@ingenyus/swarm-wasp 0.1.0 → 0.2.1

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