@memberjunction/interactive-component-types 2.73.0 → 2.75.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/component-option.d.ts +3 -3
- package/dist/component-option.d.ts.map +1 -1
- package/dist/component-spec-runtime.d.ts +130 -0
- package/dist/component-spec-runtime.d.ts.map +1 -0
- package/dist/component-spec-runtime.js +218 -0
- package/dist/component-spec-runtime.js.map +1 -0
- package/dist/component-spec.d.ts +65 -0
- package/dist/component-spec.d.ts.map +1 -0
- package/dist/component-spec.js +11 -0
- package/dist/component-spec.js.map +1 -0
- package/dist/data-requirements.d.ts +76 -44
- package/dist/data-requirements.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/library-dependency.d.ts +23 -0
- package/dist/library-dependency.d.ts.map +1 -0
- package/dist/{root-spec.js → library-dependency.js} +1 -1
- package/dist/library-dependency.js.map +1 -0
- package/dist/util.d.ts +9 -10
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +27 -27
- package/dist/util.js.map +1 -1
- package/package.json +3 -3
- package/dist/child-spec.d.ts +0 -67
- package/dist/child-spec.d.ts.map +0 -1
- package/dist/child-spec.js +0 -3
- package/dist/child-spec.js.map +0 -1
- package/dist/root-spec.d.ts +0 -72
- package/dist/root-spec.d.ts.map +0 -1
- package/dist/root-spec.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentSpec } from "./component-spec";
|
|
2
2
|
/**
|
|
3
3
|
* Defines a given option for a generated component that the user can choose. The code/componentObjectName properties are used to render the component in the UI.
|
|
4
4
|
*/
|
|
5
5
|
export type ComponentOption = {
|
|
6
6
|
/**
|
|
7
|
-
* Full details of the generated component option including functional, technical, code, and
|
|
7
|
+
* Full details of the generated component option including functional, technical, code, dependencies and libraries
|
|
8
8
|
*/
|
|
9
|
-
option:
|
|
9
|
+
option: ComponentSpec;
|
|
10
10
|
/**
|
|
11
11
|
* If multiple component options are provided a "judge" AI will evaluate all the functional
|
|
12
12
|
* responses and will rank order them with an explanation of why they were each ranked that way. Rankings are not absolute, they are relative to the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-option.d.ts","sourceRoot":"","sources":["../src/component-option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"component-option.d.ts","sourceRoot":"","sources":["../src/component-option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;;;OAIG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;OAGG;IACH,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C,CAAA"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ComponentSpec } from "./component-spec";
|
|
2
|
+
import { ComponentEntitySimplePermission } from "./data-requirements";
|
|
3
|
+
import { ComponentLibraryDependency } from "./library-dependency";
|
|
4
|
+
import { UserInfo } from "@memberjunction/core";
|
|
5
|
+
/**
|
|
6
|
+
* Runtime extension of ComponentSpec that provides helper methods for permission checking,
|
|
7
|
+
* validation, and other runtime operations. This class is not included in AI prompts
|
|
8
|
+
* to keep token usage efficient.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ComponentSpecRuntime extends ComponentSpec {
|
|
11
|
+
/**
|
|
12
|
+
* Get all unique permissions required by this component across all entities.
|
|
13
|
+
* This aggregates permissions from all entity data requirements to provide
|
|
14
|
+
* a complete picture of what the component needs.
|
|
15
|
+
*
|
|
16
|
+
* @returns Array of unique permission types required by the component
|
|
17
|
+
*/
|
|
18
|
+
GetRequiredPermissions(): ComponentEntitySimplePermission[];
|
|
19
|
+
/**
|
|
20
|
+
* Check if the component only requires read permissions across all entities.
|
|
21
|
+
* This is useful for determining if a component is effectively read-only
|
|
22
|
+
* from a permissions perspective.
|
|
23
|
+
*
|
|
24
|
+
* @returns true if the component only requires 'read' permissions
|
|
25
|
+
*/
|
|
26
|
+
IsEffectivelyReadOnly(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get all entity names that this component accesses.
|
|
29
|
+
* Useful for pre-loading permissions or understanding component data dependencies.
|
|
30
|
+
*
|
|
31
|
+
* @returns Array of entity names accessed by the component
|
|
32
|
+
*/
|
|
33
|
+
GetAccessedEntities(): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Check if the component has any write capabilities (create, update, or delete).
|
|
36
|
+
* This helps determine if the component can modify data or is purely read-only.
|
|
37
|
+
*
|
|
38
|
+
* @returns true if the component requires any write permissions
|
|
39
|
+
*/
|
|
40
|
+
HasWriteCapabilities(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Convert component permission types to MemberJunction EntityPermissionType.
|
|
43
|
+
* This enables integration with MJ's permission system.
|
|
44
|
+
*
|
|
45
|
+
* @param permission - Component permission type
|
|
46
|
+
* @returns MemberJunction EntityPermissionType
|
|
47
|
+
*/
|
|
48
|
+
private convertToEntityPermissionType;
|
|
49
|
+
/**
|
|
50
|
+
* Validate that a user has all required permissions to use this component.
|
|
51
|
+
* This method checks each entity's permission requirements against the user's
|
|
52
|
+
* actual permissions in MemberJunction using the Metadata system.
|
|
53
|
+
*
|
|
54
|
+
* @param user - The MemberJunction UserInfo object
|
|
55
|
+
* @returns Validation result with details about any missing permissions
|
|
56
|
+
*/
|
|
57
|
+
ValidateUserPermissions(user: UserInfo): Promise<{
|
|
58
|
+
canRender: boolean;
|
|
59
|
+
missingPermissions: Array<{
|
|
60
|
+
entity: string;
|
|
61
|
+
permission: ComponentEntitySimplePermission;
|
|
62
|
+
}>;
|
|
63
|
+
degradedPermissions: Array<{
|
|
64
|
+
entity: string;
|
|
65
|
+
permission: ComponentEntitySimplePermission;
|
|
66
|
+
reason: string;
|
|
67
|
+
}>;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Get a summary of all data access patterns for this component.
|
|
71
|
+
* Useful for documentation and understanding component behavior.
|
|
72
|
+
*
|
|
73
|
+
* @returns Object describing all data access patterns
|
|
74
|
+
*/
|
|
75
|
+
GetDataAccessSummary(): {
|
|
76
|
+
mode: string;
|
|
77
|
+
entityCount: number;
|
|
78
|
+
queryCount: number;
|
|
79
|
+
requiresWrite: boolean;
|
|
80
|
+
entities: Array<{
|
|
81
|
+
name: string;
|
|
82
|
+
permissions: string[];
|
|
83
|
+
}>;
|
|
84
|
+
queries: Array<{
|
|
85
|
+
name: string;
|
|
86
|
+
category: string;
|
|
87
|
+
}>;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Create a ComponentSpecRuntime instance from a plain object.
|
|
91
|
+
* Useful when deserializing from JSON or database storage.
|
|
92
|
+
*
|
|
93
|
+
* @param obj - Plain object with ComponentSpec properties
|
|
94
|
+
* @returns New ComponentSpecRuntime instance
|
|
95
|
+
*/
|
|
96
|
+
static FromObject(obj: ComponentSpec): ComponentSpecRuntime;
|
|
97
|
+
/**
|
|
98
|
+
* Create a ComponentSpecRuntime instance from JSON string.
|
|
99
|
+
* Handles parsing and object conversion in one step.
|
|
100
|
+
*
|
|
101
|
+
* @param json - JSON string representation of a ComponentSpec
|
|
102
|
+
* @returns New ComponentSpecRuntime instance
|
|
103
|
+
*/
|
|
104
|
+
static FromJSON(json: string): ComponentSpecRuntime;
|
|
105
|
+
/**
|
|
106
|
+
* Get all external library dependencies for this component.
|
|
107
|
+
* Returns both the library names and their global variables.
|
|
108
|
+
*
|
|
109
|
+
* @returns Array of library dependencies with details
|
|
110
|
+
*/
|
|
111
|
+
GetLibraryDependencies(): ComponentLibraryDependency[];
|
|
112
|
+
/**
|
|
113
|
+
* Check if this component depends on a specific library.
|
|
114
|
+
* Can check by either library name or global variable.
|
|
115
|
+
*
|
|
116
|
+
* @param libraryNameOrGlobal - Library name or global variable to check
|
|
117
|
+
* @returns true if the component depends on the specified library
|
|
118
|
+
*/
|
|
119
|
+
DependsOnLibrary(libraryNameOrGlobal: string): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Get all component dependencies recursively.
|
|
122
|
+
* Traverses the entire dependency tree to return a flat list of all
|
|
123
|
+
* components this one depends on, directly or indirectly.
|
|
124
|
+
*
|
|
125
|
+
* @param visitedNames - Set of already visited component names (for cycle detection)
|
|
126
|
+
* @returns Array of all component dependencies
|
|
127
|
+
*/
|
|
128
|
+
GetAllDependencies(visitedNames?: Set<string>): ComponentSpec[];
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=component-spec-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-spec-runtime.d.ts","sourceRoot":"","sources":["../src/component-spec-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAwB,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAEhF;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACnD;;;;;;OAMG;IACI,sBAAsB,IAAI,+BAA+B,EAAE;IAUlE;;;;;;OAMG;IACI,qBAAqB,IAAI,OAAO;IAKvC;;;;;OAKG;IACI,mBAAmB,IAAI,MAAM,EAAE;IAItC;;;;;OAKG;IACI,oBAAoB,IAAI,OAAO;IAMtC;;;;;;OAMG;IACH,OAAO,CAAC,6BAA6B;IAUrC;;;;;;;OAOG;IACU,uBAAuB,CAChC,IAAI,EAAE,QAAQ,GACf,OAAO,CAAC;QACP,SAAS,EAAE,OAAO,CAAC;QACnB,kBAAkB,EAAE,KAAK,CAAC;YACtB,MAAM,EAAE,MAAM,CAAC;YACf,UAAU,EAAE,+BAA+B,CAAC;SAC/C,CAAC,CAAC;QACH,mBAAmB,EAAE,KAAK,CAAC;YACvB,MAAM,EAAE,MAAM,CAAC;YACf,UAAU,EAAE,+BAA+B,CAAC;YAC5C,MAAM,EAAE,MAAM,CAAC;SAClB,CAAC,CAAC;KACN,CAAC;IA8CF;;;;;OAKG;IACI,oBAAoB,IAAI;QAC3B,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,OAAO,CAAC;QACvB,QAAQ,EAAE,KAAK,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,EAAE,CAAA;SAAC,CAAC,CAAC;QACvD,OAAO,EAAE,KAAK,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAC,CAAC,CAAC;KACpD;IAqBD;;;;;;OAMG;WACW,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,oBAAoB;IAMlE;;;;;;OAMG;WACW,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB;IAK1D;;;;;OAKG;IACI,sBAAsB,IAAI,0BAA0B,EAAE;IAI7D;;;;;;OAMG;IACI,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,GAAG,OAAO;IAO7D;;;;;;;OAOG;IACI,kBAAkB,CAAC,YAAY,cAAoB,GAAG,aAAa,EAAE;CAqB/E"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentSpecRuntime = void 0;
|
|
4
|
+
const component_spec_1 = require("./component-spec");
|
|
5
|
+
const core_1 = require("@memberjunction/core");
|
|
6
|
+
/**
|
|
7
|
+
* Runtime extension of ComponentSpec that provides helper methods for permission checking,
|
|
8
|
+
* validation, and other runtime operations. This class is not included in AI prompts
|
|
9
|
+
* to keep token usage efficient.
|
|
10
|
+
*/
|
|
11
|
+
class ComponentSpecRuntime extends component_spec_1.ComponentSpec {
|
|
12
|
+
/**
|
|
13
|
+
* Get all unique permissions required by this component across all entities.
|
|
14
|
+
* This aggregates permissions from all entity data requirements to provide
|
|
15
|
+
* a complete picture of what the component needs.
|
|
16
|
+
*
|
|
17
|
+
* @returns Array of unique permission types required by the component
|
|
18
|
+
*/
|
|
19
|
+
GetRequiredPermissions() {
|
|
20
|
+
const permissions = new Set();
|
|
21
|
+
this.dataRequirements?.entities.forEach(entity => {
|
|
22
|
+
entity.permissionLevelNeeded.forEach(perm => permissions.add(perm));
|
|
23
|
+
});
|
|
24
|
+
return Array.from(permissions);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check if the component only requires read permissions across all entities.
|
|
28
|
+
* This is useful for determining if a component is effectively read-only
|
|
29
|
+
* from a permissions perspective.
|
|
30
|
+
*
|
|
31
|
+
* @returns true if the component only requires 'read' permissions
|
|
32
|
+
*/
|
|
33
|
+
IsEffectivelyReadOnly() {
|
|
34
|
+
const perms = this.GetRequiredPermissions();
|
|
35
|
+
return perms.length === 1 && perms[0] === 'read';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get all entity names that this component accesses.
|
|
39
|
+
* Useful for pre-loading permissions or understanding component data dependencies.
|
|
40
|
+
*
|
|
41
|
+
* @returns Array of entity names accessed by the component
|
|
42
|
+
*/
|
|
43
|
+
GetAccessedEntities() {
|
|
44
|
+
return this.dataRequirements?.entities.map(e => e.name) || [];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Check if the component has any write capabilities (create, update, or delete).
|
|
48
|
+
* This helps determine if the component can modify data or is purely read-only.
|
|
49
|
+
*
|
|
50
|
+
* @returns true if the component requires any write permissions
|
|
51
|
+
*/
|
|
52
|
+
HasWriteCapabilities() {
|
|
53
|
+
return this.GetRequiredPermissions().some(p => p === 'create' || p === 'update' || p === 'delete');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Convert component permission types to MemberJunction EntityPermissionType.
|
|
57
|
+
* This enables integration with MJ's permission system.
|
|
58
|
+
*
|
|
59
|
+
* @param permission - Component permission type
|
|
60
|
+
* @returns MemberJunction EntityPermissionType
|
|
61
|
+
*/
|
|
62
|
+
convertToEntityPermissionType(permission) {
|
|
63
|
+
switch (permission) {
|
|
64
|
+
case 'read': return core_1.EntityPermissionType.Read;
|
|
65
|
+
case 'create': return core_1.EntityPermissionType.Create;
|
|
66
|
+
case 'update': return core_1.EntityPermissionType.Update;
|
|
67
|
+
case 'delete': return core_1.EntityPermissionType.Delete;
|
|
68
|
+
default: return core_1.EntityPermissionType.Read; // Safe default
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Validate that a user has all required permissions to use this component.
|
|
73
|
+
* This method checks each entity's permission requirements against the user's
|
|
74
|
+
* actual permissions in MemberJunction using the Metadata system.
|
|
75
|
+
*
|
|
76
|
+
* @param user - The MemberJunction UserInfo object
|
|
77
|
+
* @returns Validation result with details about any missing permissions
|
|
78
|
+
*/
|
|
79
|
+
async ValidateUserPermissions(user) {
|
|
80
|
+
const missing = [];
|
|
81
|
+
const degraded = [];
|
|
82
|
+
// Get metadata instance to access entity information
|
|
83
|
+
const md = new core_1.Metadata();
|
|
84
|
+
// Check each entity's required permissions
|
|
85
|
+
for (const entityReq of this.dataRequirements?.entities || []) {
|
|
86
|
+
// Find the entity in the metadata
|
|
87
|
+
const entityInfo = md.Entities.find(e => e.Name === entityReq.name);
|
|
88
|
+
if (!entityInfo) {
|
|
89
|
+
// Entity not found - add to missing with special reason
|
|
90
|
+
for (const requiredPerm of entityReq.permissionLevelNeeded) {
|
|
91
|
+
missing.push({ entity: entityReq.name, permission: requiredPerm });
|
|
92
|
+
}
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
// Get user permissions for this entity
|
|
96
|
+
const userPerms = entityInfo.GetUserPermisions(user);
|
|
97
|
+
for (const requiredPerm of entityReq.permissionLevelNeeded) {
|
|
98
|
+
let hasPermission = false;
|
|
99
|
+
switch (requiredPerm) {
|
|
100
|
+
case 'read':
|
|
101
|
+
hasPermission = userPerms.CanRead;
|
|
102
|
+
break;
|
|
103
|
+
case 'create':
|
|
104
|
+
hasPermission = userPerms.CanCreate;
|
|
105
|
+
break;
|
|
106
|
+
case 'update':
|
|
107
|
+
hasPermission = userPerms.CanUpdate;
|
|
108
|
+
break;
|
|
109
|
+
case 'delete':
|
|
110
|
+
hasPermission = userPerms.CanDelete;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
if (!hasPermission) {
|
|
114
|
+
missing.push({ entity: entityReq.name, permission: requiredPerm });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
canRender: missing.length === 0,
|
|
120
|
+
missingPermissions: missing,
|
|
121
|
+
degradedPermissions: degraded
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get a summary of all data access patterns for this component.
|
|
126
|
+
* Useful for documentation and understanding component behavior.
|
|
127
|
+
*
|
|
128
|
+
* @returns Object describing all data access patterns
|
|
129
|
+
*/
|
|
130
|
+
GetDataAccessSummary() {
|
|
131
|
+
const entitySummary = this.dataRequirements?.entities.map(e => ({
|
|
132
|
+
name: e.name,
|
|
133
|
+
permissions: e.permissionLevelNeeded
|
|
134
|
+
})) || [];
|
|
135
|
+
const querySummary = this.dataRequirements?.queries.map(q => ({
|
|
136
|
+
name: q.name,
|
|
137
|
+
category: q.categoryPath
|
|
138
|
+
})) || [];
|
|
139
|
+
return {
|
|
140
|
+
mode: this.dataRequirements?.mode || 'none',
|
|
141
|
+
entityCount: entitySummary.length,
|
|
142
|
+
queryCount: querySummary.length,
|
|
143
|
+
requiresWrite: this.HasWriteCapabilities(),
|
|
144
|
+
entities: entitySummary,
|
|
145
|
+
queries: querySummary
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Create a ComponentSpecRuntime instance from a plain object.
|
|
150
|
+
* Useful when deserializing from JSON or database storage.
|
|
151
|
+
*
|
|
152
|
+
* @param obj - Plain object with ComponentSpec properties
|
|
153
|
+
* @returns New ComponentSpecRuntime instance
|
|
154
|
+
*/
|
|
155
|
+
static FromObject(obj) {
|
|
156
|
+
const instance = new ComponentSpecRuntime();
|
|
157
|
+
Object.assign(instance, obj);
|
|
158
|
+
return instance;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Create a ComponentSpecRuntime instance from JSON string.
|
|
162
|
+
* Handles parsing and object conversion in one step.
|
|
163
|
+
*
|
|
164
|
+
* @param json - JSON string representation of a ComponentSpec
|
|
165
|
+
* @returns New ComponentSpecRuntime instance
|
|
166
|
+
*/
|
|
167
|
+
static FromJSON(json) {
|
|
168
|
+
const obj = JSON.parse(json);
|
|
169
|
+
return ComponentSpecRuntime.FromObject(obj);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Get all external library dependencies for this component.
|
|
173
|
+
* Returns both the library names and their global variables.
|
|
174
|
+
*
|
|
175
|
+
* @returns Array of library dependencies with details
|
|
176
|
+
*/
|
|
177
|
+
GetLibraryDependencies() {
|
|
178
|
+
return this.libraries || [];
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Check if this component depends on a specific library.
|
|
182
|
+
* Can check by either library name or global variable.
|
|
183
|
+
*
|
|
184
|
+
* @param libraryNameOrGlobal - Library name or global variable to check
|
|
185
|
+
* @returns true if the component depends on the specified library
|
|
186
|
+
*/
|
|
187
|
+
DependsOnLibrary(libraryNameOrGlobal) {
|
|
188
|
+
return this.libraries?.some(lib => lib.name === libraryNameOrGlobal ||
|
|
189
|
+
lib.globalVariable === libraryNameOrGlobal) || false;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Get all component dependencies recursively.
|
|
193
|
+
* Traverses the entire dependency tree to return a flat list of all
|
|
194
|
+
* components this one depends on, directly or indirectly.
|
|
195
|
+
*
|
|
196
|
+
* @param visitedNames - Set of already visited component names (for cycle detection)
|
|
197
|
+
* @returns Array of all component dependencies
|
|
198
|
+
*/
|
|
199
|
+
GetAllDependencies(visitedNames = new Set()) {
|
|
200
|
+
const allDeps = [];
|
|
201
|
+
// Avoid cycles
|
|
202
|
+
if (visitedNames.has(this.name)) {
|
|
203
|
+
return allDeps;
|
|
204
|
+
}
|
|
205
|
+
visitedNames.add(this.name);
|
|
206
|
+
// Process direct dependencies
|
|
207
|
+
for (const dep of this.dependencies || []) {
|
|
208
|
+
allDeps.push(dep);
|
|
209
|
+
// Recursively get subdependencies if it's a runtime instance
|
|
210
|
+
if (dep instanceof ComponentSpecRuntime) {
|
|
211
|
+
allDeps.push(...dep.GetAllDependencies(visitedNames));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return allDeps;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
exports.ComponentSpecRuntime = ComponentSpecRuntime;
|
|
218
|
+
//# sourceMappingURL=component-spec-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-spec-runtime.js","sourceRoot":"","sources":["../src/component-spec-runtime.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ComponentEvent, ComponentProperty } from "./component-props-events";
|
|
2
|
+
import { ComponentDataRequirements } from "./data-requirements";
|
|
3
|
+
import { ComponentLibraryDependency } from "./library-dependency";
|
|
4
|
+
/**
|
|
5
|
+
* Specification for an interactive component
|
|
6
|
+
*/
|
|
7
|
+
export declare class ComponentSpec {
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* End-user friendly description of what the component does
|
|
11
|
+
*/
|
|
12
|
+
description: string;
|
|
13
|
+
/**
|
|
14
|
+
* User-friendly name
|
|
15
|
+
*/
|
|
16
|
+
title: string;
|
|
17
|
+
/**
|
|
18
|
+
* Self-declared type - some common options below, can be any string if the standard ones aren't sufficient
|
|
19
|
+
*/
|
|
20
|
+
type: "report" | "dashboard" | "form" | "table" | "chart" | "navigation" | "search" | string;
|
|
21
|
+
/**
|
|
22
|
+
* JavaScript code
|
|
23
|
+
*/
|
|
24
|
+
code: string;
|
|
25
|
+
/**
|
|
26
|
+
* A functional description of what the component should do in markdown.
|
|
27
|
+
*
|
|
28
|
+
* Describes:
|
|
29
|
+
* - Core functionality
|
|
30
|
+
* - Any business rules
|
|
31
|
+
* - Expected outcomes
|
|
32
|
+
* - UX considerations
|
|
33
|
+
*/
|
|
34
|
+
functionalRequirements: string;
|
|
35
|
+
/**
|
|
36
|
+
* Describes the entities and queries a component requires to function.
|
|
37
|
+
*/
|
|
38
|
+
dataRequirements?: ComponentDataRequirements;
|
|
39
|
+
/**
|
|
40
|
+
* Technical explanation of the component in markdown.
|
|
41
|
+
*/
|
|
42
|
+
technicalDesign: string;
|
|
43
|
+
/**
|
|
44
|
+
* Properties the component accepts, if any
|
|
45
|
+
*/
|
|
46
|
+
properties?: ComponentProperty[];
|
|
47
|
+
/**
|
|
48
|
+
* Events that the component emits, if any
|
|
49
|
+
*/
|
|
50
|
+
events?: ComponentEvent[];
|
|
51
|
+
/**
|
|
52
|
+
* Example of the component being used in JSX format. This is used to provide a clear example on the properties and
|
|
53
|
+
* event handling that the component supports.
|
|
54
|
+
*/
|
|
55
|
+
exampleUsage: string;
|
|
56
|
+
/**
|
|
57
|
+
* Describes any other components this one depends on, if any
|
|
58
|
+
*/
|
|
59
|
+
dependencies?: ComponentSpec[];
|
|
60
|
+
/**
|
|
61
|
+
* 3rd party lib dependencies, if any
|
|
62
|
+
*/
|
|
63
|
+
libraries?: ComponentLibraryDependency[];
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=component-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-spec.d.ts","sourceRoot":"","sources":["../src/component-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,qBAAa,aAAa;IACtB,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;IAE7F;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;;OAQG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,EAAE,0BAA0B,EAAE,CAAC;CAC5C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentSpec = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Specification for an interactive component
|
|
6
|
+
*/
|
|
7
|
+
class ComponentSpec {
|
|
8
|
+
}
|
|
9
|
+
exports.ComponentSpec = ComponentSpec;
|
|
10
|
+
;
|
|
11
|
+
//# sourceMappingURL=component-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-spec.js","sourceRoot":"","sources":["../src/component-spec.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,MAAa,aAAa;CAqEzB;AArED,sCAqEC;AAAA,CAAC"}
|
|
@@ -1,50 +1,77 @@
|
|
|
1
|
-
import { DataContext } from "@memberjunction/data-context";
|
|
2
|
-
/**
|
|
3
|
-
* This interface is critical for understanding how components interact with MemberJunction data
|
|
4
|
-
*/
|
|
5
1
|
export interface ComponentDataRequirements {
|
|
6
2
|
/**
|
|
7
|
-
*
|
|
8
|
-
* - '
|
|
9
|
-
* - '
|
|
10
|
-
* - 'hybrid':
|
|
11
|
-
*/
|
|
12
|
-
mode: '
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Description of how the static data is used by the component
|
|
25
|
-
*/
|
|
26
|
-
description?: string;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* For dynamic mode: Defines which MemberJunction entities this component needs access to.
|
|
30
|
-
* The component will use the RunView/RunQuery utilities to fetch data at runtime.
|
|
31
|
-
*/
|
|
32
|
-
dynamicData?: {
|
|
33
|
-
/**
|
|
34
|
-
* Describes the entities and fields the component will
|
|
35
|
-
* need to fulfill user requirements.
|
|
36
|
-
*/
|
|
37
|
-
requiredEntities: ComponentEntityDataRequirement[];
|
|
38
|
-
/**
|
|
39
|
-
* Description of data access patterns
|
|
40
|
-
*/
|
|
41
|
-
description?: string;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* General description of data requirements
|
|
3
|
+
* How the component gets its data
|
|
4
|
+
* - 'views': Fetches data at runtime using MJ RunView()
|
|
5
|
+
* - 'queries': Fetches data at runtime using MJ RunQuery()
|
|
6
|
+
* - 'hybrid': Uses both views and queries, depending on the context
|
|
7
|
+
*/
|
|
8
|
+
mode: 'views' | 'queries' | 'hybrid';
|
|
9
|
+
/**
|
|
10
|
+
* Describes the entities and fields the component will access to fulfill user requirements.
|
|
11
|
+
*/
|
|
12
|
+
entities: ComponentEntityDataRequirement[];
|
|
13
|
+
/**
|
|
14
|
+
* Stored Queries that the component will use to fetch data.
|
|
15
|
+
*/
|
|
16
|
+
queries: ComponentQueryDataRequirement[];
|
|
17
|
+
/**
|
|
18
|
+
* Description of data access patterns
|
|
45
19
|
*/
|
|
46
20
|
description?: string;
|
|
47
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Describes how a component will use a specific query in MemberJunction to fetch data
|
|
24
|
+
*/
|
|
25
|
+
export type ComponentQueryDataRequirement = {
|
|
26
|
+
/**
|
|
27
|
+
* Query name, used along with categoryPath to identify the query
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* Full path of the category for the query. Categories can be hierarchical so a full path might be
|
|
32
|
+
* 'Membership/Users/ActiveUsers'. This helps in organizing queries and avoiding name collisions.
|
|
33
|
+
*/
|
|
34
|
+
categoryPath: string;
|
|
35
|
+
/**
|
|
36
|
+
* Description of the query and how/why the component will use it
|
|
37
|
+
*/
|
|
38
|
+
description?: string;
|
|
39
|
+
/**
|
|
40
|
+
* A list of the fields that the component will use out of the possible fields returned by the query.
|
|
41
|
+
* Uses the @see SimpleEntityFieldInfo type to describe each field. **NOTE** not all of the fields are actually
|
|
42
|
+
* directly related to entity fields as some might be computed/etc, but SimpleEntityFieldInfo helps define some key aspects
|
|
43
|
+
* like the data type of the column and a description of the field.
|
|
44
|
+
*/
|
|
45
|
+
fields: SimpleEntityFieldInfo[];
|
|
46
|
+
/**
|
|
47
|
+
* Queries can have parameters (not all do). See @see ComponentQueryParameterValue for details.
|
|
48
|
+
*/
|
|
49
|
+
parameters?: ComponentQueryParameterValue[];
|
|
50
|
+
/**
|
|
51
|
+
* This is only provided when requesting a NEW query be created. For existing queries, this will be undefined.
|
|
52
|
+
* This SQL can use Nunjucks syntax/templating for parameters including the custom filters defined in
|
|
53
|
+
*/
|
|
54
|
+
newQuerySQL?: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Describes a single query parameter that a component will use when running a query.
|
|
58
|
+
*/
|
|
59
|
+
export type ComponentQueryParameterValue = {
|
|
60
|
+
/**
|
|
61
|
+
* Name of the parameter
|
|
62
|
+
*/
|
|
63
|
+
name: string;
|
|
64
|
+
/**
|
|
65
|
+
* Value of the parameter. If the value is '@runtime', it indicates that the component will determine the value at runtime.
|
|
66
|
+
* If anything other than '@runtime' is specified, it is a hardcoded value that the component will use.
|
|
67
|
+
*/
|
|
68
|
+
value: string;
|
|
69
|
+
/**
|
|
70
|
+
* Description of the parameter and how it is used in the query. This is particular important if
|
|
71
|
+
* the value is '@runtime' as it helps the component developer understand what the parameter is for and how to determine its value.
|
|
72
|
+
*/
|
|
73
|
+
description?: string;
|
|
74
|
+
};
|
|
48
75
|
/**
|
|
49
76
|
* Describes use of a single entity
|
|
50
77
|
*/
|
|
@@ -52,11 +79,11 @@ export type ComponentEntityDataRequirement = {
|
|
|
52
79
|
/**
|
|
53
80
|
* Name of the entity (unique system-wide)
|
|
54
81
|
*/
|
|
55
|
-
|
|
82
|
+
name: string;
|
|
56
83
|
/**
|
|
57
84
|
* Description of data in the entity
|
|
58
85
|
*/
|
|
59
|
-
|
|
86
|
+
description?: string;
|
|
60
87
|
/**
|
|
61
88
|
* Fields to show the user
|
|
62
89
|
*/
|
|
@@ -79,7 +106,12 @@ export type ComponentEntityDataRequirement = {
|
|
|
79
106
|
* When/Where/How components should use this data
|
|
80
107
|
*/
|
|
81
108
|
usageContext?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Array of permissions required by the component
|
|
111
|
+
*/
|
|
112
|
+
permissionLevelNeeded: ComponentEntitySimplePermission[];
|
|
82
113
|
};
|
|
114
|
+
export type ComponentEntitySimplePermission = 'read' | 'create' | 'update' | 'delete';
|
|
83
115
|
/**
|
|
84
116
|
* Simple type to share more information about the relevant fields
|
|
85
117
|
* in an entity that are to be used in a component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-requirements.d.ts","sourceRoot":"","sources":["../src/data-requirements.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"data-requirements.d.ts","sourceRoot":"","sources":["../src/data-requirements.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACtC;;;;;OAKG;IACH,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;IAErC;;OAEG;IACH,QAAQ,EAAE,8BAA8B,EAAE,CAAC;IAE3C;;OAEG;IACH,OAAO,EAAE,6BAA6B,EAAE,CAAC;IAEzC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IACxC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAEhC;;OAEG;IACH,UAAU,CAAC,EAAE,4BAA4B,EAAE,CAAC;IAE5C;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACvC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG;IACzC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;;;OAIG;IACH,aAAa,EAAE,qBAAqB,EAAE,CAAA;IAEtC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,qBAAqB,EAAE,+BAA+B,EAAE,CAAC;CAC5D,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtF;;;IAGI;AACJ,MAAM,MAAM,qBAAqB,GAAG;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * from './root-spec';
|
|
2
|
-
export * from './child-spec';
|
|
3
1
|
export * from './data-requirements';
|
|
4
2
|
export * from './component-option';
|
|
5
3
|
export * from './runtime-types';
|
|
6
4
|
export * from './shared';
|
|
7
5
|
export * from './component-props-events';
|
|
8
6
|
export * from './util';
|
|
7
|
+
export * from './component-spec';
|
|
8
|
+
export * from './component-spec-runtime';
|
|
9
|
+
export * from './library-dependency';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,12 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./root-spec"), exports);
|
|
18
|
-
__exportStar(require("./child-spec"), exports);
|
|
19
17
|
__exportStar(require("./data-requirements"), exports);
|
|
20
18
|
__exportStar(require("./component-option"), exports);
|
|
21
19
|
__exportStar(require("./runtime-types"), exports);
|
|
22
20
|
__exportStar(require("./shared"), exports);
|
|
23
21
|
__exportStar(require("./component-props-events"), exports);
|
|
24
22
|
__exportStar(require("./util"), exports);
|
|
23
|
+
__exportStar(require("./component-spec"), exports);
|
|
24
|
+
__exportStar(require("./component-spec-runtime"), exports);
|
|
25
|
+
__exportStar(require("./library-dependency"), exports);
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,qDAAmC;AACnC,kDAAgC;AAChC,2CAAyB;AACzB,2DAAyC;AACzC,yCAAuB;AACvB,mDAAiC;AACjC,2DAAyC;AACzC,uDAAqC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library dependency information for a component
|
|
3
|
+
*/
|
|
4
|
+
export interface ComponentLibraryDependency {
|
|
5
|
+
/**
|
|
6
|
+
* Unique name of the library from our registry. Typically
|
|
7
|
+
* reuses npm style package names such as
|
|
8
|
+
* "recharts", "lodash", "dayjs", "antd" or "@memberjunction/lib-name"
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* The global variable name used by the component to access the library in code.
|
|
13
|
+
* When the component is bootstrapped, the library is loaded into a variable in a
|
|
14
|
+
* Factory/wrapper function around it by the host.
|
|
15
|
+
*/
|
|
16
|
+
globalVariable: string;
|
|
17
|
+
/**
|
|
18
|
+
* SemVer string describing minimum version requirement
|
|
19
|
+
* Example: "2.5.0" for fixed version, "^1.0.0" for minimum version
|
|
20
|
+
*/
|
|
21
|
+
minVersion?: string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=library-dependency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-dependency.d.ts","sourceRoot":"","sources":["../src/library-dependency.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-dependency.js","sourceRoot":"","sources":["../src/library-dependency.ts"],"names":[],"mappings":""}
|
package/dist/util.d.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentRootSpec } from "./root-spec";
|
|
1
|
+
import { ComponentSpec } from "./component-spec";
|
|
3
2
|
/**
|
|
4
3
|
* Builds the complete code for a component based on the provided spec.
|
|
5
4
|
*
|
|
6
5
|
* This function generates the full code representation of a component, including
|
|
7
|
-
* the root component code and recursively pulling in
|
|
8
|
-
* the placeholders for those
|
|
9
|
-
* actual code for those
|
|
6
|
+
* the root component code and recursively pulling in dependency components and also replacing
|
|
7
|
+
* the placeholders for those dependency components in the parent component's code with the
|
|
8
|
+
* actual code for those dependency components (which were generated after the parent component was generated).
|
|
10
9
|
*
|
|
11
10
|
* @param spec - The ComponentRootSpec defining the component structure and behavior
|
|
12
11
|
* @returns A string containing the complete executable JavaScript code for the component
|
|
13
12
|
*/
|
|
14
|
-
export declare function BuildComponentCompleteCode(spec:
|
|
13
|
+
export declare function BuildComponentCompleteCode(spec: ComponentSpec): string;
|
|
15
14
|
/**
|
|
16
|
-
* Builds the code for a component
|
|
17
|
-
* @param spec - The
|
|
18
|
-
* @returns A string containing the executable JavaScript code for the component
|
|
15
|
+
* Builds the code for a component dependency based on the provided spec including recursive dependency components.
|
|
16
|
+
* @param spec - The ComponentSpec defining the dependency component structure and behavior
|
|
17
|
+
* @returns A string containing the executable JavaScript code for the component dependency
|
|
19
18
|
*/
|
|
20
|
-
export declare function
|
|
19
|
+
export declare function BuildComponentCode(dep: ComponentSpec, path: string): string;
|
|
21
20
|
//# sourceMappingURL=util.d.ts.map
|
package/dist/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAiBtE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAkB3E"}
|
package/dist/util.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.BuildComponentCode = exports.BuildComponentCompleteCode = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Builds the complete code for a component based on the provided spec.
|
|
6
6
|
*
|
|
7
7
|
* This function generates the full code representation of a component, including
|
|
8
|
-
* the root component code and recursively pulling in
|
|
9
|
-
* the placeholders for those
|
|
10
|
-
* actual code for those
|
|
8
|
+
* the root component code and recursively pulling in dependency components and also replacing
|
|
9
|
+
* the placeholders for those dependency components in the parent component's code with the
|
|
10
|
+
* actual code for those dependency components (which were generated after the parent component was generated).
|
|
11
11
|
*
|
|
12
12
|
* @param spec - The ComponentRootSpec defining the component structure and behavior
|
|
13
13
|
* @returns A string containing the complete executable JavaScript code for the component
|
|
14
14
|
*/
|
|
15
15
|
function BuildComponentCompleteCode(spec) {
|
|
16
16
|
// Start with the base code for the root component
|
|
17
|
-
let code = spec.
|
|
18
|
-
// Recursively replace placeholders for
|
|
19
|
-
if (!spec.
|
|
20
|
-
// If there are no
|
|
17
|
+
let code = spec.code || '// Generation Error: No root component code provided! \n\n';
|
|
18
|
+
// Recursively replace placeholders for dependency components with their generated code
|
|
19
|
+
if (!spec.dependencies || spec.dependencies.length === 0) {
|
|
20
|
+
// If there are no dependency components, return the base code for this component
|
|
21
21
|
return code;
|
|
22
22
|
}
|
|
23
|
-
for (const
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
// Append the generated code for this
|
|
27
|
-
code += '\n\n' +
|
|
23
|
+
for (const dep of spec.dependencies) {
|
|
24
|
+
const depCode = BuildComponentCode(dep, "");
|
|
25
|
+
if (depCode && depCode.length > 0) {
|
|
26
|
+
// Append the generated code for this dependency component to the root component code
|
|
27
|
+
code += '\n\n' + depCode;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
// Return the complete code for this component
|
|
@@ -32,27 +32,27 @@ function BuildComponentCompleteCode(spec) {
|
|
|
32
32
|
}
|
|
33
33
|
exports.BuildComponentCompleteCode = BuildComponentCompleteCode;
|
|
34
34
|
/**
|
|
35
|
-
* Builds the code for a component
|
|
36
|
-
* @param spec - The
|
|
37
|
-
* @returns A string containing the executable JavaScript code for the component
|
|
35
|
+
* Builds the code for a component dependency based on the provided spec including recursive dependency components.
|
|
36
|
+
* @param spec - The ComponentSpec defining the dependency component structure and behavior
|
|
37
|
+
* @returns A string containing the executable JavaScript code for the component dependency
|
|
38
38
|
*/
|
|
39
|
-
function
|
|
40
|
-
// Start with the base code for the
|
|
41
|
-
let commentHeader = `/*******************************************************\n ${path ? `${path} > ` : ''}${
|
|
42
|
-
let code = commentHeader +
|
|
43
|
-
// Recursively replace placeholders for
|
|
44
|
-
if (!
|
|
45
|
-
// If there are no
|
|
39
|
+
function BuildComponentCode(dep, path) {
|
|
40
|
+
// Start with the base code for the component
|
|
41
|
+
let commentHeader = `/*******************************************************\n ${path ? `${path} > ` : ''}${dep.name}\n ${dep.description}\n*******************************************************/\n`;
|
|
42
|
+
let code = commentHeader + dep.code;
|
|
43
|
+
// Recursively replace placeholders for dependency components with their generated code
|
|
44
|
+
if (!dep.dependencies || dep.dependencies.length === 0) {
|
|
45
|
+
// If there are no dependency components, return the base code for this component
|
|
46
46
|
return code;
|
|
47
47
|
}
|
|
48
|
-
for (const sub of
|
|
49
|
-
const subCode =
|
|
48
|
+
for (const sub of dep.dependencies) {
|
|
49
|
+
const subCode = BuildComponentCode(sub, path + (path ? ' > ' : '') + sub.name);
|
|
50
50
|
if (subCode && subCode.length > 0) {
|
|
51
51
|
code += '\n\n' + subCode;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
// Return the complete code for this
|
|
54
|
+
// Return the complete code for this dependency component
|
|
55
55
|
return code;
|
|
56
56
|
}
|
|
57
|
-
exports.
|
|
57
|
+
exports.BuildComponentCode = BuildComponentCode;
|
|
58
58
|
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;GAUG;AACH,SAAgB,0BAA0B,CAAC,IAAmB;IAC1D,kDAAkD;IAClD,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,4DAA4D,CAAC;IACrF,uFAAuF;IACvF,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvD,iFAAiF;QACjF,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,kBAAkB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC5C,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,qFAAqF;YACrF,IAAI,IAAI,MAAM,GAAG,OAAO,CAAC;QAC7B,CAAC;IACL,CAAC;IACD,8CAA8C;IAC9C,OAAO,IAAI,CAAC;AAChB,CAAC;AAjBD,gEAiBC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,GAAkB,EAAE,IAAY;IAC/D,6CAA6C;IAC7C,IAAI,aAAa,GAAG,gEAAgE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,QAAQ,GAAG,CAAC,WAAW,8DAA8D,CAAA;IAC5M,IAAI,IAAI,GAAG,aAAa,GAAG,GAAG,CAAC,IAAI,CAAC;IACpC,uFAAuF;IACvF,IAAI,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrD,iFAAiF;QACjF,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,kBAAkB,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/E,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,IAAI,IAAI,MAAM,GAAG,OAAO,CAAC;QAC7B,CAAC;IACL,CAAC;IACD,yDAAyD;IACzD,OAAO,IAAI,CAAC;AAChB,CAAC;AAlBD,gDAkBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/interactive-component-types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.75.0",
|
|
4
4
|
"description": "MemberJunction: Interactive Component - Type specifications for MJ Interactive UI Componentry",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"typescript": "^5.4.5"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@memberjunction/core": "2.
|
|
23
|
-
"@memberjunction/data-context": "2.
|
|
22
|
+
"@memberjunction/core": "2.75.0",
|
|
23
|
+
"@memberjunction/data-context": "2.75.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
package/dist/child-spec.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ComponentEvent, ComponentProperty } from "./component-props-events";
|
|
2
|
-
import { ComponentDataRequirements } from "./data-requirements";
|
|
3
|
-
/**
|
|
4
|
-
* Represents a child component within a component hierarchy
|
|
5
|
-
*/
|
|
6
|
-
export interface ComponentChildSpec {
|
|
7
|
-
/**
|
|
8
|
-
* The programmatic name of the component
|
|
9
|
-
*/
|
|
10
|
-
componentName: string;
|
|
11
|
-
/**
|
|
12
|
-
* Example of the component being used in JSX format. This is used to provide a clear example on the properties and
|
|
13
|
-
* event handling that the component supports. This is used to teach the next AI exactly what we want it to generate for the
|
|
14
|
-
* child component.
|
|
15
|
-
*/
|
|
16
|
-
exampleUsage: string;
|
|
17
|
-
/**
|
|
18
|
-
* The code for the child component. This is generated LATER by a separate process after the parent
|
|
19
|
-
* component generation is complete. When the parent component generates this is undefined.
|
|
20
|
-
*/
|
|
21
|
-
componentCode?: string;
|
|
22
|
-
/**
|
|
23
|
-
* A summary of what this child component does that a user would understand.
|
|
24
|
-
* This should be a high-level, user-friendly description suitable for end users.
|
|
25
|
-
*/
|
|
26
|
-
description: string;
|
|
27
|
-
/**
|
|
28
|
-
* Functional requirements for this child component.
|
|
29
|
-
* This should be in markdown format and describe what the component should do from a functional perspective.
|
|
30
|
-
* Includes:
|
|
31
|
-
* - Component-specific functionality
|
|
32
|
-
* - How it integrates with the parent component
|
|
33
|
-
* - User interactions within this component
|
|
34
|
-
* - Business rules specific to this component
|
|
35
|
-
*/
|
|
36
|
-
functionalRequirements?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Data requirements for this child component. This section defines where a child component
|
|
39
|
-
* will **directly** access data as required using utilities methods like `rv.runView` and `rq.runQuery`
|
|
40
|
-
*/
|
|
41
|
-
dataRequirements?: ComponentDataRequirements;
|
|
42
|
-
/**
|
|
43
|
-
* An optional array of properties that the component uses. The names and descriptions
|
|
44
|
-
* allow consumers of the component to understand what is accepted by the component and the
|
|
45
|
-
* component. This can be used for shared data shared between components or for configuration
|
|
46
|
-
* settings.
|
|
47
|
-
*/
|
|
48
|
-
properties?: ComponentProperty[];
|
|
49
|
-
/**
|
|
50
|
-
* An optional array of events that the component emits.
|
|
51
|
-
* This allows consumers of the component to understand what events they can listen to.
|
|
52
|
-
*/
|
|
53
|
-
events?: ComponentEvent[];
|
|
54
|
-
/**
|
|
55
|
-
* Technical design details for this child component.
|
|
56
|
-
* This should be in markdown format and describe the implementation approach.
|
|
57
|
-
* Includes:
|
|
58
|
-
* - How the component is structured
|
|
59
|
-
* - Properites/events
|
|
60
|
-
*/
|
|
61
|
-
technicalDesign?: string;
|
|
62
|
-
/**
|
|
63
|
-
* An array of sub-components
|
|
64
|
-
*/
|
|
65
|
-
components: ComponentChildSpec[];
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=child-spec.d.ts.map
|
package/dist/child-spec.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"child-spec.d.ts","sourceRoot":"","sources":["../src/child-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAEjC;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,UAAU,EAAE,kBAAkB,EAAE,CAAC;CACpC"}
|
package/dist/child-spec.js
DELETED
package/dist/child-spec.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"child-spec.js","sourceRoot":"","sources":["../src/child-spec.ts"],"names":[],"mappings":""}
|
package/dist/root-spec.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ComponentChildSpec } from "./child-spec";
|
|
2
|
-
import { ComponentDataRequirements } from "./data-requirements";
|
|
3
|
-
/**
|
|
4
|
-
* Represents a complete specification for a generated Skip component, including its structure,
|
|
5
|
-
* requirements, code, and nested component hierarchy
|
|
6
|
-
*/
|
|
7
|
-
export type ComponentRootSpec = {
|
|
8
|
-
/**
|
|
9
|
-
* A description of what the component should do from a functional perspective.
|
|
10
|
-
* This should be in markdown format and include:
|
|
11
|
-
* - Core functionality
|
|
12
|
-
* - Business rules
|
|
13
|
-
* - Expected outcomes
|
|
14
|
-
* - UX considerations
|
|
15
|
-
*/
|
|
16
|
-
functionalRequirements: string;
|
|
17
|
-
/**
|
|
18
|
-
* Detailed data requirements, including how the component accesses and uses data.
|
|
19
|
-
*/
|
|
20
|
-
dataRequirements?: ComponentDataRequirements;
|
|
21
|
-
/**
|
|
22
|
-
* A technical description of how the component is designed and implemented.
|
|
23
|
-
* This should be in markdown format and include:
|
|
24
|
-
* - Architecture and design patterns
|
|
25
|
-
* - Key technical decisions
|
|
26
|
-
* - Component structure
|
|
27
|
-
* - State management
|
|
28
|
-
* - Integration points with parent/child components
|
|
29
|
-
*/
|
|
30
|
-
technicalDesign: string;
|
|
31
|
-
/**
|
|
32
|
-
* The code for the main component.
|
|
33
|
-
*/
|
|
34
|
-
componentCode: string;
|
|
35
|
-
/**
|
|
36
|
-
* Name of the component
|
|
37
|
-
*/
|
|
38
|
-
componentName: string;
|
|
39
|
-
/**
|
|
40
|
-
* The type of component: report, dashboard, form, or other.
|
|
41
|
-
*/
|
|
42
|
-
componentType: "report" | "dashboard" | "form" | "other";
|
|
43
|
-
/**
|
|
44
|
-
* A summary of what the component does that a user would understand.
|
|
45
|
-
*/
|
|
46
|
-
description: string;
|
|
47
|
-
/**
|
|
48
|
-
* The callback strategy used by this component (e.g., "hybrid", "direct", "none")
|
|
49
|
-
*/
|
|
50
|
-
callbackStrategy: string;
|
|
51
|
-
/**
|
|
52
|
-
* Describes the state structure managed by this component
|
|
53
|
-
*/
|
|
54
|
-
stateStructure: Record<string, string>;
|
|
55
|
-
/**
|
|
56
|
-
* An array of child component specifications
|
|
57
|
-
*/
|
|
58
|
-
childComponents: ComponentChildSpec[];
|
|
59
|
-
/**
|
|
60
|
-
* User-friendly name
|
|
61
|
-
*/
|
|
62
|
-
title: string;
|
|
63
|
-
/**
|
|
64
|
-
* A user-friendly explanation of what the component does
|
|
65
|
-
*/
|
|
66
|
-
userExplanation: string;
|
|
67
|
-
/**
|
|
68
|
-
* Summary of technical design
|
|
69
|
-
*/
|
|
70
|
-
techExplanation: string;
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=root-spec.d.ts.map
|
package/dist/root-spec.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"root-spec.d.ts","sourceRoot":"","sources":["../src/root-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;;;;;;OAOG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;;;;;;OAQG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,EAAE,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;IAEzD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,eAAe,EAAE,kBAAkB,EAAE,CAAC;IAEtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CAC3B,CAAC"}
|
package/dist/root-spec.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"root-spec.js","sourceRoot":"","sources":["../src/root-spec.ts"],"names":[],"mappings":""}
|