@or-sdk/view-templates 1.2.2-next.578.0 → 1.2.3
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/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/cjs/ViewTemplates.js +112 -46
- package/dist/cjs/ViewTemplates.js.map +1 -1
- package/dist/cjs/constants.js +58 -3
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/utils/getGetByIdQuery.js +10 -0
- package/dist/cjs/utils/getGetByIdQuery.js.map +1 -0
- package/dist/cjs/utils/getListQuery.js +10 -0
- package/dist/cjs/utils/getListQuery.js.map +1 -0
- package/dist/cjs/utils/index.js +5 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/esm/ViewTemplates.js +87 -34
- package/dist/esm/ViewTemplates.js.map +1 -1
- package/dist/esm/constants.js +106 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/utils/getGetByIdQuery.js +12 -0
- package/dist/esm/utils/getGetByIdQuery.js.map +1 -0
- package/dist/esm/utils/getListQuery.js +15 -0
- package/dist/esm/utils/getListQuery.js.map +1 -0
- package/dist/esm/utils/index.js +2 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/types/ViewTemplates.d.ts +8 -6
- package/dist/types/ViewTemplates.d.ts.map +1 -1
- package/dist/types/constants.d.ts +6 -1
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/types.d.ts +28 -20
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/getGetByIdQuery.d.ts +5 -0
- package/dist/types/utils/getGetByIdQuery.d.ts.map +1 -0
- package/dist/types/utils/getListQuery.d.ts +5 -0
- package/dist/types/utils/getListQuery.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/ViewTemplates.ts +101 -50
- package/src/constants.ts +111 -1
- package/src/types.ts +32 -25
- package/src/utils/getGetByIdQuery.ts +13 -0
- package/src/utils/getListQuery.ts +16 -0
- package/src/utils/index.ts +2 -0
package/src/types.ts
CHANGED
|
@@ -17,9 +17,39 @@ export type ViewTemplatesConfig = {
|
|
|
17
17
|
accountId?: string;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Url of OneReach
|
|
20
|
+
* Url of OneReach DataHub api
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
dataHubUrl?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type ViewTemplate = {
|
|
26
|
+
id: string;
|
|
27
|
+
template: {
|
|
28
|
+
category: string;
|
|
29
|
+
description: string;
|
|
30
|
+
help: string | null;
|
|
31
|
+
icon: string | null;
|
|
32
|
+
iconUrl: string | null;
|
|
33
|
+
implicitly: unknown | null;
|
|
34
|
+
label: string;
|
|
35
|
+
publishedBy: string;
|
|
36
|
+
tags: string[] | null;
|
|
37
|
+
type: unknown | null;
|
|
38
|
+
version: string;
|
|
39
|
+
};
|
|
40
|
+
cardIds: string[];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type ListViewTemplatesParams = {
|
|
44
|
+
projection?: string[];
|
|
45
|
+
limit?: number;
|
|
46
|
+
queryParams?: {
|
|
47
|
+
sourceId: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type GetViewTemplateByIdParams = {
|
|
52
|
+
projection?: string[];
|
|
23
53
|
};
|
|
24
54
|
|
|
25
55
|
export type View = {
|
|
@@ -104,26 +134,3 @@ export type View = {
|
|
|
104
134
|
template: null;
|
|
105
135
|
deletedDate?: string;
|
|
106
136
|
};
|
|
107
|
-
|
|
108
|
-
export type ListViewTemplatesParams = {
|
|
109
|
-
query?: {
|
|
110
|
-
[key: string]: unknown;
|
|
111
|
-
};
|
|
112
|
-
projection?: string[];
|
|
113
|
-
group?: string[];
|
|
114
|
-
sandbox?: boolean;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export type PaginationOptions = {
|
|
118
|
-
limit?: number;
|
|
119
|
-
offset?: number;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export type DownloadOptions = {
|
|
123
|
-
accountId?: string;
|
|
124
|
-
[key: string]: unknown;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export type UpgradeOptions = {
|
|
128
|
-
[key: string]: unknown;
|
|
129
|
-
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getQueryProjectionPart } from '@or-sdk/data-hub';
|
|
2
|
+
import { DEFAULT_PROJECTION_GET_LIST } from '../constants';
|
|
3
|
+
|
|
4
|
+
function getGetByIdQuery({ projection = [] }: { projection: string[]; }): string {
|
|
5
|
+
return `query getTemplate($entity: TemplateType!, $params: GetInput!, $sourceId: String) {
|
|
6
|
+
getTemplate(entity: $entity, params: $params, sourceId: $sourceId) {
|
|
7
|
+
... on View {${getQueryProjectionPart(projection.length ? projection : DEFAULT_PROJECTION_GET_LIST)}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default getGetByIdQuery;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getQueryProjectionPart } from '@or-sdk/data-hub';
|
|
2
|
+
import { DEFAULT_PROJECTION_LIST } from '../constants';
|
|
3
|
+
|
|
4
|
+
function getListQuery({ projection = [] }: { projection: string[]; }): string {
|
|
5
|
+
return `query listTemplates($entity: TemplateType!, $params: ListInput!, $sourceId: String, $forceSandbox: Boolean) {
|
|
6
|
+
listTemplates(entity: $entity, params: $params, sourceId: $sourceId, forceSandbox: $forceSandbox) {
|
|
7
|
+
records {
|
|
8
|
+
... on View {${getQueryProjectionPart(projection.length ? projection : DEFAULT_PROJECTION_LIST)}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
last
|
|
12
|
+
}
|
|
13
|
+
}`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default getListQuery;
|