@ama-sdk/client-fetch 12.2.5 → 12.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ama-sdk/client-fetch",
3
- "version": "12.2.5",
3
+ "version": "12.2.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -44,13 +44,14 @@
44
44
  "uuid": "^11.0.5"
45
45
  },
46
46
  "peerDependencies": {
47
- "@ama-sdk/core": "^12.2.5",
47
+ "@ama-sdk/core": "^12.2.7",
48
48
  "@angular-devkit/schematics": "^19.0.0",
49
49
  "@angular/cli": "^19.0.0",
50
50
  "@angular/common": "^19.0.0",
51
- "@o3r/schematics": "^12.2.5",
51
+ "@o3r/schematics": "^12.2.7",
52
52
  "@schematics/angular": "^19.0.0",
53
53
  "isomorphic-fetch": "^3.0.0",
54
+ "type-fest": "^4.30.1",
54
55
  "typescript": "^5.5.4"
55
56
  },
56
57
  "peerDependenciesMeta": {
@@ -72,12 +73,15 @@
72
73
  "isomorphic-fetch": {
73
74
  "optional": true
74
75
  },
76
+ "type-fest": {
77
+ "optional": true
78
+ },
75
79
  "typescript": {
76
80
  "optional": true
77
81
  }
78
82
  },
79
83
  "devDependencies": {
80
- "@ama-sdk/core": "^12.2.5",
84
+ "@ama-sdk/core": "^12.2.7",
81
85
  "@angular-devkit/core": "~19.2.0",
82
86
  "@angular-devkit/schematics": "~19.2.0",
83
87
  "@angular/common": "~19.2.0",
@@ -85,10 +89,10 @@
85
89
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
86
90
  "@nx/eslint-plugin": "~20.6.0",
87
91
  "@nx/jest": "~20.6.0",
88
- "@o3r/build-helpers": "^12.2.5",
89
- "@o3r/eslint-plugin": "^12.2.5",
90
- "@o3r/schematics": "^12.2.5",
91
- "@o3r/test-helpers": "^12.2.5",
92
+ "@o3r/build-helpers": "^12.2.7",
93
+ "@o3r/eslint-plugin": "^12.2.7",
94
+ "@o3r/schematics": "^12.2.7",
95
+ "@o3r/test-helpers": "^12.2.7",
92
96
  "@schematics/angular": "~19.2.0",
93
97
  "@stylistic/eslint-plugin": "~3.1.0",
94
98
  "@stylistic/eslint-plugin-ts": "~3.1.0",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAOpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAsElB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,KAAG,IAKtD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAOpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AA8ElB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,KAAG,IAKtD,CAAC"}
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngAdd = void 0;
4
4
  const path = require("node:path");
5
5
  const schematics_1 = require("@angular-devkit/schematics");
6
- const dependencies_1 = require("@schematics/angular/utility/dependencies");
7
6
  const import_map_1 = require("./migration/import-map");
8
7
  const devDependenciesToInstall = [];
8
+ const dependenciesToInstall = [];
9
9
  const reportMissingSchematicsDep = (logger) => (reason) => {
10
10
  logger.error(`[ERROR]: Adding @ama-sdk/client-fetch has failed.
11
11
  If the error is related to missing @o3r dependencies you need to install '@o3r/schematics' as devDependency to be able to use this schematics. Please run 'ng add @o3r/schematics'.
@@ -19,10 +19,11 @@ Otherwise, use the error message as guidance.`);
19
19
  function ngAddFn(options) {
20
20
  return async (tree, context) => {
21
21
  // use dynamic import to properly raise an exception if it is not an Otter project.
22
- const { getPackageInstallConfig, applyEsLintFix, setupDependencies, getO3rPeerDeps, getProjectNewDependenciesTypes, getWorkspaceConfig, getExternalDependenciesVersionRange, updateImports } = await Promise.resolve().then(() => require('@o3r/schematics'));
22
+ const { getPackageInstallConfig, applyEsLintFix, setupDependencies, getO3rPeerDeps, getProjectNewDependenciesTypes, getWorkspaceConfig, getExternalDependenciesInfo, updateImports } = await Promise.resolve().then(() => require('@o3r/schematics'));
23
23
  const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
24
24
  const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
25
25
  const depsInfo = getO3rPeerDeps(packageJsonPath);
26
+ const projectPackageJson = tree.readJson(path.posix.join(workspaceProject?.root || '.', 'package.json'));
26
27
  const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
27
28
  acc[dep] = {
28
29
  inManifest: [{
@@ -33,22 +34,23 @@ function ngAddFn(options) {
33
34
  };
34
35
  return acc;
35
36
  }, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
36
- Object.entries(getExternalDependenciesVersionRange(devDependenciesToInstall, packageJsonPath, context.logger))
37
- .forEach(([dep, range]) => {
38
- dependencies[dep] = {
39
- inManifest: [{
40
- range,
41
- types: [dependencies_1.NodeDependencyType.Dev]
42
- }]
43
- };
44
- });
37
+ const externalDependenciesInfo = getExternalDependenciesInfo({
38
+ devDependenciesToInstall,
39
+ dependenciesToInstall,
40
+ o3rPackageJsonPath: packageJsonPath,
41
+ projectPackageJson,
42
+ projectType: workspaceProject?.projectType
43
+ }, context.logger);
45
44
  return (0, schematics_1.chain)([
46
45
  // optional custom action dedicated to this module
47
46
  options.skipLinter ? (0, schematics_1.noop)() : applyEsLintFix(),
48
47
  // add the missing Otter modules in the current project
49
48
  setupDependencies({
50
49
  projectName: options.projectName,
51
- dependencies,
50
+ dependencies: {
51
+ ...dependencies,
52
+ ...externalDependenciesInfo
53
+ },
52
54
  ngAddToRun: depsInfo.o3rPeerDeps
53
55
  }),
54
56
  updateImports(import_map_1.mapMigrationFromCoreImports)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC,2DAIoC;AACpC,2EAEkD;AAClD,uDAEgC;AAKhC,MAAM,wBAAwB,GAAa,EAE1C,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,MAA2C,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE;IAClG,MAAM,CAAC,KAAK,CAAC;;8CAE+B,CAAC,CAAC;IAC9C,MAAM,MAAM,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA8B;IAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QAC7B,mFAAmF;QACnF,MAAM,EACJ,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,8BAA8B,EAC9B,kBAAkB,EAClB,mCAAmC,EACnC,aAAa,EACd,GAAG,2CAAa,iBAAiB,EAAC,CAAC;QAEpC,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACnH,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;QAEjD,MAAM,YAAY,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC5D,GAAG,CAAC,GAAG,CAAC,GAAG;gBACT,UAAU,EAAE,CAAC;wBACX,KAAK,EAAE,GAAG,OAA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