@o3r/apis-manager 14.1.0-prerelease.4 → 14.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.
- package/fesm2022/o3r-apis-manager.mjs +3 -3
- package/package.json +6 -6
- package/index.d.ts +0 -124
- package/index.d.ts.map +0 -1
|
@@ -86,10 +86,10 @@ class ApiFactoryService {
|
|
|
86
86
|
getConfigFor(api) {
|
|
87
87
|
return this.apiManager.getConfiguration(api);
|
|
88
88
|
}
|
|
89
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
90
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
89
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ApiFactoryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
90
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ApiFactoryService }); }
|
|
91
91
|
}
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ApiFactoryService, decorators: [{
|
|
93
93
|
type: Injectable
|
|
94
94
|
}], ctorParameters: () => [] });
|
|
95
95
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/apis-manager",
|
|
3
|
-
"version": "14.1.0-prerelease.
|
|
3
|
+
"version": "14.1.0-prerelease.41",
|
|
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": "~14.1.0-prerelease.
|
|
15
|
-
"@ama-sdk/core": "~14.1.0-prerelease.
|
|
14
|
+
"@ama-sdk/client-fetch": "~14.1.0-prerelease.41",
|
|
15
|
+
"@ama-sdk/core": "~14.1.0-prerelease.41",
|
|
16
16
|
"@angular-devkit/schematics": "^21.0.0",
|
|
17
17
|
"@angular/common": "^21.0.0",
|
|
18
18
|
"@angular/core": "^21.0.0",
|
|
19
|
-
"@o3r/schematics": "~14.1.0-prerelease.
|
|
19
|
+
"@o3r/schematics": "~14.1.0-prerelease.41",
|
|
20
20
|
"@schematics/angular": "^21.0.0",
|
|
21
21
|
"rxjs": "^7.8.1",
|
|
22
22
|
"type-fest": "^5.3.1",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@o3r/schematics": "~14.1.0-prerelease.
|
|
43
|
+
"@o3r/schematics": "~14.1.0-prerelease.41",
|
|
44
44
|
"tslib": "^2.6.2"
|
|
45
45
|
},
|
|
46
46
|
"schematics": "./collection.json",
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": "^
|
|
48
|
+
"node": "^22.17.0 || ^24.0.0"
|
|
49
49
|
},
|
|
50
50
|
"module": "fesm2022/o3r-apis-manager.mjs",
|
|
51
51
|
"typings": "types/o3r-apis-manager.d.ts",
|
package/index.d.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Api, ApiClient, ApiName } from '@ama-sdk/core';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, ModuleWithProviders } from '@angular/core';
|
|
4
|
-
|
|
5
|
-
/** Type of the Class of an SDK Api */
|
|
6
|
-
type ApiClassType<T extends Api = Api> = (new (client: ApiClient) => T) & ApiName;
|
|
7
|
-
/**
|
|
8
|
-
* Initial APIs instantiations
|
|
9
|
-
*/
|
|
10
|
-
declare const INITIAL_APIS_TOKEN: InjectionToken<(Api | ApiClassType<Api>)[]>;
|
|
11
|
-
declare class ApiFactoryService {
|
|
12
|
-
private readonly apiManager;
|
|
13
|
-
/** Map of loaded APIs */
|
|
14
|
-
private loadedApis;
|
|
15
|
-
constructor();
|
|
16
|
-
/**
|
|
17
|
-
* Determine if the given parameter is a API class
|
|
18
|
-
* @param apiClass object to check
|
|
19
|
-
*/
|
|
20
|
-
private isApiClass;
|
|
21
|
-
/**
|
|
22
|
-
* Retrieve a specific API with loaded configuration
|
|
23
|
-
* @param apiClass class of the API to retrieve
|
|
24
|
-
* @param refreshCache Ignore cached API instance and refresh it
|
|
25
|
-
* @param customApiName override the `apiName` set in the `apiClass`
|
|
26
|
-
* @note When passing `customApiName` the configuration is expecting to exist else an error is thrown
|
|
27
|
-
* @note When passing an Api instance that does not match a registered configuration without `customApiName`, the default one will be returned
|
|
28
|
-
*/
|
|
29
|
-
getApi<T extends Api>(apiClass: (new (client: ApiClient) => T) & ApiName, refreshCache?: boolean, customApiName?: string): T;
|
|
30
|
-
/**
|
|
31
|
-
* Update the Map of loaded APIs.
|
|
32
|
-
* Note: Can be used to override the a specific API
|
|
33
|
-
* @param map Map of loaded APIs to update
|
|
34
|
-
*/
|
|
35
|
-
updateApiMapping(map: (Api | ApiClassType)[] | Record<string, (Api | ApiClassType)>): void;
|
|
36
|
-
/**
|
|
37
|
-
* Clear the cache of loaded APIs
|
|
38
|
-
* @param apis Whitelist of APIs to clear from the cache, if specified only these apis will be removed from the cache
|
|
39
|
-
*/
|
|
40
|
-
clearCache(apis?: (ApiName | string)[]): void;
|
|
41
|
-
/**
|
|
42
|
-
* Retrieve the configuration for a specific API
|
|
43
|
-
* @param api API for which retrieving the configuration
|
|
44
|
-
*/
|
|
45
|
-
getConfigFor(api: string | ApiName): ApiClient;
|
|
46
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ApiFactoryService, never>;
|
|
47
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ApiFactoryService>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Api manager is responsible to provide an api configuration to a service factory, so that it could instantiate an API
|
|
52
|
-
* with the right parameters. It contains a default configuration and a map of specific configurations for API / set of
|
|
53
|
-
* API. Configurations are only exposed through the method getConfiguration, which will merge the default configuration
|
|
54
|
-
* and the requested one.
|
|
55
|
-
*/
|
|
56
|
-
declare class ApiManager {
|
|
57
|
-
private defaultConfiguration;
|
|
58
|
-
private apiConfigurations;
|
|
59
|
-
/**
|
|
60
|
-
* Map of registered Api Client associated to specific API
|
|
61
|
-
* Warning: This should not be used to get the ApiClient for an API, the function getConfiguration() should be used instead
|
|
62
|
-
*/
|
|
63
|
-
get registeredApiConfigurations(): {
|
|
64
|
-
readonly [key: string]: ApiClient;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Create an API manager using a custom ApiClient
|
|
68
|
-
* @param defaultConfiguration
|
|
69
|
-
*/
|
|
70
|
-
constructor(defaultConfiguration: ApiClient, apiConfigurations?: {
|
|
71
|
-
[key: string]: ApiClient;
|
|
72
|
-
});
|
|
73
|
-
/**
|
|
74
|
-
* Retrieve a configuration for a specific API
|
|
75
|
-
* @param api API to get the configuration for
|
|
76
|
-
* @note When passing a string the configuration is expecting to exist else an error is thrown
|
|
77
|
-
* @note when passing an Api instance that does not match a registered configuration, the default one will be returned
|
|
78
|
-
*/
|
|
79
|
-
getConfiguration(api?: string | ApiName): ApiClient;
|
|
80
|
-
/**
|
|
81
|
-
* Set or override API configuration
|
|
82
|
-
* @param apiClient API configuration to override to the given api
|
|
83
|
-
* @param api API name to override, the default configuration will be used if not specified
|
|
84
|
-
*/
|
|
85
|
-
setConfiguration(apiClient: ApiClient, api?: string | ApiName): void;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Add a preconnect `<link>` element to the DOM
|
|
90
|
-
* @param baseUrl the origin href
|
|
91
|
-
* @param supportCrossOrigin add crossorigin attribute to the link element
|
|
92
|
-
*/
|
|
93
|
-
declare function appendPreconnect(baseUrl: string, supportCrossOrigin?: boolean): void;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Module that needs to be imported by the application to instantiate an SDK configuration.
|
|
97
|
-
*/
|
|
98
|
-
declare class ApiManagerModule {
|
|
99
|
-
/**
|
|
100
|
-
* Provide a custom {@link ApiManager}
|
|
101
|
-
* A factory can be provided via injection to the token {@link API_TOKEN}
|
|
102
|
-
* @param apiManager
|
|
103
|
-
* @deprecated Please use {@link provideApiManager} instead, will be removed in v14.
|
|
104
|
-
*/
|
|
105
|
-
static forRoot(apiManager: ApiManager): ModuleWithProviders<ApiManagerModule>;
|
|
106
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ApiManagerModule, never>;
|
|
107
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ApiManagerModule, never, never, never>;
|
|
108
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<ApiManagerModule>;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Provide a custom {@link ApiManager}
|
|
112
|
-
* A factory can be provided via injection to the token {@link API_TOKEN}
|
|
113
|
-
* @param apiManager
|
|
114
|
-
*/
|
|
115
|
-
declare function provideApiManager(apiManager: ApiManager): i0.EnvironmentProviders;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Token used by the core library to provide an Api manager to services. It can be provided in the app.
|
|
119
|
-
*/
|
|
120
|
-
declare const API_TOKEN: InjectionToken<ApiManager>;
|
|
121
|
-
|
|
122
|
-
export { API_TOKEN, ApiFactoryService, ApiManager, ApiManagerModule, INITIAL_APIS_TOKEN, appendPreconnect, provideApiManager };
|
|
123
|
-
export type { ApiClassType };
|
|
124
|
-
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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":["_angular_core"],"mappings":";;;;AAiBA;;AAGA;;AAEG;AACH,cAAA,kBAAA,EAAA,cAAA,EAAA,GAAA,GAAA,YAAA,CAAA,GAAA;AAEA,cAAA,iBAAA;AAEE;;;;AAaA;;;AAGG;AACH;AAIA;;;;;;;AAOG;;AAaH;;;;AAIG;AACI,2BAAA,GAAA,GAAA,YAAA,MAAA,MAAA,UAAA,GAAA,GAAA,YAAA;AAmBP;;;AAGG;;AASH;;;AAGG;AACI,+BAAA,OAAA,GAAA,SAAA;;;AAGR;;AC1GD;;;;;AAKG;AACH,cAAA,UAAA;;;AAIE;;;AAGG;AACH;;AAEC;AAED;;;AAGG;AACS,sCAAA,SAAA;AAAsD,uBAAA,SAAA;AAA+B;AAKjG;;;;;AAKG;;AAYH;;;;AAIG;AACI,gCAAA,SAAA,iBAAA,OAAA;AAOR;;AC7DD;;;;AAIG;AACH,iBAAA,gBAAA;;ACUA;;AAEG;AACH,cAAA,gBAAA;AAME;;;;;AAKG;;;;;AASJ;AAED;;;;AAIG;AACH,iBAAA,iBAAA,aAAA,UAAA,GAAwDA,EAAA,CAAA,oBAAA;;ACtCxD;;AAEG;AACH,cAAA,SAAA,EAAA,cAAA,CAAA,UAAA;;;;"}
|