ts-openapi-codegen 2.0.0-beta.9 → 2.0.0
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/README.md +88 -18
- package/README.rus.md +88 -21
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.js +5 -0
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -1
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.js +20 -8
- package/dist/cli/index.js +5 -3
- package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -1
- package/dist/cli/previewChanges/previewChanges.js +116 -32
- package/dist/cli/previewChanges/utils/updateOutputPaths.d.ts.map +1 -1
- package/dist/cli/previewChanges/utils/updateOutputPaths.js +6 -0
- package/dist/common/Consts.d.ts.map +1 -1
- package/dist/common/Consts.js +4 -1
- package/dist/common/LoggerMessages.d.ts +1 -0
- package/dist/common/LoggerMessages.d.ts.map +1 -1
- package/dist/common/LoggerMessages.js +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +14 -4
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +2 -2
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +2 -2
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +2 -2
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts +42 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.js +38 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +155 -28
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +13 -17
- package/dist/common/VersionedSchema/CommonSchemas.d.ts +12 -4
- package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/CommonSchemas.js +15 -7
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +2 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +2 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +2 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +2 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +2 -2
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +19 -0
- package/dist/common/VersionedSchema/Utils/__tests__/allUtils.test.d.ts +2 -0
- package/dist/common/VersionedSchema/Utils/__tests__/allUtils.test.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/__tests__/allUtils.test.js +185 -0
- package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.js +20 -3
- package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +19 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +4 -0
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.js +68 -23
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts +1 -1
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.js +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +10 -0
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +33 -15
- package/dist/common/utils/__tests__/convertArrayToObject.test.js +64 -169
- package/dist/common/utils/convertArrayToObject.d.ts.map +1 -1
- package/dist/common/utils/convertArrayToObject.js +51 -14
- package/dist/core/OpenApiClient.d.ts.map +1 -1
- package/dist/core/OpenApiClient.js +12 -1
- package/dist/core/WriteClient.d.ts +8 -1
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +48 -7
- package/dist/core/__tests__/WriteClient.test.js +2 -0
- package/dist/core/api/v2/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getType.js +2 -1
- package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getType.js +2 -1
- package/dist/core/types/base/Templates.model.d.ts +1 -1
- package/dist/core/types/base/Templates.model.d.ts.map +1 -1
- package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts +6 -0
- package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts.map +1 -0
- package/dist/core/types/enums/EmptySchemaStrategy.enum.js +9 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.d.ts +2 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.js +27 -0
- package/dist/core/utils/__tests__/modelHelpers.test.d.ts +2 -0
- package/dist/core/utils/__tests__/modelHelpers.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/modelHelpers.test.js +151 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts +2 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.js +67 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts +2 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.js +26 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.d.ts +2 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.js +22 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.d.ts +2 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.js +121 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts +2 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.js +20 -0
- package/dist/core/utils/__tests__/writeClientSchemas.test.js +2 -0
- package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
- package/dist/core/utils/getOpenApiSpec.js +14 -1
- package/dist/core/utils/getRelativeModelPath.d.ts +9 -0
- package/dist/core/utils/getRelativeModelPath.d.ts.map +1 -0
- package/dist/core/utils/getRelativeModelPath.js +37 -0
- package/dist/core/utils/modelHelpers.d.ts.map +1 -1
- package/dist/core/utils/modelHelpers.js +37 -3
- package/dist/core/utils/postProcessModelImports.d.ts.map +1 -1
- package/dist/core/utils/postProcessModelImports.js +14 -1
- package/dist/core/utils/postProcessServiceImports.d.ts.map +1 -1
- package/dist/core/utils/postProcessServiceImports.js +1 -2
- package/dist/core/utils/precompileTemplates.js +1 -0
- package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarHelpers.js +25 -0
- package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.js +42 -41
- package/dist/core/utils/resolveRefPath.d.ts.map +1 -1
- package/dist/core/utils/resolveRefPath.js +1 -4
- package/dist/core/utils/writeClientExecutor.d.ts +4 -1
- package/dist/core/utils/writeClientExecutor.d.ts.map +1 -1
- package/dist/core/utils/writeClientExecutor.js +17 -2
- package/dist/core/utils/writeClientSchemas.d.ts +4 -1
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.js +11 -2
- package/dist/templatesCompiled/client/core/ApiError.js +1 -1
- package/dist/templatesCompiled/client/core/ApiResult.js +1 -1
- package/dist/templatesCompiled/client/core/axios/request.js +3 -3
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts +2 -0
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts.map +1 -1
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.js +13 -8
- package/dist/templatesCompiled/client/core/executor/requestExecutor.js +1 -1
- package/dist/templatesCompiled/client/core/fetch/request.js +3 -3
- package/dist/templatesCompiled/client/core/functions/catchErrors.js +1 -1
- package/dist/templatesCompiled/client/core/interceptors/withInterceptors.js +1 -1
- package/dist/templatesCompiled/client/core/node/request.js +3 -3
- package/dist/templatesCompiled/client/core/xhr/request.js +3 -3
- package/dist/templatesCompiled/client/exportClient.d.ts +4 -0
- package/dist/templatesCompiled/client/exportClient.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportClient.js +51 -13
- package/dist/templatesCompiled/client/exportSchema.d.ts +5 -1
- package/dist/templatesCompiled/client/exportSchema.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportSchema.js +37 -7
- package/dist/templatesCompiled/client/exportService.d.ts +2 -0
- package/dist/templatesCompiled/client/exportService.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportService.js +70 -30
- package/dist/templatesCompiled/client/indexFull.d.ts +1 -0
- package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexFull.js +4 -1
- package/dist/templatesCompiled/client/indexSimple.d.ts +1 -0
- package/dist/templatesCompiled/client/indexSimple.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexSimple.js +4 -1
- package/dist/templatesCompiled/client/joi/exportSchema.js +5 -5
- package/dist/templatesCompiled/client/joi/partials/joiSchema.js +7 -7
- package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.js +4 -4
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts +5 -3
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.js +39 -12
- package/dist/templatesCompiled/client/jsonschema/exportSchema.js +5 -5
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.js +7 -7
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.js +5 -5
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.js +2 -2
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.js +5 -5
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts +3 -1
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.js +45 -15
- package/dist/templatesCompiled/client/yup/exportSchema.js +3 -3
- package/dist/templatesCompiled/client/yup/partials/yupSchema.js +7 -7
- package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.js +4 -4
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts +5 -3
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.js +39 -12
- package/dist/templatesCompiled/client/zod/exportSchema.js +3 -3
- package/dist/templatesCompiled/client/zod/partials/zodSchema.js +7 -7
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts +5 -6
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.js +14 -28
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts +3 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.js +32 -8
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts +3 -4
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.js +9 -23
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts +4 -2
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.js +18 -7
- package/package.json +2 -2
- package/dist/common/defaultOptions.d.ts +0 -3
- package/dist/common/defaultOptions.d.ts.map +0 -1
- package/dist/common/defaultOptions.js +0 -28
- package/dist/core/utils/advancedDeduplicatePath.d.ts +0 -5
- package/dist/core/utils/advancedDeduplicatePath.d.ts.map +0 -1
- package/dist/core/utils/advancedDeduplicatePath.js +0 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createExecutorAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/templatesCompiled/client/core/executor/createExecutorAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createExecutorAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/templatesCompiled/client/core/executor/createExecutorAdapter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,wBA6BmC"}
|
|
@@ -9,11 +9,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
10
10
|
return "import type { ApiRequestOptions } from '../ApiRequestOptions';\nimport type { TOpenAPIConfig } from '../OpenAPI';\nimport { OpenAPI } from '../OpenAPI';\n";
|
|
11
11
|
}, "3": function (container, depth0, helpers, partials, data) {
|
|
12
|
-
return "
|
|
12
|
+
return "import { request as __request } from '../request';\n";
|
|
13
13
|
}, "5": function (container, depth0, helpers, partials, data) {
|
|
14
|
-
return "
|
|
14
|
+
return "import { request as __request, requestRaw as __requestRaw } from '../request';\n";
|
|
15
15
|
}, "7": function (container, depth0, helpers, partials, data) {
|
|
16
|
-
return "
|
|
16
|
+
return " openApiConfig: TOpenAPIConfig = OpenAPI,\n mapOptions?: (options: TRequestOptions | undefined) => Partial<ApiRequestOptions>,\n";
|
|
17
|
+
}, "9": function (container, depth0, helpers, partials, data) {
|
|
18
|
+
return " requestRaw<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<ApiResult<TResponse>> {\n return __request(config, options) as Promise<ApiResult<TResponse>>;\n },\n request<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<TResponse> {\n return __request(config, options) as Promise<TResponse>;\n },\n";
|
|
19
|
+
}, "11": function (container, depth0, helpers, partials, data) {
|
|
20
|
+
return " requestRaw<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<ApiResult<TResponse>> {\n const baseOptions: ApiRequestOptions = {\n method: config.method as ApiRequestOptions['method'],\n path: config.path,\n headers: config.headers,\n query: config.query,\n body: config.body,\n cookies: config.cookies,\n mediaType: config.requestMediaType,\n };\n\n const mergedOptions: ApiRequestOptions = {\n ...baseOptions,\n ...(mapOptions ? mapOptions(options) : {}),\n };\n\n return __requestRaw<TResponse>(mergedOptions, openApiConfig);\n },\n request<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<TResponse> {\n const baseOptions: ApiRequestOptions = {\n method: config.method as ApiRequestOptions['method'],\n path: config.path,\n headers: config.headers,\n query: config.query,\n body: config.body,\n cookies: config.cookies,\n mediaType: config.requestMediaType,\n };\n\n const mergedOptions: ApiRequestOptions = {\n ...baseOptions,\n ...(mapOptions ? mapOptions(options) : {}),\n };\n\n return __request<TResponse>(mergedOptions, openApiConfig);\n },\n";
|
|
17
21
|
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
18
22
|
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
19
23
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -22,11 +26,12 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
22
26
|
return undefined;
|
|
23
27
|
};
|
|
24
28
|
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
25
|
-
+ "\nimport type { RequestExecutor, RequestConfig } from './requestExecutor';\n"
|
|
26
|
-
+ ((stack1 = lookupProperty(helpers, "unless").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "unless", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line":
|
|
27
|
-
+ "
|
|
28
|
-
+
|
|
29
|
+
+ "\nimport type { ApiResult } from '../ApiResult';\nimport type { RequestExecutor, RequestConfig } from './requestExecutor';\n"
|
|
30
|
+
+ ((stack1 = lookupProperty(helpers, "unless").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "unless", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 9, "column": 11 } } })) != null ? stack1 : "")
|
|
31
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.program(5, data, 0), "data": data, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 14, "column": 7 } } })) != null ? stack1 : "")
|
|
32
|
+
+ "\nexport function createExecutorAdapter<TRequestOptions extends Record<string, any>>(\n"
|
|
33
|
+
+ ((stack1 = lookupProperty(helpers, "unless").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "unless", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 20, "column": 11 } } })) != null ? stack1 : "")
|
|
29
34
|
+ "): RequestExecutor<TRequestOptions> {\n return {\n"
|
|
30
|
-
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "if", "hash": {}, "fn": container.program(
|
|
35
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "if", "hash": {}, "fn": container.program(9, data, 0), "inverse": container.program(11, data, 0), "data": data, "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 67, "column": 15 } } })) != null ? stack1 : "")
|
|
31
36
|
+ " };\n}\n";
|
|
32
37
|
}, "usePartial": true, "useData": true };
|
|
@@ -14,5 +14,5 @@ exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, de
|
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
16
|
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
17
|
-
+ "\nexport interface RequestConfig {\n method: string;\n path: string;\n\n headers?: Record<string, string>;\n query?: Record<string, any>;\n body?: unknown;\n\n requestMediaType?: string;\n cookies?: Record<string, string>;\n}\n\nexport interface RequestExecutor<TOptions = unknown> {\n request<TResponse>(\n config: RequestConfig,\n options?: TOptions\n ): Promise<TResponse>;\n}";
|
|
17
|
+
+ "\nimport type { ApiResult } from '../ApiResult';\n\nexport interface RequestConfig {\n method: string;\n path: string;\n\n headers?: Record<string, string>;\n query?: Record<string, any>;\n body?: unknown;\n\n requestMediaType?: string;\n cookies?: Record<string, string>;\n}\n\nexport interface RequestExecutor<TOptions = unknown> {\n request<TResponse>(\n config: RequestConfig,\n options?: TOptions\n ): Promise<TResponse>;\n\n requestRaw<TResponse>(\n config: RequestConfig,\n options?: TOptions\n ): Promise<ApiResult<TResponse>>;\n}\n";
|
|
18
18
|
}, "usePartial": true, "useData": true };
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
10
10
|
return "import { CancelablePromise } from './CancelablePromise';\n";
|
|
11
11
|
}, "3": function (container, depth0, helpers, partials, data) {
|
|
12
|
-
return "export function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: responseHeader || responseBody,\n };\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
12
|
+
return "export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async(resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
13
13
|
}, "5": function (container, depth0, helpers, partials, data) {
|
|
14
|
-
return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: responseHeader || responseBody,\n };\n\n catchErrors(options, result);\n resolve(result
|
|
14
|
+
return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
15
15
|
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
16
16
|
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
17
17
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -51,5 +51,5 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
51
51
|
+ "\n\n"
|
|
52
52
|
+ ((stack1 = container.invokePartial(lookupProperty(partials, "functions/catchErrors"), depth0, { "name": "functions/catchErrors", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
53
53
|
+ "\n\n/**\n * Request using fetch client\n * @param config The OpenAPI configuration object\n * @param options The request options from the the service\n * @returns ApiResult\n * @throws ApiError\n */\n"
|
|
54
|
-
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.program(5, data, 0), "data": data, "loc": { "start": { "line": 61, "column": 0 }, "end": { "line":
|
|
54
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.program(5, data, 0), "data": data, "loc": { "start": { "line": 61, "column": 0 }, "end": { "line": 140, "column": 7 } } })) != null ? stack1 : "");
|
|
55
55
|
}, "usePartial": true, "useData": true };
|
|
@@ -7,5 +7,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
/* eslint: disable */
|
|
8
8
|
// @ts-nocheck
|
|
9
9
|
exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
10
|
-
return "function catchErrors(options: ApiRequestOptions, result: ApiResult): void {\n const errors: Record<string, string> = {\n [EHTTP_STATUS_CODES.BAD_GATEWAY]: EHTTP_STATUS_NAME.BAD_GATEWAY,\n [EHTTP_STATUS_CODES.BAD_REQUEST]: EHTTP_STATUS_NAME.BAD_REQUEST,\n [EHTTP_STATUS_CODES.FORBIDDEN]: EHTTP_STATUS_NAME.FORBIDDEN,\n [EHTTP_STATUS_CODES.INTERNAL_SERVER_ERROR]: EHTTP_STATUS_NAME.INTERNAL_SERVER_ERROR,\n [EHTTP_STATUS_CODES.NOT_FOUND]: EHTTP_STATUS_NAME.NOT_FOUND,\n [EHTTP_STATUS_CODES.SERVICE_UNAVAILABLE]: EHTTP_STATUS_NAME.SERVICE_UNAVAILABLE,\n [EHTTP_STATUS_CODES.UNAUTHORIZED]: EHTTP_STATUS_NAME.UNAUTHORIZED,\n ...options.errors,\n }\n\n const error = errors[result.status];\n if (error) {\n throw new ApiError(result
|
|
10
|
+
return "function catchErrors(options: ApiRequestOptions, result: ApiResult<unknown>): void {\n const errors: Record<string, string> = {\n [EHTTP_STATUS_CODES.BAD_GATEWAY]: EHTTP_STATUS_NAME.BAD_GATEWAY,\n [EHTTP_STATUS_CODES.BAD_REQUEST]: EHTTP_STATUS_NAME.BAD_REQUEST,\n [EHTTP_STATUS_CODES.FORBIDDEN]: EHTTP_STATUS_NAME.FORBIDDEN,\n [EHTTP_STATUS_CODES.INTERNAL_SERVER_ERROR]: EHTTP_STATUS_NAME.INTERNAL_SERVER_ERROR,\n [EHTTP_STATUS_CODES.NOT_FOUND]: EHTTP_STATUS_NAME.NOT_FOUND,\n [EHTTP_STATUS_CODES.SERVICE_UNAVAILABLE]: EHTTP_STATUS_NAME.SERVICE_UNAVAILABLE,\n [EHTTP_STATUS_CODES.UNAUTHORIZED]: EHTTP_STATUS_NAME.UNAUTHORIZED,\n ...options.errors,\n }\n\n const error = errors[result.status];\n if (error) {\n throw new ApiError({\n message: result.statusText,\n status: result.status,\n request: options,\n });\n }\n\n if (!result.ok) {\n throw new ApiError({\n message: 'Generic Error',\n status: result.status,\n request: options,\n });\n }\n}\n";
|
|
11
11
|
}, "useData": true };
|
|
@@ -14,5 +14,5 @@ exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, de
|
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
16
|
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
17
|
-
+ "\nimport { RequestInterceptor, ResponseInterceptor, ErrorInterceptor } from './interceptors';\nimport { RequestConfig, RequestExecutor } from '../executor/requestExecutor';\n\nexport function withInterceptors<TOptions extends Record<string, any> = Record<string, never>>(\n executor: RequestExecutor<TOptions>,\n interceptors: {\n onRequest?: RequestInterceptor[];\n onResponse?: ResponseInterceptor[];\n onError?: ErrorInterceptor[];\n }\n): RequestExecutor<TOptions> {\n
|
|
17
|
+
+ "\nimport type { ApiResult } from '../ApiResult';\nimport { RequestInterceptor, ResponseInterceptor, ErrorInterceptor } from './interceptors';\nimport { RequestConfig, RequestExecutor } from '../executor/requestExecutor';\n\nexport function withInterceptors<TOptions extends Record<string, any> = Record<string, never>>(\n executor: RequestExecutor<TOptions>,\n interceptors: {\n onRequest?: RequestInterceptor[];\n onResponse?: ResponseInterceptor[];\n onError?: ErrorInterceptor[];\n }\n): RequestExecutor<TOptions> {\n const runRequestInterceptors = async (config: RequestConfig): Promise<RequestConfig> => {\n let currentConfig = config;\n\n for (const interceptor of interceptors.onRequest ?? []) {\n currentConfig = await interceptor(currentConfig);\n }\n\n return currentConfig;\n };\n\n const runResponseInterceptors = async <TResponse>(\n response: TResponse,\n config: RequestConfig\n ): Promise<TResponse> => {\n let currentResponse = response;\n\n for (const interceptor of interceptors.onResponse ?? []) {\n currentResponse = (await interceptor(currentResponse, config)) as TResponse;\n }\n\n return currentResponse;\n };\n\n return {\n async request<TResponse>(config: RequestConfig, options?: TOptions): Promise<TResponse> {\n try {\n const currentConfig = await runRequestInterceptors(config);\n const response = await executor.request<TResponse>(currentConfig, options);\n\n return runResponseInterceptors(response, currentConfig);\n } catch (caught) {\n let error = caught;\n const currentConfig = config;\n\n for (const interceptor of interceptors.onError ?? []) {\n error = await interceptor(error, currentConfig);\n }\n\n throw error;\n }\n },\n async requestRaw<TResponse>(config: RequestConfig, options?: TOptions): Promise<ApiResult<TResponse>> {\n try {\n const currentConfig = await runRequestInterceptors(config);\n const response = await executor.requestRaw<TResponse>(currentConfig, options);\n\n return runResponseInterceptors(response, currentConfig);\n } catch (caught) {\n let error = caught;\n const currentConfig = config;\n\n for (const interceptor of interceptors.onError ?? []) {\n error = await interceptor(error, currentConfig);\n }\n\n throw error;\n }\n },\n };\n}\n";
|
|
18
18
|
}, "usePartial": true, "useData": true };
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
10
10
|
return "import { CancelablePromise } from './CancelablePromise';\n";
|
|
11
11
|
}, "3": function (container, depth0, helpers, partials, data) {
|
|
12
|
-
return "export function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: responseHeader || responseBody,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
12
|
+
return "export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
13
13
|
}, "5": function (container, depth0, helpers, partials, data) {
|
|
14
|
-
return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: responseHeader || responseBody,\n };\n\n catchErrors(options, result);\n resolve(result
|
|
14
|
+
return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = await getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
15
15
|
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
16
16
|
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
17
17
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -51,5 +51,5 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
51
51
|
+ "\n\n"
|
|
52
52
|
+ ((stack1 = container.invokePartial(lookupProperty(partials, "functions/catchErrors"), depth0, { "name": "functions/catchErrors", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
53
53
|
+ "\n\n/**\n * Request using node-fetch client\n * @param config The OpenAPI configuration object\n * @param options The request options from the the service\n * @returns ApiResult\n * @throws ApiError\n */\n"
|
|
54
|
-
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.program(5, data, 0), "data": data, "loc": { "start": { "line": 66, "column": 0 }, "end": { "line":
|
|
54
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.program(5, data, 0), "data": data, "loc": { "start": { "line": 66, "column": 0 }, "end": { "line": 147, "column": 7 } } })) != null ? stack1 : "");
|
|
55
55
|
}, "usePartial": true, "useData": true };
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
10
10
|
return "import { CancelablePromise } from './CancelablePromise';\n";
|
|
11
11
|
}, "3": function (container, depth0, helpers, partials, data) {
|
|
12
|
-
return "export function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: responseHeader || responseBody,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
12
|
+
return "export function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<ApiResult<T>> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n\nexport function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const url = getUrl(options, config);\n\n if (!onCancel.isCancelled) {\n const response = await sendRequest(options, url, config, onCancel);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n }\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
13
13
|
}, "5": function (container, depth0, helpers, partials, data) {
|
|
14
|
-
return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: responseHeader || responseBody,\n };\n\n catchErrors(options, result);\n resolve(result
|
|
14
|
+
return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n const result = await requestRaw<T>(options, config);\n return result.body;\n}\n\nexport async function requestRaw<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<ApiResult<T>> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult<T> = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: (responseHeader || responseBody) as T,\n };\n\n catchErrors(options, result);\n resolve(result);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
15
15
|
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
16
16
|
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
17
17
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -53,5 +53,5 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
53
53
|
+ "\n\n"
|
|
54
54
|
+ ((stack1 = container.invokePartial(lookupProperty(partials, "functions/catchErrors"), depth0, { "name": "functions/catchErrors", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
55
55
|
+ "\n\n/**\n * Request using XHR client\n * @param config The OpenAPI configuration object\n * @param options The request options from the the service\n * @returns ApiResult\n * @throws ApiError\n */\n"
|
|
56
|
-
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.program(5, data, 0), "data": data, "loc": { "start": { "line": 64, "column": 0 }, "end": { "line":
|
|
56
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.program(5, data, 0), "data": data, "loc": { "start": { "line": 64, "column": 0 }, "end": { "line": 145, "column": 7 } } })) != null ? stack1 : "");
|
|
57
57
|
}, "usePartial": true, "useData": true };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
3
3
|
"3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
+
"5": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
5
|
+
"6": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
6
|
+
"8": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
7
|
+
"10": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
8
|
compiler: (string | number)[];
|
|
5
9
|
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
6
10
|
usePartial: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportClient.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/client/exportClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exportClient.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/client/exportClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,wBAwFmC"}
|
|
@@ -7,13 +7,45 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
/* eslint: disable */
|
|
8
8
|
// @ts-nocheck
|
|
9
9
|
exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
10
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
12
|
+
return parent[propertyName];
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
};
|
|
16
|
+
return "import { createExecutorAdapter as createCustomExecutorAdapter } from '"
|
|
17
|
+
+ ((stack1 = container.lambda(container.strict(lookupProperty(data, "root"), "customExecutorPath", { "start": { "line": 11, "column": 73 }, "end": { "line": 11, "column": 97 } }), depth0)) != null ? stack1 : "")
|
|
18
|
+
+ "';\n";
|
|
19
|
+
}, "3": function (container, depth0, helpers, partials, data) {
|
|
10
20
|
var stack1, alias1 = container.strict, alias2 = container.lambda;
|
|
11
21
|
return "import { "
|
|
12
|
-
+ ((stack1 = alias2(alias1(depth0, "name", { "start": { "line":
|
|
22
|
+
+ ((stack1 = alias2(alias1(depth0, "name", { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 15 } }), depth0)) != null ? stack1 : "")
|
|
13
23
|
+ " } from './services/"
|
|
14
|
-
+ ((stack1 = alias2(alias1(depth0, "name", { "start": { "line":
|
|
24
|
+
+ ((stack1 = alias2(alias1(depth0, "name", { "start": { "line": 15, "column": 39 }, "end": { "line": 15, "column": 43 } }), depth0)) != null ? stack1 : "")
|
|
15
25
|
+ "';\n";
|
|
16
|
-
}, "
|
|
26
|
+
}, "5": function (container, depth0, helpers, partials, data) {
|
|
27
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
28
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
29
|
+
return parent[propertyName];
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
};
|
|
33
|
+
return " createCustomExecutorAdapter<TExecutorOptions>("
|
|
34
|
+
+ ((stack1 = lookupProperty(helpers, "unless").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "unless", "hash": {}, "fn": container.program(6, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 41, "column": 50 }, "end": { "line": 41, "column": 108 } } })) != null ? stack1 : "")
|
|
35
|
+
+ ");\n";
|
|
36
|
+
}, "6": function (container, depth0, helpers, partials, data) {
|
|
37
|
+
return "openApiConfig";
|
|
38
|
+
}, "8": function (container, depth0, helpers, partials, data) {
|
|
39
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
40
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
41
|
+
return parent[propertyName];
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
};
|
|
45
|
+
return " createExecutorAdapter<TExecutorOptions>("
|
|
46
|
+
+ ((stack1 = lookupProperty(helpers, "unless").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "unless", "hash": {}, "fn": container.program(6, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 43, "column": 44 }, "end": { "line": 43, "column": 102 } } })) != null ? stack1 : "")
|
|
47
|
+
+ ");\n";
|
|
48
|
+
}, "10": function (container, depth0, helpers, partials, data) {
|
|
17
49
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
18
50
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
19
51
|
return parent[propertyName];
|
|
@@ -21,9 +53,9 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
21
53
|
return undefined;
|
|
22
54
|
};
|
|
23
55
|
return " "
|
|
24
|
-
+ ((stack1 = lookupProperty(helpers, "camelCase").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "name"), { "name": "camelCase", "hash": {}, "data": data, "loc": { "start": { "line":
|
|
56
|
+
+ ((stack1 = lookupProperty(helpers, "camelCase").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "name"), { "name": "camelCase", "hash": {}, "data": data, "loc": { "start": { "line": 59, "column": 4 }, "end": { "line": 59, "column": 22 } } })) != null ? stack1 : "")
|
|
25
57
|
+ ": new "
|
|
26
|
-
+ ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line":
|
|
58
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line": 59, "column": 30 }, "end": { "line": 59, "column": 34 } }), depth0)) != null ? stack1 : "")
|
|
27
59
|
+ "(executor),\n";
|
|
28
60
|
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
29
61
|
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
@@ -39,15 +71,21 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
39
71
|
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "OpenAPI", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 4, "column": 37 }, "end": { "line": 4, "column": 78 } } })) != null ? stack1 : "")
|
|
40
72
|
+ "';\nimport { createExecutorAdapter } from '"
|
|
41
73
|
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./executor/createExecutorAdapter", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 5, "column": 39 }, "end": { "line": 5, "column": 105 } } })) != null ? stack1 : "")
|
|
42
|
-
+ "';\nimport {
|
|
43
|
-
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./
|
|
74
|
+
+ "';\nimport type { RequestExecutor } from '"
|
|
75
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./executor/requestExecutor", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 6, "column": 38 }, "end": { "line": 6, "column": 98 } } })) != null ? stack1 : "")
|
|
76
|
+
+ "';\nimport type { RequestInterceptor, ResponseInterceptor, ErrorInterceptor } from '"
|
|
77
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./interceptors/interceptors", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 7, "column": 80 }, "end": { "line": 7, "column": 141 } } })) != null ? stack1 : "")
|
|
44
78
|
+ "';\nimport { withInterceptors } from '"
|
|
45
|
-
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./interceptors/withInterceptors", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line":
|
|
79
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./interceptors/withInterceptors", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 8, "column": 34 }, "end": { "line": 8, "column": 99 } } })) != null ? stack1 : "")
|
|
46
80
|
+ "';\nimport { apiErrorInterceptor } from '"
|
|
47
|
-
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./interceptors/apiErrorInterceptor", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line":
|
|
48
|
-
+ "';\n
|
|
49
|
-
+ ((stack1 = lookupProperty(helpers, "
|
|
50
|
-
+ "\
|
|
51
|
-
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "services"), { "name": "each", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line":
|
|
81
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./interceptors/apiErrorInterceptor", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 9, "column": 37 }, "end": { "line": 9, "column": 105 } } })) != null ? stack1 : "")
|
|
82
|
+
+ "';\n"
|
|
83
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "customExecutorPath"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 12, "column": 7 } } })) != null ? stack1 : "")
|
|
84
|
+
+ "\n"
|
|
85
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "services"), { "name": "each", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 9 } } })) != null ? stack1 : "")
|
|
86
|
+
+ "\nexport interface ClientOptions {\n openApi?: Partial<TOpenAPIConfig>;\n interceptors?: {\n onRequest?: RequestInterceptor[];\n onResponse?: ResponseInterceptor[];\n onError?: ErrorInterceptor[];\n };\n executorFactory?: <TExecutorOptions extends Record<string, any>>(params: {\n openApiConfig: TOpenAPIConfig;\n createDefaultExecutor: () => RequestExecutor<TExecutorOptions>;\n }) => RequestExecutor<TExecutorOptions>;\n}\n\nexport function createClient<TExecutorOptions extends Record<string, any>>(\n options: ClientOptions = {},\n) {\n const openApiConfig: TOpenAPIConfig = {\n ...OpenAPI,\n ...options.openApi,\n };\n\n const createDefaultExecutor = (): RequestExecutor<TExecutorOptions> =>\n"
|
|
87
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "customExecutorPath"), { "name": "if", "hash": {}, "fn": container.program(5, data, 0), "inverse": container.program(8, data, 0), "data": data, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 44, "column": 11 } } })) != null ? stack1 : "")
|
|
88
|
+
+ "\n let executor = options.executorFactory\n ? options.executorFactory<TExecutorOptions>({ openApiConfig, createDefaultExecutor })\n : createDefaultExecutor();\n if (options?.interceptors) {\n executor = withInterceptors(executor, {\n onError: [apiErrorInterceptor, ...(options.interceptors?.onError ?? [])],\n onRequest: options.interceptors?.onRequest,\n onResponse: options.interceptors?.onResponse,\n });\n }\n\n return {\n"
|
|
89
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "services"), { "name": "each", "hash": {}, "fn": container.program(10, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 58, "column": 4 }, "end": { "line": 60, "column": 13 } } })) != null ? stack1 : "")
|
|
52
90
|
+ " };\n}\n";
|
|
53
91
|
}, "usePartial": true, "useData": true };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
"1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
3
|
+
"3": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
4
|
+
"5": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
5
|
+
"7": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
2
6
|
compiler: (string | number)[];
|
|
3
|
-
main: (container: any, depth0: any, helpers: any, partials: any, data: any) =>
|
|
7
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
4
8
|
usePartial: boolean;
|
|
5
9
|
useData: boolean;
|
|
6
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportSchema.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/client/exportSchema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exportSchema.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/client/exportSchema.ts"],"names":[],"mappings":";;;;;;;;;;AAMA,wBAgDmC"}
|
|
@@ -6,17 +6,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
/* tslint: disable */
|
|
7
7
|
/* eslint: disable */
|
|
8
8
|
// @ts-nocheck
|
|
9
|
-
exports.default = { "
|
|
9
|
+
exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
10
10
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
11
11
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
12
12
|
return parent[propertyName];
|
|
13
13
|
}
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
|
-
return ((stack1 = container.invokePartial(lookupProperty(partials, "
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
return ((stack1 = container.invokePartial(lookupProperty(partials, "zod/exportSchema"), depth0, { "name": "zod/exportSchema", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "");
|
|
17
|
+
}, "3": function (container, depth0, helpers, partials, data) {
|
|
18
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
20
|
+
return parent[propertyName];
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
};
|
|
24
|
+
return ((stack1 = container.invokePartial(lookupProperty(partials, "joi/exportSchema"), depth0, { "name": "joi/exportSchema", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "");
|
|
25
|
+
}, "5": function (container, depth0, helpers, partials, data) {
|
|
26
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
28
|
+
return parent[propertyName];
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
};
|
|
32
|
+
return ((stack1 = container.invokePartial(lookupProperty(partials, "yup/exportSchema"), depth0, { "name": "yup/exportSchema", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "");
|
|
33
|
+
}, "7": function (container, depth0, helpers, partials, data) {
|
|
34
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
36
|
+
return parent[propertyName];
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
};
|
|
40
|
+
return ((stack1 = container.invokePartial(lookupProperty(partials, "jsonschema/exportSchema"), depth0, { "name": "jsonschema/exportSchema", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "");
|
|
41
|
+
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
42
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
43
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
44
|
+
return parent[propertyName];
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
};
|
|
48
|
+
return ((stack1 = lookupProperty(helpers, "equals").call(alias1, lookupProperty(lookupProperty(data, "root"), "validationLibrary"), "zod", { "name": "equals", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 75 } } })) != null ? stack1 : "")
|
|
49
|
+
+ ((stack1 = lookupProperty(helpers, "equals").call(alias1, lookupProperty(lookupProperty(data, "root"), "validationLibrary"), "joi", { "name": "equals", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 75 } } })) != null ? stack1 : "")
|
|
50
|
+
+ ((stack1 = lookupProperty(helpers, "equals").call(alias1, lookupProperty(lookupProperty(data, "root"), "validationLibrary"), "yup", { "name": "equals", "hash": {}, "fn": container.program(5, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 75 } } })) != null ? stack1 : "")
|
|
51
|
+
+ ((stack1 = lookupProperty(helpers, "equals").call(alias1, lookupProperty(lookupProperty(data, "root"), "validationLibrary"), "jsonschema", { "name": "equals", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 89 } } })) != null ? stack1 : "");
|
|
22
52
|
}, "usePartial": true, "useData": true };
|
|
@@ -16,6 +16,8 @@ declare const _default: {
|
|
|
16
16
|
"24": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
17
17
|
"26": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
18
18
|
"28": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
19
|
+
"30": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
20
|
+
"32": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
19
21
|
compiler: (string | number)[];
|
|
20
22
|
main: (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
|
|
21
23
|
usePartial: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportService.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/client/exportService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exportService.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/client/exportService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBA2PoD"}
|