nestjs-ddd-cli 3.2.2 → 3.3.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 (210) hide show
  1. package/README.md +118 -9
  2. package/ddd.schema.json +11 -1
  3. package/dist/commands/doctor-enhanced.d.ts +1 -0
  4. package/dist/commands/doctor-enhanced.js +94 -79
  5. package/dist/commands/doctor-enhanced.js.map +1 -1
  6. package/dist/commands/doctor.d.ts +9 -0
  7. package/dist/commands/doctor.js +68 -21
  8. package/dist/commands/doctor.js.map +1 -1
  9. package/dist/commands/generate-all.js +54 -28
  10. package/dist/commands/generate-all.js.map +1 -1
  11. package/dist/commands/generate-controller.d.ts +1 -0
  12. package/dist/commands/generate-controller.js +71 -0
  13. package/dist/commands/generate-controller.js.map +1 -0
  14. package/dist/commands/generate-domain-service.d.ts +1 -1
  15. package/dist/commands/generate-domain-service.js +6 -4
  16. package/dist/commands/generate-domain-service.js.map +1 -1
  17. package/dist/commands/generate-dto.d.ts +4 -0
  18. package/dist/commands/generate-dto.js +162 -0
  19. package/dist/commands/generate-dto.js.map +1 -0
  20. package/dist/commands/generate-entity.js +7 -2
  21. package/dist/commands/generate-entity.js.map +1 -1
  22. package/dist/commands/generate-event.js +10 -4
  23. package/dist/commands/generate-event.js.map +1 -1
  24. package/dist/commands/generate-migration-deployment.d.ts +15 -0
  25. package/dist/commands/generate-migration-deployment.js +326 -0
  26. package/dist/commands/generate-migration-deployment.js.map +1 -0
  27. package/dist/commands/generate-migration-deployment.spec.d.ts +1 -0
  28. package/dist/commands/generate-migration-deployment.spec.js +337 -0
  29. package/dist/commands/generate-migration-deployment.spec.js.map +1 -0
  30. package/dist/commands/generate-module.js +4 -2
  31. package/dist/commands/generate-module.js.map +1 -1
  32. package/dist/commands/generate-query.js +23 -4
  33. package/dist/commands/generate-query.js.map +1 -1
  34. package/dist/commands/generate-repository.d.ts +1 -1
  35. package/dist/commands/generate-repository.js +17 -34
  36. package/dist/commands/generate-repository.js.map +1 -1
  37. package/dist/commands/generate-service.js +19 -4
  38. package/dist/commands/generate-service.js.map +1 -1
  39. package/dist/commands/generate-usecase.js +12 -31
  40. package/dist/commands/generate-usecase.js.map +1 -1
  41. package/dist/commands/generate-value-object.js +3 -14
  42. package/dist/commands/generate-value-object.js.map +1 -1
  43. package/dist/commands/init-project.d.ts +3 -0
  44. package/dist/commands/init-project.js +19 -9
  45. package/dist/commands/init-project.js.map +1 -1
  46. package/dist/commands/interactive-scaffold.js +10 -0
  47. package/dist/commands/interactive-scaffold.js.map +1 -1
  48. package/dist/commands/migration.d.ts +3 -0
  49. package/dist/commands/migration.js +83 -48
  50. package/dist/commands/migration.js.map +1 -1
  51. package/dist/commands/recipe.d.ts +2 -0
  52. package/dist/commands/recipe.js +229 -85
  53. package/dist/commands/recipe.js.map +1 -1
  54. package/dist/commands/recipes/banklink-connector-contract.recipe.d.ts +1 -0
  55. package/dist/commands/recipes/banklink-connector-contract.recipe.js +161 -0
  56. package/dist/commands/recipes/banklink-connector-contract.recipe.js.map +1 -0
  57. package/dist/commands/recipes/bounded-json-http.recipe.d.ts +2 -0
  58. package/dist/commands/recipes/bounded-json-http.recipe.js +53 -0
  59. package/dist/commands/recipes/bounded-json-http.recipe.js.map +1 -0
  60. package/dist/commands/recipes/business-reference-identifiers.recipe.d.ts +1 -0
  61. package/dist/commands/recipes/business-reference-identifiers.recipe.js +223 -0
  62. package/dist/commands/recipes/business-reference-identifiers.recipe.js.map +1 -0
  63. package/dist/commands/recipes/event-backbone.recipe.d.ts +1 -0
  64. package/dist/commands/recipes/event-backbone.recipe.js +1118 -0
  65. package/dist/commands/recipes/event-backbone.recipe.js.map +1 -0
  66. package/dist/commands/recipes/external-projection-worker.recipe.d.ts +6 -0
  67. package/dist/commands/recipes/external-projection-worker.recipe.js +211 -0
  68. package/dist/commands/recipes/external-projection-worker.recipe.js.map +1 -0
  69. package/dist/commands/recipes/index.d.ts +11 -0
  70. package/dist/commands/recipes/index.js +11 -0
  71. package/dist/commands/recipes/index.js.map +1 -1
  72. package/dist/commands/recipes/jest-cjs-compat.recipe.d.ts +3 -0
  73. package/dist/commands/recipes/jest-cjs-compat.recipe.js +130 -0
  74. package/dist/commands/recipes/jest-cjs-compat.recipe.js.map +1 -0
  75. package/dist/commands/recipes/joi-env.recipe.js +1 -1
  76. package/dist/commands/recipes/kafka-consumer.recipe.d.ts +1 -0
  77. package/dist/commands/recipes/kafka-consumer.recipe.js +65 -0
  78. package/dist/commands/recipes/kafka-consumer.recipe.js.map +1 -0
  79. package/dist/commands/recipes/oauth2-client-credentials.recipe.d.ts +1 -0
  80. package/dist/commands/recipes/oauth2-client-credentials.recipe.js +60 -0
  81. package/dist/commands/recipes/oauth2-client-credentials.recipe.js.map +1 -0
  82. package/dist/commands/recipes/oauth2-token-introspection.recipe.d.ts +1 -0
  83. package/dist/commands/recipes/oauth2-token-introspection.recipe.js +67 -0
  84. package/dist/commands/recipes/oauth2-token-introspection.recipe.js.map +1 -0
  85. package/dist/commands/recipes/oidc-bff-session.recipe.d.ts +1 -0
  86. package/dist/commands/recipes/oidc-bff-session.recipe.js +57 -0
  87. package/dist/commands/recipes/oidc-bff-session.recipe.js.map +1 -0
  88. package/dist/commands/recipes/oidc-dashboard.recipe.d.ts +1 -0
  89. package/dist/commands/recipes/oidc-dashboard.recipe.js +463 -0
  90. package/dist/commands/recipes/oidc-dashboard.recipe.js.map +1 -0
  91. package/dist/commands/recipes/oidc-resource-server.recipe.d.ts +1 -0
  92. package/dist/commands/recipes/oidc-resource-server.recipe.js +85 -0
  93. package/dist/commands/recipes/oidc-resource-server.recipe.js.map +1 -0
  94. package/dist/commands/recipes/platform-context.recipe.d.ts +1 -0
  95. package/dist/commands/recipes/platform-context.recipe.js +229 -0
  96. package/dist/commands/recipes/platform-context.recipe.js.map +1 -0
  97. package/dist/commands/recipes/platform-parc-authorization.recipe.d.ts +1 -0
  98. package/dist/commands/recipes/platform-parc-authorization.recipe.js +339 -0
  99. package/dist/commands/recipes/platform-parc-authorization.recipe.js.map +1 -0
  100. package/dist/commands/recipes/platform-parc-bound-authorization.recipe.d.ts +1 -0
  101. package/dist/commands/recipes/platform-parc-bound-authorization.recipe.js +56 -0
  102. package/dist/commands/recipes/platform-parc-bound-authorization.recipe.js.map +1 -0
  103. package/dist/commands/recipes/platform-service-access-request-context.recipe.d.ts +1 -0
  104. package/dist/commands/recipes/platform-service-access-request-context.recipe.js +103 -0
  105. package/dist/commands/recipes/platform-service-access-request-context.recipe.js.map +1 -0
  106. package/dist/commands/recipes/platform-service-runtime.recipe.d.ts +1 -0
  107. package/dist/commands/recipes/platform-service-runtime.recipe.js +415 -0
  108. package/dist/commands/recipes/platform-service-runtime.recipe.js.map +1 -0
  109. package/dist/index.js +77 -9
  110. package/dist/index.js.map +1 -1
  111. package/dist/templates/ai-context/CLAUDE.md.hbs +39 -3
  112. package/dist/templates/ai-context/conventions.md.hbs +13 -8
  113. package/dist/templates/command/create-command.hbs +8 -3
  114. package/dist/templates/command/delete-command.hbs +1 -1
  115. package/dist/templates/command/update-command.hbs +1 -1
  116. package/dist/templates/controller/application-controller.hbs +7 -0
  117. package/dist/templates/controller/controller.hbs +6 -0
  118. package/dist/templates/dto/create-dto.hbs +17 -5
  119. package/dist/templates/dto/filter-dto.hbs +1 -1
  120. package/dist/templates/dto/response-dto.hbs +1 -1
  121. package/dist/templates/entity/entity.hbs +4 -0
  122. package/dist/templates/mapper/mapper.hbs +5 -1
  123. package/dist/templates/orm-entity/orm-entity.hbs +9 -1
  124. package/dist/templates/prisma/prisma-mapper.hbs +6 -0
  125. package/dist/templates/prisma/prisma-repository.hbs +57 -5
  126. package/dist/templates/prisma/prisma-schema.hbs +2 -0
  127. package/dist/templates/query/get-all.query.hbs +10 -2
  128. package/dist/templates/recipes/bounded-json-http/README.md.hbs +36 -0
  129. package/dist/templates/recipes/external-projection-worker/README.md.hbs +157 -0
  130. package/dist/templates/recipes/external-projection-worker/canonical-json.ts.hbs +123 -0
  131. package/dist/templates/recipes/external-projection-worker/enqueuer.ts.hbs +167 -0
  132. package/dist/templates/recipes/external-projection-worker/index.ts.hbs +6 -0
  133. package/dist/templates/recipes/external-projection-worker/migration.ts.hbs +88 -0
  134. package/dist/templates/recipes/external-projection-worker/module.ts.hbs +36 -0
  135. package/dist/templates/recipes/external-projection-worker/store.ts.hbs +354 -0
  136. package/dist/templates/recipes/external-projection-worker/types.ts.hbs +134 -0
  137. package/dist/templates/recipes/external-projection-worker/worker.ts.hbs +296 -0
  138. package/dist/templates/recipes/kafka-consumer/README.md.hbs +50 -0
  139. package/dist/templates/recipes/kafka-consumer/kafka-consumer.ts.hbs +135 -0
  140. package/dist/templates/recipes/kafka-consumer/migration.ts.hbs +17 -0
  141. package/dist/templates/recipes/oauth2-client-credentials/README.md.hbs +40 -0
  142. package/dist/templates/recipes/oauth2-client-credentials/client.spec.ts.hbs +234 -0
  143. package/dist/templates/recipes/oauth2-client-credentials/client.ts.hbs +210 -0
  144. package/dist/templates/recipes/oauth2-client-credentials/index.ts.hbs +2 -0
  145. package/dist/templates/recipes/oauth2-client-credentials/module.ts.hbs +58 -0
  146. package/dist/templates/recipes/oauth2-token-introspection/README.md.hbs +158 -0
  147. package/dist/templates/recipes/oauth2-token-introspection/client.spec.ts.hbs +350 -0
  148. package/dist/templates/recipes/oauth2-token-introspection/client.ts.hbs +241 -0
  149. package/dist/templates/recipes/oauth2-token-introspection/http-client.spec.ts.hbs +411 -0
  150. package/dist/templates/recipes/oauth2-token-introspection/http-client.ts.hbs +343 -0
  151. package/dist/templates/recipes/oauth2-token-introspection/index.ts.hbs +3 -0
  152. package/dist/templates/recipes/oauth2-token-introspection/module.ts.hbs +58 -0
  153. package/dist/templates/recipes/oidc-bff-session/README.md.hbs +96 -0
  154. package/dist/templates/recipes/oidc-bff-session/client.test.ts.hbs +663 -0
  155. package/dist/templates/recipes/oidc-bff-session/client.ts.hbs +635 -0
  156. package/dist/templates/recipes/oidc-bff-session/index.ts.hbs +3 -0
  157. package/dist/templates/recipes/oidc-bff-session/store.integration.test.ts.hbs +480 -0
  158. package/dist/templates/recipes/oidc-bff-session/store.test.ts.hbs +87 -0
  159. package/dist/templates/recipes/oidc-bff-session/store.ts.hbs +549 -0
  160. package/dist/templates/recipes/oidc-bff-session/valkey.test.ts.hbs +158 -0
  161. package/dist/templates/recipes/oidc-bff-session/valkey.ts.hbs +148 -0
  162. package/dist/templates/recipes/oidc-resource-server/README.md.hbs +74 -0
  163. package/dist/templates/recipes/oidc-resource-server/index.ts.hbs +2 -0
  164. package/dist/templates/recipes/oidc-resource-server/module.ts.hbs +51 -0
  165. package/dist/templates/recipes/oidc-resource-server/verifier.spec.ts.hbs +186 -0
  166. package/dist/templates/recipes/oidc-resource-server/verifier.ts.hbs +440 -0
  167. package/dist/templates/recipes/platform-parc-bound-authorization/README.md.hbs +92 -0
  168. package/dist/templates/recipes/platform-parc-bound-authorization/client.ts.hbs +142 -0
  169. package/dist/templates/recipes/platform-service-access-request-context/docs.md.hbs +61 -0
  170. package/dist/templates/recipes/platform-service-access-request-context/env.example.hbs +7 -0
  171. package/dist/templates/recipes/platform-service-access-request-context/index.ts.hbs +7 -0
  172. package/dist/templates/recipes/platform-service-access-request-context/request-context-headers.ts.hbs +61 -0
  173. package/dist/templates/recipes/platform-service-access-request-context/request-context-introspection.parser.ts.hbs +132 -0
  174. package/dist/templates/recipes/platform-service-access-request-context/request-context-introspection.types.ts.hbs +40 -0
  175. package/dist/templates/recipes/platform-service-access-request-context/service-access-request-context.client.ts.hbs +45 -0
  176. package/dist/templates/recipes/platform-service-access-request-context/service-access-request-context.config.ts.hbs +142 -0
  177. package/dist/templates/recipes/platform-service-access-request-context/service-access-request-context.guard.ts.hbs +77 -0
  178. package/dist/templates/recipes/platform-service-access-request-context/service-access-request-context.module.ts.hbs +17 -0
  179. package/dist/templates/repository/repository.hbs +42 -4
  180. package/dist/templates/resolver/graphql-input.hbs +23 -6
  181. package/dist/templates/resolver/resolver.hbs +4 -0
  182. package/dist/templates/service/domain-service.hbs +2 -2
  183. package/dist/templates/test/controller.spec.hbs +5 -1
  184. package/dist/templates/test/prisma-repository.spec.hbs +192 -0
  185. package/dist/templates/test/repository.spec.hbs +40 -1
  186. package/dist/templates/test/usecase.spec.hbs +23 -4
  187. package/dist/templates/usecase/application-usecase.hbs +17 -0
  188. package/dist/templates/usecase/create-usecase.hbs +34 -3
  189. package/dist/templates/usecase/update-usecase.hbs +15 -1
  190. package/dist/utils/config.utils.d.ts +2 -0
  191. package/dist/utils/config.utils.js +14 -2
  192. package/dist/utils/config.utils.js.map +1 -1
  193. package/dist/utils/dependency.utils.d.ts +16 -2
  194. package/dist/utils/dependency.utils.js +100 -12
  195. package/dist/utils/dependency.utils.js.map +1 -1
  196. package/dist/utils/field.utils.d.ts +6 -0
  197. package/dist/utils/field.utils.js +50 -8
  198. package/dist/utils/field.utils.js.map +1 -1
  199. package/dist/utils/field.utils.spec.d.ts +1 -0
  200. package/dist/utils/field.utils.spec.js +38 -0
  201. package/dist/utils/field.utils.spec.js.map +1 -0
  202. package/dist/utils/file.utils.d.ts +23 -1
  203. package/dist/utils/file.utils.js +37 -1
  204. package/dist/utils/file.utils.js.map +1 -1
  205. package/dist/utils/naming.utils.js +5 -4
  206. package/dist/utils/naming.utils.js.map +1 -1
  207. package/dist/utils/static-recipe.utils.d.ts +4 -0
  208. package/dist/utils/static-recipe.utils.js +148 -0
  209. package/dist/utils/static-recipe.utils.js.map +1 -0
  210. package/package.json +12 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-backbone.recipe.js","sourceRoot":"","sources":["../../../src/commands/recipes/event-backbone.recipe.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,4DAwlCC;AA9lCD,2CAA6B;AAC7B,kDAA0B;AAC1B,uDAA8D;AAC9D,mGAAkG;AAClG,uEAAuE;AAEhE,KAAK,UAAU,wBAAwB,CAAC,QAAgB;IAC7D,MAAM,UAAU,GAAG,IAAI,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@@ -0,0 +1,6 @@
1
+ export interface ExternalProjectionWorkerRecipeOptions {
2
+ dryRun?: boolean;
3
+ migrationTimestamp?: string;
4
+ beforeWrite?: () => Promise<void>;
5
+ }
6
+ export declare function applyExternalProjectionWorkerRecipe(basePath: string, options: ExternalProjectionWorkerRecipeOptions): Promise<void>;
@@ -0,0 +1,211 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.applyExternalProjectionWorkerRecipe = applyExternalProjectionWorkerRecipe;
37
+ const path = __importStar(require("node:path"));
38
+ const node_crypto_1 = require("node:crypto");
39
+ const promises_1 = require("node:fs/promises");
40
+ const fs = __importStar(require("fs-extra"));
41
+ const config_utils_1 = require("../../utils/config.utils");
42
+ const file_utils_1 = require("../../utils/file.utils");
43
+ const recipeFiles = [
44
+ ['canonical-json.ts.hbs', 'canonical-json.ts'],
45
+ ['types.ts.hbs', 'external-projection-worker.types.ts'],
46
+ ['enqueuer.ts.hbs', 'external-projection-enqueuer.ts'],
47
+ ['store.ts.hbs', 'external-projection-store.ts'],
48
+ ['worker.ts.hbs', 'external-projection-worker.ts'],
49
+ ['module.ts.hbs', 'external-projection-worker.module.ts'],
50
+ ['index.ts.hbs', 'index.ts'],
51
+ ];
52
+ const migrationSuffix = 'CreateExternalProjectionOperations.ts';
53
+ function requiredTimestamp(value) {
54
+ if (!value || !/^\d{13}$/.test(value)) {
55
+ throw new Error('external-projection-worker requires --migration-timestamp with exactly 13 digits');
56
+ }
57
+ return value;
58
+ }
59
+ function resolveOwnedPath(root, configuredPath, label) {
60
+ const resolved = path.resolve(root, configuredPath);
61
+ const relative = path.relative(root, resolved);
62
+ if (relative.startsWith('..') || path.isAbsolute(relative)) {
63
+ throw new Error(`Configured ${label} path must stay inside the project root`);
64
+ }
65
+ return resolved;
66
+ }
67
+ async function assertNoSymlink(root, target) {
68
+ let cursor = target;
69
+ while (true) {
70
+ if (await fs.pathExists(cursor)) {
71
+ const stat = await fs.lstat(cursor);
72
+ if (stat.isSymbolicLink()) {
73
+ throw new Error(`Refusing symlink recipe target: ${cursor}`);
74
+ }
75
+ }
76
+ if (cursor === root)
77
+ return;
78
+ const parent = path.dirname(cursor);
79
+ if (parent === cursor || path.relative(root, parent).startsWith('..')) {
80
+ throw new Error(`Recipe target escapes project root: ${target}`);
81
+ }
82
+ cursor = parent;
83
+ }
84
+ }
85
+ async function assertTarget(root, file) {
86
+ await assertNoSymlink(root, file.target);
87
+ if ((await fs.pathExists(file.target)) &&
88
+ (await fs.readFile(file.target, 'utf8')) !== file.content) {
89
+ throw new Error(`External projection recipe target already differs: ${file.target}`);
90
+ }
91
+ }
92
+ function renderMigration(template, timestamp) {
93
+ return template.split('MIGRATIONTIMESTAMPPLACEHOLDER').join(timestamp);
94
+ }
95
+ async function writeExclusive(root, file) {
96
+ if (await fs.pathExists(file.target)) {
97
+ if ((await fs.readFile(file.target, 'utf8')) !== file.content) {
98
+ throw new Error(`External projection recipe target changed during generation: ${file.target}`);
99
+ }
100
+ return;
101
+ }
102
+ await assertNoSymlink(root, file.target);
103
+ await fs.ensureDir(path.dirname(file.target));
104
+ const temporary = `${file.target}.${process.pid}.${(0, node_crypto_1.randomUUID)()}.tmp`;
105
+ try {
106
+ await fs.writeFile(temporary, file.content, { flag: 'wx' });
107
+ await fs.link(temporary, file.target);
108
+ }
109
+ catch (error) {
110
+ if (error.code !== 'EEXIST')
111
+ throw error;
112
+ if ((await fs.readFile(file.target, 'utf8')) !== file.content) {
113
+ throw new Error(`External projection recipe target changed during generation: ${file.target}`);
114
+ }
115
+ }
116
+ finally {
117
+ await fs.remove(temporary);
118
+ }
119
+ }
120
+ async function assertSingleMigration(root, migrationsPath, expectedTarget) {
121
+ await assertNoSymlink(root, migrationsPath);
122
+ if (!(await fs.pathExists(migrationsPath)))
123
+ return;
124
+ const existing = (await fs.readdir(migrationsPath))
125
+ .filter((entry) => /^\d{13}-CreateExternalProjectionOperations\.ts$/.test(entry))
126
+ .map((entry) => path.join(migrationsPath, entry));
127
+ if (existing.some((entry) => entry !== expectedTarget)) {
128
+ throw new Error(`External projection migration already exists with another timestamp: ${existing.join(', ')}`);
129
+ }
130
+ }
131
+ async function createPlan(basePath, options) {
132
+ const timestamp = requiredTimestamp(options.migrationTimestamp);
133
+ const root = path.resolve(basePath);
134
+ const config = await (0, config_utils_1.loadConfig)(root);
135
+ if (config.orm !== 'typeorm' || config.database !== 'postgres') {
136
+ throw new Error('external-projection-worker supports only PostgreSQL with TypeORM');
137
+ }
138
+ const sharedPath = resolveOwnedPath(root, config.paths.shared, 'shared');
139
+ const migrationsPath = resolveOwnedPath(root, config.paths.migrations, 'migrations');
140
+ const workerPath = path.join(sharedPath, 'external-projection-worker');
141
+ const migrationTarget = path.join(migrationsPath, `${timestamp}-${migrationSuffix}`);
142
+ const templateRoot = path.join(__dirname, '../../templates/recipes/external-projection-worker');
143
+ const recipeOutputs = await Promise.all(recipeFiles.map(async ([source, target]) => ({
144
+ target: path.join(workerPath, target),
145
+ content: await (0, file_utils_1.readTemplate)(path.join(templateRoot, source)),
146
+ })));
147
+ const [migrationTemplate, documentationTemplate] = await Promise.all([
148
+ (0, file_utils_1.readTemplate)(path.join(templateRoot, 'migration.ts.hbs')),
149
+ (0, file_utils_1.readTemplate)(path.join(templateRoot, 'README.md.hbs')),
150
+ ]);
151
+ const planned = [
152
+ ...recipeOutputs,
153
+ {
154
+ target: migrationTarget,
155
+ content: renderMigration(migrationTemplate, timestamp),
156
+ },
157
+ {
158
+ target: path.join(root, 'docs/platform/external-projection-worker.md'),
159
+ content: documentationTemplate,
160
+ },
161
+ ];
162
+ if (new Set(planned.map(({ target }) => target)).size !== planned.length) {
163
+ throw new Error('External projection recipe resolved duplicate output targets');
164
+ }
165
+ return { root, migrationsPath, migrationTarget, planned };
166
+ }
167
+ async function preflightPlan(plan) {
168
+ await assertSingleMigration(plan.root, plan.migrationsPath, plan.migrationTarget);
169
+ for (const file of plan.planned)
170
+ await assertTarget(plan.root, file);
171
+ }
172
+ async function acquireGenerationLock(root) {
173
+ const lockPath = path.join(root, '.ddd-external-projection-worker.lock');
174
+ await assertNoSymlink(root, lockPath);
175
+ for (let attempt = 0; attempt < 200; attempt += 1) {
176
+ try {
177
+ const handle = await (0, promises_1.open)(lockPath, 'wx');
178
+ await handle.close();
179
+ return async () => {
180
+ await fs.remove(lockPath);
181
+ };
182
+ }
183
+ catch (error) {
184
+ if (error.code !== 'EEXIST')
185
+ throw error;
186
+ await new Promise((resolve) => setTimeout(resolve, 10));
187
+ }
188
+ }
189
+ throw new Error(`External projection recipe generation is already running for ${root}`);
190
+ }
191
+ async function applyExternalProjectionWorkerRecipe(basePath, options) {
192
+ const plan = await createPlan(basePath, options);
193
+ if (options.dryRun) {
194
+ await preflightPlan(plan);
195
+ for (const file of plan.planned)
196
+ console.log(`Would generate: ${file.target}`);
197
+ return;
198
+ }
199
+ const release = await acquireGenerationLock(plan.root);
200
+ try {
201
+ await preflightPlan(plan);
202
+ await options.beforeWrite?.();
203
+ await preflightPlan(plan);
204
+ for (const file of plan.planned)
205
+ await writeExclusive(plan.root, file);
206
+ }
207
+ finally {
208
+ await release();
209
+ }
210
+ }
211
+ //# sourceMappingURL=external-projection-worker.recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-projection-worker.recipe.js","sourceRoot":"","sources":["../../../src/commands/recipes/external-projection-worker.recipe.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuMA,kFAqBC;AA5ND,gDAAkC;AAClC,6CAAyC;AACzC,+CAAwC;AACxC,6CAA+B;AAC/B,2DAAsD;AACtD,uDAAsD;AAoBtD,MAAM,WAAW,GAAG;IAClB,CAAC,uBAAuB,EAAE,mBAAmB,CAAC;IAC9C,CAAC,cAAc,EAAE,qCAAqC,CAAC;IACvD,CAAC,iBAAiB,EAAE,iCAAiC,CAAC;IACtD,CAAC,cAAc,EAAE,8BAA8B,CAAC;IAChD,CAAC,eAAe,EAAE,+BAA+B,CAAC;IAClD,CAAC,eAAe,EAAE,sCAAsC,CAAC;IACzD,CAAC,cAAc,EAAE,UAAU,CAAC;CACpB,CAAC;AAEX,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAEhE,SAAS,iBAAiB,CAAC,KAAyB;IAClD,IAAI,CAAC,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY,EAAE,cAAsB,EAAE,KAAa;IAC3E,MAAM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B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO;YAAE,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -5,4 +5,15 @@ export * from './oauth2.recipe';
5
5
  export * from './message-queue.recipe';
6
6
  export * from './elasticsearch.recipe';
7
7
  export * from './event-sourcing.recipe';
8
+ export * from './event-backbone.recipe';
9
+ export * from './business-reference-identifiers.recipe';
8
10
  export * from './joi-env.recipe';
11
+ export * from './platform-service-runtime.recipe';
12
+ export * from './platform-context.recipe';
13
+ export * from './platform-service-access-request-context.recipe';
14
+ export * from './platform-parc-authorization.recipe';
15
+ export * from './banklink-connector-contract.recipe';
16
+ export * from './oidc-dashboard.recipe';
17
+ export * from './external-projection-worker.recipe';
18
+ export * from './jest-cjs-compat.recipe';
19
+ export * from './platform-parc-bound-authorization.recipe';
@@ -21,5 +21,16 @@ __exportStar(require("./oauth2.recipe"), exports);
21
21
  __exportStar(require("./message-queue.recipe"), exports);
22
22
  __exportStar(require("./elasticsearch.recipe"), exports);
23
23
  __exportStar(require("./event-sourcing.recipe"), exports);
24
+ __exportStar(require("./event-backbone.recipe"), exports);
25
+ __exportStar(require("./business-reference-identifiers.recipe"), exports);
24
26
  __exportStar(require("./joi-env.recipe"), exports);
27
+ __exportStar(require("./platform-service-runtime.recipe"), exports);
28
+ __exportStar(require("./platform-context.recipe"), exports);
29
+ __exportStar(require("./platform-service-access-request-context.recipe"), exports);
30
+ __exportStar(require("./platform-parc-authorization.recipe"), exports);
31
+ __exportStar(require("./banklink-connector-contract.recipe"), exports);
32
+ __exportStar(require("./oidc-dashboard.recipe"), exports);
33
+ __exportStar(require("./external-projection-worker.recipe"), exports);
34
+ __exportStar(require("./jest-cjs-compat.recipe"), exports);
35
+ __exportStar(require("./platform-parc-bound-authorization.recipe"), exports);
25
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/recipes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC;AACvC,kDAAgC;AAChC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/recipes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC;AACvC,kDAAgC;AAChC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,0DAAwC;AACxC,0EAAwD;AACxD,mDAAiC;AACjC,oEAAkD;AAClD,4DAA0C;AAC1C,mFAAiE;AACjE,uEAAqD;AACrD,uEAAqD;AACrD,0DAAwC;AACxC,sEAAoD;AACpD,2DAAyC;AACzC,6EAA2D"}
@@ -0,0 +1,3 @@
1
+ /** Jest-only overrides; production compiler options and dependency versions stay owned. */
2
+ export declare function nestJestCommonJsCompatibility(value: unknown): Record<string, unknown>;
3
+ export declare function applyJestCommonJsCompatibilityRecipe(basePath: string, dryRun?: boolean): Promise<void>;
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.nestJestCommonJsCompatibility = nestJestCommonJsCompatibility;
37
+ exports.applyJestCommonJsCompatibilityRecipe = applyJestCommonJsCompatibilityRecipe;
38
+ const path = __importStar(require("node:path"));
39
+ const fs = __importStar(require("fs-extra"));
40
+ const TRANSFORM = '^.+\\.(t|j)s$';
41
+ const CONFIG_EXCEPTION = '/node_modules/(?!@nestjs/config(?:/|$))';
42
+ function record(value) {
43
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
44
+ ? value
45
+ : null;
46
+ }
47
+ /** Jest-only overrides; production compiler options and dependency versions stay owned. */
48
+ function nestJestCommonJsCompatibility(value) {
49
+ const config = record(value);
50
+ const transform = record(config?.['transform']);
51
+ const current = transform?.[TRANSFORM];
52
+ const tuple = Array.isArray(current) ? current : [current];
53
+ const options = tuple.length === 1 ? {} : record(tuple[1]);
54
+ if (!config || !transform || tuple[0] !== 'ts-jest' || tuple.length > 2 || !options) {
55
+ throw new Error('Expected an existing ts-jest JavaScript/TypeScript transform');
56
+ }
57
+ const compilerOptions = options['tsconfig'] === undefined ? {} : record(options['tsconfig']);
58
+ if (!compilerOptions || options['useESM'] === true) {
59
+ throw new Error('Refusing to replace an explicit ESM or file-based Jest tsconfig');
60
+ }
61
+ const ignored = config['transformIgnorePatterns'] ?? ['/node_modules/', '\\.pnp\\.[^\\/]+$'];
62
+ if (ignored !== undefined &&
63
+ (!Array.isArray(ignored) ||
64
+ ignored.some((entry) => typeof entry !== 'string') ||
65
+ ignored.some((entry) => entry.includes('node_modules') &&
66
+ entry !== CONFIG_EXCEPTION &&
67
+ entry !== '/node_modules/' &&
68
+ entry !== 'node_modules/'))) {
69
+ throw new Error('Refusing to replace a customized node_modules transform policy');
70
+ }
71
+ return {
72
+ ...config,
73
+ transform: {
74
+ ...transform,
75
+ [TRANSFORM]: [
76
+ 'ts-jest',
77
+ {
78
+ ...options,
79
+ tsconfig: {
80
+ ...compilerOptions,
81
+ allowJs: true,
82
+ module: 'CommonJS',
83
+ moduleResolution: 'node',
84
+ resolvePackageJsonExports: false,
85
+ resolvePackageJsonImports: false,
86
+ },
87
+ },
88
+ ],
89
+ },
90
+ transformIgnorePatterns: [
91
+ CONFIG_EXCEPTION,
92
+ ...(ignored ?? []).filter((entry) => !entry.includes('node_modules')),
93
+ ],
94
+ };
95
+ }
96
+ async function applyJestCommonJsCompatibilityRecipe(basePath, dryRun = false) {
97
+ const root = path.resolve(basePath);
98
+ const target = path.join(root, 'package.json');
99
+ let cursor = target;
100
+ while (true) {
101
+ const stat = await fs.lstat(cursor);
102
+ if (stat.isSymbolicLink())
103
+ throw new Error(`Refusing symlink Jest configuration target: ${cursor}`);
104
+ if (cursor === target ? !stat.isFile() : !stat.isDirectory()) {
105
+ throw new Error(`Invalid Jest configuration target: ${cursor}`);
106
+ }
107
+ if (cursor === root)
108
+ break;
109
+ cursor = path.dirname(cursor);
110
+ }
111
+ const before = await fs.readFile(target, 'utf8');
112
+ const packageJson = record(JSON.parse(before));
113
+ if (!packageJson)
114
+ throw new Error('Expected an object package.json');
115
+ const updated = {
116
+ ...packageJson,
117
+ jest: nestJestCommonJsCompatibility(packageJson['jest']),
118
+ };
119
+ if (JSON.stringify(packageJson) === JSON.stringify(updated))
120
+ return;
121
+ if (dryRun) {
122
+ console.log(`Would update Jest-only ts-jest compatibility: ${target}`);
123
+ return;
124
+ }
125
+ if ((await fs.readFile(target, 'utf8')) !== before) {
126
+ throw new Error('Jest configuration changed after preflight; preserving owner changes');
127
+ }
128
+ await fs.writeFile(target, `${JSON.stringify(updated, null, 2)}\n`);
129
+ }
130
+ //# sourceMappingURL=jest-cjs-compat.recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jest-cjs-compat.recipe.js","sourceRoot":"","sources":["../../../src/commands/recipes/jest-cjs-compat.recipe.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,sEAoDC;AAED,oFAiCC;AApGD,gDAAkC;AAClC,6CAA+B;AAE/B,MAAM,SAAS,GAAG,eAAe,CAAC;AAClC,MAAM,gBAAgB,GAAG,yCAAyC,CAAC;AAEnE,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAE,KAAiC;QACpC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,2FAA2F;AAC3F,SAAgB,6BAA6B,CAAC,KAAc;IAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAI,CAA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,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,IAAI,CAAC,WAAW;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG;QACd,GAAG,WAAW;QACd,IAAI,EAAE,6BAA6B,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KACzD,CAAC;IACF,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;QAAE,OAAO;IACpE,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,iDAAiD,MAAM,EAAE,CAAC,CAAC;QACvE,OAAO;IACT,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;IAC1F,CAAC;IACD,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC"}
@@ -78,7 +78,7 @@ export const envValidationSchema = Joi.object({
78
78
  APP_NAME: Joi.string().trim().default('nestjs-ddd-service'),
79
79
 
80
80
  DATABASE_URL: requiredInProduction(
81
- Joi.string().trim().uri({ scheme: [/postgresql?/] }),
81
+ Joi.string().trim().uri({ scheme: ['postgres', 'postgresql'] }),
82
82
  ),
83
83
  DATABASE_SSL: Joi.boolean().truthy('true').falsy('false').default(false),
84
84
  DATABASE_LOGGING: Joi.boolean().truthy('true').falsy('false').default(false),
@@ -0,0 +1 @@
1
+ export declare function applyKafkaConsumerRecipe(basePath: string, dryRun?: boolean): Promise<void>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.applyKafkaConsumerRecipe = applyKafkaConsumerRecipe;
37
+ const path = __importStar(require("node:path"));
38
+ const fs = __importStar(require("fs-extra"));
39
+ const file_utils_1 = require("../../utils/file.utils");
40
+ const files = [
41
+ ['kafka-consumer.ts.hbs', 'src/shared/kafka-consumer/kafka-consumer.ts'],
42
+ ['migration.ts.hbs', 'src/migrations/1788600000000-KafkaConsumerReceipts.ts'],
43
+ ['README.md.hbs', 'docs/platform/kafka-consumer.md'],
44
+ ];
45
+ async function applyKafkaConsumerRecipe(basePath, dryRun = false) {
46
+ const root = path.join(__dirname, '../../templates/recipes/kafka-consumer');
47
+ const planned = await Promise.all(files.map(async ([source, target]) => ({
48
+ target: path.join(basePath, target),
49
+ content: await (0, file_utils_1.readTemplate)(path.join(root, source)),
50
+ })));
51
+ // Check all targets first; reruns must never overwrite application adaptations.
52
+ for (const file of planned) {
53
+ if ((await fs.pathExists(file.target)) &&
54
+ (await fs.readFile(file.target, 'utf8')) !== file.content) {
55
+ throw new Error(`Kafka recipe target already differs: ${file.target}`);
56
+ }
57
+ }
58
+ for (const file of planned) {
59
+ if (dryRun)
60
+ console.log(`Would generate: ${file.target}`);
61
+ else if (!(await fs.pathExists(file.target)))
62
+ await (0, file_utils_1.writeFile)(file.target, file.content);
63
+ }
64
+ }
65
+ //# sourceMappingURL=kafka-consumer.recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kafka-consumer.recipe.js","sourceRoot":"","sources":["../../../src/commands/recipes/kafka-consumer.recipe.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,4DAqBC;AA/BD,gDAAkC;AAClC,6CAA+B;AAC/B,uDAAiE;AAEjE,MAAM,KAAK,GAAG;IACZ,CAAC,uBAAuB,EAAE,6CAA6C,CAAC;IACxE,CAAC,kBAAkB,EAAE,uDAAuD,CAAC;IAC7E,CAAC,eAAe,EAAE,iCAAiC,CAAC;CAC5C,CAAC;AAEJ,KAAK,UAAU,wBAAwB,CAAC,QAAgB,EAAE,MAAM,GAAG,KAAK;IAC7E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAC;IAC5E,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QACrC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC;QACnC,OAAO,EAAE,MAAM,IAAA,yBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KACrD,CAAC,CAAC,CACJ,CAAC;IACF,gFAAgF;IAChF,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,IACE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,OAAO,EACzD,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,MAAM;YAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;aACrD,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAAE,MAAM,IAAA,sBAAS,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3F,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function applyOAuth2ClientCredentialsRecipe(basePath: string, dryRun?: boolean): Promise<void>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.applyOAuth2ClientCredentialsRecipe = applyOAuth2ClientCredentialsRecipe;
37
+ const path = __importStar(require("node:path"));
38
+ const static_recipe_utils_1 = require("../../utils/static-recipe.utils");
39
+ async function applyOAuth2ClientCredentialsRecipe(basePath, dryRun = false) {
40
+ const root = path.join(__dirname, '../../templates/recipes');
41
+ const own = 'src/shared/auth/oauth2-client-credentials';
42
+ const transport = 'src/shared/auth/oauth2-token-introspection';
43
+ const files = [
44
+ ['oauth2-client-credentials/client.ts.hbs', own + '/oauth2-client-credentials.client.ts'],
45
+ [
46
+ 'oauth2-client-credentials/client.spec.ts.hbs',
47
+ own + '/oauth2-client-credentials.client.spec.ts',
48
+ ],
49
+ ['oauth2-client-credentials/module.ts.hbs', own + '/oauth2-client-credentials.module.ts'],
50
+ ['oauth2-client-credentials/index.ts.hbs', own + '/index.ts'],
51
+ ['oauth2-client-credentials/README.md.hbs', 'docs/auth/oauth2-client-credentials.md'],
52
+ ['oauth2-token-introspection/http-client.ts.hbs', transport + '/bounded-json-http.client.ts'],
53
+ [
54
+ 'oauth2-token-introspection/http-client.spec.ts.hbs',
55
+ transport + '/bounded-json-http.client.spec.ts',
56
+ ],
57
+ ];
58
+ await (0, static_recipe_utils_1.applyStaticRecipePlan)(basePath, files.map(([source, destination]) => ({ template: path.join(root, source), destination })), dryRun);
59
+ }
60
+ //# sourceMappingURL=oauth2-client-credentials.recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth2-client-credentials.recipe.js","sourceRoot":"","sources":["../../../src/commands/recipes/oauth2-client-credentials.recipe.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,gFA2BC;AA9BD,gDAAkC;AAClC,yEAAwE;AAEjE,KAAK,UAAU,kCAAkC,CACtD,QAAgB,EAChB,MAAM,GAAG,KAAK;IAEd,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,2CAA2C,CAAC;IACxD,MAAM,SAAS,GAAG,4CAA4C,CAAC;IAC/D,MAAM,KAAK,GAAG;QACZ,CAAC,yCAAyC,EAAE,GAAG,GAAG,sCAAsC,CAAC;QACzF;YACE,8CAA8C;YAC9C,GAAG,GAAG,2CAA2C;SAClD;QACD,CAAC,yCAAyC,EAAE,GAAG,GAAG,sCAAsC,CAAC;QACzF,CAAC,wCAAwC,EAAE,GAAG,GAAG,WAAW,CAAC;QAC7D,CAAC,yCAAyC,EAAE,wCAAwC,CAAC;QACrF,CAAC,+CAA+C,EAAE,SAAS,GAAG,8BAA8B,CAAC;QAC7F;YACE,oDAAoD;YACpD,SAAS,GAAG,mCAAmC;SAChD;KACO,CAAC;IACX,MAAM,IAAA,2CAAqB,EACzB,QAAQ,EACR,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,EAC1F,MAAM,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function applyOAuth2TokenIntrospectionRecipe(basePath: string, dryRun?: boolean): Promise<void>;