@common-stack/core 8.0.1-alpha.0 → 8.2.1-alpha.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.
package/LICENSE CHANGED
@@ -1,21 +1,34 @@
1
- The MIT License
2
-
3
- Copyright (c) 2017 CDMBase LLC.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ PROPRIETARY LICENSE
2
+
3
+ Copyright (c) 2017-2025 CDMBase LLC. All Rights Reserved.
4
+
5
+ This software and associated documentation files (the "Software") are the
6
+ proprietary and confidential information of CDMBase LLC ("Confidential Information").
7
+
8
+ NOTICE: All information contained herein is, and remains the property of
9
+ CDMBase LLC. The intellectual and technical concepts contained herein are
10
+ proprietary to CDMBase LLC and may be covered by U.S. and Foreign Patents,
11
+ patents in process, and are protected by trade secret or copyright law.
12
+
13
+ Dissemination of this information or reproduction of this material is strictly
14
+ forbidden unless prior written permission is obtained from CDMBase LLC.
15
+
16
+ NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL
17
+ PROPERTY RIGHTS ARE GRANTED BY THIS DOCUMENT.
18
+
19
+ RESTRICTIONS:
20
+ 1. You may NOT use, copy, modify, merge, publish, distribute, sublicense,
21
+ and/or sell copies of the Software without explicit written permission
22
+ from CDMBase LLC.
23
+ 2. You may NOT reverse engineer, decompile, or disassemble the Software.
24
+ 3. You may NOT remove or alter any proprietary notices or labels on the Software.
25
+ 4. The Software is licensed, not sold.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
30
+ CDMBASE LLC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
31
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
+
34
+ For licensing inquiries, please contact: legal@cdmbase.com
@@ -4,3 +4,4 @@ export * from './rollupRouteGenerated';
4
4
  export * from './routeJson';
5
5
  export * from './viteSettings';
6
6
  export * from './wrapperRouteOptions';
7
+ export * from './routeMobileAdditions';
@@ -1,3 +1,4 @@
1
+ import { IPermissionsFlattenedKeys } from 'common';
1
2
  export declare enum IMenuPosition {
2
3
  Logo = "LOGO",
3
4
  Upper = "UPPER",
@@ -70,7 +71,7 @@ export interface IMenuDataItem {
70
71
  /**
71
72
  * @name permissions to determine whether to render menu or not
72
73
  */
73
- authority?: string[];
74
+ authority?: IPermissionsFlattenedKeys[];
74
75
  /**
75
76
  * @name priority of the menu to display in the order. Lower values shows first.
76
77
  */
@@ -79,5 +80,20 @@ export interface IMenuDataItem {
79
80
  * The path displayed by the menuItem's tooltip
80
81
  */
81
82
  tooltip?: string;
83
+ /**
84
+ * @name System Type
85
+ * @description Determines visibility based on user role - 'system' for admin only, 'user' for common users and owners
86
+ */
87
+ systemType?: 'system' | 'user';
88
+ /**
89
+ * @name Category
90
+ * @description Main category for hierarchical organization (e.g., 'communication', 'administration', 'business', 'content')
91
+ */
92
+ category?: string;
93
+ /**
94
+ * @name Sub Category
95
+ * @description Sub-category for more granular organization (e.g., 'email', 'chat' under 'communication')
96
+ */
97
+ subCategory?: string;
82
98
  [key: string]: any;
83
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","sources":["../../../src/component/interfaces/menu.ts"],"sourcesContent":[null],"names":[],"mappings":"IAAY,cAMX;AAND,CAAA,UAAY,aAAa,EAAA;AACrB,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACrB,CAAC,EANW,aAAa,KAAb,aAAa,GAMxB,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"menu.js","sources":["../../../src/component/interfaces/menu.ts"],"sourcesContent":[null],"names":[],"mappings":"IACY,cAMX;AAND,CAAA,UAAY,aAAa,EAAA;AACrB,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACrB,CAAC,EANW,aAAa,KAAb,aAAa,GAMxB,EAAA,CAAA,CAAA"}
@@ -14,7 +14,7 @@ export interface IRouteModule extends IMenuDataItem, IGeneratedWrapperOptions {
14
14
  * @name Path
15
15
  * @description The path of the route.
16
16
  */
17
- path?: string;
17
+ path: string;
18
18
  /**
19
19
  * @name Index Route
20
20
  * @description Indicates if this is an index route.
@@ -47,7 +47,7 @@ export interface IRouteModule extends IMenuDataItem, IGeneratedWrapperOptions {
47
47
  * @description Dynamic import of the Dialog component for modal routes.
48
48
  */
49
49
  dialog?: () => Promise<{
50
- default: LazyExoticComponent<ComponentType<any>>;
50
+ default: LazyExoticComponent<ComponentType<any>> | ComponentType<any>;
51
51
  }>;
52
52
  /**
53
53
  * @name Nested Routes
@@ -88,7 +88,7 @@ export interface IRouteModule extends IMenuDataItem, IGeneratedWrapperOptions {
88
88
  * @name Authentication Requirement
89
89
  * @description Indicates if authentication is required for the route.
90
90
  */
91
- auth?: boolean;
91
+ auth?: boolean | 'optional';
92
92
  /**
93
93
  * @name Props
94
94
  * @description Extra properties for the route, including initial parameters and UI options.
@@ -163,6 +163,21 @@ export interface IRouteModule extends IMenuDataItem, IGeneratedWrapperOptions {
163
163
  * @description Key for the previous step in a multi-step process, such as onboarding.
164
164
  */
165
165
  prev?: string;
166
+ /**
167
+ * @name System Type
168
+ * @description Determines visibility based on user role - 'system' for admin only, 'user' for common users and owners
169
+ */
170
+ systemType?: 'system' | 'user';
171
+ /**
172
+ * @name Category
173
+ * @description Main category for hierarchical organization (e.g., 'communication', 'administration', 'business', 'content')
174
+ */
175
+ category?: string;
176
+ /**
177
+ * @name Sub Category
178
+ * @description Sub-category for more granular organization (e.g., 'email', 'chat' under 'communication')
179
+ */
180
+ subCategory?: string;
166
181
  /**
167
182
  * @name Additional Properties
168
183
  * @description Allows additional properties to be added as needed.
@@ -1,9 +1,15 @@
1
1
  import { IRollupBuildGenerated } from './rollupRouteGenerated';
2
2
  import { IRouteModule } from './routeCompute';
3
+ /**
4
+ * @name IBaseRouteMap
5
+ * @description Base interface for route mapping that can be shared across platforms
6
+ */
7
+ export interface IBaseRouteMap<T = unknown, R = IRouteModule> {
8
+ [key: string]: R & T;
9
+ }
10
+ export type IRouteMap<T = unknown> = IBaseRouteMap<T, Omit<IRouteModule, 'path'> & Partial<Pick<IRouteModule, 'path'>>>;
3
11
  /**
4
12
  * @name IComputedRoutesArray
5
13
  * @description Represents an array of route objects, each containing dynamic keys mapped to route configurations. This is the `routes.json` file generated from rollup build
6
14
  */
7
- export type IComputedRoutesArray = Array<{
8
- [key: string]: IRouteModule & IRollupBuildGenerated;
9
- }>;
15
+ export type IComputedRoutesArray = Array<IRouteMap<IRollupBuildGenerated>>;
@@ -0,0 +1,50 @@
1
+ import { IRouteModule as IBaseRouteModule } from './routeCompute';
2
+ export interface IReactNavigationProps {
3
+ initialParams?: Record<string, any>;
4
+ initialRouteName?: string;
5
+ component?: React.ComponentType<any> | React.ReactNode;
6
+ unauthenticatedComponent?: React.ComponentType<any> | React.ReactNode;
7
+ options?: {
8
+ headerShown?: boolean;
9
+ headerTitle?: string;
10
+ tabBarLabel?: string;
11
+ tabBarIcon?: string | ((props: {
12
+ color: string;
13
+ }) => JSX.Element);
14
+ tabBarActiveTintColor?: string;
15
+ tabBarInactiveTintColor?: string;
16
+ drawerIcon?: string;
17
+ drawerStyle?: Record<string, any>;
18
+ gestureEnabled?: boolean;
19
+ swipeEnabled?: boolean;
20
+ title?: string;
21
+ };
22
+ screenOptions?: ((options: any) => Record<string, any>) | Record<string, any>;
23
+ drawerContent?: (props: any) => JSX.Element;
24
+ tabBar?: (props: any) => JSX.Element;
25
+ }
26
+ /**
27
+ * Interface extending IRouteModule with mobile-specific navigation properties
28
+ */
29
+ export interface IRouteMobileAdditions extends IBaseRouteModule {
30
+ /**
31
+ * @name Container
32
+ * @description Navigation container function (Stack, Drawer, or BottomTab navigator)
33
+ */
34
+ container?: any;
35
+ /**
36
+ * @name Route Name
37
+ * @description Name of the route for navigation
38
+ */
39
+ name?: string;
40
+ /**
41
+ * @name Navigation Props
42
+ * @description Extended props specific to mobile navigation
43
+ */
44
+ props?: IReactNavigationProps;
45
+ /**
46
+ * @name With Life Cycle Interaction
47
+ * @description Whether to enable life cycle interaction
48
+ */
49
+ withLifeCycleInteraction?: any;
50
+ }
@@ -42,4 +42,28 @@ export interface IViteSettings {
42
42
  * @default: false
43
43
  */
44
44
  _useFutureCommonPackage?: boolean;
45
+ /**
46
+ * @name overrideRoutes Configuration
47
+ * @description Override routes by replacing old routes with new routes.
48
+ * Can be specified as a single mapping object or an array of mappings.
49
+ * @example
50
+ * // Single mapping
51
+ * overrideRoutes: {
52
+ * oldRoute: '/0/:routeToReplace',
53
+ * newRoute: '/',
54
+ * }
55
+ *
56
+ * // Multiple mappings
57
+ * overrideRoutes: [
58
+ * { oldRoute: '/0/:routeToReplace', newRoute: '/' },
59
+ * { oldRoute: '/nested/path', newRoute: '/simple' }
60
+ * ]
61
+ */
62
+ overrideRoutes?: {
63
+ oldRoute: string;
64
+ newRoute: string;
65
+ } | Array<{
66
+ oldRoute: string;
67
+ newRoute: string;
68
+ }>;
45
69
  }
@@ -1,3 +1,4 @@
1
+ import { ContributionExtensionName, ContributionSchemaId, IPermissionsFlattenedKeys, IConfigurationsFlattenedKeys } from 'common';
1
2
  import { IAuthorityConfig } from './authority';
2
3
  import { IRollupBuildGenerated } from './rollupRouteGenerated';
3
4
  import { IViteSettings } from './viteSettings';
@@ -38,6 +39,16 @@ export interface IResourceParams {
38
39
  * @description Path related to the resource.
39
40
  */
40
41
  path?: string;
42
+ /**
43
+ * @name Extension Name
44
+ * @description Name of the extension for resource identification in dataLoader.
45
+ */
46
+ extensionName?: ContributionExtensionName;
47
+ /**
48
+ * @name Schema ID
49
+ * @description Schema identifier for configuration and preferences input.
50
+ */
51
+ schemaId?: ContributionSchemaId;
41
52
  isExternal?: boolean;
42
53
  organization?: string;
43
54
  resourceGroup?: string;
@@ -68,7 +79,7 @@ export interface IGeneratedWrapperOptions {
68
79
  * @name Authority
69
80
  * @description List of permissions required to access the route.
70
81
  */
71
- authority?: string[];
82
+ authority?: IPermissionsFlattenedKeys[];
72
83
  /**
73
84
  * @name Additional Parameters
74
85
  * @description Additional parameters for resource configuration.
@@ -77,19 +88,20 @@ export interface IGeneratedWrapperOptions {
77
88
  /**
78
89
  * @name Resource Parameters
79
90
  * @description Parameters specific to resource handling.
91
+ * Can be a single IResourceParams object or an array of IResourceParams objects.
80
92
  */
81
- resourceParams?: IResourceParams;
93
+ resourceParams?: IResourceParams | IResourceParams[];
82
94
  };
83
95
  /**
84
96
  * @name Configurations
85
97
  * @description Configuration keys related to the route.
86
98
  */
87
- configurations?: string[];
99
+ configurations?: IConfigurationsFlattenedKeys[] | ['*'];
88
100
  /**
89
101
  * @name Extra Permissions
90
102
  * @description Additional permissions required for the UI.
91
103
  */
92
- extraPermissions?: string[];
104
+ extraPermissions?: IPermissionsFlattenedKeys[] | ['*'];
93
105
  /**
94
106
  * @name Resource Endpoint
95
107
  * @description Designates the route as a resource endpoint.
@@ -124,15 +136,25 @@ export interface IGeneratedWrapperOptions {
124
136
  * @name Extra Links
125
137
  * @description Additional links for the route.
126
138
  */
127
- extraLink?: any[];
139
+ extraLinks?: any[];
128
140
  /**
129
141
  * @name Authority Configuration
130
142
  * @description Configuration for authority and permission checks.
131
143
  */
132
144
  authorityConfig?: IAuthorityConfig;
145
+ /**
146
+ * @name Extension Name
147
+ * @description Name of the extension for resource identification in dataLoader.
148
+ */
149
+ extensionName?: string;
150
+ /**
151
+ * @name Schema ID
152
+ * @description Schema identifier for configuration and preferences input.
153
+ */
154
+ schemaId?: string;
133
155
  /**
134
156
  * @name _useFutureCommonPackage Configuration
135
- * @description Whether the package is using common package or not
157
+ * @description Whether the package is using `common` package or not
136
158
  * @default: false
137
159
  */
138
160
  _useFutureCommonPackage?: boolean;
@@ -4,6 +4,8 @@ export declare const CommonType: {
4
4
  HEMERA: string;
5
5
  MOLECULER_BROKER: string;
6
6
  PUBSUB: string;
7
+ REDIS_CLIENT: symbol;
8
+ INNGEST_CLIENT: string;
7
9
  };
8
10
  export declare const TaggedType: {
9
11
  MICROSERVICE: string;
@@ -4,6 +4,8 @@ const CommonType = {
4
4
  HEMERA: 'HEMERA',
5
5
  MOLECULER_BROKER: 'MOLECULER_BROKER',
6
6
  PUBSUB: 'PUBSUB',
7
+ REDIS_CLIENT: Symbol.for('REDIS_CLIENT'),
8
+ INNGEST_CLIENT: 'INNGEST_CLIENT',
7
9
  };
8
10
  const TaggedType = {
9
11
  MICROSERVICE: 'MICROSERVICE',
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../src/constants/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AACa,MAAA,UAAU,GAAG;AACtB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,MAAM,EAAE,QAAQ;EACnB;AAEY,MAAA,UAAU,GAAG;AACtB,IAAA,YAAY,EAAE,cAAc;EAC/B;AAEY,MAAA,WAAW,GAAG;;AAEvB,IAAA,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;AAC5B,IAAA,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;AACxC,IAAA,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;AACpC,IAAA,mBAAmB,EAAE,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;AACtD,IAAA,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;AAC1C,IAAA,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;EAC1C;AAEW,MAAA,aAAa,GAAG;AACzB,IAAA,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;AACpC,IAAA,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC;AACtC,IAAA,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;"}
1
+ {"version":3,"file":"types.js","sources":["../../src/constants/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAa,MAAA,UAAU,GAAG;AACtB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;AACxC,IAAA,cAAc,EAAE,gBAAgB;EAClC;AAEW,MAAA,UAAU,GAAG;AACtB,IAAA,YAAY,EAAE,cAAc;EAC9B;AAEW,MAAA,WAAW,GAAG;;AAEvB,IAAA,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;AAC5B,IAAA,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;AACxC,IAAA,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;AACpC,IAAA,mBAAmB,EAAE,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;AACtD,IAAA,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;AAC1C,IAAA,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;EAC1C;AAEW,MAAA,aAAa,GAAG;AACzB,IAAA,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;AACpC,IAAA,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC;AACtC,IAAA,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;"}
package/lib/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './field-error';
2
2
  export * from './interfaces';
3
3
  export * from './constants';
4
4
  export * from './utils';
5
+ export * from './component';
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export{FieldError}from'./field-error.js';export{ClientTypes,CommonType,ElectronTypes,TaggedType}from'./constants/types.js';export{getEnvironment}from'./utils/getEnvironment.js';export{getGlobalVariable,setGlobalVariable}from'./utils/globalVariable.js';//# sourceMappingURL=index.js.map
1
+ export{FieldError}from'./field-error.js';export{ClientTypes,CommonType,ElectronTypes,TaggedType}from'./constants/types.js';export{getEnvironment}from'./utils/getEnvironment.js';export{getGlobalVariable,setGlobalVariable}from'./utils/globalVariable.js';export{IMenuPosition}from'./component/interfaces/menu.js';//# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@common-stack/core",
3
- "version": "8.0.1-alpha.0",
3
+ "version": "8.2.1-alpha.0",
4
4
  "description": "Common core for higher packages to depend on",
5
- "license": "ISC",
5
+ "license": "UNLICENSED",
6
6
  "author": "CDMBase LLC",
7
7
  "type": "module",
8
8
  "main": "lib/index.js",
@@ -20,11 +20,14 @@
20
20
  "test:watch": "npm test -- --watch",
21
21
  "watch": "yarn build:lib:watch"
22
22
  },
23
+ "devDependencies": {
24
+ "common": "8.2.1-alpha.0"
25
+ },
23
26
  "publishConfig": {
24
27
  "access": "public"
25
28
  },
26
29
  "typescript": {
27
30
  "definition": "lib/index.d.ts"
28
31
  },
29
- "gitHead": "73d9088ae254fbc43425eed5c9f5cd95bd66e921"
32
+ "gitHead": "b46db06f987271c3a2e050f081e266d3a01b285b"
30
33
  }
@@ -1 +0,0 @@
1
- export{IMenuPosition}from'./component/interfaces/menu.js';//# sourceMappingURL=index.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.component.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}