@ama-sdk/schematics 11.1.0-prerelease.4 → 11.1.0-prerelease.41

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 (30) hide show
  1. package/README.md +8 -7
  2. package/migration.json +10 -0
  3. package/package.json +15 -15
  4. package/schematics/helpers/generators.d.ts +2 -2
  5. package/schematics/helpers/generators.d.ts.map +1 -1
  6. package/schematics/helpers/generators.js +2 -4
  7. package/schematics/java/client-core/swagger-codegen-java-client/target/javaClient-swagger-codegen-tests.jar +0 -0
  8. package/schematics/java/client-core/swagger-codegen-java-client/target/javaClient-swagger-codegen.jar +0 -0
  9. package/schematics/migrate/index.d.ts.map +1 -1
  10. package/schematics/migrate/index.js +5 -1
  11. package/schematics/migrate/schema.d.ts +1 -1
  12. package/schematics/migrate/schema.d.ts.map +1 -1
  13. package/schematics/ng-update/index.d.ts +12 -0
  14. package/schematics/ng-update/index.d.ts.map +1 -1
  15. package/schematics/ng-update/index.js +37 -1
  16. package/schematics/ng-update/typescript/index.d.ts +4 -0
  17. package/schematics/ng-update/typescript/index.d.ts.map +1 -1
  18. package/schematics/ng-update/typescript/index.js +14 -1
  19. package/schematics/ng-update/typescript/v11.0/update-openapitools.d.ts +7 -0
  20. package/schematics/ng-update/typescript/v11.0/update-openapitools.d.ts.map +1 -0
  21. package/schematics/ng-update/typescript/v11.0/update-openapitools.js +20 -0
  22. package/schematics/ng-update/typescript/v11.0/update-regen-script.d.ts +7 -0
  23. package/schematics/ng-update/typescript/v11.0/update-regen-script.d.ts.map +1 -0
  24. package/schematics/ng-update/typescript/v11.0/update-regen-script.js +29 -0
  25. package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator-tests.jar +0 -0
  26. package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator.jar +0 -0
  27. package/schematics/typescript/shell/templates/base/readme.md +11 -25
  28. package/src/public_api.d.ts +6 -0
  29. package/src/public_api.d.ts.map +1 -0
  30. package/src/public_api.js +5 -0
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
 
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@ama-sdk/schematics",
3
- "version": "11.1.0-prerelease.4",
3
+ "version": "11.1.0-prerelease.41",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -57,12 +57,12 @@
57
57
  }
58
58
  },
59
59
  "peerDependencies": {
60
- "@ama-sdk/core": "^11.1.0-prerelease.4",
60
+ "@ama-sdk/core": "^11.1.0-prerelease.41",
61
61
  "@angular-devkit/core": "~18.0.0",
62
62
  "@angular-devkit/schematics": "~18.0.0",
63
63
  "@angular-devkit/schematics-cli": "^18.0.5",
64
64
  "@angular/cli": "~18.0.0",
65
- "@o3r/schematics": "^11.1.0-prerelease.4",
65
+ "@o3r/schematics": "^11.1.0-prerelease.41",
66
66
  "@openapitools/openapi-generator-cli": "~2.13.0",
67
67
  "@schematics/angular": "~18.0.0"
68
68
  },
@@ -79,16 +79,16 @@
79
79
  "tslib": "^2.6.2"
80
80
  },
81
81
  "devDependencies": {
82
- "@ama-sdk/core": "^11.1.0-prerelease.4",
82
+ "@ama-sdk/core": "^11.1.0-prerelease.41",
83
83
  "@angular-devkit/schematics-cli": "^18.0.5",
84
84
  "@angular-eslint/eslint-plugin": "~18.0.0",
85
85
  "@angular/cli": "~18.0.0",
86
86
  "@nx/eslint-plugin": "~19.3.0",
87
87
  "@nx/jest": "~19.3.0",
88
- "@o3r/build-helpers": "^11.1.0-prerelease.4",
89
- "@o3r/eslint-plugin": "^11.1.0-prerelease.4",
90
- "@o3r/schematics": "^11.1.0-prerelease.4",
91
- "@o3r/test-helpers": "^11.1.0-prerelease.4",
88
+ "@o3r/build-helpers": "^11.1.0-prerelease.41",
89
+ "@o3r/eslint-plugin": "^11.1.0-prerelease.41",
90
+ "@o3r/schematics": "^11.1.0-prerelease.41",
91
+ "@o3r/test-helpers": "^11.1.0-prerelease.41",
92
92
  "@openapitools/openapi-generator-cli": "~2.13.0",
93
93
  "@schematics/angular": "~18.0.0",
94
94
  "@stylistic/eslint-plugin-ts": "^2.0.0",
@@ -99,16 +99,16 @@
99
99
  "@types/node": "^20.0.0",
100
100
  "@types/pid-from-port": "^1.1.0",
101
101
  "@types/semver": "^7.3.13",
102
- "@typescript-eslint/eslint-plugin": "^7.2.0",
103
- "@typescript-eslint/parser": "^7.2.0",
104
- "@typescript-eslint/utils": "~7.14.1",
102
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
103
+ "@typescript-eslint/parser": "^7.14.1",
104
+ "@typescript-eslint/utils": "^7.14.1",
105
105
  "commit-and-tag-version": "^12.0.0",
106
106
  "copyfiles": "^2.4.1",
107
107
  "cpy-cli": "^5.0.0",
108
108
  "eslint": "^8.57.0",
109
109
  "eslint-import-resolver-node": "^0.3.9",
110
110
  "eslint-plugin-jest": "~28.6.0",
111
- "eslint-plugin-jsdoc": "~48.5.0",
111
+ "eslint-plugin-jsdoc": "~48.8.0",
112
112
  "eslint-plugin-prefer-arrow": "~1.2.3",
113
113
  "eslint-plugin-unicorn": "^54.0.0",
114
114
  "isomorphic-fetch": "~3.0.0",
@@ -121,14 +121,14 @@
121
121
  "openapi-types": "^12.0.0",
122
122
  "pid-from-port": "^1.1.3",
123
123
  "semver": "^7.5.2",
124
- "ts-jest": "~29.1.2",
124
+ "ts-jest": "~29.2.0",
125
125
  "ts-node": "~10.9.2",
126
126
  "type-fest": "^4.10.2",
127
127
  "typescript": "~5.4.2"
128
128
  },
129
129
  "generatorDependencies": {
130
- "@swc/cli": "~0.3.0",
131
- "@swc/core": "~1.6.0",
130
+ "@swc/cli": "~0.4.0",
131
+ "@swc/core": "~1.7.0",
132
132
  "@swc/helpers": "~0.5.0",
133
133
  "@commitlint/cli": "^19.0.0",
134
134
  "@commitlint/config-conventional": "^19.0.0",
@@ -1,7 +1,7 @@
1
1
  /** Name of the specification file copied locally (without extension) */
2
- export declare const LOCAL_SPEC_FILENAME = "swagger-spec";
2
+ export declare const LOCAL_SPEC_FILENAME = "open-api";
3
3
  /** Extension of the Specification file in YAML format */
4
4
  export declare const SPEC_YAML_EXTENSION = "yaml";
5
5
  /** Extension of the Specification file in JSON format */
6
- export declare const SPEC_JSON_EXTENSION = "yaml";
6
+ export declare const SPEC_JSON_EXTENSION = "json";
7
7
  //# sourceMappingURL=generators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../../schematics/helpers/generators.ts"],"names":[],"mappings":"AACA,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAG1C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,SAAS,CAAC"}
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"}
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SPEC_JSON_EXTENSION = exports.SPEC_YAML_EXTENSION = exports.LOCAL_SPEC_FILENAME = void 0;
4
- // TODO: Change to `openapi` in v11 (ref: #1745)
5
4
  /** Name of the specification file copied locally (without extension) */
6
- exports.LOCAL_SPEC_FILENAME = 'swagger-spec';
5
+ exports.LOCAL_SPEC_FILENAME = 'open-api';
7
6
  /** Extension of the Specification file in YAML format */
8
7
  exports.SPEC_YAML_EXTENSION = 'yaml';
9
- // TODO: Change to `json` in v11 (ref: #1745)
10
8
  /** Extension of the Specification file in JSON format */
11
- exports.SPEC_JSON_EXTENSION = 'yaml';
9
+ exports.SPEC_JSON_EXTENSION = 'json';
12
10
  //# sourceMappingURL=generators.js.map
@@ -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,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;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/schema.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,MAAM,WAAW,8BAA8B;IAC7C,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,2FAA2F;IAC3F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/schema.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,MAAM,WAAW,8BAA8B;IAC7C,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,2FAA2F;IAC3F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC"}
@@ -3,4 +3,16 @@ import type { Rule } from '@angular-devkit/schematics';
3
3
  * update of Otter library V10.0
4
4
  */
5
5
  export declare function updateV10_0(): Rule;
6
+ /**
7
+ * update of Otter library V10.1
8
+ */
9
+ export declare function updateV10_1(): Rule;
10
+ /**
11
+ * update of Otter library V10.3
12
+ */
13
+ export declare function updateV10_3(): Rule;
14
+ /**
15
+ * update of Otter library V11.0
16
+ */
17
+ export declare function updateV11_0(): Rule;
6
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAIvD;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAQlC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AASvD;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAQlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAQlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAQlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAQlC"}
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable @typescript-eslint/naming-convention */
3
3
  /* eslint-disable camelcase */
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.updateV10_0 = void 0;
5
+ exports.updateV11_0 = exports.updateV10_3 = exports.updateV10_1 = exports.updateV10_0 = void 0;
6
6
  const typescript_1 = require("./typescript");
7
7
  const is_typescript_project_1 = require("../helpers/is-typescript-project");
8
8
  /**
@@ -17,4 +17,40 @@ function updateV10_0() {
17
17
  };
18
18
  }
19
19
  exports.updateV10_0 = updateV10_0;
20
+ /**
21
+ * update of Otter library V10.1
22
+ */
23
+ function updateV10_1() {
24
+ return (tree, context) => {
25
+ if ((0, is_typescript_project_1.isTypescriptSdk)(tree)) {
26
+ return (0, typescript_1.updateV10_1)()(tree, context);
27
+ }
28
+ return tree;
29
+ };
30
+ }
31
+ exports.updateV10_1 = updateV10_1;
32
+ /**
33
+ * update of Otter library V10.3
34
+ */
35
+ function updateV10_3() {
36
+ return (tree, context) => {
37
+ if ((0, is_typescript_project_1.isTypescriptSdk)(tree)) {
38
+ return (0, typescript_1.updateV10_3)()(tree, context);
39
+ }
40
+ return tree;
41
+ };
42
+ }
43
+ exports.updateV10_3 = updateV10_3;
44
+ /**
45
+ * update of Otter library V11.0
46
+ */
47
+ function updateV11_0() {
48
+ return (tree, context) => {
49
+ if ((0, is_typescript_project_1.isTypescriptSdk)(tree)) {
50
+ return (0, typescript_1.updateV11_0)()(tree, context);
51
+ }
52
+ return tree;
53
+ };
54
+ }
55
+ exports.updateV11_0 = updateV11_0;
20
56
  //# sourceMappingURL=index.js.map
@@ -11,4 +11,8 @@ export declare function updateV10_1(): Rule;
11
11
  * Update of Ama-sdk library V10.3
12
12
  */
13
13
  export declare function updateV10_3(): Rule;
14
+ /**
15
+ * Update of Ama-sdk library V11
16
+ */
17
+ export declare function updateV11_0(): Rule;
14
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/typescript/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAKzD;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAQlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/typescript/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAOzD;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAQlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAOlC"}
@@ -2,11 +2,13 @@
2
2
  /* eslint-disable @typescript-eslint/naming-convention */
3
3
  /* eslint-disable camelcase */
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.updateV10_3 = exports.updateV10_1 = exports.updateV10_0 = void 0;
5
+ exports.updateV11_0 = exports.updateV10_3 = exports.updateV10_1 = exports.updateV10_0 = void 0;
6
6
  const schematics_1 = require("@angular-devkit/schematics");
7
7
  const script_removal_1 = require("./v10.0/script-removal");
8
8
  const add_presets_renovate_1 = require("./v10.1/add-presets-renovate");
9
9
  const update_openapiversion_1 = require("./v10.3/update-openapiversion");
10
+ const update_regen_script_1 = require("./v11.0/update-regen-script");
11
+ const update_openapitools_1 = require("./v11.0/update-openapitools");
10
12
  /**
11
13
  * update of Otter library V10.0
12
14
  */
@@ -39,4 +41,15 @@ function updateV10_3() {
39
41
  return (0, schematics_1.chain)(updateRules);
40
42
  }
41
43
  exports.updateV10_3 = updateV10_3;
44
+ /**
45
+ * Update of Ama-sdk library V11
46
+ */
47
+ function updateV11_0() {
48
+ const updateRules = [
49
+ update_regen_script_1.updateRegenScript,
50
+ update_openapitools_1.updateOpenapitoolsFile
51
+ ];
52
+ return (0, schematics_1.chain)(updateRules);
53
+ }
54
+ exports.updateV11_0 = updateV11_0;
42
55
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ import type { Rule } from '@angular-devkit/schematics';
2
+ /**
3
+ * Update Regen Script to base remove 'swagger' keyword
4
+ * @param tree
5
+ */
6
+ export declare const updateOpenapitoolsFile: Rule;
7
+ //# sourceMappingURL=update-openapitools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-openapitools.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-update/typescript/v11.0/update-openapitools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAIvD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,IAUpC,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateOpenapitoolsFile = void 0;
4
+ const schematics_1 = require("@o3r/schematics");
5
+ const generators_1 = require("../../../helpers/generators");
6
+ /**
7
+ * Update Regen Script to base remove 'swagger' keyword
8
+ * @param tree
9
+ */
10
+ const updateOpenapitoolsFile = (tree) => {
11
+ const files = (0, schematics_1.findFilesInTree)(tree.root, (p) => p.endsWith('openapitools.json'));
12
+ files.forEach((file) => {
13
+ const configFileContent = tree.readText(file.path);
14
+ if (configFileContent.includes('swagger-spec.yaml')) {
15
+ tree.overwrite(file.path, configFileContent.replace(/swagger-spec\.yaml/g, `${generators_1.LOCAL_SPEC_FILENAME}.yaml`));
16
+ }
17
+ });
18
+ };
19
+ exports.updateOpenapitoolsFile = updateOpenapitoolsFile;
20
+ //# sourceMappingURL=update-openapitools.js.map
@@ -0,0 +1,7 @@
1
+ import type { Rule } from '@angular-devkit/schematics';
2
+ /**
3
+ * Update Regen Script to base remove 'swagger' keyword
4
+ * @param tree
5
+ */
6
+ export declare const updateRegenScript: Rule;
7
+ //# sourceMappingURL=update-regen-script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-regen-script.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-update/typescript/v11.0/update-regen-script.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAOvD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,IAoB/B,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateRegenScript = void 0;
4
+ const schematics_1 = require("@o3r/schematics");
5
+ const generators_1 = require("../../../helpers/generators");
6
+ const SCRIPT_REGEN_LABEL = 'spec:regen';
7
+ /**
8
+ * Update Regen Script to base remove 'swagger' keyword
9
+ * @param tree
10
+ */
11
+ const updateRegenScript = (tree) => {
12
+ const files = (0, schematics_1.findFilesInTree)(tree.root, (p) => p.endsWith('package.json'));
13
+ files.forEach((file) => {
14
+ const packageJson = tree.readJson(file.path);
15
+ if (!packageJson.scripts || !Object.keys(packageJson.scripts).includes(SCRIPT_REGEN_LABEL)) {
16
+ return;
17
+ }
18
+ const swaggerFilePath = file.path.replace(/package\.json$/, 'swagger-spec.yaml');
19
+ if (!tree.exists(swaggerFilePath)) {
20
+ return;
21
+ }
22
+ packageJson.scripts[SCRIPT_REGEN_LABEL] = packageJson.scripts[SCRIPT_REGEN_LABEL].replace(/swagger-spec\.yaml/g, `${generators_1.LOCAL_SPEC_FILENAME}.yaml`);
23
+ tree.overwrite(file.path, JSON.stringify(packageJson, null, 2));
24
+ const openApiFilePath = file.path.replace(/package\.json$/, `${generators_1.LOCAL_SPEC_FILENAME}.yaml`);
25
+ tree.rename(swaggerFilePath, openApiFilePath);
26
+ });
27
+ };
28
+ exports.updateRegenScript = updateRegenScript;
29
+ //# sourceMappingURL=update-regen-script.js.map
@@ -124,12 +124,16 @@ For example, you want to be able to display that the flight is in X hours.
124
124
  You will need to compute this information with the two timezones -- the airport's and the user's.
125
125
 
126
126
  ### Solution proposed to remove the timezone: utils.DateTime
127
- We have introduced the utils.Date object to replace the Date implementation and ignore the timezone.
128
- As we need to get rid of the timezones more often than not, this will be our default behavior.
129
- By default, the Date models are replaced with utils.Date.
127
+ The Otter framework has introduced the `utils.Date` and `utils.DateTime` objects to replace the `Date` implementation and convert the date returned by the API as if it were in the
128
+ timezone of the user.
130
129
 
131
- When we need to keep the timezone information, we create a new field directly in the SDK.
132
- As this field does not exist in the specification, it will not be part of the base model but of the core model instead.
130
+ Dates can be generated as `utils.Date` or `string` depending on the value of the `stringifyDate` option. This ensures that the timezone will not impact the date.
131
+ In the case of `date-time` objects, the default type used is the native `string` and `Date` type depending on the `stringifyDate` option value.
132
+
133
+ If you want to generate a date-time using `utils.DateTime`, you can do it at property level thanks to the `x-local-timezone` vendor.
134
+
135
+ If you need to keep the timezone information, extend the model and create a new field directly in the SDK.
136
+ As this field does not exist in the specification, it will not be part of the base model but of the core model instead (the first one being completely generated from the API specifications).
133
137
 
134
138
  Simple example:
135
139
  ```yaml
@@ -140,6 +144,8 @@ Simple example:
140
144
  properties:
141
145
  departureDateTime:
142
146
  type: string
147
+ x-local-timezone: true
148
+ description: If this vendor extension is present send dates without their timezone
143
149
  format: date-time
144
150
  ```
145
151
  Base model generated
@@ -197,23 +203,3 @@ export * from './flight/index';
197
203
 
198
204
  You can now use departureDateTimeConsideringTimezone to access the timezone information.
199
205
  See [utils.Date](https://github.com/AmadeusITGroup/otter/blob/main/packages/%40ama-sdk/core/src/fwk/date.ts) for more information.
200
-
201
- ### How to keep the timezone (prevent Date replacement with utils.Date)
202
-
203
- In order to add the timezone to your timestamp property you can add the x-date-timezone extension in your yaml, for example:
204
-
205
- ```yaml
206
- properties:
207
- timestamp:
208
- title: timestamp
209
- description: >-
210
- Timestamp when event is triggered. UTC time (server time), with a
211
- format similar to yyyy-MM-ddThh:mm:ss.sTZD. Refer to the pattern
212
- type: string
213
- format: date-time
214
- x-date-timezone:
215
- description: If this vendor extension is present send dates with the timezone
216
- pattern: >-
217
- ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{1,3}([Z]|([+][0-9]{2}:?[0-9]{2}$))
218
- example: '2013-12-31T19:20:30.45+01:00'
219
- ```
@@ -0,0 +1,6 @@
1
+ export * from '../schematics/helpers/generators';
2
+ export type * from '../schematics/helpers/open-api-tools-configuration';
3
+ export type * from '../schematics/typescript/core/schema';
4
+ export type * from '../schematics/typescript/mock/schema';
5
+ export type * from '../schematics/typescript/shell/schema';
6
+ //# sourceMappingURL=public_api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,mBAAmB,oDAAoD,CAAC;AACxE,mBAAmB,sCAAsC,CAAC;AAC1D,mBAAmB,sCAAsC,CAAC;AAC1D,mBAAmB,uCAAuC,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("../schematics/helpers/generators"), exports);
5
+ //# sourceMappingURL=public_api.js.map