@memberjunction/core-entities 2.90.0 → 2.92.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/engines/component-metadata.d.ts +20 -0
- package/dist/engines/component-metadata.d.ts.map +1 -0
- package/dist/engines/component-metadata.js +46 -0
- package/dist/engines/component-metadata.js.map +1 -0
- package/dist/generated/entity_subclasses.d.ts +28 -0
- package/dist/generated/entity_subclasses.d.ts.map +1 -1
- package/dist/generated/entity_subclasses.js +46 -0
- package/dist/generated/entity_subclasses.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseEngine, IMetadataProvider, UserInfo } from "@memberjunction/core";
|
|
2
|
+
import { ComponentEntityExtended } from "../custom/ComponentEntityExtended";
|
|
3
|
+
import { ComponentLibraryEntity, ComponentLibraryLinkEntity } from "../generated/entity_subclasses";
|
|
4
|
+
/**
|
|
5
|
+
* Caching of metadata for components and related data
|
|
6
|
+
*/
|
|
7
|
+
export declare class ComponentMetadataEngine extends BaseEngine<ComponentMetadataEngine> {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the global instance of the class. This is a singleton class, so there is only one instance of it in the application. Do not directly create new instances of it, always use this method to get the instance.
|
|
10
|
+
*/
|
|
11
|
+
static get Instance(): ComponentMetadataEngine;
|
|
12
|
+
private _components;
|
|
13
|
+
private _componentLibraries;
|
|
14
|
+
private _componentLibraryLinks;
|
|
15
|
+
Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
|
|
16
|
+
get Components(): ComponentEntityExtended[];
|
|
17
|
+
get ComponentLibraries(): ComponentLibraryEntity[];
|
|
18
|
+
get ComponentLibraryLinks(): ComponentLibraryLinkEntity[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=component-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-metadata.d.ts","sourceRoot":"","sources":["../../src/engines/component-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,iBAAiB,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAEpG;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,UAAU,CAAC,uBAAuB,CAAC;IAC5E;;OAEG;IACH,WAAkB,QAAQ,IAAI,uBAAuB,CAEpD;IAED,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,mBAAmB,CAA2B;IACtD,OAAO,CAAC,sBAAsB,CAA+B;IAEhD,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB;IAqBhG,IAAW,UAAU,IAAI,uBAAuB,EAAE,CAEjD;IAED,IAAW,kBAAkB,IAAI,sBAAsB,EAAE,CAExD;IAED,IAAW,qBAAqB,IAAI,0BAA0B,EAAE,CAE/D;CACJ"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentMetadataEngine = void 0;
|
|
4
|
+
const core_1 = require("@memberjunction/core");
|
|
5
|
+
/**
|
|
6
|
+
* Caching of metadata for components and related data
|
|
7
|
+
*/
|
|
8
|
+
class ComponentMetadataEngine extends core_1.BaseEngine {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the global instance of the class. This is a singleton class, so there is only one instance of it in the application. Do not directly create new instances of it, always use this method to get the instance.
|
|
11
|
+
*/
|
|
12
|
+
static get Instance() {
|
|
13
|
+
return super.getInstance();
|
|
14
|
+
}
|
|
15
|
+
async Config(forceRefresh, contextUser, provider) {
|
|
16
|
+
const c = [
|
|
17
|
+
{
|
|
18
|
+
Type: 'entity',
|
|
19
|
+
EntityName: 'MJ: Components',
|
|
20
|
+
PropertyName: "_components"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
Type: 'entity',
|
|
24
|
+
EntityName: 'MJ: Component Libraries',
|
|
25
|
+
PropertyName: "_componentLibraries"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
Type: 'entity',
|
|
29
|
+
EntityName: 'MJ: Component Library Links',
|
|
30
|
+
PropertyName: "_componentLibraryLinks"
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
await this.Load(c, provider, forceRefresh, contextUser);
|
|
34
|
+
}
|
|
35
|
+
get Components() {
|
|
36
|
+
return this._components;
|
|
37
|
+
}
|
|
38
|
+
get ComponentLibraries() {
|
|
39
|
+
return this._componentLibraries;
|
|
40
|
+
}
|
|
41
|
+
get ComponentLibraryLinks() {
|
|
42
|
+
return this._componentLibraryLinks;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.ComponentMetadataEngine = ComponentMetadataEngine;
|
|
46
|
+
//# sourceMappingURL=component-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-metadata.js","sourceRoot":"","sources":["../../src/engines/component-metadata.ts"],"names":[],"mappings":";;;AAAA,+CAAmH;AAInH;;GAEG;AACH,MAAa,uBAAwB,SAAQ,iBAAmC;IAC5E;;OAEG;IACI,MAAM,KAAK,QAAQ;QACvB,OAAO,KAAK,CAAC,WAAW,EAA2B,CAAC;IACvD,CAAC;IAMM,KAAK,CAAC,MAAM,CAAC,YAAsB,EAAE,WAAsB,EAAE,QAA4B;QAC5F,MAAM,CAAC,GAAwC;YAC3C;gBACI,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,gBAAgB;gBAC5B,YAAY,EAAE,aAAa;aAC9B;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,yBAAyB;gBACrC,YAAY,EAAE,qBAAqB;aACtC;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,6BAA6B;gBACzC,YAAY,EAAE,wBAAwB;aACzC;SACJ,CAAA;QACD,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAC5D,CAAC;IAED,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACpC,CAAC;IAED,IAAW,qBAAqB;QAC5B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;CACJ;AA5CD,0DA4CC"}
|
|
@@ -5850,30 +5850,36 @@ export declare const ComponentLibrarySchema: z.ZodObject<{
|
|
|
5850
5850
|
Description: z.ZodNullable<z.ZodString>;
|
|
5851
5851
|
__mj_CreatedAt: z.ZodDate;
|
|
5852
5852
|
__mj_UpdatedAt: z.ZodDate;
|
|
5853
|
+
Status: z.ZodUnion<[z.ZodLiteral<"Active">, z.ZodLiteral<"Deprecated">, z.ZodLiteral<"Disabled">]>;
|
|
5854
|
+
LintRules: z.ZodNullable<z.ZodString>;
|
|
5853
5855
|
}, "strip", z.ZodTypeAny, {
|
|
5854
5856
|
ID?: string;
|
|
5855
5857
|
__mj_CreatedAt?: Date;
|
|
5856
5858
|
__mj_UpdatedAt?: Date;
|
|
5857
5859
|
Name?: string;
|
|
5858
5860
|
Description?: string;
|
|
5861
|
+
Status?: "Disabled" | "Active" | "Deprecated";
|
|
5859
5862
|
Category?: "Other" | "Core" | "Runtime" | "UI" | "Charting" | "Utility";
|
|
5860
5863
|
DisplayName?: string;
|
|
5861
5864
|
Version?: string;
|
|
5862
5865
|
GlobalVariable?: string;
|
|
5863
5866
|
CDNUrl?: string;
|
|
5864
5867
|
CDNCssUrl?: string;
|
|
5868
|
+
LintRules?: string;
|
|
5865
5869
|
}, {
|
|
5866
5870
|
ID?: string;
|
|
5867
5871
|
__mj_CreatedAt?: Date;
|
|
5868
5872
|
__mj_UpdatedAt?: Date;
|
|
5869
5873
|
Name?: string;
|
|
5870
5874
|
Description?: string;
|
|
5875
|
+
Status?: "Disabled" | "Active" | "Deprecated";
|
|
5871
5876
|
Category?: "Other" | "Core" | "Runtime" | "UI" | "Charting" | "Utility";
|
|
5872
5877
|
DisplayName?: string;
|
|
5873
5878
|
Version?: string;
|
|
5874
5879
|
GlobalVariable?: string;
|
|
5875
5880
|
CDNUrl?: string;
|
|
5876
5881
|
CDNCssUrl?: string;
|
|
5882
|
+
LintRules?: string;
|
|
5877
5883
|
}>;
|
|
5878
5884
|
export type ComponentLibraryEntityType = z.infer<typeof ComponentLibrarySchema>;
|
|
5879
5885
|
/**
|
|
@@ -25325,6 +25331,28 @@ export declare class ComponentLibraryEntity extends BaseEntity<ComponentLibraryE
|
|
|
25325
25331
|
* * Default Value: getutcdate()
|
|
25326
25332
|
*/
|
|
25327
25333
|
get __mj_UpdatedAt(): Date;
|
|
25334
|
+
/**
|
|
25335
|
+
* * Field Name: Status
|
|
25336
|
+
* * Display Name: Status
|
|
25337
|
+
* * SQL Data Type: nvarchar(20)
|
|
25338
|
+
* * Default Value: Active
|
|
25339
|
+
* * Value List Type: List
|
|
25340
|
+
* * Possible Values
|
|
25341
|
+
* * Active
|
|
25342
|
+
* * Deprecated
|
|
25343
|
+
* * Disabled
|
|
25344
|
+
* * Description: Status of the component library. Active: fully supported; Deprecated: works but shows console warning; Disabled: throws error if used
|
|
25345
|
+
*/
|
|
25346
|
+
get Status(): 'Active' | 'Deprecated' | 'Disabled';
|
|
25347
|
+
set Status(value: 'Active' | 'Deprecated' | 'Disabled');
|
|
25348
|
+
/**
|
|
25349
|
+
* * Field Name: LintRules
|
|
25350
|
+
* * Display Name: Lint Rules
|
|
25351
|
+
* * SQL Data Type: nvarchar(MAX)
|
|
25352
|
+
* * Description: JSON configuration for library-specific lint rules that are applied during component validation. This field contains structured rules that define how components using this library should be validated, including DOM element requirements, initialization patterns, lifecycle methods, and common error patterns. Example structure: {"initialization": {"constructorName": "Chart", "elementType": "canvas"}, "lifecycle": {"requiredMethods": ["render"], "cleanupMethods": ["destroy"]}}. The linter dynamically applies these rules based on the libraries referenced in a component spec, enabling extensible validation without hardcoding library-specific logic.
|
|
25353
|
+
*/
|
|
25354
|
+
get LintRules(): string | null;
|
|
25355
|
+
set LintRules(value: string | null);
|
|
25328
25356
|
}
|
|
25329
25357
|
/**
|
|
25330
25358
|
* MJ: Component Library Links - strongly typed entity sub-class
|