@cinerino/sdk 7.0.0 → 7.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.
@@ -148,6 +148,7 @@ async function main() {
148
148
  const creditCardPaymentAuth = await authorizeCreditCardAsyncForcibly({
149
149
  object: {
150
150
  amount,
151
+ // amount: 1, // 間違えてみる
151
152
  paymentMethod: paymentMethodType,
152
153
  paymentMethodId, // URL発行時のpaymentMethodIdを指定
153
154
  method: '1',
@@ -268,16 +269,16 @@ async function authorizeSeatReservationByEvent(params: {
268
269
  });
269
270
 
270
271
  const selectedTicketOffer = ticketOffers.shift();
271
- console.log('ticket offer selected', selectedTicketOffer);
272
+ if (selectedTicketOffer === undefined) {
273
+ throw new Error('selectedTicketOffer undefined');
274
+ }
275
+ console.log('ticket offer selected', selectedTicketOffer.id, selectedTicketOffer.identifier, selectedTicketOffer.name.ja);
272
276
 
273
277
  // 座席をランダムに選択
274
278
  const selectedScreeningRoomSection = String(availableSeatOffers[0].containedInPlace?.branchCode);
275
279
  console.log('screening room section selected', selectedScreeningRoomSection);
276
280
  console.log(selectedScreeningRoomSection);
277
281
  const selectedSeatOffers = availableSeatOffers.slice(0, 1);
278
- if (selectedTicketOffer === undefined) {
279
- throw new Error('selectedTicketOffer undefined');
280
- }
281
282
  console.log(selectedSeatOffers.length, 'seats selected');
282
283
 
283
284
  await wait(3000);
@@ -137,6 +137,7 @@ async function main() {
137
137
  purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
138
138
  })({ paymentService });
139
139
  console.log('credit card payment authorized', creditCardPaymentAuth.id);
140
+ // throw new Error('force error');
140
141
 
141
142
  // 購入情報確認時間
142
143
  // tslint:disable-next-line:no-magic-numbers
@@ -201,7 +202,6 @@ async function authorizeSeatReservationByEvent(params: {
201
202
  seller: { id: '' }
202
203
  });
203
204
 
204
- const screeningEvent = params.event;
205
205
  const transaction = params.transaction;
206
206
 
207
207
  await wait(3000);
@@ -209,7 +209,8 @@ async function authorizeSeatReservationByEvent(params: {
209
209
  const seatReservationAuth = await placeOrderService.createSeatReservationAuthorization({
210
210
  object: {
211
211
  event: {
212
- id: screeningEvent.id
212
+ id: params.event.id
213
+ // id: '120162210202406131200920'
213
214
  },
214
215
  acceptedOffer: [
215
216
  {
@@ -234,6 +235,7 @@ async function authorizeSeatReservationByEvent(params: {
234
235
  purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
235
236
  });
236
237
  console.log('seat reservation authorized', seatReservationAuth.result.responseBody.tmpReserveNum, seatReservationAuth);
238
+ // throw new Error('force error');
237
239
 
238
240
  const amount = seatReservationAuth.result.price;
239
241
  console.log('amount:', amount);
@@ -150,7 +150,7 @@ async function main() {
150
150
  });
151
151
  // tslint:disable-next-line:no-null-keyword
152
152
  console.dir(checkMovieTicketAction, { depth: null });
153
- console.log('movieTickets checked. 有効券枚数合計:', checkMovieTicketAction.purchaseNumberAuthResult.ykknmiNumSum);
153
+ console.log('movieTickets checked. 有効券枚数:', checkMovieTicketAction.purchaseNumberAuthResult.ykknmiNumSum);
154
154
 
155
155
  // 決済承認
156
156
  await wait(3000);
@@ -13,4 +13,9 @@ export declare class ActionService extends Service {
13
13
  id: string;
14
14
  typeOf: T;
15
15
  }): Promise<IAction<T>>;
16
+ searchRecipes(params: {
17
+ recipeFor: {
18
+ id: string;
19
+ };
20
+ }): Promise<Pick<factory.recipe.IRecipe, 'recipeCategory' | 'step'>[]>;
16
21
  }
@@ -106,6 +106,21 @@ var ActionService = /** @class */ (function (_super) {
106
106
  });
107
107
  });
108
108
  };
109
+ ActionService.prototype.searchRecipes = function (params) {
110
+ return __awaiter(this, void 0, void 0, function () {
111
+ var _this = this;
112
+ return __generator(this, function (_a) {
113
+ return [2 /*return*/, this.fetch({
114
+ uri: "/actions/" + encodeURIComponent(String(params.recipeFor.id)) + "/recipe",
115
+ method: 'GET',
116
+ expectedStatusCodes: [http_status_1.OK]
117
+ })
118
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
119
+ return [2 /*return*/, response.json()];
120
+ }); }); })];
121
+ });
122
+ });
123
+ };
109
124
  return ActionService;
110
125
  }(service_1.Service));
111
126
  exports.ActionService = ActionService;
@@ -0,0 +1,21 @@
1
+ import * as factory from '../../factory';
2
+ declare type IAuthorizeCOAEventServiceActionResult = factory.action.authorize.offer.eventService.IResult<factory.service.webAPI.Identifier.COA>;
3
+ declare type ICOAResponseBody = factory.action.authorize.offer.eventService.IResponseBody<factory.service.webAPI.Identifier.COA>;
4
+ declare type IOptimizedAuthorizeCOAEventServiceActionResult = Pick<IAuthorizeCOAEventServiceActionResult, 'price'> & {
5
+ /**
6
+ * COA仮予約レスポンス
7
+ * tmpReserveNum: 仮予約番号
8
+ */
9
+ responseBody: Pick<ICOAResponseBody, 'tmpReserveNum'>;
10
+ };
11
+ /**
12
+ * COA興行オファー承認レスポンス
13
+ */
14
+ export interface IAuthorizeCOAEventServiceResult {
15
+ /**
16
+ * 承認アクションID
17
+ */
18
+ id: string;
19
+ result: IOptimizedAuthorizeCOAEventServiceActionResult;
20
+ }
21
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
1
  import * as factory from '../factory';
2
2
  import { Service } from '../service';
3
- import { IAuthorizeCOAEventServiceResult } from '../chevreTxn/transaction/placeOrder/factory';
3
+ import { IAuthorizeCOAEventServiceResult } from './offer/factory';
4
4
  interface IAppliesToSurfrock {
5
5
  identifier: string;
6
6
  serviceOutput: {
@@ -1,54 +1,10 @@
1
1
  import * as factory from '../factory';
2
2
  import { Service } from '../service';
3
- import { IAuthorizeCOAEventServiceResult, IAuthorizeEventServiceResult, IAuthorizeProductOfferResult, IMinimalAuthorizeEventServiceResult } from './transaction/placeOrder/factory';
3
+ import { IAuthorizeEventServiceResult, IAuthorizeProductOfferResult, IMinimalAuthorizeEventServiceResult } from './transaction/placeOrder/factory';
4
4
  export interface IPurpose {
5
5
  typeOf: factory.transactionType;
6
6
  id: string;
7
7
  }
8
- export declare enum FlgMember {
9
- /**
10
- * 非会員
11
- */
12
- NonMember = "0",
13
- /**
14
- * 会員
15
- */
16
- Member = "1"
17
- }
18
- export interface ICOAPointOffer {
19
- /**
20
- * オファーID
21
- */
22
- id: string;
23
- /**
24
- * オファーコード
25
- */
26
- identifier: string;
27
- /**
28
- * チケットコード
29
- */
30
- ticketCode: string;
31
- /**
32
- * チケット名
33
- */
34
- ticketName: string;
35
- /**
36
- * チケット名(カナ)
37
- */
38
- ticketNameKana: string;
39
- /**
40
- * チケット名(英)
41
- */
42
- ticketNameEng: string;
43
- /**
44
- * ポイント購入の場合の消費ポイント
45
- */
46
- usePoint: number;
47
- /**
48
- * 会員用フラグ
49
- */
50
- flgMember?: FlgMember;
51
- }
52
8
  /**
53
9
  * オファーサービス
54
10
  */
@@ -88,73 +44,4 @@ export declare class OfferService extends Service {
88
44
  };
89
45
  purpose: IPurpose;
90
46
  }): Promise<void>;
91
- /**
92
- * 興行オファー承認
93
- */
94
- authorizeEventServiceByCOA(params: {
95
- object: {
96
- acceptedOffer: factory.action.authorize.offer.eventService.IAcceptedOfferBeforeAuthorize4COA[];
97
- event: {
98
- id: string;
99
- };
100
- };
101
- /**
102
- * token
103
- */
104
- purpose: string;
105
- purposeRaw: string;
106
- result: {
107
- requestBody: factory.action.authorize.offer.eventService.IRequestBody<factory.service.webAPI.Identifier.COA>;
108
- responseBody: factory.action.authorize.offer.eventService.IResponseBody<factory.service.webAPI.Identifier.COA>;
109
- };
110
- }): Promise<IAuthorizeCOAEventServiceResult>;
111
- /**
112
- * 興行オファー承認取消
113
- */
114
- voidAuthorizationByCOA(params: {
115
- /**
116
- * 承認アクションID
117
- */
118
- id: string;
119
- /**
120
- * token
121
- */
122
- purpose: string;
123
- purposeRaw: string;
124
- }): Promise<{
125
- theaterCode?: string;
126
- dateJouei?: string;
127
- titleCode?: string;
128
- titleBranchNum?: string;
129
- timeBegin?: string;
130
- tmpReserveNum?: string;
131
- }>;
132
- /**
133
- * 興行オファー承認変更
134
- */
135
- updateEventServiceByCOA(params: {
136
- /**
137
- * 承認アクションID
138
- */
139
- id: string;
140
- object: {
141
- acceptedOffer: factory.action.authorize.offer.eventService.IAcceptedOfferBeforeAuthorize4COA[];
142
- event: {
143
- id: string;
144
- };
145
- };
146
- /**
147
- * token
148
- */
149
- purpose: string;
150
- purposeRaw: string;
151
- }): Promise<IAuthorizeCOAEventServiceResult>;
152
- findCOAInfo(params: {
153
- object: {
154
- id: string;
155
- };
156
- purpose: {
157
- id: string;
158
- };
159
- }): Promise<Pick<factory.event.screeningEvent.ICOAInfo, 'dateJouei' | 'screenCode' | 'theaterCode' | 'timeBegin' | 'timeEnd' | 'titleBranchNum' | 'titleCode'>>;
160
47
  }
@@ -73,21 +73,10 @@ var __rest = (this && this.__rest) || function (s, e) {
73
73
  return t;
74
74
  };
75
75
  Object.defineProperty(exports, "__esModule", { value: true });
76
- exports.OfferService = exports.FlgMember = void 0;
76
+ exports.OfferService = void 0;
77
77
  var http_status_1 = require("http-status");
78
78
  var factory = require("../factory");
79
79
  var service_1 = require("../service");
80
- var FlgMember;
81
- (function (FlgMember) {
82
- /**
83
- * 非会員
84
- */
85
- FlgMember["NonMember"] = "0";
86
- /**
87
- * 会員
88
- */
89
- FlgMember["Member"] = "1";
90
- })(FlgMember = exports.FlgMember || (exports.FlgMember = {}));
91
80
  /**
92
81
  * オファーサービス
93
82
  */
@@ -164,95 +153,6 @@ var OfferService = /** @class */ (function (_super) {
164
153
  });
165
154
  });
166
155
  };
167
- /**
168
- * 興行オファー承認
169
- */
170
- OfferService.prototype.authorizeEventServiceByCOA = function (params) {
171
- return __awaiter(this, void 0, void 0, function () {
172
- var _this = this;
173
- return __generator(this, function (_a) {
174
- return [2 /*return*/, this.fetch({
175
- uri: "/offers/" + factory.product.ProductType.EventService + "ByCOA/authorize",
176
- method: 'POST',
177
- expectedStatusCodes: [http_status_1.CREATED],
178
- body: params,
179
- qs: {
180
- purpose: { id: params.purposeRaw } // 追加(2024-04-01~)
181
- }
182
- })
183
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
184
- return [2 /*return*/, response.json()];
185
- }); }); })];
186
- });
187
- });
188
- };
189
- /**
190
- * 興行オファー承認取消
191
- */
192
- OfferService.prototype.voidAuthorizationByCOA = function (params) {
193
- return __awaiter(this, void 0, void 0, function () {
194
- var id, body;
195
- var _this = this;
196
- return __generator(this, function (_a) {
197
- id = params.id, body = __rest(params, ["id"]);
198
- return [2 /*return*/, this.fetch({
199
- uri: "/offers/" + factory.product.ProductType.EventService + "ByCOA/authorize/" + id + "/void",
200
- method: 'PUT',
201
- expectedStatusCodes: [http_status_1.OK],
202
- body: body,
203
- qs: {
204
- purpose: { id: params.purposeRaw } // 追加(2024-04-01~)
205
- }
206
- })
207
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
208
- return [2 /*return*/, response.json()];
209
- }); }); })];
210
- });
211
- });
212
- };
213
- /**
214
- * 興行オファー承認変更
215
- */
216
- OfferService.prototype.updateEventServiceByCOA = function (params) {
217
- return __awaiter(this, void 0, void 0, function () {
218
- var id, body;
219
- var _this = this;
220
- return __generator(this, function (_a) {
221
- id = params.id, body = __rest(params, ["id"]);
222
- return [2 /*return*/, this.fetch({
223
- uri: "/offers/" + factory.product.ProductType.EventService + "ByCOA/authorize/" + id,
224
- method: 'PATCH',
225
- expectedStatusCodes: [http_status_1.OK],
226
- body: body,
227
- qs: {
228
- purpose: { id: params.purposeRaw } // 追加(2024-04-01~)
229
- }
230
- })
231
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
232
- return [2 /*return*/, response.json()];
233
- }); }); })];
234
- });
235
- });
236
- };
237
- OfferService.prototype.findCOAInfo = function (params) {
238
- return __awaiter(this, void 0, void 0, function () {
239
- var _this = this;
240
- return __generator(this, function (_a) {
241
- return [2 /*return*/, this.fetch({
242
- uri: "/offers/" + factory.product.ProductType.EventService + "ByCOA/events/" + String(params.object.id) + "/coaInfo",
243
- method: 'GET',
244
- expectedStatusCodes: [http_status_1.OK],
245
- body: params,
246
- qs: {
247
- purpose: { id: params.purpose.id }
248
- }
249
- })
250
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
251
- return [2 /*return*/, response.json()];
252
- }); }); })];
253
- });
254
- });
255
- };
256
156
  return OfferService;
257
157
  }(service_1.Service));
258
158
  exports.OfferService = OfferService;
@@ -37,25 +37,6 @@ export interface IStartParams {
37
37
  };
38
38
  }
39
39
  export declare type IStartPlaceOrderResult = Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'expires' | 'startDate' | 'id'>;
40
- declare type IAuthorizeCOAEventServiceActionResult = factory.action.authorize.offer.eventService.IResult<factory.service.webAPI.Identifier.COA>;
41
- declare type ICOAResponseBody = factory.action.authorize.offer.eventService.IResponseBody<factory.service.webAPI.Identifier.COA>;
42
- declare type IOptimizedAuthorizeCOAEventServiceActionResult = Pick<IAuthorizeCOAEventServiceActionResult, 'price'> & {
43
- /**
44
- * COA仮予約レスポンス
45
- * tmpReserveNum: 仮予約番号
46
- */
47
- responseBody: Pick<ICOAResponseBody, 'tmpReserveNum'>;
48
- };
49
- /**
50
- * COA興行オファー承認レスポンス
51
- */
52
- export interface IAuthorizeCOAEventServiceResult {
53
- /**
54
- * 承認アクションID
55
- */
56
- id: string;
57
- result: IOptimizedAuthorizeCOAEventServiceActionResult;
58
- }
59
40
  declare type IAuthorizeEventServiceAction = factory.action.authorize.offer.eventService.IAction<factory.service.webAPI.Identifier.Chevre>;
60
41
  export declare type IAuthorizeEventServiceResult = Pick<IAuthorizeEventServiceAction, 'id'> & {
61
42
  result?: {
@@ -1,4 +1,4 @@
1
- import { IAuthorizeCOAEventServiceResult } from '../../../chevreTxn/transaction/placeOrder/factory';
1
+ import { IAuthorizeCOAEventServiceResult } from '../../../chevreTxc/offer/factory';
2
2
  import * as factory from '../../../factory';
3
3
  import { IAdditionalOptions, IOptions } from '../../../service';
4
4
  import { PlaceOrderTransactionService } from './placeOrder';
@@ -83,7 +83,7 @@ var http_status_1 = require("http-status");
83
83
  var factory = require("../../factory");
84
84
  var index_1 = require("../../index");
85
85
  var service_1 = require("../../service");
86
- var USE_CHECK_MOVIE_TICKET_PAGING_INTERVAL_MS = 300;
86
+ var USE_CHECK_MOVIE_TICKET_PAGING_INTERVAL_MS = 500;
87
87
  var USE_CHECK_MOVIE_TICKET_PAGING_LIMIT = 20;
88
88
  var USE_CHECK_MOVIE_TICKET_PAGING_LIMIT_SSKTS = 100;
89
89
  var USE_FORCE_AUTHORIZE_PAYMENT_ASYNC_GIVE_UP_MS = 10000;