seatsio 72.6.0 → 73.0.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/README.md +1 -1
- package/package.json +22 -9
- package/.eslintrc.json +0 -15
- package/.github/dependabot.yml +0 -7
- package/.github/workflows/build.yml +0 -25
- package/.github/workflows/release.yml +0 -42
- package/gulpfile.js +0 -24
- package/index.js +0 -9
- package/jest.config.json +0 -7
- package/release.mjs +0 -92
- package/src/Accounts/Account.js +0 -18
- package/src/Accounts/AccountSettings.js +0 -17
- package/src/Accounts/Accounts.js +0 -71
- package/src/Accounts/ChartValidationSettings.js +0 -15
- package/src/Accounts/DefaultRendererSettings.js +0 -11
- package/src/AsyncIterator.js +0 -160
- package/src/Charts/Category.js +0 -55
- package/src/Charts/Chart.js +0 -36
- package/src/Charts/ChartListParams.js +0 -78
- package/src/Charts/ChartObjectInfo.js +0 -26
- package/src/Charts/ChartValidation.js +0 -8
- package/src/Charts/Charts.js +0 -301
- package/src/Charts/SocialDistancingRuleset.js +0 -133
- package/src/Common/IDs.js +0 -11
- package/src/Common/Labels.js +0 -26
- package/src/Events/BestAvailableObjects.js +0 -14
- package/src/Events/ChangeObjectStatusResult.js +0 -12
- package/src/Events/Channel.js +0 -14
- package/src/Events/Channels.js +0 -56
- package/src/Events/Event.js +0 -33
- package/src/Events/EventDeserializer.js +0 -13
- package/src/Events/EventObjectInfo.js +0 -48
- package/src/Events/Events.js +0 -577
- package/src/Events/ForSaleConfig.js +0 -16
- package/src/Events/ObjectProperties.js +0 -35
- package/src/Events/StatusChange.js +0 -22
- package/src/Events/StatusChangeRequest.js +0 -28
- package/src/Events/StatusChangesParams.js +0 -82
- package/src/Events/TableBookingConfig.js +0 -41
- package/src/HoldTokens/HoldToken.js +0 -13
- package/src/HoldTokens/HoldTokens.js +0 -40
- package/src/Invitations/Invitation.js +0 -10
- package/src/Invitations/Invitations.js +0 -20
- package/src/Lister.js +0 -54
- package/src/Page.js +0 -25
- package/src/PageFetcher.js +0 -39
- package/src/Region.js +0 -27
- package/src/Reports/ChartReports.js +0 -100
- package/src/Reports/EventReports.js +0 -268
- package/src/Reports/UsageReports.js +0 -32
- package/src/Seasons/Season.js +0 -18
- package/src/Seasons/SeasonParams.js +0 -28
- package/src/Seasons/Seasons.js +0 -123
- package/src/SeatsioClient.js +0 -120
- package/src/Subaccounts/Subaccount.js +0 -15
- package/src/Subaccounts/Subaccounts.js +0 -148
- package/src/Users/User.js +0 -16
- package/src/Users/Users.js +0 -95
- package/src/Workspaces/Workspace.js +0 -17
- package/src/Workspaces/Workspaces.js +0 -200
- package/src/errorInterceptor.js +0 -15
- package/src/utilities/helperFunctions.js +0 -22
- package/src/utilities/reportUtility.js +0 -38
- package/tests/accounts/changeHoldPeriod.test.js +0 -9
- package/tests/accounts/changePassword.test.js +0 -6
- package/tests/accounts/disableDraftChartDrawings.test.js +0 -11
- package/tests/accounts/enableDraftChartDrawings.test.js +0 -11
- package/tests/accounts/regenerateDesignerKey.test.js +0 -11
- package/tests/accounts/regenerateSecretKey.test.js +0 -11
- package/tests/accounts/retrieveMyAccount.test.js +0 -22
- package/tests/accounts/updateSettingTest.test.js +0 -9
- package/tests/chartReports/chartReport.test.js +0 -144
- package/tests/chartReports/chartReportSummary.test.js +0 -165
- package/tests/charts/addTag.test.js +0 -22
- package/tests/charts/chartValidation.test.js +0 -60
- package/tests/charts/copyChart.test.js +0 -13
- package/tests/charts/copyChartToSubaccount.test.js +0 -15
- package/tests/charts/copyChartToWorkspace.test.js +0 -15
- package/tests/charts/copyDraftVersion.test.js +0 -13
- package/tests/charts/createChart.test.js +0 -69
- package/tests/charts/discardDraftVersion.test.js +0 -14
- package/tests/charts/listAllCharts.test.js +0 -139
- package/tests/charts/listAllTags.test.js +0 -13
- package/tests/charts/listChartsInArchive.test.js +0 -144
- package/tests/charts/listFirstPageOfCharts.test.js +0 -79
- package/tests/charts/listPageAfter.test.js +0 -41
- package/tests/charts/listPageBefore.test.js +0 -41
- package/tests/charts/manageCategories.test.js +0 -44
- package/tests/charts/moveChartOutOfArchive.test.js +0 -15
- package/tests/charts/moveChartToArchive.test.js +0 -11
- package/tests/charts/publishDraftVersion.test.js +0 -14
- package/tests/charts/removeTag.test.js +0 -13
- package/tests/charts/retrieveChart.test.js +0 -33
- package/tests/charts/retrieveDraftVersion.test.js +0 -12
- package/tests/charts/retrievePublishedVersion.test.js +0 -13
- package/tests/charts/saveSocialDistancingRulesets.test.js +0 -61
- package/tests/charts/updateChart.test.js +0 -25
- package/tests/error.test.js +0 -18
- package/tests/eventReports/eventReport.test.js +0 -357
- package/tests/eventReports/eventReportDeepSummary.test.js +0 -113
- package/tests/eventReports/eventReportSummary.test.js +0 -393
- package/tests/events/bookObject.test.js +0 -143
- package/tests/events/changeBestAvailableObjectStatus.test.js +0 -204
- package/tests/events/changeObjectStatus.test.js +0 -261
- package/tests/events/changeObjectStatusForMultipleEvents.test.js +0 -64
- package/tests/events/changeObjectStatusForMultipleObjects.test.js +0 -149
- package/tests/events/changeObjectStatusInBatch.test.js +0 -107
- package/tests/events/channels/addChannel.test.js +0 -113
- package/tests/events/channels/addObjectToChannel.test.js +0 -34
- package/tests/events/channels/removeChannel.test.js +0 -26
- package/tests/events/channels/removeObjectsFromChannel.test.js +0 -25
- package/tests/events/channels/replaceChannels.test.js +0 -36
- package/tests/events/channels/setObjectsForChannelsTest.js +0 -39
- package/tests/events/channels/updateChannel.test.js +0 -65
- package/tests/events/createEvent.test.js +0 -90
- package/tests/events/createEvents.test.js +0 -134
- package/tests/events/deleteEvent.test.js +0 -14
- package/tests/events/holdObjects.test.js +0 -85
- package/tests/events/listAllEvents.test.js +0 -30
- package/tests/events/listAllStatusChanges.test.js +0 -231
- package/tests/events/listFirstPage.test.js +0 -27
- package/tests/events/listPageAfter.test.js +0 -26
- package/tests/events/listPageBefore.test.js +0 -26
- package/tests/events/listStatusChangesForObjects.test.js +0 -23
- package/tests/events/markEverythingAsForSale.test.js +0 -13
- package/tests/events/markObjectsAsForSale.test.js +0 -42
- package/tests/events/markObjectsAsNotForSale.test.js +0 -42
- package/tests/events/releaseObjects.test.js +0 -95
- package/tests/events/retrieveEvent.test.js +0 -95
- package/tests/events/retrieveEventObjectInfo.test.js +0 -16
- package/tests/events/retrieveEventObjectInfos.test.js +0 -30
- package/tests/events/updateEvent.test.js +0 -134
- package/tests/events/updateExtraData.test.js +0 -14
- package/tests/events/updateExtraDatas.test.js +0 -16
- package/tests/exponentialBackoff.test.js +0 -50
- package/tests/holdTokens/createHoldTokens.test.js +0 -21
- package/tests/holdTokens/retrieveHoldToken.test.js +0 -14
- package/tests/holdTokens/updateHoldTokenExpirationDate.test.js +0 -19
- package/tests/invitations/listAllInvitations.test.js +0 -17
- package/tests/requestListener.test.js +0 -32
- package/tests/sampleChart.json +0 -457
- package/tests/sampleChartWithErrors.json +0 -444
- package/tests/sampleChartWithSections.json +0 -1021
- package/tests/sampleChartWithTables.json +0 -207
- package/tests/seasons/addEventsToPartialSeason.test.js +0 -13
- package/tests/seasons/createEventsInSeason.test.js +0 -21
- package/tests/seasons/createPartialSeason.test.js +0 -22
- package/tests/seasons/createSeason.test.js +0 -72
- package/tests/seasons/removeEventsFromPartialSeason.test.js +0 -13
- package/tests/seasons/retrieveSeason.test.js +0 -25
- package/tests/setupTests.js +0 -1
- package/tests/subaccounts/activateSubaccount.test.js +0 -12
- package/tests/subaccounts/copyChartToParent.test.js +0 -13
- package/tests/subaccounts/copyChartToSubaccount.test.js +0 -16
- package/tests/subaccounts/createSubAccount.test.js +0 -21
- package/tests/subaccounts/deactivateSubaccount.test.js +0 -10
- package/tests/subaccounts/filterSubaccounts.test.js +0 -102
- package/tests/subaccounts/listActiveSubaccounts.test.js +0 -88
- package/tests/subaccounts/listAllSubaccounts.test.js +0 -14
- package/tests/subaccounts/listFirstPage.test.js +0 -27
- package/tests/subaccounts/listInactiveSubaccounts.test.js +0 -118
- package/tests/subaccounts/listPageAfter.test.js +0 -25
- package/tests/subaccounts/listPageBefore.test.js +0 -25
- package/tests/subaccounts/regenerateDesignerKey.test.js +0 -12
- package/tests/subaccounts/regenerateSecretKey.test.js +0 -13
- package/tests/subaccounts/retrieveSubaccount.test.js +0 -15
- package/tests/subaccounts/updateSubaccount.test.js +0 -22
- package/tests/testUtils.js +0 -140
- package/tests/users/inviteUser.test.js +0 -27
- package/tests/users/listAllUsers.test.js +0 -11
- package/tests/users/retrieveUser.test.js +0 -15
- package/tests/workspacekey.authentication.test.js +0 -11
- package/tests/workspaces/activateWorkspace.test.js +0 -12
- package/tests/workspaces/createWorkspace.test.js +0 -25
- package/tests/workspaces/deactivateWorkspace.test.js +0 -11
- package/tests/workspaces/listActiveWorkspaces.test.js +0 -32
- package/tests/workspaces/listAllWorkspaces.test.js +0 -29
- package/tests/workspaces/listFirstPage.test.js +0 -23
- package/tests/workspaces/listInactiveWorkspaces.test.js +0 -34
- package/tests/workspaces/listPageAfter.test.js +0 -24
- package/tests/workspaces/listPageBefore.test.js +0 -24
- package/tests/workspaces/regenerateSecretKeyOfWorkspace.test.js +0 -12
- package/tests/workspaces/retrieveWorkspace.test.js +0 -17
- package/tests/workspaces/setDefaultWorkspace.test.js +0 -11
- package/tests/workspaces/updateWorkspace.test.js +0 -11
package/README.md
CHANGED
|
@@ -275,7 +275,7 @@ console.log(`Created a chart with key ${chart.key} and an event with key: ${even
|
|
|
275
275
|
import { SeatsioClient, Region } from 'seatsio'
|
|
276
276
|
|
|
277
277
|
let client = new SeatsioClient(Region.EU(), <COMPANY ADMIN KEY>, <WORKSPACE PUBLIC KEY>)
|
|
278
|
-
let
|
|
278
|
+
let categoryList = await client.charts.listCategories("the chart key")
|
|
279
279
|
for (const category of categoryList) {
|
|
280
280
|
console.log(category.label)
|
|
281
281
|
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "seatsio",
|
|
3
|
-
"version": "
|
|
4
|
-
"main": "index.js",
|
|
3
|
+
"version": "73.0.0",
|
|
4
|
+
"main": "dist/src/index.js",
|
|
5
|
+
"types": "dist/src/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"/dist/src"
|
|
8
|
+
],
|
|
5
9
|
"description": "Official JavaScript and Node.JS client library for the Seats.io REST API",
|
|
6
10
|
"license": "MIT",
|
|
7
11
|
"scripts": {
|
|
8
|
-
"lint": "eslint ./src ./tests",
|
|
9
|
-
"test": "jest --maxWorkers=8 --verbose"
|
|
12
|
+
"lint": "eslint './src/**/*.ts' './tests/**/*.ts'",
|
|
13
|
+
"test": "jest --maxWorkers=8 --verbose",
|
|
14
|
+
"build": "tsc --outDir dist"
|
|
10
15
|
},
|
|
11
16
|
"repository": {
|
|
12
17
|
"type": "git",
|
|
13
18
|
"url": "https://github.com/seatsio/seatsio-js"
|
|
14
19
|
},
|
|
15
20
|
"dependencies": {
|
|
16
|
-
"axios": "1.
|
|
21
|
+
"axios": "1.4.0"
|
|
17
22
|
},
|
|
18
23
|
"devDependencies": {
|
|
19
|
-
"
|
|
24
|
+
"@jest/globals": "29.5.0",
|
|
25
|
+
"@types/jest": "29.5.1",
|
|
26
|
+
"@types/node": "20.1.5",
|
|
27
|
+
"@types/uuid": "9.0.1",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "5.59.6",
|
|
29
|
+
"@typescript-eslint/parser": "5.59.6",
|
|
30
|
+
"eslint": "8.40.0",
|
|
20
31
|
"eslint-config-standard": "17.0.0",
|
|
21
32
|
"eslint-plugin-import": "2.27.5",
|
|
22
|
-
"eslint-plugin-n": "
|
|
33
|
+
"eslint-plugin-n": "16.0.0",
|
|
23
34
|
"eslint-plugin-promise": "6.1.1",
|
|
24
|
-
"jest": "29.
|
|
25
|
-
"jest-cli": "29.
|
|
35
|
+
"jest": "29.5.0",
|
|
36
|
+
"jest-cli": "29.5.0",
|
|
37
|
+
"ts-jest": "29.1.0",
|
|
38
|
+
"typescript": "5.0.4",
|
|
26
39
|
"uuid": "9.0.0"
|
|
27
40
|
}
|
|
28
41
|
}
|
package/.eslintrc.json
DELETED
package/.github/dependabot.yml
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
name: 'Build'
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ master ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ master ]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v2
|
|
16
|
-
- uses: actions/setup-node@v1
|
|
17
|
-
with:
|
|
18
|
-
node-version: 18
|
|
19
|
-
registry-url: https://registry.npmjs.org/
|
|
20
|
-
- run: yarn install
|
|
21
|
-
- run: yarn lint
|
|
22
|
-
- uses: zcong1993/setup-timezone@master
|
|
23
|
-
with:
|
|
24
|
-
timezone: Europe/Brussels
|
|
25
|
-
- run: yarn test
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# Very important!
|
|
2
|
-
# Make sure that the github token has read AND WRITE access on github.
|
|
3
|
-
# 1. hit https://github.com/seatsio/[REPO]/settings/actions
|
|
4
|
-
# 2. under "Workflow permissions", make sure "Read and write permissions" is checked instead of the (default?) read only.
|
|
5
|
-
#
|
|
6
|
-
|
|
7
|
-
name: Release
|
|
8
|
-
run-name: Release ${{ github.repository }}
|
|
9
|
-
on:
|
|
10
|
-
workflow_dispatch:
|
|
11
|
-
inputs:
|
|
12
|
-
versionToBump:
|
|
13
|
-
description: 'The version to bump. Major for incompatible API changes, minor for adding BC features'
|
|
14
|
-
required: true
|
|
15
|
-
type: choice
|
|
16
|
-
options:
|
|
17
|
-
- minor
|
|
18
|
-
- major
|
|
19
|
-
jobs:
|
|
20
|
-
release:
|
|
21
|
-
runs-on: ubuntu-latest
|
|
22
|
-
steps:
|
|
23
|
-
- uses: actions/checkout@v3
|
|
24
|
-
- uses: fregante/setup-git-user@v2
|
|
25
|
-
- id: install-zx
|
|
26
|
-
run: npm i -g zx
|
|
27
|
-
- id: install-semver-tool
|
|
28
|
-
run: |
|
|
29
|
-
wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
|
|
30
|
-
chmod +x /usr/local/bin/semver
|
|
31
|
-
- run: zx ./release.mjs -v $VERSION_TO_BUMP
|
|
32
|
-
env:
|
|
33
|
-
VERSION_TO_BUMP: ${{ inputs.versionToBump }}
|
|
34
|
-
GH_TOKEN: ${{ github.token }}
|
|
35
|
-
- uses: actions/setup-node@v1
|
|
36
|
-
with:
|
|
37
|
-
node-version: 18
|
|
38
|
-
registry-url: https://registry.npmjs.org/
|
|
39
|
-
- run: yarn install
|
|
40
|
-
- run: yarn publish
|
|
41
|
-
env:
|
|
42
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/gulpfile.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var gulp = require('gulp')
|
|
2
|
-
var jest = require('gulp-jest').default
|
|
3
|
-
var browserify = require('browserify')
|
|
4
|
-
var tap = require('gulp-tap')
|
|
5
|
-
var buffer = require('gulp-buffer')
|
|
6
|
-
var uglify = require('gulp-uglify-es').default
|
|
7
|
-
|
|
8
|
-
gulp.task('jest', function () {
|
|
9
|
-
return gulp.src('tests')
|
|
10
|
-
.pipe(jest({
|
|
11
|
-
preprocessorIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/node_modules'],
|
|
12
|
-
automock: false
|
|
13
|
-
}))
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
gulp.task('bundle', function () {
|
|
17
|
-
return gulp.src('src/SeatsioClient.js', { read: true })
|
|
18
|
-
.pipe(tap(function (file) {
|
|
19
|
-
file.contents = browserify(file.path, { debug: true, standalone: 'SeatsioClient' }).bundle().on('error', (err) => console.log(err))
|
|
20
|
-
}))
|
|
21
|
-
.pipe(buffer())
|
|
22
|
-
.pipe(uglify())
|
|
23
|
-
.pipe(gulp.dest('build'))
|
|
24
|
-
})
|
package/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
SeatsioClient: require('./src/SeatsioClient.js'),
|
|
3
|
-
StatusChangesParams: require('./src/Events/StatusChangesParams.js'),
|
|
4
|
-
StatusChangeRequest: require('./src/Events/StatusChangeRequest.js'),
|
|
5
|
-
TableBookingconfig: require('./src/Events/TableBookingConfig.js'),
|
|
6
|
-
ChartListParams: require('./src/Charts/ChartListParams.js'),
|
|
7
|
-
SocialDistancingRuleset: require('./src/Charts/SocialDistancingRuleset.js'),
|
|
8
|
-
Region: require('./src/Region.js')
|
|
9
|
-
}
|
package/jest.config.json
DELETED
package/release.mjs
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env zx
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Script to release the seats.io java lib.
|
|
5
|
-
* - changes the version number in README.md
|
|
6
|
-
* - changes the version number in build.gradle
|
|
7
|
-
* - creates the release in Gihub (using gh cli)
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* Prerequisites:
|
|
11
|
-
* - zx installed (https://github.com/google/zx)
|
|
12
|
-
* - gh cli installed (https://cli.github.com/)
|
|
13
|
-
* - semver cli installed (https://github.com/fsaintjacques/semver-tool)
|
|
14
|
-
*
|
|
15
|
-
* Usage:
|
|
16
|
-
* zx ./release.mjs -v major/minor -n "release notes"
|
|
17
|
-
* */
|
|
18
|
-
|
|
19
|
-
// don't output the commands themselves
|
|
20
|
-
$.verbose = false
|
|
21
|
-
|
|
22
|
-
const versionToBump = getVersionToBump()
|
|
23
|
-
const latestVersion = await fetchLatestReleasedVersionNumber()
|
|
24
|
-
const nextVersion = await determineNextVersionNumber(latestVersion)
|
|
25
|
-
|
|
26
|
-
await pullLastVersion()
|
|
27
|
-
.then(bumpVersionInFiles)
|
|
28
|
-
.then(commitAndPush)
|
|
29
|
-
.then(release)
|
|
30
|
-
|
|
31
|
-
function getVersionToBump() {
|
|
32
|
-
if (!argv.v || !(argv.v === 'minor' || argv.v === 'major')) {
|
|
33
|
-
throw new Error ("Please specify -v major/minor")
|
|
34
|
-
}
|
|
35
|
-
return argv.v
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function removeLeadingV(tagName) {
|
|
39
|
-
if (tagName.startsWith('v')) {
|
|
40
|
-
return tagName.substring(1)
|
|
41
|
-
}
|
|
42
|
-
return tagName
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async function fetchLatestReleasedVersionNumber() {
|
|
46
|
-
let result = await $`gh release view --json tagName`
|
|
47
|
-
let tagName = JSON.parse(result).tagName
|
|
48
|
-
return removeLeadingV(tagName)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async function determineNextVersionNumber(previous) {
|
|
52
|
-
return (await $`semver bump ${versionToBump} ${previous}`).stdout.trim()
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async function bumpVersionInFiles() {
|
|
56
|
-
await replaceInFile("package.json", `"version": "${latestVersion}",`, `"version": "${nextVersion}",`)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function replaceInFile(filename, latestVersion, nextVersion) {
|
|
60
|
-
return await fs.readFile(filename, 'utf8')
|
|
61
|
-
.then(text => {
|
|
62
|
-
if (text.indexOf(latestVersion) < 0) {
|
|
63
|
-
throw new Error('Not the correct version. Could not find ' + latestVersion + ' in ' + filename)
|
|
64
|
-
}
|
|
65
|
-
return text
|
|
66
|
-
})
|
|
67
|
-
.then(text => text.replace(latestVersion, nextVersion))
|
|
68
|
-
.then(text => fs.writeFileSync(filename, text))
|
|
69
|
-
.then(() => gitAdd(filename))
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async function pullLastVersion() {
|
|
73
|
-
await $`git checkout master`
|
|
74
|
-
await $`git pull origin master`
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async function gitAdd(filename) {
|
|
78
|
-
return await $`git add ${filename}`
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async function commitAndPush() {
|
|
82
|
-
await $`git commit -m "version bump"`
|
|
83
|
-
await $`git push origin master`
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async function release() {
|
|
87
|
-
const newTag = 'v' + nextVersion
|
|
88
|
-
return await $`gh release create ${newTag} --generate-notes`.catch(error => {
|
|
89
|
-
console.error('something went wrong while creating the release. Please revert the version change!')
|
|
90
|
-
throw error
|
|
91
|
-
})
|
|
92
|
-
}
|
package/src/Accounts/Account.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const AccountSettings = require('./AccountSettings.js')
|
|
2
|
-
|
|
3
|
-
class Account {
|
|
4
|
-
/**
|
|
5
|
-
* @param {object} account
|
|
6
|
-
*/
|
|
7
|
-
constructor (account) {
|
|
8
|
-
this.secretKey = account.secretKey
|
|
9
|
-
this.designerKey = account.designerKey
|
|
10
|
-
this.publicKey = account.publicKey
|
|
11
|
-
this.settings = new AccountSettings(account.settings)
|
|
12
|
-
this.company = account.company
|
|
13
|
-
this.email = account.email
|
|
14
|
-
this.role = account.role
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
module.exports = Account
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const ChartValidationSettings = require('./ChartValidationSettings.js')
|
|
2
|
-
const DefaultRendererSettings = require('./DefaultRendererSettings.js')
|
|
3
|
-
|
|
4
|
-
class AccountSettings {
|
|
5
|
-
/**
|
|
6
|
-
* @param {object} settings
|
|
7
|
-
*/
|
|
8
|
-
constructor (settings) {
|
|
9
|
-
this.draftChartDrawingsEnabled = settings.draftChartDrawingsEnabled
|
|
10
|
-
this.holdOnSelectForGAs = settings.holdOnSelectForGAs
|
|
11
|
-
this.holdPeriodInMinutes = settings.holdPeriodInMinutes
|
|
12
|
-
this.chartValidation = new ChartValidationSettings(settings.chartValidation)
|
|
13
|
-
this.defaultRendererSettings = new DefaultRendererSettings(settings.defaultRendererSettings)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = AccountSettings
|
package/src/Accounts/Accounts.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
const Account = require('./Account.js')
|
|
2
|
-
|
|
3
|
-
const baseUrl = '/accounts/me'
|
|
4
|
-
|
|
5
|
-
class Accounts {
|
|
6
|
-
constructor (client) {
|
|
7
|
-
this.client = client
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @returns {Promise<Account>}
|
|
12
|
-
*/
|
|
13
|
-
retrieveMyAccount () {
|
|
14
|
-
return this.client.get(baseUrl).then((res) => new Account(res.data))
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @returns {Promise<string>}
|
|
19
|
-
*/
|
|
20
|
-
regenerateSecretKey () {
|
|
21
|
-
return this.client.post(baseUrl + '/secret-key/actions/regenerate').then((res) => res.data.secretKey)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @returns {Promise<string>}
|
|
26
|
-
*/
|
|
27
|
-
regenerateDesignerKey () {
|
|
28
|
-
return this.client.post(baseUrl + '/designer-key/actions/regenerate').then((res) => res.data.designerKey)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @returns {Promise}
|
|
33
|
-
*/
|
|
34
|
-
enableDraftChartDrawings () {
|
|
35
|
-
return this.client.post(baseUrl + '/draft-chart-drawings/actions/enable')
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @returns {Promise} Promise
|
|
40
|
-
*/
|
|
41
|
-
disableDraftChartDrawings () {
|
|
42
|
-
return this.client.post(baseUrl + '/draft-chart-drawings/actions/disable')
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @param {string} password
|
|
47
|
-
* @returns {Promise} Promise
|
|
48
|
-
*/
|
|
49
|
-
changePassword (password) {
|
|
50
|
-
return this.client.post(baseUrl + '/actions/change-password', { password })
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @param {number} holdPeriodInMinutes
|
|
55
|
-
* @returns {Promise} Promise
|
|
56
|
-
*/
|
|
57
|
-
changeHoldPeriod (holdPeriodInMinutes) {
|
|
58
|
-
return this.client.post(baseUrl + '/actions/change-hold-period', { holdPeriodInMinutes })
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @param {string} key
|
|
63
|
-
* @param {string} value
|
|
64
|
-
* @returns {Promise} Promise
|
|
65
|
-
*/
|
|
66
|
-
updateSetting (key, value) {
|
|
67
|
-
return this.client.post(baseUrl + '/settings', { key, value })
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
module.exports = Accounts
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
class ChartValidationSettings {
|
|
2
|
-
/**
|
|
3
|
-
* @param {object} chartValidations
|
|
4
|
-
*/
|
|
5
|
-
constructor (chartValidations) {
|
|
6
|
-
this.VALIDATE_DUPLICATE_LABELS = chartValidations.VALIDATE_DUPLICATE_LABELS
|
|
7
|
-
this.VALIDATE_OBJECTS_WITHOUT_CATEGORIES = chartValidations.VALIDATE_OBJECTS_WITHOUT_CATEGORIES
|
|
8
|
-
this.VALIDATE_UNLABELED_OBJECTS = chartValidations.VALIDATE_UNLABELED_OBJECTS
|
|
9
|
-
this.VALIDATE_FOCAL_POINT = chartValidations.VALIDATE_FOCAL_POINT
|
|
10
|
-
this.VALIDATE_OBJECT_TYPES_PER_CATEGORY = chartValidations.VALIDATE_OBJECT_TYPES_PER_CATEGORY
|
|
11
|
-
this.VALIDATE_EMPTY_FLOOR = chartValidations.VALIDATE_EMPTY_FLOOR
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = ChartValidationSettings
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
class DefaultRendererSettings {
|
|
2
|
-
/**
|
|
3
|
-
* @param {object} defaultRendererSettings
|
|
4
|
-
*/
|
|
5
|
-
constructor (defaultRendererSettings) {
|
|
6
|
-
this.showFullScreenButton = defaultRendererSettings.showFullScreenButton
|
|
7
|
-
this.multiSelectEnabled = defaultRendererSettings.multiSelectEnabled
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = DefaultRendererSettings
|
package/src/AsyncIterator.js
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
const Page = require('./Page.js')
|
|
2
|
-
const StatusChange = require('./Events/StatusChange.js')
|
|
3
|
-
const Chart = require('./Charts/Chart.js')
|
|
4
|
-
const User = require('./Users/User.js')
|
|
5
|
-
const Subaccount = require('./Subaccounts/Subaccount.js')
|
|
6
|
-
const Workspace = require('./Workspaces/Workspace.js')
|
|
7
|
-
const Season = require('./Seasons/Season')
|
|
8
|
-
const EventDeserializer = require('./Events/EventDeserializer')
|
|
9
|
-
|
|
10
|
-
class AsyncIterator {
|
|
11
|
-
/**
|
|
12
|
-
* @param {string} url
|
|
13
|
-
* @param {Axios} client
|
|
14
|
-
* @param {string} objType
|
|
15
|
-
* @param {object} params
|
|
16
|
-
*/
|
|
17
|
-
constructor (url, client, objType, params = {}) {
|
|
18
|
-
this.url = url
|
|
19
|
-
this.client = client
|
|
20
|
-
this.objType = objType
|
|
21
|
-
this.params = params
|
|
22
|
-
this.items = []
|
|
23
|
-
this.pages = []
|
|
24
|
-
this.index = 0
|
|
25
|
-
this.nextPageMustBeFetched = true
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
charts (data) {
|
|
29
|
-
const charts = []
|
|
30
|
-
data.items.forEach((chartData) => {
|
|
31
|
-
const chart = new Chart(chartData)
|
|
32
|
-
this.items.push(chart)
|
|
33
|
-
charts.push(chart)
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
this.pages.push(new Page(charts, data.next_page_starts_after, data.previous_page_ends_before))
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
events (data) {
|
|
40
|
-
const events = []
|
|
41
|
-
data.items.forEach(eventData => {
|
|
42
|
-
const event = new EventDeserializer().fromJson(eventData)
|
|
43
|
-
this.items.push(event)
|
|
44
|
-
events.push(event)
|
|
45
|
-
})
|
|
46
|
-
this.pages.push(new Page(events, data.next_page_starts_after, data.previous_page_ends_before))
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
seasons (data) {
|
|
50
|
-
const seasons = []
|
|
51
|
-
data.items.forEach(seasonData => {
|
|
52
|
-
const season = new Season(seasonData)
|
|
53
|
-
this.items.push(season)
|
|
54
|
-
seasons.push(season)
|
|
55
|
-
})
|
|
56
|
-
this.pages.push(new Page(seasons, data.next_page_starts_after, data.previous_page_ends_before))
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
statusChanges (data) {
|
|
60
|
-
const statusChanges = []
|
|
61
|
-
data.items.forEach((statusData) => {
|
|
62
|
-
const status = new StatusChange(statusData)
|
|
63
|
-
this.items.push(status)
|
|
64
|
-
statusChanges.push(status)
|
|
65
|
-
})
|
|
66
|
-
this.pages.push(new Page(statusChanges, data.next_page_starts_after, data.previous_page_ends_before))
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
subaccounts (data) {
|
|
70
|
-
const subaccounts = []
|
|
71
|
-
data.items.forEach((subaccountData) => {
|
|
72
|
-
const subaccount = new Subaccount(subaccountData)
|
|
73
|
-
this.items.push(subaccount)
|
|
74
|
-
subaccounts.push(subaccount)
|
|
75
|
-
})
|
|
76
|
-
this.pages.push(new Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before))
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
workspaces (data) {
|
|
80
|
-
const workspaces = []
|
|
81
|
-
data.items.forEach((json) => {
|
|
82
|
-
const workspace = new Workspace(json)
|
|
83
|
-
this.items.push(workspace)
|
|
84
|
-
workspaces.push(workspace)
|
|
85
|
-
})
|
|
86
|
-
this.pages.push(new Page(workspaces, data.next_page_starts_after, data.previous_page_ends_before))
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
users (data) {
|
|
90
|
-
const users = []
|
|
91
|
-
data.items.forEach((userData) => {
|
|
92
|
-
const user = new User(userData)
|
|
93
|
-
this.items.push(user)
|
|
94
|
-
users.push(user)
|
|
95
|
-
})
|
|
96
|
-
this.pages.push(new Page(users, data.next_page_starts_after, data.previous_page_ends_before))
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
fetch (fetchParams = {}) {
|
|
100
|
-
return this.client.get(this.url, { params: fetchParams })
|
|
101
|
-
.then((res) => {
|
|
102
|
-
if (res.data.next_page_starts_after) {
|
|
103
|
-
this.nextPageStartsAfter = res.data.next_page_starts_after
|
|
104
|
-
this.nextPageMustBeFetched = true
|
|
105
|
-
} else {
|
|
106
|
-
this.nextPageMustBeFetched = false
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
switch (this.objType) {
|
|
110
|
-
case 'charts':
|
|
111
|
-
this.charts(res.data)
|
|
112
|
-
break
|
|
113
|
-
case 'events':
|
|
114
|
-
this.events(res.data)
|
|
115
|
-
break
|
|
116
|
-
case 'seasons':
|
|
117
|
-
this.seasons(res.data)
|
|
118
|
-
break
|
|
119
|
-
case 'statusChanges':
|
|
120
|
-
this.statusChanges(res.data)
|
|
121
|
-
break
|
|
122
|
-
case 'subaccounts':
|
|
123
|
-
this.subaccounts(res.data)
|
|
124
|
-
break
|
|
125
|
-
case 'users':
|
|
126
|
-
this.users(res.data)
|
|
127
|
-
break
|
|
128
|
-
case 'workspaces':
|
|
129
|
-
this.workspaces(res.data)
|
|
130
|
-
break
|
|
131
|
-
default:
|
|
132
|
-
throw new Error(`Unknown object type '${this.objType}'`)
|
|
133
|
-
}
|
|
134
|
-
})
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
[Symbol.asyncIterator] () {
|
|
138
|
-
const _this = this
|
|
139
|
-
|
|
140
|
-
return {
|
|
141
|
-
async next () {
|
|
142
|
-
if (_this.nextPageMustBeFetched && _this.items.length === 0) {
|
|
143
|
-
await _this.fetch(_this.params)
|
|
144
|
-
} else if (_this.nextPageMustBeFetched && !_this.items[_this.index]) {
|
|
145
|
-
_this.params.start_after_id = _this.nextPageStartsAfter
|
|
146
|
-
await _this.fetch(_this.params)
|
|
147
|
-
}
|
|
148
|
-
if (!_this.items[_this.index]) {
|
|
149
|
-
return Promise.resolve({
|
|
150
|
-
done: true
|
|
151
|
-
})
|
|
152
|
-
} else {
|
|
153
|
-
return Promise.resolve({ value: _this.items[_this.index++], done: false })
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
module.exports = AsyncIterator
|
package/src/Charts/Category.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
class Category {
|
|
2
|
-
/**
|
|
3
|
-
* @param {string|number} key
|
|
4
|
-
* @param {string} label
|
|
5
|
-
* @param {string} color
|
|
6
|
-
*/
|
|
7
|
-
constructor (key, label, color, accessible = false) {
|
|
8
|
-
this.key = key
|
|
9
|
-
this.label = label
|
|
10
|
-
this.color = color
|
|
11
|
-
this.accessible = accessible
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @param {string|number} key
|
|
16
|
-
* @returns {Category}
|
|
17
|
-
*/
|
|
18
|
-
setKey (key) {
|
|
19
|
-
this.key = key
|
|
20
|
-
return this
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param {string} label
|
|
25
|
-
* @returns {Category}
|
|
26
|
-
*/
|
|
27
|
-
setLabel (label) {
|
|
28
|
-
this.label = label
|
|
29
|
-
return this
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @param {string} color
|
|
34
|
-
* @returns {Category}
|
|
35
|
-
*/
|
|
36
|
-
setColor (color) {
|
|
37
|
-
this.color = color
|
|
38
|
-
return this
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @param {boolean} accessible
|
|
43
|
-
* @returns {Category}
|
|
44
|
-
*/
|
|
45
|
-
setAccessible (accessible) {
|
|
46
|
-
this.accessible = accessible
|
|
47
|
-
return this
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static fromJson (json) {
|
|
51
|
-
return new Category(json.key, json.label, json.color, json.accessible)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports = Category
|
package/src/Charts/Chart.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const ChartValidation = require('./ChartValidation')
|
|
2
|
-
const SocialDistancingRuleset = require('./SocialDistancingRuleset')
|
|
3
|
-
const EventDeserializer = require('../Events/EventDeserializer')
|
|
4
|
-
|
|
5
|
-
class Chart {
|
|
6
|
-
/**
|
|
7
|
-
* @param {object} chart
|
|
8
|
-
*/
|
|
9
|
-
constructor (chart) {
|
|
10
|
-
this.name = chart.name
|
|
11
|
-
this.id = chart.id
|
|
12
|
-
this.key = chart.key
|
|
13
|
-
this.status = chart.status
|
|
14
|
-
this.tags = chart.tags
|
|
15
|
-
this.publishedVersionThumbnailUrl = chart.publishedVersionThumbnailUrl
|
|
16
|
-
this.draftVersionThumbnailUrl = chart.draftVersionThumbnailUrl || null
|
|
17
|
-
this.events = chart.events ? chart.events.map(event => new EventDeserializer().fromJson(event)) : []
|
|
18
|
-
this.archived = chart.archived
|
|
19
|
-
if (chart.validation) this.validation = new ChartValidation(chart.validation)
|
|
20
|
-
this.socialDistancingRulesets = Chart.socialDistancingRulesetsFromJson(chart.socialDistancingRulesets)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
static socialDistancingRulesetsFromJson (json) {
|
|
24
|
-
if (json === undefined) {
|
|
25
|
-
return undefined
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const result = {}
|
|
29
|
-
for (const key in json) {
|
|
30
|
-
result[key] = SocialDistancingRuleset.fromJson(json[key])
|
|
31
|
-
}
|
|
32
|
-
return result
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = Chart
|