seatsio 76.0.0 → 76.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md 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.
@@ -17,5 +17,8 @@ export declare class ChartObjectInfo {
17
17
  objectType: string;
18
18
  rightNeighbour?: string;
19
19
  section?: string;
20
+ isAccessible?: boolean;
21
+ isCompanionSeat?: boolean;
22
+ hasRestrictedView?: boolean;
20
23
  constructor(json: ChartObjectInfoJson);
21
24
  }
@@ -19,6 +19,9 @@ var ChartObjectInfo = /** @class */ (function () {
19
19
  this.rightNeighbour = json.rightNeighbour;
20
20
  this.distanceToFocalPoint = json.distanceToFocalPoint;
21
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
  }());
@@ -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;
@@ -21,6 +22,8 @@ export declare class Event {
21
22
  tableBookingConfig: TableBookingConfig;
22
23
  topLevelSeasonKey?: string;
23
24
  updatedOn: Date | null;
25
+ name: string | null;
26
+ date: LocalDate | null;
24
27
  constructor(json: EventJson);
25
28
  isSeason(): boolean;
26
29
  }
@@ -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;
@@ -22,6 +23,8 @@ var Event = /** @class */ (function () {
22
23
  this.isEventInSeason = json.isEventInSeason;
23
24
  this.objectCategories = json.objectCategories;
24
25
  this.categories = json.categories ? json.categories.map(function (c) { return Category_1.Category.fromJson(c); }) : null;
26
+ this.name = json.name || null;
27
+ this.date = json.date ? LocalDate_1.LocalDate.parse(json.date) : null;
25
28
  }
26
29
  Event.prototype.isSeason = function () {
27
30
  return false;
@@ -11,6 +11,7 @@ import { Axios } from 'axios';
11
11
  import { Category } from '../Charts/Category';
12
12
  import { Dict } from '../Dict';
13
13
  import { StatusChangeRequest } from './StatusChangeRequest';
14
+ import { LocalDate } from '../LocalDate';
14
15
  export interface ObjectIdAndTicketType {
15
16
  objectId: string;
16
17
  ticketType?: string;
@@ -21,11 +22,11 @@ export declare class Events {
21
22
  channels: Channels;
22
23
  client: Axios;
23
24
  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>;
25
+ create(chartKey: string, eventKey?: string | null, tableBookingConfig?: TableBookingConfig | null, socialDistancingRulesetKey?: string | null, objectCategories?: object | null, categories?: Category[] | null, name?: string | null, date?: LocalDate | null): Promise<Event>;
26
+ static eventCreationParams(eventKey?: string | null, tableBookingConfig?: TableBookingConfig | null, socialDistancingRulesetKey?: string | null, objectCategories?: object | null, categories?: Category[] | null, name?: string | null, date?: LocalDate | null): Dict<any>;
26
27
  createMultiple(chartKey: string, events?: any[]): Promise<Event[]>;
27
28
  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>>;
29
+ update(eventKey: string, chartKey?: string | null, newEventKey?: string | null, tableBookingConfig?: TableBookingConfig | null, socialDistancingRulesetKey?: string | null, objectCategories?: object | null, categories?: Category[] | null, name?: string | null, date?: LocalDate | null): Promise<import("axios").AxiosResponse<any, any>>;
29
30
  delete(eventKey: string): Promise<import("axios").AxiosResponse<any, any>>;
30
31
  listAll(requestParameters?: {}): import("../AsyncIterator").AsyncIterator<Event>;
31
32
  listFirstPage(pageSize?: number | null): Promise<Page<Event>>;
@@ -50,12 +50,14 @@ 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) {
53
+ Events.prototype.create = function (chartKey, eventKey, tableBookingConfig, socialDistancingRulesetKey, objectCategories, categories, name, date) {
54
54
  if (eventKey === void 0) { eventKey = null; }
55
55
  if (tableBookingConfig === void 0) { tableBookingConfig = null; }
56
56
  if (socialDistancingRulesetKey === void 0) { socialDistancingRulesetKey = null; }
57
57
  if (objectCategories === void 0) { objectCategories = null; }
58
58
  if (categories === void 0) { categories = null; }
59
+ if (name === void 0) { name = null; }
60
+ if (date === void 0) { date = null; }
59
61
  var requestParameters = {};
60
62
  requestParameters.chartKey = chartKey;
61
63
  if (eventKey !== null) {
@@ -73,21 +75,31 @@ var Events = /** @class */ (function () {
73
75
  if (categories != null) {
74
76
  requestParameters.categories = categories;
75
77
  }
78
+ if (name != null) {
79
+ requestParameters.name = name;
80
+ }
81
+ if (date != null) {
82
+ requestParameters.date = date.toString();
83
+ }
76
84
  return this.client.post('/events', requestParameters)
77
85
  .then(function (res) { return new EventDeserializer_1.EventDeserializer().fromJson(res.data); });
78
86
  };
79
- Events.eventCreationParams = function (eventKey, tableBookingConfig, socialDistancingRulesetKey, objectCategories, categories) {
87
+ Events.eventCreationParams = function (eventKey, tableBookingConfig, socialDistancingRulesetKey, objectCategories, categories, name, date) {
80
88
  if (eventKey === void 0) { eventKey = null; }
81
89
  if (tableBookingConfig === void 0) { tableBookingConfig = null; }
82
90
  if (socialDistancingRulesetKey === void 0) { socialDistancingRulesetKey = null; }
83
91
  if (objectCategories === void 0) { objectCategories = null; }
84
92
  if (categories === void 0) { categories = null; }
93
+ if (name === void 0) { name = null; }
94
+ if (date === void 0) { date = null; }
85
95
  var eventDefinition = {};
86
96
  eventDefinition.eventKey = eventKey;
87
97
  eventDefinition.tableBookingConfig = tableBookingConfig;
88
98
  eventDefinition.socialDistancingRulesetKey = socialDistancingRulesetKey;
89
99
  eventDefinition.objectCategories = objectCategories;
90
100
  eventDefinition.categories = categories;
101
+ eventDefinition.name = name;
102
+ eventDefinition.date = date;
91
103
  return eventDefinition;
92
104
  };
93
105
  Events.prototype.createMultiple = function (chartKey, events) {
@@ -112,6 +124,12 @@ var Events = /** @class */ (function () {
112
124
  if (events[i].categories != null) {
113
125
  event_1.categories = events[i].categories;
114
126
  }
127
+ if (events[i].name != null) {
128
+ event_1.name = events[i].name;
129
+ }
130
+ if (events[i].date != null) {
131
+ event_1.date = events[i].date.toString();
132
+ }
115
133
  requestParameters.events.push(event_1);
116
134
  }
117
135
  }
@@ -130,13 +148,15 @@ var Events = /** @class */ (function () {
130
148
  return this.client.get("/events/".concat(encodeURIComponent(eventKey)))
131
149
  .then(function (res) { return new EventDeserializer_1.EventDeserializer().fromJson(res.data); });
132
150
  };
133
- Events.prototype.update = function (eventKey, chartKey, newEventKey, tableBookingConfig, socialDistancingRulesetKey, objectCategories, categories) {
151
+ Events.prototype.update = function (eventKey, chartKey, newEventKey, tableBookingConfig, socialDistancingRulesetKey, objectCategories, categories, name, date) {
134
152
  if (chartKey === void 0) { chartKey = null; }
135
153
  if (newEventKey === void 0) { newEventKey = null; }
136
154
  if (tableBookingConfig === void 0) { tableBookingConfig = null; }
137
155
  if (socialDistancingRulesetKey === void 0) { socialDistancingRulesetKey = null; }
138
156
  if (objectCategories === void 0) { objectCategories = null; }
139
157
  if (categories === void 0) { categories = null; }
158
+ if (name === void 0) { name = null; }
159
+ if (date === void 0) { date = null; }
140
160
  var requestParameters = {};
141
161
  if (chartKey !== null) {
142
162
  requestParameters.chartKey = chartKey;
@@ -156,6 +176,12 @@ var Events = /** @class */ (function () {
156
176
  if (categories != null) {
157
177
  requestParameters.categories = categories;
158
178
  }
179
+ if (name != null) {
180
+ requestParameters.name = name;
181
+ }
182
+ if (date != null) {
183
+ requestParameters.date = date.toString();
184
+ }
159
185
  return this.client.post("events/".concat(encodeURIComponent(eventKey)), requestParameters);
160
186
  };
161
187
  Events.prototype.delete = function (eventKey) {
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seatsio",
3
- "version": "76.0.0",
3
+ "version": "76.2.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [
@@ -22,20 +22,20 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@jest/globals": "29.5.0",
25
- "@types/jest": "29.5.1",
26
- "@types/node": "20.1.5",
25
+ "@types/jest": "29.5.2",
26
+ "@types/node": "20.2.5",
27
27
  "@types/uuid": "9.0.1",
28
- "@typescript-eslint/eslint-plugin": "5.59.6",
29
- "@typescript-eslint/parser": "5.59.6",
30
- "eslint": "8.40.0",
31
- "eslint-config-standard": "17.0.0",
28
+ "@typescript-eslint/eslint-plugin": "5.59.8",
29
+ "@typescript-eslint/parser": "5.59.8",
30
+ "eslint": "8.41.0",
31
+ "eslint-config-standard": "17.1.0",
32
32
  "eslint-plugin-import": "2.27.5",
33
33
  "eslint-plugin-n": "16.0.0",
34
34
  "eslint-plugin-promise": "6.1.1",
35
35
  "jest": "29.5.0",
36
36
  "jest-cli": "29.5.0",
37
37
  "ts-jest": "29.1.0",
38
- "typescript": "5.0.4",
38
+ "typescript": "5.1.3",
39
39
  "uuid": "9.0.0"
40
40
  }
41
41
  }