@fmsim/api 2.0.0-beta.3 → 2.0.0-beta.36
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 +252 -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,59 @@
|
|
|
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": "prevId",
|
|
42
|
+
"optional": true,
|
|
43
|
+
"type": {
|
|
44
|
+
"text": "string"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "nextId",
|
|
49
|
+
"optional": true,
|
|
50
|
+
"type": {
|
|
51
|
+
"text": "string"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
30
56
|
{
|
|
31
57
|
"kind": "function",
|
|
32
58
|
"name": "fetchBoardById",
|
|
59
|
+
"parameters": [
|
|
60
|
+
{
|
|
61
|
+
"name": "id",
|
|
62
|
+
"type": {
|
|
63
|
+
"text": "string"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "cachedUpdatedAt",
|
|
68
|
+
"optional": true,
|
|
69
|
+
"type": {
|
|
70
|
+
"text": "string"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"kind": "function",
|
|
77
|
+
"name": "fetchBoardNameById",
|
|
78
|
+
"return": {
|
|
79
|
+
"type": {
|
|
80
|
+
"text": "Promise<string>"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
33
83
|
"parameters": [
|
|
34
84
|
{
|
|
35
85
|
"name": "id",
|
|
@@ -115,6 +165,14 @@
|
|
|
115
165
|
"module": "src/index.ts"
|
|
116
166
|
}
|
|
117
167
|
},
|
|
168
|
+
{
|
|
169
|
+
"kind": "js",
|
|
170
|
+
"name": "reorderBoard",
|
|
171
|
+
"declaration": {
|
|
172
|
+
"name": "reorderBoard",
|
|
173
|
+
"module": "src/index.ts"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
118
176
|
{
|
|
119
177
|
"kind": "js",
|
|
120
178
|
"name": "fetchBoardById",
|
|
@@ -123,6 +181,14 @@
|
|
|
123
181
|
"module": "src/index.ts"
|
|
124
182
|
}
|
|
125
183
|
},
|
|
184
|
+
{
|
|
185
|
+
"kind": "js",
|
|
186
|
+
"name": "fetchBoardNameById",
|
|
187
|
+
"declaration": {
|
|
188
|
+
"name": "fetchBoardNameById",
|
|
189
|
+
"module": "src/index.ts"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
126
192
|
{
|
|
127
193
|
"kind": "js",
|
|
128
194
|
"name": "createBoard",
|
|
@@ -188,6 +254,49 @@
|
|
|
188
254
|
}
|
|
189
255
|
]
|
|
190
256
|
},
|
|
257
|
+
{
|
|
258
|
+
"kind": "function",
|
|
259
|
+
"name": "fetchBoardNameById",
|
|
260
|
+
"return": {
|
|
261
|
+
"type": {
|
|
262
|
+
"text": "Promise<string>"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"parameters": [
|
|
266
|
+
{
|
|
267
|
+
"name": "id",
|
|
268
|
+
"type": {
|
|
269
|
+
"text": "string"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"kind": "function",
|
|
276
|
+
"name": "reorderBoard",
|
|
277
|
+
"parameters": [
|
|
278
|
+
{
|
|
279
|
+
"name": "id",
|
|
280
|
+
"type": {
|
|
281
|
+
"text": "string"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "prevId",
|
|
286
|
+
"optional": true,
|
|
287
|
+
"type": {
|
|
288
|
+
"text": "string"
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "nextId",
|
|
293
|
+
"optional": true,
|
|
294
|
+
"type": {
|
|
295
|
+
"text": "string"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
},
|
|
191
300
|
{
|
|
192
301
|
"kind": "function",
|
|
193
302
|
"name": "fetchBoardById",
|
|
@@ -197,6 +306,13 @@
|
|
|
197
306
|
"type": {
|
|
198
307
|
"text": "string"
|
|
199
308
|
}
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"name": "cachedUpdatedAt",
|
|
312
|
+
"optional": true,
|
|
313
|
+
"type": {
|
|
314
|
+
"text": "string"
|
|
315
|
+
}
|
|
200
316
|
}
|
|
201
317
|
]
|
|
202
318
|
},
|
|
@@ -258,6 +374,22 @@
|
|
|
258
374
|
"module": "src/graphql/board.ts"
|
|
259
375
|
}
|
|
260
376
|
},
|
|
377
|
+
{
|
|
378
|
+
"kind": "js",
|
|
379
|
+
"name": "fetchBoardNameById",
|
|
380
|
+
"declaration": {
|
|
381
|
+
"name": "fetchBoardNameById",
|
|
382
|
+
"module": "src/graphql/board.ts"
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"kind": "js",
|
|
387
|
+
"name": "reorderBoard",
|
|
388
|
+
"declaration": {
|
|
389
|
+
"name": "reorderBoard",
|
|
390
|
+
"module": "src/graphql/board.ts"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
261
393
|
{
|
|
262
394
|
"kind": "js",
|
|
263
395
|
"name": "fetchBoardById",
|
|
@@ -609,6 +741,60 @@
|
|
|
609
741
|
"name": "*",
|
|
610
742
|
"module": "src/graphql/theme"
|
|
611
743
|
}
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"kind": "js",
|
|
747
|
+
"name": "*",
|
|
748
|
+
"declaration": {
|
|
749
|
+
"name": "*",
|
|
750
|
+
"module": "src/graphql/playback"
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
]
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"kind": "javascript-module",
|
|
757
|
+
"path": "src/graphql/playback.ts",
|
|
758
|
+
"declarations": [
|
|
759
|
+
{
|
|
760
|
+
"kind": "function",
|
|
761
|
+
"name": "fetchPlayback",
|
|
762
|
+
"return": {
|
|
763
|
+
"type": {
|
|
764
|
+
"text": "Promise<PlaybackResult>"
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
"parameters": [
|
|
768
|
+
{
|
|
769
|
+
"name": "startTime",
|
|
770
|
+
"type": {
|
|
771
|
+
"text": "string"
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"name": "endTime",
|
|
776
|
+
"type": {
|
|
777
|
+
"text": "string"
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"name": "includeSnapshot",
|
|
782
|
+
"default": "true",
|
|
783
|
+
"type": {
|
|
784
|
+
"text": "boolean"
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
]
|
|
788
|
+
}
|
|
789
|
+
],
|
|
790
|
+
"exports": [
|
|
791
|
+
{
|
|
792
|
+
"kind": "js",
|
|
793
|
+
"name": "fetchPlayback",
|
|
794
|
+
"declaration": {
|
|
795
|
+
"name": "fetchPlayback",
|
|
796
|
+
"module": "src/graphql/playback.ts"
|
|
797
|
+
}
|
|
612
798
|
}
|
|
613
799
|
]
|
|
614
800
|
},
|
|
@@ -988,6 +1174,49 @@
|
|
|
988
1174
|
}
|
|
989
1175
|
]
|
|
990
1176
|
},
|
|
1177
|
+
{
|
|
1178
|
+
"kind": "function",
|
|
1179
|
+
"name": "fetchBoardNameById",
|
|
1180
|
+
"return": {
|
|
1181
|
+
"type": {
|
|
1182
|
+
"text": "Promise<string>"
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
"parameters": [
|
|
1186
|
+
{
|
|
1187
|
+
"name": "id",
|
|
1188
|
+
"type": {
|
|
1189
|
+
"text": "string"
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
]
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
"kind": "function",
|
|
1196
|
+
"name": "reorderBoard",
|
|
1197
|
+
"parameters": [
|
|
1198
|
+
{
|
|
1199
|
+
"name": "id",
|
|
1200
|
+
"type": {
|
|
1201
|
+
"text": "string"
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
"name": "prevId",
|
|
1206
|
+
"optional": true,
|
|
1207
|
+
"type": {
|
|
1208
|
+
"text": "string"
|
|
1209
|
+
}
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
"name": "nextId",
|
|
1213
|
+
"optional": true,
|
|
1214
|
+
"type": {
|
|
1215
|
+
"text": "string"
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
]
|
|
1219
|
+
},
|
|
991
1220
|
{
|
|
992
1221
|
"kind": "function",
|
|
993
1222
|
"name": "fetchBoardById",
|
|
@@ -997,6 +1226,13 @@
|
|
|
997
1226
|
"type": {
|
|
998
1227
|
"text": "string"
|
|
999
1228
|
}
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
"name": "cachedUpdatedAt",
|
|
1232
|
+
"optional": true,
|
|
1233
|
+
"type": {
|
|
1234
|
+
"text": "string"
|
|
1235
|
+
}
|
|
1000
1236
|
}
|
|
1001
1237
|
]
|
|
1002
1238
|
},
|
|
@@ -1065,6 +1301,22 @@
|
|
|
1065
1301
|
"module": "src/restful/board.ts"
|
|
1066
1302
|
}
|
|
1067
1303
|
},
|
|
1304
|
+
{
|
|
1305
|
+
"kind": "js",
|
|
1306
|
+
"name": "fetchBoardNameById",
|
|
1307
|
+
"declaration": {
|
|
1308
|
+
"name": "fetchBoardNameById",
|
|
1309
|
+
"module": "src/restful/board.ts"
|
|
1310
|
+
}
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
"kind": "js",
|
|
1314
|
+
"name": "reorderBoard",
|
|
1315
|
+
"declaration": {
|
|
1316
|
+
"name": "reorderBoard",
|
|
1317
|
+
"module": "src/restful/board.ts"
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1068
1320
|
{
|
|
1069
1321
|
"kind": "js",
|
|
1070
1322
|
"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, prevId?: string, nextId?: string): 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, prevId, nextId) {
|
|
40
|
+
const response = await client.mutate({
|
|
41
|
+
mutation: gql `
|
|
42
|
+
mutation ReorderBoard($id: String!, $prevId: String, $nextId: String) {
|
|
43
|
+
reorderBoard(id: $id, prevId: $prevId, nextId: $nextId)
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
variables: { id, prevId, nextId }
|
|
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":"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;;;;;;;;;;;;;KAahC;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EAAU;;IACjD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;KAOT;QACD,SAAS,EAAE,EAAE,EAAE,EAAE;KAClB,CAAC,CAAA;IACF,OAAO,CAAA,MAAC,IAAY,CAAC,KAAK,0CAAE,IAAI,KAAI,EAAE,CAAA;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAU,EAAE,MAAe,E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,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;KAeZ;QACD,SAAS,EAAE;YACT,EAAE;YACF,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE;SAC7C;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAU;IAC1C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;KAIZ;QACD,SAAS,EAAE;YACT,EAAE;SACH;KACF,CAAC,CAAA;IAEF,OAAO,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, prevId?: string, nextId?: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ReorderBoard($id: String!, $prevId: String, $nextId: String) {\n reorderBoard(id: $id, prevId: $prevId, nextId: $nextId)\n }\n `,\n variables: { id, prevId, nextId }\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, prevId?: string, nextId?: string): 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, prevId, nextId) {
|
|
26
26
|
if (isRestfulAvailable()) {
|
|
27
|
-
return await
|
|
27
|
+
return await restfulReorderBoard(id, prevId, nextId);
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
return await
|
|
30
|
+
return await graphqlReorderBoard(id, prevId, nextId);
|
|
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,IAAI,uBAAuB,EAC3C,kBAAkB,IAAI,yBAAyB,EAChD,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,IAAI,uBAAuB,EAC3C,kBAAkB,IAAI,yBAAyB,EAChD,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,cAAc,IAAI,qBAAqB,EACvC,cAAc,IAAI,qBAAqB,EACvC,WAAW,IAAI,kBAAkB,EACjC,cAAc,IAAI,qBAAqB,
|
|
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,IAAI,uBAAuB,EAC3C,kBAAkB,IAAI,yBAAyB,EAChD,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,IAAI,uBAAuB,EAC3C,kBAAkB,IAAI,yBAAyB,EAChD,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,cAA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AC1C,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,yBAAyB,EAAE,CAAA;IAC1C,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,EAAU;;IACzD,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,MAAA,CAAC,MAAM,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,0CAAE,IAAI,CAAA;QAE5D,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClC,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,MAAM,EAAE;oBACN,KAAK,EAAE,OAAO;oBACd,OAAO,EAAE,sBAAsB;iBAChC;aACF,CAAC,CACH,CAAA;YACD,MAAM,IAAI,KAAK,CAAC,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, prevId?: string, nextId?: string) {\n if (isRestfulAvailable()) {\n return await restfulReorderBoard(id, prevId, nextId)\n } else {\n return await graphqlReorderBoard(id, prevId, nextId)\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, prevId?: string, nextId?: string): 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, prevId, nextId) {
|
|
21
|
+
return callApi(getRestServiceFullPath() + '/reorderBoard', 'post', null, { id, prevId, nextId });
|
|
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,EAAE,SAAS,CAAC,CAAA;AACvF,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,EAAU;IACxD,OAAO,OAAO,CAAC,sBAAsB,EAAE,GAAG,mCAAmC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxG,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAY;IACtC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACzC,OAAO,OAAO,CAAC,sBAAsB,EAAE,GAAG,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;AAChF,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAAU;IACpC,OAAO,OAAO,CAAC,sBAAsB,EAAE,GAAG,eAAe,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACvF,CAAC;AAED,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"board.js","sourceRoot":"","sources":["../../../src/restful/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,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAClG,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAU,EAAE,eAAwB;IACjE,MAAM,GAAG,GAAG,sBAAsB,EAAE,GAAG,kBAAkB,GAAG,EAAE;UAC1D,CAAC,eAAe,CAAC,CAAC,CAAC,oBAAoB,kBAAkB,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IACtF,OAAO,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EAAU;IACjD,uBAAuB;IACvB,OAAO,OAAO,CAAC,sBAAsB,EAAE,GAAG,sBAAsB,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAC3F,CAAC;AAED,MAAM,UAAU,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, prevId?: string, nextId?: string) {\n return callApi(getRestServiceFullPath() + '/reorderBoard', 'post', null, { id, prevId, nextId })\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"]}
|