@or-sdk/billing 11.40.2-beta.2975.0 → 11.41.0

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.
@@ -1 +1 @@
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,EA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W,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,AA3CD,CAAsC,iBAAO,GA2C5C"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/auditApi/types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
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,OAAO;IAA7C;;QACmB,gBAAW,GAAG,OAAO,CAAC;IA2CzC,CAAC;IAtCc,SAAS;6DACpB,MAA2B,EAC3B,UAA6B,EAAE;YAI/B,MAAM,KAAwB,MAAM,IAAI,EAAS,EAA3C,EAAE,IAAI,EAAE,EAAE,OAAiC,EAA5B,IAAI,cAAnB,cAAqB,CAAsB,CAAC;YAClD,MAAM,UAAU,qBAAiC,IAAI,CAAE,CAAC;YACxD,IAAI,IAAI,YAAY,IAAI;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M,UAAU,qBAAiC,IAAI,CAAE,CAAC;YACxD,IAAI,IAAI,YAAY,IAAI;gBAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;iBAAM,IAAI,IAAI;gBAAE,UAAU,CAAC,IAAI,GAAG,IAAc,CAAC;YAChH,IAAI,EAAE,YAAY,IAAI;gBAAE,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;iBAAM,IAAI,EAAE;gBAAE,UAAU,CAAC,EAAE,GAAG,EAAY,CAAC;YAEpG,OAAO,MAAM,IAAI,CAAC,OAAO,iBACvB,MAAM,EAAE,KAAK,EACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,EAC5B,MAAM,EAAE,UAAU,IACf,OAAO,EACV,CAAC;QACL,CAAC;KAAA;IAKY,YAAY,CAAC,EAAU;;YAClC,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,EAAE;aACnC,CAAC,CAAC;QACL,CAAC;KAAA;IAKY,WAAW;;YACtB,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC;gBACxB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,WAAW;aACtC,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/auditApi/types.ts"],"names":[],"mappings":""}
@@ -1,12 +1,10 @@
1
- import { AuditPaginatedResponseDto, AuditQueryParamsDto, AuditDto } from '@onereach/billing-dto';
2
1
  import { OptionalApiParams } from '../../types';
3
2
  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: AuditQueryParamsDto, options?: OptionalApiParams): Promise<AuditPaginatedResponseDto>;
7
- getAuditById(id: string): Promise<AuditDto>;
8
- getEntities(): Promise<{
9
- items: string[];
10
- }>;
6
+ getAudits(params: GetAuditsParams, options?: OptionalApiParams): Promise<GetAuditsResponse>;
7
+ getAuditById(id: string): Promise<AuditRecordDto>;
8
+ getEntities(): Promise<AuditEntitiesResponse>;
11
9
  }
12
10
  //# 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,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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/auditApi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEpG,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAC3C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAW;IAK1B,SAAS,CACpB,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,iBAAiB,CAAC;IAkBhB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAUjD,WAAW,IAAI,OAAO,CAAC,qBAAqB,CAAC;CAM3D"}
@@ -0,0 +1,31 @@
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
@@ -0,0 +1 @@
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@or-sdk/billing",
3
- "version": "11.40.2-beta.2975.0",
3
+ "version": "11.41.0",
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.40.2-beta.2975.0",
19
- "@onereach/billing-shared": "^11.40.2-beta.2975.0",
18
+ "@onereach/billing-dto": "^11.41.0",
19
+ "@onereach/billing-shared": "^11.41.0",
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
-
3
1
  import { OptionalApiParams } from '../../types';
4
2
  import { BaseApi } from '../baseApi';
5
3
 
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,15 +10,14 @@ export default class AuditApi extends BaseApi {
10
10
  * @description Get audits with pagination and filters
11
11
  */
12
12
  public async getAudits(
13
- params: AuditQueryParamsDto,
13
+ params: GetAuditsParams,
14
14
  options: OptionalApiParams = {},
15
- ): Promise<AuditPaginatedResponseDto> {
15
+ ): Promise<GetAuditsResponse> {
16
16
  // Normalize date params to ISO if Date objects are passed
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
17
  const { from, to, ...rest } = params || {} as any;
19
18
  const normalized: Record<string, unknown> = { ...rest };
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;
19
+ if (from instanceof Date) normalized.from = from.toISOString(); else if (from) normalized.from = from as string;
20
+ if (to instanceof Date) normalized.to = to.toISOString(); else if (to) normalized.to = to as string;
22
21
 
23
22
  return await this.apiCall({
24
23
  method: 'GET',
@@ -31,7 +30,7 @@ export default class AuditApi extends BaseApi {
31
30
  /**
32
31
  * @description Get audit record by id
33
32
  */
34
- public async getAuditById(id: string): Promise<AuditDto> {
33
+ public async getAuditById(id: string): Promise<AuditRecordDto> {
35
34
  return await this.apiCall({
36
35
  method: 'GET',
37
36
  route: `${this.apiBasePath}/${id}`,
@@ -41,7 +40,7 @@ export default class AuditApi extends BaseApi {
41
40
  /**
42
41
  * @description Get list of audited entity names
43
42
  */
44
- public async getEntities(): Promise<{ items: string[] }> {
43
+ public async getEntities(): Promise<AuditEntitiesResponse> {
45
44
  return await this.apiCall({
46
45
  method: 'GET',
47
46
  route: `${this.apiBasePath}/entities`,
@@ -0,0 +1,31 @@
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
+ }