@ama-sdk/schematics 12.3.0-prerelease.6 → 12.3.0-prerelease.60
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/README.md +20 -2
- package/package.json +23 -22
- package/schematics/api-extension/index.d.ts +1 -1
- package/schematics/api-extension/index.d.ts.map +1 -1
- package/schematics/api-extension/index.js +2 -4
- package/schematics/migrate/index.d.ts +1 -1
- package/schematics/migrate/index.d.ts.map +1 -1
- package/schematics/migrate/index.js +2 -4
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +3 -8
- package/schematics/typescript/core/index.d.ts +1 -1
- package/schematics/typescript/core/index.d.ts.map +1 -1
- package/schematics/typescript/core/index.js +2 -4
- package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator-tests.jar +0 -0
- package/schematics/typescript/core/openapi-codegen-typescript/target/typescriptFetch-openapi-generator.jar +0 -0
- package/schematics/typescript/mock/index.d.ts +1 -1
- package/schematics/typescript/mock/index.d.ts.map +1 -1
- package/schematics/typescript/mock/index.js +3 -4
- package/schematics/typescript/shell/index.d.ts +1 -1
- package/schematics/typescript/shell/index.d.ts.map +1 -1
- package/schematics/typescript/shell/index.js +4 -7
- package/schematics/typescript/shell/templates/base/eslint.config.mjs.template +1 -5
- package/schematics/typescript/shell/templates/base/src/api/.editorconfig.template +2 -0
- package/schematics/typescript/shell/templates/base/src/fixtures/jest/package.json +1 -3
- package/schematics/typescript/shell/templates/base/src/helpers/package.json +1 -3
- package/schematics/typescript/shell/templates/base/src/models/base/.editorconfig.template +2 -0
- package/schematics/typescript/shell/templates/base/src/spec/.editorconfig.template +2 -0
- package/schematics/typescript/shell/templates/base/src/spec/package.json +1 -3
- package/schematics/typescript/shell/templates/base/testing/tsconfig.spec.json +1 -1
- package/schematics/typescript/shell/templates/base/tsconfigs/tsconfig.jest.json +1 -1
- package/schematics/typescript/shell/templates/base/configs/tsconfig.test.json +0 -21
- /package/schematics/typescript/mock/templates/{__dasherizeModelName__.mock.ts → __dasherizeModelName__.mock.ts.template} +0 -0
- /package/schematics/typescript/mock/templates/{__dasherizeModelName__.spec.ts → __dasherizeModelName__.spec.ts.template} +0 -0
- /package/schematics/typescript/mock/templates/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/{jest.config.js → jest.config.js.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/api/{fixtures.jest.ts → fixtures.jest.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/api/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/fixtures/jest/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/helpers/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/base/{enums.ts → enums.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/base/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/base/{patterns.ts → patterns.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/core/{enums.ts → enums.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/core/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/core/{patterns.ts → patterns.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/custom/{enums.ts → enums.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/custom/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/custom/{patterns.ts → patterns.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/{enums.ts → enums.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/models/{patterns.ts → patterns.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/spec/{api-mock.ts → api-mock.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/spec/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/spec/mock-factory/{index.ts → index.ts.template} +0 -0
- /package/schematics/typescript/shell/templates/base/src/spec/{operation-adapter.ts → operation-adapter.ts.template} +0 -0
package/README.md
CHANGED
|
@@ -119,9 +119,27 @@ For more information, check out OpenAPI's documentation on [parameter serializat
|
|
|
119
119
|
It is important to note that, as in OpenAPI 3.1, we only support simple arrays and simple non-nested objects in path and query parameters.
|
|
120
120
|
The parameter types that we support are stored in `SupportedParamType` in the package `@ama-sdk/core`.
|
|
121
121
|
|
|
122
|
+
To enable the parameter serialization within your API, you can set the option `enableParameterSerialization` to `true` (its current default value is `false`) in the constructor. For example:
|
|
123
|
+
```typescript
|
|
124
|
+
const apiConfig: ApiClient = new ApiFetchClient(
|
|
125
|
+
{
|
|
126
|
+
basePath: 'https://petstore3.swagger.io/api/v3',
|
|
127
|
+
enableParameterSerialization: true
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
We provide the methods `serializeQueryParams` and `serializePathParams` to serialize the values of query and path parameters. However, it is also possible to pass
|
|
133
|
+
your own serialization methods if the ones provided do not meet your requirements. These custom methods can be passed as a parameter to the API client constructor.
|
|
134
|
+
|
|
135
|
+
> [!NOTE]
|
|
136
|
+
> If you have enabled the serialization mechanism and want to update the query parameters within a `RequestPlugin`, these must be serialized before being returned to the
|
|
137
|
+
> API to prepare the URL. You can do so by using the serialization method that we provide (`serializeQueryParams`) or your own serialization method. The value of the query
|
|
138
|
+
> parameters returned by the `RequestPlugin` will be forwarded to the next plugin and the last value will be directly added to the URL.
|
|
139
|
+
|
|
122
140
|
> [!NOTE]
|
|
123
|
-
>
|
|
124
|
-
>
|
|
141
|
+
> It is important to note that special characters have to be encoded, as required by RFC6570 and RFC3986. Please take this into account if you choose to use your own
|
|
142
|
+
> serialization methods.
|
|
125
143
|
|
|
126
144
|
#### Light SDK
|
|
127
145
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-sdk/schematics",
|
|
3
|
-
"version": "12.3.0-prerelease.
|
|
3
|
+
"version": "12.3.0-prerelease.60",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@ama-sdk/core": "^12.3.0-prerelease.
|
|
65
|
+
"@ama-sdk/core": "^12.3.0-prerelease.60",
|
|
66
66
|
"@angular-devkit/core": "^19.0.0",
|
|
67
67
|
"@angular-devkit/schematics-cli": "^19.0.0",
|
|
68
68
|
"@angular/cli": "^19.0.0",
|
|
69
|
-
"@o3r/schematics": "^12.3.0-prerelease.
|
|
70
|
-
"@o3r/telemetry": "^12.3.0-prerelease.
|
|
69
|
+
"@o3r/schematics": "^12.3.0-prerelease.60",
|
|
70
|
+
"@o3r/telemetry": "^12.3.0-prerelease.60",
|
|
71
71
|
"@openapitools/openapi-generator-cli": "^2.15.0",
|
|
72
72
|
"openapi-types": "^12.0.0",
|
|
73
73
|
"ts-node": "~10.9.2",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@angular-devkit/core": "~19.2.0",
|
|
78
78
|
"@angular-devkit/schematics": "~19.2.0",
|
|
79
|
+
"@o3r/schematics": "^12.3.0-prerelease.60",
|
|
79
80
|
"chokidar": "^4.0.3",
|
|
80
81
|
"globby": "^11.1.0",
|
|
81
82
|
"js-yaml": "^4.1.0",
|
|
@@ -86,18 +87,17 @@
|
|
|
86
87
|
"tslib": "^2.6.2"
|
|
87
88
|
},
|
|
88
89
|
"devDependencies": {
|
|
89
|
-
"@ama-sdk/core": "^12.3.0-prerelease.
|
|
90
|
+
"@ama-sdk/core": "^12.3.0-prerelease.60",
|
|
90
91
|
"@angular-devkit/schematics-cli": "~19.2.0",
|
|
91
92
|
"@angular/cli": "~19.2.0",
|
|
92
93
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
93
|
-
"@nx/eslint-plugin": "~20.
|
|
94
|
-
"@nx/jest": "~20.
|
|
95
|
-
"@o3r/build-helpers": "^12.3.0-prerelease.
|
|
96
|
-
"@o3r/eslint-plugin": "^12.3.0-prerelease.
|
|
97
|
-
"@o3r/
|
|
98
|
-
"@o3r/
|
|
99
|
-
"@
|
|
100
|
-
"@openapitools/openapi-generator-cli": "~2.18.0",
|
|
94
|
+
"@nx/eslint-plugin": "~20.8.0",
|
|
95
|
+
"@nx/jest": "~20.8.0",
|
|
96
|
+
"@o3r/build-helpers": "^12.3.0-prerelease.60",
|
|
97
|
+
"@o3r/eslint-plugin": "^12.3.0-prerelease.60",
|
|
98
|
+
"@o3r/telemetry": "^12.3.0-prerelease.60",
|
|
99
|
+
"@o3r/test-helpers": "^12.3.0-prerelease.60",
|
|
100
|
+
"@openapitools/openapi-generator-cli": "~2.19.0",
|
|
101
101
|
"@schematics/angular": "~19.2.0",
|
|
102
102
|
"@stylistic/eslint-plugin": "~3.1.0",
|
|
103
103
|
"@types/jest": "~29.5.2",
|
|
@@ -107,12 +107,12 @@
|
|
|
107
107
|
"@types/node": "^20.0.0",
|
|
108
108
|
"@types/pid-from-port": "^1.1.0",
|
|
109
109
|
"@types/semver": "^7.3.13",
|
|
110
|
-
"@typescript-eslint/parser": "~8.
|
|
110
|
+
"@typescript-eslint/parser": "~8.31.0",
|
|
111
111
|
"angular-eslint": "~19.3.0",
|
|
112
112
|
"commit-and-tag-version": "^12.0.0",
|
|
113
113
|
"copyfiles": "^2.4.1",
|
|
114
114
|
"cpy-cli": "^5.0.0",
|
|
115
|
-
"eslint": "~9.
|
|
115
|
+
"eslint": "~9.25.0",
|
|
116
116
|
"eslint-import-resolver-node": "~0.3.9",
|
|
117
117
|
"eslint-import-resolver-typescript": "~3.10.0",
|
|
118
118
|
"eslint-plugin-import": "~2.31.0",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"jsonc-eslint-parser": "~2.4.0",
|
|
130
130
|
"mem-fs": "^4.0.0",
|
|
131
131
|
"npm-run-all2": "^7.0.0",
|
|
132
|
-
"nx": "~20.
|
|
132
|
+
"nx": "~20.8.0",
|
|
133
133
|
"openapi-types": "^12.0.0",
|
|
134
134
|
"pid-from-port": "^1.1.3",
|
|
135
135
|
"semver": "^7.5.2",
|
|
@@ -137,21 +137,22 @@
|
|
|
137
137
|
"ts-node": "~10.9.2",
|
|
138
138
|
"type-fest": "^4.30.1",
|
|
139
139
|
"typescript": "~5.8.2",
|
|
140
|
-
"typescript-eslint": "~8.
|
|
140
|
+
"typescript-eslint": "~8.31.0"
|
|
141
141
|
},
|
|
142
142
|
"generatorDependencies": {
|
|
143
|
-
"@
|
|
144
|
-
"@swc/core": "~1.11.0",
|
|
145
|
-
"@swc/helpers": "~0.5.0",
|
|
143
|
+
"@angular-eslint/eslint-plugin": "^19.0.0",
|
|
146
144
|
"@commitlint/cli": "^19.0.0",
|
|
147
145
|
"@commitlint/config-conventional": "^19.0.0",
|
|
148
|
-
"@
|
|
146
|
+
"@swc/cli": "~0.7.0",
|
|
147
|
+
"@swc/core": "~1.11.0",
|
|
148
|
+
"@swc/helpers": "~0.5.0",
|
|
149
|
+
"@typescript-eslint/eslint-plugin": "~8.31.0",
|
|
149
150
|
"jest-junit": "~16.0.0",
|
|
150
151
|
"lint-staged": "^15.0.0",
|
|
151
152
|
"minimist": "^1.2.6",
|
|
152
153
|
"rimraf": "^6.0.1",
|
|
153
|
-
"typedoc": "~0.28.0",
|
|
154
154
|
"tsc-watch": "^6.0.4",
|
|
155
|
+
"typedoc": "~0.28.0",
|
|
155
156
|
"yaml-eslint-parser": "^1.2.2"
|
|
156
157
|
},
|
|
157
158
|
"openApiSupportedVersion": "^7.11.0",
|
|
@@ -4,5 +4,5 @@ import { NgGenerateApiExtensionSchematicsSchema } from './schema';
|
|
|
4
4
|
* Generate a Extension of a API core definition
|
|
5
5
|
* @param options
|
|
6
6
|
*/
|
|
7
|
-
export declare const ngGenerateApiExtension: (options: NgGenerateApiExtensionSchematicsSchema) =>
|
|
7
|
+
export declare const ngGenerateApiExtension: (options: NgGenerateApiExtensionSchematicsSchema) => Rule;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/api-extension/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EAIL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/api-extension/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EAIL,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,sCAAsC,EACvC,MAAM,UAAU,CAAC;AAiBlB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,sCAAsC,SAA4D,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngGenerateApiExtension = void 0;
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_2 = require("@o3r/schematics");
|
|
5
6
|
/**
|
|
6
7
|
* Generate a Extension of a API core definition
|
|
7
8
|
* @param options
|
|
@@ -20,9 +21,6 @@ function ngGenerateApiExtensionFn(options) {
|
|
|
20
21
|
* Generate a Extension of a API core definition
|
|
21
22
|
* @param options
|
|
22
23
|
*/
|
|
23
|
-
const ngGenerateApiExtension = (options) =>
|
|
24
|
-
const { createOtterSchematic } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
25
|
-
return createOtterSchematic(ngGenerateApiExtensionFn)(options);
|
|
26
|
-
};
|
|
24
|
+
const ngGenerateApiExtension = (options) => (0, schematics_2.createOtterSchematic)(ngGenerateApiExtensionFn)(options);
|
|
27
25
|
exports.ngGenerateApiExtension = ngGenerateApiExtension;
|
|
28
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,5 +4,5 @@ import { MigrateSchematicsSchemaOptions } from './schema';
|
|
|
4
4
|
* Facilitate the migration of a version to another by the run of migration rules
|
|
5
5
|
* @param options
|
|
6
6
|
*/
|
|
7
|
-
export declare const migrate: (options: MigrateSchematicsSchemaOptions) =>
|
|
7
|
+
export declare const migrate: (options: MigrateSchematicsSchemaOptions) => Rule;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/migrate/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AAyBpC,OAAO,EACL,8BAA8B,EAC/B,MAAM,UAAU,CAAC;AAgClB;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,SAAS,8BAA8B,SAA6C,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.migrate = void 0;
|
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
6
|
const schematics_1 = require("@o3r/schematics");
|
|
7
|
+
const schematics_2 = require("@o3r/schematics");
|
|
7
8
|
const semver_1 = require("semver");
|
|
8
9
|
const is_typescript_project_1 = require("../helpers/is-typescript-project");
|
|
9
10
|
const typescript_1 = require("../ng-update/typescript");
|
|
@@ -40,9 +41,6 @@ function migrateFn(options) {
|
|
|
40
41
|
* Facilitate the migration of a version to another by the run of migration rules
|
|
41
42
|
* @param options
|
|
42
43
|
*/
|
|
43
|
-
const migrate = (options) =>
|
|
44
|
-
const { createOtterSchematic } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
45
|
-
return createOtterSchematic(migrateFn)(options);
|
|
46
|
-
};
|
|
44
|
+
const migrate = (options) => (0, schematics_2.createOtterSchematic)(migrateFn)(options);
|
|
47
45
|
exports.migrate = migrate;
|
|
48
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,IAAI,EAGL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAOlB;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,IAwCtC,CAAC;AAoGF;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,MAAM,qBAAqB,SAAwC,CAAC"}
|
|
@@ -5,6 +5,7 @@ const node_fs_1 = require("node:fs");
|
|
|
5
5
|
const path = require("node:path");
|
|
6
6
|
const core_1 = require("@angular-devkit/core");
|
|
7
7
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
8
|
+
const schematics_2 = require("@o3r/schematics");
|
|
8
9
|
const rxjs_1 = require("rxjs");
|
|
9
10
|
const node_install_1 = require("../helpers/node-install");
|
|
10
11
|
const packageJsonPath = '/package.json';
|
|
@@ -122,10 +123,7 @@ const registerPackageSchematics = async (tree, context) => {
|
|
|
122
123
|
}
|
|
123
124
|
return () => (0, schematics_1.chain)([
|
|
124
125
|
...schematicsDependencies.map((dep) => (0, schematics_1.externalSchematic)(dep, 'ng-add', {})),
|
|
125
|
-
|
|
126
|
-
const { registerPackageCollectionSchematics } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
127
|
-
return () => registerPackageCollectionSchematics(amaSdkSchematicsPackageJsonContent)(t, c);
|
|
128
|
-
}
|
|
126
|
+
(0, schematics_2.registerPackageCollectionSchematics)(amaSdkSchematicsPackageJsonContent)
|
|
129
127
|
]);
|
|
130
128
|
};
|
|
131
129
|
/**
|
|
@@ -146,9 +144,6 @@ function ngAddFn() {
|
|
|
146
144
|
* Add Otter ama-sdk-schematics to a Project
|
|
147
145
|
* @param opts
|
|
148
146
|
*/
|
|
149
|
-
const ngAdd = (opts) =>
|
|
150
|
-
const { createOtterSchematic } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
151
|
-
return createOtterSchematic(ngAddFn)(opts);
|
|
152
|
-
};
|
|
147
|
+
const ngAdd = (opts) => (0, schematics_2.createOtterSchematic)(ngAddFn)(opts);
|
|
153
148
|
exports.ngAdd = ngAdd;
|
|
154
149
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,5 +4,5 @@ import { NgGenerateTypescriptSDKCoreSchematicsSchema } from './schema';
|
|
|
4
4
|
* Generate a typescript SDK source code base on swagger specification
|
|
5
5
|
* @param options
|
|
6
6
|
*/
|
|
7
|
-
export declare const ngGenerateTypescriptSDK: (options: NgGenerateTypescriptSDKCoreSchematicsSchema) =>
|
|
7
|
+
export declare const ngGenerateTypescriptSDK: (options: NgGenerateTypescriptSDKCoreSchematicsSchema) => Rule;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/typescript/core/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAOL,IAAI,EAKL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/typescript/core/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAOL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAiCpC,OAAO,EACL,2CAA2C,EAC5C,MAAM,UAAU,CAAC;AAoQlB;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,2CAA2C,SAA6D,CAAC"}
|
|
@@ -5,6 +5,7 @@ const node_fs_1 = require("node:fs");
|
|
|
5
5
|
const path = require("node:path");
|
|
6
6
|
const node_url_1 = require("node:url");
|
|
7
7
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
8
|
+
const schematics_2 = require("@o3r/schematics");
|
|
8
9
|
const semver = require("semver");
|
|
9
10
|
const open_api_cli_generator_1 = require("../../code-generator/open-api-cli-generator/open-api-cli.generator");
|
|
10
11
|
const generators_1 = require("../../helpers/generators");
|
|
@@ -245,9 +246,6 @@ function ngGenerateTypescriptSDKFn(options) {
|
|
|
245
246
|
* Generate a typescript SDK source code base on swagger specification
|
|
246
247
|
* @param options
|
|
247
248
|
*/
|
|
248
|
-
const ngGenerateTypescriptSDK = (options) =>
|
|
249
|
-
const { createOtterSchematic } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
250
|
-
return createOtterSchematic(ngGenerateTypescriptSDKFn)(options);
|
|
251
|
-
};
|
|
249
|
+
const ngGenerateTypescriptSDK = (options) => (0, schematics_2.createOtterSchematic)(ngGenerateTypescriptSDKFn)(options);
|
|
252
250
|
exports.ngGenerateTypescriptSDK = ngGenerateTypescriptSDK;
|
|
253
251
|
//# sourceMappingURL=index.js.map
|
|
Binary file
|
|
Binary file
|
|
@@ -9,5 +9,5 @@ export declare function getDasherizeModelName(modelName: string): string;
|
|
|
9
9
|
* Add mock
|
|
10
10
|
* @param options
|
|
11
11
|
*/
|
|
12
|
-
export declare const ngGenerateMock: (options: NgGenerateMockSchematicsSchema) =>
|
|
12
|
+
export declare const ngGenerateMock: (options: NgGenerateMockSchematicsSchema) => Rule;
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/typescript/mock/index.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/typescript/mock/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAOL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,8BAA8B,EAC/B,MAAM,UAAU,CAAC;AAsBlB;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE/D;AAgDD;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,8BAA8B,SAAoD,CAAC"}
|
|
@@ -5,6 +5,7 @@ exports.getDasherizeModelName = getDasherizeModelName;
|
|
|
5
5
|
const path = require("node:path");
|
|
6
6
|
const core_1 = require("@angular-devkit/core");
|
|
7
7
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
8
|
+
const schematics_2 = require("@o3r/schematics");
|
|
8
9
|
function endsWith(singular, matches, excludes = []) {
|
|
9
10
|
return matches.some((match) => singular.endsWith(match)
|
|
10
11
|
&& excludes.every((exclude) => !singular.endsWith(exclude)));
|
|
@@ -61,6 +62,7 @@ function ngGenerateMockFn(options) {
|
|
|
61
62
|
dasherizeModelName,
|
|
62
63
|
dasherizeAndCapitalizeModelName: dasherizeModelName.toUpperCase()
|
|
63
64
|
}),
|
|
65
|
+
(0, schematics_1.renameTemplateFiles)(),
|
|
64
66
|
(0, schematics_1.move)(mockDestination)
|
|
65
67
|
]), schematics_1.MergeStrategy.Overwrite)(tree, context);
|
|
66
68
|
};
|
|
@@ -74,9 +76,6 @@ function ngGenerateMockFn(options) {
|
|
|
74
76
|
* Add mock
|
|
75
77
|
* @param options
|
|
76
78
|
*/
|
|
77
|
-
const ngGenerateMock = (options) =>
|
|
78
|
-
const { createOtterSchematic } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
79
|
-
return createOtterSchematic(ngGenerateMockFn)(options);
|
|
80
|
-
};
|
|
79
|
+
const ngGenerateMock = (options) => (0, schematics_2.createOtterSchematic)(ngGenerateMockFn)(options);
|
|
81
80
|
exports.ngGenerateMock = ngGenerateMock;
|
|
82
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,5 +4,5 @@ import type { NgGenerateTypescriptSDKShellSchematicsSchema } from './schema';
|
|
|
4
4
|
* Generate Typescript SDK shell
|
|
5
5
|
* @param options
|
|
6
6
|
*/
|
|
7
|
-
export declare const ngGenerateTypescriptSDK: (options: NgGenerateTypescriptSDKShellSchematicsSchema) =>
|
|
7
|
+
export declare const ngGenerateTypescriptSDK: (options: NgGenerateTypescriptSDKShellSchematicsSchema) => Rule;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/typescript/shell/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAOL,IAAI,EAKL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/typescript/shell/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAOL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAgBpC,OAAO,KAAK,EACV,4CAA4C,EAC7C,MAAM,UAAU,CAAC;AAkJlB;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,4CAA4C,SAA6D,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ngGenerateTypescriptSDK = void 0;
|
|
4
4
|
const node_path_1 = require("node:path");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
+
const schematics_2 = require("@o3r/schematics");
|
|
6
7
|
const js_yaml_1 = require("js-yaml");
|
|
7
8
|
const node_install_1 = require("../../helpers/node-install");
|
|
8
9
|
const read_package_1 = require("../../helpers/read-package");
|
|
@@ -18,7 +19,6 @@ function ngGenerateTypescriptSDKFn(options) {
|
|
|
18
19
|
};
|
|
19
20
|
const setupRule = async (tree, context) => {
|
|
20
21
|
const amaSdkSchematicsPackageJson = await (0, read_package_1.readPackageJson)();
|
|
21
|
-
const { enforceTildeRange } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
22
22
|
const versions = Object.fromEntries(Object.entries({
|
|
23
23
|
tslib: amaSdkSchematicsPackageJson.dependencies.tslib,
|
|
24
24
|
'@commitlint/cli': amaSdkSchematicsPackageJson.generatorDependencies['@commitlint/cli'],
|
|
@@ -53,7 +53,7 @@ function ngGenerateTypescriptSDKFn(options) {
|
|
|
53
53
|
'tsc-watch': amaSdkSchematicsPackageJson.generatorDependencies['tsc-watch'],
|
|
54
54
|
'yaml-eslint-parser': amaSdkSchematicsPackageJson.generatorDependencies['yaml-eslint-parser'],
|
|
55
55
|
typedoc: amaSdkSchematicsPackageJson.generatorDependencies.typedoc
|
|
56
|
-
}).map(([key, range]) => ([key, enforceTildeRange(range)])));
|
|
56
|
+
}).map(([key, range]) => ([key, (0, schematics_2.enforceTildeRange)(range)])));
|
|
57
57
|
const openApiSupportedVersion = typeof amaSdkSchematicsPackageJson.openApiSupportedVersion === 'string'
|
|
58
58
|
&& amaSdkSchematicsPackageJson.openApiSupportedVersion.replace(/\^|~/, '');
|
|
59
59
|
context.logger.warn(JSON.stringify(openApiSupportedVersion));
|
|
@@ -75,7 +75,7 @@ function ngGenerateTypescriptSDKFn(options) {
|
|
|
75
75
|
sdkCoreRange: `${options.exactO3rVersion ? '' : '~'}${amaSdkSchematicsPackageJson.version}`,
|
|
76
76
|
sdkCoreVersion: amaSdkSchematicsPackageJson.version,
|
|
77
77
|
angularVersion: amaSdkSchematicsPackageJson.dependencies['@angular-devkit/core'],
|
|
78
|
-
angularEslintVersion: amaSdkSchematicsPackageJson.
|
|
78
|
+
angularEslintVersion: amaSdkSchematicsPackageJson.generatorDependencies['@angular-eslint/eslint-plugin'],
|
|
79
79
|
versions,
|
|
80
80
|
...openApiSupportedVersion ? { openApiSupportedVersion } : {},
|
|
81
81
|
engineVersions,
|
|
@@ -146,9 +146,6 @@ function ngGenerateTypescriptSDKFn(options) {
|
|
|
146
146
|
* Generate Typescript SDK shell
|
|
147
147
|
* @param options
|
|
148
148
|
*/
|
|
149
|
-
const ngGenerateTypescriptSDK = (options) =>
|
|
150
|
-
const { createOtterSchematic } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
151
|
-
return createOtterSchematic(ngGenerateTypescriptSDKFn)(options);
|
|
152
|
-
};
|
|
149
|
+
const ngGenerateTypescriptSDK = (options) => (0, schematics_2.createOtterSchematic)(ngGenerateTypescriptSDKFn)(options);
|
|
153
150
|
exports.ngGenerateTypescriptSDK = ngGenerateTypescriptSDK;
|
|
154
151
|
//# sourceMappingURL=index.js.map
|
|
@@ -23,11 +23,7 @@ export default [
|
|
|
23
23
|
sourceType: 'commonjs',
|
|
24
24
|
parserOptions: {
|
|
25
25
|
tsconfigRootDir: __dirname,
|
|
26
|
-
|
|
27
|
-
'testing/tsconfig.spec.json',
|
|
28
|
-
'tsconfigs/tsconfig.jest.json',
|
|
29
|
-
'tsconfigs/tsconfig.source.json'
|
|
30
|
-
]
|
|
26
|
+
projectService: true
|
|
31
27
|
},
|
|
32
28
|
ecmaVersion: 12
|
|
33
29
|
}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
"name": "<% if (projectName) { %>@<%=projectName%>/<% } %><%=projectPackageName%>/jest",
|
|
3
3
|
"main": "../../cjs/api/fixtures.jest.js",
|
|
4
4
|
"module": "../../esm2020/api/fixtures.jest.js",
|
|
5
|
-
"es2020": "../../esm2020/api/fixtures.jest.js",
|
|
6
|
-
"esm2020": "../../esm2020/api/fixtures.jest.js",
|
|
7
5
|
"node": "../../cjs/api/fixtures.jest.js",
|
|
8
6
|
"default": "../../esm2020/api/fixtures.jest.js",
|
|
9
|
-
"
|
|
7
|
+
"types": "./index.d.ts"
|
|
10
8
|
}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
"name": "<% if (projectName) { %>@<%=projectName%>/<% } %><%=projectPackageName%>/helpers",
|
|
3
3
|
"main": "../cjs/helpers/index.js",
|
|
4
4
|
"module": "../esm2020/helpers/index.js",
|
|
5
|
-
"es2020": "../esm2020/helpers/index.js",
|
|
6
|
-
"esm2020": "../esm2020/helpers/index.js",
|
|
7
5
|
"node": "../cjs/helpers/index.js",
|
|
8
6
|
"default": "../esm2020/helpers/index.js",
|
|
9
|
-
"
|
|
7
|
+
"types": "./index.d.ts"
|
|
10
8
|
}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
"name": "<% if (projectName) { %>@<%=projectName%>/<% } %><%=projectPackageName%>/spec",
|
|
3
3
|
"main": "../cjs/spec/index.js",
|
|
4
4
|
"module": "../esm2020/spec/index.js",
|
|
5
|
-
"es2020": "../esm2020/spec/index.js",
|
|
6
|
-
"esm2020": "../esm2020/spec/index.js",
|
|
7
5
|
"node": "../cjs/spec/index.js",
|
|
8
6
|
"default": "../esm2020/spec/index.js",
|
|
9
|
-
"
|
|
7
|
+
"types": "./index.d.ts"
|
|
10
8
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"target": "es6",
|
|
6
|
-
"noImplicitAny": false,
|
|
7
|
-
"emitDecoratorMetadata": true,
|
|
8
|
-
"experimentalDecorators": true,
|
|
9
|
-
"strictNullChecks": false,
|
|
10
|
-
"noEmitHelpers": true,
|
|
11
|
-
"importHelpers": true,
|
|
12
|
-
"sourceMap": true,
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"outDir": "test",
|
|
15
|
-
"lib": [ "dom", "es2015", "dom.iterable", "scripthost", "es2017.object" ]
|
|
16
|
-
},
|
|
17
|
-
"include": [
|
|
18
|
-
"../src/**/*.ts"
|
|
19
|
-
],
|
|
20
|
-
"exclude": []
|
|
21
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/schematics/typescript/shell/templates/base/{jest.config.js → jest.config.js.template}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/fixtures/jest/{index.ts → index.ts.template}
RENAMED
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/helpers/{index.ts → index.ts.template}
RENAMED
|
File without changes
|
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/models/base/{enums.ts → enums.ts.template}
RENAMED
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/models/base/{index.ts → index.ts.template}
RENAMED
|
File without changes
|
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/models/core/{enums.ts → enums.ts.template}
RENAMED
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/models/core/{index.ts → index.ts.template}
RENAMED
|
File without changes
|
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/models/custom/{enums.ts → enums.ts.template}
RENAMED
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/models/custom/{index.ts → index.ts.template}
RENAMED
|
File without changes
|
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/models/{enums.ts → enums.ts.template}
RENAMED
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/models/{index.ts → index.ts.template}
RENAMED
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/models/{patterns.ts → patterns.ts.template}
RENAMED
|
File without changes
|
/package/schematics/typescript/shell/templates/base/src/spec/{api-mock.ts → api-mock.ts.template}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|