resurgence-data 1.1.64 → 1.1.67

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,7 +1,11 @@
1
+ import { ErrorContent } from "../types/error.type";
1
2
  import { ResurgenceException } from "./exception";
2
3
  export declare class InvalidCredentialsException extends ResurgenceException {
4
+ constructor(errorContent?: ErrorContent);
3
5
  }
4
6
  export declare class InvalidUserException extends ResurgenceException {
7
+ constructor(errorContent?: ErrorContent);
5
8
  }
6
9
  export declare class InactiveUserException extends ResurgenceException {
10
+ constructor(errorContent?: ErrorContent);
7
11
  }
@@ -3,11 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InactiveUserException = exports.InvalidUserException = exports.InvalidCredentialsException = void 0;
4
4
  const exception_1 = require("./exception");
5
5
  class InvalidCredentialsException extends exception_1.ResurgenceException {
6
+ constructor(errorContent) {
7
+ super(errorContent);
8
+ this.name = "InvalidCredentialsException";
9
+ }
6
10
  }
7
11
  exports.InvalidCredentialsException = InvalidCredentialsException;
8
12
  class InvalidUserException extends exception_1.ResurgenceException {
13
+ constructor(errorContent) {
14
+ super(errorContent);
15
+ this.name = "InvalidUserException";
16
+ }
9
17
  }
10
18
  exports.InvalidUserException = InvalidUserException;
11
19
  class InactiveUserException extends exception_1.ResurgenceException {
20
+ constructor(errorContent) {
21
+ super(errorContent);
22
+ this.name = "InactiveUserException";
23
+ }
12
24
  }
13
25
  exports.InactiveUserException = InactiveUserException;
@@ -1,5 +1,8 @@
1
+ import { ErrorContent } from "../types/error.type";
1
2
  import { ResurgenceException } from "./exception";
2
3
  export declare class InvalidAuthorizationException extends ResurgenceException {
4
+ constructor(errorContent?: ErrorContent);
3
5
  }
4
6
  export declare class ExpiredAuthorizationException extends ResurgenceException {
7
+ constructor(errorContent?: ErrorContent);
5
8
  }
@@ -3,8 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExpiredAuthorizationException = exports.InvalidAuthorizationException = void 0;
4
4
  const exception_1 = require("./exception");
5
5
  class InvalidAuthorizationException extends exception_1.ResurgenceException {
6
+ constructor(errorContent) {
7
+ super(errorContent);
8
+ this.name = "InvalidAuthorizationException";
9
+ }
6
10
  }
7
11
  exports.InvalidAuthorizationException = InvalidAuthorizationException;
8
12
  class ExpiredAuthorizationException extends exception_1.ResurgenceException {
13
+ constructor(errorContent) {
14
+ super(errorContent);
15
+ this.name = "ExpiredAuthorizationException";
16
+ }
9
17
  }
10
18
  exports.ExpiredAuthorizationException = ExpiredAuthorizationException;
@@ -1,3 +1,5 @@
1
+ import { ErrorContent } from "../types/error.type";
1
2
  import { ResurgenceException } from "./exception";
2
3
  export declare class InvalidPayloadException extends ResurgenceException {
4
+ constructor(errorContent?: ErrorContent);
3
5
  }
@@ -3,5 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvalidPayloadException = void 0;
4
4
  const exception_1 = require("./exception");
5
5
  class InvalidPayloadException extends exception_1.ResurgenceException {
6
+ constructor(errorContent) {
7
+ super(errorContent);
8
+ this.name = "InvalidPayloadException";
9
+ }
6
10
  }
7
11
  exports.InvalidPayloadException = InvalidPayloadException;
@@ -1,3 +1,5 @@
1
+ import { ErrorContent } from "../types/error.type";
1
2
  import { ResurgenceException } from "./exception";
2
3
  export declare class DatabaseProcessException extends ResurgenceException {
4
+ constructor(errorContent?: ErrorContent);
3
5
  }
@@ -3,5 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DatabaseProcessException = void 0;
4
4
  const exception_1 = require("./exception");
5
5
  class DatabaseProcessException extends exception_1.ResurgenceException {
6
+ constructor(errorContent) {
7
+ super(errorContent);
8
+ this.name = "DatabaseProcessException";
9
+ }
6
10
  }
7
11
  exports.DatabaseProcessException = DatabaseProcessException;
@@ -1,5 +1,8 @@
1
+ import { ErrorContent } from "../types/error.type";
1
2
  import { ResurgenceException } from "./exception";
2
3
  export declare class MessagingException extends ResurgenceException {
4
+ constructor(errorContent?: ErrorContent);
3
5
  }
4
6
  export declare class ThirdPartyIntegrationException extends ResurgenceException {
7
+ constructor(errorContent?: ErrorContent);
5
8
  }
@@ -3,8 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ThirdPartyIntegrationException = exports.MessagingException = void 0;
4
4
  const exception_1 = require("./exception");
5
5
  class MessagingException extends exception_1.ResurgenceException {
6
+ constructor(errorContent) {
7
+ super(errorContent);
8
+ this.name = "MessagingException";
9
+ }
6
10
  }
7
11
  exports.MessagingException = MessagingException;
8
12
  class ThirdPartyIntegrationException extends exception_1.ResurgenceException {
13
+ constructor(errorContent) {
14
+ super(errorContent);
15
+ this.name = "ThirdPartyIntegrationException";
16
+ }
9
17
  }
10
18
  exports.ThirdPartyIntegrationException = ThirdPartyIntegrationException;
@@ -1,3 +1,5 @@
1
+ import { ErrorContent } from "../types/error.type";
1
2
  import { ResurgenceException } from "./exception";
2
3
  export declare class IncompleteProcessException extends ResurgenceException {
4
+ constructor(errorContent?: ErrorContent);
3
5
  }
@@ -3,5 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IncompleteProcessException = void 0;
4
4
  const exception_1 = require("./exception");
5
5
  class IncompleteProcessException extends exception_1.ResurgenceException {
6
+ constructor(errorContent) {
7
+ super(errorContent);
8
+ this.name = "IncompleteProcessException";
9
+ }
6
10
  }
7
11
  exports.IncompleteProcessException = IncompleteProcessException;
@@ -1,9 +1,14 @@
1
+ import { ErrorContent } from "../types/error.type";
1
2
  import { ResurgenceException } from "./exception";
2
3
  export declare class ResourceNotFoundException extends ResurgenceException {
4
+ constructor(errorContent?: ErrorContent);
3
5
  }
4
6
  export declare class ResourceExistsException extends ResurgenceException {
7
+ constructor(errorContent?: ErrorContent);
5
8
  }
6
9
  export declare class UnauthorizedResourceActionException extends ResurgenceException {
10
+ constructor(errorContent?: ErrorContent);
7
11
  }
8
12
  export declare class ExpiredResourceException extends ResurgenceException {
13
+ constructor(errorContent?: ErrorContent);
9
14
  }
@@ -3,14 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExpiredResourceException = exports.UnauthorizedResourceActionException = exports.ResourceExistsException = exports.ResourceNotFoundException = void 0;
4
4
  const exception_1 = require("./exception");
5
5
  class ResourceNotFoundException extends exception_1.ResurgenceException {
6
+ constructor(errorContent) {
7
+ super(errorContent);
8
+ this.name = "ResourceNotFoundException";
9
+ }
6
10
  }
7
11
  exports.ResourceNotFoundException = ResourceNotFoundException;
8
12
  class ResourceExistsException extends exception_1.ResurgenceException {
13
+ constructor(errorContent) {
14
+ super(errorContent);
15
+ this.name = "ResourceExistsException";
16
+ }
9
17
  }
10
18
  exports.ResourceExistsException = ResourceExistsException;
11
19
  class UnauthorizedResourceActionException extends exception_1.ResurgenceException {
20
+ constructor(errorContent) {
21
+ super(errorContent);
22
+ this.name = "UnauthorizedResourceActionException";
23
+ }
12
24
  }
13
25
  exports.UnauthorizedResourceActionException = UnauthorizedResourceActionException;
14
26
  class ExpiredResourceException extends exception_1.ResurgenceException {
27
+ constructor(errorContent) {
28
+ super(errorContent);
29
+ this.name = "ExpiredResourceException";
30
+ }
15
31
  }
16
32
  exports.ExpiredResourceException = ExpiredResourceException;
@@ -2,3 +2,4 @@ export declare function toCamel(s: any): any;
2
2
  export declare function isArray(a: any): a is any[];
3
3
  export declare function isObject(o: any): boolean;
4
4
  export declare function keysToCamelCase(o: any): any;
5
+ export declare function maskString(str: string, unmaskLastN: number): string;
@@ -4,6 +4,7 @@ exports.toCamel = toCamel;
4
4
  exports.isArray = isArray;
5
5
  exports.isObject = isObject;
6
6
  exports.keysToCamelCase = keysToCamelCase;
7
+ exports.maskString = maskString;
7
8
  function toCamel(s) {
8
9
  return s.replace(/([-_][a-z])/gi, ($1) => {
9
10
  return $1.toUpperCase().replace("-", "").replace("_", "");
@@ -30,3 +31,15 @@ function keysToCamelCase(o) {
30
31
  }
31
32
  return o;
32
33
  }
34
+ function maskString(str, unmaskLastN) {
35
+ if (!str || unmaskLastN < 0) {
36
+ return str;
37
+ }
38
+ if (unmaskLastN >= str.length) {
39
+ return str;
40
+ }
41
+ const maskLength = str.length - unmaskLastN;
42
+ const maskedPart = "*".repeat(maskLength);
43
+ const unmaskedPart = str.slice(maskLength);
44
+ return maskedPart + unmaskedPart;
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.64",
3
+ "version": "1.1.67",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -613,7 +613,7 @@ export class CreateBillerChargeConfigurationDto extends BaseDTO {
613
613
  })
614
614
  @IsDecimal(
615
615
  { decimal_digits: "1,2", force_decimal: false },
616
- { message: "Percent amount must be a valid decimal with up to 2 decimal places" }
616
+ { message: "Percent amount must be a valid decimal with up to 2 decimal places" },
617
617
  )
618
618
  @Min(0, { message: "Percent amount must not be negative" })
619
619
  @IsOptional()
@@ -726,7 +726,7 @@ export class UpdateBillerChargeConfigurationDto extends BaseDTO {
726
726
  })
727
727
  @IsDecimal(
728
728
  { decimal_digits: "1,2", force_decimal: false },
729
- { message: "Percent amount must be a valid decimal with up to 2 decimal places" }
729
+ { message: "Percent amount must be a valid decimal with up to 2 decimal places" },
730
730
  )
731
731
  @Min(0, { message: "Percent amount must not be negative" })
732
732
  @IsOptional()
@@ -1331,6 +1331,15 @@ export class UpdateBillerItemDto extends BaseDTO {
1331
1331
  @IsOptional()
1332
1332
  name?: string;
1333
1333
 
1334
+ @ApiProperty({
1335
+ description: "Indicates if the biller item is active",
1336
+ example: true,
1337
+ required: false,
1338
+ })
1339
+ @IsBoolean({ message: "Active must be a valid boolean" })
1340
+ @IsOptional()
1341
+ active?: boolean;
1342
+
1334
1343
  @ApiProperty({
1335
1344
  description: "The source of the biller item",
1336
1345
  example: "Utility Bill",
@@ -1,3 +1,4 @@
1
1
  export * from "./api-key";
2
2
  export * from "./payment-request";
3
3
  export * from "./bank-account";
4
+ export * from "./vendor-settlement-account/vendor-settlement-account.dto";
@@ -0,0 +1,78 @@
1
+ import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
2
+ import { IsString, IsUUID, IsBoolean, IsOptional, IsIn } from "class-validator";
3
+
4
+ export class CreateVendorSettlementAccountDto {
5
+ @ApiProperty({
6
+ description: "ID of the settlement account to use as vendor",
7
+ example: "550e8400-e29b-41d4-a716-446655440000",
8
+ })
9
+ @IsUUID()
10
+ settlementAccountId: string;
11
+
12
+ @ApiProperty({
13
+ description: "Currency code for this vendor account (e.g., NGN, USD, GHS)",
14
+ example: "NGN",
15
+ })
16
+ @IsString()
17
+ @IsIn(["NGN", "USD", "GHS", "KES", "ZAR", "UGX"]) // Add more as needed
18
+ currency: string;
19
+ }
20
+
21
+ export class UpdateVendorSettlementAccountDto {
22
+ @ApiPropertyOptional({
23
+ description: "Currency code to update",
24
+ example: "NGN",
25
+ })
26
+ @IsOptional()
27
+ @IsString()
28
+ @IsIn(["NGN", "USD", "GHS", "KES", "ZAR", "UGX"]) // Add more as needed
29
+ currency?: string;
30
+
31
+ @ApiPropertyOptional({
32
+ description: "Whether this account is currently active for its currency",
33
+ example: true,
34
+ })
35
+ @IsOptional()
36
+ @IsBoolean()
37
+ active?: boolean;
38
+ }
39
+
40
+ export class VendorSettlementAccountResponseDto {
41
+ @ApiProperty({
42
+ description: "Unique identifier for the vendor settlement account",
43
+ })
44
+ id: string;
45
+
46
+ @ApiProperty({
47
+ description: "ID of the associated settlement account",
48
+ })
49
+ settlementAccountId: string;
50
+
51
+ @ApiProperty({
52
+ description: "Currency code",
53
+ })
54
+ currency: string;
55
+
56
+ @ApiProperty({
57
+ description: "Whether this is the active vendor account for its currency",
58
+ })
59
+ active: boolean;
60
+
61
+ @ApiProperty({
62
+ description: "Timestamp when created",
63
+ })
64
+ createdAt: Date;
65
+
66
+ @ApiProperty({
67
+ description: "Timestamp when last updated",
68
+ })
69
+ updatedAt: Date;
70
+
71
+ @ApiPropertyOptional({
72
+ description: "Flutterwave onboarded account details if available",
73
+ })
74
+ onboardedAccount?: {
75
+ id: string;
76
+ processorAccountId: string;
77
+ };
78
+ }