@cinerino/sdk 16.4.0-alpha.2 → 16.4.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.
@@ -65,9 +65,7 @@ export declare class EventService extends Service {
65
65
  */
66
66
  findSeatOffersDeprecated(params: {
67
67
  id: string;
68
- } & Pick<factory.place.seat.ISearchConditions, 'additionalProperty' | 'branchCode' | 'containedInPlace' | 'limit' | 'name' | 'page' | 'parentOrganization' | 'seatingType' | 'sort'>, options: {
69
- useDefaultSection: boolean;
70
- }): Promise<ISeatAsEventOffer[]>;
68
+ } & Pick<factory.place.seat.ISearchConditions, 'additionalProperty' | 'branchCode' | 'containedInPlace' | 'limit' | 'name' | 'page' | 'parentOrganization' | 'seatingType' | 'sort'>): Promise<ISeatAsEventOffer[]>;
71
69
  /**
72
70
  * オファーで利用可能な適用決済カード条件を検索する
73
71
  */
@@ -67,15 +67,15 @@ class EventService extends service_1.Service {
67
67
  * イベントに対する座席検索
68
68
  * @deprecated use find seatOffers
69
69
  */
70
- async findSeatOffersDeprecated(params, options) {
70
+ async findSeatOffersDeprecated(params) {
71
71
  const { id, ...query } = params;
72
- const { useDefaultSection } = options;
72
+ // const { useDefaultSection } = options;
73
73
  return this.fetch({
74
74
  uri: `/events/${encodeURIComponent(String(id))}/seats`,
75
75
  method: 'GET',
76
76
  qs: {
77
77
  ...query,
78
- useDefaultSection
78
+ // useDefaultSection
79
79
  },
80
80
  expectedStatusCodes: [http_status_1.status.OK]
81
81
  })
@@ -0,0 +1,13 @@
1
+ import { factory } from '../factory';
2
+ import { IOptions, Service } from '../service';
3
+ type IFindParams = Pick<factory.task.ISearchConditions, 'id' | 'name' | 'runsFrom' | 'runsThrough' | 'status' | 'limit' | 'page' | 'sort'>;
4
+ type IKeyOfProjection = keyof factory.task.ITask<factory.taskName>;
5
+ /**
6
+ * 予定タスクサービス
7
+ */
8
+ export declare class ScheduledTaskService extends Service<IOptions> {
9
+ findScheduledTasks(params: IFindParams & {
10
+ $projection?: Partial<Record<IKeyOfProjection, 1>>;
11
+ }): Promise<factory.task.ITask<factory.taskName>[]>;
12
+ }
13
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScheduledTaskService = void 0;
4
+ const http_status_1 = require("http-status");
5
+ const service_1 = require("../service");
6
+ /**
7
+ * 予定タスクサービス
8
+ */
9
+ class ScheduledTaskService extends service_1.Service {
10
+ async findScheduledTasks(params) {
11
+ return this.fetch({
12
+ uri: '/scheduledTasks',
13
+ method: 'GET',
14
+ qs: params,
15
+ expectedStatusCodes: [http_status_1.status.OK]
16
+ })
17
+ .then(async (response) => response.json());
18
+ }
19
+ }
20
+ exports.ScheduledTaskService = ScheduledTaskService;
@@ -49,6 +49,7 @@ import type { SellerService } from './chevreConsole/seller';
49
49
  import type { SellerMakesOfferService } from './chevreConsole/sellerMakesOffer';
50
50
  import type { SellerReturnPolicyService } from './chevreConsole/sellerReturnPolicy';
51
51
  import type { AsyncActionService } from './chevreConsole/asyncAction';
52
+ import type { ScheduledTaskService } from './chevreConsole/scheduledTask';
52
53
  import type { TaskService } from './chevreConsole/task';
53
54
  import type { TicketService } from './chevreConsole/ticket';
54
55
  import type { TokenService } from './chevreConsole/token';
@@ -397,6 +398,13 @@ export declare namespace service {
397
398
  namespace AsyncAction {
398
399
  let svc: typeof AsyncActionService | undefined;
399
400
  }
401
+ /**
402
+ * 予定タスクサービス
403
+ */
404
+ type ScheduledTask = ScheduledTaskService;
405
+ namespace ScheduledTask {
406
+ let svc: typeof ScheduledTaskService | undefined;
407
+ }
400
408
  /**
401
409
  * タスクサービス
402
410
  */
@@ -529,6 +537,7 @@ export declare class ChevreConsole {
529
537
  createSellerMakesOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<SellerMakesOfferService>;
530
538
  createSellerReturnPolicyInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<SellerReturnPolicyService>;
531
539
  createAsyncActionInstance(params: Pick<IOptions, 'project'>): Promise<AsyncActionService>;
540
+ createScheduledTaskInstance(params: Pick<IOptions, 'project'>): Promise<ScheduledTaskService>;
532
541
  createTaskInstance(params: Pick<IOptions, 'project'>): Promise<TaskService>;
533
542
  createTicketInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<TicketService>;
534
543
  createAssetTransactionInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<AssetTransactionService>;
@@ -183,6 +183,9 @@ var service;
183
183
  let AsyncAction;
184
184
  (function (AsyncAction) {
185
185
  })(AsyncAction = service.AsyncAction || (service.AsyncAction = {}));
186
+ let ScheduledTask;
187
+ (function (ScheduledTask) {
188
+ })(ScheduledTask = service.ScheduledTask || (service.ScheduledTask = {}));
186
189
  let Task;
187
190
  (function (Task) {
188
191
  })(Task = service.Task || (service.Task = {}));
@@ -519,6 +522,12 @@ class ChevreConsole {
519
522
  }
520
523
  return new service.AsyncAction.svc({ ...this.options, ...params, retryableStatusCodes: [] });
521
524
  }
525
+ async createScheduledTaskInstance(params) {
526
+ if (service.ScheduledTask.svc === undefined) {
527
+ service.ScheduledTask.svc = (await Promise.resolve().then(() => __importStar(require('./chevreConsole/scheduledTask.js')))).ScheduledTaskService;
528
+ }
529
+ return new service.ScheduledTask.svc({ ...this.options, ...params, retryableStatusCodes: [] });
530
+ }
522
531
  async createTaskInstance(params) {
523
532
  if (service.Task.svc === undefined) {
524
533
  service.Task.svc = (await Promise.resolve().then(() => __importStar(require('./chevreConsole/task.js')))).TaskService;
@@ -35,8 +35,6 @@ export declare class OfferService extends Service {
35
35
  */
36
36
  id?: string;
37
37
  };
38
- }, options?: {
39
- useAsyncAction: '1' | '0';
40
38
  }): Promise<{
41
39
  /**
42
40
  * task id
@@ -8,9 +8,8 @@ const service_1 = require("../service");
8
8
  * COAオファーサービス
9
9
  */
10
10
  class OfferService extends service_1.Service {
11
- async acceptOffer(params, options) {
11
+ async acceptOffer(params) {
12
12
  const { object, purpose, potentialActions } = params;
13
- const useAsyncAction = options?.useAsyncAction;
14
13
  return this.fetch({
15
14
  uri: `/offers/${factory_1.factory.product.ProductType.EventService}ByCOA/accept`,
16
15
  method: 'POST',
@@ -21,8 +20,7 @@ class OfferService extends service_1.Service {
21
20
  ...(typeof potentialActions?.id === 'string') ? { potentialActions } : undefined
22
21
  },
23
22
  qs: {
24
- purpose: { id: purpose.id },
25
- ...((typeof useAsyncAction === 'string') && { useAsyncAction })
23
+ purpose: { id: purpose.id }
26
24
  }
27
25
  })
28
26
  .then(async (response) => response.json());
@@ -183,8 +183,6 @@ export declare class EventService extends Service {
183
183
  };
184
184
  limit: number;
185
185
  page: number;
186
- }, options?: {
187
- useDefaultSection?: boolean;
188
186
  }): Promise<ISearchResult<Omit<ISeatAsEventOffer, 'containedInPlace'>[]> & {
189
187
  /**
190
188
  * デフォルトセクションコード
@@ -112,16 +112,12 @@ class EventService extends service_1.Service {
112
112
  * 自動的にルームのひとつめのセクションが選択されます
113
113
  * @deprecated use SeatOfferService
114
114
  */
115
- async findSeatOffersDeprecated(params, options) {
116
- const { event, ...query } = params;
117
- const useDefaultSection = options?.useDefaultSection === true;
115
+ async findSeatOffersDeprecated(params) {
116
+ const { event, limit, page } = params;
118
117
  return this.fetch({
119
118
  uri: `/events/${encodeURIComponent(String(event.id))}/seats`,
120
119
  method: 'GET',
121
- qs: {
122
- ...query,
123
- useDefaultSection
124
- },
120
+ qs: { limit, page },
125
121
  expectedStatusCodes: [http_status_1.status.OK]
126
122
  })
127
123
  .then(async (response) => {
@@ -41,8 +41,6 @@ declare function authorizeOfferAsync(params: {
41
41
  */
42
42
  id?: string;
43
43
  };
44
- }, options?: {
45
- useAsyncAction: '1' | '0';
46
44
  }): (repos: {
47
45
  offerService: service.Offer;
48
46
  }) => Promise<IAuthorizeOfferAsyncResult>;
@@ -43,7 +43,7 @@ function authorizeActionError2responseError(authorizeActionError) {
43
43
  }
44
44
  return error;
45
45
  }
46
- function authorizeOfferAsync(params, options) {
46
+ function authorizeOfferAsync(params) {
47
47
  return async (repos) => {
48
48
  const acceptTask = await repos.offerService.acceptOffer({
49
49
  object: {
@@ -55,7 +55,7 @@ function authorizeOfferAsync(params, options) {
55
55
  ...(typeof params.potentialActions?.id === 'string')
56
56
  ? { potentialActions: { id: params.potentialActions.id } }
57
57
  : undefined
58
- }, options);
58
+ });
59
59
  let alreadyGivenUp = false;
60
60
  setTimeout(() => { alreadyGivenUp = true; }, ASYNC_ACTION_GIVEUP_MS);
61
61
  let result;
@@ -38,8 +38,6 @@ export declare class PlaceOrderCOAService extends Service {
38
38
  appliesToSurfrock?: IAppliesToSurfrock;
39
39
  };
40
40
  purpose: factory.action.authorize.offer.eventService.IPurpose;
41
- }, options?: {
42
- useAsyncAction: '1' | '0';
43
41
  }): Promise<IAuthorizeCOAEventServiceResult>;
44
42
  /**
45
43
  * COA興行オファー承認取消
@@ -77,8 +75,6 @@ export declare class PlaceOrderCOAService extends Service {
77
75
  appliesToSurfrock?: IAppliesToSurfrock;
78
76
  };
79
77
  purpose: factory.action.authorize.offer.eventService.IPurpose;
80
- }, options?: {
81
- useAsyncAction: '1' | '0';
82
78
  }): Promise<IAuthorizeCOAEventServiceResult>;
83
79
  }
84
80
  export {};
@@ -12,7 +12,7 @@ class PlaceOrderCOAService extends service_1.Service {
12
12
  /**
13
13
  * COA興行オファー承認
14
14
  */
15
- async createSeatReservationAuthorization(params, options) {
15
+ async createSeatReservationAuthorization(params) {
16
16
  const { object, purpose } = params;
17
17
  const { event, acceptedOffer, appliesToSurfrock } = object;
18
18
  const appliesToSurfrockIdentifier = (typeof appliesToSurfrock?.identifier === 'string' && appliesToSurfrock.identifier.length > 0)
@@ -43,7 +43,7 @@ class PlaceOrderCOAService extends service_1.Service {
43
43
  // potentialActions?: {
44
44
  // id?: string;
45
45
  // };
46
- }, options)({
46
+ })({
47
47
  offerService
48
48
  });
49
49
  if (typeof action.result?.price !== 'number') {
@@ -90,7 +90,7 @@ class PlaceOrderCOAService extends service_1.Service {
90
90
  * COA興行オファー承認変更
91
91
  * 完了ステータスの承認アクションに対して券種変更する際に使用
92
92
  */
93
- async changeSeatReservationOffers(params, options) {
93
+ async changeSeatReservationOffers(params) {
94
94
  const { id, object, purpose } = params;
95
95
  const { event, acceptedOffer, appliesToSurfrock } = object;
96
96
  const appliesToSurfrockIdentifier = (typeof appliesToSurfrock?.identifier === 'string' && appliesToSurfrock.identifier.length > 0)
@@ -119,7 +119,7 @@ class PlaceOrderCOAService extends service_1.Service {
119
119
  serviceOutput: { typeOf: appliesToSurfrockServiceOutputTypeOf }
120
120
  },
121
121
  potentialActions: { id }
122
- }, options)({
122
+ })({
123
123
  offerService
124
124
  });
125
125
  if (typeof action.result?.price !== 'number') {