@memberjunction/interactive-component-types 2.74.0 → 2.76.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.
@@ -1,12 +1,12 @@
1
- import { ComponentRootSpec } from "./root-spec";
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 child componentry.
7
+ * Full details of the generated component option including functional, technical, code, dependencies and libraries
8
8
  */
9
- option: ComponentRootSpec;
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,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B;;OAEG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAE1B;;;;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"}
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":";;;AAAA,qDAAiD;AAGjD,+CAAgF;AAEhF;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,8BAAa;IACnD;;;;;;OAMG;IACI,sBAAsB;QACzB,MAAM,WAAW,GAAG,IAAI,GAAG,EAAmC,CAAC;QAE/D,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7C,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;OAMG;IACI,qBAAqB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;IACrD,CAAC;IAED;;;;;OAKG;IACI,mBAAmB;QACtB,OAAO,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAClE,CAAC;IAED;;;;;OAKG;IACI,oBAAoB;QACvB,OAAO,IAAI,CAAC,sBAAsB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAC1C,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,QAAQ,IA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,CAAC;QACD,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5B,8BAA8B;QAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,YAAY,IAAI,EAAE,EAAE,CAAC;YACxC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAElB,6DAA6D;YAC7D,IAAI,GAAG,YAAY,oBAAoB,EAAE,CAAC;gBACtC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;YAC1D,CAAC;QACL,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAxPD,oDAwPC"}
@@ -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"}
@@ -106,7 +106,12 @@ export type ComponentEntityDataRequirement = {
106
106
  * When/Where/How components should use this data
107
107
  */
108
108
  usageContext?: string;
109
+ /**
110
+ * Array of permissions required by the component
111
+ */
112
+ permissionLevelNeeded: ComponentEntitySimplePermission[];
109
113
  };
114
+ export type ComponentEntitySimplePermission = 'read' | 'create' | 'update' | 'delete';
110
115
  /**
111
116
  * Simple type to share more information about the relevant fields
112
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,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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+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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,QAAQ,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,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,qDAAmC;AACnC,kDAAgC;AAChC,2CAAyB;AACzB,2DAAyC;AACzC,yCAAuB"}
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"}
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=root-spec.js.map
3
+ //# sourceMappingURL=library-dependency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library-dependency.js","sourceRoot":"","sources":["../src/library-dependency.ts"],"names":[],"mappings":""}
@@ -4,11 +4,6 @@ import { SimpleMetadata, SimpleRunQuery, SimpleRunView } from "./shared";
4
4
  * Callbacks a component can use.
5
5
  */
6
6
  export interface ComponentCallbacks {
7
- /**
8
- * When data is provided by the parent, this request results in the parent restarting the component. Only relevant for static/hybrid data, not for dynamic.
9
- * @deprecated
10
- */
11
- RefreshData: () => void;
12
7
  /**
13
8
  * If an action occurs inside a component where it would be desirable for the containing UI to open a specific
14
9
  * record, if supported, this event can be listened to and the container UI can then open the record.
@@ -16,16 +11,6 @@ export interface ComponentCallbacks {
16
11
  * @param key - this is an array of key/value pairs representing the primary key. The format of a Composite Key is an array of KeyValuePair objects and KeyValuePair objects simply have FieldName and Value properties. In most cases entities have single-valued primary keys but this structure is here for complex entity types that have composite primary keys
17
12
  */
18
13
  OpenEntityRecord: (entityName: string, key: CompositeKey) => void;
19
- /**
20
- * This event should be raised whenever something changes within the component that should be tracked as a change in state
21
- * that will persist. userState is any valid serializable JavaScript object. This state is passed to the component when it
22
- * initializes.
23
- */
24
- UpdateUserState: (userState: any) => void;
25
- /**
26
- * Other notifications that a component might want to send to the parent.
27
- */
28
- NotifyEvent: (eventName: string, eventData: any) => void;
29
14
  }
30
15
  /**
31
16
  * Defines styles for the component. Container can provide styles to a top level component. The top level component
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-types.d.ts","sourceRoot":"","sources":["../src/runtime-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAqB,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE5F;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB;;;;;OAKG;IACH,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,KAAK,IAAI,CAAC;IAElE;;;;OAIG;IACH,eAAe,EAAE,CAAC,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC;IAE1C;;OAEG;IACH,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC;CAC5D;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,MAAM,EAAE;QAEJ,OAAO,EAAE,MAAM,CAAA;QACf,YAAY,EAAE,MAAM,CAAA;QACpB,YAAY,CAAC,EAAE,MAAM,CAAA;QAGrB,SAAS,EAAE,MAAM,CAAA;QACjB,cAAc,CAAC,EAAE,MAAM,CAAA;QAGvB,OAAO,EAAE,MAAM,CAAA;QACf,YAAY,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ComponentChildSpec } from "./child-spec";
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 child components and also replacing
8
- * the placeholders for those child components in the parent component's code with the
9
- * actual code for those child components (which were generated after the parent component was generated).
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: ComponentRootSpec): string;
13
+ export declare function BuildComponentCompleteCode(spec: ComponentSpec): string;
15
14
  /**
16
- * Builds the code for a component child based on the provided spec including recursive child components.
17
- * @param spec - The ComponentChildSpec defining the child component structure and behavior
18
- * @returns A string containing the executable JavaScript code for the component child
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 BuildComponentChildCode(child: ComponentChildSpec, path: string): string;
19
+ export declare function BuildComponentCode(dep: ComponentSpec, path: string): string;
21
20
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAiB1E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAkBvF"}
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.BuildComponentChildCode = exports.BuildComponentCompleteCode = void 0;
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 child components and also replacing
9
- * the placeholders for those child components in the parent component's code with the
10
- * actual code for those child components (which were generated after the parent component was generated).
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.componentCode || '// Generation Error: No root component code provided! \n\n';
18
- // Recursively replace placeholders for child components with their generated code
19
- if (!spec.childComponents || spec.childComponents.length === 0) {
20
- // If there are no child components, return the base code for this component
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 child of spec.childComponents) {
24
- const childCode = BuildComponentChildCode(child, "");
25
- if (childCode && childCode.length > 0) {
26
- // Append the generated code for this child component to the root component code
27
- code += '\n\n' + childCode;
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 child based on the provided spec including recursive child components.
36
- * @param spec - The ComponentChildSpec defining the child component structure and behavior
37
- * @returns A string containing the executable JavaScript code for the component child
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 BuildComponentChildCode(child, path) {
40
- // Start with the base code for the child component
41
- let commentHeader = `/*******************************************************\n ${path ? `${path} > ` : ''}${child.componentName}\n ${child.description}\n*******************************************************/\n`;
42
- let code = commentHeader + child.componentCode;
43
- // Recursively replace placeholders for child components with their generated code
44
- if (!child.components || child.components.length === 0) {
45
- // If there are no child components, return the base code for this child
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 child.components) {
49
- const subCode = BuildComponentChildCode(sub, path + (path ? ' > ' : '') + child.componentName);
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 child component
54
+ // Return the complete code for this dependency component
55
55
  return code;
56
56
  }
57
- exports.BuildComponentChildCode = BuildComponentChildCode;
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":";;;AAGA;;;;;;;;;;GAUG;AACH,SAAgB,0BAA0B,CAAC,IAAuB;IAC9D,kDAAkD;IAClD,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,IAAI,4DAA4D,CAAC;IAC9F,kFAAkF;IAClF,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7D,4EAA4E;QAC5E,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG,uBAAuB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrD,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,gFAAgF;YAChF,IAAI,IAAI,MAAM,GAAG,SAAS,CAAC;QAC/B,CAAC;IACL,CAAC;IACD,8CAA8C;IAC9C,OAAO,IAAI,CAAC;AAChB,CAAC;AAjBD,gEAiBC;AAED;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,KAAyB,EAAE,IAAY;IAC3E,mDAAmD;IACnD,IAAI,aAAa,GAAG,gEAAgE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,aAAa,QAAQ,KAAK,CAAC,WAAW,8DAA8D,CAAA;IACzN,IAAI,IAAI,GAAG,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;IAC/C,kFAAkF;IAClF,IAAI,CAAC,K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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.74.0",
3
+ "version": "2.76.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.74.0",
23
- "@memberjunction/data-context": "2.74.0"
22
+ "@memberjunction/core": "2.76.0",
23
+ "@memberjunction/data-context": "2.76.0"
24
24
  }
25
25
  }
@@ -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
@@ -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"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=child-spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"child-spec.js","sourceRoot":"","sources":["../src/child-spec.ts"],"names":[],"mappings":""}
@@ -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
@@ -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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"root-spec.js","sourceRoot":"","sources":["../src/root-spec.ts"],"names":[],"mappings":""}