@memberjunction/skip-types 2.44.0 → 2.46.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.
Files changed (54) hide show
  1. package/dist/agent-types.d.ts +251 -0
  2. package/dist/agent-types.d.ts.map +1 -0
  3. package/dist/agent-types.js +76 -0
  4. package/dist/agent-types.js.map +1 -0
  5. package/dist/api-types.d.ts +212 -0
  6. package/dist/api-types.d.ts.map +1 -0
  7. package/dist/api-types.js +80 -0
  8. package/dist/api-types.js.map +1 -0
  9. package/dist/artifact-types.d.ts +142 -0
  10. package/dist/artifact-types.d.ts.map +1 -0
  11. package/dist/artifact-types.js +26 -0
  12. package/dist/artifact-types.js.map +1 -0
  13. package/dist/auth-types.d.ts +39 -0
  14. package/dist/auth-types.d.ts.map +1 -0
  15. package/dist/auth-types.js +32 -0
  16. package/dist/auth-types.js.map +1 -0
  17. package/dist/component-types.d.ts +351 -0
  18. package/dist/component-types.d.ts.map +1 -0
  19. package/dist/component-types.js +28 -0
  20. package/dist/component-types.js.map +1 -0
  21. package/dist/conversation-types.d.ts +141 -0
  22. package/dist/conversation-types.d.ts.map +1 -0
  23. package/dist/conversation-types.js +46 -0
  24. package/dist/conversation-types.js.map +1 -0
  25. package/dist/entity-metadata-types.d.ts +125 -0
  26. package/dist/entity-metadata-types.d.ts.map +1 -0
  27. package/dist/entity-metadata-types.js +78 -0
  28. package/dist/entity-metadata-types.js.map +1 -0
  29. package/dist/index.d.ts +11 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +12 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/query-types.d.ts +112 -0
  34. package/dist/query-types.d.ts.map +1 -0
  35. package/dist/query-types.js +65 -0
  36. package/dist/query-types.js.map +1 -0
  37. package/dist/response-types.d.ts +156 -0
  38. package/dist/response-types.d.ts.map +1 -0
  39. package/dist/response-types.js +63 -0
  40. package/dist/response-types.js.map +1 -0
  41. package/dist/shared.d.ts +44 -0
  42. package/dist/shared.d.ts.map +1 -0
  43. package/dist/shared.js +3 -0
  44. package/dist/shared.js.map +1 -0
  45. package/dist/types.d.ts +31 -1057
  46. package/dist/types.d.ts.map +1 -1
  47. package/dist/types.js +45 -211
  48. package/dist/types.js.map +1 -1
  49. package/dist/util.d.ts +68 -0
  50. package/dist/util.d.ts.map +1 -0
  51. package/dist/util.js +201 -0
  52. package/dist/util.js.map +1 -0
  53. package/package.json +3 -3
  54. package/readme.md +19 -19
@@ -0,0 +1,156 @@
1
+ /**
2
+ * @fileoverview Specific API response types for Skip API
3
+ *
4
+ * This file contains specialized response types that extend the base SkipAPIResponse for different
5
+ * response phases and scenarios. These types define the structure for:
6
+ *
7
+ * - Analysis completion responses (SkipAPIAnalysisCompleteResponse)
8
+ * - Clarifying question responses (SkipAPIClarifyingQuestionResponse)
9
+ * - Data request responses (SkipAPIDataRequestResponse)
10
+ * - Chat with record responses (SkipAPIChatWithRecordResponse)
11
+ * - Drill-down functionality for components (SkipAPIAnalysisDrillDown, SkipAPIAnalysisDrillDownFilter)
12
+ *
13
+ * Each response type corresponds to a specific responsePhase value and contains additional
14
+ * properties relevant to that particular type of response. These specialized response types
15
+ * allow clients to access type-safe, context-specific data based on the response phase.
16
+ *
17
+ * The analysis complete response is particularly comprehensive, containing component data,
18
+ * explanations, column metadata, drill-down information, and component options.
19
+ *
20
+ * @author MemberJunction
21
+ * @since 2.0.0
22
+ */
23
+ import { SkipAPIResponse } from './api-types';
24
+ import type { SkipSubProcessResponse } from './conversation-types';
25
+ import type { SkipColumnInfo } from './entity-metadata-types';
26
+ import type { SkipDataRequest } from './query-types';
27
+ import type { SkipAPIArtifactRequest } from './artifact-types';
28
+ import { SimpleDataContext } from './shared';
29
+ import { SkipComponentOption } from './component-types';
30
+ /**
31
+ * Defines an individual filter that will be used to filter the data in the view to the specific row or rows that the user clicked on for a drill down
32
+ */
33
+ export declare class SkipAPIAnalysisDrillDownFilter {
34
+ componentFieldName: string;
35
+ viewFieldName: string;
36
+ }
37
+ /**
38
+ * Defines the filtering information necessary for a component UI to enable behavior to drill down when a user clicks on a portion of a component like an element of a chart or a row in a table
39
+ */
40
+ export declare class SkipAPIAnalysisDrillDown {
41
+ /**
42
+ * The name of the view in the database that we should drill into whenever a user clicks on an element in the component
43
+ */
44
+ viewName: string;
45
+ /**
46
+ * If the data context that was provided to Skip for generating a component had filtered data related to the drill down view noted in viewName property, then this
47
+ * baseFilter value will be populated with a SQL filter that can be added to a WHERE clause with an AND statement to ensure that the filtering is inclusive of the
48
+ * data context's in-built filters.
49
+ */
50
+ baseFilter: string;
51
+ /**
52
+ * One or more filters that are used to filter the data in the view to the specific row or rows that the user clicked on
53
+ */
54
+ filters: SkipAPIAnalysisDrillDownFilter[];
55
+ }
56
+ /**
57
+ * Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'analysis_complete'
58
+ */
59
+ export declare class SkipAPIAnalysisCompleteResponse extends SkipAPIResponse {
60
+ /**
61
+ * The data context that was passed in with the request, this is used to know the source data at the time the process was executed and for simple persistence.
62
+ */
63
+ dataContext: SimpleDataContext;
64
+ /**
65
+ * The type of component generated, data is a simple table, plot is a chart and html is a custom HTML component
66
+ * For data/plot types, the results will be server-generated and available in the executionResults property
67
+ * For html type, the executionResults will be null because the server generates an HTML component that is intended to run on the client.
68
+ */
69
+ resultType: "data" | "plot" | "html" | null;
70
+ /**
71
+ * The results of the execution of the sub-process to run the server-side script
72
+ */
73
+ executionResults?: SkipSubProcessResponse | null;
74
+ /**
75
+ * A user-friendly explanation of what the component does
76
+ */
77
+ userExplanation?: string;
78
+ /**
79
+ * A more detailed technical explanation of what the component does and how it works
80
+ */
81
+ techExplanation?: string;
82
+ /**
83
+ * Describes each column in the component's computed data output that is what is displayed in either a table or a chart
84
+ */
85
+ tableDataColumns?: SkipColumnInfo[];
86
+ /**
87
+ * Zero or more suggested questions that the AI engine suggests might be good follow up questions to ask after reviewing the provided component
88
+ */
89
+ suggestedQuestions?: string[] | null;
90
+ /**
91
+ * Legacy property that is no longer used, but is kept for backwards compatibility
92
+ * @deprecated This property is no longer used and will be removed in a future version. Use the `title` property instead.
93
+ */
94
+ reportTitle?: string | null;
95
+ /**
96
+ * The title of the component
97
+ */
98
+ title?: string | null;
99
+ /**
100
+ * An analysis of the component, the data and the formatted component output.
101
+ */
102
+ analysis?: string | null;
103
+ /**
104
+ * Information that will support a drill-down experience in the component UI
105
+ */
106
+ drillDown?: SkipAPIAnalysisDrillDown | null;
107
+ /**
108
+ * The script text that was used to generated the component and can be saved to be run again later
109
+ */
110
+ scriptText?: string | null;
111
+ /**
112
+ * When provided, this array of data requests indicate to the caller of the Skip API that Skip was able to retrieve, on his own, additional data
113
+ * BEYOND what was provided in the SkipAPIRequest object. The caller of the Skip API should update its internal representation of its data context
114
+ * to include these new data items so that they will be run and provided to Skip for future iterations/requests and for re-running components as well.
115
+ */
116
+ newDataItems?: SkipDataRequest[];
117
+ /**
118
+ * Contains a list of all the possible components that were generated (1 or more) for the given request.
119
+ */
120
+ componentOptions?: SkipComponentOption[];
121
+ /**
122
+ * If the AI Agent decides it would be best to display the result in an artifact, this information can be used by the calling application to properly
123
+ * associate this specific response with the artifact that is being created. This is typically used for output that is likely to have iterations where
124
+ * artifacts are a clean way of managing a UI in the calling application where you can show multiple versions/etc.
125
+ */
126
+ artifactRequest?: SkipAPIArtifactRequest;
127
+ }
128
+ /**
129
+ * Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'clarifying_question'
130
+ */
131
+ export declare class SkipAPIClarifyingQuestionResponse extends SkipAPIResponse {
132
+ /**
133
+ * The question to display to the user from the AI model after a request is made to the AI when the AI needs more information to process the request
134
+ */
135
+ clarifyingQuestion: string;
136
+ /**
137
+ * Zero or more suggested answers that the AI model suggests might be good responses to the clarifying question
138
+ */
139
+ suggestedAnswers: string[];
140
+ }
141
+ /**
142
+ * Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'data_request'
143
+ */
144
+ export declare class SkipAPIDataRequestResponse extends SkipAPIResponse {
145
+ dataRequest: SkipDataRequest[];
146
+ }
147
+ /**
148
+ * Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'chat_with_a_record_complete'
149
+ */
150
+ export declare class SkipAPIChatWithRecordResponse extends SkipAPIResponse {
151
+ /**
152
+ * The response from the AI model regarding the user request
153
+ */
154
+ response: string;
155
+ }
156
+ //# sourceMappingURL=response-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-types.d.ts","sourceRoot":"","sources":["../src/response-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD;;GAEG;AACH,qBAAa,8BAA8B;IACvC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,qBAAa,wBAAwB;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,EAAE,8BAA8B,EAAE,CAAC;CAC7C;AAED;;GAEG;AACH,qBAAa,+BAAgC,SAAQ,eAAe;IAChE;;OAEG;IACH,WAAW,EAAE,iBAAiB,CAAC;IAC/B;;;;OAIG;IACH,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5C;;OAEG;IACH,gBAAgB,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACjD;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,cAAc,EAAE,CAAC;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAErC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC5C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IAEjC;;OAEG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC;;;;OAIG;IACH,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC5C;AAED;;GAEG;AACH,qBAAa,iCAAkC,SAAQ,eAAe;IAClE;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,eAAe;IAC3D,WAAW,EAAE,eAAe,EAAE,CAAC;CAClC;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,eAAe;IAC9D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACnB"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Specific API response types for Skip API
4
+ *
5
+ * This file contains specialized response types that extend the base SkipAPIResponse for different
6
+ * response phases and scenarios. These types define the structure for:
7
+ *
8
+ * - Analysis completion responses (SkipAPIAnalysisCompleteResponse)
9
+ * - Clarifying question responses (SkipAPIClarifyingQuestionResponse)
10
+ * - Data request responses (SkipAPIDataRequestResponse)
11
+ * - Chat with record responses (SkipAPIChatWithRecordResponse)
12
+ * - Drill-down functionality for components (SkipAPIAnalysisDrillDown, SkipAPIAnalysisDrillDownFilter)
13
+ *
14
+ * Each response type corresponds to a specific responsePhase value and contains additional
15
+ * properties relevant to that particular type of response. These specialized response types
16
+ * allow clients to access type-safe, context-specific data based on the response phase.
17
+ *
18
+ * The analysis complete response is particularly comprehensive, containing component data,
19
+ * explanations, column metadata, drill-down information, and component options.
20
+ *
21
+ * @author MemberJunction
22
+ * @since 2.0.0
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.SkipAPIChatWithRecordResponse = exports.SkipAPIDataRequestResponse = exports.SkipAPIClarifyingQuestionResponse = exports.SkipAPIAnalysisCompleteResponse = exports.SkipAPIAnalysisDrillDown = exports.SkipAPIAnalysisDrillDownFilter = void 0;
26
+ const api_types_1 = require("./api-types");
27
+ /**
28
+ * Defines an individual filter that will be used to filter the data in the view to the specific row or rows that the user clicked on for a drill down
29
+ */
30
+ class SkipAPIAnalysisDrillDownFilter {
31
+ }
32
+ exports.SkipAPIAnalysisDrillDownFilter = SkipAPIAnalysisDrillDownFilter;
33
+ /**
34
+ * Defines the filtering information necessary for a component UI to enable behavior to drill down when a user clicks on a portion of a component like an element of a chart or a row in a table
35
+ */
36
+ class SkipAPIAnalysisDrillDown {
37
+ }
38
+ exports.SkipAPIAnalysisDrillDown = SkipAPIAnalysisDrillDown;
39
+ /**
40
+ * Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'analysis_complete'
41
+ */
42
+ class SkipAPIAnalysisCompleteResponse extends api_types_1.SkipAPIResponse {
43
+ }
44
+ exports.SkipAPIAnalysisCompleteResponse = SkipAPIAnalysisCompleteResponse;
45
+ /**
46
+ * Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'clarifying_question'
47
+ */
48
+ class SkipAPIClarifyingQuestionResponse extends api_types_1.SkipAPIResponse {
49
+ }
50
+ exports.SkipAPIClarifyingQuestionResponse = SkipAPIClarifyingQuestionResponse;
51
+ /**
52
+ * Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'data_request'
53
+ */
54
+ class SkipAPIDataRequestResponse extends api_types_1.SkipAPIResponse {
55
+ }
56
+ exports.SkipAPIDataRequestResponse = SkipAPIDataRequestResponse;
57
+ /**
58
+ * Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'chat_with_a_record_complete'
59
+ */
60
+ class SkipAPIChatWithRecordResponse extends api_types_1.SkipAPIResponse {
61
+ }
62
+ exports.SkipAPIChatWithRecordResponse = SkipAPIChatWithRecordResponse;
63
+ //# sourceMappingURL=response-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-types.js","sourceRoot":"","sources":["../src/response-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAEH,2CAA8C;AAQ9C;;GAEG;AACH,MAAa,8BAA8B;CAG1C;AAHD,wEAGC;AAED;;GAEG;AACH,MAAa,wBAAwB;CAepC;AAfD,4DAeC;AAED;;GAEG;AACH,MAAa,+BAAgC,SAAQ,2BAAe;CAwEnE;AAxED,0EAwEC;AAED;;GAEG;AACH,MAAa,iCAAkC,SAAQ,2BAAe;CASrE;AATD,8EASC;AAED;;GAEG;AACH,MAAa,0BAA2B,SAAQ,2BAAe;CAE9D;AAFD,gEAEC;AAED;;GAEG;AACH,MAAa,6BAA8B,SAAQ,2BAAe;CAKjE;AALD,sEAKC"}
@@ -0,0 +1,44 @@
1
+ import { RunQueryParams, RunQueryResult, RunViewParams, RunViewResult } from "@memberjunction/core";
2
+ import { SkipEntityInfo } from "./entity-metadata-types";
3
+ /**
4
+ * This is a simple data context object that is passed into the SkipComponentInitFunction, it contains a property for each of the data context items and typically are named
5
+ * data_item_1, data_item_2, etc. The data context is a simple JavaScript object that contains properties that are in turn data objects which are typically arrays of things, but can be anything.
6
+ */
7
+ export type SimpleDataContext = {
8
+ [key: string]: any;
9
+ };
10
+ /**
11
+ * Simple version of the @interface Metadata MemberJunction object that is passed to the Skip component.
12
+ */
13
+ export interface SimpleMetadata {
14
+ entities: SkipEntityInfo[];
15
+ }
16
+ /**
17
+ * Simple interface for running views in MemberJunction that can be used by components generated by Skip
18
+ */
19
+ export interface SimpleRunView {
20
+ /**
21
+ * Run a single view and return the results. The view is run dynamically against the MemberJunction host environment.
22
+ * @param params
23
+ * @returns
24
+ */
25
+ runView: (params: RunViewParams) => Promise<RunViewResult>;
26
+ /**
27
+ * Runs multiple views and returns the results. This is useful for running multiple views in parallel and returning the results in a single call.
28
+ * @param params
29
+ * @returns
30
+ */
31
+ runViews: (params: RunViewParams[]) => Promise<RunViewResult[]>;
32
+ }
33
+ /**
34
+ * Simple interface for running predefined queries in MemberJunction that can be used by components generated by Skip
35
+ */
36
+ export interface SimpleRunQuery {
37
+ /**
38
+ * Run a single predefined query and return the results. The query is run dynamically against the MemberJunction host environment.
39
+ * @param params
40
+ * @returns
41
+ */
42
+ runQuery: (params: RunQueryParams) => Promise<RunQueryResult>;
43
+ }
44
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,cAAc,EAAE,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;;;OAIG;IACH,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IAC1D;;;;OAIG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;CAClE;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;OAIG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;CAChE"}
package/dist/shared.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":""}