@wenex/sdk 1.1.43 → 1.1.45
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/core/classes/restful.service.d.ts +16 -11
- package/common/core/classes/restful.service.js +50 -10
- package/common/core/classes/restful.service.js.map +1 -1
- package/common/core/interfaces/meta.interface.d.ts +1 -1
- package/common/core/utils/index.d.ts +1 -0
- package/common/core/utils/index.js +1 -0
- package/common/core/utils/index.js.map +1 -1
- package/common/core/utils/type.util.d.ts +1 -0
- package/common/core/utils/type.util.js +6 -0
- package/common/core/utils/type.util.js.map +1 -0
- package/common/interfaces/financial/invoices/invoice.interface.d.ts +3 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
|
3
3
|
import { Collection } from '../collection';
|
|
4
4
|
import { RequestService } from '../providers';
|
|
5
5
|
import { Filter, FilterOne, Pagination, Query } from '../interfaces/mongo';
|
|
6
|
-
import { Dto, Core, Items, Serializer, Optional, Metadata } from '../interfaces';
|
|
6
|
+
import { Dto, Core, Data, Items, Serializer, Total, Optional, Metadata } from '../interfaces';
|
|
7
7
|
export type RequestConfig<T extends object = Core> = Omit<AxiosRequestConfig, 'params' | 'headers'> & {
|
|
8
8
|
params?: Optional<Filter<T>> & {
|
|
9
9
|
zone?: string;
|
|
@@ -18,21 +18,26 @@ export type RequestConfig<T extends object = Core> = Omit<AxiosRequestConfig, 'p
|
|
|
18
18
|
} & {
|
|
19
19
|
[x: string]: any;
|
|
20
20
|
};
|
|
21
|
+
} & {
|
|
22
|
+
fullResponse?: boolean;
|
|
21
23
|
};
|
|
24
|
+
export type ResponseType<T extends object = Core, D = any, C extends RequestConfig<T> | undefined = RequestConfig<T>> = C extends {
|
|
25
|
+
fullResponse: true;
|
|
26
|
+
} ? T : D;
|
|
22
27
|
export declare class RestfulService<T extends Core, D extends Dto<Core>> extends RequestService {
|
|
23
28
|
protected readonly path: Collection;
|
|
24
29
|
protected readonly axios: AxiosInstance;
|
|
25
30
|
protected readonly url: (path?: string) => string;
|
|
26
31
|
constructor(path: Collection, axios: AxiosInstance);
|
|
27
|
-
count(query: Query<T>, config?:
|
|
28
|
-
create(data: D, config?:
|
|
29
|
-
createBulk(data: Items<D>, config?:
|
|
32
|
+
count<C extends RequestConfig<T> = RequestConfig<T>>(query: Query<T>, config?: C): Promise<ResponseType<Total, number, C>>;
|
|
33
|
+
create<C extends RequestConfig<T> = RequestConfig<T>>(data: D, config?: C): Promise<ResponseType<Data<Serializer<T>>, Serializer<T>, C>>;
|
|
34
|
+
createBulk<C extends RequestConfig<T> = RequestConfig<T>>(data: Items<D>, config?: C): Promise<ResponseType<Items<Serializer<T>>, Serializer<T>[], C>>;
|
|
30
35
|
cursor(filter: FilterOne<T>, options: FetchEventSourceInit, config?: RequestConfig<T>): Promise<void>;
|
|
31
|
-
find<Path extends object = object>(filter: Filter<T>, config?:
|
|
32
|
-
findById<Path extends object = object>(id: string, config?:
|
|
33
|
-
deleteById<Path extends object = object>(id: string, config?:
|
|
34
|
-
restoreById<Path extends object = object>(id: string, config?:
|
|
35
|
-
destroyById<Path extends object = object>(id: string, config?:
|
|
36
|
-
updateBulk(data: Optional<D>, query: Query<T>, config?:
|
|
37
|
-
updateById<Path extends object = object>(id: string, data: Optional<D>, config?:
|
|
36
|
+
find<Path extends object = object, C extends RequestConfig<T> = RequestConfig<T>>(filter: Filter<T>, config?: C): Promise<ResponseType<Items<Serializer<T, Path>>, Serializer<T, Path>[], C>>;
|
|
37
|
+
findById<Path extends object = object, C extends RequestConfig<T> = RequestConfig<T>>(id: string, config?: C): Promise<ResponseType<Data<Serializer<T, Path>>, Serializer<T, Path>, C>>;
|
|
38
|
+
deleteById<Path extends object = object, C extends RequestConfig<T> = RequestConfig<T>>(id: string, config?: C): Promise<ResponseType<Data<Serializer<T, Path>>, Serializer<T, Path>, C>>;
|
|
39
|
+
restoreById<Path extends object = object, C extends RequestConfig<T> = RequestConfig<T>>(id: string, config?: C): Promise<ResponseType<Data<Serializer<T, Path>>, Serializer<T, Path>, C>>;
|
|
40
|
+
destroyById<Path extends object = object, C extends RequestConfig<T> = RequestConfig<T>>(id: string, config?: C): Promise<ResponseType<Data<Serializer<T, Path>>, Serializer<T, Path>, C>>;
|
|
41
|
+
updateBulk<C extends RequestConfig<T> = RequestConfig<T>>(data: Optional<D>, query: Query<T>, config?: C): Promise<ResponseType<Total, number, C>>;
|
|
42
|
+
updateById<Path extends object = object, C extends RequestConfig<T> = RequestConfig<T>>(id: string, data: Optional<D>, config?: C): Promise<ResponseType<Data<Serializer<T, Path>>, Serializer<T, Path>, C>>;
|
|
38
43
|
}
|
|
@@ -16,13 +16,25 @@ class RestfulService extends providers_1.RequestService {
|
|
|
16
16
|
}
|
|
17
17
|
async count(query, config) {
|
|
18
18
|
const params = Object.assign({ ...query }, { ...config?.params });
|
|
19
|
-
|
|
19
|
+
if (!config?.fullResponse) {
|
|
20
|
+
return (await this.get(this.url('count'), { ...config, params })).total;
|
|
21
|
+
}
|
|
22
|
+
else
|
|
23
|
+
return (await this.get(this.url('count'), { ...config, params }));
|
|
20
24
|
}
|
|
21
25
|
async create(data, config) {
|
|
22
|
-
|
|
26
|
+
if (!config?.fullResponse) {
|
|
27
|
+
return (await this.post(this.url(), data, config)).data;
|
|
28
|
+
}
|
|
29
|
+
else
|
|
30
|
+
return (await this.post(this.url(), data, config));
|
|
23
31
|
}
|
|
24
32
|
async createBulk(data, config) {
|
|
25
|
-
|
|
33
|
+
if (!config?.fullResponse) {
|
|
34
|
+
return (await this.post(this.url('bulk'), data, config)).items;
|
|
35
|
+
}
|
|
36
|
+
else
|
|
37
|
+
return (await this.post(this.url('bulk'), data, config));
|
|
26
38
|
}
|
|
27
39
|
async cursor(filter, options, config) {
|
|
28
40
|
options.method = 'GET';
|
|
@@ -37,26 +49,54 @@ class RestfulService extends providers_1.RequestService {
|
|
|
37
49
|
}
|
|
38
50
|
async find(filter, config) {
|
|
39
51
|
const params = Object.assign({ ...filter }, { ...config?.params });
|
|
40
|
-
|
|
52
|
+
if (!config?.fullResponse) {
|
|
53
|
+
return (await this.get(this.url(), { ...config, params })).items;
|
|
54
|
+
}
|
|
55
|
+
else
|
|
56
|
+
return (await this.get(this.url(), { ...config, params }));
|
|
41
57
|
}
|
|
42
58
|
async findById(id, config) {
|
|
43
|
-
|
|
59
|
+
if (!config?.fullResponse) {
|
|
60
|
+
return (await this.get(this.url(id), config)).data;
|
|
61
|
+
}
|
|
62
|
+
else
|
|
63
|
+
return (await this.get(this.url(id), config));
|
|
44
64
|
}
|
|
45
65
|
async deleteById(id, config) {
|
|
46
|
-
|
|
66
|
+
if (!config?.fullResponse) {
|
|
67
|
+
return (await this.delete(this.url(id), config)).data;
|
|
68
|
+
}
|
|
69
|
+
else
|
|
70
|
+
return (await this.delete(this.url(id), config));
|
|
47
71
|
}
|
|
48
72
|
async restoreById(id, config) {
|
|
49
|
-
|
|
73
|
+
if (!config?.fullResponse) {
|
|
74
|
+
return (await this.put(this.url(`${id}/restore`), undefined, config)).data;
|
|
75
|
+
}
|
|
76
|
+
else
|
|
77
|
+
return (await this.put(this.url(`${id}/restore`), undefined, config));
|
|
50
78
|
}
|
|
51
79
|
async destroyById(id, config) {
|
|
52
|
-
|
|
80
|
+
if (!config?.fullResponse) {
|
|
81
|
+
return (await this.delete(this.url(`${id}/destroy`), config)).data;
|
|
82
|
+
}
|
|
83
|
+
else
|
|
84
|
+
return (await this.delete(this.url(`${id}/destroy`), config));
|
|
53
85
|
}
|
|
54
86
|
async updateBulk(data, query, config) {
|
|
55
87
|
const params = Object.assign({ ...query }, { ...config?.params });
|
|
56
|
-
|
|
88
|
+
if (!config?.fullResponse) {
|
|
89
|
+
return (await this.patch(this.url('bulk'), data, { ...config, params })).total;
|
|
90
|
+
}
|
|
91
|
+
else
|
|
92
|
+
return (await this.patch(this.url('bulk'), data, { ...config, params }));
|
|
57
93
|
}
|
|
58
94
|
async updateById(id, data, config) {
|
|
59
|
-
|
|
95
|
+
if (!config?.fullResponse) {
|
|
96
|
+
return (await this.patch(this.url(id), data, config)).data;
|
|
97
|
+
}
|
|
98
|
+
else
|
|
99
|
+
return (await this.patch(this.url(id), data, config));
|
|
60
100
|
}
|
|
61
101
|
}
|
|
62
102
|
exports.RestfulService = RestfulService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restful.service.js","sourceRoot":"","sources":["../../../src/common/core/classes/restful.service.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAuF;AAEvF,4CAAoB;AAGpB,4CAA8C;
|
|
1
|
+
{"version":3,"file":"restful.service.js","sourceRoot":"","sources":["../../../src/common/core/classes/restful.service.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAuF;AAEvF,4CAAoB;AAGpB,4CAA8C;AAoB9C,MAAa,cAAoD,SAAQ,0BAAc;IAGrF,YACqB,IAAgB,EAChB,KAAoB;QAEvC,KAAK,CAAC,KAAK,CAAC,CAAC;QAHM,SAAI,GAAJ,IAAI,CAAY;QAChB,UAAK,GAAL,KAAK,CAAe;QAJtB,QAAG,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAOrF,CAAC;IAED,KAAK,CAAC,KAAK,CAAgD,KAAe,EAAE,MAAU;QACpF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC;YAC1B,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAQ,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,KAAuC,CAAC;QACnH,CAAC;;Y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
|
|
|
1
|
-
export type MetaKey = 'user-agent' | 'authorization' | 'x-at' | 'x-by' | 'x-in' | 'x-zone' | 'x-token' | 'x-user-ip' | 'x-api-key' | 'x-saga-ttl' | 'x-api-token' | 'x-file-data' | 'x-request-id' | 'x-user-agent' | 'x-nested-keys' | 'x-saga-session' | 'x-authorization' | 'x-payment-amount' | 'x-no-api-response' | 'x-can-with-policies' | 'x-naming-convention' | 'x-stat-learning-rate' | 'x-stat-delay-datetime' | 'x-can-with-id-policies' | 'x-exclude-soft-delete-query';
|
|
1
|
+
export type MetaKey = 'user-agent' | 'authorization' | 'x-at' | 'x-by' | 'x-in' | 'x-zone' | 'x-token' | 'x-user-ip' | 'x-api-key' | 'x-saga-ttl' | 'x-api-token' | 'x-file-data' | 'x-request-id' | 'x-user-agent' | 'x-nested-keys' | 'x-saga-session' | 'x-authorization' | 'x-payment-amount' | 'x-no-api-response' | 'x-can-with-policies' | 'x-naming-convention' | 'x-stat-learning-rate' | 'x-stat-delay-datetime' | 'x-can-with-id-policies' | 'x-change-projection-value' | 'x-ignore-change-projection' | 'x-exclude-soft-delete-query';
|
|
2
2
|
export type Metadata = {
|
|
3
3
|
[key in MetaKey]?: any;
|
|
4
4
|
};
|
|
@@ -11,6 +11,7 @@ export * from './repository.util';
|
|
|
11
11
|
export * from './token.util';
|
|
12
12
|
export * from './tools.util';
|
|
13
13
|
export * from './transform.util';
|
|
14
|
+
export * from './type.util';
|
|
14
15
|
export * from './unicode.util';
|
|
15
16
|
export * from './validation.util';
|
|
16
17
|
export * from './wrapper.util';
|
|
@@ -27,6 +27,7 @@ __exportStar(require("./repository.util"), exports);
|
|
|
27
27
|
__exportStar(require("./token.util"), exports);
|
|
28
28
|
__exportStar(require("./tools.util"), exports);
|
|
29
29
|
__exportStar(require("./transform.util"), exports);
|
|
30
|
+
__exportStar(require("./type.util"), exports);
|
|
30
31
|
__exportStar(require("./unicode.util"), exports);
|
|
31
32
|
__exportStar(require("./validation.util"), exports);
|
|
32
33
|
__exportStar(require("./wrapper.util"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/core/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,kDAAgC;AAChC,gDAA8B;AAC9B,iDAA+B;AAC/B,gDAA8B;AAC9B,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,gDAA8B;AAC9B,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,iDAA+B;AAC/B,oDAAkC;AAClC,iDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/core/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,kDAAgC;AAChC,gDAA8B;AAC9B,iDAA+B;AAC/B,gDAA8B;AAC9B,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,gDAA8B;AAC9B,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,8CAA4B;AAC5B,iDAA+B;AAC/B,oDAAkC;AAClC,iDAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mergeType: <T = any, O extends object = object>(obj: O) => O & T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.util.js","sourceRoot":"","sources":["../../../src/common/core/utils/type.util.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,CAAqC,GAAM,EAAS,EAAE,CAAC,GAAY,CAAC;AAAhF,QAAA,SAAS,aAAuE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Document } from 'mongoose';
|
|
2
2
|
import { Pay, PayDto } from '../common';
|
|
3
|
+
import { State } from '../../../core/enums';
|
|
3
4
|
import { InvoiceType } from '../../../enums/financial';
|
|
4
5
|
import { Core, Dto, NesteDto } from '../../../core/interfaces';
|
|
5
6
|
import { InvoiceItem, InvoiceItemDto } from './item.interface';
|
|
@@ -12,13 +13,14 @@ export interface Invoice<Properties extends object = object> extends Core<Proper
|
|
|
12
13
|
payers?: Pay<Properties>[];
|
|
13
14
|
currency?: string;
|
|
14
15
|
items?: InvoiceItem<Properties>[];
|
|
16
|
+
state: State;
|
|
15
17
|
closed_at?: Date;
|
|
16
18
|
expires_at?: Date;
|
|
17
19
|
replication?: number;
|
|
18
20
|
subscription?: string;
|
|
19
21
|
}
|
|
20
22
|
export type InvoiceDoc<Properties extends object = object> = Invoice<Properties> & Document;
|
|
21
|
-
export type InvoiceDto<Properties extends object = object> = NesteDto<Dto<Invoice<Properties>, 'type'>, {
|
|
23
|
+
export type InvoiceDto<Properties extends object = object> = NesteDto<Dto<Invoice<Properties>, 'type' | 'state'>, {
|
|
22
24
|
payees: PayDto[];
|
|
23
25
|
payers?: PayDto[];
|
|
24
26
|
items?: InvoiceItemDto[];
|