seatsio 77.3.0 → 78.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.
@@ -2,7 +2,6 @@ import { SeasonJson } from './Seasons/Season';
2
2
  import { ChartJson } from './Charts/Chart';
3
3
  import { Page } from './Page';
4
4
  import { StatusChangeJson } from './Events/StatusChange';
5
- import { SubaccountJson } from './Subaccounts/Subaccount';
6
5
  import { WorkspaceJson } from './Workspaces/Workspace';
7
6
  import { UserJson } from './Users/User';
8
7
  import { EventJson } from './Events/Event';
@@ -31,7 +30,6 @@ export declare class AsyncIterator<T> {
31
30
  events(data: PaginatedJson<EventJson>): void;
32
31
  seasons(data: PaginatedJson<SeasonJson>): void;
33
32
  statusChanges(data: PaginatedJson<StatusChangeJson>): void;
34
- subaccounts(data: PaginatedJson<SubaccountJson>): void;
35
33
  workspaces(data: PaginatedJson<WorkspaceJson>): void;
36
34
  users(data: PaginatedJson<UserJson>): void;
37
35
  fetch(fetchParams?: {}): Promise<void>;
@@ -42,7 +42,6 @@ var Chart_1 = require("./Charts/Chart");
42
42
  var Page_1 = require("./Page");
43
43
  var EventDeserializer_1 = require("./Events/EventDeserializer");
44
44
  var StatusChange_1 = require("./Events/StatusChange");
45
- var Subaccount_1 = require("./Subaccounts/Subaccount");
46
45
  var Workspace_1 = require("./Workspaces/Workspace");
47
46
  var User_1 = require("./Users/User");
48
47
  var AsyncIterator = /** @class */ (function () {
@@ -105,18 +104,6 @@ var AsyncIterator = /** @class */ (function () {
105
104
  // @ts-ignore
106
105
  this.pages.push(new Page_1.Page(statusChanges, data.next_page_starts_after, data.previous_page_ends_before));
107
106
  };
108
- AsyncIterator.prototype.subaccounts = function (data) {
109
- var _this_1 = this;
110
- var subaccounts = [];
111
- data.items.forEach(function (subaccountData) {
112
- var subaccount = new Subaccount_1.Subaccount(subaccountData);
113
- // @ts-ignore
114
- _this_1.items.push(subaccount);
115
- subaccounts.push(subaccount);
116
- });
117
- // @ts-ignore
118
- this.pages.push(new Page_1.Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before));
119
- };
120
107
  AsyncIterator.prototype.workspaces = function (data) {
121
108
  var _this_1 = this;
122
109
  var workspaces = [];
@@ -166,9 +153,6 @@ var AsyncIterator = /** @class */ (function () {
166
153
  case 'statusChanges':
167
154
  _this_1.statusChanges(res.data);
168
155
  break;
169
- case 'subaccounts':
170
- _this_1.subaccounts(res.data);
171
- break;
172
156
  case 'users':
173
157
  _this_1.users(res.data);
174
158
  break;
@@ -25,7 +25,6 @@ export declare class Charts {
25
25
  moveOutOfArchive(key: string): Promise<import("axios").AxiosResponse<any, any>>;
26
26
  copy(key: string): Promise<Chart>;
27
27
  copyDraftVersion(key: string): Promise<Chart>;
28
- copyToSubaccount(key: string, subaccountId: number): Promise<Chart>;
29
28
  copyToWorkspace(key: string, workspaceKey: string): Promise<Chart>;
30
29
  retrievePublishedVersionThumbnail(key: string): Promise<any>;
31
30
  retrieveDraftVersionThumbnail(key: string): Promise<any>;
@@ -95,10 +95,6 @@ var Charts = /** @class */ (function () {
95
95
  return this.client.post("charts/".concat(key, "/version/draft/actions/copy"))
96
96
  .then(function (res) { return new Chart_1.Chart(res.data); });
97
97
  };
98
- Charts.prototype.copyToSubaccount = function (key, subaccountId) {
99
- return this.client.post("charts/".concat(key, "/version/published/actions/copy-to/").concat(subaccountId))
100
- .then(function (res) { return new Chart_1.Chart(res.data); });
101
- };
102
98
  Charts.prototype.copyToWorkspace = function (key, workspaceKey) {
103
99
  return this.client.post("charts/".concat(key, "/version/published/actions/copy-to-workspace/").concat(workspaceKey))
104
100
  .then(function (res) { return new Chart_1.Chart(res.data); });
@@ -1,4 +1,5 @@
1
1
  import { Axios } from 'axios';
2
+ import { Channel } from './Channel';
2
3
  export declare class Channels {
3
4
  client: Axios;
4
5
  constructor(client: Axios);
@@ -8,5 +9,5 @@ export declare class Channels {
8
9
  update(eventKey: string, channelKey: string, newChannelName: any, newColor: any, newObjects: any): Promise<import("axios").AxiosResponse<any, any>>;
9
10
  addObjects(eventKey: string, channelKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any>>;
10
11
  removeObjects(eventKey: string, channelKey: string, objects: string[]): Promise<import("axios").AxiosResponse<any, any>>;
11
- replace(eventKey: string, channels: any): Promise<import("axios").AxiosResponse<any, any>>;
12
+ replace(eventKey: string, channels: Channel[]): Promise<import("axios").AxiosResponse<any, any>>;
12
13
  }
@@ -1,3 +1,6 @@
1
1
  import { AbstractEventParams } from './AbstractEventParams';
2
+ import { Channel } from './Channel';
2
3
  export declare class CreateEventParams extends AbstractEventParams {
4
+ channels?: Channel[];
5
+ withChannels(channels: Channel[]): this;
3
6
  }
@@ -22,6 +22,10 @@ var CreateEventParams = /** @class */ (function (_super) {
22
22
  function CreateEventParams() {
23
23
  return _super !== null && _super.apply(this, arguments) || this;
24
24
  }
25
+ CreateEventParams.prototype.withChannels = function (channels) {
26
+ this.channels = channels;
27
+ return this;
28
+ };
25
29
  return CreateEventParams;
26
30
  }(AbstractEventParams_1.AbstractEventParams));
27
31
  exports.CreateEventParams = CreateEventParams;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventObjectInfo = void 0;
4
4
  var helperFunctions_1 = require("../utilities/helperFunctions");
5
5
  var IDs_1 = require("../Common/IDs");
6
- var EventObjectInfo = exports.EventObjectInfo = /** @class */ (function () {
6
+ var EventObjectInfo = /** @class */ (function () {
7
7
  function EventObjectInfo(json) {
8
8
  this.label = json.label;
9
9
  this.labels = helperFunctions_1.HelperFunctions.labelCreator(json);
@@ -45,3 +45,4 @@ var EventObjectInfo = exports.EventObjectInfo = /** @class */ (function () {
45
45
  EventObjectInfo.HELD = 'reservedByToken';
46
46
  return EventObjectInfo;
47
47
  }());
48
+ exports.EventObjectInfo = EventObjectInfo;
@@ -72,6 +72,9 @@ var Events = /** @class */ (function () {
72
72
  if (params.date !== undefined) {
73
73
  requestParameters.date = params.date.toString();
74
74
  }
75
+ if (params.channels !== undefined) {
76
+ requestParameters.channels = params.channels;
77
+ }
75
78
  }
76
79
  return this.client.post('/events', requestParameters)
77
80
  .then(function (res) { return new EventDeserializer_1.EventDeserializer().fromJson(res.data); });
@@ -102,6 +105,9 @@ var Events = /** @class */ (function () {
102
105
  if (eventParams.date !== undefined) {
103
106
  eventRequest.date = eventParams.date.toString();
104
107
  }
108
+ if (eventParams.channels !== undefined) {
109
+ eventRequest.channels = eventParams.channels;
110
+ }
105
111
  requestParameters.events.push(eventRequest);
106
112
  }
107
113
  }
@@ -1,11 +1,14 @@
1
1
  import { TableBookingConfig } from '../Events/TableBookingConfig';
2
+ import { Channel } from '../Events/Channel';
2
3
  export declare class SeasonParams {
3
4
  _eventKeys?: string[];
4
5
  _key?: string;
5
6
  _numberOfEvents?: number;
6
7
  _tableBookingConfig?: TableBookingConfig;
8
+ _channels?: Channel[];
7
9
  key(key: string): this;
8
10
  numberOfEvents(numberOfEvents: number): this;
9
11
  eventKeys(eventKeys: string[]): this;
10
12
  tableBookingConfig(tableBookingConfig: TableBookingConfig): this;
13
+ channels(channels: Channel[]): this;
11
14
  }
@@ -20,6 +20,10 @@ var SeasonParams = /** @class */ (function () {
20
20
  this._tableBookingConfig = tableBookingConfig;
21
21
  return this;
22
22
  };
23
+ SeasonParams.prototype.channels = function (channels) {
24
+ this._channels = channels;
25
+ return this;
26
+ };
23
27
  return SeasonParams;
24
28
  }());
25
29
  exports.SeasonParams = SeasonParams;
@@ -49,18 +49,21 @@ var Seasons = /** @class */ (function () {
49
49
  var requestParameters = {};
50
50
  requestParameters.chartKey = chartKey;
51
51
  if (seasonParams !== null) {
52
- if (seasonParams._key !== null) {
52
+ if (seasonParams._key !== undefined) {
53
53
  requestParameters.key = seasonParams._key;
54
54
  }
55
- if (seasonParams._numberOfEvents !== null) {
55
+ if (seasonParams._numberOfEvents !== undefined) {
56
56
  requestParameters.numberOfEvents = seasonParams._numberOfEvents;
57
57
  }
58
- if (seasonParams._eventKeys !== null) {
58
+ if (seasonParams._eventKeys !== undefined) {
59
59
  requestParameters.eventKeys = seasonParams._eventKeys;
60
60
  }
61
- if (seasonParams._tableBookingConfig !== null) {
61
+ if (seasonParams._tableBookingConfig !== undefined) {
62
62
  requestParameters.tableBookingConfig = seasonParams._tableBookingConfig;
63
63
  }
64
+ if (seasonParams._channels !== undefined) {
65
+ requestParameters.channels = seasonParams._channels;
66
+ }
64
67
  }
65
68
  return this.client.post('/seasons', requestParameters)
66
69
  .then(function (res) { return new Season_1.Season(res.data); });
@@ -3,7 +3,6 @@ import { Users } from './Users/Users';
3
3
  import { Invitations } from './Invitations/Invitations';
4
4
  import { Charts } from './Charts/Charts';
5
5
  import { Events } from './Events/Events';
6
- import { Subaccounts } from './Subaccounts/Subaccounts';
7
6
  import { Workspaces } from './Workspaces/Workspaces';
8
7
  import { HoldTokens } from './HoldTokens/HoldTokens';
9
8
  import { ChartReports } from './Reports/ChartReports';
@@ -24,7 +23,6 @@ export declare class SeatsioClient {
24
23
  invitations: Invitations;
25
24
  requestListener: any;
26
25
  seasons: Seasons;
27
- subaccounts: Subaccounts;
28
26
  usageReports: UsageReports;
29
27
  users: Users;
30
28
  workspaces: Workspaces;
@@ -9,7 +9,6 @@ var Users_1 = require("./Users/Users");
9
9
  var Invitations_1 = require("./Invitations/Invitations");
10
10
  var Charts_1 = require("./Charts/Charts");
11
11
  var Events_1 = require("./Events/Events");
12
- var Subaccounts_1 = require("./Subaccounts/Subaccounts");
13
12
  var Workspaces_1 = require("./Workspaces/Workspaces");
14
13
  var HoldTokens_1 = require("./HoldTokens/HoldTokens");
15
14
  var ChartReports_1 = require("./Reports/ChartReports");
@@ -31,7 +30,6 @@ var SeatsioClient = /** @class */ (function () {
31
30
  this.errInterceptor = this.client.interceptors.response.use(function (response) { return response; }, errorInterceptor_1.errorResponseHandler);
32
31
  this.charts = new Charts_1.Charts(this.client);
33
32
  this.events = new Events_1.Events(this.client);
34
- this.subaccounts = new Subaccounts_1.Subaccounts(this.client);
35
33
  this.workspaces = new Workspaces_1.Workspaces(this.client);
36
34
  this.users = new Users_1.Users(this.client);
37
35
  this.invitations = new Invitations_1.Invitations(this.client);
@@ -40,8 +40,6 @@ export * from './Reports/UsageReports';
40
40
  export * from './Seasons/Season';
41
41
  export * from './Seasons/SeasonParams';
42
42
  export * from './Seasons/Seasons';
43
- export * from './Subaccounts/Subaccount';
44
- export * from './Subaccounts/Subaccounts';
45
43
  export * from './Users/User';
46
44
  export * from './Users/Users';
47
45
  export * from './Workspaces/Workspace';
package/dist/src/index.js CHANGED
@@ -56,8 +56,6 @@ __exportStar(require("./Reports/UsageReports"), exports);
56
56
  __exportStar(require("./Seasons/Season"), exports);
57
57
  __exportStar(require("./Seasons/SeasonParams"), exports);
58
58
  __exportStar(require("./Seasons/Seasons"), exports);
59
- __exportStar(require("./Subaccounts/Subaccount"), exports);
60
- __exportStar(require("./Subaccounts/Subaccounts"), exports);
61
59
  __exportStar(require("./Users/User"), exports);
62
60
  __exportStar(require("./Users/Users"), exports);
63
61
  __exportStar(require("./Workspaces/Workspace"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seatsio",
3
- "version": "77.3.0",
3
+ "version": "78.0.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [
@@ -18,24 +18,24 @@
18
18
  "url": "https://github.com/seatsio/seatsio-js"
19
19
  },
20
20
  "dependencies": {
21
- "axios": "1.4.0"
21
+ "axios": "1.5.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@jest/globals": "29.6.2",
25
- "@types/jest": "29.5.3",
26
- "@types/node": "20.4.8",
27
- "@types/uuid": "9.0.2",
24
+ "@jest/globals": "29.6.4",
25
+ "@types/jest": "29.5.4",
26
+ "@types/node": "20.5.9",
27
+ "@types/uuid": "9.0.3",
28
28
  "@typescript-eslint/eslint-plugin": "5.62.0",
29
29
  "@typescript-eslint/parser": "5.62.0",
30
- "eslint": "8.46.0",
30
+ "eslint": "8.48.0",
31
31
  "eslint-config-standard": "17.1.0",
32
- "eslint-plugin-import": "2.28.0",
33
- "eslint-plugin-n": "16.0.1",
32
+ "eslint-plugin-import": "2.28.1",
33
+ "eslint-plugin-n": "16.0.2",
34
34
  "eslint-plugin-promise": "6.1.1",
35
- "jest": "29.6.2",
36
- "jest-cli": "29.6.2",
35
+ "jest": "29.6.4",
36
+ "jest-cli": "29.6.4",
37
37
  "ts-jest": "29.1.1",
38
- "typescript": "5.1.6",
38
+ "typescript": "5.2.2",
39
39
  "ctix": "1.8.2",
40
40
  "uuid": "9.0.0"
41
41
  }
@@ -1,11 +0,0 @@
1
- import { Dict } from '../Dict';
2
- export type SubaccountJson = Dict<any>;
3
- export declare class Subaccount {
4
- active: boolean;
5
- designerKey: string;
6
- id: number;
7
- name: string;
8
- publicKey: string;
9
- secretKey: string;
10
- constructor(json: SubaccountJson);
11
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Subaccount = void 0;
4
- var Subaccount = /** @class */ (function () {
5
- function Subaccount(json) {
6
- this.id = json.id;
7
- this.secretKey = json.secretKey;
8
- this.designerKey = json.designerKey;
9
- this.publicKey = json.publicKey;
10
- this.name = json.name;
11
- this.active = json.active;
12
- }
13
- return Subaccount;
14
- }());
15
- exports.Subaccount = Subaccount;
@@ -1,25 +0,0 @@
1
- import { Lister } from '../Lister';
2
- import { Subaccount, SubaccountJson } from './Subaccount';
3
- import { Page } from '../Page';
4
- import { Chart } from '../Charts/Chart';
5
- import { Axios } from 'axios';
6
- export declare class Subaccounts {
7
- active: Lister<Subaccount, SubaccountJson>;
8
- client: Axios;
9
- inactive: Lister<Subaccount, SubaccountJson>;
10
- constructor(client: Axios);
11
- retrieve(id: number): Promise<Subaccount>;
12
- create(name?: string | null): Promise<Subaccount>;
13
- update(id: number, name?: string | null): Promise<import("axios").AxiosResponse<any, any>>;
14
- activate(id: number): Promise<import("axios").AxiosResponse<any, any>>;
15
- deactivate(id: number): Promise<import("axios").AxiosResponse<any, any>>;
16
- regenerateSecretKey(id: number): Promise<any>;
17
- regenerateDesignerKey(id: number): Promise<any>;
18
- copyChartToParent(id: number, chartKey: string): Promise<Chart>;
19
- copyChartToSubaccount(fromId: number, toId: number, chartKey: string): Promise<Chart>;
20
- listAll(filter?: string | null): import("..").AsyncIterator<Subaccount>;
21
- listFirstPage(filter?: string | null, pageSize?: number | null): Promise<Page<Subaccount>>;
22
- listPageAfter(afterId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Subaccount>>;
23
- listPageBefore(beforeId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Subaccount>>;
24
- iterator(): Lister<Subaccount, SubaccountJson>;
25
- }
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Subaccounts = void 0;
4
- var Lister_1 = require("../Lister");
5
- var Subaccount_1 = require("./Subaccount");
6
- var Page_1 = require("../Page");
7
- var Chart_1 = require("../Charts/Chart");
8
- var Subaccounts = /** @class */ (function () {
9
- function Subaccounts(client) {
10
- this.client = client;
11
- this.active = new Lister_1.Lister('/subaccounts/active', this.client, 'subaccounts', function (data) {
12
- var subaccounts = data.items.map(function (subaccountsData) { return new Subaccount_1.Subaccount(subaccountsData); });
13
- return new Page_1.Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before);
14
- });
15
- this.inactive = new Lister_1.Lister('/subaccounts/inactive', this.client, 'subaccounts', function (data) {
16
- var subaccounts = data.items.map(function (subaccountsData) { return new Subaccount_1.Subaccount(subaccountsData); });
17
- return new Page_1.Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before);
18
- });
19
- }
20
- Subaccounts.prototype.retrieve = function (id) {
21
- return this.client.get("/subaccounts/".concat(id)).then(function (res) { return new Subaccount_1.Subaccount(res.data); });
22
- };
23
- Subaccounts.prototype.create = function (name) {
24
- if (name === void 0) { name = null; }
25
- var requestParameters = {};
26
- if (name !== null) {
27
- requestParameters.name = name;
28
- }
29
- return this.client.post('/subaccounts', requestParameters)
30
- .then(function (res) { return new Subaccount_1.Subaccount(res.data); });
31
- };
32
- Subaccounts.prototype.update = function (id, name) {
33
- if (name === void 0) { name = null; }
34
- var requestParameters = {};
35
- if (name !== null) {
36
- requestParameters.name = name;
37
- }
38
- return this.client.post("/subaccounts/".concat(id), requestParameters);
39
- };
40
- Subaccounts.prototype.activate = function (id) {
41
- return this.client.post("/subaccounts/".concat(id, "/actions/activate"));
42
- };
43
- Subaccounts.prototype.deactivate = function (id) {
44
- return this.client.post("/subaccounts/".concat(id, "/actions/deactivate"));
45
- };
46
- Subaccounts.prototype.regenerateSecretKey = function (id) {
47
- return this.client.post("/subaccounts/".concat(id, "/secret-key/actions/regenerate")).then(function (res) { return res.data; });
48
- };
49
- Subaccounts.prototype.regenerateDesignerKey = function (id) {
50
- return this.client.post("/subaccounts/".concat(id, "/designer-key/actions/regenerate")).then(function (res) { return res.data; });
51
- };
52
- Subaccounts.prototype.copyChartToParent = function (id, chartKey) {
53
- return this.client.post("/subaccounts/".concat(id, "/charts/").concat(chartKey, "/actions/copy-to/parent"))
54
- .then(function (res) { return new Chart_1.Chart(res.data); });
55
- };
56
- Subaccounts.prototype.copyChartToSubaccount = function (fromId, toId, chartKey) {
57
- return this.client.post("/subaccounts/".concat(fromId, "/charts/").concat(chartKey, "/actions/copy-to/").concat(toId))
58
- .then(function (res) { return new Chart_1.Chart(res.data); });
59
- };
60
- Subaccounts.prototype.listAll = function (filter) {
61
- if (filter === void 0) { filter = null; }
62
- var requestParameters = filter !== null ? { filter: filter } : {};
63
- return this.iterator().all(requestParameters);
64
- };
65
- Subaccounts.prototype.listFirstPage = function (filter, pageSize) {
66
- if (filter === void 0) { filter = null; }
67
- if (pageSize === void 0) { pageSize = null; }
68
- var requestParameters = filter !== null ? { filter: filter } : null;
69
- return this.iterator().firstPage(requestParameters, pageSize);
70
- };
71
- Subaccounts.prototype.listPageAfter = function (afterId, filter, pageSize) {
72
- if (filter === void 0) { filter = null; }
73
- if (pageSize === void 0) { pageSize = null; }
74
- var requestParameters = filter !== null ? { filter: filter } : null;
75
- return this.iterator().pageAfter(afterId, requestParameters, pageSize);
76
- };
77
- Subaccounts.prototype.listPageBefore = function (beforeId, filter, pageSize) {
78
- if (filter === void 0) { filter = null; }
79
- if (pageSize === void 0) { pageSize = null; }
80
- var requestParameters = filter !== null ? { filter: filter } : null;
81
- return this.iterator().pageBefore(beforeId, requestParameters, pageSize);
82
- };
83
- Subaccounts.prototype.iterator = function () {
84
- return new Lister_1.Lister('/subaccounts', this.client, 'subaccounts', function (data) {
85
- var subaccounts = data.items.map(function (subaccountsData) { return new Subaccount_1.Subaccount(subaccountsData); });
86
- return new Page_1.Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before);
87
- });
88
- };
89
- return Subaccounts;
90
- }());
91
- exports.Subaccounts = Subaccounts;