@memberjunction/skip-types 0.9.17 → 0.9.19

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/types.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { EntityInfo } from '@memberjunction/core';
2
- import { UserViewEntityExtended } from '@memberjunction/core-entities';
1
+ import { DataContext } from '@memberjunction/data-context';
3
2
  export declare class SubProcessResponse {
4
3
  status: "success" | "error";
5
4
  resultType: "data" | "plot" | "html" | null;
@@ -38,7 +37,7 @@ export declare class SkipAPIRequest {
38
37
  /**
39
38
  * The data context, use this to provide all of the data you have in a data context to Skip. You should provide this from cache or refreshed based on the parameters provided by the user.
40
39
  */
41
- dataContext: SkipDataContext;
40
+ dataContext: DataContext;
42
41
  /**
43
42
  * The conversation ID
44
43
  */
@@ -114,76 +113,3 @@ export declare class SkipDataRequest {
114
113
  */
115
114
  description?: string;
116
115
  }
117
- export declare class SkipDataContextFieldInfo {
118
- Name: string;
119
- Type: string;
120
- Description?: string;
121
- }
122
- export declare class SkipDataContextItem {
123
- /**
124
- * The type of the item, either "view", "query", "full_entity", or "sql", or "single_record"
125
- */
126
- Type: 'view' | 'query' | 'full_entity' | 'sql' | 'single_record';
127
- /**
128
- * The ID of the single record in the system, only used if type = 'single_record'
129
- */
130
- RecordID: number;
131
- /**
132
- * EntityID - the ID of the entity in the system, only used if type = 'full_entity', 'view', or 'single_record' --- for type of 'query' or 'sql' this property is not used as results can come from any number of entities in combination
133
- */
134
- EntityID?: number;
135
- /**
136
- * ViewID - the ID of the view in the system, only used if type = 'view'
137
- */
138
- ViewID?: number;
139
- /**
140
- * QueryID - the ID of the query in the system, only used if type = 'query'
141
- */
142
- QueryID?: number;
143
- /**
144
- * The name of the view, query, or entity in the system. Not used with type='single_record' or type='sql'
145
- */
146
- RecordName: string;
147
- /**
148
- * SQL - the SQL statement to execute, only used if type = 'sql'
149
- */
150
- SQL?: string;
151
- /**
152
- * The name of the entity in the system, only used if type = 'full_entity', 'view', or 'single_record' --- for type of 'query' or 'sql' this property is not used as results can come from any number of entities in combination
153
- */
154
- EntityName?: string;
155
- Fields: SkipDataContextFieldInfo[];
156
- /**
157
- * This field can be used at run time to stash the record ID in the database of the Data Context Item, if it was already saved. For items that haven't/won't be saved, this property can be ignored.
158
- */
159
- DataContextItemID?: number;
160
- /**
161
- * ViewEntity - the object instantiated that contains the metadata for the UserView being used - only populated if the type is 'view', also this is NOT to be sent to/from the API server, it is a placeholder that can be used
162
- * within a given tier like in the MJAPI server or Skip Server or in the UI.
163
- */
164
- ViewEntity?: UserViewEntityExtended;
165
- /**
166
- * Entity - the object that contains metadata for the entity being used, only populated if the type is 'full_entity' or 'view' - also this is NOT to be sent to/from the API server, it is a placeholder that can be used
167
- * within a given tier like in the MJAPI server or Skip Server or in the UI.
168
- */
169
- Entity?: EntityInfo;
170
- /** Additional Description has any other information that might be useful for someone (or an LLM) intepreting the contents of this data item */
171
- AdditionalDescription?: string;
172
- /**
173
- * Generated description of the item which is dependent on the type of the item
174
- */
175
- get Description(): string;
176
- /**
177
- * Populate the SkipDataContextItem from a UserViewEntity class instance
178
- * @param viewEntity
179
- */
180
- static FromViewEntity(viewEntity: UserViewEntityExtended): SkipDataContextItem;
181
- Data?: any[];
182
- ValidateDataExists(): boolean;
183
- }
184
- export declare class SkipDataContext {
185
- Items: SkipDataContextItem[];
186
- ValidateDataExists(): boolean;
187
- ConvertToSimpleObject(): any;
188
- CreateSimpleObjectTypeDefinition(): string;
189
- }
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SkipDataContext = exports.SkipDataContextItem = exports.SkipDataContextFieldInfo = exports.SkipDataRequest = exports.SkipAPIDataRequestResponse = exports.SkipAPIClarifyingQuestionResponse = exports.SkipAPIAnalysisCompleteResponse = exports.SkipAPIResponse = exports.SkipAPIRequest = exports.SkipMessage = exports.SubProcessResponse = void 0;
3
+ exports.SkipDataRequest = exports.SkipAPIDataRequestResponse = exports.SkipAPIClarifyingQuestionResponse = exports.SkipAPIAnalysisCompleteResponse = exports.SkipAPIResponse = exports.SkipAPIRequest = exports.SkipMessage = exports.SubProcessResponse = void 0;
4
4
  class SubProcessResponse {
5
5
  }
6
6
  exports.SubProcessResponse = SubProcessResponse;
@@ -46,95 +46,4 @@ exports.SkipAPIDataRequestResponse = SkipAPIDataRequestResponse;
46
46
  class SkipDataRequest {
47
47
  }
48
48
  exports.SkipDataRequest = SkipDataRequest;
49
- class SkipDataContextFieldInfo {
50
- }
51
- exports.SkipDataContextFieldInfo = SkipDataContextFieldInfo;
52
- class SkipDataContextItem {
53
- constructor() {
54
- /*
55
- * The fields in the view, query, or entity
56
- */
57
- this.Fields = [];
58
- }
59
- /**
60
- * Generated description of the item which is dependent on the type of the item
61
- */
62
- get Description() {
63
- let ret = '';
64
- switch (this.Type) {
65
- case 'view':
66
- ret = `View: ${this.RecordName}, From Entity: ${this.EntityName}`;
67
- break;
68
- case 'query':
69
- ret = `Query: ${this.RecordName}`;
70
- break;
71
- case 'full_entity':
72
- ret = `Full Entity - All Records: ${this.EntityName}`;
73
- break;
74
- case 'sql':
75
- ret = `SQL Statement: ${this.RecordName}`;
76
- break;
77
- default:
78
- ret = `Unknown Type: ${this.Type}`;
79
- break;
80
- }
81
- if (this.AdditionalDescription && this.AdditionalDescription.length > 0)
82
- ret += ` (More Info: ${this.AdditionalDescription})`;
83
- return ret;
84
- }
85
- /**
86
- * Populate the SkipDataContextItem from a UserViewEntity class instance
87
- * @param viewEntity
88
- */
89
- static FromViewEntity(viewEntity) {
90
- const instance = new SkipDataContextItem();
91
- // update our data from the viewEntity definition
92
- instance.ViewEntity = viewEntity;
93
- instance.Entity = viewEntity.ViewEntityInfo;
94
- instance.Type = 'view';
95
- instance.EntityName = viewEntity.ViewEntityInfo.Name;
96
- instance.RecordID = viewEntity.ID;
97
- instance.RecordName = viewEntity.Name;
98
- instance.Fields = viewEntity.ViewEntityInfo.Fields.map(f => {
99
- return {
100
- Name: f.Name,
101
- Type: f.Type,
102
- Description: f.Description
103
- };
104
- });
105
- return instance;
106
- }
107
- ValidateDataExists() {
108
- return this.Data ? this.Data.length >= 0 : false; // can have 0 to many rows, just need to make sure we have a Data object to work with
109
- }
110
- }
111
- exports.SkipDataContextItem = SkipDataContextItem;
112
- class SkipDataContext {
113
- constructor() {
114
- this.Items = [];
115
- }
116
- ValidateDataExists() {
117
- if (this.Items)
118
- return !this.Items.some(i => !i.ValidateDataExists()); // if any data item is invalid, return false
119
- else
120
- return false;
121
- }
122
- ConvertToSimpleObject() {
123
- // Return a simple object that will have a property for each item in our Items array. We will name each item sequentially as data_item_1, data_item_2, etc.
124
- const ret = {};
125
- for (let i = 0; i < this.Items.length; i++) {
126
- ret[`data_item_${i}`] = this.Items[i].Data;
127
- }
128
- return ret;
129
- }
130
- CreateSimpleObjectTypeDefinition() {
131
- let sOutput = "";
132
- for (let i = 0; i < this.Items.length; i++) {
133
- const item = this.Items[i];
134
- sOutput += `data_item_${i}: []; // ${item.Description}\n`;
135
- }
136
- return `{${sOutput}}`;
137
- }
138
- }
139
- exports.SkipDataContext = SkipDataContext;
140
49
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAGA,MAAa,kBAAkB;CAQ9B;AARD,gDAQC;AAGD;;GAEG;AACH,MAAa,WAAW;CASvB;AATD,kCASC;AAED;;GAEG;AACH,MAAa,cAAc;CA4B1B;AA5BD,wCA4BC;AAED;;GAEG;AACH,MAAa,eAAe;CAa3B;AAbD,0CAaC;AAED;;GAEG;AACH,MAAa,+BAAgC,SAAQ,eAAe;CAQnE;AARD,0EAQC;AAED;;GAEG;AACH,MAAa,iCAAkC,SAAQ,eAAe;CAErE;AAFD,8EAEC;AAED;;GAEG;AACH,MAAa,0BAA2B,SAAQ,eAAe;CAE9D;AA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AEM,gCAAgC;QACnC,IAAI,OAAO,GAAW,EAAE,CAAC;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC3B,OAAO,IAAI,aAAa,CAAC,YAAY,IAAI,CAAC,WAAW,IAAI,CAAC;QAC9D,CAAC;QACD,OAAO,IAAI,OAAO,GAAG,CAAC;IAC1B,CAAC;CACJ;AA3BD,0CA2BC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAIA,MAAa,kBAAkB;CAQ9B;AARD,gDAQC;AAGD;;GAEG;AACH,MAAa,WAAW;CASvB;AATD,kCASC;AAED;;GAEG;AACH,MAAa,cAAc;CA4B1B;AA5BD,wCA4BC;AAED;;GAEG;AACH,MAAa,eAAe;CAa3B;AAbD,0CAaC;AAED;;GAEG;AACH,MAAa,+BAAgC,SAAQ,eAAe;CAQnE;AARD,0EAQC;AAED;;GAEG;AACH,MAAa,iCAAkC,SAAQ,eAAe;CAErE;AAFD,8EAEC;AAED;;GAEG;AACH,MAAa,0BAA2B,SAAQ,eAAe;CAE9D;AAFD,gEAEC;AAED;;GAEG;AACH,MAAa,eAAe;CAa3B;AAbD,0CAaC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/skip-types",
3
- "version": "0.9.17",
3
+ "version": "0.9.19",
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,6 +19,7 @@
19
19
  "typescript": "^5.3.3"
20
20
  },
21
21
  "dependencies": {
22
- "@memberjunction/core-entities": "^0.9.123"
22
+ "@memberjunction/core-entities": "^0.9.125",
23
+ "@memberjunction/data-context": "^0.9.3"
23
24
  }
24
25
  }