@o3r/apis-manager 13.4.0-prerelease.8 → 13.5.0-prerelease.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"o3r-apis-manager.mjs","sources":["../../src/apis-manager/api-manager.token.ts","../../src/apis-manager/api-factory.service.ts","../../src/apis-manager/api-manager.ts","../../src/apis-manager/api-manager.helpers.ts","../../src/apis-manager/api-manager.module.ts","../../src/o3r-apis-manager.ts"],"sourcesContent":["import {\n InjectionToken,\n} from '@angular/core';\nimport type {\n ApiManager,\n} from './api-manager';\n\n/**\n * Token used by the core library to provide an Api manager to services. It can be provided in the app.\n */\nexport const API_TOKEN = new InjectionToken<ApiManager>('Custom API manager token');\n","import type {\n Api,\n ApiClient,\n ApiName,\n} from '@ama-sdk/core';\nimport {\n inject,\n Injectable,\n InjectionToken,\n} from '@angular/core';\nimport {\n ApiManager,\n} from './api-manager';\nimport {\n API_TOKEN,\n} from './api-manager.token';\n\n/** Type of the Class of an SDK Api */\nexport type ApiClassType<T extends Api = Api> = (new (client: ApiClient) => T) & ApiName;\n\n/**\n * Initial APIs instantiations\n */\nexport const INITIAL_APIS_TOKEN = new InjectionToken<(Api | ApiClassType)[]>('Initial APIs token');\n\n@Injectable()\nexport class ApiFactoryService {\n private readonly apiManager = inject<ApiManager>(API_TOKEN);\n\n /** Map of loaded APIs */\n private loadedApis: Record<string, Api> = {};\n\n constructor() {\n const apis = inject(INITIAL_APIS_TOKEN, { optional: true });\n\n if (apis) {\n this.updateApiMapping(apis);\n }\n }\n\n /**\n * Determine if the given parameter is a API class\n * @param apiClass object to check\n */\n private isApiClass<T extends Api = Api>(apiClass: any): apiClass is ApiClassType<T> {\n return !!apiClass.apiName && typeof apiClass === 'function';\n }\n\n /**\n * Retrieve a specific API with loaded configuration\n * @param apiClass class of the API to retrieve\n * @param refreshCache Ignore cached API instance and refresh it\n * @param customApiName override the `apiName` set in the `apiClass`\n * @note When passing `customApiName` the configuration is expecting to exist else an error is thrown\n * @note When passing an Api instance that does not match a registered configuration without `customApiName`, the default one will be returned\n */\n public getApi<T extends Api>(apiClass: (new (client: ApiClient) => T) & ApiName, refreshCache = false, customApiName?: string): T {\n const apiName = customApiName ?? apiClass.apiName;\n const cache = this.loadedApis[apiName];\n if (!refreshCache && cache) {\n return cache as T;\n }\n\n const instance = new apiClass(this.getConfigFor(customApiName ?? apiClass));\n this.loadedApis[apiName] = instance;\n return instance;\n }\n\n /**\n * Update the Map of loaded APIs.\n * Note: Can be used to override the a specific API\n * @param map Map of loaded APIs to update\n */\n public updateApiMapping(map: (Api | ApiClassType)[] | Record<string, (Api | ApiClassType)>) {\n const newItems: Record<string, (Api | ApiClassType)> = Array.isArray(map)\n ? map\n .reduce<Record<string, Api | ApiClassType<Api>>>((acc, curr) => {\n acc[curr.apiName] = curr;\n return acc;\n }, {})\n : map;\n\n this.loadedApis = {\n ...this.loadedApis,\n ...Object.entries(newItems)\n .reduce<Record<string, Api>>((acc, [apiName, api]) => {\n acc[apiName] = this.isApiClass(api) ? new api(this.getConfigFor(api)) : api;\n return acc;\n }, {})\n };\n }\n\n /**\n * Clear the cache of loaded APIs\n * @param apis Whitelist of APIs to clear from the cache, if specified only these apis will be removed from the cache\n */\n public clearCache(apis?: (ApiName | string)[]) {\n if (apis) {\n apis.forEach((api) => delete this.loadedApis[typeof api === 'string' ? api : api.apiName]);\n } else {\n this.loadedApis = {};\n }\n }\n\n /**\n * Retrieve the configuration for a specific API\n * @param api API for which retrieving the configuration\n */\n public getConfigFor(api: string | ApiName): ApiClient {\n return this.apiManager.getConfiguration(api);\n }\n}\n","import type {\n ApiClient,\n ApiName,\n} from '@ama-sdk/core';\n\n/**\n * Api manager is responsible to provide an api configuration to a service factory, so that it could instantiate an API\n * with the right parameters. It contains a default configuration and a map of specific configurations for API / set of\n * API. Configurations are only exposed through the method getConfiguration, which will merge the default configuration\n * and the requested one.\n */\nexport class ApiManager {\n private defaultConfiguration: ApiClient;\n private apiConfigurations: { [key: string]: ApiClient };\n\n /**\n * Map of registered Api Client associated to specific API\n * Warning: This should not be used to get the ApiClient for an API, the function getConfiguration() should be used instead\n */\n public get registeredApiConfigurations() {\n return { ...this.apiConfigurations } as const;\n }\n\n /**\n * Create an API manager using a custom ApiClient\n * @param defaultConfiguration\n */\n constructor(defaultConfiguration: ApiClient, apiConfigurations: { [key: string]: ApiClient } = {}) {\n this.defaultConfiguration = defaultConfiguration;\n this.apiConfigurations = apiConfigurations;\n }\n\n /**\n * Retrieve a configuration for a specific API\n * @param api API to get the configuration for\n * @note When passing a string the configuration is expecting to exist else an error is thrown\n * @note when passing an Api instance that does not match a registered configuration, the default one will be returned\n */\n public getConfiguration(api?: string | ApiName): ApiClient {\n if (typeof api === 'string') {\n if (this.apiConfigurations[api]) {\n return this.apiConfigurations[api];\n } else {\n throw new Error(`Unknown API configuration: ${api}\\nKnown API configurations: ${Object.keys(this.apiConfigurations).join(', ')}`);\n }\n }\n return (api && this.apiConfigurations[api.apiName]) || this.defaultConfiguration;\n }\n\n /**\n * Set or override API configuration\n * @param apiClient API configuration to override to the given api\n * @param api API name to override, the default configuration will be used if not specified\n */\n public setConfiguration(apiClient: ApiClient, api?: string | ApiName): void {\n if (api) {\n this.apiConfigurations[typeof api === 'string' ? api : api.apiName] = apiClient;\n } else {\n this.defaultConfiguration = apiClient;\n }\n }\n}\n","/**\n * Add a preconnect `<link>` element to the DOM\n * @param baseUrl the origin href\n * @param supportCrossOrigin add crossorigin attribute to the link element\n */\nexport function appendPreconnect(baseUrl: string, supportCrossOrigin = true): void {\n const preConnectLink = document.createElement('link');\n preConnectLink.setAttribute('rel', 'preconnect');\n preConnectLink.setAttribute('href', baseUrl);\n if (supportCrossOrigin) {\n preConnectLink.setAttribute('crossorigin', '');\n }\n document.head.append(preConnectLink);\n}\n","import {\n makeEnvironmentProviders,\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport {\n ApiFactoryService,\n} from './api-factory.service';\nimport {\n ApiManager,\n} from './api-manager';\nimport {\n API_TOKEN,\n} from './api-manager.token';\n\n/**\n * Module that needs to be imported by the application to instantiate an SDK configuration.\n */\n@NgModule({\n providers: [\n ApiFactoryService\n ]\n})\nexport class ApiManagerModule {\n /**\n * Provide a custom {@link ApiManager}\n * A factory can be provided via injection to the token {@link API_TOKEN}\n * @param apiManager\n * @deprecated Please use {@link provideApiManager} instead, will be removed in v14.\n */\n public static forRoot(apiManager: ApiManager): ModuleWithProviders<ApiManagerModule> {\n return {\n ngModule: ApiManagerModule,\n providers: [\n { provide: API_TOKEN, useValue: apiManager }\n ]\n };\n }\n}\n\n/**\n * Provide a custom {@link ApiManager}\n * A factory can be provided via injection to the token {@link API_TOKEN}\n * @param apiManager\n */\nexport function provideApiManager(apiManager: ApiManager) {\n return makeEnvironmentProviders([\n ApiFactoryService,\n { provide: API_TOKEN, useValue: apiManager }\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;AAOA;;AAEG;MACU,SAAS,GAAG,IAAI,cAAc,CAAa,0BAA0B;;ACUlF;;AAEG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAAyB,oBAAoB;MAGpF,iBAAiB,CAAA;AAM5B,IAAA,WAAA,GAAA;AALiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAa,SAAS,CAAC;;QAGnD,IAAA,CAAA,UAAU,GAAwB,EAAE;AAG1C,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAE3D,IAAI,IAAI,EAAE;AACR,YAAA,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;QAC7B;IACF;AAEA;;;AAGG;AACK,IAAA,UAAU,CAAsB,QAAa,EAAA;QACnD,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,OAAO,QAAQ,KAAK,UAAU;IAC7D;AAEA;;;;;;;AA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,gBAAgB,EAAA,CAAA,CAAA;AAAhB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAAA,SAAA,EAJhB;YACT;AACD,SAAA,EAAA,CAAA,CAAA;;2FAEU,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;wBACT;AACD;AACF,iBAAA;;AAkBD;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,UAAsB,EAAA;AACtD,IAAA,OAAO,wBAAwB,CAAC;QAC9B,iBAAiB;AACjB,QAAA,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU;AAC3C,KAAA,CAAC;AACJ;;AClDA;;AAEG;;;;"}
1
+ {"version":3,"file":"o3r-apis-manager.mjs","sources":["../../src/apis-manager/api-manager-token.ts","../../src/apis-manager/api-factory-service.ts","../../src/apis-manager/api-manager.ts","../../src/apis-manager/api-manager-helpers.ts","../../src/apis-manager/api-manager-module.ts","../../src/o3r-apis-manager.ts"],"sourcesContent":["import {\n InjectionToken,\n} from '@angular/core';\nimport type {\n ApiManager,\n} from './api-manager';\n\n/**\n * Token used by the core library to provide an Api manager to services. It can be provided in the app.\n */\nexport const API_TOKEN = new InjectionToken<ApiManager>('Custom API manager token');\n","import type {\n Api,\n ApiClient,\n ApiName,\n} from '@ama-sdk/core';\nimport {\n inject,\n Injectable,\n InjectionToken,\n} from '@angular/core';\nimport {\n ApiManager,\n} from './api-manager';\nimport {\n API_TOKEN,\n} from './api-manager-token';\n\n/** Type of the Class of an SDK Api */\nexport type ApiClassType<T extends Api = Api> = (new (client: ApiClient) => T) & ApiName;\n\n/**\n * Initial APIs instantiations\n */\nexport const INITIAL_APIS_TOKEN = new InjectionToken<(Api | ApiClassType)[]>('Initial APIs token');\n\n@Injectable()\nexport class ApiFactoryService {\n private readonly apiManager = inject<ApiManager>(API_TOKEN);\n\n /** Map of loaded APIs */\n private loadedApis: Record<string, Api> = {};\n\n constructor() {\n const apis = inject(INITIAL_APIS_TOKEN, { optional: true });\n\n if (apis) {\n this.updateApiMapping(apis);\n }\n }\n\n /**\n * Determine if the given parameter is a API class\n * @param apiClass object to check\n */\n private isApiClass<T extends Api = Api>(apiClass: any): apiClass is ApiClassType<T> {\n return !!apiClass.apiName && typeof apiClass === 'function';\n }\n\n /**\n * Retrieve a specific API with loaded configuration\n * @param apiClass class of the API to retrieve\n * @param refreshCache Ignore cached API instance and refresh it\n * @param customApiName override the `apiName` set in the `apiClass`\n * @note When passing `customApiName` the configuration is expecting to exist else an error is thrown\n * @note When passing an Api instance that does not match a registered configuration without `customApiName`, the default one will be returned\n */\n public getApi<T extends Api>(apiClass: (new (client: ApiClient) => T) & ApiName, refreshCache = false, customApiName?: string): T {\n const apiName = customApiName ?? apiClass.apiName;\n const cache = this.loadedApis[apiName];\n if (!refreshCache && cache) {\n return cache as T;\n }\n\n const instance = new apiClass(this.getConfigFor(customApiName ?? apiClass));\n this.loadedApis[apiName] = instance;\n return instance;\n }\n\n /**\n * Update the Map of loaded APIs.\n * Note: Can be used to override the a specific API\n * @param map Map of loaded APIs to update\n */\n public updateApiMapping(map: (Api | ApiClassType)[] | Record<string, (Api | ApiClassType)>) {\n const newItems: Record<string, (Api | ApiClassType)> = Array.isArray(map)\n ? map\n .reduce<Record<string, Api | ApiClassType<Api>>>((acc, curr) => {\n acc[curr.apiName] = curr;\n return acc;\n }, {})\n : map;\n\n this.loadedApis = {\n ...this.loadedApis,\n ...Object.entries(newItems)\n .reduce<Record<string, Api>>((acc, [apiName, api]) => {\n acc[apiName] = this.isApiClass(api) ? new api(this.getConfigFor(api)) : api;\n return acc;\n }, {})\n };\n }\n\n /**\n * Clear the cache of loaded APIs\n * @param apis Whitelist of APIs to clear from the cache, if specified only these apis will be removed from the cache\n */\n public clearCache(apis?: (ApiName | string)[]) {\n if (apis) {\n apis.forEach((api) => delete this.loadedApis[typeof api === 'string' ? api : api.apiName]);\n } else {\n this.loadedApis = {};\n }\n }\n\n /**\n * Retrieve the configuration for a specific API\n * @param api API for which retrieving the configuration\n */\n public getConfigFor(api: string | ApiName): ApiClient {\n return this.apiManager.getConfiguration(api);\n }\n}\n","import type {\n ApiClient,\n ApiName,\n} from '@ama-sdk/core';\n\n/**\n * Api manager is responsible to provide an api configuration to a service factory, so that it could instantiate an API\n * with the right parameters. It contains a default configuration and a map of specific configurations for API / set of\n * API. Configurations are only exposed through the method getConfiguration, which will merge the default configuration\n * and the requested one.\n */\nexport class ApiManager {\n private defaultConfiguration: ApiClient;\n private apiConfigurations: { [key: string]: ApiClient };\n\n /**\n * Map of registered Api Client associated to specific API\n * Warning: This should not be used to get the ApiClient for an API, the function getConfiguration() should be used instead\n */\n public get registeredApiConfigurations() {\n return { ...this.apiConfigurations } as const;\n }\n\n /**\n * Create an API manager using a custom ApiClient\n * @param defaultConfiguration\n */\n constructor(defaultConfiguration: ApiClient, apiConfigurations: { [key: string]: ApiClient } = {}) {\n this.defaultConfiguration = defaultConfiguration;\n this.apiConfigurations = apiConfigurations;\n }\n\n /**\n * Retrieve a configuration for a specific API\n * @param api API to get the configuration for\n * @note When passing a string the configuration is expecting to exist else an error is thrown\n * @note when passing an Api instance that does not match a registered configuration, the default one will be returned\n */\n public getConfiguration(api?: string | ApiName): ApiClient {\n if (typeof api === 'string') {\n if (this.apiConfigurations[api]) {\n return this.apiConfigurations[api];\n } else {\n throw new Error(`Unknown API configuration: ${api}\\nKnown API configurations: ${Object.keys(this.apiConfigurations).join(', ')}`);\n }\n }\n return (api && this.apiConfigurations[api.apiName]) || this.defaultConfiguration;\n }\n\n /**\n * Set or override API configuration\n * @param apiClient API configuration to override to the given api\n * @param api API name to override, the default configuration will be used if not specified\n */\n public setConfiguration(apiClient: ApiClient, api?: string | ApiName): void {\n if (api) {\n this.apiConfigurations[typeof api === 'string' ? api : api.apiName] = apiClient;\n } else {\n this.defaultConfiguration = apiClient;\n }\n }\n}\n","/**\n * Add a preconnect `<link>` element to the DOM\n * @param baseUrl the origin href\n * @param supportCrossOrigin add crossorigin attribute to the link element\n */\nexport function appendPreconnect(baseUrl: string, supportCrossOrigin = true): void {\n const preConnectLink = document.createElement('link');\n preConnectLink.setAttribute('rel', 'preconnect');\n preConnectLink.setAttribute('href', baseUrl);\n if (supportCrossOrigin) {\n preConnectLink.setAttribute('crossorigin', '');\n }\n document.head.append(preConnectLink);\n}\n","import {\n makeEnvironmentProviders,\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport {\n ApiFactoryService,\n} from './api-factory-service';\nimport {\n ApiManager,\n} from './api-manager';\nimport {\n API_TOKEN,\n} from './api-manager-token';\n\n/**\n * Module that needs to be imported by the application to instantiate an SDK configuration.\n */\n@NgModule({\n providers: [\n ApiFactoryService\n ]\n})\nexport class ApiManagerModule {\n /**\n * Provide a custom {@link ApiManager}\n * A factory can be provided via injection to the token {@link API_TOKEN}\n * @param apiManager\n * @deprecated Please use {@link provideApiManager} instead, will be removed in v14.\n */\n public static forRoot(apiManager: ApiManager): ModuleWithProviders<ApiManagerModule> {\n return {\n ngModule: ApiManagerModule,\n providers: [\n { provide: API_TOKEN, useValue: apiManager }\n ]\n };\n }\n}\n\n/**\n * Provide a custom {@link ApiManager}\n * A factory can be provided via injection to the token {@link API_TOKEN}\n * @param apiManager\n */\nexport function provideApiManager(apiManager: ApiManager) {\n return makeEnvironmentProviders([\n ApiFactoryService,\n { provide: API_TOKEN, useValue: apiManager }\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;AAOA;;AAEG;MACU,SAAS,GAAG,IAAI,cAAc,CAAa,0BAA0B;;ACUlF;;AAEG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAAyB,oBAAoB;MAGpF,iBAAiB,CAAA;AA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AAC,aAAa,EAAE,EAAE,CAAC;IAChD;AACA,IAAA,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;AACtC;;ACEA;;AAEG;MAMU,gBAAgB,CAAA;AAC3B;;;;;AAKG;IACI,OAAO,OAAO,CAAC,UAAsB,EAAA;QAC1C,OAAO;AACL,YAAA,QAAQ,EAAE,gBAAgB;AAC1B,YAAA,SAAS,EAAE;AACT,gBAAA,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU;AAC3C;SACF;IACH;iIAdW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kIAAhB,gBAAgB,EAAA,CAAA,CAAA;AAAhB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAAA,SAAA,EAJhB;YACT;AACD,SAAA,EAAA,CAAA,CAAA;;2FAEU,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;wBACT;AACD;AACF,iBAAA;;AAkBD;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,UAAsB,EAAA;AACtD,IAAA,OAAO,wBAAwB,CAAC;QAC9B,iBAAiB;AACjB,QAAA,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU;AAC3C,KAAA,CAAC;AACJ;;AClDA;;AAEG;;;;"}
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sources":["../src/apis-manager/api-factory.service.ts","../src/apis-manager/api-manager.ts","../src/apis-manager/api-manager.helpers.ts","../src/apis-manager/api-manager.module.ts","../src/apis-manager/api-manager.token.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":";;;;AAiBA;;AAGA;;AAEG;AACH;AAEA;AAEE;;;;AAaA;;;AAGG;AACH;AAIA;;;;;;;AAOG;;AAaH;;;;AAIG;AACI;AAmBP;;;AAGG;;AASH;;;AAGG;AACI;;;AAGR;;AC1GD;;;;;AAKG;AACH;;;AAIE;;;AAGG;AACH;;AAEC;AAED;;;AAGG;AACS;AAAsD;AAA+B;AAKjG;;;;;AAKG;;AAYH;;;;AAIG;AACI;AAOR;;AC7DD;;;;AAIG;AACH;;ACUA;;AAEG;AACH;AAME;;;;;AAKG;;;;;AASJ;AAED;;;;AAIG;AACH;;ACtCA;;AAEG;AACH;;;"}
1
+ {"version":3,"file":"index.d.ts","sources":["../src/apis-manager/api-factory-service.ts","../src/apis-manager/api-manager.ts","../src/apis-manager/api-manager-helpers.ts","../src/apis-manager/api-manager-module.ts","../src/apis-manager/api-manager-token.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":";;;;AAiBA;;AAGA;;AAEG;AACH;AAEA;AAEE;;;;AAaA;;;AAGG;AACH;AAIA;;;;;;;AAOG;;AAaH;;;;AAIG;AACI;AAmBP;;;AAGG;;AASH;;;AAGG;AACI;;;AAGR;;AC1GD;;;;;AAKG;AACH;;;AAIE;;;AAGG;AACH;;AAEC;AAED;;;AAGG;AACS;AAAsD;AAA+B;AAKjG;;;;;AAKG;;AAYH;;;;AAIG;AACI;AAOR;;AC7DD;;;;AAIG;AACH;;ACUA;;AAEG;AACH;AAME;;;;;AAKG;;;;;AASJ;AAED;;;;AAIG;AACH;;ACtCA;;AAEG;AACH;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/apis-manager",
3
- "version": "13.4.0-prerelease.8",
3
+ "version": "13.5.0-prerelease.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,12 +11,12 @@
11
11
  "otter-module"
12
12
  ],
13
13
  "peerDependencies": {
14
- "@ama-sdk/client-fetch": "13.4.0-prerelease.8",
15
- "@ama-sdk/core": "13.4.0-prerelease.8",
14
+ "@ama-sdk/client-fetch": "~13.5.0-prerelease.0",
15
+ "@ama-sdk/core": "~13.5.0-prerelease.0",
16
16
  "@angular-devkit/schematics": "^20.0.0",
17
17
  "@angular/common": "^20.0.0",
18
18
  "@angular/core": "^20.0.0",
19
- "@o3r/schematics": "13.4.0-prerelease.8",
19
+ "@o3r/schematics": "~13.5.0-prerelease.0",
20
20
  "@schematics/angular": "^20.0.0",
21
21
  "rxjs": "^7.8.1",
22
22
  "ts-node": "~10.9.2",
@@ -41,7 +41,7 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@o3r/schematics": "13.4.0-prerelease.8",
44
+ "@o3r/schematics": "~13.5.0-prerelease.0",
45
45
  "tslib": "^2.6.2"
46
46
  },
47
47
  "schematics": "./collection.json",