@common-stack/client-core 6.0.2-alpha.2 → 6.0.6-alpha.106
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {ApolloClient}from'@apollo/client/core/index.js';import {InMemoryCache}from'@apollo/client/cache/index.js';import {logger}from'@cdm-logger/client';import {ClientTypes}from'@common-stack/core'
|
|
1
|
+
import {ApolloClient}from'@apollo/client/core/index.js';import {InMemoryCache}from'@apollo/client/cache/index.js';import {logger}from'@cdm-logger/client';import {ClientTypes}from'@common-stack/core';/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
class UtilityClass {
|
|
2
3
|
modules;
|
|
3
4
|
constructor(modules) {
|
|
4
5
|
this.modules = modules;
|
|
@@ -40,6 +41,9 @@ const apolloClientHelper = (modules) => {
|
|
|
40
41
|
container.bind(ClientTypes.Logger).toConstantValue(logger);
|
|
41
42
|
container.bind(ClientTypes.UtilityClass).toConstantValue(utility);
|
|
42
43
|
container.bind(ClientTypes.ApolloClient).toConstantValue(client);
|
|
44
|
+
container
|
|
45
|
+
.bind(ClientTypes.ApolloClientFactory)
|
|
46
|
+
.toFactory((context) => () => container.get(ClientTypes.ApolloClient));
|
|
43
47
|
container.bind(ClientTypes.InMemoryCache).toConstantValue(cache);
|
|
44
48
|
const services = modules.createService({});
|
|
45
49
|
client.container = services;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-client-test-helper.js","sources":["../../src/helpers/apollo-client-test-helper.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apollo-client-test-helper.js","sources":["../../src/helpers/apollo-client-test-helper.ts"],"sourcesContent":[null],"names":[],"mappings":"uMAAA;AAQA,MAAM,YAAY,CAAA;AACM,IAAA,OAAA,CAAA;AAApB,IAAA,WAAA,CAAoB,OAAO,EAA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I,YAAY,CAAC,OAAO,CAAC,CAAC;;IAG1C,MAAM,SAAS,GAAyB,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;AACrE,IAAA,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;AAC3D,IAAA,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AAClE,IAAA,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IACjE,SAAS;AACJ,SAAA,IAAI,CAA4C,WAAW,CAAC,mBAAmB,CAAC;AAChF,SAAA,SAAS,CAER,CAAC,OAA2B,KAAK,MAAM,SAAS,CAAC,GAAG,CAAsC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;AAC3H,IAAA,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACjE,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;AAC1C,IAAA,MAAc,CAAC,SAAS,GAAG,QAAQ,CAAC;IAErC,OAAO;QACH,MAAM;QACN,gBAAgB;QAChB,QAAQ;QACR,SAAS;KACZ,CAAC;AACN"}
|
|
@@ -13,3 +13,23 @@ export interface IAppLoadContext<S = any> {
|
|
|
13
13
|
redisClient: Redis | Cluster | undefined;
|
|
14
14
|
logger?: CdmLogger.ILogger;
|
|
15
15
|
}
|
|
16
|
+
export interface IClientLoadContext {
|
|
17
|
+
container?: Container;
|
|
18
|
+
apolloClient?: ApolloClient<NormalizedCache>;
|
|
19
|
+
logger?: CdmLogger.ILogger;
|
|
20
|
+
}
|
|
21
|
+
export interface IResourceParams {
|
|
22
|
+
params: any;
|
|
23
|
+
query: any;
|
|
24
|
+
path: string;
|
|
25
|
+
configKey: string;
|
|
26
|
+
fragment: string;
|
|
27
|
+
}
|
|
28
|
+
export type IAppMiddlewareContext = {
|
|
29
|
+
context: IAppLoadContext;
|
|
30
|
+
resourceParams: IResourceParams;
|
|
31
|
+
};
|
|
32
|
+
export type IClientMiddlewareContext = {
|
|
33
|
+
context: IClientLoadContext;
|
|
34
|
+
resourceParams: IResourceParams;
|
|
35
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/client-core",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.6-alpha.106",
|
|
4
4
|
"description": "common core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"watch": "yarn build:lib:watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@common-stack/core": "6.0.
|
|
24
|
+
"@common-stack/core": "6.0.6-alpha.106"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"redux-observable": "^
|
|
27
|
+
"redux-observable": "^3.0.0-rc.2"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@apollo/client": ">=3.0.0",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"typescript": {
|
|
38
38
|
"definition": "lib/index.d.ts"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "f5c81f6a5a14f3d4ce27c54e9c467c2371179692"
|
|
41
41
|
}
|