@goast/kotlin 0.6.0-beta.1 → 0.6.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +45 -45
- package/assets/client/okhttp3/ApiAbstractions.kt +30 -30
- package/assets/client/okhttp3/ApiClient.kt +252 -252
- package/assets/client/okhttp3/ApiResponse.kt +43 -43
- package/assets/client/okhttp3/Errors.kt +21 -21
- package/assets/client/okhttp3/PartConfig.kt +11 -11
- package/assets/client/okhttp3/RequestConfig.kt +18 -18
- package/assets/client/okhttp3/RequestMethod.kt +8 -8
- package/assets/client/okhttp3/ResponseExtensions.kt +24 -24
- package/assets/client/spring-reactive-web-clients/ApiRequestFile.kt +33 -33
- package/esm/src/ast/references/jackson.d.ts +8 -0
- package/esm/src/ast/references/jackson.d.ts.map +1 -1
- package/esm/src/ast/references/jackson.js +8 -0
- package/esm/src/generators/file-generator.d.ts +21 -1
- package/esm/src/generators/file-generator.d.ts.map +1 -1
- package/esm/src/generators/file-generator.js +41 -2
- package/esm/src/generators/models/args.d.ts +5 -0
- package/esm/src/generators/models/args.d.ts.map +1 -1
- package/esm/src/generators/models/model-generator.d.ts +23 -0
- package/esm/src/generators/models/model-generator.d.ts.map +1 -1
- package/esm/src/generators/models/model-generator.js +130 -13
- package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts +9 -0
- package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts.map +1 -1
- package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +59 -41
- package/esm/src/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts.map +1 -1
- package/esm/src/generators/services/okhttp3-clients/okhttp3-clients-generator.js +11 -9
- package/esm/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -1
- package/esm/src/generators/services/spring-controllers/spring-controller-generator.js +53 -35
- package/esm/src/generators/services/spring-reactive-web-clients/args.d.ts +3 -0
- package/esm/src/generators/services/spring-reactive-web-clients/args.d.ts.map +1 -1
- package/esm/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts +7 -0
- package/esm/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts.map +1 -1
- package/esm/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.js +41 -20
- package/esm/src/import-collection.d.ts.map +1 -1
- package/esm/src/import-collection.js +2 -2
- package/esm/src/utils.d.ts +3 -1
- package/esm/src/utils.d.ts.map +1 -1
- package/esm/src/utils.js +7 -0
- package/package.json +2 -2
- package/script/src/ast/references/jackson.d.ts +8 -0
- package/script/src/ast/references/jackson.d.ts.map +1 -1
- package/script/src/ast/references/jackson.js +9 -1
- package/script/src/generators/file-generator.d.ts +21 -1
- package/script/src/generators/file-generator.d.ts.map +1 -1
- package/script/src/generators/file-generator.js +41 -2
- package/script/src/generators/models/args.d.ts +5 -0
- package/script/src/generators/models/args.d.ts.map +1 -1
- package/script/src/generators/models/model-generator.d.ts +23 -0
- package/script/src/generators/models/model-generator.d.ts.map +1 -1
- package/script/src/generators/models/model-generator.js +129 -12
- package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts +9 -0
- package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts.map +1 -1
- package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +58 -40
- package/script/src/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts.map +1 -1
- package/script/src/generators/services/okhttp3-clients/okhttp3-clients-generator.js +11 -9
- package/script/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -1
- package/script/src/generators/services/spring-controllers/spring-controller-generator.js +52 -34
- package/script/src/generators/services/spring-reactive-web-clients/args.d.ts +3 -0
- package/script/src/generators/services/spring-reactive-web-clients/args.d.ts.map +1 -1
- package/script/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts +7 -0
- package/script/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts.map +1 -1
- package/script/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.js +40 -19
- package/script/src/import-collection.d.ts.map +1 -1
- package/script/src/import-collection.js +1 -1
- package/script/src/utils.d.ts +3 -1
- package/script/src/utils.d.ts.map +1 -1
- package/script/src/utils.js +9 -0
package/script/src/utils.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { ApiComponent, Nullable } from '@goast/core';
|
|
1
|
+
import type { ApiComponent, ApiSchema, Nullable } from '@goast/core';
|
|
2
2
|
export declare function toKotlinStringLiteral(value: Nullable<string>): string;
|
|
3
3
|
export declare function toKotlinPropertyName(value: string): string;
|
|
4
4
|
export declare function modifyString<TArgs extends unknown[]>(value: string, modifier: string | RegExp | ((value: string, ...args: TArgs) => string) | undefined, ...args: TArgs): string;
|
|
5
5
|
export declare function getSourceDocLine<T>(component: ApiComponent<T>): string;
|
|
6
|
+
export declare function getStringEnumSchema(schema: Nullable<ApiSchema>): ApiSchema<'string'> | undefined;
|
|
7
|
+
export declare function getArrayItemStringEnumSchema(schema: Nullable<ApiSchema>): ApiSchema<'string'> | undefined;
|
|
6
8
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIrE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAWrE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED,wBAAgB,YAAY,CAAC,KAAK,SAAS,OAAO,EAAE,EAClD,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC,GAAG,SAAS,EACnF,GAAG,IAAI,EAAE,KAAK,GACb,MAAM,CAYR;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,CAItE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,SAAS,CAEhG;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,SAAS,CAEzG"}
|
package/script/src/utils.js
CHANGED
|
@@ -4,6 +4,8 @@ exports.toKotlinStringLiteral = toKotlinStringLiteral;
|
|
|
4
4
|
exports.toKotlinPropertyName = toKotlinPropertyName;
|
|
5
5
|
exports.modifyString = modifyString;
|
|
6
6
|
exports.getSourceDocLine = getSourceDocLine;
|
|
7
|
+
exports.getStringEnumSchema = getStringEnumSchema;
|
|
8
|
+
exports.getArrayItemStringEnumSchema = getArrayItemStringEnumSchema;
|
|
7
9
|
const tslib_1 = require("tslib");
|
|
8
10
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
9
11
|
const node_process_1 = tslib_1.__importDefault(require("node:process"));
|
|
@@ -43,3 +45,10 @@ function getSourceDocLine(component) {
|
|
|
43
45
|
const { line, col } = component.$src.pos;
|
|
44
46
|
return `Source: ${file}:${line}:${col} (${component.$src.path})`;
|
|
45
47
|
}
|
|
48
|
+
function getStringEnumSchema(schema) {
|
|
49
|
+
var _a;
|
|
50
|
+
return (schema === null || schema === void 0 ? void 0 : schema.kind) === 'string' && ((_a = schema.enum) === null || _a === void 0 ? void 0 : _a.length) ? schema : undefined;
|
|
51
|
+
}
|
|
52
|
+
function getArrayItemStringEnumSchema(schema) {
|
|
53
|
+
return (schema === null || schema === void 0 ? void 0 : schema.kind) === 'array' ? getStringEnumSchema(schema.items) : undefined;
|
|
54
|
+
}
|