@carlonicora/nestjs-neo4jsonapi 1.22.0 → 1.23.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.
Files changed (83) hide show
  1. package/dist/bootstrap/app.module.factory.d.ts.map +1 -1
  2. package/dist/bootstrap/app.module.factory.js +3 -0
  3. package/dist/bootstrap/app.module.factory.js.map +1 -1
  4. package/dist/bootstrap/bootstrap.d.ts.map +1 -1
  5. package/dist/bootstrap/bootstrap.js +85 -2
  6. package/dist/bootstrap/bootstrap.js.map +1 -1
  7. package/dist/bootstrap/bootstrap.options.d.ts +47 -0
  8. package/dist/bootstrap/bootstrap.options.d.ts.map +1 -1
  9. package/dist/bootstrap/index.d.ts +1 -1
  10. package/dist/bootstrap/index.d.ts.map +1 -1
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +2 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/openapi/decorators/api-jsonapi-error.decorator.d.ts +52 -0
  16. package/dist/openapi/decorators/api-jsonapi-error.decorator.d.ts.map +1 -0
  17. package/dist/openapi/decorators/api-jsonapi-error.decorator.js +105 -0
  18. package/dist/openapi/decorators/api-jsonapi-error.decorator.js.map +1 -0
  19. package/dist/openapi/decorators/api-jsonapi-query.decorator.d.ts +43 -0
  20. package/dist/openapi/decorators/api-jsonapi-query.decorator.d.ts.map +1 -0
  21. package/dist/openapi/decorators/api-jsonapi-query.decorator.js +117 -0
  22. package/dist/openapi/decorators/api-jsonapi-query.decorator.js.map +1 -0
  23. package/dist/openapi/decorators/api-jsonapi-response.decorator.d.ts +38 -0
  24. package/dist/openapi/decorators/api-jsonapi-response.decorator.d.ts.map +1 -0
  25. package/dist/openapi/decorators/api-jsonapi-response.decorator.js +84 -0
  26. package/dist/openapi/decorators/api-jsonapi-response.decorator.js.map +1 -0
  27. package/dist/openapi/decorators/index.d.ts +4 -0
  28. package/dist/openapi/decorators/index.d.ts.map +1 -0
  29. package/dist/openapi/decorators/index.js +20 -0
  30. package/dist/openapi/decorators/index.js.map +1 -0
  31. package/dist/openapi/factories/entity-schema.factory.d.ts +21 -0
  32. package/dist/openapi/factories/entity-schema.factory.d.ts.map +1 -0
  33. package/dist/openapi/factories/entity-schema.factory.js +177 -0
  34. package/dist/openapi/factories/entity-schema.factory.js.map +1 -0
  35. package/dist/openapi/factories/index.d.ts +3 -0
  36. package/dist/openapi/factories/index.d.ts.map +1 -0
  37. package/dist/openapi/factories/index.js +19 -0
  38. package/dist/openapi/factories/index.js.map +1 -0
  39. package/dist/openapi/factories/request-schema.factory.d.ts +20 -0
  40. package/dist/openapi/factories/request-schema.factory.d.ts.map +1 -0
  41. package/dist/openapi/factories/request-schema.factory.js +160 -0
  42. package/dist/openapi/factories/request-schema.factory.js.map +1 -0
  43. package/dist/openapi/index.d.ts +7 -0
  44. package/dist/openapi/index.d.ts.map +1 -0
  45. package/dist/openapi/index.js +31 -0
  46. package/dist/openapi/index.js.map +1 -0
  47. package/dist/openapi/module/index.d.ts +3 -0
  48. package/dist/openapi/module/index.d.ts.map +1 -0
  49. package/dist/openapi/module/index.js +8 -0
  50. package/dist/openapi/module/index.js.map +1 -0
  51. package/dist/openapi/module/openapi.module.d.ts +20 -0
  52. package/dist/openapi/module/openapi.module.d.ts.map +1 -0
  53. package/dist/openapi/module/openapi.module.js +39 -0
  54. package/dist/openapi/module/openapi.module.js.map +1 -0
  55. package/dist/openapi/module/openapi.service.d.ts +65 -0
  56. package/dist/openapi/module/openapi.service.d.ts.map +1 -0
  57. package/dist/openapi/module/openapi.service.js +127 -0
  58. package/dist/openapi/module/openapi.service.js.map +1 -0
  59. package/dist/openapi/schemas/index.d.ts +3 -0
  60. package/dist/openapi/schemas/index.d.ts.map +1 -0
  61. package/dist/openapi/schemas/index.js +19 -0
  62. package/dist/openapi/schemas/index.js.map +1 -0
  63. package/dist/openapi/schemas/jsonapi-base.schemas.d.ts +54 -0
  64. package/dist/openapi/schemas/jsonapi-base.schemas.d.ts.map +1 -0
  65. package/dist/openapi/schemas/jsonapi-base.schemas.js +170 -0
  66. package/dist/openapi/schemas/jsonapi-base.schemas.js.map +1 -0
  67. package/dist/openapi/schemas/jsonapi-error.schemas.d.ts +19 -0
  68. package/dist/openapi/schemas/jsonapi-error.schemas.d.ts.map +1 -0
  69. package/dist/openapi/schemas/jsonapi-error.schemas.js +200 -0
  70. package/dist/openapi/schemas/jsonapi-error.schemas.js.map +1 -0
  71. package/dist/openapi/utils/cypher-to-openapi.util.d.ts +32 -0
  72. package/dist/openapi/utils/cypher-to-openapi.util.d.ts.map +1 -0
  73. package/dist/openapi/utils/cypher-to-openapi.util.js +55 -0
  74. package/dist/openapi/utils/cypher-to-openapi.util.js.map +1 -0
  75. package/dist/openapi/utils/example-generator.util.d.ts +11 -0
  76. package/dist/openapi/utils/example-generator.util.d.ts.map +1 -0
  77. package/dist/openapi/utils/example-generator.util.js +95 -0
  78. package/dist/openapi/utils/example-generator.util.js.map +1 -0
  79. package/dist/openapi/utils/index.d.ts +3 -0
  80. package/dist/openapi/utils/index.d.ts.map +1 -0
  81. package/dist/openapi/utils/index.js +19 -0
  82. package/dist/openapi/utils/index.js.map +1 -0
  83. package/package.json +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.factory.d.ts","sourceRoot":"","sources":["../../src/bootstrap/app.module.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAkB7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAmHpE"}
1
+ {"version":3,"file":"app.module.factory.d.ts","sourceRoot":"","sources":["../../src/bootstrap/app.module.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAmB7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAsHpE"}
@@ -56,6 +56,7 @@ const discord_module_1 = require("../foundations/discord/discord.module");
56
56
  const app_mode_module_1 = require("../core/appmode/app.mode.module");
57
57
  const core_module_1 = require("../core/core.module");
58
58
  const foundations_modules_1 = require("../foundations/foundations.modules");
59
+ const openapi_module_1 = require("../openapi/module/openapi.module");
59
60
  /**
60
61
  * Creates a dynamic AppModule based on bootstrap options.
61
62
  *
@@ -145,6 +146,8 @@ function createAppModule(options) {
145
146
  }),
146
147
  // Library's AI agents (prompts configured via baseConfig.prompts)
147
148
  agents_modules_1.AgentsModule,
149
+ // OpenAPI module for Swagger/Redoc documentation
150
+ openapi_module_1.OpenApiModule,
148
151
  // User's app-specific modules (MUST be before NecordModule so Necord can discover handlers)
149
152
  ...options.appModules,
150
153
  // Discord bot (only in worker mode when token is configured)
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.factory.js","sourceRoot":"","sources":["../../src/bootstrap/app.module.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,0CAmHC;AAxJD,2CAA6D;AAC7D,2CAA6D;AAC7D,yDAA2D;AAC3D,+CAAkD;AAClD,iDAAoD;AACpD,2CAA+C;AAC/C,mCAAsC;AACtC,2CAAuC;AACvC,6CAAgG;AAChG,2CAA6B;AAE7B,6DAAwD;AACxD,sCAA8G;AAC9G,0EAAsE;AACtE,qEAAgE;AAEhE,qDAAiD;AACjD,4EAAuE;AAGvE;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,eAAe,CAAC,OAAyB;;IAEvD,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;QACtB,MAAM,CAAC,OAAO,CAAC,UAAyB;YACtC,6EAA6E;YAC7E,MAAM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AAC;KACF,CAAA;IAjHK,kBAAkB;QADvB,IAAA,eAAM,EAAC,EAAE,CAAC;OACL,kBAAkB,CAiHvB;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBxE"}
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBxE"}
@@ -5,8 +5,10 @@ const common_1 = require("@nestjs/common");
5
5
  const config_1 = require("@nestjs/config");
6
6
  const core_1 = require("@nestjs/core");
7
7
  const platform_fastify_1 = require("@nestjs/platform-fastify");
8
+ const swagger_1 = require("@nestjs/swagger");
8
9
  const stream_1 = require("stream");
9
10
  const http_exception_filter_1 = require("../common/filters/http-exception.filter");
11
+ const openapi_service_1 = require("../openapi/module/openapi.service");
10
12
  const app_mode_constant_1 = require("../core/appmode/constants/app.mode.constant");
11
13
  const cache_interceptor_1 = require("../core/cache/interceptors/cache.interceptor");
12
14
  const cache_service_1 = require("../core/cache/services/cache.service");
@@ -59,7 +61,7 @@ async function bootstrap(options) {
59
61
  await bootstrapWorker(AppModule, modeConfig);
60
62
  }
61
63
  else {
62
- await bootstrapAPI(AppModule, modeConfig);
64
+ await bootstrapAPI(AppModule, modeConfig, options);
63
65
  }
64
66
  }
65
67
  catch (error) {
@@ -70,7 +72,7 @@ async function bootstrap(options) {
70
72
  /**
71
73
  * Bootstrap the application in API mode with Fastify
72
74
  */
73
- async function bootstrapAPI(AppModule, modeConfig) {
75
+ async function bootstrapAPI(AppModule, modeConfig, options) {
74
76
  const app = await core_1.NestFactory.create(AppModule.forRoot(modeConfig), new platform_fastify_1.FastifyAdapter(defaults_1.defaultFastifyOptions), { logger: ["error", "warn"] });
75
77
  const configService = app.get((config_1.ConfigService));
76
78
  const loggingService = app.get(logging_service_1.AppLoggingService);
@@ -105,6 +107,8 @@ async function bootstrapAPI(AppModule, modeConfig) {
105
107
  const corsService = app.get(cors_service_1.CorsService);
106
108
  corsService.validateConfiguration();
107
109
  app.enableCors(corsService.getCorsConfiguration());
110
+ // Setup OpenAPI documentation
111
+ await setupOpenApiDocs(app, options, loggingService);
108
112
  // Start server
109
113
  const port = configService.get("api").port;
110
114
  await app.listen(port, "0.0.0.0");
@@ -157,6 +161,85 @@ function setupFastifyLoggingHook(app, loggingService) {
157
161
  return payload;
158
162
  });
159
163
  }
164
+ /**
165
+ * Setup OpenAPI documentation (Swagger UI and/or Redoc)
166
+ */
167
+ async function setupOpenApiDocs(app, options, loggingService) {
168
+ const openApiConfig = options.openApi;
169
+ if (!openApiConfig?.enableSwagger && !openApiConfig?.enableRedoc) {
170
+ return;
171
+ }
172
+ const { title = "API Documentation", description = "Auto-generated API documentation", version = "1.0.0", bearerAuth = true, contactEmail, license, licenseUrl, swaggerPath = "/api-docs", redocPath = "/docs", } = openApiConfig;
173
+ // Build OpenAPI document
174
+ const documentBuilder = new swagger_1.DocumentBuilder().setTitle(title).setDescription(description).setVersion(version);
175
+ if (bearerAuth) {
176
+ documentBuilder.addBearerAuth({
177
+ type: "http",
178
+ scheme: "bearer",
179
+ bearerFormat: "JWT",
180
+ description: "Enter your JWT token",
181
+ }, "JWT-auth");
182
+ }
183
+ if (contactEmail) {
184
+ documentBuilder.setContact("API Support", "", contactEmail);
185
+ }
186
+ if (license) {
187
+ documentBuilder.setLicense(license, licenseUrl || "");
188
+ }
189
+ const config = documentBuilder.build();
190
+ // Get schemas from OpenApiService
191
+ let extraSchemas = {};
192
+ try {
193
+ const openApiService = app.get(openapi_service_1.OpenApiService);
194
+ // Register entity descriptors if provided
195
+ if (openApiConfig.entityDescriptors && openApiConfig.entityDescriptors.length > 0) {
196
+ openApiService.registerEntities(openApiConfig.entityDescriptors);
197
+ loggingService.log(`Registered ${openApiConfig.entityDescriptors.length} entities with OpenAPI`);
198
+ }
199
+ extraSchemas = openApiService.getAllSchemas();
200
+ }
201
+ catch {
202
+ loggingService.warn("OpenApiService not available, using base schemas only");
203
+ }
204
+ // Create document with extra schemas
205
+ const document = swagger_1.SwaggerModule.createDocument(app, config, {
206
+ extraModels: [],
207
+ });
208
+ // Merge extra schemas into components
209
+ document.components = document.components || {};
210
+ document.components.schemas = {
211
+ ...document.components.schemas,
212
+ ...extraSchemas,
213
+ };
214
+ // Setup Swagger UI
215
+ if (openApiConfig.enableSwagger) {
216
+ swagger_1.SwaggerModule.setup(swaggerPath, app, document, {
217
+ swaggerOptions: {
218
+ persistAuthorization: true,
219
+ docExpansion: "none",
220
+ filter: true,
221
+ showRequestDuration: true,
222
+ },
223
+ });
224
+ loggingService.log(`Swagger UI available at ${swaggerPath}`);
225
+ }
226
+ // Setup Redoc
227
+ if (openApiConfig.enableRedoc) {
228
+ try {
229
+ const { RedocModule } = await import("nestjs-redoc");
230
+ await RedocModule.setup(redocPath, app, document, {
231
+ title: title,
232
+ sortPropsAlphabetically: true,
233
+ hideDownloadButton: false,
234
+ hideHostname: false,
235
+ });
236
+ loggingService.log(`Redoc available at ${redocPath}`);
237
+ }
238
+ catch {
239
+ loggingService.warn("Failed to setup Redoc. Make sure nestjs-redoc is installed.");
240
+ }
241
+ }
242
+ }
160
243
  /**
161
244
  * Setup graceful shutdown handlers for SIGTERM and SIGINT
162
245
  */
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":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CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,gBAAgB,MAAM,YAAY,EAAE,KAAK,CAAC,CAAC;YACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { DynamicModule, Type } from "@nestjs/common";
2
+ import { EntityDescriptor, RelationshipDef } from "../common/interfaces/entity.schema.interface";
2
3
  import { ContentExtensionConfig } from "../foundations/content/interfaces/content.extension.interface";
3
4
  /**
4
5
  * i18n configuration options
@@ -52,5 +53,51 @@ export interface BootstrapOptions {
52
53
  * ```
53
54
  */
54
55
  contentExtension?: ContentExtensionConfig;
56
+ /**
57
+ * OpenAPI documentation configuration.
58
+ * When provided, sets up Swagger UI and/or Redoc documentation endpoints.
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * openApi: {
63
+ * enableSwagger: true,
64
+ * swaggerPath: '/api-docs',
65
+ * enableRedoc: true,
66
+ * redocPath: '/docs',
67
+ * title: 'My API',
68
+ * version: '1.0.0',
69
+ * }
70
+ * ```
71
+ */
72
+ openApi?: OpenApiOptions;
73
+ }
74
+ /**
75
+ * OpenAPI documentation options
76
+ */
77
+ export interface OpenApiOptions {
78
+ /** Enable Swagger UI endpoint (default: false) */
79
+ enableSwagger?: boolean;
80
+ /** Path for Swagger UI (default: '/api-docs') */
81
+ swaggerPath?: string;
82
+ /** Enable Redoc endpoint (default: false) */
83
+ enableRedoc?: boolean;
84
+ /** Path for Redoc (default: '/docs') */
85
+ redocPath?: string;
86
+ /** API documentation title */
87
+ title?: string;
88
+ /** API documentation description */
89
+ description?: string;
90
+ /** API version */
91
+ version?: string;
92
+ /** Enable JWT Bearer authentication in docs (default: true) */
93
+ bearerAuth?: boolean;
94
+ /** Contact email for API */
95
+ contactEmail?: string;
96
+ /** License name */
97
+ license?: string;
98
+ /** License URL */
99
+ licenseUrl?: string;
100
+ /** Entity descriptors to register for OpenAPI schema generation */
101
+ entityDescriptors?: EntityDescriptor<any, Record<string, RelationshipDef>>[];
55
102
  }
56
103
  //# sourceMappingURL=bootstrap.options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.options.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+DAA+D,CAAC;AAEvG;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,UAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,EAAE,CAAC;IAE1C;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEnC;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;CAC3C"}
1
+ {"version":3,"file":"bootstrap.options.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,gBAAgB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MAAM,CAAC;IACpB,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC;CAC9E"}
@@ -42,7 +42,7 @@ import { AppMode, AppModeConfig } from "../core/appmode/constants/app.mode.const
42
42
  export { AppMode, AppModeConfig };
43
43
  export { createAppModule } from "./app.module.factory";
44
44
  export { bootstrap } from "./bootstrap";
45
- export { BootstrapOptions, I18nOptions } from "./bootstrap.options";
45
+ export { BootstrapOptions, I18nOptions, OpenApiOptions } from "./bootstrap.options";
46
46
  export { defaultFastifyOptions, defaultMultipartOptions, getAppMode, getAppModeConfig } from "./defaults";
47
47
  export { RAW_BODY_ROUTES, setupRawBodyCapture } from "./raw-body.config";
48
48
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bootstrap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAErF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGpE,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG1G,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bootstrap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAErF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGpF,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG1G,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -9,4 +9,5 @@ export * from "./core";
9
9
  export * from "./foundations";
10
10
  export * from "./agents";
11
11
  export * from "./bootstrap";
12
+ export * from "./openapi";
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC;AAGzB,cAAc,QAAQ,CAAC;AAGvB,cAAc,eAAe,CAAC;AAG9B,cAAc,UAAU,CAAC;AAGzB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC;AAGzB,cAAc,QAAQ,CAAC;AAGvB,cAAc,eAAe,CAAC;AAG9B,cAAc,UAAU,CAAC;AAGzB,cAAc,aAAa,CAAC;AAG5B,cAAc,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -31,4 +31,6 @@ __exportStar(require("./foundations"), exports);
31
31
  __exportStar(require("./agents"), exports);
32
32
  // Bootstrap utilities
33
33
  __exportStar(require("./bootstrap"), exports);
34
+ // OpenAPI module exports
35
+ __exportStar(require("./openapi"), exports);
34
36
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,iBAAiB;AACjB,2CAAyB;AAEzB,iBAAiB;AACjB,2CAAyB;AAEzB,sBAAsB;AACtB,yCAAuB;AAEvB,4BAA4B;AAC5B,gDAA8B;AAE9B,uBAAuB;AACvB,2CAAyB;AAEzB,sBAAsB;AACtB,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,iBAAiB;AACjB,2CAAyB;AAEzB,iBAAiB;AACjB,2CAAyB;AAEzB,sBAAsB;AACtB,yCAAuB;AAEvB,4BAA4B;AAC5B,gDAA8B;AAE9B,uBAAuB;AACvB,2CAAyB;AAEzB,sBAAsB;AACtB,8CAA4B;AAE5B,yBAAyB;AACzB,4CAA0B"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Options for @ApiJsonApiErrors decorator.
3
+ */
4
+ export interface ApiJsonApiErrorsOptions {
5
+ badRequest?: boolean;
6
+ unauthorized?: boolean;
7
+ forbidden?: boolean;
8
+ notFound?: boolean;
9
+ unprocessable?: boolean;
10
+ serverError?: boolean;
11
+ }
12
+ /**
13
+ * Decorator that adds common JSON:API error responses to an endpoint.
14
+ * By default adds 401 (Unauthorized) and 500 (Server Error).
15
+ *
16
+ * @example
17
+ * @ApiJsonApiErrors()
18
+ * @Get()
19
+ * findAll() { ... }
20
+ *
21
+ * @example
22
+ * @ApiJsonApiErrors({ notFound: true })
23
+ * @Get(':id')
24
+ * findById() { ... }
25
+ */
26
+ export declare function ApiJsonApiErrors(options?: ApiJsonApiErrorsOptions): MethodDecorator;
27
+ /**
28
+ * Convenience decorator for read endpoints (GET by ID).
29
+ * Adds 401, 404, and 500 error responses.
30
+ */
31
+ export declare function ApiJsonApiReadErrors(): MethodDecorator;
32
+ /**
33
+ * Convenience decorator for list endpoints (GET all).
34
+ * Adds 401 and 500 error responses.
35
+ */
36
+ export declare function ApiJsonApiListErrors(): MethodDecorator;
37
+ /**
38
+ * Convenience decorator for create endpoints (POST).
39
+ * Adds 400, 401, 422, and 500 error responses.
40
+ */
41
+ export declare function ApiJsonApiCreateErrors(): MethodDecorator;
42
+ /**
43
+ * Convenience decorator for update endpoints (PUT/PATCH).
44
+ * Adds 400, 401, 404, 422, and 500 error responses.
45
+ */
46
+ export declare function ApiJsonApiUpdateErrors(): MethodDecorator;
47
+ /**
48
+ * Convenience decorator for delete endpoints (DELETE).
49
+ * Adds 401, 403, 404, and 500 error responses.
50
+ */
51
+ export declare function ApiJsonApiDeleteErrors(): MethodDecorator;
52
+ //# sourceMappingURL=api-jsonapi-error.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-jsonapi-error.decorator.d.ts","sourceRoot":"","sources":["../../../src/openapi/decorators/api-jsonapi-error.decorator.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,eAAe,CAmEvF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,CAEtD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,CAEtD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,CAExD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,CAMxD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,CAExD"}
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiJsonApiErrors = ApiJsonApiErrors;
4
+ exports.ApiJsonApiReadErrors = ApiJsonApiReadErrors;
5
+ exports.ApiJsonApiListErrors = ApiJsonApiListErrors;
6
+ exports.ApiJsonApiCreateErrors = ApiJsonApiCreateErrors;
7
+ exports.ApiJsonApiUpdateErrors = ApiJsonApiUpdateErrors;
8
+ exports.ApiJsonApiDeleteErrors = ApiJsonApiDeleteErrors;
9
+ const common_1 = require("@nestjs/common");
10
+ const swagger_1 = require("@nestjs/swagger");
11
+ /**
12
+ * Decorator that adds common JSON:API error responses to an endpoint.
13
+ * By default adds 401 (Unauthorized) and 500 (Server Error).
14
+ *
15
+ * @example
16
+ * @ApiJsonApiErrors()
17
+ * @Get()
18
+ * findAll() { ... }
19
+ *
20
+ * @example
21
+ * @ApiJsonApiErrors({ notFound: true })
22
+ * @Get(':id')
23
+ * findById() { ... }
24
+ */
25
+ function ApiJsonApiErrors(options = {}) {
26
+ const { badRequest = false, unauthorized = true, forbidden = false, notFound = false, unprocessable = false, serverError = true, } = options;
27
+ const decorators = [];
28
+ if (badRequest) {
29
+ decorators.push((0, swagger_1.ApiBadRequestResponse)({
30
+ description: "Bad Request - Invalid request parameters",
31
+ schema: { $ref: "#/components/schemas/JsonApi400ErrorResponse" },
32
+ }));
33
+ }
34
+ if (unauthorized) {
35
+ decorators.push((0, swagger_1.ApiUnauthorizedResponse)({
36
+ description: "Unauthorized - Valid JWT token required",
37
+ schema: { $ref: "#/components/schemas/JsonApi401ErrorResponse" },
38
+ }));
39
+ }
40
+ if (forbidden) {
41
+ decorators.push((0, swagger_1.ApiForbiddenResponse)({
42
+ description: "Forbidden - Insufficient permissions",
43
+ schema: { $ref: "#/components/schemas/JsonApi403ErrorResponse" },
44
+ }));
45
+ }
46
+ if (notFound) {
47
+ decorators.push((0, swagger_1.ApiNotFoundResponse)({
48
+ description: "Not Found - Resource does not exist",
49
+ schema: { $ref: "#/components/schemas/JsonApi404ErrorResponse" },
50
+ }));
51
+ }
52
+ if (unprocessable) {
53
+ decorators.push((0, swagger_1.ApiUnprocessableEntityResponse)({
54
+ description: "Unprocessable Entity - Validation failed",
55
+ schema: { $ref: "#/components/schemas/JsonApi422ErrorResponse" },
56
+ }));
57
+ }
58
+ if (serverError) {
59
+ decorators.push((0, swagger_1.ApiInternalServerErrorResponse)({
60
+ description: "Internal Server Error",
61
+ schema: { $ref: "#/components/schemas/JsonApi500ErrorResponse" },
62
+ }));
63
+ }
64
+ return (0, common_1.applyDecorators)(...decorators);
65
+ }
66
+ /**
67
+ * Convenience decorator for read endpoints (GET by ID).
68
+ * Adds 401, 404, and 500 error responses.
69
+ */
70
+ function ApiJsonApiReadErrors() {
71
+ return ApiJsonApiErrors({ notFound: true });
72
+ }
73
+ /**
74
+ * Convenience decorator for list endpoints (GET all).
75
+ * Adds 401 and 500 error responses.
76
+ */
77
+ function ApiJsonApiListErrors() {
78
+ return ApiJsonApiErrors();
79
+ }
80
+ /**
81
+ * Convenience decorator for create endpoints (POST).
82
+ * Adds 400, 401, 422, and 500 error responses.
83
+ */
84
+ function ApiJsonApiCreateErrors() {
85
+ return ApiJsonApiErrors({ badRequest: true, unprocessable: true });
86
+ }
87
+ /**
88
+ * Convenience decorator for update endpoints (PUT/PATCH).
89
+ * Adds 400, 401, 404, 422, and 500 error responses.
90
+ */
91
+ function ApiJsonApiUpdateErrors() {
92
+ return ApiJsonApiErrors({
93
+ badRequest: true,
94
+ notFound: true,
95
+ unprocessable: true,
96
+ });
97
+ }
98
+ /**
99
+ * Convenience decorator for delete endpoints (DELETE).
100
+ * Adds 401, 403, 404, and 500 error responses.
101
+ */
102
+ function ApiJsonApiDeleteErrors() {
103
+ return ApiJsonApiErrors({ forbidden: true, notFound: true });
104
+ }
105
+ //# sourceMappingURL=api-jsonapi-error.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-jsonapi-error.decorator.js","sourceRoot":"","sources":["../../../src/openapi/decorators/api-jsonapi-error.decorator.ts"],"names":[],"mappings":";;AAoCA,4CAmEC;AAMD,oDAEC;AAMD,oDAEC;AAMD,wDAEC;AAMD,wDAMC;AAMD,wDAEC;AAnJD,2CAAiD;AACjD,6CAOyB;AAczB;;;;;;;;;;;;;GAaG;AACH,SAAgB,gBAAgB,CAAC,UAAmC,EAAE;IACpE,MAAM,EACJ,UAAU,GAAG,KAAK,EAClB,YAAY,GAAG,IAAI,EACnB,SAAS,GAAG,KAAK,EACjB,QAAQ,GAAG,KAAK,EAChB,aAAa,GAAG,KAAK,EACrB,WAAW,GAAG,IAAI,GACnB,GAAG,OAAO,CAAC;IAEZ,MAAM,UAAU,GAAsB,EAAE,CAAC;IAEzC,IAAI,UAAU,EAAE,CAAC;QACf,UAAU,CAAC,IAAI,CACb,IAAA,+BAAqB,EAAC;YACpB,WAAW,EAAE,0CAA0C;YACvD,MAAM,EAAE,EAAE,IAAI,EAAE,8CAA8C,EAAE;SACjE,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,UAAU,CAAC,IAAI,CACb,IAAA,iCAAuB,EAAC;YACtB,WAAW,EAAE,yCAAyC;YACtD,MAAM,EAAE,EAAE,IAAI,EAAE,8CAA8C,EAAE;SACjE,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,UAAU,CAAC,IAAI,CACb,IAAA,8BAAoB,EAAC;YACnB,WAAW,EAAE,sCAAsC;YACnD,MAAM,EAAE,EAAE,IAAI,EAAE,8CAA8C,EAAE;SACjE,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,UAAU,CAAC,IAAI,CACb,IAAA,6BAAmB,EAAC;YACl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orator that documents standard JSON:API list query parameters.
3
+ * Adds documentation for: page[offset], page[size], orderBy, fetchAll, search
4
+ *
5
+ * @example
6
+ * @ApiJsonApiListQuery()
7
+ * @Get()
8
+ * findAll(@Query() query: any) { ... }
9
+ */
10
+ export declare function ApiJsonApiListQuery(): MethodDecorator;
11
+ /**
12
+ * Decorator that documents the JSON:API include parameter.
13
+ * Allows specifying which relationships can be included.
14
+ *
15
+ * @example
16
+ * @ApiJsonApiInclude(['roll', 'metadata', 'faces'])
17
+ * @Get()
18
+ * findAll(@Query('include') include?: string) { ... }
19
+ */
20
+ export declare function ApiJsonApiInclude(allowedRelationships: string[]): MethodDecorator;
21
+ /**
22
+ * Decorator that documents pagination query parameters only.
23
+ * Use when you need pagination but not orderBy/search.
24
+ *
25
+ * @example
26
+ * @ApiJsonApiPagination()
27
+ * @Get()
28
+ * findAll(@Query() query: any) { ... }
29
+ */
30
+ export declare function ApiJsonApiPagination(): MethodDecorator;
31
+ /**
32
+ * Decorator for documenting filter parameters.
33
+ *
34
+ * @example
35
+ * @ApiJsonApiFilter('status', ['active', 'pending', 'completed'])
36
+ * @Get()
37
+ * findAll(@Query('filter[status]') status?: string) { ... }
38
+ */
39
+ export declare function ApiJsonApiFilter(fieldName: string, allowedValues?: string[], options?: {
40
+ description?: string;
41
+ required?: boolean;
42
+ }): MethodDecorator;
43
+ //# sourceMappingURL=api-jsonapi-query.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-jsonapi-query.decorator.d.ts","sourceRoot":"","sources":["../../../src/openapi/decorators/api-jsonapi-query.decorator.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,eAAe,CAqCrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,oBAAoB,EAAE,MAAM,EAAE,GAAG,eAAe,CAcjF;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,CAiBtD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,aAAa,CAAC,EAAE,MAAM,EAAE,EACxB,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GACzD,eAAe,CAejB"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiJsonApiListQuery = ApiJsonApiListQuery;
4
+ exports.ApiJsonApiInclude = ApiJsonApiInclude;
5
+ exports.ApiJsonApiPagination = ApiJsonApiPagination;
6
+ exports.ApiJsonApiFilter = ApiJsonApiFilter;
7
+ const common_1 = require("@nestjs/common");
8
+ const swagger_1 = require("@nestjs/swagger");
9
+ /**
10
+ * Decorator that documents standard JSON:API list query parameters.
11
+ * Adds documentation for: page[offset], page[size], orderBy, fetchAll, search
12
+ *
13
+ * @example
14
+ * @ApiJsonApiListQuery()
15
+ * @Get()
16
+ * findAll(@Query() query: any) { ... }
17
+ */
18
+ function ApiJsonApiListQuery() {
19
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiQuery)({
20
+ name: "page[offset]",
21
+ required: false,
22
+ type: Number,
23
+ description: "Number of records to skip (for pagination)",
24
+ example: 0,
25
+ }), (0, swagger_1.ApiQuery)({
26
+ name: "page[size]",
27
+ required: false,
28
+ type: Number,
29
+ description: "Number of records per page (default: 20, max: 100)",
30
+ example: 20,
31
+ }), (0, swagger_1.ApiQuery)({
32
+ name: "orderBy",
33
+ required: false,
34
+ type: String,
35
+ description: "Field to order by, prefix with - for descending (e.g., -createdAt)",
36
+ example: "-createdAt",
37
+ }), (0, swagger_1.ApiQuery)({
38
+ name: "fetchAll",
39
+ required: false,
40
+ type: Boolean,
41
+ description: "If true, returns all records without pagination (use with caution)",
42
+ example: false,
43
+ }), (0, swagger_1.ApiQuery)({
44
+ name: "search",
45
+ required: false,
46
+ type: String,
47
+ description: "Full-text search term",
48
+ }));
49
+ }
50
+ /**
51
+ * Decorator that documents the JSON:API include parameter.
52
+ * Allows specifying which relationships can be included.
53
+ *
54
+ * @example
55
+ * @ApiJsonApiInclude(['roll', 'metadata', 'faces'])
56
+ * @Get()
57
+ * findAll(@Query('include') include?: string) { ... }
58
+ */
59
+ function ApiJsonApiInclude(allowedRelationships) {
60
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiQuery)({
61
+ name: "include",
62
+ required: false,
63
+ type: String,
64
+ description: `Comma-separated list of relationships to include. Allowed: ${allowedRelationships.join(", ")}`,
65
+ example: allowedRelationships.slice(0, 2).join(","),
66
+ schema: {
67
+ type: "string",
68
+ description: `Allowed values: ${allowedRelationships.join(", ")}`,
69
+ },
70
+ }));
71
+ }
72
+ /**
73
+ * Decorator that documents pagination query parameters only.
74
+ * Use when you need pagination but not orderBy/search.
75
+ *
76
+ * @example
77
+ * @ApiJsonApiPagination()
78
+ * @Get()
79
+ * findAll(@Query() query: any) { ... }
80
+ */
81
+ function ApiJsonApiPagination() {
82
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiQuery)({
83
+ name: "page[offset]",
84
+ required: false,
85
+ type: Number,
86
+ description: "Number of records to skip",
87
+ example: 0,
88
+ }), (0, swagger_1.ApiQuery)({
89
+ name: "page[size]",
90
+ required: false,
91
+ type: Number,
92
+ description: "Number of records per page",
93
+ example: 20,
94
+ }));
95
+ }
96
+ /**
97
+ * Decorator for documenting filter parameters.
98
+ *
99
+ * @example
100
+ * @ApiJsonApiFilter('status', ['active', 'pending', 'completed'])
101
+ * @Get()
102
+ * findAll(@Query('filter[status]') status?: string) { ... }
103
+ */
104
+ function ApiJsonApiFilter(fieldName, allowedValues, options = {}) {
105
+ const queryName = `filter[${fieldName}]`;
106
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiQuery)({
107
+ name: queryName,
108
+ required: options.required || false,
109
+ type: String,
110
+ description: options.description || `Filter by ${fieldName}`,
111
+ ...(allowedValues && {
112
+ enum: allowedValues,
113
+ example: allowedValues[0],
114
+ }),
115
+ }));
116
+ }
117
+ //# sourceMappingURL=api-jsonapi-query.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-jsonapi-query.decorator.js","sourceRoot":"","sources":["../../../src/openapi/decorators/api-jsonapi-query.decorator.ts"],"names":[],"mappings":";;AAYA,kDAqCC;AAWD,8CAcC;AAWD,oDAiBC;AAUD,4CAmBC;AAnID,2CAAiD;AACjD,6CAA2C;AAE3C;;;;;;;;GAQG;AACH,SAAgB,mBAAmB;IACjC,OAAO,IAAA,wBAAe,EACpB,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,CAAC;KACX,CAAC,EACF,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,oDAAoD;QACjE,OAAO,EAAE,EAAE;KACZ,CAAC,EACF,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,oEAAoE;QACjF,OAAO,EAAE,YAAY;KACtB,CAAC,EACF,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,oEAAoE;QACjF,OAAO,EAAE,KAAK;KACf,CAAC,EACF,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,uBAAuB;KACrC,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,iBAAiB,CAAC,oBAA8B;IAC9D,OAAO,IAAA,wBAAe,EACpB,IAAA,kBA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