@common-stack/client-core 0.2.29 → 0.2.31
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.
|
@@ -6,6 +6,7 @@ import { interfaces } from 'inversify';
|
|
|
6
6
|
export declare const featureCatalog: {};
|
|
7
7
|
export declare abstract class AbstractFeature implements IFeature {
|
|
8
8
|
link: any;
|
|
9
|
+
envalidConfig: any[];
|
|
9
10
|
errorLink: ErrorLink[];
|
|
10
11
|
createFetch: any;
|
|
11
12
|
connectionParam: any;
|
|
@@ -48,6 +49,7 @@ export declare abstract class AbstractFeature implements IFeature {
|
|
|
48
49
|
* @param features
|
|
49
50
|
*/
|
|
50
51
|
constructor(feature?: IModuleShape, ...features: IModuleShape[]);
|
|
52
|
+
get envalidConfigs(): any;
|
|
51
53
|
private get container();
|
|
52
54
|
get epics(): any;
|
|
53
55
|
getRouter(withRoot?: boolean, rootComponent?: any): any;
|
package/lib/index.js
CHANGED
|
@@ -37,6 +37,8 @@ class AbstractFeature {
|
|
|
37
37
|
this.reducer = combine(arguments, (arg) => arg.reducer);
|
|
38
38
|
// Client side schema for apollo-link-state
|
|
39
39
|
this.clientStateParams = combine(arguments, (arg) => arg.clientStateParams);
|
|
40
|
+
// Envalid config
|
|
41
|
+
this.envalidConfig = combine(arguments, (arg) => arg.envalidConfig);
|
|
40
42
|
// Epic actions
|
|
41
43
|
this.epic = combine(arguments, (arg) => arg.epic);
|
|
42
44
|
this.sidebarSegments = combine(arguments, (arg) => arg.sidebarSegments);
|
|
@@ -66,6 +68,21 @@ class AbstractFeature {
|
|
|
66
68
|
this.data = combine([{}].concat(Array.from(arguments)), arg => arg.data)
|
|
67
69
|
.reduce((acc, el) => [Object.assign(Object.assign({}, acc[0]), el)], [{}]);
|
|
68
70
|
}
|
|
71
|
+
get envalidConfigs() {
|
|
72
|
+
return this.envalidConfig.reduce((prev, config) => {
|
|
73
|
+
for (let key in config) {
|
|
74
|
+
if (prev[key]) {
|
|
75
|
+
if (prev[key].required) {
|
|
76
|
+
config[key].required = prev[key].required;
|
|
77
|
+
}
|
|
78
|
+
if (prev[key].devRequired) {
|
|
79
|
+
config[key].devRequired = prev[key].devRequired;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return Object.assign(Object.assign({}, prev), config);
|
|
83
|
+
}
|
|
84
|
+
}, {});
|
|
85
|
+
}
|
|
69
86
|
get container() {
|
|
70
87
|
if (!this._container) {
|
|
71
88
|
this._container = new inversify_1.Container();
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;AAAA,wDAA+B;AAI/B,6DAA+D;AAE/D,sEAAkD;AAElD,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,oBAAO,EAAC,kBAAK,EAAC,GAAG,gBAAG,EAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,sBAAS,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AAC1G,sBAAc,GAAG,EAAE,CAAC;AAGjC,MAAsB,eAAe;IAqCjC;;;;;OAKG;IACH,YACI,OAAsB;IACtB,gCAAgC;IAChC,GAAG,QAAwB;QAE3B,eAAe;QACf,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,GAAiB,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,GAAiB,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAE1E,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,GAAiB,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC;aACxE,KAAK,CAAC,CAAC,CAAC,CAAC;aACT,GAAG,EAAE,CAAC;QACX,IAAI,CAAC,eA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FAAyB;AACzB,0FAA4B;AAC5B,4FAA6B;AAC7B,0FAA4B;AAC5B,sFAA0B;;;;;;;;;;;;ACJ1B,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAjC,+FAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;ACA5B,qFAAyB;;;;;;;;;;;;;;ACAzB,qFAAkD;AAElD,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC;AACrE,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC;AAClE,MAAM,MAAM,GAAG,qBAAY,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAe,EAAE,CAAC,CAAC;AAE/D,wBAAM;;;;;;;;;;;ACNf;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://@common-stack/client-core/./src/connector/abstract-connector.ts","webpack://@common-stack/client-core/./src/connector/index.ts","webpack://@common-stack/client-core/./src/constants/constants.ts","webpack://@common-stack/client-core/./src/constants/index.ts","webpack://@common-stack/client-core/./src/helpers/apollo-client-test-helper.ts","webpack://@common-stack/client-core/./src/helpers/index.ts","webpack://@common-stack/client-core/./src/index.ts","webpack://@common-stack/client-core/./src/interfaces/connector.ts","webpack://@common-stack/client-core/./src/interfaces/index.ts","webpack://@common-stack/client-core/./src/logger/index.ts","webpack://@common-stack/client-core/./src/logger/logger.ts","webpack://@common-stack/client-core/external commonjs \"@apollo/client\"","webpack://@common-stack/client-core/external commonjs \"@cdm-logger/client\"","webpack://@common-stack/client-core/external commonjs \"@common-stack/core\"","webpack://@common-stack/client-core/external commonjs \"inversify\"","webpack://@common-stack/client-core/external commonjs \"lodash\"","webpack://@common-stack/client-core/external commonjs \"react\"","webpack://@common-stack/client-core/webpack/bootstrap","webpack://@common-stack/client-core/webpack/before-startup","webpack://@common-stack/client-core/webpack/startup","webpack://@common-stack/client-core/webpack/after-startup"],"sourcesContent":["import * as React from 'react';\nimport { IFeature, IModuleShape, IClientStateConfig, IClientState, ResolverType, ApolloConnectionParamFunc } from '../interfaces';\nimport { IdGetterObj, Resolvers } from '@apollo/client';\nimport { ErrorLink } from '@apollo/client/link/error'\nimport { merge, map, union, without, castArray } from 'lodash';\nimport { ReducersMapObject } from 'redux';\nimport { interfaces, Container } from 'inversify';\n\nconst combine = (features, extractor) => without(union(...map(features, res => castArray(extractor(res)))), undefined);\nexport const featureCatalog = {};\n\n\nexport abstract class AbstractFeature implements IFeature {\n public link: any;\n public errorLink: ErrorLink[];\n public createFetch: any;\n public connectionParam: any;\n public epic: any;\n public reducer: ReducersMapObject[];\n public reduxContext: any;\n public clientStateParams?: IClientStateConfig[];\n public sidebarSegments: any[];\n public routerFactory: any;\n public route: any;\n public navItem: any;\n public navItemRight: any;\n public rootComponentFactory: any[];\n public dataRootComponent: any[];\n public createFetchOptions: any[];\n public stylesInsert: any[];\n public scriptsInsert: any[];\n public catalogInfo: any[];\n public languagesFuncs: any[];\n public data: any[];\n public dataIdFromObject: { [key: string]: (value: any) => string }[];\n public createContainerFunc: Function[];\n public createServiceFunc: Function[];\n public leftMainPanelItems: any;\n public middleMainPanelItems: any;\n public middleMainPanelItemsProps: any;\n public leftFooterItems: any;\n public rightFooterItems: any;\n public middleLowerPanelItems: any;\n public reduxPersistTransforms: any[];\n\n private isContainerLoaded: boolean;\n private services;\n private _container: interfaces.Container;\n\n /**\n * Constructs Client feature module representation, that folds all the feature modules\n * into a single module represented by this instance.\n * @param feature\n * @param features\n */\n constructor(\n feature?: IModuleShape,\n // tslint:disable:trailing-comma\n ...features: IModuleShape[]\n ) {\n // Connectivity\n this.link = combine(arguments, (arg: IModuleShape) => arg.link);\n this.errorLink = combine(arguments, (arg: IModuleShape) => arg.errorLink);\n\n this.createFetch = combine(arguments, (arg: IModuleShape) => arg.createFetch)\n .slice(-1)\n .pop();\n this.connectionParam = combine(arguments, (arg: IModuleShape) => arg.connectionParam);\n\n // State management\n this.reducer = combine(arguments, (arg: IModuleShape) => arg.reducer);\n // Client side schema for apollo-link-state\n this.clientStateParams = combine(arguments, (arg: IModuleShape) => arg.clientStateParams);\n\n // Epic actions\n this.epic = combine(arguments, (arg: IModuleShape) => arg.epic);\n\n\n this.sidebarSegments = combine(arguments, (arg: IModuleShape) => arg.sidebarSegments);\n\n this.leftMainPanelItems = combine(arguments, (arg: IModuleShape) => arg.leftMainPanelItems);\n this.middleMainPanelItems = combine(arguments, (arg: IModuleShape) => arg.middleMainPanelItems);\n this.middleMainPanelItemsProps = combine(arguments, (arg: IModuleShape) => arg.middleMainPanelItemsProps);\n this.leftFooterItems = combine(arguments, (arg: IModuleShape) => arg.leftFooterItems);\n this.rightFooterItems = combine(arguments, (arg: IModuleShape) => arg.rightFooterItems);\n this.middleLowerPanelItems = combine(arguments, (arg: IModuleShape) => arg.middleLowerPanelItems);\n this.dataIdFromObject = combine(arguments, (arg: IModuleShape) => arg.dataIdFromObject);\n\n\n this.navItem = combine(arguments, (arg: IModuleShape) => arg.navItem);\n this.navItemRight = combine(arguments, (arg: IModuleShape) => arg.navItemRight);\n\n // UI provider-components\n this.rootComponentFactory = combine(arguments, (arg: IModuleShape) => arg.rootComponentFactory);\n this.dataRootComponent = combine(arguments, (arg: IModuleShape) => arg.dataRootComponent);\n\n // UI provider-components\n this.languagesFuncs = combine(arguments, (arg: IModuleShape) => arg.languagesFuncs);\n\n // container\n this.createContainerFunc = combine(arguments, arg => arg.createContainerFunc);\n\n // services\n this.createServiceFunc = combine(arguments, arg => arg.createServiceFunc);\n\n // TODO: Use React Helmet for those. Low level DOM manipulation\n this.stylesInsert = combine(arguments, (arg: IModuleShape) => arg.stylesInsert);\n this.scriptsInsert = combine(arguments, (arg: IModuleShape) => arg.scriptsInsert);\n this.reduxPersistTransforms = combine(arguments, (arg: IModuleShape) => arg.reduxPersistTransforms);\n\n\n // Shared modules data\n this.data = combine([{}].concat(Array.from(arguments)), arg => arg.data)\n .reduce(\n (acc, el) => [{ ...acc[0], ...el }],\n [{}],\n );\n }\n\n private get container(): interfaces.Container {\n if (!this._container) {\n this._container = new Container();\n }\n return this._container;\n }\n\n public get epics() {\n return this.epic;\n }\n\n public getRouter(withRoot?: boolean, rootComponent?: any) {\n return this.routerFactory(this.getRoutes());\n }\n\n public abstract getRoutes(searchPath?: RegExp);\n\n public abstract get navItems();\n\n public abstract get navItemsRight();\n\n get reducers() {\n return merge({}, ...(this.reducer || []));\n }\n\n public createContainers(options): interfaces.Container {\n // only create once\n if (this.isContainerLoaded) {\n return this.container;\n }\n this.createContainerFunc.map(createModule => {\n this.container.load(createModule(options));\n });\n this.isContainerLoaded = true;\n return this.container;\n }\n\n public createService(options, updateOptions) {\n // only create once\n if (this.services) {\n return this.services;\n }\n try {\n if (!this.isContainerLoaded) {\n this.createContainers(options);\n }\n this.services = merge({}, ...this.createServiceFunc.map(serviceFunc => serviceFunc(this.container)));\n return this.services;\n } catch (err) {\n throw err;\n }\n }\n\n public getStateParams(args: { resolverContex?: any } = {}) {\n const cn = this.container;\n return this.clientStateParams.reduce<IClientState>(function (acc, curr: IClientStateConfig) {\n const defs = curr.typeDefs ? Array.isArray(curr.typeDefs) ? curr.typeDefs : [curr.typeDefs] : [];\n const preLinksAccumulator = acc.preLinks || [];\n const attemptFuncAccumulator = acc.retryLinkAttemptFuncs || [];\n const connectionParamsFuncAccumulator = acc.connectionParams || [];\n const callbackBackFuncAccumulator = acc.connectionCallbackFuncs || [];\n const attemptDefaults = acc.defaults || [];\n const schema = defs.map(typeDef => {\n if (typeof typeDef === 'string') {\n return typeDef;\n }\n console.warn(`Not supported AST format `, typeDef);\n })\n .map(str => str.trim())\n .join('\\n');\n const typeDefs = acc.typeDefs ? acc.typeDefs.concat('\\n', schema) : schema;\n const defaults = curr.defaults ? attemptDefaults.concat(curr.defaults) : attemptDefaults;\n const resolvers = merge(acc.resolvers, consoldidatedResolvers(curr.resolvers, args.resolverContex)) as Resolvers;\n const possibleTypes = merge(acc.possibleTypes, curr.possibleTypes);\n const typePolicies = merge(acc.typePolicies, curr.typePolicies);\n const retryLinkAttemptFuncs = curr.retryLinkAttemptFuncs ? attemptFuncAccumulator.concat(curr.retryLinkAttemptFuncs || []) : attemptFuncAccumulator;\n const preLinks = preLinksAccumulator.concat((curr.preLinkFuncs || []).map(linkF => linkF(cn)) || []);\n const connectionParams = curr.connectionParam ? connectionParamsFuncAccumulator.concat(consoldidatedConnection(curr.connectionParam, cn)) : connectionParamsFuncAccumulator;\n const connectionCallbackFuncs = curr.connectionCallbackFunc ? callbackBackFuncAccumulator.concat(curr.connectionCallbackFunc(cn) || []) : callbackBackFuncAccumulator;\n return {\n defaults,\n resolvers,\n typeDefs,\n possibleTypes,\n retryLinkAttemptFuncs,\n preLinks,\n typePolicies,\n connectionParams,\n connectionCallbackFuncs\n };\n }, {} as IClientState);\n }\n\n\n get connectionParams() {\n return this.connectionParam;\n }\n\n get stylesInserts() {\n return this.stylesInsert;\n }\n\n get scriptsInserts() {\n return this.scriptsInsert;\n }\n\n get leftMainPanel() {\n return merge({}, ...(this.leftMainPanelItems || []));\n }\n\n get middleMainPanel() {\n const panelObj = merge({}, ...(this.middleMainPanelItems || []));\n const withProps = {} as any;\n Object.keys(panelObj).forEach(key => {\n const props = this.middleMainPanelItemsProps.filter(el => !!el[key]);\n let mergedProps = [];\n props.forEach(el => {\n const insideEl = el[key];\n Object.keys(insideEl).forEach(item => {\n if (mergedProps[item]) {\n mergedProps[item] = [...mergedProps[item], ...insideEl[item]];\n } else {\n mergedProps = { ...mergedProps, [item]: insideEl[item] };\n }\n });\n });\n return withProps[key] = React.cloneElement(\n panelObj[key],\n mergedProps,\n );\n });\n return withProps;\n }\n\n get leftFooter() {\n return this.leftFooterItems;\n }\n\n get rightFooter() {\n return this.rightFooterItems;\n }\n\n get middleLowerPanel() {\n return merge({}, ...(this.middleLowerPanelItems || []));\n }\n\n get reduxPersistStateTransformers() {\n return this.reduxPersistTransforms\n }\n\n public getDataIdFromObject(result: { [key: string]: string | number, __typename?: string } | IdGetterObj) {\n const dataIdFromObject = merge({}, ...this.dataIdFromObject);\n if (dataIdFromObject[result.__typename]) {\n return dataIdFromObject[result.__typename](result);\n }\n return result.id || (result as any)._id;\n }\n\n public abstract getWrappedRoot(root, req);\n\n public abstract getDataRoot(root);\n\n public abstract registerLanguages(monaco);\n}\n\nfunction consoldidatedResolvers(resolvers: ResolverType, context): Resolvers {\n let finalResolvers;\n if (Array.isArray(resolvers)) {\n const resolverObject = (resolvers as (object[])).map(resolver => {\n return typeof resolver === 'function'\n ? resolver(context)\n : resolver;\n });\n finalResolvers = merge({}, ...resolverObject);\n } else {\n finalResolvers = typeof resolvers === 'function'\n ? resolvers(context)\n : resolvers;\n }\n\n return finalResolvers;\n}\n\nasync function consoldidatedConnection(connectionParams: ApolloConnectionParamFunc, context): Promise<any> {\n let finalConnectionParams;\n if (Array.isArray(connectionParams)) {\n throw new Error('Array is not supported for ConnectionParams')\n } else {\n finalConnectionParams = typeof connectionParams === 'function'\n ? await connectionParams(context)\n : connectionParams;\n }\n\n return finalConnectionParams;\n}\n\n","export * from './abstract-connector';\n","import { ClientTypes, ElectronTypes } from '@common-stack/core';\n\nexport {\n ElectronTypes,\n ClientTypes,\n}\n\nexport const REDUX_PERSIST_KEY = 'root'; \n","export * from './constants';\n","import { ApolloClient, ApolloClientOptions, InMemoryCache } from '@apollo/client';\nimport { interfaces } from 'inversify';\nimport { logger } from '@cdm-logger/client';\nimport { IFeature } from '../interfaces';\nimport { ClientTypes } from '../constants';\n\nclass UtilityClass {\n constructor(private modules) {\n }\n public getCacheKey(storeObj) {\n return this.modules.getDataIdFromObject(storeObj);\n }\n}\n\n\n/**\n * Helper method to produce ApolloClient and Services from the feeded Feature Module.\n * @param modules \n */\nexport const apolloClientHelper = (modules: IFeature) => {\n const clientState = modules.getStateParams({ resolverContex: () => modules.createService({}, {}) });\n\n const dataIdFromObject = (result) => modules.getDataIdFromObject(result);\n const cache = new InMemoryCache({\n dataIdFromObject,\n possibleTypes: clientState.possibleTypes\n });\n\n const schema = ``;\n\n const params: ApolloClientOptions<any> = {\n cache,\n queryDeduplication: true,\n typeDefs: schema.concat(<string>clientState.typeDefs),\n resolvers: clientState.resolvers as any,\n };\n const client = new ApolloClient(params);\n clientState.defaults.map(x => {\n if (x.type === 'query') {\n cache.writeQuery(x);\n } else if (x.type === 'fragment') {\n cache.writeFragment(x);\n }\n });\n\n const utility = new UtilityClass(modules);\n\n // additional bindings to container\n const container: interfaces.Container = modules.createContainers({});\n container.bind(ClientTypes.Logger).toConstantValue(logger);\n container.bind(ClientTypes.UtilityClass).toConstantValue(utility);\n container.bind(ClientTypes.ApolloClient).toConstantValue(client);\n container.bind(ClientTypes.InMemoryCache).toConstantValue(cache);\n const services = modules.createService({}, {});\n (client as any).container = services;\n\n\n return {\n client,\n dataIdFromObject,\n services,\n container,\n }\n}\n\n\n\n","export * from './apollo-client-test-helper';\n","export * from './logger';\nexport * from './connector';\nexport * from './interfaces';\nexport * from './constants';\nexport * from './helpers';","// tslint:disable:max-line-length\n\nimport { Resolvers, IdGetterObj, PossibleTypesMap, TypePolicies, Operation, ApolloLink, ApolloClientOptions } from '@apollo/client';\nimport { interfaces } from 'inversify';\nimport { Cache } from '@apollo/client/cache';\nimport { ReducersMapObject } from 'redux';\nimport { ErrorLink } from '@apollo/client/link/error';\nimport { ConnectionParams } from 'subscriptions-transport-ws';\n\nexport type ResolverType = Resolvers | Resolvers[] | ((service: any) => Resolvers) | ((service: any) => Resolvers)[] | ((service: any) => any) | ((service: any) => any)[];\nexport type ApolloLinkFunc = (container: interfaces.Container) => ApolloLink;\nexport type ApolloConnectionParamFunc = ((container: interfaces.Container) => ConnectionParams) | ConnectionParams ;\nexport type IWSConnectionCallbackFunc = (webSocket: any, error: Error[], result?: any) => void | Promise<void>;\nexport type ApolloWSConnectionCallbackFunc = (container: interfaces.Container) => IWSConnectionCallbackFunc;\n\ntype IRetryLinkAttemptFuncs = (count: number, operation: Operation, error: any) => boolean | Promise<boolean>;\ntype IClientStateQueryDefault<T, V> = {\n type: 'query',\n} & Cache.WriteQueryOptions<T, V>;\n\ntype IClientStateFragmentDefault<T, V> = {\n type: 'fragment',\n} & Cache.WriteFragmentOptions<T, V>;\n\nexport type IClientStateDefault<T = unknown, V = unknown> = IClientStateFragmentDefault<T,V> | IClientStateQueryDefault<T,V>;\nexport interface IClientStateConfig {\n resolvers?: ResolverType; // don't need `Resolvers` type as it may conflict with the usage\n defaults?: IClientStateDefault[];\n typeDefs?: string | string[];\n possibleTypes?: PossibleTypesMap;\n typePolicies?: TypePolicies;\n // retries the request if function returns true\n retryLinkAttemptFuncs?: IRetryLinkAttemptFuncs;\n /**\n * @param preLinkFuncs all `apollo-link` that need to be composed before the network link. Should be a function.\n * @inheritdoc https://www.apollographql.com/docs/react/api/link/introduction/\n */\n preLinkFuncs?: ApolloLinkFunc[];\n /**\n * @param connectionParam To provide connectionParam to `WebSocketLink`. It takes a single `Object` or a `Function`.\n * @inheritdoc https://www.apollographql.com/docs/react/api/link/apollo-link-ws/\n */\n connectionParam?: ApolloConnectionParamFunc;\n /**\n * @param connectionCallback Accept only one function for all modules.\n * @inheritdoc\n */\n connectionCallbackFunc?: ApolloWSConnectionCallbackFunc;\n \n}\n\nexport interface IClientState {\n resolvers?: Resolvers; // don't need `Resolvers` type as it may conflict with the usage\n defaults: IClientStateDefault[];\n typeDefs?: string | string[];\n possibleTypes?: PossibleTypesMap;\n retryLinkAttemptFuncs?: IRetryLinkAttemptFuncs[];\n typePolicies?: TypePolicies,\n preLinks: ApolloLink[];\n connectionParams: ConnectionParams[];\n connectionCallbackFuncs?: IWSConnectionCallbackFunc[];\n}\n\n/**\n * ModuleShape have optional configuration to be implemented by all the feature modules\n * in the application.\n */\nexport interface IModuleShape {\n /**\n * @param link all `apollo-link` that need to be composed.\n * @inheritdoc https://github.com/apollographql/apollo-link\n * @deprecated use ClientStateParms.preLinkFuncs\n */\n readonly link?: any;\n /**\n * @param errorLink compose all errorLink\n * @inheritdoc https://github.com/apollographql/apollo-link/tree/master/packages/apollo-link-error\n */\n readonly errorLink?: ErrorLink | ErrorLink[];\n readonly createFetch?: any;\n /**\n * @param connectionParam method that called when a client connects to the socket.\n * @inheritdoc https://github.com/apollographql/subscriptions-transport-ws#constructorurl-options-connectioncallback\n * @deprecated use clientStateParams\n */\n readonly connectionParam?: any;\n /**\n * @param epic all `epics` that need to be composed.\n * @inheritdoc https://redux-observable.js.org/docs/basics/Epics.html\n */\n readonly epic?: any;\n /**\n * @param reducer Redux reducers list\n */\n readonly reducer?: ReducersMapObject | ReducersMapObject[];\n /**\n * @param clientStateParams Client side configuration of `apollo-client`\n * @inheritdoc https://github.com/apollographql/apollo-client/tree/2d65da133c156f6d808e64aee7e7fd5f7cc71d7f\n */\n readonly clientStateParams?: IClientStateConfig | IClientStateConfig[];\n /**\n * @param dataIdFromObject A function that returns an object identifier given an particular result\n * object.\n * @inheritdoc https://github.com/apollographql/apollo-client/tree/ed66999bac40226abfeada8d6c83b454636bb4b0/packages/apollo-cache-inmemory#configuration\n */\n readonly dataIdFromObject?: { [key: string]: (value: any) => string } | { [key: string]: (value: any) => string }[] | IdGetterObj;\n /**\n * @param createContainerFunc Synchronous Container Modules of inversify.\n * @inheritdoc https://github.com/inversify/InversifyJS/blob/master/wiki/container_modules.md\n */\n readonly createContainerFunc?: Function | Function[];\n /**\n * @param createServiceFunc Services\n */\n readonly createServiceFunc?: Function | Function[];\n readonly sidebarSegments?: any;\n readonly routerFactory?: any;\n /**\n * @param route Route list\n */\n readonly route?: any;\n /**\n * @param navItem Top left navigation links\n */\n readonly navItem?: any;\n /**\n * @param navItemRightTop right navigation links\n */\n readonly navItemRight?: any;\n /**\n * @param rootComponentFactory Root component factory list\n */\n readonly rootComponentFactory?: any;\n /**\n * @param dataRootComponent Data root React elements list (data root elements wraps data fetching react subtree root)\n */\n readonly dataRootComponent?: any;\n readonly createFetchOptions?: any;\n /**\n * @param stylesInsert URL list to 3rd party css scripts\n */\n readonly stylesInsert?: any;\n /**\n * @param scriptsInsert URL list to 3rd party js scripts\n */\n readonly scriptsInsert?: any;\n /**\n * @deprecated\n */\n readonly catalogInfo?: any;\n /**\n * @deprecated\n */\n readonly languagesFuncs?: any;\n /**\n * @param leftMainPanelItems Components that will be placed left panel.\n */\n readonly leftMainPanelItems?: any;\n /**\n * @param middleMainPanelItems Components that will be placed middle center panel\n */\n readonly middleMainPanelItems?: any;\n /**\n * @param middleMainPanelItemsProps Props of the component that will be placed middle center panel\n */\n readonly middleMainPanelItemsProps?: any;\n /**\n * @param leftFooterItems Components that will be placed left footer panel\n */\n readonly leftFooterItems?: any;\n /**\n * @param rightFooterItems Components that will be placed right footer panel\n */\n readonly rightFooterItems?: any;\n /**\n * @param middleLowerPanelItems Components that will be placed below middle panel\n */\n readonly middleLowerPanelItems?: any;\n\n readonly reduxPersistTransforms?: any[];\n\n}\n\n\n/**\n * Feature module methods\n */\nexport interface IFeature extends IModuleShape {\n // Public variables\n readonly data: any[];\n\n /**\n * @returns Redux-Observable Epics\n */\n readonly epics;\n\n readonly getRouter;\n /**\n * @returns client-side React route components list\n */\n readonly getRoutes;\n\n /**\n * @returns client-side top left navbar link component list\n */\n readonly navItems;\n /**\n * @returns client-side top right navbar link component list\n */\n readonly navItemsRight;\n /**\n * @returns Redux reducers\n */\n readonly reducers;\n\n readonly connectionParams;\n\n /**\n * @returns URL list to 3rd party css styles\n */\n readonly stylesInserts;\n /**\n * @returns URL list to 3rd party js styles\n */\n readonly scriptsInserts;\n\n readonly leftMainPanel;\n readonly middleMainPanel;\n readonly leftFooter;\n readonly rightFooter;\n readonly middleLowerPanel;\n readonly dataIdFromObject;\n\n /**\n * @param args Options to pass to each Container Module\n * @returns Created container and binds all the container modules\n */\n createContainers(args);\n\n\n createService(options, updateOptions);\n /**\n * @param args Provide resolverContext which can be passed to all resolver functions.\n * @returns IClientState\n */\n getStateParams(args?: { resolverContex?: any }): IClientState;\n\n getDataIdFromObject(result: {\n [key: string]: string | number;\n __typename?: string;\n } | IdGetterObj): any;\n /**\n * @arguments root React tree root component\n * @arguments req Http Request\n * @returns React tree root component wrapped up by root components exposed by this module\n */\n getWrappedRoot(root: any, req?: any): any;\n /**\n * @param root React tree data root component (first React root components which is used for fetching data)\n *\n * @returns React tree data root component wrapped up by data root components exposed by this module\n */\n getDataRoot(root: any): any;\n registerLanguages(monaco): void;\n}\n","export * from './connector';\n","export * from './logger';\n","import { ClientLogger } from '@cdm-logger/client';\n\nconst appName = (process.env && process.env.APP_NAME) || 'FullStack';\nconst logLevel = (process.env && process.env.LOG_LEVEL) || 'info';\nconst logger = ClientLogger.create(appName, { level: logLevel as any });\n\nexport { logger };\n","module.exports = require(\"@apollo/client\");","module.exports = require(\"@cdm-logger/client\");","module.exports = require(\"@common-stack/core\");","module.exports = require(\"inversify\");","module.exports = require(\"lodash\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./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abstract-connector.ts","webpack://@common-stack/client-core/./src/connector/index.ts","webpack://@common-stack/client-core/./src/constants/constants.ts","webpack://@common-stack/client-core/./src/constants/index.ts","webpack://@common-stack/client-core/./src/helpers/apollo-client-test-helper.ts","webpack://@common-stack/client-core/./src/helpers/index.ts","webpack://@common-stack/client-core/./src/index.ts","webpack://@common-stack/client-core/./src/interfaces/connector.ts","webpack://@common-stack/client-core/./src/interfaces/index.ts","webpack://@common-stack/client-core/./src/logger/index.ts","webpack://@common-stack/client-core/./src/logger/logger.ts","webpack://@common-stack/client-core/external commonjs \"@apollo/client\"","webpack://@common-stack/client-core/external commonjs \"@cdm-logger/client\"","webpack://@common-stack/client-core/external commonjs \"@common-stack/core\"","webpack://@common-stack/client-core/external commonjs \"inversify\"","webpack://@common-stack/client-core/external commonjs \"lodash\"","webpack://@common-stack/client-core/external commonjs \"react\"","webpack://@common-stack/client-core/webpack/bootstrap","webpack://@common-stack/client-core/webpack/before-startup","webpack://@common-stack/client-core/webpack/startup","webpack://@common-stack/client-core/webpack/after-startup"],"sourcesContent":["import * as React from 'react';\nimport { IFeature, IModuleShape, IClientStateConfig, IClientState, ResolverType, ApolloConnectionParamFunc } from '../interfaces';\nimport { IdGetterObj, Resolvers } from '@apollo/client';\nimport { ErrorLink } from '@apollo/client/link/error'\nimport { merge, map, union, without, castArray } from 'lodash';\nimport { ReducersMapObject } from 'redux';\nimport { interfaces, Container } from 'inversify';\n\nconst combine = (features, extractor) => without(union(...map(features, res => castArray(extractor(res)))), undefined);\nexport const featureCatalog = {};\n\n\nexport abstract class AbstractFeature implements IFeature {\n public link: any;\n public envalidConfig: any[];\n public errorLink: ErrorLink[];\n public createFetch: any;\n public connectionParam: any;\n public epic: any;\n public reducer: ReducersMapObject[];\n public reduxContext: any;\n public clientStateParams?: IClientStateConfig[];\n public sidebarSegments: any[];\n public routerFactory: any;\n public route: any;\n public navItem: any;\n public navItemRight: any;\n public rootComponentFactory: any[];\n public dataRootComponent: any[];\n public createFetchOptions: any[];\n public stylesInsert: any[];\n public scriptsInsert: any[];\n public catalogInfo: any[];\n public languagesFuncs: any[];\n public data: any[];\n public dataIdFromObject: { [key: string]: (value: any) => string }[];\n public createContainerFunc: Function[];\n public createServiceFunc: Function[];\n public leftMainPanelItems: any;\n public middleMainPanelItems: any;\n public middleMainPanelItemsProps: any;\n public leftFooterItems: any;\n public rightFooterItems: any;\n public middleLowerPanelItems: any;\n public reduxPersistTransforms: any[];\n\n private isContainerLoaded: boolean;\n private services;\n private _container: interfaces.Container;\n\n /**\n * Constructs Client feature module representation, that folds all the feature modules\n * into a single module represented by this instance.\n * @param feature\n * @param features\n */\n constructor(\n feature?: IModuleShape,\n // tslint:disable:trailing-comma\n ...features: IModuleShape[]\n ) {\n // Connectivity\n this.link = combine(arguments, (arg: IModuleShape) => arg.link);\n this.errorLink = combine(arguments, (arg: IModuleShape) => arg.errorLink);\n\n this.createFetch = combine(arguments, (arg: IModuleShape) => arg.createFetch)\n .slice(-1)\n .pop();\n this.connectionParam = combine(arguments, (arg: IModuleShape) => arg.connectionParam);\n\n // State management\n this.reducer = combine(arguments, (arg: IModuleShape) => arg.reducer);\n // Client side schema for apollo-link-state\n this.clientStateParams = combine(arguments, (arg: IModuleShape) => arg.clientStateParams);\n\n // Envalid config\n this.envalidConfig = combine(arguments, (arg: IModuleShape) => arg.envalidConfig);\n \n // Epic actions\n this.epic = combine(arguments, (arg: IModuleShape) => arg.epic);\n\n\n this.sidebarSegments = combine(arguments, (arg: IModuleShape) => arg.sidebarSegments);\n\n this.leftMainPanelItems = combine(arguments, (arg: IModuleShape) => arg.leftMainPanelItems);\n this.middleMainPanelItems = combine(arguments, (arg: IModuleShape) => arg.middleMainPanelItems);\n this.middleMainPanelItemsProps = combine(arguments, (arg: IModuleShape) => arg.middleMainPanelItemsProps);\n this.leftFooterItems = combine(arguments, (arg: IModuleShape) => arg.leftFooterItems);\n this.rightFooterItems = combine(arguments, (arg: IModuleShape) => arg.rightFooterItems);\n this.middleLowerPanelItems = combine(arguments, (arg: IModuleShape) => arg.middleLowerPanelItems);\n this.dataIdFromObject = combine(arguments, (arg: IModuleShape) => arg.dataIdFromObject);\n\n\n this.navItem = combine(arguments, (arg: IModuleShape) => arg.navItem);\n this.navItemRight = combine(arguments, (arg: IModuleShape) => arg.navItemRight);\n\n // UI provider-components\n this.rootComponentFactory = combine(arguments, (arg: IModuleShape) => arg.rootComponentFactory);\n this.dataRootComponent = combine(arguments, (arg: IModuleShape) => arg.dataRootComponent);\n\n // UI provider-components\n this.languagesFuncs = combine(arguments, (arg: IModuleShape) => arg.languagesFuncs);\n\n // container\n this.createContainerFunc = combine(arguments, arg => arg.createContainerFunc);\n\n // services\n this.createServiceFunc = combine(arguments, arg => arg.createServiceFunc);\n\n // TODO: Use React Helmet for those. Low level DOM manipulation\n this.stylesInsert = combine(arguments, (arg: IModuleShape) => arg.stylesInsert);\n this.scriptsInsert = combine(arguments, (arg: IModuleShape) => arg.scriptsInsert);\n this.reduxPersistTransforms = combine(arguments, (arg: IModuleShape) => arg.reduxPersistTransforms);\n\n\n // Shared modules data\n this.data = combine([{}].concat(Array.from(arguments)), arg => arg.data)\n .reduce(\n (acc, el) => [{ ...acc[0], ...el }],\n [{}],\n );\n }\n public get envalidConfigs() {\n return this.envalidConfig.reduce((prev, config) => {\n for( let key in config){\n if (prev[key]) {\n if(prev[key].required) {\n config[key].required = prev[key].required;\n }\n if(prev[key].devRequired) {\n config[key].devRequired = prev[key].devRequired;\n }\n }\n return { ...prev, ...config}\n }\n }, {})\n \n }\n\n private get container(): interfaces.Container {\n if (!this._container) {\n this._container = new Container();\n }\n return this._container;\n }\n\n public get epics() {\n return this.epic;\n }\n\n public getRouter(withRoot?: boolean, rootComponent?: any) {\n return this.routerFactory(this.getRoutes());\n }\n\n public abstract getRoutes(searchPath?: RegExp);\n\n public abstract get navItems();\n\n public abstract get navItemsRight();\n\n get reducers() {\n return merge({}, ...(this.reducer || []));\n }\n\n public createContainers(options): interfaces.Container {\n // only create once\n if (this.isContainerLoaded) {\n return this.container;\n }\n this.createContainerFunc.map(createModule => {\n this.container.load(createModule(options));\n });\n this.isContainerLoaded = true;\n return this.container;\n }\n\n public createService(options, updateOptions) {\n // only create once\n if (this.services) {\n return this.services;\n }\n try {\n if (!this.isContainerLoaded) {\n this.createContainers(options);\n }\n this.services = merge({}, ...this.createServiceFunc.map(serviceFunc => serviceFunc(this.container)));\n return this.services;\n } catch (err) {\n throw err;\n }\n }\n\n public getStateParams(args: { resolverContex?: any } = {}) {\n const cn = this.container;\n return this.clientStateParams.reduce<IClientState>(function (acc, curr: IClientStateConfig) {\n const defs = curr.typeDefs ? Array.isArray(curr.typeDefs) ? curr.typeDefs : [curr.typeDefs] : [];\n const preLinksAccumulator = acc.preLinks || [];\n const attemptFuncAccumulator = acc.retryLinkAttemptFuncs || [];\n const connectionParamsFuncAccumulator = acc.connectionParams || [];\n const callbackBackFuncAccumulator = acc.connectionCallbackFuncs || [];\n const attemptDefaults = acc.defaults || [];\n const schema = defs.map(typeDef => {\n if (typeof typeDef === 'string') {\n return typeDef;\n }\n console.warn(`Not supported AST format `, typeDef);\n })\n .map(str => str.trim())\n .join('\\n');\n const typeDefs = acc.typeDefs ? acc.typeDefs.concat('\\n', schema) : schema;\n const defaults = curr.defaults ? attemptDefaults.concat(curr.defaults) : attemptDefaults;\n const resolvers = merge(acc.resolvers, consoldidatedResolvers(curr.resolvers, args.resolverContex)) as Resolvers;\n const possibleTypes = merge(acc.possibleTypes, curr.possibleTypes);\n const typePolicies = merge(acc.typePolicies, curr.typePolicies);\n const retryLinkAttemptFuncs = curr.retryLinkAttemptFuncs ? attemptFuncAccumulator.concat(curr.retryLinkAttemptFuncs || []) : attemptFuncAccumulator;\n const preLinks = preLinksAccumulator.concat((curr.preLinkFuncs || []).map(linkF => linkF(cn)) || []);\n const connectionParams = curr.connectionParam ? connectionParamsFuncAccumulator.concat(consoldidatedConnection(curr.connectionParam, cn)) : connectionParamsFuncAccumulator;\n const connectionCallbackFuncs = curr.connectionCallbackFunc ? callbackBackFuncAccumulator.concat(curr.connectionCallbackFunc(cn) || []) : callbackBackFuncAccumulator;\n return {\n defaults,\n resolvers,\n typeDefs,\n possibleTypes,\n retryLinkAttemptFuncs,\n preLinks,\n typePolicies,\n connectionParams,\n connectionCallbackFuncs\n };\n }, {} as IClientState);\n }\n\n\n get connectionParams() {\n return this.connectionParam;\n }\n\n get stylesInserts() {\n return this.stylesInsert;\n }\n\n get scriptsInserts() {\n return this.scriptsInsert;\n }\n\n get leftMainPanel() {\n return merge({}, ...(this.leftMainPanelItems || []));\n }\n\n get middleMainPanel() {\n const panelObj = merge({}, ...(this.middleMainPanelItems || []));\n const withProps = {} as any;\n Object.keys(panelObj).forEach(key => {\n const props = this.middleMainPanelItemsProps.filter(el => !!el[key]);\n let mergedProps = [];\n props.forEach(el => {\n const insideEl = el[key];\n Object.keys(insideEl).forEach(item => {\n if (mergedProps[item]) {\n mergedProps[item] = [...mergedProps[item], ...insideEl[item]];\n } else {\n mergedProps = { ...mergedProps, [item]: insideEl[item] };\n }\n });\n });\n return withProps[key] = React.cloneElement(\n panelObj[key],\n mergedProps,\n );\n });\n return withProps;\n }\n\n get leftFooter() {\n return this.leftFooterItems;\n }\n\n get rightFooter() {\n return this.rightFooterItems;\n }\n\n get middleLowerPanel() {\n return merge({}, ...(this.middleLowerPanelItems || []));\n }\n\n get reduxPersistStateTransformers() {\n return this.reduxPersistTransforms\n }\n\n public getDataIdFromObject(result: { [key: string]: string | number, __typename?: string } | IdGetterObj) {\n const dataIdFromObject = merge({}, ...this.dataIdFromObject);\n if (dataIdFromObject[result.__typename]) {\n return dataIdFromObject[result.__typename](result);\n }\n return result.id || (result as any)._id;\n }\n\n public abstract getWrappedRoot(root, req);\n\n public abstract getDataRoot(root);\n\n public abstract registerLanguages(monaco);\n}\n\nfunction consoldidatedResolvers(resolvers: ResolverType, context): Resolvers {\n let finalResolvers;\n if (Array.isArray(resolvers)) {\n const resolverObject = (resolvers as (object[])).map(resolver => {\n return typeof resolver === 'function'\n ? resolver(context)\n : resolver;\n });\n finalResolvers = merge({}, ...resolverObject);\n } else {\n finalResolvers = typeof resolvers === 'function'\n ? resolvers(context)\n : resolvers;\n }\n\n return finalResolvers;\n}\n\nasync function consoldidatedConnection(connectionParams: ApolloConnectionParamFunc, context): Promise<any> {\n let finalConnectionParams;\n if (Array.isArray(connectionParams)) {\n throw new Error('Array is not supported for ConnectionParams')\n } else {\n finalConnectionParams = typeof connectionParams === 'function'\n ? await connectionParams(context)\n : connectionParams;\n }\n\n return finalConnectionParams;\n}\n\n","export * from './abstract-connector';\n","import { ClientTypes, ElectronTypes } from '@common-stack/core';\n\nexport {\n ElectronTypes,\n ClientTypes,\n}\n\nexport const REDUX_PERSIST_KEY = 'root'; \n","export * from './constants';\n","import { ApolloClient, ApolloClientOptions, InMemoryCache } from '@apollo/client';\nimport { interfaces } from 'inversify';\nimport { logger } from '@cdm-logger/client';\nimport { IFeature } from '../interfaces';\nimport { ClientTypes } from '../constants';\n\nclass UtilityClass {\n constructor(private modules) {\n }\n public getCacheKey(storeObj) {\n return this.modules.getDataIdFromObject(storeObj);\n }\n}\n\n\n/**\n * Helper method to produce ApolloClient and Services from the feeded Feature Module.\n * @param modules \n */\nexport const apolloClientHelper = (modules: IFeature) => {\n const clientState = modules.getStateParams({ resolverContex: () => modules.createService({}, {}) });\n\n const dataIdFromObject = (result) => modules.getDataIdFromObject(result);\n const cache = new InMemoryCache({\n dataIdFromObject,\n possibleTypes: clientState.possibleTypes\n });\n\n const schema = ``;\n\n const params: ApolloClientOptions<any> = {\n cache,\n queryDeduplication: true,\n typeDefs: schema.concat(<string>clientState.typeDefs),\n resolvers: clientState.resolvers as any,\n };\n const client = new ApolloClient(params);\n clientState.defaults.map(x => {\n if (x.type === 'query') {\n cache.writeQuery(x);\n } else if (x.type === 'fragment') {\n cache.writeFragment(x);\n }\n });\n\n const utility = new UtilityClass(modules);\n\n // additional bindings to container\n const container: interfaces.Container = modules.createContainers({});\n container.bind(ClientTypes.Logger).toConstantValue(logger);\n container.bind(ClientTypes.UtilityClass).toConstantValue(utility);\n container.bind(ClientTypes.ApolloClient).toConstantValue(client);\n container.bind(ClientTypes.InMemoryCache).toConstantValue(cache);\n const services = modules.createService({}, {});\n (client as any).container = services;\n\n\n return {\n client,\n dataIdFromObject,\n services,\n container,\n }\n}\n\n\n\n","export * from './apollo-client-test-helper';\n","export * from './logger';\nexport * from './connector';\nexport * from './interfaces';\nexport * from './constants';\nexport * from './helpers';","// tslint:disable:max-line-length\n\nimport { Resolvers, IdGetterObj, PossibleTypesMap, TypePolicies, Operation, ApolloLink, ApolloClientOptions } from '@apollo/client';\nimport { interfaces } from 'inversify';\nimport { Cache } from '@apollo/client/cache';\nimport { ReducersMapObject } from 'redux';\nimport { ErrorLink } from '@apollo/client/link/error';\ntype ConnectionParams = {\n [paramName: string]: any;\n};\nexport type ResolverType = Resolvers | Resolvers[] | ((service: any) => Resolvers) | ((service: any) => Resolvers)[] | ((service: any) => any) | ((service: any) => any)[];\nexport type ApolloLinkFunc = (container: interfaces.Container) => ApolloLink;\nexport type ApolloConnectionParamFunc = ((container: interfaces.Container) => ConnectionParams) | ConnectionParams ;\nexport type IWSConnectionCallbackFunc = (webSocket: any, error: Error[], result?: any) => void | Promise<void>;\nexport type ApolloWSConnectionCallbackFunc = (container: interfaces.Container) => IWSConnectionCallbackFunc;\n\ntype IRetryLinkAttemptFuncs = (count: number, operation: Operation, error: any) => boolean | Promise<boolean>;\ntype IClientStateQueryDefault<T, V> = {\n type: 'query',\n} & Cache.WriteQueryOptions<T, V>;\n\ntype IClientStateFragmentDefault<T, V> = {\n type: 'fragment',\n} & Cache.WriteFragmentOptions<T, V>;\n\nexport type IClientStateDefault<T = unknown, V = unknown> = IClientStateFragmentDefault<T,V> | IClientStateQueryDefault<T,V>;\nexport interface IClientStateConfig {\n resolvers?: ResolverType; // don't need `Resolvers` type as it may conflict with the usage\n defaults?: IClientStateDefault[];\n typeDefs?: string | string[];\n possibleTypes?: PossibleTypesMap;\n typePolicies?: TypePolicies;\n // retries the request if function returns true\n retryLinkAttemptFuncs?: IRetryLinkAttemptFuncs;\n /**\n * @param preLinkFuncs all `apollo-link` that need to be composed before the network link. Should be a function.\n * @inheritdoc https://www.apollographql.com/docs/react/api/link/introduction/\n */\n preLinkFuncs?: ApolloLinkFunc[];\n /**\n * @param connectionParam To provide connectionParam to `WebSocketLink`. It takes a single `Object` or a `Function`.\n * @inheritdoc https://www.apollographql.com/docs/react/api/link/apollo-link-ws/\n */\n connectionParam?: ApolloConnectionParamFunc;\n /**\n * @param connectionCallback Accept only one function for all modules.\n * @inheritdoc\n */\n connectionCallbackFunc?: ApolloWSConnectionCallbackFunc;\n \n}\n\nexport interface IClientState {\n resolvers?: Resolvers; // don't need `Resolvers` type as it may conflict with the usage\n defaults: IClientStateDefault[];\n typeDefs?: string | string[];\n possibleTypes?: PossibleTypesMap;\n retryLinkAttemptFuncs?: IRetryLinkAttemptFuncs[];\n typePolicies?: TypePolicies,\n preLinks: ApolloLink[];\n connectionParams: ConnectionParams[];\n connectionCallbackFuncs?: IWSConnectionCallbackFunc[];\n}\n\n/**\n * ModuleShape have optional configuration to be implemented by all the feature modules\n * in the application.\n */\nexport interface IModuleShape {\n /**\n * @param envalidConfig envalid validators\n */\n readonly envalidConfig?: any;\n /**\n * @param link all `apollo-link` that need to be composed.\n * @inheritdoc https://github.com/apollographql/apollo-link\n * @deprecated use ClientStateParms.preLinkFuncs\n */\n readonly link?: any;\n /**\n * @param errorLink compose all errorLink\n * @inheritdoc https://github.com/apollographql/apollo-link/tree/master/packages/apollo-link-error\n */\n readonly errorLink?: ErrorLink | ErrorLink[];\n readonly createFetch?: any;\n /**\n * @param connectionParam method that called when a client connects to the socket.\n * @inheritdoc https://github.com/apollographql/subscriptions-transport-ws#constructorurl-options-connectioncallback\n * @deprecated use clientStateParams\n */\n readonly connectionParam?: any;\n /**\n * @param epic all `epics` that need to be composed.\n * @inheritdoc https://redux-observable.js.org/docs/basics/Epics.html\n */\n readonly epic?: any;\n /**\n * @param reducer Redux reducers list\n */\n readonly reducer?: ReducersMapObject | ReducersMapObject[];\n /**\n * @param clientStateParams Client side configuration of `apollo-client`\n * @inheritdoc https://github.com/apollographql/apollo-client/tree/2d65da133c156f6d808e64aee7e7fd5f7cc71d7f\n */\n readonly clientStateParams?: IClientStateConfig | IClientStateConfig[];\n /**\n * @param dataIdFromObject A function that returns an object identifier given an particular result\n * object.\n * @inheritdoc https://github.com/apollographql/apollo-client/tree/ed66999bac40226abfeada8d6c83b454636bb4b0/packages/apollo-cache-inmemory#configuration\n */\n readonly dataIdFromObject?: { [key: string]: (value: any) => string } | { [key: string]: (value: any) => string }[] | IdGetterObj;\n /**\n * @param createContainerFunc Synchronous Container Modules of inversify.\n * @inheritdoc https://github.com/inversify/InversifyJS/blob/master/wiki/container_modules.md\n */\n readonly createContainerFunc?: Function | Function[];\n /**\n * @param createServiceFunc Services\n */\n readonly createServiceFunc?: Function | Function[];\n readonly sidebarSegments?: any;\n readonly routerFactory?: any;\n /**\n * @param route Route list\n */\n readonly route?: any;\n /**\n * @param navItem Top left navigation links\n */\n readonly navItem?: any;\n /**\n * @param navItemRightTop right navigation links\n */\n readonly navItemRight?: any;\n /**\n * @param rootComponentFactory Root component factory list\n */\n readonly rootComponentFactory?: any;\n /**\n * @param dataRootComponent Data root React elements list (data root elements wraps data fetching react subtree root)\n */\n readonly dataRootComponent?: any;\n readonly createFetchOptions?: any;\n /**\n * @param stylesInsert URL list to 3rd party css scripts\n */\n readonly stylesInsert?: any;\n /**\n * @param scriptsInsert URL list to 3rd party js scripts\n */\n readonly scriptsInsert?: any;\n /**\n * @deprecated\n */\n readonly catalogInfo?: any;\n /**\n * @deprecated\n */\n readonly languagesFuncs?: any;\n /**\n * @param leftMainPanelItems Components that will be placed left panel.\n */\n readonly leftMainPanelItems?: any;\n /**\n * @param middleMainPanelItems Components that will be placed middle center panel\n */\n readonly middleMainPanelItems?: any;\n /**\n * @param middleMainPanelItemsProps Props of the component that will be placed middle center panel\n */\n readonly middleMainPanelItemsProps?: any;\n /**\n * @param leftFooterItems Components that will be placed left footer panel\n */\n readonly leftFooterItems?: any;\n /**\n * @param rightFooterItems Components that will be placed right footer panel\n */\n readonly rightFooterItems?: any;\n /**\n * @param middleLowerPanelItems Components that will be placed below middle panel\n */\n readonly middleLowerPanelItems?: any;\n\n readonly reduxPersistTransforms?: any[];\n\n}\n\n\n/**\n * Feature module methods\n */\nexport interface IFeature extends IModuleShape {\n // Public variables\n readonly data: any[];\n\n /**\n * @returns envalidConfig of all features\n */\n readonly envalidConfigs: any[];\n\n /**\n * @returns Redux-Observable Epics\n */\n readonly epics;\n\n readonly getRouter;\n /**\n * @returns client-side React route components list\n */\n readonly getRoutes;\n\n /**\n * @returns client-side top left navbar link component list\n */\n readonly navItems;\n /**\n * @returns client-side top right navbar link component list\n */\n readonly navItemsRight;\n /**\n * @returns Redux reducers\n */\n readonly reducers;\n\n readonly connectionParams;\n\n /**\n * @returns URL list to 3rd party css styles\n */\n readonly stylesInserts;\n /**\n * @returns URL list to 3rd party js styles\n */\n readonly scriptsInserts;\n\n readonly leftMainPanel;\n readonly middleMainPanel;\n readonly leftFooter;\n readonly rightFooter;\n readonly middleLowerPanel;\n readonly dataIdFromObject;\n\n /**\n * @param args Options to pass to each Container Module\n * @returns Created container and binds all the container modules\n */\n createContainers(args);\n\n\n createService(options, updateOptions);\n /**\n * @param args Provide resolverContext which can be passed to all resolver functions.\n * @returns IClientState\n */\n getStateParams(args?: { resolverContex?: any }): IClientState;\n\n getDataIdFromObject(result: {\n [key: string]: string | number;\n __typename?: string;\n } | IdGetterObj): any;\n /**\n * @arguments root React tree root component\n * @arguments req Http Request\n * @returns React tree root component wrapped up by root components exposed by this module\n */\n getWrappedRoot(root: any, req?: any): any;\n /**\n * @param root React tree data root component (first React root components which is used for fetching data)\n *\n * @returns React tree data root component wrapped up by data root components exposed by this module\n */\n getDataRoot(root: any): any;\n registerLanguages(monaco): void;\n}\n","export * from './connector';\n","export * from './logger';\n","import { ClientLogger } from '@cdm-logger/client';\n\nconst appName = (process.env && process.env.APP_NAME) || 'FullStack';\nconst logLevel = (process.env && process.env.LOG_LEVEL) || 'info';\nconst logger = ClientLogger.create(appName, { level: logLevel as any });\n\nexport { logger };\n","module.exports = require(\"@apollo/client\");","module.exports = require(\"@cdm-logger/client\");","module.exports = require(\"@common-stack/core\");","module.exports = require(\"inversify\");","module.exports = require(\"lodash\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/index.ts\");\n",""],"names":[],"sourceRoot":""}
|
|
@@ -3,7 +3,9 @@ import { interfaces } from 'inversify';
|
|
|
3
3
|
import { Cache } from '@apollo/client/cache';
|
|
4
4
|
import { ReducersMapObject } from 'redux';
|
|
5
5
|
import { ErrorLink } from '@apollo/client/link/error';
|
|
6
|
-
|
|
6
|
+
declare type ConnectionParams = {
|
|
7
|
+
[paramName: string]: any;
|
|
8
|
+
};
|
|
7
9
|
export declare type ResolverType = Resolvers | Resolvers[] | ((service: any) => Resolvers) | ((service: any) => Resolvers)[] | ((service: any) => any) | ((service: any) => any)[];
|
|
8
10
|
export declare type ApolloLinkFunc = (container: interfaces.Container) => ApolloLink;
|
|
9
11
|
export declare type ApolloConnectionParamFunc = ((container: interfaces.Container) => ConnectionParams) | ConnectionParams;
|
|
@@ -56,6 +58,10 @@ export interface IClientState {
|
|
|
56
58
|
* in the application.
|
|
57
59
|
*/
|
|
58
60
|
export interface IModuleShape {
|
|
61
|
+
/**
|
|
62
|
+
* @param envalidConfig envalid validators
|
|
63
|
+
*/
|
|
64
|
+
readonly envalidConfig?: any;
|
|
59
65
|
/**
|
|
60
66
|
* @param link all `apollo-link` that need to be composed.
|
|
61
67
|
* @inheritdoc https://github.com/apollographql/apollo-link
|
|
@@ -177,6 +183,10 @@ export interface IModuleShape {
|
|
|
177
183
|
*/
|
|
178
184
|
export interface IFeature extends IModuleShape {
|
|
179
185
|
readonly data: any[];
|
|
186
|
+
/**
|
|
187
|
+
* @returns envalidConfig of all features
|
|
188
|
+
*/
|
|
189
|
+
readonly envalidConfigs: any[];
|
|
180
190
|
/**
|
|
181
191
|
* @returns Redux-Observable Epics
|
|
182
192
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/client-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.31",
|
|
4
4
|
"description": "common core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@common-stack/core": "
|
|
41
|
+
"@common-stack/core": "0.2.30"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"typescript": {
|
|
51
51
|
"definition": "lib/index.d.ts"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "04bf975c14ed72fa9c22354f4e76248a0cb66d6d"
|
|
54
54
|
}
|