@memberjunction/skip-types 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-types.d.ts +4 -4
- package/dist/agent-types.js +7 -17
- package/dist/agent-types.js.map +1 -1
- package/dist/api-types.d.ts +6 -6
- package/dist/api-types.js +6 -13
- package/dist/api-types.js.map +1 -1
- package/dist/artifact-types.js +1 -2
- package/dist/artifact-types.js.map +1 -1
- package/dist/auth-types.js +1 -5
- package/dist/auth-types.js.map +1 -1
- package/dist/child-spec.d.ts +72 -0
- package/dist/child-spec.d.ts.map +1 -0
- package/dist/child-spec.js +3 -0
- package/dist/child-spec.js.map +1 -0
- package/dist/component-option.d.ts +32 -0
- package/dist/component-option.d.ts.map +1 -0
- package/dist/component-option.js +3 -0
- package/dist/component-option.js.map +1 -0
- package/dist/component-props-events.d.ts +66 -0
- package/dist/component-props-events.d.ts.map +1 -0
- package/dist/component-props-events.js +3 -0
- package/dist/component-props-events.js.map +1 -0
- package/dist/conversation-types.d.ts +1 -1
- package/dist/conversation-types.js +3 -9
- package/dist/conversation-types.js.map +1 -1
- package/dist/data-requirements.d.ts +77 -0
- package/dist/data-requirements.d.ts.map +1 -0
- package/dist/data-requirements.js +3 -0
- package/dist/data-requirements.js.map +1 -0
- package/dist/entity-metadata-types.js +1 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -25
- package/dist/index.js.map +1 -1
- package/dist/query-types.js +7 -16
- package/dist/query-types.js.map +1 -1
- package/dist/response-types.d.ts +5 -5
- package/dist/response-types.js +7 -16
- package/dist/response-types.js.map +1 -1
- package/dist/root-spec.d.ts +72 -0
- package/dist/root-spec.d.ts.map +1 -0
- package/dist/root-spec.js +3 -0
- package/dist/root-spec.js.map +1 -0
- package/dist/runtime-types.d.ts +211 -0
- package/dist/runtime-types.d.ts.map +1 -0
- package/dist/runtime-types.js +3 -0
- package/dist/runtime-types.js.map +1 -0
- package/dist/shared.d.ts +44 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +3 -0
- package/dist/shared.js.map +1 -0
- package/dist/util.d.ts +1 -1
- package/dist/util.js +18 -36
- package/dist/util.js.map +1 -1
- package/package.json +8 -7
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,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;AAE7B,cAAc,QAAQ,CAAC"}
|
package/dist/query-types.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* This file contains types related to database queries, stored queries, and data requests
|
|
4
3
|
* within the Skip API system. These types define the structure for:
|
|
@@ -19,23 +18,20 @@
|
|
|
19
18
|
* IMPORTANT: These types implement interfaces from @memberjunction/core to ensure
|
|
20
19
|
* consistency between MJ and Skip. Property names use PascalCase to match MJ conventions.
|
|
21
20
|
*/
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.SkipLearningCycleQueryChange = exports.SkipQueryInfo = exports.SkipQueryEntityInfo = exports.SkipQueryParamInfo = exports.SkipQueryFieldInfo = exports.SkipDataRequest = exports.SkipDataRequestType = void 0;
|
|
24
21
|
/**
|
|
25
22
|
* Describes the different types of data requests the Skip API server can make for additional data.
|
|
26
23
|
* * sql: The Skip API server is asking for additional data to be gathered using a fully executable SQL statement
|
|
27
24
|
* * stored_query: The Skip API server is asking for additional data to be gathered using a stored query that is defined in the system within the Queries entity.
|
|
28
25
|
*/
|
|
29
|
-
|
|
26
|
+
export const SkipDataRequestType = {
|
|
30
27
|
sql: "sql",
|
|
31
28
|
stored_query: "stored_query"
|
|
32
29
|
};
|
|
33
30
|
/**
|
|
34
31
|
* This type is used to define the requested data whenever the Skip API server asks for additional data to be gathered
|
|
35
32
|
*/
|
|
36
|
-
class SkipDataRequest {
|
|
33
|
+
export class SkipDataRequest {
|
|
37
34
|
}
|
|
38
|
-
exports.SkipDataRequest = SkipDataRequest;
|
|
39
35
|
/**
|
|
40
36
|
* Metadata about individual fields within a stored query, including their data types,
|
|
41
37
|
* source entity mappings, and computed field information. This helps Skip understand
|
|
@@ -43,27 +39,24 @@ exports.SkipDataRequest = SkipDataRequest;
|
|
|
43
39
|
*
|
|
44
40
|
* Implements IQueryFieldInfoBase for consistency with MJCore types.
|
|
45
41
|
*/
|
|
46
|
-
class SkipQueryFieldInfo {
|
|
42
|
+
export class SkipQueryFieldInfo {
|
|
47
43
|
}
|
|
48
|
-
exports.SkipQueryFieldInfo = SkipQueryFieldInfo;
|
|
49
44
|
/**
|
|
50
45
|
* Parameter definitions for parameterized queries that use Nunjucks templates.
|
|
51
46
|
* Each parameter represents a dynamic value that can be passed when executing the query.
|
|
52
47
|
*
|
|
53
48
|
* Implements IQueryParameterInfoBase for consistency with MJCore types.
|
|
54
49
|
*/
|
|
55
|
-
class SkipQueryParamInfo {
|
|
50
|
+
export class SkipQueryParamInfo {
|
|
56
51
|
}
|
|
57
|
-
exports.SkipQueryParamInfo = SkipQueryParamInfo;
|
|
58
52
|
/**
|
|
59
53
|
* Metadata about entities referenced by a query. This helps Skip understand which
|
|
60
54
|
* entities are involved in each query and how they are being used.
|
|
61
55
|
*
|
|
62
56
|
* Implements IQueryEntityInfoBase for consistency with MJCore types.
|
|
63
57
|
*/
|
|
64
|
-
class SkipQueryEntityInfo {
|
|
58
|
+
export class SkipQueryEntityInfo {
|
|
65
59
|
}
|
|
66
|
-
exports.SkipQueryEntityInfo = SkipQueryEntityInfo;
|
|
67
60
|
/**
|
|
68
61
|
* Complete metadata about a stored query, including its SQL, approval status, quality ranking,
|
|
69
62
|
* and field definitions. This information allows Skip to understand and utilize pre-built
|
|
@@ -71,18 +64,16 @@ exports.SkipQueryEntityInfo = SkipQueryEntityInfo;
|
|
|
71
64
|
*
|
|
72
65
|
* Implements IQueryInfoBase for consistency with MJCore types.
|
|
73
66
|
*/
|
|
74
|
-
class SkipQueryInfo {
|
|
67
|
+
export class SkipQueryInfo {
|
|
75
68
|
constructor() {
|
|
76
69
|
this.CacheEnabled = false;
|
|
77
70
|
}
|
|
78
71
|
}
|
|
79
|
-
exports.SkipQueryInfo = SkipQueryInfo;
|
|
80
72
|
/**
|
|
81
73
|
* Represents a change to a query during the learning cycle process, allowing Skip
|
|
82
74
|
* to add new queries, update existing ones, or mark queries for deletion based on
|
|
83
75
|
* its analysis of conversation patterns and user needs.
|
|
84
76
|
*/
|
|
85
|
-
class SkipLearningCycleQueryChange {
|
|
77
|
+
export class SkipLearningCycleQueryChange {
|
|
86
78
|
}
|
|
87
|
-
exports.SkipLearningCycleQueryChange = SkipLearningCycleQueryChange;
|
|
88
79
|
//# sourceMappingURL=query-types.js.map
|
package/dist/query-types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-types.js","sourceRoot":"","sources":["../src/query-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query-types.js","sourceRoot":"","sources":["../src/query-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,GAAG,EAAE,KAAK;IACV,YAAY,EAAE,cAAc;CACtB,CAAC;AAGX;;GAEG;AACH,MAAM,OAAO,eAAe;CAmB3B;AAED;;;;;;GAMG;AACH,MAAM,OAAO,kBAAkB;CAyD9B;AAED;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;CAqC9B;AAED;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;CAiB/B;AAED;;;;;;GAMG;AACH,MAAM,OAAO,aAAa;IAA1B;QA8DI,iBAAY,GAAY,KAAK,CAAC;IAIlC,CAAC;CAAA;AAED;;;;GAIG;AACH,MAAM,OAAO,4BAA4B;CAGxC"}
|
package/dist/response-types.d.ts
CHANGED
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
* The analysis complete response is particularly comprehensive, containing component data,
|
|
16
16
|
* explanations, column metadata, drill-down information, and component options.
|
|
17
17
|
*/
|
|
18
|
-
import { SkipAPIResponse } from './api-types';
|
|
19
|
-
import type { SkipSubProcessResponse } from './conversation-types';
|
|
20
|
-
import type { SkipColumnInfo } from './entity-metadata-types';
|
|
21
|
-
import type { SkipDataRequest } from './query-types';
|
|
22
|
-
import type { SkipAPIArtifactRequest } from './artifact-types';
|
|
18
|
+
import { SkipAPIResponse } from './api-types.js';
|
|
19
|
+
import type { SkipSubProcessResponse } from './conversation-types.js';
|
|
20
|
+
import type { SkipColumnInfo } from './entity-metadata-types.js';
|
|
21
|
+
import type { SkipDataRequest } from './query-types.js';
|
|
22
|
+
import type { SkipAPIArtifactRequest } from './artifact-types.js';
|
|
23
23
|
import { ComponentOption, SimpleDataContext } from '@memberjunction/interactive-component-types';
|
|
24
24
|
import { AgentResponseForm } from '@memberjunction/ai-core-plus';
|
|
25
25
|
/**
|
package/dist/response-types.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* This file contains specialized response types that extend the base SkipAPIResponse for different
|
|
4
3
|
* response phases and scenarios. These types define the structure for:
|
|
@@ -16,43 +15,35 @@
|
|
|
16
15
|
* The analysis complete response is particularly comprehensive, containing component data,
|
|
17
16
|
* explanations, column metadata, drill-down information, and component options.
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
exports.SkipAPIChatWithRecordResponse = exports.SkipAPIDataRequestResponse = exports.SkipAPIClarifyingQuestionResponse = exports.SkipAPIAnalysisCompleteResponse = exports.SkipAPIAnalysisDrillDown = exports.SkipAPIAnalysisDrillDownFilter = void 0;
|
|
21
|
-
const api_types_1 = require("./api-types");
|
|
18
|
+
import { SkipAPIResponse } from './api-types.js';
|
|
22
19
|
/**
|
|
23
20
|
* 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
|
|
24
21
|
*/
|
|
25
|
-
class SkipAPIAnalysisDrillDownFilter {
|
|
22
|
+
export class SkipAPIAnalysisDrillDownFilter {
|
|
26
23
|
}
|
|
27
|
-
exports.SkipAPIAnalysisDrillDownFilter = SkipAPIAnalysisDrillDownFilter;
|
|
28
24
|
/**
|
|
29
25
|
* 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
|
|
30
26
|
*/
|
|
31
|
-
class SkipAPIAnalysisDrillDown {
|
|
27
|
+
export class SkipAPIAnalysisDrillDown {
|
|
32
28
|
}
|
|
33
|
-
exports.SkipAPIAnalysisDrillDown = SkipAPIAnalysisDrillDown;
|
|
34
29
|
/**
|
|
35
30
|
* Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'analysis_complete'
|
|
36
31
|
*/
|
|
37
|
-
class SkipAPIAnalysisCompleteResponse extends
|
|
32
|
+
export class SkipAPIAnalysisCompleteResponse extends SkipAPIResponse {
|
|
38
33
|
}
|
|
39
|
-
exports.SkipAPIAnalysisCompleteResponse = SkipAPIAnalysisCompleteResponse;
|
|
40
34
|
/**
|
|
41
35
|
* Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'clarifying_question'
|
|
42
36
|
*/
|
|
43
|
-
class SkipAPIClarifyingQuestionResponse extends
|
|
37
|
+
export class SkipAPIClarifyingQuestionResponse extends SkipAPIResponse {
|
|
44
38
|
}
|
|
45
|
-
exports.SkipAPIClarifyingQuestionResponse = SkipAPIClarifyingQuestionResponse;
|
|
46
39
|
/**
|
|
47
40
|
* Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'data_request'
|
|
48
41
|
*/
|
|
49
|
-
class SkipAPIDataRequestResponse extends
|
|
42
|
+
export class SkipAPIDataRequestResponse extends SkipAPIResponse {
|
|
50
43
|
}
|
|
51
|
-
exports.SkipAPIDataRequestResponse = SkipAPIDataRequestResponse;
|
|
52
44
|
/**
|
|
53
45
|
* Defines the shape of the data that is returned by the Skip API Server when the responsePhase is 'chat_with_a_record_complete'
|
|
54
46
|
*/
|
|
55
|
-
class SkipAPIChatWithRecordResponse extends
|
|
47
|
+
export class SkipAPIChatWithRecordResponse extends SkipAPIResponse {
|
|
56
48
|
}
|
|
57
|
-
exports.SkipAPIChatWithRecordResponse = SkipAPIChatWithRecordResponse;
|
|
58
49
|
//# sourceMappingURL=response-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-types.js","sourceRoot":"","sources":["../src/response-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response-types.js","sourceRoot":"","sources":["../src/response-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQ9C;;GAEG;AACH,MAAM,OAAO,8BAA8B;CAG1C;AAED;;GAEG;AACH,MAAM,OAAO,wBAAwB;CAepC;AAED;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,eAAe;CAyEnE;AAED;;GAEG;AACH,MAAM,OAAO,iCAAkC,SAAQ,eAAe;CAiBrE;AAED;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,eAAe;CAE9D;AAED;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,eAAe;CAKjE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { SkipComponentChildSpec } from "./child-spec.js";
|
|
2
|
+
import { SkipComponentDataRequirements } from "./data-requirements.js";
|
|
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 SkipComponentRootSpec = {
|
|
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?: SkipComponentDataRequirements;
|
|
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: SkipComponentChildSpec[];
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-spec.d.ts","sourceRoot":"","sources":["../src/root-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEpE;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;;;;OAOG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,6BAA6B,CAAC;IAEjD;;;;;;;;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,sBAAsB,EAAE,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-spec.js","sourceRoot":"","sources":["../src/root-spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { CompositeKey } from "@memberjunction/core";
|
|
2
|
+
import { SimpleDataContext } from "./shared.js";
|
|
3
|
+
import { SimpleMetadata, SimpleRunQuery, SimpleRunView } from "./shared.js";
|
|
4
|
+
/**
|
|
5
|
+
* Available callbacks a component can call.
|
|
6
|
+
*/
|
|
7
|
+
export interface SkipComponentCallbacks {
|
|
8
|
+
/**
|
|
9
|
+
* 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.
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
12
|
+
RefreshData: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* If an action occurs inside a component where it would be desirable for the containing UI to open a specific
|
|
15
|
+
* record, if supported, this event can be listened to and the container UI can then open the record.
|
|
16
|
+
* @param entityName - this is the Entity NAME from the Entity metadata, not the table name or base view name. Use Entity Metadata to provide the entity name here
|
|
17
|
+
* @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
|
|
18
|
+
*/
|
|
19
|
+
OpenEntityRecord: (entityName: string, key: CompositeKey) => void;
|
|
20
|
+
/**
|
|
21
|
+
* This event should be raised whenever something changes within the component that should be tracked as a change in state
|
|
22
|
+
* that will persist. userState is any valid serializable JavaScript object. This state is passed to the component when it
|
|
23
|
+
* initializes.
|
|
24
|
+
*/
|
|
25
|
+
UpdateUserState: (userState: any) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Other notifications that a component might want to send to the parent.
|
|
28
|
+
*/
|
|
29
|
+
NotifyEvent: (eventName: string, eventData: any) => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Function signature for the initialization function of each component.
|
|
33
|
+
* This function is called when the component is loaded by its container. The function receives the data context, an optional userState property, and a set of callbacks that can be used to interact with the parent component.
|
|
34
|
+
* userState is an optional parameter that can be used to pass in any state information that the parent component wants to provide to the component that is specific
|
|
35
|
+
* to the CURRENT user. If the component modifies the userState, it should notify the parent component via the UserStateChanged event in the callbacks object so that the parent component can handle storage.
|
|
36
|
+
*/
|
|
37
|
+
export type SkipComponentInitFunction = (params: SkipComponentInitParams) => void;
|
|
38
|
+
/**
|
|
39
|
+
* This is the function signature for the print function that is provided by the component via the SkipComponentObject
|
|
40
|
+
*/
|
|
41
|
+
export type SkipComponentPrintFunction = () => void;
|
|
42
|
+
/**
|
|
43
|
+
* This is the function signature for the refresh function that is provided by the component via the SkipComponentObject
|
|
44
|
+
*/
|
|
45
|
+
export type SkipComponentRefreshFunction = () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Parameters that are passed to the SkipComponentInitFunction when it is called by the parent component.
|
|
48
|
+
*/
|
|
49
|
+
export interface SkipComponentInitParams {
|
|
50
|
+
/**
|
|
51
|
+
* Contains the static data specified by the root component specification. This data is pre-loaded and passed to
|
|
52
|
+
* the component during initialization and anytime the component is refreshed.
|
|
53
|
+
*/
|
|
54
|
+
staticData: SimpleDataContext;
|
|
55
|
+
/**
|
|
56
|
+
* Contains the dynamic data utilities that the component can use to access MemberJunction data. This includes
|
|
57
|
+
* the metadata, run view, and run query utilities that the component can use to access data dynamically at runtime.
|
|
58
|
+
* The component can use these utilities to fetch data at runtime based on the user's interactions with the component.
|
|
59
|
+
*/
|
|
60
|
+
utilities?: SkipComponentUtilities;
|
|
61
|
+
/**
|
|
62
|
+
* Any valid serializable JavaScript object that represents the user-specific state for the component.
|
|
63
|
+
*/
|
|
64
|
+
userState?: any;
|
|
65
|
+
/**
|
|
66
|
+
* Callbacks that the component can use to interact with the parent component. These callbacks allow the component to refresh data, open records, update user state, and send custom events.
|
|
67
|
+
*/
|
|
68
|
+
callbacks?: SkipComponentCallbacks;
|
|
69
|
+
/**
|
|
70
|
+
* The default styles the component should use as specified by its parent (the container in the case of a root component, or a parent component in the case
|
|
71
|
+
* of a child component). The component can alter these styles based on the requirements specified by the user in its design documentation.
|
|
72
|
+
*/
|
|
73
|
+
styles?: SkipComponentStyles;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* This interface defines styles that can be applied to the component. The container can provide
|
|
77
|
+
* styles to the top level component. The top level component can alter these styles based on
|
|
78
|
+
* the prompting of the user, learned notes, etc, and adjust the styles of the component accordingly. In addition
|
|
79
|
+
* the top level component will pass in its computed styles to each sub-component so that the sub-components
|
|
80
|
+
* can do the same recursively down to any level of depth. This allows sub-components to inherit styles but
|
|
81
|
+
* also make adjustments as required based on functional needs and user input.
|
|
82
|
+
*/
|
|
83
|
+
export interface SkipComponentStyles {
|
|
84
|
+
colors: {
|
|
85
|
+
primary: string;
|
|
86
|
+
primaryHover: string;
|
|
87
|
+
primaryLight?: string;
|
|
88
|
+
secondary: string;
|
|
89
|
+
secondaryHover?: string;
|
|
90
|
+
success: string;
|
|
91
|
+
successLight?: string;
|
|
92
|
+
warning?: string;
|
|
93
|
+
warningLight?: string;
|
|
94
|
+
error?: string;
|
|
95
|
+
errorLight?: string;
|
|
96
|
+
info?: string;
|
|
97
|
+
infoLight?: string;
|
|
98
|
+
background: string;
|
|
99
|
+
surface: string;
|
|
100
|
+
surfaceHover?: string;
|
|
101
|
+
text: string;
|
|
102
|
+
textSecondary: string;
|
|
103
|
+
textTertiary?: string;
|
|
104
|
+
textInverse?: string;
|
|
105
|
+
border: string;
|
|
106
|
+
borderLight?: string;
|
|
107
|
+
borderFocus?: string;
|
|
108
|
+
shadow?: string;
|
|
109
|
+
shadowMedium?: string;
|
|
110
|
+
shadowLarge?: string;
|
|
111
|
+
[key: string]: string | undefined;
|
|
112
|
+
};
|
|
113
|
+
spacing: {
|
|
114
|
+
xs: string;
|
|
115
|
+
sm: string;
|
|
116
|
+
md: string;
|
|
117
|
+
lg: string;
|
|
118
|
+
xl: string;
|
|
119
|
+
xxl?: string;
|
|
120
|
+
xxxl?: string;
|
|
121
|
+
[key: string]: string | undefined;
|
|
122
|
+
};
|
|
123
|
+
typography: {
|
|
124
|
+
fontFamily: string;
|
|
125
|
+
fontSize: {
|
|
126
|
+
xs?: string;
|
|
127
|
+
sm: string;
|
|
128
|
+
md: string;
|
|
129
|
+
lg: string;
|
|
130
|
+
xl: string;
|
|
131
|
+
xxl?: string;
|
|
132
|
+
xxxl?: string;
|
|
133
|
+
[key: string]: string | undefined;
|
|
134
|
+
};
|
|
135
|
+
fontWeight?: {
|
|
136
|
+
light?: string;
|
|
137
|
+
regular?: string;
|
|
138
|
+
medium?: string;
|
|
139
|
+
semibold?: string;
|
|
140
|
+
bold?: string;
|
|
141
|
+
[key: string]: string | undefined;
|
|
142
|
+
};
|
|
143
|
+
lineHeight?: {
|
|
144
|
+
tight?: string;
|
|
145
|
+
normal?: string;
|
|
146
|
+
relaxed?: string;
|
|
147
|
+
[key: string]: string | undefined;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
borders: {
|
|
151
|
+
radius: string | {
|
|
152
|
+
sm?: string;
|
|
153
|
+
md?: string;
|
|
154
|
+
lg?: string;
|
|
155
|
+
xl?: string;
|
|
156
|
+
full?: string;
|
|
157
|
+
[key: string]: string | undefined;
|
|
158
|
+
};
|
|
159
|
+
width: string | {
|
|
160
|
+
thin?: string;
|
|
161
|
+
medium?: string;
|
|
162
|
+
thick?: string;
|
|
163
|
+
[key: string]: string | undefined;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
shadows?: {
|
|
167
|
+
sm?: string;
|
|
168
|
+
md?: string;
|
|
169
|
+
lg?: string;
|
|
170
|
+
xl?: string;
|
|
171
|
+
inner?: string;
|
|
172
|
+
[key: string]: string | undefined;
|
|
173
|
+
};
|
|
174
|
+
transitions?: {
|
|
175
|
+
fast?: string;
|
|
176
|
+
normal?: string;
|
|
177
|
+
slow?: string;
|
|
178
|
+
[key: string]: string | undefined;
|
|
179
|
+
};
|
|
180
|
+
overflow: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* This is the interface that each Skip component will expose to the parent component and assign it a name globally on the window object so that the parent component can call it.
|
|
184
|
+
* The component will create this object and it will include the members defined in this interface.
|
|
185
|
+
*/
|
|
186
|
+
export interface SkipComponentObject {
|
|
187
|
+
/**
|
|
188
|
+
* The React component that Angular will render directly using ReactDOM.
|
|
189
|
+
* This component receives props including data, userState, callbacks, utilities, and styles.
|
|
190
|
+
*/
|
|
191
|
+
component: any;
|
|
192
|
+
/**
|
|
193
|
+
* The optional print function that is called when the user clicks on the print button in the parent of the component. This function will never be called by the parent before the init function so the print function
|
|
194
|
+
* can assume the component has been initialized;
|
|
195
|
+
*/
|
|
196
|
+
print?: SkipComponentPrintFunction;
|
|
197
|
+
/**
|
|
198
|
+
* The optional refresh function that is called when the user clicks on the refresh button in the parent of the component. This function will never be called by the parent before the init function so the refresh function
|
|
199
|
+
*/
|
|
200
|
+
refresh?: SkipComponentRefreshFunction;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* This interface defines the utilities that are available to the Skip component. These utilities are used to interact with the host MemberJunction system to
|
|
204
|
+
* retrieve metadata, run views, and run queries. The utilities are passed into the SkipComponentInitFunction by the container.
|
|
205
|
+
*/
|
|
206
|
+
export interface SkipComponentUtilities {
|
|
207
|
+
md: SimpleMetadata;
|
|
208
|
+
rv: SimpleRunView;
|
|
209
|
+
rq: SimpleRunQuery;
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=runtime-types.d.ts.map
|
|
@@ -0,0 +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,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAA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MAAM,CAAA;QACX,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,KAAK,CAAC,EAAE,MAAM,CAAA;QAGd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACrC,CAAA;IACD,WAAW,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QAGb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACrC,CAAA;IACD,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;OAGG;IACH,SAAS,EAAE,GAAG,CAAC;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,0BAA0B,CAAC;IAEnC;;OAEG;IACH,OAAO,CAAC,EAAE,4BAA4B,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,cAAc,CAAC;IACnB,EAAE,EAAE,aAAa,CAAC;IAClB,EAAE,EAAE,cAAc,CAAA;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-types.js","sourceRoot":"","sources":["../src/runtime-types.ts"],"names":[],"mappings":""}
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { RunQueryParams, RunQueryResult, RunViewParams, RunViewResult } from "@memberjunction/core";
|
|
2
|
+
import { SkipEntityInfo } from "./entity-metadata-types.js";
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":""}
|
package/dist/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EntityFieldInfo, EntityFieldValueInfo, EntityInfo, EntityRelationshipInfo } from "@memberjunction/core";
|
|
2
2
|
import { SimpleEntityInfo, SimpleEntityFieldInfo } from "@memberjunction/interactive-component-types";
|
|
3
|
-
import { SkipEntityFieldInfo, SkipEntityFieldValueInfo, SkipEntityInfo, SkipEntityRelationshipInfo } from "./entity-metadata-types";
|
|
3
|
+
import { SkipEntityFieldInfo, SkipEntityFieldValueInfo, SkipEntityInfo, SkipEntityRelationshipInfo } from "./entity-metadata-types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Maps a MemberJunction EntityInfo object to a SkipEntityInfo object for use in the Skip query system.
|
|
6
6
|
*
|