@memberjunction/skip-types 2.66.0 → 2.68.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,3 +1,4 @@
1
+ import { SkipComponentEvent, SkipComponentProperty } from "./component-props-events";
1
2
  import { SkipComponentDataRequirements } from "./data-requirements";
2
3
  /**
3
4
  * Represents a child component within a component hierarchy
@@ -36,13 +37,28 @@ export interface SkipComponentChildSpec {
36
37
  */
37
38
  functionalRequirements?: string;
38
39
  /**
39
- * Data requirements for this child component.
40
- * Child components inherit static data from their parent component's data context.
41
- * However, they can define their own dynamic data requirements for entities they need to access at runtime.
40
+ * Data requirements for this child component. This section defines where a child component
41
+ * will **directly** access data as required using utilities methods like `rv.runView` and `rq.runQuery`
42
+ *
43
+ * This is **not** the same as the dataProps array shown below which is the manifest of the possible
44
+ * sub-properties that can be passed into the component in its `data` property.
42
45
  *
43
46
  * @since 2.1.0 - Enhanced documentation for clarity
44
47
  */
45
48
  dataRequirements?: SkipComponentDataRequirements;
49
+ /**
50
+ * An optional array of properties that the component uses. The names and descriptions
51
+ * allow consumers of the component to understand what is accepted by the component and the
52
+ * component. This can be used for shared data shared between components or for configuration
53
+ * settings.
54
+ */
55
+ properties?: SkipComponentProperty[];
56
+ /**
57
+ * An optional array of events that the component emits.
58
+ * This allows consumers of the component to understand what events they can listen to.
59
+ * Each event should have a name and a description of what it does.
60
+ */
61
+ events?: SkipComponentEvent[];
46
62
  /**
47
63
  * Technical design details for this child component.
48
64
  * This should be in markdown format and describe the implementation approach.
@@ -1 +1 @@
1
- {"version":3,"file":"child-spec.d.ts","sourceRoot":"","sources":["../src/child-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC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of a single property of a component.
3
+ */
4
+ export interface SkipComponentProperty {
5
+ /**
6
+ * The name of the property
7
+ */
8
+ name: string;
9
+ /**
10
+ * A description of what this property is used for
11
+ */
12
+ description: string;
13
+ /**
14
+ * The type of the property.
15
+ * It can be one of 'string', 'number', 'boolean', 'object', 'array', 'function', or 'any'.
16
+ * These types are for aligning users of the component. Components are in JavaScript and do not
17
+ * actually enforce types at runtime, but this is used to provide guidance for users (AI and Human)
18
+ */
19
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'function' | 'any';
20
+ /**
21
+ * Indicates if this property is required for the component to function correctly.
22
+ * If true, the component will not work without this property being set.
23
+ */
24
+ required: boolean;
25
+ /**
26
+ * The default value, if any, for this property if it is not provided.
27
+ */
28
+ defaultValue?: any;
29
+ /**
30
+ * Optional list of possible values for this property.
31
+ */
32
+ possibleValues?: string[];
33
+ }
34
+ /**
35
+ * Definition of a single event of a component.
36
+ */
37
+ export interface SkipComponentEvent {
38
+ /**
39
+ * The name of the event
40
+ */
41
+ name: string;
42
+ /**
43
+ * A description of what this event does
44
+ */
45
+ description: string;
46
+ /**
47
+ * An array of parameters that this event can emit.
48
+ */
49
+ parameters?: SkipComponentEventParameter[];
50
+ }
51
+ export interface SkipComponentEventParameter {
52
+ /**
53
+ * The name of the parameter
54
+ */
55
+ name: string;
56
+ /**
57
+ * A description of what this parameter is used for
58
+ */
59
+ description: string;
60
+ /**
61
+ * The type of the parameter.
62
+ * It can be one of 'string', 'number', 'boolean', 'object', 'array', 'function', or 'any'.
63
+ */
64
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'function' | 'any';
65
+ }
66
+ //# sourceMappingURL=component-props-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-props-events.d.ts","sourceRoot":"","sources":["../src/component-props-events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,CAAC;IAChF;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,2BAA2B,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,2BAA2B;IACxC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,CAAC;CACnF"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=component-props-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-props-events.js","sourceRoot":"","sources":["../src/component-props-events.ts"],"names":[],"mappings":""}
@@ -7,9 +7,9 @@ import { DataContext } from "@memberjunction/data-context";
7
7
  export interface SkipComponentDataRequirements {
8
8
  /**
9
9
  * The primary data access mode for this component.
10
- * - 'static': Data is pre-loaded and passed to the component during initialization
11
10
  * - 'dynamic': Component fetches data at runtime using MJ utilities
12
- * - 'hybrid': Component uses both static and dynamic data access patterns
11
+ * - 'static': Static is deprecated, use dynamic. Data is pre-loaded and passed to the component during initialization
12
+ * - 'hybrid': Hybrid is deprecated, use dynamic. Uses both static and dynamic data access patterns
13
13
  */
14
14
  mode: 'static' | 'dynamic' | 'hybrid';
15
15
  /**
@@ -19,6 +19,7 @@ export interface SkipComponentDataRequirements {
19
19
  * - Reports with fixed datasets
20
20
  * - Components where users don't need entity-level permissions
21
21
  * - Scenarios requiring reduced database load
22
+ * @deprecated Use dynamicData instead
22
23
  */
23
24
  staticData?: {
24
25
  /**
@@ -51,33 +52,11 @@ export interface SkipComponentDataRequirements {
51
52
  */
52
53
  description?: string;
53
54
  };
54
- /**
55
- * For hybrid mode: Components can use both static and dynamic data access.
56
- * Both staticData and dynamicData sections should be populated.
57
- * Hybrid mode is useful for:
58
- * - Components with both summary (static) and detail (dynamic) views
59
- * - Optimizing performance while maintaining interactivity
60
- */
61
- hybridStrategy?: {
62
- /**
63
- * Description of how the component decides when to use static vs dynamic data
64
- */
65
- description: string;
66
- /**
67
- * Optional performance considerations for the hybrid approach
68
- */
69
- performanceNotes?: string;
70
- };
71
55
  /**
72
56
  * General description of the component's data requirements and access patterns.
73
57
  * This should provide a high-level overview of the data strategy.
74
58
  */
75
59
  description?: string;
76
- /**
77
- * Security considerations for data access
78
- * @since 2.1.0
79
- */
80
- securityNotes?: string;
81
60
  }
82
61
  /**
83
62
  * Specifications for the use of a single entity within a Skip component.
@@ -1 +1 @@
1
- {"version":3,"file":"data-requirements.d.ts","sourceRoot":"","sources":["../src/data-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC1C;;;;;OAKG;IACH,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAEtC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE;QACT;;;WAGG;QACH,WAAW,EAAE,WAAW,CAAC;QAEzB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAEF;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE;QACV;;;;WAIG;QACH,gBAAg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AAC;KACxB,CAAC;IAEF;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC7C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;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;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -12,5 +12,6 @@ export * from './data-requirements';
12
12
  export * from './component-option';
13
13
  export * from './runtime-types';
14
14
  export * from './shared';
15
+ export * from './component-props-events';
15
16
  export * from './util';
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AAEzB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,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;AAEzC,cAAc,QAAQ,CAAC"}
package/dist/index.js CHANGED
@@ -29,5 +29,6 @@ __exportStar(require("./data-requirements"), exports);
29
29
  __exportStar(require("./component-option"), exports);
30
30
  __exportStar(require("./runtime-types"), exports);
31
31
  __exportStar(require("./shared"), exports);
32
+ __exportStar(require("./component-props-events"), exports);
32
33
  __exportStar(require("./util"), exports);
33
34
  //# 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,6CAA6C;AAC7C,8CAA4B;AAC5B,uDAAqC;AACrC,mDAAiC;AACjC,0DAAwC;AACxC,gDAA8B;AAC9B,gDAA8B;AAC9B,mDAAiC;AACjC,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,qDAAmC;AACnC,kDAAgC;AAChC,2CAAyB;AAEzB,yCAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,8CAA4B;AAC5B,uDAAqC;AACrC,mDAAiC;AACjC,0DAAwC;AACxC,gDAA8B;AAC9B,gDAA8B;AAC9B,mDAAiC;AACjC,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,qDAAmC;AACnC,kDAAgC;AAChC,2CAAyB;AACzB,2DAAyC;AAEzC,yCAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACpI,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,UAAU,GAAG,cAAc,CAW3E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uCAAuC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,eAAe,GAAG,mBAAmB,CA+B9G;AAED;;;;;;;;;GASG;AACH,wBAAgB,iDAAiD,CAAC,EAAE,EAAE,oBAAoB,GAAG,wBAAwB,CAMpH;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qDAAqD,CAAC,EAAE,EAAE,sBAAsB,GAAG,0BAA0B,CAgB5H;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAWlF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAWjF"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACpI,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,UAAU,GAAG,cAAc,CAW3E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uCAAuC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,eAAe,GAAG,mBAAmB,CA+B9G;AAED;;;;;;;;;GASG;AACH,wBAAgB,iDAAiD,CAAC,EAAE,EAAE,oBAAoB,GAAG,wBAAwB,CAMpH;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qDAAqD,CAAC,EAAE,EAAE,sBAAsB,GAAG,0BAA0B,CAgB5H;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAalF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAiBjF"}
package/dist/util.js CHANGED
@@ -128,12 +128,14 @@ exports.MapEntityRelationshipInfoToSkipEntityRelationshipInfo = MapEntityRelatio
128
128
  */
129
129
  function BuildSkipComponentCompleteCode(spec) {
130
130
  // Start with the base code for the root component
131
- let code = spec.componentCode;
131
+ let code = spec.componentCode || '// Generation Error: No root component code provided! \n\n';
132
132
  // Recursively replace placeholders for child components with their generated code
133
133
  for (const child of spec.childComponents) {
134
134
  const childCode = BuildSkipComponentChildCode(child);
135
- // Replace the placeholder in the parent component's code with the actual child component code
136
- code = replacePlaceholderWithCode(code, child.componentName, childCode);
135
+ if (childCode && childCode.length > 0) {
136
+ // Append the generated code for this child component to the root component code
137
+ code += '\n\n' + childCode;
138
+ }
137
139
  }
138
140
  // Return the complete code for this component
139
141
  return code;
@@ -148,54 +150,18 @@ function BuildSkipComponentChildCode(child) {
148
150
  // Start with the base code for the child component
149
151
  let code = child.componentCode;
150
152
  // Recursively replace placeholders for child components with their generated code
153
+ if (!child.components || child.components.length === 0) {
154
+ // If there are no child components, return the base code for this child
155
+ return code;
156
+ }
151
157
  for (const sub of child.components) {
152
158
  const subCode = BuildSkipComponentChildCode(sub);
153
- // Replace the placeholder in the parent component's code with the actual child component code
154
- code = replacePlaceholderWithCode(code, sub.componentName, subCode);
159
+ if (subCode && subCode.length > 0) {
160
+ code += '\n\n' + subCode;
161
+ }
155
162
  }
156
163
  // Return the complete code for this child component
157
164
  return code;
158
165
  }
159
166
  exports.BuildSkipComponentChildCode = BuildSkipComponentChildCode;
160
- /**
161
- * Replaces a placeholder with code, handling commented placeholders and maintaining proper indentation.
162
- *
163
- * This function finds the entire line containing the placeholder (including if it's commented out)
164
- * and replaces it with the provided code, maintaining the original indentation level for all
165
- * inserted lines.
166
- *
167
- * @param sourceCode - The source code containing the placeholder
168
- * @param placeholder - The placeholder name (without << >> brackets)
169
- * @param replacementCode - The code to insert in place of the placeholder
170
- * @returns The source code with the placeholder replaced
171
- */
172
- function replacePlaceholderWithCode(sourceCode, placeholder, replacementCode) {
173
- // Split the source code into lines
174
- const lines = sourceCode.split('\n');
175
- // Find the line containing the placeholder (with or without comment prefix)
176
- // Look for patterns like: <<placeholder>>, // <<placeholder>>, /* <<placeholder>> */, etc.
177
- const placeholderPattern = new RegExp(`<<${placeholder}>>`);
178
- const lineIndex = lines.findIndex(line => placeholderPattern.test(line));
179
- if (lineIndex === -1) {
180
- // Placeholder not found, return original code
181
- console.warn(`Placeholder <<${placeholder}>> not found in code`);
182
- return sourceCode;
183
- }
184
- // Get the line with the placeholder
185
- const placeholderLine = lines[lineIndex];
186
- // Calculate the indentation (number of leading spaces/tabs)
187
- const indentMatch = placeholderLine.match(/^(\s*)/);
188
- const indent = indentMatch ? indentMatch[1] : '';
189
- // Split the replacement code into lines
190
- const replacementLines = replacementCode.split('\n');
191
- // Add the indentation to each line of the replacement code
192
- const indentedReplacementLines = replacementLines.map(line => {
193
- // Don't add indentation to empty lines
194
- return line.trim() === '' ? line : indent + line;
195
- });
196
- // Replace the placeholder line with the indented replacement lines
197
- lines.splice(lineIndex, 1, ...indentedReplacementLines);
198
- // Join the lines back together
199
- return lines.join('\n');
200
- }
201
167
  //# 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":";;;AAKA;;;;;;;;GAQG;AACH,SAAgB,6BAA6B,CAAC,CAAa;IACvD,MAAM,EAAE,GAAmB;QACvB,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,uCAAuC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxE,eAAe,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,qDAAqD,CAAC,EAAE,CAAC,CAAC;KAC1G,CAAC;IACF,OAAO,EAAE,CAAC;AACd,CAAC;AAXD,sEAWC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,uCAAuC,CAAC,CAAa,EAAE,CAAkB;IACrF,MAAM,EAAE,GAAwB;QAC5B,QAAQ,EAAE,CAAC,CAAC,EAAE;QACd,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,KAAK,EAAE,CA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CAAC;IACL,CAAC;IACD,oDAAoD;IACpD,OAAO,IAAI,CAAC;AAChB,CAAC;AAjBD,kEAiBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/skip-types",
3
- "version": "2.66.0",
3
+ "version": "2.68.0",
4
4
  "description": "MemberJunction: Skip AI Assistant - Types that are used between the MJAPI and the Skip API as well as the UI within MemberJunction Explorer",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,8 +19,8 @@
19
19
  "typescript": "^5.4.5"
20
20
  },
21
21
  "dependencies": {
22
- "@memberjunction/core": "2.66.0",
23
- "@memberjunction/core-entities": "2.66.0",
24
- "@memberjunction/data-context": "2.66.0"
22
+ "@memberjunction/core": "2.68.0",
23
+ "@memberjunction/core-entities": "2.68.0",
24
+ "@memberjunction/data-context": "2.68.0"
25
25
  }
26
26
  }