@o3r/apis-manager 10.2.0-prerelease.7 → 10.2.0-prerelease.71
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 +3 -0
- package/esm2022/apis-manager/api-factory.service.mjs +3 -3
- package/esm2022/apis-manager/api-manager.module.mjs +4 -4
- package/fesm2022/o3r-apis-manager.mjs +7 -7
- package/package.json +9 -9
- package/schematics/ng-add/index.d.ts +1 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +40 -39
- package/schematics/ng-add/index.js.map +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,9 @@ This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/ot
|
|
|
9
9
|
|
|
10
10
|
## Description
|
|
11
11
|
|
|
12
|
+
[](https://www.npmjs.com/package/@o3r/apis-manager)
|
|
13
|
+
[](https://www.npmjs.com/package/@o3r/apis-manager)
|
|
14
|
+
|
|
12
15
|
This module provides services to help you communicate with your APIs. Its responsibility is to provide an API configuration to a service factory so that it could instantiate an API with the right configurations.
|
|
13
16
|
|
|
14
17
|
It contains a default configuration and a map of specific configurations for API / set of API.
|
|
@@ -78,10 +78,10 @@ export class ApiFactoryService {
|
|
|
78
78
|
getConfigFor(apiClass) {
|
|
79
79
|
return this.apiManager.getConfiguration(apiClass.apiName);
|
|
80
80
|
}
|
|
81
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
82
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
81
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiFactoryService, deps: [{ token: API_TOKEN }, { token: INITIAL_APIS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
82
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiFactoryService }); }
|
|
83
83
|
}
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiFactoryService, decorators: [{
|
|
85
85
|
type: Injectable
|
|
86
86
|
}], ctorParameters: () => [{ type: i1.ApiManager, decorators: [{
|
|
87
87
|
type: Inject,
|
|
@@ -17,13 +17,13 @@ export class ApiManagerModule {
|
|
|
17
17
|
]
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
21
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
22
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
20
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiManagerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
21
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: ApiManagerModule }); }
|
|
22
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiManagerModule, providers: [
|
|
23
23
|
ApiFactoryService
|
|
24
24
|
] }); }
|
|
25
25
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiManagerModule, decorators: [{
|
|
27
27
|
type: NgModule,
|
|
28
28
|
args: [{
|
|
29
29
|
providers: [
|
|
@@ -125,10 +125,10 @@ class ApiFactoryService {
|
|
|
125
125
|
getConfigFor(apiClass) {
|
|
126
126
|
return this.apiManager.getConfiguration(apiClass.apiName);
|
|
127
127
|
}
|
|
128
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
129
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
128
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiFactoryService, deps: [{ token: API_TOKEN }, { token: INITIAL_APIS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
129
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiFactoryService }); }
|
|
130
130
|
}
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiFactoryService, decorators: [{
|
|
132
132
|
type: Injectable
|
|
133
133
|
}], ctorParameters: () => [{ type: ApiManager, decorators: [{
|
|
134
134
|
type: Inject,
|
|
@@ -155,13 +155,13 @@ class ApiManagerModule {
|
|
|
155
155
|
]
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
159
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
160
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
158
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiManagerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
159
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: ApiManagerModule }); }
|
|
160
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiManagerModule, providers: [
|
|
161
161
|
ApiFactoryService
|
|
162
162
|
] }); }
|
|
163
163
|
}
|
|
164
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApiManagerModule, decorators: [{
|
|
165
165
|
type: NgModule,
|
|
166
166
|
args: [{
|
|
167
167
|
providers: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/apis-manager",
|
|
3
|
-
"version": "10.2.0-prerelease.
|
|
3
|
+
"version": "10.2.0-prerelease.71",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"otter-module"
|
|
12
12
|
],
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@ama-sdk/core": "^10.2.0-prerelease.
|
|
15
|
-
"@angular-devkit/schematics": "~17.
|
|
16
|
-
"@angular/common": "~17.
|
|
17
|
-
"@angular/core": "~17.
|
|
18
|
-
"@o3r/schematics": "^10.2.0-prerelease.
|
|
19
|
-
"@schematics/angular": "~17.
|
|
14
|
+
"@ama-sdk/core": "^10.2.0-prerelease.71",
|
|
15
|
+
"@angular-devkit/schematics": "~17.3.0",
|
|
16
|
+
"@angular/common": "~17.3.0",
|
|
17
|
+
"@angular/core": "~17.3.0",
|
|
18
|
+
"@o3r/schematics": "^10.2.0-prerelease.71",
|
|
19
|
+
"@schematics/angular": "~17.3.0",
|
|
20
20
|
"rxjs": "^7.8.1",
|
|
21
|
-
"typescript": "~5.
|
|
21
|
+
"typescript": "~5.4.2"
|
|
22
22
|
},
|
|
23
23
|
"peerDependenciesMeta": {
|
|
24
24
|
"@angular-devkit/schematics": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"tslib": "^2.
|
|
35
|
+
"tslib": "^2.6.2"
|
|
36
36
|
},
|
|
37
37
|
"schematics": "./collection.json",
|
|
38
38
|
"engines": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAiDtD;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,qBAAqB,KAAG,IAGtD,CAAC"}
|
|
@@ -2,56 +2,57 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngAdd = void 0;
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const schematics_2 = require("@o3r/schematics");
|
|
6
5
|
const path = require("node:path");
|
|
6
|
+
const reportMissingSchematicsDep = (logger) => (reason) => {
|
|
7
|
+
logger.error(`[ERROR]: Adding @o3r/apis-manager has failed.
|
|
8
|
+
You need to install '@o3r/schematics' to be able to use the o3r apis-manager package. Please run 'ng add @o3r/schematics'.`);
|
|
9
|
+
throw reason;
|
|
10
|
+
};
|
|
7
11
|
/**
|
|
8
12
|
* Add Otter apis manager to an Angular Project
|
|
9
13
|
* @param options
|
|
10
14
|
*/
|
|
11
15
|
function ngAddFn(options) {
|
|
12
|
-
return async (tree
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
25
|
-
acc[dep] = {
|
|
26
|
-
inManifest: [{
|
|
27
|
-
range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
|
|
28
|
-
types: getProjectNewDependenciesTypes(workspaceProject)
|
|
29
|
-
}],
|
|
30
|
-
ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
|
|
31
|
-
};
|
|
32
|
-
return acc;
|
|
33
|
-
}, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
34
|
-
return () => (0, schematics_1.chain)([
|
|
35
|
-
...rulesToExecute,
|
|
36
|
-
options.skipLinter ? schematics_1.noop : applyEsLintFix(),
|
|
37
|
-
setupDependencies({
|
|
38
|
-
projectName: options.projectName,
|
|
39
|
-
dependencies,
|
|
40
|
-
ngAddToRun: depsInfo.o3rPeerDeps
|
|
41
|
-
})
|
|
42
|
-
])(tree, context);
|
|
43
|
-
}
|
|
44
|
-
catch (e) {
|
|
45
|
-
// o3r apis-manager needs o3r/schematics as peer dep.
|
|
46
|
-
context.logger.error(`[ERROR]: Adding @o3r/apis-manager has failed.
|
|
47
|
-
You need to install '@o3r/schematics' to be able to use the o3r apis-manager package. Please run 'ng add @o3r/schematics' .`);
|
|
48
|
-
throw (e);
|
|
16
|
+
return async (tree) => {
|
|
17
|
+
const { getPackageInstallConfig } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
18
|
+
const { setupDependencies, getO3rPeerDeps, applyEsLintFix, getWorkspaceConfig, getProjectNewDependenciesTypes } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
19
|
+
const { updateApiDependencies } = await Promise.resolve().then(() => require('../helpers/update-api-deps'));
|
|
20
|
+
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
21
|
+
const depsInfo = getO3rPeerDeps(packageJsonPath);
|
|
22
|
+
const rulesToExecute = [];
|
|
23
|
+
const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
|
|
24
|
+
const projectType = workspaceProject?.projectType || 'application';
|
|
25
|
+
if (projectType === 'application') {
|
|
26
|
+
rulesToExecute.push(updateApiDependencies(options));
|
|
49
27
|
}
|
|
28
|
+
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
29
|
+
acc[dep] = {
|
|
30
|
+
inManifest: [{
|
|
31
|
+
range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
|
|
32
|
+
types: getProjectNewDependenciesTypes(workspaceProject)
|
|
33
|
+
}],
|
|
34
|
+
ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
|
|
35
|
+
};
|
|
36
|
+
return acc;
|
|
37
|
+
}, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
38
|
+
return () => (0, schematics_1.chain)([
|
|
39
|
+
...rulesToExecute,
|
|
40
|
+
options.skipLinter ? schematics_1.noop : applyEsLintFix(),
|
|
41
|
+
setupDependencies({
|
|
42
|
+
projectName: options.projectName,
|
|
43
|
+
dependencies,
|
|
44
|
+
ngAddToRun: depsInfo.o3rPeerDeps
|
|
45
|
+
})
|
|
46
|
+
]);
|
|
50
47
|
};
|
|
51
48
|
}
|
|
52
49
|
/**
|
|
53
50
|
* Add Otter apis manager to an Angular Project
|
|
54
51
|
* @param options
|
|
55
52
|
*/
|
|
56
|
-
|
|
53
|
+
const ngAdd = (options) => async (_, { logger }) => {
|
|
54
|
+
const { createSchematicWithMetricsIfInstalled } = await Promise.resolve().then(() => require('@o3r/schematics')).catch(reportMissingSchematicsDep(logger));
|
|
55
|
+
return createSchematicWithMetricsIfInstalled(ngAddFn)(options);
|
|
56
|
+
};
|
|
57
|
+
exports.ngAdd = ngAdd;
|
|
57
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAAoE;AACpE,kCAAkC;AAGlC,MAAM,0BAA0B,GAAG,CAAC,MAA2C,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE;IAClG,MAAM,CAAC,KAAK,CAAC;2HAC4G,CAAC,CAAC;IAC3H,MAAM,MAAM,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA8B;IAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,EAAE,uBAAuB,EAAE,GAAG,2CAAa,iBAAiB,EAAC,CAAC;QACpE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,GAAG,2CAAa,iBAAiB,EAAC,CAAC;QAClJ,MAAM,EAAE,qBAAqB,EAAE,GAAG,2CAAa,4BAA4B,EAAC,CAAC;QAC7E,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QAC5E,MAAM,QAAQ,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;QACjD,MAAM,cAAc,GAAW,EAAE,CAAC;QAClC,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,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