@cinerino/sdk 12.12.0-alpha.6 → 12.12.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.
@@ -201,6 +201,7 @@ function authorizeCreditCardAsync(params: {
201
201
  method: string;
202
202
  creditCard: typeof creditCard;
203
203
  issuedThrough: { id: string };
204
+ eventIdsAsOrderedItem: string[];
204
205
  };
205
206
  purpose: { id: string; typeOf: client.factory.transactionType.PlaceOrder };
206
207
  }) {
@@ -345,7 +346,8 @@ async function main() {
345
346
  paymentMethod: 'CreditCard',
346
347
  method: '1',
347
348
  creditCard,
348
- issuedThrough: { id: '5f9a6986cc98a1eb13a90285' }
349
+ issuedThrough: { id: '5f9a6986cc98a1eb13a90285' },
350
+ eventIdsAsOrderedItem: [EVENT_ID]
349
351
  },
350
352
  purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
351
353
  })({ paymentService });
@@ -0,0 +1,33 @@
1
+ // tslint:disable:no-console
2
+ // tslint:disable-next-line:no-implicit-dependencies
3
+ import { loadCloudSearch } from '../../../../lib/index';
4
+ import { auth } from '../../auth/clientCredentials';
5
+
6
+ const PROJECT_ID = String(process.env.PROJECT_ID);
7
+ const SELLER_ID = '59d20831e53ebc2b4e774466';
8
+
9
+ async function main() {
10
+ const seatOfferService = await (await loadCloudSearch({
11
+ endpoint: <string>process.env.API_ENDPOINT,
12
+ auth: await auth()
13
+ })).createSeatOfferInstance({
14
+ project: { id: PROJECT_ID },
15
+ seller: { id: SELLER_ID }
16
+ });
17
+
18
+ const offers = await seatOfferService.findEventSeatOffersBySection({
19
+ limit: 100,
20
+ page: 1,
21
+ eventId: '691ed47f249a02f4f078a2d6',
22
+ sectionCode: 'Default'
23
+ });
24
+ // tslint:disable-next-line:no-null-keyword
25
+ console.dir(offers, { depth: null });
26
+ console.log(offers.length);
27
+ }
28
+
29
+ main()
30
+ .then(() => {
31
+ console.log('success!');
32
+ })
33
+ .catch(console.error);
@@ -13,7 +13,7 @@ export function authorizeCreditCardAsyncForcibly(params: {
13
13
  client.factory.action.authorize.paymentMethod.any.IObjectWithoutDetail,
14
14
  'amount' | 'issuedThrough' | 'paymentMethod' | 'creditCard' | 'method' | 'paymentMethodId' | 'name' | 'additionalProperty' | 'ticketToken'
15
15
  > & {
16
- eventIdsAsOrderedItem?: string[];
16
+ eventIdsAsOrderedItem: string[];
17
17
  };
18
18
  purpose: {
19
19
  typeOf: client.factory.transactionType.PlaceOrder;
@@ -189,7 +189,8 @@ async function main() {
189
189
  ...creditCard,
190
190
  retUrl: String(process.env.SECURE_TRAN_RET_URL) // callbackを指定すると3DSとして処理される
191
191
  },
192
- issuedThrough: { id: paymentServiceId }
192
+ issuedThrough: { id: paymentServiceId },
193
+ eventIdsAsOrderedItem: eventIds
193
194
  },
194
195
  purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
195
196
  })({ paymentService });
@@ -497,7 +498,7 @@ const USE_FORCE_AUTHORIZE_PAYMENT_ASYNC_GIVE_UP_SECONDS = 10;
497
498
  const USE_FORCE_AUTHORIZE_PAYMENT_ASYNC_CHECK_INTERVAL_MS = 1000;
498
499
  function publishPaymentUrlAsyncForcibly(params: {
499
500
  object: Pick<client.factory.action.authorize.paymentMethod.any.IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'paymentMethod' | 'method' | 'ticketToken'> & {
500
- eventIdsAsOrderedItem?: string[];
501
+ eventIdsAsOrderedItem: string[];
501
502
  };
502
503
  purpose: {
503
504
  typeOf: client.factory.transactionType.PlaceOrder;
@@ -102,7 +102,10 @@ async function main() {
102
102
  const numEvents = 1;
103
103
  let amount = 0;
104
104
  // tslint:disable-next-line:max-line-length
105
- const authorizeSeatReservationResults: { price: number }[] = [];
105
+ const authorizeSeatReservationResults: {
106
+ price: number;
107
+ eventId: string;
108
+ }[] = [];
106
109
 
107
110
  // tslint:disable-next-line:no-increment-decrement
108
111
  for (let i = 0; i < numEvents; i++) {
@@ -114,7 +117,10 @@ async function main() {
114
117
  transaction: transaction
115
118
  });
116
119
  amount += Number(authorizeSeatReservationResult.price);
117
- authorizeSeatReservationResults.push(authorizeSeatReservationResult);
120
+ authorizeSeatReservationResults.push({
121
+ ...authorizeSeatReservationResult,
122
+ eventId: screeningEvent.id
123
+ });
118
124
  }
119
125
 
120
126
  // 決済URL発行
@@ -127,7 +133,8 @@ async function main() {
127
133
  ...creditCard,
128
134
  retUrl: String(process.env.SECURE_TRAN_RET_URL) // callbackを指定すると3DSとして処理される
129
135
  },
130
- issuedThrough: { id: paymentServiceId }
136
+ issuedThrough: { id: paymentServiceId },
137
+ eventIdsAsOrderedItem: authorizeSeatReservationResults.map(({ eventId }) => eventId)
131
138
  },
132
139
  purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
133
140
  })({ paymentService });
@@ -143,7 +150,8 @@ async function main() {
143
150
  ...creditCard,
144
151
  retUrl: String(process.env.SECURE_TRAN_RET_URL) // callbackを指定すると3DSとして処理される
145
152
  },
146
- issuedThrough: { id: paymentServiceId }
153
+ issuedThrough: { id: paymentServiceId },
154
+ eventIdsAsOrderedItem: authorizeSeatReservationResults.map(({ eventId }) => eventId)
147
155
  },
148
156
  purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
149
157
  })({ paymentService });
@@ -176,7 +184,8 @@ async function main() {
176
184
  paymentMethodId, // URL発行時のpaymentMethodIdを指定
177
185
  method: '1',
178
186
  creditCard,
179
- issuedThrough: { id: paymentServiceId }
187
+ issuedThrough: { id: paymentServiceId },
188
+ eventIdsAsOrderedItem: authorizeSeatReservationResults.map(({ eventId }) => eventId)
180
189
  },
181
190
  purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
182
191
  })({ paymentService });
@@ -384,7 +393,9 @@ async function wait(waitInMilliseconds: number) {
384
393
  const USE_FORCE_AUTHORIZE_PAYMENT_ASYNC_GIVE_UP_SECONDS = 10;
385
394
  const USE_FORCE_AUTHORIZE_PAYMENT_ASYNC_CHECK_INTERVAL_MS = 1000;
386
395
  function publishPaymentUrlAsyncForcibly(params: {
387
- object: Pick<client.factory.action.authorize.paymentMethod.any.IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'paymentMethod' | 'method'>;
396
+ object: Pick<client.factory.action.authorize.paymentMethod.any.IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'paymentMethod' | 'method'> & {
397
+ eventIdsAsOrderedItem: string[];
398
+ };
388
399
  purpose: {
389
400
  typeOf: client.factory.transactionType.PlaceOrder;
390
401
  id: string;
@@ -206,7 +206,8 @@ async function main() {
206
206
  method: '1',
207
207
  creditCard,
208
208
  issuedThrough: { id: PAYMENT_SERVICE_ID },
209
- ticketToken // メンバーシップチケットを指定
209
+ ticketToken, // メンバーシップチケットを指定
210
+ eventIdsAsOrderedItem: [EVENT_ID]
210
211
  },
211
212
  purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
212
213
  })({ paymentService });
@@ -3,7 +3,7 @@ import { Service } from '../service';
3
3
  /**
4
4
  * 座席オファー
5
5
  */
6
- interface ISeatOfferBySection {
6
+ export interface ISeatOfferBySection {
7
7
  /**
8
8
  * 在庫状態
9
9
  */
@@ -15,6 +15,21 @@ interface ISeatOfferBySection {
15
15
  branchCode: string;
16
16
  };
17
17
  }
18
+ export interface IFindParams {
19
+ /**
20
+ * max: 100
21
+ */
22
+ limit: number;
23
+ page: number;
24
+ /**
25
+ * イベントID
26
+ */
27
+ eventId: string;
28
+ /**
29
+ * セクションコード
30
+ */
31
+ sectionCode: string;
32
+ }
18
33
  /**
19
34
  * 座席オファーサービス
20
35
  */
@@ -22,20 +37,5 @@ export declare class SeatOfferService extends Service {
22
37
  /**
23
38
  * イベントとセクション指定で座席在庫検索
24
39
  */
25
- findEventSeatOffersBySection(params: {
26
- /**
27
- * max: 100
28
- */
29
- limit: number;
30
- page: number;
31
- /**
32
- * イベントID
33
- */
34
- eventId: string;
35
- /**
36
- * セクションコード
37
- */
38
- sectionCode: string;
39
- }): Promise<ISeatOfferBySection[]>;
40
+ findEventSeatOffersBySection(params: IFindParams): Promise<ISeatOfferBySection[]>;
40
41
  }
41
- export {};
@@ -54,6 +54,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
54
54
  exports.SeatOfferService = void 0;
55
55
  var http_status_1 = require("http-status");
56
56
  var service_1 = require("../service");
57
+ var BASE_URI = '/seatOffers';
57
58
  /**
58
59
  * 座席オファーサービス
59
60
  */
@@ -72,7 +73,7 @@ var SeatOfferService = /** @class */ (function (_super) {
72
73
  return __generator(this, function (_a) {
73
74
  limit = params.limit, page = params.page, eventId = params.eventId, sectionCode = params.sectionCode;
74
75
  return [2 /*return*/, this.fetch({
75
- uri: '/seatOffers',
76
+ uri: BASE_URI,
76
77
  method: 'GET',
77
78
  qs: { limit: limit, page: page, eventId: eventId, sectionCode: sectionCode },
78
79
  expectedStatusCodes: [http_status_1.OK]
@@ -35,8 +35,9 @@ export declare type IAuthorizeAnyPaymentObject = Pick<factory.action.authorize.p
35
35
  export declare type IAuthorizeCreditCardObject = Pick<factory.action.authorize.paymentMethod.any.IAuthorizeCreditCardObject, 'amount' | 'issuedThrough' | 'paymentMethod' | 'creditCard' | 'method' | 'paymentMethodId' | 'name' | 'additionalProperty' | 'ticketToken'> & {
36
36
  /**
37
37
  * 関連注文に含まれるイベントIDリスト
38
+ * 必須化(2025-12-10~)
38
39
  */
39
- eventIdsAsOrderedItem?: string[];
40
+ eventIdsAsOrderedItem: string[];
40
41
  };
41
42
  export declare type IAuthorizeMovieTicketObject = Pick<factory.action.authorize.paymentMethod.any.IAuthorizeMovieTicketObject, 'issuedThrough' | 'paymentMethod' | 'movieTickets' | 'name' | 'additionalProperty' | 'ticketToken'>;
42
43
  export declare type IAuthorizePaymentCardObject = Pick<factory.action.authorize.paymentMethod.any.IAuthorizePaymentCardObject, 'amount' | 'issuedThrough' | 'paymentMethod' | 'fromLocation' | 'name' | 'additionalProperty'> & {
@@ -45,8 +46,9 @@ export declare type IAuthorizePaymentCardObject = Pick<factory.action.authorize.
45
46
  export declare type IPublishPaymentUrlObject = Pick<factory.action.authorize.paymentMethod.any.IAuthorizeCreditCardObject, 'amount' | 'creditCard' | 'issuedThrough' | 'paymentMethod' | 'method' | 'ticketToken'> & {
46
47
  /**
47
48
  * 関連注文に含まれるイベントIDリスト
49
+ * 必須化(2025-12-10~)
48
50
  */
49
- eventIdsAsOrderedItem?: string[];
51
+ eventIdsAsOrderedItem: string[];
50
52
  };
51
53
  export declare type IPublishPaymentUrlResult = Pick<factory.action.accept.pay.IResult, 'paymentMethodId' | 'paymentUrl'>;
52
54
  export interface IFindAuthorizeActionResult {
@@ -166,6 +166,10 @@ var PaymentService = /** @class */ (function (_super) {
166
166
  && (typeof ticketToken !== 'string' || ticketToken === '')) {
167
167
  throw new factory.errors.ArgumentNull('object.paymentMethodId or object.ticketToken');
168
168
  }
169
+ // イベントIDリスト必須化(2025-12-10~)
170
+ if (!Array.isArray(eventIdsAsOrderedItem) || eventIdsAsOrderedItem.length === 0) {
171
+ throw new factory.errors.ArgumentNull('object.eventIdsAsOrderedItem');
172
+ }
169
173
  return [2 /*return*/, this.fetch({
170
174
  uri: "/payment/" + factory.service.paymentService.PaymentServiceType.CreditCard + "/authorize",
171
175
  method: 'POST',
@@ -257,6 +261,10 @@ var PaymentService = /** @class */ (function (_super) {
257
261
  if (typeof ticketToken !== 'string' || ticketToken === '') {
258
262
  throw new factory.errors.ArgumentNull('object.ticketToken'); // required(2025-12-06~)
259
263
  }
264
+ // イベントIDリスト必須化(2025-12-10~)
265
+ if (!Array.isArray(eventIdsAsOrderedItem) || eventIdsAsOrderedItem.length === 0) {
266
+ throw new factory.errors.ArgumentNull('object.eventIdsAsOrderedItem');
267
+ }
260
268
  return [2 /*return*/, this.fetch({
261
269
  uri: "/payment/" + factory.service.paymentService.PaymentServiceType.CreditCard + "/publishPaymentUrl",
262
270
  method: 'POST',
@@ -0,0 +1,11 @@
1
+ import { IFindParams, ISeatOfferBySection } from '../../chevre/seatOffer';
2
+ import { Service } from '../../service';
3
+ /**
4
+ * 座席オファーサービス
5
+ */
6
+ export declare class SeatOfferService extends Service {
7
+ /**
8
+ * イベントとセクション指定で座席在庫検索
9
+ */
10
+ findEventSeatOffersBySection(params: IFindParams): Promise<ISeatOfferBySection[]>;
11
+ }
@@ -0,0 +1,89 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.SeatOfferService = void 0;
55
+ var http_status_1 = require("http-status");
56
+ var service_1 = require("../../service");
57
+ var BASE_URI = '/seatOffers';
58
+ /**
59
+ * 座席オファーサービス
60
+ */
61
+ var SeatOfferService = /** @class */ (function (_super) {
62
+ __extends(SeatOfferService, _super);
63
+ function SeatOfferService() {
64
+ return _super !== null && _super.apply(this, arguments) || this;
65
+ }
66
+ /**
67
+ * イベントとセクション指定で座席在庫検索
68
+ */
69
+ SeatOfferService.prototype.findEventSeatOffersBySection = function (params) {
70
+ return __awaiter(this, void 0, void 0, function () {
71
+ var limit, page, eventId, sectionCode;
72
+ var _this = this;
73
+ return __generator(this, function (_a) {
74
+ limit = params.limit, page = params.page, eventId = params.eventId, sectionCode = params.sectionCode;
75
+ return [2 /*return*/, this.fetch({
76
+ uri: BASE_URI,
77
+ method: 'GET',
78
+ qs: { limit: limit, page: page, eventId: eventId, sectionCode: sectionCode },
79
+ expectedStatusCodes: [http_status_1.OK]
80
+ })
81
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
82
+ return [2 /*return*/, response.json()];
83
+ }); }); })];
84
+ });
85
+ });
86
+ };
87
+ return SeatOfferService;
88
+ }(service_1.Service));
89
+ exports.SeatOfferService = SeatOfferService;
@@ -5,6 +5,7 @@ import type { PaymentProductService } from './search/paymentService';
5
5
  import type { PlaceService } from './search/place';
6
6
  import type { ProductService } from './search/product';
7
7
  import type { ProductOfferService } from './search/productOffer';
8
+ import type { SeatOfferService } from './search/seatOffer';
8
9
  /**
9
10
  * publicリソース検索サービス群
10
11
  */
@@ -51,6 +52,13 @@ export declare namespace service {
51
52
  namespace ProductOffer {
52
53
  let svc: typeof ProductOfferService | undefined;
53
54
  }
55
+ /**
56
+ * 座席オファーサービス
57
+ */
58
+ type SeatOffer = SeatOfferService;
59
+ namespace SeatOffer {
60
+ let svc: typeof SeatOfferService | undefined;
61
+ }
54
62
  }
55
63
  /**
56
64
  * publicリソース検索サービス
@@ -84,4 +92,9 @@ export declare class CloudSearch {
84
92
  * 販売者指定必須
85
93
  */
86
94
  createPlaceInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PlaceService>;
95
+ /**
96
+ * 座席オファーサービスインスタンス生成
97
+ * 販売者指定必須
98
+ */
99
+ createSeatOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<SeatOfferService>;
87
100
  }
@@ -73,6 +73,9 @@ var service;
73
73
  var ProductOffer;
74
74
  (function (ProductOffer) {
75
75
  })(ProductOffer = service.ProductOffer || (service.ProductOffer = {}));
76
+ var SeatOffer;
77
+ (function (SeatOffer) {
78
+ })(SeatOffer = service.SeatOffer || (service.SeatOffer = {}));
76
79
  })(service = exports.service || (exports.service = {}));
77
80
  var defaultRetryableStatusCodes = [http_status_1.BAD_GATEWAY, http_status_1.FORBIDDEN, http_status_1.UNAUTHORIZED];
78
81
  /**
@@ -204,6 +207,27 @@ var CloudSearch = /** @class */ (function () {
204
207
  });
205
208
  });
206
209
  };
210
+ /**
211
+ * 座席オファーサービスインスタンス生成
212
+ * 販売者指定必須
213
+ */
214
+ CloudSearch.prototype.createSeatOfferInstance = function (params) {
215
+ return __awaiter(this, void 0, void 0, function () {
216
+ var _a;
217
+ return __generator(this, function (_b) {
218
+ switch (_b.label) {
219
+ case 0:
220
+ if (!(service.SeatOffer.svc === undefined)) return [3 /*break*/, 2];
221
+ _a = service.SeatOffer;
222
+ return [4 /*yield*/, Promise.resolve().then(function () { return require('./search/seatOffer'); })];
223
+ case 1:
224
+ _a.svc = (_b.sent()).SeatOfferService;
225
+ _b.label = 2;
226
+ case 2: return [2 /*return*/, new service.SeatOffer.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: defaultRetryableStatusCodes }))];
227
+ }
228
+ });
229
+ });
230
+ };
207
231
  return CloudSearch;
208
232
  }());
209
233
  exports.CloudSearch = CloudSearch;