@fmsim/api 2.0.0-beta.36 → 2.0.0-beta.40

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.
@@ -53,6 +53,39 @@
53
53
  }
54
54
  ]
55
55
  },
56
+ {
57
+ "kind": "function",
58
+ "name": "fetchPlayback",
59
+ "parameters": [
60
+ {
61
+ "name": "startTime",
62
+ "type": {
63
+ "text": "string"
64
+ }
65
+ },
66
+ {
67
+ "name": "endTime",
68
+ "optional": true,
69
+ "type": {
70
+ "text": "string"
71
+ }
72
+ },
73
+ {
74
+ "name": "includeSnapshot",
75
+ "default": "true",
76
+ "type": {
77
+ "text": "boolean"
78
+ }
79
+ },
80
+ {
81
+ "name": "count",
82
+ "optional": true,
83
+ "type": {
84
+ "text": "number"
85
+ }
86
+ }
87
+ ]
88
+ },
56
89
  {
57
90
  "kind": "function",
58
91
  "name": "fetchBoardById",
@@ -173,6 +206,14 @@
173
206
  "module": "src/index.ts"
174
207
  }
175
208
  },
209
+ {
210
+ "kind": "js",
211
+ "name": "fetchPlayback",
212
+ "declaration": {
213
+ "name": "fetchPlayback",
214
+ "module": "src/index.ts"
215
+ }
216
+ },
176
217
  {
177
218
  "kind": "js",
178
219
  "name": "fetchBoardById",
@@ -441,6 +482,15 @@
441
482
  "description": "",
442
483
  "name": "DataSubscriptionProviderImpl",
443
484
  "members": [
485
+ {
486
+ "kind": "field",
487
+ "name": "_paused",
488
+ "type": {
489
+ "text": "boolean"
490
+ },
491
+ "privacy": "private",
492
+ "default": "false"
493
+ },
444
494
  {
445
495
  "kind": "method",
446
496
  "name": "subscribe",
@@ -464,6 +514,16 @@
464
514
  }
465
515
  ]
466
516
  },
517
+ {
518
+ "kind": "method",
519
+ "name": "pause",
520
+ "description": "플레이백 중 라이브 데이터 배포 중단"
521
+ },
522
+ {
523
+ "kind": "method",
524
+ "name": "resume",
525
+ "description": "플레이백 종료 후 라이브 데이터 배포 재개"
526
+ },
467
527
  {
468
528
  "kind": "method",
469
529
  "name": "dispose"
@@ -1944,6 +2004,14 @@
1944
2004
  "name": "*",
1945
2005
  "module": "src/restful/theme"
1946
2006
  }
2007
+ },
2008
+ {
2009
+ "kind": "js",
2010
+ "name": "*",
2011
+ "declaration": {
2012
+ "name": "*",
2013
+ "module": "src/restful/playback"
2014
+ }
1947
2015
  }
1948
2016
  ]
1949
2017
  },
@@ -1981,6 +2049,61 @@
1981
2049
  }
1982
2050
  ]
1983
2051
  },
2052
+ {
2053
+ "kind": "javascript-module",
2054
+ "path": "src/restful/playback.ts",
2055
+ "declarations": [
2056
+ {
2057
+ "kind": "function",
2058
+ "name": "fetchPlayback",
2059
+ "return": {
2060
+ "type": {
2061
+ "text": "Promise<PlaybackResult>"
2062
+ }
2063
+ },
2064
+ "parameters": [
2065
+ {
2066
+ "name": "startTime",
2067
+ "type": {
2068
+ "text": "string"
2069
+ }
2070
+ },
2071
+ {
2072
+ "name": "endTime",
2073
+ "optional": true,
2074
+ "type": {
2075
+ "text": "string"
2076
+ }
2077
+ },
2078
+ {
2079
+ "name": "includeSnapshot",
2080
+ "default": "true",
2081
+ "type": {
2082
+ "text": "boolean"
2083
+ }
2084
+ },
2085
+ {
2086
+ "name": "count",
2087
+ "optional": true,
2088
+ "type": {
2089
+ "text": "number"
2090
+ }
2091
+ }
2092
+ ],
2093
+ "description": "RESTful 플레이백 데이터 조회\nGET /mcs/lv/playback?startTime=...&endTime=...&count=...&includeSnapshot=..."
2094
+ }
2095
+ ],
2096
+ "exports": [
2097
+ {
2098
+ "kind": "js",
2099
+ "name": "fetchPlayback",
2100
+ "declaration": {
2101
+ "name": "fetchPlayback",
2102
+ "module": "src/restful/playback.ts"
2103
+ }
2104
+ }
2105
+ ]
2106
+ },
1984
2107
  {
1985
2108
  "kind": "javascript-module",
1986
2109
  "path": "src/restful/scenario.ts",
@@ -1,7 +1,12 @@
1
1
  import { Component, DataSubscriptionProvider } from '@hatiolab/things-scene';
2
2
  export declare class DataSubscriptionProviderImpl implements DataSubscriptionProvider {
3
+ private _paused;
3
4
  subscribe(tag: string, component: Component): Promise<{
4
5
  unsubscribe: () => void;
5
6
  }>;
7
+ /** 플레이백 중 라이브 데이터 배포 중단 */
8
+ pause(): void;
9
+ /** 플레이백 종료 후 라이브 데이터 배포 재개 */
10
+ resume(): void;
6
11
  dispose(): void;
7
12
  }
@@ -1,6 +1,9 @@
1
1
  import gql from 'graphql-tag';
2
2
  import { subscribe } from '@operato/graphql';
3
3
  export class DataSubscriptionProviderImpl {
4
+ constructor() {
5
+ this._paused = false;
6
+ }
4
7
  async subscribe(tag, component) {
5
8
  return await subscribe({
6
9
  query: gql `
@@ -13,12 +16,16 @@ export class DataSubscriptionProviderImpl {
13
16
  `
14
17
  }, {
15
18
  next: async ({ data }) => {
16
- if (data) {
19
+ if (data && !this._paused) {
17
20
  component.data = data.data.data;
18
21
  }
19
22
  }
20
23
  });
21
24
  }
25
+ /** 플레이백 중 라이브 데이터 배포 중단 */
26
+ pause() { this._paused = true; }
27
+ /** 플레이백 종료 후 라이브 데이터 배포 재개 */
28
+ resume() { this._paused = false; }
22
29
  dispose() { }
23
30
  }
24
31
  //# sourceMappingURL=data-subscription.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-subscription.js","sourceRoot":"","sources":["../../../src/graphql/data-subscription.ts"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,MAAM,OAAO,4BAA4B;IACvC,KAAK,CAAC,SAAS,CAAC,GAAW,EAAE,SAAoB;QAC/C,OAAO,MAAM,SAAS,CACpB;YACE,KAAK,EAAE,GAAG,CAAA;;iCAEe,GAAG;;;;;iBAKnB;SACV,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE,CAAC;oBACT,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;gBACjC,CAAC;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;IAED,OAAO,KAAI,CAAC;CACb","sourcesContent":["import { Component, DataSubscriptionProvider } from '@hatiolab/things-scene'\n\nimport gql from 'graphql-tag'\nimport { subscribe } from '@operato/graphql'\n\nexport class DataSubscriptionProviderImpl implements DataSubscriptionProvider {\n async subscribe(tag: string, component: Component): Promise<{ unsubscribe: () => void }> {\n return await subscribe(\n {\n query: gql`\n subscription {\n data(tag: \"${tag}\") {\n tag\n data\n }\n }\n `\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n component.data = data.data.data\n }\n }\n }\n )\n }\n\n dispose() {}\n}\n"]}
1
+ {"version":3,"file":"data-subscription.js","sourceRoot":"","sources":["../../../src/graphql/data-subscription.ts"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,MAAM,OAAO,4BAA4B;IAAzC;QACU,YAAO,GAAG,KAAK,CAAA;IA+BzB,CAAC;IA7BC,KAAK,CAAC,SAAS,CAAC,GAAW,EAAE,SAAoB;QAC/C,OAAO,MAAM,SAAS,CACpB;YACE,KAAK,EAAE,GAAG,CAAA;;iCAEe,GAAG;;;;;iBAKnB;SACV,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;oBAC1B,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;gBACjC,CAAC;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;IAED,2BAA2B;IAC3B,KAAK,KAAK,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA,CAAC,CAAC;IAE/B,8BAA8B;IAC9B,MAAM,KAAK,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA,CAAC,CAAC;IAEjC,OAAO,KAAI,CAAC;CACb","sourcesContent":["import { Component, DataSubscriptionProvider } from '@hatiolab/things-scene'\n\nimport gql from 'graphql-tag'\nimport { subscribe } from '@operato/graphql'\n\nexport class DataSubscriptionProviderImpl implements DataSubscriptionProvider {\n private _paused = false\n\n async subscribe(tag: string, component: Component): Promise<{ unsubscribe: () => void }> {\n return await subscribe(\n {\n query: gql`\n subscription {\n data(tag: \"${tag}\") {\n tag\n data\n }\n }\n `\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data && !this._paused) {\n component.data = data.data.data\n }\n }\n }\n )\n }\n\n /** 플레이백 중 라이브 데이터 배포 중단 */\n pause() { this._paused = true }\n\n /** 플레이백 종료 후 라이브 데이터 배포 재개 */\n resume() { this._paused = false }\n\n dispose() {}\n}\n"]}
@@ -4,6 +4,7 @@ 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
6
  export declare function reorderBoard(id: string, prevId?: string, nextId?: string): Promise<any>;
7
+ export declare function fetchPlayback(startTime: string, endTime?: string, includeSnapshot?: boolean, count?: number): Promise<import("./graphql").PlaybackResult>;
7
8
  export declare function fetchBoardById(id: string, cachedUpdatedAt?: string): Promise<any>;
8
9
  export declare function fetchBoardNameById(id: string): Promise<string>;
9
10
  export declare function createBoard(board: Board): Promise<any>;
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, 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';
4
+ import { fetchGroupList as restfulFetchGroupList, fetchBoardList as restfulFetchBoardList, createBoard as restfulCreateBoard, fetchBoardById as restfulFetchBoardById, fetchBoardNameById as restfulFetchBoardNameById, reorderBoard as restfulReorderBoard, fetchPlayback as restfulFetchPlayback } from './restful';
5
+ import { fetchGroupList as graphqlFetchGroupList, fetchBoardList as graphqlFetchBoardList, createBoard as graphqlCreateBoard, fetchBoardById as graphqlFetchBoardById, fetchBoardNameById as graphqlFetchBoardNameById, reorderBoard as graphqlReorderBoard, fetchPlayback as graphqlFetchPlayback } from './graphql';
6
6
  export function isRestfulAvailable() {
7
7
  return sessionStorage.getItem('lv_server_ip_port');
8
8
  }
@@ -30,6 +30,14 @@ export async function reorderBoard(id, prevId, nextId) {
30
30
  return await graphqlReorderBoard(id, prevId, nextId);
31
31
  }
32
32
  }
33
+ export async function fetchPlayback(startTime, endTime, includeSnapshot = true, count) {
34
+ if (isRestfulAvailable()) {
35
+ return await restfulFetchPlayback(startTime, endTime, includeSnapshot, count);
36
+ }
37
+ else {
38
+ return await graphqlFetchPlayback(startTime, endTime || '', includeSnapshot);
39
+ }
40
+ }
33
41
  export async function fetchBoardById(id, cachedUpdatedAt) {
34
42
  if (isRestfulAvailable()) {
35
43
  return await restfulFetchBoardById(id, cachedUpdatedAt);
@@ -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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;IACxC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,OAAO,MAAM,yBAAyB,EAAE,CAAA;IAC1C,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"]}
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,EACvC,kBAAkB,IAAI,yBAAyB,EAC/C,YAAY,IAAI,mBAAmB,EACnC,aAAa,IAAI,oBAAoB,EACtC,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,cAAc,IAAI,qBAAqB,EACvC,cAAc,IAAI,qBAAqB,EACvC,WAAW,IAAI,kBAAkB,EACjC,cAAc,IAAI,qBAAqB,EACvC,kBAAkB,IAAI,yBAAyB,EAC/C,YAAY,IAAI,mBAAmB,EACnC,aAAa,IAAI,oBAAoB,EACtC,MAAM,WAAW,CAAA;AAIlB,MAAM,UAAU,kBAAkB;IAChC,OAAO,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UA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AU;;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 fetchPlayback as restfulFetchPlayback\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 fetchPlayback as graphqlFetchPlayback\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 fetchPlayback(\n startTime: string,\n endTime?: string,\n includeSnapshot: boolean = true,\n count?: number\n) {\n if (isRestfulAvailable()) {\n return await restfulFetchPlayback(startTime, endTime, includeSnapshot, count)\n } else {\n return await graphqlFetchPlayback(startTime, endTime || '', includeSnapshot)\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"]}
@@ -9,3 +9,4 @@ export * from './scenario';
9
9
  export * from './common';
10
10
  export * from './machine';
11
11
  export * from './theme';
12
+ export * from './playback';
@@ -9,4 +9,5 @@ export * from './scenario';
9
9
  export * from './common';
10
10
  export * from './machine';
11
11
  export * from './theme';
12
+ export * from './playback';
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/restful/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA","sourcesContent":["export * from './board'\nexport * from './authHeader'\nexport * from './favorite-board'\nexport * from './group'\nexport * from './font'\nexport * from './attachment'\nexport * from './connection'\nexport * from './scenario'\nexport * from './common'\nexport * from './machine'\nexport * from './theme'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/restful/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA","sourcesContent":["export * from './board'\nexport * from './authHeader'\nexport * from './favorite-board'\nexport * from './group'\nexport * from './font'\nexport * from './attachment'\nexport * from './connection'\nexport * from './scenario'\nexport * from './common'\nexport * from './machine'\nexport * from './theme'\nexport * from './playback'\n"]}
@@ -0,0 +1,16 @@
1
+ import type { PlaybackResult } from '../graphql/playback';
2
+ export interface PlaybackParams {
3
+ /** 시작 시점 "YYYY-MM-DD HH:mm:ss" */
4
+ startTime: string;
5
+ /** 종료 시점 (범위 조회) */
6
+ endTime?: string;
7
+ /** 시작 시점부터 조회할 프레임 수 (개수 조회) */
8
+ count?: number;
9
+ /** 시작 시점의 전체 상태(snapshot) 포함 여부 */
10
+ includeSnapshot?: boolean;
11
+ }
12
+ /**
13
+ * RESTful 플레이백 데이터 조회
14
+ * GET /mcs/lv/playback?startTime=...&endTime=...&count=...&includeSnapshot=...
15
+ */
16
+ export declare function fetchPlayback(startTime: string, endTime?: string, includeSnapshot?: boolean, count?: number): Promise<PlaybackResult>;
@@ -0,0 +1,37 @@
1
+ import { callApi } from './common';
2
+ import { getRestServiceFullPath } from './common';
3
+ /**
4
+ * RESTful 플레이백 데이터 조회
5
+ * GET /mcs/lv/playback?startTime=...&endTime=...&count=...&includeSnapshot=...
6
+ */
7
+ export async function fetchPlayback(startTime, endTime, includeSnapshot = true, count) {
8
+ var _a;
9
+ const query = new URLSearchParams();
10
+ query.set('startTime', startTime);
11
+ if (endTime)
12
+ query.set('endTime', endTime);
13
+ if (count != null)
14
+ query.set('count', String(count));
15
+ if (includeSnapshot != null)
16
+ query.set('includeSnapshot', String(includeSnapshot));
17
+ const url = getRestServiceFullPath() + '/playback?' + query.toString();
18
+ const response = await callApi(url, 'get', null, null);
19
+ const result = ((response === null || response === void 0 ? void 0 : response.data) || { status: false });
20
+ // data가 JSON string으로 전달되면 파싱 (서버 호환)
21
+ if ((_a = result === null || result === void 0 ? void 0 : result.playback) === null || _a === void 0 ? void 0 : _a.scenarios) {
22
+ for (const scenario of result.playback.scenarios) {
23
+ for (const frame of scenario.snapshots) {
24
+ if (typeof frame.data === 'string') {
25
+ try {
26
+ frame.data = JSON.parse(frame.data);
27
+ }
28
+ catch (_b) {
29
+ frame.data = [];
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ return result;
36
+ }
37
+ //# sourceMappingURL=playback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playback.js","sourceRoot":"","sources":["../../../src/restful/playback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAcjD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,SAAiB,EACjB,OAAgB,EAChB,kBAA2B,IAAI,EAC/B,KAAc;;IAEd,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAA;IACnC,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IACjC,IAAI,OAAO;QAAE,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAC1C,IAAI,KAAK,IAAI,IAAI;QAAE,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IACpD,IAAI,eAAe,IAAI,IAAI;QAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAA;IAElF,MAAM,GAAG,GAAG,sBAAsB,EAAE,GAAG,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;IACtE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAEtD,MAAM,MAAM,GAAG,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,KAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAmB,CAAA;IAEtE,sCAAsC;IACtC,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 { callApi } from './common'\nimport { getRestServiceFullPath } from './common'\nimport type { PlaybackResult } from '../graphql/playback'\n\nexport interface PlaybackParams {\n /** 시작 시점 \"YYYY-MM-DD HH:mm:ss\" */\n startTime: string\n /** 종료 시점 (범위 조회) */\n endTime?: string\n /** 시작 시점부터 조회할 프레임 수 (개수 조회) */\n count?: number\n /** 시작 시점의 전체 상태(snapshot) 포함 여부 */\n includeSnapshot?: boolean\n}\n\n/**\n * RESTful 플레이백 데이터 조회\n * GET /mcs/lv/playback?startTime=...&endTime=...&count=...&includeSnapshot=...\n */\nexport async function fetchPlayback(\n startTime: string,\n endTime?: string,\n includeSnapshot: boolean = true,\n count?: number\n): Promise<PlaybackResult> {\n const query = new URLSearchParams()\n query.set('startTime', startTime)\n if (endTime) query.set('endTime', endTime)\n if (count != null) query.set('count', String(count))\n if (includeSnapshot != null) query.set('includeSnapshot', String(includeSnapshot))\n\n const url = getRestServiceFullPath() + '/playback?' + query.toString()\n const response = await callApi(url, 'get', null, null)\n\n const result = (response?.data || { status: false }) 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"]}