@yunzhanghu/sdk-nodejs 1.0.17 → 1.0.18

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.
@@ -19,6 +19,7 @@ h5usersign
19
19
  real_name: '张三',
20
20
  id_card: '11010519491231002X',
21
21
  certificate_type: 0,
22
+ collect_phone_no: 0,
22
23
  })
23
24
  .then((data) => {
24
25
  if (data.code === '0000') {
@@ -0,0 +1,66 @@
1
+ const yzhAPI = require('../yzh/index.js')
2
+ const config = require('./conf/config.js')
3
+
4
+ // 用户信息收集
5
+ config.base_url="https://api-user.yunzhanghu.com"
6
+ const userCollect = new yzhAPI.UserCollectServiceClient(config)
7
+
8
+ // 查询手机号码绑定状态
9
+ userCollect
10
+ .GetUserCollectPhoneStatus({
11
+
12
+ /**
13
+ * @param {string} request-id:请求 ID,请求的唯一标识
14
+ * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
15
+ * 如未自定义 request-id,将使用 SDK 中的 UUID 方法自动生成。注意:UUID 方法生成的 request-id 不能保证全局唯一,推荐自定义 request-id
16
+ */
17
+ request_id: 'requestIdExample123456789',
18
+ dealer_id: config.dealer_id,
19
+ broker_id: config.broker_id,
20
+ dealer_user_id: 'userId1234567890',
21
+ real_name: '张三',
22
+ id_card: '11010519491231002X',
23
+ certificate_type: 0,
24
+ })
25
+ .then((data) => {
26
+ if (data.code === '0000') {
27
+ // 操作成功
28
+ console.log('操作成功 ', data.data)
29
+ } else {
30
+ // 失败返回
31
+ console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
32
+ }
33
+ })
34
+ .catch((err) => {
35
+ // 发生异常
36
+ console.log(err.toString())
37
+ })
38
+
39
+ // 获取收集手机号码页面
40
+ userCollect
41
+ .GetUserCollectPhoneUrl({
42
+
43
+ /**
44
+ * @param {string} request-id:请求 ID,请求的唯一标识
45
+ * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
46
+ * 如未自定义 request-id,将使用 SDK 中的 UUID 方法自动生成。注意:UUID 方法生成的 request-id 不能保证全局唯一,推荐自定义 request-id
47
+ */
48
+ request_id: 'requestIdExample123456789',
49
+ token: 'testToken',
50
+ color: '',
51
+ url : 'https://www.example.com',
52
+ redirect_url: '',
53
+ })
54
+ .then((data) => {
55
+ if (data.code === '0000') {
56
+ // 操作成功
57
+ console.log('操作成功 ', data.data)
58
+ } else {
59
+ // 失败返回
60
+ console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
61
+ }
62
+ })
63
+ .catch((err) => {
64
+ // 发生异常
65
+ console.log(err.toString())
66
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yunzhanghu/sdk-nodejs",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "云账户 SDK for Node.js",
5
5
  "main": "yzh/index.js",
6
6
  "scripts": {
@@ -12,6 +12,8 @@ interface H5UserPresignRequest {
12
12
  id_card: string;
13
13
  /** 证件类型 0:身份证 2:港澳居民来往内地通行证 3:护照 5:台湾居民来往大陆通行证 9:港澳居民居住证 10:台湾居民居住证 11:外国人永久居留身份证 12:外国人工作许可证 */
14
14
  certificate_type: number;
15
+ /** 是否收集手机号码 0:不收集(默认) 1:收集手机号码 */
16
+ collect_phone_no: number;
15
17
  }
16
18
 
17
19
  /** H5UserPresignResponse 预申请签约返回 */
@@ -12,3 +12,4 @@ export { InvoiceClient } from './invoice';
12
12
  export { PaymentClient } from './payment';
13
13
  export { TaxClient } from './tax';
14
14
  export { UploadUserSignServiceClient } from './uploadusersign';
15
+ export { UserCollectServiceClient } from './usercollect';
@@ -0,0 +1,76 @@
1
+ import YZHclient from '../../common/client';
2
+
3
+ /** GetUserCollectPhoneStatusRequest 查询手机号码绑定状态请求 */
4
+ interface GetUserCollectPhoneStatusRequest {
5
+ /** 平台企业 ID */
6
+ dealer_id: string;
7
+ /** 综合服务主体 ID */
8
+ broker_id: string;
9
+ /** 平台企业用户 ID */
10
+ dealer_user_id: string;
11
+ /** 姓名 */
12
+ real_name: string;
13
+ /** 证件号码 */
14
+ id_card: string;
15
+ /** 证件类型编码 */
16
+ certificate_type: number;
17
+ }
18
+
19
+ /** GetUserCollectPhoneStatusResponse 查询手机号码绑定状态返回 */
20
+ interface GetUserCollectPhoneStatusResponse {
21
+ /** 手机号码收集 Token */
22
+ token: string;
23
+ /** 绑定状态 */
24
+ status: number;
25
+ }
26
+
27
+ /** GetUserCollectPhoneUrlRequest 获取收集手机号码页面请求 */
28
+ interface GetUserCollectPhoneUrlRequest {
29
+ /** 手机号码收集 Token */
30
+ token: string;
31
+ /** 主题颜色 */
32
+ color: string;
33
+ /** 回调地址 */
34
+ url: string;
35
+ /** 跳转 URL */
36
+ redirect_url: string;
37
+ }
38
+
39
+ /** GetUserCollectPhoneUrlResponse 获取收集手机号码页面返回 */
40
+ interface GetUserCollectPhoneUrlResponse {
41
+ /** 收集手机号码页面 URL */
42
+ url: string;
43
+ }
44
+
45
+ export class UserCollectServiceClient extends YZHclient {
46
+ // eslint-disable-next-line no-useless-constructor
47
+ constructor(conf: {
48
+ dealer_id: string;
49
+ broker_id: string;
50
+ app_key: string;
51
+ des3_key: string;
52
+ private_key: string;
53
+ yzh_public_key: string;
54
+ sign_type: 'rsa' | 'sha256';
55
+ base_url?: string;
56
+ timeout?: number;
57
+ }) {
58
+ super(conf);
59
+ }
60
+
61
+ // GetUserCollectPhoneStatus 查询手机号码绑定状态
62
+ async GetUserCollectPhoneStatus(
63
+ req: GetUserCollectPhoneStatusRequest,
64
+ cb?: (error: null | string, rep: GetUserCollectPhoneStatusResponse) => void
65
+ ): Promise<GetUserCollectPhoneStatusResponse> {
66
+ return this.request('get', '/api/user/v1/collect/phone/status', req, { encryption: false }, cb);
67
+ }
68
+
69
+ // GetUserCollectPhoneUrl 获取收集手机号码页面
70
+ async GetUserCollectPhoneUrl(
71
+ req: GetUserCollectPhoneUrlRequest,
72
+ cb?: (error: null | string, rep: GetUserCollectPhoneUrlResponse) => void
73
+ ): Promise<GetUserCollectPhoneUrlResponse> {
74
+ return this.request('get', '/api/user/v1/collect/phone/url', req, { encryption: false }, cb);
75
+ }
76
+ }
@@ -11,6 +11,8 @@ interface H5UserPresignRequest {
11
11
  id_card: string;
12
12
  /** 证件类型 0:身份证 2:港澳居民来往内地通行证 3:护照 5:台湾居民来往大陆通行证 9:港澳居民居住证 10:台湾居民居住证 11:外国人永久居留身份证 12:外国人工作许可证 */
13
13
  certificate_type: number;
14
+ /** 是否收集手机号码 0:不收集(默认) 1:收集手机号码 */
15
+ collect_phone_no: number;
14
16
  }
15
17
 
16
18
  /** H5UserPresignResponse 预申请签约返回 */
@@ -12,3 +12,4 @@ export { InvoiceClient } from './invoice';
12
12
  export { PaymentClient } from './payment';
13
13
  export { TaxClient } from './tax';
14
14
  export { UploadUserSignServiceClient } from './uploadusersign';
15
+ export { UserCollectServiceClient } from './usercollect';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UploadUserSignServiceClient = exports.TaxClient = exports.PaymentClient = exports.InvoiceClient = exports.H5UserSignServiceClient = exports.DataServiceClient = exports.CustomClient = exports.BizlicXjjH5APIServiceClient = exports.BizlicXjjH5ServiceClient = exports.BizlicGxV2H5APIServiceClient = exports.BizlicGxV2H5ServiceClient = exports.AuthenticationClient = exports.ApiUserSignServiceClient = exports.Util = void 0;
3
+ exports.UserCollectServiceClient = exports.UploadUserSignServiceClient = exports.TaxClient = exports.PaymentClient = exports.InvoiceClient = exports.H5UserSignServiceClient = exports.DataServiceClient = exports.CustomClient = exports.BizlicXjjH5APIServiceClient = exports.BizlicXjjH5ServiceClient = exports.BizlicGxV2H5APIServiceClient = exports.BizlicGxV2H5ServiceClient = exports.AuthenticationClient = exports.ApiUserSignServiceClient = exports.Util = void 0;
4
4
  var utils_1 = require("../common/utils");
5
5
  Object.defineProperty(exports, "Util", { enumerable: true, get: function () { return utils_1.Util; } });
6
6
  var apiusersign_1 = require("./apiusersign");
@@ -29,3 +29,5 @@ var tax_1 = require("./tax");
29
29
  Object.defineProperty(exports, "TaxClient", { enumerable: true, get: function () { return tax_1.TaxClient; } });
30
30
  var uploadusersign_1 = require("./uploadusersign");
31
31
  Object.defineProperty(exports, "UploadUserSignServiceClient", { enumerable: true, get: function () { return uploadusersign_1.UploadUserSignServiceClient; } });
32
+ var usercollect_1 = require("./usercollect");
33
+ Object.defineProperty(exports, "UserCollectServiceClient", { enumerable: true, get: function () { return usercollect_1.UserCollectServiceClient; } });
@@ -0,0 +1,66 @@
1
+ import YZHclient from '../../common/client';
2
+ /** GetUserCollectPhoneStatusRequest 查询手机号码绑定状态请求 */
3
+ interface GetUserCollectPhoneStatusRequest {
4
+ /** 平台企业 ID */
5
+ dealer_id: string;
6
+ /** 综合服务主体 ID */
7
+ broker_id: string;
8
+ /** 平台企业用户 ID */
9
+ dealer_user_id: string;
10
+ /** 姓名 */
11
+ real_name: string;
12
+ /** 证件号码 */
13
+ id_card: string;
14
+ /** 证件类型编码 */
15
+ certificate_type: number;
16
+ }
17
+
18
+ /** GetUserCollectPhoneStatusResponse 查询手机号码绑定状态返回 */
19
+ interface GetUserCollectPhoneStatusResponse {
20
+ /** 手机号码收集 Token */
21
+ token: string;
22
+ /** 绑定状态 */
23
+ status: number;
24
+ }
25
+
26
+ /** GetUserCollectPhoneUrlRequest 获取收集手机号码页面请求 */
27
+ interface GetUserCollectPhoneUrlRequest {
28
+ /** 手机号码收集 Token */
29
+ token: string;
30
+ /** 主题颜色 */
31
+ color: string;
32
+ /** 回调地址 */
33
+ url: string;
34
+ /** 跳转 URL */
35
+ redirect_url: string;
36
+ }
37
+
38
+ /** GetUserCollectPhoneUrlResponse 获取收集手机号码页面返回 */
39
+ interface GetUserCollectPhoneUrlResponse {
40
+ /** 收集手机号码页面 URL */
41
+ url: string;
42
+ }
43
+
44
+ export declare class UserCollectServiceClient extends YZHclient {
45
+ constructor(conf: {
46
+ dealer_id: string;
47
+ broker_id: string;
48
+ app_key: string;
49
+ des3_key: string;
50
+ private_key: string;
51
+ yzh_public_key: string;
52
+ sign_type: 'rsa' | 'sha256';
53
+ base_url?: string;
54
+ timeout?: number;
55
+ });
56
+ GetUserCollectPhoneStatus(
57
+ req: GetUserCollectPhoneStatusRequest,
58
+ cb?: (error: null | string, rep: GetUserCollectPhoneStatusResponse) => void
59
+ ): Promise<GetUserCollectPhoneStatusResponse>;
60
+ GetUserCollectPhoneUrl(
61
+ req: GetUserCollectPhoneUrlRequest,
62
+ cb?: (error: null | string, rep: GetUserCollectPhoneUrlResponse) => void
63
+ ): Promise<GetUserCollectPhoneUrlResponse>;
64
+ }
65
+
66
+ export {};
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.UserCollectServiceClient = void 0;
4
+ const client_1 = require('../../common/client');
5
+ class UserCollectServiceClient extends client_1.default {
6
+ // eslint-disable-next-line no-useless-constructor
7
+ constructor(conf) {
8
+ super(conf);
9
+ }
10
+ // GetUserCollectPhoneStatus 查询手机号码绑定状态
11
+ async GetUserCollectPhoneStatus(req, cb) {
12
+ return this.request('get', '/api/user/v1/collect/phone/status', req, { encryption: false }, cb);
13
+ }
14
+ // GetUserCollectPhoneUrl 获取收集手机号码页面
15
+ async GetUserCollectPhoneUrl(req, cb) {
16
+ return this.request('get', '/api/user/v1/collect/phone/url', req, { encryption: false }, cb);
17
+ }
18
+ }
19
+ exports.UserCollectServiceClient = UserCollectServiceClient;