@cinerino/sdk 16.4.0-alpha.1 → 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.
- package/lib/abstract/chevreConsole/asyncAction.d.ts +13 -0
- package/lib/abstract/chevreConsole/asyncAction.js +20 -0
- package/lib/abstract/chevreConsole/scheduledTask.d.ts +13 -0
- package/lib/abstract/chevreConsole/scheduledTask.js +20 -0
- package/lib/abstract/chevreConsole.d.ts +18 -0
- package/lib/abstract/chevreConsole.js +18 -0
- package/lib/abstract/chevreTxc/offer.d.ts +0 -2
- package/lib/abstract/chevreTxc/offer.js +2 -4
- package/lib/abstract/cloud/txc/transaction/forceAsync.d.ts +0 -2
- package/lib/abstract/cloud/txc/transaction/forceAsync.js +2 -2
- package/lib/abstract/cloud/txc/transaction/placeOrder.d.ts +0 -4
- package/lib/abstract/cloud/txc/transaction/placeOrder.js +4 -4
- package/lib/bundle.js +3 -3
- package/lib/bundle.js.map +4 -4
- package/package.json +2 -2
|
@@ -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 AsyncActionService extends Service<IOptions> {
|
|
9
|
+
findAsyncActions(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.AsyncActionService = void 0;
|
|
4
|
+
const http_status_1 = require("http-status");
|
|
5
|
+
const service_1 = require("../service");
|
|
6
|
+
/**
|
|
7
|
+
* 非同期アクションサービス
|
|
8
|
+
*/
|
|
9
|
+
class AsyncActionService extends service_1.Service {
|
|
10
|
+
async findAsyncActions(params) {
|
|
11
|
+
return this.fetch({
|
|
12
|
+
uri: '/asyncActions',
|
|
13
|
+
method: 'GET',
|
|
14
|
+
qs: params,
|
|
15
|
+
expectedStatusCodes: [http_status_1.status.OK]
|
|
16
|
+
})
|
|
17
|
+
.then(async (response) => response.json());
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.AsyncActionService = AsyncActionService;
|
|
@@ -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;
|
|
@@ -48,6 +48,8 @@ import type { ReservationService } from './chevreConsole/reservation';
|
|
|
48
48
|
import type { SellerService } from './chevreConsole/seller';
|
|
49
49
|
import type { SellerMakesOfferService } from './chevreConsole/sellerMakesOffer';
|
|
50
50
|
import type { SellerReturnPolicyService } from './chevreConsole/sellerReturnPolicy';
|
|
51
|
+
import type { AsyncActionService } from './chevreConsole/asyncAction';
|
|
52
|
+
import type { ScheduledTaskService } from './chevreConsole/scheduledTask';
|
|
51
53
|
import type { TaskService } from './chevreConsole/task';
|
|
52
54
|
import type { TicketService } from './chevreConsole/ticket';
|
|
53
55
|
import type { TokenService } from './chevreConsole/token';
|
|
@@ -389,6 +391,20 @@ export declare namespace service {
|
|
|
389
391
|
namespace SellerReturnPolicy {
|
|
390
392
|
let svc: typeof SellerReturnPolicyService | undefined;
|
|
391
393
|
}
|
|
394
|
+
/**
|
|
395
|
+
* 非同期アクションサービス
|
|
396
|
+
*/
|
|
397
|
+
type AsyncAction = AsyncActionService;
|
|
398
|
+
namespace AsyncAction {
|
|
399
|
+
let svc: typeof AsyncActionService | undefined;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* 予定タスクサービス
|
|
403
|
+
*/
|
|
404
|
+
type ScheduledTask = ScheduledTaskService;
|
|
405
|
+
namespace ScheduledTask {
|
|
406
|
+
let svc: typeof ScheduledTaskService | undefined;
|
|
407
|
+
}
|
|
392
408
|
/**
|
|
393
409
|
* タスクサービス
|
|
394
410
|
*/
|
|
@@ -520,6 +536,8 @@ export declare class ChevreConsole {
|
|
|
520
536
|
createSellerInstance(params: Pick<IOptions, 'project'>): Promise<SellerService>;
|
|
521
537
|
createSellerMakesOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<SellerMakesOfferService>;
|
|
522
538
|
createSellerReturnPolicyInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<SellerReturnPolicyService>;
|
|
539
|
+
createAsyncActionInstance(params: Pick<IOptions, 'project'>): Promise<AsyncActionService>;
|
|
540
|
+
createScheduledTaskInstance(params: Pick<IOptions, 'project'>): Promise<ScheduledTaskService>;
|
|
523
541
|
createTaskInstance(params: Pick<IOptions, 'project'>): Promise<TaskService>;
|
|
524
542
|
createTicketInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<TicketService>;
|
|
525
543
|
createAssetTransactionInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<AssetTransactionService>;
|
|
@@ -180,6 +180,12 @@ var service;
|
|
|
180
180
|
let SellerReturnPolicy;
|
|
181
181
|
(function (SellerReturnPolicy) {
|
|
182
182
|
})(SellerReturnPolicy = service.SellerReturnPolicy || (service.SellerReturnPolicy = {}));
|
|
183
|
+
let AsyncAction;
|
|
184
|
+
(function (AsyncAction) {
|
|
185
|
+
})(AsyncAction = service.AsyncAction || (service.AsyncAction = {}));
|
|
186
|
+
let ScheduledTask;
|
|
187
|
+
(function (ScheduledTask) {
|
|
188
|
+
})(ScheduledTask = service.ScheduledTask || (service.ScheduledTask = {}));
|
|
183
189
|
let Task;
|
|
184
190
|
(function (Task) {
|
|
185
191
|
})(Task = service.Task || (service.Task = {}));
|
|
@@ -510,6 +516,18 @@ class ChevreConsole {
|
|
|
510
516
|
}
|
|
511
517
|
return new service.SellerReturnPolicy.svc({ ...this.options, ...params, retryableStatusCodes: [] });
|
|
512
518
|
}
|
|
519
|
+
async createAsyncActionInstance(params) {
|
|
520
|
+
if (service.AsyncAction.svc === undefined) {
|
|
521
|
+
service.AsyncAction.svc = (await Promise.resolve().then(() => __importStar(require('./chevreConsole/asyncAction')))).AsyncActionService;
|
|
522
|
+
}
|
|
523
|
+
return new service.AsyncAction.svc({ ...this.options, ...params, retryableStatusCodes: [] });
|
|
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
|
+
}
|
|
513
531
|
async createTaskInstance(params) {
|
|
514
532
|
if (service.Task.svc === undefined) {
|
|
515
533
|
service.Task.svc = (await Promise.resolve().then(() => __importStar(require('./chevreConsole/task.js')))).TaskService;
|
|
@@ -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
|
|
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());
|
|
@@ -43,7 +43,7 @@ function authorizeActionError2responseError(authorizeActionError) {
|
|
|
43
43
|
}
|
|
44
44
|
return error;
|
|
45
45
|
}
|
|
46
|
-
function authorizeOfferAsync(params
|
|
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
|
-
}
|
|
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
|
|
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
|
-
}
|
|
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
|
|
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
|
-
}
|
|
122
|
+
})({
|
|
123
123
|
offerService
|
|
124
124
|
});
|
|
125
125
|
if (typeof action.result?.price !== 'number') {
|