@cinerino/sdk 16.4.0-alpha.2 → 16.4.0-alpha.3

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.
@@ -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());
@@ -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') {