@fmsim/api 2.0.0-beta.2 → 2.0.0-beta.29
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/custom-elements.json +228 -0
- package/dist/src/graphql/board.d.ts +3 -1
- package/dist/src/graphql/board.js +31 -3
- package/dist/src/graphql/board.js.map +1 -1
- package/dist/src/graphql/index.d.ts +1 -0
- package/dist/src/graphql/index.js +1 -0
- package/dist/src/graphql/index.js.map +1 -1
- package/dist/src/graphql/playback.d.ts +17 -0
- package/dist/src/graphql/playback.js +44 -0
- package/dist/src/graphql/playback.js.map +1 -0
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.js +21 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/restful/board.d.ts +3 -1
- package/dist/src/restful/board.js +12 -2
- package/dist/src/restful/board.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -4
package/custom-elements.json
CHANGED
|
@@ -27,9 +27,51 @@
|
|
|
27
27
|
}
|
|
28
28
|
]
|
|
29
29
|
},
|
|
30
|
+
{
|
|
31
|
+
"kind": "function",
|
|
32
|
+
"name": "reorderBoard",
|
|
33
|
+
"parameters": [
|
|
34
|
+
{
|
|
35
|
+
"name": "id",
|
|
36
|
+
"type": {
|
|
37
|
+
"text": "string"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "sortOrder",
|
|
42
|
+
"type": {
|
|
43
|
+
"text": "number"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
30
48
|
{
|
|
31
49
|
"kind": "function",
|
|
32
50
|
"name": "fetchBoardById",
|
|
51
|
+
"parameters": [
|
|
52
|
+
{
|
|
53
|
+
"name": "id",
|
|
54
|
+
"type": {
|
|
55
|
+
"text": "string"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "cachedUpdatedAt",
|
|
60
|
+
"optional": true,
|
|
61
|
+
"type": {
|
|
62
|
+
"text": "string"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"kind": "function",
|
|
69
|
+
"name": "fetchBoardNameById",
|
|
70
|
+
"return": {
|
|
71
|
+
"type": {
|
|
72
|
+
"text": "Promise<string>"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
33
75
|
"parameters": [
|
|
34
76
|
{
|
|
35
77
|
"name": "id",
|
|
@@ -115,6 +157,14 @@
|
|
|
115
157
|
"module": "src/index.ts"
|
|
116
158
|
}
|
|
117
159
|
},
|
|
160
|
+
{
|
|
161
|
+
"kind": "js",
|
|
162
|
+
"name": "reorderBoard",
|
|
163
|
+
"declaration": {
|
|
164
|
+
"name": "reorderBoard",
|
|
165
|
+
"module": "src/index.ts"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
118
168
|
{
|
|
119
169
|
"kind": "js",
|
|
120
170
|
"name": "fetchBoardById",
|
|
@@ -123,6 +173,14 @@
|
|
|
123
173
|
"module": "src/index.ts"
|
|
124
174
|
}
|
|
125
175
|
},
|
|
176
|
+
{
|
|
177
|
+
"kind": "js",
|
|
178
|
+
"name": "fetchBoardNameById",
|
|
179
|
+
"declaration": {
|
|
180
|
+
"name": "fetchBoardNameById",
|
|
181
|
+
"module": "src/index.ts"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
126
184
|
{
|
|
127
185
|
"kind": "js",
|
|
128
186
|
"name": "createBoard",
|
|
@@ -188,6 +246,41 @@
|
|
|
188
246
|
}
|
|
189
247
|
]
|
|
190
248
|
},
|
|
249
|
+
{
|
|
250
|
+
"kind": "function",
|
|
251
|
+
"name": "fetchBoardNameById",
|
|
252
|
+
"return": {
|
|
253
|
+
"type": {
|
|
254
|
+
"text": "Promise<string>"
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"parameters": [
|
|
258
|
+
{
|
|
259
|
+
"name": "id",
|
|
260
|
+
"type": {
|
|
261
|
+
"text": "string"
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"kind": "function",
|
|
268
|
+
"name": "reorderBoard",
|
|
269
|
+
"parameters": [
|
|
270
|
+
{
|
|
271
|
+
"name": "id",
|
|
272
|
+
"type": {
|
|
273
|
+
"text": "string"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"name": "sortOrder",
|
|
278
|
+
"type": {
|
|
279
|
+
"text": "number"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
},
|
|
191
284
|
{
|
|
192
285
|
"kind": "function",
|
|
193
286
|
"name": "fetchBoardById",
|
|
@@ -197,6 +290,13 @@
|
|
|
197
290
|
"type": {
|
|
198
291
|
"text": "string"
|
|
199
292
|
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "cachedUpdatedAt",
|
|
296
|
+
"optional": true,
|
|
297
|
+
"type": {
|
|
298
|
+
"text": "string"
|
|
299
|
+
}
|
|
200
300
|
}
|
|
201
301
|
]
|
|
202
302
|
},
|
|
@@ -258,6 +358,22 @@
|
|
|
258
358
|
"module": "src/graphql/board.ts"
|
|
259
359
|
}
|
|
260
360
|
},
|
|
361
|
+
{
|
|
362
|
+
"kind": "js",
|
|
363
|
+
"name": "fetchBoardNameById",
|
|
364
|
+
"declaration": {
|
|
365
|
+
"name": "fetchBoardNameById",
|
|
366
|
+
"module": "src/graphql/board.ts"
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"kind": "js",
|
|
371
|
+
"name": "reorderBoard",
|
|
372
|
+
"declaration": {
|
|
373
|
+
"name": "reorderBoard",
|
|
374
|
+
"module": "src/graphql/board.ts"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
261
377
|
{
|
|
262
378
|
"kind": "js",
|
|
263
379
|
"name": "fetchBoardById",
|
|
@@ -609,6 +725,60 @@
|
|
|
609
725
|
"name": "*",
|
|
610
726
|
"module": "src/graphql/theme"
|
|
611
727
|
}
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"kind": "js",
|
|
731
|
+
"name": "*",
|
|
732
|
+
"declaration": {
|
|
733
|
+
"name": "*",
|
|
734
|
+
"module": "src/graphql/playback"
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
]
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"kind": "javascript-module",
|
|
741
|
+
"path": "src/graphql/playback.ts",
|
|
742
|
+
"declarations": [
|
|
743
|
+
{
|
|
744
|
+
"kind": "function",
|
|
745
|
+
"name": "fetchPlayback",
|
|
746
|
+
"return": {
|
|
747
|
+
"type": {
|
|
748
|
+
"text": "Promise<PlaybackResult>"
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
"parameters": [
|
|
752
|
+
{
|
|
753
|
+
"name": "startTime",
|
|
754
|
+
"type": {
|
|
755
|
+
"text": "string"
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
"name": "endTime",
|
|
760
|
+
"type": {
|
|
761
|
+
"text": "string"
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"name": "includeSnapshot",
|
|
766
|
+
"default": "true",
|
|
767
|
+
"type": {
|
|
768
|
+
"text": "boolean"
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
]
|
|
772
|
+
}
|
|
773
|
+
],
|
|
774
|
+
"exports": [
|
|
775
|
+
{
|
|
776
|
+
"kind": "js",
|
|
777
|
+
"name": "fetchPlayback",
|
|
778
|
+
"declaration": {
|
|
779
|
+
"name": "fetchPlayback",
|
|
780
|
+
"module": "src/graphql/playback.ts"
|
|
781
|
+
}
|
|
612
782
|
}
|
|
613
783
|
]
|
|
614
784
|
},
|
|
@@ -988,6 +1158,41 @@
|
|
|
988
1158
|
}
|
|
989
1159
|
]
|
|
990
1160
|
},
|
|
1161
|
+
{
|
|
1162
|
+
"kind": "function",
|
|
1163
|
+
"name": "fetchBoardNameById",
|
|
1164
|
+
"return": {
|
|
1165
|
+
"type": {
|
|
1166
|
+
"text": "Promise<string>"
|
|
1167
|
+
}
|
|
1168
|
+
},
|
|
1169
|
+
"parameters": [
|
|
1170
|
+
{
|
|
1171
|
+
"name": "id",
|
|
1172
|
+
"type": {
|
|
1173
|
+
"text": "string"
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
]
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
"kind": "function",
|
|
1180
|
+
"name": "reorderBoard",
|
|
1181
|
+
"parameters": [
|
|
1182
|
+
{
|
|
1183
|
+
"name": "id",
|
|
1184
|
+
"type": {
|
|
1185
|
+
"text": "string"
|
|
1186
|
+
}
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
"name": "sortOrder",
|
|
1190
|
+
"type": {
|
|
1191
|
+
"text": "number"
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
]
|
|
1195
|
+
},
|
|
991
1196
|
{
|
|
992
1197
|
"kind": "function",
|
|
993
1198
|
"name": "fetchBoardById",
|
|
@@ -997,6 +1202,13 @@
|
|
|
997
1202
|
"type": {
|
|
998
1203
|
"text": "string"
|
|
999
1204
|
}
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
"name": "cachedUpdatedAt",
|
|
1208
|
+
"optional": true,
|
|
1209
|
+
"type": {
|
|
1210
|
+
"text": "string"
|
|
1211
|
+
}
|
|
1000
1212
|
}
|
|
1001
1213
|
]
|
|
1002
1214
|
},
|
|
@@ -1065,6 +1277,22 @@
|
|
|
1065
1277
|
"module": "src/restful/board.ts"
|
|
1066
1278
|
}
|
|
1067
1279
|
},
|
|
1280
|
+
{
|
|
1281
|
+
"kind": "js",
|
|
1282
|
+
"name": "fetchBoardNameById",
|
|
1283
|
+
"declaration": {
|
|
1284
|
+
"name": "fetchBoardNameById",
|
|
1285
|
+
"module": "src/restful/board.ts"
|
|
1286
|
+
}
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
"kind": "js",
|
|
1290
|
+
"name": "reorderBoard",
|
|
1291
|
+
"declaration": {
|
|
1292
|
+
"name": "reorderBoard",
|
|
1293
|
+
"module": "src/restful/board.ts"
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1068
1296
|
{
|
|
1069
1297
|
"kind": "js",
|
|
1070
1298
|
"name": "fetchBoardById",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Board } from '../types';
|
|
2
2
|
export declare function fetchBoardList(listParam?: any): Promise<any>;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function fetchBoardNameById(id: string): Promise<string>;
|
|
4
|
+
export declare function reorderBoard(id: string, sortOrder: number): Promise<any>;
|
|
5
|
+
export declare function fetchBoardById(id: string, cachedUpdatedAt?: string): Promise<any>;
|
|
4
6
|
export declare function createBoard(board: Board): Promise<any>;
|
|
5
7
|
export declare function updateBoard(board: Board): Promise<any>;
|
|
6
8
|
export declare function deleteBoard(id: string): Promise<any>;
|
|
@@ -10,6 +10,7 @@ export async function fetchBoardList(listParam = {}) {
|
|
|
10
10
|
name
|
|
11
11
|
description
|
|
12
12
|
thumbnail
|
|
13
|
+
sortOrder
|
|
13
14
|
createdAt
|
|
14
15
|
updatedAt
|
|
15
16
|
}
|
|
@@ -20,13 +21,39 @@ export async function fetchBoardList(listParam = {}) {
|
|
|
20
21
|
});
|
|
21
22
|
return response.data;
|
|
22
23
|
}
|
|
23
|
-
export async function
|
|
24
|
-
|
|
24
|
+
export async function fetchBoardNameById(id) {
|
|
25
|
+
var _a;
|
|
26
|
+
const { data } = await client.query({
|
|
25
27
|
query: gql `
|
|
26
|
-
query
|
|
28
|
+
query FetchBoardName($id: String!) {
|
|
27
29
|
board(id: $id) {
|
|
28
30
|
id
|
|
29
31
|
name
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`,
|
|
35
|
+
variables: { id }
|
|
36
|
+
});
|
|
37
|
+
return ((_a = data.board) === null || _a === void 0 ? void 0 : _a.name) || id;
|
|
38
|
+
}
|
|
39
|
+
export async function reorderBoard(id, sortOrder) {
|
|
40
|
+
const response = await client.mutate({
|
|
41
|
+
mutation: gql `
|
|
42
|
+
mutation ReorderBoard($id: String!, $sortOrder: Float!) {
|
|
43
|
+
reorderBoard(id: $id, sortOrder: $sortOrder)
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
variables: { id, sortOrder }
|
|
47
|
+
});
|
|
48
|
+
return response.data;
|
|
49
|
+
}
|
|
50
|
+
export async function fetchBoardById(id, cachedUpdatedAt) {
|
|
51
|
+
const response = await client.query({
|
|
52
|
+
query: gql `
|
|
53
|
+
query FetchBoardById($id: String!, $cachedUpdatedAt: String, $filters: [Filter!]) {
|
|
54
|
+
board(id: $id, cachedUpdatedAt: $cachedUpdatedAt) {
|
|
55
|
+
id
|
|
56
|
+
name
|
|
30
57
|
description
|
|
31
58
|
group {
|
|
32
59
|
id
|
|
@@ -59,6 +86,7 @@ export async function fetchBoardById(id) {
|
|
|
59
86
|
`,
|
|
60
87
|
variables: {
|
|
61
88
|
id,
|
|
89
|
+
cachedUpdatedAt,
|
|
62
90
|
filters: [
|
|
63
91
|
{
|
|
64
92
|
name: 'active',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.js","sourceRoot":"","sources":["../../../src/graphql/board.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,YAAiB,EAAE;IACtD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;iBAEG,SAAS,CAAC,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":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O,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAAe;IACtD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BT;QACD,SAAS,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE;KAC3B,CAAC,CAAA;IAEF,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { buildArgs, client } from '@operato/graphql'\n\nimport { Board } from '../types'\nimport gql from 'graphql-tag'\n\nexport async function fetchBoardList(listParam: any = {}) {\n const response = await client.query({\n query: gql`\n {\n boards(${buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n sortOrder\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchBoardNameById(id: string): Promise<string> {\n const { data } = await client.query({\n query: gql`\n query FetchBoardName($id: String!) {\n board(id: $id) {\n id\n name\n }\n }\n `,\n variables: { id }\n })\n return (data as any).board?.name || id\n}\n\nexport async function reorderBoard(id: string, sortOrder: number) {\n const response = await client.mutate({\n mutation: gql`\n mutation ReorderBoard($id: String!, $sortOrder: Float!) {\n reorderBoard(id: $id, sortOrder: $sortOrder)\n }\n `,\n variables: { id, sortOrder }\n })\n return response.data\n}\n\nexport async function fetchBoardById(id: string, cachedUpdatedAt?: string) {\n const response = await client.query({\n query: gql`\n query FetchBoardById($id: String!, $cachedUpdatedAt: String, $filters: [Filter!]) {\n board(id: $id, cachedUpdatedAt: $cachedUpdatedAt) {\n id\n name\n description\n group {\n id\n name\n }\n thumbnail\n model\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n\n themes(filters: $filters) {\n items {\n name\n description\n active\n type\n value\n }\n }\n }\n `,\n variables: {\n id,\n cachedUpdatedAt,\n filters: [\n {\n name: 'active',\n operator: 'eq',\n value: true\n }\n ]\n }\n })\n\n return response.data\n}\n\nexport async function createBoard(board: Board) {\n /*\n input NewBoard {\n name : String!\n description : String\n model : String!\n groupId : String!\n }\n */\n\n board.model = JSON.stringify(board.model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateBoard($board: NewBoard!) {\n createBoard(board: $board) {\n id\n name\n description\n model\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n board\n }\n })\n\n return response.data\n}\n\nexport async function updateBoard(board: Board) {\n /*\n input BoardPatch {\n name : String\n description : String\n model : String\n }\n */\n var { id, name, description, model, groupId } = board\n model = JSON.stringify(model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBoard($id: String!, $patch: BoardPatch!) {\n updateBoard(id: $id, patch: $patch) {\n id\n name\n description\n model\n group {\n id\n name\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description, model, groupId }\n }\n })\n\n return response.data\n}\n\nexport async function deleteBoard(id: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteBoard(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function fetchBoardInfoById(boardId: string) {\n const { data } = await client.query({\n query: gql`\n query FetchBoardById($id: String!) {\n board(id: $id) {\n id\n name\n description\n group {\n id\n name\n }\n thumbnail\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n\n groups {\n items {\n id\n name\n description\n }\n }\n }\n `,\n variables: { id: boardId }\n })\n\n return data\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graphql/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA","sourcesContent":["export * from './board'\nexport * from './data-subscription'\nexport * from './favorite-board'\nexport * from './group'\nexport * from './scenario'\nexport * from './theme'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graphql/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA","sourcesContent":["export * from './board'\nexport * from './data-subscription'\nexport * from './favorite-board'\nexport * from './group'\nexport * from './scenario'\nexport * from './theme'\nexport * from './playback'\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface PlaybackFrame {
|
|
2
|
+
type: 'snapshot' | 'diff';
|
|
3
|
+
time: string;
|
|
4
|
+
data: any[];
|
|
5
|
+
}
|
|
6
|
+
export interface PlaybackScenario {
|
|
7
|
+
scenarioName: string;
|
|
8
|
+
snapshots: PlaybackFrame[];
|
|
9
|
+
}
|
|
10
|
+
export interface PlaybackResult {
|
|
11
|
+
status: boolean;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
playback?: {
|
|
14
|
+
scenarios: PlaybackScenario[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function fetchPlayback(startTime: string, endTime: string, includeSnapshot?: boolean): Promise<PlaybackResult>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import gql from 'graphql-tag';
|
|
2
|
+
import { client } from '@operato/graphql';
|
|
3
|
+
export async function fetchPlayback(startTime, endTime, includeSnapshot = true) {
|
|
4
|
+
var _a;
|
|
5
|
+
const { data } = await client.query({
|
|
6
|
+
query: gql `
|
|
7
|
+
query ($startTime: String!, $endTime: String, $includeSnapshot: Boolean) {
|
|
8
|
+
playback(startTime: $startTime, endTime: $endTime, includeSnapshot: $includeSnapshot) {
|
|
9
|
+
status
|
|
10
|
+
errorMessage
|
|
11
|
+
playback {
|
|
12
|
+
scenarios {
|
|
13
|
+
scenarioName
|
|
14
|
+
snapshots {
|
|
15
|
+
type
|
|
16
|
+
time
|
|
17
|
+
data
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`,
|
|
24
|
+
variables: { startTime, endTime, includeSnapshot }
|
|
25
|
+
});
|
|
26
|
+
const result = data.playback;
|
|
27
|
+
// data가 JSON string으로 전달되므로 파싱
|
|
28
|
+
if ((_a = result === null || result === void 0 ? void 0 : result.playback) === null || _a === void 0 ? void 0 : _a.scenarios) {
|
|
29
|
+
for (const scenario of result.playback.scenarios) {
|
|
30
|
+
for (const frame of scenario.snapshots) {
|
|
31
|
+
if (typeof frame.data === 'string') {
|
|
32
|
+
try {
|
|
33
|
+
frame.data = JSON.parse(frame.data);
|
|
34
|
+
}
|
|
35
|
+
catch (_b) {
|
|
36
|
+
frame.data = [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=playback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playback.js","sourceRoot":"","sources":["../../../src/graphql/playback.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAqBzC,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,SAAiB,EACjB,OAAe,EACf,kBAA2B,IAAI;;IAE/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBT;QACD,SAAS,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE;KACnD,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,IAAI,CAAC,QAA0B,CAAA;IAE9C,+BAA+B;IAC/B,IAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,0CAAE,SAAS,EAAE,CAAC;QAChC,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YACjD,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;gBACvC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;oBACnC,IAAI,CAAC;wBAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;oBAAC,CAAC;oBAAC,WAAM,CAAC;wBAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAA;oBAAC,CAAC;gBACvE,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\n\nexport interface PlaybackFrame {\n type: 'snapshot' | 'diff'\n time: string\n data: any[]\n}\n\nexport interface PlaybackScenario {\n scenarioName: string\n snapshots: PlaybackFrame[]\n}\n\nexport interface PlaybackResult {\n status: boolean\n errorMessage?: string\n playback?: {\n scenarios: PlaybackScenario[]\n }\n}\n\nexport async function fetchPlayback(\n startTime: string,\n endTime: string,\n includeSnapshot: boolean = true\n): Promise<PlaybackResult> {\n const { data } = await client.query({\n query: gql`\n query ($startTime: String!, $endTime: String, $includeSnapshot: Boolean) {\n playback(startTime: $startTime, endTime: $endTime, includeSnapshot: $includeSnapshot) {\n status\n errorMessage\n playback {\n scenarios {\n scenarioName\n snapshots {\n type\n time\n data\n }\n }\n }\n }\n }\n `,\n variables: { startTime, endTime, includeSnapshot }\n })\n\n const result = data.playback as PlaybackResult\n\n // data가 JSON string으로 전달되므로 파싱\n if (result?.playback?.scenarios) {\n for (const scenario of result.playback.scenarios) {\n for (const frame of scenario.snapshots) {\n if (typeof frame.data === 'string') {\n try { frame.data = JSON.parse(frame.data) } catch { frame.data = [] }\n }\n }\n }\n }\n\n return result\n}\n"]}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { Board } from './types';
|
|
|
3
3
|
export declare function isRestfulAvailable(): string | null;
|
|
4
4
|
export declare function fetchGroupList(): Promise<any>;
|
|
5
5
|
export declare function fetchBoardList(listParam?: any): Promise<any>;
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function reorderBoard(id: string, sortOrder: number): Promise<any>;
|
|
7
|
+
export declare function fetchBoardById(id: string, cachedUpdatedAt?: string): Promise<any>;
|
|
8
|
+
export declare function fetchBoardNameById(id: string): Promise<string>;
|
|
7
9
|
export declare function createBoard(board: Board): Promise<any>;
|
|
8
10
|
export declare function themesColorMap(): Promise<string[]>;
|
|
9
11
|
export declare function themesColorRange(): Promise<string[]>;
|
package/dist/src/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './graphql';
|
|
2
2
|
import { themesColorMap as graphqlThemesColorMap, themesColorRange as graphqlThemesColorRange, themesAnimationMap as graphqlThemesAnimationMap } from './graphql';
|
|
3
3
|
import { getPopupData as restfulGetPopupData, themesColorMap as restfulThemesColorMap, themesColorRange as restfulThemesColorRange, themesAnimationMap as restfulThemesAnimationMap } from './restful';
|
|
4
|
-
import { fetchGroupList as restfulFetchGroupList, fetchBoardList as restfulFetchBoardList, createBoard as restfulCreateBoard, fetchBoardById as restfulFetchBoardById } from './restful';
|
|
5
|
-
import { fetchGroupList as graphqlFetchGroupList, fetchBoardList as graphqlFetchBoardList, createBoard as graphqlCreateBoard, fetchBoardById as graphqlFetchBoardById } from './graphql';
|
|
4
|
+
import { fetchGroupList as restfulFetchGroupList, fetchBoardList as restfulFetchBoardList, createBoard as restfulCreateBoard, fetchBoardById as restfulFetchBoardById, fetchBoardNameById as restfulFetchBoardNameById, reorderBoard as restfulReorderBoard } from './restful';
|
|
5
|
+
import { fetchGroupList as graphqlFetchGroupList, fetchBoardList as graphqlFetchBoardList, createBoard as graphqlCreateBoard, fetchBoardById as graphqlFetchBoardById, fetchBoardNameById as graphqlFetchBoardNameById, reorderBoard as graphqlReorderBoard } from './graphql';
|
|
6
6
|
export function isRestfulAvailable() {
|
|
7
7
|
return sessionStorage.getItem('lv_server_ip_port');
|
|
8
8
|
}
|
|
@@ -22,12 +22,28 @@ export async function fetchBoardList(listParam = {}) {
|
|
|
22
22
|
return await graphqlFetchBoardList(listParam);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export async function
|
|
25
|
+
export async function reorderBoard(id, sortOrder) {
|
|
26
26
|
if (isRestfulAvailable()) {
|
|
27
|
-
return await
|
|
27
|
+
return await restfulReorderBoard(id, sortOrder);
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
return await
|
|
30
|
+
return await graphqlReorderBoard(id, sortOrder);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export async function fetchBoardById(id, cachedUpdatedAt) {
|
|
34
|
+
if (isRestfulAvailable()) {
|
|
35
|
+
return await restfulFetchBoardById(id, cachedUpdatedAt);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return await graphqlFetchBoardById(id, cachedUpdatedAt);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export async function fetchBoardNameById(id) {
|
|
42
|
+
if (isRestfulAvailable()) {
|
|
43
|
+
return await restfulFetchBoardNameById(id);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return await graphqlFetchBoardNameById(id);
|
|
31
47
|
}
|
|
32
48
|
}
|
|
33
49
|
export async function createBoard(board) {
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EACL,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,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sBAAsB,CAAC,CAAA;QACzC,CAAC;QAED,OAAO,QAAQ,CAAC,SAAS,CAAA;IAC3B,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IACzD,CAAC;AACH,CAAC","sourcesContent":["export * from './graphql'\n\nimport {\n themesColorMap as graphqlThemesColorMap,\n themesColorRange as graphqlThemesColorRange,\n themesAnimationMap as graphqlThemesAnimationMap\n} from './graphql'\n\nimport {\n getPopupData as restfulGetPopupData,\n themesColorMap as restfulThemesColorMap,\n themesColorRange as restfulThemesColorRange,\n themesAnimationMap as restfulThemesAnimationMap\n} from './restful'\n\nimport {\n fetchGroupList as restfulFetchGroupList,\n fetchBoardList as restfulFetchBoardList,\n createBoard as restfulCreateBoard,\n fetchBoardById as restfulFetchBoardById,\n fetchBoardNameById as restfulFetchBoardNameById,\n reorderBoard as restfulReorderBoard\n} from './restful'\n\nimport {\n fetchGroupList as graphqlFetchGroupList,\n fetchBoardList as graphqlFetchBoardList,\n createBoard as graphqlCreateBoard,\n fetchBoardById as graphqlFetchBoardById,\n fetchBoardNameById as graphqlFetchBoardNameById,\n reorderBoard as graphqlReorderBoard\n} from './graphql'\n\nimport { Board } from './types'\n\nexport function isRestfulAvailable() {\n return sessionStorage.getItem('lv_server_ip_port')\n}\n\nexport async function fetchGroupList() {\n if (isRestfulAvailable()) {\n return await restfulFetchGroupList()\n } else {\n return await graphqlFetchGroupList()\n }\n}\n\nexport async function fetchBoardList(listParam: any = {}) {\n if (isRestfulAvailable()) {\n return await restfulFetchBoardList(listParam)\n } else {\n return await graphqlFetchBoardList(listParam)\n }\n}\n\nexport async function reorderBoard(id: string, sortOrder: number) {\n if (isRestfulAvailable()) {\n return await restfulReorderBoard(id, sortOrder)\n } else {\n return await graphqlReorderBoard(id, sortOrder)\n }\n}\n\nexport async function fetchBoardById(id: string, cachedUpdatedAt?: string) {\n if (isRestfulAvailable()) {\n return await restfulFetchBoardById(id, cachedUpdatedAt)\n } else {\n return await graphqlFetchBoardById(id, cachedUpdatedAt)\n }\n}\n\nexport async function fetchBoardNameById(id: string): Promise<string> {\n if (isRestfulAvailable()) {\n return await restfulFetchBoardNameById(id)\n } else {\n return await graphqlFetchBoardNameById(id)\n }\n}\n\nexport async function createBoard(board: Board) {\n if (isRestfulAvailable()) {\n return await restfulCreateBoard(board)\n } else {\n return await graphqlCreateBoard(board)\n }\n}\n\nexport async function themesColorMap() {\n if (isRestfulAvailable()) {\n return await restfulThemesColorMap()\n } else {\n return await graphqlThemesColorMap()\n }\n}\n\nexport async function themesColorRange() {\n if (isRestfulAvailable()) {\n return await restfulThemesColorRange()\n } else {\n return await graphqlThemesColorRange()\n }\n}\n\nexport async function themesAnimationMap() {\n if (isRestfulAvailable()) {\n return await restfulThemesAnimationMap()\n } else {\n return await graphqlThemesAnimationMap()\n }\n}\n\nexport async function getPopupData(type: string, id: string) {\n if (isRestfulAvailable()) {\n const response = (await restfulGetPopupData(type, id))?.data\n\n if (!response || !response.status) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: 'Error : getPopupData'\n }\n })\n )\n throw new Error('Error : getPopupData')\n }\n\n return response.popupData\n } else {\n await new Promise(resolve => setTimeout(resolve, 1000))\n }\n}\n"]}
|
|
@@ -3,6 +3,8 @@ export declare function fetchBoardList(listParam?: any): Promise<import("./commo
|
|
|
3
3
|
export declare function getBoardByUseMcsAutoConfigAndId(id: string): Promise<import("./common").RestfulReturnType | undefined>;
|
|
4
4
|
export declare function createBoard(board: Board): Promise<import("./common").RestfulReturnType | undefined>;
|
|
5
5
|
export declare function deleteBoard(id: string): Promise<import("./common").RestfulReturnType | undefined>;
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function fetchBoardNameById(id: string): Promise<string>;
|
|
7
|
+
export declare function reorderBoard(id: string, sortOrder: number): Promise<import("./common").RestfulReturnType | undefined>;
|
|
8
|
+
export declare function fetchBoardById(id: string, cachedUpdatedAt?: string): Promise<import("./common").RestfulReturnType | undefined>;
|
|
7
9
|
export declare function fetchBoardInfoById(id: string): Promise<import("./common").RestfulReturnType | undefined>;
|
|
8
10
|
export declare function updateBoard(board: any, from?: string): Promise<import("./common").RestfulReturnType | undefined>;
|
|
@@ -12,8 +12,18 @@ export function createBoard(board) {
|
|
|
12
12
|
export function deleteBoard(id) {
|
|
13
13
|
return callApi(getRestServiceFullPath() + '/deleteBoard/' + id, 'delete', null, null);
|
|
14
14
|
}
|
|
15
|
-
export function
|
|
16
|
-
|
|
15
|
+
export async function fetchBoardNameById(id) {
|
|
16
|
+
var _a;
|
|
17
|
+
const data = await callApi(getRestServiceFullPath() + '/fetchBoardById/' + id, 'get', null, null);
|
|
18
|
+
return ((_a = data === null || data === void 0 ? void 0 : data.board) === null || _a === void 0 ? void 0 : _a.name) || id;
|
|
19
|
+
}
|
|
20
|
+
export async function reorderBoard(id, sortOrder) {
|
|
21
|
+
return callApi(getRestServiceFullPath() + '/reorderBoard', 'post', null, { id, sortOrder });
|
|
22
|
+
}
|
|
23
|
+
export function fetchBoardById(id, cachedUpdatedAt) {
|
|
24
|
+
const url = getRestServiceFullPath() + '/fetchBoardById/' + id
|
|
25
|
+
+ (cachedUpdatedAt ? `?cachedUpdatedAt=${encodeURIComponent(cachedUpdatedAt)}` : '');
|
|
26
|
+
return callApi(url, 'get', null, null);
|
|
17
27
|
}
|
|
18
28
|
export async function fetchBoardInfoById(id) {
|
|
19
29
|
/* TODO implement me */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.js","sourceRoot":"","sources":["../../../src/restful/board.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAE1D,MAAM,UAAU,cAAc,CAAC,YAAiB,EAAE;IAChD,OAAO,OAAO,CAAC,sBAAsB,EAAE,GAAG,iBAAiB,EAAE,MAAM,EAAE,IAAI,EA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,WAAW,CAAC,KAAU,EAAE,IAAa;IACnD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAC3C,CAAC;IACD,OAAO,OAAO,CAAC,sBAAsB,EAAE,GAAG,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;AAC/E,CAAC","sourcesContent":["import { Board } from '../types'\nimport { callApi, getRestServiceFullPath } from './common'\n\nexport function fetchBoardList(listParam: any = {}) {\n return callApi(getRestServiceFullPath() + '/fetchBoardList', 'post', null, listParam)\n}\n\nexport function getBoardByUseMcsAutoConfigAndId(id: string) {\n return callApi(getRestServiceFullPath() + '/getBoardByUseMcsAutoConfigAndId/' + id, 'get', null, null)\n}\n\nexport function createBoard(board: Board) {\n board.model = JSON.stringify(board.model)\n return callApi(getRestServiceFullPath() + '/createBoard', 'post', null, board)\n}\n\nexport function deleteBoard(id: string) {\n return callApi(getRestServiceFullPath() + '/deleteBoard/' + id, 'delete', null, null)\n}\n\nexport async function fetchBoardNameById(id: string): Promise<string> {\n const data: any = await callApi(getRestServiceFullPath() + '/fetchBoardById/' + id, 'get', null, null)\n return data?.board?.name || id\n}\n\nexport async function reorderBoard(id: string, sortOrder: number) {\n return callApi(getRestServiceFullPath() + '/reorderBoard', 'post', null, { id, sortOrder })\n}\n\nexport function fetchBoardById(id: string, cachedUpdatedAt?: string) {\n const url = getRestServiceFullPath() + '/fetchBoardById/' + id\n + (cachedUpdatedAt ? `?cachedUpdatedAt=${encodeURIComponent(cachedUpdatedAt)}` : '')\n return callApi(url, 'get', null, null)\n}\n\nexport async function fetchBoardInfoById(id: string) {\n /* TODO implement me */\n return callApi(getRestServiceFullPath() + '/fetchBoardInfoById/' + id, 'get', null, null)\n}\n\nexport function updateBoard(board: any, from?: string) {\n if (!from) {\n board.model = JSON.stringify(board.model)\n }\n return callApi(getRestServiceFullPath() + '/updateBoard', 'put', null, board)\n}\n"]}
|