@cinerino/sdk 5.2.0-alpha.2 → 5.2.0-alpha.4

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.
@@ -269,7 +269,7 @@ async function authorizeSeatReservationByEvent(params: {
269
269
  seller: { id: '' }
270
270
  });
271
271
 
272
- const placeOrderService = new (await client.loadService()).txn.PlaceOrder({
272
+ const offerService = new (await client.loadService()).Offer({
273
273
  endpoint: <string>process.env.API_ENDPOINT,
274
274
  auth: await auth(),
275
275
  project,
@@ -341,7 +341,7 @@ async function authorizeSeatReservationByEvent(params: {
341
341
 
342
342
  await wait(5000);
343
343
  console.log('authorizing seat reservation...');
344
- const seatReservationAuth = <IAuthorizeReservationAction>await placeOrderService.authorizeSeatReservation({
344
+ const seatReservationAuth = <IAuthorizeReservationAction>await offerService.authorizeEventService({
345
345
  object: {
346
346
  reservationFor: {
347
347
  id: screeningEvent.id
@@ -34,6 +34,13 @@ async function main() {
34
34
  project
35
35
  });
36
36
 
37
+ const offerService = new (await client.loadService()).Offer({
38
+ endpoint: <string>process.env.API_ENDPOINT,
39
+ auth: authClient,
40
+ project,
41
+ seller: { id: '' }
42
+ });
43
+
37
44
  const placeOrderService = new (await client.loadService()).txn.PlaceOrder({
38
45
  endpoint: <string>process.env.API_ENDPOINT,
39
46
  auth: authClient,
@@ -148,7 +155,7 @@ async function main() {
148
155
  event: screeningEvent,
149
156
  // seller: seller,
150
157
  transaction: { id: transaction.id }
151
- })(eventService, placeOrderService, ownershipInfoService, tokenService);
158
+ })(eventService, offerService, ownershipInfoService, tokenService);
152
159
  amount += authorizeSeatReservationResult.price;
153
160
  authorizeSeatReservationResults.push(authorizeSeatReservationResult);
154
161
  }
@@ -281,7 +288,7 @@ function authorizeSeatReservationByEvent(params: {
281
288
  // tslint:disable-next-line:max-func-body-length
282
289
  return async (
283
290
  eventService: client.service.Event,
284
- placeOrderService: client.service.transaction.PlaceOrder,
291
+ offerService: client.service.Offer,
285
292
  ownershipInfoService: client.service.person.OwnershipInfo,
286
293
  tokenService: client.service.Token
287
294
  ): Promise<client.factory.action.authorize.offer.seatReservation.IResult<client.factory.service.webAPI.Identifier.Chevre>> => {
@@ -381,7 +388,7 @@ function authorizeSeatReservationByEvent(params: {
381
388
 
382
389
  await wait(5000);
383
390
  console.log('authorizing seat reservation...');
384
- const seatReservationAuth = <IAuthorizeReservationAction>await placeOrderService.authorizeSeatReservation({
391
+ const seatReservationAuth = <IAuthorizeReservationAction>await offerService.authorizeEventService({
385
392
  object: {
386
393
  reservationFor: {
387
394
  id: screeningEvent.id
@@ -41,6 +41,12 @@ async function main() {
41
41
  project,
42
42
  seller: { id: '' }
43
43
  });
44
+ const offerService = new (await client.loadService()).Offer({
45
+ endpoint: <string>process.env.API_ENDPOINT,
46
+ auth: authClient,
47
+ project,
48
+ seller: { id: '' }
49
+ });
44
50
  const placeOrderService = new (await client.loadService()).txn.PlaceOrder({
45
51
  endpoint: <string>process.env.API_ENDPOINT,
46
52
  auth: authClient,
@@ -226,7 +232,7 @@ async function main() {
226
232
 
227
233
  await wait(5000);
228
234
  console.log('authorizing seat reservation...');
229
- const seatReservationAuth = <IAuthorizeReservationAction>await placeOrderService.authorizeSeatReservation({
235
+ const seatReservationAuth = <IAuthorizeReservationAction>await offerService.authorizeEventService({
230
236
  object: {
231
237
  reservationFor: { id: screeningEvent.id },
232
238
  acceptedOffer: selectedSeatOffers.map((o) => {
@@ -64,7 +64,5 @@ export declare class OfferCatalogService extends Service {
64
64
  page?: number;
65
65
  }): Promise<IItemListElement[]>;
66
66
  sync2aggregateOffers(): Promise<void>;
67
- convert2offerCatalogItems(params: {
68
- id: string;
69
- }): Promise<Pick<ICreateResult, 'id'>>;
67
+ convert2offerCatalogItems(params: Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'identifier' | 'name'>): Promise<Pick<ICreateResult, 'id'>>;
70
68
  }
@@ -206,11 +206,14 @@ var OfferCatalogService = /** @class */ (function (_super) {
206
206
  };
207
207
  OfferCatalogService.prototype.convert2offerCatalogItems = function (params) {
208
208
  return __awaiter(this, void 0, void 0, function () {
209
+ var id, body;
209
210
  var _this = this;
210
211
  return __generator(this, function (_a) {
212
+ id = params.id, body = __rest(params, ["id"]);
211
213
  return [2 /*return*/, this.fetch({
212
214
  uri: "/offerCatalogs/" + encodeURIComponent(String(params.id)) + "/convert2offerCatalogItems",
213
215
  method: 'PUT',
216
+ body: body,
214
217
  expectedStatusCodes: [http_status_1.CREATED, http_status_1.OK]
215
218
  })
216
219
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
@@ -61,12 +61,17 @@ export declare class OfferService extends Service {
61
61
  purpose: factory.action.authorize.offer.product.IPurpose;
62
62
  }): Promise<IAuthorizeProductOfferResult>;
63
63
  /**
64
- * イベントオファー承認
64
+ * 興行オファー承認
65
65
  */
66
66
  authorizeEventService(params: {
67
67
  object: factory.action.authorize.offer.seatReservation.IObjectWithoutDetail<factory.service.webAPI.Identifier.Chevre>;
68
68
  purpose: factory.action.authorize.offer.seatReservation.IPurpose;
69
+ }, options?: {
69
70
  expectsMinimalResponse?: boolean;
71
+ /**
72
+ * オファー未指定(座席をホールドするのみ)
73
+ */
74
+ noOfferSpecified?: boolean;
70
75
  }): Promise<IAuthorizeEventServiceResult | IMinimalAuthorizeEventServiceResult>;
71
76
  /**
72
77
  * オファー承認取消
@@ -116,9 +116,9 @@ var OfferService = /** @class */ (function (_super) {
116
116
  });
117
117
  };
118
118
  /**
119
- * イベントオファー承認
119
+ * 興行オファー承認
120
120
  */
121
- OfferService.prototype.authorizeEventService = function (params) {
121
+ OfferService.prototype.authorizeEventService = function (params, options) {
122
122
  return __awaiter(this, void 0, void 0, function () {
123
123
  var _this = this;
124
124
  return __generator(this, function (_a) {
@@ -127,7 +127,7 @@ var OfferService = /** @class */ (function (_super) {
127
127
  method: 'POST',
128
128
  expectedStatusCodes: [http_status_1.CREATED],
129
129
  body: params,
130
- qs: __assign({}, (params.expectsMinimalResponse === true) ? { expectsMinimalResponse: '1' } : undefined)
130
+ qs: __assign(__assign({}, ((options === null || options === void 0 ? void 0 : options.expectsMinimalResponse) === true) ? { expectsMinimalResponse: '1' } : undefined), ((options === null || options === void 0 ? void 0 : options.noOfferSpecified) === true) ? { noOfferSpecified: '1' } : undefined)
131
131
  })
132
132
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
133
133
  return [2 /*return*/, response.json()];
@@ -1,9 +1,6 @@
1
+ import { IAuthorizeEventServiceResult, IMinimalAuthorizeEventServiceResult } from '../chevreTxn/transaction/placeOrder/factory';
1
2
  import * as factory from '../factory';
2
- import { ISearchResult, Service } from '../service';
3
- export interface IPurpose {
4
- typeOf: factory.transactionType;
5
- id: string;
6
- }
3
+ import { Service } from '../service';
7
4
  interface ISearchConditions {
8
5
  limit?: number;
9
6
  page?: number;
@@ -20,7 +17,40 @@ interface ISearchConditions {
20
17
  export declare class OfferService extends Service {
21
18
  /**
22
19
  * オファー検索
20
+ * 管理者権限が必要です
21
+ */
22
+ search(params: ISearchConditions): Promise<factory.unitPriceOffer.IUnitPriceOffer[]>;
23
+ /**
24
+ * 興行オファー承認
23
25
  */
24
- search(params: ISearchConditions): Promise<ISearchResult<factory.unitPriceOffer.IUnitPriceOffer[]>>;
26
+ authorizeEventService(params: {
27
+ object: factory.action.authorize.offer.seatReservation.IObjectWithoutDetail<factory.service.webAPI.Identifier.Chevre>;
28
+ purpose: factory.action.authorize.offer.seatReservation.IPurpose;
29
+ }, options?: {
30
+ /**
31
+ * レスポンスを最小化する
32
+ * Promise<IMinimalAuthorizeEventServiceResult>が返ります
33
+ */
34
+ expectsMinimalResponse?: boolean;
35
+ /**
36
+ * オファー未指定(座席をホールドするのみ)
37
+ */
38
+ noOfferSpecified?: boolean;
39
+ }): Promise<IAuthorizeEventServiceResult | IMinimalAuthorizeEventServiceResult>;
40
+ /**
41
+ * 興行オファー承認取消
42
+ */
43
+ voidAuthorization(params: {
44
+ /**
45
+ * アクションID
46
+ */
47
+ id: string;
48
+ object: {
49
+ itemOffered: {
50
+ typeOf: factory.product.ProductType.EventService;
51
+ };
52
+ };
53
+ purpose: factory.action.authorize.offer.seatReservation.IPurpose;
54
+ }): Promise<void>;
25
55
  }
26
56
  export {};
@@ -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) {
@@ -50,9 +61,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
50
61
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
62
  }
52
63
  };
64
+ var __rest = (this && this.__rest) || function (s, e) {
65
+ var t = {};
66
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
67
+ t[p] = s[p];
68
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
69
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
70
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
71
+ t[p[i]] = s[p[i]];
72
+ }
73
+ return t;
74
+ };
53
75
  Object.defineProperty(exports, "__esModule", { value: true });
54
76
  exports.OfferService = void 0;
55
77
  var http_status_1 = require("http-status");
78
+ var factory = require("../factory");
56
79
  var service_1 = require("../service");
57
80
  /**
58
81
  * オファーサービス
@@ -64,6 +87,7 @@ var OfferService = /** @class */ (function (_super) {
64
87
  }
65
88
  /**
66
89
  * オファー検索
90
+ * 管理者権限が必要です
67
91
  */
68
92
  OfferService.prototype.search = function (
69
93
  // params: factory.offer.ISearchConditions
@@ -77,18 +101,52 @@ var OfferService = /** @class */ (function (_super) {
77
101
  qs: params,
78
102
  expectedStatusCodes: [http_status_1.OK]
79
103
  })
80
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
81
- var _a;
82
- return __generator(this, function (_b) {
83
- switch (_b.label) {
84
- case 0:
85
- _a = {};
86
- return [4 /*yield*/, response.json()];
87
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
88
- _a)];
89
- }
90
- });
91
- }); })];
104
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
105
+ return [2 /*return*/, response.json()];
106
+ }); }); })];
107
+ });
108
+ });
109
+ };
110
+ /**
111
+ * 興行オファー承認
112
+ */
113
+ OfferService.prototype.authorizeEventService = function (params, options) {
114
+ return __awaiter(this, void 0, void 0, function () {
115
+ var _this = this;
116
+ return __generator(this, function (_a) {
117
+ return [2 /*return*/, this.fetch({
118
+ uri: "/offers/" + factory.product.ProductType.EventService + "/authorize",
119
+ method: 'POST',
120
+ expectedStatusCodes: [http_status_1.CREATED],
121
+ body: params,
122
+ qs: __assign(__assign({}, ((options === null || options === void 0 ? void 0 : options.expectsMinimalResponse) === true) ? { expectsMinimalResponse: '1' } : undefined), ((options === null || options === void 0 ? void 0 : options.noOfferSpecified) === true) ? { noOfferSpecified: '1' } : undefined)
123
+ })
124
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
125
+ return [2 /*return*/, response.json()];
126
+ }); }); })];
127
+ });
128
+ });
129
+ };
130
+ /**
131
+ * 興行オファー承認取消
132
+ */
133
+ OfferService.prototype.voidAuthorization = function (params) {
134
+ return __awaiter(this, void 0, void 0, function () {
135
+ var id, object, body;
136
+ return __generator(this, function (_a) {
137
+ switch (_a.label) {
138
+ case 0:
139
+ id = params.id, object = params.object, body = __rest(params, ["id", "object"]);
140
+ return [4 /*yield*/, this.fetch({
141
+ uri: "/offers/" + object.itemOffered.typeOf + "/authorize/" + id + "/void",
142
+ method: 'PUT',
143
+ expectedStatusCodes: [http_status_1.NO_CONTENT],
144
+ body: body
145
+ })];
146
+ case 1:
147
+ _a.sent();
148
+ return [2 /*return*/];
149
+ }
92
150
  });
93
151
  });
94
152
  };
@@ -1,4 +1,4 @@
1
- import { IAuthorizeEventServiceResult, IConfirmResult, IMinimalAuthorizeEventServiceResult, IMinimalConfirmResult, IStartParams, IStartPlaceOrderResult } from '../../chevreTxn/transaction/placeOrder/factory';
1
+ import { IConfirmResult, IMinimalConfirmResult, IStartParams, IStartPlaceOrderResult } from '../../chevreTxn/transaction/placeOrder/factory';
2
2
  import * as factory from '../../factory';
3
3
  import { Service } from '../../service';
4
4
  import { ISetProfileParams, TransactionService } from '../transaction';
@@ -11,28 +11,6 @@ export declare class PlaceOrderTransactionService extends Service implements Tra
11
11
  * 取引開始
12
12
  */
13
13
  start(params: IStartParams): Promise<IStartPlaceOrderResult>;
14
- /**
15
- * イベントオファー承認
16
- */
17
- authorizeSeatReservation(params: {
18
- object: factory.action.authorize.offer.seatReservation.IObjectWithoutDetail<factory.service.webAPI.Identifier.Chevre>;
19
- purpose: factory.action.authorize.offer.seatReservation.IPurpose;
20
- /**
21
- * レスポンスを最小化する
22
- * Promise<IMinimalAuthorizeEventServiceResult>が返ります
23
- */
24
- expectsMinimalResponse?: boolean;
25
- }): Promise<IAuthorizeEventServiceResult | IMinimalAuthorizeEventServiceResult>;
26
- /**
27
- * イベントオファー承認取消
28
- */
29
- voidSeatReservation(params: {
30
- /**
31
- * アクションID
32
- */
33
- id: string;
34
- purpose: factory.action.authorize.offer.seatReservation.IPurpose;
35
- }): Promise<void>;
36
14
  /**
37
15
  * 取引人プロフィール変更
38
16
  */
@@ -95,45 +95,6 @@ var PlaceOrderTransactionService = /** @class */ (function (_super) {
95
95
  });
96
96
  });
97
97
  };
98
- /**
99
- * イベントオファー承認
100
- */
101
- PlaceOrderTransactionService.prototype.authorizeSeatReservation = function (params) {
102
- return __awaiter(this, void 0, void 0, function () {
103
- var _this = this;
104
- return __generator(this, function (_a) {
105
- return [2 /*return*/, this.fetch({
106
- uri: "/transactions/" + this.typeOf + "/" + params.purpose.id + "/actions/authorize/offer/seatReservation",
107
- method: 'POST',
108
- expectedStatusCodes: [http_status_1.CREATED],
109
- body: params.object,
110
- qs: __assign({}, (params.expectsMinimalResponse === true) ? { expectsMinimalResponse: '1' } : undefined)
111
- })
112
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
113
- return [2 /*return*/, response.json()];
114
- }); }); })];
115
- });
116
- });
117
- };
118
- /**
119
- * イベントオファー承認取消
120
- */
121
- PlaceOrderTransactionService.prototype.voidSeatReservation = function (params) {
122
- return __awaiter(this, void 0, void 0, function () {
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
125
- case 0: return [4 /*yield*/, this.fetch({
126
- uri: "/transactions/" + this.typeOf + "/" + params.purpose.id + "/actions/authorize/offer/seatReservation/" + params.id + "/cancel",
127
- method: 'PUT',
128
- expectedStatusCodes: [http_status_1.NO_CONTENT]
129
- })];
130
- case 1:
131
- _a.sent();
132
- return [2 /*return*/];
133
- }
134
- });
135
- });
136
- };
137
98
  /**
138
99
  * 取引人プロフィール変更
139
100
  */
@@ -12,7 +12,7 @@ interface IAppliesToSurfrock {
12
12
  */
13
13
  export declare class PlaceOrderTransaction4ssktsService extends PlaceOrderTransactionService {
14
14
  /**
15
- * COAイベントオファー承認
15
+ * COA興行オファー承認
16
16
  */
17
17
  createSeatReservationAuthorization(params: {
18
18
  object: {
@@ -34,7 +34,7 @@ export declare class PlaceOrderTransaction4ssktsService extends PlaceOrderTransa
34
34
  purpose: factory.action.authorize.offer.seatReservation.IPurpose;
35
35
  }): Promise<IAuthorizeCOAEventServiceResult>;
36
36
  /**
37
- * COAイベントオファー承認取消
37
+ * COA興行オファー承認取消
38
38
  */
39
39
  cancelSeatReservationAuthorization(params: {
40
40
  /**
@@ -44,7 +44,7 @@ export declare class PlaceOrderTransaction4ssktsService extends PlaceOrderTransa
44
44
  purpose: factory.action.authorize.offer.seatReservation.IPurpose;
45
45
  }): Promise<void>;
46
46
  /**
47
- * COAイベントオファー承認の供給情報を変更する
47
+ * COA興行オファー承認の供給情報を変更する
48
48
  * 完了ステータスの承認アクションに対して券種変更する際に使用
49
49
  */
50
50
  changeSeatReservationOffers(params: {
@@ -77,7 +77,7 @@ var PlaceOrderTransaction4ssktsService = /** @class */ (function (_super) {
77
77
  // super(options)/* istanbul ignore next */;
78
78
  // }
79
79
  /**
80
- * COAイベントオファー承認
80
+ * COA興行オファー承認
81
81
  */
82
82
  PlaceOrderTransaction4ssktsService.prototype.createSeatReservationAuthorization = function (params) {
83
83
  var _a, _b;
@@ -99,7 +99,7 @@ var PlaceOrderTransaction4ssktsService = /** @class */ (function (_super) {
99
99
  });
100
100
  };
101
101
  /**
102
- * COAイベントオファー承認取消
102
+ * COA興行オファー承認取消
103
103
  */
104
104
  PlaceOrderTransaction4ssktsService.prototype.cancelSeatReservationAuthorization = function (params) {
105
105
  return __awaiter(this, void 0, void 0, function () {
@@ -118,7 +118,7 @@ var PlaceOrderTransaction4ssktsService = /** @class */ (function (_super) {
118
118
  });
119
119
  };
120
120
  /**
121
- * COAイベントオファー承認の供給情報を変更する
121
+ * COA興行オファー承認の供給情報を変更する
122
122
  * 完了ステータスの承認アクションに対して券種変更する際に使用
123
123
  */
124
124
  PlaceOrderTransaction4ssktsService.prototype.changeSeatReservationOffers = function (params) {
package/lib/bundle.js CHANGED
@@ -7990,11 +7990,14 @@ var OfferCatalogService = /** @class */ (function (_super) {
7990
7990
  };
7991
7991
  OfferCatalogService.prototype.convert2offerCatalogItems = function (params) {
7992
7992
  return __awaiter(this, void 0, void 0, function () {
7993
+ var id, body;
7993
7994
  var _this = this;
7994
7995
  return __generator(this, function (_a) {
7996
+ id = params.id, body = __rest(params, ["id"]);
7995
7997
  return [2 /*return*/, this.fetch({
7996
7998
  uri: "/offerCatalogs/" + encodeURIComponent(String(params.id)) + "/convert2offerCatalogItems",
7997
7999
  method: 'PUT',
8000
+ body: body,
7998
8001
  expectedStatusCodes: [http_status_1.CREATED, http_status_1.OK]
7999
8002
  })
8000
8003
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
@@ -12225,9 +12228,9 @@ var OfferService = /** @class */ (function (_super) {
12225
12228
  });
12226
12229
  };
12227
12230
  /**
12228
- * イベントオファー承認
12231
+ * 興行オファー承認
12229
12232
  */
12230
- OfferService.prototype.authorizeEventService = function (params) {
12233
+ OfferService.prototype.authorizeEventService = function (params, options) {
12231
12234
  return __awaiter(this, void 0, void 0, function () {
12232
12235
  var _this = this;
12233
12236
  return __generator(this, function (_a) {
@@ -12236,7 +12239,7 @@ var OfferService = /** @class */ (function (_super) {
12236
12239
  method: 'POST',
12237
12240
  expectedStatusCodes: [http_status_1.CREATED],
12238
12241
  body: params,
12239
- qs: __assign({}, (params.expectsMinimalResponse === true) ? { expectsMinimalResponse: '1' } : undefined)
12242
+ qs: __assign(__assign({}, ((options === null || options === void 0 ? void 0 : options.expectsMinimalResponse) === true) ? { expectsMinimalResponse: '1' } : undefined), ((options === null || options === void 0 ? void 0 : options.noOfferSpecified) === true) ? { noOfferSpecified: '1' } : undefined)
12240
12243
  })
12241
12244
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
12242
12245
  return [2 /*return*/, response.json()];
@@ -14747,6 +14750,17 @@ var __extends = (this && this.__extends) || (function () {
14747
14750
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14748
14751
  };
14749
14752
  })();
14753
+ var __assign = (this && this.__assign) || function () {
14754
+ __assign = Object.assign || function(t) {
14755
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
14756
+ s = arguments[i];
14757
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
14758
+ t[p] = s[p];
14759
+ }
14760
+ return t;
14761
+ };
14762
+ return __assign.apply(this, arguments);
14763
+ };
14750
14764
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14751
14765
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14752
14766
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -14783,9 +14797,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14783
14797
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
14784
14798
  }
14785
14799
  };
14800
+ var __rest = (this && this.__rest) || function (s, e) {
14801
+ var t = {};
14802
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14803
+ t[p] = s[p];
14804
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
14805
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
14806
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
14807
+ t[p[i]] = s[p[i]];
14808
+ }
14809
+ return t;
14810
+ };
14786
14811
  Object.defineProperty(exports, "__esModule", { value: true });
14787
14812
  exports.OfferService = void 0;
14788
14813
  var http_status_1 = require("http-status");
14814
+ var factory = require("../factory");
14789
14815
  var service_1 = require("../service");
14790
14816
  /**
14791
14817
  * オファーサービス
@@ -14797,6 +14823,7 @@ var OfferService = /** @class */ (function (_super) {
14797
14823
  }
14798
14824
  /**
14799
14825
  * オファー検索
14826
+ * 管理者権限が必要です
14800
14827
  */
14801
14828
  OfferService.prototype.search = function (
14802
14829
  // params: factory.offer.ISearchConditions
@@ -14810,18 +14837,52 @@ var OfferService = /** @class */ (function (_super) {
14810
14837
  qs: params,
14811
14838
  expectedStatusCodes: [http_status_1.OK]
14812
14839
  })
14813
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
14814
- var _a;
14815
- return __generator(this, function (_b) {
14816
- switch (_b.label) {
14817
- case 0:
14818
- _a = {};
14819
- return [4 /*yield*/, response.json()];
14820
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
14821
- _a)];
14822
- }
14823
- });
14824
- }); })];
14840
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
14841
+ return [2 /*return*/, response.json()];
14842
+ }); }); })];
14843
+ });
14844
+ });
14845
+ };
14846
+ /**
14847
+ * 興行オファー承認
14848
+ */
14849
+ OfferService.prototype.authorizeEventService = function (params, options) {
14850
+ return __awaiter(this, void 0, void 0, function () {
14851
+ var _this = this;
14852
+ return __generator(this, function (_a) {
14853
+ return [2 /*return*/, this.fetch({
14854
+ uri: "/offers/" + factory.product.ProductType.EventService + "/authorize",
14855
+ method: 'POST',
14856
+ expectedStatusCodes: [http_status_1.CREATED],
14857
+ body: params,
14858
+ qs: __assign(__assign({}, ((options === null || options === void 0 ? void 0 : options.expectsMinimalResponse) === true) ? { expectsMinimalResponse: '1' } : undefined), ((options === null || options === void 0 ? void 0 : options.noOfferSpecified) === true) ? { noOfferSpecified: '1' } : undefined)
14859
+ })
14860
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
14861
+ return [2 /*return*/, response.json()];
14862
+ }); }); })];
14863
+ });
14864
+ });
14865
+ };
14866
+ /**
14867
+ * 興行オファー承認取消
14868
+ */
14869
+ OfferService.prototype.voidAuthorization = function (params) {
14870
+ return __awaiter(this, void 0, void 0, function () {
14871
+ var id, object, body;
14872
+ return __generator(this, function (_a) {
14873
+ switch (_a.label) {
14874
+ case 0:
14875
+ id = params.id, object = params.object, body = __rest(params, ["id", "object"]);
14876
+ return [4 /*yield*/, this.fetch({
14877
+ uri: "/offers/" + object.itemOffered.typeOf + "/authorize/" + id + "/void",
14878
+ method: 'PUT',
14879
+ expectedStatusCodes: [http_status_1.NO_CONTENT],
14880
+ body: body
14881
+ })];
14882
+ case 1:
14883
+ _a.sent();
14884
+ return [2 /*return*/];
14885
+ }
14825
14886
  });
14826
14887
  });
14827
14888
  };
@@ -14829,7 +14890,7 @@ var OfferService = /** @class */ (function (_super) {
14829
14890
  }(service_1.Service));
14830
14891
  exports.OfferService = OfferService;
14831
14892
 
14832
- },{"../service":85,"http-status":316}],93:[function(require,module,exports){
14893
+ },{"../factory":80,"../service":85,"http-status":316}],93:[function(require,module,exports){
14833
14894
  "use strict";
14834
14895
  var __extends = (this && this.__extends) || (function () {
14835
14896
  var extendStatics = function (d, b) {
@@ -16836,45 +16897,6 @@ var PlaceOrderTransactionService = /** @class */ (function (_super) {
16836
16897
  });
16837
16898
  });
16838
16899
  };
16839
- /**
16840
- * イベントオファー承認
16841
- */
16842
- PlaceOrderTransactionService.prototype.authorizeSeatReservation = function (params) {
16843
- return __awaiter(this, void 0, void 0, function () {
16844
- var _this = this;
16845
- return __generator(this, function (_a) {
16846
- return [2 /*return*/, this.fetch({
16847
- uri: "/transactions/" + this.typeOf + "/" + params.purpose.id + "/actions/authorize/offer/seatReservation",
16848
- method: 'POST',
16849
- expectedStatusCodes: [http_status_1.CREATED],
16850
- body: params.object,
16851
- qs: __assign({}, (params.expectsMinimalResponse === true) ? { expectsMinimalResponse: '1' } : undefined)
16852
- })
16853
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
16854
- return [2 /*return*/, response.json()];
16855
- }); }); })];
16856
- });
16857
- });
16858
- };
16859
- /**
16860
- * イベントオファー承認取消
16861
- */
16862
- PlaceOrderTransactionService.prototype.voidSeatReservation = function (params) {
16863
- return __awaiter(this, void 0, void 0, function () {
16864
- return __generator(this, function (_a) {
16865
- switch (_a.label) {
16866
- case 0: return [4 /*yield*/, this.fetch({
16867
- uri: "/transactions/" + this.typeOf + "/" + params.purpose.id + "/actions/authorize/offer/seatReservation/" + params.id + "/cancel",
16868
- method: 'PUT',
16869
- expectedStatusCodes: [http_status_1.NO_CONTENT]
16870
- })];
16871
- case 1:
16872
- _a.sent();
16873
- return [2 /*return*/];
16874
- }
16875
- });
16876
- });
16877
- };
16878
16900
  /**
16879
16901
  * 取引人プロフィール変更
16880
16902
  */
@@ -17057,7 +17079,7 @@ var PlaceOrderTransaction4ssktsService = /** @class */ (function (_super) {
17057
17079
  // super(options)/* istanbul ignore next */;
17058
17080
  // }
17059
17081
  /**
17060
- * COAイベントオファー承認
17082
+ * COA興行オファー承認
17061
17083
  */
17062
17084
  PlaceOrderTransaction4ssktsService.prototype.createSeatReservationAuthorization = function (params) {
17063
17085
  var _a, _b;
@@ -17079,7 +17101,7 @@ var PlaceOrderTransaction4ssktsService = /** @class */ (function (_super) {
17079
17101
  });
17080
17102
  };
17081
17103
  /**
17082
- * COAイベントオファー承認取消
17104
+ * COA興行オファー承認取消
17083
17105
  */
17084
17106
  PlaceOrderTransaction4ssktsService.prototype.cancelSeatReservationAuthorization = function (params) {
17085
17107
  return __awaiter(this, void 0, void 0, function () {
@@ -17098,7 +17120,7 @@ var PlaceOrderTransaction4ssktsService = /** @class */ (function (_super) {
17098
17120
  });
17099
17121
  };
17100
17122
  /**
17101
- * COAイベントオファー承認の供給情報を変更する
17123
+ * COA興行オファー承認の供給情報を変更する
17102
17124
  * 完了ステータスの承認アクションに対して券種変更する際に使用
17103
17125
  */
17104
17126
  PlaceOrderTransaction4ssktsService.prototype.changeSeatReservationOffers = function (params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "5.2.0-alpha.2",
3
+ "version": "5.2.0-alpha.4",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {