@memberjunction/global 3.3.0 → 4.0.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/dist/BaseSingleton.d.ts +2 -2
- package/dist/BaseSingleton.d.ts.map +1 -1
- package/dist/BaseSingleton.js +9 -13
- package/dist/BaseSingleton.js.map +1 -1
- package/dist/ClassFactory.d.ts +6 -6
- package/dist/ClassFactory.d.ts.map +1 -1
- package/dist/ClassFactory.js +31 -21
- package/dist/ClassFactory.js.map +1 -1
- package/dist/ClassUtils.js +9 -21
- package/dist/ClassUtils.js.map +1 -1
- package/dist/Core.d.ts +29 -0
- package/dist/Core.d.ts.map +1 -0
- package/dist/Core.js +58 -0
- package/dist/Core.js.map +1 -0
- package/dist/DeepDiff.js +4 -31
- package/dist/DeepDiff.js.map +1 -1
- package/dist/EncryptionUtils.js +6 -11
- package/dist/EncryptionUtils.js.map +1 -1
- package/dist/Global.d.ts +4 -4
- package/dist/Global.js +11 -15
- package/dist/Global.js.map +1 -1
- package/dist/JSONValidator.d.ts +1 -1
- package/dist/JSONValidator.d.ts.map +1 -1
- package/dist/JSONValidator.js +12 -15
- package/dist/JSONValidator.js.map +1 -1
- package/dist/ObjectCache.js +2 -7
- package/dist/ObjectCache.js.map +1 -1
- package/dist/RegisterClass.d.ts +1 -1
- package/dist/RegisterClass.d.ts.map +1 -1
- package/dist/RegisterClass.js +3 -7
- package/dist/RegisterClass.js.map +1 -1
- package/dist/SQLExpressionValidator.js +9 -13
- package/dist/SQLExpressionValidator.js.map +1 -1
- package/dist/SafeExpressionEvaluator.js +60 -64
- package/dist/SafeExpressionEvaluator.js.map +1 -1
- package/dist/ValidationTypes.js +4 -9
- package/dist/ValidationTypes.js.map +1 -1
- package/dist/generic/QueryCache.d.ts +85 -0
- package/dist/generic/QueryCache.d.ts.map +1 -0
- package/dist/generic/QueryCache.js +198 -0
- package/dist/generic/QueryCache.js.map +1 -0
- package/dist/generic/QueryCacheConfig.d.ts +72 -0
- package/dist/generic/QueryCacheConfig.d.ts.map +1 -0
- package/dist/generic/QueryCacheConfig.js +3 -0
- package/dist/generic/QueryCacheConfig.js.map +1 -0
- package/dist/generic/applicationInfo.d.ts +138 -0
- package/dist/generic/applicationInfo.d.ts.map +1 -0
- package/dist/generic/applicationInfo.js +177 -0
- package/dist/generic/applicationInfo.js.map +1 -0
- package/dist/generic/authEvaluator.d.ts +25 -0
- package/dist/generic/authEvaluator.d.ts.map +1 -0
- package/dist/generic/authEvaluator.js +49 -0
- package/dist/generic/authEvaluator.js.map +1 -0
- package/dist/generic/authTypes.d.ts +193 -0
- package/dist/generic/authTypes.d.ts.map +1 -0
- package/dist/generic/authTypes.js +19 -0
- package/dist/generic/authTypes.js.map +1 -0
- package/dist/generic/baseEngine.d.ts +260 -0
- package/dist/generic/baseEngine.d.ts.map +1 -0
- package/dist/generic/baseEngine.js +510 -0
- package/dist/generic/baseEngine.js.map +1 -0
- package/dist/generic/baseEntity.d.ts +691 -0
- package/dist/generic/baseEntity.d.ts.map +1 -0
- package/dist/generic/baseEntity.js +1688 -0
- package/dist/generic/baseEntity.js.map +1 -0
- package/dist/generic/baseInfo.d.ts +24 -0
- package/dist/generic/baseInfo.d.ts.map +1 -0
- package/dist/generic/baseInfo.js +53 -0
- package/dist/generic/baseInfo.js.map +1 -0
- package/dist/generic/compositeKey.d.ts +206 -0
- package/dist/generic/compositeKey.d.ts.map +1 -0
- package/dist/generic/compositeKey.js +412 -0
- package/dist/generic/compositeKey.js.map +1 -0
- package/dist/generic/databaseProviderBase.d.ts +46 -0
- package/dist/generic/databaseProviderBase.d.ts.map +1 -0
- package/dist/generic/databaseProviderBase.js +14 -0
- package/dist/generic/databaseProviderBase.js.map +1 -0
- package/dist/generic/entityInfo.d.ts +983 -0
- package/dist/generic/entityInfo.d.ts.map +1 -0
- package/dist/generic/entityInfo.js +1401 -0
- package/dist/generic/entityInfo.js.map +1 -0
- package/dist/generic/explorerNavigationItem.d.ts +20 -0
- package/dist/generic/explorerNavigationItem.d.ts.map +1 -0
- package/dist/generic/explorerNavigationItem.js +29 -0
- package/dist/generic/explorerNavigationItem.js.map +1 -0
- package/dist/generic/interfaces.d.ts +610 -0
- package/dist/generic/interfaces.d.ts.map +1 -0
- package/dist/generic/interfaces.js +211 -0
- package/dist/generic/interfaces.js.map +1 -0
- package/dist/generic/libraryInfo.d.ts +40 -0
- package/dist/generic/libraryInfo.d.ts.map +1 -0
- package/dist/generic/libraryInfo.js +56 -0
- package/dist/generic/libraryInfo.js.map +1 -0
- package/dist/generic/logging.d.ts +179 -0
- package/dist/generic/logging.d.ts.map +1 -0
- package/dist/generic/logging.js +382 -0
- package/dist/generic/logging.js.map +1 -0
- package/dist/generic/metadata.d.ts +305 -0
- package/dist/generic/metadata.d.ts.map +1 -0
- package/dist/generic/metadata.js +454 -0
- package/dist/generic/metadata.js.map +1 -0
- package/dist/generic/metadataUtil.d.ts +8 -0
- package/dist/generic/metadataUtil.d.ts.map +1 -0
- package/dist/generic/metadataUtil.js +36 -0
- package/dist/generic/metadataUtil.js.map +1 -0
- package/dist/generic/providerBase.d.ts +546 -0
- package/dist/generic/providerBase.d.ts.map +1 -0
- package/dist/generic/providerBase.js +999 -0
- package/dist/generic/providerBase.js.map +1 -0
- package/dist/generic/queryInfo.d.ts +460 -0
- package/dist/generic/queryInfo.d.ts.map +1 -0
- package/dist/generic/queryInfo.js +633 -0
- package/dist/generic/queryInfo.js.map +1 -0
- package/dist/generic/querySQLFilters.d.ts +54 -0
- package/dist/generic/querySQLFilters.d.ts.map +1 -0
- package/dist/generic/querySQLFilters.js +84 -0
- package/dist/generic/querySQLFilters.js.map +1 -0
- package/dist/generic/runQuery.d.ts +96 -0
- package/dist/generic/runQuery.d.ts.map +1 -0
- package/dist/generic/runQuery.js +66 -0
- package/dist/generic/runQuery.js.map +1 -0
- package/dist/generic/runQuerySQLFilterImplementations.d.ts +51 -0
- package/dist/generic/runQuerySQLFilterImplementations.d.ts.map +1 -0
- package/dist/generic/runQuerySQLFilterImplementations.js +238 -0
- package/dist/generic/runQuerySQLFilterImplementations.js.map +1 -0
- package/dist/generic/runReport.d.ts +25 -0
- package/dist/generic/runReport.d.ts.map +1 -0
- package/dist/generic/runReport.js +42 -0
- package/dist/generic/runReport.js.map +1 -0
- package/dist/generic/securityInfo.d.ts +355 -0
- package/dist/generic/securityInfo.d.ts.map +1 -0
- package/dist/generic/securityInfo.js +425 -0
- package/dist/generic/securityInfo.js.map +1 -0
- package/dist/generic/transactionGroup.d.ts +184 -0
- package/dist/generic/transactionGroup.d.ts.map +1 -0
- package/dist/generic/transactionGroup.js +357 -0
- package/dist/generic/transactionGroup.js.map +1 -0
- package/dist/generic/util.d.ts +81 -0
- package/dist/generic/util.d.ts.map +1 -0
- package/dist/generic/util.js +301 -0
- package/dist/generic/util.js.map +1 -0
- package/dist/index.d.ts +16 -16
- package/dist/index.js +16 -35
- package/dist/index.js.map +1 -1
- package/dist/interface.d.ts +2 -2
- package/dist/interface.d.ts.map +1 -1
- package/dist/interface.js +3 -8
- package/dist/interface.js.map +1 -1
- package/dist/util/PatternUtils.js +6 -15
- package/dist/util/PatternUtils.js.map +1 -1
- package/dist/util.d.ts +13 -5
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +36 -75
- package/dist/util.js.map +1 -1
- package/dist/views/runView.d.ts +150 -0
- package/dist/views/runView.d.ts.map +1 -0
- package/dist/views/runView.js +100 -0
- package/dist/views/runView.js.map +1 -0
- package/dist/views/viewInfo.d.ts +121 -0
- package/dist/views/viewInfo.d.ts.map +1 -0
- package/dist/views/viewInfo.js +182 -0
- package/dist/views/viewInfo.js.map +1 -0
- package/dist/warningManager.js +2 -6
- package/dist/warningManager.js.map +1 -1
- package/package.json +7 -6
package/dist/BaseSingleton.d.ts
CHANGED
|
@@ -17,12 +17,12 @@ export declare abstract class BaseSingleton<T> {
|
|
|
17
17
|
* @param className
|
|
18
18
|
* @returns
|
|
19
19
|
*/
|
|
20
|
-
protected static getInstance<T extends BaseSingleton<
|
|
20
|
+
protected static getInstance<T extends BaseSingleton<unknown>>(this: new () => T, className?: string): T;
|
|
21
21
|
/**
|
|
22
22
|
* The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared
|
|
23
23
|
* because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.
|
|
24
24
|
* @returns
|
|
25
25
|
*/
|
|
26
|
-
GetGlobalObjectStore():
|
|
26
|
+
GetGlobalObjectStore(): import("./util.js").GlobalObjectStore | null;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=BaseSingleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSingleton.d.ts","sourceRoot":"","sources":["../src/BaseSingleton.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,8BAAsB,aAAa,CAAC,CAAC;IACjC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAA4B;IAC3D,OAAO,CAAC,UAAU,CAAS;IAC3B,IAAW,SAAS,IAAI,MAAM,CAE7B;IACD,SAAS;IAcT;;;;;;;;OAQG;IACH,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,SAAS,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"BaseSingleton.d.ts","sourceRoot":"","sources":["../src/BaseSingleton.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,8BAAsB,aAAa,CAAC,CAAC;IACjC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAA4B;IAC3D,OAAO,CAAC,UAAU,CAAS;IAC3B,IAAW,SAAS,IAAI,MAAM,CAE7B;IACD,SAAS;IAcT;;;;;;;;OAQG;IACH,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC;IASxG;;;;OAIG;IACI,oBAAoB;CAG9B"}
|
package/dist/BaseSingleton.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseSingleton = void 0;
|
|
4
|
-
const _1 = require(".");
|
|
1
|
+
import { GetGlobalObjectStore } from "./index.js";
|
|
5
2
|
/**
|
|
6
3
|
* Generic, abstract base class for any scenario where we want to use a Singleton pattern. This base class abstracts away the complexity of ensuring a truly global
|
|
7
4
|
* singleton instance across multiple code paths in a deployed application. It uses a Global Object Store to ensure that only one instance of the class exists in the application even
|
|
8
5
|
* if the class has code imported into multiple execution paths (which is not optimal, of course, but can occur in some situations).
|
|
9
6
|
*/
|
|
10
|
-
class BaseSingleton {
|
|
7
|
+
export class BaseSingleton {
|
|
8
|
+
static { this._globalKeyPrefix = '___SINGLETON__'; }
|
|
11
9
|
get GlobalKey() {
|
|
12
10
|
return this._globalKey;
|
|
13
11
|
}
|
|
14
12
|
constructor() {
|
|
15
13
|
this._globalKey = BaseSingleton._globalKeyPrefix + this.constructor.name;
|
|
16
|
-
const g =
|
|
14
|
+
const g = GetGlobalObjectStore();
|
|
17
15
|
if (g && g[this.GlobalKey]) {
|
|
18
16
|
return g[this.GlobalKey];
|
|
19
17
|
}
|
|
@@ -32,12 +30,12 @@ class BaseSingleton {
|
|
|
32
30
|
* @returns
|
|
33
31
|
*/
|
|
34
32
|
static getInstance(className) {
|
|
35
|
-
const key = BaseSingleton._globalKeyPrefix + (className || this.name);
|
|
36
|
-
const g =
|
|
37
|
-
if (!g[key]) {
|
|
33
|
+
const key = BaseSingleton._globalKeyPrefix + (className || this.name);
|
|
34
|
+
const g = GetGlobalObjectStore();
|
|
35
|
+
if (g && !g[key]) {
|
|
38
36
|
g[key] = new this();
|
|
39
37
|
}
|
|
40
|
-
return g[key];
|
|
38
|
+
return g ? g[key] : new this();
|
|
41
39
|
}
|
|
42
40
|
/**
|
|
43
41
|
* The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared
|
|
@@ -45,9 +43,7 @@ class BaseSingleton {
|
|
|
45
43
|
* @returns
|
|
46
44
|
*/
|
|
47
45
|
GetGlobalObjectStore() {
|
|
48
|
-
return
|
|
46
|
+
return GetGlobalObjectStore();
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
|
-
exports.BaseSingleton = BaseSingleton;
|
|
52
|
-
BaseSingleton._globalKeyPrefix = '___SINGLETON__';
|
|
53
49
|
//# sourceMappingURL=BaseSingleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSingleton.js","sourceRoot":"","sources":["../src/BaseSingleton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseSingleton.js","sourceRoot":"","sources":["../src/BaseSingleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAEzC;;;;GAIG;AACH,MAAM,OAAgB,aAAa;aAChB,qBAAgB,GAAW,gBAAgB,CAAC;IAE3D,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IACD;QACI,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QACzE,MAAM,CAAC,GAAG,oBAAoB,EAAE,CAAC;QAEjC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAS,CAAC;QACrC,CAAC;QAED,0DAA0D;QAC1D,IAAI,CAAC,EAAE,CAAC;YACJ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;QAC7B,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACO,MAAM,CAAC,WAAW,CAAsD,SAAkB;QAChG,MAAM,GAAG,GAAG,aAAa,CAAC,gBAAgB,GAAG,CAAC,SAAS,IAAK,IAAoC,CAAC,IAAI,CAAC,CAAC;QACvG,MAAM,CAAC,GAAG,oBAAoB,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;YACf,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,CAAC;QACD,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,oBAAoB;QACvB,OAAO,oBAAoB,EAAE,CAAC;IAClC,CAAC"}
|
package/dist/ClassFactory.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class ClassRegistration {
|
|
|
12
12
|
BaseClass: any;
|
|
13
13
|
SubClass: any;
|
|
14
14
|
RootClass: any;
|
|
15
|
-
Key: string;
|
|
15
|
+
Key: string | null;
|
|
16
16
|
Priority: number;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
@@ -30,23 +30,23 @@ export declare class ClassFactory {
|
|
|
30
30
|
* @param skipNullKeyWarning If true, will not print a warning if the key is null or undefined. This is useful for cases where you know that the key is not needed and you don't want to see the warning in the console.
|
|
31
31
|
* @param autoRegisterWithRootClass If true (default), will automatically register the subclass with the root class of the baseClass hierarchy. This ensures proper priority ordering when multiple subclasses are registered in a hierarchy.
|
|
32
32
|
*/
|
|
33
|
-
Register(baseClass:
|
|
33
|
+
Register(baseClass: unknown, subClass: unknown, key?: string | null, priority?: number, skipNullKeyWarning?: boolean, autoRegisterWithRootClass?: boolean): void;
|
|
34
34
|
/**
|
|
35
35
|
* Creates an instance of the class registered for the given base class and key.
|
|
36
36
|
* If no registration is found, will return an instance of the base class.
|
|
37
37
|
*/
|
|
38
|
-
CreateInstance<T>(baseClass:
|
|
38
|
+
CreateInstance<T>(baseClass: unknown, key?: string | null, ...params: unknown[]): T | null;
|
|
39
39
|
/**
|
|
40
40
|
* Returns all registrations for a given base class and key. If key is not provided, will return all registrations for the base class.
|
|
41
41
|
* @param baseClass
|
|
42
42
|
* @param key
|
|
43
43
|
* @returns
|
|
44
44
|
*/
|
|
45
|
-
GetAllRegistrations(baseClass:
|
|
45
|
+
GetAllRegistrations(baseClass: unknown, key?: string | null): ClassRegistration[];
|
|
46
46
|
/**
|
|
47
47
|
* Returns the registration with the highest priority for a given base class and key. If key is not provided, will return the registration with the highest priority for the base class.
|
|
48
48
|
*/
|
|
49
|
-
GetRegistration(baseClass:
|
|
49
|
+
GetRegistration(baseClass: unknown, key?: string | null): ClassRegistration | null;
|
|
50
50
|
/**
|
|
51
51
|
* Returns all registrations that have the specified root class, regardless of what base class was used in the registration.
|
|
52
52
|
* This is useful for finding all registrations in a class hierarchy.
|
|
@@ -54,6 +54,6 @@ export declare class ClassFactory {
|
|
|
54
54
|
* @param key Optional key to filter results
|
|
55
55
|
* @returns Array of matching registrations
|
|
56
56
|
*/
|
|
57
|
-
GetRegistrationsByRootClass(rootClass:
|
|
57
|
+
GetRegistrationsByRootClass(rootClass: unknown, key?: string | null): ClassRegistration[];
|
|
58
58
|
}
|
|
59
59
|
//# sourceMappingURL=ClassFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassFactory.d.ts","sourceRoot":"","sources":["../src/ClassFactory.ts"],"names":[],"mappings":"AAAA;;;;;;wGAMwG;
|
|
1
|
+
{"version":3,"file":"ClassFactory.d.ts","sourceRoot":"","sources":["../src/ClassFactory.ts"],"names":[],"mappings":"AAAA;;;;;;wGAMwG;AASxG;;GAEG;AACH,qBAAa,iBAAiB;IAE1B,SAAS,EAAE,GAAG,CAAC;IAEf,QAAQ,EAAE,GAAG,CAAC;IAEd,SAAS,EAAE,GAAG,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE1B,QAAQ,EAAE,MAAM,CAAK;CACxB;AAGD;;;GAGG;AACH,qBAAa,YAAY;IACrB,OAAO,CAAC,cAAc,CAA2B;IAEjD;;;;;;;;OAQG;IACI,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,GAAE,MAAM,GAAG,IAAW,EAAE,QAAQ,GAAE,MAAU,EAAE,kBAAkB,GAAE,OAAe,EAAE,yBAAyB,GAAE,OAAc,GAAG,IAAI;IAwD7L;;;OAGG;IACI,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,GAAE,MAAM,GAAG,IAAW,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,IAAI;IAuBvG;;;;;OAKG;IACI,mBAAmB,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,iBAAiB,EAAE;IAaxF;;OAEG;IACI,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,iBAAiB,GAAG,IAAI;IAoBzF;;;;;;OAMG;IACI,2BAA2B,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,iBAAiB,EAAE;CAWnG"}
|
package/dist/ClassFactory.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*******************************************************************************************************
|
|
3
2
|
* MJ Global Class Factory handles both the registration and instantiation of any class that we need to create across any MJ Project
|
|
4
3
|
*
|
|
@@ -6,20 +5,22 @@
|
|
|
6
5
|
* instantiate whatever class we need. This allows any module at any time to register their new class for a given base class as a sub-class
|
|
7
6
|
* and we will dynamically instantiate that sub-class from that point forward
|
|
8
7
|
******************************************************************************************************/
|
|
9
|
-
|
|
10
|
-
exports.ClassFactory = exports.ClassRegistration = void 0;
|
|
11
|
-
const ClassUtils_1 = require("./ClassUtils");
|
|
8
|
+
import { GetRootClass } from './ClassUtils.js';
|
|
12
9
|
/**
|
|
13
10
|
* Data structure to track the class registrations
|
|
14
11
|
*/
|
|
15
|
-
class ClassRegistration {
|
|
12
|
+
export class ClassRegistration {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.Key = null; // used to identify a special attribute that we use to determine if this is the right sub-class. For example, in the case of BaseEntity and Entity object subclasses we'll have a LOT of entries
|
|
15
|
+
// in the registration list, so we'll use the key to identify which sub-class to use for a given entity
|
|
16
|
+
this.Priority = 0; // if there are multiple entries for a given combination of baseClass and subClass and key, we will use the priority to determine which one to use. The higher the number, the higher the priority
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
|
-
exports.ClassRegistration = ClassRegistration;
|
|
18
19
|
/**
|
|
19
20
|
* ClassFactory is used to register and create instances of classes. It is a singleton class that can be used to register a sub-class for a given base class and key. Do NOT directly attempt to instantiate this class,
|
|
20
21
|
* instead use the static Instance property of the MJGlobal class to get the instance of the ClassFactory for your application.
|
|
21
22
|
*/
|
|
22
|
-
class ClassFactory {
|
|
23
|
+
export class ClassFactory {
|
|
23
24
|
constructor() {
|
|
24
25
|
this._registrations = [];
|
|
25
26
|
}
|
|
@@ -34,16 +35,20 @@ class ClassFactory {
|
|
|
34
35
|
*/
|
|
35
36
|
Register(baseClass, subClass, key = null, priority = 0, skipNullKeyWarning = false, autoRegisterWithRootClass = true) {
|
|
36
37
|
if (baseClass && subClass) {
|
|
38
|
+
const baseClassName = baseClass.name;
|
|
39
|
+
const subClassName = subClass.name;
|
|
37
40
|
if (key === undefined || key === null && !skipNullKeyWarning) {
|
|
38
|
-
console.warn(`ClassFactory.GetAllRegistrations: Registration for base class ${
|
|
41
|
+
console.warn(`ClassFactory.GetAllRegistrations: Registration for base class ${baseClassName} has no key set. This is not recommended and may lead to unintended behavior when trying to match registrations. Please set a key for this registration.`);
|
|
39
42
|
}
|
|
40
43
|
// Get the root class for this registration
|
|
41
|
-
const rootClass =
|
|
44
|
+
const rootClass = GetRootClass(baseClass);
|
|
45
|
+
const rootClassName = rootClass.name;
|
|
42
46
|
// Determine which class to actually register against
|
|
43
47
|
const effectiveBaseClass = autoRegisterWithRootClass ? rootClass : baseClass;
|
|
48
|
+
const effectiveBaseClassName = effectiveBaseClass.name;
|
|
44
49
|
// Log if we're auto-registering with root class
|
|
45
50
|
if (autoRegisterWithRootClass && effectiveBaseClass !== baseClass) {
|
|
46
|
-
console.info(`ClassFactory.Register: Auto-registering ${
|
|
51
|
+
console.info(`ClassFactory.Register: Auto-registering ${subClassName} with root class ${rootClassName} instead of ${baseClassName}`);
|
|
47
52
|
}
|
|
48
53
|
// get all of the existing registrations for the effective base class and key
|
|
49
54
|
const registrations = this.GetAllRegistrations(effectiveBaseClass, key);
|
|
@@ -51,7 +56,7 @@ class ClassFactory {
|
|
|
51
56
|
// validate to make sure that the combination of base class and key for the provided priority # is not already registered, if it is, then print a warning
|
|
52
57
|
const existing = registrations.filter(r => r.Priority === priority);
|
|
53
58
|
if (existing && existing.length > 0) {
|
|
54
|
-
console.warn(`*** ClassFactory.Register: Registering class ${
|
|
59
|
+
console.warn(`*** ClassFactory.Register: Registering class ${subClassName} for base class ${effectiveBaseClassName} and key/priority ${key}/${priority}. ${existing.length} registrations already exist for that combination. While this is allowed it is not desired and when matching class requests occur, we will simply use the LAST registration we happen to have which can lead to unintended behavior. ***`);
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
62
|
else if (priority === 0 || priority === null || priority === undefined) {
|
|
@@ -83,16 +88,18 @@ class ClassFactory {
|
|
|
83
88
|
if (baseClass) {
|
|
84
89
|
let reg = this.GetRegistration(baseClass, key);
|
|
85
90
|
if (reg) {
|
|
91
|
+
const SubClassConstructor = reg.SubClass;
|
|
86
92
|
let instance = null;
|
|
87
93
|
if (params !== undefined)
|
|
88
|
-
instance = new
|
|
94
|
+
instance = new SubClassConstructor(...params);
|
|
89
95
|
else
|
|
90
|
-
instance = new
|
|
96
|
+
instance = new SubClassConstructor(); // dont pass in anything if we got undefined for that parameter into our function because it is different to call a function with no params than to pass in a single null/undefined param
|
|
91
97
|
return instance;
|
|
92
98
|
}
|
|
93
99
|
else {
|
|
94
100
|
// this is a normal condition to use the base class if we can't find a registration
|
|
95
|
-
|
|
101
|
+
const BaseClassConstructor = baseClass;
|
|
102
|
+
return new BaseClassConstructor(...params); // if we can't find a registration, just return a new instance of the base class
|
|
96
103
|
}
|
|
97
104
|
}
|
|
98
105
|
return null;
|
|
@@ -103,20 +110,22 @@ class ClassFactory {
|
|
|
103
110
|
* @param key
|
|
104
111
|
* @returns
|
|
105
112
|
*/
|
|
106
|
-
GetAllRegistrations(baseClass, key
|
|
113
|
+
GetAllRegistrations(baseClass, key) {
|
|
107
114
|
if (baseClass) {
|
|
108
115
|
return this._registrations.filter(r => {
|
|
109
|
-
|
|
116
|
+
const baseClassName = baseClass.name;
|
|
117
|
+
const regBaseClassName = r.BaseClass.name;
|
|
118
|
+
return regBaseClassName === baseClassName && // we use the name of the class instead of the class itself because JS is finicky about this since a given module can be loaded in various places (like from multiple other modules) and the class itself will be different in each case
|
|
110
119
|
(key === undefined || key === null ? true : r.Key?.trim().toLowerCase() === key.trim().toLowerCase());
|
|
111
120
|
});
|
|
112
121
|
}
|
|
113
122
|
else
|
|
114
|
-
return
|
|
123
|
+
return [];
|
|
115
124
|
}
|
|
116
125
|
/**
|
|
117
126
|
* Returns the registration with the highest priority for a given base class and key. If key is not provided, will return the registration with the highest priority for the base class.
|
|
118
127
|
*/
|
|
119
|
-
GetRegistration(baseClass, key
|
|
128
|
+
GetRegistration(baseClass, key) {
|
|
120
129
|
let matches = this.GetAllRegistrations(baseClass, key);
|
|
121
130
|
if (matches && matches.length > 0) {
|
|
122
131
|
// figure out the highest priority for all the matching registrations
|
|
@@ -139,15 +148,16 @@ class ClassFactory {
|
|
|
139
148
|
* @param key Optional key to filter results
|
|
140
149
|
* @returns Array of matching registrations
|
|
141
150
|
*/
|
|
142
|
-
GetRegistrationsByRootClass(rootClass, key
|
|
151
|
+
GetRegistrationsByRootClass(rootClass, key) {
|
|
143
152
|
if (rootClass) {
|
|
153
|
+
const rootClassName = rootClass.name;
|
|
144
154
|
return this._registrations.filter(r => {
|
|
145
|
-
|
|
155
|
+
const regRootClassName = r.RootClass?.name;
|
|
156
|
+
return regRootClassName === rootClassName &&
|
|
146
157
|
(key === undefined || key === null ? true : r.Key?.trim().toLowerCase() === key.trim().toLowerCase());
|
|
147
158
|
});
|
|
148
159
|
}
|
|
149
160
|
return [];
|
|
150
161
|
}
|
|
151
162
|
}
|
|
152
|
-
exports.ClassFactory = ClassFactory;
|
|
153
163
|
//# sourceMappingURL=ClassFactory.js.map
|
package/dist/ClassFactory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassFactory.js","sourceRoot":"","sources":["../src/ClassFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClassFactory.js","sourceRoot":"","sources":["../src/ClassFactory.ts"],"names":[],"mappings":"AAAA;;;;;;wGAMwG;AAExG,OAAO,EAAE,YAAY,EAAe,MAAM,cAAc,CAAC;AAOzD;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QAOI,QAAG,GAAkB,IAAI,CAAC,CAAC,gMAAgM;QAC/M,uGAAuG;QACnH,aAAQ,GAAW,CAAC,CAAC,CAAC,kMAAkM;IAC5N,CAAC;CAAA;AAGD;;;GAGG;AACH,MAAM,OAAO,YAAY;IAAzB;QACY,mBAAc,GAAwB,EAAE,CAAC;IA0JrD,CAAC;IAxJG;;;;;;;;OAQG;IACI,QAAQ,CAAC,SAAkB,EAAE,QAAiB,EAAE,MAAqB,IAAI,EAAE,WAAmB,CAAC,EAAE,qBAA8B,KAAK,EAAE,4BAAqC,IAAI;QAClL,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC;YACxB,MAAM,aAAa,GAAI,SAAwB,CAAC,IAAI,CAAC;YACrD,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O,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,eAAe;oBACrC,eAAe,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YAC9C,CAAC;YAED,sEAAsE;YACtE,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,eAAe,CAAC,CAAC;YAEpE,4JAA4J;YAC5J,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;;;OAMG;IACI,2BAA2B,CAAC,SAAkB,EAAE,GAAmB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,MAAM,aAAa,GAAI,SAA8B,CAAC,IAAI,CAAC;YAC3D,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;gBAClC,MAAM,gBAAgB,GAAI,CAAC,CAAC,SAA+B,EAAE,IAAI,CAAC;gBAClE,OAAO,gBAAgB,KAAK,aAAa;oBAClC,CAAC,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;YAChH,CAAC,CAAC,CAAC;QACP,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;CACJ"}
|
package/dist/ClassUtils.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Utility functions for working with class hierarchies and reflection
|
|
4
3
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GetClassName = exports.IsClassConstructor = exports.GetFullClassHierarchy = exports.GetClassInheritance = exports.IsDescendantClassOf = exports.IsRootClass = exports.IsSubclassOf = exports.GetRootClass = exports.GetSuperclass = void 0;
|
|
7
4
|
/**
|
|
8
5
|
* Gets the immediate superclass of the given class
|
|
9
6
|
* @param ClassRef The class constructor reference
|
|
10
7
|
* @returns The superclass constructor or null if no superclass
|
|
11
8
|
*/
|
|
12
|
-
function GetSuperclass(ClassRef) {
|
|
9
|
+
export function GetSuperclass(ClassRef) {
|
|
13
10
|
if (!ClassRef || typeof ClassRef !== 'function') {
|
|
14
11
|
return null;
|
|
15
12
|
}
|
|
@@ -20,13 +17,12 @@ function GetSuperclass(ClassRef) {
|
|
|
20
17
|
}
|
|
21
18
|
return superclass;
|
|
22
19
|
}
|
|
23
|
-
exports.GetSuperclass = GetSuperclass;
|
|
24
20
|
/**
|
|
25
21
|
* Gets the root class in the inheritance chain (the topmost user-defined class)
|
|
26
22
|
* @param ClassRef The class constructor reference
|
|
27
23
|
* @returns The root class constructor
|
|
28
24
|
*/
|
|
29
|
-
function GetRootClass(ClassRef) {
|
|
25
|
+
export function GetRootClass(ClassRef) {
|
|
30
26
|
if (!ClassRef || typeof ClassRef !== 'function') {
|
|
31
27
|
return ClassRef;
|
|
32
28
|
}
|
|
@@ -43,7 +39,6 @@ function GetRootClass(ClassRef) {
|
|
|
43
39
|
}
|
|
44
40
|
return previous;
|
|
45
41
|
}
|
|
46
|
-
exports.GetRootClass = GetRootClass;
|
|
47
42
|
/**
|
|
48
43
|
* Checks if a class is a subclass of another class (at any level in the inheritance hierarchy)
|
|
49
44
|
* Note: This checks the entire inheritance chain, not just the immediate parent
|
|
@@ -51,7 +46,7 @@ exports.GetRootClass = GetRootClass;
|
|
|
51
46
|
* @param PotentialAncestor The potential ancestor class constructor
|
|
52
47
|
* @returns True if PotentialSubclass inherits from PotentialAncestor at any level
|
|
53
48
|
*/
|
|
54
|
-
function IsSubclassOf(PotentialSubclass, PotentialAncestor) {
|
|
49
|
+
export function IsSubclassOf(PotentialSubclass, PotentialAncestor) {
|
|
55
50
|
if (!PotentialSubclass || !PotentialAncestor ||
|
|
56
51
|
typeof PotentialSubclass !== 'function' ||
|
|
57
52
|
typeof PotentialAncestor !== 'function') {
|
|
@@ -75,13 +70,12 @@ function IsSubclassOf(PotentialSubclass, PotentialAncestor) {
|
|
|
75
70
|
}
|
|
76
71
|
return false;
|
|
77
72
|
}
|
|
78
|
-
exports.IsSubclassOf = IsSubclassOf;
|
|
79
73
|
/**
|
|
80
74
|
* Checks if a class is a root class (has no user-defined superclass)
|
|
81
75
|
* @param ClassRef The class constructor reference
|
|
82
76
|
* @returns True if the class has no superclass
|
|
83
77
|
*/
|
|
84
|
-
function IsRootClass(ClassRef) {
|
|
78
|
+
export function IsRootClass(ClassRef) {
|
|
85
79
|
if (!ClassRef || typeof ClassRef !== 'function') {
|
|
86
80
|
return false;
|
|
87
81
|
}
|
|
@@ -91,7 +85,6 @@ function IsRootClass(ClassRef) {
|
|
|
91
85
|
superclass === Function.prototype ||
|
|
92
86
|
superclass.constructor === Function;
|
|
93
87
|
}
|
|
94
|
-
exports.IsRootClass = IsRootClass;
|
|
95
88
|
/**
|
|
96
89
|
* Checks if a class is a descendant of another class (at any level in the hierarchy)
|
|
97
90
|
* This is an alias for IsSubclassOf with a more descriptive name
|
|
@@ -99,16 +92,15 @@ exports.IsRootClass = IsRootClass;
|
|
|
99
92
|
* @param PotentialAncestor The potential ancestor class constructor
|
|
100
93
|
* @returns True if PotentialDescendant inherits from PotentialAncestor at any level
|
|
101
94
|
*/
|
|
102
|
-
function IsDescendantClassOf(PotentialDescendant, PotentialAncestor) {
|
|
95
|
+
export function IsDescendantClassOf(PotentialDescendant, PotentialAncestor) {
|
|
103
96
|
return IsSubclassOf(PotentialDescendant, PotentialAncestor);
|
|
104
97
|
}
|
|
105
|
-
exports.IsDescendantClassOf = IsDescendantClassOf;
|
|
106
98
|
/**
|
|
107
99
|
* Gets the complete inheritance chain for a class
|
|
108
100
|
* @param ClassRef The class constructor reference
|
|
109
101
|
* @returns Array of ClassInfo objects, ordered from immediate superclass to root
|
|
110
102
|
*/
|
|
111
|
-
function GetClassInheritance(ClassRef) {
|
|
103
|
+
export function GetClassInheritance(ClassRef) {
|
|
112
104
|
const chain = [];
|
|
113
105
|
if (!ClassRef || typeof ClassRef !== 'function') {
|
|
114
106
|
return chain;
|
|
@@ -127,13 +119,12 @@ function GetClassInheritance(ClassRef) {
|
|
|
127
119
|
}
|
|
128
120
|
return chain;
|
|
129
121
|
}
|
|
130
|
-
exports.GetClassInheritance = GetClassInheritance;
|
|
131
122
|
/**
|
|
132
123
|
* Gets the complete class hierarchy including the class itself
|
|
133
124
|
* @param ClassRef The class constructor reference
|
|
134
125
|
* @returns Array of ClassInfo objects, ordered from the class itself up to root
|
|
135
126
|
*/
|
|
136
|
-
function GetFullClassHierarchy(ClassRef) {
|
|
127
|
+
export function GetFullClassHierarchy(ClassRef) {
|
|
137
128
|
const chain = [];
|
|
138
129
|
if (!ClassRef || typeof ClassRef !== 'function') {
|
|
139
130
|
return chain;
|
|
@@ -152,13 +143,12 @@ function GetFullClassHierarchy(ClassRef) {
|
|
|
152
143
|
}
|
|
153
144
|
return chain;
|
|
154
145
|
}
|
|
155
|
-
exports.GetFullClassHierarchy = GetFullClassHierarchy;
|
|
156
146
|
/**
|
|
157
147
|
* Checks if a value is a class constructor (not an instance)
|
|
158
148
|
* @param value The value to check
|
|
159
149
|
* @returns True if the value is a class constructor
|
|
160
150
|
*/
|
|
161
|
-
function IsClassConstructor(value) {
|
|
151
|
+
export function IsClassConstructor(value) {
|
|
162
152
|
if (typeof value !== 'function') {
|
|
163
153
|
return false;
|
|
164
154
|
}
|
|
@@ -176,13 +166,12 @@ function IsClassConstructor(value) {
|
|
|
176
166
|
}
|
|
177
167
|
return false;
|
|
178
168
|
}
|
|
179
|
-
exports.IsClassConstructor = IsClassConstructor;
|
|
180
169
|
/**
|
|
181
170
|
* Gets the class name safely, handling minification and anonymous classes
|
|
182
171
|
* @param ClassRef The class constructor reference
|
|
183
172
|
* @returns The class name or a fallback string
|
|
184
173
|
*/
|
|
185
|
-
function GetClassName(ClassRef) {
|
|
174
|
+
export function GetClassName(ClassRef) {
|
|
186
175
|
if (!ClassRef || typeof ClassRef !== 'function') {
|
|
187
176
|
return 'Unknown';
|
|
188
177
|
}
|
|
@@ -198,5 +187,4 @@ function GetClassName(ClassRef) {
|
|
|
198
187
|
}
|
|
199
188
|
return 'Anonymous';
|
|
200
189
|
}
|
|
201
|
-
exports.GetClassName = GetClassName;
|
|
202
190
|
//# sourceMappingURL=ClassUtils.js.map
|
package/dist/ClassUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassUtils.js","sourceRoot":"","sources":["../src/ClassUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClassUtils.js","sourceRoot":"","sources":["../src/ClassUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,QAAa;IACvC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAEnD,8CAA8C;IAC9C,IAAI,CAAC,UAAU,IAAI,UAAU,KAAK,QAAQ,CAAC,SAAS,IAAI,UAAU,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QAC1F,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,QAAa;IACtC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,IAAI,OAAO,GAAG,QAAQ,CAAC;IACvB,IAAI,QAAQ,GAAG,QAAQ,CAAC;IAExB,OAAO,OAAO,EAA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AAE,CAAC;QAChB,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,6CAA6C;IAC7C,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC/C,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,WAAW,CAAC;AACvB,CAAC"}
|
package/dist/Core.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './generic/metadata.js';
|
|
2
|
+
export * from './generic/baseInfo.js';
|
|
3
|
+
export * from './generic/baseEngine.js';
|
|
4
|
+
export * from './views/runView.js';
|
|
5
|
+
export * from './generic/runReport.js';
|
|
6
|
+
export * from './generic/runQuery.js';
|
|
7
|
+
export * from './generic/interfaces.js';
|
|
8
|
+
export * from './generic/baseEntity.js';
|
|
9
|
+
export * from './generic/applicationInfo.js';
|
|
10
|
+
export * from './generic/providerBase.js';
|
|
11
|
+
export * from './generic/entityInfo.js';
|
|
12
|
+
export * from './generic/securityInfo.js';
|
|
13
|
+
export * from './generic/transactionGroup.js';
|
|
14
|
+
export * from './generic/util.js';
|
|
15
|
+
export * from './generic/logging.js';
|
|
16
|
+
export * from './generic/queryInfo.js';
|
|
17
|
+
export * from './generic/querySQLFilters.js';
|
|
18
|
+
export * from './generic/runQuerySQLFilterImplementations.js';
|
|
19
|
+
export * from './generic/libraryInfo.js';
|
|
20
|
+
export * from './generic/QueryCacheConfig.js';
|
|
21
|
+
export * from './generic/QueryCache.js';
|
|
22
|
+
export * from './generic/explorerNavigationItem.js';
|
|
23
|
+
export * from './generic/compositeKey.js';
|
|
24
|
+
export * from './generic/authEvaluator.js';
|
|
25
|
+
export * from './generic/metadataUtil.js';
|
|
26
|
+
export * from './generic/authTypes.js';
|
|
27
|
+
export * from './generic/databaseProviderBase.js';
|
|
28
|
+
export declare function SetProvider(provider: any): void;
|
|
29
|
+
//# sourceMappingURL=Core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Core.d.ts","sourceRoot":"","sources":["../src/Core.ts"],"names":[],"mappings":"AAMA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,gCAAgC,CAAC;AAE/C,wBAAgB,WAAW,CAAC,QAAQ,KAAA,QAMnC"}
|
package/dist/Core.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.SetProvider = void 0;
|
|
18
|
+
const baseEntity_1 = require("./generic/baseEntity.js");
|
|
19
|
+
const metadata_1 = require("./generic/metadata.js");
|
|
20
|
+
const runQuery_1 = require("./generic/runQuery.js");
|
|
21
|
+
const runReport_1 = require("./generic/runReport.js");
|
|
22
|
+
const runView_1 = require("./views/runView.js");
|
|
23
|
+
__exportStar(require("./generic/metadata.js"), exports);
|
|
24
|
+
__exportStar(require("./generic/baseInfo.js"), exports);
|
|
25
|
+
__exportStar(require("./generic/baseEngine.js"), exports);
|
|
26
|
+
__exportStar(require("./views/runView.js"), exports);
|
|
27
|
+
__exportStar(require("./generic/runReport.js"), exports);
|
|
28
|
+
__exportStar(require("./generic/runQuery.js"), exports);
|
|
29
|
+
__exportStar(require("./generic/interfaces.js"), exports);
|
|
30
|
+
__exportStar(require("./generic/baseEntity.js"), exports);
|
|
31
|
+
__exportStar(require("./generic/applicationInfo.js"), exports);
|
|
32
|
+
__exportStar(require("./generic/providerBase.js"), exports);
|
|
33
|
+
__exportStar(require("./generic/entityInfo.js"), exports);
|
|
34
|
+
__exportStar(require("./generic/securityInfo.js"), exports);
|
|
35
|
+
__exportStar(require("./generic/transactionGroup.js"), exports);
|
|
36
|
+
__exportStar(require("./generic/util.js"), exports);
|
|
37
|
+
__exportStar(require("./generic/logging.js"), exports);
|
|
38
|
+
__exportStar(require("./generic/queryInfo.js"), exports);
|
|
39
|
+
__exportStar(require("./generic/querySQLFilters.js"), exports);
|
|
40
|
+
__exportStar(require("./generic/runQuerySQLFilterImplementations.js"), exports);
|
|
41
|
+
__exportStar(require("./generic/libraryInfo.js"), exports);
|
|
42
|
+
__exportStar(require("./generic/QueryCacheConfig.js"), exports);
|
|
43
|
+
__exportStar(require("./generic/QueryCache.js"), exports);
|
|
44
|
+
__exportStar(require("./generic/explorerNavigationItem.js"), exports);
|
|
45
|
+
__exportStar(require("./generic/compositeKey.js"), exports);
|
|
46
|
+
__exportStar(require("./generic/authEvaluator.js"), exports);
|
|
47
|
+
__exportStar(require("./generic/metadataUtil.js"), exports);
|
|
48
|
+
__exportStar(require("./generic/authTypes.js"), exports);
|
|
49
|
+
__exportStar(require("./generic/databaseProviderBase.js"), exports);
|
|
50
|
+
function SetProvider(provider) {
|
|
51
|
+
metadata_1.Metadata.Provider = provider;
|
|
52
|
+
baseEntity_1.BaseEntity.Provider = provider;
|
|
53
|
+
runView_1.RunView.Provider = provider;
|
|
54
|
+
runReport_1.RunReport.Provider = provider;
|
|
55
|
+
runQuery_1.RunQuery.Provider = provider;
|
|
56
|
+
}
|
|
57
|
+
exports.SetProvider = SetProvider;
|
|
58
|
+
//# sourceMappingURL=Core.js.map
|
package/dist/Core.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Core.js","sourceRoot":"","sources":["../src/Core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAkD;AAClD,iDAA8C;AAC9C,iDAA8C;AAC9C,mDAAgD;AAChD,6CAA0C;AAE1C,qDAAmC;AACnC,qDAAmC;AACnC,uDAAqC;AACrC,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,uDAAqC;AACrC,uDAAqC;AACrC,4DAA0C;AAC1C,yDAAuC;AACvC,uDAAqC;AACrC,yDAAuC;AACvC,6DAA2C;AAC3C,iDAA+B;AAC/B,oDAAkC;AAClC,sDAAoC;AACpC,4DAA0C;AAC1C,6EAA2D;AAC3D,wDAAsC;AACtC,6DAA2C;AAC3C,uDAAqC;AACrC,mEAAiD;AACjD,yDAAuC;AACvC,0DAAwC;AACxC,yDAAuC;AACvC,sDAAoC;AAEpC,iEAA+C;AAE/C,SAAgB,WAAW,CAAC,QAAQ;IAClC,mBAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,uBAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,iBAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC5B,qBAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC9B,mBAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC/B,CAAC;AAND,kCAMC"}
|
package/dist/DeepDiff.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @fileoverview Deep difference comparison utility for JavaScript objects
|
|
4
3
|
*
|
|
@@ -50,36 +49,11 @@
|
|
|
50
49
|
* // newProp: shows as Added
|
|
51
50
|
* ```
|
|
52
51
|
*/
|
|
53
|
-
|
|
54
|
-
if (k2 === undefined) k2 = k;
|
|
55
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
56
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
57
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
58
|
-
}
|
|
59
|
-
Object.defineProperty(o, k2, desc);
|
|
60
|
-
}) : (function(o, m, k, k2) {
|
|
61
|
-
if (k2 === undefined) k2 = k;
|
|
62
|
-
o[k2] = m[k];
|
|
63
|
-
}));
|
|
64
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
65
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
66
|
-
}) : function(o, v) {
|
|
67
|
-
o["default"] = v;
|
|
68
|
-
});
|
|
69
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
70
|
-
if (mod && mod.__esModule) return mod;
|
|
71
|
-
var result = {};
|
|
72
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
73
|
-
__setModuleDefault(result, mod);
|
|
74
|
-
return result;
|
|
75
|
-
};
|
|
76
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
|
-
exports.DeepDiffer = exports.DiffChangeType = void 0;
|
|
78
|
-
const _ = __importStar(require("lodash"));
|
|
52
|
+
import _ from 'lodash';
|
|
79
53
|
/**
|
|
80
54
|
* Types of changes that can occur in a deep diff operation
|
|
81
55
|
*/
|
|
82
|
-
var DiffChangeType;
|
|
56
|
+
export var DiffChangeType;
|
|
83
57
|
(function (DiffChangeType) {
|
|
84
58
|
/** A new property or value was added */
|
|
85
59
|
DiffChangeType["Added"] = "added";
|
|
@@ -89,14 +63,14 @@ var DiffChangeType;
|
|
|
89
63
|
DiffChangeType["Modified"] = "modified";
|
|
90
64
|
/** No change detected (only included when includeUnchanged is true) */
|
|
91
65
|
DiffChangeType["Unchanged"] = "unchanged";
|
|
92
|
-
})(DiffChangeType || (
|
|
66
|
+
})(DiffChangeType || (DiffChangeType = {}));
|
|
93
67
|
/**
|
|
94
68
|
* Deep difference generator for comparing JavaScript objects, arrays, and primitives.
|
|
95
69
|
*
|
|
96
70
|
* This class provides comprehensive comparison capabilities with configurable
|
|
97
71
|
* output formatting and depth control.
|
|
98
72
|
*/
|
|
99
|
-
class DeepDiffer {
|
|
73
|
+
export class DeepDiffer {
|
|
100
74
|
/**
|
|
101
75
|
* Creates a new DeepDiffer instance
|
|
102
76
|
* @param config - Optional configuration overrides
|
|
@@ -366,5 +340,4 @@ class DeepDiffer {
|
|
|
366
340
|
return lines.join('\n');
|
|
367
341
|
}
|
|
368
342
|
}
|
|
369
|
-
exports.DeepDiffer = DeepDiffer;
|
|
370
343
|
//# sourceMappingURL=DeepDiff.js.map
|