@operato/board 0.2.49 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/assets/images/components/audio.png +0 -0
- package/assets/images/components/both-arrow.png +0 -0
- package/assets/images/components/color-image.png +0 -0
- package/assets/images/components/container.png +0 -0
- package/assets/images/components/dash.png +0 -0
- package/assets/images/components/donut.png +0 -0
- package/assets/images/components/ellipse.png +0 -0
- package/assets/images/components/forklift.png +0 -0
- package/assets/images/components/gif-image.png +0 -0
- package/assets/images/components/global-reference.png +0 -0
- package/assets/images/components/gray-image.png +0 -0
- package/assets/images/components/humidity-sensor.png +0 -0
- package/assets/images/components/info-window.png +0 -0
- package/assets/images/components/line.png +0 -0
- package/assets/images/components/local-reference.png +0 -0
- package/assets/images/components/person.png +0 -0
- package/assets/images/components/polygon.png +0 -0
- package/assets/images/components/polyline.png +0 -0
- package/assets/images/components/popup.png +0 -0
- package/assets/images/components/rect.png +0 -0
- package/assets/images/components/single-arrow.png +0 -0
- package/assets/images/components/star.png +0 -0
- package/assets/images/components/text.png +0 -0
- package/assets/images/components/triangle.png +0 -0
- package/assets/images/icon-vtoolbar.png +0 -0
- package/custom-elements.json +2665 -1411
- package/dist/src/component/3d.d.ts +2 -0
- package/dist/src/component/3d.js +27 -0
- package/dist/src/component/3d.js.map +1 -0
- package/dist/src/component/chart-and-gauge.d.ts +2 -0
- package/dist/src/component/chart-and-gauge.js +26 -0
- package/dist/src/component/chart-and-gauge.js.map +1 -0
- package/dist/src/component/container.d.ts +2 -0
- package/dist/src/component/container.js +60 -0
- package/dist/src/component/container.js.map +1 -0
- package/dist/src/component/data-source.d.ts +2 -0
- package/dist/src/component/data-source.js +28 -0
- package/dist/src/component/data-source.js.map +1 -0
- package/dist/src/component/etc.d.ts +2 -0
- package/dist/src/component/etc.js +82 -0
- package/dist/src/component/etc.js.map +1 -0
- package/dist/src/component/form.d.ts +2 -0
- package/dist/src/component/form.js +40 -0
- package/dist/src/component/form.js.map +1 -0
- package/dist/src/component/index.d.ts +12 -0
- package/dist/src/component/index.js +13 -0
- package/dist/src/component/index.js.map +1 -0
- package/dist/src/component/iot.d.ts +2 -0
- package/dist/src/component/iot.js +50 -0
- package/dist/src/component/iot.js.map +1 -0
- package/dist/src/component/line.d.ts +2 -0
- package/dist/src/component/line.js +130 -0
- package/dist/src/component/line.js.map +1 -0
- package/dist/src/component/register-default-groups.d.ts +1 -0
- package/dist/src/component/register-default-groups.js +28 -0
- package/dist/src/component/register-default-groups.js.map +1 -0
- package/dist/src/component/shape.d.ts +2 -0
- package/dist/src/component/shape.js +152 -0
- package/dist/src/component/shape.js.map +1 -0
- package/dist/src/component/table.d.ts +2 -0
- package/dist/src/component/table.js +26 -0
- package/dist/src/component/table.js.map +1 -0
- package/dist/src/component/text-and-media.d.ts +2 -0
- package/dist/src/component/text-and-media.js +122 -0
- package/dist/src/component/text-and-media.js.map +1 -0
- package/dist/src/component/warehouse.d.ts +2 -0
- package/dist/src/component/warehouse.js +24 -0
- package/dist/src/component/warehouse.js.map +1 -0
- package/dist/src/graphql/board.d.ts +6 -0
- package/dist/src/graphql/board.js +130 -0
- package/dist/src/graphql/board.js.map +1 -0
- package/dist/src/graphql/favorite-board.d.ts +1 -0
- package/dist/src/graphql/favorite-board.js +23 -0
- package/dist/src/graphql/favorite-board.js.map +1 -0
- package/dist/src/graphql/group.d.ts +7 -0
- package/dist/src/graphql/group.js +125 -0
- package/dist/src/graphql/group.js.map +1 -0
- package/dist/src/graphql/index.d.ts +4 -0
- package/dist/src/graphql/index.js +5 -0
- package/dist/src/graphql/index.js.map +1 -0
- package/dist/src/graphql/play-group.d.ts +8 -0
- package/dist/src/graphql/play-group.js +173 -0
- package/dist/src/graphql/play-group.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/modeller/component-toolbar/component-toolbar.js +56 -61
- package/dist/src/modeller/component-toolbar/component-toolbar.js.map +1 -1
- package/dist/src/modeller/component-toolbar/mode-icons.d.ts +2 -0
- package/dist/src/modeller/component-toolbar/mode-icons.js +86 -0
- package/dist/src/modeller/component-toolbar/mode-icons.js.map +1 -0
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.d.ts +2 -2
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js +4 -5
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js.map +1 -1
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.d.ts +2 -2
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js +3 -3
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/effects.js +2 -2
- package/dist/src/modeller/property-sidebar/effects/effects.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-animation.d.ts +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-animation.js +2 -2
- package/dist/src/modeller/property-sidebar/effects/property-animation.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-animations.js +2 -2
- package/dist/src/modeller/property-sidebar/effects/property-animations.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.d.ts +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.js +3 -3
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.d.ts +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js +3 -3
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-event.js +2 -2
- package/dist/src/modeller/property-sidebar/effects/property-event.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js +2 -2
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js.map +1 -1
- package/dist/src/modeller/property-sidebar/inspector/inspector.js +1 -1
- package/dist/src/modeller/property-sidebar/inspector/inspector.js.map +1 -1
- package/dist/src/modeller/property-sidebar/shapes/shapes.d.ts +2 -2
- package/dist/src/modeller/property-sidebar/shapes/shapes.js +3 -3
- package/dist/src/modeller/property-sidebar/shapes/shapes.js.map +1 -1
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js +1 -1
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js.map +1 -1
- package/dist/src/ox-board-list.d.ts +2 -0
- package/dist/src/ox-board-list.js +427 -0
- package/dist/src/ox-board-list.js.map +1 -0
- package/dist/src/ox-board-modeller.d.ts +5 -0
- package/dist/src/ox-board-modeller.js +32 -0
- package/dist/src/ox-board-modeller.js.map +1 -1
- package/dist/src/types.d.ts +30 -0
- package/dist/src/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -10
- package/src/component/3d.ts +29 -0
- package/src/component/chart-and-gauge.ts +28 -0
- package/src/component/container.ts +62 -0
- package/src/component/data-source.ts +30 -0
- package/src/component/etc.ts +87 -0
- package/src/component/form.ts +42 -0
- package/src/component/index.ts +12 -0
- package/src/component/iot.ts +52 -0
- package/src/component/line.ts +132 -0
- package/src/component/register-default-groups.ts +28 -0
- package/src/component/shape.ts +154 -0
- package/src/component/table.ts +28 -0
- package/src/component/text-and-media.ts +124 -0
- package/src/component/warehouse.ts +26 -0
- package/src/graphql/board.ts +144 -0
- package/src/graphql/favorite-board.ts +25 -0
- package/src/graphql/group.ts +138 -0
- package/src/graphql/index.ts +4 -0
- package/src/graphql/play-group.ts +189 -0
- package/src/index.ts +5 -0
- package/src/modeller/component-toolbar/component-toolbar.ts +70 -63
- package/src/modeller/component-toolbar/mode-icons.ts +86 -0
- package/src/modeller/property-sidebar/data-binding/data-binding-mapper.ts +5 -5
- package/src/modeller/property-sidebar/data-binding/data-binding.ts +5 -4
- package/src/modeller/property-sidebar/effects/effects.ts +2 -3
- package/src/modeller/property-sidebar/effects/property-animation.ts +2 -2
- package/src/modeller/property-sidebar/effects/property-animations.ts +2 -3
- package/src/modeller/property-sidebar/effects/property-event-hover.ts +4 -3
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +4 -3
- package/src/modeller/property-sidebar/effects/property-event.ts +2 -3
- package/src/modeller/property-sidebar/effects/property-shadow.ts +2 -3
- package/src/modeller/property-sidebar/inspector/inspector.ts +1 -1
- package/src/modeller/property-sidebar/shapes/shapes.ts +3 -3
- package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +1 -1
- package/src/ox-board-list.ts +459 -0
- package/src/ox-board-modeller.ts +40 -0
- package/src/types.ts +48 -0
- package/tsconfig.json +1 -0
- package/web-dev-server.config.mjs +2 -0
- package/yarn-error.log +18355 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ComponentGroup } from '../types'
|
|
2
|
+
import audio from '../../../assets/images/components/audio.png'
|
|
3
|
+
import colorImage from '../../../assets/images/components/color-image.png'
|
|
4
|
+
import gifImage from '../../../assets/images/components/gif-image.png'
|
|
5
|
+
import grayImage from '../../../assets/images/components/gray-image.png'
|
|
6
|
+
import text from '../../../assets/images/components/text.png'
|
|
7
|
+
|
|
8
|
+
const icon = `
|
|
9
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">
|
|
10
|
+
<style type="text/css">
|
|
11
|
+
.st0{fill:none;stroke:{{strokeColor}};stroke-width:2;stroke-miterlimit:10;}
|
|
12
|
+
.st1{fill:{{strokeColor}};}
|
|
13
|
+
</style>
|
|
14
|
+
<g>
|
|
15
|
+
<polyline class="st0" points="20.6,12.8 20.6,5.1 1.6,5.1 1.6,18 15,18"/>
|
|
16
|
+
<path class="st1" d="M5.7,7.9c-0.9,0-1.6,0.7-1.6,1.6s0.7,1.6,1.6,1.6s1.6-0.7,1.6-1.6S6.6,7.9,5.7,7.9z"/>
|
|
17
|
+
<polygon class="st1" points="12.8,8.6 8.5,14.7 5.9,12.7 3.2,16.1 15.1,16.1 15.2,13.7"/>
|
|
18
|
+
<path class="st1" d="M24.1,15.1h2.1l0.6,2.8h1.7l-0.1-3.8H16.5l-0.1,3.8h1.7l0.4-2.8h2.1c0.1,2,0.1,3.1,0.1,5.2V21
|
|
19
|
+
c0,1.6,0,1.9,0,2.7l-1.8,0.2V25h6.9v-1.1L24,23.7c0-0.9,0-1.1,0-2.7v-0.7C24,18.1,24,17,24.1,15.1z"/>
|
|
20
|
+
</g>
|
|
21
|
+
</svg>
|
|
22
|
+
`
|
|
23
|
+
|
|
24
|
+
export const textAndMedia: ComponentGroup = {
|
|
25
|
+
name: 'textAndMedia',
|
|
26
|
+
description: 'a group of text and various media components',
|
|
27
|
+
icon,
|
|
28
|
+
templates: [
|
|
29
|
+
{
|
|
30
|
+
type: 'text',
|
|
31
|
+
description: 'text',
|
|
32
|
+
icon: text,
|
|
33
|
+
group: 'textAndMedia',
|
|
34
|
+
model: {
|
|
35
|
+
type: 'text',
|
|
36
|
+
left: 100,
|
|
37
|
+
top: 100,
|
|
38
|
+
width: 200,
|
|
39
|
+
height: 50,
|
|
40
|
+
text: 'Text',
|
|
41
|
+
fillStyle: '#fff',
|
|
42
|
+
strokeStyle: '#000',
|
|
43
|
+
alpha: 1,
|
|
44
|
+
hidden: false,
|
|
45
|
+
lineWidth: 5,
|
|
46
|
+
lineDash: 'solid',
|
|
47
|
+
lineCap: 'butt',
|
|
48
|
+
textAlign: 'left',
|
|
49
|
+
textBaseline: 'top',
|
|
50
|
+
textWrap: false,
|
|
51
|
+
fontFamily: 'serif',
|
|
52
|
+
fontSize: 30
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: 'color image',
|
|
57
|
+
description: 'color image',
|
|
58
|
+
icon: colorImage,
|
|
59
|
+
group: 'textAndMedia',
|
|
60
|
+
model: {
|
|
61
|
+
type: 'image-view',
|
|
62
|
+
left: 100,
|
|
63
|
+
top: 100,
|
|
64
|
+
width: 100,
|
|
65
|
+
height: 100,
|
|
66
|
+
isGray: false,
|
|
67
|
+
fillStyle: '#fff',
|
|
68
|
+
strokeStyle: '#000',
|
|
69
|
+
alpha: 1,
|
|
70
|
+
hidden: false,
|
|
71
|
+
lineWidth: 1,
|
|
72
|
+
lineDash: 'solid',
|
|
73
|
+
lineCap: 'butt'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: 'gray image',
|
|
78
|
+
description: 'gray image',
|
|
79
|
+
icon: grayImage,
|
|
80
|
+
group: 'textAndMedia',
|
|
81
|
+
model: {
|
|
82
|
+
type: 'image-view',
|
|
83
|
+
left: 100,
|
|
84
|
+
top: 100,
|
|
85
|
+
width: 100,
|
|
86
|
+
height: 100,
|
|
87
|
+
isGray: true,
|
|
88
|
+
fillStyle: '#fff',
|
|
89
|
+
strokeStyle: '#000',
|
|
90
|
+
alpha: 1,
|
|
91
|
+
hidden: false,
|
|
92
|
+
lineWidth: 1,
|
|
93
|
+
lineDash: 'solid',
|
|
94
|
+
lineCap: 'butt'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: 'gif image',
|
|
99
|
+
description: 'gif image',
|
|
100
|
+
icon: gifImage,
|
|
101
|
+
group: 'textAndMedia',
|
|
102
|
+
model: {
|
|
103
|
+
type: 'gif-view',
|
|
104
|
+
left: 100,
|
|
105
|
+
top: 100,
|
|
106
|
+
width: 100,
|
|
107
|
+
height: 100
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: 'audio',
|
|
112
|
+
description: 'audio',
|
|
113
|
+
icon: audio,
|
|
114
|
+
group: 'textAndMedia',
|
|
115
|
+
model: {
|
|
116
|
+
type: 'audio',
|
|
117
|
+
left: 100,
|
|
118
|
+
top: 100,
|
|
119
|
+
width: 100,
|
|
120
|
+
height: 100
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentGroup } from '../types'
|
|
2
|
+
|
|
3
|
+
const icon = `
|
|
4
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:{{strokeColor}};}
|
|
7
|
+
.st14{fill:none;stroke:{{strokeColor}};stroke-width:2.5;stroke-linecap:round;stroke-miterlimit:10;}
|
|
8
|
+
.st15{fill:none;stroke:{{strokeColor}};stroke-linecap:round;stroke-miterlimit:10;}
|
|
9
|
+
</style>
|
|
10
|
+
<g>
|
|
11
|
+
<polyline class="st14" points="1.5,11.2 15,5.2 28.5,11 "/>
|
|
12
|
+
<line class="st15" x1="3.2" y1="11.6" x2="3.2" y2="23.8"/>
|
|
13
|
+
<line class="st15" x1="26.9" y1="11.6" x2="26.9" y2="23.8"/>
|
|
14
|
+
<line class="st5" x1="1.7" y1="24.8" x2="28.3" y2="24.8"/>
|
|
15
|
+
<rect x="21.1" y="18.3" class="st0" width="3.4" height="5.5"/>
|
|
16
|
+
<path class="st0" d="M5.9,13.6v10.2h13.8V13.6H5.9z M18.7,17.3H6.8v-2.4h11.9V17.3z"/>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|
|
19
|
+
`
|
|
20
|
+
|
|
21
|
+
export const warehouse: ComponentGroup = {
|
|
22
|
+
name: 'warehouse',
|
|
23
|
+
description: 'a group of various components used in a warehouse depiction',
|
|
24
|
+
icon,
|
|
25
|
+
templates: []
|
|
26
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { buildArgs, client } from '@operato/graphql'
|
|
2
|
+
|
|
3
|
+
import { Board } from '../types'
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
|
|
6
|
+
export async function fetchBoardList(listParam = {}) {
|
|
7
|
+
const response = await client.query({
|
|
8
|
+
query: gql`
|
|
9
|
+
{
|
|
10
|
+
boards(${buildArgs(listParam)}) {
|
|
11
|
+
items {
|
|
12
|
+
id
|
|
13
|
+
name
|
|
14
|
+
description
|
|
15
|
+
thumbnail
|
|
16
|
+
createdAt
|
|
17
|
+
updatedAt
|
|
18
|
+
}
|
|
19
|
+
total
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
return response.data
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function fetchBoard(id: string) {
|
|
29
|
+
const response = await client.query({
|
|
30
|
+
query: gql`
|
|
31
|
+
query FetchBoardById($id: String!) {
|
|
32
|
+
board(id: $id) {
|
|
33
|
+
id
|
|
34
|
+
name
|
|
35
|
+
description
|
|
36
|
+
group {
|
|
37
|
+
id
|
|
38
|
+
name
|
|
39
|
+
}
|
|
40
|
+
thumbnail
|
|
41
|
+
model
|
|
42
|
+
createdAt
|
|
43
|
+
creator {
|
|
44
|
+
id
|
|
45
|
+
name
|
|
46
|
+
}
|
|
47
|
+
updatedAt
|
|
48
|
+
updater {
|
|
49
|
+
id
|
|
50
|
+
name
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`,
|
|
55
|
+
variables: { id }
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
return response.data
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function createBoard(board: Board) {
|
|
62
|
+
/*
|
|
63
|
+
input NewBoard {
|
|
64
|
+
name : String!
|
|
65
|
+
description : String
|
|
66
|
+
model : String!
|
|
67
|
+
groupId : String!
|
|
68
|
+
}
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
board.model = JSON.stringify(board.model)
|
|
72
|
+
|
|
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
|
+
|
|
91
|
+
return response.data
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export async function updateBoard(board: Board) {
|
|
95
|
+
/*
|
|
96
|
+
input BoardPatch {
|
|
97
|
+
name : String
|
|
98
|
+
description : String
|
|
99
|
+
model : String
|
|
100
|
+
}
|
|
101
|
+
*/
|
|
102
|
+
var { id, name, description, model, groupId } = board
|
|
103
|
+
model = JSON.stringify(model)
|
|
104
|
+
|
|
105
|
+
const response = await client.mutate({
|
|
106
|
+
mutation: gql`
|
|
107
|
+
mutation UpdateBoard($id: String!, $patch: BoardPatch!) {
|
|
108
|
+
updateBoard(id: $id, patch: $patch) {
|
|
109
|
+
id
|
|
110
|
+
name
|
|
111
|
+
description
|
|
112
|
+
model
|
|
113
|
+
group {
|
|
114
|
+
id
|
|
115
|
+
name
|
|
116
|
+
}
|
|
117
|
+
createdAt
|
|
118
|
+
updatedAt
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`,
|
|
122
|
+
variables: {
|
|
123
|
+
id,
|
|
124
|
+
patch: { name, description, model, groupId }
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
return response.data
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export async function deleteBoard(id: string) {
|
|
132
|
+
const response = await client.mutate({
|
|
133
|
+
mutation: gql`
|
|
134
|
+
mutation ($id: String!) {
|
|
135
|
+
deleteBoard(id: $id)
|
|
136
|
+
}
|
|
137
|
+
`,
|
|
138
|
+
variables: {
|
|
139
|
+
id
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
return response.data
|
|
144
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { buildArgs, client } from '@operato/graphql'
|
|
2
|
+
|
|
3
|
+
import gql from 'graphql-tag'
|
|
4
|
+
|
|
5
|
+
export async function fetchFavoriteBoardList(listParam = {}) {
|
|
6
|
+
const response = await client.query({
|
|
7
|
+
query: gql`
|
|
8
|
+
{
|
|
9
|
+
favoriteBoards(${buildArgs(listParam)}) {
|
|
10
|
+
items {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
description
|
|
14
|
+
thumbnail
|
|
15
|
+
createdAt
|
|
16
|
+
updatedAt
|
|
17
|
+
}
|
|
18
|
+
total
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
return response.data
|
|
25
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { BoardGroup } from '../types'
|
|
2
|
+
import { client } from '@operato/graphql'
|
|
3
|
+
import gql from 'graphql-tag'
|
|
4
|
+
|
|
5
|
+
export async function fetchGroup(id: string) {
|
|
6
|
+
const response = await client.query({
|
|
7
|
+
query: gql`
|
|
8
|
+
query FetchGroupById($id: String!) {
|
|
9
|
+
group(id: $id) {
|
|
10
|
+
id
|
|
11
|
+
name
|
|
12
|
+
description
|
|
13
|
+
createdAt
|
|
14
|
+
creator {
|
|
15
|
+
id
|
|
16
|
+
name
|
|
17
|
+
}
|
|
18
|
+
updatedAt
|
|
19
|
+
updater {
|
|
20
|
+
id
|
|
21
|
+
name
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`,
|
|
26
|
+
variables: { id }
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
return response.data
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function updateGroup(group: BoardGroup) {
|
|
33
|
+
var { id, name, description } = group
|
|
34
|
+
|
|
35
|
+
const response = await client.mutate({
|
|
36
|
+
mutation: gql`
|
|
37
|
+
mutation UpdateGroup($id: String!, $patch: GroupPatch!) {
|
|
38
|
+
updateGroup(id: $id, patch: $patch) {
|
|
39
|
+
id
|
|
40
|
+
name
|
|
41
|
+
description
|
|
42
|
+
createdAt
|
|
43
|
+
updatedAt
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
variables: {
|
|
48
|
+
id,
|
|
49
|
+
patch: { name, description }
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
return response.data
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function deleteGroup(id: string) {
|
|
57
|
+
const response = await client.mutate({
|
|
58
|
+
mutation: gql`
|
|
59
|
+
mutation ($id: String!) {
|
|
60
|
+
deleteGroup(id: $id)
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
variables: {
|
|
64
|
+
id
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
return response.data
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function fetchGroupList() {
|
|
72
|
+
const response = await client.query({
|
|
73
|
+
query: gql`
|
|
74
|
+
{
|
|
75
|
+
groups {
|
|
76
|
+
items {
|
|
77
|
+
id
|
|
78
|
+
name
|
|
79
|
+
description
|
|
80
|
+
createdAt
|
|
81
|
+
updatedAt
|
|
82
|
+
}
|
|
83
|
+
total
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
return response.data
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export async function createGroup(group: BoardGroup) {
|
|
93
|
+
const response = await client.mutate({
|
|
94
|
+
mutation: gql`
|
|
95
|
+
mutation CreateGroup($group: NewGroup!) {
|
|
96
|
+
createGroup(group: $group) {
|
|
97
|
+
id
|
|
98
|
+
name
|
|
99
|
+
description
|
|
100
|
+
createdAt
|
|
101
|
+
updatedAt
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`,
|
|
105
|
+
variables: { group }
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
return response.data
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export async function joinGroup(boardId: string, groupId: string) {
|
|
112
|
+
const response = await client.mutate({
|
|
113
|
+
mutation: gql`
|
|
114
|
+
mutation JoinGroup($id: String!, $boardIds: [String!]!) {
|
|
115
|
+
joinGroup(id: $id, boardIds: $boardIds) {
|
|
116
|
+
id
|
|
117
|
+
name
|
|
118
|
+
description
|
|
119
|
+
boards {
|
|
120
|
+
id
|
|
121
|
+
name
|
|
122
|
+
description
|
|
123
|
+
createdAt
|
|
124
|
+
updatedAt
|
|
125
|
+
}
|
|
126
|
+
createdAt
|
|
127
|
+
updatedAt
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
`,
|
|
131
|
+
variables: {
|
|
132
|
+
id: groupId,
|
|
133
|
+
boardIds: [boardId]
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
return response.data
|
|
138
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { PlayGroup } from '../types'
|
|
2
|
+
import { client } from '@operato/graphql'
|
|
3
|
+
import gql from 'graphql-tag'
|
|
4
|
+
|
|
5
|
+
export async function fetchPlayGroupList() {
|
|
6
|
+
const response = await client.query({
|
|
7
|
+
query: gql`
|
|
8
|
+
{
|
|
9
|
+
playGroups {
|
|
10
|
+
items {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
description
|
|
14
|
+
}
|
|
15
|
+
total
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
return response.data
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function fetchPlayGroup(groupId: string) {
|
|
25
|
+
const response = await client.query({
|
|
26
|
+
query: gql`
|
|
27
|
+
query FetchPlayGroup($id: String!) {
|
|
28
|
+
playGroup(id: $id) {
|
|
29
|
+
id
|
|
30
|
+
name
|
|
31
|
+
description
|
|
32
|
+
boards {
|
|
33
|
+
id
|
|
34
|
+
name
|
|
35
|
+
description
|
|
36
|
+
model
|
|
37
|
+
thumbnail
|
|
38
|
+
createdAt
|
|
39
|
+
creator {
|
|
40
|
+
id
|
|
41
|
+
name
|
|
42
|
+
}
|
|
43
|
+
updatedAt
|
|
44
|
+
updater {
|
|
45
|
+
id
|
|
46
|
+
name
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
createdAt
|
|
50
|
+
creator {
|
|
51
|
+
id
|
|
52
|
+
name
|
|
53
|
+
}
|
|
54
|
+
updatedAt
|
|
55
|
+
updater {
|
|
56
|
+
id
|
|
57
|
+
name
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,
|
|
62
|
+
variables: {
|
|
63
|
+
id: groupId
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
return response.data
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function createPlayGroup(group: PlayGroup) {
|
|
71
|
+
var { name, description } = group
|
|
72
|
+
|
|
73
|
+
const response = await client.mutate({
|
|
74
|
+
mutation: gql`
|
|
75
|
+
mutation CreatePlayGroup($playGroup: NewPlayGroup!) {
|
|
76
|
+
createPlayGroup(playGroup: $playGroup) {
|
|
77
|
+
id
|
|
78
|
+
name
|
|
79
|
+
description
|
|
80
|
+
createdAt
|
|
81
|
+
updatedAt
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
`,
|
|
85
|
+
variables: {
|
|
86
|
+
playGroup: { name, description }
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
return response.data
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export async function updatePlayGroup(group: PlayGroup) {
|
|
94
|
+
var { id, name, description } = group
|
|
95
|
+
|
|
96
|
+
const response = await client.mutate({
|
|
97
|
+
mutation: gql`
|
|
98
|
+
mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {
|
|
99
|
+
updatePlayGroup(id: $id, patch: $patch) {
|
|
100
|
+
id
|
|
101
|
+
name
|
|
102
|
+
description
|
|
103
|
+
createdAt
|
|
104
|
+
updatedAt
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`,
|
|
108
|
+
variables: {
|
|
109
|
+
id,
|
|
110
|
+
patch: { name, description }
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
return response.data
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export async function deletePlayGroup(id: string) {
|
|
118
|
+
const response = await client.mutate({
|
|
119
|
+
mutation: gql`
|
|
120
|
+
mutation ($id: String!) {
|
|
121
|
+
deletePlayGroup(id: $id)
|
|
122
|
+
}
|
|
123
|
+
`,
|
|
124
|
+
variables: {
|
|
125
|
+
id
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
return response.data
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export async function joinPlayGroup(boardId: string, group: PlayGroup) {
|
|
132
|
+
var { id, name, description } = group
|
|
133
|
+
|
|
134
|
+
const response = await client.mutate({
|
|
135
|
+
mutation: gql`
|
|
136
|
+
mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {
|
|
137
|
+
joinPlayGroup(id: $id, boardIds: $boardIds) {
|
|
138
|
+
id
|
|
139
|
+
name
|
|
140
|
+
description
|
|
141
|
+
boards {
|
|
142
|
+
id
|
|
143
|
+
name
|
|
144
|
+
description
|
|
145
|
+
createdAt
|
|
146
|
+
updatedAt
|
|
147
|
+
}
|
|
148
|
+
createdAt
|
|
149
|
+
updatedAt
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
`,
|
|
153
|
+
variables: {
|
|
154
|
+
id,
|
|
155
|
+
boardIds: [boardId]
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
return response.data
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export async function leavePlayGroup(boardId: string, groupId: string) {
|
|
163
|
+
const response = await client.mutate({
|
|
164
|
+
mutation: gql`
|
|
165
|
+
mutation ($id: String!, $boardIds: [String]!) {
|
|
166
|
+
leavePlayGroup(id: $id, boardIds: $boardIds) {
|
|
167
|
+
id
|
|
168
|
+
name
|
|
169
|
+
description
|
|
170
|
+
boards {
|
|
171
|
+
id
|
|
172
|
+
name
|
|
173
|
+
description
|
|
174
|
+
createdAt
|
|
175
|
+
updatedAt
|
|
176
|
+
}
|
|
177
|
+
createdAt
|
|
178
|
+
updatedAt
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
`,
|
|
182
|
+
variables: {
|
|
183
|
+
id: groupId,
|
|
184
|
+
boardIds: [boardId]
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
return response.data
|
|
189
|
+
}
|
package/src/index.ts
CHANGED