@or-sdk/billing 11.41.0 → 11.41.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/cjs/api/auditApi/index.js.map +1 -1
- package/dist/esm/api/auditApi/index.js.map +1 -1
- package/dist/types/api/auditApi/index.d.ts +6 -4
- package/dist/types/api/auditApi/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/api/auditApi/index.ts +9 -8
- package/dist/cjs/api/auditApi/types.js +0 -3
- package/dist/cjs/api/auditApi/types.js.map +0 -1
- package/dist/esm/api/auditApi/types.js +0 -2
- package/dist/esm/api/auditApi/types.js.map +0 -1
- package/dist/types/api/auditApi/types.d.ts +0 -31
- package/dist/types/api/auditApi/types.d.ts.map +0 -1
- package/src/api/auditApi/types.ts +0 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/auditApi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/auditApi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,sCAAqC;AAErC;IAAsC,4BAAO;IAA7C;;QACmB,iBAAW,GAAG,OAAO,CAAC;;IA2CzC,CAAC;IAtCc,4BAAS,GAAtB;4DACE,MAA2B,EAC3B,OAA+B;;YAA/B,wBAAA,EAAA,YAA+B;;;;wBAIzB,KAAwB,MAAM,IAAI,EAAS,EAAzC,IAAI,UAAA,EAAE,EAAE,QAAA,EAAK,IAAI,cAAnB,cAAqB,CAAF,CAAyB;wBAC5C,UAAU,gBAAiC,IAAI,CAAE,CAAC;wBACxD,IAAI,IAAI,YAAY,IAAI;4BAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;6BAAK,IAAI,IAAI;4BAAE,UAAU,CAAC,IAAI,GAAG,IAAc,CAAC;wBAC/G,IAAI,EAAE,YAAY,IAAI;4BAAE,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;6BAAK,IAAI,EAAE;4BAAE,UAAU,CAAC,EAAE,GAAG,EAAY,CAAC;wBAE5F,WAAM,IAAI,CAAC,OAAO,YACvB,MAAM,EAAE,KAAK,EACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,CAAE,EAC5B,MAAM,EAAE,UAAU,IACf,OAAO,EACV,EAAA;4BALF,WAAO,SAKL,EAAC;;;;KACJ;IAKY,+BAAY,GAAzB,UAA0B,EAAU;;;;4BAC3B,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,cAAI,EAAE,CAAE;yBACnC,CAAC,EAAA;4BAHF,WAAO,SAGL,EAAC;;;;KACJ;IAKY,8BAAW,GAAxB;;;;4BACS,WAAM,IAAI,CAAC,OAAO,CAAC;4BACxB,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,UAAG,IAAI,CAAC,WAAW,cAAW;yBACtC,CAAC,EAAA;4BAHF,WAAO,SAGL,EAAC;;;;KACJ;IACH,eAAC;AAAD,CAAC,AA5CD,CAAsC,iBAAO,GA4C5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/auditApi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/auditApi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ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Params } from '../../types';
|
|
2
3
|
import { BaseApi } from '../baseApi';
|
|
3
|
-
import { AuditEntitiesResponse, AuditRecordDto, GetAuditsParams, GetAuditsResponse } from './types';
|
|
4
4
|
export default class AuditApi extends BaseApi {
|
|
5
5
|
private readonly apiBasePath;
|
|
6
|
-
getAudits(params:
|
|
7
|
-
getAuditById(id: string): Promise<
|
|
8
|
-
getEntities(): Promise<
|
|
6
|
+
getAudits(params: AuditQueryParamsDto, options?: OptionalApiParams): Promise<AuditPaginatedResponseDto>;
|
|
7
|
+
getAuditById(id: string): Promise<AuditDto>;
|
|
8
|
+
getEntities(): Promise<{
|
|
9
|
+
items: string[];
|
|
10
|
+
}>;
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/auditApi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/auditApi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAC3C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAW;IAK1B,SAAS,CACpB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAmBxB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAU3C,WAAW,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAMzD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/billing",
|
|
3
|
-
"version": "11.41.
|
|
3
|
+
"version": "11.41.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dev": "pnpm build:watch:esm"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@onereach/billing-dto": "^11.41.
|
|
19
|
-
"@onereach/billing-shared": "^11.41.
|
|
18
|
+
"@onereach/billing-dto": "^11.41.1",
|
|
19
|
+
"@onereach/billing-shared": "^11.41.1",
|
|
20
20
|
"@or-sdk/base": "^0.42.4",
|
|
21
21
|
"@or-sdk/discovery": "1.10.6",
|
|
22
22
|
"@types/qs": "6.14.0",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { AuditPaginatedResponseDto, AuditQueryParamsDto, AuditDto } from '@onereach/billing-dto';
|
|
2
|
+
|
|
1
3
|
import { OptionalApiParams } from '../../types';
|
|
2
4
|
import { BaseApi } from '../baseApi';
|
|
3
5
|
|
|
4
|
-
import { AuditEntitiesResponse, AuditRecordDto, GetAuditsParams, GetAuditsResponse } from './types';
|
|
5
|
-
|
|
6
6
|
export default class AuditApi extends BaseApi {
|
|
7
7
|
private readonly apiBasePath = 'audit';
|
|
8
8
|
|
|
@@ -10,14 +10,15 @@ export default class AuditApi extends BaseApi {
|
|
|
10
10
|
* @description Get audits with pagination and filters
|
|
11
11
|
*/
|
|
12
12
|
public async getAudits(
|
|
13
|
-
params:
|
|
13
|
+
params: AuditQueryParamsDto,
|
|
14
14
|
options: OptionalApiParams = {},
|
|
15
|
-
): Promise<
|
|
15
|
+
): Promise<AuditPaginatedResponseDto> {
|
|
16
16
|
// Normalize date params to ISO if Date objects are passed
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
18
|
const { from, to, ...rest } = params || {} as any;
|
|
18
19
|
const normalized: Record<string, unknown> = { ...rest };
|
|
19
|
-
if (from instanceof Date) normalized.from = from.toISOString();
|
|
20
|
-
if (to instanceof Date) normalized.to = to.toISOString();
|
|
20
|
+
if (from instanceof Date) normalized.from = from.toISOString();else if (from) normalized.from = from as string;
|
|
21
|
+
if (to instanceof Date) normalized.to = to.toISOString();else if (to) normalized.to = to as string;
|
|
21
22
|
|
|
22
23
|
return await this.apiCall({
|
|
23
24
|
method: 'GET',
|
|
@@ -30,7 +31,7 @@ export default class AuditApi extends BaseApi {
|
|
|
30
31
|
/**
|
|
31
32
|
* @description Get audit record by id
|
|
32
33
|
*/
|
|
33
|
-
public async getAuditById(id: string): Promise<
|
|
34
|
+
public async getAuditById(id: string): Promise<AuditDto> {
|
|
34
35
|
return await this.apiCall({
|
|
35
36
|
method: 'GET',
|
|
36
37
|
route: `${this.apiBasePath}/${id}`,
|
|
@@ -40,7 +41,7 @@ export default class AuditApi extends BaseApi {
|
|
|
40
41
|
/**
|
|
41
42
|
* @description Get list of audited entity names
|
|
42
43
|
*/
|
|
43
|
-
public async getEntities(): Promise<
|
|
44
|
+
public async getEntities(): Promise<{ items: string[] }> {
|
|
44
45
|
return await this.apiCall({
|
|
45
46
|
method: 'GET',
|
|
46
47
|
route: `${this.apiBasePath}/entities`,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/auditApi/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/auditApi/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AuditOperation, ResponseDto, RequestDto } from '@onereach/billing-shared';
|
|
2
|
-
export interface AuditRecordDto {
|
|
3
|
-
id: string;
|
|
4
|
-
entityName: string;
|
|
5
|
-
entityId: string;
|
|
6
|
-
operation: AuditOperation;
|
|
7
|
-
changedAt: string;
|
|
8
|
-
changedBy?: string | null;
|
|
9
|
-
before?: Record<string, unknown> | null;
|
|
10
|
-
after?: Record<string, unknown> | null;
|
|
11
|
-
diff?: Record<string, {
|
|
12
|
-
before: unknown;
|
|
13
|
-
after: unknown;
|
|
14
|
-
} | undefined> | null;
|
|
15
|
-
}
|
|
16
|
-
export type GetAuditsParams = Partial<{
|
|
17
|
-
entityName: string;
|
|
18
|
-
entityId: string;
|
|
19
|
-
operation: AuditOperation;
|
|
20
|
-
from: Date | string;
|
|
21
|
-
to: Date | string;
|
|
22
|
-
search: string;
|
|
23
|
-
}> & RequestDto;
|
|
24
|
-
export type GetAuditsResponse = ResponseDto<AuditRecordDto> & {
|
|
25
|
-
skip: number;
|
|
26
|
-
take: number;
|
|
27
|
-
};
|
|
28
|
-
export interface AuditEntitiesResponse {
|
|
29
|
-
items: string[];
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/auditApi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEnF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;CAC/E;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,cAAc,CAAC;IAC1B,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,GAAG,UAAU,CAAC;AAEhB,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,cAAc,CAAC,GAAG;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AuditOperation, ResponseDto, RequestDto } from '@onereach/billing-shared';
|
|
2
|
-
|
|
3
|
-
export interface AuditRecordDto {
|
|
4
|
-
id: string;
|
|
5
|
-
entityName: string;
|
|
6
|
-
entityId: string;
|
|
7
|
-
operation: AuditOperation;
|
|
8
|
-
changedAt: string; // ISO string
|
|
9
|
-
changedBy?: string | null;
|
|
10
|
-
before?: Record<string, unknown> | null;
|
|
11
|
-
after?: Record<string, unknown> | null;
|
|
12
|
-
diff?: Record<string, { before: unknown; after: unknown } | undefined> | null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type GetAuditsParams = Partial<{
|
|
16
|
-
entityName: string;
|
|
17
|
-
entityId: string;
|
|
18
|
-
operation: AuditOperation;
|
|
19
|
-
from: Date | string;
|
|
20
|
-
to: Date | string;
|
|
21
|
-
search: string;
|
|
22
|
-
}> & RequestDto;
|
|
23
|
-
|
|
24
|
-
export type GetAuditsResponse = ResponseDto<AuditRecordDto> & {
|
|
25
|
-
skip: number;
|
|
26
|
-
take: number;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export interface AuditEntitiesResponse {
|
|
30
|
-
items: string[];
|
|
31
|
-
}
|