seatsio 75.0.0 → 76.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.
Files changed (97) hide show
  1. package/dist/src/Accounts/Account.d.ts +14 -0
  2. package/dist/src/Accounts/Account.js +8 -8
  3. package/dist/src/Accounts/AccountSettings.d.ts +13 -0
  4. package/dist/src/Accounts/Accounts.d.ts +14 -0
  5. package/dist/src/Accounts/ChartValidationSettings.d.ts +12 -0
  6. package/dist/src/Accounts/ChartValidationSettings.js +7 -7
  7. package/dist/src/Accounts/DefaultRendererSettings.d.ts +8 -0
  8. package/dist/src/Accounts/DefaultRendererSettings.js +3 -3
  9. package/dist/src/AsyncIterator.d.ts +42 -0
  10. package/dist/src/AsyncIterator.js +20 -6
  11. package/dist/src/Charts/Category.d.ts +15 -0
  12. package/dist/src/Charts/Category.js +0 -1
  13. package/dist/src/Charts/Chart.d.ts +20 -0
  14. package/dist/src/Charts/Chart.js +0 -1
  15. package/dist/src/Charts/ChartListParams.d.ts +19 -0
  16. package/dist/src/Charts/ChartListParams.js +2 -14
  17. package/dist/src/Charts/ChartObjectInfo.d.ts +21 -0
  18. package/dist/src/Charts/ChartObjectInfo.js +15 -15
  19. package/dist/src/Charts/ChartValidation.d.ts +6 -0
  20. package/dist/src/Charts/ChartValidation.js +3 -3
  21. package/dist/src/Charts/Charts.d.ts +41 -0
  22. package/dist/src/Charts/Charts.js +9 -14
  23. package/dist/src/Charts/SocialDistancingRuleset.d.ts +58 -0
  24. package/dist/src/Charts/SocialDistancingRuleset.js +31 -67
  25. package/dist/src/Common/IDs.d.ts +6 -0
  26. package/dist/src/Common/LabelAndType.d.ts +5 -0
  27. package/dist/src/Common/LabelAndType.js +11 -0
  28. package/dist/src/Common/Labels.d.ts +9 -0
  29. package/dist/src/Common/Labels.js +2 -11
  30. package/dist/src/Dict.d.ts +3 -0
  31. package/dist/src/Dict.js +2 -0
  32. package/dist/src/Events/BestAvailableObjects.d.ts +7 -0
  33. package/dist/src/Events/BestAvailableObjects.js +4 -4
  34. package/dist/src/Events/ChangeObjectStatusResult.d.ts +6 -0
  35. package/dist/src/Events/Channel.d.ts +10 -0
  36. package/dist/src/Events/Channel.js +6 -6
  37. package/dist/src/Events/Channels.d.ts +12 -0
  38. package/dist/src/Events/Event.d.ts +26 -0
  39. package/dist/src/Events/EventDeserializer.d.ts +4 -0
  40. package/dist/src/Events/EventDeserializer.js +4 -4
  41. package/dist/src/Events/EventObjectInfo.d.ts +42 -0
  42. package/dist/src/Events/EventObjectInfo.js +33 -33
  43. package/dist/src/Events/Events.d.ts +54 -0
  44. package/dist/src/Events/Events.js +6 -63
  45. package/dist/src/Events/ForSaleConfig.d.ts +8 -0
  46. package/dist/src/Events/ObjectProperties.d.ts +10 -0
  47. package/dist/src/Events/StatusChange.d.ts +19 -0
  48. package/dist/src/Events/StatusChange.js +14 -14
  49. package/dist/src/Events/StatusChangeOrigin.d.ts +8 -0
  50. package/dist/src/Events/StatusChangeOrigin.js +11 -0
  51. package/dist/src/Events/StatusChangeRequest.d.ts +14 -0
  52. package/dist/src/Events/StatusChangesParams.d.ts +18 -0
  53. package/dist/src/Events/StatusChangesParams.js +0 -3
  54. package/dist/src/Events/TableBookingConfig.d.ts +15 -0
  55. package/dist/src/Events/TableBookingConfig.js +0 -3
  56. package/dist/src/HoldTokens/HoldToken.d.ts +10 -0
  57. package/dist/src/HoldTokens/HoldToken.js +5 -5
  58. package/dist/src/HoldTokens/HoldTokens.d.ts +9 -0
  59. package/dist/src/HoldTokens/HoldTokens.js +0 -2
  60. package/dist/src/Invitations/Invitation.d.ts +9 -0
  61. package/dist/src/Invitations/Invitations.d.ts +6 -0
  62. package/dist/src/Lister.d.ts +16 -0
  63. package/dist/src/Lister.js +14 -11
  64. package/dist/src/Page.d.ts +15 -0
  65. package/dist/src/PageFetcher.d.ts +12 -0
  66. package/dist/src/PageFetcher.js +3 -0
  67. package/dist/src/Region.d.ts +9 -0
  68. package/dist/src/Reports/ChartReports.d.ts +16 -0
  69. package/dist/src/Reports/ChartReports.js +0 -9
  70. package/dist/src/Reports/EventReports.d.ts +35 -0
  71. package/dist/src/Reports/UsageReports.d.ts +10 -0
  72. package/dist/src/Seasons/Season.d.ts +9 -0
  73. package/dist/src/Seasons/SeasonParams.d.ts +13 -0
  74. package/dist/src/Seasons/Seasons.d.ts +15 -0
  75. package/dist/src/Seasons/Seasons.js +0 -15
  76. package/dist/src/SeatsioClient.d.ts +44 -0
  77. package/dist/src/SeatsioClient.js +6 -6
  78. package/dist/src/Subaccounts/Subaccount.d.ts +11 -0
  79. package/dist/src/Subaccounts/Subaccount.js +7 -7
  80. package/dist/src/Subaccounts/Subaccounts.d.ts +25 -0
  81. package/dist/src/Subaccounts/Subaccounts.js +0 -2
  82. package/dist/src/Users/User.d.ts +15 -0
  83. package/dist/src/Users/User.js +11 -11
  84. package/dist/src/Users/Users.d.ts +18 -0
  85. package/dist/src/Users/Users.js +0 -1
  86. package/dist/src/Workspaces/Workspace.d.ts +13 -0
  87. package/dist/src/Workspaces/Workspace.js +9 -9
  88. package/dist/src/Workspaces/Workspaces.d.ts +30 -0
  89. package/dist/src/errorInterceptor.d.ts +1 -0
  90. package/dist/src/errorInterceptor.js +7 -7
  91. package/dist/src/index.d.ts +50 -0
  92. package/dist/src/index.js +93 -9
  93. package/dist/src/utilities/helperFunctions.d.ts +4 -0
  94. package/dist/src/utilities/helperFunctions.js +7 -6
  95. package/dist/src/utilities/reportUtility.d.ts +8 -0
  96. package/dist/src/utilities/reportUtility.js +0 -3
  97. package/package.json +2 -2
@@ -0,0 +1,14 @@
1
+ import { AccountSettings } from './AccountSettings';
2
+ import { Dict } from '../Dict';
3
+ type AccountJson = Dict<any>;
4
+ export declare class Account {
5
+ company: any;
6
+ designerKey: string;
7
+ email: string;
8
+ publicKey: string;
9
+ role: string;
10
+ secretKey: string;
11
+ settings: AccountSettings;
12
+ constructor(json: AccountJson);
13
+ }
14
+ export {};
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Account = void 0;
4
4
  var AccountSettings_1 = require("./AccountSettings");
5
5
  var Account = /** @class */ (function () {
6
- function Account(account) {
7
- this.secretKey = account.secretKey;
8
- this.designerKey = account.designerKey;
9
- this.publicKey = account.publicKey;
10
- this.settings = new AccountSettings_1.AccountSettings(account.settings);
11
- this.company = account.company;
12
- this.email = account.email;
13
- this.role = account.role;
6
+ function Account(json) {
7
+ this.secretKey = json.secretKey;
8
+ this.designerKey = json.designerKey;
9
+ this.publicKey = json.publicKey;
10
+ this.settings = new AccountSettings_1.AccountSettings(json.settings);
11
+ this.company = json.company;
12
+ this.email = json.email;
13
+ this.role = json.role;
14
14
  }
15
15
  return Account;
16
16
  }());
@@ -0,0 +1,13 @@
1
+ import { ChartValidationSettings } from './ChartValidationSettings';
2
+ import { DefaultRendererSettings } from './DefaultRendererSettings';
3
+ import { Dict } from '../Dict';
4
+ type AccountSettingsJson = Dict<any>;
5
+ export declare class AccountSettings {
6
+ chartValidation: ChartValidationSettings;
7
+ defaultRendererSettings: DefaultRendererSettings;
8
+ draftChartDrawingsEnabled: boolean;
9
+ holdOnSelectForGAs: boolean;
10
+ holdPeriodInMinutes: number;
11
+ constructor(settings: AccountSettingsJson);
12
+ }
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import { Account } from './Account';
2
+ import { Axios } from 'axios';
3
+ export declare class Accounts {
4
+ private client;
5
+ constructor(client: Axios);
6
+ retrieveMyAccount(): Promise<Account>;
7
+ regenerateSecretKey(): Promise<any>;
8
+ regenerateDesignerKey(): Promise<any>;
9
+ enableDraftChartDrawings(): Promise<import("axios").AxiosResponse<any, any>>;
10
+ disableDraftChartDrawings(): Promise<import("axios").AxiosResponse<any, any>>;
11
+ changePassword(password: string): Promise<import("axios").AxiosResponse<any, any>>;
12
+ changeHoldPeriod(holdPeriodInMinutes: number): Promise<import("axios").AxiosResponse<any, any>>;
13
+ updateSetting(key: string, value: string): Promise<import("axios").AxiosResponse<any, any>>;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { Dict } from '../Dict';
2
+ type ChartValidationSettingsJson = Dict<any>;
3
+ export declare class ChartValidationSettings {
4
+ VALIDATE_DUPLICATE_LABELS: string;
5
+ VALIDATE_EMPTY_FLOOR: string;
6
+ VALIDATE_FOCAL_POINT: string;
7
+ VALIDATE_OBJECTS_WITHOUT_CATEGORIES: string;
8
+ VALIDATE_OBJECT_TYPES_PER_CATEGORY: string;
9
+ VALIDATE_UNLABELED_OBJECTS: string;
10
+ constructor(json: ChartValidationSettingsJson);
11
+ }
12
+ export {};
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChartValidationSettings = void 0;
4
4
  var ChartValidationSettings = /** @class */ (function () {
5
- function ChartValidationSettings(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;
5
+ function ChartValidationSettings(json) {
6
+ this.VALIDATE_DUPLICATE_LABELS = json.VALIDATE_DUPLICATE_LABELS;
7
+ this.VALIDATE_OBJECTS_WITHOUT_CATEGORIES = json.VALIDATE_OBJECTS_WITHOUT_CATEGORIES;
8
+ this.VALIDATE_UNLABELED_OBJECTS = json.VALIDATE_UNLABELED_OBJECTS;
9
+ this.VALIDATE_FOCAL_POINT = json.VALIDATE_FOCAL_POINT;
10
+ this.VALIDATE_OBJECT_TYPES_PER_CATEGORY = json.VALIDATE_OBJECT_TYPES_PER_CATEGORY;
11
+ this.VALIDATE_EMPTY_FLOOR = json.VALIDATE_EMPTY_FLOOR;
12
12
  }
13
13
  return ChartValidationSettings;
14
14
  }());
@@ -0,0 +1,8 @@
1
+ import { Dict } from '../Dict';
2
+ type DefaultRendererSettingsJson = Dict<any>;
3
+ export declare class DefaultRendererSettings {
4
+ multiSelectEnabled: boolean;
5
+ showFullScreenButton: boolean;
6
+ constructor(json: DefaultRendererSettingsJson);
7
+ }
8
+ export {};
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultRendererSettings = void 0;
4
4
  var DefaultRendererSettings = /** @class */ (function () {
5
- function DefaultRendererSettings(defaultRendererSettings) {
6
- this.showFullScreenButton = defaultRendererSettings.showFullScreenButton;
7
- this.multiSelectEnabled = defaultRendererSettings.multiSelectEnabled;
5
+ function DefaultRendererSettings(json) {
6
+ this.showFullScreenButton = json.showFullScreenButton;
7
+ this.multiSelectEnabled = json.multiSelectEnabled;
8
8
  }
9
9
  return DefaultRendererSettings;
10
10
  }());
@@ -0,0 +1,42 @@
1
+ import { SeasonJson } from './Seasons/Season';
2
+ import { ChartJson } from './Charts/Chart';
3
+ import { Page } from './Page';
4
+ import { StatusChangeJson } from './Events/StatusChange';
5
+ import { SubaccountJson } from './Subaccounts/Subaccount';
6
+ import { WorkspaceJson } from './Workspaces/Workspace';
7
+ import { UserJson } from './Users/User';
8
+ import { EventJson } from './Events/Event';
9
+ import { Axios } from 'axios';
10
+ export interface PaginatedJson<T> {
11
+ items: T[];
12
+ next_page_starts_after?: number;
13
+ previous_page_ends_before?: number;
14
+ }
15
+ interface PaginationParams {
16
+ start_after_id?: number;
17
+ end_before_id?: number;
18
+ }
19
+ export declare class AsyncIterator<T> {
20
+ client: Axios;
21
+ index: number;
22
+ items: T[];
23
+ nextPageMustBeFetched: boolean;
24
+ nextPageStartsAfter?: number;
25
+ objType: string;
26
+ pages: Page<T>[];
27
+ params: PaginationParams;
28
+ url: string;
29
+ constructor(url: string, client: Axios, objType: string, params?: {});
30
+ charts(json: PaginatedJson<ChartJson>): void;
31
+ events(data: PaginatedJson<EventJson>): void;
32
+ seasons(data: PaginatedJson<SeasonJson>): void;
33
+ statusChanges(data: PaginatedJson<StatusChangeJson>): void;
34
+ subaccounts(data: PaginatedJson<SubaccountJson>): void;
35
+ workspaces(data: PaginatedJson<WorkspaceJson>): void;
36
+ users(data: PaginatedJson<UserJson>): void;
37
+ fetch(fetchParams?: {}): Promise<void>;
38
+ [Symbol.asyncIterator](): {
39
+ next(): Promise<any>;
40
+ };
41
+ }
42
+ export {};
@@ -57,24 +57,28 @@ var AsyncIterator = /** @class */ (function () {
57
57
  this.index = 0;
58
58
  this.nextPageMustBeFetched = true;
59
59
  }
60
- AsyncIterator.prototype.charts = function (data) {
60
+ AsyncIterator.prototype.charts = function (json) {
61
61
  var _this_1 = this;
62
62
  var charts = [];
63
- data.items.forEach(function (chartData) {
63
+ json.items.forEach(function (chartData) {
64
64
  var chart = new Chart_1.Chart(chartData);
65
+ // @ts-ignore
65
66
  _this_1.items.push(chart);
66
67
  charts.push(chart);
67
68
  });
68
- this.pages.push(new Page_1.Page(charts, data.next_page_starts_after, data.previous_page_ends_before));
69
+ // @ts-ignore
70
+ this.pages.push(new Page_1.Page(charts, json.next_page_starts_after, json.previous_page_ends_before));
69
71
  };
70
72
  AsyncIterator.prototype.events = function (data) {
71
73
  var _this_1 = this;
72
74
  var events = [];
73
75
  data.items.forEach(function (eventData) {
74
76
  var event = new EventDeserializer_1.EventDeserializer().fromJson(eventData);
77
+ // @ts-ignore
75
78
  _this_1.items.push(event);
76
79
  events.push(event);
77
80
  });
81
+ // @ts-ignore
78
82
  this.pages.push(new Page_1.Page(events, data.next_page_starts_after, data.previous_page_ends_before));
79
83
  };
80
84
  AsyncIterator.prototype.seasons = function (data) {
@@ -82,19 +86,23 @@ var AsyncIterator = /** @class */ (function () {
82
86
  var seasons = [];
83
87
  data.items.forEach(function (seasonData) {
84
88
  var season = new Season_1.Season(seasonData);
89
+ // @ts-ignore
85
90
  _this_1.items.push(season);
86
91
  seasons.push(season);
87
92
  });
93
+ // @ts-ignore
88
94
  this.pages.push(new Page_1.Page(seasons, data.next_page_starts_after, data.previous_page_ends_before));
89
95
  };
90
96
  AsyncIterator.prototype.statusChanges = function (data) {
91
97
  var _this_1 = this;
92
98
  var statusChanges = [];
93
99
  data.items.forEach(function (statusData) {
94
- var status = new StatusChange_1.StatusChange(statusData);
95
- _this_1.items.push(status);
96
- statusChanges.push(status);
100
+ var statusChange = new StatusChange_1.StatusChange(statusData);
101
+ // @ts-ignore
102
+ _this_1.items.push(statusChange);
103
+ statusChanges.push(statusChange);
97
104
  });
105
+ // @ts-ignore
98
106
  this.pages.push(new Page_1.Page(statusChanges, data.next_page_starts_after, data.previous_page_ends_before));
99
107
  };
100
108
  AsyncIterator.prototype.subaccounts = function (data) {
@@ -102,9 +110,11 @@ var AsyncIterator = /** @class */ (function () {
102
110
  var subaccounts = [];
103
111
  data.items.forEach(function (subaccountData) {
104
112
  var subaccount = new Subaccount_1.Subaccount(subaccountData);
113
+ // @ts-ignore
105
114
  _this_1.items.push(subaccount);
106
115
  subaccounts.push(subaccount);
107
116
  });
117
+ // @ts-ignore
108
118
  this.pages.push(new Page_1.Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before));
109
119
  };
110
120
  AsyncIterator.prototype.workspaces = function (data) {
@@ -112,9 +122,11 @@ var AsyncIterator = /** @class */ (function () {
112
122
  var workspaces = [];
113
123
  data.items.forEach(function (json) {
114
124
  var workspace = new Workspace_1.Workspace(json);
125
+ // @ts-ignore
115
126
  _this_1.items.push(workspace);
116
127
  workspaces.push(workspace);
117
128
  });
129
+ // @ts-ignore
118
130
  this.pages.push(new Page_1.Page(workspaces, data.next_page_starts_after, data.previous_page_ends_before));
119
131
  };
120
132
  AsyncIterator.prototype.users = function (data) {
@@ -122,9 +134,11 @@ var AsyncIterator = /** @class */ (function () {
122
134
  var users = [];
123
135
  data.items.forEach(function (userData) {
124
136
  var user = new User_1.User(userData);
137
+ // @ts-ignore
125
138
  _this_1.items.push(user);
126
139
  users.push(user);
127
140
  });
141
+ // @ts-ignore
128
142
  this.pages.push(new Page_1.Page(users, data.next_page_starts_after, data.previous_page_ends_before));
129
143
  };
130
144
  AsyncIterator.prototype.fetch = function (fetchParams) {
@@ -0,0 +1,15 @@
1
+ import { Dict } from '../Dict';
2
+ export type CategoryJson = Dict<any>;
3
+ export type CategoryKey = string | number;
4
+ export declare class Category {
5
+ accessible: boolean;
6
+ color: string;
7
+ key: CategoryKey;
8
+ label: string;
9
+ constructor(key: string | number, label: string, color: string, accessible: boolean);
10
+ setKey(key: string | number): this;
11
+ setLabel(label: string): this;
12
+ setColor(color: string): this;
13
+ setAccessible(accessible: boolean): this;
14
+ static fromJson(json: CategoryJson): Category;
15
+ }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Category = void 0;
4
4
  var Category = /** @class */ (function () {
5
5
  function Category(key, label, color, accessible) {
6
- if (accessible === void 0) { accessible = false; }
7
6
  this.key = key;
8
7
  this.label = label;
9
8
  this.color = color;
@@ -0,0 +1,20 @@
1
+ import { ChartValidation } from './ChartValidation';
2
+ import { SocialDistancingRuleset, SocialDistancingRulesetJson } from './SocialDistancingRuleset';
3
+ import { Event } from '../Events/Event';
4
+ import { Dict } from '../Dict';
5
+ export type ChartJson = Dict<any>;
6
+ export declare class Chart {
7
+ archived: boolean;
8
+ draftVersionThumbnailUrl: string | null;
9
+ events: Event[];
10
+ id: number;
11
+ key: string;
12
+ name: string;
13
+ publishedVersionThumbnailUrl: string;
14
+ socialDistancingRulesets?: Dict<SocialDistancingRuleset>;
15
+ status: string;
16
+ tags: string[];
17
+ validation?: ChartValidation;
18
+ constructor(chart: ChartJson);
19
+ static socialDistancingRulesetsFromJson(json: SocialDistancingRulesetJson): Dict<SocialDistancingRuleset> | undefined;
20
+ }
@@ -25,7 +25,6 @@ var Chart = /** @class */ (function () {
25
25
  }
26
26
  var result = {};
27
27
  for (var key in json) {
28
- // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
29
28
  result[key] = SocialDistancingRuleset_1.SocialDistancingRuleset.fromJson(json[key]);
30
29
  }
31
30
  return result;
@@ -0,0 +1,19 @@
1
+ export declare class ChartListParams {
2
+ eventsLimit?: number;
3
+ expand?: string;
4
+ filter?: string;
5
+ tag?: string;
6
+ validation?: boolean;
7
+ withFilter(filter: string): this;
8
+ withTag(tag: string): this;
9
+ withExpandEvents(expandEvents: boolean): this;
10
+ withEventsLimit(eventsLimit: number): this;
11
+ withValidation(validation: boolean): this;
12
+ serialize(): {
13
+ tag: string | undefined;
14
+ expand: string | undefined;
15
+ filter: string | undefined;
16
+ validation: boolean | undefined;
17
+ eventsLimit: number | undefined;
18
+ };
19
+ }
@@ -2,19 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChartListParams = void 0;
4
4
  var ChartListParams = /** @class */ (function () {
5
- function ChartListParams(filter, tag, expandEvents, withValidation, eventsLimit) {
6
- if (filter === void 0) { filter = null; }
7
- if (tag === void 0) { tag = null; }
8
- if (expandEvents === void 0) { expandEvents = null; }
9
- if (withValidation === void 0) { withValidation = false; }
10
- if (eventsLimit === void 0) { eventsLimit = null; }
11
- this.filter = filter;
12
- this.tag = tag;
13
- this.validation = withValidation;
14
- this.eventsLimit = eventsLimit;
15
- if (expandEvents === true) {
16
- this.expand = 'events';
17
- }
5
+ function ChartListParams() {
18
6
  }
19
7
  ChartListParams.prototype.withFilter = function (filter) {
20
8
  this.filter = filter;
@@ -25,7 +13,7 @@ var ChartListParams = /** @class */ (function () {
25
13
  return this;
26
14
  };
27
15
  ChartListParams.prototype.withExpandEvents = function (expandEvents) {
28
- if (expandEvents === true) {
16
+ if (expandEvents) {
29
17
  this.expand = 'events';
30
18
  }
31
19
  return this;
@@ -0,0 +1,21 @@
1
+ import { IDs } from '../Common/IDs';
2
+ import { Labels } from '../Common/Labels';
3
+ import { Dict } from '../Dict';
4
+ export type ChartObjectInfoJson = Dict<any>;
5
+ export declare class ChartObjectInfo {
6
+ bookAsAWhole?: boolean;
7
+ capacity?: number;
8
+ categoryKey?: string;
9
+ categoryLabel: string;
10
+ distanceToFocalPoint?: number;
11
+ entrance?: string;
12
+ ids: IDs;
13
+ label: string;
14
+ labels: Labels;
15
+ leftNeighbour?: string;
16
+ numSeats?: number;
17
+ objectType: string;
18
+ rightNeighbour?: string;
19
+ section?: string;
20
+ constructor(json: ChartObjectInfoJson);
21
+ }
@@ -4,21 +4,21 @@ exports.ChartObjectInfo = void 0;
4
4
  var helperFunctions_1 = require("../utilities/helperFunctions");
5
5
  var IDs_1 = require("../Common/IDs");
6
6
  var ChartObjectInfo = /** @class */ (function () {
7
- function ChartObjectInfo(chartReport) {
8
- this.label = chartReport.label;
9
- this.labels = helperFunctions_1.HelperFunctions.labelCreator(chartReport);
10
- this.ids = new IDs_1.IDs(chartReport.ids.own, chartReport.ids.parent, chartReport.ids.section);
11
- this.categoryLabel = chartReport.categoryLabel;
12
- this.categoryKey = chartReport.categoryKey;
13
- this.entrance = chartReport.entrance;
14
- this.objectType = chartReport.objectType;
15
- this.section = chartReport.section;
16
- this.capacity = chartReport.capacity;
17
- this.bookAsAWhole = chartReport.bookAsAWhole;
18
- this.leftNeighbour = chartReport.leftNeighbour;
19
- this.rightNeighbour = chartReport.rightNeighbour;
20
- this.distanceToFocalPoint = chartReport.distanceToFocalPoint;
21
- this.numSeats = chartReport.numSeats;
7
+ function ChartObjectInfo(json) {
8
+ this.label = json.label;
9
+ this.labels = helperFunctions_1.HelperFunctions.labelCreator(json);
10
+ this.ids = new IDs_1.IDs(json.ids.own, json.ids.parent, json.ids.section);
11
+ this.categoryLabel = json.categoryLabel;
12
+ this.categoryKey = json.categoryKey;
13
+ this.entrance = json.entrance;
14
+ this.objectType = json.objectType;
15
+ this.section = json.section;
16
+ this.capacity = json.capacity;
17
+ this.bookAsAWhole = json.bookAsAWhole;
18
+ this.leftNeighbour = json.leftNeighbour;
19
+ this.rightNeighbour = json.rightNeighbour;
20
+ this.distanceToFocalPoint = json.distanceToFocalPoint;
21
+ this.numSeats = json.numSeats;
22
22
  }
23
23
  return ChartObjectInfo;
24
24
  }());
@@ -0,0 +1,6 @@
1
+ import { Dict } from '../Dict';
2
+ export declare class ChartValidation {
3
+ errors: string[];
4
+ warnings: string[];
5
+ constructor(json: Dict<any>);
6
+ }
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChartValidation = void 0;
4
4
  var ChartValidation = /** @class */ (function () {
5
- function ChartValidation(validation) {
6
- this.errors = validation.errors;
7
- this.warnings = validation.warnings;
5
+ function ChartValidation(json) {
6
+ this.errors = json.errors;
7
+ this.warnings = json.warnings;
8
8
  }
9
9
  return ChartValidation;
10
10
  }());
@@ -0,0 +1,41 @@
1
+ import { Lister } from '../Lister';
2
+ import { Page } from '../Page';
3
+ import { Chart, ChartJson } from './Chart';
4
+ import { Axios } from 'axios';
5
+ import { ChartListParams } from './ChartListParams';
6
+ import { CategoryJson, CategoryKey } from './Category';
7
+ export declare class Charts {
8
+ archive: Lister<Chart, ChartJson>;
9
+ client: Axios;
10
+ constructor(client: Axios);
11
+ create(name?: string | null, venueType?: string | null, categories?: CategoryJson[] | null): Promise<Chart>;
12
+ update(key: string, name?: string | null, categories?: CategoryJson[] | null): Promise<import("axios").AxiosResponse<any, any>>;
13
+ addCategory(key: string, category: CategoryJson): Promise<import("axios").AxiosResponse<any, any>>;
14
+ removeCategory(chartKey: string, categoryKey: CategoryKey): Promise<import("axios").AxiosResponse<any, any>>;
15
+ listCategories(key: string): Promise<any>;
16
+ validatePublishedVersion(key: string): Promise<any>;
17
+ validateDraftVersion(key: string): Promise<any>;
18
+ retrieve(key: string): Promise<Chart>;
19
+ retrieveWithEvents(key: string): Promise<Chart>;
20
+ retrievePublishedVersion(key: string): Promise<any>;
21
+ retrieveDraftVersion(key: string): Promise<any>;
22
+ publishDraftVersion(key: string): Promise<import("axios").AxiosResponse<any, any>>;
23
+ discardDraftVersion(key: string): Promise<import("axios").AxiosResponse<any, any>>;
24
+ moveToArchive(key: string): Promise<import("axios").AxiosResponse<any, any>>;
25
+ moveOutOfArchive(key: string): Promise<import("axios").AxiosResponse<any, any>>;
26
+ copy(key: string): Promise<Chart>;
27
+ copyDraftVersion(key: string): Promise<Chart>;
28
+ copyToSubaccount(key: string, subaccountId: number): Promise<Chart>;
29
+ copyToWorkspace(key: string, workspaceKey: string): Promise<Chart>;
30
+ saveSocialDistancingRulesets(key: string, socialDistancingRulesets: object): Promise<import("axios").AxiosResponse<any, any>>;
31
+ retrievePublishedVersionThumbnail(key: string): Promise<any>;
32
+ retrieveDraftVersionThumbnail(key: string): Promise<any>;
33
+ listAllTags(): Promise<any>;
34
+ addTag(key: string, tag: string): Promise<import("axios").AxiosResponse<any, any>>;
35
+ removeTag(key: string, tag: string): Promise<import("axios").AxiosResponse<any, any>>;
36
+ listAll(chartListParams?: ChartListParams | null): import("../AsyncIterator").AsyncIterator<Chart>;
37
+ listFirstPage(chartListParams?: ChartListParams | null, pageSize?: number | null): Promise<Page<Chart>>;
38
+ listPageAfter(afterId: number, chartListParams?: ChartListParams | null, pageSize?: number | null): Promise<Page<Chart>>;
39
+ listPageBefore(beforeId: number, chartListParams?: ChartListParams | null, pageSize?: number | null): Promise<Page<Chart>>;
40
+ iterator(): Lister<Chart, ChartJson>;
41
+ }
@@ -18,15 +18,12 @@ var Charts = /** @class */ (function () {
18
18
  if (categories === void 0) { categories = null; }
19
19
  var requestParameters = {};
20
20
  if (name !== null) {
21
- // @ts-expect-error TS(2339): Property 'name' does not exist on type '{}'.
22
21
  requestParameters.name = name;
23
22
  }
24
23
  if (venueType !== null) {
25
- // @ts-expect-error TS(2339): Property 'venueType' does not exist on type '{}'.
26
24
  requestParameters.venueType = venueType;
27
25
  }
28
26
  if (categories !== null) {
29
- // @ts-expect-error TS(2339): Property 'categories' does not exist on type '{}'.
30
27
  requestParameters.categories = categories;
31
28
  }
32
29
  return this.client.post('charts', requestParameters)
@@ -37,11 +34,9 @@ var Charts = /** @class */ (function () {
37
34
  if (categories === void 0) { categories = null; }
38
35
  var requestParameters = {};
39
36
  if (name !== null) {
40
- // @ts-expect-error TS(2339): Property 'name' does not exist on type '{}'.
41
37
  requestParameters.name = name;
42
38
  }
43
39
  if (categories !== null) {
44
- // @ts-expect-error TS(2339): Property 'categories' does not exist on type '{}'.
45
40
  requestParameters.categories = categories;
46
41
  }
47
42
  return this.client.post("/charts/".concat(key), requestParameters);
@@ -131,24 +126,24 @@ var Charts = /** @class */ (function () {
131
126
  var url = "charts/".concat(key, "/tags/").concat(encodeURIComponent(tag));
132
127
  return this.client.delete(url);
133
128
  };
134
- Charts.prototype.listAll = function (requestParameters) {
135
- if (requestParameters === void 0) { requestParameters = {}; }
136
- return this.iterator().all(requestParameters);
129
+ Charts.prototype.listAll = function (chartListParams) {
130
+ if (chartListParams === void 0) { chartListParams = null; }
131
+ return this.iterator().all(chartListParams);
137
132
  };
138
133
  Charts.prototype.listFirstPage = function (chartListParams, pageSize) {
139
134
  if (chartListParams === void 0) { chartListParams = null; }
140
135
  if (pageSize === void 0) { pageSize = null; }
141
136
  return this.iterator().firstPage(chartListParams, pageSize);
142
137
  };
143
- Charts.prototype.listPageAfter = function (afterId, chartListParameters, pageSize) {
144
- if (chartListParameters === void 0) { chartListParameters = null; }
138
+ Charts.prototype.listPageAfter = function (afterId, chartListParams, pageSize) {
139
+ if (chartListParams === void 0) { chartListParams = null; }
145
140
  if (pageSize === void 0) { pageSize = null; }
146
- return this.iterator().pageAfter(afterId, chartListParameters, pageSize);
141
+ return this.iterator().pageAfter(afterId, chartListParams, pageSize);
147
142
  };
148
- Charts.prototype.listPageBefore = function (beforeId, chartListParameters, pageSize) {
149
- if (chartListParameters === void 0) { chartListParameters = null; }
143
+ Charts.prototype.listPageBefore = function (beforeId, chartListParams, pageSize) {
144
+ if (chartListParams === void 0) { chartListParams = null; }
150
145
  if (pageSize === void 0) { pageSize = null; }
151
- return this.iterator().pageBefore(beforeId, chartListParameters, pageSize);
146
+ return this.iterator().pageBefore(beforeId, chartListParams, pageSize);
152
147
  };
153
148
  Charts.prototype.iterator = function () {
154
149
  return new Lister_1.Lister('/charts', this.client, 'charts', function (data) {
@@ -0,0 +1,58 @@
1
+ import { Dict } from '../Dict';
2
+ export type SocialDistancingRulesetJson = Dict<any>;
3
+ export declare class SocialDistancingRuleset {
4
+ index: number;
5
+ name: string;
6
+ numberOfDisabledSeatsToTheSides: number;
7
+ disableSeatsInFrontAndBehind: boolean;
8
+ disableDiagonalSeatsInFrontAndBehind: boolean;
9
+ numberOfDisabledAisleSeats: number;
10
+ maxGroupSize: number;
11
+ maxOccupancyAbsolute: number;
12
+ maxOccupancyPercentage: number;
13
+ oneGroupPerTable: boolean;
14
+ fixedGroupLayout: boolean;
15
+ disabledSeats: string[];
16
+ enabledSeats: string[];
17
+ constructor(index: number, name: string, numberOfDisabledSeatsToTheSides: number, disableSeatsInFrontAndBehind: boolean, disableDiagonalSeatsInFrontAndBehind: boolean, numberOfDisabledAisleSeats: number, maxGroupSize: number, maxOccupancyAbsolute: number, maxOccupancyPercentage: number, oneGroupPerTable: boolean, fixedGroupLayout: boolean, disabledSeats: string[], enabledSeats: string[]);
18
+ static fixed(name: string): FixedSocialDistancingRulesetBuilder;
19
+ static ruleBased(name: string): RuleBasedSocialDistancingRulesetBuilder;
20
+ static fromJson(json: Dict<any>): SocialDistancingRuleset;
21
+ }
22
+ declare class FixedSocialDistancingRulesetBuilder {
23
+ disabledSeats: string[];
24
+ index: number;
25
+ name: string;
26
+ constructor(name: string);
27
+ build(): SocialDistancingRuleset;
28
+ setIndex(index: number): this;
29
+ setDisabledSeats(disabledSeats: string[]): this;
30
+ }
31
+ declare class RuleBasedSocialDistancingRulesetBuilder {
32
+ disableDiagonalSeatsInFrontAndBehind: boolean;
33
+ disableSeatsInFrontAndBehind: boolean;
34
+ disabledSeats: string[];
35
+ enabledSeats: string[];
36
+ index: number;
37
+ maxGroupSize: number;
38
+ maxOccupancyAbsolute: number;
39
+ maxOccupancyPercentage: number;
40
+ name: string;
41
+ numberOfDisabledAisleSeats: number;
42
+ numberOfDisabledSeatsToTheSides: number;
43
+ oneGroupPerTable: boolean;
44
+ constructor(name: string);
45
+ build(): SocialDistancingRuleset;
46
+ setIndex(index: number): this;
47
+ setNumberOfDisabledSeatsToTheSides(numberOfDisabledSeatsToTheSides: number): this;
48
+ setDisableSeatsInFrontAndBehind(disableSeatsInFrontAndBehind: boolean): this;
49
+ setDisableDiagonalSeatsInFrontAndBehind(disableDiagonalSeatsInFrontAndBehind: boolean): this;
50
+ setNumberOfDisabledAisleSeats(numberOfDisabledAisleSeats: number): this;
51
+ setMaxGroupSize(maxGroupSize: number): this;
52
+ setMaxOccupancyAbsolute(maxOccupancyAbsolute: number): this;
53
+ setMaxOccupancyPercentage(maxOccupancyPercentage: number): this;
54
+ setOneGroupPerTable(oneGroupPerTable: boolean): this;
55
+ setDisabledSeats(disabledSeats: string[]): this;
56
+ setEnabledSeats(enabledSeats: string[]): this;
57
+ }
58
+ export {};