@cinerino/sdk 3.61.0 → 3.64.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.
@@ -0,0 +1,66 @@
1
+ // tslint:disable:no-console
2
+ /**
3
+ * ユーザー認証
4
+ */
5
+ // tslint:disable-next-line:no-implicit-dependencies
6
+ import * as open from 'open';
7
+ import * as readline from 'readline';
8
+ import * as client from '../../../lib/';
9
+
10
+ export async function login() {
11
+ const auth = new client.auth.OAuth2({
12
+ domain: <string>process.env.TEST_CHILD_AUTHORIZE_SERVER_DOMAIN,
13
+ clientId: <string>process.env.TEST_CHILD_CLIENT_ID,
14
+ clientSecret: <string>process.env.TEST_CHILD_CLIENT_SECRET,
15
+ redirectUri: 'https://localhost/signIn',
16
+ logoutUri: 'https://localhost/signOut'
17
+ });
18
+
19
+ const scopes: string[] = [];
20
+ const state = '12345';
21
+ const codeVerifier = '12345';
22
+
23
+ let authUrl = auth.generateAuthUrl({
24
+ scopes: scopes,
25
+ state: state,
26
+ codeVerifier: codeVerifier
27
+ });
28
+ const signInUrl = new URL(authUrl);
29
+ authUrl = `${signInUrl.href}&identity_provider=`;
30
+
31
+ console.log('authUrl:', authUrl);
32
+ open(authUrl);
33
+
34
+ await new Promise<void>((resolve, reject) => {
35
+ const rl = readline.createInterface({
36
+ input: process.stdin,
37
+ output: process.stdout
38
+ });
39
+
40
+ rl.question('enter authorization code:\n', async (code) => {
41
+ rl.question('enter state:\n', async (givenState) => {
42
+ if (givenState !== state) {
43
+ reject(new Error('state not matched'));
44
+
45
+ return;
46
+ }
47
+
48
+ let credentials = await auth.getToken(code, codeVerifier);
49
+ console.log('credentials published', credentials);
50
+
51
+ auth.setCredentials(credentials);
52
+
53
+ credentials = await auth.refreshAccessToken();
54
+ console.log('credentials refreshed', credentials);
55
+
56
+ // rl.close();
57
+ resolve();
58
+ });
59
+ });
60
+ });
61
+
62
+ const logoutUrl = auth.generateLogoutUrl();
63
+ console.log('logoutUrl:', logoutUrl);
64
+
65
+ return auth;
66
+ }
@@ -66,7 +66,8 @@ async function main() {
66
66
 
67
67
  // 確定
68
68
  await payService.confirm({
69
- transactionNumber: transactionNumber
69
+ transactionNumber: transactionNumber,
70
+ potentialActions: { pay: { purpose: { typeOf: client.factory.order.OrderType.Order } } }
70
71
  });
71
72
  console.log('transaction confirmed');
72
73
  }
@@ -4,9 +4,16 @@ import * as httpStatus from 'http-status';
4
4
 
5
5
  import * as client from '../../../../lib/index';
6
6
  import * as auth from '../../auth/auth';
7
+ import * as authChild from '../../auth/authChild';
7
8
 
8
- // tslint:disable-next-line:max-func-body-length
9
9
  async function main() {
10
+ const childAuthClient = await authChild.login();
11
+ await childAuthClient.refreshAccessToken();
12
+ const childLoginTicket = childAuthClient.verifyIdToken({});
13
+ console.log('username is', childLoginTicket.getUsername());
14
+
15
+ // return;
16
+
10
17
  const authClient = await auth.login();
11
18
  await authClient.refreshAccessToken();
12
19
  const loginTicket = authClient.verifyIdToken({});
package/lib/bundle.js CHANGED
@@ -2886,8 +2886,58 @@ var RoleType;
2886
2886
  })(RoleType = exports.RoleType || (exports.RoleType = {}));
2887
2887
 
2888
2888
  },{}],92:[function(require,module,exports){
2889
- arguments[4][14][0].apply(exports,arguments)
2890
- },{"dup":14}],93:[function(require,module,exports){
2889
+ "use strict";
2890
+ Object.defineProperty(exports, "__esModule", { value: true });
2891
+ /**
2892
+ * ソート条件インターフェース
2893
+ */
2894
+ // export interface ISortOrder {
2895
+ // createdAt?: SortType;
2896
+ // }
2897
+ // export interface ICustomerSearchConditions {
2898
+ // typeOf?: PersonType;
2899
+ // ids?: string[];
2900
+ // identifiers?: PersonFactory.IIdentifier;
2901
+ // /**
2902
+ // * メールアドレス
2903
+ // */
2904
+ // email?: string;
2905
+ // /**
2906
+ // * 電話番号
2907
+ // */
2908
+ // telephone?: string;
2909
+ // memberOf?: {
2910
+ // /**
2911
+ // * 会員番号
2912
+ // */
2913
+ // membershipNumbers?: string[];
2914
+ // };
2915
+ // }
2916
+ // export interface IReferencesOrderSearchConditions {
2917
+ // orderNumbers?: string[];
2918
+ // }
2919
+ /**
2920
+ * インボイス検索条件インターフェース
2921
+ */
2922
+ // export interface ISearchConditions {
2923
+ // limit?: number;
2924
+ // page?: number;
2925
+ // sort?: ISortOrder;
2926
+ // project?: {
2927
+ // id?: { $eq?: string };
2928
+ // };
2929
+ // createdFrom?: Date;
2930
+ // createdThrough?: Date;
2931
+ // accountIds?: string[];
2932
+ // confirmationNumbers?: string[];
2933
+ // customer?: ICustomerSearchConditions;
2934
+ // paymentMethods?: string[];
2935
+ // paymentMethodIds?: string[];
2936
+ // paymentStatuses?: PaymentStatusType[];
2937
+ // referencesOrder?: IReferencesOrderSearchConditions;
2938
+ // }
2939
+
2940
+ },{}],93:[function(require,module,exports){
2891
2941
  "use strict";
2892
2942
  Object.defineProperty(exports, "__esModule", { value: true });
2893
2943
  exports.ItemAvailability = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "3.61.0",
3
+ "version": "3.64.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.61.0",
100
+ "@cinerino/api-abstract-client": "3.64.0",
101
101
  "debug": "^3.2.6",
102
102
  "http-status": "^1.4.2",
103
103
  "idtoken-verifier": "^2.0.3",