@cinerino/sdk 4.0.0 → 4.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.
@@ -97,7 +97,7 @@ async function main() {
97
97
  },
98
98
  seller: { typeOf: seller.typeOf, id: String(seller.id) }
99
99
  },
100
- purpose: { typeOf: transaction.typeOf, id: transaction.id }
100
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
101
101
  });
102
102
  // tslint:disable-next-line:no-console
103
103
  console.log('moneyTransfer authorized. id:', moneyTransaferAuthorization.id);
@@ -114,7 +114,7 @@ async function main() {
114
114
  amount: price,
115
115
  issuedThrough: { id: '' }
116
116
  },
117
- purpose: transaction
117
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
118
118
  });
119
119
  console.log('cash payment authorized', anyPaymentAuth.id);
120
120
  }
@@ -105,7 +105,7 @@ async function main() {
105
105
  },
106
106
  seller: { typeOf: seller.typeOf, id: String(seller.id) }
107
107
  },
108
- purpose: { typeOf: transaction.typeOf, id: transaction.id }
108
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
109
109
  });
110
110
  // tslint:disable-next-line:no-console
111
111
  console.log('moneyTransfer authorized. id:', moneyTransaferAuthorization.id);
@@ -122,7 +122,7 @@ async function main() {
122
122
  creditCard: creditCard,
123
123
  issuedThrough: { id: 'xxx' }
124
124
  },
125
- purpose: { typeOf: transaction.typeOf, id: transaction.id }
125
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
126
126
  });
127
127
  // tslint:disable-next-line:no-console
128
128
  console.log('credit card payment authorized', creditCardPaymentAuth.id);
@@ -151,7 +151,7 @@ async function main() {
151
151
  creditCard: creditCard,
152
152
  issuedThrough: { id: 'xxx' }
153
153
  },
154
- purpose: transaction
154
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
155
155
  });
156
156
  console.log('credit card payment authorized', creditCardPaymentAuth.id);
157
157
 
@@ -161,7 +161,7 @@ async function main() {
161
161
  await paymentService.voidTransaction({
162
162
  id: creditCardPaymentAuth.id,
163
163
  object: { typeOf: client.factory.service.paymentService.PaymentServiceType.CreditCard },
164
- purpose: { typeOf: transaction.typeOf, id: transaction.id }
164
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
165
165
  });
166
166
  console.log('credit card auth voided');
167
167
 
@@ -175,7 +175,7 @@ async function main() {
175
175
  creditCard: creditCard,
176
176
  issuedThrough: { id: 'xxx' }
177
177
  },
178
- purpose: transaction
178
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
179
179
  });
180
180
  console.log('credit card payment authorized', creditCardPaymentAuth.id);
181
181
 
@@ -264,7 +264,7 @@ export type IAuthorizeReservationAction
264
264
  async function authorizeSeatReservationByEvent(params: {
265
265
  event: client.factory.event.screeningEvent.IEvent;
266
266
  seller: client.factory.seller.ISeller;
267
- transaction: client.factory.transaction.placeOrder.ITransaction;
267
+ transaction: Pick<client.factory.transaction.placeOrder.ITransaction, 'id'>;
268
268
  }): Promise<client.factory.action.authorize.offer.seatReservation.IResult<client.factory.service.webAPI.Identifier.Chevre>> {
269
269
  const eventService = new (await client.loadService()).Event({
270
270
  endpoint: <string>process.env.API_ENDPOINT,
@@ -376,7 +376,7 @@ async function authorizeSeatReservationByEvent(params: {
376
376
  };
377
377
  })
378
378
  },
379
- purpose: transaction
379
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
380
380
  });
381
381
  console.log('seat reservation authorized', seatReservationAuth.id);
382
382
 
@@ -151,7 +151,7 @@ async function main() {
151
151
  const authorizeSeatReservationResult = await authorizeSeatReservationByEvent({
152
152
  event: screeningEvent,
153
153
  seller: seller,
154
- transaction: transaction
154
+ transaction: { id: transaction.id }
155
155
  })(eventService, placeOrderService, ownershipInfoService, tokenService);
156
156
  amount += authorizeSeatReservationResult.price;
157
157
  authorizeSeatReservationResults.push(authorizeSeatReservationResult);
@@ -168,7 +168,7 @@ async function main() {
168
168
  creditCard: creditCard,
169
169
  issuedThrough: { id: 'xxx' }
170
170
  },
171
- purpose: transaction
171
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
172
172
  });
173
173
  console.log('credit card payment authorized', creditCardPaymentAuth.id);
174
174
 
@@ -178,7 +178,7 @@ async function main() {
178
178
  await paymentService.voidTransaction({
179
179
  id: creditCardPaymentAuth.id,
180
180
  object: { typeOf: client.factory.service.paymentService.PaymentServiceType.CreditCard },
181
- purpose: { typeOf: transaction.typeOf, id: transaction.id }
181
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
182
182
  });
183
183
  console.log('credit card auth voided');
184
184
 
@@ -192,7 +192,7 @@ async function main() {
192
192
  creditCard: creditCard,
193
193
  issuedThrough: { id: 'xxx' }
194
194
  },
195
- purpose: transaction
195
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
196
196
  });
197
197
  console.log('credit card payment authorized', creditCardPaymentAuth.id);
198
198
 
@@ -280,7 +280,7 @@ export type IAuthorizeReservationAction
280
280
  function authorizeSeatReservationByEvent(params: {
281
281
  event: client.factory.event.screeningEvent.IEvent;
282
282
  seller: client.factory.seller.ISeller;
283
- transaction: client.factory.transaction.placeOrder.ITransaction;
283
+ transaction: Pick<client.factory.transaction.placeOrder.ITransaction, 'id'>;
284
284
  }) {
285
285
  // tslint:disable-next-line:max-func-body-length
286
286
  return async (
@@ -416,7 +416,7 @@ function authorizeSeatReservationByEvent(params: {
416
416
  };
417
417
  })
418
418
  },
419
- purpose: transaction
419
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
420
420
  });
421
421
  console.log('seat reservation authorized', seatReservationAuth.id);
422
422
 
@@ -255,7 +255,7 @@ async function main() {
255
255
  };
256
256
  })
257
257
  },
258
- purpose: transaction
258
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
259
259
  });
260
260
  console.log('seat reservation authorized', seatReservationAuth.id);
261
261
 
@@ -275,7 +275,7 @@ async function main() {
275
275
  additionalProperty: [{ name: 'useCoin', value: '0' }],
276
276
  issuedThrough: { id: '' }
277
277
  },
278
- purpose: transaction
278
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
279
279
  });
280
280
  console.log('any payment authorized', anyPaymentAuth.id);
281
281
 
@@ -234,7 +234,7 @@ async function main() {
234
234
  };
235
235
  })
236
236
  },
237
- purpose: transaction
237
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
238
238
  });
239
239
  console.log('seat reservation authorized', seatReservationAuth.id);
240
240
 
@@ -262,7 +262,7 @@ async function main() {
262
262
  };
263
263
  })
264
264
  },
265
- purpose: transaction
265
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
266
266
  });
267
267
 
268
268
  // 金額計算
@@ -285,7 +285,7 @@ async function main() {
285
285
  movieTickets: movieTickets.map((movieTicket) => {
286
286
  return {
287
287
  ...movieTicket,
288
- project: transaction.project,
288
+ project: project,
289
289
  category: { codeValue: '' }, // 情報空でよし
290
290
  serviceType: '', // 情報空でよし
291
291
  serviceOutput: {
@@ -305,9 +305,9 @@ async function main() {
305
305
  }
306
306
  };
307
307
  }),
308
- seller: { id: String(transaction.seller.id) }
308
+ seller: { id: String(seller.id) }
309
309
  },
310
- purpose: { id: transaction.id, typeOf: transaction.typeOf }
310
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
311
311
  });
312
312
  console.log('movie ticket:', checkMovieTicketAction);
313
313
  const checkMovieTicketActionResult = checkMovieTicketAction;
@@ -365,7 +365,7 @@ async function main() {
365
365
  }],
366
366
  issuedThrough: { id: '5f9a52994f3709000abe6417' }
367
367
  },
368
- purpose: transaction
368
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
369
369
  });
370
370
  }));
371
371
  console.log(movieTicketPaymentAuths.length, 'mvtk payment authorized');
@@ -431,7 +431,7 @@ async function main() {
431
431
  creditCard: creditCard,
432
432
  issuedThrough: { id: '5f9a4fed4f3709000abe6415' }
433
433
  },
434
- purpose: transaction
434
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
435
435
  });
436
436
  console.log('credit card payment authorized', creditCardPaymentAuth.id);
437
437
 
@@ -96,9 +96,9 @@ async function main() {
96
96
  }
97
97
  };
98
98
  }),
99
- seller: { id: String(transaction.seller.id) }
99
+ seller: { id: String(seller.id) }
100
100
  },
101
- purpose: { id: transaction.id, typeOf: transaction.typeOf }
101
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
102
102
  });
103
103
  console.log('checkMovieTicketAction:', checkMovieTicketAction);
104
104
  console.log('purchaseNumberAuthResult.knyknrNoInfoOut:', checkMovieTicketAction.purchaseNumberAuthResult.knyknrNoInfoOut);
@@ -146,7 +146,7 @@ async function main() {
146
146
  }],
147
147
  issuedThrough: { id: paymentServiceId }
148
148
  },
149
- purpose: { id: transaction.id, typeOf: transaction.typeOf }
149
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
150
150
  });
151
151
  }));
152
152
  console.log(movieTicketPaymentAuths.length, 'mvtk payment authorized');
@@ -184,7 +184,7 @@ async function main() {
184
184
  }
185
185
  ]
186
186
  },
187
- purpose: { id: transaction.id, typeOf: transaction.typeOf }
187
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
188
188
  });
189
189
  console.log('eventService offer authorized', seatReservationAuth.id);
190
190
 
@@ -144,7 +144,7 @@ async function main() {
144
144
  const authorizeSeatReservationResult = await authorizeSeatReservationByEvent({
145
145
  event: screeningEvent,
146
146
  seller: seller,
147
- transaction: transaction
147
+ transaction: { id: transaction.id }
148
148
  })(eventService, placeOrderService);
149
149
  amount += authorizeSeatReservationResult.price;
150
150
  authorizeSeatReservationResults.push(authorizeSeatReservationResult);
@@ -160,7 +160,7 @@ async function main() {
160
160
  fromLocation: 'xxx',
161
161
  issuedThrough: { id: 'xxx' }
162
162
  },
163
- purpose: transaction
163
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
164
164
  });
165
165
  console.log('payment authorized', paymentAuth.id);
166
166
 
@@ -168,7 +168,7 @@ async function main() {
168
168
  await paymentService.voidTransaction({
169
169
  id: paymentAuth.id,
170
170
  object: { typeOf: client.factory.service.paymentService.PaymentServiceType.PaymentCard },
171
- purpose: transaction
171
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
172
172
  });
173
173
 
174
174
  await wait(5000);
@@ -183,7 +183,7 @@ async function main() {
183
183
  fromLocation: 'xxx',
184
184
  issuedThrough: { id: 'xxx' }
185
185
  },
186
- purpose: transaction
186
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
187
187
  });
188
188
  console.log('payment authorized', paymentAuth.id);
189
189
 
@@ -273,7 +273,7 @@ export type IAuthorizeReservationResult
273
273
  function authorizeSeatReservationByEvent(params: {
274
274
  event: client.factory.event.screeningEvent.IEvent;
275
275
  seller: client.factory.seller.ISeller;
276
- transaction: client.factory.transaction.placeOrder.ITransaction;
276
+ transaction: Pick<client.factory.transaction.placeOrder.ITransaction, 'id'>;
277
277
  }) {
278
278
  // tslint:disable-next-line:max-func-body-length
279
279
  return async (eventService: client.service.Event, placeOrderService: client.service.transaction.PlaceOrder
@@ -368,7 +368,7 @@ function authorizeSeatReservationByEvent(params: {
368
368
  // ],
369
369
  // }
370
370
  },
371
- purpose: transaction
371
+ purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
372
372
  });
373
373
  console.log('seat reservation authorized', seatReservationAuth.id);
374
374
 
@@ -16,6 +16,10 @@ export declare class EventService extends Service {
16
16
  * イベント検索
17
17
  */
18
18
  search<T extends factory.eventType>(params: Omit<factory.event.ISearchConditions<T>, 'project' | 'organizer'> & IProjectionSearchConditions): Promise<ISearchResult<ISearchedEvent<T>[]>>;
19
+ /**
20
+ * イベント集計検索
21
+ */
22
+ searchAggregations(params: Omit<factory.event.ISearchConditions<factory.eventType.ScreeningEvent>, 'project' | 'organizer'>): Promise<Pick<factory.event.screeningEvent.IEvent, 'aggregateEntranceGate' | 'aggregateOffer' | 'aggregateReservation' | 'id'>[]>;
19
23
  /**
20
24
  * イベント取得
21
25
  */
@@ -101,6 +101,25 @@ var EventService = /** @class */ (function (_super) {
101
101
  });
102
102
  });
103
103
  };
104
+ /**
105
+ * イベント集計検索
106
+ */
107
+ EventService.prototype.searchAggregations = function (params) {
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ var _this = this;
110
+ return __generator(this, function (_a) {
111
+ return [2 /*return*/, this.fetch({
112
+ uri: '/events/aggregations',
113
+ method: 'GET',
114
+ qs: params,
115
+ expectedStatusCodes: [http_status_1.OK]
116
+ })
117
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
118
+ return [2 /*return*/, response.json()];
119
+ }); }); })];
120
+ });
121
+ });
122
+ };
104
123
  /**
105
124
  * イベント取得
106
125
  */
@@ -1,6 +1,14 @@
1
1
  import { ISearchedEvent } from '../chevre/event/factory';
2
2
  import * as factory from '../factory';
3
3
  import { ISearchResult, Service } from '../service';
4
+ declare type ISearchSeatsResult = Pick<factory.place.seat.IPlaceWithOffer, 'branchCode' | 'name' | 'offers' | 'seatingType'> & {
5
+ containedInPlace?: {
6
+ /**
7
+ * セクションコード
8
+ */
9
+ branchCode?: string;
10
+ };
11
+ };
4
12
  /**
5
13
  * COA券種オファーインターフェース
6
14
  */
@@ -106,6 +114,10 @@ export declare class EventService extends Service {
106
114
  * イベント検索
107
115
  */
108
116
  search<T extends factory.eventType>(params: Omit<factory.event.ISearchConditions<T>, 'project' | 'organizer'>): Promise<ISearchResult<ISearchedEvent<T>[]>>;
117
+ /**
118
+ * イベント集計検索
119
+ */
120
+ searchAggregations(params: Omit<factory.event.ISearchConditions<factory.eventType.ScreeningEvent>, 'project' | 'organizer'>): Promise<Pick<factory.event.screeningEvent.IEvent, 'aggregateEntranceGate' | 'aggregateOffer' | 'aggregateReservation' | 'id'>[]>;
109
121
  /**
110
122
  * イベント取得
111
123
  */
@@ -134,7 +146,7 @@ export declare class EventService extends Service {
134
146
  };
135
147
  limit?: number;
136
148
  page?: number;
137
- }): Promise<ISearchResult<factory.place.seat.IPlaceWithOffer[]>>;
149
+ }): Promise<ISearchResult<ISearchSeatsResult[]>>;
138
150
  /**
139
151
  * 興行オファー検索
140
152
  */
@@ -223,3 +235,4 @@ export declare class EventService extends Service {
223
235
  };
224
236
  }): Promise<Pick<factory.priceSpecification.unitPrice.IAppliesToMovieTicket, 'serviceOutput'>[]>;
225
237
  }
238
+ export {};
@@ -122,6 +122,25 @@ var EventService = /** @class */ (function (_super) {
122
122
  });
123
123
  });
124
124
  };
125
+ /**
126
+ * イベント集計検索
127
+ */
128
+ EventService.prototype.searchAggregations = function (params) {
129
+ return __awaiter(this, void 0, void 0, function () {
130
+ var _this = this;
131
+ return __generator(this, function (_a) {
132
+ return [2 /*return*/, this.fetch({
133
+ uri: '/events/aggregations',
134
+ method: 'GET',
135
+ qs: params,
136
+ expectedStatusCodes: [http_status_1.OK]
137
+ })
138
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
139
+ return [2 /*return*/, response.json()];
140
+ }); }); })];
141
+ });
142
+ });
143
+ };
125
144
  /**
126
145
  * イベント取得
127
146
  */
@@ -2,6 +2,7 @@ import { IAuthorizeEventServiceResult, IConfirmResult, IMinimalAuthorizeEventSer
2
2
  import * as factory from '../../factory';
3
3
  import { Service } from '../../service';
4
4
  import { ISetProfileParams, TransactionService } from '../transaction';
5
+ declare type IStartResult = Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'expires' | 'startDate' | 'id'>;
5
6
  /**
6
7
  * 注文取引サービス
7
8
  */
@@ -10,7 +11,7 @@ export declare class PlaceOrderTransactionService extends Service implements Tra
10
11
  /**
11
12
  * 取引開始
12
13
  */
13
- start(params: IStartParams): Promise<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>>;
14
+ start(params: IStartParams): Promise<IStartResult>;
14
15
  /**
15
16
  * イベントオファー承認
16
17
  */
@@ -76,3 +77,4 @@ export declare class PlaceOrderTransactionService extends Service implements Tra
76
77
  id: string;
77
78
  }): Promise<void>;
78
79
  }
80
+ export {};
package/lib/bundle.js CHANGED
@@ -1074,6 +1074,25 @@ var EventService = /** @class */ (function (_super) {
1074
1074
  });
1075
1075
  });
1076
1076
  };
1077
+ /**
1078
+ * イベント集計検索
1079
+ */
1080
+ EventService.prototype.searchAggregations = function (params) {
1081
+ return __awaiter(this, void 0, void 0, function () {
1082
+ var _this = this;
1083
+ return __generator(this, function (_a) {
1084
+ return [2 /*return*/, this.fetch({
1085
+ uri: '/events/aggregations',
1086
+ method: 'GET',
1087
+ qs: params,
1088
+ expectedStatusCodes: [http_status_1.OK]
1089
+ })
1090
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1091
+ return [2 /*return*/, response.json()];
1092
+ }); }); })];
1093
+ });
1094
+ });
1095
+ };
1077
1096
  /**
1078
1097
  * イベント取得
1079
1098
  */
@@ -14921,6 +14940,25 @@ var EventService = /** @class */ (function (_super) {
14921
14940
  });
14922
14941
  });
14923
14942
  };
14943
+ /**
14944
+ * イベント集計検索
14945
+ */
14946
+ EventService.prototype.searchAggregations = function (params) {
14947
+ return __awaiter(this, void 0, void 0, function () {
14948
+ var _this = this;
14949
+ return __generator(this, function (_a) {
14950
+ return [2 /*return*/, this.fetch({
14951
+ uri: '/events/aggregations',
14952
+ method: 'GET',
14953
+ qs: params,
14954
+ expectedStatusCodes: [http_status_1.OK]
14955
+ })
14956
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
14957
+ return [2 /*return*/, response.json()];
14958
+ }); }); })];
14959
+ });
14960
+ });
14961
+ };
14924
14962
  /**
14925
14963
  * イベント取得
14926
14964
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {