@yunzhanghu/sdk-nodejs 1.0.10 → 1.0.12

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.
package/.gitlab-ci.yml ADDED
@@ -0,0 +1,7 @@
1
+ include: # include包含模板配置
2
+ - project: "laboratory/gitlab-ci"
3
+ ref: sdk-test
4
+ file: "/sdk-test.gitlab-ci.yml"
5
+
6
+
7
+ image: docker.yunzhanghu.net/base/node18-sdk-unittest:v1.0.1
@@ -77,6 +77,8 @@ invoice
77
77
  bank_name_account: '交通银行北京东大桥支行 12343456654321',
78
78
  goods_services_name: '*测试分类*test测试内容',
79
79
  remark: '',
80
+ receive_emails: ['username1@example.com'],
81
+ invoice_media: '1',
80
82
  })
81
83
  .then((data) => {
82
84
  if (data.code === '0000') {
@@ -146,7 +148,7 @@ invoice
146
148
  console.log(err.toString())
147
149
  })
148
150
 
149
- // 发送发票扫描件压缩包下载链接邮件
151
+ // 发送发票开具成功通知邮件
150
152
  invoice
151
153
  .SendReminderEmail({
152
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yunzhanghu/sdk-nodejs",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "云账户 SDK for Node.js",
5
5
  "main": "yzh/index.js",
6
6
  "scripts": {
@@ -47,4 +47,4 @@
47
47
  "git add"
48
48
  ]
49
49
  }
50
- }
50
+ }
@@ -252,7 +252,7 @@ export class YZHClient {
252
252
  const { data: axiosData } = result;
253
253
  let response = axiosData;
254
254
  // 需解密
255
- if (encryption) {
255
+ if (encryption && response?.data) {
256
256
  response = { ...response, data: this.decrypt(response.data) };
257
257
  }
258
258
  return response;
@@ -60,6 +60,10 @@ interface ApplyInvoiceRequest {
60
60
  goods_services_name: string;
61
61
  /** 发票备注 */
62
62
  remark: string;
63
+ /** 发票接收邮箱 */
64
+ receive_emails: string[];
65
+ /** 发票介质 */
66
+ invoice_media: string;
63
67
  }
64
68
 
65
69
  /** ApplyInvoiceResponse 发票开具申请返回 */
@@ -108,6 +112,10 @@ interface GetInvoiceStatusResponse {
108
112
  post_type: string;
109
113
  /** 快递单号 */
110
114
  waybill_number: string[];
115
+ /** 驳回原因 */
116
+ reject_reason: string;
117
+ /** 发票介质 */
118
+ invoice_media: string;
111
119
  }
112
120
 
113
121
  /** GetInvoiceInformationRequest 查询发票信息请求 */
@@ -142,6 +150,8 @@ interface InformationDataInfo {
142
150
  price_tax_amount: string;
143
151
  /** 开票日期 */
144
152
  invoiced_date: string;
153
+ /** 发票状态 */
154
+ status: string;
145
155
  }
146
156
 
147
157
  /** BankNameAccount 系统支持的开户行及账号 */
@@ -176,7 +186,7 @@ interface GetInvoiceFileResponse {
176
186
  name: string;
177
187
  }
178
188
 
179
- /** SendReminderEmailRequest 发送发票扫描件压缩包下载链接邮件请求 */
189
+ /** SendReminderEmailRequest 发送发票开具成功通知邮件请求 */
180
190
  interface SendReminderEmailRequest {
181
191
  /** 发票申请编号 */
182
192
  invoice_apply_id: string;
@@ -184,7 +194,7 @@ interface SendReminderEmailRequest {
184
194
  application_id: string;
185
195
  }
186
196
 
187
- /** SendReminderEmailResponse 发送发票扫描件压缩包下载链接邮件返回 */
197
+ /** SendReminderEmailResponse 发送发票开具成功通知邮件返回 */
188
198
  interface SendReminderEmailResponse {}
189
199
 
190
200
  export class InvoiceClient extends YZHclient {
@@ -251,7 +261,7 @@ export class InvoiceClient extends YZHclient {
251
261
  return this.request('post', '/api/invoice/v2/invoice/invoice-pdf', req, { encryption: false }, cb);
252
262
  }
253
263
 
254
- // SendReminderEmail 发送发票扫描件压缩包下载链接邮件
264
+ // SendReminderEmail 发送发票开具成功通知邮件
255
265
  async SendReminderEmail(
256
266
  req: SendReminderEmailRequest,
257
267
  cb?: (error: null | string, rep: SendReminderEmailResponse) => void
@@ -302,7 +302,7 @@ class YZHClient {
302
302
  const { data: axiosData } = result;
303
303
  let response = axiosData;
304
304
  // 需解密
305
- if (encryption) {
305
+ if (encryption && (response === null || response === void 0 ? void 0 : response.data)) {
306
306
  response = { ...response, data: this.decrypt(response.data) };
307
307
  }
308
308
  return response;
@@ -59,6 +59,10 @@ interface ApplyInvoiceRequest {
59
59
  goods_services_name: string;
60
60
  /** 发票备注 */
61
61
  remark: string;
62
+ /** 发票接收邮箱 */
63
+ receive_emails: string[];
64
+ /** 发票介质 */
65
+ invoice_media: string;
62
66
  }
63
67
 
64
68
  /** ApplyInvoiceResponse 发票开具申请返回 */
@@ -107,6 +111,10 @@ interface GetInvoiceStatusResponse {
107
111
  post_type: string;
108
112
  /** 快递单号 */
109
113
  waybill_number: string[];
114
+ /** 驳回原因 */
115
+ reject_reason: string;
116
+ /** 发票介质 */
117
+ invoice_media: string;
110
118
  }
111
119
 
112
120
  /** GetInvoiceInformationRequest 查询发票信息请求 */
@@ -141,6 +149,8 @@ interface InformationDataInfo {
141
149
  price_tax_amount: string;
142
150
  /** 开票日期 */
143
151
  invoiced_date: string;
152
+ /** 发票状态 */
153
+ status: string;
144
154
  }
145
155
 
146
156
  /** BankNameAccount 系统支持的开户行及账号 */
@@ -175,7 +185,7 @@ interface GetInvoiceFileResponse {
175
185
  name: string;
176
186
  }
177
187
 
178
- /** SendReminderEmailRequest 发送发票扫描件压缩包下载链接邮件请求 */
188
+ /** SendReminderEmailRequest 发送发票开具成功通知邮件请求 */
179
189
  interface SendReminderEmailRequest {
180
190
  /** 发票申请编号 */
181
191
  invoice_apply_id: string;
@@ -183,7 +193,7 @@ interface SendReminderEmailRequest {
183
193
  application_id: string;
184
194
  }
185
195
 
186
- /** SendReminderEmailResponse 发送发票扫描件压缩包下载链接邮件返回 */
196
+ /** SendReminderEmailResponse 发送发票开具成功通知邮件返回 */
187
197
  interface SendReminderEmailResponse {}
188
198
 
189
199
  export declare class InvoiceClient extends YZHclient {
@@ -31,7 +31,7 @@ class InvoiceClient extends client_1.default {
31
31
  async GetInvoiceFile(req, cb) {
32
32
  return this.request('post', '/api/invoice/v2/invoice/invoice-pdf', req, { encryption: false }, cb);
33
33
  }
34
- // SendReminderEmail 发送发票扫描件压缩包下载链接邮件
34
+ // SendReminderEmail 发送发票开具成功通知邮件
35
35
  async SendReminderEmail(req, cb) {
36
36
  return this.request('post', '/api/invoice/v2/invoice/reminder/email', req, { encryption: false }, cb);
37
37
  }