@memberjunction/interactive-component-types 2.73.0 → 2.74.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,50 +1,77 @@
|
|
|
1
|
-
import { DataContext } from "@memberjunction/data-context";
|
|
2
|
-
/**
|
|
3
|
-
* This interface is critical for understanding how components interact with MemberJunction data
|
|
4
|
-
*/
|
|
5
1
|
export interface ComponentDataRequirements {
|
|
6
2
|
/**
|
|
7
|
-
*
|
|
8
|
-
* - '
|
|
9
|
-
* - '
|
|
10
|
-
* - 'hybrid':
|
|
11
|
-
*/
|
|
12
|
-
mode: '
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Description of how the static data is used by the component
|
|
25
|
-
*/
|
|
26
|
-
description?: string;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* For dynamic mode: Defines which MemberJunction entities this component needs access to.
|
|
30
|
-
* The component will use the RunView/RunQuery utilities to fetch data at runtime.
|
|
31
|
-
*/
|
|
32
|
-
dynamicData?: {
|
|
33
|
-
/**
|
|
34
|
-
* Describes the entities and fields the component will
|
|
35
|
-
* need to fulfill user requirements.
|
|
36
|
-
*/
|
|
37
|
-
requiredEntities: ComponentEntityDataRequirement[];
|
|
38
|
-
/**
|
|
39
|
-
* Description of data access patterns
|
|
40
|
-
*/
|
|
41
|
-
description?: string;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* General description of data requirements
|
|
3
|
+
* How the component gets its data
|
|
4
|
+
* - 'views': Fetches data at runtime using MJ RunView()
|
|
5
|
+
* - 'queries': Fetches data at runtime using MJ RunQuery()
|
|
6
|
+
* - 'hybrid': Uses both views and queries, depending on the context
|
|
7
|
+
*/
|
|
8
|
+
mode: 'views' | 'queries' | 'hybrid';
|
|
9
|
+
/**
|
|
10
|
+
* Describes the entities and fields the component will access to fulfill user requirements.
|
|
11
|
+
*/
|
|
12
|
+
entities: ComponentEntityDataRequirement[];
|
|
13
|
+
/**
|
|
14
|
+
* Stored Queries that the component will use to fetch data.
|
|
15
|
+
*/
|
|
16
|
+
queries: ComponentQueryDataRequirement[];
|
|
17
|
+
/**
|
|
18
|
+
* Description of data access patterns
|
|
45
19
|
*/
|
|
46
20
|
description?: string;
|
|
47
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Describes how a component will use a specific query in MemberJunction to fetch data
|
|
24
|
+
*/
|
|
25
|
+
export type ComponentQueryDataRequirement = {
|
|
26
|
+
/**
|
|
27
|
+
* Query name, used along with categoryPath to identify the query
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* Full path of the category for the query. Categories can be hierarchical so a full path might be
|
|
32
|
+
* 'Membership/Users/ActiveUsers'. This helps in organizing queries and avoiding name collisions.
|
|
33
|
+
*/
|
|
34
|
+
categoryPath: string;
|
|
35
|
+
/**
|
|
36
|
+
* Description of the query and how/why the component will use it
|
|
37
|
+
*/
|
|
38
|
+
description?: string;
|
|
39
|
+
/**
|
|
40
|
+
* A list of the fields that the component will use out of the possible fields returned by the query.
|
|
41
|
+
* Uses the @see SimpleEntityFieldInfo type to describe each field. **NOTE** not all of the fields are actually
|
|
42
|
+
* directly related to entity fields as some might be computed/etc, but SimpleEntityFieldInfo helps define some key aspects
|
|
43
|
+
* like the data type of the column and a description of the field.
|
|
44
|
+
*/
|
|
45
|
+
fields: SimpleEntityFieldInfo[];
|
|
46
|
+
/**
|
|
47
|
+
* Queries can have parameters (not all do). See @see ComponentQueryParameterValue for details.
|
|
48
|
+
*/
|
|
49
|
+
parameters?: ComponentQueryParameterValue[];
|
|
50
|
+
/**
|
|
51
|
+
* This is only provided when requesting a NEW query be created. For existing queries, this will be undefined.
|
|
52
|
+
* This SQL can use Nunjucks syntax/templating for parameters including the custom filters defined in
|
|
53
|
+
*/
|
|
54
|
+
newQuerySQL?: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Describes a single query parameter that a component will use when running a query.
|
|
58
|
+
*/
|
|
59
|
+
export type ComponentQueryParameterValue = {
|
|
60
|
+
/**
|
|
61
|
+
* Name of the parameter
|
|
62
|
+
*/
|
|
63
|
+
name: string;
|
|
64
|
+
/**
|
|
65
|
+
* Value of the parameter. If the value is '@runtime', it indicates that the component will determine the value at runtime.
|
|
66
|
+
* If anything other than '@runtime' is specified, it is a hardcoded value that the component will use.
|
|
67
|
+
*/
|
|
68
|
+
value: string;
|
|
69
|
+
/**
|
|
70
|
+
* Description of the parameter and how it is used in the query. This is particular important if
|
|
71
|
+
* the value is '@runtime' as it helps the component developer understand what the parameter is for and how to determine its value.
|
|
72
|
+
*/
|
|
73
|
+
description?: string;
|
|
74
|
+
};
|
|
48
75
|
/**
|
|
49
76
|
* Describes use of a single entity
|
|
50
77
|
*/
|
|
@@ -52,11 +79,11 @@ export type ComponentEntityDataRequirement = {
|
|
|
52
79
|
/**
|
|
53
80
|
* Name of the entity (unique system-wide)
|
|
54
81
|
*/
|
|
55
|
-
|
|
82
|
+
name: string;
|
|
56
83
|
/**
|
|
57
84
|
* Description of data in the entity
|
|
58
85
|
*/
|
|
59
|
-
|
|
86
|
+
description?: string;
|
|
60
87
|
/**
|
|
61
88
|
* Fields to show the user
|
|
62
89
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-requirements.d.ts","sourceRoot":"","sources":["../src/data-requirements.ts"],"names":[],"mappings":"AAAA,
|
|
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;IAE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EG;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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/interactive-component-types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.74.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.
|
|
23
|
-
"@memberjunction/data-context": "2.
|
|
22
|
+
"@memberjunction/core": "2.74.0",
|
|
23
|
+
"@memberjunction/data-context": "2.74.0"
|
|
24
24
|
}
|
|
25
25
|
}
|