@cinerino/sdk 3.124.1 → 3.125.0-alpha.1

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.
@@ -1206,7 +1206,7 @@ var OAuth2client = /** @class */ (function () {
1206
1206
  */
1207
1207
  OAuth2client.prototype.fetch = function (url, options, expectedStatusCodes) {
1208
1208
  return __awaiter(this, void 0, void 0, function () {
1209
- var retry, result, numberOfTry, _a, _b, error_1, statusCode;
1209
+ var retry, result, numberOfTry, _a, _b, error_1, statusCode, retryableStatusCodes;
1210
1210
  return __generator(this, function (_c) {
1211
1211
  switch (_c.label) {
1212
1212
  case 0:
@@ -1236,7 +1236,8 @@ var OAuth2client = /** @class */ (function () {
1236
1236
  error_1 = _c.sent();
1237
1237
  if (!(error_1 instanceof Error)) return [3 /*break*/, 8];
1238
1238
  statusCode = error_1.code;
1239
- if (!(retry && (statusCode === http_status_1.UNAUTHORIZED || statusCode === http_status_1.FORBIDDEN))) return [3 /*break*/, 8];
1239
+ retryableStatusCodes = [http_status_1.BAD_GATEWAY, http_status_1.FORBIDDEN, http_status_1.UNAUTHORIZED];
1240
+ if (!(retry && retryableStatusCodes.includes(statusCode))) return [3 /*break*/, 8];
1240
1241
  if (!(typeof this.credentials.refresh_token === 'string' && this.credentials.refresh_token.length > 0)) return [3 /*break*/, 7];
1241
1242
  return [4 /*yield*/, this.refreshAccessToken()];
1242
1243
  case 6:
@@ -49,8 +49,7 @@ async function main() {
49
49
  },
50
50
  description: 'sample',
51
51
  pendingTransaction: {
52
- typeOf: client.factory.account.transactionType.Deposit,
53
- id: ''
52
+ typeOf: client.factory.account.transactionType.Deposit
54
53
  }
55
54
  },
56
55
  expires: moment()
@@ -45,6 +45,7 @@ async function main() {
45
45
  // 取引開始
46
46
  const transaction = await transferService.start({
47
47
  typeOf: client.factory.account.transactionType.Transfer,
48
+ transactionNumber: `sample-${Date.now()}`,
48
49
  project: { typeOf: client.factory.organizationType.Project, id: project.id },
49
50
  expires: moment()
50
51
  .add(10, 'minutes')
@@ -43,6 +43,7 @@ async function main() {
43
43
  // 取引開始
44
44
  const transaction = await withdrawService.start({
45
45
  typeOf: client.factory.account.transactionType.Withdraw,
46
+ transactionNumber: `sample-${Date.now()}`,
46
47
  project: { typeOf: client.factory.organizationType.Project, id: project.id },
47
48
  expires: moment()
48
49
  .add(10, 'minutes')
@@ -29,7 +29,7 @@ async function main() {
29
29
  const searchMyPaymentCardsResult = await personOwnershipInfoService.searchMyPaymentCards({
30
30
  iss: ''
31
31
  });
32
- console.log(searchMyPaymentCardsResult.data.map((o) => `${o.typeOfGood.identifier} ${o.typeOfGood.paymentAccount?.status}`));
32
+ console.log(searchMyPaymentCardsResult.data.map((o) => `${o.typeOfGood.identifier}`));
33
33
  console.log(searchMyPaymentCardsResult.data.length, 'ownershipInfos returned');
34
34
 
35
35
  // const paymentCardOwnershipInfo = searchMyPaymentCardsResult.data[0];
@@ -82,13 +82,25 @@ async function main() {
82
82
  // async () => {
83
83
  // i += 1;
84
84
  // try {
85
-
85
+ // await orderService.search({
86
+ // limit: 10,
87
+ // page: 1,
88
+ // orderDate: {
89
+ // $gte: moment(now)
90
+ // .add(-1, 'month')
91
+ // .toDate(),
92
+ // $lte: now
93
+ // }
94
+ // });
95
+ // console.log(data);
96
+ // console.log(totalCount, 'orders found', i);
97
+ // console.log(data.length, 'orders returned', i);
86
98
  // } catch (error) {
87
- // console.error(error);
99
+ // console.error(error, i);
88
100
  // }
89
101
  // },
90
102
  // // tslint:disable-next-line:no-magic-numbers
91
- // 500
103
+ // 50
92
104
  // );
93
105
  }
94
106