Skip to content

Commit fa8c905

Browse files
committed
feat: init java client
1 parent 10a7009 commit fa8c905

424 files changed

Lines changed: 40021 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
17 Bytes
Binary file not shown.
1 Byte
Binary file not shown.
17 Bytes
Binary file not shown.

.gradle/8.7/gc.properties

Whitespace-only changes.

.gradle/vcs-1/gc.properties

Whitespace-only changes.

api/openapi.yaml

Lines changed: 5542 additions & 0 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
apply plugin: 'idea'
2+
apply plugin: 'eclipse'
3+
4+
group = 'co.permify'
5+
version = '0.0.1'
6+
7+
buildscript {
8+
repositories {
9+
mavenCentral()
10+
}
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:2.3.+'
13+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
14+
}
15+
}
16+
17+
repositories {
18+
mavenCentral()
19+
}
20+
21+
if(hasProperty('target') && target == 'android') {
22+
23+
apply plugin: 'com.android.library'
24+
apply plugin: 'com.github.dcendents.android-maven'
25+
26+
android {
27+
compileSdkVersion 25
28+
buildToolsVersion '25.0.2'
29+
defaultConfig {
30+
minSdkVersion 14
31+
targetSdkVersion 25
32+
}
33+
34+
compileOptions {
35+
sourceCompatibility JavaVersion.VERSION_1_8
36+
targetCompatibility JavaVersion.VERSION_1_8
37+
}
38+
39+
// Rename the aar correctly
40+
libraryVariants.all { variant ->
41+
variant.outputs.each { output ->
42+
def outputFile = output.outputFile
43+
if (outputFile != null && outputFile.name.endsWith('.aar')) {
44+
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
45+
output.outputFile = new File(outputFile.parent, fileName)
46+
}
47+
}
48+
}
49+
50+
dependencies {
51+
provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
52+
}
53+
}
54+
55+
afterEvaluate {
56+
android.libraryVariants.all { variant ->
57+
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
58+
task.description = "Create jar artifact for ${variant.name}"
59+
task.dependsOn variant.javaCompile
60+
task.from variant.javaCompile.destinationDirectory
61+
task.destinationDirectory = project.file("${project.buildDir}/outputs/jar")
62+
task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar"
63+
artifacts.add('archives', task);
64+
}
65+
}
66+
67+
task sourcesJar(type: Jar) {
68+
from android.sourceSets.main.java.srcDirs
69+
archiveClassifier = 'sources'
70+
}
71+
72+
artifacts {
73+
archives sourcesJar
74+
}
75+
76+
} else {
77+
78+
apply plugin: 'java'
79+
apply plugin: 'maven-publish'
80+
81+
sourceCompatibility = JavaVersion.VERSION_1_8
82+
targetCompatibility = JavaVersion.VERSION_1_8
83+
84+
publishing {
85+
repositories {
86+
maven {
87+
name = "GitHubPackages"
88+
url = "https://maven.pkg.github.com/permify/permify-java"
89+
credentials {
90+
username = System.getenv("GITHUB_ACTOR")
91+
password = System.getenv("GITHUB_TOKEN")
92+
}
93+
}
94+
}
95+
publications {
96+
maven(MavenPublication) {
97+
artifactId = 'permify'
98+
from components.java
99+
}
100+
}
101+
}
102+
103+
task execute(type:JavaExec) {
104+
mainClass = System.getProperty('mainClass')
105+
classpath = sourceSets.main.runtimeClasspath
106+
}
107+
108+
task sourcesJar(type: Jar, dependsOn: classes) {
109+
archiveClassifier = 'sources'
110+
from sourceSets.main.allSource
111+
}
112+
113+
task javadocJar(type: Jar, dependsOn: javadoc) {
114+
archiveClassifier = 'javadoc'
115+
from javadoc.destinationDir
116+
}
117+
118+
artifacts {
119+
archives sourcesJar
120+
archives javadocJar
121+
}
122+
}
123+
124+
ext {
125+
spring_boot_version = "2.7.17"
126+
jakarta_annotation_version = "1.3.5"
127+
reactor_version = "3.4.34"
128+
reactor_netty_version = "1.0.39"
129+
jackson_version = "2.17.1"
130+
jackson_databind_version = "2.17.1"
131+
jackson_databind_nullable_version = "0.2.6"
132+
junit_version = "5.10.2"
133+
}
134+
135+
dependencies {
136+
implementation "com.google.code.findbugs:jsr305:3.0.2"
137+
implementation "io.projectreactor:reactor-core:$reactor_version"
138+
implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version"
139+
implementation "io.projectreactor.netty:reactor-netty-http:$reactor_netty_version"
140+
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
141+
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
142+
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
143+
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
144+
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
145+
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
146+
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
147+
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
148+
}

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# TODO

docs/AbstractType.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
# AbstractType
4+
5+
Application defined abstract type.
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**name** | **String** | The fully qualified name of this abstract type. | [optional] |
12+
|**parameterTypes** | [**List<V1alpha1Type>**](V1alpha1Type.md) | Parameter types for this abstract type. | [optional] |
13+
14+
15+

docs/Any.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
# Any
4+
5+
`Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } // or ... if (any.isSameTypeAs(Foo.getDefaultInstance())) { foo = any.unpack(Foo.getDefaultInstance()); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... } The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example \"foo.bar.com/x/y.z\" will yield type name \"y.z\". JSON ==== The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { \"@type\": \"type.googleapis.com/google.profile.Person\", \"firstName\": <string>, \"lastName\": <string> } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]): { \"@type\": \"type.googleapis.com/google.protobuf.Duration\", \"value\": \"1.212s\" }
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**atType** | **String** | A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \&quot;/\&quot; character. The last segment of the URL&#39;s path must represent the fully qualified name of the type (as in &#x60;path/google.protobuf.Duration&#x60;). The name should be in a canonical form (e.g., leading \&quot;.\&quot; is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme &#x60;http&#x60;, &#x60;https&#x60;, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, &#x60;https&#x60; is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. As of May 2023, there are no widely used type server implementations and no plans to implement one. Schemes other than &#x60;http&#x60;, &#x60;https&#x60; (or the empty scheme) might be used with implementation specific semantics. | [optional] |
12+
13+
14+

0 commit comments

Comments
 (0)