@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
|
@@ -12,7 +12,7 @@ export { WebhookAuthType, WebhookMethod, WebhookSource, WebhookExecutionStatus,
|
|
|
12
12
|
/**
|
|
13
13
|
* DTO for creating a webhook
|
|
14
14
|
*/
|
|
15
|
-
export class
|
|
15
|
+
export class CreateWebhookDTO {
|
|
16
16
|
name;
|
|
17
17
|
description;
|
|
18
18
|
targetUrl;
|
|
@@ -27,21 +27,21 @@ export class CreateWebhookDto {
|
|
|
27
27
|
__decorate([
|
|
28
28
|
ApiProperty({ description: 'Human-readable name for this webhook', example: 'Stripe Payment Webhook' }),
|
|
29
29
|
IsString()
|
|
30
|
-
],
|
|
30
|
+
], CreateWebhookDTO.prototype, "name", void 0);
|
|
31
31
|
__decorate([
|
|
32
32
|
ApiPropertyOptional({ description: 'Optional description', example: 'Handles payment confirmations from Stripe' }),
|
|
33
33
|
IsString(),
|
|
34
34
|
IsOptional()
|
|
35
|
-
],
|
|
35
|
+
], CreateWebhookDTO.prototype, "description", void 0);
|
|
36
36
|
__decorate([
|
|
37
37
|
ApiProperty({ description: 'Target URL where requests will be forwarded', example: 'https://internal-api.example.com/payments/webhook' }),
|
|
38
38
|
IsUrl()
|
|
39
|
-
],
|
|
39
|
+
], CreateWebhookDTO.prototype, "targetUrl", void 0);
|
|
40
40
|
__decorate([
|
|
41
41
|
ApiPropertyOptional({ description: 'Whether webhook is active', default: true }),
|
|
42
42
|
IsBoolean(),
|
|
43
43
|
IsOptional()
|
|
44
|
-
],
|
|
44
|
+
], CreateWebhookDTO.prototype, "isActive", void 0);
|
|
45
45
|
__decorate([
|
|
46
46
|
ApiPropertyOptional({
|
|
47
47
|
description: 'Allowed HTTP methods (defaults to POST only)',
|
|
@@ -53,17 +53,17 @@ __decorate([
|
|
|
53
53
|
IsArray(),
|
|
54
54
|
IsEnum(WebhookMethod, { each: true }),
|
|
55
55
|
IsOptional()
|
|
56
|
-
],
|
|
56
|
+
], CreateWebhookDTO.prototype, "allowedMethods", void 0);
|
|
57
57
|
__decorate([
|
|
58
58
|
ApiPropertyOptional({ description: 'Outbound authentication type', enum: WebhookAuthType, default: WebhookAuthType.NONE }),
|
|
59
59
|
IsEnum(WebhookAuthType),
|
|
60
60
|
IsOptional()
|
|
61
|
-
],
|
|
61
|
+
], CreateWebhookDTO.prototype, "outboundAuthType", void 0);
|
|
62
62
|
__decorate([
|
|
63
63
|
ApiPropertyOptional({ description: 'Outbound authentication credentials (Bearer token)' }),
|
|
64
64
|
IsString(),
|
|
65
65
|
IsOptional()
|
|
66
|
-
],
|
|
66
|
+
], CreateWebhookDTO.prototype, "outboundAuthCredentials", void 0);
|
|
67
67
|
__decorate([
|
|
68
68
|
ApiProperty({
|
|
69
69
|
description: 'Allowed inbound sources',
|
|
@@ -73,28 +73,28 @@ __decorate([
|
|
|
73
73
|
}),
|
|
74
74
|
IsArray(),
|
|
75
75
|
IsEnum(WebhookSource, { each: true })
|
|
76
|
-
],
|
|
76
|
+
], CreateWebhookDTO.prototype, "inboundAllowedSources", void 0);
|
|
77
77
|
__decorate([
|
|
78
78
|
ApiPropertyOptional({ description: 'Secret for external source verification (e.g., Stripe signing secret)' }),
|
|
79
79
|
IsString(),
|
|
80
80
|
IsOptional()
|
|
81
|
-
],
|
|
81
|
+
], CreateWebhookDTO.prototype, "inboundSecret", void 0);
|
|
82
82
|
__decorate([
|
|
83
83
|
ApiPropertyOptional({ description: 'Request timeout in milliseconds', default: 30000, minimum: 1000, maximum: 120000 }),
|
|
84
84
|
IsNumber(),
|
|
85
85
|
Min(1000),
|
|
86
86
|
Max(120000),
|
|
87
87
|
IsOptional()
|
|
88
|
-
],
|
|
88
|
+
], CreateWebhookDTO.prototype, "timeoutMs", void 0);
|
|
89
89
|
/**
|
|
90
90
|
* DTO for updating a webhook (all fields optional)
|
|
91
91
|
*/
|
|
92
|
-
export class
|
|
92
|
+
export class UpdateWebhookDTO extends PartialType(CreateWebhookDTO) {
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* DTO for webhook list responses (hides sensitive fields)
|
|
96
96
|
*/
|
|
97
|
-
export class
|
|
97
|
+
export class WebhookDTO {
|
|
98
98
|
id;
|
|
99
99
|
name;
|
|
100
100
|
description;
|
|
@@ -112,53 +112,53 @@ export class WebhookDto {
|
|
|
112
112
|
}
|
|
113
113
|
__decorate([
|
|
114
114
|
ApiProperty({ description: 'Webhook ID' })
|
|
115
|
-
],
|
|
115
|
+
], WebhookDTO.prototype, "id", void 0);
|
|
116
116
|
__decorate([
|
|
117
117
|
ApiProperty({ description: 'Human-readable name' })
|
|
118
|
-
],
|
|
118
|
+
], WebhookDTO.prototype, "name", void 0);
|
|
119
119
|
__decorate([
|
|
120
120
|
ApiPropertyOptional({ description: 'Optional description' })
|
|
121
|
-
],
|
|
121
|
+
], WebhookDTO.prototype, "description", void 0);
|
|
122
122
|
__decorate([
|
|
123
123
|
ApiProperty({ description: 'Target URL where requests are forwarded' })
|
|
124
|
-
],
|
|
124
|
+
], WebhookDTO.prototype, "targetUrl", void 0);
|
|
125
125
|
__decorate([
|
|
126
126
|
ApiProperty({
|
|
127
127
|
description: 'Public URL to receive webhook requests (format: {baseUrl}/{apiVersion}/hooks/{projectKey}/{hookId})',
|
|
128
128
|
example: 'https://api.pers.ninja/v2/hooks/b3245237f5e658af.../550e8400-e29b-41d4-a716-446655440000'
|
|
129
129
|
})
|
|
130
|
-
],
|
|
130
|
+
], WebhookDTO.prototype, "url", void 0);
|
|
131
131
|
__decorate([
|
|
132
132
|
ApiProperty({ description: 'Whether webhook is active' })
|
|
133
|
-
],
|
|
133
|
+
], WebhookDTO.prototype, "isActive", void 0);
|
|
134
134
|
__decorate([
|
|
135
135
|
ApiProperty({ description: 'Allowed HTTP methods', enum: WebhookMethod, isArray: true })
|
|
136
|
-
],
|
|
136
|
+
], WebhookDTO.prototype, "allowedMethods", void 0);
|
|
137
137
|
__decorate([
|
|
138
138
|
ApiProperty({ description: 'Outbound authentication type', enum: WebhookAuthType })
|
|
139
|
-
],
|
|
139
|
+
], WebhookDTO.prototype, "outboundAuthType", void 0);
|
|
140
140
|
__decorate([
|
|
141
141
|
ApiProperty({ description: 'Whether outbound credentials are configured' })
|
|
142
|
-
],
|
|
142
|
+
], WebhookDTO.prototype, "hasOutboundCredentials", void 0);
|
|
143
143
|
__decorate([
|
|
144
144
|
ApiProperty({ description: 'Allowed inbound sources', enum: WebhookSource, isArray: true })
|
|
145
|
-
],
|
|
145
|
+
], WebhookDTO.prototype, "inboundAllowedSources", void 0);
|
|
146
146
|
__decorate([
|
|
147
147
|
ApiProperty({ description: 'Whether inbound secret is configured' })
|
|
148
|
-
],
|
|
148
|
+
], WebhookDTO.prototype, "hasInboundSecret", void 0);
|
|
149
149
|
__decorate([
|
|
150
150
|
ApiProperty({ description: 'Request timeout in milliseconds' })
|
|
151
|
-
],
|
|
151
|
+
], WebhookDTO.prototype, "timeoutMs", void 0);
|
|
152
152
|
__decorate([
|
|
153
153
|
ApiProperty({ description: 'Creation timestamp' })
|
|
154
|
-
],
|
|
154
|
+
], WebhookDTO.prototype, "createdAt", void 0);
|
|
155
155
|
__decorate([
|
|
156
156
|
ApiProperty({ description: 'Last update timestamp' })
|
|
157
|
-
],
|
|
157
|
+
], WebhookDTO.prototype, "updatedAt", void 0);
|
|
158
158
|
/**
|
|
159
159
|
* DTO for webhook execution history
|
|
160
160
|
*/
|
|
161
|
-
export class
|
|
161
|
+
export class WebhookExecutionDTO {
|
|
162
162
|
id;
|
|
163
163
|
webhookId;
|
|
164
164
|
method;
|
|
@@ -177,50 +177,50 @@ export class WebhookExecutionDto {
|
|
|
177
177
|
}
|
|
178
178
|
__decorate([
|
|
179
179
|
ApiProperty({ description: 'Execution ID' })
|
|
180
|
-
],
|
|
180
|
+
], WebhookExecutionDTO.prototype, "id", void 0);
|
|
181
181
|
__decorate([
|
|
182
182
|
ApiProperty({ description: 'Webhook ID' })
|
|
183
|
-
],
|
|
183
|
+
], WebhookExecutionDTO.prototype, "webhookId", void 0);
|
|
184
184
|
__decorate([
|
|
185
185
|
ApiProperty({ description: 'HTTP method', example: 'POST' })
|
|
186
|
-
],
|
|
186
|
+
], WebhookExecutionDTO.prototype, "method", void 0);
|
|
187
187
|
__decorate([
|
|
188
188
|
ApiProperty({ description: 'Target URL at time of execution' })
|
|
189
|
-
],
|
|
189
|
+
], WebhookExecutionDTO.prototype, "targetUrl", void 0);
|
|
190
190
|
__decorate([
|
|
191
191
|
ApiProperty({ description: 'Execution status', enum: WebhookExecutionStatus })
|
|
192
|
-
],
|
|
192
|
+
], WebhookExecutionDTO.prototype, "status", void 0);
|
|
193
193
|
__decorate([
|
|
194
194
|
ApiPropertyOptional({ description: 'HTTP response status code' })
|
|
195
|
-
],
|
|
195
|
+
], WebhookExecutionDTO.prototype, "responseStatusCode", void 0);
|
|
196
196
|
__decorate([
|
|
197
197
|
ApiPropertyOptional({ description: 'Duration in milliseconds' })
|
|
198
|
-
],
|
|
198
|
+
], WebhookExecutionDTO.prototype, "durationMs", void 0);
|
|
199
199
|
__decorate([
|
|
200
200
|
ApiProperty({ description: 'Source IP of the request' })
|
|
201
|
-
],
|
|
201
|
+
], WebhookExecutionDTO.prototype, "sourceIp", void 0);
|
|
202
202
|
__decorate([
|
|
203
203
|
ApiPropertyOptional({ description: 'Error or status message' })
|
|
204
|
-
],
|
|
204
|
+
], WebhookExecutionDTO.prototype, "message", void 0);
|
|
205
205
|
__decorate([
|
|
206
206
|
ApiProperty({ description: 'When execution started' })
|
|
207
|
-
],
|
|
207
|
+
], WebhookExecutionDTO.prototype, "startedAt", void 0);
|
|
208
208
|
__decorate([
|
|
209
209
|
ApiPropertyOptional({ description: 'When execution completed' })
|
|
210
|
-
],
|
|
210
|
+
], WebhookExecutionDTO.prototype, "completedAt", void 0);
|
|
211
211
|
__decorate([
|
|
212
212
|
ApiPropertyOptional({ description: 'Callback status from external workflow', enum: WebhookCallbackStatus, default: WebhookCallbackStatus.NONE })
|
|
213
|
-
],
|
|
213
|
+
], WebhookExecutionDTO.prototype, "callbackStatus", void 0);
|
|
214
214
|
__decorate([
|
|
215
215
|
ApiPropertyOptional({ description: 'Callback result data from external workflow' })
|
|
216
|
-
],
|
|
216
|
+
], WebhookExecutionDTO.prototype, "callbackResult", void 0);
|
|
217
217
|
__decorate([
|
|
218
218
|
ApiPropertyOptional({ description: 'When callback was received' })
|
|
219
|
-
],
|
|
219
|
+
], WebhookExecutionDTO.prototype, "callbackReceivedAt", void 0);
|
|
220
220
|
/**
|
|
221
221
|
* DTO for webhook callback requests from external systems (e.g., n8n workflow completion)
|
|
222
222
|
*/
|
|
223
|
-
export class
|
|
223
|
+
export class WebhookCallbackDTO {
|
|
224
224
|
status;
|
|
225
225
|
result;
|
|
226
226
|
error;
|
|
@@ -232,15 +232,15 @@ __decorate([
|
|
|
232
232
|
example: WebhookCallbackStatus.SUCCESS
|
|
233
233
|
}),
|
|
234
234
|
IsEnum(WebhookCallbackStatus)
|
|
235
|
-
],
|
|
235
|
+
], WebhookCallbackDTO.prototype, "status", void 0);
|
|
236
236
|
__decorate([
|
|
237
237
|
ApiPropertyOptional({ description: 'Result data from external workflow' }),
|
|
238
238
|
IsObject(),
|
|
239
239
|
IsOptional()
|
|
240
|
-
],
|
|
240
|
+
], WebhookCallbackDTO.prototype, "result", void 0);
|
|
241
241
|
__decorate([
|
|
242
242
|
ApiPropertyOptional({ description: 'Error message if workflow failed' }),
|
|
243
243
|
IsString(),
|
|
244
244
|
IsOptional()
|
|
245
|
-
],
|
|
245
|
+
], WebhookCallbackDTO.prototype, "error", void 0);
|
|
246
246
|
//# 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"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 const EntityTypes = {
|
|
8
|
+
// Core entities
|
|
9
|
+
USER: 'user',
|
|
10
|
+
ADMIN: 'admin',
|
|
11
|
+
TENANT: 'tenant',
|
|
12
|
+
// Token entities
|
|
13
|
+
TOKEN: 'token',
|
|
14
|
+
TOKEN_METADATA: 'token_metadata',
|
|
15
|
+
TOKEN_TYPE: 'token_type',
|
|
16
|
+
// Financial entities
|
|
17
|
+
WALLET: 'wallet',
|
|
18
|
+
BALANCE: 'balance',
|
|
19
|
+
TRANSACTION: 'transaction',
|
|
20
|
+
PURCHASE: 'purchase',
|
|
21
|
+
// Business entities
|
|
22
|
+
BUSINESS: 'business',
|
|
23
|
+
BUSINESS_TYPE: 'business_type',
|
|
24
|
+
// Campaign entities
|
|
25
|
+
CAMPAIGN: 'campaign',
|
|
26
|
+
CAMPAIGN_TRIGGER: 'campaign_trigger',
|
|
27
|
+
// Redemption entities
|
|
28
|
+
REDEMPTION: 'redemption',
|
|
29
|
+
REDEMPTION_TYPE: 'redemption_type',
|
|
30
|
+
// Infrastructure entities
|
|
31
|
+
CONTRACT: 'contract',
|
|
32
|
+
SIGNING_ACCOUNT: 'signing_account',
|
|
33
|
+
API_KEY: 'api_key',
|
|
34
|
+
WEBHOOK: 'webhook',
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Error-specific domains (extends EntityTypes)
|
|
38
|
+
*
|
|
39
|
+
* Includes entity types plus error-specific classification domains.
|
|
40
|
+
*/
|
|
41
|
+
export const ErrorDomains = {
|
|
42
|
+
...EntityTypes,
|
|
43
|
+
// Error-specific domains (not entities, but error classifications)
|
|
44
|
+
VALIDATION: 'validation',
|
|
45
|
+
SYSTEM: 'system',
|
|
46
|
+
AUTHENTICATION: 'authentication',
|
|
47
|
+
EXTERNAL: 'external',
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Auditable Entity Types (extends EntityTypes)
|
|
51
|
+
*
|
|
52
|
+
* All entities that can be audited. Currently same as EntityTypes,
|
|
53
|
+
* but can be extended with audit-specific entities if needed.
|
|
54
|
+
*/
|
|
55
|
+
export const AuditEntityTypes = {
|
|
56
|
+
...EntityTypes,
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=entity-types.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-types.enum.js","sourceRoot":"","sources":["../../../../src/shared-lib/enum/entity-types.enum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,gBAAgB;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAEhB,iBAAiB;IACjB,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;IAChC,UAAU,EAAE,YAAY;IAExB,qBAAqB;IACrB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;IAEpB,oBAAoB;IACpB,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,eAAe;IAE9B,oBAAoB;IACpB,QAAQ,EAAE,UAAU;IACpB,gBAAgB,EAAE,kBAAkB;IAEpC,sBAAsB;IACtB,UAAU,EAAE,YAAY;IACxB,eAAe,EAAE,iBAAiB;IAElC,0BAA0B;IAC1B,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,iBAAiB;IAClC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACV,CAAC;AAOX;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,WAAW;IACd,mEAAmE;IACnE,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,cAAc,EAAE,gBAAgB;IAChC,QAAQ,EAAE,UAAU;CACZ,CAAC;AAOX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,WAAW;CACN,CAAC"}
|
|
@@ -26,5 +26,6 @@ export * from './ai-operation-type.enum';
|
|
|
26
26
|
export * from './ai-trigger-process-type.enum';
|
|
27
27
|
export * from './ai-analytics-metric.enum';
|
|
28
28
|
export * from './webhook.enum';
|
|
29
|
+
export * from './entity-types.enum';
|
|
29
30
|
export { ErrorCategory } from '../errors/base/error-classification-enums';
|
|
30
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/enum/index.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,YAAY,CAAC;AAE3B,cAAc,YAAY,CAAC;AAE3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/enum/index.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,YAAY,CAAC;AAE3B,cAAc,YAAY,CAAC;AAE3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gBAAgB,CAAC;AAG/B,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -28,6 +28,8 @@ export * from './ai-trigger-process-type.enum.js';
|
|
|
28
28
|
export * from './ai-analytics-metric.enum.js';
|
|
29
29
|
// Webhook enums
|
|
30
30
|
export * from './webhook.enum.js';
|
|
31
|
+
// Entity type system (base + domain-specific extensions)
|
|
32
|
+
export * from './entity-types.enum.js';
|
|
31
33
|
// Error classification enum
|
|
32
34
|
export { ErrorCategory } from '../errors/base/error-classification-enums.js';
|
|
33
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared-lib/enum/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAA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+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,YAAY,CAAC;AAE3B,cAAc,YAAY,CAAC;AAE3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAE3C,gBAAgB;AAChB,cAAc,gBAAgB,CAAC;AAE/B,yDAAyD;AACzD,cAAc,qBAAqB,CAAC;AAEpC,4BAA4B;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -86,30 +86,6 @@ export declare const CommonErrorCodes: {
|
|
|
86
86
|
* but with better performance through the object pattern.
|
|
87
87
|
*/
|
|
88
88
|
export type CommonErrorCode = typeof CommonErrorCodes[keyof typeof CommonErrorCodes];
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
*
|
|
92
|
-
* Centralized domain strings to ensure consistency across all error classes
|
|
93
|
-
* and prevent typos in domain names.
|
|
94
|
-
*/
|
|
95
|
-
export declare const ErrorDomains: {
|
|
96
|
-
readonly USER: "user";
|
|
97
|
-
readonly TOKEN: "token";
|
|
98
|
-
readonly WALLET: "wallet";
|
|
99
|
-
readonly BUSINESS: "business";
|
|
100
|
-
readonly BALANCE: "balance";
|
|
101
|
-
readonly CONTRACT: "contract";
|
|
102
|
-
readonly TRANSACTION: "transaction";
|
|
103
|
-
readonly VALIDATION: "validation";
|
|
104
|
-
readonly SYSTEM: "system";
|
|
105
|
-
readonly CAMPAIGN: "campaign";
|
|
106
|
-
readonly AUTHENTICATION: "authentication";
|
|
107
|
-
readonly EXTERNAL: "external";
|
|
108
|
-
readonly TENANT: "tenant";
|
|
109
|
-
readonly WEBHOOK: "webhook";
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Type-safe union of all domain names
|
|
113
|
-
*/
|
|
114
|
-
export type ErrorDomain = typeof ErrorDomains[keyof typeof ErrorDomains];
|
|
89
|
+
export { ErrorDomains } from '../enum/entity-types.enum';
|
|
90
|
+
export type { ErrorDomain } from '../enum/entity-types.enum';
|
|
115
91
|
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/errors/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyGnB,CAAC;AAEX;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/errors/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyGnB,CAAC;AAEX;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAGrF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -98,26 +98,6 @@ export const CommonErrorCodes = {
|
|
|
98
98
|
REQUEST_TIMEOUT: 'REQUEST_TIMEOUT',
|
|
99
99
|
GATEWAY_TIMEOUT: 'GATEWAY_TIMEOUT'
|
|
100
100
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
*
|
|
104
|
-
* Centralized domain strings to ensure consistency across all error classes
|
|
105
|
-
* and prevent typos in domain names.
|
|
106
|
-
*/
|
|
107
|
-
export const ErrorDomains = {
|
|
108
|
-
USER: 'user',
|
|
109
|
-
TOKEN: 'token',
|
|
110
|
-
WALLET: 'wallet',
|
|
111
|
-
BUSINESS: 'business',
|
|
112
|
-
BALANCE: 'balance',
|
|
113
|
-
CONTRACT: 'contract',
|
|
114
|
-
TRANSACTION: 'transaction',
|
|
115
|
-
VALIDATION: 'validation',
|
|
116
|
-
SYSTEM: 'system',
|
|
117
|
-
CAMPAIGN: 'campaign',
|
|
118
|
-
AUTHENTICATION: 'authentication',
|
|
119
|
-
EXTERNAL: 'external',
|
|
120
|
-
TENANT: 'tenant',
|
|
121
|
-
WEBHOOK: 'webhook'
|
|
122
|
-
};
|
|
101
|
+
// Re-export ErrorDomains from centralized entity types
|
|
102
|
+
export { ErrorDomains } from '../enum/entity-types.enum.js';
|
|
123
103
|
//# sourceMappingURL=error-codes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../../../src/shared-lib/errors/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,cAAc;IACd,cAAc,EAAE,gBAAgB;IAChC,mBAAmB,EAAE,qBAAqB;IAC1C,mBAAmB,EAAE,qBAAqB;IAE1C,eAAe;IACf,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,iBAAiB,EAAE,mBAAmB;IACtC,oBAAoB,EAAE,sBAAsB;IAE5C,gBAAgB;IAChB,sBAAsB,EAAE,wBAAwB;IAChD,gBAAgB,EAAE,kBAAkB;IACpC,8BAA8B,EAAE,gCAAgC;IAEhE,iBAAiB;IACjB,oBAAoB,EAAE,sBAAsB;IAE5C,kBAAkB;IAClB,kBAAkB,EAAE,oBAA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ACjC,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,mBAAmB,EAAE,qBAAqB;IAE1C,oBAAoB;IACpB,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,uBAAuB,EAAE,yBAAyB;IAClD,kBAAkB,EAAE,oBAAoB;IAExC,iBAAiB;IACjB,iBAAiB,EAAE,mBAAmB;IACtC,gBAAgB,EAAE,kBAAkB;IACpC,0BAA0B,EAAE,4BAA4B;IACxD,yBAAyB,EAAE,2BAA2B;IACtD,sBAAsB,EAAE,wBAAwB;IAChD,eAAe,EAAE,iBAAiB;IAElC,wBAAwB;IACxB,iBAAiB,EAAE,mBAAmB;IACtC,uBAAuB,EAAE,yBAAyB;IAElD,uBAAuB;IACvB,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;CAC1B,CAAC;AAUX
|
|
1
|
+
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../../../src/shared-lib/errors/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,cAAc;IACd,cAAc,EAAE,gBAAgB;IAChC,mBAAmB,EAAE,qBAAqB;IAC1C,mBAAmB,EAAE,qBAAqB;IAE1C,eAAe;IACf,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,iBAAiB,EAAE,mBAAmB;IACtC,oBAAoB,EAAE,sBAAsB;IAE5C,gBAAgB;IAChB,sBAAsB,EAAE,wBAAwB;IAChD,gBAAgB,EAAE,kBAAkB;IACpC,8BAA8B,EAAE,gCAAgC;IAEhE,iBAAiB;IACjB,oBAAoB,EAAE,sBAAsB;IAE5C,kBAAkB;IAClB,kBAAkB,EAAE,oBAAoB;IAExC,kBAAkB;IAClB,kBAAkB,EAAE,oBAAoB;IACxC,mBAAmB,EAAE,qBAAqB;IAE1C,oBAAoB;I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E,qBAAqB;IAE1C,oBAAoB;IACpB,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,uBAAuB,EAAE,yBAAyB;IAClD,kBAAkB,EAAE,oBAAoB;IAExC,iBAAiB;IACjB,iBAAiB,EAAE,mBAAmB;IACtC,gBAAgB,EAAE,kBAAkB;IACpC,0BAA0B,EAAE,4BAA4B;IACxD,yBAAyB,EAAE,2BAA2B;IACtD,sBAAsB,EAAE,wBAAwB;IAChD,eAAe,EAAE,iBAAiB;IAElC,wBAAwB;IACxB,iBAAiB,EAAE,mBAAmB;IACtC,uBAAuB,EAAE,yBAAyB;IAElD,uBAAuB;IACvB,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;CAC1B,CAAC;AAUX,uDAAuD;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-balance.value-object.js","sourceRoot":"","sources":["../../../../src/shared-lib/value-objects/token-balance.value-object.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"token-balance.value-object.js","sourceRoot":"","sources":["../../../../src/shared-lib/value-objects/token-balance.value-object.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAE1F;;GAEG;AACH,MAAM,OAAO,YAAY;IACJ,OAAO,CAAS;IAChB,oBAAoB,CAAU;IAC9B,OAAO,CAAgB;IACvB,WAAW,CAAgB;IAC3B,OAAO,CAAS;IAChB,SAAS,CAAS;IAClB,WAAW,CAAS;IACpB,SAAS,CAAkB;IAC3B,UAAU,CAAc;IAEzC;;;;;;;;;;;;OAYG;IACH,YACI,OAAe,EACf,oBAA6B,EAC7B,UAAyB,IAAI,EAC7B,cAA6B,IAAI,EACjC,OAAe,EACf,SAAiB,EACjB,WAAmB,EACnB,SAA0B,EAAE,wDAAwD;IAC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A2B,IAAI,CAAC,OAAO,oBAAoB,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,cAAc,IAAI,CAAC,OAAO,cAAc,IAAI,CAAC,OAAO,gBAAgB,IAAI,CAAC,SAAS,kBAAkB,IAAI,CAAC,WAAW,gBAAgB,IAAI,CAAC,SAAS,GAAG,CAAC;IAChQ,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,KAAmB;QAC7B,OAAO,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,UAAU,EAAE;YACtC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,EAAE,CAAC;YACjE,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,UAAU,EAAE;YACnC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,UAAU,EAAE;YACnC,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,YAAY,EAAE;YACvC,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,cAAc,EAAE;YAC3C,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;CACJ"}
|
package/dist/esm/shared-patterns/functions/{helper.functions.d.ts → token-metadata.functions.d.ts}
RENAMED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Metadata Functions
|
|
3
|
+
*
|
|
4
|
+
* Utilities for working with NFT/blockchain token metadata,
|
|
5
|
+
* validity computation, and attribute extraction.
|
|
6
|
+
*/
|
|
1
7
|
import { type TokenValidityType } from '../../shared-lib/enum/token-validity-type.enum';
|
|
2
8
|
import { TokenStorageData } from '../../shared-lib/interfaces/token-storage-data.interface';
|
|
3
9
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
* Checks if a token ID is a URI (IPFS or HTTP).
|
|
11
|
+
* Used for determining how to resolve token metadata.
|
|
12
|
+
*
|
|
13
|
+
* @param tokenId - The token ID to check
|
|
14
|
+
* @returns true if the tokenId is a valid URI
|
|
15
|
+
*/
|
|
10
16
|
export declare const checkIfTokenIdIsUri: (tokenId: string | null) => boolean;
|
|
11
|
-
export declare const compareVersions: (version1: string, version2: string) => number;
|
|
12
17
|
/**
|
|
13
18
|
* Computes the expiry date based on validity configuration.
|
|
14
19
|
*
|
|
@@ -27,22 +32,6 @@ export declare const computeExpiryDate: (validityType?: TokenValidityType, valid
|
|
|
27
32
|
* @returns true if expired, false if still valid, undefined if no expiry date
|
|
28
33
|
*/
|
|
29
34
|
export declare const isTokenExpired: (expiryDate?: Date | null, referenceDate?: Date) => boolean | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Normalizes an array of tags for consistent storage.
|
|
32
|
-
* - Converts to lowercase
|
|
33
|
-
* - Trims whitespace
|
|
34
|
-
* - Replaces spaces with dashes
|
|
35
|
-
* - Removes duplicates
|
|
36
|
-
* - Filters out empty strings
|
|
37
|
-
*
|
|
38
|
-
* @param tags - Array of tag strings to normalize
|
|
39
|
-
* @returns Normalized, deduplicated array of tags
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* normalizeTags(['Summer', ' VIP ', 'Black Friday', 'summer'])
|
|
43
|
-
* // Returns: ['summer', 'vip', 'black-friday']
|
|
44
|
-
*/
|
|
45
|
-
export declare const normalizeTags: (tags?: string[] | null) => string[];
|
|
46
35
|
/**
|
|
47
36
|
* Extracts the expiry_date attribute from token metadata (OpenSea standard format).
|
|
48
37
|
* This is the inverse operation of computeExpiryDate - it reads the expiry that was
|
|
@@ -80,4 +69,4 @@ export declare const extractTagsFromMetadata: (metadata: TokenStorageData | null
|
|
|
80
69
|
* extractBusinessIdsFromMetadata(metadata); // Returns ['uuid-1', 'uuid-2']
|
|
81
70
|
*/
|
|
82
71
|
export declare const extractBusinessIdsFromMetadata: (metadata: TokenStorageData | null) => string[];
|
|
83
|
-
//# sourceMappingURL=
|
|
72
|
+
//# sourceMappingURL=token-metadata.functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-metadata.functions.d.ts","sourceRoot":"","sources":["../../../../src/shared-patterns/functions/token-metadata.functions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAkC,MAAM,0DAA0D,CAAC;AAE5H;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,OAM5D,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,eAAe,iBAAiB,EAChC,mBAAmB,MAAM,EACzB,kBAAkB,IAAI,EACtB,eAAc,IAAiB,KAC9B,IAAI,GAAG,SA6CT,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GACzB,aAAa,IAAI,GAAG,IAAI,EACxB,gBAAe,IAAiB,KAC/B,OAAO,GAAG,SAGZ,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,6BAA6B,GAAI,UAAU,gBAAgB,GAAG,IAAI,KAAG,IAAI,GAAG,IAaxF,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,gBAAgB,GAAG,IAAI,KAAG,MAAM,EAiBjF,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,8BAA8B,GAAI,UAAU,gBAAgB,GAAG,IAAI,KAAG,MAAM,EAmBxF,CAAA"}
|