@wenex/sdk 1.0.21 → 1.0.22
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/common/interfaces/financial/common/pay.interface.d.ts +1 -1
- package/package.json +1 -1
- package/services/financial/invoices.service.d.ts +4 -2
- package/services/financial/invoices.service.js +3 -0
- package/services/financial/invoices.service.js.map +1 -1
- package/services/financial/transactions.service.d.ts +6 -2
- package/services/financial/transactions.service.js +10 -0
- package/services/financial/transactions.service.js.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PayType } from '../../../enums/financial';
|
|
2
1
|
import { Core, Dto } from '../../../core/interfaces';
|
|
2
|
+
import { PayType } from '../../../enums/financial';
|
|
3
3
|
export interface Pay<Properties extends object = object> extends Core<Properties> {
|
|
4
4
|
type: PayType;
|
|
5
5
|
wallet: string;
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AxiosInstance } from 'axios';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Serializer } from '../../common/core/interfaces';
|
|
3
|
+
import { RequestConfig, RestfulService } from '../../common/core/classes';
|
|
4
|
+
import { Transaction, Invoice, InvoiceDto } from '../../common/interfaces/financial';
|
|
4
5
|
export declare class InvoicesService<Properties extends object = object> extends RestfulService<Invoice<Properties>, InvoiceDto<Properties>> {
|
|
5
6
|
protected axios: AxiosInstance;
|
|
6
7
|
constructor(axios: AxiosInstance);
|
|
8
|
+
payment<Path extends object = object>(id: string, config?: RequestConfig<Invoice<Properties>>): Promise<Serializer<Transaction<Properties>, Path>>;
|
|
7
9
|
static build<Properties extends object = object>(axios: AxiosInstance): InvoicesService<Properties>;
|
|
8
10
|
}
|
|
@@ -7,6 +7,9 @@ class InvoicesService extends classes_1.RestfulService {
|
|
|
7
7
|
super('invoices', axios);
|
|
8
8
|
this.axios = axios;
|
|
9
9
|
}
|
|
10
|
+
async payment(id, config) {
|
|
11
|
+
return (await this.get(this.url(`${id}/payment`), config)).data;
|
|
12
|
+
}
|
|
10
13
|
static build(axios) {
|
|
11
14
|
return new InvoicesService(axios);
|
|
12
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.service.js","sourceRoot":"","sources":["../../src/services/financial/invoices.service.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"invoices.service.js","sourceRoot":"","sources":["../../src/services/financial/invoices.service.ts"],"names":[],"mappings":";;;AAGA,uDAA0E;AAG1E,MAAa,eAAoD,SAAQ,wBAGxE;IACC,YAAsB,KAAoB;QACxC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QADL,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAED,KAAK,CAAC,OAAO,CACX,EAAU,EACV,MAA2C;QAE3C,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAkD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACnH,CAAC;IAED,MAAM,CAAC,KAAK,CAAqC,KAAoB;QACnE,OAAO,IAAI,eAAe,CAAa,KAAK,CAAC,CAAC;IAChD,CAAC;CACF;AAlBD,0CAkBC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { AxiosInstance } from 'axios';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Serializer } from '../../common/core/interfaces';
|
|
3
|
+
import { RequestConfig, RestfulService } from '../../common/core/classes';
|
|
4
|
+
import { Transaction, TransactionDto, TransactionInitDto } from '../../common/interfaces/financial';
|
|
4
5
|
export declare class TransactionsService<Properties extends object = object> extends RestfulService<Transaction<Properties>, TransactionDto<Properties>> {
|
|
5
6
|
protected axios: AxiosInstance;
|
|
6
7
|
constructor(axios: AxiosInstance);
|
|
8
|
+
init(data: TransactionInitDto<Properties>, config?: RequestConfig<Transaction<Properties>>): Promise<Serializer<Transaction<Properties>>>;
|
|
9
|
+
abort<Path extends object = object>(id: string, config?: RequestConfig<Transaction<Properties>>): Promise<Serializer<Transaction<Properties>, Path>>;
|
|
10
|
+
verify<Path extends object = object>(id: string, config?: RequestConfig<Transaction<Properties>>): Promise<Serializer<Transaction<Properties>, Path>>;
|
|
7
11
|
static build<Properties extends object = object>(axios: AxiosInstance): TransactionsService<Properties>;
|
|
8
12
|
}
|
|
@@ -7,6 +7,16 @@ class TransactionsService extends classes_1.RestfulService {
|
|
|
7
7
|
super('transactions', axios);
|
|
8
8
|
this.axios = axios;
|
|
9
9
|
}
|
|
10
|
+
async init(data, config) {
|
|
11
|
+
return (await this.post(this.url(), data, config))
|
|
12
|
+
.data;
|
|
13
|
+
}
|
|
14
|
+
async abort(id, config) {
|
|
15
|
+
return (await this.get(this.url(`${id}/abort`), config)).data;
|
|
16
|
+
}
|
|
17
|
+
async verify(id, config) {
|
|
18
|
+
return (await this.get(this.url(`${id}/verify`), config)).data;
|
|
19
|
+
}
|
|
10
20
|
static build(axios) {
|
|
11
21
|
return new TransactionsService(axios);
|
|
12
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.service.js","sourceRoot":"","sources":["../../src/services/financial/transactions.service.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"transactions.service.js","sourceRoot":"","sources":["../../src/services/financial/transactions.service.ts"],"names":[],"mappings":";;;AAGA,uDAA0E;AAG1E,MAAa,mBAAwD,SAAQ,wBAG5E;IACC,YAAsB,KAAoB;QACxC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QADT,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAED,KAAK,CAAC,IAAI,CACR,IAAoC,EACpC,MAA+C;QAE/C,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAA4E,IAAI,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;aAC1H,IAAI,CAAC;IACV,CAAC;IAED,KAAK,CAAC,KAAK,CACT,EAAU,EACV,MAA+C;QAE/C,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAkD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACjH,CAAC;IAED,KAAK,CAAC,MAAM,CACV,EAAU,EACV,MAA+C;QAE/C,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAkD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAClH,CAAC;IAED,MAAM,CAAC,KAAK,CAAqC,KAAoB;QACnE,OAAO,IAAI,mBAAmB,CAAa,KAAK,CAAC,CAAC;IACpD,CAAC;CACF;AAjCD,kDAiCC"}
|