@cinerino/sdk 3.56.0 → 3.57.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.
@@ -3,13 +3,16 @@
3
3
  * 確認番号で注文検索
4
4
  */
5
5
  import * as client from '../../lib/index';
6
- import * as auth from './auth/auth';
6
+ // import * as auth from './auth/auth';
7
7
 
8
8
  async function main() {
9
- const authClient = await auth.login();
10
- await authClient.refreshAccessToken();
11
- const loginTicket = authClient.verifyIdToken({});
12
- console.log('username is', loginTicket.getUsername());
9
+ const authClient = new client.auth.ClientCredentials({
10
+ domain: <string>process.env.TEST_AUTHORIZE_SERVER_DOMAIN,
11
+ clientId: <string>process.env.TEST_CLIENT_ID,
12
+ clientSecret: <string>process.env.TEST_CLIENT_SECRET,
13
+ scopes: [],
14
+ state: ''
15
+ });
13
16
 
14
17
  const orderService = new client.service.Order({
15
18
  endpoint: <string>process.env.API_ENDPOINT,
@@ -17,11 +20,12 @@ async function main() {
17
20
  project: { id: 'cinerino' }
18
21
  });
19
22
  const orders = await orderService.findByConfirmationNumber({
20
- confirmationNumber: '2',
23
+ confirmationNumber: '0551',
21
24
  customer: {
22
- telephone: '+819012345678'
25
+ telephone: '+819012341234'
23
26
  }
24
27
  });
28
+ console.log(orders);
25
29
  console.log(orders.length, 'orders found', orders[0].orderDate, orders[0].orderNumber);
26
30
  }
27
31
 
@@ -21,73 +21,75 @@ async function main() {
21
21
 
22
22
  const now = new Date();
23
23
 
24
- let i = 0;
25
- setInterval(
26
- async () => {
27
- i += 1;
28
- try {
29
-
30
- const { totalCount, data } = await orderService.search({
31
- limit: 10,
32
- page: 1,
33
- orderDate: {
34
- $gte: moment(now)
35
- .add(-1, 'month')
36
- .toDate(),
37
- $lte: now
38
- },
39
- // identifier: {
40
- // $in: [
41
- // { name: 'sampleOrderIdentifierName1', value: 'sampleOrderIdentifiervalue1' },
42
- // { name: 'sampleOrderIdentifierName2', value: 'sampleOrderIdentifiervalue2' }
43
- // ]
44
- // },
45
- // customer: {
46
- // typeOf: client.factory.personType.Person,
47
- // identifiers: [
48
- // { name: 'SampleName', value: 'SampleValue' }
49
- // ],
50
- // telephone: '1234$'
51
- // },
52
- paymentMethods: {
53
- // typeOfs: [client.factory.paymentMethodType.Account],
54
- // paymentMethodIds: ['30118000911']
24
+ const { totalCount, data } = await orderService.search({
25
+ limit: 10,
26
+ page: 1,
27
+ orderDate: {
28
+ $gte: moment(now)
29
+ .add(-1, 'month')
30
+ .toDate(),
31
+ $lte: now
32
+ },
33
+ // identifier: {
34
+ // $in: [
35
+ // { name: 'sampleOrderIdentifierName1', value: 'sampleOrderIdentifiervalue1' },
36
+ // { name: 'sampleOrderIdentifierName2', value: 'sampleOrderIdentifiervalue2' }
37
+ // ]
38
+ // },
39
+ // customer: {
40
+ // typeOf: client.factory.personType.Person,
41
+ // identifiers: [
42
+ // { name: 'SampleName', value: 'SampleValue' }
43
+ // ],
44
+ // telephone: '1234$'
45
+ // },
46
+ paymentMethods: {
47
+ // typeOfs: [client.factory.paymentMethodType.Account],
48
+ // paymentMethodIds: ['30118000911']
49
+ },
50
+ acceptedOffers: {
51
+ itemOffered: {
52
+ // ids: ['118-181018-000018-0'],
53
+ reservationFor: {
54
+ // ids: ['xdflc2sjncbz279'],
55
+ // name: '',
56
+ // inSessionFrom: moment().add(1, 'days').toDate(),
57
+ // inSessionThrough: moment().add(4, 'days').toDate(),
58
+ // startFrom: moment().toDate(),
59
+ // startThrough: moment().add(3, 'days').toDate(),
60
+ location: {
61
+ // branchCodes: ['90'],
55
62
  },
56
- acceptedOffers: {
57
- itemOffered: {
58
- // ids: ['118-181018-000018-0'],
59
- reservationFor: {
60
- // ids: ['xdflc2sjncbz279'],
61
- // name: '',
62
- // inSessionFrom: moment().add(1, 'days').toDate(),
63
- // inSessionThrough: moment().add(4, 'days').toDate(),
64
- // startFrom: moment().toDate(),
65
- // startThrough: moment().add(3, 'days').toDate(),
66
- location: {
67
- // branchCodes: ['90'],
68
- },
69
- superEvent: {
70
- // ids: ['405gzn58jnbd0wks'],
71
- location: {
72
- // branchCodes: ['002'],
73
- },
74
- workPerformed: {
75
- // identifiers: ['1622100'],
76
- }
77
- }
78
- }
63
+ superEvent: {
64
+ // ids: ['405gzn58jnbd0wks'],
65
+ location: {
66
+ // branchCodes: ['002'],
67
+ },
68
+ workPerformed: {
69
+ // identifiers: ['1622100'],
79
70
  }
80
71
  }
81
- });
82
- console.log(i, totalCount, 'orders found');
83
- console.log(i, data.length, 'orders returned');
84
- } catch (error) {
85
- console.error(error);
72
+ }
86
73
  }
87
- },
88
- // tslint:disable-next-line:no-magic-numbers
89
- 500
90
- );
74
+ }
75
+ });
76
+ console.log(data);
77
+ console.log(totalCount, 'orders found');
78
+ console.log(data.length, 'orders returned');
79
+
80
+ // let i = 0;
81
+ // setInterval(
82
+ // async () => {
83
+ // i += 1;
84
+ // try {
85
+
86
+ // } catch (error) {
87
+ // console.error(error);
88
+ // }
89
+ // },
90
+ // // tslint:disable-next-line:no-magic-numbers
91
+ // 500
92
+ // );
91
93
  }
92
94
 
93
95
  main()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "3.56.0",
3
+ "version": "3.57.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.56.0",
100
+ "@cinerino/api-abstract-client": "3.57.0",
101
101
  "debug": "^3.2.6",
102
102
  "http-status": "^1.4.2",
103
103
  "idtoken-verifier": "^2.0.3",