@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/cli/main.js CHANGED
@@ -1154,7 +1154,21 @@ function extractFromSourceFile(sourceFile, project) {
1154
1154
  const combined = joinPaths(prefix, handlerPath);
1155
1155
  const params = extractParams(combined);
1156
1156
  const methodName = method.getName();
1157
- const routeName = `${className}.${methodName}`;
1157
+ const classAsDecorator = cls.getDecorator("As");
1158
+ let classAs;
1159
+ if (classAsDecorator) {
1160
+ const classAsArgs = classAsDecorator.getArguments();
1161
+ const classAsName = decoratorStringArg(classAsArgs[0]);
1162
+ if (classAsName) classAs = classAsName;
1163
+ }
1164
+ const methodAsDecorator = method.getDecorator("As");
1165
+ let methodAs;
1166
+ if (methodAsDecorator) {
1167
+ const methodAsArgs = methodAsDecorator.getArguments();
1168
+ const methodAsName = decoratorStringArg(methodAsArgs[0]);
1169
+ if (methodAsName) methodAs = methodAsName;
1170
+ }
1171
+ const routeName = resolveRouteName(className, methodName, classAs, methodAs);
1158
1172
  const dtoContract = extractDtoContract(method, sourceFile, project);
1159
1173
  routes.push({
1160
1174
  method: httpMethod,
@@ -1340,7 +1354,7 @@ async function watch(config, onChange) {
1340
1354
  __name(watch, "watch");
1341
1355
 
1342
1356
  // src/index.ts
1343
- var VERSION = "1.0.4";
1357
+ var VERSION = "1.0.5";
1344
1358
 
1345
1359
  // src/cli/codegen.ts
1346
1360
  async function runCodegen(opts = {}) {