@explorins/pers-shared 2.1.104 → 2.1.105
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/shared-lib/dto/transaction/transaction-bulk-data.request.dto.d.ts +3 -3
- package/dist/cjs/shared-lib/dto/transaction/transaction-bulk-data.request.dto.js +9 -9
- package/dist/cjs/shared-lib/dto/user/userUploadData.dto.d.ts +3 -3
- package/dist/cjs/shared-lib/dto/user/userUploadData.dto.js +14 -14
- package/dist/cjs/shared-lib/dto/webhook/webhook.dto.d.ts +6 -6
- package/dist/cjs/shared-lib/dto/webhook/webhook.dto.js +52 -52
- package/dist/cjs/shared-lib/enum/entity-types.enum.d.ts +100 -0
- package/dist/cjs/shared-lib/enum/entity-types.enum.d.ts.map +1 -0
- package/dist/cjs/shared-lib/enum/entity-types.enum.js +61 -0
- package/dist/cjs/shared-lib/enum/entity-types.enum.js.map +1 -0
- package/dist/cjs/shared-lib/enum/index.d.ts +1 -0
- package/dist/cjs/shared-lib/enum/index.d.ts.map +1 -1
- package/dist/cjs/shared-lib/enum/index.js +2 -0
- package/dist/cjs/shared-lib/enum/index.js.map +1 -1
- package/dist/cjs/shared-lib/errors/error-codes.d.ts +2 -26
- package/dist/cjs/shared-lib/errors/error-codes.d.ts.map +1 -1
- package/dist/cjs/shared-lib/errors/error-codes.js +3 -22
- package/dist/cjs/shared-lib/errors/error-codes.js.map +1 -1
- package/dist/cjs/shared-lib/value-objects/token-balance.value-object.js +2 -2
- package/dist/cjs/shared-lib/value-objects/token-balance.value-object.js.map +1 -1
- package/dist/cjs/shared-patterns/functions/{helper.functions.d.ts → token-metadata.functions.d.ts} +13 -24
- package/dist/cjs/shared-patterns/functions/token-metadata.functions.d.ts.map +1 -0
- package/dist/cjs/shared-patterns/functions/{helper.functions.js → token-metadata.functions.js} +14 -58
- package/dist/cjs/shared-patterns/functions/token-metadata.functions.js.map +1 -0
- package/dist/esm/shared-lib/dto/transaction/transaction-bulk-data.request.dto.d.ts +3 -3
- package/dist/esm/shared-lib/dto/transaction/transaction-bulk-data.request.dto.js +8 -8
- package/dist/esm/shared-lib/dto/user/userUploadData.dto.d.ts +3 -3
- package/dist/esm/shared-lib/dto/user/userUploadData.dto.js +10 -10
- package/dist/esm/shared-lib/dto/webhook/webhook.dto.d.ts +6 -6
- package/dist/esm/shared-lib/dto/webhook/webhook.dto.js +46 -46
- package/dist/esm/shared-lib/enum/entity-types.enum.d.ts +100 -0
- package/dist/esm/shared-lib/enum/entity-types.enum.d.ts.map +1 -0
- package/dist/esm/shared-lib/enum/entity-types.enum.js +58 -0
- package/dist/esm/shared-lib/enum/entity-types.enum.js.map +1 -0
- package/dist/esm/shared-lib/enum/index.d.ts +1 -0
- package/dist/esm/shared-lib/enum/index.d.ts.map +1 -1
- package/dist/esm/shared-lib/enum/index.js +2 -0
- package/dist/esm/shared-lib/enum/index.js.map +1 -1
- package/dist/esm/shared-lib/errors/error-codes.d.ts +2 -26
- package/dist/esm/shared-lib/errors/error-codes.d.ts.map +1 -1
- package/dist/esm/shared-lib/errors/error-codes.js +2 -22
- package/dist/esm/shared-lib/errors/error-codes.js.map +1 -1
- package/dist/esm/shared-lib/value-objects/token-balance.value-object.js +1 -1
- package/dist/esm/shared-lib/value-objects/token-balance.value-object.js.map +1 -1
- package/dist/esm/shared-patterns/functions/{helper.functions.d.ts → token-metadata.functions.d.ts} +13 -24
- package/dist/esm/shared-patterns/functions/token-metadata.functions.d.ts.map +1 -0
- package/dist/esm/shared-patterns/functions/{helper.functions.js → token-metadata.functions.js} +13 -54
- package/dist/esm/shared-patterns/functions/token-metadata.functions.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/shared-patterns/functions/helper.functions.d.ts.map +0 -1
- package/dist/cjs/shared-patterns/functions/helper.functions.js.map +0 -1
- package/dist/esm/shared-patterns/functions/helper.functions.d.ts.map +0 -1
- package/dist/esm/shared-patterns/functions/helper.functions.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class
|
|
1
|
+
import { UserUploadDataDTO } from "../user/userUploadData.dto";
|
|
2
|
+
export declare class TransactionBulkUserUploadDataDTO extends UserUploadDataDTO {
|
|
3
3
|
amount?: number;
|
|
4
4
|
tokenAddress?: string;
|
|
5
5
|
chainId?: number;
|
|
6
6
|
tokenMetadataIncrementalId?: string | null;
|
|
7
7
|
}
|
|
8
8
|
export declare class TransactionBulkDataRequestDTO {
|
|
9
|
-
userData:
|
|
9
|
+
userData: TransactionBulkUserUploadDataDTO[];
|
|
10
10
|
amount?: number;
|
|
11
11
|
tokenAddress?: string;
|
|
12
12
|
tokenMetadataIncrementalId?: string | null;
|
|
@@ -9,19 +9,19 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TransactionBulkDataRequestDTO = exports.
|
|
12
|
+
exports.TransactionBulkDataRequestDTO = exports.TransactionBulkUserUploadDataDTO = void 0;
|
|
13
13
|
const userUploadData_dto_1 = require("../user/userUploadData.dto");
|
|
14
14
|
const swagger_1 = require("@nestjs/swagger");
|
|
15
15
|
const class_transformer_1 = require("class-transformer");
|
|
16
16
|
const class_validator_1 = require("class-validator");
|
|
17
17
|
const decorators_1 = require("../../decorators");
|
|
18
|
-
class
|
|
18
|
+
class TransactionBulkUserUploadDataDTO extends userUploadData_dto_1.UserUploadDataDTO {
|
|
19
19
|
amount;
|
|
20
20
|
tokenAddress;
|
|
21
21
|
chainId;
|
|
22
22
|
tokenMetadataIncrementalId;
|
|
23
23
|
}
|
|
24
|
-
exports.
|
|
24
|
+
exports.TransactionBulkUserUploadDataDTO = TransactionBulkUserUploadDataDTO;
|
|
25
25
|
__decorate([
|
|
26
26
|
(0, swagger_1.ApiPropertyOptional)({
|
|
27
27
|
description: 'Amount to mint for this specific user. Overrides global amount if provided.',
|
|
@@ -30,7 +30,7 @@ __decorate([
|
|
|
30
30
|
(0, decorators_1.OptionalStripNumber)(),
|
|
31
31
|
(0, class_validator_1.IsNumber)(),
|
|
32
32
|
__metadata("design:type", Number)
|
|
33
|
-
],
|
|
33
|
+
], TransactionBulkUserUploadDataDTO.prototype, "amount", void 0);
|
|
34
34
|
__decorate([
|
|
35
35
|
(0, swagger_1.ApiPropertyOptional)({
|
|
36
36
|
description: 'Token address for this specific user. Overrides global tokenAddress.',
|
|
@@ -40,7 +40,7 @@ __decorate([
|
|
|
40
40
|
(0, class_validator_1.IsString)(),
|
|
41
41
|
(0, class_validator_1.MinLength)(1),
|
|
42
42
|
__metadata("design:type", String)
|
|
43
|
-
],
|
|
43
|
+
], TransactionBulkUserUploadDataDTO.prototype, "tokenAddress", void 0);
|
|
44
44
|
__decorate([
|
|
45
45
|
(0, swagger_1.ApiPropertyOptional)({
|
|
46
46
|
description: 'Chain ID for this specific user. Overrides global chainId.',
|
|
@@ -49,7 +49,7 @@ __decorate([
|
|
|
49
49
|
(0, decorators_1.OptionalStripNumber)(),
|
|
50
50
|
(0, class_validator_1.IsNumber)(),
|
|
51
51
|
__metadata("design:type", Number)
|
|
52
|
-
],
|
|
52
|
+
], TransactionBulkUserUploadDataDTO.prototype, "chainId", void 0);
|
|
53
53
|
__decorate([
|
|
54
54
|
(0, swagger_1.ApiPropertyOptional)({
|
|
55
55
|
description: 'Token metadata incremental ID for this specific user. Overrides global tokenMetadataIncrementalId.',
|
|
@@ -59,7 +59,7 @@ __decorate([
|
|
|
59
59
|
(0, class_validator_1.IsString)(),
|
|
60
60
|
(0, class_validator_1.MinLength)(1),
|
|
61
61
|
__metadata("design:type", Object)
|
|
62
|
-
],
|
|
62
|
+
], TransactionBulkUserUploadDataDTO.prototype, "tokenMetadataIncrementalId", void 0);
|
|
63
63
|
class TransactionBulkDataRequestDTO {
|
|
64
64
|
userData;
|
|
65
65
|
amount;
|
|
@@ -72,13 +72,13 @@ exports.TransactionBulkDataRequestDTO = TransactionBulkDataRequestDTO;
|
|
|
72
72
|
__decorate([
|
|
73
73
|
(0, swagger_1.ApiProperty)({
|
|
74
74
|
description: 'Array of user data objects for bulk minting. Each object must conform to the UserUploadDataDto structure.',
|
|
75
|
-
type: [
|
|
75
|
+
type: [TransactionBulkUserUploadDataDTO], // Use the specific DTO for Swagger
|
|
76
76
|
}),
|
|
77
77
|
(0, class_validator_1.IsArray)(),
|
|
78
78
|
(0, class_validator_1.ArrayMinSize)(1) // Ensure there's at least one user data object
|
|
79
79
|
,
|
|
80
80
|
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
81
|
-
(0, class_transformer_1.Type)(() =>
|
|
81
|
+
(0, class_transformer_1.Type)(() => TransactionBulkUserUploadDataDTO) // Use the specific DTO for class-transformer and validation
|
|
82
82
|
,
|
|
83
83
|
__metadata("design:type", Array)
|
|
84
84
|
], TransactionBulkDataRequestDTO.prototype, "userData", void 0);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { UserIdentifierParamsObject as IUserIdentifierObject } from '../../types/unique-user-identifier-keys';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class UserIdentifierObjectDTO implements IUserIdentifierObject {
|
|
3
3
|
email?: string;
|
|
4
4
|
externalId?: string;
|
|
5
5
|
id?: string;
|
|
6
6
|
instagramAccountId?: string;
|
|
7
7
|
wildcard?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare class
|
|
10
|
-
user:
|
|
9
|
+
export declare class UserUploadDataDTO {
|
|
10
|
+
user: UserIdentifierObjectDTO;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=userUploadData.dto.d.ts.map
|
|
@@ -9,48 +9,48 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.UserUploadDataDTO = exports.UserIdentifierObjectDTO = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const class_transformer_1 = require("class-transformer");
|
|
16
16
|
const decorators_1 = require("../../decorators");
|
|
17
17
|
// This DTO represents the user identification part.
|
|
18
18
|
// It implements IUserIdentifierObject to align with the shared library type structure.
|
|
19
|
-
class
|
|
19
|
+
class UserIdentifierObjectDTO {
|
|
20
20
|
email;
|
|
21
21
|
externalId;
|
|
22
22
|
id;
|
|
23
23
|
instagramAccountId;
|
|
24
24
|
wildcard;
|
|
25
25
|
}
|
|
26
|
-
exports.
|
|
26
|
+
exports.UserIdentifierObjectDTO = UserIdentifierObjectDTO;
|
|
27
27
|
__decorate([
|
|
28
28
|
(0, swagger_1.ApiPropertyOptional)({ description: 'User email', example: 'user@example.com' }),
|
|
29
29
|
(0, decorators_1.OptionalStrip)(),
|
|
30
30
|
(0, class_validator_1.IsEmail)(),
|
|
31
31
|
__metadata("design:type", String)
|
|
32
|
-
],
|
|
32
|
+
], UserIdentifierObjectDTO.prototype, "email", void 0);
|
|
33
33
|
__decorate([
|
|
34
34
|
(0, swagger_1.ApiPropertyOptional)({ description: 'External User ID' }),
|
|
35
35
|
(0, decorators_1.OptionalStrip)(),
|
|
36
36
|
(0, class_validator_1.IsString)(),
|
|
37
37
|
(0, class_validator_1.MinLength)(1),
|
|
38
38
|
__metadata("design:type", String)
|
|
39
|
-
],
|
|
39
|
+
], UserIdentifierObjectDTO.prototype, "externalId", void 0);
|
|
40
40
|
__decorate([
|
|
41
41
|
(0, swagger_1.ApiPropertyOptional)({ description: 'User ID (from uniqueUserIdentifierKeys)' }),
|
|
42
42
|
(0, decorators_1.OptionalStrip)(),
|
|
43
43
|
(0, class_validator_1.IsString)(),
|
|
44
44
|
(0, class_validator_1.MinLength)(1),
|
|
45
45
|
__metadata("design:type", String)
|
|
46
|
-
],
|
|
46
|
+
], UserIdentifierObjectDTO.prototype, "id", void 0);
|
|
47
47
|
__decorate([
|
|
48
48
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Instagram Account ID (from uniqueUserIdentifierKeys)' }),
|
|
49
49
|
(0, decorators_1.OptionalStrip)(),
|
|
50
50
|
(0, class_validator_1.IsString)(),
|
|
51
51
|
(0, class_validator_1.MinLength)(1),
|
|
52
52
|
__metadata("design:type", String)
|
|
53
|
-
],
|
|
53
|
+
], UserIdentifierObjectDTO.prototype, "instagramAccountId", void 0);
|
|
54
54
|
__decorate([
|
|
55
55
|
(0, swagger_1.ApiPropertyOptional)({
|
|
56
56
|
description: 'Wildcard value for auto-detection of identifier type',
|
|
@@ -59,20 +59,20 @@ __decorate([
|
|
|
59
59
|
(0, decorators_1.OptionalStrip)(),
|
|
60
60
|
(0, class_validator_1.IsString)(),
|
|
61
61
|
__metadata("design:type", String)
|
|
62
|
-
],
|
|
62
|
+
], UserIdentifierObjectDTO.prototype, "wildcard", void 0);
|
|
63
63
|
// This DTO represents the data for a single user in a bulk upload scenario.
|
|
64
|
-
class
|
|
64
|
+
class UserUploadDataDTO {
|
|
65
65
|
user;
|
|
66
66
|
}
|
|
67
|
-
exports.
|
|
67
|
+
exports.UserUploadDataDTO = UserUploadDataDTO;
|
|
68
68
|
__decorate([
|
|
69
69
|
(0, swagger_1.ApiProperty)({
|
|
70
70
|
description: 'User identifier object. At least one identifier (e.g., email, id) must be provided. If only wildcard is provided, the system will attempt to detect the identifier type.',
|
|
71
|
-
type: () =>
|
|
71
|
+
type: () => UserIdentifierObjectDTO
|
|
72
72
|
}),
|
|
73
73
|
(0, class_validator_1.IsObject)(),
|
|
74
74
|
(0, class_validator_1.ValidateNested)(),
|
|
75
|
-
(0, class_transformer_1.Type)(() =>
|
|
76
|
-
__metadata("design:type",
|
|
77
|
-
],
|
|
75
|
+
(0, class_transformer_1.Type)(() => UserIdentifierObjectDTO),
|
|
76
|
+
__metadata("design:type", UserIdentifierObjectDTO)
|
|
77
|
+
], UserUploadDataDTO.prototype, "user", void 0);
|
|
78
78
|
//# sourceMappingURL=userUploadData.dto.js.map
|
|
@@ -3,7 +3,7 @@ export { WebhookAuthType, WebhookMethod, WebhookSource, WebhookExecutionStatus,
|
|
|
3
3
|
/**
|
|
4
4
|
* DTO for creating a webhook
|
|
5
5
|
*/
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class CreateWebhookDTO {
|
|
7
7
|
name: string;
|
|
8
8
|
description?: string;
|
|
9
9
|
targetUrl: string;
|
|
@@ -15,16 +15,16 @@ export declare class CreateWebhookDto {
|
|
|
15
15
|
inboundSecret?: string;
|
|
16
16
|
timeoutMs?: number;
|
|
17
17
|
}
|
|
18
|
-
declare const
|
|
18
|
+
declare const UpdateWebhookDTO_base: import("@nestjs/common").Type<Partial<CreateWebhookDTO>>;
|
|
19
19
|
/**
|
|
20
20
|
* DTO for updating a webhook (all fields optional)
|
|
21
21
|
*/
|
|
22
|
-
export declare class
|
|
22
|
+
export declare class UpdateWebhookDTO extends UpdateWebhookDTO_base {
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* DTO for webhook list responses (hides sensitive fields)
|
|
26
26
|
*/
|
|
27
|
-
export declare class
|
|
27
|
+
export declare class WebhookDTO {
|
|
28
28
|
id: string;
|
|
29
29
|
name: string;
|
|
30
30
|
description?: string | null;
|
|
@@ -43,7 +43,7 @@ export declare class WebhookDto {
|
|
|
43
43
|
/**
|
|
44
44
|
* DTO for webhook execution history
|
|
45
45
|
*/
|
|
46
|
-
export declare class
|
|
46
|
+
export declare class WebhookExecutionDTO {
|
|
47
47
|
id: string;
|
|
48
48
|
webhookId: string;
|
|
49
49
|
method: string;
|
|
@@ -62,7 +62,7 @@ export declare class WebhookExecutionDto {
|
|
|
62
62
|
/**
|
|
63
63
|
* DTO for webhook callback requests from external systems (e.g., n8n workflow completion)
|
|
64
64
|
*/
|
|
65
|
-
export declare class
|
|
65
|
+
export declare class WebhookCallbackDTO {
|
|
66
66
|
status: WebhookCallbackStatus;
|
|
67
67
|
result?: Record<string, unknown>;
|
|
68
68
|
error?: string;
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.WebhookCallbackDTO = exports.WebhookExecutionDTO = exports.WebhookDTO = exports.UpdateWebhookDTO = exports.CreateWebhookDTO = exports.WebhookCallbackStatus = exports.WebhookExecutionStatus = exports.WebhookSource = exports.WebhookMethod = exports.WebhookAuthType = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const webhook_enum_1 = require("../../enum/webhook.enum");
|
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "WebhookCallbackStatus", { enumerable: true, get:
|
|
|
21
21
|
/**
|
|
22
22
|
* DTO for creating a webhook
|
|
23
23
|
*/
|
|
24
|
-
class
|
|
24
|
+
class CreateWebhookDTO {
|
|
25
25
|
name;
|
|
26
26
|
description;
|
|
27
27
|
targetUrl;
|
|
@@ -33,29 +33,29 @@ class CreateWebhookDto {
|
|
|
33
33
|
inboundSecret;
|
|
34
34
|
timeoutMs;
|
|
35
35
|
}
|
|
36
|
-
exports.
|
|
36
|
+
exports.CreateWebhookDTO = CreateWebhookDTO;
|
|
37
37
|
__decorate([
|
|
38
38
|
(0, swagger_1.ApiProperty)({ description: 'Human-readable name for this webhook', example: 'Stripe Payment Webhook' }),
|
|
39
39
|
(0, class_validator_1.IsString)(),
|
|
40
40
|
__metadata("design:type", String)
|
|
41
|
-
],
|
|
41
|
+
], CreateWebhookDTO.prototype, "name", void 0);
|
|
42
42
|
__decorate([
|
|
43
43
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Optional description', example: 'Handles payment confirmations from Stripe' }),
|
|
44
44
|
(0, class_validator_1.IsString)(),
|
|
45
45
|
(0, class_validator_1.IsOptional)(),
|
|
46
46
|
__metadata("design:type", String)
|
|
47
|
-
],
|
|
47
|
+
], CreateWebhookDTO.prototype, "description", void 0);
|
|
48
48
|
__decorate([
|
|
49
49
|
(0, swagger_1.ApiProperty)({ description: 'Target URL where requests will be forwarded', example: 'https://internal-api.example.com/payments/webhook' }),
|
|
50
50
|
(0, class_validator_1.IsUrl)(),
|
|
51
51
|
__metadata("design:type", String)
|
|
52
|
-
],
|
|
52
|
+
], CreateWebhookDTO.prototype, "targetUrl", void 0);
|
|
53
53
|
__decorate([
|
|
54
54
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Whether webhook is active', default: true }),
|
|
55
55
|
(0, class_validator_1.IsBoolean)(),
|
|
56
56
|
(0, class_validator_1.IsOptional)(),
|
|
57
57
|
__metadata("design:type", Boolean)
|
|
58
|
-
],
|
|
58
|
+
], CreateWebhookDTO.prototype, "isActive", void 0);
|
|
59
59
|
__decorate([
|
|
60
60
|
(0, swagger_1.ApiPropertyOptional)({
|
|
61
61
|
description: 'Allowed HTTP methods (defaults to POST only)',
|
|
@@ -68,19 +68,19 @@ __decorate([
|
|
|
68
68
|
(0, class_validator_1.IsEnum)(webhook_enum_1.WebhookMethod, { each: true }),
|
|
69
69
|
(0, class_validator_1.IsOptional)(),
|
|
70
70
|
__metadata("design:type", Array)
|
|
71
|
-
],
|
|
71
|
+
], CreateWebhookDTO.prototype, "allowedMethods", void 0);
|
|
72
72
|
__decorate([
|
|
73
73
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Outbound authentication type', enum: webhook_enum_1.WebhookAuthType, default: webhook_enum_1.WebhookAuthType.NONE }),
|
|
74
74
|
(0, class_validator_1.IsEnum)(webhook_enum_1.WebhookAuthType),
|
|
75
75
|
(0, class_validator_1.IsOptional)(),
|
|
76
76
|
__metadata("design:type", String)
|
|
77
|
-
],
|
|
77
|
+
], CreateWebhookDTO.prototype, "outboundAuthType", void 0);
|
|
78
78
|
__decorate([
|
|
79
79
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Outbound authentication credentials (Bearer token)' }),
|
|
80
80
|
(0, class_validator_1.IsString)(),
|
|
81
81
|
(0, class_validator_1.IsOptional)(),
|
|
82
82
|
__metadata("design:type", String)
|
|
83
|
-
],
|
|
83
|
+
], CreateWebhookDTO.prototype, "outboundAuthCredentials", void 0);
|
|
84
84
|
__decorate([
|
|
85
85
|
(0, swagger_1.ApiProperty)({
|
|
86
86
|
description: 'Allowed inbound sources',
|
|
@@ -91,13 +91,13 @@ __decorate([
|
|
|
91
91
|
(0, class_validator_1.IsArray)(),
|
|
92
92
|
(0, class_validator_1.IsEnum)(webhook_enum_1.WebhookSource, { each: true }),
|
|
93
93
|
__metadata("design:type", Array)
|
|
94
|
-
],
|
|
94
|
+
], CreateWebhookDTO.prototype, "inboundAllowedSources", void 0);
|
|
95
95
|
__decorate([
|
|
96
96
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Secret for external source verification (e.g., Stripe signing secret)' }),
|
|
97
97
|
(0, class_validator_1.IsString)(),
|
|
98
98
|
(0, class_validator_1.IsOptional)(),
|
|
99
99
|
__metadata("design:type", String)
|
|
100
|
-
],
|
|
100
|
+
], CreateWebhookDTO.prototype, "inboundSecret", void 0);
|
|
101
101
|
__decorate([
|
|
102
102
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Request timeout in milliseconds', default: 30000, minimum: 1000, maximum: 120000 }),
|
|
103
103
|
(0, class_validator_1.IsNumber)(),
|
|
@@ -105,17 +105,17 @@ __decorate([
|
|
|
105
105
|
(0, class_validator_1.Max)(120000),
|
|
106
106
|
(0, class_validator_1.IsOptional)(),
|
|
107
107
|
__metadata("design:type", Number)
|
|
108
|
-
],
|
|
108
|
+
], CreateWebhookDTO.prototype, "timeoutMs", void 0);
|
|
109
109
|
/**
|
|
110
110
|
* DTO for updating a webhook (all fields optional)
|
|
111
111
|
*/
|
|
112
|
-
class
|
|
112
|
+
class UpdateWebhookDTO extends (0, swagger_1.PartialType)(CreateWebhookDTO) {
|
|
113
113
|
}
|
|
114
|
-
exports.
|
|
114
|
+
exports.UpdateWebhookDTO = UpdateWebhookDTO;
|
|
115
115
|
/**
|
|
116
116
|
* DTO for webhook list responses (hides sensitive fields)
|
|
117
117
|
*/
|
|
118
|
-
class
|
|
118
|
+
class WebhookDTO {
|
|
119
119
|
id;
|
|
120
120
|
name;
|
|
121
121
|
description;
|
|
@@ -131,70 +131,70 @@ class WebhookDto {
|
|
|
131
131
|
createdAt;
|
|
132
132
|
updatedAt;
|
|
133
133
|
}
|
|
134
|
-
exports.
|
|
134
|
+
exports.WebhookDTO = WebhookDTO;
|
|
135
135
|
__decorate([
|
|
136
136
|
(0, swagger_1.ApiProperty)({ description: 'Webhook ID' }),
|
|
137
137
|
__metadata("design:type", String)
|
|
138
|
-
],
|
|
138
|
+
], WebhookDTO.prototype, "id", void 0);
|
|
139
139
|
__decorate([
|
|
140
140
|
(0, swagger_1.ApiProperty)({ description: 'Human-readable name' }),
|
|
141
141
|
__metadata("design:type", String)
|
|
142
|
-
],
|
|
142
|
+
], WebhookDTO.prototype, "name", void 0);
|
|
143
143
|
__decorate([
|
|
144
144
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Optional description' }),
|
|
145
145
|
__metadata("design:type", Object)
|
|
146
|
-
],
|
|
146
|
+
], WebhookDTO.prototype, "description", void 0);
|
|
147
147
|
__decorate([
|
|
148
148
|
(0, swagger_1.ApiProperty)({ description: 'Target URL where requests are forwarded' }),
|
|
149
149
|
__metadata("design:type", String)
|
|
150
|
-
],
|
|
150
|
+
], WebhookDTO.prototype, "targetUrl", void 0);
|
|
151
151
|
__decorate([
|
|
152
152
|
(0, swagger_1.ApiProperty)({
|
|
153
153
|
description: 'Public URL to receive webhook requests (format: {baseUrl}/{apiVersion}/hooks/{projectKey}/{hookId})',
|
|
154
154
|
example: 'https://api.pers.ninja/v2/hooks/b3245237f5e658af.../550e8400-e29b-41d4-a716-446655440000'
|
|
155
155
|
}),
|
|
156
156
|
__metadata("design:type", String)
|
|
157
|
-
],
|
|
157
|
+
], WebhookDTO.prototype, "url", void 0);
|
|
158
158
|
__decorate([
|
|
159
159
|
(0, swagger_1.ApiProperty)({ description: 'Whether webhook is active' }),
|
|
160
160
|
__metadata("design:type", Boolean)
|
|
161
|
-
],
|
|
161
|
+
], WebhookDTO.prototype, "isActive", void 0);
|
|
162
162
|
__decorate([
|
|
163
163
|
(0, swagger_1.ApiProperty)({ description: 'Allowed HTTP methods', enum: webhook_enum_1.WebhookMethod, isArray: true }),
|
|
164
164
|
__metadata("design:type", Array)
|
|
165
|
-
],
|
|
165
|
+
], WebhookDTO.prototype, "allowedMethods", void 0);
|
|
166
166
|
__decorate([
|
|
167
167
|
(0, swagger_1.ApiProperty)({ description: 'Outbound authentication type', enum: webhook_enum_1.WebhookAuthType }),
|
|
168
168
|
__metadata("design:type", String)
|
|
169
|
-
],
|
|
169
|
+
], WebhookDTO.prototype, "outboundAuthType", void 0);
|
|
170
170
|
__decorate([
|
|
171
171
|
(0, swagger_1.ApiProperty)({ description: 'Whether outbound credentials are configured' }),
|
|
172
172
|
__metadata("design:type", Boolean)
|
|
173
|
-
],
|
|
173
|
+
], WebhookDTO.prototype, "hasOutboundCredentials", void 0);
|
|
174
174
|
__decorate([
|
|
175
175
|
(0, swagger_1.ApiProperty)({ description: 'Allowed inbound sources', enum: webhook_enum_1.WebhookSource, isArray: true }),
|
|
176
176
|
__metadata("design:type", Array)
|
|
177
|
-
],
|
|
177
|
+
], WebhookDTO.prototype, "inboundAllowedSources", void 0);
|
|
178
178
|
__decorate([
|
|
179
179
|
(0, swagger_1.ApiProperty)({ description: 'Whether inbound secret is configured' }),
|
|
180
180
|
__metadata("design:type", Boolean)
|
|
181
|
-
],
|
|
181
|
+
], WebhookDTO.prototype, "hasInboundSecret", void 0);
|
|
182
182
|
__decorate([
|
|
183
183
|
(0, swagger_1.ApiProperty)({ description: 'Request timeout in milliseconds' }),
|
|
184
184
|
__metadata("design:type", Number)
|
|
185
|
-
],
|
|
185
|
+
], WebhookDTO.prototype, "timeoutMs", void 0);
|
|
186
186
|
__decorate([
|
|
187
187
|
(0, swagger_1.ApiProperty)({ description: 'Creation timestamp' }),
|
|
188
188
|
__metadata("design:type", Date)
|
|
189
|
-
],
|
|
189
|
+
], WebhookDTO.prototype, "createdAt", void 0);
|
|
190
190
|
__decorate([
|
|
191
191
|
(0, swagger_1.ApiProperty)({ description: 'Last update timestamp' }),
|
|
192
192
|
__metadata("design:type", Date)
|
|
193
|
-
],
|
|
193
|
+
], WebhookDTO.prototype, "updatedAt", void 0);
|
|
194
194
|
/**
|
|
195
195
|
* DTO for webhook execution history
|
|
196
196
|
*/
|
|
197
|
-
class
|
|
197
|
+
class WebhookExecutionDTO {
|
|
198
198
|
id;
|
|
199
199
|
webhookId;
|
|
200
200
|
method;
|
|
@@ -211,72 +211,72 @@ class WebhookExecutionDto {
|
|
|
211
211
|
callbackResult;
|
|
212
212
|
callbackReceivedAt;
|
|
213
213
|
}
|
|
214
|
-
exports.
|
|
214
|
+
exports.WebhookExecutionDTO = WebhookExecutionDTO;
|
|
215
215
|
__decorate([
|
|
216
216
|
(0, swagger_1.ApiProperty)({ description: 'Execution ID' }),
|
|
217
217
|
__metadata("design:type", String)
|
|
218
|
-
],
|
|
218
|
+
], WebhookExecutionDTO.prototype, "id", void 0);
|
|
219
219
|
__decorate([
|
|
220
220
|
(0, swagger_1.ApiProperty)({ description: 'Webhook ID' }),
|
|
221
221
|
__metadata("design:type", String)
|
|
222
|
-
],
|
|
222
|
+
], WebhookExecutionDTO.prototype, "webhookId", void 0);
|
|
223
223
|
__decorate([
|
|
224
224
|
(0, swagger_1.ApiProperty)({ description: 'HTTP method', example: 'POST' }),
|
|
225
225
|
__metadata("design:type", String)
|
|
226
|
-
],
|
|
226
|
+
], WebhookExecutionDTO.prototype, "method", void 0);
|
|
227
227
|
__decorate([
|
|
228
228
|
(0, swagger_1.ApiProperty)({ description: 'Target URL at time of execution' }),
|
|
229
229
|
__metadata("design:type", String)
|
|
230
|
-
],
|
|
230
|
+
], WebhookExecutionDTO.prototype, "targetUrl", void 0);
|
|
231
231
|
__decorate([
|
|
232
232
|
(0, swagger_1.ApiProperty)({ description: 'Execution status', enum: webhook_enum_1.WebhookExecutionStatus }),
|
|
233
233
|
__metadata("design:type", String)
|
|
234
|
-
],
|
|
234
|
+
], WebhookExecutionDTO.prototype, "status", void 0);
|
|
235
235
|
__decorate([
|
|
236
236
|
(0, swagger_1.ApiPropertyOptional)({ description: 'HTTP response status code' }),
|
|
237
237
|
__metadata("design:type", Object)
|
|
238
|
-
],
|
|
238
|
+
], WebhookExecutionDTO.prototype, "responseStatusCode", void 0);
|
|
239
239
|
__decorate([
|
|
240
240
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Duration in milliseconds' }),
|
|
241
241
|
__metadata("design:type", Object)
|
|
242
|
-
],
|
|
242
|
+
], WebhookExecutionDTO.prototype, "durationMs", void 0);
|
|
243
243
|
__decorate([
|
|
244
244
|
(0, swagger_1.ApiProperty)({ description: 'Source IP of the request' }),
|
|
245
245
|
__metadata("design:type", String)
|
|
246
|
-
],
|
|
246
|
+
], WebhookExecutionDTO.prototype, "sourceIp", void 0);
|
|
247
247
|
__decorate([
|
|
248
248
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Error or status message' }),
|
|
249
249
|
__metadata("design:type", Object)
|
|
250
|
-
],
|
|
250
|
+
], WebhookExecutionDTO.prototype, "message", void 0);
|
|
251
251
|
__decorate([
|
|
252
252
|
(0, swagger_1.ApiProperty)({ description: 'When execution started' }),
|
|
253
253
|
__metadata("design:type", Date)
|
|
254
|
-
],
|
|
254
|
+
], WebhookExecutionDTO.prototype, "startedAt", void 0);
|
|
255
255
|
__decorate([
|
|
256
256
|
(0, swagger_1.ApiPropertyOptional)({ description: 'When execution completed' }),
|
|
257
257
|
__metadata("design:type", Object)
|
|
258
|
-
],
|
|
258
|
+
], WebhookExecutionDTO.prototype, "completedAt", void 0);
|
|
259
259
|
__decorate([
|
|
260
260
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Callback status from external workflow', enum: webhook_enum_1.WebhookCallbackStatus, default: webhook_enum_1.WebhookCallbackStatus.NONE }),
|
|
261
261
|
__metadata("design:type", String)
|
|
262
|
-
],
|
|
262
|
+
], WebhookExecutionDTO.prototype, "callbackStatus", void 0);
|
|
263
263
|
__decorate([
|
|
264
264
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Callback result data from external workflow' }),
|
|
265
265
|
__metadata("design:type", Object)
|
|
266
|
-
],
|
|
266
|
+
], WebhookExecutionDTO.prototype, "callbackResult", void 0);
|
|
267
267
|
__decorate([
|
|
268
268
|
(0, swagger_1.ApiPropertyOptional)({ description: 'When callback was received' }),
|
|
269
269
|
__metadata("design:type", Object)
|
|
270
|
-
],
|
|
270
|
+
], WebhookExecutionDTO.prototype, "callbackReceivedAt", void 0);
|
|
271
271
|
/**
|
|
272
272
|
* DTO for webhook callback requests from external systems (e.g., n8n workflow completion)
|
|
273
273
|
*/
|
|
274
|
-
class
|
|
274
|
+
class WebhookCallbackDTO {
|
|
275
275
|
status;
|
|
276
276
|
result;
|
|
277
277
|
error;
|
|
278
278
|
}
|
|
279
|
-
exports.
|
|
279
|
+
exports.WebhookCallbackDTO = WebhookCallbackDTO;
|
|
280
280
|
__decorate([
|
|
281
281
|
(0, swagger_1.ApiProperty)({
|
|
282
282
|
description: 'Callback status from external workflow',
|
|
@@ -285,17 +285,17 @@ __decorate([
|
|
|
285
285
|
}),
|
|
286
286
|
(0, class_validator_1.IsEnum)(webhook_enum_1.WebhookCallbackStatus),
|
|
287
287
|
__metadata("design:type", String)
|
|
288
|
-
],
|
|
288
|
+
], WebhookCallbackDTO.prototype, "status", void 0);
|
|
289
289
|
__decorate([
|
|
290
290
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Result data from external workflow' }),
|
|
291
291
|
(0, class_validator_1.IsObject)(),
|
|
292
292
|
(0, class_validator_1.IsOptional)(),
|
|
293
293
|
__metadata("design:type", Object)
|
|
294
|
-
],
|
|
294
|
+
], WebhookCallbackDTO.prototype, "result", void 0);
|
|
295
295
|
__decorate([
|
|
296
296
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Error message if workflow failed' }),
|
|
297
297
|
(0, class_validator_1.IsString)(),
|
|
298
298
|
(0, class_validator_1.IsOptional)(),
|
|
299
299
|
__metadata("design:type", String)
|
|
300
|
-
],
|
|
300
|
+
], WebhookCallbackDTO.prototype, "error", void 0);
|
|
301
301
|
//# sourceMappingURL=webhook.dto.js.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Entity Types
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for entity type identifiers used across the system.
|
|
5
|
+
* Other type consts (ErrorDomains, AuditEntityTypes) extend from this base.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EntityTypes: {
|
|
8
|
+
readonly USER: "user";
|
|
9
|
+
readonly ADMIN: "admin";
|
|
10
|
+
readonly TENANT: "tenant";
|
|
11
|
+
readonly TOKEN: "token";
|
|
12
|
+
readonly TOKEN_METADATA: "token_metadata";
|
|
13
|
+
readonly TOKEN_TYPE: "token_type";
|
|
14
|
+
readonly WALLET: "wallet";
|
|
15
|
+
readonly BALANCE: "balance";
|
|
16
|
+
readonly TRANSACTION: "transaction";
|
|
17
|
+
readonly PURCHASE: "purchase";
|
|
18
|
+
readonly BUSINESS: "business";
|
|
19
|
+
readonly BUSINESS_TYPE: "business_type";
|
|
20
|
+
readonly CAMPAIGN: "campaign";
|
|
21
|
+
readonly CAMPAIGN_TRIGGER: "campaign_trigger";
|
|
22
|
+
readonly REDEMPTION: "redemption";
|
|
23
|
+
readonly REDEMPTION_TYPE: "redemption_type";
|
|
24
|
+
readonly CONTRACT: "contract";
|
|
25
|
+
readonly SIGNING_ACCOUNT: "signing_account";
|
|
26
|
+
readonly API_KEY: "api_key";
|
|
27
|
+
readonly WEBHOOK: "webhook";
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Type-safe union of all entity types
|
|
31
|
+
*/
|
|
32
|
+
export type EntityType = typeof EntityTypes[keyof typeof EntityTypes];
|
|
33
|
+
/**
|
|
34
|
+
* Error-specific domains (extends EntityTypes)
|
|
35
|
+
*
|
|
36
|
+
* Includes entity types plus error-specific classification domains.
|
|
37
|
+
*/
|
|
38
|
+
export declare const ErrorDomains: {
|
|
39
|
+
readonly VALIDATION: "validation";
|
|
40
|
+
readonly SYSTEM: "system";
|
|
41
|
+
readonly AUTHENTICATION: "authentication";
|
|
42
|
+
readonly EXTERNAL: "external";
|
|
43
|
+
readonly USER: "user";
|
|
44
|
+
readonly ADMIN: "admin";
|
|
45
|
+
readonly TENANT: "tenant";
|
|
46
|
+
readonly TOKEN: "token";
|
|
47
|
+
readonly TOKEN_METADATA: "token_metadata";
|
|
48
|
+
readonly TOKEN_TYPE: "token_type";
|
|
49
|
+
readonly WALLET: "wallet";
|
|
50
|
+
readonly BALANCE: "balance";
|
|
51
|
+
readonly TRANSACTION: "transaction";
|
|
52
|
+
readonly PURCHASE: "purchase";
|
|
53
|
+
readonly BUSINESS: "business";
|
|
54
|
+
readonly BUSINESS_TYPE: "business_type";
|
|
55
|
+
readonly CAMPAIGN: "campaign";
|
|
56
|
+
readonly CAMPAIGN_TRIGGER: "campaign_trigger";
|
|
57
|
+
readonly REDEMPTION: "redemption";
|
|
58
|
+
readonly REDEMPTION_TYPE: "redemption_type";
|
|
59
|
+
readonly CONTRACT: "contract";
|
|
60
|
+
readonly SIGNING_ACCOUNT: "signing_account";
|
|
61
|
+
readonly API_KEY: "api_key";
|
|
62
|
+
readonly WEBHOOK: "webhook";
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Type-safe union of all error domains
|
|
66
|
+
*/
|
|
67
|
+
export type ErrorDomain = typeof ErrorDomains[keyof typeof ErrorDomains];
|
|
68
|
+
/**
|
|
69
|
+
* Auditable Entity Types (extends EntityTypes)
|
|
70
|
+
*
|
|
71
|
+
* All entities that can be audited. Currently same as EntityTypes,
|
|
72
|
+
* but can be extended with audit-specific entities if needed.
|
|
73
|
+
*/
|
|
74
|
+
export declare const AuditEntityTypes: {
|
|
75
|
+
readonly USER: "user";
|
|
76
|
+
readonly ADMIN: "admin";
|
|
77
|
+
readonly TENANT: "tenant";
|
|
78
|
+
readonly TOKEN: "token";
|
|
79
|
+
readonly TOKEN_METADATA: "token_metadata";
|
|
80
|
+
readonly TOKEN_TYPE: "token_type";
|
|
81
|
+
readonly WALLET: "wallet";
|
|
82
|
+
readonly BALANCE: "balance";
|
|
83
|
+
readonly TRANSACTION: "transaction";
|
|
84
|
+
readonly PURCHASE: "purchase";
|
|
85
|
+
readonly BUSINESS: "business";
|
|
86
|
+
readonly BUSINESS_TYPE: "business_type";
|
|
87
|
+
readonly CAMPAIGN: "campaign";
|
|
88
|
+
readonly CAMPAIGN_TRIGGER: "campaign_trigger";
|
|
89
|
+
readonly REDEMPTION: "redemption";
|
|
90
|
+
readonly REDEMPTION_TYPE: "redemption_type";
|
|
91
|
+
readonly CONTRACT: "contract";
|
|
92
|
+
readonly SIGNING_ACCOUNT: "signing_account";
|
|
93
|
+
readonly API_KEY: "api_key";
|
|
94
|
+
readonly WEBHOOK: "webhook";
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Type-safe union of all auditable entity types
|
|
98
|
+
*/
|
|
99
|
+
export type AuditEntityType = typeof AuditEntityTypes[keyof typeof AuditEntityTypes];
|
|
100
|
+
//# sourceMappingURL=entity-types.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-types.enum.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/enum/entity-types.enum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;CAkCd,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;CAOf,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CAEnB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC"}
|