@cinerino/sdk 3.34.0 → 3.37.0

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.
@@ -8344,7 +8344,7 @@ var PersonService = /** @class */ (function (_super) {
8344
8344
  uri: "/people/" + id,
8345
8345
  method: 'GET',
8346
8346
  expectedStatusCodes: [http_status_1.OK],
8347
- qs: { iss: params.iss }
8347
+ qs: { iss: params.iss, replaceNewUserPool: params.replaceNewUserPool }
8348
8348
  })
8349
8349
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
8350
8350
  return [2 /*return*/, response.json()];
@@ -13704,37 +13704,7 @@ var PersonOwnershipInfoService = /** @class */ (function (_super) {
13704
13704
  });
13705
13705
  };
13706
13706
  /**
13707
- * 口座開設
13708
- */
13709
- // public async openAccount(params: {
13710
- // /**
13711
- // * 未指定の場合`me`がセットされます
13712
- // */
13713
- // id?: string;
13714
- // /**
13715
- // * 口座名義
13716
- // */
13717
- // name: string;
13718
- // /**
13719
- // * 口座タイプ
13720
- // */
13721
- // accountType: string;
13722
- // }): Promise<factory.transaction.placeOrder.IResult> {
13723
- // const id = (typeof params.id === 'string') ? params.id : 'me';
13724
- // return this.fetch({
13725
- // uri: `/people/${id}/ownershipInfos/accounts/${params.accountType}`,
13726
- // method: 'POST',
13727
- // body: {
13728
- // name: params.name
13729
- // },
13730
- // expectedStatusCodes: [CREATED]
13731
- // })
13732
- // .then(async (response) => response.json());
13733
- // }
13734
- /**
13735
- * 口座解約
13736
- * 口座の状態を変更するだけで、ユーザーの所有する口座リストから削除はされません。
13737
- * 解約された口座で取引を進行しようとすると400エラーとなります。
13707
+ * ペイメントカード所有権削除
13738
13708
  */
13739
13709
  PersonOwnershipInfoService.prototype.closeAccount = function (params) {
13740
13710
  return __awaiter(this, void 0, void 0, function () {
@@ -13939,6 +13909,28 @@ var PersonOwnershipInfoService = /** @class */ (function (_super) {
13939
13909
  });
13940
13910
  });
13941
13911
  };
13912
+ /**
13913
+ * 会員所有権削除
13914
+ */
13915
+ PersonOwnershipInfoService.prototype.deleteOwnershipInfoById = function (params) {
13916
+ return __awaiter(this, void 0, void 0, function () {
13917
+ var id;
13918
+ return __generator(this, function (_a) {
13919
+ switch (_a.label) {
13920
+ case 0:
13921
+ id = (typeof params.id === 'string') ? params.id : 'me';
13922
+ return [4 /*yield*/, this.fetch({
13923
+ uri: "/people/" + id + "/ownershipInfos/" + String(params.ownershipInfoId),
13924
+ method: 'DELETE',
13925
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
13926
+ })];
13927
+ case 1:
13928
+ _a.sent();
13929
+ return [2 /*return*/];
13930
+ }
13931
+ });
13932
+ });
13933
+ };
13942
13934
  return PersonOwnershipInfoService;
13943
13935
  }(service_1.Service));
13944
13936
  exports.PersonOwnershipInfoService = PersonOwnershipInfoService;
@@ -0,0 +1,32 @@
1
+ // tslint:disable:no-implicit-dependencies no-console no-magic-numbers
2
+ import * as client from '../../../lib/';
3
+
4
+ const project = { id: process.env.PROJECT_ID };
5
+
6
+ async function main() {
7
+ const authClient = new client.auth.ClientCredentials({
8
+ domain: <string>process.env.CHEVRE_AUTHORIZE_SERVER_DOMAIN,
9
+ clientId: <string>process.env.CHEVRE_CLIENT_ID,
10
+ clientSecret: <string>process.env.CHEVRE_CLIENT_SECRET,
11
+ scopes: [],
12
+ state: ''
13
+ });
14
+
15
+ const personService = new client.chevre.service.Person({
16
+ endpoint: <string>process.env.CHEVRE_ENDPOINT,
17
+ auth: authClient,
18
+ project
19
+ });
20
+
21
+ const data = await personService.findById({
22
+ iss: '',
23
+ id: '708b007c-79e2-4a3f-8f7a-4bcfc56f4583'
24
+ });
25
+ console.log(data);
26
+ }
27
+
28
+ main()
29
+ .then(() => {
30
+ console.log('main processed.');
31
+ })
32
+ .catch(console.error);
@@ -1,6 +1,6 @@
1
1
  // tslint:disable:no-console no-implicit-dependencies no-magic-numbers
2
2
  import * as httpStatus from 'http-status';
3
- // import * as moment from 'moment';
3
+ import * as moment from 'moment';
4
4
 
5
5
  import * as client from '../../../../lib/index';
6
6
  import * as auth from '../../auth/auth';
@@ -18,18 +18,40 @@ async function main() {
18
18
  });
19
19
 
20
20
  console.log('searching...');
21
+ const now = new Date();
21
22
  const result = await personService.fetch({
22
23
  uri: '/people/me/ownershipInfos/PaymentCard',
23
24
  method: 'GET',
24
25
  qs: {
25
26
  limit: 10,
26
- page: 1
27
+ page: 1,
28
+ ownedFrom: moment(now)
29
+ .add(-1, 'seconds')
30
+ .toDate(),
31
+ ownedThrough: now
27
32
  },
28
33
  expectedStatusCodes: [httpStatus.OK]
29
34
  })
30
35
  .then(async (response) => response.json());
31
36
  console.log(result);
32
37
  console.log(result.map((o: any) => o.typeOfGood));
38
+
39
+ if (result.length > 0) {
40
+ // カード取引履歴検索
41
+ const paymentCardOwnershipInfo = result[result.length - 1];
42
+ const actions = await personService.fetch({
43
+ uri: `/people/me/ownershipInfos/PaymentCard/${paymentCardOwnershipInfo.id}/actions/moneyTransfer`,
44
+ method: 'GET',
45
+ qs: {
46
+ limit: 1,
47
+ page: 1
48
+ },
49
+ expectedStatusCodes: [httpStatus.OK]
50
+ })
51
+ .then(async (response) => response.json());
52
+ console.log(actions);
53
+
54
+ }
33
55
  }
34
56
 
35
57
  main()
@@ -31,6 +31,19 @@ async function main() {
31
31
  console.log(result);
32
32
  console.log(result.map((o: any) => o.typeOfGood));
33
33
  console.log(result.map((o: any) => o.typeOfGood.reservationFor.superEvent));
34
+
35
+ if (result.length > 0) {
36
+ // 所有権削除
37
+ // const reservationOwnershipInfo = result[result.length - 1];
38
+ // console.log('deleting...', reservationOwnershipInfo.id);
39
+ // await personService.fetch({
40
+ // uri: `/people/me/ownershipInfos/${reservationOwnershipInfo.id}`,
41
+ // method: 'DELETE',
42
+ // expectedStatusCodes: [httpStatus.NO_CONTENT]
43
+ // });
44
+ // console.log('deleted', reservationOwnershipInfo.id);
45
+
46
+ }
34
47
  }
35
48
 
36
49
  main()
@@ -0,0 +1,45 @@
1
+ // tslint:disable:no-console no-implicit-dependencies no-magic-numbers
2
+ import * as httpStatus from 'http-status';
3
+
4
+ import * as client from '../../../lib/index';
5
+
6
+ const auth = new client.auth.ClientCredentials({
7
+ domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
8
+ clientId: <string>process.env.ST_CLIENT_ID,
9
+ clientSecret: <string>process.env.ST_CLIENT_SECRET,
10
+ scopes: [],
11
+ state: 'teststate'
12
+ });
13
+
14
+ const sellerService = new client.service.Seller({
15
+ endpoint: <string>process.env.ST_API_ENDPOINT,
16
+ auth: auth
17
+ });
18
+
19
+ // tslint:disable-next-line:max-func-body-length
20
+ async function main() {
21
+ console.log('ルームを検索しています...');
22
+ const searchResult = await sellerService.fetch({
23
+ uri: '/places/ScreeningRoom',
24
+ method: 'GET',
25
+ qs: {
26
+ limit: 100
27
+ },
28
+ expectedStatusCodes: [httpStatus.OK]
29
+ })
30
+ .then(async (response) => {
31
+ return {
32
+ data: await response.json()
33
+ };
34
+ });
35
+ console.log(searchResult.data);
36
+ console.log(searchResult.data.length);
37
+ }
38
+
39
+ main()
40
+ .then(() => {
41
+ console.log('main processed.');
42
+ })
43
+ .catch((err) => {
44
+ console.error(err);
45
+ });
@@ -41,31 +41,12 @@ async function main() {
41
41
  });
42
42
  console.log('transaction started', transaction.id);
43
43
 
44
- const informUrl = process.env.LINE_NOTIFY_URL;
45
-
46
44
  console.log('confirming transaction...');
47
45
  await returnOrderService.confirm({
48
46
  id: transaction.id,
49
47
  potentialActions: {
50
48
  returnOrder: {
51
49
  potentialActions: {
52
- cancelReservation: [
53
- {
54
- object: {
55
- typeOf: client.factory.assetTransactionType.Reserve,
56
- id: '5d6e593c0470230012b80b53'
57
- },
58
- potentialActions: {
59
- cancelReservation: {
60
- potentialActions: {
61
- informReservation: [
62
- { recipient: { url: informUrl } }
63
- ]
64
- }
65
- }
66
- }
67
- }
68
- ],
69
50
  /**
70
51
  * クレジットカード返金アクションについてカスタマイズする場合に指定
71
52
  */
package/lib/bundle.js CHANGED
@@ -13704,37 +13704,7 @@ var PersonOwnershipInfoService = /** @class */ (function (_super) {
13704
13704
  });
13705
13705
  };
13706
13706
  /**
13707
- * 口座開設
13708
- */
13709
- // public async openAccount(params: {
13710
- // /**
13711
- // * 未指定の場合`me`がセットされます
13712
- // */
13713
- // id?: string;
13714
- // /**
13715
- // * 口座名義
13716
- // */
13717
- // name: string;
13718
- // /**
13719
- // * 口座タイプ
13720
- // */
13721
- // accountType: string;
13722
- // }): Promise<factory.transaction.placeOrder.IResult> {
13723
- // const id = (typeof params.id === 'string') ? params.id : 'me';
13724
- // return this.fetch({
13725
- // uri: `/people/${id}/ownershipInfos/accounts/${params.accountType}`,
13726
- // method: 'POST',
13727
- // body: {
13728
- // name: params.name
13729
- // },
13730
- // expectedStatusCodes: [CREATED]
13731
- // })
13732
- // .then(async (response) => response.json());
13733
- // }
13734
- /**
13735
- * 口座解約
13736
- * 口座の状態を変更するだけで、ユーザーの所有する口座リストから削除はされません。
13737
- * 解約された口座で取引を進行しようとすると400エラーとなります。
13707
+ * ペイメントカード所有権削除
13738
13708
  */
13739
13709
  PersonOwnershipInfoService.prototype.closeAccount = function (params) {
13740
13710
  return __awaiter(this, void 0, void 0, function () {
@@ -13939,6 +13909,28 @@ var PersonOwnershipInfoService = /** @class */ (function (_super) {
13939
13909
  });
13940
13910
  });
13941
13911
  };
13912
+ /**
13913
+ * 会員所有権削除
13914
+ */
13915
+ PersonOwnershipInfoService.prototype.deleteOwnershipInfoById = function (params) {
13916
+ return __awaiter(this, void 0, void 0, function () {
13917
+ var id;
13918
+ return __generator(this, function (_a) {
13919
+ switch (_a.label) {
13920
+ case 0:
13921
+ id = (typeof params.id === 'string') ? params.id : 'me';
13922
+ return [4 /*yield*/, this.fetch({
13923
+ uri: "/people/" + id + "/ownershipInfos/" + String(params.ownershipInfoId),
13924
+ method: 'DELETE',
13925
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
13926
+ })];
13927
+ case 1:
13928
+ _a.sent();
13929
+ return [2 /*return*/];
13930
+ }
13931
+ });
13932
+ });
13933
+ };
13942
13934
  return PersonOwnershipInfoService;
13943
13935
  }(service_1.Service));
13944
13936
  exports.PersonOwnershipInfoService = PersonOwnershipInfoService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "3.34.0",
3
+ "version": "3.37.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -97,7 +97,7 @@
97
97
  "watchify": "^3.11.1"
98
98
  },
99
99
  "dependencies": {
100
- "@cinerino/api-abstract-client": "3.34.0",
100
+ "@cinerino/api-abstract-client": "3.37.0",
101
101
  "debug": "^3.2.6",
102
102
  "http-status": "^1.4.2",
103
103
  "idtoken-verifier": "^2.0.3",