seatsio 75.1.0 → 76.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.
Files changed (98) hide show
  1. package/README.md +8 -2
  2. package/dist/src/Accounts/Account.d.ts +11 -7
  3. package/dist/src/Accounts/Account.js +8 -8
  4. package/dist/src/Accounts/AccountSettings.d.ts +11 -6
  5. package/dist/src/Accounts/Accounts.d.ts +11 -9
  6. package/dist/src/Accounts/ChartValidationSettings.d.ts +10 -7
  7. package/dist/src/Accounts/ChartValidationSettings.js +7 -7
  8. package/dist/src/Accounts/DefaultRendererSettings.d.ts +6 -3
  9. package/dist/src/Accounts/DefaultRendererSettings.js +3 -3
  10. package/dist/src/AsyncIterator.d.ts +39 -22
  11. package/dist/src/AsyncIterator.js +20 -6
  12. package/dist/src/Charts/Category.d.ts +13 -10
  13. package/dist/src/Charts/Category.js +0 -1
  14. package/dist/src/Charts/Chart.d.ts +18 -13
  15. package/dist/src/Charts/Chart.js +0 -1
  16. package/dist/src/Charts/ChartListParams.d.ts +15 -16
  17. package/dist/src/Charts/ChartListParams.js +2 -14
  18. package/dist/src/Charts/ChartObjectInfo.d.ts +22 -15
  19. package/dist/src/Charts/ChartObjectInfo.js +18 -15
  20. package/dist/src/Charts/ChartValidation.d.ts +4 -3
  21. package/dist/src/Charts/ChartValidation.js +3 -3
  22. package/dist/src/Charts/Charts.d.ts +38 -33
  23. package/dist/src/Charts/Charts.js +9 -14
  24. package/dist/src/Charts/SocialDistancingRuleset.d.ts +49 -33
  25. package/dist/src/Charts/SocialDistancingRuleset.js +31 -67
  26. package/dist/src/Common/IDs.d.ts +4 -4
  27. package/dist/src/Common/LabelAndType.d.ts +5 -0
  28. package/dist/src/Common/LabelAndType.js +11 -0
  29. package/dist/src/Common/Labels.d.ts +6 -10
  30. package/dist/src/Common/Labels.js +2 -11
  31. package/dist/src/Dict.d.ts +3 -0
  32. package/dist/src/Dict.js +2 -0
  33. package/dist/src/Events/BestAvailableObjects.d.ts +5 -4
  34. package/dist/src/Events/BestAvailableObjects.js +4 -4
  35. package/dist/src/Events/ChangeObjectStatusResult.d.ts +4 -2
  36. package/dist/src/Events/Channel.d.ts +8 -6
  37. package/dist/src/Events/Channel.js +6 -6
  38. package/dist/src/Events/Channels.d.ts +10 -9
  39. package/dist/src/Events/Event.d.ts +23 -17
  40. package/dist/src/Events/EventDeserializer.d.ts +2 -2
  41. package/dist/src/Events/EventDeserializer.js +4 -4
  42. package/dist/src/Events/EventObjectInfo.d.ts +37 -33
  43. package/dist/src/Events/EventObjectInfo.js +33 -33
  44. package/dist/src/Events/Events.d.ts +51 -33
  45. package/dist/src/Events/Events.js +6 -63
  46. package/dist/src/Events/ForSaleConfig.d.ts +6 -5
  47. package/dist/src/Events/ObjectProperties.d.ts +8 -8
  48. package/dist/src/Events/StatusChange.d.ts +17 -14
  49. package/dist/src/Events/StatusChange.js +14 -14
  50. package/dist/src/Events/StatusChangeOrigin.d.ts +8 -0
  51. package/dist/src/Events/StatusChangeOrigin.js +11 -0
  52. package/dist/src/Events/StatusChangeRequest.d.ts +12 -11
  53. package/dist/src/Events/StatusChangesParams.d.ts +8 -8
  54. package/dist/src/Events/StatusChangesParams.js +0 -3
  55. package/dist/src/Events/TableBookingConfig.d.ts +10 -4
  56. package/dist/src/Events/TableBookingConfig.js +0 -3
  57. package/dist/src/HoldTokens/HoldToken.d.ts +8 -5
  58. package/dist/src/HoldTokens/HoldToken.js +5 -5
  59. package/dist/src/HoldTokens/HoldTokens.d.ts +7 -5
  60. package/dist/src/HoldTokens/HoldTokens.js +0 -2
  61. package/dist/src/Invitations/Invitation.d.ts +7 -5
  62. package/dist/src/Invitations/Invitations.d.ts +4 -3
  63. package/dist/src/Lister.d.ts +15 -11
  64. package/dist/src/Lister.js +14 -11
  65. package/dist/src/Page.d.ts +6 -6
  66. package/dist/src/PageFetcher.d.ts +11 -8
  67. package/dist/src/PageFetcher.js +3 -0
  68. package/dist/src/Region.d.ts +3 -3
  69. package/dist/src/Reports/ChartReports.d.ts +14 -13
  70. package/dist/src/Reports/ChartReports.js +0 -9
  71. package/dist/src/Reports/EventReports.d.ts +33 -31
  72. package/dist/src/Reports/UsageReports.d.ts +8 -7
  73. package/dist/src/Seasons/Season.d.ts +5 -3
  74. package/dist/src/Seasons/SeasonParams.d.ts +11 -10
  75. package/dist/src/Seasons/Seasons.d.ts +13 -9
  76. package/dist/src/Seasons/Seasons.js +0 -15
  77. package/dist/src/SeatsioClient.d.ts +32 -19
  78. package/dist/src/SeatsioClient.js +6 -6
  79. package/dist/src/Subaccounts/Subaccount.d.ts +9 -7
  80. package/dist/src/Subaccounts/Subaccount.js +7 -7
  81. package/dist/src/Subaccounts/Subaccounts.d.ts +22 -18
  82. package/dist/src/Subaccounts/Subaccounts.js +0 -2
  83. package/dist/src/Users/User.d.ts +12 -10
  84. package/dist/src/Users/User.js +11 -11
  85. package/dist/src/Users/Users.d.ts +15 -11
  86. package/dist/src/Users/Users.js +0 -1
  87. package/dist/src/Workspaces/Workspace.d.ts +10 -8
  88. package/dist/src/Workspaces/Workspace.js +9 -9
  89. package/dist/src/Workspaces/Workspaces.d.ts +27 -24
  90. package/dist/src/errorInterceptor.d.ts +1 -1
  91. package/dist/src/errorInterceptor.js +7 -7
  92. package/dist/src/index.d.ts +47 -4
  93. package/dist/src/index.js +93 -9
  94. package/dist/src/utilities/helperFunctions.d.ts +1 -1
  95. package/dist/src/utilities/helperFunctions.js +7 -6
  96. package/dist/src/utilities/reportUtility.d.ts +6 -3
  97. package/dist/src/utilities/reportUtility.js +0 -3
  98. package/package.json +8 -8
package/README.md CHANGED
@@ -15,10 +15,12 @@ This is the official JavaScript client library for the [Seats.io V2 REST API](ht
15
15
  > **Only use this in browser code if you know what you're doing (e.g. if you're building a password-protected backoffice application for admins)**. You have been warned :)
16
16
 
17
17
  ## Installing
18
- For Node, you can install using npm:
18
+ For Node, you can install using yarn or npm:
19
19
 
20
20
  ```sh
21
- npm install seatsio
21
+ yarn add seatsio
22
+ # or
23
+ npm install seatsio --save
22
24
  ```
23
25
 
24
26
  ## Usage
@@ -309,3 +311,7 @@ let client = new SeatsioClient(Region.EU(), <WORKSPACE SECRET KEY>).setMaxRetrie
309
311
  ```
310
312
 
311
313
  Passing in 0 disables exponential backoff completely. In that case, the client will never retry a failed request.
314
+
315
+ ## TypeScript
316
+
317
+ Since v76, this package contains TypeScript definitions.
@@ -1,10 +1,14 @@
1
+ import { AccountSettings } from './AccountSettings';
2
+ import { Dict } from '../Dict';
3
+ type AccountJson = Dict<any>;
1
4
  export declare class Account {
2
5
  company: any;
3
- designerKey: any;
4
- email: any;
5
- publicKey: any;
6
- role: any;
7
- secretKey: any;
8
- settings: any;
9
- constructor(account: any);
6
+ designerKey: string;
7
+ email: string;
8
+ publicKey: string;
9
+ role: string;
10
+ secretKey: string;
11
+ settings: AccountSettings;
12
+ constructor(json: AccountJson);
10
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
  }());
@@ -1,8 +1,13 @@
1
+ import { ChartValidationSettings } from './ChartValidationSettings';
2
+ import { DefaultRendererSettings } from './DefaultRendererSettings';
3
+ import { Dict } from '../Dict';
4
+ type AccountSettingsJson = Dict<any>;
1
5
  export declare class AccountSettings {
2
- chartValidation: any;
3
- defaultRendererSettings: any;
4
- draftChartDrawingsEnabled: any;
5
- holdOnSelectForGAs: any;
6
- holdPeriodInMinutes: any;
7
- constructor(settings: any);
6
+ chartValidation: ChartValidationSettings;
7
+ defaultRendererSettings: DefaultRendererSettings;
8
+ draftChartDrawingsEnabled: boolean;
9
+ holdOnSelectForGAs: boolean;
10
+ holdPeriodInMinutes: number;
11
+ constructor(settings: AccountSettingsJson);
8
12
  }
13
+ export {};
@@ -1,12 +1,14 @@
1
+ import { Account } from './Account';
2
+ import { Axios } from 'axios';
1
3
  export declare class Accounts {
2
4
  private client;
3
- constructor(client: any);
4
- retrieveMyAccount(): any;
5
- regenerateSecretKey(): any;
6
- regenerateDesignerKey(): any;
7
- enableDraftChartDrawings(): any;
8
- disableDraftChartDrawings(): any;
9
- changePassword(password: any): any;
10
- changeHoldPeriod(holdPeriodInMinutes: any): any;
11
- updateSetting(key: any, value: any): any;
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>>;
12
14
  }
@@ -1,9 +1,12 @@
1
+ import { Dict } from '../Dict';
2
+ type ChartValidationSettingsJson = Dict<any>;
1
3
  export declare class ChartValidationSettings {
2
- VALIDATE_DUPLICATE_LABELS: any;
3
- VALIDATE_EMPTY_FLOOR: any;
4
- VALIDATE_FOCAL_POINT: any;
5
- VALIDATE_OBJECTS_WITHOUT_CATEGORIES: any;
6
- VALIDATE_OBJECT_TYPES_PER_CATEGORY: any;
7
- VALIDATE_UNLABELED_OBJECTS: any;
8
- constructor(chartValidations: any);
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);
9
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
  }());
@@ -1,5 +1,8 @@
1
+ import { Dict } from '../Dict';
2
+ type DefaultRendererSettingsJson = Dict<any>;
1
3
  export declare class DefaultRendererSettings {
2
- multiSelectEnabled: any;
3
- showFullScreenButton: any;
4
- constructor(defaultRendererSettings: any);
4
+ multiSelectEnabled: boolean;
5
+ showFullScreenButton: boolean;
6
+ constructor(json: DefaultRendererSettingsJson);
5
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
  }());
@@ -1,25 +1,42 @@
1
- export declare class AsyncIterator {
2
- client: any;
3
- index: any;
4
- items: any;
5
- nextPageMustBeFetched: any;
6
- nextPageStartsAfter: any;
7
- objType: any;
8
- pages: any;
9
- params: any;
10
- url: any;
11
- constructor(url: any, client: any, objType: any, params?: {});
12
- charts(data: any): void;
13
- events(data: any): void;
14
- seasons(data: any): void;
15
- statusChanges(data: any): void;
16
- subaccounts(data: any): void;
17
- workspaces(data: any): void;
18
- users(data: any): void;
19
- fetch(fetchParams?: {}): any;
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>;
20
38
  [Symbol.asyncIterator](): {
21
- next(): Promise<{
22
- done: boolean;
23
- }>;
39
+ next(): Promise<any>;
24
40
  };
25
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) {
@@ -1,12 +1,15 @@
1
+ import { Dict } from '../Dict';
2
+ export type CategoryJson = Dict<any>;
3
+ export type CategoryKey = string | number;
1
4
  export declare class Category {
2
- accessible: any;
3
- color: any;
4
- key: any;
5
- label: any;
6
- constructor(key: any, label: any, color: any, accessible?: boolean);
7
- setKey(key: any): this;
8
- setLabel(label: any): this;
9
- setColor(color: any): this;
10
- setAccessible(accessible: any): this;
11
- static fromJson(json: any): 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;
12
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;
@@ -1,15 +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>;
1
6
  export declare class Chart {
2
- archived: any;
3
- draftVersionThumbnailUrl: any;
4
- events: any;
5
- id: any;
6
- key: any;
7
- name: any;
8
- publishedVersionThumbnailUrl: any;
9
- socialDistancingRulesets: any;
10
- status: any;
11
- tags: any;
12
- validation: any;
13
- constructor(chart: any);
14
- static socialDistancingRulesetsFromJson(json: any): {} | undefined;
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;
15
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;
@@ -1,20 +1,19 @@
1
1
  export declare class ChartListParams {
2
- eventsLimit: any;
3
- expand: any;
4
- filter: any;
5
- tag: any;
6
- validation: any;
7
- constructor(filter?: null, tag?: null, expandEvents?: null, withValidation?: boolean, eventsLimit?: null);
8
- withFilter(filter: any): this;
9
- withTag(tag: any): this;
10
- withExpandEvents(expandEvents: any): this;
11
- withEventsLimit(eventsLimit: any): this;
12
- withValidation(validation: any): this;
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;
13
12
  serialize(): {
14
- tag: any;
15
- expand: any;
16
- filter: any;
17
- validation: any;
18
- eventsLimit: any;
13
+ tag: string | undefined;
14
+ expand: string | undefined;
15
+ filter: string | undefined;
16
+ validation: boolean | undefined;
17
+ eventsLimit: number | undefined;
19
18
  };
20
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;
@@ -1,17 +1,24 @@
1
+ import { IDs } from '../Common/IDs';
2
+ import { Labels } from '../Common/Labels';
3
+ import { Dict } from '../Dict';
4
+ export type ChartObjectInfoJson = Dict<any>;
1
5
  export declare class ChartObjectInfo {
2
- bookAsAWhole: any;
3
- capacity: any;
4
- categoryKey: any;
5
- categoryLabel: any;
6
- distanceToFocalPoint: any;
7
- entrance: any;
8
- ids: any;
9
- label: any;
10
- labels: any;
11
- leftNeighbour: any;
12
- numSeats: any;
13
- objectType: any;
14
- rightNeighbour: any;
15
- section: any;
16
- constructor(chartReport: any);
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
+ isAccessible?: boolean;
21
+ isCompanionSeat?: boolean;
22
+ hasRestrictedView?: boolean;
23
+ constructor(json: ChartObjectInfoJson);
17
24
  }
@@ -4,21 +4,24 @@ 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
+ this.isAccessible = json.isAccessible;
23
+ this.isCompanionSeat = json.isCompanionSeat;
24
+ this.hasRestrictedView = json.hasRestrictedView;
22
25
  }
23
26
  return ChartObjectInfo;
24
27
  }());
@@ -1,5 +1,6 @@
1
+ import { Dict } from '../Dict';
1
2
  export declare class ChartValidation {
2
- errors: any;
3
- warnings: any;
4
- constructor(validation: any);
3
+ errors: string[];
4
+ warnings: string[];
5
+ constructor(json: Dict<any>);
5
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
  }());