@cinerino/sdk 16.3.0-alpha.1 → 16.3.0-alpha.11
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/chevreAdmin/order.d.ts +1 -13
- package/lib/abstract/chevreAdmin/order.js +0 -12
- package/lib/abstract/chevreAdmin/reservation.d.ts +2 -2
- package/lib/abstract/chevreAsset/order.js +1 -3
- package/lib/abstract/chevreConsole/assetTransaction/pay.d.ts +0 -9
- package/lib/abstract/chevreConsole/assetTransaction/pay.js +0 -41
- package/lib/abstract/chevreConsole/emailMessage.d.ts +11 -12
- package/lib/abstract/chevreConsole/emailMessage.js +2 -18
- package/lib/abstract/chevreConsole/order.js +0 -16
- package/lib/abstract/chevreConsole/reservation/factory.d.ts +4 -0
- package/lib/abstract/chevreConsole/reservation/factory.js +0 -1
- package/lib/abstract/chevreTxn/transaction/placeOrder/factory.d.ts +34 -9
- package/lib/abstract/chevreTxn/transaction/placeOrder.d.ts +3 -16
- package/lib/abstract/chevreTxn/transaction/placeOrder.js +12 -8
- package/lib/abstract/chevreTxn/transaction/returnOrder/factory.d.ts +86 -0
- package/lib/abstract/chevreTxn/transaction/returnOrder/factory.js +1 -0
- package/lib/abstract/chevreTxn/transaction/returnOrder.d.ts +2 -2
- package/lib/abstract/cinerino/service/emailMessage.d.ts +2 -14
- package/lib/abstract/cinerino/service/emailMessage.js +2 -2
- package/lib/abstract/cloud/admin/order.d.ts +0 -10
- package/lib/abstract/cloud/admin/order.js +0 -14
- package/lib/abstract/cloud/admin/reservation.d.ts +1 -5
- package/lib/abstract/cloud/asset/order.d.ts +6 -3
- package/lib/abstract/cloud/asset/order.js +1 -2
- package/lib/abstract/cloud/txn/transaction/placeOrder.d.ts +3 -5
- package/lib/abstract/cloud/txn/transaction/placeOrder.js +2 -37
- package/lib/abstract/cloud/txn/transaction/returnOrder.d.ts +2 -5
- package/lib/abstract/cloud/txn/transaction/returnOrder.js +0 -30
- package/lib/bundle.js +2 -2
- package/lib/bundle.js.map +3 -3
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ISetProfileParams } from '../../../chevreTxn/transaction';
|
|
2
|
-
import type { IConfirmResult4tttsPOS, IMinimalConfirmResult, IStartParams, IStartPlaceOrderResult } from '../../../chevreTxn/transaction/placeOrder/factory';
|
|
2
|
+
import type { IEmailCustomization, IConfirmResult4tttsPOS, IMinimalConfirmResult, IStartParams, IStartPlaceOrderResult } from '../../../chevreTxn/transaction/placeOrder/factory';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
4
|
import { Service } from '../../../service';
|
|
5
5
|
/**
|
|
@@ -31,7 +31,7 @@ export declare class PlaceOrderTransactionService extends Service {
|
|
|
31
31
|
/**
|
|
32
32
|
* 取引確定(レスポンス最小化)
|
|
33
33
|
*/
|
|
34
|
-
confirmWithMiminalResponse(params: Pick<factory.transaction.placeOrder.IConfirmParams, 'id'
|
|
34
|
+
confirmWithMiminalResponse(params: Pick<factory.transaction.placeOrder.IConfirmParams, 'id'> & {
|
|
35
35
|
/**
|
|
36
36
|
* 注文配送メールを送信するかどうか
|
|
37
37
|
*/
|
|
@@ -42,9 +42,7 @@ export declare class PlaceOrderTransactionService extends Service {
|
|
|
42
42
|
* 挿入変数として`order`を使用できます
|
|
43
43
|
* 参考 -> https://pugjs.org/api/getting-started.html
|
|
44
44
|
*/
|
|
45
|
-
email?:
|
|
46
|
-
sender?: Pick<factory.creativeWork.message.email.ICustomizedParticipant, 'name'>;
|
|
47
|
-
};
|
|
45
|
+
email?: IEmailCustomization;
|
|
48
46
|
}): Promise<IMinimalConfirmResult>;
|
|
49
47
|
/**
|
|
50
48
|
* 明示的に取引を中止する
|
|
@@ -2,19 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PlaceOrderTransactionService = void 0;
|
|
4
4
|
const http_status_1 = require("http-status");
|
|
5
|
-
// import { IAdditionalOptions, IOptions, Service } from '../../../service';
|
|
6
5
|
const index_1 = require("../../../index");
|
|
7
6
|
const service_1 = require("../../../service");
|
|
8
7
|
/**
|
|
9
8
|
* 注文取引サービス
|
|
10
9
|
*/
|
|
11
10
|
class PlaceOrderTransactionService extends service_1.Service {
|
|
12
|
-
// constructor(options: Pick<
|
|
13
|
-
// IOptions,
|
|
14
|
-
// 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath' | 'retryableStatusCodes'
|
|
15
|
-
// > & IAdditionalOptions) {
|
|
16
|
-
// super(options);
|
|
17
|
-
// }
|
|
18
11
|
/**
|
|
19
12
|
* 取引開始
|
|
20
13
|
*/
|
|
@@ -106,24 +99,12 @@ class PlaceOrderTransactionService extends service_1.Service {
|
|
|
106
99
|
expectsReservationIds: true,
|
|
107
100
|
id
|
|
108
101
|
});
|
|
109
|
-
// return this.fetch({
|
|
110
|
-
// uri: `/transactions/${this.typeOf}/${params.id}/confirm`,
|
|
111
|
-
// method: 'PUT',
|
|
112
|
-
// expectedStatusCodes: [status.OK],
|
|
113
|
-
// // retry 429(2024-04-01~)
|
|
114
|
-
// // retry 409(2024-04-01~)
|
|
115
|
-
// retryableStatusCodes: [CONFLICT, TOO_MANY_REQUESTS],
|
|
116
|
-
// body: {
|
|
117
|
-
// expectsReservationIds: true
|
|
118
|
-
// }
|
|
119
|
-
// })
|
|
120
|
-
// .then(async (response) => response.json());
|
|
121
102
|
}
|
|
122
103
|
/**
|
|
123
104
|
* 取引確定(レスポンス最小化)
|
|
124
105
|
*/
|
|
125
106
|
async confirmWithMiminalResponse(params) {
|
|
126
|
-
const { id,
|
|
107
|
+
const { id, sendEmailMessage, email } = params;
|
|
127
108
|
const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
|
|
128
109
|
const chevreTxn = await (0, index_1.loadChevreTxn)({ auth, endpoint, disableAutoRetry });
|
|
129
110
|
const placeOrderService = await chevreTxn.createPlaceOrderTransactionInstance({
|
|
@@ -135,23 +116,7 @@ class PlaceOrderTransactionService extends service_1.Service {
|
|
|
135
116
|
http_status_1.status.TOO_MANY_REQUESTS
|
|
136
117
|
]
|
|
137
118
|
});
|
|
138
|
-
return placeOrderService.confirm({
|
|
139
|
-
id, potentialActions, result, sendEmailMessage, email,
|
|
140
|
-
expectsMinimalResponse: true
|
|
141
|
-
});
|
|
142
|
-
// return this.fetch({
|
|
143
|
-
// uri: `/transactions/${this.typeOf}/${params.id}/confirm`,
|
|
144
|
-
// method: 'PUT',
|
|
145
|
-
// expectedStatusCodes: [status.OK],
|
|
146
|
-
// // retry 429(2024-04-01~)
|
|
147
|
-
// // retry 409(2024-04-01~)
|
|
148
|
-
// retryableStatusCodes: [CONFLICT, TOO_MANY_REQUESTS],
|
|
149
|
-
// body: {
|
|
150
|
-
// ...params,
|
|
151
|
-
// expectsMinimalResponse: true
|
|
152
|
-
// }
|
|
153
|
-
// })
|
|
154
|
-
// .then(async (response) => response.json());
|
|
119
|
+
return placeOrderService.confirm({ id, sendEmailMessage, email });
|
|
155
120
|
}
|
|
156
121
|
/**
|
|
157
122
|
* 明示的に取引を中止する
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type { IStartParams } from '../../../chevreTxn/transaction/returnOrder/factory';
|
|
1
|
+
import type { IStartParams, IConfirmParams } from '../../../chevreTxn/transaction/returnOrder/factory';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
3
|
import { Service } from '../../../service';
|
|
4
4
|
/**
|
|
5
5
|
* 返品取引サービス
|
|
6
6
|
*/
|
|
7
7
|
export declare class ReturnOrderTransactionService extends Service {
|
|
8
|
-
/**
|
|
9
|
-
* 取引を開始する
|
|
10
|
-
*/
|
|
11
8
|
start(params: IStartParams): Promise<Pick<factory.transaction.ITransaction<factory.transactionType.ReturnOrder>, 'expires' | 'id' | 'project' | 'startDate' | 'status' | 'typeOf'>>;
|
|
12
9
|
/**
|
|
13
10
|
* 返品取引を開始可能かどうか検証する
|
|
@@ -16,5 +13,5 @@ export declare class ReturnOrderTransactionService extends Service {
|
|
|
16
13
|
/**
|
|
17
14
|
* 取引確定
|
|
18
15
|
*/
|
|
19
|
-
confirm(params:
|
|
16
|
+
confirm(params: IConfirmParams): Promise<void>;
|
|
20
17
|
}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ReturnOrderTransactionService = void 0;
|
|
4
|
-
// import { IAdditionalOptions, IOptions, Service } from '../../../service';
|
|
5
4
|
const index_1 = require("../../../index");
|
|
6
5
|
const service_1 = require("../../../service");
|
|
7
6
|
/**
|
|
8
7
|
* 返品取引サービス
|
|
9
8
|
*/
|
|
10
9
|
class ReturnOrderTransactionService extends service_1.Service {
|
|
11
|
-
// constructor(options: Pick<
|
|
12
|
-
// IOptions,
|
|
13
|
-
// 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath' | 'retryableStatusCodes'
|
|
14
|
-
// > & IAdditionalOptions) {
|
|
15
|
-
// super(options);
|
|
16
|
-
// }
|
|
17
|
-
/**
|
|
18
|
-
* 取引を開始する
|
|
19
|
-
*/
|
|
20
10
|
async start(params) {
|
|
21
11
|
const { agent, object } = params;
|
|
22
12
|
const { auth, endpoint, project, seller, retryableStatusCodes } = this.options;
|
|
@@ -29,13 +19,6 @@ class ReturnOrderTransactionService extends service_1.Service {
|
|
|
29
19
|
]
|
|
30
20
|
});
|
|
31
21
|
return returnOrderService.start({ agent, object });
|
|
32
|
-
// return this.fetch({
|
|
33
|
-
// uri: `/transactions/${this.typeOf}/start`,
|
|
34
|
-
// method: 'POST',
|
|
35
|
-
// body: params,
|
|
36
|
-
// expectedStatusCodes: [status.OK]
|
|
37
|
-
// })
|
|
38
|
-
// .then(async (response) => response.json());
|
|
39
22
|
}
|
|
40
23
|
/**
|
|
41
24
|
* 返品取引を開始可能かどうか検証する
|
|
@@ -52,13 +35,6 @@ class ReturnOrderTransactionService extends service_1.Service {
|
|
|
52
35
|
]
|
|
53
36
|
});
|
|
54
37
|
await returnOrderService.verifyReturnPolicy({ object });
|
|
55
|
-
// await this.fetch({
|
|
56
|
-
// uri: `/transactions/${this.typeOf}/start`,
|
|
57
|
-
// method: 'POST',
|
|
58
|
-
// body: params,
|
|
59
|
-
// qs: { justVerify: true },
|
|
60
|
-
// expectedStatusCodes: [NO_CONTENT, OK]
|
|
61
|
-
// });
|
|
62
38
|
}
|
|
63
39
|
/**
|
|
64
40
|
* 取引確定
|
|
@@ -75,12 +51,6 @@ class ReturnOrderTransactionService extends service_1.Service {
|
|
|
75
51
|
]
|
|
76
52
|
});
|
|
77
53
|
await returnOrderService.confirm({ id, potentialActions });
|
|
78
|
-
// await this.fetch({
|
|
79
|
-
// uri: `/transactions/${this.typeOf}/${params.id}/confirm`,
|
|
80
|
-
// method: 'PUT',
|
|
81
|
-
// body: params,
|
|
82
|
-
// expectedStatusCodes: [status.NO_CONTENT]
|
|
83
|
-
// });
|
|
84
54
|
}
|
|
85
55
|
}
|
|
86
56
|
exports.ReturnOrderTransactionService = ReturnOrderTransactionService;
|