seatsio 76.1.0 → 77.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.
@@ -1,5 +1,4 @@
1
1
  import { ChartValidation } from './ChartValidation';
2
- import { SocialDistancingRuleset, SocialDistancingRulesetJson } from './SocialDistancingRuleset';
3
2
  import { Event } from '../Events/Event';
4
3
  import { Dict } from '../Dict';
5
4
  export type ChartJson = Dict<any>;
@@ -11,10 +10,8 @@ export declare class Chart {
11
10
  key: string;
12
11
  name: string;
13
12
  publishedVersionThumbnailUrl: string;
14
- socialDistancingRulesets?: Dict<SocialDistancingRuleset>;
15
13
  status: string;
16
14
  tags: string[];
17
15
  validation?: ChartValidation;
18
16
  constructor(chart: ChartJson);
19
- static socialDistancingRulesetsFromJson(json: SocialDistancingRulesetJson): Dict<SocialDistancingRuleset> | undefined;
20
17
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Chart = void 0;
4
4
  var EventDeserializer_1 = require("../Events/EventDeserializer");
5
5
  var ChartValidation_1 = require("./ChartValidation");
6
- var SocialDistancingRuleset_1 = require("./SocialDistancingRuleset");
7
6
  var Chart = /** @class */ (function () {
8
7
  function Chart(chart) {
9
8
  this.name = chart.name;
@@ -17,18 +16,7 @@ var Chart = /** @class */ (function () {
17
16
  this.archived = chart.archived;
18
17
  if (chart.validation)
19
18
  this.validation = new ChartValidation_1.ChartValidation(chart.validation);
20
- this.socialDistancingRulesets = Chart.socialDistancingRulesetsFromJson(chart.socialDistancingRulesets);
21
19
  }
22
- Chart.socialDistancingRulesetsFromJson = function (json) {
23
- if (json === undefined) {
24
- return undefined;
25
- }
26
- var result = {};
27
- for (var key in json) {
28
- result[key] = SocialDistancingRuleset_1.SocialDistancingRuleset.fromJson(json[key]);
29
- }
30
- return result;
31
- };
32
20
  return Chart;
33
21
  }());
34
22
  exports.Chart = Chart;
@@ -27,7 +27,6 @@ export declare class Charts {
27
27
  copyDraftVersion(key: string): Promise<Chart>;
28
28
  copyToSubaccount(key: string, subaccountId: number): Promise<Chart>;
29
29
  copyToWorkspace(key: string, workspaceKey: string): Promise<Chart>;
30
- saveSocialDistancingRulesets(key: string, socialDistancingRulesets: object): Promise<import("axios").AxiosResponse<any, any>>;
31
30
  retrievePublishedVersionThumbnail(key: string): Promise<any>;
32
31
  retrieveDraftVersionThumbnail(key: string): Promise<any>;
33
32
  listAllTags(): Promise<any>;
@@ -103,9 +103,6 @@ var Charts = /** @class */ (function () {
103
103
  return this.client.post("charts/".concat(key, "/version/published/actions/copy-to-workspace/").concat(workspaceKey))
104
104
  .then(function (res) { return new Chart_1.Chart(res.data); });
105
105
  };
106
- Charts.prototype.saveSocialDistancingRulesets = function (key, socialDistancingRulesets) {
107
- return this.client.post("/charts/".concat(key, "/social-distancing-rulesets"), { socialDistancingRulesets: socialDistancingRulesets });
108
- };
109
106
  Charts.prototype.retrievePublishedVersionThumbnail = function (key) {
110
107
  return this.client.get("/charts/".concat(key, "/version/published/thumbnail"), { responseType: 'arraybuffer' })
111
108
  .then(function (res) { return res.data; });
@@ -0,0 +1,17 @@
1
+ import { TableBookingConfig } from './TableBookingConfig';
2
+ import { Category } from '../Charts/Category';
3
+ import { LocalDate } from '../LocalDate';
4
+ export declare abstract class AbstractEventParams {
5
+ key?: string;
6
+ tableBookingConfig?: TableBookingConfig;
7
+ objectCategories?: object;
8
+ categories?: Category[];
9
+ name?: string;
10
+ date?: LocalDate;
11
+ withKey(key: string): this;
12
+ withTableBookingConfig(tableBookingConfig: TableBookingConfig): this;
13
+ withObjectCategories(objectCategories: object): this;
14
+ withCategories(categories: Category[]): this;
15
+ withName(name: string): this;
16
+ withDate(date: LocalDate): this;
17
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbstractEventParams = void 0;
4
+ var AbstractEventParams = /** @class */ (function () {
5
+ function AbstractEventParams() {
6
+ }
7
+ AbstractEventParams.prototype.withKey = function (key) {
8
+ this.key = key;
9
+ return this;
10
+ };
11
+ AbstractEventParams.prototype.withTableBookingConfig = function (tableBookingConfig) {
12
+ this.tableBookingConfig = tableBookingConfig;
13
+ return this;
14
+ };
15
+ AbstractEventParams.prototype.withObjectCategories = function (objectCategories) {
16
+ this.objectCategories = objectCategories;
17
+ return this;
18
+ };
19
+ AbstractEventParams.prototype.withCategories = function (categories) {
20
+ this.categories = categories;
21
+ return this;
22
+ };
23
+ AbstractEventParams.prototype.withName = function (name) {
24
+ this.name = name;
25
+ return this;
26
+ };
27
+ AbstractEventParams.prototype.withDate = function (date) {
28
+ this.date = date;
29
+ return this;
30
+ };
31
+ return AbstractEventParams;
32
+ }());
33
+ exports.AbstractEventParams = AbstractEventParams;
@@ -0,0 +1,3 @@
1
+ import { AbstractEventParams } from './AbstractEventParams';
2
+ export declare class CreateEventParams extends AbstractEventParams {
3
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CreateEventParams = void 0;
19
+ var AbstractEventParams_1 = require("./AbstractEventParams");
20
+ var CreateEventParams = /** @class */ (function (_super) {
21
+ __extends(CreateEventParams, _super);
22
+ function CreateEventParams() {
23
+ return _super !== null && _super.apply(this, arguments) || this;
24
+ }
25
+ return CreateEventParams;
26
+ }(AbstractEventParams_1.AbstractEventParams));
27
+ exports.CreateEventParams = CreateEventParams;
@@ -3,6 +3,7 @@ import { Channel } from './Channel';
3
3
  import { Category } from '../Charts/Category';
4
4
  import { TableBookingConfig } from './TableBookingConfig';
5
5
  import { Dict } from '../Dict';
6
+ import { LocalDate } from '../LocalDate';
6
7
  export type EventJson = Dict<any>;
7
8
  export declare class Event {
8
9
  categories: Category[] | null;
@@ -16,11 +17,12 @@ export declare class Event {
16
17
  isTopLevelSeason: boolean;
17
18
  key: string;
18
19
  objectCategories?: Map<string, any>;
19
- socialDistancingRulesetKey?: string;
20
20
  supportsBestAvailable: boolean;
21
21
  tableBookingConfig: TableBookingConfig;
22
22
  topLevelSeasonKey?: string;
23
23
  updatedOn: Date | null;
24
+ name: string | null;
25
+ date: LocalDate | null;
24
26
  constructor(json: EventJson);
25
27
  isSeason(): boolean;
26
28
  }
@@ -4,6 +4,7 @@ exports.Event = void 0;
4
4
  var ForSaleConfig_1 = require("./ForSaleConfig");
5
5
  var Channel_1 = require("./Channel");
6
6
  var Category_1 = require("../Charts/Category");
7
+ var LocalDate_1 = require("../LocalDate");
7
8
  var Event = /** @class */ (function () {
8
9
  function Event(json) {
9
10
  this.id = json.id;
@@ -15,13 +16,14 @@ var Event = /** @class */ (function () {
15
16
  this.createdOn = json.createdOn ? new Date(json.createdOn) : null;
16
17
  this.updatedOn = json.updatedOn ? new Date(json.updatedOn) : null;
17
18
  this.channels = json.channels ? json.channels.map(function (c) { return new Channel_1.Channel(c); }) : null;
18
- this.socialDistancingRulesetKey = json.socialDistancingRulesetKey;
19
19
  this.topLevelSeasonKey = json.topLevelSeasonKey;
20
20
  this.isTopLevelSeason = json.isTopLevelSeason;
21
21
  this.isPartialSeason = json.isPartialSeason;
22
22
  this.isEventInSeason = json.isEventInSeason;
23
23
  this.objectCategories = json.objectCategories;
24
24
  this.categories = json.categories ? json.categories.map(function (c) { return Category_1.Category.fromJson(c); }) : null;
25
+ this.name = json.name || null;
26
+ this.date = json.date ? LocalDate_1.LocalDate.parse(json.date) : null;
25
27
  }
26
28
  Event.prototype.isSeason = function () {
27
29
  return false;
@@ -24,7 +24,6 @@ export declare class EventObjectInfo {
24
24
  isAccessible?: boolean;
25
25
  isAvailable: boolean;
26
26
  isCompanionSeat?: boolean;
27
- isDisabledBySocialDistancing: boolean;
28
27
  label: string;
29
28
  labels: Labels;
30
29
  leftNeighbour?: string;
@@ -32,7 +32,6 @@ var EventObjectInfo = exports.EventObjectInfo = /** @class */ (function () {
32
32
  this.rightNeighbour = json.rightNeighbour;
33
33
  this.isAvailable = json.isAvailable;
34
34
  this.availabilityReason = json.availabilityReason;
35
- this.isDisabledBySocialDistancing = json.isDisabledBySocialDistancing;
36
35
  this.channel = json.channel;
37
36
  this.distanceToFocalPoint = json.distanceToFocalPoint;
38
37
  this.holds = json.holds;
@@ -5,12 +5,12 @@ import { Channels } from './Channels';
5
5
  import { StatusChange, StatusChangeJson } from './StatusChange';
6
6
  import { ChangeObjectStatusResult } from './ChangeObjectStatusResult';
7
7
  import { BestAvailableObjects } from './BestAvailableObjects';
8
- import { TableBookingConfig } from './TableBookingConfig';
9
8
  import { Event, EventJson } from './Event';
10
9
  import { Axios } from 'axios';
11
- import { Category } from '../Charts/Category';
12
10
  import { Dict } from '../Dict';
13
11
  import { StatusChangeRequest } from './StatusChangeRequest';
12
+ import { CreateEventParams } from './CreateEventParams';
13
+ import { UpdateEventParams } from './UpdateEventParams';
14
14
  export interface ObjectIdAndTicketType {
15
15
  objectId: string;
16
16
  ticketType?: string;
@@ -21,11 +21,10 @@ export declare class Events {
21
21
  channels: Channels;
22
22
  client: Axios;
23
23
  constructor(client: Axios);
24
- create(chartKey: string, eventKey?: string | null, tableBookingConfig?: TableBookingConfig | null, socialDistancingRulesetKey?: string | null, objectCategories?: object | null, categories?: Category[] | null): Promise<Event>;
25
- static eventCreationParams(eventKey?: string | null, tableBookingConfig?: TableBookingConfig | null, socialDistancingRulesetKey?: string | null, objectCategories?: object | null, categories?: Category[] | null): Dict<any>;
26
- createMultiple(chartKey: string, events?: any[]): Promise<Event[]>;
24
+ create(chartKey: string, params?: CreateEventParams): Promise<Event>;
25
+ createMultiple(chartKey: string, events?: CreateEventParams[]): Promise<Event[]>;
27
26
  retrieve(eventKey: string): Promise<Event>;
28
- update(eventKey: string, chartKey?: string | null, newEventKey?: string | null, tableBookingConfig?: TableBookingConfig | null, socialDistancingRulesetKey?: string | null, objectCategories?: object | null, categories?: Category[] | null): Promise<import("axios").AxiosResponse<any, any>>;
27
+ update(eventKey: string, params: UpdateEventParams): Promise<import("axios").AxiosResponse<any, any>>;
29
28
  delete(eventKey: string): Promise<import("axios").AxiosResponse<any, any>>;
30
29
  listAll(requestParameters?: {}): import("../AsyncIterator").AsyncIterator<Event>;
31
30
  listFirstPage(pageSize?: number | null): Promise<Page<Event>>;
@@ -41,13 +40,13 @@ export declare class Events {
41
40
  updateExtraDatas(eventKey: string, extraData: Dict<any>): Promise<import("axios").AxiosResponse<any, any>>;
42
41
  retrieveObjectInfo(eventKey: string, label: string): Promise<EventObjectInfo>;
43
42
  retrieveObjectInfos(eventKey: string, labels: string[]): Promise<Dict<EventObjectInfo>>;
44
- changeObjectStatus(eventKeyOrKeys: string | string[], objectOrObjects: ObjectOrObjects, status: string, holdToken?: string | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null, ignoreSocialDistancing?: boolean | null, allowedPreviousStatuses?: string[] | null, rejectedPreviousStatuses?: string[] | null): Promise<ChangeObjectStatusResult>;
43
+ changeObjectStatus(eventKeyOrKeys: string | string[], objectOrObjects: ObjectOrObjects, status: string, holdToken?: string | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null, allowedPreviousStatuses?: string[] | null, rejectedPreviousStatuses?: string[] | null): Promise<ChangeObjectStatusResult>;
45
44
  changeObjectStatusInBatch(statusChangeRequests: StatusChangeRequest[]): Promise<any>;
46
- changeObjectStatusRequest(objectOrObjects: ObjectOrObjects, status: string, holdToken: string | null, orderId: string | null, keepExtraData: boolean | null, ignoreChannels: boolean | null, channelKeys?: string[] | null, ignoreSocialDistancing?: boolean | null, allowedPreviousStatuses?: string[] | null, rejectedPreviousStatuses?: string[] | null): Dict<any>;
47
- book(eventKeyOrKeys: string | string[], objectOrObjects: ObjectOrObjects, holdToken?: string | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null, ignoreSocialDistancing?: boolean | null): Promise<ChangeObjectStatusResult>;
45
+ changeObjectStatusRequest(objectOrObjects: ObjectOrObjects, status: string, holdToken: string | null, orderId: string | null, keepExtraData: boolean | null, ignoreChannels: boolean | null, channelKeys?: string[] | null, allowedPreviousStatuses?: string[] | null, rejectedPreviousStatuses?: string[] | null): Dict<any>;
46
+ book(eventKeyOrKeys: string | string[], objectOrObjects: ObjectOrObjects, holdToken?: string | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null): Promise<ChangeObjectStatusResult>;
48
47
  bookBestAvailable(eventKey: string, number: number, categories?: string[] | null, holdToken?: string | null, extraData?: Dict<any> | null, ticketTypes?: string[] | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null, tryToPreventOrphanSeats?: boolean | null): Promise<BestAvailableObjects>;
49
48
  release(eventKeyOrKeys: string | string[], objectOrObjects: ObjectOrObjects, holdToken?: string | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null): Promise<ChangeObjectStatusResult>;
50
- hold(eventKeyOrKeys: string | string[], objectOrObjects: ObjectOrObjects, holdToken: string, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null, ignoreSocialDistancing?: boolean | null): Promise<ChangeObjectStatusResult>;
49
+ hold(eventKeyOrKeys: string | string[], objectOrObjects: ObjectOrObjects, holdToken: string, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null): Promise<ChangeObjectStatusResult>;
51
50
  holdBestAvailable(eventKey: string, number: number, holdToken: string, categories?: string[] | null, extraData?: Dict<any> | null, ticketTypes?: string[] | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null, tryToPreventOrphanSeats?: boolean | null): Promise<BestAvailableObjects>;
52
51
  changeBestAvailableObjectStatus(eventKey: string, number: number, status: string, categories?: string[] | null, holdToken?: string | null, extraData?: Dict<any> | null, ticketTypes?: string[] | null, orderId?: string | null, keepExtraData?: boolean | null, ignoreChannels?: boolean | null, channelKeys?: string[] | null, tryToPreventOrphanSeats?: boolean | null): Promise<BestAvailableObjects>;
53
52
  normalizeObjects(objectOrObjects: ObjectOrObjects): ObjectIdAndTicketType[];
@@ -50,69 +50,59 @@ var Events = /** @class */ (function () {
50
50
  this.client = client;
51
51
  this.channels = new Channels_1.Channels(this.client);
52
52
  }
53
- Events.prototype.create = function (chartKey, eventKey, tableBookingConfig, socialDistancingRulesetKey, objectCategories, categories) {
54
- if (eventKey === void 0) { eventKey = null; }
55
- if (tableBookingConfig === void 0) { tableBookingConfig = null; }
56
- if (socialDistancingRulesetKey === void 0) { socialDistancingRulesetKey = null; }
57
- if (objectCategories === void 0) { objectCategories = null; }
58
- if (categories === void 0) { categories = null; }
53
+ Events.prototype.create = function (chartKey, params) {
59
54
  var requestParameters = {};
60
55
  requestParameters.chartKey = chartKey;
61
- if (eventKey !== null) {
62
- requestParameters.eventKey = eventKey;
63
- }
64
- if (tableBookingConfig !== null) {
65
- requestParameters.tableBookingConfig = tableBookingConfig;
66
- }
67
- if (socialDistancingRulesetKey !== null) {
68
- requestParameters.socialDistancingRulesetKey = socialDistancingRulesetKey;
69
- }
70
- if (objectCategories !== null) {
71
- requestParameters.objectCategories = objectCategories;
72
- }
73
- if (categories != null) {
74
- requestParameters.categories = categories;
56
+ if (params !== undefined) {
57
+ if (params.key !== undefined) {
58
+ requestParameters.eventKey = params.key;
59
+ }
60
+ if (params.tableBookingConfig !== undefined) {
61
+ requestParameters.tableBookingConfig = params.tableBookingConfig;
62
+ }
63
+ if (params.objectCategories !== undefined) {
64
+ requestParameters.objectCategories = params.objectCategories;
65
+ }
66
+ if (params.categories !== undefined) {
67
+ requestParameters.categories = params.categories;
68
+ }
69
+ if (params.name !== undefined) {
70
+ requestParameters.name = params.name;
71
+ }
72
+ if (params.date !== undefined) {
73
+ requestParameters.date = params.date.toString();
74
+ }
75
75
  }
76
76
  return this.client.post('/events', requestParameters)
77
77
  .then(function (res) { return new EventDeserializer_1.EventDeserializer().fromJson(res.data); });
78
78
  };
79
- Events.eventCreationParams = function (eventKey, tableBookingConfig, socialDistancingRulesetKey, objectCategories, categories) {
80
- if (eventKey === void 0) { eventKey = null; }
81
- if (tableBookingConfig === void 0) { tableBookingConfig = null; }
82
- if (socialDistancingRulesetKey === void 0) { socialDistancingRulesetKey = null; }
83
- if (objectCategories === void 0) { objectCategories = null; }
84
- if (categories === void 0) { categories = null; }
85
- var eventDefinition = {};
86
- eventDefinition.eventKey = eventKey;
87
- eventDefinition.tableBookingConfig = tableBookingConfig;
88
- eventDefinition.socialDistancingRulesetKey = socialDistancingRulesetKey;
89
- eventDefinition.objectCategories = objectCategories;
90
- eventDefinition.categories = categories;
91
- return eventDefinition;
92
- };
93
79
  Events.prototype.createMultiple = function (chartKey, events) {
94
80
  var requestParameters = {};
95
81
  requestParameters.chartKey = chartKey;
96
82
  requestParameters.events = [];
97
83
  if (events) {
98
84
  for (var i = 0; i < events.length; i++) {
99
- var event_1 = {};
100
- if (events[i].eventKey !== null) {
101
- event_1.eventKey = events[i].eventKey;
85
+ var eventRequest = {};
86
+ var eventParams = events[i];
87
+ if (eventParams.key !== undefined) {
88
+ eventRequest.eventKey = eventParams.key;
89
+ }
90
+ if (eventParams.tableBookingConfig !== undefined) {
91
+ eventRequest.tableBookingConfig = eventParams.tableBookingConfig;
102
92
  }
103
- if (events[i].tableBookingConfig !== null) {
104
- event_1.tableBookingConfig = events[i].tableBookingConfig;
93
+ if (eventParams.objectCategories !== undefined) {
94
+ eventRequest.objectCategories = eventParams.objectCategories;
105
95
  }
106
- if (events[i].socialDistancingRulesetKey !== null) {
107
- event_1.socialDistancingRulesetKey = events[i].socialDistancingRulesetKey;
96
+ if (eventParams.categories !== undefined) {
97
+ eventRequest.categories = eventParams.categories;
108
98
  }
109
- if (events[i].objectCategories !== null) {
110
- event_1.objectCategories = events[i].objectCategories;
99
+ if (eventParams.name !== undefined) {
100
+ eventRequest.name = eventParams.name;
111
101
  }
112
- if (events[i].categories != null) {
113
- event_1.categories = events[i].categories;
102
+ if (eventParams.date !== undefined) {
103
+ eventRequest.date = eventParams.date.toString();
114
104
  }
115
- requestParameters.events.push(event_1);
105
+ requestParameters.events.push(eventRequest);
116
106
  }
117
107
  }
118
108
  return this.client.post('/events/actions/create-multiple', requestParameters)
@@ -120,8 +110,8 @@ var Events = /** @class */ (function () {
120
110
  var result = [];
121
111
  var deserializer = new EventDeserializer_1.EventDeserializer();
122
112
  for (var _i = 0, _a = res.data.events; _i < _a.length; _i++) {
123
- var event_2 = _a[_i];
124
- result.push(deserializer.fromJson(event_2));
113
+ var event_1 = _a[_i];
114
+ result.push(deserializer.fromJson(event_1));
125
115
  }
126
116
  return result;
127
117
  });
@@ -130,31 +120,28 @@ var Events = /** @class */ (function () {
130
120
  return this.client.get("/events/".concat(encodeURIComponent(eventKey)))
131
121
  .then(function (res) { return new EventDeserializer_1.EventDeserializer().fromJson(res.data); });
132
122
  };
133
- Events.prototype.update = function (eventKey, chartKey, newEventKey, tableBookingConfig, socialDistancingRulesetKey, objectCategories, categories) {
134
- if (chartKey === void 0) { chartKey = null; }
135
- if (newEventKey === void 0) { newEventKey = null; }
136
- if (tableBookingConfig === void 0) { tableBookingConfig = null; }
137
- if (socialDistancingRulesetKey === void 0) { socialDistancingRulesetKey = null; }
138
- if (objectCategories === void 0) { objectCategories = null; }
139
- if (categories === void 0) { categories = null; }
123
+ Events.prototype.update = function (eventKey, params) {
140
124
  var requestParameters = {};
141
- if (chartKey !== null) {
142
- requestParameters.chartKey = chartKey;
125
+ if (params.chartKey !== undefined) {
126
+ requestParameters.chartKey = params.chartKey;
143
127
  }
144
- if (newEventKey !== null) {
145
- requestParameters.eventKey = newEventKey;
128
+ if (params.key !== undefined) {
129
+ requestParameters.eventKey = params.key;
146
130
  }
147
- if (tableBookingConfig !== null) {
148
- requestParameters.tableBookingConfig = tableBookingConfig;
131
+ if (params.tableBookingConfig !== undefined) {
132
+ requestParameters.tableBookingConfig = params.tableBookingConfig;
149
133
  }
150
- if (socialDistancingRulesetKey !== null) {
151
- requestParameters.socialDistancingRulesetKey = socialDistancingRulesetKey;
134
+ if (params.objectCategories !== undefined) {
135
+ requestParameters.objectCategories = params.objectCategories;
152
136
  }
153
- if (objectCategories !== null) {
154
- requestParameters.objectCategories = objectCategories;
137
+ if (params.categories !== undefined) {
138
+ requestParameters.categories = params.categories;
155
139
  }
156
- if (categories != null) {
157
- requestParameters.categories = categories;
140
+ if (params.name !== undefined) {
141
+ requestParameters.name = params.name;
142
+ }
143
+ if (params.date !== undefined) {
144
+ requestParameters.date = params.date.toString();
158
145
  }
159
146
  return this.client.post("events/".concat(encodeURIComponent(eventKey)), requestParameters);
160
147
  };
@@ -268,16 +255,15 @@ var Events = /** @class */ (function () {
268
255
  return objectInfos;
269
256
  });
270
257
  };
271
- Events.prototype.changeObjectStatus = function (eventKeyOrKeys, objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, ignoreSocialDistancing, allowedPreviousStatuses, rejectedPreviousStatuses) {
258
+ Events.prototype.changeObjectStatus = function (eventKeyOrKeys, objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses) {
272
259
  if (holdToken === void 0) { holdToken = null; }
273
260
  if (orderId === void 0) { orderId = null; }
274
261
  if (keepExtraData === void 0) { keepExtraData = null; }
275
262
  if (ignoreChannels === void 0) { ignoreChannels = null; }
276
263
  if (channelKeys === void 0) { channelKeys = null; }
277
- if (ignoreSocialDistancing === void 0) { ignoreSocialDistancing = null; }
278
264
  if (allowedPreviousStatuses === void 0) { allowedPreviousStatuses = null; }
279
265
  if (rejectedPreviousStatuses === void 0) { rejectedPreviousStatuses = null; }
280
- var request = this.changeObjectStatusRequest(objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, ignoreSocialDistancing, allowedPreviousStatuses, rejectedPreviousStatuses);
266
+ var request = this.changeObjectStatusRequest(objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses);
281
267
  request.events = Array.isArray(eventKeyOrKeys) ? eventKeyOrKeys : [eventKeyOrKeys];
282
268
  return this.client.post('/events/groups/actions/change-object-status?expand=objects', request)
283
269
  .then(function (res) { return new ChangeObjectStatusResult_1.ChangeObjectStatusResult(res.data.objects); });
@@ -285,7 +271,7 @@ var Events = /** @class */ (function () {
285
271
  Events.prototype.changeObjectStatusInBatch = function (statusChangeRequests) {
286
272
  var _this = this;
287
273
  var requests = statusChangeRequests.map(function (r) {
288
- var json = _this.changeObjectStatusRequest(r.objectOrObjects, r.status, r.holdToken, r.orderId, r.keepExtraData, r.ignoreChannels, r.channelKeys, null, r.allowedPreviousStatuses, r.rejectedPreviousStatuses);
274
+ var json = _this.changeObjectStatusRequest(r.objectOrObjects, r.status, r.holdToken, r.orderId, r.keepExtraData, r.ignoreChannels, r.channelKeys, r.allowedPreviousStatuses, r.rejectedPreviousStatuses);
289
275
  json.event = r.eventKey;
290
276
  return json;
291
277
  });
@@ -293,9 +279,8 @@ var Events = /** @class */ (function () {
293
279
  return this.client.post('/events/actions/change-object-status?expand=objects', request)
294
280
  .then(function (res) { return res.data.results.map(function (r) { return new ChangeObjectStatusResult_1.ChangeObjectStatusResult(r.objects); }); });
295
281
  };
296
- Events.prototype.changeObjectStatusRequest = function (objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, ignoreSocialDistancing, allowedPreviousStatuses, rejectedPreviousStatuses) {
282
+ Events.prototype.changeObjectStatusRequest = function (objectOrObjects, status, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, allowedPreviousStatuses, rejectedPreviousStatuses) {
297
283
  if (channelKeys === void 0) { channelKeys = null; }
298
- if (ignoreSocialDistancing === void 0) { ignoreSocialDistancing = null; }
299
284
  if (allowedPreviousStatuses === void 0) { allowedPreviousStatuses = null; }
300
285
  if (rejectedPreviousStatuses === void 0) { rejectedPreviousStatuses = null; }
301
286
  var request = {};
@@ -316,9 +301,6 @@ var Events = /** @class */ (function () {
316
301
  if (channelKeys !== null) {
317
302
  request.channelKeys = channelKeys;
318
303
  }
319
- if (ignoreSocialDistancing !== null) {
320
- request.ignoreSocialDistancing = ignoreSocialDistancing;
321
- }
322
304
  if (allowedPreviousStatuses !== null) {
323
305
  request.allowedPreviousStatuses = allowedPreviousStatuses;
324
306
  }
@@ -327,14 +309,13 @@ var Events = /** @class */ (function () {
327
309
  }
328
310
  return request;
329
311
  };
330
- Events.prototype.book = function (eventKeyOrKeys, objectOrObjects, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, ignoreSocialDistancing) {
312
+ Events.prototype.book = function (eventKeyOrKeys, objectOrObjects, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys) {
331
313
  if (holdToken === void 0) { holdToken = null; }
332
314
  if (orderId === void 0) { orderId = null; }
333
315
  if (keepExtraData === void 0) { keepExtraData = null; }
334
316
  if (ignoreChannels === void 0) { ignoreChannels = null; }
335
317
  if (channelKeys === void 0) { channelKeys = null; }
336
- if (ignoreSocialDistancing === void 0) { ignoreSocialDistancing = null; }
337
- return this.changeObjectStatus(eventKeyOrKeys, objectOrObjects, EventObjectInfo_1.EventObjectInfo.BOOKED, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, ignoreSocialDistancing);
318
+ return this.changeObjectStatus(eventKeyOrKeys, objectOrObjects, EventObjectInfo_1.EventObjectInfo.BOOKED, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys);
338
319
  };
339
320
  Events.prototype.bookBestAvailable = function (eventKey, number, categories, holdToken, extraData, ticketTypes, orderId, keepExtraData, ignoreChannels, channelKeys, tryToPreventOrphanSeats) {
340
321
  if (categories === void 0) { categories = null; }
@@ -356,13 +337,12 @@ var Events = /** @class */ (function () {
356
337
  if (channelKeys === void 0) { channelKeys = null; }
357
338
  return this.changeObjectStatus(eventKeyOrKeys, objectOrObjects, EventObjectInfo_1.EventObjectInfo.FREE, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys);
358
339
  };
359
- Events.prototype.hold = function (eventKeyOrKeys, objectOrObjects, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, ignoreSocialDistancing) {
340
+ Events.prototype.hold = function (eventKeyOrKeys, objectOrObjects, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys) {
360
341
  if (orderId === void 0) { orderId = null; }
361
342
  if (keepExtraData === void 0) { keepExtraData = null; }
362
343
  if (ignoreChannels === void 0) { ignoreChannels = null; }
363
344
  if (channelKeys === void 0) { channelKeys = null; }
364
- if (ignoreSocialDistancing === void 0) { ignoreSocialDistancing = null; }
365
- return this.changeObjectStatus(eventKeyOrKeys, objectOrObjects, EventObjectInfo_1.EventObjectInfo.HELD, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys, ignoreSocialDistancing);
345
+ return this.changeObjectStatus(eventKeyOrKeys, objectOrObjects, EventObjectInfo_1.EventObjectInfo.HELD, holdToken, orderId, keepExtraData, ignoreChannels, channelKeys);
366
346
  };
367
347
  Events.prototype.holdBestAvailable = function (eventKey, number, holdToken, categories, extraData, ticketTypes, orderId, keepExtraData, ignoreChannels, channelKeys, tryToPreventOrphanSeats) {
368
348
  if (categories === void 0) { categories = null; }
@@ -0,0 +1,5 @@
1
+ import { AbstractEventParams } from './AbstractEventParams';
2
+ export declare class UpdateEventParams extends AbstractEventParams {
3
+ chartKey?: string;
4
+ withChartKey(chartKey: string): this;
5
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.UpdateEventParams = void 0;
19
+ var AbstractEventParams_1 = require("./AbstractEventParams");
20
+ var UpdateEventParams = /** @class */ (function (_super) {
21
+ __extends(UpdateEventParams, _super);
22
+ function UpdateEventParams() {
23
+ return _super !== null && _super.apply(this, arguments) || this;
24
+ }
25
+ UpdateEventParams.prototype.withChartKey = function (chartKey) {
26
+ this.chartKey = chartKey;
27
+ return this;
28
+ };
29
+ return UpdateEventParams;
30
+ }(AbstractEventParams_1.AbstractEventParams));
31
+ exports.UpdateEventParams = UpdateEventParams;
@@ -0,0 +1,8 @@
1
+ export declare class LocalDate {
2
+ private readonly year;
3
+ private readonly month;
4
+ private readonly day;
5
+ constructor(year: number, month: number, day: number);
6
+ toString(): string;
7
+ static parse(date: string): LocalDate;
8
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LocalDate = void 0;
4
+ var LocalDate = /** @class */ (function () {
5
+ function LocalDate(year, month, day) {
6
+ this.year = year;
7
+ this.month = month;
8
+ this.day = day;
9
+ }
10
+ LocalDate.prototype.toString = function () {
11
+ return this.year + '-' + String(this.month).padStart(2, '0') + '-' + String(this.day).padStart(2, '0');
12
+ };
13
+ LocalDate.parse = function (date) {
14
+ var year = parseInt(date.substring(0, 4));
15
+ var month = parseInt(date.substring(5, 7));
16
+ var day = parseInt(date.substring(8, 10));
17
+ return new LocalDate(year, month, day);
18
+ };
19
+ return LocalDate;
20
+ }());
21
+ exports.LocalDate = LocalDate;
@@ -3,11 +3,9 @@ export declare class SeasonParams {
3
3
  _eventKeys?: string[];
4
4
  _key?: string;
5
5
  _numberOfEvents?: number;
6
- _socialDistancingRulesetKey?: string;
7
6
  _tableBookingConfig?: TableBookingConfig;
8
7
  key(key: string): this;
9
8
  numberOfEvents(numberOfEvents: number): this;
10
9
  eventKeys(eventKeys: string[]): this;
11
10
  tableBookingConfig(tableBookingConfig: TableBookingConfig): this;
12
- socialDistancingRulesetKey(socialDistancingRulesetKey: string): this;
13
11
  }
@@ -20,10 +20,6 @@ var SeasonParams = /** @class */ (function () {
20
20
  this._tableBookingConfig = tableBookingConfig;
21
21
  return this;
22
22
  };
23
- SeasonParams.prototype.socialDistancingRulesetKey = function (socialDistancingRulesetKey) {
24
- this._socialDistancingRulesetKey = socialDistancingRulesetKey;
25
- return this;
26
- };
27
23
  return SeasonParams;
28
24
  }());
29
25
  exports.SeasonParams = SeasonParams;
@@ -61,9 +61,6 @@ var Seasons = /** @class */ (function () {
61
61
  if (seasonParams._tableBookingConfig !== null) {
62
62
  requestParameters.tableBookingConfig = seasonParams._tableBookingConfig;
63
63
  }
64
- if (seasonParams._socialDistancingRulesetKey !== null) {
65
- requestParameters.socialDistancingRulesetKey = seasonParams._socialDistancingRulesetKey;
66
- }
67
64
  }
68
65
  return this.client.post('/seasons', requestParameters)
69
66
  .then(function (res) { return new Season_1.Season(res.data); });
@@ -14,7 +14,6 @@ export { Chart } from './Charts/Chart';
14
14
  export { ChartListParams } from './Charts/ChartListParams';
15
15
  export { ChartObjectInfo } from './Charts/ChartObjectInfo';
16
16
  export { ChartValidation } from './Charts/ChartValidation';
17
- export { SocialDistancingRuleset } from './Charts/SocialDistancingRuleset';
18
17
  export { IDs } from './Common/IDs';
19
18
  export { LabelAndType } from './Common/LabelAndType';
20
19
  export { Labels } from './Common/Labels';
package/dist/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Workspaces = exports.Workspace = exports.Users = exports.User = exports.Subaccounts = exports.Subaccount = exports.Seasons = exports.SeasonParams = exports.Season = exports.UsageReports = exports.EventReports = exports.ChartReports = exports.Invitations = exports.Invitation = exports.HoldTokens = exports.HoldToken = exports.TableBookingConfig = exports.StatusChangesParams = exports.StatusChangeRequest = exports.StatusChangeOrigin = exports.StatusChange = exports.ObjectProperties = exports.ForSaleConfig = exports.Events = exports.EventObjectInfo = exports.Event = exports.Channels = exports.Channel = exports.ChangeObjectStatusResult = exports.BestAvailableObjects = exports.Labels = exports.LabelAndType = exports.IDs = exports.SocialDistancingRuleset = exports.ChartValidation = exports.ChartObjectInfo = exports.ChartListParams = exports.Chart = exports.Category = exports.DefaultRendererSettings = exports.ChartValidationSettings = exports.AccountSettings = exports.Accounts = exports.Account = exports.SeatsioClient = exports.Region = exports.PageFetcher = exports.Page = exports.Lister = void 0;
3
+ exports.Workspaces = exports.Workspace = exports.Users = exports.User = exports.Subaccounts = exports.Subaccount = exports.Seasons = exports.SeasonParams = exports.Season = exports.UsageReports = exports.EventReports = exports.ChartReports = exports.Invitations = exports.Invitation = exports.HoldTokens = exports.HoldToken = exports.TableBookingConfig = exports.StatusChangesParams = exports.StatusChangeRequest = exports.StatusChangeOrigin = exports.StatusChange = exports.ObjectProperties = exports.ForSaleConfig = exports.Events = exports.EventObjectInfo = exports.Event = exports.Channels = exports.Channel = exports.ChangeObjectStatusResult = exports.BestAvailableObjects = exports.Labels = exports.LabelAndType = exports.IDs = exports.ChartValidation = exports.ChartObjectInfo = exports.ChartListParams = exports.Chart = exports.Category = exports.DefaultRendererSettings = exports.ChartValidationSettings = exports.AccountSettings = exports.Accounts = exports.Account = exports.SeatsioClient = exports.Region = exports.PageFetcher = exports.Page = exports.Lister = void 0;
4
4
  var Lister_1 = require("./Lister");
5
5
  Object.defineProperty(exports, "Lister", { enumerable: true, get: function () { return Lister_1.Lister; } });
6
6
  var Page_1 = require("./Page");
@@ -31,8 +31,6 @@ var ChartObjectInfo_1 = require("./Charts/ChartObjectInfo");
31
31
  Object.defineProperty(exports, "ChartObjectInfo", { enumerable: true, get: function () { return ChartObjectInfo_1.ChartObjectInfo; } });
32
32
  var ChartValidation_1 = require("./Charts/ChartValidation");
33
33
  Object.defineProperty(exports, "ChartValidation", { enumerable: true, get: function () { return ChartValidation_1.ChartValidation; } });
34
- var SocialDistancingRuleset_1 = require("./Charts/SocialDistancingRuleset");
35
- Object.defineProperty(exports, "SocialDistancingRuleset", { enumerable: true, get: function () { return SocialDistancingRuleset_1.SocialDistancingRuleset; } });
36
34
  var IDs_1 = require("./Common/IDs");
37
35
  Object.defineProperty(exports, "IDs", { enumerable: true, get: function () { return IDs_1.IDs; } });
38
36
  var LabelAndType_1 = require("./Common/LabelAndType");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seatsio",
3
- "version": "76.1.0",
3
+ "version": "77.0.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [
@@ -23,19 +23,19 @@
23
23
  "devDependencies": {
24
24
  "@jest/globals": "29.5.0",
25
25
  "@types/jest": "29.5.2",
26
- "@types/node": "20.2.5",
27
- "@types/uuid": "9.0.1",
28
- "@typescript-eslint/eslint-plugin": "5.59.8",
29
- "@typescript-eslint/parser": "5.59.8",
30
- "eslint": "8.41.0",
26
+ "@types/node": "20.3.3",
27
+ "@types/uuid": "9.0.2",
28
+ "@typescript-eslint/eslint-plugin": "5.60.1",
29
+ "@typescript-eslint/parser": "5.60.1",
30
+ "eslint": "8.44.0",
31
31
  "eslint-config-standard": "17.1.0",
32
32
  "eslint-plugin-import": "2.27.5",
33
- "eslint-plugin-n": "16.0.0",
33
+ "eslint-plugin-n": "16.0.1",
34
34
  "eslint-plugin-promise": "6.1.1",
35
35
  "jest": "29.5.0",
36
36
  "jest-cli": "29.5.0",
37
- "ts-jest": "29.1.0",
38
- "typescript": "5.1.3",
37
+ "ts-jest": "29.1.1",
38
+ "typescript": "5.1.6",
39
39
  "uuid": "9.0.0"
40
40
  }
41
41
  }
@@ -1,58 +0,0 @@
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 {};
@@ -1,115 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SocialDistancingRuleset = void 0;
4
- var SocialDistancingRuleset = /** @class */ (function () {
5
- function SocialDistancingRuleset(index, name, numberOfDisabledSeatsToTheSides, disableSeatsInFrontAndBehind, disableDiagonalSeatsInFrontAndBehind, numberOfDisabledAisleSeats, maxGroupSize, maxOccupancyAbsolute, maxOccupancyPercentage, oneGroupPerTable, fixedGroupLayout, disabledSeats, enabledSeats) {
6
- this.index = index;
7
- this.name = name;
8
- this.numberOfDisabledSeatsToTheSides = numberOfDisabledSeatsToTheSides;
9
- this.disableSeatsInFrontAndBehind = disableSeatsInFrontAndBehind;
10
- this.disableDiagonalSeatsInFrontAndBehind = disableDiagonalSeatsInFrontAndBehind;
11
- this.numberOfDisabledAisleSeats = numberOfDisabledAisleSeats;
12
- this.maxGroupSize = maxGroupSize;
13
- this.maxOccupancyAbsolute = maxOccupancyAbsolute;
14
- this.maxOccupancyPercentage = maxOccupancyPercentage;
15
- this.oneGroupPerTable = oneGroupPerTable;
16
- this.fixedGroupLayout = fixedGroupLayout;
17
- this.disabledSeats = disabledSeats;
18
- this.enabledSeats = enabledSeats;
19
- }
20
- SocialDistancingRuleset.fixed = function (name) {
21
- return new FixedSocialDistancingRulesetBuilder(name);
22
- };
23
- SocialDistancingRuleset.ruleBased = function (name) {
24
- return new RuleBasedSocialDistancingRulesetBuilder(name);
25
- };
26
- SocialDistancingRuleset.fromJson = function (json) {
27
- return new SocialDistancingRuleset(json.index, json.name, json.numberOfDisabledSeatsToTheSides, json.disableSeatsInFrontAndBehind, json.disableDiagonalSeatsInFrontAndBehind, json.numberOfDisabledAisleSeats, json.maxGroupSize, json.maxOccupancyAbsolute, json.maxOccupancyPercentage, json.oneGroupPerTable, json.fixedGroupLayout, json.disabledSeats, json.enabledSeats);
28
- };
29
- return SocialDistancingRuleset;
30
- }());
31
- exports.SocialDistancingRuleset = SocialDistancingRuleset;
32
- var FixedSocialDistancingRulesetBuilder = /** @class */ (function () {
33
- function FixedSocialDistancingRulesetBuilder(name) {
34
- this.disabledSeats = [];
35
- this.index = 0;
36
- this.name = 'a name';
37
- this.name = name;
38
- }
39
- FixedSocialDistancingRulesetBuilder.prototype.build = function () {
40
- return new SocialDistancingRuleset(this.index, this.name, 0, false, false, 0, 0, 0, 0, false, true, this.disabledSeats, []);
41
- };
42
- FixedSocialDistancingRulesetBuilder.prototype.setIndex = function (index) {
43
- this.index = index;
44
- return this;
45
- };
46
- FixedSocialDistancingRulesetBuilder.prototype.setDisabledSeats = function (disabledSeats) {
47
- this.disabledSeats = disabledSeats;
48
- return this;
49
- };
50
- return FixedSocialDistancingRulesetBuilder;
51
- }());
52
- var RuleBasedSocialDistancingRulesetBuilder = /** @class */ (function () {
53
- function RuleBasedSocialDistancingRulesetBuilder(name) {
54
- this.disableDiagonalSeatsInFrontAndBehind = false;
55
- this.disableSeatsInFrontAndBehind = false;
56
- this.disabledSeats = [];
57
- this.enabledSeats = [];
58
- this.index = 0;
59
- this.maxGroupSize = 0;
60
- this.maxOccupancyAbsolute = 0;
61
- this.maxOccupancyPercentage = 0;
62
- this.numberOfDisabledAisleSeats = 0;
63
- this.numberOfDisabledSeatsToTheSides = 0;
64
- this.oneGroupPerTable = false;
65
- this.name = name;
66
- }
67
- RuleBasedSocialDistancingRulesetBuilder.prototype.build = function () {
68
- return new SocialDistancingRuleset(this.index, this.name, this.numberOfDisabledSeatsToTheSides, this.disableSeatsInFrontAndBehind, this.disableDiagonalSeatsInFrontAndBehind, this.numberOfDisabledAisleSeats, this.maxGroupSize, this.maxOccupancyAbsolute, this.maxOccupancyPercentage, this.oneGroupPerTable, false, this.disabledSeats, this.enabledSeats);
69
- };
70
- RuleBasedSocialDistancingRulesetBuilder.prototype.setIndex = function (index) {
71
- this.index = index;
72
- return this;
73
- };
74
- RuleBasedSocialDistancingRulesetBuilder.prototype.setNumberOfDisabledSeatsToTheSides = function (numberOfDisabledSeatsToTheSides) {
75
- this.numberOfDisabledSeatsToTheSides = numberOfDisabledSeatsToTheSides;
76
- return this;
77
- };
78
- RuleBasedSocialDistancingRulesetBuilder.prototype.setDisableSeatsInFrontAndBehind = function (disableSeatsInFrontAndBehind) {
79
- this.disableSeatsInFrontAndBehind = disableSeatsInFrontAndBehind;
80
- return this;
81
- };
82
- RuleBasedSocialDistancingRulesetBuilder.prototype.setDisableDiagonalSeatsInFrontAndBehind = function (disableDiagonalSeatsInFrontAndBehind) {
83
- this.disableDiagonalSeatsInFrontAndBehind = disableDiagonalSeatsInFrontAndBehind;
84
- return this;
85
- };
86
- RuleBasedSocialDistancingRulesetBuilder.prototype.setNumberOfDisabledAisleSeats = function (numberOfDisabledAisleSeats) {
87
- this.numberOfDisabledAisleSeats = numberOfDisabledAisleSeats;
88
- return this;
89
- };
90
- RuleBasedSocialDistancingRulesetBuilder.prototype.setMaxGroupSize = function (maxGroupSize) {
91
- this.maxGroupSize = maxGroupSize;
92
- return this;
93
- };
94
- RuleBasedSocialDistancingRulesetBuilder.prototype.setMaxOccupancyAbsolute = function (maxOccupancyAbsolute) {
95
- this.maxOccupancyAbsolute = maxOccupancyAbsolute;
96
- return this;
97
- };
98
- RuleBasedSocialDistancingRulesetBuilder.prototype.setMaxOccupancyPercentage = function (maxOccupancyPercentage) {
99
- this.maxOccupancyPercentage = maxOccupancyPercentage;
100
- return this;
101
- };
102
- RuleBasedSocialDistancingRulesetBuilder.prototype.setOneGroupPerTable = function (oneGroupPerTable) {
103
- this.oneGroupPerTable = oneGroupPerTable;
104
- return this;
105
- };
106
- RuleBasedSocialDistancingRulesetBuilder.prototype.setDisabledSeats = function (disabledSeats) {
107
- this.disabledSeats = disabledSeats;
108
- return this;
109
- };
110
- RuleBasedSocialDistancingRulesetBuilder.prototype.setEnabledSeats = function (enabledSeats) {
111
- this.enabledSeats = enabledSeats;
112
- return this;
113
- };
114
- return RuleBasedSocialDistancingRulesetBuilder;
115
- }());