@rxap/open-api 12.4.0 → 13.0.0-next.10

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.
Files changed (113) hide show
  1. package/data-source/package.json +5 -5
  2. package/data-source/table/package.json +5 -5
  3. package/esm2020/data-source/lib/error.mjs +8 -0
  4. package/esm2020/data-source/lib/open-api-data-source.loader.mjs +36 -0
  5. package/esm2020/data-source/lib/open-api.data-source.mjs +140 -0
  6. package/esm2020/data-source/public_api.mjs +6 -0
  7. package/esm2020/data-source/rxap-open-api-data-source.mjs +5 -0
  8. package/esm2020/data-source/table/lib/error.mjs +8 -0
  9. package/esm2020/data-source/table/lib/open-api-table.data-source.mjs +127 -0
  10. package/esm2020/data-source/table/lib/to-open-api-table-data-source.pipe.mjs +29 -0
  11. package/esm2020/data-source/table/lib/tokens.mjs +3 -0
  12. package/esm2020/data-source/table/public_api.mjs +5 -0
  13. package/esm2020/data-source/table/rxap-open-api-data-source-table.mjs +5 -0
  14. package/esm2020/index.mjs +7 -0
  15. package/esm2020/lib/error.mjs +7 -0
  16. package/esm2020/lib/open-api-config.service.mjs +160 -0
  17. package/esm2020/lib/open-api.mjs +2 -0
  18. package/esm2020/lib/schema-validation.mixin.mjs +256 -0
  19. package/esm2020/lib/tokens.mjs +8 -0
  20. package/esm2020/lib/utilities.mjs +16 -0
  21. package/esm2020/remote-method/lib/error.mjs +8 -0
  22. package/esm2020/remote-method/lib/open-api-remote-method.loader.mjs +37 -0
  23. package/esm2020/remote-method/lib/open-api.remote-method.mjs +145 -0
  24. package/esm2020/remote-method/public_api.mjs +4 -0
  25. package/esm2020/remote-method/rxap-open-api-remote-method.mjs +5 -0
  26. package/esm2020/rxap-open-api.mjs +5 -0
  27. package/fesm2015/rxap-open-api-data-source-table.mjs +172 -0
  28. package/fesm2015/rxap-open-api-data-source-table.mjs.map +1 -0
  29. package/{esm2015/data-source/lib/open-api.data-source.js → fesm2015/rxap-open-api-data-source.mjs} +96 -49
  30. package/fesm2015/rxap-open-api-data-source.mjs.map +1 -0
  31. package/fesm2015/rxap-open-api-remote-method.mjs +201 -0
  32. package/fesm2015/rxap-open-api-remote-method.mjs.map +1 -0
  33. package/fesm2015/{rxap-open-api.js → rxap-open-api.mjs} +55 -20
  34. package/fesm2015/rxap-open-api.mjs.map +1 -0
  35. package/{fesm2015/rxap-open-api-data-source-table.js → fesm2020/rxap-open-api-data-source-table.mjs} +18 -20
  36. package/fesm2020/rxap-open-api-data-source-table.mjs.map +1 -0
  37. package/{fesm2015/rxap-open-api-data-source.js → fesm2020/rxap-open-api-data-source.mjs} +17 -18
  38. package/fesm2020/rxap-open-api-data-source.mjs.map +1 -0
  39. package/{fesm2015/rxap-open-api-remote-method.js → fesm2020/rxap-open-api-remote-method.mjs} +50 -46
  40. package/fesm2020/rxap-open-api-remote-method.mjs.map +1 -0
  41. package/{esm2015/lib/schema-validation.mixin.js → fesm2020/rxap-open-api.mjs} +197 -8
  42. package/fesm2020/rxap-open-api.mjs.map +1 -0
  43. package/lib/open-api-config.service.d.ts +6 -4
  44. package/package.json +60 -22
  45. package/remote-method/lib/open-api.remote-method.d.ts +16 -1
  46. package/remote-method/package.json +5 -5
  47. package/src/schematics/open-api/coerce-open-api-project.js +4 -3
  48. package/src/schematics/open-api/coerce-open-api-project.js.map +1 -1
  49. package/src/schematics/open-api/create-directive.js +6 -7
  50. package/src/schematics/open-api/create-directive.js.map +1 -1
  51. package/src/schematics/open-api/generate-data-source.js +1 -1
  52. package/src/schematics/open-api/generate-remote-method.js +5 -2
  53. package/src/schematics/open-api/generate-remote-method.js.map +1 -1
  54. package/src/schematics/open-api/index.js +1 -1
  55. package/src/schematics/open-api/schema.json +6 -0
  56. package/bundles/rxap-open-api-data-source-table.umd.js +0 -534
  57. package/bundles/rxap-open-api-data-source-table.umd.js.map +0 -1
  58. package/bundles/rxap-open-api-data-source.umd.js +0 -548
  59. package/bundles/rxap-open-api-data-source.umd.js.map +0 -1
  60. package/bundles/rxap-open-api-remote-method.umd.js +0 -557
  61. package/bundles/rxap-open-api-remote-method.umd.js.map +0 -1
  62. package/bundles/rxap-open-api.umd.js +0 -868
  63. package/bundles/rxap-open-api.umd.js.map +0 -1
  64. package/esm2015/data-source/lib/error.js +0 -8
  65. package/esm2015/data-source/lib/error.js.map +0 -1
  66. package/esm2015/data-source/lib/open-api-data-source.loader.js +0 -36
  67. package/esm2015/data-source/lib/open-api-data-source.loader.js.map +0 -1
  68. package/esm2015/data-source/lib/open-api.data-source.js.map +0 -1
  69. package/esm2015/data-source/public_api.js +0 -6
  70. package/esm2015/data-source/public_api.js.map +0 -1
  71. package/esm2015/data-source/rxap-open-api-data-source.js +0 -5
  72. package/esm2015/data-source/rxap-open-api-data-source.js.map +0 -1
  73. package/esm2015/data-source/table/lib/error.js +0 -8
  74. package/esm2015/data-source/table/lib/error.js.map +0 -1
  75. package/esm2015/data-source/table/lib/open-api-table.data-source.js +0 -129
  76. package/esm2015/data-source/table/lib/open-api-table.data-source.js.map +0 -1
  77. package/esm2015/data-source/table/lib/to-open-api-table-data-source.pipe.js +0 -29
  78. package/esm2015/data-source/table/lib/to-open-api-table-data-source.pipe.js.map +0 -1
  79. package/esm2015/data-source/table/lib/tokens.js +0 -3
  80. package/esm2015/data-source/table/lib/tokens.js.map +0 -1
  81. package/esm2015/data-source/table/public_api.js +0 -5
  82. package/esm2015/data-source/table/public_api.js.map +0 -1
  83. package/esm2015/data-source/table/rxap-open-api-data-source-table.js +0 -5
  84. package/esm2015/data-source/table/rxap-open-api-data-source-table.js.map +0 -1
  85. package/esm2015/index.js +0 -7
  86. package/esm2015/index.js.map +0 -1
  87. package/esm2015/lib/error.js +0 -7
  88. package/esm2015/lib/error.js.map +0 -1
  89. package/esm2015/lib/open-api-config.service.js +0 -127
  90. package/esm2015/lib/open-api-config.service.js.map +0 -1
  91. package/esm2015/lib/open-api.js +0 -2
  92. package/esm2015/lib/open-api.js.map +0 -1
  93. package/esm2015/lib/schema-validation.mixin.js.map +0 -1
  94. package/esm2015/lib/tokens.js +0 -8
  95. package/esm2015/lib/tokens.js.map +0 -1
  96. package/esm2015/lib/utilities.js +0 -16
  97. package/esm2015/lib/utilities.js.map +0 -1
  98. package/esm2015/remote-method/lib/error.js +0 -8
  99. package/esm2015/remote-method/lib/error.js.map +0 -1
  100. package/esm2015/remote-method/lib/open-api-remote-method.loader.js +0 -37
  101. package/esm2015/remote-method/lib/open-api-remote-method.loader.js.map +0 -1
  102. package/esm2015/remote-method/lib/open-api.remote-method.js +0 -141
  103. package/esm2015/remote-method/lib/open-api.remote-method.js.map +0 -1
  104. package/esm2015/remote-method/public_api.js +0 -4
  105. package/esm2015/remote-method/public_api.js.map +0 -1
  106. package/esm2015/remote-method/rxap-open-api-remote-method.js +0 -5
  107. package/esm2015/remote-method/rxap-open-api-remote-method.js.map +0 -1
  108. package/esm2015/rxap-open-api.js +0 -5
  109. package/esm2015/rxap-open-api.js.map +0 -1
  110. package/fesm2015/rxap-open-api-data-source-table.js.map +0 -1
  111. package/fesm2015/rxap-open-api-data-source.js.map +0 -1
  112. package/fesm2015/rxap-open-api-remote-method.js.map +0 -1
  113. package/fesm2015/rxap-open-api.js.map +0 -1
@@ -0,0 +1,201 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injector, Injectable, Inject, Optional } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import { HttpEventType, HttpClient } from '@angular/common/http';
5
+ import { __awaiter, __decorate, __metadata } from 'tslib';
6
+ import * as i2 from '@rxap/open-api';
7
+ import { OpenApiConfigService, DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA, RXAP_OPEN_API_STRICT_VALIDATOR, DISABLE_SCHEMA_VALIDATION, DISABLE_VALIDATION, SchemaValidationMixin, RxapOpenApiError } from '@rxap/open-api';
8
+ import { BaseHttpRemoteMethod } from '@rxap/remote-method/http';
9
+ import { RxapRemoteMethod } from '@rxap/remote-method';
10
+ import { JoinPath } from '@rxap/utilities';
11
+ import { retry, catchError, filter, tap, take, timeout } from 'rxjs/operators';
12
+ import { throwError } from 'rxjs';
13
+ import { Mixin } from '@rxap/mixin';
14
+
15
+ function RxapOpenApiRemoteMethod(operationOrId, serverIndex = 0) {
16
+ return function (target) {
17
+ var _a;
18
+ const id = typeof operationOrId === 'string' ? operationOrId : ((_a = operationOrId.operation.operationId) !== null && _a !== void 0 ? _a : operationOrId.fallbackId);
19
+ if (!id) {
20
+ throw new Error('The operationId for the open api remote method is not defined');
21
+ }
22
+ const metadata = {
23
+ id,
24
+ serverIndex
25
+ };
26
+ if (typeof operationOrId !== 'string') {
27
+ metadata.operation = operationOrId.operation;
28
+ metadata.serverId = operationOrId.serverId;
29
+ }
30
+ RxapRemoteMethod(metadata)(target);
31
+ };
32
+ }
33
+ let OpenApiRemoteMethod = class OpenApiRemoteMethod extends BaseHttpRemoteMethod {
34
+ constructor(http, injector, openApiConfigService, metadata = null, strict = null, disableSchemaValidation = null, disableValidation = null) {
35
+ var _a, _b;
36
+ super(http, injector, metadata);
37
+ this.strict = false;
38
+ this.disableSchemaValidation = false;
39
+ this.disableValidation = false;
40
+ let operation;
41
+ if (!this.metadata.operation) {
42
+ this.metadata.operation = operation = openApiConfigService.getOperation(this.metadata.id);
43
+ }
44
+ else {
45
+ operation = this.metadata.operation;
46
+ }
47
+ this.applyMetadata({
48
+ id: operation.operationId,
49
+ url: () => JoinPath(openApiConfigService.getBaseUrl(this.metadata.serverIndex, this.metadata.serverId), operation.path),
50
+ method: operation.method,
51
+ withCredentials: (_a = this.metadata.withCredentials) !== null && _a !== void 0 ? _a : true,
52
+ ignoreUndefined: (_b = this.metadata.ignoreUndefined) !== null && _b !== void 0 ? _b : true,
53
+ });
54
+ this.strict = strict || this.metadata.strict || false;
55
+ this.disableSchemaValidation = disableSchemaValidation || this.metadata.disableSchemaValidation || false;
56
+ this.disableValidation = disableValidation || this.metadata.disableValidation || false;
57
+ }
58
+ get operation() {
59
+ return this.metadata.operation;
60
+ }
61
+ _call(args = {}) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ if (!this.disableValidation) {
64
+ this.validateParameters(this.operation, args.parameters, this.strict);
65
+ this.validateRequestBody(this.operation, args.requestBody, this.strict);
66
+ }
67
+ const response = yield this._callWithResponse(args);
68
+ if (response.body) {
69
+ return response.body;
70
+ }
71
+ console.warn('The response body is empty!');
72
+ return null;
73
+ });
74
+ }
75
+ /**
76
+ * Instead of returning the response body the full response object is returned
77
+ */
78
+ callWithResponse(args = {}) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ this.init();
81
+ this.executionsInProgress$.increase();
82
+ const result = yield this._callWithResponse(args);
83
+ this.executionsInProgress$.decrease();
84
+ if (result.body) {
85
+ this.executed$.next(result.body);
86
+ this.executed(result.body);
87
+ }
88
+ return result;
89
+ });
90
+ }
91
+ // TODO : update to the new call method concept (the remove of the _call method concept)
92
+ _callWithResponse(args = {}) {
93
+ var _a;
94
+ if (!this.disableValidation) {
95
+ this.validateParameters(this.operation, args.parameters, this.strict);
96
+ this.validateRequestBody(this.operation, args.requestBody, this.strict);
97
+ }
98
+ return this.http.request(this.updateRequest(this.buildHttpOptions(this.operation, args.parameters, args.requestBody, this.metadata.ignoreUndefined))).pipe(retry((_a = this.metadata.retry) !== null && _a !== void 0 ? _a : 0), catchError((response) => {
99
+ var _a;
100
+ (_a = this.interceptors) === null || _a === void 0 ? void 0 : _a.forEach(interceptor => interceptor
101
+ .next({ response, parameters: args.parameters, requestBody: args.requestBody }));
102
+ return throwError(response);
103
+ }), filter((event) => event.type === HttpEventType.Response), tap((response) => {
104
+ if (this.disableValidation) {
105
+ this.validateResponse(this.operation, response, this.strict);
106
+ }
107
+ }), tap((response) => {
108
+ var _a;
109
+ (_a = this.interceptors) === null || _a === void 0 ? void 0 : _a.forEach(interceptor => interceptor
110
+ .next({ response, parameters: args.parameters, requestBody: args.requestBody }));
111
+ }), take(1), timeout(this.timeout)).toPromise();
112
+ }
113
+ };
114
+ OpenApiRemoteMethod.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiRemoteMethod, deps: [{ token: HttpClient }, { token: Injector }, { token: OpenApiConfigService }, { token: DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA, optional: true }, { token: RXAP_OPEN_API_STRICT_VALIDATOR, optional: true }, { token: DISABLE_SCHEMA_VALIDATION, optional: true }, { token: DISABLE_VALIDATION, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
115
+ OpenApiRemoteMethod.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiRemoteMethod });
116
+ OpenApiRemoteMethod = __decorate([
117
+ Mixin(SchemaValidationMixin),
118
+ __metadata("design:paramtypes", [HttpClient,
119
+ Injector,
120
+ OpenApiConfigService, Object, Object, Object, Object])
121
+ ], OpenApiRemoteMethod);
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiRemoteMethod, decorators: [{
123
+ type: Injectable
124
+ }], ctorParameters: function () {
125
+ return [{ type: i1.HttpClient, decorators: [{
126
+ type: Inject,
127
+ args: [HttpClient]
128
+ }] }, { type: i0.Injector, decorators: [{
129
+ type: Inject,
130
+ args: [Injector]
131
+ }] }, { type: i2.OpenApiConfigService, decorators: [{
132
+ type: Inject,
133
+ args: [OpenApiConfigService]
134
+ }] }, { type: undefined, decorators: [{
135
+ type: Optional
136
+ }, {
137
+ type: Inject,
138
+ args: [DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA]
139
+ }] }, { type: undefined, decorators: [{
140
+ type: Optional
141
+ }, {
142
+ type: Inject,
143
+ args: [RXAP_OPEN_API_STRICT_VALIDATOR]
144
+ }] }, { type: undefined, decorators: [{
145
+ type: Optional
146
+ }, {
147
+ type: Inject,
148
+ args: [DISABLE_SCHEMA_VALIDATION]
149
+ }] }, { type: undefined, decorators: [{
150
+ type: Optional
151
+ }, {
152
+ type: Inject,
153
+ args: [DISABLE_VALIDATION]
154
+ }] }];
155
+ } });
156
+
157
+ class OpenApiRemoteMethodLoader {
158
+ constructor(openApiConfig, http, injector) {
159
+ this.openApiConfig = openApiConfig;
160
+ this.http = http;
161
+ this.injector = injector;
162
+ }
163
+ load(definitionId) {
164
+ const operation = this.openApiConfig.getOperation(definitionId);
165
+ if (operation) {
166
+ return new OpenApiRemoteMethod(this.http, this.injector, this.openApiConfig, {
167
+ id: definitionId,
168
+ operation
169
+ });
170
+ }
171
+ return null;
172
+ }
173
+ }
174
+ OpenApiRemoteMethodLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiRemoteMethodLoader, deps: [{ token: OpenApiConfigService }, { token: HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
175
+ OpenApiRemoteMethodLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiRemoteMethodLoader, providedIn: 'root' });
176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiRemoteMethodLoader, decorators: [{
177
+ type: Injectable,
178
+ args: [{ providedIn: 'root' }]
179
+ }], ctorParameters: function () {
180
+ return [{ type: i2.OpenApiConfigService, decorators: [{
181
+ type: Inject,
182
+ args: [OpenApiConfigService]
183
+ }] }, { type: i1.HttpClient, decorators: [{
184
+ type: Inject,
185
+ args: [HttpClient]
186
+ }] }, { type: i0.Injector }];
187
+ } });
188
+
189
+ class RxapOpenApiRemoteMethodError extends RxapOpenApiError {
190
+ constructor(message, code, scope) {
191
+ super(message, code, scope);
192
+ this.addSubPackageName('remote-method');
193
+ }
194
+ }
195
+
196
+ /**
197
+ * Generated bundle index. Do not edit.
198
+ */
199
+
200
+ export { OpenApiRemoteMethod, OpenApiRemoteMethodLoader, RxapOpenApiRemoteMethod, RxapOpenApiRemoteMethodError };
201
+ //# sourceMappingURL=rxap-open-api-remote-method.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rxap-open-api-remote-method.mjs","sources":["../../../../libs/open-api/remote-method/src/lib/open-api.remote-method.ts","../../../../libs/open-api/remote-method/src/lib/open-api-remote-method.loader.ts","../../../../libs/open-api/remote-method/src/lib/error.ts","../../../../libs/open-api/remote-method/src/rxap-open-api-remote-method.ts"],"sourcesContent":["import {\n Inject,\n Injector,\n Optional,\n Injectable\n} from '@angular/core';\nimport {\n HttpClient,\n HttpResponse,\n HttpEventType,\n HttpErrorResponse\n} from '@angular/common/http';\nimport {\n OperationObjectWithMetadata,\n OpenApiConfigService,\n SchemaValidationMixin,\n RXAP_OPEN_API_STRICT_VALIDATOR,\n DEFAULT_OPEN_API_REMOTE_METHOD_META_DATA,\n DISABLE_SCHEMA_VALIDATION,\n DISABLE_VALIDATION\n} from '@rxap/open-api';\nimport { BaseHttpRemoteMethod } from '@rxap/remote-method/http';\nimport {\n BaseRemoteMethodMetadata,\n RxapRemoteMethod\n} from '@rxap/remote-method';\nimport { JoinPath } from '@rxap/utilities';\nimport {\n filter,\n timeout,\n retry,\n catchError,\n tap,\n take\n} from 'rxjs/operators';\nimport { throwError } from 'rxjs';\nimport { Mixin } from '@rxap/mixin';\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 function RxapOpenApiRemoteMethod(operationOrId: string | OperationForMetadata, serverIndex: number = 0) {\n return function(target: any) {\n const id = typeof operationOrId === 'string' ? operationOrId : (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 interface OpenApiRemoteMethodMetadata extends BaseRemoteMethodMetadata {\n /**\n * The operation object with path and method\n */\n operation?: OperationObjectWithMetadata;\n /**\n * The index of the server object in the servers array in the open api config\n */\n serverIndex?: number;\n /**\n * used to specify the target server for the reset api operation\n */\n serverId?: string;\n id: string;\n}\n\nexport interface OpenApiRemoteMethodParameter<Parameters extends Record<string, any> | void = any, RequestBody = any> {\n parameters?: Parameters,\n requestBody?: RequestBody\n}\n\nexport interface OpenApiRemoteMethod<Response = any, Parameters extends Record<string, any> | void = any, RequestBody = any>\n extends SchemaValidationMixin<Response, Parameters, RequestBody> {}\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 public get operation(): OperationObjectWithMetadata {\n return this.metadata.operation;\n }\n\n private readonly strict: boolean = false;\n protected readonly disableSchemaValidation: boolean = false;\n protected readonly disableValidation: 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 let operation: OperationObjectWithMetadata & { serverId?: string };\n if (!this.metadata.operation) {\n this.metadata.operation = operation = openApiConfigService.getOperation(this.metadata.id);\n } else {\n operation = this.metadata.operation;\n }\n this.applyMetadata({\n id: operation.operationId,\n url: () => JoinPath(openApiConfigService.getBaseUrl(this.metadata.serverIndex, this.metadata.serverId), 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 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 const response = await this._callWithResponse(args);\n\n if (response.body) {\n return response.body;\n }\n\n console.warn('The response body is empty!');\n return null as any;\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 this.http.request<Response>(this.updateRequest(this.buildHttpOptions(this.operation, args.parameters, args.requestBody, this.metadata.ignoreUndefined))).pipe(\n retry(this.metadata.retry ?? 0),\n catchError((response: HttpErrorResponse) => {\n this.interceptors?.forEach(interceptor => interceptor\n .next({ response, parameters: args.parameters, requestBody: args.requestBody })\n );\n return throwError(response);\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({ response, parameters: args.parameters, requestBody: args.requestBody })\n );\n }),\n take(1),\n timeout(this.timeout)\n ).toPromise();\n\n }\n\n}\n","import {\n Injectable,\n Injector,\n Inject\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 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","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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;SAkDgB,uBAAuB,CAAC,aAA4C,EAAE,cAAsB,CAAC;IAC3G,OAAO,UAAS,MAAW;;QACzB,MAAM,EAAE,GAAG,OAAO,aAAa,KAAK,QAAQ,GAAG,aAAa,IAAI,MAAA,aAAa,CAAC,SAAS,CAAC,WAAW,mCAAI,aAAa,CAAC,UAAU,CAAC,CAAC;QACjI,IAAI,CAAC,EAAE,EAAE;YACP,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;SAClF;QACD,MAAM,QAAQ,GAAgC;YAC5C,EAAE;YACF,WAAW;SACZ,CAAC;QACF,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;YACrC,QAAQ,CAAC,SAA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Aa,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAEhE,IAAI,SAAS,EAAE;YAEb,OAAO,IAAI,mBAAmB,CAC5B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,aAAa,EAClB;gBACE,EAAE,EAAE,YAAY;gBAChB,SAAS;aACV,CACF,CAAC;SAEH;QAED,OAAO,IAAI,CAAC;KAEb;;sHA3BU,yBAAyB,kBAG1B,oBAAoB,aACpB,UAAU;0HAJT,yBAAyB,cADZ,MAAM;2FACnB,yBAAyB;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;8BAI7B,MAAM;+BAAC,oBAAoB;;8BAC3B,MAAM;+BAAC,UAAU;;;;MCZT,qCAAqC,gBAAgB;IAEhE,YAAY,OAAe,EAAE,IAAa,EAAE,KAAc;QACxD,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5B,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;KACzC;;;ACPH;;;;;;"}
@@ -36,12 +36,14 @@ function AssertOpenApiV3(obj) {
36
36
  class OpenApiConfigService {
37
37
  constructor(config = null) {
38
38
  this.defaultServerIndex = OpenApiConfigService.DefaultServerIndex;
39
+ this._operations = null;
40
+ this.serverConfigMap = new Map();
41
+ this._config = null;
39
42
  config = config !== null && config !== void 0 ? config : OpenApiConfigService.Config;
40
- if (!config) {
41
- throw new Error('Could not load open api config');
43
+ if (config) {
44
+ this._config = config;
45
+ this._operations = OpenApiConfigService.LoadOperations(config);
42
46
  }
43
- this.config = config;
44
- this._operations = OpenApiConfigService.LoadOperations(config);
45
47
  }
46
48
  /**
47
49
  * Used to load the app open api config from a remote resource.
@@ -123,37 +125,70 @@ class OpenApiConfigService {
123
125
  static ExpandOpenApi(config) {
124
126
  return Promise.resolve(config);
125
127
  }
128
+ get config() {
129
+ if (!this._config) {
130
+ throw new Error('Could not load open api config');
131
+ }
132
+ return this._config;
133
+ }
126
134
  getOperation(operationId) {
135
+ if (!this._operations) {
136
+ if (!this._config) {
137
+ throw new Error('The operations map is not loaded and the config object is not loaded');
138
+ }
139
+ this._operations = OpenApiConfigService.LoadOperations(this._config);
140
+ }
127
141
  if (!this._operations.has(operationId)) {
128
142
  console.debug(`The operation '${operationId}' is not defined in the openapi-json`, this.config);
129
143
  throw new Error(`The operation '${operationId}' is not defined in the openapi-json`);
130
144
  }
131
145
  return this._operations.get(operationId);
132
146
  }
133
- getBaseUrl(serverIndex = this.defaultServerIndex) {
147
+ getBaseUrl(serverIndex = this.defaultServerIndex, serverId) {
148
+ var _a;
149
+ let serverConfig;
150
+ if (!serverId && ((_a = this._config) === null || _a === void 0 ? void 0 : _a.servers)) {
151
+ serverConfig = this._config.servers[serverIndex];
152
+ }
153
+ if (this.serverConfigMap.has(serverId)) {
154
+ serverConfig = this.serverConfigMap.get(serverId)[serverIndex];
155
+ }
156
+ if (!serverConfig) {
157
+ throw new Error(`Could not determine the base url with the index: ${serverIndex} and the serverId: ${serverId}`);
158
+ }
134
159
  return OpenApiConfigService.GetBaseUrl(this.config, serverIndex);
135
160
  }
136
- insertServer(serverConfig, index = this.defaultServerIndex) {
137
- if (!this.config.servers) {
138
- this.config.servers = [];
161
+ insertServer(serverConfig, index = this.defaultServerIndex, serverId) {
162
+ if (this._config) {
163
+ if (!this.config.servers) {
164
+ this.config.servers = [];
165
+ }
166
+ this.config.servers.splice(index, 1, serverConfig);
139
167
  }
140
- this.config.servers.splice(index, 1, serverConfig);
168
+ if (!this.serverConfigMap.has(serverId)) {
169
+ this.serverConfigMap.set(serverId, []);
170
+ }
171
+ const list = this.serverConfigMap.get(serverId);
172
+ list[index] = serverConfig;
173
+ this.serverConfigMap.set(serverId, list);
141
174
  }
142
175
  }
143
176
  OpenApiConfigService.Config = null;
144
177
  OpenApiConfigService.DefaultServerIndex = 0;
145
178
  OpenApiConfigService._operations = null;
146
- OpenApiConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OpenApiConfigService, deps: [{ token: RXAP_OPEN_API_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
147
- OpenApiConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OpenApiConfigService, providedIn: 'root' });
148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OpenApiConfigService, decorators: [{
179
+ OpenApiConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiConfigService, deps: [{ token: RXAP_OPEN_API_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
180
+ OpenApiConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiConfigService, providedIn: 'root' });
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiConfigService, decorators: [{
149
182
  type: Injectable,
150
183
  args: [{ providedIn: 'root' }]
151
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
152
- type: Optional
153
- }, {
154
- type: Inject,
155
- args: [RXAP_OPEN_API_CONFIG]
156
- }] }]; } });
184
+ }], ctorParameters: function () {
185
+ return [{ type: undefined, decorators: [{
186
+ type: Optional
187
+ }, {
188
+ type: Inject,
189
+ args: [RXAP_OPEN_API_CONFIG]
190
+ }] }];
191
+ } });
157
192
 
158
193
  class SchemaValidationMixin {
159
194
  /**
@@ -220,8 +255,8 @@ class SchemaValidationMixin {
220
255
  * @protected
221
256
  */
222
257
  validateResponse(operation, response, strict = false) {
223
- // region only validate the response if the content type is undefined or application/json
224
258
  var _a;
259
+ // region only validate the response if the content type is undefined or application/json
225
260
  const contentType = response.headers.get('Content-Type');
226
261
  if (contentType && contentType !== 'application/json') {
227
262
  if (isDevMode()) {
@@ -411,4 +446,4 @@ SchemaValidationMixin.STRICT = false;
411
446
  */
412
447
 
413
448
  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, RXAP_OPEN_API_CONFIG, RXAP_OPEN_API_STRICT_VALIDATOR, RxapOpenApiError, SchemaValidationMixin };
414
- //# sourceMappingURL=rxap-open-api.js.map
449
+ //# sourceMappingURL=rxap-open-api.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rxap-open-api.mjs","sources":["../../../../libs/open-api/src/lib/tokens.ts","../../../../libs/open-api/src/lib/error.ts","../../../../libs/open-api/src/lib/utilities.ts","../../../../libs/open-api/src/lib/open-api-config.service.ts","../../../../libs/open-api/src/lib/schema-validation.mixin.ts","../../../../libs/open-api/src/rxap-open-api.ts"],"sourcesContent":["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('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');\nexport const DISABLE_VALIDATION = new InjectionToken<boolean>('rxap/open-api/disable-validation');\n","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 { 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 Injectable,\n Inject,\n Optional\n} from '@angular/core';\nimport { OperationObjectWithMetadata } from './open-api';\nimport { RXAP_OPEN_API_CONFIG } from './tokens';\nimport {\n OpenAPIV3,\n OpenAPI\n} from 'openapi-types';\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: number = 0;\n\n private static _operations: OperationMap | null = null;\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: string = '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 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 public defaultServerIndex: number = OpenApiConfigService.DefaultServerIndex;\n\n private _operations: OperationMap | null = null;\n\n private serverConfigMap = new Map<string | undefined, OpenAPIV3.ServerObject[]>();\n\n private _config: OpenAPIV3.Document | null = null;\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 }\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.debug(\n `The operation '${operationId}' is not defined in the openapi-json`,\n this.config\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 if (!serverId && this._config?.servers) {\n serverConfig = this._config.servers[serverIndex];\n }\n if (this.serverConfigMap.has(serverId)) {\n serverConfig = this.serverConfigMap.get(serverId)![serverIndex];\n }\n if (!serverConfig) {\n throw new Error(`Could not determine the base url with the index: ${serverIndex} and the serverId: ${serverId}`);\n }\n return OpenApiConfigService.GetBaseUrl(this.config, serverIndex);\n }\n\n public insertServer(\n serverConfig: OpenAPIV3.ServerObject,\n index: number = this.defaultServerIndex,\n serverId?: string\n ): void {\n if (this._config) {\n if (!this.config.servers) {\n this.config.servers = [];\n }\n this.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","import {\n coerceArray,\n isPromiseLike,\n IsRecord,\n clone\n} from '@rxap/utilities';\nimport { isDevMode } from '@angular/core';\nimport * as Ajv from 'ajv-oai';\nimport {\n HttpParams,\n HttpHeaders\n} from '@angular/common/http';\nimport {\n NotContainsReferenceObjects,\n IsReferenceObject\n} from './utilities';\nimport { OperationObjectWithMetadata } from './open-api';\nimport { RxapOpenApiError } from './error';\nimport { OpenAPIV3 } from 'openapi-types';\nimport { HttpRemoteMethodParameter } from '@rxap/remote-method/http';\n\nexport interface SchemaValidationResponse<Data> {\n headers: Record<string, any>;\n status: number;\n body?: Data | null;\n data?: Data;\n}\n\nexport class SchemaValidationMixin<Response = any, Parameters extends Record<string, any> | void = any, RequestBody = any> {\n\n public static STRICT: boolean = 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: boolean = 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 && parameter.in !== '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(`The parameter '${parameter.name}' is not valid against the schema!`, strict, parameter.schema, value);\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(`The operation ${operation.operationId} does not expect any parameters. But a parameter is provided.`, parameters);\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(operation: OperationObjectWithMetadata, response: SchemaValidationResponse<Response>, strict: boolean = false): 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 && responseObject.content['application/json'] && 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: boolean = 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(message: string, strict: boolean, schema?: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject, value?: any) {\n if (isDevMode() && schema !== undefined) {\n // tslint:disable-next-line:no-console\n console.debug(message, { schema, value });\n }\n if (strict || SchemaValidationMixin.STRICT) {\n throw new RxapOpenApiError(message, '', 'SchemaValidationMixin');\n } else {\n console.warn(message);\n }\n }\n\n public buildHttpParams(operationParameters: OpenAPIV3.ParameterObject[], parameters?: Parameters, ignoreUndefined = true): 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, first);\n\n for (const item of value) {\n params = params.append(parameterName, item);\n }\n\n }\n\n } else {\n params = params.set(parameter.name, 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 let headers = new HttpHeaders();\n\n if (IsRecord(parameters)) {\n\n for (const parameter of operationParameters.filter(p => p.in === 'header')) {\n\n if (parameters.hasOwnProperty(parameter.name)) {\n\n const value = parameters[ parameter.name ];\n\n if (Array.isArray(value)) {\n\n if (value.length) {\n\n const first = value.shift();\n\n headers = headers.set(parameters.name, first);\n\n for (const item of value) {\n headers = headers.append(parameters.name, item);\n }\n\n }\n\n } else {\n headers = headers.set(parameter.name, value);\n }\n\n }\n\n }\n\n }\n\n return headers;\n\n }\n\n public buildHttpPathParams(operationParameters: OpenAPIV3.ParameterObject[], parameters?: Parameters): 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 (parameters.hasOwnProperty(parameter.name)) {\n pathParams[ parameter.name ] = encodeURIComponent(parameters[ parameter.name ]);\n }\n\n }\n\n }\n\n return pathParams;\n\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(operation: OperationObjectWithMetadata, parameters?: Parameters, requestBody?: RequestBody, ignoreUndefined = true): 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 options.body = requestBody;\n }\n\n return options;\n\n }\n\n private validate(schema: string | boolean | object, value: any): boolean {\n\n if (this.disableSchemaValidation) {\n return true;\n }\n\n let result: boolean | PromiseLike<any>;\n\n try {\n result = new Ajv().validate(schema, clone(value));\n } catch (e: any) {\n console.error(e.message);\n return false;\n }\n\n if (isPromiseLike(result)) {\n throw new Error('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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;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,CAAC,CAAC;YACzB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,uGAAuG,CAAC,CAAC;SAC1H;QAED,OAAO,MAAM,CAAC;KACf;;AAjWa,4BAAM,GAAY,KAAK;;AC9BvC;;;;;;"}
@@ -26,17 +26,15 @@ class OpenApiTableDataSource extends AbstractTableDataSource {
26
26
  }
27
27
  }
28
28
  tableEventToOpenApiParameters(event) {
29
- var _a, _b;
30
29
  return {
31
30
  page: event.page.pageIndex,
32
31
  size: event.page.pageSize,
33
- sortBy: (_a = event.sort) === null || _a === void 0 ? void 0 : _a.active,
34
- direction: (_b = event.sort) === null || _b === void 0 ? void 0 : _b.direction,
32
+ sortBy: event.sort?.active,
33
+ direction: event.sort?.direction,
35
34
  filter: event.filter,
36
35
  };
37
36
  }
38
37
  _connect(viewer) {
39
- var _a, _b, _c, _d, _e, _f, _g;
40
38
  this.assertPaginator();
41
39
  if (viewer.viewChange && viewer.viewChange !== EMPTY) {
42
40
  console.warn('The viewChange property is readonly');
@@ -54,11 +52,11 @@ class OpenApiTableDataSource extends AbstractTableDataSource {
54
52
  console.warn('The page size is not defined!');
55
53
  }
56
54
  }), filter((page) => typeof page.pageSize === 'number')),
57
- (_e = (_b = (_a = this.sort) === null || _a === void 0 ? void 0 : _a.sortChange) === null || _b === void 0 ? void 0 : _b.pipe(startWith({
58
- active: (_c = this.sort) === null || _c === void 0 ? void 0 : _c.active,
59
- direction: (_d = this.sort) === null || _d === void 0 ? void 0 : _d.direction,
60
- }))) !== null && _e !== void 0 ? _e : of(null),
61
- (_g = (_f = this.filter) === null || _f === void 0 ? void 0 : _f.change) !== null && _g !== void 0 ? _g : of(null),
55
+ this.sort?.sortChange?.pipe(startWith({
56
+ active: this.sort?.active,
57
+ direction: this.sort?.direction,
58
+ })) ?? of(null),
59
+ this.filter?.change ?? of(null),
62
60
  ]).pipe(map(([page, sort, filter]) => ({ page, sort, filter })), switchMap((event) => {
63
61
  const options = this.tableEventToOpenApiParameters(event);
64
62
  if (isPromise(options) || isObservable(options)) {
@@ -92,9 +90,9 @@ class OpenApiTableDataSource extends AbstractTableDataSource {
92
90
  ];
93
91
  }
94
92
  }
95
- OpenApiTableDataSource.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OpenApiTableDataSource, deps: [{ token: RXAP_TABLE_DATA_SOURCE }, { token: RXAP_TABLE_DATA_SOURCE_PAGINATOR, optional: true }, { token: RXAP_OPEN_API_TABLE_DATA_SOURCE_TO_PARAMETERS_FUNCTION, optional: true }, { token: RXAP_TABLE_DATA_SOURCE_SORT, optional: true }, { token: RXAP_TABLE_DATA_SOURCE_FILTER, optional: true }, { token: RXAP_TABLE_DATA_SOURCE_PARAMETERS, optional: true }, { token: RXAP_DATA_SOURCE_METADATA, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
96
- OpenApiTableDataSource.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OpenApiTableDataSource });
97
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OpenApiTableDataSource, decorators: [{
93
+ OpenApiTableDataSource.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiTableDataSource, deps: [{ token: RXAP_TABLE_DATA_SOURCE }, { token: RXAP_TABLE_DATA_SOURCE_PAGINATOR, optional: true }, { token: RXAP_OPEN_API_TABLE_DATA_SOURCE_TO_PARAMETERS_FUNCTION, optional: true }, { token: RXAP_TABLE_DATA_SOURCE_SORT, optional: true }, { token: RXAP_TABLE_DATA_SOURCE_FILTER, optional: true }, { token: RXAP_TABLE_DATA_SOURCE_PARAMETERS, optional: true }, { token: RXAP_DATA_SOURCE_METADATA, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
94
+ OpenApiTableDataSource.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiTableDataSource });
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: OpenApiTableDataSource, decorators: [{
98
96
  type: Injectable
99
97
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
100
98
  type: Inject,
@@ -141,9 +139,9 @@ class ToOpenApiTableDataSourcePipe {
141
139
  return new OpenApiTableDataSource(dataSource, paginator, tableEventToOpenApiParameters, sort, filter);
142
140
  }
143
141
  }
144
- ToOpenApiTableDataSourcePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToOpenApiTableDataSourcePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
145
- ToOpenApiTableDataSourcePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToOpenApiTableDataSourcePipe, name: "toOpenApiTableDataSource" });
146
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToOpenApiTableDataSourcePipe, decorators: [{
142
+ ToOpenApiTableDataSourcePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ToOpenApiTableDataSourcePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
143
+ ToOpenApiTableDataSourcePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ToOpenApiTableDataSourcePipe, name: "toOpenApiTableDataSource" });
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ToOpenApiTableDataSourcePipe, decorators: [{
147
145
  type: Pipe,
148
146
  args: [{
149
147
  name: 'toOpenApiTableDataSource'
@@ -151,10 +149,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
151
149
  }] });
152
150
  class ToOpenApiTableDataSourcePipeModule {
153
151
  }
154
- ToOpenApiTableDataSourcePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToOpenApiTableDataSourcePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
155
- ToOpenApiTableDataSourcePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToOpenApiTableDataSourcePipeModule, declarations: [ToOpenApiTableDataSourcePipe], exports: [ToOpenApiTableDataSourcePipe] });
156
- ToOpenApiTableDataSourcePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToOpenApiTableDataSourcePipeModule });
157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToOpenApiTableDataSourcePipeModule, decorators: [{
152
+ ToOpenApiTableDataSourcePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ToOpenApiTableDataSourcePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
153
+ ToOpenApiTableDataSourcePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ToOpenApiTableDataSourcePipeModule, declarations: [ToOpenApiTableDataSourcePipe], exports: [ToOpenApiTableDataSourcePipe] });
154
+ ToOpenApiTableDataSourcePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ToOpenApiTableDataSourcePipeModule });
155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ToOpenApiTableDataSourcePipeModule, decorators: [{
158
156
  type: NgModule,
159
157
  args: [{
160
158
  exports: [ToOpenApiTableDataSourcePipe],
@@ -167,4 +165,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
167
165
  */
168
166
 
169
167
  export { OpenApiTableDataSource, RXAP_OPEN_API_TABLE_DATA_SOURCE_TO_PARAMETERS_FUNCTION, RxapOpenApiDataSourceTableError, RxapOpenApiTableDataSource, ToOpenApiTableDataSourcePipe, ToOpenApiTableDataSourcePipeModule };
170
- //# sourceMappingURL=rxap-open-api-data-source-table.js.map
168
+ //# sourceMappingURL=rxap-open-api-data-source-table.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rxap-open-api-data-source-table.mjs","sources":["../../../../libs/open-api/data-source/table/src/lib/error.ts","../../../../libs/open-api/data-source/table/src/lib/tokens.ts","../../../../libs/open-api/data-source/table/src/lib/open-api-table.data-source.ts","../../../../libs/open-api/data-source/table/src/lib/to-open-api-table-data-source.pipe.ts","../../../../libs/open-api/data-source/table/src/rxap-open-api-data-source-table.ts"],"sourcesContent":["import { RxapOpenApiDataSourceError } from '@rxap/open-api/data-source';\n\nexport class RxapOpenApiDataSourceTableError extends RxapOpenApiDataSourceError {\n\n constructor(message: string, code?: string, scope?: string) {\n super(message, code, scope);\n this.addSubPackageName('table');\n }\n\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const RXAP_OPEN_API_TABLE_DATA_SOURCE_TO_PARAMETERS_FUNCTION = new InjectionToken('rxap/open-api/data-source/table/to-parameters-function')\n","import {\n AbstractTableDataSource,\n RXAP_TABLE_DATA_SOURCE,\n RXAP_TABLE_DATA_SOURCE_PAGINATOR,\n RXAP_TABLE_DATA_SOURCE_SORT,\n SortLike,\n RXAP_TABLE_DATA_SOURCE_FILTER,\n FilterLike,\n Sort,\n AbstractTableDataSourceMetadata,\n RxapAbstractTableDataSource,\n RXAP_TABLE_DATA_SOURCE_PARAMETERS\n} from '@rxap/data-source/table';\nimport {\n Injectable,\n Inject,\n Optional\n} from '@angular/core';\nimport {\n RXAP_DATA_SOURCE_METADATA,\n BaseDataSourceViewer\n} from '@rxap/data-source';\nimport {\n PaginatorLike,\n PageEvent\n} from '@rxap/data-source/pagination';\nimport { PaginationData } from '@rxap/data-source/http/pagination';\nimport {\n Observable,\n TeardownLogic,\n EMPTY,\n combineLatest,\n of,\n isObservable\n} from 'rxjs';\nimport { RxapOpenApiDataSourceTableError } from './error';\nimport {\n startWith,\n tap,\n filter as rxjsFilter,\n map,\n switchMap\n} from 'rxjs/operators';\nimport { RXAP_OPEN_API_TABLE_DATA_SOURCE_TO_PARAMETERS_FUNCTION } from './tokens';\nimport {\n Constructor,\n isPromise\n} from '@rxap/utilities';\nimport type { OpenApiDataSource } from '@rxap/open-api/data-source';\nimport { OpenApiDataSourceViewer } from '@rxap/open-api/data-source';\n\nexport interface TableEvent {\n page: PageEvent;\n sort: Sort | null;\n filter: Record<string, any> | string | null;\n}\n\nexport interface OpenApiTableDataSourceViewer extends BaseDataSourceViewer {\n readonly viewChange: Observable<TableEvent>;\n}\n\nexport interface OpenApiTableDataSourceMetadata\n extends AbstractTableDataSourceMetadata {}\n\nexport type TableEventToOpenApiParametersFunction<\n Parameters extends Record<string, any>\n> = (\n event: TableEvent\n) => Parameters | Observable<Parameters> | Promise<Parameters>;\n\n@Injectable()\nexport class OpenApiTableDataSource<\n Data extends object = any,\n Parameters extends Record<string, any> = any\n> extends AbstractTableDataSource<Data> {\n constructor(\n @Inject(RXAP_TABLE_DATA_SOURCE)\n private readonly dataSource: OpenApiDataSource<PaginationData<Data>>,\n @Optional()\n @Inject(RXAP_TABLE_DATA_SOURCE_PAGINATOR)\n paginator: PaginatorLike | null = null,\n @Optional()\n @Inject(RXAP_OPEN_API_TABLE_DATA_SOURCE_TO_PARAMETERS_FUNCTION)\n tableEventToOpenApiParameters: any | null = null,\n @Optional()\n @Inject(RXAP_TABLE_DATA_SOURCE_SORT)\n sort: SortLike | null = null,\n @Optional()\n @Inject(RXAP_TABLE_DATA_SOURCE_FILTER)\n filter: FilterLike | null = null,\n @Optional()\n @Inject(RXAP_TABLE_DATA_SOURCE_PARAMETERS)\n parameters: Observable<Parameters> | null = null,\n @Optional()\n @Inject(RXAP_DATA_SOURCE_METADATA)\n metadata: OpenApiTableDataSourceMetadata | null = dataSource.metadata\n ) {\n super(paginator, sort, filter, parameters, metadata);\n if (tableEventToOpenApiParameters) {\n this.tableEventToOpenApiParameters = tableEventToOpenApiParameters;\n }\n }\n\n public tableEventToOpenApiParameters(\n event: TableEvent\n ): Parameters | Observable<Parameters> | Promise<Parameters> {\n return {\n page: event.page.pageIndex,\n size: event.page.pageSize,\n sortBy: event.sort?.active,\n direction: event.sort?.direction,\n filter: event.filter,\n } as any;\n }\n\n protected _connect(\n viewer: OpenApiDataSourceViewer\n ): [Observable<Data[]>, TeardownLogic] {\n this.assertPaginator();\n\n if (viewer.viewChange && viewer.viewChange !== EMPTY) {\n console.warn('The viewChange property is readonly');\n }\n\n if (this.paginator === undefined || this.paginator.page === undefined) {\n throw new RxapOpenApiDataSourceTableError(\n 'The paginator instance has not a page property',\n ''\n );\n }\n\n viewer.viewChange = combineLatest([\n this.paginator.page.pipe(\n startWith({\n pageIndex: this.paginator.pageIndex,\n pageSize: this.paginator.pageSize,\n length: this.paginator.length,\n }),\n tap((page) => {\n if (typeof page.pageSize !== 'number') {\n console.warn('The page size is not defined!');\n }\n }),\n rxjsFilter((page) => typeof page.pageSize === 'number')\n ),\n this.sort?.sortChange?.pipe(\n startWith({\n active: this.sort?.active,\n direction: this.sort?.direction,\n })\n ) ?? of(null),\n this.filter?.change ?? of(null),\n ]).pipe(\n map(([page, sort, filter]) => ({ page, sort, filter })),\n switchMap((event) => {\n const options = this.tableEventToOpenApiParameters(event);\n if (isPromise(options) || isObservable(options)) {\n return options;\n }\n return of(options);\n })\n );\n\n return [\n this.dataSource.connect(viewer).pipe(\n tap((paginationData) => {\n if (typeof paginationData !== 'object') {\n throw new RxapOpenApiDataSourceTableError(\n 'The open api data source does not return a PaginationData object. Value is not an object',\n ''\n );\n }\n if (!paginationData.hasOwnProperty('total')) {\n throw new RxapOpenApiDataSourceTableError(\n 'The open api data source does not return a PaginationData object. Object has not the property total',\n ''\n );\n }\n if (\n !paginationData.hasOwnProperty('data') &&\n !Array.isArray(paginationData.data)\n ) {\n throw new RxapOpenApiDataSourceTableError(\n 'The open api data source does not return a PaginationData object. Object has not the property data' +\n ' property of the value not an array',\n ''\n );\n }\n if (\n paginationData.size !== undefined &&\n paginationData.size !== this.paginator!.pageSize\n ) {\n console.warn(\n 'The selected page size from the paginator is not equal to the page size from the PaginationData object'\n );\n }\n if (\n paginationData.page !== undefined &&\n paginationData.page !== this.paginator!.pageIndex\n ) {\n console.warn(\n 'The selected page index from the paginator is not equal to the page index from the PaginationData object'\n );\n }\n }),\n tap((paginationData) => this.updateTotalLength(paginationData.total)),\n map((paginationData) => paginationData.data)\n ),\n () => this.dataSource.disconnect(viewer),\n ];\n }\n}\n\nexport function RxapOpenApiTableDataSource<\n Data extends object,\n Parameters extends Record<string, any>\n>(\n metadata: OpenApiTableDataSourceMetadata,\n className: string = 'OpenApiTableDataSource',\n packageName: string = '@rxap/open-api/data-source/table'\n) {\n return function (\n target: Constructor<OpenApiTableDataSource<Data, Parameters>>\n ) {\n RxapAbstractTableDataSource(metadata, className, packageName)(target);\n };\n}\n","import {\n Pipe,\n PipeTransform,\n NgModule\n} from '@angular/core';\nimport { PaginationData } from '@rxap/data-source/http/pagination';\nimport { PaginatorLike } from '@rxap/data-source/pagination';\nimport {\n SortLike,\n FilterLike\n} from '@rxap/data-source/table';\nimport { OpenApiDataSource } from '@rxap/open-api/data-source';\nimport {\n OpenApiTableDataSource,\n TableEventToOpenApiParametersFunction\n} from './open-api-table.data-source';\n\n@Pipe({\n name: 'toOpenApiTableDataSource'\n})\nexport class ToOpenApiTableDataSourcePipe implements PipeTransform {\n\n public transform<Data extends object, Parameters extends Record<string, any>>(\n dataSource: OpenApiDataSource<PaginationData<Data>>,\n paginator: PaginatorLike,\n tableEventToOpenApiParameters?: TableEventToOpenApiParametersFunction<Parameters>,\n sort?: SortLike,\n filter?: FilterLike\n ): OpenApiTableDataSource<Data> {\n return new OpenApiTableDataSource(dataSource, paginator, tableEventToOpenApiParameters, sort, filter);\n }\n\n}\n\n@NgModule({\n exports: [ ToOpenApiTableDataSourcePipe ],\n declarations: [ ToOpenApiTableDataSourcePipe ]\n})\nexport class ToOpenApiTableDataSourcePipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["rxjsFilter"],"mappings":";;;;;;;;;;MAEa,+BAAgC,SAAQ,0BAA0B;IAE7E,YAAY,OAAe,EAAE,IAAa,EAAE,KAAc;QACxD,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5B,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;KACjC;;;MCLU,sDAAsD,GAAG,IAAI,cAAc,CAAC,wDAAwD;;MCqEpI,sBAGX,SAAQ,uBAA6B;IACrC,YAEmB,UAAmD,EAGpE,YAAkC,IAAI,EAGtC,gCAA4C,IAAI,EAGhD,OAAwB,IAAI,EAG5B,SAA4B,IAAI,EAGhC,aAA4C,IAAI,EAGhD,WAAkD,UAAU,CAAC,QAAQ;QAErE,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QApBpC,eAAU,GAAV,UAAU,CAAyC;QAqBpE,IAAI,6BAA6B,EAAE;YACjC,IAAI,CAAC,6BAA6B,GAAG,6BAA6B,CAAC;SACpE;KACF;IAEM,6BAA6B,CAClC,KAAiB;QAEjB,OAAO;YACL,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS;YAC1B,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ;YACzB,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM;YAC1B,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS;YAChC,MAAM,EAAE,KAAK,CAAC,MA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