@atomsolution/invoice-sdk-api 1.28.0 → 1.29.1

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/dist/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
2
2
  import { Configuration } from './configuration';
3
- import { BaseAPI, RequestArgs } from './base';
3
+ import { RequestArgs } from './base';
4
4
  /**
5
5
  *
6
6
  * @export
@@ -1306,127 +1306,6 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
1306
1306
  */
1307
1307
  getInvoiceSerials(params: GetInvoiceSerialsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInvoiceSerialsResponse>>;
1308
1308
  };
1309
- /**
1310
- * DefaultApi - object-oriented interface
1311
- * @export
1312
- * @class DefaultApi
1313
- * @extends {BaseAPI}
1314
- */
1315
- export declare class DefaultApi extends BaseAPI {
1316
- /**
1317
- * Tạo một hóa đơn mới theo định dạng dựa trên thông tin được cung cấp.
1318
- * @summary Create invoice
1319
- * @param {CreateInvoiceRequest} createInvoiceRequest
1320
- * @param {*} [options] Override http request option.
1321
- * @throws {RequiredError}
1322
- * @memberof DefaultApi
1323
- */
1324
- createInvoice(createInvoiceRequest: CreateInvoiceRequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<CreateInvoiceSuccess, any>>;
1325
- /**
1326
- * Lấy thông tin chi tiết của một hóa đơn dựa trên ID hóa đơn.
1327
- * @summary API lấy thông tin hóa đơn
1328
- * @param {string} id id hóa đơn.
1329
- * @param {string} stax mã số thuế bên bán
1330
- * @param {*} [options] Override http request option.
1331
- * @throws {RequiredError}
1332
- * @memberof DefaultApi
1333
- */
1334
- getInvoice(params: GetInvoiceRequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<GetInvoiceResponse, any>>;
1335
- /**
1336
- * Lấy danh sách tất cả hóa đơn dựa trên bộ lọc được cung cấp.
1337
- * @summary API lấy danh sách hóa đơn
1338
- * @param {string} fromDate Ngày bắt đầu lọc hóa đơn (định dạng yyyy-MM-dd)
1339
- * @param {string} toDate Ngày kết thúc lọc hóa đơn (định dạng yyyy-MM-dd)
1340
- * @param {string} stax mã số thuế bên bán
1341
- * @param {number} [start] Vị trí bắt đầu của danh sách hóa đơn (phân trang)
1342
- * @param {number} [count] Số lượng hóa đơn cần lấy (phân trang)
1343
- * @param {string} [serial] Ký hiệu hóa đơn để lọc
1344
- * @param {*} [options] Override http request option.
1345
- * @throws {RequiredError}
1346
- * @memberof DefaultApi
1347
- */
1348
- getInvoices(params: GetInvoicesRequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<GetInvoicesSuccess, any>>;
1349
- /**
1350
- * Ký hợp đồng điện tử với thông tin hợp đồng được cung cấp.
1351
- * @summary API ký hóa đơn
1352
- * @param {SignContractRequest} signContractRequest
1353
- * @param {*} [options] Override http request option.
1354
- * @throws {RequiredError}
1355
- * @memberof DefaultApi
1356
- */
1357
- signContract(signContractRequest: SignContractRequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<SignContractResponse, any>>;
1358
- /**
1359
- * Đăng nhập vào hệ thống với thông tin tài khoản người dùng.
1360
- * @summary API đăng nhập
1361
- * @param {SignInRequest} signInRequest
1362
- * @param {*} [options] Override http request option.
1363
- * @throws {RequiredError}
1364
- * @memberof DefaultApi
1365
- */
1366
- signIn(signInRequest: SignInRequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<SignInResponse, any>>;
1367
- /**
1368
- * Lấy thông tin hóa đơn dưới định dạng sẵn sàng để in.
1369
- * @summary API xem in hóa đơn
1370
- * @param {string} id id hóa đơn.
1371
- * @param {string} stax mã số thuế bên bán
1372
- * @param {*} [options] Override http request option.
1373
- * @throws {RequiredError}
1374
- * @memberof DefaultApi
1375
- */
1376
- viewPrintInvoice(id: string, stax?: string, template_code?: string, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<ViewPrintInvoiceResponse, any>>;
1377
- /**
1378
- * Lấy thông tin chi tiết của một mã số thuế (MST) dựa trên mã số thuế được cung cấp.
1379
- * @summary API lấy thông tin mã số thuế
1380
- * @param {string} tax Mã số thuế cần tra cứu
1381
- * @param {*} [options] Override http request option.
1382
- * @throws {RequiredError}
1383
- * @memberof DefaultApi
1384
- */
1385
- taxInfo(tax: string, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<TaxInfoResponse, any>>;
1386
- /**
1387
- * Single Sign-On login for merchants using provider and tax code.
1388
- * @summary API merchant SSO login
1389
- * @param {SignInSSORequest} signInSSORequest
1390
- * @param {*} [options] Override http request option.
1391
- * @throws {RequiredError}
1392
- * @memberof DefaultApi
1393
- */
1394
- signInSSO(signInSSORequest: SignInSSORequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<SignInSSOResponse, any>>;
1395
- /**
1396
- * Single Sign-On logout for merchants using provider and tax code.
1397
- * @summary API merchant SSO logout
1398
- * @param {*} [options] Override http request option.
1399
- * @throws {RequiredError}
1400
- * @memberof DefaultApi
1401
- */
1402
- signOutSSO(options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<SignOutSSOResponse, any>>;
1403
- /**
1404
- * Check authentication status for merchants using provider and tax code.
1405
- * @summary API check auth
1406
- * @param {*} [options] Override http request option.
1407
- * @throws {RequiredError}
1408
- * @memberof DefaultApi
1409
- */
1410
- checkAuth(options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<CheckAuthResponse, any>>;
1411
- /**
1412
- * Check customer declaration status with filtering options.
1413
- * @summary API check customer declaration status
1414
- * @param {CheckCustomerDeclarationStatusRequest} params
1415
- * @param {*} [options] Override http request option.
1416
- * @throws {RequiredError}
1417
- * @memberof DefaultApi
1418
- */
1419
- checkCustomerDeclarationStatus(params: CheckCustomerDeclarationStatusRequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<CheckCustomerDeclarationStatusResponse, any>>;
1420
- /**
1421
- * Check authentication status for merchants using provider and tax code.
1422
- * @summary API check auth
1423
- * @param {number} [invType]
1424
- * @param {*} [options] Override http request option.
1425
- * @throws {RequiredError}
1426
- * @memberof DefaultApi
1427
- */
1428
- getInvoiceSerials(params: GetInvoiceSerialsRequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<GetInvoiceSerialsResponse, any>>;
1429
- }
1430
1309
  /**
1431
1310
  * Unified API functions distinguished by provider in configuration
1432
1311
  * @export
package/dist/base.d.ts CHANGED
@@ -1,15 +1,4 @@
1
- import { Configuration } from './configuration';
2
- import { AxiosInstance, RawAxiosRequestConfig } from 'axios';
3
- /**
4
- *
5
- * @export
6
- */
7
- export declare const COLLECTION_FORMATS: {
8
- csv: string;
9
- ssv: string;
10
- tsv: string;
11
- pipes: string;
12
- };
1
+ import { RawAxiosRequestConfig } from 'axios';
13
2
  /**
14
3
  *
15
4
  * @export
@@ -19,17 +8,6 @@ export interface RequestArgs {
19
8
  url: string;
20
9
  options: RawAxiosRequestConfig;
21
10
  }
22
- /**
23
- *
24
- * @export
25
- * @class BaseAPI
26
- */
27
- export declare class BaseAPI {
28
- protected basePath: string;
29
- protected axios: AxiosInstance;
30
- protected configuration: Configuration | undefined;
31
- constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
32
- }
33
11
  /**
34
12
  *
35
13
  * @export
package/dist/index.esm.js CHANGED
@@ -136,10 +136,11 @@ function getListProviders(mode, bank) {
136
136
  const widget = yield loadSettingsFromCDN();
137
137
  const bankSettings = widget.getSettings(mode, bank);
138
138
  const providers = PROVIDERS.map((provider) => {
139
- const { invoiceLookupUrl, sso } = bankSettings[provider.route];
139
+ const { invoiceLookupUrl, sso, features } = bankSettings[provider.route];
140
140
  return __spreadProps(__spreadValues({}, provider), {
141
141
  invoiceLookupUrl,
142
- isActiveSSO: sso
142
+ isActiveSSO: sso,
143
+ features
143
144
  });
144
145
  });
145
146
  return providers.filter((provider) => bankSettings[provider.route].isActive);
@@ -193,19 +194,6 @@ function clearProvider(provider, merchantId) {
193
194
  function clearAllProviders(merchantId) {
194
195
  localStorage.removeItem("".concat(STORAGE_KEY, "_").concat(merchantId));
195
196
  }
196
- class BaseAPI {
197
- constructor(configuration, basePath = "", axios = globalAxios) {
198
- this.basePath = basePath;
199
- this.axios = axios;
200
- if (configuration) {
201
- this.configuration = configuration;
202
- this.basePath = configuration.basePath ? "".concat(configuration.basePath.replace(
203
- /\/+$/,
204
- ""
205
- ), "/").concat(configuration.provider.replace(/^\/+|\/+$/g, "")) : "".concat(basePath, "/").concat(configuration.provider.replace(/^\/+|\/+$/g, ""));
206
- }
207
- }
208
- }
209
197
  class RequiredError extends Error {
210
198
  constructor(field, msg) {
211
199
  super(msg);
@@ -1102,145 +1090,6 @@ const DefaultApiFp = function(configuration) {
1102
1090
  }
1103
1091
  };
1104
1092
  };
1105
- class DefaultApi extends BaseAPI {
1106
- /**
1107
- * Tạo một hóa đơn mới theo định dạng dựa trên thông tin được cung cấp.
1108
- * @summary Create invoice
1109
- * @param {CreateInvoiceRequest} createInvoiceRequest
1110
- * @param {*} [options] Override http request option.
1111
- * @throws {RequiredError}
1112
- * @memberof DefaultApi
1113
- */
1114
- createInvoice(createInvoiceRequest, options) {
1115
- return DefaultApiFp(this.configuration).createInvoice(createInvoiceRequest, options).then((request) => request(this.axios, this.basePath));
1116
- }
1117
- /**
1118
- * Lấy thông tin chi tiết của một hóa đơn dựa trên ID hóa đơn.
1119
- * @summary API lấy thông tin hóa đơn
1120
- * @param {string} id id hóa đơn.
1121
- * @param {string} stax mã số thuế bên bán
1122
- * @param {*} [options] Override http request option.
1123
- * @throws {RequiredError}
1124
- * @memberof DefaultApi
1125
- */
1126
- getInvoice(params, options) {
1127
- return DefaultApiFp(this.configuration).getInvoice(params, options).then((request) => request(this.axios, this.basePath));
1128
- }
1129
- /**
1130
- * Lấy danh sách tất cả hóa đơn dựa trên bộ lọc được cung cấp.
1131
- * @summary API lấy danh sách hóa đơn
1132
- * @param {string} fromDate Ngày bắt đầu lọc hóa đơn (định dạng yyyy-MM-dd)
1133
- * @param {string} toDate Ngày kết thúc lọc hóa đơn (định dạng yyyy-MM-dd)
1134
- * @param {string} stax mã số thuế bên bán
1135
- * @param {number} [start] Vị trí bắt đầu của danh sách hóa đơn (phân trang)
1136
- * @param {number} [count] Số lượng hóa đơn cần lấy (phân trang)
1137
- * @param {string} [serial] Ký hiệu hóa đơn để lọc
1138
- * @param {*} [options] Override http request option.
1139
- * @throws {RequiredError}
1140
- * @memberof DefaultApi
1141
- */
1142
- getInvoices(params, options) {
1143
- return DefaultApiFp(this.configuration).getInvoices(params, options).then((request) => request(this.axios, this.basePath));
1144
- }
1145
- /**
1146
- * Ký hợp đồng điện tử với thông tin hợp đồng được cung cấp.
1147
- * @summary API ký hóa đơn
1148
- * @param {SignContractRequest} signContractRequest
1149
- * @param {*} [options] Override http request option.
1150
- * @throws {RequiredError}
1151
- * @memberof DefaultApi
1152
- */
1153
- signContract(signContractRequest, options) {
1154
- return DefaultApiFp(this.configuration).signContract(signContractRequest, options).then((request) => request(this.axios, this.basePath));
1155
- }
1156
- /**
1157
- * Đăng nhập vào hệ thống với thông tin tài khoản người dùng.
1158
- * @summary API đăng nhập
1159
- * @param {SignInRequest} signInRequest
1160
- * @param {*} [options] Override http request option.
1161
- * @throws {RequiredError}
1162
- * @memberof DefaultApi
1163
- */
1164
- signIn(signInRequest, options) {
1165
- return DefaultApiFp(this.configuration).signIn(signInRequest, options).then((request) => request(this.axios, this.basePath));
1166
- }
1167
- /**
1168
- * Lấy thông tin hóa đơn dưới định dạng sẵn sàng để in.
1169
- * @summary API xem in hóa đơn
1170
- * @param {string} id id hóa đơn.
1171
- * @param {string} stax mã số thuế bên bán
1172
- * @param {*} [options] Override http request option.
1173
- * @throws {RequiredError}
1174
- * @memberof DefaultApi
1175
- */
1176
- viewPrintInvoice(id, stax, template_code, options) {
1177
- return DefaultApiFp(this.configuration).viewPrintInvoice(id, stax, template_code, options).then((request) => request(this.axios, this.basePath));
1178
- }
1179
- /**
1180
- * Lấy thông tin chi tiết của một mã số thuế (MST) dựa trên mã số thuế được cung cấp.
1181
- * @summary API lấy thông tin mã số thuế
1182
- * @param {string} tax Mã số thuế cần tra cứu
1183
- * @param {*} [options] Override http request option.
1184
- * @throws {RequiredError}
1185
- * @memberof DefaultApi
1186
- */
1187
- taxInfo(tax, options) {
1188
- return DefaultApiFp(this.configuration).taxInfo(tax, options).then((request) => request(this.axios, this.basePath));
1189
- }
1190
- /**
1191
- * Single Sign-On login for merchants using provider and tax code.
1192
- * @summary API merchant SSO login
1193
- * @param {SignInSSORequest} signInSSORequest
1194
- * @param {*} [options] Override http request option.
1195
- * @throws {RequiredError}
1196
- * @memberof DefaultApi
1197
- */
1198
- signInSSO(signInSSORequest, options) {
1199
- return DefaultApiFp(this.configuration).signInSSO(signInSSORequest, options).then((request) => request(this.axios, this.basePath));
1200
- }
1201
- /**
1202
- * Single Sign-On logout for merchants using provider and tax code.
1203
- * @summary API merchant SSO logout
1204
- * @param {*} [options] Override http request option.
1205
- * @throws {RequiredError}
1206
- * @memberof DefaultApi
1207
- */
1208
- signOutSSO(options) {
1209
- return DefaultApiFp(this.configuration).signOutSSO(options).then((request) => request(this.axios, this.basePath));
1210
- }
1211
- /**
1212
- * Check authentication status for merchants using provider and tax code.
1213
- * @summary API check auth
1214
- * @param {*} [options] Override http request option.
1215
- * @throws {RequiredError}
1216
- * @memberof DefaultApi
1217
- */
1218
- checkAuth(options) {
1219
- return DefaultApiFp(this.configuration).checkAuth(options).then((request) => request(this.axios, this.basePath));
1220
- }
1221
- /**
1222
- * Check customer declaration status with filtering options.
1223
- * @summary API check customer declaration status
1224
- * @param {CheckCustomerDeclarationStatusRequest} params
1225
- * @param {*} [options] Override http request option.
1226
- * @throws {RequiredError}
1227
- * @memberof DefaultApi
1228
- */
1229
- checkCustomerDeclarationStatus(params, options) {
1230
- return DefaultApiFp(this.configuration).checkCustomerDeclarationStatus(params, options).then((request) => request(this.axios, this.basePath));
1231
- }
1232
- /**
1233
- * Check authentication status for merchants using provider and tax code.
1234
- * @summary API check auth
1235
- * @param {number} [invType]
1236
- * @param {*} [options] Override http request option.
1237
- * @throws {RequiredError}
1238
- * @memberof DefaultApi
1239
- */
1240
- getInvoiceSerials(params, options) {
1241
- return DefaultApiFp(this.configuration).getInvoiceSerials(params, options).then((request) => request(this.axios, this.basePath));
1242
- }
1243
- }
1244
1093
  const InvoiceApi = function(configuration, basePath, axios) {
1245
1094
  const localVarFp = DefaultApiFp(configuration);
1246
1095
  return {
@@ -1325,7 +1174,6 @@ const InvoiceApi = function(configuration, basePath, axios) {
1325
1174
  };
1326
1175
  export {
1327
1176
  Configuration,
1328
- DefaultApi,
1329
1177
  DefaultApiAxiosParamCreator,
1330
1178
  DefaultApiFp,
1331
1179
  InvoiceApi,