@ama-sdk/schematics 11.0.0-prerelease.9 → 11.0.0-rc.10

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 (64) hide show
  1. package/README.md +8 -7
  2. package/cli/clear-index.cjs +35 -0
  3. package/cli/clear-index.cjs.map +1 -0
  4. package/cli/clear-index.d.cts +3 -0
  5. package/cli/clear-index.d.cts.map +1 -0
  6. package/cli/files-pack.cjs +96 -0
  7. package/cli/files-pack.cjs.map +1 -0
  8. package/cli/files-pack.d.cts +3 -0
  9. package/cli/files-pack.d.cts.map +1 -0
  10. package/cli/package.json +3 -0
  11. package/cli/update-spec-from-npm.cjs +75 -0
  12. package/cli/update-spec-from-npm.cjs.map +1 -0
  13. package/cli/update-spec-from-npm.d.cts +3 -0
  14. package/cli/update-spec-from-npm.d.cts.map +1 -0
  15. package/migration.json +10 -0
  16. package/package.json +55 -37
  17. package/schematics/helpers/generators.d.ts +7 -0
  18. package/schematics/helpers/generators.d.ts.map +1 -0
  19. package/schematics/helpers/generators.js +10 -0
  20. package/schematics/helpers/generators.js.map +1 -0
  21. package/schematics/helpers/open-api-tools-configuration.d.ts +28 -0
  22. package/schematics/helpers/open-api-tools-configuration.d.ts.map +1 -0
  23. package/schematics/helpers/open-api-tools-configuration.js +3 -0
  24. package/schematics/helpers/open-api-tools-configuration.js.map +1 -0
  25. package/schematics/java/client-core/swagger-codegen-java-client/target/javaClient-swagger-codegen-tests.jar +0 -0
  26. package/schematics/java/client-core/swagger-codegen-java-client/target/javaClient-swagger-codegen.jar +0 -0
  27. package/schematics/migrate/index.d.ts.map +1 -1
  28. package/schematics/migrate/index.js +5 -1
  29. package/schematics/migrate/index.js.map +1 -1
  30. package/schematics/migrate/schema.d.ts +1 -1
  31. package/schematics/migrate/schema.d.ts.map +1 -1
  32. package/schematics/ng-update/index.d.ts +12 -0
  33. package/schematics/ng-update/index.d.ts.map +1 -1
  34. package/schematics/ng-update/index.js +37 -1
  35. package/schematics/ng-update/index.js.map +1 -1
  36. package/schematics/ng-update/typescript/index.d.ts +4 -0
  37. package/schematics/ng-update/typescript/index.d.ts.map +1 -1
  38. package/schematics/ng-update/typescript/index.js +14 -1
  39. package/schematics/ng-update/typescript/index.js.map +1 -1
  40. package/schematics/ng-update/typescript/v10.0/script-removal.js +1 -1
  41. package/schematics/ng-update/typescript/v10.0/script-removal.js.map +1 -1
  42. package/schematics/ng-update/typescript/v11.0/update-openapitools.d.ts +7 -0
  43. package/schematics/ng-update/typescript/v11.0/update-openapitools.d.ts.map +1 -0
  44. package/schematics/ng-update/typescript/v11.0/update-openapitools.js +20 -0
  45. package/schematics/ng-update/typescript/v11.0/update-openapitools.js.map +1 -0
  46. package/schematics/ng-update/typescript/v11.0/update-regen-script.d.ts +7 -0
  47. package/schematics/ng-update/typescript/v11.0/update-regen-script.d.ts.map +1 -0
  48. package/schematics/ng-update/typescript/v11.0/update-regen-script.js +29 -0
  49. package/schematics/ng-update/typescript/v11.0/update-regen-script.js.map +1 -0
  50. package/schematics/typescript/core/index.d.ts.map +1 -1
  51. package/schematics/typescript/core/index.js +4 -4
  52. package/schematics/typescript/core/index.js.map +1 -1
  53. package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator-tests.jar +0 -0
  54. package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator.jar +0 -0
  55. package/schematics/typescript/shell/index.d.ts.map +1 -1
  56. package/schematics/typescript/shell/index.js +2 -1
  57. package/schematics/typescript/shell/index.js.map +1 -1
  58. package/schematics/typescript/shell/templates/base/.renovaterc.json.template +0 -3
  59. package/schematics/typescript/shell/templates/base/package.json.template +4 -3
  60. package/schematics/typescript/shell/templates/base/readme.md +11 -25
  61. package/src/public_api.d.ts +2 -0
  62. package/src/public_api.d.ts.map +1 -1
  63. package/src/public_api.js +2 -0
  64. package/src/public_api.js.map +1 -1
package/README.md CHANGED
@@ -127,16 +127,16 @@ Please note that revivers are generated for SDKs that use:
127
127
 
128
128
  If your specification file includes dates, there are multiple options for the generation of your SDK involving the global property option `stringifyDate`:
129
129
 
130
- - By default, the option `stringifyDate` is false so dates will be generated as either `utils.Date`, `utils.DateTime`, or `Date`.
130
+ - By default, the option `stringifyDate` is set to `true`. Set it to `false` if you want date-time objects to be generated
131
+ as `Date` and date objects to be generated as `utils.Date`.
131
132
  For more information related to these types, check out this [documentation](https://github.com/AmadeusITGroup/otter/tree/main/packages/%40ama-sdk/schematics/schematics/typescript/shell/templates/base#manage-dates).
132
- - To leave the handling of the timezone to the application and generate the dates as `string` types, the option `stringifyDate` can be set to true. <br>
133
- This can be done by adding `--global-property stringifyDate` to the generator command.
134
- - If an existing SDK contains stringified dates that need to be reverted to their expected formats, you can regenerate the SDK by removing the `stringifyDate` option from the global properties (since it is false by default).
133
+ This can be done by adding `--global-property stringifyDate=false` to the generator command or by adding the global property
134
+ to the `openapitools.json`.
135
135
 
136
- Example to stringify dates:
136
+ Example to use `Date`:
137
137
 
138
138
  ```shell
139
- yarn schematics @ama-sdk/schematics:typescript-core --spec-path ./swagger-spec.yaml --global-property stringifyDate
139
+ yarn schematics @ama-sdk/schematics:typescript-core --spec-path ./swagger-spec.yaml --global-property stringifyDate=false
140
140
  ```
141
141
 
142
142
  ##### Extensible models
@@ -214,7 +214,7 @@ described global properties `stringifyDate` and `allowModelExtension`:
214
214
  "output": ".",
215
215
  "inputSpec": "./openapi-spec.yaml", // or "./openapi-spec.json" according to the specification format
216
216
  "globalProperty": {
217
- "stringifyDate": true,
217
+ "stringifyDate": false,
218
218
  "allowModelExtension": true
219
219
  }
220
220
  }
@@ -252,6 +252,7 @@ yarn schematics @ama-sdk/schematics:migrate --from 10.0.0 [--to 11.0.0]
252
252
  ```
253
253
 
254
254
  > [!NOTE]
255
+ >
255
256
  > - The `--from` parameter is mandatory to provide the version of the original `@ama-sdk/schematics` package from which the rules should be run.
256
257
  > - The *optional* `--to` parameter allows to indicate a version until which the rules should be run. The current installed version will be used if not provided.
257
258
 
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /*
4
+ * Remove deleted models' exports
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const minimist = require("minimist");
8
+ const node_fs_1 = require("node:fs");
9
+ const node_path_1 = require("node:path");
10
+ const argv = minimist(process.argv.slice(2));
11
+ const { help } = argv;
12
+ const baseDir = (0, node_path_1.resolve)(process.cwd(), 'src', 'models', 'base');
13
+ if (help) {
14
+ // eslint-disable-next-line no-console
15
+ console.log(`Remove the index files that are no longer necessary after the deletion of the associated model.
16
+ Usage: amasdk-clear-index
17
+ `);
18
+ process.exit(0);
19
+ }
20
+ void (async () => {
21
+ const models = await node_fs_1.promises.readdir(baseDir);
22
+ const shouldRemoveModels = (await Promise.all(models
23
+ .filter((file) => (0, node_fs_1.statSync)((0, node_path_1.resolve)(baseDir, file)).isDirectory())
24
+ .map(async (model) => {
25
+ const files = await node_fs_1.promises.readdir((0, node_path_1.resolve)(baseDir, model));
26
+ return { model, removeIndex: files.length === 1 };
27
+ }))).filter(({ removeIndex }) => removeIndex)
28
+ .map(({ model }) => model);
29
+ await Promise.all(shouldRemoveModels
30
+ .map((model) => {
31
+ console.warn(`Removing ${model} model`);
32
+ return node_fs_1.promises.unlink((0, node_path_1.resolve)(baseDir, model, 'index.ts'));
33
+ }));
34
+ })();
35
+ //# sourceMappingURL=clear-index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clear-index.cjs","sourceRoot":"","sources":["../../cli/clear-index.cts"],"names":[],"mappings":";;AAEA;;GAEG;;AAEH,qCAAqC;AACrC,qCAAmD;AACnD,yCAAoC;AAEpC,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7C,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;AACtB,MAAM,OAAO,GAAG,IAAA,mBAAO,EAAC,OAAO,CAAC,GA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,CAAC,CAAC,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=clear-index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clear-index.d.cts","sourceRoot":"","sources":["../../cli/clear-index.cts"],"names":[],"mappings":""}
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /*
4
+ * Update the Typescript SDK Package to expose the sub modules
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const node_fs_1 = require("node:fs");
8
+ const minimist = require("minimist");
9
+ const path = require("node:path");
10
+ const node_fs_2 = require("node:fs");
11
+ const globby = require("globby");
12
+ const argv = minimist(process.argv.slice(2));
13
+ const distFolder = argv.dist || 'dist';
14
+ const baseDir = argv.cwd && path.resolve(process.cwd(), argv.cwd) || process.cwd();
15
+ const { help, watch, noExports } = argv;
16
+ if (help) {
17
+ // eslint-disable-next-line no-console
18
+ console.log(`Prepare the dist folder for publication. This will copy necessary files from src and update the exports in package.json.
19
+ Usage: amasdk-files-pack [--exports] [--watch]
20
+
21
+ --exports Update the exports in package.json. (Default: true)
22
+ --watch Watch for files changes and run the updates
23
+ `);
24
+ process.exit(0);
25
+ }
26
+ const files = [
27
+ { glob: 'README.md', cwdForCopy: baseDir },
28
+ { glob: 'LICENSE', cwdForCopy: baseDir },
29
+ { glob: 'package.json', cwdForCopy: baseDir },
30
+ { glob: 'src/**/package.json', cwdForCopy: path.join(baseDir, 'src') }
31
+ ];
32
+ /** Update package.json exports */
33
+ const updateExports = async () => {
34
+ const packageJson = JSON.parse(await node_fs_2.promises.readFile(path.join(baseDir, 'package.json'), { encoding: 'utf8' }));
35
+ const packageJsonFiles = globby.sync(path.posix.join(distFolder, '*', '**', 'package.json'), { absolute: true });
36
+ packageJson.exports = packageJson.exports || {};
37
+ for (const packageJsonFile of packageJsonFiles) {
38
+ try {
39
+ const subPackageJson = JSON.parse(await node_fs_2.promises.readFile(packageJsonFile, { encoding: 'utf8' }));
40
+ const folder = './' + path.relative(path.join(baseDir, distFolder), path.dirname(packageJsonFile)).replace(/[/\\]+/g, '/');
41
+ packageJson.exports[folder] = packageJson.exports[folder] || {};
42
+ Object.entries(subPackageJson).forEach(([key, value]) => {
43
+ if (['name', 'sideEffects'].includes(key)) {
44
+ return;
45
+ }
46
+ packageJson.exports[folder][key] = './' + path.relative(path.join(baseDir, distFolder), path.resolve(path.dirname(packageJsonFile), value)).replace(/[/\\]+/g, '/');
47
+ });
48
+ packageJson.exports[folder].import = packageJson.exports[folder].module || packageJson.exports[folder].esm2020 || packageJson.exports[folder].esm2015 || packageJson.exports[folder].node;
49
+ packageJson.exports[folder].require = packageJson.exports[folder].node;
50
+ packageJson.exports[folder].main = packageJson.exports[folder].import || packageJson.exports[folder].require;
51
+ }
52
+ catch (e) {
53
+ if (watch) {
54
+ console.warn(`Exception in ${packageJsonFile}`, e);
55
+ }
56
+ else {
57
+ throw e;
58
+ }
59
+ }
60
+ }
61
+ delete packageJson.scripts;
62
+ await node_fs_2.promises.writeFile(path.join(baseDir, distFolder, 'package.json'), JSON.stringify(packageJson, null, 2));
63
+ };
64
+ void (async () => {
65
+ const copyToDist = (file, cwdForCopy) => {
66
+ const distFile = path.resolve(baseDir, distFolder, path.relative(cwdForCopy, file));
67
+ // eslint-disable-next-line no-console
68
+ console.log(`${file} copied to ${distFile}`);
69
+ try {
70
+ (0, node_fs_1.mkdirSync)(path.dirname(distFile), { recursive: true });
71
+ }
72
+ catch { /* ignore error */ }
73
+ return (0, node_fs_1.copyFileSync)(file, distFile);
74
+ };
75
+ // Move files into the dist folder
76
+ const copies = files.map(async ({ glob, cwdForCopy }) => {
77
+ return watch ?
78
+ Promise.resolve().then(() => require('chokidar')).then((chokidar) => chokidar.watch(glob, { cwd: baseDir }))
79
+ .then((watcher) => watcher.on('all', async (event, file) => {
80
+ if (event !== 'unlink' && event !== 'unlinkDir') {
81
+ copyToDist(file, cwdForCopy);
82
+ if (!noExports) {
83
+ await updateExports();
84
+ }
85
+ }
86
+ })) :
87
+ globby.sync(glob)
88
+ .forEach((file) => copyToDist(file, cwdForCopy));
89
+ });
90
+ await Promise.all(copies);
91
+ // Edit package.json exports
92
+ if (!noExports && !watch) {
93
+ await updateExports();
94
+ }
95
+ })();
96
+ //# sourceMappingURL=files-pack.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files-pack.cjs","sourceRoot":"","sources":["../../cli/files-pack.cts"],"names":[],"mappings":";;AAEA;;GAEG;;AAEH,qCAAkD;AAClD,qCAAqC;AACrC,kCAAkC;AAClC,qCAAyC;AACzC,iCAAiC;AAGjC,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC;AACvC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AACnF,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAC,GAAG,IAAI,CAAC;AAEtC,IAAI,IAAI,EAAE,CAAC;IACT,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC;;;;;GAKX,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,KAAK,GAAG;IACZ,EAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAC;IACxC,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAC;IACtC,EAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAC;IAC3C,EAAC,IAAI,EAAE,qBAAqB,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,OA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AAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;oBAC7B,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,aAAa,EAAE,CAAC;oBACxB,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC,CAAC,CAAC;YACP,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;iBACd,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IACH,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE1B,4BAA4B;IAC5B,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC;QACzB,MAAM,aAAa,EAAE,CAAC;IACxB,CAAC;AACH,CAAC,CAAC,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=files-pack.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files-pack.d.cts","sourceRoot":"","sources":["../../cli/files-pack.cts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /*
4
+ * Update the OpenAPI spec from an NPM package
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const minimist = require("minimist");
8
+ const node_fs_1 = require("node:fs");
9
+ const node_module_1 = require("node:module");
10
+ const node_path_1 = require("node:path");
11
+ const promises_1 = require("node:fs/promises");
12
+ const schematics_1 = require("@ama-sdk/schematics");
13
+ const argv = minimist(process.argv.slice(2));
14
+ const packageName = argv._[0];
15
+ const { help, output, 'package-path': packagePath, quiet } = argv;
16
+ const openApiConfigDefaultPath = './openapitools.json';
17
+ const noop = () => undefined;
18
+ const logger = quiet ? { error: noop, warn: noop, log: noop, info: noop, debug: noop } : console;
19
+ const SPEC_YML_EXTENSION = 'yml';
20
+ const DEFAULT_SPEC_EXPORT_PATH_IN_NPM_MODULE = 'openapi';
21
+ const supportedExtensions = [schematics_1.SPEC_JSON_EXTENSION, schematics_1.SPEC_YAML_EXTENSION, SPEC_YML_EXTENSION];
22
+ if (help) {
23
+ // eslint-disable-next-line no-console
24
+ console.log(`This script can be used to update your local spec file from a given locally installed npm package.
25
+ Usage: amasdk-update-spec-from-npm <package-name> [--package-path] [--output] [--quiet]
26
+
27
+ package-name The full identifier of the npm package (e.g. @my-scope/my-package)
28
+ --package-path The relative path inside the npm package where to find the spec file (default: './openapi.yml')
29
+ --output The path where the spec file should be copied (default: './${schematics_1.LOCAL_SPEC_FILENAME}.${schematics_1.SPEC_YAML_EXTENSION}')
30
+ --quiet Don't log anything
31
+ `);
32
+ process.exit(0);
33
+ }
34
+ if (!packageName) {
35
+ logger.error('Need to provide packageName, use `amasdk-update-spec-from-npm --help` for more information');
36
+ process.exit(-1);
37
+ }
38
+ void (async () => {
39
+ let specSourcePath;
40
+ const appRequire = (0, node_module_1.createRequire)(node_path_1.posix.join(process.cwd(), 'package.json'));
41
+ const packageJsonPath = appRequire.resolve(`${packageName}/package.json`);
42
+ if (!packagePath) {
43
+ const packageJson = JSON.parse(await (0, promises_1.readFile)(packageJsonPath, { encoding: 'utf8' }));
44
+ const exportMatcher = new RegExp(`^\\./${DEFAULT_SPEC_EXPORT_PATH_IN_NPM_MODULE}\\.(?:${supportedExtensions.join('|')})$`);
45
+ const matchingExport = packageJson.exports && Object.keys(packageJson.exports).find((exportPath) => exportMatcher.test(exportPath));
46
+ if (matchingExport) {
47
+ specSourcePath = appRequire.resolve(node_path_1.posix.join(packageName, matchingExport));
48
+ }
49
+ }
50
+ else {
51
+ specSourcePath = packageJsonPath.replace(/package.json$/, packagePath);
52
+ }
53
+ if (!specSourcePath || !(0, node_fs_1.existsSync)(specSourcePath)) {
54
+ logger.error(`Unable to find source spec from ${packageName}, please make sure it is correctly exported in package.json`);
55
+ process.exit(-2);
56
+ }
57
+ let specDestinationPath = output;
58
+ if (!specDestinationPath) {
59
+ let specSourceExtension = (0, node_path_1.extname)(specSourcePath);
60
+ if (specSourceExtension === `.${SPEC_YML_EXTENSION}`) {
61
+ specSourceExtension = `.${schematics_1.SPEC_YAML_EXTENSION}`;
62
+ }
63
+ specDestinationPath = `./${schematics_1.LOCAL_SPEC_FILENAME}${specSourceExtension}`;
64
+ if ((0, node_fs_1.existsSync)(openApiConfigDefaultPath)) {
65
+ const openApiConfig = JSON.parse(await (0, promises_1.readFile)(openApiConfigDefaultPath, { encoding: 'utf8' }));
66
+ const generators = Object.values(openApiConfig['generator-cli']?.generators ?? {});
67
+ if (generators.length === 1 && generators[0].inputSpec && (0, node_path_1.extname)(generators[0].inputSpec) === specSourceExtension) {
68
+ specDestinationPath = generators[0].inputSpec;
69
+ }
70
+ }
71
+ }
72
+ logger.info(`Updating spec file from "${specSourcePath}" to "${specDestinationPath}" (CWD: "${process.cwd()}")`);
73
+ await (0, promises_1.copyFile)(specSourcePath, specDestinationPath);
74
+ })();
75
+ //# sourceMappingURL=update-spec-from-npm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-spec-from-npm.cjs","sourceRoot":"","sources":["../../cli/update-spec-from-npm.cts"],"names":[],"mappings":";;AAEA;;GAEG;;AAEH,qCAAqC;AACrC,qCAAqC;AACrC,6CAA4C;AAC5C,yCAA2C;AAC3C,+CAAsD;AAGtD,oDAAoG;AAEpG,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7C,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;AAClE,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AACvD,MAAM,IAAI,GAAG,GA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YAC5H,MAAM,UAAU,GAA4B,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;YAC5G,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,IAAA,mBAAO,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,mBAAmB,EAAE,CAAC;gBACnH,mBAAmB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAChD,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,4BAA4B,cAAc,SAAS,mBAAmB,YAAY,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACjH,MAAM,IAAA,mBAAQ,EAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;AACtD,CAAC,CAAC,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=update-spec-from-npm.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-spec-from-npm.d.cts","sourceRoot":"","sources":["../../cli/update-spec-from-npm.cts"],"names":[],"mappings":""}
package/migration.json CHANGED
@@ -6,10 +6,20 @@
6
6
  "description": "Updates of @ama-sdk/schematics to v10.0.*",
7
7
  "factory": "./schematics/ng-update/index#updateV10_0"
8
8
  },
9
+ "migration-v10_1": {
10
+ "version": "10.1.0-alpha.0",
11
+ "description": "Updates of @ama-sdk/schematics to v10.1.*",
12
+ "factory": "./schematics/ng-update/index#updateV10_1"
13
+ },
9
14
  "migration-v10_3": {
10
15
  "version": "10.3.0-alpha.0",
11
16
  "description": "Updates of @ama-sdk/schematics to v10.3.*",
12
17
  "factory": "./schematics/ng-update/index#updateV10_3"
18
+ },
19
+ "migration-v11_0": {
20
+ "version": "11.0.0-alpha.0",
21
+ "description": "Updates of @ama-sdk/schematics to v11.0.*",
22
+ "factory": "./schematics/ng-update/index#updateV11_0"
13
23
  }
14
24
  }
15
25
  }
package/package.json CHANGED
@@ -1,24 +1,33 @@
1
1
  {
2
2
  "name": "@ama-sdk/schematics",
3
- "version": "11.0.0-prerelease.9",
3
+ "version": "11.0.0-rc.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "description": "Swagger specification SDK Generator by schematics",
8
8
  "typings": "./src/public_api.d.ts",
9
+ "main": "./src/public_api.js",
10
+ "types": "./src/public_api.d.ts",
9
11
  "scripts": {
10
12
  "nx": "nx",
11
13
  "ng": "yarn nx",
12
14
  "test": "yarn nx test ama-sdk-schematics",
13
15
  "prepare:build:builders": "yarn cpy 'schematics/**/*.json' 'schematics/**/templates/**' 'schematics/**/*.jar' dist/schematics && yarn cpy '{package,collection,migration}.json' dist",
14
16
  "build": "yarn nx build ama-sdk-schematics",
17
+ "postbuild": "patch-package-json-main",
15
18
  "build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest",
16
19
  "install-swagger-cli": "mvn install:install-file -DgroupId=io.swagger -DartifactId=swagger-codegen-cli -Dversion=2.4.0-AMADEUS -Dpackaging=jar -Dfile=./schematics/resources/swagger-codegen-cli.jar",
17
20
  "build:swagger": "yarn install-swagger-cli && run-p 'build:swagger-*' 'build:openapi-*'",
18
21
  "build:openapi-typescript-gen": "mvn clean package -f ./schematics/typescript/core/openapi-codegen-typescript/pom.xml",
19
22
  "build:swagger-java-client-gen": "mvn clean package -f ./schematics/java/client-core/swagger-codegen-java-client/pom.xml",
23
+ "build:cli": "tsc -b tsconfig.cli.json --pretty && yarn generate-cjs-manifest",
20
24
  "prepare:publish": "prepare-publish ./dist"
21
25
  },
26
+ "bin": {
27
+ "amasdk-clear-index": "./cli/clear-index.cjs",
28
+ "amasdk-files-pack": "./cli/files-pack.cjs",
29
+ "amasdk-update-spec-from-npm": "./cli/update-spec-from-npm.cjs"
30
+ },
22
31
  "ng-update": {
23
32
  "migrations": "./migration.json",
24
33
  "packageGroup": [
@@ -48,63 +57,67 @@
48
57
  }
49
58
  },
50
59
  "peerDependencies": {
51
- "@ama-sdk/core": "^11.0.0-prerelease.9",
52
- "@angular-devkit/core": "~17.3.0",
53
- "@angular-devkit/schematics": "~17.3.0",
54
- "@angular-devkit/schematics-cli": "^17.0.1",
55
- "@angular/cli": "^17.0.1",
56
- "@o3r/schematics": "^11.0.0-prerelease.9",
60
+ "@ama-sdk/core": "^11.0.0-rc.10",
61
+ "@angular-devkit/core": "~18.0.0",
62
+ "@angular-devkit/schematics": "~18.0.0",
63
+ "@angular-devkit/schematics-cli": "^18.0.5",
64
+ "@angular/cli": "~18.0.0",
65
+ "@o3r/schematics": "^11.0.0-rc.10",
57
66
  "@openapitools/openapi-generator-cli": "~2.13.0",
58
- "@schematics/angular": "~17.3.0"
67
+ "@schematics/angular": "~18.0.0"
59
68
  },
60
69
  "dependencies": {
61
- "@angular-devkit/core": "~17.3.0",
62
- "@angular-devkit/schematics": "~17.3.0",
70
+ "@angular-devkit/core": "~18.0.0",
71
+ "@angular-devkit/schematics": "~18.0.0",
72
+ "chokidar": "^3.5.2",
73
+ "globby": "^11.1.0",
63
74
  "js-yaml": "^4.1.0",
64
75
  "minimatch": "~9.0.3",
76
+ "minimist": "^1.2.6",
65
77
  "rxjs": "^7.8.1",
66
78
  "semver": "^7.5.2",
67
79
  "tslib": "^2.6.2"
68
80
  },
69
81
  "devDependencies": {
70
- "@ama-sdk/core": "^11.0.0-prerelease.9",
71
- "@angular-devkit/schematics-cli": "~17.3.0",
72
- "@angular-eslint/eslint-plugin": "~17.5.0",
73
- "@angular/cli": "~17.3.0",
74
- "@nx/eslint-plugin": "~18.3.0",
75
- "@nx/jest": "~18.3.0",
76
- "@o3r/build-helpers": "^11.0.0-prerelease.9",
77
- "@o3r/eslint-plugin": "^11.0.0-prerelease.9",
78
- "@o3r/schematics": "^11.0.0-prerelease.9",
79
- "@o3r/test-helpers": "^11.0.0-prerelease.9",
82
+ "@ama-sdk/core": "^11.0.0-rc.10",
83
+ "@angular-devkit/schematics-cli": "^18.0.5",
84
+ "@angular-eslint/eslint-plugin": "~18.0.0",
85
+ "@angular/cli": "~18.0.0",
86
+ "@nx/eslint-plugin": "~19.3.0",
87
+ "@nx/jest": "~19.3.0",
88
+ "@o3r/build-helpers": "^11.0.0-rc.10",
89
+ "@o3r/eslint-plugin": "^11.0.0-rc.10",
90
+ "@o3r/schematics": "^11.0.0-rc.10",
91
+ "@o3r/test-helpers": "^11.0.0-rc.10",
80
92
  "@openapitools/openapi-generator-cli": "~2.13.0",
81
- "@schematics/angular": "~17.3.0",
82
- "@stylistic/eslint-plugin-ts": "^1.5.4",
93
+ "@schematics/angular": "~18.0.0",
94
+ "@stylistic/eslint-plugin-ts": "^2.0.0",
83
95
  "@types/jest": "~29.5.2",
84
96
  "@types/js-yaml": "^4.0.5",
85
97
  "@types/minimatch": "^5.1.2",
98
+ "@types/minimist": "^1.2.2",
86
99
  "@types/node": "^20.0.0",
87
100
  "@types/pid-from-port": "^1.1.0",
88
101
  "@types/semver": "^7.3.13",
89
- "@typescript-eslint/eslint-plugin": "^7.2.0",
90
- "@typescript-eslint/parser": "^7.2.0",
91
- "commit-and-tag-version": "^9.5.0",
102
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
103
+ "@typescript-eslint/parser": "^7.14.1",
104
+ "@typescript-eslint/utils": "^7.14.1",
105
+ "commit-and-tag-version": "^12.0.0",
92
106
  "copyfiles": "^2.4.1",
93
107
  "cpy-cli": "^5.0.0",
94
108
  "eslint": "^8.57.0",
95
109
  "eslint-import-resolver-node": "^0.3.9",
96
- "eslint-plugin-jest": "~27.9.0",
97
- "eslint-plugin-jsdoc": "~48.2.1",
110
+ "eslint-plugin-jest": "~28.6.0",
111
+ "eslint-plugin-jsdoc": "~48.4.0",
98
112
  "eslint-plugin-prefer-arrow": "~1.2.3",
99
- "eslint-plugin-unicorn": "^51.0.1",
100
- "globby": "^11.1.0",
113
+ "eslint-plugin-unicorn": "^54.0.0",
101
114
  "isomorphic-fetch": "~3.0.0",
102
115
  "jest": "~29.7.0",
103
116
  "jest-junit": "~16.0.0",
104
117
  "jsonc-eslint-parser": "~2.4.0",
105
118
  "mem-fs": "^4.0.0",
106
119
  "npm-run-all2": "^6.0.0",
107
- "nx": "~18.3.0",
120
+ "nx": "~19.3.0",
108
121
  "openapi-types": "^12.0.0",
109
122
  "pid-from-port": "^1.1.3",
110
123
  "semver": "^7.5.2",
@@ -115,20 +128,21 @@
115
128
  },
116
129
  "generatorDependencies": {
117
130
  "@swc/cli": "~0.3.0",
118
- "@swc/core": "~1.5.24",
131
+ "@swc/core": "~1.6.0",
119
132
  "@swc/helpers": "~0.5.0",
120
- "@commitlint/cli": "^18.0.0",
121
- "@commitlint/config-conventional": "^18.0.0",
133
+ "@commitlint/cli": "^19.0.0",
134
+ "@commitlint/config-conventional": "^19.0.0",
122
135
  "jest-junit": "~16.0.0",
123
136
  "lint-staged": "^15.0.0",
124
137
  "minimist": "^1.2.6",
125
138
  "rimraf": "^5.0.1",
126
- "typedoc": "~0.25.0",
127
- "tsc-watch": "^6.0.4"
139
+ "typedoc": "~0.26.0",
140
+ "tsc-watch": "^6.0.4",
141
+ "yaml-eslint-parser": "^1.2.2"
128
142
  },
129
143
  "openApiSupportedVersion": "~7.4.0",
130
144
  "engines": {
131
- "node": ">=18.0.0"
145
+ "node": "^18.19.1 || ^20.11.1 || >=22.0.0"
132
146
  },
133
147
  "contributors": [
134
148
  {
@@ -158,6 +172,7 @@
158
172
  },
159
173
  {
160
174
  "name": "Stephane Dalle",
175
+ "url": "https://github.com/sdalle-1A",
161
176
  "email": "sdalle-1A@users.noreply.github.com"
162
177
  },
163
178
  {
@@ -192,7 +207,10 @@
192
207
  }
193
208
  ],
194
209
  "bugs": "https://github.com/AmadeusITGroup/otter/issues",
195
- "repository": "https://github.com/AmadeusITGroup/otter",
210
+ "repository": {
211
+ "type": "git",
212
+ "url": "git+https://github.com/AmadeusITGroup/otter.git"
213
+ },
196
214
  "license": "BSD-3-Clause",
197
215
  "homepage": "https://amadeusitgroup.github.io/otter/"
198
216
  }
@@ -0,0 +1,7 @@
1
+ /** Name of the specification file copied locally (without extension) */
2
+ export declare const LOCAL_SPEC_FILENAME = "open-api";
3
+ /** Extension of the Specification file in YAML format */
4
+ export declare const SPEC_YAML_EXTENSION = "yaml";
5
+ /** Extension of the Specification file in JSON format */
6
+ export declare const SPEC_JSON_EXTENSION = "json";
7
+ //# sourceMappingURL=generators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/generators.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAE9C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SPEC_JSON_EXTENSION = exports.SPEC_YAML_EXTENSION = exports.LOCAL_SPEC_FILENAME = void 0;
4
+ /** Name of the specification file copied locally (without extension) */
5
+ exports.LOCAL_SPEC_FILENAME = 'open-api';
6
+ /** Extension of the Specification file in YAML format */
7
+ exports.SPEC_YAML_EXTENSION = 'yaml';
8
+ /** Extension of the Specification file in JSON format */
9
+ exports.SPEC_JSON_EXTENSION = 'json';
10
+ //# sourceMappingURL=generators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generators.js","sourceRoot":"","sources":["../../../schematics/helpers/generators.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AAC3D,QAAA,mBAAmB,GAAG,UAAU,CAAC;AAE9C,yDAAyD;AAC5C,QAAA,mBAAmB,GAAG,MAAM,CAAC;AAE1C,yDAAyD;AAC5C,QAAA,mBAAmB,GAAG,MAAM,CAAC"}
@@ -0,0 +1,28 @@
1
+ /** Configuration of an Open API generator */
2
+ export interface OpenApiToolsGenerator {
3
+ /** Location of the OpenAPI spec, as URL or file */
4
+ inputSpec: string;
5
+ /** Output path for the generated SDK */
6
+ output: string;
7
+ /** Generator to use */
8
+ generatorName: string;
9
+ /** Path to configuration file. It can be JSON or YAML */
10
+ config?: string;
11
+ /** Sets specified global properties */
12
+ globalProperty?: string | Record<string, any>;
13
+ }
14
+ /** Global configuration of Open API generators */
15
+ export interface OpenApiToolsGeneratorCli {
16
+ /** Open API version */
17
+ version: string;
18
+ /** Location of the generator JAR file */
19
+ storageDir?: string;
20
+ /** Generators configuration */
21
+ generators: Record<string, OpenApiToolsGenerator>;
22
+ }
23
+ /** Global configuration of Open API Tools */
24
+ export interface OpenApiToolsConfiguration {
25
+ /** Generators CLI configuration */
26
+ 'generator-cli': OpenApiToolsGeneratorCli;
27
+ }
28
+ //# sourceMappingURL=open-api-tools-configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-api-tools-configuration.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/open-api-tools-configuration.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/C;AAED,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACnD;AAED,6CAA6C;AAC7C,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IAEnC,eAAe,EAAE,wBAAwB,CAAC;CAC3C"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=open-api-tools-configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-api-tools-configuration.js","sourceRoot":"","sources":["../../../schematics/helpers/open-api-tools-configuration.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAkC1D;;;GAGG;AACH,eAAO,MAAM,OAAO,YAAa,8BAA8B,wBAG9D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAqC1D;;;GAGG;AACH,eAAO,MAAM,OAAO,YAAa,8BAA8B,wBAG9D,CAAC"}
@@ -3,12 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrate = void 0;
4
4
  const schematics_1 = require("@o3r/schematics");
5
5
  const node_path_1 = require("node:path");
6
+ const update_regen_script_1 = require("../ng-update/typescript/v11.0/update-regen-script");
6
7
  const semver_1 = require("semver");
7
8
  const is_typescript_project_1 = require("../helpers/is-typescript-project");
8
9
  const update_openapiversion_1 = require("../ng-update/typescript/v10.3/update-openapiversion");
9
10
  /* eslint-disable @typescript-eslint/naming-convention */
10
11
  const tsMigrationMap = {
11
- '~10.3.2': (0, update_openapiversion_1.updateOpenApiVersionInProject)()
12
+ '~10.3.2': (0, update_openapiversion_1.updateOpenApiVersionInProject)(),
13
+ '11.0.*': [
14
+ update_regen_script_1.updateRegenScript
15
+ ]
12
16
  };
13
17
  /* eslint-enable @typescript-eslint/naming-convention */
14
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/migrate/index.ts"],"names":[],"mappings":";;;AAEA,gDAAqG;AACrG,yCAAoC;AACpC,mCAAwC;AACxC,4EAAmE;AACnE,+FAAkG;AAElG,yDAAyD;AACzD,MAAM,cAAc,GAAsB;IACxC,SAAS,EAAE,IAAA,qDAA6B,GAAE;CAC3C,CAAC;AACF,wDAAwD;AAExD;;;GAGG;AACH,SAAS,SAAS,CAAC,OAAuC;IAExD,MAAM,cAAc,GAAG,OAAO,CAAC,IAAA,mBAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC;IACvF,MAAM,EAAE,GAAW,OAAO,CAAC,EAAE,IAAI,cAAc,CAAC;IAChD,MAAM,cAAc,GAAG,IAAA,mBAAU,EAAC,EAAE,CAAC,CAAC;IAEtC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACvB,IAAI,cAAc,IAAI,IAAA,WAAE,EAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC;YACzD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,6FAA6F,cAAc,IAAI;gBAC7J,yCAAyC,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,gBAAgB,GAAG,OAAO,EAAE,WAAW,IAAI,IAAA,+BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,IAAI,GAAG,CAAC;QACtH,MAAM,mBAAmB,GAAG,IAAA,uCAAe,EAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAA,mCAAsB,EAAC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,C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cAAc,IAAI;gBAC7J,yCAAyC,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,gBAAgB,GAAG,OAAO,EAAE,WAAW,IAAI,IAAA,+BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,IAAI,GAAG,CAAC;QACtH,MAAM,mBAAmB,GAAG,IAAA,uCAAe,EAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAA,mCAAsB,EAAC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACrJ,OAAO,mBAAmB,EAAE,CAAC,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAC,CAAC,CAAC;IACzD,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,MAAM,OAAO,GAAG,CAAC,OAAuC,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE;IAC7E,MAAM,EAAE,qCAAqC,EAAE,GAAG,2CAAa,iBAAiB,EAAC,CAAC;IAClF,OAAO,qCAAqC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC;AACnE,CAAC,CAAC;AAHW,QAAA,OAAO,WAGlB"}
@@ -1,4 +1,4 @@
1
- /** Schematic Option */
1
+ /** Migrate Schematics Options */
2
2
  export interface MigrateSchematicsSchemaOptions {
3
3
  /** Starting version from which the migration scripts are executed */
4
4
  from: string;