@dudousxd/nestjs-inertia-codegen 1.0.4 → 1.0.5

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.
package/dist/index.d.cts CHANGED
@@ -120,6 +120,6 @@ declare function acquireLock(outDir: string): Promise<{
120
120
  release: () => Promise<void>;
121
121
  } | null>;
122
122
 
123
- declare const VERSION = "1.0.4";
123
+ declare const VERSION = "1.0.5";
124
124
 
125
125
  export { CodegenError, ConfigError, type ResolvedConfig, type ScopeConfig, type UserConfig, VERSION, type Watcher, acquireLock, defineConfig, generate, loadConfig, watch };
package/dist/index.d.ts CHANGED
@@ -120,6 +120,6 @@ declare function acquireLock(outDir: string): Promise<{
120
120
  release: () => Promise<void>;
121
121
  } | null>;
122
122
 
123
- declare const VERSION = "1.0.4";
123
+ declare const VERSION = "1.0.5";
124
124
 
125
125
  export { CodegenError, ConfigError, type ResolvedConfig, type ScopeConfig, type UserConfig, VERSION, type Watcher, acquireLock, defineConfig, generate, loadConfig, watch };
package/dist/index.js CHANGED
@@ -1166,7 +1166,21 @@ function extractFromSourceFile(sourceFile, project) {
1166
1166
  const combined = joinPaths(prefix, handlerPath);
1167
1167
  const params = extractParams(combined);
1168
1168
  const methodName = method.getName();
1169
- const routeName = `${className}.${methodName}`;
1169
+ const classAsDecorator = cls.getDecorator("As");
1170
+ let classAs;
1171
+ if (classAsDecorator) {
1172
+ const classAsArgs = classAsDecorator.getArguments();
1173
+ const classAsName = decoratorStringArg(classAsArgs[0]);
1174
+ if (classAsName) classAs = classAsName;
1175
+ }
1176
+ const methodAsDecorator = method.getDecorator("As");
1177
+ let methodAs;
1178
+ if (methodAsDecorator) {
1179
+ const methodAsArgs = methodAsDecorator.getArguments();
1180
+ const methodAsName = decoratorStringArg(methodAsArgs[0]);
1181
+ if (methodAsName) methodAs = methodAsName;
1182
+ }
1183
+ const routeName = resolveRouteName(className, methodName, classAs, methodAs);
1170
1184
  const dtoContract = extractDtoContract(method, sourceFile, project);
1171
1185
  routes.push({
1172
1186
  method: httpMethod,
@@ -1352,7 +1366,7 @@ async function watch(config, onChange) {
1352
1366
  __name(watch, "watch");
1353
1367
 
1354
1368
  // src/index.ts
1355
- var VERSION = "1.0.4";
1369
+ var VERSION = "1.0.5";
1356
1370
  export {
1357
1371
  CodegenError,
1358
1372
  ConfigError,