@fmsim/api 0.0.49

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.
Files changed (69) hide show
  1. package/.storybook/main.js +3 -0
  2. package/.storybook/server.mjs +8 -0
  3. package/custom-elements.json +1875 -0
  4. package/dist/mcs-config/mcs_auto_config.json +2298 -0
  5. package/dist/src/graphql/board.d.ts +7 -0
  6. package/dist/src/graphql/board.js +177 -0
  7. package/dist/src/graphql/board.js.map +1 -0
  8. package/dist/src/graphql/data-subscription.d.ts +5 -0
  9. package/dist/src/graphql/data-subscription.js +24 -0
  10. package/dist/src/graphql/data-subscription.js.map +1 -0
  11. package/dist/src/graphql/favorite-board.d.ts +4 -0
  12. package/dist/src/graphql/favorite-board.js +61 -0
  13. package/dist/src/graphql/favorite-board.js.map +1 -0
  14. package/dist/src/graphql/group.d.ts +7 -0
  15. package/dist/src/graphql/group.js +125 -0
  16. package/dist/src/graphql/group.js.map +1 -0
  17. package/dist/src/graphql/index.d.ts +6 -0
  18. package/dist/src/graphql/index.js +7 -0
  19. package/dist/src/graphql/index.js.map +1 -0
  20. package/dist/src/graphql/scenario.d.ts +6 -0
  21. package/dist/src/graphql/scenario.js +69 -0
  22. package/dist/src/graphql/scenario.js.map +1 -0
  23. package/dist/src/graphql/theme.d.ts +3 -0
  24. package/dist/src/graphql/theme.js +56 -0
  25. package/dist/src/graphql/theme.js.map +1 -0
  26. package/dist/src/index.d.ts +1 -0
  27. package/dist/src/index.js +32 -0
  28. package/dist/src/index.js.map +1 -0
  29. package/dist/src/restful/attachment.d.ts +5 -0
  30. package/dist/src/restful/attachment.js +22 -0
  31. package/dist/src/restful/attachment.js.map +1 -0
  32. package/dist/src/restful/authHeader.d.ts +4 -0
  33. package/dist/src/restful/authHeader.js +22 -0
  34. package/dist/src/restful/authHeader.js.map +1 -0
  35. package/dist/src/restful/board.d.ts +8 -0
  36. package/dist/src/restful/board.js +28 -0
  37. package/dist/src/restful/board.js.map +1 -0
  38. package/dist/src/restful/common.d.ts +19 -0
  39. package/dist/src/restful/common.js +58 -0
  40. package/dist/src/restful/common.js.map +1 -0
  41. package/dist/src/restful/connection.d.ts +5 -0
  42. package/dist/src/restful/connection.js +17 -0
  43. package/dist/src/restful/connection.js.map +1 -0
  44. package/dist/src/restful/favorite-board.d.ts +4 -0
  45. package/dist/src/restful/favorite-board.js +14 -0
  46. package/dist/src/restful/favorite-board.js.map +1 -0
  47. package/dist/src/restful/font.d.ts +3 -0
  48. package/dist/src/restful/font.js +11 -0
  49. package/dist/src/restful/font.js.map +1 -0
  50. package/dist/src/restful/group.d.ts +6 -0
  51. package/dist/src/restful/group.js +18 -0
  52. package/dist/src/restful/group.js.map +1 -0
  53. package/dist/src/restful/index.d.ts +10 -0
  54. package/dist/src/restful/index.js +12 -0
  55. package/dist/src/restful/index.js.map +1 -0
  56. package/dist/src/restful/machine.d.ts +7 -0
  57. package/dist/src/restful/machine.js +24 -0
  58. package/dist/src/restful/machine.js.map +1 -0
  59. package/dist/src/restful/scenario.d.ts +8 -0
  60. package/dist/src/restful/scenario.js +36 -0
  61. package/dist/src/restful/scenario.js.map +1 -0
  62. package/dist/src/types.d.ts +37 -0
  63. package/dist/src/types.js +2 -0
  64. package/dist/src/types.js.map +1 -0
  65. package/dist/tsconfig.tsbuildinfo +1 -0
  66. package/mcs-config/mcs_auto_config.json +2298 -0
  67. package/package.json +88 -0
  68. package/web-dev-server.config.mjs +30 -0
  69. package/web-test-runner.config.mjs +29 -0
@@ -0,0 +1,7 @@
1
+ import { Board } from '../types';
2
+ export declare function fetchBoardList(listParam?: any): Promise<any>;
3
+ export declare function fetchBoardById(id: string): Promise<any>;
4
+ export declare function createBoard(board: Board): Promise<any>;
5
+ export declare function updateBoard(board: Board): Promise<any>;
6
+ export declare function deleteBoard(id: string): Promise<any>;
7
+ export declare function fetchBoardInfoById(boardId: string): Promise<any>;
@@ -0,0 +1,177 @@
1
+ import { buildArgs, client } from '@operato/graphql';
2
+ import gql from 'graphql-tag';
3
+ export async function fetchBoardList(listParam = {}) {
4
+ const response = await client.query({
5
+ query: gql `
6
+ {
7
+ boards(${buildArgs(listParam)}) {
8
+ items {
9
+ id
10
+ name
11
+ description
12
+ thumbnail
13
+ createdAt
14
+ updatedAt
15
+ }
16
+ total
17
+ }
18
+ }
19
+ `
20
+ });
21
+ return response.data;
22
+ }
23
+ export async function fetchBoardById(id) {
24
+ const response = await client.query({
25
+ query: gql `
26
+ query FetchBoardById($id: String!) {
27
+ board(id: $id) {
28
+ id
29
+ name
30
+ description
31
+ group {
32
+ id
33
+ name
34
+ }
35
+ thumbnail
36
+ model
37
+ createdAt
38
+ creator {
39
+ id
40
+ name
41
+ }
42
+ updatedAt
43
+ updater {
44
+ id
45
+ name
46
+ }
47
+ }
48
+
49
+ themes {
50
+ items {
51
+ name
52
+ description
53
+ type
54
+ value
55
+ }
56
+ }
57
+ }
58
+ `,
59
+ variables: { id }
60
+ });
61
+ return response.data;
62
+ }
63
+ export async function createBoard(board) {
64
+ /*
65
+ input NewBoard {
66
+ name : String!
67
+ description : String
68
+ model : String!
69
+ groupId : String!
70
+ }
71
+ */
72
+ board.model = JSON.stringify(board.model);
73
+ const response = await client.mutate({
74
+ mutation: gql `
75
+ mutation CreateBoard($board: NewBoard!) {
76
+ createBoard(board: $board) {
77
+ id
78
+ name
79
+ description
80
+ model
81
+ createdAt
82
+ updatedAt
83
+ }
84
+ }
85
+ `,
86
+ variables: {
87
+ board
88
+ }
89
+ });
90
+ return response.data;
91
+ }
92
+ export async function updateBoard(board) {
93
+ /*
94
+ input BoardPatch {
95
+ name : String
96
+ description : String
97
+ model : String
98
+ }
99
+ */
100
+ var { id, name, description, model, groupId } = board;
101
+ model = JSON.stringify(model);
102
+ const response = await client.mutate({
103
+ mutation: gql `
104
+ mutation UpdateBoard($id: String!, $patch: BoardPatch!) {
105
+ updateBoard(id: $id, patch: $patch) {
106
+ id
107
+ name
108
+ description
109
+ model
110
+ group {
111
+ id
112
+ name
113
+ }
114
+ createdAt
115
+ updatedAt
116
+ }
117
+ }
118
+ `,
119
+ variables: {
120
+ id,
121
+ patch: { name, description, model, groupId }
122
+ }
123
+ });
124
+ return response.data;
125
+ }
126
+ export async function deleteBoard(id) {
127
+ const response = await client.mutate({
128
+ mutation: gql `
129
+ mutation ($id: String!) {
130
+ deleteBoard(id: $id)
131
+ }
132
+ `,
133
+ variables: {
134
+ id
135
+ }
136
+ });
137
+ return response.data;
138
+ }
139
+ export async function fetchBoardInfoById(boardId) {
140
+ const { data } = await client.query({
141
+ query: gql `
142
+ query FetchBoardById($id: String!) {
143
+ board(id: $id) {
144
+ id
145
+ name
146
+ description
147
+ group {
148
+ id
149
+ name
150
+ }
151
+ thumbnail
152
+ createdAt
153
+ creator {
154
+ id
155
+ name
156
+ }
157
+ updatedAt
158
+ updater {
159
+ id
160
+ name
161
+ }
162
+ }
163
+
164
+ groups {
165
+ items {
166
+ id
167
+ name
168
+ description
169
+ }
170
+ }
171
+ }
172
+ `,
173
+ variables: { id: boardId }
174
+ });
175
+ return data;
176
+ }
177
+ //# sourceMappingURL=board.js.map
@@ -0,0 +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;;;;;;;;;;;;KAYhC;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAU;IAC7C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;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AAA;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 createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchBoardById(id: string) {\n const response = 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 model\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n\n themes {\n items {\n name\n description\n type\n value\n }\n }\n }\n `,\n variables: { id }\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"]}
@@ -0,0 +1,5 @@
1
+ import { Component, DataSubscriptionProvider } from '@hatiolab/things-scene';
2
+ export declare class DataSubscriptionProviderImpl implements DataSubscriptionProvider {
3
+ subscribe(tag: string, component: Component): Promise<import("zen-observable-ts").Subscription>;
4
+ dispose(): void;
5
+ }
@@ -0,0 +1,24 @@
1
+ import gql from 'graphql-tag';
2
+ import { subscribe } from '@operato/graphql';
3
+ export class DataSubscriptionProviderImpl {
4
+ async subscribe(tag, component) {
5
+ return await subscribe({
6
+ query: gql `
7
+ subscription {
8
+ data(tag: "${tag}") {
9
+ tag
10
+ data
11
+ }
12
+ }
13
+ `
14
+ }, {
15
+ next: async ({ data }) => {
16
+ if (data) {
17
+ component.data = data.data.data;
18
+ }
19
+ }
20
+ });
21
+ }
22
+ dispose() { }
23
+ }
24
+ //# sourceMappingURL=data-subscription.js.map
@@ -0,0 +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;oBACR,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;iBAChC;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) {\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"]}
@@ -0,0 +1,4 @@
1
+ export declare function fetchFavoriteBoardList(listParam?: any): Promise<any>;
2
+ export declare function refreshFavorites(): Promise<any>;
3
+ export declare function removeFavorite(boardId: string): Promise<any>;
4
+ export declare function addFavorite(boardId: string): Promise<any>;
@@ -0,0 +1,61 @@
1
+ import { buildArgs, client } from '@operato/graphql';
2
+ import gql from 'graphql-tag';
3
+ export async function fetchFavoriteBoardList(listParam = {}) {
4
+ const response = await client.query({
5
+ query: gql `
6
+ {
7
+ favoriteBoards(${buildArgs(listParam)}) {
8
+ items {
9
+ id
10
+ name
11
+ description
12
+ thumbnail
13
+ createdAt
14
+ updatedAt
15
+ }
16
+ total
17
+ }
18
+ }
19
+ `
20
+ });
21
+ return response.data;
22
+ }
23
+ export async function refreshFavorites() {
24
+ const { data } = await client.query({
25
+ query: gql `
26
+ query {
27
+ myFavorites {
28
+ id
29
+ routing
30
+ }
31
+ }
32
+ `
33
+ });
34
+ return data;
35
+ }
36
+ export async function removeFavorite(boardId) {
37
+ const { data } = await client.query({
38
+ query: gql `
39
+ mutation {
40
+ deleteFavorite(routing: "${boardId}")
41
+ }
42
+ `
43
+ });
44
+ return data;
45
+ }
46
+ export async function addFavorite(boardId) {
47
+ const { data } = await client.query({
48
+ query: gql `
49
+ mutation {
50
+ createFavorite(favorite: {
51
+ routing: "${boardId}"
52
+ }) {
53
+ id
54
+ routing
55
+ }
56
+ }
57
+ `
58
+ });
59
+ return data;
60
+ }
61
+ //# sourceMappingURL=favorite-board.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"favorite-board.js","sourceRoot":"","sources":["../../../src/graphql/favorite-board.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,YAAiB,EAAE;IAC9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;yBAEW,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;;;KAYxC;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;KAOT;KACF,CAAC,CAAA;IAEF,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAe;IAClD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;mCAEqB,OAAO;;KAErC;KACF,CAAC,CAAA;IAEF,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAe;IAC/C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;sBAGQ,OAAO;;;;;;KAMxB;KACF,CAAC,CAAA;IAEF,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { buildArgs, client } from '@operato/graphql'\n\nimport gql from 'graphql-tag'\n\nexport async function fetchFavoriteBoardList(listParam: any = {}) {\n const response = await client.query({\n query: gql`\n {\n favoriteBoards(${buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function refreshFavorites() {\n const { data } = await client.query({\n query: gql`\n query {\n myFavorites {\n id\n routing\n }\n }\n `\n })\n\n return data\n}\n\nexport async function removeFavorite(boardId: string) {\n const { data } = await client.query({\n query: gql`\n mutation {\n deleteFavorite(routing: \"${boardId}\")\n }\n `\n })\n\n return data\n}\n\nexport async function addFavorite(boardId: string) {\n const { data } = await client.query({\n query: gql`\n mutation {\n createFavorite(favorite: {\n routing: \"${boardId}\"\n }) {\n id\n routing\n }\n }\n `\n })\n\n return data\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { BoardGroup } from '../types';
2
+ export declare function fetchGroupById(id: string): Promise<any>;
3
+ export declare function updateGroup(group: BoardGroup): Promise<any>;
4
+ export declare function deleteGroup(id: string): Promise<any>;
5
+ export declare function fetchGroupList(): Promise<any>;
6
+ export declare function createGroup(group: BoardGroup): Promise<any>;
7
+ export declare function joinGroup(boardId: string, groupId: string): Promise<any>;
@@ -0,0 +1,125 @@
1
+ import { client } from '@operato/graphql';
2
+ import gql from 'graphql-tag';
3
+ export async function fetchGroupById(id) {
4
+ const response = await client.query({
5
+ query: gql `
6
+ query FetchGroupById($id: String!) {
7
+ group(id: $id) {
8
+ id
9
+ name
10
+ description
11
+ createdAt
12
+ creator {
13
+ id
14
+ name
15
+ }
16
+ updatedAt
17
+ updater {
18
+ id
19
+ name
20
+ }
21
+ }
22
+ }
23
+ `,
24
+ variables: { id }
25
+ });
26
+ return response.data;
27
+ }
28
+ export async function updateGroup(group) {
29
+ var { id, name, description } = group;
30
+ const response = await client.mutate({
31
+ mutation: gql `
32
+ mutation UpdateGroup($id: String!, $patch: GroupPatch!) {
33
+ updateGroup(id: $id, patch: $patch) {
34
+ id
35
+ name
36
+ description
37
+ createdAt
38
+ updatedAt
39
+ }
40
+ }
41
+ `,
42
+ variables: {
43
+ id,
44
+ patch: { name, description }
45
+ }
46
+ });
47
+ return response.data;
48
+ }
49
+ export async function deleteGroup(id) {
50
+ const response = await client.mutate({
51
+ mutation: gql `
52
+ mutation ($id: String!) {
53
+ deleteGroup(id: $id)
54
+ }
55
+ `,
56
+ variables: {
57
+ id
58
+ }
59
+ });
60
+ return response.data;
61
+ }
62
+ export async function fetchGroupList() {
63
+ const response = await client.query({
64
+ query: gql `
65
+ {
66
+ groups {
67
+ items {
68
+ id
69
+ name
70
+ description
71
+ createdAt
72
+ updatedAt
73
+ }
74
+ total
75
+ }
76
+ }
77
+ `
78
+ });
79
+ return response.data;
80
+ }
81
+ export async function createGroup(group) {
82
+ const response = await client.mutate({
83
+ mutation: gql `
84
+ mutation CreateGroup($group: NewGroup!) {
85
+ createGroup(group: $group) {
86
+ id
87
+ name
88
+ description
89
+ createdAt
90
+ updatedAt
91
+ }
92
+ }
93
+ `,
94
+ variables: { group }
95
+ });
96
+ return response.data;
97
+ }
98
+ export async function joinGroup(boardId, groupId) {
99
+ const response = await client.mutate({
100
+ mutation: gql `
101
+ mutation JoinGroup($id: String!, $boardIds: [String!]!) {
102
+ joinGroup(id: $id, boardIds: $boardIds) {
103
+ id
104
+ name
105
+ description
106
+ boards {
107
+ id
108
+ name
109
+ description
110
+ createdAt
111
+ updatedAt
112
+ }
113
+ createdAt
114
+ updatedAt
115
+ }
116
+ }
117
+ `,
118
+ variables: {
119
+ id: groupId,
120
+ boardIds: [boardId]
121
+ }
122
+ });
123
+ return response.data;
124
+ }
125
+ //# sourceMappingURL=group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/graphql/group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAU;IAC7C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBT;QACD,SAAS,EAAE,EAAE,EAAE,EAAE;KAClB,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAiB;IACjD,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAErC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;KAUZ;QACD,SAAS,EAAE;YACT,EAAE;YACF,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;SAC7B;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,cAAc;IAClC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;KAaT;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAiB;IACjD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;KAUZ;QACD,SAAS,EAAE,EAAE,KAAK,EAAE;KACrB,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe,EAAE,OAAe;IAC9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import { BoardGroup } from '../types'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\n\nexport async function fetchGroupById(id: string) {\n const response = await client.query({\n query: gql`\n query FetchGroupById($id: String!) {\n group(id: $id) {\n id\n name\n description\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data\n}\n\nexport async function updateGroup(group: BoardGroup) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateGroup($id: String!, $patch: GroupPatch!) {\n updateGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deleteGroup(id: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function fetchGroupList() {\n const response = await client.query({\n query: gql`\n {\n groups {\n items {\n id\n name\n description\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function createGroup(group: BoardGroup) {\n const response = await client.mutate({\n mutation: gql`\n mutation CreateGroup($group: NewGroup!) {\n createGroup(group: $group) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: { group }\n })\n\n return response.data\n}\n\nexport async function joinGroup(boardId: string, groupId: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation JoinGroup($id: String!, $boardIds: [String!]!) {\n joinGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export * from './board';
2
+ export * from './data-subscription';
3
+ export * from './favorite-board';
4
+ export * from './group';
5
+ export * from './scenario';
6
+ export * from './theme';
@@ -0,0 +1,7 @@
1
+ export * from './board';
2
+ export * from './data-subscription';
3
+ export * from './favorite-board';
4
+ export * from './group';
5
+ export * from './scenario';
6
+ export * from './theme';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,6 @@
1
+ export declare const scenarios: () => Promise<{
2
+ name: string;
3
+ description: string;
4
+ }[]>;
5
+ export declare const startScenario: (scenarioName: string, instanceName: string, variables: string | number | object) => Promise<any>;
6
+ export declare const runScenario: (scenarioName: string, variables: string | number | object) => Promise<any>;
@@ -0,0 +1,69 @@
1
+ import gql from 'graphql-tag';
2
+ import { client } from '@operato/graphql';
3
+ export const scenarios = async () => {
4
+ var response = await client.query({
5
+ query: gql `
6
+ query {
7
+ scenarios {
8
+ items {
9
+ name
10
+ description
11
+ }
12
+ }
13
+ }
14
+ `
15
+ });
16
+ if (response.errors) {
17
+ return [];
18
+ }
19
+ return response.data.scenarios.items;
20
+ };
21
+ export const startScenario = async (scenarioName, instanceName, variables) => {
22
+ var _a, _b;
23
+ if (!scenarioName) {
24
+ return;
25
+ }
26
+ if (client) {
27
+ var response = await client.query({
28
+ query: gql `
29
+ mutation ($instanceName: String, $scenarioName: String!, $variables: Object) {
30
+ startScenario(instanceName: $instanceName, scenarioName: $scenarioName, variables: $variables) {
31
+ state
32
+ message
33
+ data
34
+ }
35
+ }
36
+ `,
37
+ variables: {
38
+ instanceName: instanceName,
39
+ scenarioName: scenarioName,
40
+ variables
41
+ }
42
+ });
43
+ return (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.startScenario) === null || _b === void 0 ? void 0 : _b.data;
44
+ }
45
+ };
46
+ export const runScenario = async (scenarioName, variables) => {
47
+ var _a, _b;
48
+ if (!scenarioName)
49
+ return;
50
+ if (client) {
51
+ var response = await client.query({
52
+ query: gql `
53
+ mutation ($scenarioName: String!, $variables: Object) {
54
+ runScenario(scenarioName: $scenarioName, variables: $variables) {
55
+ state
56
+ message
57
+ data
58
+ }
59
+ }
60
+ `,
61
+ variables: {
62
+ scenarioName: scenarioName,
63
+ variables
64
+ }
65
+ });
66
+ return (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.runScenario) === null || _b === void 0 ? void 0 : _b.data;
67
+ }
68
+ };
69
+ //# sourceMappingURL=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;OAQT;YACD,SAAS,EAAE;gBACT,YAAY,EAAE,YAAY;gBAC1B,SAAS;aACV;SACF,CAAC,CAAA;QAEF,OAAO,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,WAAW,0CAAE,IAAI,CAAA;KACzC;AACH,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nexport const scenarios = async (): Promise<{ name: string; description: string }[]> => {\n var response = await client.query({\n query: gql`\n query {\n scenarios {\n items {\n name\n description\n }\n }\n }\n `\n })\n\n if (response.errors) {\n return []\n }\n\n return response.data.scenarios.items\n}\n\nexport const startScenario = async (\n scenarioName: string,\n instanceName: string,\n variables: string | number | object\n) => {\n if (!scenarioName) {\n return\n }\n\n if (client) {\n var response = await client.query({\n query: gql`\n mutation ($instanceName: String, $scenarioName: String!, $variables: Object) {\n startScenario(instanceName: $instanceName, scenarioName: $scenarioName, variables: $variables) {\n state\n message\n data\n }\n }\n `,\n variables: {\n instanceName: instanceName,\n scenarioName: scenarioName,\n variables\n }\n })\n\n return response?.data?.startScenario?.data\n }\n}\n\nexport const runScenario = async (scenarioName: string, variables: string | number | object) => {\n if (!scenarioName) return\n\n if (client) {\n var response = await client.query({\n query: gql`\n mutation ($scenarioName: String!, $variables: Object) {\n runScenario(scenarioName: $scenarioName, variables: $variables) {\n state\n message\n data\n }\n }\n `,\n variables: {\n scenarioName: scenarioName,\n variables\n }\n })\n\n return response?.data?.runScenario?.data\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export declare function fetchThemeList(params?: any): Promise<any>;
2
+ export declare function updateMultipleTheme(patches: any[]): Promise<any>;
3
+ export declare function deleteThemes(ids: string[]): Promise<any>;
@@ -0,0 +1,56 @@
1
+ import { client } from '@operato/graphql';
2
+ import gql from 'graphql-tag';
3
+ export async function fetchThemeList(params = {}) {
4
+ const { data } = await client.query({
5
+ query: gql `
6
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
7
+ responses: themes(filters: $filters, pagination: $pagination, sortings: $sortings) {
8
+ items {
9
+ id
10
+ name
11
+ description
12
+ type
13
+ value
14
+ updater {
15
+ id
16
+ name
17
+ }
18
+ updatedAt
19
+ }
20
+ total
21
+ }
22
+ }
23
+ `,
24
+ variables: params
25
+ });
26
+ return data;
27
+ }
28
+ export async function updateMultipleTheme(patches) {
29
+ const response = await client.mutate({
30
+ mutation: gql `
31
+ mutation ($patches: [ThemePatch!]!) {
32
+ updateMultipleTheme(patches: $patches) {
33
+ name
34
+ }
35
+ }
36
+ `,
37
+ variables: {
38
+ patches
39
+ }
40
+ });
41
+ return response.data;
42
+ }
43
+ export async function deleteThemes(ids) {
44
+ const response = await client.mutate({
45
+ mutation: gql `
46
+ mutation ($ids: [String!]!) {
47
+ deleteThemes(ids: $ids)
48
+ }
49
+ `,
50
+ variables: {
51
+ ids
52
+ }
53
+ });
54
+ return response.data;
55
+ }
56
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../src/graphql/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,SAAc,EAAE;IACnD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBT;QACD,SAAS,EAAE,MAAM;KAClB,CAAC,CAAA;IAEF,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAc;IACtD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;KAMZ;QACD,SAAS,EAAE;YACT,OAAO;SACR;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAa;IAC9C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;KAIZ;QACD,SAAS,EAAE;YACT,GAAG;SACJ;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import { buildArgs, client } from '@operato/graphql'\n\nimport { Board } from '../types'\nimport gql from 'graphql-tag'\n\nexport async function fetchThemeList(params: any = {}) {\n const { data } = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: themes(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n type\n value\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: params\n })\n\n return data\n}\n\nexport async function updateMultipleTheme(patches: any[]) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [ThemePatch!]!) {\n updateMultipleTheme(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n return response.data\n}\n\nexport async function deleteThemes(ids: string[]) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteThemes(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n return response.data\n}\n"]}
@@ -0,0 +1 @@
1
+ export * from './graphql';
@@ -0,0 +1,32 @@
1
+ export * from './graphql';
2
+ // export * from './restful'
3
+ // import * as graphql from './graphql'
4
+ // import * as restful from './restful'
5
+ // class API {
6
+ // public fetchBoardList = graphql.fetchBoardList
7
+ // public fetchBoardById = graphql.fetchBoardById
8
+ // public createBoard = graphql.createBoard
9
+ // public updateBoard = graphql.updateBoard
10
+ // public deleteBoard = graphql.deleteBoard
11
+ // public fetchBoardInfoById = graphql.fetchBoardInfoById
12
+ // public fetchFavoriteBoardList = graphql.fetchFavoriteBoardList
13
+ // public refreshFavorites = graphql.refreshFavorites
14
+ // public removeFavorite = graphql.removeFavorite
15
+ // public addFavorite = graphql.addFavorite
16
+ // public fetchGroupById = graphql.fetchGroupById
17
+ // public updateGroup = graphql.updateGroup
18
+ // public deleteGroup = graphql.deleteGroup
19
+ // public fetchGroupList = graphql.fetchGroupList
20
+ // public createGroup = graphql.createGroup
21
+ // public joinGroup = graphql.joinGroup
22
+ // public scenarios = graphql.scenarios
23
+ // public startScenario = graphql.startScenario
24
+ // public runScenario = graphql.runScenario
25
+ // public fetchThemeList = graphql.fetchThemeList
26
+ // public updateMultipleTheme = graphql.updateMultipleTheme
27
+ // public deleteThemes = graphql.deleteThemes
28
+ // public DataSubscriptionProviderImpl = graphql.DataSubscriptionProviderImpl
29
+ // }
30
+ // const APIInstance = new API()
31
+ // export default APIInstance
32
+ //# sourceMappingURL=index.js.map