seatsio 70.0.0 → 71.1.0
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/.github/workflows/build.yml +3 -3
- package/.github/workflows/publish.yml +2 -9
- package/README.md +0 -17
- package/package.json +8 -17
- package/src/Common/IDs.js +1 -1
- package/src/Common/Labels.js +2 -2
- package/src/Events/Channels.js +8 -8
- package/src/Events/StatusChangesParams.js +1 -1
- package/src/Subaccounts/Subaccounts.js +4 -4
- package/src/Users/Users.js +2 -0
- package/src/Workspaces/Workspaces.js +12 -12
- package/tests/accounts/changeHoldPeriod.test.js +1 -1
- package/tests/accounts/changePassword.test.js +1 -1
- package/tests/accounts/disableDraftChartDrawings.test.js +1 -1
- package/tests/accounts/enableDraftChartDrawings.test.js +1 -1
- package/tests/accounts/updateSettingTest.test.js +1 -1
- package/tests/chartReports/chartReportSummary.test.js +1 -1
- package/tests/charts/addTag.test.js +2 -2
- package/tests/charts/copyChart.test.js +1 -1
- package/tests/charts/copyChartToSubaccount.test.js +1 -1
- package/tests/charts/copyDraftVersion.test.js +1 -1
- package/tests/charts/createChart.test.js +5 -5
- package/tests/charts/discardDraftVersion.test.js +1 -1
- package/tests/charts/listAllCharts.test.js +1 -1
- package/tests/charts/listAllTags.test.js +1 -1
- package/tests/charts/listChartsInArchive.test.js +8 -8
- package/tests/charts/listFirstPageOfCharts.test.js +5 -5
- package/tests/charts/listPageAfter.test.js +3 -3
- package/tests/charts/listPageBefore.test.js +3 -3
- package/tests/charts/moveChartOutOfArchive.test.js +1 -1
- package/tests/charts/moveChartToArchive.test.js +1 -1
- package/tests/charts/publishDraftVersion.test.js +1 -1
- package/tests/charts/removeTag.test.js +1 -1
- package/tests/charts/retrieveDraftVersion.test.js +1 -1
- package/tests/charts/retrievePublishedVersion.test.js +1 -1
- package/tests/charts/saveSocialDistancingRulesets.test.js +1 -1
- package/tests/charts/updateChart.test.js +2 -2
- package/tests/error.test.js +1 -1
- package/tests/eventReports/eventReportSummary.test.js +1 -1
- package/tests/events/channels/replaceChannels.test.js +15 -16
- package/tests/events/channels/setObjectsForChannelsTest.js +19 -19
- package/tests/events/deleteEvent.test.js +1 -1
- package/tests/events/listAllStatusChanges.test.js +0 -1
- package/tests/events/listFirstPage.test.js +2 -2
- package/tests/events/listPageAfter.test.js +2 -2
- package/tests/events/listPageBefore.test.js +2 -2
- package/tests/events/retrieveEvent.test.js +1 -1
- package/tests/holdTokens/createHoldTokens.test.js +2 -2
- package/tests/holdTokens/retrieveHoldToken.test.js +1 -1
- package/tests/holdTokens/updateHoldTokenExpirationDate.test.js +1 -1
- package/tests/invitations/listAllInvitations.test.js +1 -1
- package/tests/subaccounts/activateSubaccount.test.js +1 -1
- package/tests/subaccounts/copyChartToParent.test.js +1 -1
- package/tests/subaccounts/copyChartToSubaccount.test.js +1 -1
- package/tests/subaccounts/createSubAccount.test.js +2 -2
- package/tests/subaccounts/deactivateSubaccount.test.js +1 -1
- package/tests/subaccounts/filterSubaccounts.test.js +7 -7
- package/tests/subaccounts/listActiveSubaccounts.test.js +4 -4
- package/tests/subaccounts/listInactiveSubaccounts.test.js +7 -7
- package/tests/subaccounts/listPageAfter.test.js +2 -2
- package/tests/subaccounts/listPageBefore.test.js +2 -2
- package/tests/subaccounts/regenerateDesignerKey.test.js +1 -1
- package/tests/subaccounts/regenerateSecretKey.test.js +1 -1
- package/tests/subaccounts/retrieveSubaccount.test.js +1 -1
- package/tests/subaccounts/updateSubaccount.test.js +2 -2
- package/tests/testUtils.js +7 -7
- package/tests/users/inviteUser.test.js +6 -6
- package/tests/workspaces/listAllWorkspaces.test.js +1 -1
- package/tests/workspaces/listFirstPage.test.js +2 -2
- package/tests/workspaces/listInactiveWorkspaces.test.js +2 -2
- package/tests/workspaces/listPageAfter.test.js +2 -2
- package/tests/workspaces/listPageBefore.test.js +2 -2
- package/tests/workspaces/updateWorkspace.test.js +1 -1
- package/.github/workflows/release.yml +0 -39
- package/tests/users/activateUser.test.js +0 -6
- package/tests/users/deactivateUser.test.js +0 -6
|
@@ -17,9 +17,9 @@ jobs:
|
|
|
17
17
|
with:
|
|
18
18
|
node-version: 18
|
|
19
19
|
registry-url: https://registry.npmjs.org/
|
|
20
|
-
- run:
|
|
21
|
-
- run:
|
|
20
|
+
- run: yarn install
|
|
21
|
+
- run: yarn lint
|
|
22
22
|
- uses: zcong1993/setup-timezone@master
|
|
23
23
|
with:
|
|
24
24
|
timezone: Europe/Brussels
|
|
25
|
-
- run:
|
|
25
|
+
- run: yarn test
|
|
@@ -13,14 +13,7 @@ jobs:
|
|
|
13
13
|
with:
|
|
14
14
|
node-version: 18
|
|
15
15
|
registry-url: https://registry.npmjs.org/
|
|
16
|
-
- run:
|
|
17
|
-
- run:
|
|
18
|
-
- run: npm publish
|
|
16
|
+
- run: yarn install
|
|
17
|
+
- run: yarn publish
|
|
19
18
|
env:
|
|
20
19
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
21
|
-
- uses: svenstaro/upload-release-action@v2
|
|
22
|
-
with:
|
|
23
|
-
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
24
|
-
file: build/SeatsioClient.js
|
|
25
|
-
tag: ${{ github.ref }}
|
|
26
|
-
overwrite: true
|
package/README.md
CHANGED
|
@@ -20,23 +20,6 @@ For Node, you can install using npm:
|
|
|
20
20
|
```sh
|
|
21
21
|
npm install seatsio
|
|
22
22
|
```
|
|
23
|
-
Then you can use it with require:
|
|
24
|
-
```js
|
|
25
|
-
const { SeatsioClient } = require('seatsio')
|
|
26
|
-
```
|
|
27
|
-
For browser, you can directly include it from GitHub:
|
|
28
|
-
|
|
29
|
-
```html
|
|
30
|
-
<script src="https://github.com/seatsio/seatsio-js/releases/download/<RELEASE_TAG>/SeatsioClient.js"></script>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
This library uses `async/await` introduced with ES2017 and `for await` loops which is part of the ES2018. `for await` loops gained native support from Node 10 onwards. As a result, the minimum required version for Node is 10.
|
|
34
|
-
|
|
35
|
-
## Versioning
|
|
36
|
-
|
|
37
|
-
seatsio-js follows semver since v54.4.0.
|
|
38
|
-
|
|
39
|
-
Please note that any version below v2 is not production ready.
|
|
40
23
|
|
|
41
24
|
## Usage
|
|
42
25
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "seatsio",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "71.1.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Official JavaScript and Node.JS client library for the Seats.io REST API",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"lint": "eslint ./src",
|
|
9
|
-
"test": "jest --maxWorkers=8 --verbose"
|
|
10
|
-
"bundle": "gulp bundle"
|
|
8
|
+
"lint": "eslint ./src ./tests",
|
|
9
|
+
"test": "jest --maxWorkers=8 --verbose"
|
|
11
10
|
},
|
|
12
11
|
"repository": {
|
|
13
12
|
"type": "git",
|
|
@@ -17,21 +16,13 @@
|
|
|
17
16
|
"axios": "0.27.2"
|
|
18
17
|
},
|
|
19
18
|
"devDependencies": {
|
|
20
|
-
"
|
|
21
|
-
"eslint": "8.24.0",
|
|
19
|
+
"eslint": "8.26.0",
|
|
22
20
|
"eslint-config-standard": "17.0.0",
|
|
23
21
|
"eslint-plugin-import": "2.26.0",
|
|
24
|
-
"eslint-plugin-
|
|
25
|
-
"eslint-plugin-promise": "6.
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"gulp-buffer": "0.0.2",
|
|
29
|
-
"gulp-jest": "4.0.4",
|
|
30
|
-
"gulp-tap": "2.0.0",
|
|
31
|
-
"gulp-uglify": "3.0.2",
|
|
32
|
-
"gulp-uglify-es": "3.0.0",
|
|
33
|
-
"jest": "29.1.2",
|
|
34
|
-
"jest-cli": "29.1.2",
|
|
22
|
+
"eslint-plugin-n": "15.5.0",
|
|
23
|
+
"eslint-plugin-promise": "6.1.1",
|
|
24
|
+
"jest": "29.2.2",
|
|
25
|
+
"jest-cli": "29.2.2",
|
|
35
26
|
"uuid": "9.0.0"
|
|
36
27
|
}
|
|
37
28
|
}
|
package/src/Common/IDs.js
CHANGED
package/src/Common/Labels.js
CHANGED
package/src/Events/Channels.js
CHANGED
|
@@ -9,10 +9,10 @@ class Channels {
|
|
|
9
9
|
add (eventKey, channelKey, name, color, index, objects) {
|
|
10
10
|
return this.client.post(`/events/${encodeURIComponent(eventKey)}/channels`, {
|
|
11
11
|
key: channelKey,
|
|
12
|
-
name
|
|
13
|
-
color
|
|
14
|
-
index
|
|
15
|
-
objects
|
|
12
|
+
name,
|
|
13
|
+
color,
|
|
14
|
+
index,
|
|
15
|
+
objects
|
|
16
16
|
})
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -30,22 +30,22 @@ class Channels {
|
|
|
30
30
|
|
|
31
31
|
addObjects (eventKey, channelKey, objects) {
|
|
32
32
|
return this.client.post(`/events/${encodeURIComponent(eventKey)}/channels/${encodeURIComponent(channelKey)}/objects`, {
|
|
33
|
-
objects
|
|
33
|
+
objects
|
|
34
34
|
})
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
removeObjects (eventKey, channelKey, objects) {
|
|
38
38
|
return this.client.delete(`/events/${encodeURIComponent(eventKey)}/channels/${encodeURIComponent(channelKey)}/objects`, {
|
|
39
|
-
data: { objects
|
|
39
|
+
data: { objects }
|
|
40
40
|
})
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
replace (eventKey, channels) {
|
|
44
|
-
return this.client.post(`/events/${encodeURIComponent(eventKey)}/channels/update`, { channels
|
|
44
|
+
return this.client.post(`/events/${encodeURIComponent(eventKey)}/channels/update`, { channels })
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
setObjects (eventKey, channelConfig) {
|
|
48
|
-
return this.client.post(`/events/${encodeURIComponent(eventKey)}/channels/assign-objects`, { channelConfig
|
|
48
|
+
return this.client.post(`/events/${encodeURIComponent(eventKey)}/channels/assign-objects`, { channelConfig })
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -106,7 +106,7 @@ class Subaccounts {
|
|
|
106
106
|
* @returns {AsyncIterator}
|
|
107
107
|
*/
|
|
108
108
|
listAll (filter = null) {
|
|
109
|
-
const requestParameters = filter !== null ? { filter
|
|
109
|
+
const requestParameters = filter !== null ? { filter } : {}
|
|
110
110
|
return this.iterator().all(requestParameters)
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -114,7 +114,7 @@ class Subaccounts {
|
|
|
114
114
|
* @returns {Page}
|
|
115
115
|
*/
|
|
116
116
|
listFirstPage (filter = null, pageSize = null) {
|
|
117
|
-
const requestParameters = filter !== null ? { filter
|
|
117
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
118
118
|
return this.iterator().firstPage(requestParameters, pageSize)
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -122,7 +122,7 @@ class Subaccounts {
|
|
|
122
122
|
* @returns {Page}
|
|
123
123
|
*/
|
|
124
124
|
listPageAfter (afterId, filter = null, pageSize = null) {
|
|
125
|
-
const requestParameters = filter !== null ? { filter
|
|
125
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
126
126
|
return this.iterator().pageAfter(afterId, requestParameters, pageSize)
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -130,7 +130,7 @@ class Subaccounts {
|
|
|
130
130
|
* @returns {Page}
|
|
131
131
|
*/
|
|
132
132
|
listPageBefore (beforeId, filter = null, pageSize = null) {
|
|
133
|
-
const requestParameters = filter !== null ? { filter
|
|
133
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
134
134
|
return this.iterator().pageBefore(beforeId, requestParameters, pageSize)
|
|
135
135
|
}
|
|
136
136
|
|
package/src/Users/Users.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const Page = require('../Page.js')
|
|
2
2
|
const Lister = require('../Lister.js')
|
|
3
3
|
const User = require('./User.js')
|
|
4
|
+
const Invitation = require('../Invitations/Invitation')
|
|
4
5
|
|
|
5
6
|
class Users {
|
|
6
7
|
/**
|
|
@@ -20,6 +21,7 @@ class Users {
|
|
|
20
21
|
const requestParameters = { email, role, workspaces }
|
|
21
22
|
|
|
22
23
|
return this.client.post('/users/actions/invite', requestParameters)
|
|
24
|
+
.then(res => new Invitation(res.data))
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
/**
|
|
@@ -74,7 +74,7 @@ class Workspaces {
|
|
|
74
74
|
* @returns {AsyncIterator}
|
|
75
75
|
*/
|
|
76
76
|
listAll (filter = null) {
|
|
77
|
-
const requestParameters = filter !== null ? { filter
|
|
77
|
+
const requestParameters = filter !== null ? { filter } : {}
|
|
78
78
|
return this.iterator().all(requestParameters)
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -82,7 +82,7 @@ class Workspaces {
|
|
|
82
82
|
* @returns {Page}
|
|
83
83
|
*/
|
|
84
84
|
listFirstPage (filter = null, pageSize = null) {
|
|
85
|
-
const requestParameters = filter !== null ? { filter
|
|
85
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
86
86
|
return this.iterator().firstPage(requestParameters, pageSize)
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -90,7 +90,7 @@ class Workspaces {
|
|
|
90
90
|
* @returns {Page}
|
|
91
91
|
*/
|
|
92
92
|
listPageAfter (afterId, filter = null, pageSize = null) {
|
|
93
|
-
const requestParameters = filter !== null ? { filter
|
|
93
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
94
94
|
return this.iterator().pageAfter(afterId, requestParameters, pageSize)
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -98,7 +98,7 @@ class Workspaces {
|
|
|
98
98
|
* @returns {Page}
|
|
99
99
|
*/
|
|
100
100
|
listPageBefore (beforeId, filter = null, pageSize = null) {
|
|
101
|
-
const requestParameters = filter !== null ? { filter
|
|
101
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
102
102
|
return this.iterator().pageBefore(beforeId, requestParameters, pageSize)
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -106,7 +106,7 @@ class Workspaces {
|
|
|
106
106
|
* @returns {AsyncIterator}
|
|
107
107
|
*/
|
|
108
108
|
listActive (filter = null) {
|
|
109
|
-
const requestParameters = filter !== null ? { filter
|
|
109
|
+
const requestParameters = filter !== null ? { filter } : {}
|
|
110
110
|
return this.activeWorkspacesIterator().all(requestParameters)
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -114,7 +114,7 @@ class Workspaces {
|
|
|
114
114
|
* @returns {Page}
|
|
115
115
|
*/
|
|
116
116
|
listActiveFirstPage (filter = null, pageSize = null) {
|
|
117
|
-
const requestParameters = filter !== null ? { filter
|
|
117
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
118
118
|
return this.activeWorkspacesIterator().firstPage(requestParameters, pageSize)
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -122,7 +122,7 @@ class Workspaces {
|
|
|
122
122
|
* @returns {Page}
|
|
123
123
|
*/
|
|
124
124
|
listActivePageAfter (afterId, filter = null, pageSize = null) {
|
|
125
|
-
const requestParameters = filter !== null ? { filter
|
|
125
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
126
126
|
return this.activeWorkspacesIterator().pageAfter(afterId, requestParameters, pageSize)
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -130,7 +130,7 @@ class Workspaces {
|
|
|
130
130
|
* @returns {Page}
|
|
131
131
|
*/
|
|
132
132
|
listActivePageBefore (beforeId, filter = null, pageSize = null) {
|
|
133
|
-
const requestParameters = filter !== null ? { filter
|
|
133
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
134
134
|
return this.activeWorkspacesIterator().pageBefore(beforeId, requestParameters, pageSize)
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -138,7 +138,7 @@ class Workspaces {
|
|
|
138
138
|
* @returns {AsyncIterator}
|
|
139
139
|
*/
|
|
140
140
|
listInactive (filter = null) {
|
|
141
|
-
const requestParameters = filter !== null ? { filter
|
|
141
|
+
const requestParameters = filter !== null ? { filter } : {}
|
|
142
142
|
return this.inactiveWorkspacesIterator().all(requestParameters)
|
|
143
143
|
}
|
|
144
144
|
|
|
@@ -146,7 +146,7 @@ class Workspaces {
|
|
|
146
146
|
* @returns {Page}
|
|
147
147
|
*/
|
|
148
148
|
listInactiveFirstPage (filter = null, pageSize = null) {
|
|
149
|
-
const requestParameters = filter !== null ? { filter
|
|
149
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
150
150
|
return this.inactiveWorkspacesIterator().firstPage(requestParameters, pageSize)
|
|
151
151
|
}
|
|
152
152
|
|
|
@@ -154,7 +154,7 @@ class Workspaces {
|
|
|
154
154
|
* @returns {Page}
|
|
155
155
|
*/
|
|
156
156
|
listInactivePageAfter (afterId, filter = null, pageSize = null) {
|
|
157
|
-
const requestParameters = filter !== null ? { filter
|
|
157
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
158
158
|
return this.inactiveWorkspacesIterator().pageAfter(afterId, requestParameters, pageSize)
|
|
159
159
|
}
|
|
160
160
|
|
|
@@ -162,7 +162,7 @@ class Workspaces {
|
|
|
162
162
|
* @returns {Page}
|
|
163
163
|
*/
|
|
164
164
|
listInactivePageBefore (beforeId, filter = null, pageSize = null) {
|
|
165
|
-
const requestParameters = filter !== null ? { filter
|
|
165
|
+
const requestParameters = filter !== null ? { filter } : null
|
|
166
166
|
return this.inactiveWorkspacesIterator().pageBefore(beforeId, requestParameters, pageSize)
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should change the holdPeriod', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
await client.accounts.changeHoldPeriod(14)
|
|
6
6
|
|
|
7
7
|
const account = await client.accounts.retrieveMyAccount()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should change the password', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
await client.accounts.changePassword('someNewPassword')
|
|
6
6
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should disable draft chart drawings', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
await client.accounts.enableDraftChartDrawings()
|
|
6
6
|
|
|
7
7
|
await client.accounts.disableDraftChartDrawings()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should enable draft chart drawings', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
await client.accounts.disableDraftChartDrawings()
|
|
6
6
|
|
|
7
7
|
await client.accounts.enableDraftChartDrawings()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('updates a setting', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
await client.accounts.updateSetting('VALIDATE_DUPLICATE_LABELS', 'OFF')
|
|
6
6
|
|
|
7
7
|
const account = await client.accounts.retrieveMyAccount()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should add tag', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
const chart = await client.charts.create()
|
|
6
6
|
|
|
7
7
|
await client.charts.addTag(chart.key, 'tag1')
|
|
@@ -12,7 +12,7 @@ test('should add tag', async () => {
|
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
test('should be able to add a tag with special characters', async () => {
|
|
15
|
-
const { client
|
|
15
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
16
16
|
const chart = await client.charts.create()
|
|
17
17
|
|
|
18
18
|
await client.charts.addTag(chart.key, 'tag1/:"-<>')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should copy chart', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
const chart = await client.charts.create('My Chart', 'BOOTHS')
|
|
6
6
|
|
|
7
7
|
const copiedChart = await client.charts.copy(chart.key)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should copy to subaccount', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
const subaccount = await client.subaccounts.create()
|
|
6
6
|
const subaccountClient = testUtils.createClient(subaccount.secretKey)
|
|
7
7
|
const chart = await client.charts.create('My chart')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should copy draft version of a chart', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
const chart = await client.charts.create('oldName')
|
|
6
6
|
await client.events.create(chart.key)
|
|
7
7
|
await client.charts.update(chart.key, 'newName')
|
|
@@ -2,7 +2,7 @@ const Category = require('../../src/Charts/Category.js')
|
|
|
2
2
|
const testUtils = require('../testUtils.js')
|
|
3
3
|
|
|
4
4
|
test('should create a chart with default parameters', async () => {
|
|
5
|
-
const { client
|
|
5
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
6
6
|
const chart = await client.charts.create()
|
|
7
7
|
|
|
8
8
|
expect(chart.key).toBeTruthy()
|
|
@@ -20,7 +20,7 @@ test('should create a chart with default parameters', async () => {
|
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
test('should create chart with name', async () => {
|
|
23
|
-
const { client
|
|
23
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
24
24
|
const chart = await client.charts.create('aChart')
|
|
25
25
|
|
|
26
26
|
const retrievedChart = await client.charts.retrievePublishedVersion(chart.key)
|
|
@@ -30,7 +30,7 @@ test('should create chart with name', async () => {
|
|
|
30
30
|
})
|
|
31
31
|
|
|
32
32
|
test('should create chart with venue type', async () => {
|
|
33
|
-
const { client
|
|
33
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
34
34
|
const chart = await client.charts.create(null, 'BOOTHS')
|
|
35
35
|
|
|
36
36
|
const retrievedChart = await client.charts.retrievePublishedVersion(chart.key)
|
|
@@ -40,7 +40,7 @@ test('should create chart with venue type', async () => {
|
|
|
40
40
|
})
|
|
41
41
|
|
|
42
42
|
test('should create chart with categories as class', async () => {
|
|
43
|
-
const { client
|
|
43
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
44
44
|
const cat1 = { key: 1, label: 'Category 1', color: '#aaaaaa', accessible: false }
|
|
45
45
|
const cat2 = { key: 3, label: 'Category 2', color: '#bbbbbb', accessible: true }
|
|
46
46
|
|
|
@@ -53,7 +53,7 @@ test('should create chart with categories as class', async () => {
|
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
test('should create chart with categories as instance of Category class', async () => {
|
|
56
|
-
const { client
|
|
56
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
57
57
|
const cat1 = new Category(1, 'Category 1', '#aaaaaa')
|
|
58
58
|
const cat2 = new Category(2, 'Category 2', '#bbbbbb', true)
|
|
59
59
|
const expectedCategories = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should discard draft version of the chart', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
const chart = await client.charts.create('oldName')
|
|
6
6
|
await client.events.create(chart.key)
|
|
7
7
|
await client.charts.update(chart.key, 'newName')
|
|
@@ -103,7 +103,7 @@ test('listAll Charts with expandEvents parameters', async () => {
|
|
|
103
103
|
test('listAll Charts with expandEvents parameters and eventsLimit', async () => {
|
|
104
104
|
const { client } = await testUtils.createTestUserAndClient()
|
|
105
105
|
const chart1 = await client.charts.create()
|
|
106
|
-
|
|
106
|
+
await client.events.create(chart1.key)
|
|
107
107
|
const event2 = await client.events.create(chart1.key)
|
|
108
108
|
const event3 = await client.events.create(chart1.key)
|
|
109
109
|
const retrievedKeys = []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should retrieve all tags of all charts', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
const chart1 = await client.charts.create()
|
|
6
6
|
const chart2 = await client.charts.create()
|
|
7
7
|
await client.charts.addTag(chart1.key, 'tag1')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const testUtils = require('../testUtils.js')
|
|
2
2
|
|
|
3
3
|
test('should list all charts in archive', async () => {
|
|
4
|
-
const { client
|
|
4
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
5
5
|
const chart1 = await client.charts.create()
|
|
6
6
|
const chart2 = await client.charts.create()
|
|
7
7
|
const archivedChartKeys = []
|
|
@@ -20,7 +20,7 @@ test('should list all charts in archive', async () => {
|
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
test('get many archived charts)', async () => {
|
|
23
|
-
const { client
|
|
23
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
24
24
|
const charts = await testUtils.createArray(15, async () => {
|
|
25
25
|
const chart = await client.charts.create()
|
|
26
26
|
await client.charts.moveToArchive(chart.key)
|
|
@@ -36,7 +36,7 @@ test('get many archived charts)', async () => {
|
|
|
36
36
|
})
|
|
37
37
|
|
|
38
38
|
test('get first page of archived charts', async () => {
|
|
39
|
-
const { client
|
|
39
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
40
40
|
const charts = await testUtils.createArray(3, async () => {
|
|
41
41
|
const chart = await client.charts.create()
|
|
42
42
|
await client.charts.moveToArchive(chart.key)
|
|
@@ -50,7 +50,7 @@ test('get first page of archived charts', async () => {
|
|
|
50
50
|
})
|
|
51
51
|
|
|
52
52
|
test('get first page of archived charts with page size', async () => {
|
|
53
|
-
const { client
|
|
53
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
54
54
|
const chart1 = await client.charts.create()
|
|
55
55
|
const chart2 = await client.charts.create()
|
|
56
56
|
const chart3 = await client.charts.create()
|
|
@@ -68,7 +68,7 @@ test('get first page of archived charts with page size', async () => {
|
|
|
68
68
|
})
|
|
69
69
|
|
|
70
70
|
test('get page after given archived charts id', async () => {
|
|
71
|
-
const { client
|
|
71
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
72
72
|
const chart1 = await client.charts.create()
|
|
73
73
|
const chart2 = await client.charts.create()
|
|
74
74
|
const chart3 = await client.charts.create()
|
|
@@ -87,7 +87,7 @@ test('get page after given archived charts id', async () => {
|
|
|
87
87
|
})
|
|
88
88
|
|
|
89
89
|
test('get page after given archived charts id with page size', async () => {
|
|
90
|
-
const { client
|
|
90
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
91
91
|
const chart1 = await client.charts.create()
|
|
92
92
|
const chart2 = await client.charts.create()
|
|
93
93
|
const chart3 = await client.charts.create()
|
|
@@ -106,7 +106,7 @@ test('get page after given archived charts id with page size', async () => {
|
|
|
106
106
|
})
|
|
107
107
|
|
|
108
108
|
test('get page before given archived charts id', async () => {
|
|
109
|
-
const { client
|
|
109
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
110
110
|
const chart1 = await client.charts.create()
|
|
111
111
|
const chart2 = await client.charts.create()
|
|
112
112
|
const chart3 = await client.charts.create()
|
|
@@ -125,7 +125,7 @@ test('get page before given archived charts id', async () => {
|
|
|
125
125
|
})
|
|
126
126
|
|
|
127
127
|
test('get page after given archived charts id with page size', async () => {
|
|
128
|
-
const { client
|
|
128
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
129
129
|
const chart1 = await client.charts.create()
|
|
130
130
|
const chart2 = await client.charts.create()
|
|
131
131
|
const chart3 = await client.charts.create()
|
|
@@ -2,7 +2,7 @@ const ChartListParams = require('../../src/Charts/ChartListParams.js')
|
|
|
2
2
|
const testUtils = require('../testUtils.js')
|
|
3
3
|
|
|
4
4
|
test('should list first page of charts', async () => {
|
|
5
|
-
const { client
|
|
5
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
6
6
|
const promises = [
|
|
7
7
|
client.charts.create(),
|
|
8
8
|
client.charts.create(),
|
|
@@ -17,7 +17,7 @@ test('should list first page of charts', async () => {
|
|
|
17
17
|
})
|
|
18
18
|
|
|
19
19
|
test('should list first page of charts with filter', async () => {
|
|
20
|
-
const { client
|
|
20
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
21
21
|
const promises = [
|
|
22
22
|
client.charts.create('foo'),
|
|
23
23
|
client.charts.create('foo'),
|
|
@@ -34,7 +34,7 @@ test('should list first page of charts with filter', async () => {
|
|
|
34
34
|
})
|
|
35
35
|
|
|
36
36
|
test('should list first page of charts with tag', async () => {
|
|
37
|
-
const { client
|
|
37
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
38
38
|
const promises = [
|
|
39
39
|
client.charts.create('foo'),
|
|
40
40
|
client.charts.create('foo'),
|
|
@@ -50,7 +50,7 @@ test('should list first page of charts with tag', async () => {
|
|
|
50
50
|
})
|
|
51
51
|
|
|
52
52
|
test('pageSize of list first page of charts with page size', async () => {
|
|
53
|
-
const { client
|
|
53
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
54
54
|
await client.charts.create('foo')
|
|
55
55
|
await client.charts.create('foo')
|
|
56
56
|
const chart3 = await client.charts.create('bar')
|
|
@@ -63,7 +63,7 @@ test('pageSize of list first page of charts with page size', async () => {
|
|
|
63
63
|
})
|
|
64
64
|
|
|
65
65
|
test('should list first page of charts with expanded events', async () => {
|
|
66
|
-
const { client
|
|
66
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
67
67
|
const generatedKeys = []
|
|
68
68
|
for (let i = 0; i < 5; i++) {
|
|
69
69
|
const chart = await client.charts.create(i.toString())
|
|
@@ -2,7 +2,7 @@ const ChartListParams = require('../../src/Charts/ChartListParams.js')
|
|
|
2
2
|
const testUtils = require('../testUtils.js')
|
|
3
3
|
|
|
4
4
|
test('should list charts after a given chart id', async () => {
|
|
5
|
-
const { client
|
|
5
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
6
6
|
const chart1 = await client.charts.create()
|
|
7
7
|
const chart2 = await client.charts.create()
|
|
8
8
|
const chart3 = await client.charts.create()
|
|
@@ -14,7 +14,7 @@ test('should list charts after a given chart id', async () => {
|
|
|
14
14
|
})
|
|
15
15
|
|
|
16
16
|
test('should list charts after a given chart id with filter', async () => {
|
|
17
|
-
const { client
|
|
17
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
18
18
|
const chart1 = await client.charts.create('foo')
|
|
19
19
|
await client.charts.create('bar')
|
|
20
20
|
const chart3 = await client.charts.create('foo')
|
|
@@ -28,7 +28,7 @@ test('should list charts after a given chart id with filter', async () => {
|
|
|
28
28
|
})
|
|
29
29
|
|
|
30
30
|
test('should list charts after a given chart id with page size', async () => {
|
|
31
|
-
const { client
|
|
31
|
+
const { client } = await testUtils.createTestUserAndClient()
|
|
32
32
|
await client.charts.create()
|
|
33
33
|
const chart2 = await client.charts.create()
|
|
34
34
|
const chart3 = await client.charts.create()
|