@rxap/open-api 19.2.0-dev.4 → 19.3.0-dev.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/CHANGELOG.md +10 -0
- package/compodoc/changelog.html +7 -0
- package/compodoc/dependencies.html +6 -6
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/variables.html +146 -0
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +842 -566
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/OpenApiConfigService.html +3 -3
- package/docs/html/classes/OpenApiHttpResponseError.html +4 -4
- package/docs/html/classes/RxapOpenApiError.html +5 -5
- package/docs/html/classes/SchemaValidationMixin.html +5 -5
- package/docs/html/functions/AssertOpenApiV3.html +1 -1
- package/docs/html/functions/IsOpenApiV3.html +1 -1
- package/docs/html/functions/IsReferenceObject.html +1 -1
- package/docs/html/functions/NotContainsReferenceObjects.html +1 -1
- package/docs/html/functions/OpenApiInit.html +1 -1
- package/docs/html/functions/injectOpenApiBaseUrlHttpInterceptorFn.html +1 -0
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/OpenApiInitOptions.html +3 -3
- package/docs/html/interfaces/OpenApiMetaData.html +5 -5
- package/docs/html/interfaces/OperationObjectWithMetadata.html +2 -2
- package/docs/html/interfaces/SchemaValidationResponse.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/OperationMap.html +1 -1
- package/docs/html/variables/DEFAULT_OPEN_API_DATA_SOURCE_META_DATA.html +1 -1
- package/docs/html/variables/DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA.html +1 -1
- package/docs/html/variables/DISABLE_SCHEMA_VALIDATION.html +1 -1
- package/docs/html/variables/DISABLE_VALIDATION.html +1 -1
- package/docs/html/variables/OPEN_API_OPERATION.html +1 -0
- package/docs/html/variables/OPEN_API_OPERATION_ID.html +1 -0
- package/docs/html/variables/OPEN_API_SERVER_ID.html +1 -0
- package/docs/html/variables/OPEN_API_SERVER_INDEX.html +1 -0
- package/docs/html/variables/RXAP_OPEN_API_CONFIG.html +1 -1
- package/docs/html/variables/RXAP_OPEN_API_STRICT_VALIDATOR.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/OpenApiConfigService.md +14 -14
- package/docs/markdown/classes/OpenApiHttpResponseError.md +7 -7
- package/docs/markdown/classes/RxapOpenApiError.md +13 -13
- package/docs/markdown/classes/SchemaValidationMixin.md +13 -13
- package/docs/markdown/functions/AssertOpenApiV3.md +2 -2
- package/docs/markdown/functions/IsOpenApiV3.md +2 -2
- package/docs/markdown/functions/IsReferenceObject.md +2 -2
- package/docs/markdown/functions/NotContainsReferenceObjects.md +2 -2
- package/docs/markdown/functions/OpenApiInit.md +2 -2
- package/docs/markdown/functions/injectOpenApiBaseUrlHttpInterceptorFn.md +25 -0
- package/docs/markdown/globals.md +7 -2
- package/docs/markdown/interfaces/OpenApiInitOptions.md +4 -4
- package/docs/markdown/interfaces/OpenApiMetaData.md +7 -7
- package/docs/markdown/interfaces/OperationObjectWithMetadata.md +4 -4
- package/docs/markdown/interfaces/SchemaValidationResponse.md +6 -6
- package/docs/markdown/type-aliases/OperationMap.md +2 -2
- package/docs/markdown/variables/DEFAULT_OPEN_API_DATA_SOURCE_META_DATA.md +2 -2
- package/docs/markdown/variables/DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA.md +2 -2
- package/docs/markdown/variables/DISABLE_SCHEMA_VALIDATION.md +2 -2
- package/docs/markdown/variables/DISABLE_VALIDATION.md +2 -2
- package/docs/markdown/variables/OPEN_API_OPERATION.md +11 -0
- package/docs/markdown/variables/OPEN_API_OPERATION_ID.md +11 -0
- package/docs/markdown/variables/OPEN_API_SERVER_ID.md +11 -0
- package/docs/markdown/variables/OPEN_API_SERVER_INDEX.md +11 -0
- package/docs/markdown/variables/RXAP_OPEN_API_CONFIG.md +2 -2
- package/docs/markdown/variables/RXAP_OPEN_API_STRICT_VALIDATOR.md +2 -2
- package/docs/wiki/Class.OpenApiConfigService.md +13 -13
- package/docs/wiki/Class.OpenApiHttpResponseError.md +6 -6
- package/docs/wiki/Class.RxapOpenApiError.md +12 -12
- package/docs/wiki/Class.SchemaValidationMixin.md +12 -12
- package/docs/wiki/Function.AssertOpenApiV3.md +1 -1
- package/docs/wiki/Function.IsOpenApiV3.md +1 -1
- package/docs/wiki/Function.IsReferenceObject.md +1 -1
- package/docs/wiki/Function.NotContainsReferenceObjects.md +1 -1
- package/docs/wiki/Function.OpenApiInit.md +1 -1
- package/docs/wiki/Function.injectOpenApiBaseUrlHttpInterceptorFn.md +21 -0
- package/docs/wiki/Interface.OpenApiInitOptions.md +3 -3
- package/docs/wiki/Interface.OpenApiMetaData.md +6 -6
- package/docs/wiki/Interface.OperationObjectWithMetadata.md +3 -3
- package/docs/wiki/Interface.SchemaValidationResponse.md +5 -5
- package/docs/wiki/TypeAlias.OperationMap.md +1 -1
- package/docs/wiki/Variable.DEFAULT_OPEN_API_DATA_SOURCE_META_DATA.md +1 -1
- package/docs/wiki/Variable.DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA.md +1 -1
- package/docs/wiki/Variable.DISABLE_SCHEMA_VALIDATION.md +1 -1
- package/docs/wiki/Variable.DISABLE_VALIDATION.md +1 -1
- package/docs/wiki/Variable.OPEN_API_OPERATION.md +7 -0
- package/docs/wiki/Variable.OPEN_API_OPERATION_ID.md +7 -0
- package/docs/wiki/Variable.OPEN_API_SERVER_ID.md +7 -0
- package/docs/wiki/Variable.OPEN_API_SERVER_INDEX.md +7 -0
- package/docs/wiki/Variable.RXAP_OPEN_API_CONFIG.md +1 -1
- package/docs/wiki/Variable.RXAP_OPEN_API_STRICT_VALIDATOR.md +1 -1
- package/docs/wiki/_Sidebar.md +5 -0
- package/docs/wiki/globals.md +6 -1
- package/fesm2022/rxap-open-api-http-resource.mjs +8 -16
- package/fesm2022/rxap-open-api-http-resource.mjs.map +1 -1
- package/fesm2022/rxap-open-api-remote-method.mjs +6 -2
- package/fesm2022/rxap-open-api-remote-method.mjs.map +1 -1
- package/fesm2022/rxap-open-api.mjs +26 -3
- package/fesm2022/rxap-open-api.mjs.map +1 -1
- package/http-resource/lib/http-context-tokens.d.ts +4 -4
- package/http-resource/lib/http-interceptors.d.ts +4 -2
- package/index.d.ts +2 -0
- package/lib/http-context-tokens.d.ts +5 -0
- package/lib/http-interceptors.d.ts +2 -0
- package/package.json +26 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-open-api-http-resource.mjs","sources":["../../../../../packages/angular/open-api/http-resource/src/lib/http-context-tokens.ts","../../../../../packages/angular/open-api/http-resource/src/lib/http-interceptors.ts","../../../../../packages/angular/open-api/http-resource/src/lib/to-http-headers.ts","../../../../../packages/angular/open-api/http-resource/src/lib/to-http-params.ts","../../../../../packages/angular/open-api/http-resource/src/index.ts","../../../../../packages/angular/open-api/http-resource/src/rxap-open-api-http-resource.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"rxap-open-api-http-resource.mjs","sources":["../../../../../packages/angular/open-api/http-resource/src/lib/http-context-tokens.ts","../../../../../packages/angular/open-api/http-resource/src/lib/http-interceptors.ts","../../../../../packages/angular/open-api/http-resource/src/lib/to-http-headers.ts","../../../../../packages/angular/open-api/http-resource/src/lib/to-http-params.ts","../../../../../packages/angular/open-api/http-resource/src/index.ts","../../../../../packages/angular/open-api/http-resource/src/rxap-open-api-http-resource.ts"],"sourcesContent":["/**\n * @deprecated use the @rxap/open-api package\n */\nexport {\n OPEN_API_OPERATION_ID,\n OPEN_API_SERVER_ID,\n} from '@rxap/open-api';\n","/**\n * @deprecated use the @rxap/open-api package\n */\nexport {\n injectOpenApiBaseUrlHttpInterceptorFn,\n} from '@rxap/open-api';\n","import { HttpResourceRequest } from '@angular/common/http';\nimport { Signal } from '@angular/core';\n\nexport function toHttpHeaders<T extends Record<string, Signal<unknown>>>(\n record: T | undefined | null,\n include: Array<keyof T> = []\n): HttpResourceRequest['headers'] | undefined {\n if (!record) {\n return undefined;\n }\n return Object.entries(record as Record<string, Signal<any>>)\n .filter(([key]) => include.includes(key))\n .reduce(\n (acc, [key, signal]: [string, Signal<any>]) => ({\n ...acc,\n [key]: signal(),\n }),\n {} as Record<\n string,\n string | ReadonlyArray<string>\n >\n );\n}\n","import { HttpResourceRequest } from '@angular/common/http';\nimport { Signal } from '@angular/core';\n\nexport function toHttpParams<T extends Record<string, Signal<unknown>>>(\n record: T | undefined | null,\n include: Array<keyof T> = []\n): HttpResourceRequest['params'] | undefined {\n if (!record) {\n return undefined;\n }\n return Object.entries(record as Record<string, Signal<any>>)\n .filter(([key]) => include.includes(key))\n .reduce(\n (acc, [key, signal]: [string, Signal<any>]) => ({\n ...acc,\n [key]: encodeURIComponent(signal()),\n }),\n {} as Record<\n string,\n string | number | boolean | ReadonlyArray<string | number | boolean>\n >\n );\n}\n","// region \nexport * from './lib/http-context-tokens';\nexport * from './lib/http-interceptors';\nexport * from './lib/to-http-headers';\nexport * from './lib/to-http-params';\nexport * from './lib/types';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;AAEG;;ACFH;;AAEG;;SCCa,aAAa,CAC3B,MAA4B,EAC5B,UAA0B,EAAE,EAAA;IAE5B,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,SAAS;;AAElB,IAAA,OAAO,MAAM,CAAC,OAAO,CAAC,MAAqC;AACxD,SAAA,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;AACvC,SAAA,MAAM,CACL,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,CAAwB,MAAM;AAC9C,QAAA,GAAG,GAAG;AACN,QAAA,CAAC,GAAG,GAAG,MAAM,EAAE;KAChB,CAAC,EACF,EAGC,CACF;AACL;;SCnBgB,YAAY,CAC1B,MAA4B,EAC5B,UAA0B,EAAE,EAAA;IAE5B,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,SAAS;;AAElB,IAAA,OAAO,MAAM,CAAC,OAAO,CAAC,MAAqC;AACxD,SAAA,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;AACvC,SAAA,MAAM,CACL,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,CAAwB,MAAM;AAC9C,QAAA,GAAG,GAAG;AACN,QAAA,CAAC,GAAG,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;KACpC,CAAC,EACF,EAGC,CACF;AACL;;ACtBA;AAMA;;ACNA;;AAEG;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i2 from '@rxap/open-api';
|
|
2
|
-
import { RxapOpenApiError, OpenApiHttpResponseError, OpenApiConfigService, DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA, RXAP_OPEN_API_STRICT_VALIDATOR, DISABLE_SCHEMA_VALIDATION, DISABLE_VALIDATION, SchemaValidationMixin } from '@rxap/open-api';
|
|
2
|
+
import { RxapOpenApiError, OPEN_API_OPERATION_ID, OPEN_API_SERVER_ID, OPEN_API_SERVER_INDEX, OpenApiHttpResponseError, OpenApiConfigService, DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA, RXAP_OPEN_API_STRICT_VALIDATOR, DISABLE_SCHEMA_VALIDATION, DISABLE_VALIDATION, SchemaValidationMixin } from '@rxap/open-api';
|
|
3
3
|
import { BaseRemoteMethod, RxapRemoteMethod } from '@rxap/remote-method';
|
|
4
4
|
import { coerceString } from '@rxap/utilities';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
6
|
import { isDevMode, Injector, Injectable, Inject, Optional } from '@angular/core';
|
|
7
7
|
import * as i1 from '@angular/common/http';
|
|
8
|
-
import { HttpErrorResponse, HttpEventType, HttpClient } from '@angular/common/http';
|
|
8
|
+
import { HttpContext, HttpErrorResponse, HttpEventType, HttpClient } from '@angular/common/http';
|
|
9
9
|
import { __decorate, __metadata } from 'tslib';
|
|
10
10
|
import { Mixin } from '@rxap/mixin';
|
|
11
11
|
import { BaseHttpRemoteMethod } from '@rxap/remote-method/http';
|
|
@@ -116,6 +116,10 @@ let OpenApiRemoteMethod = class OpenApiRemoteMethod extends BaseHttpRemoteMethod
|
|
|
116
116
|
method: operation.method,
|
|
117
117
|
withCredentials: this.metadata.withCredentials ?? true,
|
|
118
118
|
ignoreUndefined: this.metadata['ignoreUndefined'] ?? true,
|
|
119
|
+
context: new HttpContext()
|
|
120
|
+
.set(OPEN_API_OPERATION_ID, operation.operationId)
|
|
121
|
+
.set(OPEN_API_SERVER_ID, this.metadata['serverId'])
|
|
122
|
+
.set(OPEN_API_SERVER_INDEX, this.metadata['serverIndex'])
|
|
119
123
|
});
|
|
120
124
|
this.strict = strict || this.metadata['strict'] || false;
|
|
121
125
|
this.disableSchemaValidation = disableSchemaValidation || this.metadata['disableSchemaValidation'] || false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-open-api-remote-method.mjs","sources":["../../../../../packages/angular/open-api/remote-method/src/lib/error.ts","../../../../../packages/angular/open-api/remote-method/src/lib/get-page-adapter.factory.ts","../../../../../packages/angular/open-api/remote-method/src/lib/open-api.remote-method.ts","../../../../../packages/angular/open-api/remote-method/src/lib/open-api-remote-method.loader.ts","../../../../../packages/angular/open-api/remote-method/src/index.ts","../../../../../packages/angular/open-api/remote-method/src/rxap-open-api-remote-method.ts"],"sourcesContent":["import { RxapOpenApiError } from '@rxap/open-api';\n\nexport class RxapOpenApiRemoteMethodError extends RxapOpenApiError {\n\n constructor(message: string, code?: string, scope?: string) {\n super(message, code, scope);\n this.addSubPackageName('remote-method');\n }\n\n}\n","import { BaseRemoteMethod } from '@rxap/remote-method';\nimport { TableEvent } from '@rxap/data-source/table';\nimport { coerceString } from '@rxap/utilities';\nimport type { OpenApiRemoteMethod } from './open-api.remote-method';\nimport { PaginatorLike } from '@rxap/data-source/pagination';\n\nexport interface GetPageRemoteMethodParameters {\n pageIndex: number;\n pageSize: number;\n sortBy?: string;\n sortDirection?: 'desc' | 'asc' | undefined | '' | string;\n filter: string[];\n}\n\nexport interface GetPageResponse<Data extends Record<string, any>> {\n total: number;\n rows: Data[];\n [key: string]: any;\n}\n\nexport interface GetPageAdapterDefaultOptions {\n sortBy?: string;\n sortDirection?: 'asc' | 'desc' | string;\n}\n\nexport class GetPageAdapterRemoteMethod<Data extends Record<string, any>>\n extends BaseRemoteMethod<Data[], TableEvent> {\n\n constructor(\n private readonly remoteMethod: OpenApiRemoteMethod<GetPageResponse<Data>, GetPageRemoteMethodParameters>,\n private readonly paginator?: PaginatorLike,\n private readonly options?: GetPageAdapterDefaultOptions,\n ) {\n super(null, remoteMethod.metadata);\n }\n\n public static BuildFilter(filterEvent?: string | Record<string, any> | null): string[] {\n const filter: string[] = [];\n if (filterEvent && typeof filterEvent !== 'string') {\n for (const [ key, value ] of Object.entries(filterEvent)) {\n if (value !== null && value !== undefined && `${ value }` !== '') {\n const valueString = coerceString(value);\n if (valueString) {\n filter.push([ key, valueString ].join('|'));\n }\n }\n }\n }\n return filter;\n }\n\n protected async _call(event: TableEvent): Promise<Data[]> {\n const parameters: GetPageRemoteMethodParameters = {\n pageIndex: event.page?.pageIndex ?? 0,\n pageSize: event.page?.pageSize ?? 10,\n sortBy: event.sort?.active ?? this.options?.sortBy ?? undefined,\n // use the || operator to set the default sort direction if the sort direction is undefined or an empty string\n sortDirection: event.sort?.direction ?? this.options?.sortDirection ?? undefined,\n filter: GetPageAdapterRemoteMethod.BuildFilter(event.filter),\n ...(event.parameters ?? {}),\n };\n const response = await this.remoteMethod.call({ parameters });\n\n if (event.setTotalLength) {\n event.setTotalLength(response.total);\n }\n\n if (this.paginator) {\n this.paginator.length = response.total;\n }\n\n return response.rows;\n }\n\n}\n\nexport function GetPageAdapterFactory(remoteMethod: OpenApiRemoteMethod, paginator?: PaginatorLike) {\n return new GetPageAdapterRemoteMethod(remoteMethod, paginator);\n}\n\nexport function GetPageAdapterFactoryWithOptions(options: GetPageAdapterDefaultOptions = {}) {\n return (remoteMethod: OpenApiRemoteMethod, paginator?: PaginatorLike) => {\n return new GetPageAdapterRemoteMethod(remoteMethod, paginator, options);\n };\n}\n","import { HttpClient, HttpErrorResponse, HttpEventType, HttpResponse } from '@angular/common/http';\nimport {\n Inject,\n Injectable,\n Injector,\n isDevMode,\n Optional,\n} from '@angular/core';\nimport { Mixin } from '@rxap/mixin';\nimport {\n DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA,\n DISABLE_SCHEMA_VALIDATION,\n DISABLE_VALIDATION,\n OpenApiConfigService,\n OpenApiHttpResponseError,\n OpenApiMetaData,\n OperationObjectWithMetadata,\n RXAP_OPEN_API_STRICT_VALIDATOR,\n SchemaValidationMixin,\n} from '@rxap/open-api';\nimport { RxapRemoteMethod } from '@rxap/remote-method';\nimport { BaseHttpRemoteMethod } from '@rxap/remote-method/http';\nimport { firstValueFrom } from 'rxjs';\nimport {\n filter,\n retry,\n take,\n tap,\n timeout,\n} from 'rxjs/operators';\n\nexport interface OperationForMetadata {\n operation: OperationObjectWithMetadata;\n /**\n * used to specify the target server for the reset api operation\n */\n serverId?: string;\n /**\n * the fallback id used if the operation does not have a operationId\n */\n fallbackId?: string;\n}\n\nexport interface OperationFromMetadataInline {\n operationId: string;\n operation: string;\n /**\n * used to specify the target server for the reset api operation\n */\n serverId?: string;\n}\n\nexport function IsOperationFromMetadataInline(metadata: OperationForMetadata | OperationFromMetadataInline): metadata is OperationFromMetadataInline {\n return typeof metadata.operation === 'string';\n}\n\nexport function RxapOpenApiRemoteMethod(\n operationOrId: string | OperationForMetadata | OperationFromMetadataInline,\n serverIndex = 0,\n) {\n return function (target: any) {\n const id = typeof operationOrId === 'string' ?\n operationOrId :\n (IsOperationFromMetadataInline(operationOrId) ?\n operationOrId.operationId :\n operationOrId.operation.operationId ?? operationOrId.fallbackId);\n if (!id) {\n throw new Error('The operationId for the open api remote method is not defined');\n }\n const metadata: OpenApiRemoteMethodMetadata = {\n id,\n serverIndex,\n };\n if (typeof operationOrId !== 'string') {\n metadata.operation = operationOrId.operation;\n metadata.serverId = operationOrId.serverId;\n }\n RxapRemoteMethod(metadata)(target);\n };\n}\n\nexport type OpenApiRemoteMethodMetadata = OpenApiMetaData\n\nexport interface OpenApiRemoteMethodParameter<Parameters extends Record<string, any> | void = any, RequestBody = any> {\n parameters?: Parameters,\n requestBody?: RequestBody\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface OpenApiRemoteMethod<Response = any, Parameters extends Record<string, any> | void = any, RequestBody = any>\n extends SchemaValidationMixin<Response, Parameters, RequestBody> {\n}\n\n@Mixin(SchemaValidationMixin)\n@Injectable()\nexport class OpenApiRemoteMethod<Response = any, Parameters extends Record<string, any> | void = any, RequestBody = any>\n extends BaseHttpRemoteMethod<Response, any, OpenApiRemoteMethodParameter<Parameters, RequestBody>> {\n\n protected readonly disableSchemaValidation: boolean = false;\n protected readonly disableValidation: boolean = false;\n private readonly strict: boolean = false;\n\n constructor(\n @Inject(HttpClient) http: HttpClient,\n @Inject(Injector) injector: Injector,\n @Inject(OpenApiConfigService) openApiConfigService: OpenApiConfigService,\n @Optional()\n @Inject(DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA)\n metadata: OpenApiRemoteMethodMetadata | null = null,\n @Optional()\n @Inject(RXAP_OPEN_API_STRICT_VALIDATOR)\n strict: boolean | null = null,\n @Optional()\n @Inject(DISABLE_SCHEMA_VALIDATION)\n disableSchemaValidation: boolean | null = null,\n @Optional()\n @Inject(DISABLE_VALIDATION)\n disableValidation: boolean | null = null,\n ) {\n super(http, injector, metadata);\n this.metadata['operation'] ??= openApiConfigService.getOperation(this.metadata.id);\n if (typeof this.metadata['operation'] === 'string') {\n try {\n this.metadata['operation'] = JSON.parse(this.metadata['operation']);\n } catch (e: any) {\n throw new Error(`could not parse the remote method operation string into an object: ${ this.constructor.name }`);\n }\n }\n const operation: OperationObjectWithMetadata & { serverId?: string } = this.metadata['operation'];\n this.applyMetadata({\n id: operation.operationId,\n url: () => openApiConfigService.getBaseUrl(this.metadata['serverIndex'], this.metadata['serverId']) +\n operation.path,\n method: operation.method as any,\n withCredentials: this.metadata.withCredentials ?? true,\n ignoreUndefined: this.metadata['ignoreUndefined'] ?? true,\n });\n this.strict = strict || this.metadata['strict'] || false;\n this.disableSchemaValidation = disableSchemaValidation || this.metadata['disableSchemaValidation'] || false;\n this.disableValidation = disableValidation || this.metadata['disableValidation'] || false;\n }\n\n public get operation(): OperationObjectWithMetadata {\n return this.metadata['operation'];\n }\n\n /**\n * Instead of returning the response body the full response object is returned\n */\n public async callWithResponse(args: OpenApiRemoteMethodParameter<Parameters, RequestBody> = {}): Promise<HttpResponse<Response>> {\n this.init();\n this.executionsInProgress$.increase();\n const result = await this._callWithResponse(args);\n this.executionsInProgress$.decrease();\n if (result.body) {\n this.executed$.next(result.body);\n this.executed(result.body);\n }\n return result;\n }\n\n // TODO : update to the new call method concept (the remove of the _call method concept)\n public _callWithResponse(args: OpenApiRemoteMethodParameter<Parameters, RequestBody> = {}): Promise<HttpResponse<Response>> {\n\n if (!this.disableValidation) {\n this.validateParameters(this.operation, args.parameters, this.strict);\n this.validateRequestBody(this.operation, args.requestBody, this.strict);\n }\n\n return firstValueFrom(this.http.request<Response>(this.updateRequest(this.buildHttpOptions(\n this.operation,\n args.parameters,\n args.requestBody,\n this.metadata['ignoreUndefined'],\n ))).pipe(\n retry(this.metadata.retry ?? 0),\n tap({\n error: (error) => {\n if (error instanceof HttpErrorResponse) {\n this.interceptors?.forEach(interceptor => interceptor\n .next({\n response: error,\n parameters: args.parameters,\n requestBody: args.requestBody,\n }),\n );\n }\n },\n }),\n filter((event: any) => event.type === HttpEventType.Response),\n tap((response: HttpResponse<Response>) => {\n if (!this.disableValidation) {\n this.validateResponse(this.operation, response, this.strict);\n }\n }),\n tap((response: HttpResponse<Response>) => {\n this.interceptors?.forEach(interceptor => interceptor\n .next({\n response,\n parameters: args.parameters,\n requestBody: args.requestBody,\n }),\n );\n }),\n take(1),\n timeout(this.timeout),\n ));\n\n }\n\n protected async _call(args: OpenApiRemoteMethodParameter<Parameters, RequestBody> = {}): Promise<Response> {\n\n if (!this.disableValidation) {\n this.validateParameters(this.operation, args.parameters, this.strict);\n this.validateRequestBody(this.operation, args.requestBody, this.strict);\n }\n\n let response: HttpResponse<Response>;\n\n try {\n response = await this._callWithResponse(args);\n } catch (error: any) {\n if (error instanceof HttpErrorResponse) {\n throw new OpenApiHttpResponseError(\n error,\n this.metadata,\n );\n } else {\n throw error;\n }\n }\n\n if (response.body) {\n return response.body;\n }\n\n if (isDevMode()) {\n console.warn('The response body is empty!');\n }\n return null as any;\n }\n\n}\n","import {\n Inject,\n Injectable,\n Injector,\n} from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { OpenApiRemoteMethod } from './open-api.remote-method';\nimport { OpenApiConfigService } from '@rxap/open-api';\n\n@Injectable({ providedIn: 'root' })\nexport class OpenApiRemoteMethodLoader {\n\n constructor(\n @Inject(OpenApiConfigService) public readonly openApiConfig: OpenApiConfigService,\n @Inject(HttpClient) public readonly http: HttpClient,\n public readonly injector: Injector,\n ) {\n }\n\n public load(definitionId: string): OpenApiRemoteMethod | null {\n const operation = this.openApiConfig.getOperation(definitionId);\n\n if (operation) {\n\n return new OpenApiRemoteMethod(\n this.http,\n this.injector,\n this.openApiConfig,\n {\n id: definitionId,\n operation,\n },\n );\n\n }\n\n return null;\n\n }\n\n}\n","// region \nexport * from './lib/error';\nexport * from './lib/get-page-adapter.factory';\nexport * from './lib/open-api-remote-method.loader';\nexport * from './lib/open-api.remote-method';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAEM,MAAO,4BAA6B,SAAQ,gBAAgB,CAAA;AAEhE,IAAA,WAAA,CAAY,OAAe,EAAE,IAAa,EAAE,KAA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"rxap-open-api-remote-method.mjs","sources":["../../../../../packages/angular/open-api/remote-method/src/lib/error.ts","../../../../../packages/angular/open-api/remote-method/src/lib/get-page-adapter.factory.ts","../../../../../packages/angular/open-api/remote-method/src/lib/open-api.remote-method.ts","../../../../../packages/angular/open-api/remote-method/src/lib/open-api-remote-method.loader.ts","../../../../../packages/angular/open-api/remote-method/src/index.ts","../../../../../packages/angular/open-api/remote-method/src/rxap-open-api-remote-method.ts"],"sourcesContent":["import { RxapOpenApiError } from '@rxap/open-api';\n\nexport class RxapOpenApiRemoteMethodError extends RxapOpenApiError {\n\n constructor(message: string, code?: string, scope?: string) {\n super(message, code, scope);\n this.addSubPackageName('remote-method');\n }\n\n}\n","import { BaseRemoteMethod } from '@rxap/remote-method';\nimport { TableEvent } from '@rxap/data-source/table';\nimport { coerceString } from '@rxap/utilities';\nimport type { OpenApiRemoteMethod } from './open-api.remote-method';\nimport { PaginatorLike } from '@rxap/data-source/pagination';\n\nexport interface GetPageRemoteMethodParameters {\n pageIndex: number;\n pageSize: number;\n sortBy?: string;\n sortDirection?: 'desc' | 'asc' | undefined | '' | string;\n filter: string[];\n}\n\nexport interface GetPageResponse<Data extends Record<string, any>> {\n total: number;\n rows: Data[];\n [key: string]: any;\n}\n\nexport interface GetPageAdapterDefaultOptions {\n sortBy?: string;\n sortDirection?: 'asc' | 'desc' | string;\n}\n\nexport class GetPageAdapterRemoteMethod<Data extends Record<string, any>>\n extends BaseRemoteMethod<Data[], TableEvent> {\n\n constructor(\n private readonly remoteMethod: OpenApiRemoteMethod<GetPageResponse<Data>, GetPageRemoteMethodParameters>,\n private readonly paginator?: PaginatorLike,\n private readonly options?: GetPageAdapterDefaultOptions,\n ) {\n super(null, remoteMethod.metadata);\n }\n\n public static BuildFilter(filterEvent?: string | Record<string, any> | null): string[] {\n const filter: string[] = [];\n if (filterEvent && typeof filterEvent !== 'string') {\n for (const [ key, value ] of Object.entries(filterEvent)) {\n if (value !== null && value !== undefined && `${ value }` !== '') {\n const valueString = coerceString(value);\n if (valueString) {\n filter.push([ key, valueString ].join('|'));\n }\n }\n }\n }\n return filter;\n }\n\n protected async _call(event: TableEvent): Promise<Data[]> {\n const parameters: GetPageRemoteMethodParameters = {\n pageIndex: event.page?.pageIndex ?? 0,\n pageSize: event.page?.pageSize ?? 10,\n sortBy: event.sort?.active ?? this.options?.sortBy ?? undefined,\n // use the || operator to set the default sort direction if the sort direction is undefined or an empty string\n sortDirection: event.sort?.direction ?? this.options?.sortDirection ?? undefined,\n filter: GetPageAdapterRemoteMethod.BuildFilter(event.filter),\n ...(event.parameters ?? {}),\n };\n const response = await this.remoteMethod.call({ parameters });\n\n if (event.setTotalLength) {\n event.setTotalLength(response.total);\n }\n\n if (this.paginator) {\n this.paginator.length = response.total;\n }\n\n return response.rows;\n }\n\n}\n\nexport function GetPageAdapterFactory(remoteMethod: OpenApiRemoteMethod, paginator?: PaginatorLike) {\n return new GetPageAdapterRemoteMethod(remoteMethod, paginator);\n}\n\nexport function GetPageAdapterFactoryWithOptions(options: GetPageAdapterDefaultOptions = {}) {\n return (remoteMethod: OpenApiRemoteMethod, paginator?: PaginatorLike) => {\n return new GetPageAdapterRemoteMethod(remoteMethod, paginator, options);\n };\n}\n","import {\n HttpClient,\n HttpContext,\n HttpErrorResponse,\n HttpEventType,\n HttpResponse,\n} from '@angular/common/http';\nimport {\n Inject,\n Injectable,\n Injector,\n isDevMode,\n Optional,\n} from '@angular/core';\nimport { Mixin } from '@rxap/mixin';\nimport {\n DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA,\n DISABLE_SCHEMA_VALIDATION,\n DISABLE_VALIDATION,\n OPEN_API_SERVER_INDEX,\n OpenApiConfigService,\n OpenApiHttpResponseError,\n OpenApiMetaData,\n OperationObjectWithMetadata,\n RXAP_OPEN_API_STRICT_VALIDATOR,\n SchemaValidationMixin,\n} from '@rxap/open-api';\nimport {\n OPEN_API_OPERATION_ID,\n OPEN_API_SERVER_ID,\n} from '@rxap/open-api';\nimport { RxapRemoteMethod } from '@rxap/remote-method';\nimport { BaseHttpRemoteMethod } from '@rxap/remote-method/http';\nimport { firstValueFrom } from 'rxjs';\nimport {\n filter,\n retry,\n take,\n tap,\n timeout,\n} from 'rxjs/operators';\n\nexport interface OperationForMetadata {\n operation: OperationObjectWithMetadata;\n /**\n * used to specify the target server for the reset api operation\n */\n serverId?: string;\n /**\n * the fallback id used if the operation does not have a operationId\n */\n fallbackId?: string;\n}\n\nexport interface OperationFromMetadataInline {\n operationId: string;\n operation: string;\n /**\n * used to specify the target server for the reset api operation\n */\n serverId?: string;\n}\n\nexport function IsOperationFromMetadataInline(metadata: OperationForMetadata | OperationFromMetadataInline): metadata is OperationFromMetadataInline {\n return typeof metadata.operation === 'string';\n}\n\nexport function RxapOpenApiRemoteMethod(\n operationOrId: string | OperationForMetadata | OperationFromMetadataInline,\n serverIndex = 0,\n) {\n return function (target: any) {\n const id = typeof operationOrId === 'string' ?\n operationOrId :\n (IsOperationFromMetadataInline(operationOrId) ?\n operationOrId.operationId :\n operationOrId.operation.operationId ?? operationOrId.fallbackId);\n if (!id) {\n throw new Error('The operationId for the open api remote method is not defined');\n }\n const metadata: OpenApiRemoteMethodMetadata = {\n id,\n serverIndex,\n };\n if (typeof operationOrId !== 'string') {\n metadata.operation = operationOrId.operation;\n metadata.serverId = operationOrId.serverId;\n }\n RxapRemoteMethod(metadata)(target);\n };\n}\n\nexport type OpenApiRemoteMethodMetadata = OpenApiMetaData\n\nexport interface OpenApiRemoteMethodParameter<Parameters extends Record<string, any> | void = any, RequestBody = any> {\n parameters?: Parameters,\n requestBody?: RequestBody\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface OpenApiRemoteMethod<Response = any, Parameters extends Record<string, any> | void = any, RequestBody = any>\n extends SchemaValidationMixin<Response, Parameters, RequestBody> {\n}\n\n@Mixin(SchemaValidationMixin)\n@Injectable()\nexport class OpenApiRemoteMethod<Response = any, Parameters extends Record<string, any> | void = any, RequestBody = any>\n extends BaseHttpRemoteMethod<Response, any, OpenApiRemoteMethodParameter<Parameters, RequestBody>> {\n\n protected readonly disableSchemaValidation: boolean = false;\n protected readonly disableValidation: boolean = false;\n private readonly strict: boolean = false;\n\n constructor(\n @Inject(HttpClient) http: HttpClient,\n @Inject(Injector) injector: Injector,\n @Inject(OpenApiConfigService) openApiConfigService: OpenApiConfigService,\n @Optional()\n @Inject(DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA)\n metadata: OpenApiRemoteMethodMetadata | null = null,\n @Optional()\n @Inject(RXAP_OPEN_API_STRICT_VALIDATOR)\n strict: boolean | null = null,\n @Optional()\n @Inject(DISABLE_SCHEMA_VALIDATION)\n disableSchemaValidation: boolean | null = null,\n @Optional()\n @Inject(DISABLE_VALIDATION)\n disableValidation: boolean | null = null,\n ) {\n super(http, injector, metadata);\n this.metadata['operation'] ??= openApiConfigService.getOperation(this.metadata.id);\n if (typeof this.metadata['operation'] === 'string') {\n try {\n this.metadata['operation'] = JSON.parse(this.metadata['operation']);\n } catch (e: any) {\n throw new Error(`could not parse the remote method operation string into an object: ${ this.constructor.name }`);\n }\n }\n const operation: OperationObjectWithMetadata & { serverId?: string } = this.metadata['operation'];\n this.applyMetadata({\n id: operation.operationId,\n url: () => openApiConfigService.getBaseUrl(this.metadata['serverIndex'], this.metadata['serverId']) +\n operation.path,\n method: operation.method as any,\n withCredentials: this.metadata.withCredentials ?? true,\n ignoreUndefined: this.metadata['ignoreUndefined'] ?? true,\n context: new HttpContext()\n .set(OPEN_API_OPERATION_ID, operation.operationId)\n .set(OPEN_API_SERVER_ID, this.metadata['serverId'])\n .set(OPEN_API_SERVER_INDEX, this.metadata['serverIndex'])\n });\n this.strict = strict || this.metadata['strict'] || false;\n this.disableSchemaValidation = disableSchemaValidation || this.metadata['disableSchemaValidation'] || false;\n this.disableValidation = disableValidation || this.metadata['disableValidation'] || false;\n }\n\n public get operation(): OperationObjectWithMetadata {\n return this.metadata['operation'];\n }\n\n /**\n * Instead of returning the response body the full response object is returned\n */\n public async callWithResponse(args: OpenApiRemoteMethodParameter<Parameters, RequestBody> = {}): Promise<HttpResponse<Response>> {\n this.init();\n this.executionsInProgress$.increase();\n const result = await this._callWithResponse(args);\n this.executionsInProgress$.decrease();\n if (result.body) {\n this.executed$.next(result.body);\n this.executed(result.body);\n }\n return result;\n }\n\n // TODO : update to the new call method concept (the remove of the _call method concept)\n public _callWithResponse(args: OpenApiRemoteMethodParameter<Parameters, RequestBody> = {}): Promise<HttpResponse<Response>> {\n\n if (!this.disableValidation) {\n this.validateParameters(this.operation, args.parameters, this.strict);\n this.validateRequestBody(this.operation, args.requestBody, this.strict);\n }\n\n return firstValueFrom(this.http.request<Response>(this.updateRequest(this.buildHttpOptions(\n this.operation,\n args.parameters,\n args.requestBody,\n this.metadata['ignoreUndefined'],\n ))).pipe(\n retry(this.metadata.retry ?? 0),\n tap({\n error: (error) => {\n if (error instanceof HttpErrorResponse) {\n this.interceptors?.forEach(interceptor => interceptor\n .next({\n response: error,\n parameters: args.parameters,\n requestBody: args.requestBody,\n }),\n );\n }\n },\n }),\n filter((event: any) => event.type === HttpEventType.Response),\n tap((response: HttpResponse<Response>) => {\n if (!this.disableValidation) {\n this.validateResponse(this.operation, response, this.strict);\n }\n }),\n tap((response: HttpResponse<Response>) => {\n this.interceptors?.forEach(interceptor => interceptor\n .next({\n response,\n parameters: args.parameters,\n requestBody: args.requestBody,\n }),\n );\n }),\n take(1),\n timeout(this.timeout),\n ));\n\n }\n\n protected async _call(args: OpenApiRemoteMethodParameter<Parameters, RequestBody> = {}): Promise<Response> {\n\n if (!this.disableValidation) {\n this.validateParameters(this.operation, args.parameters, this.strict);\n this.validateRequestBody(this.operation, args.requestBody, this.strict);\n }\n\n let response: HttpResponse<Response>;\n\n try {\n response = await this._callWithResponse(args);\n } catch (error: any) {\n if (error instanceof HttpErrorResponse) {\n throw new OpenApiHttpResponseError(\n error,\n this.metadata,\n );\n } else {\n throw error;\n }\n }\n\n if (response.body) {\n return response.body;\n }\n\n if (isDevMode()) {\n console.warn('The response body is empty!');\n }\n return null as any;\n }\n\n}\n","import {\n Inject,\n Injectable,\n Injector,\n} from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { OpenApiRemoteMethod } from './open-api.remote-method';\nimport { OpenApiConfigService } from '@rxap/open-api';\n\n@Injectable({ providedIn: 'root' })\nexport class OpenApiRemoteMethodLoader {\n\n constructor(\n @Inject(OpenApiConfigService) public readonly openApiConfig: OpenApiConfigService,\n @Inject(HttpClient) public readonly http: HttpClient,\n public readonly injector: Injector,\n ) {\n }\n\n public load(definitionId: string): OpenApiRemoteMethod | null {\n const operation = this.openApiConfig.getOperation(definitionId);\n\n if (operation) {\n\n return new OpenApiRemoteMethod(\n this.http,\n this.injector,\n this.openApiConfig,\n {\n id: definitionId,\n operation,\n },\n );\n\n }\n\n return null;\n\n }\n\n}\n","// region \nexport * from './lib/error';\nexport * from './lib/get-page-adapter.factory';\nexport * from './lib/open-api-remote-method.loader';\nexport * from './lib/open-api.remote-method';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAEM,MAAO,4BAA6B,SAAQ,gBAAgB,CAAA;AAEhE,IAAA,WAAA,CAAY,OAAe,EAAE,IAAa,EAAE,KAAc,EAAA;AACxD,QAAA,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC;AAC3B,QAAA,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC;;AAG1C;;ACgBK,MAAO,0BACX,SAAQ,gBAAoC,CAAA;AAE5C,IAAA,WAAA,CACmB,YAAuF,EACvF,SAAyB,EACzB,OAAsC,EAAA;AAEvD,QAAA,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC;QAJjB,IAAY,CAAA,YAAA,GAAZ,YAAY;QACZ,IAAS,CAAA,SAAA,GAAT,SAAS;QACT,IAAO,CAAA,OAAA,GAAP,OAAO;;IAKnB,OAAO,W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I,CAAA,IAAA,GAAJ,IAAI;QACxB,IAAQ,CAAA,QAAA,GAAR,QAAQ;;AAInB,IAAA,IAAI,CAAC,YAAoB,EAAA;QAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC;QAE/D,IAAI,SAAS,EAAE;AAEb,YAAA,OAAO,IAAI,mBAAmB,CAC5B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,aAAa,EAClB;AACE,gBAAA,EAAE,EAAE,YAAY;gBAChB,SAAS;AACV,aAAA,CACF;;AAIH,QAAA,OAAO,IAAI;;+GA1BF,yBAAyB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAG1B,oBAAoB,EAAA,EAAA,EAAA,KAAA,EACpB,UAAU,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAJT,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;4FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;0BAI7B,MAAM;2BAAC,oBAAoB;;0BAC3B,MAAM;2BAAC,UAAU;;;ACdtB;AAKA;;ACLA;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RxapError, JoinPath, coerceArray, IsRecord, assertsObject, isPromiseLike } from '@rxap/utilities';
|
|
2
|
+
import { HttpContextToken, HttpErrorResponse, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
2
3
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, isDevMode, Injectable, Optional, Inject } from '@angular/core';
|
|
4
|
-
import { HttpErrorResponse, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
4
|
+
import { InjectionToken, isDevMode, Injectable, Optional, Inject, inject } from '@angular/core';
|
|
5
5
|
import { ConfigService } from '@rxap/config';
|
|
6
6
|
import Ajv from 'ajv';
|
|
7
7
|
|
|
@@ -11,6 +11,11 @@ class RxapOpenApiError extends RxapError {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
const OPEN_API_OPERATION_ID = new HttpContextToken(() => '');
|
|
15
|
+
const OPEN_API_SERVER_ID = new HttpContextToken(() => null);
|
|
16
|
+
const OPEN_API_SERVER_INDEX = new HttpContextToken(() => 0);
|
|
17
|
+
const OPEN_API_OPERATION = new HttpContextToken(() => '');
|
|
18
|
+
|
|
14
19
|
const RXAP_OPEN_API_CONFIG = new InjectionToken('rxap/open-api/config');
|
|
15
20
|
const RXAP_OPEN_API_STRICT_VALIDATOR = new InjectionToken('rxap/open-api/strict-validator');
|
|
16
21
|
const DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA = new InjectionToken('rxap/open-api/default-remote-method-meta-data');
|
|
@@ -207,6 +212,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
207
212
|
args: [RXAP_OPEN_API_CONFIG]
|
|
208
213
|
}] }] });
|
|
209
214
|
|
|
215
|
+
const injectOpenApiBaseUrlHttpInterceptorFn = (req, next) => {
|
|
216
|
+
const serverId = req.context.get(OPEN_API_SERVER_ID);
|
|
217
|
+
const serverIndex = req.context.get(OPEN_API_SERVER_INDEX);
|
|
218
|
+
const openApiConfigService = inject(OpenApiConfigService);
|
|
219
|
+
if (serverId) {
|
|
220
|
+
const baseUrl = openApiConfigService.getBaseUrl(serverIndex, serverId);
|
|
221
|
+
if (req.url.startsWith('http')) {
|
|
222
|
+
if (!req.url.startsWith(baseUrl)) {
|
|
223
|
+
console.warn(`The url ${req.url} is not a valid url for the server ${serverId}. Expected base url ${baseUrl}`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
return next(req.clone({ url: new URL(req.url, baseUrl).toString() }));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return next(req);
|
|
231
|
+
};
|
|
232
|
+
|
|
210
233
|
class OpenApiHttpResponseError extends HttpErrorResponse {
|
|
211
234
|
constructor(httpErrorResponse, metadata) {
|
|
212
235
|
super({
|
|
@@ -598,5 +621,5 @@ class SchemaValidationMixin {
|
|
|
598
621
|
* Generated bundle index. Do not edit.
|
|
599
622
|
*/
|
|
600
623
|
|
|
601
|
-
export { AssertOpenApiV3, DEFAULT_OPEN_API_DATA_SOURCE_META_DATA, DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA, DISABLE_SCHEMA_VALIDATION, DISABLE_VALIDATION, IsOpenApiV3, IsReferenceObject, NotContainsReferenceObjects, OpenApiConfigService, OpenApiHttpResponseError, OpenApiInit, RXAP_OPEN_API_CONFIG, RXAP_OPEN_API_STRICT_VALIDATOR, RxapOpenApiError, SchemaValidationMixin };
|
|
624
|
+
export { AssertOpenApiV3, DEFAULT_OPEN_API_DATA_SOURCE_META_DATA, DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA, DISABLE_SCHEMA_VALIDATION, DISABLE_VALIDATION, IsOpenApiV3, IsReferenceObject, NotContainsReferenceObjects, OPEN_API_OPERATION, OPEN_API_OPERATION_ID, OPEN_API_SERVER_ID, OPEN_API_SERVER_INDEX, OpenApiConfigService, OpenApiHttpResponseError, OpenApiInit, RXAP_OPEN_API_CONFIG, RXAP_OPEN_API_STRICT_VALIDATOR, RxapOpenApiError, SchemaValidationMixin, injectOpenApiBaseUrlHttpInterceptorFn };
|
|
602
625
|
//# sourceMappingURL=rxap-open-api.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-open-api.mjs","sources":["../../../../../packages/angular/open-api/src/lib/error.ts","../../../../../packages/angular/open-api/src/lib/tokens.ts","../../../../../packages/angular/open-api/src/lib/utilities.ts","../../../../../packages/angular/open-api/src/lib/open-api-config.service.ts","../../../../../packages/angular/open-api/src/lib/open-api-http-response.error.ts","../../../../../packages/angular/open-api/src/lib/open-api-init.ts","../../../../../packages/angular/open-api/src/lib/schema-validation.mixin.ts","../../../../../packages/angular/open-api/src/index.ts","../../../../../packages/angular/open-api/src/rxap-open-api.ts"],"sourcesContent":["import { RxapError } from '@rxap/utilities';\n\nexport class RxapOpenApiError extends RxapError {\n\n constructor(message: string, code?: string, scope?: string) {\n super('@rxap/open-api', message, code ?? '', scope);\n }\n\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const RXAP_OPEN_API_CONFIG = new InjectionToken('rxap/open-api/config');\nexport const RXAP_OPEN_API_STRICT_VALIDATOR = new InjectionToken('rxap/open-api/strict-validator');\nexport const DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA = new InjectionToken(\n 'rxap/open-api/default-remote-method-meta-data');\nexport const DEFAULT_OPEN_API_DATA_SOURCE_META_DATA = new InjectionToken('rxap/open-api/default-data-source-meta-data');\nexport const DISABLE_SCHEMA_VALIDATION = new InjectionToken<boolean>('rxap/open-api/disable-schema-validation', {\n providedIn: 'root',\n factory: () => true,\n});\nexport const DISABLE_VALIDATION = new InjectionToken<boolean>('rxap/open-api/disable-validation', {\n providedIn: 'root',\n factory: () => true,\n});\n","import { OpenAPIV3 } from 'openapi-types';\nimport { RxapOpenApiError } from './error';\n\nexport function IsReferenceObject(obj?: any): obj is OpenAPIV3.ReferenceObject {\n return !!obj && obj.hasOwnProperty('$ref');\n}\n\nexport function NotContainsReferenceObjects<T>(array?: Array<OpenAPIV3.ReferenceObject | T | undefined>): array is T[] {\n return !!array && array.every(item => !IsReferenceObject(item) && !!item);\n}\n\nexport function IsOpenApiV3(obj?: any): obj is OpenAPIV3.Document {\n return !!obj && obj.hasOwnProperty('openapi') && obj.openapi.match(/^3\\./);\n}\n\nexport function AssertOpenApiV3(obj?: any): asserts obj is OpenAPIV3.Document {\n\n if (!IsOpenApiV3(obj)) {\n throw new RxapOpenApiError('Only openapi version 3.x.x is supported');\n }\n\n}\n","import {\n Inject,\n Injectable,\n isDevMode,\n Optional,\n} from '@angular/core';\nimport {\n OpenAPI,\n OpenAPIV3,\n} from 'openapi-types';\nimport { OperationObjectWithMetadata } from './open-api';\nimport { RXAP_OPEN_API_CONFIG } from './tokens';\nimport { AssertOpenApiV3 } from './utilities';\n\nexport type OperationMap = Map<string, OperationObjectWithMetadata>;\n\n@Injectable({ providedIn: 'root' })\nexport class OpenApiConfigService {\n public static Config: OpenAPIV3.Document | null = null;\n\n public static DefaultServerIndex = 0;\n\n private static _operations: OperationMap | null = null;\n public defaultServerIndex: number = OpenApiConfigService.DefaultServerIndex;\n private _operations: OperationMap | null = null;\n private static serverConfigMap = new Map<string | undefined, OpenAPIV3.ServerObject[]>();\n\n private get serverConfigMap(): Map<string | undefined, OpenAPIV3.ServerObject[]> {\n return OpenApiConfigService.serverConfigMap;\n }\n\n get serverIds(): string[] {\n return Object.keys(this.serverConfigMap);\n }\n\n constructor(\n @Optional()\n @Inject(RXAP_OPEN_API_CONFIG)\n config: OpenAPIV3.Document | null = null,\n ) {\n config = config ?? OpenApiConfigService.Config;\n if (config) {\n this._config = config;\n this._operations = OpenApiConfigService.LoadOperations(config);\n }\n OpenApiConfigService.Config ??= config;\n }\n\n private _config: OpenAPIV3.Document | null = null;\n\n public get config(): OpenAPIV3.Document {\n if (!this._config) {\n throw new Error('Could not load open api config');\n }\n return this._config;\n }\n\n /**\n * Used to load the app open api config from a remote resource.\n *\n * Promise.all([ OpenApiDataSourceLoader.Load() ])\n * .then(() => platformBrowserDynamic().bootstrapModule(AppModule))\n * .catch(err => console.error(err))\n *\n */\n public static async Load(openApiUrl = 'openapi.json'): Promise<void> {\n if (!openApiUrl) {\n throw new Error('The open api url is not defined!');\n }\n\n let config: OpenAPIV3.Document | null = null;\n try {\n const response = await fetch(openApiUrl);\n config = await response.json();\n } catch (error: any) {\n console.debug(\n `Could not load the open api config from '${ openApiUrl }'!`,\n error,\n );\n console.error(\n `Could not load the open api config from '${ openApiUrl }'!`,\n error.message,\n );\n }\n\n if (config) {\n const expandedConfig = await this.ExpandOpenApi(config);\n\n AssertOpenApiV3(expandedConfig);\n\n this.Config = expandedConfig;\n } else {\n this.Config = null;\n }\n }\n\n public static GetOperation(operationId: string): OperationObjectWithMetadata {\n if (!this.Config) {\n throw new Error('Could not load open api config');\n }\n\n if (!this._operations) {\n this._operations = this.LoadOperations(this.Config);\n }\n if (!this._operations!.has(operationId)) {\n throw new Error(\n `The operation '${ operationId }' is not defined in the openapi-json`,\n );\n }\n return this._operations!.get(operationId)!;\n }\n\n private static LoadOperations(config: OpenAPIV3.Document): OperationMap {\n const operations = new Map<string, OperationObjectWithMetadata>();\n\n Object.entries(config.paths)\n .filter(\n (item): item is [ string, OpenAPIV3.PathItemObject ] =>\n item[0] !== undefined,\n )\n .filter(\n ([ _, methods ]: [ string, OpenAPIV3.PathItemObject ]) =>\n methods &&\n Object.keys(methods).some((method) =>\n [ 'get', 'put', 'post', 'delete', 'patch' ].includes(method),\n ),\n )\n .forEach(([ path, methods ]: [ string, OpenAPIV3.PathItemObject ]) =>\n Object.entries(methods)\n .filter(\n (item): item is [ string, OpenAPIV3.OperationObject ] =>\n item[0] !== undefined,\n )\n .forEach(\n ([ method, operation ]: [ string, OpenAPIV3.OperationObject ]) => {\n if (!operation.operationId) {\n throw new Error('The OpenApu OperationId is not defined');\n }\n\n if (operations!.has(operation.operationId)) {\n throw new Error(\n `The OpenApi Operation '${ operation.operationId }' is already defined.`,\n );\n }\n\n operations!.set(operation.operationId, {\n ...operation,\n path: path,\n method: method.toUpperCase(),\n });\n },\n ),\n );\n\n return operations;\n }\n\n private static GetBaseUrl(\n config: OpenAPIV3.Document,\n serverIndex: number = this.DefaultServerIndex,\n ): string {\n const server = config.servers ? config.servers[serverIndex] : null;\n\n if (!server) {\n console.debug(\n `Could not extract the server config with the index '${ serverIndex }' from the open api config`,\n config,\n );\n throw new Error(\n `Could not extract the server config with the index '${ serverIndex }' from the open api config`,\n );\n }\n\n return server.url;\n }\n\n /**\n * Replaces all $ref with the concrete definition\n *\n * @param config\n * @private\n */\n private static ExpandOpenApi(\n config: OpenAPI.Document,\n ): Promise<OpenAPI.Document> {\n return Promise.resolve(config);\n }\n\n public getOperation(operationId: string): OperationObjectWithMetadata {\n if (!this._operations) {\n if (!this._config) {\n throw new Error('The operations map is not loaded and the config object is not loaded');\n }\n this._operations = OpenApiConfigService.LoadOperations(this._config);\n }\n if (!this._operations.has(operationId)) {\n console.error(\n `The operation '${ operationId }' is not defined in the openapi-json`,\n isDevMode() ? this.config : undefined,\n );\n throw new Error(\n `The operation '${ operationId }' is not defined in the openapi-json`,\n );\n }\n return this._operations.get(operationId)!;\n }\n\n public getBaseUrl(serverIndex: number = this.defaultServerIndex, serverId?: string): string {\n let serverConfig: OpenAPIV3.ServerObject | undefined;\n const servers = this._config?.servers ?? [];\n if (!serverId && servers) {\n serverConfig = servers[serverIndex];\n }\n if (this.serverConfigMap.has(serverId)) {\n serverConfig = this.serverConfigMap.get(serverId)![serverIndex];\n }\n if (!serverConfig) {\n console.error(\n `Could not determine the base url with the index '${ serverIndex }' and the serverId '${ serverId }'`,\n isDevMode() ? servers : undefined,\n );\n throw new Error(`Could not determine the base url with the index '${ serverIndex }' and the serverId '${ serverId }'`);\n }\n return serverConfig.url;\n }\n\n public static InsertServer(\n serverConfig: OpenAPIV3.ServerObject,\n index: number,\n serverId?: string,\n config: OpenAPIV3.Document = this.Config!,\n ): void {\n if (!serverId && config) {\n if (!config.servers) {\n config.servers = [];\n }\n config.servers.splice(index, 1, serverConfig);\n }\n if (!this.serverConfigMap.has(serverId)) {\n this.serverConfigMap.set(serverId, []);\n }\n const list = this.serverConfigMap.get(serverId)!;\n list[index] = serverConfig;\n this.serverConfigMap.set(serverId, list);\n }\n\n public insertServer(\n serverConfig: OpenAPIV3.ServerObject,\n index: number = this.defaultServerIndex,\n serverId?: string,\n ): void {\n OpenApiConfigService.InsertServer(serverConfig, index, serverId, this.config);\n }\n\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { OpenApiMetaData } from './open-api.meta-data';\n\nexport class OpenApiHttpResponseError extends HttpErrorResponse {\n\n constructor(\n public readonly httpErrorResponse: HttpErrorResponse,\n public readonly metadata: OpenApiMetaData,\n ) {\n super({\n error: httpErrorResponse.error,\n headers: httpErrorResponse.headers,\n status: httpErrorResponse.status,\n statusText: httpErrorResponse.statusText,\n url: httpErrorResponse.url ?? undefined,\n });\n if ((Error as any)['captureStackTrace']) {\n (Error as any)['captureStackTrace'](this, OpenApiHttpResponseError);\n }\n Reflect.set(this, 'name', 'OpenApiHttpResponseError');\n }\n\n get operationId() {\n return this.metadata.id;\n }\n\n get serverId() {\n return this.metadata.serverId;\n }\n\n}\n","import { ConfigService } from '@rxap/config';\nimport { Environment } from '@rxap/environment';\nimport { JoinPath } from '@rxap/utilities';\nimport { OpenApiConfigService } from './open-api-config.service';\n\nexport interface OpenApiInitOptions {\n /**\n * true - load the open api config file from the default url\n * default url: openapi.json\n */\n load?: {\n openApiUrl?: string;\n } | boolean;\n /**\n * The location origin prefix for the open api base urls if the base url is not absolute. defaults to location.origin\n */\n origin?: string;\n}\n\nexport function OpenApiInit(environment: Environment, options: OpenApiInitOptions = {}) {\n const api = ConfigService.Get<Record<string, { baseUrl?: string }> & { baseUrl: string }>(\n 'api',\n {} as any,\n ConfigService.Config,\n );\n options.origin ??= environment.origin ?? location.origin;\n options.load ??= environment.openApi?.load ?? false;\n if (api.baseUrl) {\n OpenApiConfigService.InsertServer({\n url: api.baseUrl.match(/^https?:\\/\\//) ? api.baseUrl : JoinPath(options.origin, api.baseUrl),\n }, OpenApiConfigService.DefaultServerIndex);\n }\n for (const [ serverId, config ] of Object.entries(api)) {\n if (config && typeof config === 'object') {\n const baseUrl = config.baseUrl;\n if (baseUrl) {\n const url = baseUrl.match(/^https?:\\/\\//) ? baseUrl : JoinPath(options.origin, baseUrl);\n console.debug(`Add server '${ serverId }' with url '${ url }'`);\n OpenApiConfigService.InsertServer(\n { url },\n OpenApiConfigService.DefaultServerIndex,\n serverId,\n );\n }\n }\n }\n if (options.load) {\n return OpenApiConfigService.Load(typeof options.load === 'object' ? options.load.openApiUrl : undefined);\n }\n return undefined;\n}\n","import {\n HttpHeaders,\n HttpParams,\n} from '@angular/common/http';\nimport { isDevMode } from '@angular/core';\nimport { HttpRemoteMethodParameter } from '@rxap/remote-method/http';\nimport {\n assertsObject,\n coerceArray,\n isPromiseLike,\n IsRecord,\n} from '@rxap/utilities';\nimport Ajv from 'ajv';\nimport { OpenAPIV3 } from 'openapi-types';\nimport { RxapOpenApiError } from './error';\nimport { OperationObjectWithMetadata } from './open-api';\nimport {\n IsReferenceObject,\n NotContainsReferenceObjects,\n} from './utilities';\n\nexport interface SchemaValidationResponse<Data> {\n headers: HttpHeaders;\n status: number;\n body?: Data | null;\n data?: Data;\n}\n\n\n\nexport class SchemaValidationMixin<Response = any, Parameters extends Record<string, any> | void = any, RequestBody = any> {\n\n public static STRICT = false;\n\n protected disableSchemaValidation?: boolean;\n\n /**\n * Validates the parameters against the schema specified in the operation object\n *\n * @param operation\n * @param parameters\n * @param strict\n * @protected\n */\n public validateParameters(operation: OperationObjectWithMetadata, parameters?: Parameters, strict = false): void {\n\n const operationParameters = coerceArray(operation.parameters);\n\n if (!NotContainsReferenceObjects<OpenAPIV3.ParameterObject>(operationParameters)) {\n throw new RxapOpenApiError('The operation parameters contains ReferenceObject!');\n }\n\n if (parameters === undefined) {\n // TODO : find concept to definition witch parameter should not be checked if required\n // header parameters are never required if changes the semantic release manager breaks\n const requiredParameters = operationParameters.filter(parameter => parameter.required &&\n parameter.in !==\n 'header');\n if (requiredParameters.length) {\n if (isDevMode()) {\n console.debug('Some operation parameters are required!', requiredParameters.map(p => p.name));\n }\n this.validationError('Some operation parameters are required!', strict);\n }\n\n } else if (IsRecord(parameters)) {\n\n for (const parameter of operationParameters) {\n\n if (parameter.required) {\n // header parameters are never required if changes the semantic release manager breaks\n if (parameter.in !== 'header') {\n if (!parameters.hasOwnProperty(parameter.name)) {\n this.validationError(`The operation parameter '${ parameter.name }' is required!`, strict);\n }\n }\n }\n\n\n if (parameter.schema) {\n if (parameters.hasOwnProperty(parameter.name)) {\n\n const value = parameters[parameter.name];\n\n if (!this.validate(parameter.schema, value)) {\n this.validationError(\n `The parameter '${ parameter.name }' is not valid against the schema!`,\n strict,\n parameter.schema,\n value,\n );\n }\n\n }\n }\n\n }\n\n } else {\n if (operationParameters.length === 0 || operationParameters.every(op => !op.required)) {\n if (isDevMode()) {\n console.warn(\n `The operation ${ operation.operationId } does not expect any parameters. But a parameter is provided.`,\n parameters,\n );\n }\n } else {\n throw new Error('The parameters object is not a record');\n }\n }\n\n }\n\n /**\n * Validates the http response against the schema specified in the operation object\n *\n * @param operation\n * @param response\n * @param strict\n * @protected\n */\n public validateResponse(\n operation: OperationObjectWithMetadata,\n response: SchemaValidationResponse<Response>,\n strict = false,\n ): void {\n\n // region only validate the response if the content type is undefined or application/json\n\n const contentType = response.headers.get('Content-Type');\n\n if (contentType && contentType !== 'application/json') {\n if (isDevMode()) {\n console.warn('Response validation is only supported for content type application/json');\n }\n return;\n }\n\n // endregion\n\n if (operation.responses) {\n\n const status = response.status;\n\n // region extract the response object based on the response status\n let responseObject: OpenAPIV3.ResponseObject | OpenAPIV3.ReferenceObject | undefined;\n\n if (operation.responses[status]) {\n responseObject = operation.responses[status];\n } else {\n // use the default response object if no matching was found.\n responseObject = operation.responses['default'];\n }\n // endregion\n\n if (responseObject) {\n\n if (IsReferenceObject(responseObject)) {\n throw new RxapOpenApiError('Found a reference object. The operation config is not expand!');\n }\n\n // region validate the response against the schema if defined\n\n // TODO : create schema that validates all parameters at once\n\n if (responseObject.content &&\n responseObject.content['application/json'] &&\n responseObject.content['application/json'].schema) {\n\n const schema = responseObject.content['application/json'].schema;\n\n const data = response.body ?? response.data;\n\n if (!this.validate(schema, data)) {\n this.validationError('The response is not valid ageist the operation schema!', strict, schema, data);\n }\n\n }\n\n // endregion\n\n }\n\n\n }\n\n }\n\n public validateRequestBody(operation: OperationObjectWithMetadata, body?: RequestBody, strict = false): void {\n\n // only validate body if type of object\n if (typeof body !== 'object') {\n return;\n }\n\n if (operation.requestBody) {\n\n if (IsReferenceObject(operation.requestBody)) {\n throw new RxapOpenApiError('Found a reference object. The operation config is not expand!');\n }\n\n if (body === undefined && operation.requestBody.required) {\n this.validationError('The request body is required!', strict);\n }\n\n if (operation.requestBody.content && operation.requestBody.content['application/json']) {\n\n const schema = operation.requestBody.content['application/json'].schema;\n\n if (schema) {\n if (!this.validate(schema, body)) {\n this.validationError('The request body is not valid!', strict, schema, body);\n }\n }\n\n }\n\n }\n\n }\n\n public validationError(\n message: string,\n strict: boolean,\n schema?: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject,\n value?: any,\n ) {\n if (isDevMode() && schema !== undefined) {\n console.debug(\n message,\n {\n schema,\n value,\n },\n );\n }\n if (strict || SchemaValidationMixin.STRICT) {\n throw new RxapOpenApiError(message, '', 'SchemaValidationMixin');\n } else {\n console.warn(message);\n }\n }\n\n public buildHttpParams(\n operationParameters: OpenAPIV3.ParameterObject[],\n parameters?: Parameters,\n ignoreUndefined = true,\n ): HttpParams {\n\n let params = new HttpParams();\n\n if (IsRecord(parameters)) {\n\n for (const parameter of operationParameters.filter(p => p.in === 'query')) {\n const parameterName = parameter.name;\n\n if (parameters.hasOwnProperty(parameter.name)) {\n\n const value = parameters[parameter.name];\n\n if (value === undefined && ignoreUndefined) {\n continue;\n }\n\n if (Array.isArray(value)) {\n\n if (value.length) {\n\n const first = value.shift();\n\n params = params.set(parameterName, typeof first === 'object' ? JSON.stringify(first) : first);\n\n for (const item of value) {\n params = params.append(parameterName, typeof item === 'object' ? JSON.stringify(item) : item);\n }\n\n }\n\n } else {\n params = params.set(parameter.name, typeof value === 'object' ? JSON.stringify(value) : value);\n }\n\n }\n\n }\n\n }\n\n return params;\n\n }\n\n public buildHttpHeaders(operationParameters: OpenAPIV3.ParameterObject[], parameters?: Parameters): HttpHeaders {\n\n const headers: Record<string, string | number | string[] | number[]> = {};\n\n if (IsRecord(parameters)) {\n\n for (const parameter of operationParameters.filter((p) => p.in === 'header')) {\n if (parameters.hasOwnProperty(parameter.name)) {\n const value = parameters[parameter.name];\n\n if (Array.isArray(value)) {\n if (value.length) {\n if (value.length === 1) {\n const first = value.shift();\n headers[parameter.name] =\n typeof first === 'object' ? JSON.stringify(first) : first;\n } else {\n headers[parameter.name] = value.map((item) =>\n typeof item === 'object' ? JSON.stringify(item) : item\n );\n }\n }\n } else {\n headers[parameter.name] =\n typeof value === 'object' ? JSON.stringify(value) : value;\n }\n }\n }\n\n }\n\n return new HttpHeaders(headers);\n\n }\n\n public buildHttpPathParams(\n operationParameters: OpenAPIV3.ParameterObject[],\n parameters?: Parameters,\n ): Record<string, string> {\n\n const pathParams: Record<string, any> = {};\n\n if (IsRecord(parameters)) {\n\n for (const parameter of operationParameters.filter(p => p.in === 'path')) {\n\n if (parameter.name in parameters) {\n pathParams[parameter.name] = this.normalizePathParamValue(parameters[parameter.name], parameter.name);\n }\n\n }\n\n }\n\n return pathParams;\n\n }\n\n protected normalizePathParamValue(value: any, paramName: string): string {\n if (!value) {\n throw new Error(`The path parameter '${paramName}' is empty or undefined!`);\n }\n if (Array.isArray(value)) {\n if (value.length === 0) {\n throw new Error(`The path parameter '${paramName}' is an empty array!`);\n }\n return value.map((item, index) => this.normalizePathParamValue(item, `${ paramName }[${index}]`)).join('/');\n } else if (typeof value === 'object') {\n return encodeURIComponent(JSON.stringify(value));\n } else if (typeof value === `string`) {\n return encodeURIComponent(value);\n }\n return value.toString();\n }\n\n /**\n * Converts open api parameters into the corresponding http options to\n * create a http request. The transformation is guided by the openapi definition\n *\n * @param operation\n * @param parameters\n * @param requestBody\n * @param ignoreUndefined\n */\n public buildHttpOptions(\n operation: OperationObjectWithMetadata,\n parameters?: Parameters,\n requestBody?: RequestBody,\n ignoreUndefined = true,\n ): HttpRemoteMethodParameter {\n\n const options: HttpRemoteMethodParameter = {};\n\n const operationParameters = coerceArray(operation.parameters);\n\n if (!NotContainsReferenceObjects<OpenAPIV3.ParameterObject>(operationParameters)) {\n throw new RxapOpenApiError('The operation parameters contains ReferenceObject!');\n }\n\n const params = this.buildHttpParams(operationParameters, parameters, ignoreUndefined);\n const headers = this.buildHttpHeaders(operationParameters, parameters);\n const pathParams: Record<string, any> = this.buildHttpPathParams(operationParameters, parameters);\n\n if (params.keys().length) {\n options.params = params;\n }\n\n if (headers.keys().length) {\n options.headers = headers;\n }\n\n if (Object.keys(pathParams).length) {\n options.pathParams = pathParams;\n }\n\n if (requestBody !== undefined) {\n const [ body, contentType ] = this.buildBody(operation, requestBody);\n if (body !== undefined) {\n options.body = body;\n if (contentType !== undefined) {\n options.headers ??= new HttpHeaders();\n options.headers.set('Content-Type', contentType);\n }\n }\n }\n\n return options;\n\n }\n\n private buildBody(operation: OperationObjectWithMetadata, requestBody: RequestBody): [ any, string | undefined ] {\n const accept: string[] = [];\n if (operation.requestBody && !IsReferenceObject(operation.requestBody)) {\n if (operation.requestBody.content) {\n for (const contentType of Object.keys(operation.requestBody.content)) {\n accept.push(contentType);\n }\n }\n }\n if (!accept.length) {\n console.warn('No content type found for the request body! Omitting the body!');\n return [ undefined, undefined ];\n }\n if (accept.length > 1) {\n console.warn('Multiple content types found for the request body! Using the first one!');\n }\n const contentType = accept[0];\n switch (contentType) {\n\n case 'application/json':\n assertsObject(requestBody);\n return [ requestBody, contentType ];\n\n case 'application/x-www-form-urlencoded':\n assertsObject(requestBody);\n // eslint-disable-next-line no-case-declarations\n let params = new HttpParams();\n for (const [ key, value ] of Object.entries(requestBody)) {\n params = params.set(key, value);\n }\n return [ params.toString(), contentType ];\n\n case 'multipart/form-data':\n assertsObject(requestBody);\n // eslint-disable-next-line no-case-declarations\n const formData = new FormData();\n\n // Iterate through the JSON object and append each field to FormData\n for (const [ key, value ] of Object.entries(requestBody)) {\n formData.append(key, value);\n }\n return [ formData, contentType ];\n\n default:\n return [ requestBody, contentType ];\n\n }\n\n }\n\n private validate(schema: string | boolean | object, value: any): boolean {\n\n if (this.disableSchemaValidation) {\n return true;\n }\n\n if (typeof schema !== 'object') {\n throw new Error('The schema must be an object!');\n }\n\n if (!schema) {\n throw new Error('The schema must not be null or undefined!');\n }\n\n let result: boolean | PromiseLike<any>;\n\n const ajv = new Ajv();\n const validate = ajv.compile(schema);\n\n try {\n result = validate(value);\n } catch (e: any) {\n console.error(e.message);\n return false;\n }\n\n if (isPromiseLike(result)) {\n throw new Error(\n 'Async schema validation is not yet supported. Ensure the all refs in the openapi schema are internal!');\n }\n\n return result;\n }\n\n}\n","// region \nexport * from './lib/error';\nexport * from './lib/open-api-config.service';\nexport * from './lib/open-api-http-response.error';\nexport * from './lib/open-api-init';\nexport * from './lib/open-api.meta-data';\nexport * from './lib/open-api';\nexport * from './lib/schema-validation.mixin';\nexport * from './lib/tokens';\nexport * from './lib/utilities';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEM,MAAO,gBAAiB,SAAQ,SAAS,CAAA;AAE7C,IAAA,WAAA,CAAY,OAAe,EAAE,IAAa,EAAE,KAAc,EAAA;QACxD,KAAK,CAAC,gBAAgB,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC;;AAGtD;;MCNY,oBAAoB,GAAG,IAAI,cAAc,CAAC,sBAAsB;MAChE,8BAA8B,GAAG,IAAI,cAAc,CAAC,gCAAgC;MACpF,wCAAwC,GAAG,IAAI,cAAc,CACxE,+CAA+C;MACpC,sCAAsC,GAAG,IAAI,cAAc,CAAC,6CAA6C;MACzG,yBAAyB,GAAG,IAAI,cAAc,CAAU,yCAAyC,EAAE;AAC9G,IAAA,UAAU,EAAE,MAAM;AAClB,I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,IAAI,KAAK,CAAC,2CAA2C,CAAC;;AAG9D,QAAA,IAAI,MAAkC;AAEtC,QAAA,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE;QACrB,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;AAEpC,QAAA,IAAI;AACF,YAAA,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;;QACxB,OAAO,CAAM,EAAE;AACf,YAAA,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;AACxB,YAAA,OAAO,KAAK;;AAGd,QAAA,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;AACzB,YAAA,MAAM,IAAI,KAAK,CACb,uGAAuG,CAAC;;AAG5G,QAAA,OAAO,MAAM;;;;ACvfjB;AAUA;;ACVA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"rxap-open-api.mjs","sources":["../../../../../packages/angular/open-api/src/lib/error.ts","../../../../../packages/angular/open-api/src/lib/http-context-tokens.ts","../../../../../packages/angular/open-api/src/lib/tokens.ts","../../../../../packages/angular/open-api/src/lib/utilities.ts","../../../../../packages/angular/open-api/src/lib/open-api-config.service.ts","../../../../../packages/angular/open-api/src/lib/http-interceptors.ts","../../../../../packages/angular/open-api/src/lib/open-api-http-response.error.ts","../../../../../packages/angular/open-api/src/lib/open-api-init.ts","../../../../../packages/angular/open-api/src/lib/schema-validation.mixin.ts","../../../../../packages/angular/open-api/src/index.ts","../../../../../packages/angular/open-api/src/rxap-open-api.ts"],"sourcesContent":["import { RxapError } from '@rxap/utilities';\n\nexport class RxapOpenApiError extends RxapError {\n\n constructor(message: string, code?: string, scope?: string) {\n super('@rxap/open-api', message, code ?? '', scope);\n }\n\n}\n","import { HttpContextToken } from '@angular/common/http';\n\nexport const OPEN_API_OPERATION_ID = new HttpContextToken<string>(() => '');\nexport const OPEN_API_SERVER_ID = new HttpContextToken<string | null>(() => null);\nexport const OPEN_API_SERVER_INDEX = new HttpContextToken<number>(() => 0);\nexport const OPEN_API_OPERATION = new HttpContextToken<string>(() => '');\n","import { InjectionToken } from '@angular/core';\n\nexport const RXAP_OPEN_API_CONFIG = new InjectionToken('rxap/open-api/config');\nexport const RXAP_OPEN_API_STRICT_VALIDATOR = new InjectionToken('rxap/open-api/strict-validator');\nexport const DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA = new InjectionToken(\n 'rxap/open-api/default-remote-method-meta-data');\nexport const DEFAULT_OPEN_API_DATA_SOURCE_META_DATA = new InjectionToken('rxap/open-api/default-data-source-meta-data');\nexport const DISABLE_SCHEMA_VALIDATION = new InjectionToken<boolean>('rxap/open-api/disable-schema-validation', {\n providedIn: 'root',\n factory: () => true,\n});\nexport const DISABLE_VALIDATION = new InjectionToken<boolean>('rxap/open-api/disable-validation', {\n providedIn: 'root',\n factory: () => true,\n});\n","import { OpenAPIV3 } from 'openapi-types';\nimport { RxapOpenApiError } from './error';\n\nexport function IsReferenceObject(obj?: any): obj is OpenAPIV3.ReferenceObject {\n return !!obj && obj.hasOwnProperty('$ref');\n}\n\nexport function NotContainsReferenceObjects<T>(array?: Array<OpenAPIV3.ReferenceObject | T | undefined>): array is T[] {\n return !!array && array.every(item => !IsReferenceObject(item) && !!item);\n}\n\nexport function IsOpenApiV3(obj?: any): obj is OpenAPIV3.Document {\n return !!obj && obj.hasOwnProperty('openapi') && obj.openapi.match(/^3\\./);\n}\n\nexport function AssertOpenApiV3(obj?: any): asserts obj is OpenAPIV3.Document {\n\n if (!IsOpenApiV3(obj)) {\n throw new RxapOpenApiError('Only openapi version 3.x.x is supported');\n }\n\n}\n","import {\n Inject,\n Injectable,\n isDevMode,\n Optional,\n} from '@angular/core';\nimport {\n OpenAPI,\n OpenAPIV3,\n} from 'openapi-types';\nimport { OperationObjectWithMetadata } from './open-api';\nimport { RXAP_OPEN_API_CONFIG } from './tokens';\nimport { AssertOpenApiV3 } from './utilities';\n\nexport type OperationMap = Map<string, OperationObjectWithMetadata>;\n\n@Injectable({ providedIn: 'root' })\nexport class OpenApiConfigService {\n public static Config: OpenAPIV3.Document | null = null;\n\n public static DefaultServerIndex = 0;\n\n private static _operations: OperationMap | null = null;\n public defaultServerIndex: number = OpenApiConfigService.DefaultServerIndex;\n private _operations: OperationMap | null = null;\n private static serverConfigMap = new Map<string | undefined, OpenAPIV3.ServerObject[]>();\n\n private get serverConfigMap(): Map<string | undefined, OpenAPIV3.ServerObject[]> {\n return OpenApiConfigService.serverConfigMap;\n }\n\n get serverIds(): string[] {\n return Object.keys(this.serverConfigMap);\n }\n\n constructor(\n @Optional()\n @Inject(RXAP_OPEN_API_CONFIG)\n config: OpenAPIV3.Document | null = null,\n ) {\n config = config ?? OpenApiConfigService.Config;\n if (config) {\n this._config = config;\n this._operations = OpenApiConfigService.LoadOperations(config);\n }\n OpenApiConfigService.Config ??= config;\n }\n\n private _config: OpenAPIV3.Document | null = null;\n\n public get config(): OpenAPIV3.Document {\n if (!this._config) {\n throw new Error('Could not load open api config');\n }\n return this._config;\n }\n\n /**\n * Used to load the app open api config from a remote resource.\n *\n * Promise.all([ OpenApiDataSourceLoader.Load() ])\n * .then(() => platformBrowserDynamic().bootstrapModule(AppModule))\n * .catch(err => console.error(err))\n *\n */\n public static async Load(openApiUrl = 'openapi.json'): Promise<void> {\n if (!openApiUrl) {\n throw new Error('The open api url is not defined!');\n }\n\n let config: OpenAPIV3.Document | null = null;\n try {\n const response = await fetch(openApiUrl);\n config = await response.json();\n } catch (error: any) {\n console.debug(\n `Could not load the open api config from '${ openApiUrl }'!`,\n error,\n );\n console.error(\n `Could not load the open api config from '${ openApiUrl }'!`,\n error.message,\n );\n }\n\n if (config) {\n const expandedConfig = await this.ExpandOpenApi(config);\n\n AssertOpenApiV3(expandedConfig);\n\n this.Config = expandedConfig;\n } else {\n this.Config = null;\n }\n }\n\n public static GetOperation(operationId: string): OperationObjectWithMetadata {\n if (!this.Config) {\n throw new Error('Could not load open api config');\n }\n\n if (!this._operations) {\n this._operations = this.LoadOperations(this.Config);\n }\n if (!this._operations!.has(operationId)) {\n throw new Error(\n `The operation '${ operationId }' is not defined in the openapi-json`,\n );\n }\n return this._operations!.get(operationId)!;\n }\n\n private static LoadOperations(config: OpenAPIV3.Document): OperationMap {\n const operations = new Map<string, OperationObjectWithMetadata>();\n\n Object.entries(config.paths)\n .filter(\n (item): item is [ string, OpenAPIV3.PathItemObject ] =>\n item[0] !== undefined,\n )\n .filter(\n ([ _, methods ]: [ string, OpenAPIV3.PathItemObject ]) =>\n methods &&\n Object.keys(methods).some((method) =>\n [ 'get', 'put', 'post', 'delete', 'patch' ].includes(method),\n ),\n )\n .forEach(([ path, methods ]: [ string, OpenAPIV3.PathItemObject ]) =>\n Object.entries(methods)\n .filter(\n (item): item is [ string, OpenAPIV3.OperationObject ] =>\n item[0] !== undefined,\n )\n .forEach(\n ([ method, operation ]: [ string, OpenAPIV3.OperationObject ]) => {\n if (!operation.operationId) {\n throw new Error('The OpenApu OperationId is not defined');\n }\n\n if (operations!.has(operation.operationId)) {\n throw new Error(\n `The OpenApi Operation '${ operation.operationId }' is already defined.`,\n );\n }\n\n operations!.set(operation.operationId, {\n ...operation,\n path: path,\n method: method.toUpperCase(),\n });\n },\n ),\n );\n\n return operations;\n }\n\n private static GetBaseUrl(\n config: OpenAPIV3.Document,\n serverIndex: number = this.DefaultServerIndex,\n ): string {\n const server = config.servers ? config.servers[serverIndex] : null;\n\n if (!server) {\n console.debug(\n `Could not extract the server config with the index '${ serverIndex }' from the open api config`,\n config,\n );\n throw new Error(\n `Could not extract the server config with the index '${ serverIndex }' from the open api config`,\n );\n }\n\n return server.url;\n }\n\n /**\n * Replaces all $ref with the concrete definition\n *\n * @param config\n * @private\n */\n private static ExpandOpenApi(\n config: OpenAPI.Document,\n ): Promise<OpenAPI.Document> {\n return Promise.resolve(config);\n }\n\n public getOperation(operationId: string): OperationObjectWithMetadata {\n if (!this._operations) {\n if (!this._config) {\n throw new Error('The operations map is not loaded and the config object is not loaded');\n }\n this._operations = OpenApiConfigService.LoadOperations(this._config);\n }\n if (!this._operations.has(operationId)) {\n console.error(\n `The operation '${ operationId }' is not defined in the openapi-json`,\n isDevMode() ? this.config : undefined,\n );\n throw new Error(\n `The operation '${ operationId }' is not defined in the openapi-json`,\n );\n }\n return this._operations.get(operationId)!;\n }\n\n public getBaseUrl(serverIndex: number = this.defaultServerIndex, serverId?: string): string {\n let serverConfig: OpenAPIV3.ServerObject | undefined;\n const servers = this._config?.servers ?? [];\n if (!serverId && servers) {\n serverConfig = servers[serverIndex];\n }\n if (this.serverConfigMap.has(serverId)) {\n serverConfig = this.serverConfigMap.get(serverId)![serverIndex];\n }\n if (!serverConfig) {\n console.error(\n `Could not determine the base url with the index '${ serverIndex }' and the serverId '${ serverId }'`,\n isDevMode() ? servers : undefined,\n );\n throw new Error(`Could not determine the base url with the index '${ serverIndex }' and the serverId '${ serverId }'`);\n }\n return serverConfig.url;\n }\n\n public static InsertServer(\n serverConfig: OpenAPIV3.ServerObject,\n index: number,\n serverId?: string,\n config: OpenAPIV3.Document = this.Config!,\n ): void {\n if (!serverId && config) {\n if (!config.servers) {\n config.servers = [];\n }\n config.servers.splice(index, 1, serverConfig);\n }\n if (!this.serverConfigMap.has(serverId)) {\n this.serverConfigMap.set(serverId, []);\n }\n const list = this.serverConfigMap.get(serverId)!;\n list[index] = serverConfig;\n this.serverConfigMap.set(serverId, list);\n }\n\n public insertServer(\n serverConfig: OpenAPIV3.ServerObject,\n index: number = this.defaultServerIndex,\n serverId?: string,\n ): void {\n OpenApiConfigService.InsertServer(serverConfig, index, serverId, this.config);\n }\n\n}\n","import { HttpInterceptorFn } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport {\n OpenApiConfigService,\n} from './open-api-config.service';\nimport { OPEN_API_SERVER_ID, OPEN_API_SERVER_INDEX } from './http-context-tokens';\n\nexport const injectOpenApiBaseUrlHttpInterceptorFn: HttpInterceptorFn = (\n req,\n next\n) => {\n const serverId = req.context.get(OPEN_API_SERVER_ID);\n const serverIndex = req.context.get(OPEN_API_SERVER_INDEX);\n const openApiConfigService = inject(OpenApiConfigService);\n if (serverId) {\n const baseUrl = openApiConfigService.getBaseUrl(serverIndex, serverId);\n if (req.url.startsWith('http')) {\n if (!req.url.startsWith(baseUrl)) {\n console.warn(`The url ${req.url} is not a valid url for the server ${serverId}. Expected base url ${baseUrl}`);\n }\n } else {\n return next(req.clone({ url: new URL(req.url, baseUrl).toString() }));\n }\n }\n\n return next(req);\n};\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { OpenApiMetaData } from './open-api.meta-data';\n\nexport class OpenApiHttpResponseError extends HttpErrorResponse {\n\n constructor(\n public readonly httpErrorResponse: HttpErrorResponse,\n public readonly metadata: OpenApiMetaData,\n ) {\n super({\n error: httpErrorResponse.error,\n headers: httpErrorResponse.headers,\n status: httpErrorResponse.status,\n statusText: httpErrorResponse.statusText,\n url: httpErrorResponse.url ?? undefined,\n });\n if ((Error as any)['captureStackTrace']) {\n (Error as any)['captureStackTrace'](this, OpenApiHttpResponseError);\n }\n Reflect.set(this, 'name', 'OpenApiHttpResponseError');\n }\n\n get operationId() {\n return this.metadata.id;\n }\n\n get serverId() {\n return this.metadata.serverId;\n }\n\n}\n","import { ConfigService } from '@rxap/config';\nimport { Environment } from '@rxap/environment';\nimport { JoinPath } from '@rxap/utilities';\nimport { OpenApiConfigService } from './open-api-config.service';\n\nexport interface OpenApiInitOptions {\n /**\n * true - load the open api config file from the default url\n * default url: openapi.json\n */\n load?: {\n openApiUrl?: string;\n } | boolean;\n /**\n * The location origin prefix for the open api base urls if the base url is not absolute. defaults to location.origin\n */\n origin?: string;\n}\n\nexport function OpenApiInit(environment: Environment, options: OpenApiInitOptions = {}) {\n const api = ConfigService.Get<Record<string, { baseUrl?: string }> & { baseUrl: string }>(\n 'api',\n {} as any,\n ConfigService.Config,\n );\n options.origin ??= environment.origin ?? location.origin;\n options.load ??= environment.openApi?.load ?? false;\n if (api.baseUrl) {\n OpenApiConfigService.InsertServer({\n url: api.baseUrl.match(/^https?:\\/\\//) ? api.baseUrl : JoinPath(options.origin, api.baseUrl),\n }, OpenApiConfigService.DefaultServerIndex);\n }\n for (const [ serverId, config ] of Object.entries(api)) {\n if (config && typeof config === 'object') {\n const baseUrl = config.baseUrl;\n if (baseUrl) {\n const url = baseUrl.match(/^https?:\\/\\//) ? baseUrl : JoinPath(options.origin, baseUrl);\n console.debug(`Add server '${ serverId }' with url '${ url }'`);\n OpenApiConfigService.InsertServer(\n { url },\n OpenApiConfigService.DefaultServerIndex,\n serverId,\n );\n }\n }\n }\n if (options.load) {\n return OpenApiConfigService.Load(typeof options.load === 'object' ? options.load.openApiUrl : undefined);\n }\n return undefined;\n}\n","import {\n HttpHeaders,\n HttpParams,\n} from '@angular/common/http';\nimport { isDevMode } from '@angular/core';\nimport { HttpRemoteMethodParameter } from '@rxap/remote-method/http';\nimport {\n assertsObject,\n coerceArray,\n isPromiseLike,\n IsRecord,\n} from '@rxap/utilities';\nimport Ajv from 'ajv';\nimport { OpenAPIV3 } from 'openapi-types';\nimport { RxapOpenApiError } from './error';\nimport { OperationObjectWithMetadata } from './open-api';\nimport {\n IsReferenceObject,\n NotContainsReferenceObjects,\n} from './utilities';\n\nexport interface SchemaValidationResponse<Data> {\n headers: HttpHeaders;\n status: number;\n body?: Data | null;\n data?: Data;\n}\n\n\n\nexport class SchemaValidationMixin<Response = any, Parameters extends Record<string, any> | void = any, RequestBody = any> {\n\n public static STRICT = false;\n\n protected disableSchemaValidation?: boolean;\n\n /**\n * Validates the parameters against the schema specified in the operation object\n *\n * @param operation\n * @param parameters\n * @param strict\n * @protected\n */\n public validateParameters(operation: OperationObjectWithMetadata, parameters?: Parameters, strict = false): void {\n\n const operationParameters = coerceArray(operation.parameters);\n\n if (!NotContainsReferenceObjects<OpenAPIV3.ParameterObject>(operationParameters)) {\n throw new RxapOpenApiError('The operation parameters contains ReferenceObject!');\n }\n\n if (parameters === undefined) {\n // TODO : find concept to definition witch parameter should not be checked if required\n // header parameters are never required if changes the semantic release manager breaks\n const requiredParameters = operationParameters.filter(parameter => parameter.required &&\n parameter.in !==\n 'header');\n if (requiredParameters.length) {\n if (isDevMode()) {\n console.debug('Some operation parameters are required!', requiredParameters.map(p => p.name));\n }\n this.validationError('Some operation parameters are required!', strict);\n }\n\n } else if (IsRecord(parameters)) {\n\n for (const parameter of operationParameters) {\n\n if (parameter.required) {\n // header parameters are never required if changes the semantic release manager breaks\n if (parameter.in !== 'header') {\n if (!parameters.hasOwnProperty(parameter.name)) {\n this.validationError(`The operation parameter '${ parameter.name }' is required!`, strict);\n }\n }\n }\n\n\n if (parameter.schema) {\n if (parameters.hasOwnProperty(parameter.name)) {\n\n const value = parameters[parameter.name];\n\n if (!this.validate(parameter.schema, value)) {\n this.validationError(\n `The parameter '${ parameter.name }' is not valid against the schema!`,\n strict,\n parameter.schema,\n value,\n );\n }\n\n }\n }\n\n }\n\n } else {\n if (operationParameters.length === 0 || operationParameters.every(op => !op.required)) {\n if (isDevMode()) {\n console.warn(\n `The operation ${ operation.operationId } does not expect any parameters. But a parameter is provided.`,\n parameters,\n );\n }\n } else {\n throw new Error('The parameters object is not a record');\n }\n }\n\n }\n\n /**\n * Validates the http response against the schema specified in the operation object\n *\n * @param operation\n * @param response\n * @param strict\n * @protected\n */\n public validateResponse(\n operation: OperationObjectWithMetadata,\n response: SchemaValidationResponse<Response>,\n strict = false,\n ): void {\n\n // region only validate the response if the content type is undefined or application/json\n\n const contentType = response.headers.get('Content-Type');\n\n if (contentType && contentType !== 'application/json') {\n if (isDevMode()) {\n console.warn('Response validation is only supported for content type application/json');\n }\n return;\n }\n\n // endregion\n\n if (operation.responses) {\n\n const status = response.status;\n\n // region extract the response object based on the response status\n let responseObject: OpenAPIV3.ResponseObject | OpenAPIV3.ReferenceObject | undefined;\n\n if (operation.responses[status]) {\n responseObject = operation.responses[status];\n } else {\n // use the default response object if no matching was found.\n responseObject = operation.responses['default'];\n }\n // endregion\n\n if (responseObject) {\n\n if (IsReferenceObject(responseObject)) {\n throw new RxapOpenApiError('Found a reference object. The operation config is not expand!');\n }\n\n // region validate the response against the schema if defined\n\n // TODO : create schema that validates all parameters at once\n\n if (responseObject.content &&\n responseObject.content['application/json'] &&\n responseObject.content['application/json'].schema) {\n\n const schema = responseObject.content['application/json'].schema;\n\n const data = response.body ?? response.data;\n\n if (!this.validate(schema, data)) {\n this.validationError('The response is not valid ageist the operation schema!', strict, schema, data);\n }\n\n }\n\n // endregion\n\n }\n\n\n }\n\n }\n\n public validateRequestBody(operation: OperationObjectWithMetadata, body?: RequestBody, strict = false): void {\n\n // only validate body if type of object\n if (typeof body !== 'object') {\n return;\n }\n\n if (operation.requestBody) {\n\n if (IsReferenceObject(operation.requestBody)) {\n throw new RxapOpenApiError('Found a reference object. The operation config is not expand!');\n }\n\n if (body === undefined && operation.requestBody.required) {\n this.validationError('The request body is required!', strict);\n }\n\n if (operation.requestBody.content && operation.requestBody.content['application/json']) {\n\n const schema = operation.requestBody.content['application/json'].schema;\n\n if (schema) {\n if (!this.validate(schema, body)) {\n this.validationError('The request body is not valid!', strict, schema, body);\n }\n }\n\n }\n\n }\n\n }\n\n public validationError(\n message: string,\n strict: boolean,\n schema?: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject,\n value?: any,\n ) {\n if (isDevMode() && schema !== undefined) {\n console.debug(\n message,\n {\n schema,\n value,\n },\n );\n }\n if (strict || SchemaValidationMixin.STRICT) {\n throw new RxapOpenApiError(message, '', 'SchemaValidationMixin');\n } else {\n console.warn(message);\n }\n }\n\n public buildHttpParams(\n operationParameters: OpenAPIV3.ParameterObject[],\n parameters?: Parameters,\n ignoreUndefined = true,\n ): HttpParams {\n\n let params = new HttpParams();\n\n if (IsRecord(parameters)) {\n\n for (const parameter of operationParameters.filter(p => p.in === 'query')) {\n const parameterName = parameter.name;\n\n if (parameters.hasOwnProperty(parameter.name)) {\n\n const value = parameters[parameter.name];\n\n if (value === undefined && ignoreUndefined) {\n continue;\n }\n\n if (Array.isArray(value)) {\n\n if (value.length) {\n\n const first = value.shift();\n\n params = params.set(parameterName, typeof first === 'object' ? JSON.stringify(first) : first);\n\n for (const item of value) {\n params = params.append(parameterName, typeof item === 'object' ? JSON.stringify(item) : item);\n }\n\n }\n\n } else {\n params = params.set(parameter.name, typeof value === 'object' ? JSON.stringify(value) : value);\n }\n\n }\n\n }\n\n }\n\n return params;\n\n }\n\n public buildHttpHeaders(operationParameters: OpenAPIV3.ParameterObject[], parameters?: Parameters): HttpHeaders {\n\n const headers: Record<string, string | number | string[] | number[]> = {};\n\n if (IsRecord(parameters)) {\n\n for (const parameter of operationParameters.filter((p) => p.in === 'header')) {\n if (parameters.hasOwnProperty(parameter.name)) {\n const value = parameters[parameter.name];\n\n if (Array.isArray(value)) {\n if (value.length) {\n if (value.length === 1) {\n const first = value.shift();\n headers[parameter.name] =\n typeof first === 'object' ? JSON.stringify(first) : first;\n } else {\n headers[parameter.name] = value.map((item) =>\n typeof item === 'object' ? JSON.stringify(item) : item\n );\n }\n }\n } else {\n headers[parameter.name] =\n typeof value === 'object' ? JSON.stringify(value) : value;\n }\n }\n }\n\n }\n\n return new HttpHeaders(headers);\n\n }\n\n public buildHttpPathParams(\n operationParameters: OpenAPIV3.ParameterObject[],\n parameters?: Parameters,\n ): Record<string, string> {\n\n const pathParams: Record<string, any> = {};\n\n if (IsRecord(parameters)) {\n\n for (const parameter of operationParameters.filter(p => p.in === 'path')) {\n\n if (parameter.name in parameters) {\n pathParams[parameter.name] = this.normalizePathParamValue(parameters[parameter.name], parameter.name);\n }\n\n }\n\n }\n\n return pathParams;\n\n }\n\n protected normalizePathParamValue(value: any, paramName: string): string {\n if (!value) {\n throw new Error(`The path parameter '${paramName}' is empty or undefined!`);\n }\n if (Array.isArray(value)) {\n if (value.length === 0) {\n throw new Error(`The path parameter '${paramName}' is an empty array!`);\n }\n return value.map((item, index) => this.normalizePathParamValue(item, `${ paramName }[${index}]`)).join('/');\n } else if (typeof value === 'object') {\n return encodeURIComponent(JSON.stringify(value));\n } else if (typeof value === `string`) {\n return encodeURIComponent(value);\n }\n return value.toString();\n }\n\n /**\n * Converts open api parameters into the corresponding http options to\n * create a http request. The transformation is guided by the openapi definition\n *\n * @param operation\n * @param parameters\n * @param requestBody\n * @param ignoreUndefined\n */\n public buildHttpOptions(\n operation: OperationObjectWithMetadata,\n parameters?: Parameters,\n requestBody?: RequestBody,\n ignoreUndefined = true,\n ): HttpRemoteMethodParameter {\n\n const options: HttpRemoteMethodParameter = {};\n\n const operationParameters = coerceArray(operation.parameters);\n\n if (!NotContainsReferenceObjects<OpenAPIV3.ParameterObject>(operationParameters)) {\n throw new RxapOpenApiError('The operation parameters contains ReferenceObject!');\n }\n\n const params = this.buildHttpParams(operationParameters, parameters, ignoreUndefined);\n const headers = this.buildHttpHeaders(operationParameters, parameters);\n const pathParams: Record<string, any> = this.buildHttpPathParams(operationParameters, parameters);\n\n if (params.keys().length) {\n options.params = params;\n }\n\n if (headers.keys().length) {\n options.headers = headers;\n }\n\n if (Object.keys(pathParams).length) {\n options.pathParams = pathParams;\n }\n\n if (requestBody !== undefined) {\n const [ body, contentType ] = this.buildBody(operation, requestBody);\n if (body !== undefined) {\n options.body = body;\n if (contentType !== undefined) {\n options.headers ??= new HttpHeaders();\n options.headers.set('Content-Type', contentType);\n }\n }\n }\n\n return options;\n\n }\n\n private buildBody(operation: OperationObjectWithMetadata, requestBody: RequestBody): [ any, string | undefined ] {\n const accept: string[] = [];\n if (operation.requestBody && !IsReferenceObject(operation.requestBody)) {\n if (operation.requestBody.content) {\n for (const contentType of Object.keys(operation.requestBody.content)) {\n accept.push(contentType);\n }\n }\n }\n if (!accept.length) {\n console.warn('No content type found for the request body! Omitting the body!');\n return [ undefined, undefined ];\n }\n if (accept.length > 1) {\n console.warn('Multiple content types found for the request body! Using the first one!');\n }\n const contentType = accept[0];\n switch (contentType) {\n\n case 'application/json':\n assertsObject(requestBody);\n return [ requestBody, contentType ];\n\n case 'application/x-www-form-urlencoded':\n assertsObject(requestBody);\n // eslint-disable-next-line no-case-declarations\n let params = new HttpParams();\n for (const [ key, value ] of Object.entries(requestBody)) {\n params = params.set(key, value);\n }\n return [ params.toString(), contentType ];\n\n case 'multipart/form-data':\n assertsObject(requestBody);\n // eslint-disable-next-line no-case-declarations\n const formData = new FormData();\n\n // Iterate through the JSON object and append each field to FormData\n for (const [ key, value ] of Object.entries(requestBody)) {\n formData.append(key, value);\n }\n return [ formData, contentType ];\n\n default:\n return [ requestBody, contentType ];\n\n }\n\n }\n\n private validate(schema: string | boolean | object, value: any): boolean {\n\n if (this.disableSchemaValidation) {\n return true;\n }\n\n if (typeof schema !== 'object') {\n throw new Error('The schema must be an object!');\n }\n\n if (!schema) {\n throw new Error('The schema must not be null or undefined!');\n }\n\n let result: boolean | PromiseLike<any>;\n\n const ajv = new Ajv();\n const validate = ajv.compile(schema);\n\n try {\n result = validate(value);\n } catch (e: any) {\n console.error(e.message);\n return false;\n }\n\n if (isPromiseLike(result)) {\n throw new Error(\n 'Async schema validation is not yet supported. Ensure the all refs in the openapi schema are internal!');\n }\n\n return result;\n }\n\n}\n","// region \nexport * from './lib/error';\nexport * from './lib/http-context-tokens';\nexport * from './lib/http-interceptors';\nexport * from './lib/open-api-config.service';\nexport * from './lib/open-api-http-response.error';\nexport * from './lib/open-api-init';\nexport * from './lib/open-api.meta-data';\nexport * from './lib/open-api';\nexport * from './lib/schema-validation.mixin';\nexport * from './lib/tokens';\nexport * from './lib/utilities';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEM,MAAO,gBAAiB,SAAQ,SAAS,CAAA;AAE7C,IAAA,WAAA,CAAY,OAAe,EAAE,IAAa,EAAE,KAAc,EAAA;QACxD,KAAK,CAAC,gBAAgB,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC;;AAGtD;;ACNM,MAAM,qBAAqB,GAAG,IAAI,gBAAgB,CAAS,MAAM,EAAE;AACnE,MAAM,kBAAkB,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AAK,CAAC,+BAA+B,CAAC;;QAGlD,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC;;AAG9D,QAAA,IAAI,MAAkC;AAEtC,QAAA,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE;QACrB,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;AAEpC,QAAA,IAAI;AACF,YAAA,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;;QACxB,OAAO,CAAM,EAAE;AACf,YAAA,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;AACxB,YAAA,OAAO,KAAK;;AAGd,QAAA,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;AACzB,YAAA,MAAM,IAAI,KAAK,CACb,uGAAuG,CAAC;;AAG5G,QAAA,OAAO,MAAM;;;;ACvfjB;AAYA;;ACZA;;AAEG;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated use the @rxap/open-api package
|
|
3
|
+
*/
|
|
4
|
+
export { OPEN_API_OPERATION_ID, OPEN_API_SERVER_ID, } from '@rxap/open-api';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated use the @rxap/open-api package
|
|
3
|
+
*/
|
|
4
|
+
export { injectOpenApiBaseUrlHttpInterceptorFn, } from '@rxap/open-api';
|
package/index.d.ts
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HttpContextToken } from '@angular/common/http';
|
|
2
|
+
export declare const OPEN_API_OPERATION_ID: HttpContextToken<string>;
|
|
3
|
+
export declare const OPEN_API_SERVER_ID: HttpContextToken<string | null>;
|
|
4
|
+
export declare const OPEN_API_SERVER_INDEX: HttpContextToken<number>;
|
|
5
|
+
export declare const OPEN_API_OPERATION: HttpContextToken<string>;
|