@cinerino/sdk 12.12.0-alpha.4 → 12.12.0-alpha.5

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.
@@ -63,10 +63,13 @@ export declare class EventService extends Service {
63
63
  }): Promise<Omit<factory.product.ITicketOffer, 'priceCurrency'>[]>;
64
64
  /**
65
65
  * イベントに対する座席検索
66
+ * @deprecated use find seatOffers
66
67
  */
67
- searchSeats(params: {
68
+ findSeatOffersDeprecated(params: {
68
69
  id: string;
69
- } & Pick<factory.place.seat.ISearchConditions, 'additionalProperty' | 'branchCode' | 'containedInPlace' | 'limit' | 'name' | 'page' | 'parentOrganization' | 'seatingType' | 'sort'>): Promise<ISeatAsEventOffer[]>;
70
+ } & Pick<factory.place.seat.ISearchConditions, 'additionalProperty' | 'branchCode' | 'containedInPlace' | 'limit' | 'name' | 'page' | 'parentOrganization' | 'seatingType' | 'sort'>, options: {
71
+ useDefaultSection: boolean;
72
+ }): Promise<ISeatAsEventOffer[]>;
70
73
  /**
71
74
  * オファーで利用可能な適用決済カード条件を検索する
72
75
  */
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
17
28
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
29
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
30
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -161,17 +172,19 @@ var EventService = /** @class */ (function (_super) {
161
172
  };
162
173
  /**
163
174
  * イベントに対する座席検索
175
+ * @deprecated use find seatOffers
164
176
  */
165
- EventService.prototype.searchSeats = function (params) {
177
+ EventService.prototype.findSeatOffersDeprecated = function (params, options) {
166
178
  return __awaiter(this, void 0, void 0, function () {
167
- var id, query;
179
+ var id, query, useDefaultSection;
168
180
  var _this = this;
169
181
  return __generator(this, function (_a) {
170
182
  id = params.id, query = __rest(params, ["id"]);
183
+ useDefaultSection = options.useDefaultSection;
171
184
  return [2 /*return*/, this.fetch({
172
185
  uri: "/events/" + encodeURIComponent(String(id)) + "/seats",
173
186
  method: 'GET',
174
- qs: query,
187
+ qs: __assign(__assign({}, query), { useDefaultSection: useDefaultSection }),
175
188
  expectedStatusCodes: [http_status_1.OK]
176
189
  })
177
190
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
@@ -26,12 +26,6 @@ export declare class PlaceService extends Service {
26
26
  searchScreeningRoomSections(params: Omit<factory.place.screeningRoomSection.ISearchConditions, 'project'>): Promise<{
27
27
  data: IScreeningRoomSection[];
28
28
  }>;
29
- /**
30
- * 座席検索
31
- */
32
- searchSeats(params: Omit<factory.place.seat.ISearchConditions, 'project'>): Promise<{
33
- data: ISeat[];
34
- }>;
35
29
  /**
36
30
  * ルーム指定でセクション検索
37
31
  * ルーティングによる販売者指定が必須
@@ -147,34 +147,6 @@ var PlaceService = /** @class */ (function (_super) {
147
147
  });
148
148
  });
149
149
  };
150
- /**
151
- * 座席検索
152
- */
153
- PlaceService.prototype.searchSeats = function (params) {
154
- return __awaiter(this, void 0, void 0, function () {
155
- var _this = this;
156
- return __generator(this, function (_a) {
157
- return [2 /*return*/, this.fetch({
158
- uri: "/places/" + factory.placeType.Seat,
159
- method: 'GET',
160
- qs: params,
161
- expectedStatusCodes: [http_status_1.OK]
162
- })
163
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
164
- var _a;
165
- return __generator(this, function (_b) {
166
- switch (_b.label) {
167
- case 0:
168
- _a = {};
169
- return [4 /*yield*/, response.json()];
170
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
171
- _a)];
172
- }
173
- });
174
- }); })];
175
- });
176
- });
177
- };
178
150
  /**
179
151
  * ルーム指定でセクション検索
180
152
  * ルーティングによる販売者指定が必須
@@ -178,6 +178,8 @@ export declare class EventService extends Service {
178
178
  };
179
179
  limit: number;
180
180
  page: number;
181
+ }, options?: {
182
+ useDefaultSection?: boolean;
181
183
  }): Promise<ISearchResult<ISeatAsEventOffer[]>>;
182
184
  /**
183
185
  * 興行オファー検索
@@ -217,16 +217,17 @@ var EventService = /** @class */ (function (_super) {
217
217
  /**
218
218
  * イベントに対する座席検索
219
219
  */
220
- EventService.prototype.searchSeats = function (params) {
220
+ EventService.prototype.searchSeats = function (params, options) {
221
221
  return __awaiter(this, void 0, void 0, function () {
222
- var event, query;
222
+ var event, query, useDefaultSection;
223
223
  var _this = this;
224
224
  return __generator(this, function (_a) {
225
225
  event = params.event, query = __rest(params, ["event"]);
226
+ useDefaultSection = (options === null || options === void 0 ? void 0 : options.useDefaultSection) === true;
226
227
  return [2 /*return*/, this.fetch({
227
228
  uri: "/events/" + encodeURIComponent(String(event.id)) + "/seats",
228
229
  method: 'GET',
229
- qs: query,
230
+ qs: __assign(__assign({}, query), { useDefaultSection: useDefaultSection }),
230
231
  expectedStatusCodes: [http_status_1.OK]
231
232
  })
232
233
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
@@ -1,4 +1,4 @@
1
- import { IScreeningRoom, ISeat } from '../../chevre/place';
1
+ import { IScreeningRoom } from '../../chevre/place';
2
2
  import * as factory from '../../factory';
3
3
  import { IAdditionalOptions, IOptions, ISearchResult, Service } from '../../service';
4
4
  /**
@@ -34,54 +34,4 @@ export declare class PlaceService extends Service {
34
34
  };
35
35
  };
36
36
  }): Promise<ISearchResult<IScreeningRoom[]>>;
37
- /**
38
- * 座席検索
39
- */
40
- searchSeats(params: {
41
- limit?: number;
42
- page?: number;
43
- /**
44
- * 座席コード
45
- */
46
- branchCode?: {
47
- $eq?: string;
48
- /**
49
- * max: 10
50
- */
51
- $in?: string[];
52
- };
53
- /**
54
- * セクション条件
55
- */
56
- containedInPlace?: {
57
- branchCode?: {
58
- /**
59
- * max: 10
60
- */
61
- $in?: string[];
62
- };
63
- /**
64
- * ルーム条件
65
- */
66
- containedInPlace?: {
67
- /**
68
- * 施設条件
69
- */
70
- containedInPlace?: {
71
- /**
72
- * 施設コード
73
- */
74
- branchCode?: {
75
- $eq?: string;
76
- };
77
- };
78
- };
79
- };
80
- }): Promise<ISearchResult<ISeat[]>>;
81
- /**
82
- * ターミナル検索
83
- */
84
- searchBusStops(params: Omit<factory.place.busStop.ISearchConditions, 'project'>): Promise<{
85
- data: factory.place.busStop.IPlace[];
86
- }>;
87
37
  }
@@ -130,62 +130,6 @@ var PlaceService = /** @class */ (function (_super) {
130
130
  });
131
131
  });
132
132
  };
133
- /**
134
- * 座席検索
135
- */
136
- PlaceService.prototype.searchSeats = function (params) {
137
- return __awaiter(this, void 0, void 0, function () {
138
- var _this = this;
139
- return __generator(this, function (_a) {
140
- return [2 /*return*/, this.fetch({
141
- uri: "/places/" + factory.placeType.Seat,
142
- method: 'GET',
143
- qs: params,
144
- expectedStatusCodes: [http_status_1.OK]
145
- })
146
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
147
- var _a;
148
- return __generator(this, function (_b) {
149
- switch (_b.label) {
150
- case 0:
151
- _a = {};
152
- return [4 /*yield*/, response.json()];
153
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
154
- _a)];
155
- }
156
- });
157
- }); })];
158
- });
159
- });
160
- };
161
- /**
162
- * ターミナル検索
163
- */
164
- PlaceService.prototype.searchBusStops = function (params) {
165
- return __awaiter(this, void 0, void 0, function () {
166
- var _this = this;
167
- return __generator(this, function (_a) {
168
- return [2 /*return*/, this.fetch({
169
- uri: "/places/" + factory.placeType.BusStop,
170
- method: 'GET',
171
- qs: params,
172
- expectedStatusCodes: [http_status_1.OK]
173
- })
174
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
175
- var _a;
176
- return __generator(this, function (_b) {
177
- switch (_b.label) {
178
- case 0:
179
- _a = {};
180
- return [4 /*yield*/, response.json()];
181
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
182
- _a)];
183
- }
184
- });
185
- }); })];
186
- });
187
- });
188
- };
189
133
  return PlaceService;
190
134
  }(service_1.Service));
191
135
  exports.PlaceService = PlaceService;
package/lib/bundle.js CHANGED
@@ -671,6 +671,17 @@ var __extends = (this && this.__extends) || (function () {
671
671
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
672
672
  };
673
673
  })();
674
+ var __assign = (this && this.__assign) || function () {
675
+ __assign = Object.assign || function(t) {
676
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
677
+ s = arguments[i];
678
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
679
+ t[p] = s[p];
680
+ }
681
+ return t;
682
+ };
683
+ return __assign.apply(this, arguments);
684
+ };
674
685
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
675
686
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
676
687
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -818,17 +829,19 @@ var EventService = /** @class */ (function (_super) {
818
829
  };
819
830
  /**
820
831
  * イベントに対する座席検索
832
+ * @deprecated use find seatOffers
821
833
  */
822
- EventService.prototype.searchSeats = function (params) {
834
+ EventService.prototype.findSeatOffersDeprecated = function (params, options) {
823
835
  return __awaiter(this, void 0, void 0, function () {
824
- var id, query;
836
+ var id, query, useDefaultSection;
825
837
  var _this = this;
826
838
  return __generator(this, function (_a) {
827
839
  id = params.id, query = __rest(params, ["id"]);
840
+ useDefaultSection = options.useDefaultSection;
828
841
  return [2 /*return*/, this.fetch({
829
842
  uri: "/events/" + encodeURIComponent(String(id)) + "/seats",
830
843
  method: 'GET',
831
- qs: query,
844
+ qs: __assign(__assign({}, query), { useDefaultSection: useDefaultSection }),
832
845
  expectedStatusCodes: [http_status_1.OK]
833
846
  })
834
847
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
@@ -1426,34 +1439,6 @@ var PlaceService = /** @class */ (function (_super) {
1426
1439
  });
1427
1440
  });
1428
1441
  };
1429
- /**
1430
- * 座席検索
1431
- */
1432
- PlaceService.prototype.searchSeats = function (params) {
1433
- return __awaiter(this, void 0, void 0, function () {
1434
- var _this = this;
1435
- return __generator(this, function (_a) {
1436
- return [2 /*return*/, this.fetch({
1437
- uri: "/places/" + factory.placeType.Seat,
1438
- method: 'GET',
1439
- qs: params,
1440
- expectedStatusCodes: [http_status_1.OK]
1441
- })
1442
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1443
- var _a;
1444
- return __generator(this, function (_b) {
1445
- switch (_b.label) {
1446
- case 0:
1447
- _a = {};
1448
- return [4 /*yield*/, response.json()];
1449
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
1450
- _a)];
1451
- }
1452
- });
1453
- }); })];
1454
- });
1455
- });
1456
- };
1457
1442
  /**
1458
1443
  * ルーム指定でセクション検索
1459
1444
  * ルーティングによる販売者指定が必須
@@ -20689,16 +20674,17 @@ var EventService = /** @class */ (function (_super) {
20689
20674
  /**
20690
20675
  * イベントに対する座席検索
20691
20676
  */
20692
- EventService.prototype.searchSeats = function (params) {
20677
+ EventService.prototype.searchSeats = function (params, options) {
20693
20678
  return __awaiter(this, void 0, void 0, function () {
20694
- var event, query;
20679
+ var event, query, useDefaultSection;
20695
20680
  var _this = this;
20696
20681
  return __generator(this, function (_a) {
20697
20682
  event = params.event, query = __rest(params, ["event"]);
20683
+ useDefaultSection = (options === null || options === void 0 ? void 0 : options.useDefaultSection) === true;
20698
20684
  return [2 /*return*/, this.fetch({
20699
20685
  uri: "/events/" + encodeURIComponent(String(event.id)) + "/seats",
20700
20686
  method: 'GET',
20701
- qs: query,
20687
+ qs: __assign(__assign({}, query), { useDefaultSection: useDefaultSection }),
20702
20688
  expectedStatusCodes: [http_status_1.OK]
20703
20689
  })
20704
20690
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
@@ -20984,62 +20970,6 @@ var PlaceService = /** @class */ (function (_super) {
20984
20970
  });
20985
20971
  });
20986
20972
  };
20987
- /**
20988
- * 座席検索
20989
- */
20990
- PlaceService.prototype.searchSeats = function (params) {
20991
- return __awaiter(this, void 0, void 0, function () {
20992
- var _this = this;
20993
- return __generator(this, function (_a) {
20994
- return [2 /*return*/, this.fetch({
20995
- uri: "/places/" + factory.placeType.Seat,
20996
- method: 'GET',
20997
- qs: params,
20998
- expectedStatusCodes: [http_status_1.OK]
20999
- })
21000
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
21001
- var _a;
21002
- return __generator(this, function (_b) {
21003
- switch (_b.label) {
21004
- case 0:
21005
- _a = {};
21006
- return [4 /*yield*/, response.json()];
21007
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
21008
- _a)];
21009
- }
21010
- });
21011
- }); })];
21012
- });
21013
- });
21014
- };
21015
- /**
21016
- * ターミナル検索
21017
- */
21018
- PlaceService.prototype.searchBusStops = function (params) {
21019
- return __awaiter(this, void 0, void 0, function () {
21020
- var _this = this;
21021
- return __generator(this, function (_a) {
21022
- return [2 /*return*/, this.fetch({
21023
- uri: "/places/" + factory.placeType.BusStop,
21024
- method: 'GET',
21025
- qs: params,
21026
- expectedStatusCodes: [http_status_1.OK]
21027
- })
21028
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
21029
- var _a;
21030
- return __generator(this, function (_b) {
21031
- switch (_b.label) {
21032
- case 0:
21033
- _a = {};
21034
- return [4 /*yield*/, response.json()];
21035
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
21036
- _a)];
21037
- }
21038
- });
21039
- }); })];
21040
- });
21041
- });
21042
- };
21043
20973
  return PlaceService;
21044
20974
  }(service_1.Service));
21045
20975
  exports.PlaceService = PlaceService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "12.12.0-alpha.4",
3
+ "version": "12.12.0-alpha.5",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -1,40 +0,0 @@
1
- // tslint:disable:no-implicit-dependencies no-console
2
- import * as client from '../../../lib/index';
3
-
4
- const PROJECT_ID = String(process.env.PROJECT_ID);
5
-
6
- async function main() {
7
- const authClient = await client.auth.ClientCredentials.createInstance({
8
- domain: <string>process.env.CHEVRE_AUTHORIZE_SERVER_DOMAIN,
9
- clientId: <string>process.env.CHEVRE_CLIENT_ID,
10
- clientSecret: <string>process.env.CHEVRE_CLIENT_SECRET,
11
- scopes: [],
12
- state: ''
13
- });
14
-
15
- const chevre = await client.loadChevre({
16
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
17
- auth: authClient
18
- });
19
-
20
- const eventService = await chevre.createEventInstance({
21
- project: { id: PROJECT_ID },
22
- seller: { id: '' }
23
- });
24
-
25
- const result = await eventService.searchSeats({
26
- id: 'bm2bfj55r',
27
- page: 1,
28
- limit: 1,
29
- branchCode: { $eq: 'B-2' }
30
- });
31
- // tslint:disable-next-line:no-null-keyword
32
- console.dir(result, { depth: null });
33
- console.log(result.length, 'events returned');
34
- }
35
-
36
- main()
37
- .then(() => {
38
- console.log('success!');
39
- })
40
- .catch(console.error);