@ingenyus/swarm-wasp 0.1.0 → 0.2.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 (123) hide show
  1. package/README.md +229 -21
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/common/filesystem.d.ts +0 -14
  4. package/dist/common/filesystem.d.ts.map +1 -1
  5. package/dist/common/filesystem.js +123 -0
  6. package/dist/common/index.js +391 -0
  7. package/dist/common/plugin.js +41 -0
  8. package/dist/common/prisma.js +140 -0
  9. package/dist/common/schemas.d.ts +8 -42
  10. package/dist/common/schemas.d.ts.map +1 -1
  11. package/dist/common/schemas.js +54 -0
  12. package/dist/common/templates.js +52 -0
  13. package/dist/generators/action/action-generator.d.ts +16 -29
  14. package/dist/generators/action/action-generator.d.ts.map +1 -1
  15. package/dist/generators/action/action-generator.js +1429 -0
  16. package/dist/generators/action/index.js +1429 -0
  17. package/dist/generators/action/schema.d.ts +11 -23
  18. package/dist/generators/action/schema.d.ts.map +1 -1
  19. package/dist/generators/action/schema.js +119 -0
  20. package/dist/generators/api/api-generator.d.ts +19 -26
  21. package/dist/generators/api/api-generator.d.ts.map +1 -1
  22. package/dist/generators/api/api-generator.js +1108 -0
  23. package/dist/generators/api/index.js +1108 -0
  24. package/dist/generators/api/schema.d.ts +13 -21
  25. package/dist/generators/api/schema.d.ts.map +1 -1
  26. package/dist/generators/api/schema.js +121 -0
  27. package/dist/generators/api-namespace/api-namespace-generator.d.ts +10 -17
  28. package/dist/generators/api-namespace/api-namespace-generator.d.ts.map +1 -1
  29. package/dist/generators/api-namespace/api-namespace-generator.js +1032 -0
  30. package/dist/generators/api-namespace/index.js +1032 -0
  31. package/dist/generators/api-namespace/schema.d.ts +4 -12
  32. package/dist/generators/api-namespace/schema.d.ts.map +1 -1
  33. package/dist/generators/api-namespace/schema.js +93 -0
  34. package/dist/generators/base/{entity-generator.base.d.ts → component-generator.base.d.ts} +9 -9
  35. package/dist/generators/base/component-generator.base.d.ts.map +1 -0
  36. package/dist/generators/base/component-generator.base.js +935 -0
  37. package/dist/generators/base/index.d.ts +1 -1
  38. package/dist/generators/base/index.d.ts.map +1 -1
  39. package/dist/generators/base/index.js +1334 -0
  40. package/dist/generators/base/operation-generator.base.d.ts +12 -3
  41. package/dist/generators/base/operation-generator.base.d.ts.map +1 -1
  42. package/dist/generators/base/operation-generator.base.js +1335 -0
  43. package/dist/generators/base/wasp-generator.base.d.ts +2 -1
  44. package/dist/generators/base/wasp-generator.base.d.ts.map +1 -1
  45. package/dist/generators/base/wasp-generator.base.js +710 -0
  46. package/dist/generators/config/config-generator.d.ts +7 -4
  47. package/dist/generators/config/config-generator.d.ts.map +1 -1
  48. package/dist/generators/config/config-generator.js +0 -0
  49. package/dist/generators/config/index.js +600 -0
  50. package/dist/generators/config/wasp-config-generator.d.ts +1 -1
  51. package/dist/generators/config/wasp-config-generator.d.ts.map +1 -1
  52. package/dist/generators/config/wasp-config-generator.js +600 -0
  53. package/dist/generators/crud/crud-generator.d.ts +34 -22
  54. package/dist/generators/crud/crud-generator.d.ts.map +1 -1
  55. package/dist/generators/crud/crud-generator.js +1554 -0
  56. package/dist/generators/crud/index.js +1554 -0
  57. package/dist/generators/crud/schema.d.ts +25 -18
  58. package/dist/generators/crud/schema.d.ts.map +1 -1
  59. package/dist/generators/crud/schema.js +137 -0
  60. package/dist/generators/feature/feature-generator.d.ts +20 -0
  61. package/dist/generators/feature/feature-generator.d.ts.map +1 -0
  62. package/dist/generators/feature/feature-generator.js +769 -0
  63. package/dist/generators/feature/index.d.ts +2 -0
  64. package/dist/generators/feature/index.d.ts.map +1 -0
  65. package/dist/generators/feature/index.js +769 -0
  66. package/dist/generators/feature/schema.d.ts +5 -0
  67. package/dist/generators/feature/schema.d.ts.map +1 -0
  68. package/dist/generators/feature/schema.js +90 -0
  69. package/dist/generators/index.d.ts +1 -1
  70. package/dist/generators/index.d.ts.map +1 -1
  71. package/dist/generators/index.js +2215 -0
  72. package/dist/generators/job/index.js +1103 -0
  73. package/dist/generators/job/job-generator.d.ts +12 -23
  74. package/dist/generators/job/job-generator.d.ts.map +1 -1
  75. package/dist/generators/job/job-generator.js +1103 -0
  76. package/dist/generators/job/schema.d.ts +6 -18
  77. package/dist/generators/job/schema.d.ts.map +1 -1
  78. package/dist/generators/job/schema.js +156 -0
  79. package/dist/generators/query/index.js +1429 -0
  80. package/dist/generators/query/query-generator.d.ts +16 -29
  81. package/dist/generators/query/query-generator.d.ts.map +1 -1
  82. package/dist/generators/query/query-generator.js +1429 -0
  83. package/dist/generators/query/schema.d.ts +11 -23
  84. package/dist/generators/query/schema.d.ts.map +1 -1
  85. package/dist/generators/query/schema.js +119 -0
  86. package/dist/generators/route/index.js +1042 -0
  87. package/dist/generators/route/route-generator.d.ts +11 -20
  88. package/dist/generators/route/route-generator.d.ts.map +1 -1
  89. package/dist/generators/route/route-generator.js +1042 -0
  90. package/dist/generators/route/schema.d.ts +5 -15
  91. package/dist/generators/route/schema.d.ts.map +1 -1
  92. package/dist/generators/route/schema.js +94 -0
  93. package/dist/index.d.ts +2 -10
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +1730 -1839
  96. package/dist/plugins/index.d.ts +2 -0
  97. package/dist/plugins/index.d.ts.map +1 -0
  98. package/dist/plugins/wasp.d.ts +3 -0
  99. package/dist/plugins/wasp.d.ts.map +1 -0
  100. package/dist/types/constants.d.ts +4 -22
  101. package/dist/types/constants.d.ts.map +1 -1
  102. package/dist/types/constants.js +8 -2
  103. package/dist/types/index.d.ts +2 -2
  104. package/dist/types/index.d.ts.map +1 -1
  105. package/dist/types/index.js +8 -2
  106. package/dist/wasp-config/app.d.ts +2 -1
  107. package/dist/wasp-config/app.d.ts.map +1 -1
  108. package/dist/wasp-config/app.js +357 -0
  109. package/dist/wasp-config/index.js +357 -0
  110. package/dist/wasp-config/stubs/index.js +48 -0
  111. package/package.json +5 -14
  112. package/dist/generators/args.types.d.ts +0 -85
  113. package/dist/generators/args.types.d.ts.map +0 -1
  114. package/dist/generators/base/entity-generator.base.d.ts.map +0 -1
  115. package/dist/generators/feature-directory/feature-directory-generator.d.ts +0 -18
  116. package/dist/generators/feature-directory/feature-directory-generator.d.ts.map +0 -1
  117. package/dist/generators/feature-directory/index.d.ts +0 -2
  118. package/dist/generators/feature-directory/index.d.ts.map +0 -1
  119. package/dist/generators/feature-directory/schema.d.ts +0 -8
  120. package/dist/generators/feature-directory/schema.d.ts.map +0 -1
  121. package/dist/plugin.d.ts +0 -6
  122. package/dist/plugin.d.ts.map +0 -1
  123. /package/dist/generators/{feature-directory → feature}/templates/feature.wasp.eta +0 -0
@@ -0,0 +1,1032 @@
1
+ // src/generators/api-namespace/api-namespace-generator.ts
2
+ import { toCamelCase as toCamelCase2 } from "@ingenyus/swarm";
3
+ import path8 from "path";
4
+
5
+ // src/types/constants.ts
6
+ var PLUGIN_NAME = "wasp";
7
+ var TYPE_DIRECTORIES = {
8
+ component: "client/components",
9
+ hook: "client/hooks",
10
+ layout: "client/layouts",
11
+ page: "client/pages",
12
+ util: "client/utils",
13
+ action: "server/actions",
14
+ query: "server/queries",
15
+ middleware: "server/middleware",
16
+ job: "server/jobs",
17
+ api: "server/apis",
18
+ crud: "server/cruds",
19
+ type: "types"
20
+ };
21
+ var CONFIG_TYPES = {
22
+ ROUTE: "Route",
23
+ QUERY: "Query",
24
+ ACTION: "Action",
25
+ JOB: "Job",
26
+ API: "Api",
27
+ API_NAMESPACE: "ApiNamespace",
28
+ CRUD: "Crud"
29
+ };
30
+
31
+ // src/generators/base/component-generator.base.ts
32
+ import {
33
+ hasHelperMethodCall,
34
+ logger as singletonLogger4,
35
+ toCamelCase,
36
+ toKebabCase as toKebabCase2,
37
+ validateFeaturePath as validateFeaturePath3
38
+ } from "@ingenyus/swarm";
39
+ import path7 from "path";
40
+
41
+ // src/common/filesystem.ts
42
+ import { toPascalCase, validateFeaturePath } from "@ingenyus/swarm";
43
+ import fs from "fs";
44
+ import path from "path";
45
+ var realFileSystem = {
46
+ readFileSync: fs.readFileSync,
47
+ writeFileSync: fs.writeFileSync,
48
+ existsSync: fs.existsSync,
49
+ copyFileSync: fs.copyFileSync,
50
+ mkdirSync: fs.mkdirSync,
51
+ readdirSync: fs.readdirSync,
52
+ statSync: fs.statSync
53
+ };
54
+ function findWaspRoot(fileSystem, startDir = process.cwd()) {
55
+ const startDirPath = path.resolve(startDir);
56
+ let currentDirPath = startDirPath;
57
+ const root = path.parse(currentDirPath).root;
58
+ while (currentDirPath !== root) {
59
+ const waspRootPath = path.join(currentDirPath, ".wasproot");
60
+ if (fileSystem.existsSync(waspRootPath)) {
61
+ return currentDirPath;
62
+ }
63
+ currentDirPath = path.dirname(currentDirPath);
64
+ }
65
+ throw new Error(
66
+ `Couldn't find Wasp application root from ${startDirPath}. Make sure you are running this command from within a Wasp project directory.`
67
+ );
68
+ }
69
+ function ensureDirectoryExists(fileSystem, dir) {
70
+ if (!fileSystem.existsSync(dir)) {
71
+ fileSystem.mkdirSync(dir, { recursive: true });
72
+ }
73
+ }
74
+ function normaliseFeaturePath(featurePath) {
75
+ const segments = validateFeaturePath(featurePath);
76
+ const normalisedSegments = [];
77
+ for (let i = 0; i < segments.length; i++) {
78
+ const segment = segments[i];
79
+ const previousSegment = normalisedSegments[normalisedSegments.length - 1];
80
+ if (previousSegment !== "features" && segment !== "features") {
81
+ normalisedSegments.push("features");
82
+ }
83
+ normalisedSegments.push(segment);
84
+ }
85
+ return normalisedSegments.join("/");
86
+ }
87
+ function getFeatureDir(fileSystem, featureName) {
88
+ const waspRoot = findWaspRoot(fileSystem);
89
+ const normalisedPath = normaliseFeaturePath(featureName);
90
+ return path.join(waspRoot, "src", normalisedPath);
91
+ }
92
+
93
+ // src/common/plugin.ts
94
+ import path2 from "path";
95
+ import { fileURLToPath } from "url";
96
+
97
+ // src/common/prisma.ts
98
+ import {
99
+ getSchema
100
+ } from "@mrleebo/prisma-ast";
101
+ import fs2 from "fs";
102
+ import path3 from "path";
103
+
104
+ // src/common/schemas.ts
105
+ import { commandRegistry } from "@ingenyus/swarm";
106
+ import { z } from "zod";
107
+ var commonSchemas = {
108
+ feature: z.string().min(1, "Feature is required").meta({
109
+ description: "The feature directory this component will be generated in"
110
+ }).register(commandRegistry, {
111
+ shortName: "f",
112
+ examples: ["root", "auth", "dashboard/users"],
113
+ helpText: "Can be nested as a logical or relative path, e.g. 'dashboard/users' or 'features/dashboard/features/users'"
114
+ }),
115
+ name: z.string().min(1, "Name is required").meta({ description: "The name of the generated component" }).register(commandRegistry, {
116
+ shortName: "n",
117
+ examples: ["users", "task"],
118
+ helpText: "Will be used for generated files and configuration entries"
119
+ }),
120
+ target: z.string().min(1, "Target directory is required").meta({ description: "The target path of the generated directory" }).register(commandRegistry, {
121
+ shortName: "t",
122
+ examples: ["dashboard/users", "features/dashboard/features/users"],
123
+ helpText: "A logical or relative path, e.g. 'dashboard/users' or 'features/dashboard/features/users'"
124
+ }),
125
+ path: z.string().min(1, "Path is required").meta({ description: "The path that this component will be accessible at" }).register(commandRegistry, {
126
+ shortName: "p",
127
+ examples: ["/api/users/:id", "/api/products"],
128
+ helpText: "Supports Express-style placeholders, e.g. '/api/users/:id'"
129
+ }),
130
+ dataType: z.string().min(1, "Data type is required").meta({ description: "The data type/model name for this operation" }).register(commandRegistry, {
131
+ shortName: "d",
132
+ examples: ["User", "Product", "Task"],
133
+ helpText: "The Wasp entity or model name this operation will interact with"
134
+ }),
135
+ entities: z.array(z.string()).optional().meta({
136
+ description: "The Wasp entities that will be available to this component (optional)"
137
+ }).register(commandRegistry, {
138
+ shortName: "e",
139
+ examples: ["User", "User Task"],
140
+ helpText: "An array of Wasp entity names"
141
+ }),
142
+ force: z.boolean().optional().meta({
143
+ description: "Force overwrite of existing files and configuration entries (optional)"
144
+ }).register(commandRegistry, {
145
+ shortName: "F",
146
+ helpText: "CAUTION: Will overwrite existing files and configuration entries with current parameters"
147
+ }),
148
+ auth: z.boolean().optional().meta({
149
+ description: "Require authentication for this component (optional)"
150
+ }).register(commandRegistry, {
151
+ shortName: "a",
152
+ helpText: "Will generate authentication checks"
153
+ })
154
+ };
155
+
156
+ // src/common/templates.ts
157
+ import { toKebabCase } from "@ingenyus/swarm";
158
+ import { Eta } from "eta";
159
+ import path4 from "path";
160
+ var TemplateUtility = class {
161
+ constructor(fileSystem) {
162
+ this.fileSystem = fileSystem;
163
+ }
164
+ processTemplate(templatePath, replacements) {
165
+ const declarations = Object.keys(replacements).map((key) => `${key}=it.${key}`).join(", ");
166
+ const functionHeader = declarations ? `const ${declarations};` : void 0;
167
+ const templateDir = path4.dirname(templatePath);
168
+ const eta = new Eta({
169
+ autoTrim: false,
170
+ autoEscape: false,
171
+ views: templateDir,
172
+ functionHeader
173
+ });
174
+ const templateName = path4.basename(templatePath).replace(/\.eta$/, "");
175
+ if (this.fileSystem.existsSync(templatePath)) {
176
+ return eta.render(templateName, replacements);
177
+ } else {
178
+ const template = this.fileSystem.readFileSync(templatePath, "utf8");
179
+ return eta.renderString(template, replacements);
180
+ }
181
+ }
182
+ /**
183
+ * Helper method to resolve template paths for concrete generators
184
+ * @param relativePath - The relative path to the template file
185
+ * @param generatorName - The name of the generator (e.g., 'api', 'job')
186
+ * @param currentFileUrl - The import.meta.url from the concrete generator class
187
+ * @returns The full path to the template file
188
+ */
189
+ resolveTemplatePath(relativePath, generatorName, currentFileUrl) {
190
+ const generatorDirName = toKebabCase(generatorName);
191
+ const currentFilePath = new URL(currentFileUrl).pathname;
192
+ const currentFileDir = path4.dirname(currentFilePath);
193
+ const currentFileName = path4.basename(currentFilePath);
194
+ const isInstalledPackage = currentFileDir.includes("node_modules") && currentFileDir.endsWith("/dist") && currentFileName === "index.js";
195
+ const startDir = isInstalledPackage ? currentFileDir : path4.dirname(path4.dirname(currentFileDir));
196
+ return path4.join(
197
+ startDir,
198
+ "generators",
199
+ generatorDirName,
200
+ "templates",
201
+ relativePath
202
+ );
203
+ }
204
+ };
205
+
206
+ // src/generators/feature/feature-generator.ts
207
+ import {
208
+ handleFatalError as handleFatalError2,
209
+ logger as singletonLogger3,
210
+ validateFeaturePath as validateFeaturePath2
211
+ } from "@ingenyus/swarm";
212
+ import path6 from "path";
213
+
214
+ // src/generators/base/wasp-generator.base.ts
215
+ import {
216
+ GeneratorBase,
217
+ logger as singletonLogger2,
218
+ SwarmConfigManager,
219
+ TemplateResolver
220
+ } from "@ingenyus/swarm";
221
+
222
+ // src/generators/config/wasp-config-generator.ts
223
+ import {
224
+ handleFatalError,
225
+ parseHelperMethodDefinition,
226
+ logger as singletonLogger
227
+ } from "@ingenyus/swarm";
228
+ import path5 from "path";
229
+ var WaspConfigGenerator = class {
230
+ constructor(logger = singletonLogger, fileSystem = realFileSystem) {
231
+ this.logger = logger;
232
+ this.fileSystem = fileSystem;
233
+ this.templateUtility = new TemplateUtility(fileSystem);
234
+ }
235
+ path = path5;
236
+ templateUtility;
237
+ /**
238
+ * Gets the template path for feature config templates.
239
+ * Feature config templates are located in the feature generator's templates directory.
240
+ * @param templateName - The name of the template file (e.g., 'feature.wasp.eta')
241
+ * @returns The full path to the template file
242
+ */
243
+ getTemplatePath(templateName) {
244
+ return this.templateUtility.resolveTemplatePath(
245
+ templateName,
246
+ "feature",
247
+ import.meta.url
248
+ );
249
+ }
250
+ /**
251
+ * Generate a TypeScript Wasp config file in a feature directory
252
+ * @param featurePath - The feature directory path
253
+ */
254
+ generate(featurePath) {
255
+ const featureDir = getFeatureDir(this.fileSystem, featurePath);
256
+ if (!this.fileSystem.existsSync(featureDir)) {
257
+ this.fileSystem.mkdirSync(featureDir, { recursive: true });
258
+ }
259
+ const templatePath = this.getTemplatePath("feature.wasp.eta");
260
+ if (!this.fileSystem.existsSync(templatePath)) {
261
+ this.logger.error(`Template not found: ${templatePath}`);
262
+ return;
263
+ }
264
+ const configFilePath = path5.join(featureDir, `feature.wasp.ts`);
265
+ if (this.fileSystem.existsSync(configFilePath)) {
266
+ this.logger.warn(`Feature config already exists: ${configFilePath}`);
267
+ return;
268
+ }
269
+ this.fileSystem.copyFileSync(templatePath, configFilePath);
270
+ this.logger.success(`Generated feature config: ${configFilePath}`);
271
+ }
272
+ /**
273
+ * Updates or creates a feature configuration file with a pre-built declaration.
274
+ * @param featurePath - The path to the feature
275
+ * @param declaration - The pre-built declaration string to add or update
276
+ * @returns The updated feature configuration file
277
+ */
278
+ update(featurePath, declaration) {
279
+ const configDir = getFeatureDir(this.fileSystem, featurePath);
280
+ const configFilePath = path5.join(configDir, `feature.wasp.ts`);
281
+ if (!this.fileSystem.existsSync(configFilePath)) {
282
+ const templatePath = this.getTemplatePath("feature.wasp.eta");
283
+ if (!this.fileSystem.existsSync(templatePath)) {
284
+ handleFatalError(`Feature config template not found: ${templatePath}`);
285
+ }
286
+ this.fileSystem.copyFileSync(templatePath, configFilePath);
287
+ }
288
+ let content = this.fileSystem.readFileSync(configFilePath, "utf8");
289
+ content = this.normaliseSemicolons(content);
290
+ const parsed = parseHelperMethodDefinition(declaration);
291
+ if (!parsed) {
292
+ handleFatalError(`Could not parse definition: ${declaration}`);
293
+ return content;
294
+ }
295
+ const { methodName } = parsed;
296
+ const hadExistingDefinitions = this.hasExistingDefinitions(
297
+ content,
298
+ methodName
299
+ );
300
+ content = this.removeExistingDefinition(content, declaration);
301
+ const hasExistingDefinitions = this.hasExistingDefinitions(
302
+ content,
303
+ methodName
304
+ );
305
+ const lines = content.split("\n");
306
+ const configureFunctionStart = lines.findIndex(
307
+ (line) => line.trim().startsWith("export default function")
308
+ );
309
+ if (configureFunctionStart === -1) {
310
+ handleFatalError("Could not find configure function in feature config");
311
+ }
312
+ const appLineIndex = lines.findIndex(
313
+ (line, index) => index > configureFunctionStart && line.trim() === "app"
314
+ );
315
+ if (appLineIndex === -1) {
316
+ const insertIndex = configureFunctionStart + 1;
317
+ const itemsToInsert = [" app"];
318
+ const comment = this.getMethodComment(methodName);
319
+ itemsToInsert.push(` ${comment}`);
320
+ itemsToInsert.push(declaration.trimEnd());
321
+ lines.splice(insertIndex, 0, ...itemsToInsert);
322
+ } else {
323
+ const { insertIndex, addComment } = this.findGroupInsertionPoint(
324
+ lines,
325
+ methodName,
326
+ declaration,
327
+ hadExistingDefinitions || hasExistingDefinitions
328
+ );
329
+ const newLines = this.insertWithSpacing(
330
+ lines,
331
+ declaration,
332
+ insertIndex,
333
+ methodName,
334
+ addComment
335
+ );
336
+ const normalisedContent2 = this.normaliseSemicolons(newLines.join("\n"));
337
+ this.fileSystem.writeFileSync(configFilePath, normalisedContent2);
338
+ return configFilePath;
339
+ }
340
+ const normalisedContent = this.normaliseSemicolons(lines.join("\n"));
341
+ this.fileSystem.writeFileSync(configFilePath, normalisedContent);
342
+ return configFilePath;
343
+ }
344
+ /**
345
+ * Determines the insertion index for a method name based on alphabetical ordering
346
+ * of existing groups in the configuration file.
347
+ * @param groups - Object containing existing method groups
348
+ * @param methodName - The method name to find insertion index for
349
+ * @returns The insertion index for the method name
350
+ */
351
+ getInsertionIndexForMethod(groups, methodName) {
352
+ const existingMethods = Object.keys(groups).filter(
353
+ (method) => groups[method].length > 0
354
+ );
355
+ const allMethods = [...existingMethods, methodName].sort();
356
+ return allMethods.indexOf(methodName);
357
+ }
358
+ /**
359
+ * Gets the comment text for a method type.
360
+ * @param methodName The method name (e.g., 'addApi')
361
+ * @returns The comment text for the method type
362
+ */
363
+ getMethodComment(methodName) {
364
+ const entityName = methodName.startsWith("add") ? methodName.slice(3) : methodName;
365
+ return `// ${entityName} definitions`;
366
+ }
367
+ /**
368
+ * Finds the correct insertion point for a new configuration item.
369
+ * @param lines - Array of file lines
370
+ * @param methodName - The method name (e.g., 'addApi')
371
+ * @param definition - The definition string to parse for item name
372
+ * @returns Object with insertion index and whether to add a comment
373
+ */
374
+ findGroupInsertionPoint(lines, methodName, definition, hasExistingDefinitionsOfType) {
375
+ const appLineIndex = lines.findIndex((line) => line.trim() === "app");
376
+ if (appLineIndex === -1) {
377
+ return { insertIndex: appLineIndex + 1, addComment: false };
378
+ }
379
+ const methodCalls = [];
380
+ for (let i = appLineIndex + 1; i < lines.length; i++) {
381
+ const line = lines[i].trim();
382
+ if (line.startsWith(".") && line.includes("(")) {
383
+ let methodCallContent = line;
384
+ let j = i;
385
+ let closingParenCount = 0;
386
+ let foundClosingParen = false;
387
+ for (let k = 0; k < methodCallContent.length; k++) {
388
+ if (methodCallContent[k] === "(") closingParenCount++;
389
+ if (methodCallContent[k] === ")") closingParenCount--;
390
+ if (closingParenCount === 0 && methodCallContent[k] === ")") {
391
+ foundClosingParen = true;
392
+ break;
393
+ }
394
+ }
395
+ while (!foundClosingParen && j < lines.length - 1) {
396
+ j++;
397
+ methodCallContent += " " + lines[j].trim();
398
+ for (let k = 0; k < lines[j].length; k++) {
399
+ if (lines[j][k] === "(") closingParenCount++;
400
+ if (lines[j][k] === ")") closingParenCount--;
401
+ if (closingParenCount === 0 && lines[j][k] === ")") {
402
+ foundClosingParen = true;
403
+ break;
404
+ }
405
+ }
406
+ }
407
+ const match = methodCallContent.match(
408
+ /\.(\w+)\([^,]+,\s*['"`]([^'"`]+)['"`]/
409
+ );
410
+ if (match) {
411
+ methodCalls.push({
412
+ lineIndex: i,
413
+ endLineIndex: j,
414
+ methodName: match[1],
415
+ itemName: match[2]
416
+ });
417
+ }
418
+ }
419
+ }
420
+ const groups = {};
421
+ methodCalls.forEach((call) => {
422
+ if (!groups[call.methodName]) {
423
+ groups[call.methodName] = [];
424
+ }
425
+ groups[call.methodName].push({
426
+ lineIndex: call.lineIndex,
427
+ endLineIndex: call.endLineIndex,
428
+ itemName: call.itemName
429
+ });
430
+ });
431
+ const targetGroup = groups[methodName] || [];
432
+ if (targetGroup.length === 0) {
433
+ const targetGroupIndex = this.getInsertionIndexForMethod(
434
+ groups,
435
+ methodName
436
+ );
437
+ const existingMethods = Object.keys(groups).filter((method) => groups[method].length > 0).sort();
438
+ for (let i = targetGroupIndex; i < existingMethods.length; i++) {
439
+ const groupMethod = existingMethods[i];
440
+ if (groups[groupMethod] && groups[groupMethod].length > 0) {
441
+ const firstItem = groups[groupMethod][0];
442
+ let insertIndex = firstItem.lineIndex;
443
+ for (let j = firstItem.lineIndex - 1; j > appLineIndex; j--) {
444
+ const line = lines[j].trim();
445
+ if (line.startsWith("//") && line.includes("definitions")) {
446
+ insertIndex = j;
447
+ break;
448
+ } else if (line.startsWith(".") || line === "") {
449
+ continue;
450
+ } else {
451
+ break;
452
+ }
453
+ }
454
+ return { insertIndex, addComment: !hasExistingDefinitionsOfType };
455
+ }
456
+ }
457
+ for (let i = targetGroupIndex - 1; i >= 0; i--) {
458
+ const groupMethod = existingMethods[i];
459
+ if (groups[groupMethod] && groups[groupMethod].length > 0) {
460
+ const lastItem2 = groups[groupMethod][groups[groupMethod].length - 1];
461
+ return {
462
+ insertIndex: lastItem2.endLineIndex + 1,
463
+ addComment: !hasExistingDefinitionsOfType
464
+ };
465
+ }
466
+ }
467
+ return {
468
+ insertIndex: appLineIndex + 1,
469
+ addComment: !hasExistingDefinitionsOfType
470
+ };
471
+ }
472
+ const parsed = parseHelperMethodDefinition(definition);
473
+ if (!parsed) {
474
+ return { insertIndex: appLineIndex + 1, addComment: false };
475
+ }
476
+ const { firstParam: itemName } = parsed;
477
+ for (let i = 0; i < targetGroup.length; i++) {
478
+ if (itemName.localeCompare(targetGroup[i].itemName) < 0) {
479
+ return { insertIndex: targetGroup[i].lineIndex, addComment: false };
480
+ }
481
+ }
482
+ const lastItem = targetGroup[targetGroup.length - 1];
483
+ return { insertIndex: lastItem.endLineIndex + 1, addComment: false };
484
+ }
485
+ /**
486
+ * Inserts a definition with optional comment header.
487
+ * @param lines - Array of file lines
488
+ * @param declaration - The declaration to insert
489
+ * @param insertIndex - The index where to insert
490
+ * @param methodName - The method name for comment generation
491
+ * @param addComment - Whether to add a comment before the declaration
492
+ * @returns The modified lines array
493
+ */
494
+ insertWithSpacing(lines, declaration, insertIndex, methodName, addComment = false) {
495
+ const newLines = [...lines];
496
+ if (addComment) {
497
+ const comment = this.getMethodComment(methodName);
498
+ newLines.splice(insertIndex, 0, ` ${comment}`);
499
+ insertIndex += 1;
500
+ }
501
+ newLines.splice(insertIndex, 0, declaration.trimEnd());
502
+ return newLines;
503
+ }
504
+ /**
505
+ * Checks if there are any existing definitions of a specific type in the content.
506
+ * @param content - The file content to search
507
+ * @param methodName - The method name to check for (e.g., 'addJob', 'addApi')
508
+ * @returns true if there are existing definitions of this type, false otherwise
509
+ */
510
+ hasExistingDefinitions(content, methodName) {
511
+ const lines = content.split("\n");
512
+ for (const line of lines) {
513
+ if (line.trim().startsWith(`.${methodName}(`)) {
514
+ return true;
515
+ }
516
+ }
517
+ return false;
518
+ }
519
+ /**
520
+ * Removes an existing definition from the content by finding the helper method call
521
+ * and removing the entire method call block.
522
+ * @param content - The file content
523
+ * @param definition - The new definition to find the existing one from
524
+ * @returns The content with the existing definition removed
525
+ */
526
+ removeExistingDefinition(content, definition) {
527
+ const parsed = parseHelperMethodDefinition(definition);
528
+ if (!parsed) {
529
+ return content;
530
+ }
531
+ const { methodName, firstParam } = parsed;
532
+ let contentLines = content.split("\n");
533
+ let openingLineIndex = -1;
534
+ for (let i = 0; i < contentLines.length; i++) {
535
+ const line = contentLines[i];
536
+ if (line.trim().startsWith(`.${methodName}(`)) {
537
+ if (firstParam && line.includes(firstParam)) {
538
+ openingLineIndex = i;
539
+ break;
540
+ }
541
+ }
542
+ }
543
+ if (openingLineIndex === -1) {
544
+ return content;
545
+ }
546
+ let closingLineIndex = -1;
547
+ let parenCount = 0;
548
+ let braceCount = 0;
549
+ let foundOpening = false;
550
+ for (let i = openingLineIndex; i < contentLines.length; i++) {
551
+ const line = contentLines[i];
552
+ for (const char of line) {
553
+ if (char === "(") {
554
+ parenCount++;
555
+ foundOpening = true;
556
+ } else if (char === ")") {
557
+ parenCount--;
558
+ if (foundOpening && parenCount === 0 && braceCount === 0) {
559
+ closingLineIndex = i;
560
+ break;
561
+ }
562
+ } else if (char === "{") {
563
+ braceCount++;
564
+ } else if (char === "}") {
565
+ braceCount--;
566
+ }
567
+ }
568
+ if (closingLineIndex !== -1) {
569
+ break;
570
+ }
571
+ }
572
+ if (closingLineIndex === -1) {
573
+ this.logger.warn(
574
+ "Could not find closing parenthesis for existing definition"
575
+ );
576
+ return content;
577
+ }
578
+ contentLines.splice(
579
+ openingLineIndex,
580
+ closingLineIndex - openingLineIndex + 1
581
+ );
582
+ return contentLines.join("\n");
583
+ }
584
+ /**
585
+ * Adds a definition to the content by finding the appropriate place to insert it.
586
+ * @param content - The current file content
587
+ * @param definition - The definition to add
588
+ * @returns The updated content with the new definition
589
+ */
590
+ addDefinitionToContent(content, definition) {
591
+ const lines = content.split("\n");
592
+ const lastLineIndex = lines.length - 1;
593
+ let insertIndex = lastLineIndex;
594
+ for (let i = lastLineIndex; i >= 0; i--) {
595
+ const line = lines[i].trim();
596
+ if (line && !line.startsWith("}")) {
597
+ insertIndex = i;
598
+ break;
599
+ }
600
+ }
601
+ lines.splice(insertIndex + 1, 0, ` ${definition}`);
602
+ return lines.join("\n");
603
+ }
604
+ /**
605
+ * Normalises semicolons in the config file by removing them from method chain calls
606
+ * while preserving them in other contexts (imports, declarations, etc.).
607
+ * @param content - The file content to normalise
608
+ * @returns The normalised content
609
+ */
610
+ normaliseSemicolons(content) {
611
+ const lines = content.split("\n");
612
+ const configureFunctionStart = lines.findIndex(
613
+ (line) => line.trim().startsWith("export default function")
614
+ );
615
+ if (configureFunctionStart === -1) {
616
+ return content;
617
+ }
618
+ const appLineIndex = lines.findIndex(
619
+ (line, index) => index > configureFunctionStart && line.trim().startsWith("app")
620
+ );
621
+ if (appLineIndex === -1) {
622
+ return content;
623
+ }
624
+ let braceCount = 0;
625
+ let functionEndIndex = lines.length - 1;
626
+ for (let i = configureFunctionStart; i < lines.length; i++) {
627
+ const line = lines[i];
628
+ for (const char of line) {
629
+ if (char === "{") braceCount++;
630
+ if (char === "}") {
631
+ braceCount--;
632
+ if (braceCount === 0) {
633
+ functionEndIndex = i;
634
+ break;
635
+ }
636
+ }
637
+ }
638
+ if (braceCount === 0 && i > configureFunctionStart) {
639
+ break;
640
+ }
641
+ }
642
+ let lastMethodCallIndex = -1;
643
+ for (let i = appLineIndex + 1; i < functionEndIndex; i++) {
644
+ const line = lines[i];
645
+ const trimmed = line.trim();
646
+ if ((trimmed.endsWith(")") || trimmed.endsWith(");")) && !trimmed.startsWith("//")) {
647
+ lines[i] = line.replace(/;\s*$/, "");
648
+ lastMethodCallIndex = i;
649
+ }
650
+ }
651
+ if (lastMethodCallIndex !== -1 && !lines[lastMethodCallIndex].trim().endsWith(";")) {
652
+ lines[lastMethodCallIndex] = lines[lastMethodCallIndex] + ";";
653
+ }
654
+ return lines.join("\n");
655
+ }
656
+ };
657
+
658
+ // src/generators/base/wasp-generator.base.ts
659
+ var WaspGeneratorBase = class extends GeneratorBase {
660
+ constructor(fileSystem = realFileSystem, logger = singletonLogger2) {
661
+ super(fileSystem, logger);
662
+ this.fileSystem = fileSystem;
663
+ this.logger = logger;
664
+ this.configGenerator = new WaspConfigGenerator(logger, fileSystem);
665
+ this.templateUtility = new TemplateUtility(fileSystem);
666
+ this.templateResolver = new TemplateResolver(fileSystem);
667
+ }
668
+ configGenerator;
669
+ templateUtility;
670
+ templateResolver;
671
+ swarmConfig;
672
+ configLoaded = false;
673
+ // Plugin name from swarm.config.json
674
+ pluginName = PLUGIN_NAME;
675
+ async loadSwarmConfig() {
676
+ if (this.configLoaded) return;
677
+ const configManager = new SwarmConfigManager();
678
+ this.swarmConfig = await configManager.loadConfig();
679
+ this.configLoaded = true;
680
+ }
681
+ async getCustomTemplateDir() {
682
+ await this.loadSwarmConfig();
683
+ return this.swarmConfig?.templateDirectory;
684
+ }
685
+ /**
686
+ * Resolves template path with override support
687
+ */
688
+ async getTemplatePath(templateName) {
689
+ const defaultPath = this.getDefaultTemplatePath(templateName);
690
+ const customPath = await this.getCustomTemplateDir();
691
+ if (!customPath) {
692
+ return defaultPath;
693
+ }
694
+ const { path: resolvedPath, isCustom } = this.templateResolver.resolveTemplatePath(
695
+ this.pluginName,
696
+ this.name,
697
+ templateName,
698
+ defaultPath,
699
+ customPath
700
+ );
701
+ if (isCustom) {
702
+ this.logger.info(`Using custom template: ${resolvedPath}`);
703
+ }
704
+ return resolvedPath;
705
+ }
706
+ /**
707
+ * Processes a template and writes the result to a file
708
+ */
709
+ async renderTemplateToFile(templateName, replacements, outputPath, readableFileType, force) {
710
+ const templatePath = await this.getTemplatePath(templateName);
711
+ const fileExists = this.checkFileExists(
712
+ outputPath,
713
+ force,
714
+ readableFileType
715
+ );
716
+ const content = this.templateUtility.processTemplate(
717
+ templatePath,
718
+ replacements
719
+ );
720
+ this.writeFile(outputPath, content, readableFileType, fileExists);
721
+ return fileExists;
722
+ }
723
+ /**
724
+ * Generic existence check with force flag handling
725
+ * Consolidates the pattern used in both file and config checks
726
+ */
727
+ checkExistence(exists, itemDescription, force, errorMessage) {
728
+ if (exists && !force) {
729
+ this.logger.error(`${itemDescription}. Use --force to overwrite`);
730
+ throw new Error(errorMessage || itemDescription);
731
+ }
732
+ return exists;
733
+ }
734
+ /**
735
+ * Checks if a file exists and handles force flag logic
736
+ */
737
+ checkFileExists(filePath, force, fileType) {
738
+ const fileExists = this.fileSystem.existsSync(filePath);
739
+ return this.checkExistence(
740
+ fileExists,
741
+ `${fileType} already exists: ${filePath}`,
742
+ force,
743
+ `${fileType} already exists`
744
+ );
745
+ }
746
+ /**
747
+ * Safely writes a file with proper error handling and logging
748
+ */
749
+ writeFile(filePath, content, fileType, fileExists) {
750
+ this.fileSystem.writeFileSync(filePath, content);
751
+ this.logger.success(
752
+ `${fileExists ? "Overwrote" : "Generated"} ${fileType}: ${filePath}`
753
+ );
754
+ }
755
+ };
756
+
757
+ // src/generators/feature/schema.ts
758
+ import { z as z2 } from "zod";
759
+ var schema = z2.object({
760
+ target: commonSchemas.target
761
+ });
762
+
763
+ // src/generators/feature/feature-generator.ts
764
+ var FeatureGenerator = class extends WaspGeneratorBase {
765
+ constructor(logger = singletonLogger3, fileSystem = realFileSystem) {
766
+ super(fileSystem, logger);
767
+ this.logger = logger;
768
+ this.fileSystem = fileSystem;
769
+ this.name = "feature";
770
+ this.description = "Generates a feature directory containing a Wasp configuration file";
771
+ }
772
+ name;
773
+ description;
774
+ schema = schema;
775
+ getDefaultTemplatePath(templateName) {
776
+ return this.templateUtility.resolveTemplatePath(
777
+ templateName,
778
+ this.name,
779
+ import.meta.url
780
+ );
781
+ }
782
+ /**
783
+ * Generates a feature directory containing a Wasp configuration file
784
+ * @param target - The target path of the generated directory
785
+ */
786
+ async generate(args) {
787
+ const { target } = args;
788
+ const segments = validateFeaturePath2(target);
789
+ const normalisedPath = normaliseFeaturePath(target);
790
+ const sourceRoot = path6.join(findWaspRoot(this.fileSystem), "src");
791
+ if (segments.length > 1) {
792
+ const parentPath = segments.slice(0, -1).join("/");
793
+ const parentNormalisedPath = normaliseFeaturePath(parentPath);
794
+ const parentFeatureDir = path6.join(sourceRoot, parentNormalisedPath);
795
+ if (!this.fileSystem.existsSync(parentFeatureDir)) {
796
+ handleFatalError2(
797
+ `Parent feature '${parentPath}' does not exist. Please create it first.`
798
+ );
799
+ }
800
+ }
801
+ const featureDir = path6.join(sourceRoot, normalisedPath);
802
+ this.fileSystem.mkdirSync(featureDir, { recursive: true });
803
+ this.configGenerator.generate(normalisedPath);
804
+ this.logger.success(`Generated feature: ${normalisedPath}`);
805
+ }
806
+ };
807
+
808
+ // src/generators/base/component-generator.base.ts
809
+ var ComponentGeneratorBase = class extends WaspGeneratorBase {
810
+ constructor(logger = singletonLogger4, fileSystem = realFileSystem, featureDirectoryGenerator = new FeatureGenerator(logger, fileSystem)) {
811
+ super(fileSystem, logger);
812
+ this.logger = logger;
813
+ this.fileSystem = fileSystem;
814
+ this.featureDirectoryGenerator = featureDirectoryGenerator;
815
+ this.featureDirectoryGenerator = featureDirectoryGenerator;
816
+ }
817
+ getDefaultTemplatePath(templateName) {
818
+ return this.templateUtility.resolveTemplatePath(
819
+ templateName,
820
+ this.name,
821
+ import.meta.url
822
+ );
823
+ }
824
+ get name() {
825
+ return toKebabCase2(this.componentType);
826
+ }
827
+ /**
828
+ * Validates that the feature config file exists in the target or ancestor directories
829
+ */
830
+ validateFeatureConfig(featurePath) {
831
+ const normalisedPath = normaliseFeaturePath(featurePath);
832
+ const segments = normalisedPath.split("/");
833
+ for (let i = segments.length; i > 0; i--) {
834
+ const pathSegments = segments.slice(0, i);
835
+ const currentPath = pathSegments.join("/");
836
+ const featureName = pathSegments[pathSegments.length - 1];
837
+ const featureDir = getFeatureDir(this.fileSystem, currentPath);
838
+ const configPath = path7.join(featureDir, `feature.wasp.ts`);
839
+ if (this.fileSystem.existsSync(configPath)) {
840
+ return configPath;
841
+ }
842
+ }
843
+ this.logger.error(
844
+ `Feature config file not found in '${normalisedPath}' or any ancestor directories`
845
+ );
846
+ this.logger.error(
847
+ `Expected to find a feature.wasp.ts config file in one of the feature directories`
848
+ );
849
+ throw new Error("Feature config file not found");
850
+ }
851
+ /**
852
+ * Checks if a config item already exists in the feature config
853
+ */
854
+ checkConfigExists(configPath, methodName, itemName, force) {
855
+ const configContent = this.fileSystem.readFileSync(configPath, "utf8");
856
+ const configExists = hasHelperMethodCall(
857
+ configContent,
858
+ methodName,
859
+ itemName
860
+ );
861
+ return this.checkExistence(
862
+ configExists,
863
+ `${methodName} config already exists in ${configPath}`,
864
+ force,
865
+ `${methodName} config already exists`
866
+ );
867
+ }
868
+ /**
869
+ * Updates the feature config with a new definition
870
+ */
871
+ updateFeatureConfig(featurePath, definition, configPath, configExists, methodName) {
872
+ this.configGenerator.update(featurePath, definition);
873
+ this.logger.success(
874
+ `${configExists ? "Updated" : "Added"} ${methodName} config in: ${configPath}`
875
+ );
876
+ }
877
+ /**
878
+ * Consolidated helper for updating config files with existence check
879
+ * This replaces the duplicated updateConfigFile pattern in concrete generators
880
+ */
881
+ updateConfigWithCheck(configPath, methodName, entityName, definition, featurePath, force) {
882
+ const configExists = this.checkConfigExists(
883
+ configPath,
884
+ methodName,
885
+ entityName,
886
+ force
887
+ );
888
+ if (!configExists || force) {
889
+ this.updateFeatureConfig(
890
+ featurePath,
891
+ definition,
892
+ configPath,
893
+ configExists,
894
+ methodName
895
+ );
896
+ }
897
+ }
898
+ /**
899
+ * Gets the appropriate directory for a feature based on its path.
900
+ * @param fileSystem - The filesystem abstraction
901
+ * @param featurePath - The full feature path
902
+ * @param type - The type of file being generated
903
+ * @returns The target directory and import path
904
+ */
905
+ getFeatureTargetDir(fileSystem, featurePath, type) {
906
+ validateFeaturePath3(featurePath);
907
+ const normalisedPath = normaliseFeaturePath(featurePath);
908
+ const featureDir = getFeatureDir(fileSystem, normalisedPath);
909
+ const typeKey = type.toLowerCase();
910
+ const typeDirectory = TYPE_DIRECTORIES[typeKey];
911
+ const targetDirectory = path7.join(featureDir, typeDirectory);
912
+ const importDirectory = `@src/${normalisedPath}/${typeDirectory}`;
913
+ return { targetDirectory, importDirectory };
914
+ }
915
+ /**
916
+ * Ensures a target directory exists and returns its path
917
+ */
918
+ ensureTargetDirectory(featurePath, type) {
919
+ const { targetDirectory, importDirectory } = this.getFeatureTargetDir(
920
+ this.fileSystem,
921
+ featurePath,
922
+ type
923
+ );
924
+ ensureDirectoryExists(this.fileSystem, targetDirectory);
925
+ return { targetDirectory, importDirectory };
926
+ }
927
+ /**
928
+ * Generate middleware file for API or API namespace
929
+ */
930
+ async generateMiddlewareFile(targetFile, name, force) {
931
+ const replacements = {
932
+ name,
933
+ middlewareType: toCamelCase(this.componentType || "")
934
+ };
935
+ await this.renderTemplateToFile(
936
+ "middleware.eta",
937
+ replacements,
938
+ targetFile,
939
+ "Middleware file",
940
+ force
941
+ );
942
+ }
943
+ };
944
+
945
+ // src/generators/base/operation-generator.base.ts
946
+ import {
947
+ capitalise,
948
+ getPlural,
949
+ handleFatalError as handleFatalError3,
950
+ toPascalCase as toPascalCase2
951
+ } from "@ingenyus/swarm";
952
+
953
+ // src/generators/api-namespace/schema.ts
954
+ import { z as z3 } from "zod";
955
+ var schema2 = z3.object({
956
+ feature: commonSchemas.feature,
957
+ name: commonSchemas.name,
958
+ path: commonSchemas.path,
959
+ force: commonSchemas.force
960
+ });
961
+
962
+ // src/generators/api-namespace/api-namespace-generator.ts
963
+ var ApiNamespaceGenerator = class extends ComponentGeneratorBase {
964
+ get componentType() {
965
+ return CONFIG_TYPES.API_NAMESPACE;
966
+ }
967
+ description = "Generates a Wasp API Namespace";
968
+ schema = schema2;
969
+ async generate(args) {
970
+ const { name, path: namespacePath, feature } = args;
971
+ const namespaceName = toCamelCase2(name);
972
+ return this.handleGeneratorError(
973
+ this.componentType,
974
+ namespaceName,
975
+ async () => {
976
+ const configPath = this.validateFeatureConfig(feature);
977
+ const { targetDirectory, importDirectory } = this.ensureTargetDirectory(
978
+ feature,
979
+ "middleware"
980
+ );
981
+ const targetFile = `${targetDirectory}/${namespaceName}.ts`;
982
+ await this.generateMiddlewareFile(
983
+ targetFile,
984
+ namespaceName,
985
+ args.force || false
986
+ );
987
+ await this.updateConfigFile(
988
+ namespaceName,
989
+ importDirectory,
990
+ namespacePath,
991
+ args,
992
+ configPath
993
+ );
994
+ }
995
+ );
996
+ }
997
+ async updateConfigFile(namespaceName, importDirectory, namespacePath, args, configFilePath) {
998
+ const { force = false } = args;
999
+ const importPath = path8.join(importDirectory, namespaceName);
1000
+ const definition = await this.getDefinition(
1001
+ namespaceName,
1002
+ importPath,
1003
+ namespacePath
1004
+ );
1005
+ this.updateConfigWithCheck(
1006
+ configFilePath,
1007
+ "addApiNamespace",
1008
+ namespaceName,
1009
+ definition,
1010
+ args.feature,
1011
+ force
1012
+ );
1013
+ }
1014
+ /**
1015
+ * Generates an apiNamespace definition for the feature configuration.
1016
+ */
1017
+ async getDefinition(namespaceName, middlewareImportPath, pathValue) {
1018
+ const templatePath = this.templateUtility.resolveTemplatePath(
1019
+ "config/api-namespace.eta",
1020
+ "api-namespace",
1021
+ import.meta.url
1022
+ );
1023
+ return this.templateUtility.processTemplate(templatePath, {
1024
+ namespaceName,
1025
+ middlewareImportPath,
1026
+ pathValue
1027
+ });
1028
+ }
1029
+ };
1030
+ export {
1031
+ ApiNamespaceGenerator
1032
+ };