@plyaz/types 1.26.0 → 1.27.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.
package/dist/index.cjs CHANGED
@@ -6,684 +6,6 @@ var zod = require('zod');
6
6
  var __defProp = Object.defineProperty;
7
7
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
8
 
9
- // src/auth/enums.ts
10
- var USER_ROLE = {
11
- /** A user who is an athlete and participates in sports activities. */
12
- Athlete: "athlete",
13
- /** A user who scouts and discovers talent. */
14
- Scout: "scout",
15
- /** A user who acts as an agent representing athletes or clubs. */
16
- Agent: "agent",
17
- /** A user representing a sports club or organization. */
18
- Club: "club",
19
- /** A fan or supporter of athletes or clubs. */
20
- Fan: "fan",
21
- /** A system administrator with access to management tools. */
22
- Admin: "admin",
23
- /** A super admin with the highest level of access and control. */
24
- SuperAdmin: "super.admin"
25
- };
26
- var USER_STATUS = {
27
- /** Active user with full access. */
28
- Active: "active",
29
- /** Inactive user, typically not currently using the platform. */
30
- Inactive: "inactive",
31
- /** User account is awaiting approval or completion of setup. */
32
- Pending: "pending",
33
- /** User has been temporarily suspended due to policy violations or manual review. */
34
- Suspended: "suspended",
35
- /** User has been permanently banned from the platform. */
36
- Banned: "banned"
37
- };
38
- var AUTH_PROVIDER_TYPE = /* @__PURE__ */ ((AUTH_PROVIDER_TYPE2) => {
39
- AUTH_PROVIDER_TYPE2["ClerkSupabase"] = "CLERK_SUPABASE";
40
- AUTH_PROVIDER_TYPE2["InternalDb"] = "INTERNAL_DB";
41
- return AUTH_PROVIDER_TYPE2;
42
- })(AUTH_PROVIDER_TYPE || {});
43
- var AUTH_PROVIDER = /* @__PURE__ */ ((AUTH_PROVIDER2) => {
44
- AUTH_PROVIDER2["EMAIL"] = "EMAIL";
45
- AUTH_PROVIDER2["CLERK"] = "CLERK";
46
- AUTH_PROVIDER2["GOOGLE"] = "GOOGLE";
47
- AUTH_PROVIDER2["FACEBOOK"] = "FACEBOOK";
48
- AUTH_PROVIDER2["APPLE"] = "APPLE";
49
- AUTH_PROVIDER2["WEB3"] = "WEB3";
50
- return AUTH_PROVIDER2;
51
- })(AUTH_PROVIDER || {});
52
- var USER_ROLE_STATUS = /* @__PURE__ */ ((USER_ROLE_STATUS2) => {
53
- USER_ROLE_STATUS2["ACTIVE"] = "ACTIVE";
54
- USER_ROLE_STATUS2["INACTIVE"] = "INACTIVE";
55
- USER_ROLE_STATUS2["SUSPENDED"] = "SUSPENDED";
56
- return USER_ROLE_STATUS2;
57
- })(USER_ROLE_STATUS || {});
58
- var TOKEN_TYPE = /* @__PURE__ */ ((TOKEN_TYPE2) => {
59
- TOKEN_TYPE2["BEARER"] = "Bearer";
60
- TOKEN_TYPE2["JWT"] = "JWT";
61
- return TOKEN_TYPE2;
62
- })(TOKEN_TYPE || {});
63
- var DEFAULT_PASSWORD = 8;
64
- var ContactUsFormSchema = zod.z.object({
65
- name: zod.z.string({ error: "errors.form.missingField" }).min(1, "errors.form.nameMissing"),
66
- email: zod.z.email({ error: "errors.form.emailInvalid" })
67
- });
68
- var SignupFormSchema = zod.z.object({
69
- name: zod.z.string({ error: "errors.form.missingField" }).min(1, "errors.form.nameMissing"),
70
- email: zod.z.email({ error: "errors.form.emailInvalid" }),
71
- password: zod.z.string({ error: "errors.form.missingField" }).min(DEFAULT_PASSWORD, "errors.form.passwordTooShort")
72
- });
73
-
74
- // src/core/modules.ts
75
- var BACKEND_RUNTIMES = [
76
- "node",
77
- "nestjs",
78
- "express",
79
- "deno",
80
- "bun"
81
- ];
82
- var FRONTEND_RUNTIMES = ["browser"];
83
- var UNIVERSAL_RUNTIMES = [
84
- "nextjs",
85
- "nuxt",
86
- "edge"
87
- ];
88
- var APP_CONTEXTS = [
89
- "webapp",
90
- "backoffice",
91
- "mobile",
92
- "microapp",
93
- "cli"
94
- ];
95
-
96
- // src/core/tables/enum.ts
97
- var TABLES = /* @__PURE__ */ ((TABLES2) => {
98
- TABLES2["User"] = "users";
99
- return TABLES2;
100
- })(TABLES || {});
101
-
102
- // src/core/featureFlag/enums.ts
103
- var SORT_DIRECTION = /* @__PURE__ */ ((SORT_DIRECTION2) => {
104
- SORT_DIRECTION2["Asc"] = "asc";
105
- SORT_DIRECTION2["Desc"] = "desc";
106
- return SORT_DIRECTION2;
107
- })(SORT_DIRECTION || {});
108
- var FEATURE_FLAG_TABLE = /* @__PURE__ */ ((FEATURE_FLAG_TABLE2) => {
109
- FEATURE_FLAG_TABLE2["FeatureFlags"] = "feature_flags";
110
- FEATURE_FLAG_TABLE2["FeatureFlagRules"] = "feature_flag_rules";
111
- FEATURE_FLAG_TABLE2["FeatureFlagEvaluations"] = "feature_flag_evaluations";
112
- FEATURE_FLAG_TABLE2["FeatureFlagOverrides"] = "feature_flag_overrides";
113
- return FEATURE_FLAG_TABLE2;
114
- })(FEATURE_FLAG_TABLE || {});
115
- var FEATURE_FLAG_FIELD = /* @__PURE__ */ ((FEATURE_FLAG_FIELD2) => {
116
- FEATURE_FLAG_FIELD2["Key"] = "key";
117
- FEATURE_FLAG_FIELD2["Name"] = "name";
118
- FEATURE_FLAG_FIELD2["Value"] = "value";
119
- FEATURE_FLAG_FIELD2["Type"] = "type";
120
- FEATURE_FLAG_FIELD2["IsEnabled"] = "is_enabled";
121
- FEATURE_FLAG_FIELD2["Environments"] = "environments";
122
- FEATURE_FLAG_FIELD2["Description"] = "description";
123
- FEATURE_FLAG_FIELD2["CreatedAt"] = "created_at";
124
- FEATURE_FLAG_FIELD2["UpdatedAt"] = "updated_at";
125
- return FEATURE_FLAG_FIELD2;
126
- })(FEATURE_FLAG_FIELD || {});
127
- var FEATURE_FLAG_RULE_FIELD = /* @__PURE__ */ ((FEATURE_FLAG_RULE_FIELD2) => {
128
- FEATURE_FLAG_RULE_FIELD2["Id"] = "id";
129
- FEATURE_FLAG_RULE_FIELD2["FlagKey"] = "flag_key";
130
- FEATURE_FLAG_RULE_FIELD2["Name"] = "name";
131
- FEATURE_FLAG_RULE_FIELD2["Conditions"] = "conditions";
132
- FEATURE_FLAG_RULE_FIELD2["Value"] = "value";
133
- FEATURE_FLAG_RULE_FIELD2["Priority"] = "priority";
134
- FEATURE_FLAG_RULE_FIELD2["IsEnabled"] = "is_enabled";
135
- return FEATURE_FLAG_RULE_FIELD2;
136
- })(FEATURE_FLAG_RULE_FIELD || {});
137
- var FEATURE_FLAG_PROVIDERS = /* @__PURE__ */ ((FEATURE_FLAG_PROVIDERS2) => {
138
- FEATURE_FLAG_PROVIDERS2["MEMORY"] = "memory";
139
- FEATURE_FLAG_PROVIDERS2["FILE"] = "file";
140
- FEATURE_FLAG_PROVIDERS2["REDIS"] = "redis";
141
- FEATURE_FLAG_PROVIDERS2["API"] = "api";
142
- FEATURE_FLAG_PROVIDERS2["DATABASE"] = "database";
143
- return FEATURE_FLAG_PROVIDERS2;
144
- })(FEATURE_FLAG_PROVIDERS || {});
145
- var NODE_ENVIRONMENTS = /* @__PURE__ */ ((NODE_ENVIRONMENTS2) => {
146
- NODE_ENVIRONMENTS2["DEVELOPMENT"] = "development";
147
- NODE_ENVIRONMENTS2["PRODUCTION"] = "production";
148
- NODE_ENVIRONMENTS2["STAGING"] = "staging";
149
- NODE_ENVIRONMENTS2["TEST"] = "test";
150
- return NODE_ENVIRONMENTS2;
151
- })(NODE_ENVIRONMENTS || {});
152
- var DATABASE_FIELDS = /* @__PURE__ */ ((DATABASE_FIELDS2) => {
153
- DATABASE_FIELDS2["Key"] = "key";
154
- DATABASE_FIELDS2["FlagKey"] = "flag_key";
155
- DATABASE_FIELDS2["UserId"] = "user_id";
156
- DATABASE_FIELDS2["IsEnabled"] = "is_enabled";
157
- DATABASE_FIELDS2["CreatedAt"] = "created_at";
158
- DATABASE_FIELDS2["UpdatedAt"] = "updated_at";
159
- DATABASE_FIELDS2["ExpiresAt"] = "expires_at";
160
- DATABASE_FIELDS2["EvaluatedAt"] = "evaluated_at";
161
- return DATABASE_FIELDS2;
162
- })(DATABASE_FIELDS || {});
163
- var SYSTEM_USERS = /* @__PURE__ */ ((SYSTEM_USERS2) => {
164
- SYSTEM_USERS2["SYSTEM"] = "system";
165
- return SYSTEM_USERS2;
166
- })(SYSTEM_USERS || {});
167
- var EVALUATION_REASONS = /* @__PURE__ */ ((EVALUATION_REASONS2) => {
168
- EVALUATION_REASONS2["Default"] = "default";
169
- EVALUATION_REASONS2["RuleMatch"] = "rule_match";
170
- EVALUATION_REASONS2["Rollout"] = "rollout";
171
- EVALUATION_REASONS2["Override"] = "override";
172
- EVALUATION_REASONS2["Disabled"] = "disabled";
173
- return EVALUATION_REASONS2;
174
- })(EVALUATION_REASONS || {});
175
- var FEATURE_FLAG_TYPES = /* @__PURE__ */ ((FEATURE_FLAG_TYPES2) => {
176
- FEATURE_FLAG_TYPES2["BOOLEAN"] = "boolean";
177
- FEATURE_FLAG_TYPES2["STRING"] = "string";
178
- FEATURE_FLAG_TYPES2["NUMBER"] = "number";
179
- FEATURE_FLAG_TYPES2["OBJECT"] = "object";
180
- return FEATURE_FLAG_TYPES2;
181
- })(FEATURE_FLAG_TYPES || {});
182
-
183
- // src/core/featureFlag/constants.ts
184
- var FEATURE_FLAG_DEFAULTS = {
185
- CACHE_TTL: 300,
186
- REFRESH_INTERVAL: 0,
187
- POOL_SIZE: 10,
188
- TIMEOUT: 3e4,
189
- TABLE_NAME: "feature_flags"
190
- };
191
- var FEATURE_FLAG_METADATA = {
192
- FLAG_CHECK: "plyaz:feature_flag_check",
193
- // Single feature flag check
194
- RESOLVE_FLAGS: "plyaz:resolve_feature_flags"
195
- // Multiple flags resolved at once
196
- };
197
-
198
- // src/core/events/enums.ts
199
- var CoreEventScope = {
200
- SYSTEM: "system",
201
- ENTITY: "entity",
202
- VALIDATION: "validation",
203
- SANITIZATION: "sanitization",
204
- API: "api",
205
- CACHE: "cache",
206
- AUTH: "auth",
207
- DATABASE: "database",
208
- FEATURE_FLAG: "featureFlag",
209
- STORE: "store",
210
- STORAGE: "storage",
211
- NOTIFICATION: "notification"
212
- };
213
- var SystemEventAction = {
214
- INITIALIZED: "initialized",
215
- READY: "ready",
216
- SHUTDOWN: "shutdown",
217
- ERROR: "error",
218
- WARNING: "warning"
219
- };
220
- var EntityEventAction = {
221
- // Lifecycle (before API call)
222
- CREATING: "creating",
223
- UPDATING: "updating",
224
- PATCHING: "patching",
225
- DELETING: "deleting",
226
- // Completed (after API call)
227
- CREATED: "created",
228
- UPDATED: "updated",
229
- PATCHED: "patched",
230
- DELETED: "deleted",
231
- // Error/Complete
232
- ERROR: "error",
233
- COMPLETE: "complete",
234
- // Bulk operations
235
- BULK_CREATED: "bulkCreated",
236
- BULK_DELETED: "bulkDeleted"
237
- };
238
- var ValidationEventAction = {
239
- STARTED: "started",
240
- SUCCESS: "success",
241
- FAILED: "failed"
242
- };
243
- var SanitizationEventAction = {
244
- STARTED: "started",
245
- SUCCESS: "success",
246
- FAILED: "failed"
247
- };
248
- var ApiEventAction = {
249
- REQUEST_START: "requestStart",
250
- REQUEST_SUCCESS: "requestSuccess",
251
- REQUEST_ERROR: "requestError",
252
- RETRY: "retry",
253
- TIMEOUT: "timeout"
254
- };
255
- var CacheEventAction = {
256
- HIT: "hit",
257
- MISS: "miss",
258
- SET: "set",
259
- DELETE: "delete",
260
- CLEAR: "clear",
261
- EXPIRED: "expired"
262
- };
263
- var AuthEventAction = {
264
- LOGIN: "login",
265
- LOGOUT: "logout",
266
- TOKEN_REFRESH: "tokenRefresh",
267
- SESSION_EXPIRED: "sessionExpired",
268
- UNAUTHORIZED: "unauthorized"
269
- };
270
- var DatabaseEventAction = {
271
- CONNECTED: "connected",
272
- DISCONNECTED: "disconnected",
273
- QUERY: "query",
274
- ERROR: "error",
275
- TRANSACTION_START: "transactionStart",
276
- TRANSACTION_COMMIT: "transactionCommit",
277
- TRANSACTION_ROLLBACK: "transactionRollback"
278
- };
279
- var FeatureFlagEventAction = {
280
- CHANGED: "changed",
281
- EVALUATED: "evaluated",
282
- REFRESHED: "refreshed"
283
- };
284
- var StoreEventAction = {
285
- UPDATED: "updated",
286
- RESET: "reset",
287
- HYDRATED: "hydrated"
288
- };
289
- var StorageEventAction = {
290
- UPLOADED: "uploaded",
291
- DOWNLOADED: "downloaded",
292
- DELETED: "deleted",
293
- ERROR: "error",
294
- HEALTH_CHECK: "healthCheck"
295
- };
296
- var NotificationEventAction = {
297
- SENT: "sent",
298
- FAILED: "failed",
299
- DELIVERED: "delivered",
300
- OPENED: "opened",
301
- CLICKED: "clicked",
302
- ERROR: "error",
303
- HEALTH_CHECK: "healthCheck"
304
- };
305
- var CORE_EVENTS = {
306
- SYSTEM: {
307
- INITIALIZED: `${CoreEventScope.SYSTEM}:${SystemEventAction.INITIALIZED}`,
308
- READY: `${CoreEventScope.SYSTEM}:${SystemEventAction.READY}`,
309
- SHUTDOWN: `${CoreEventScope.SYSTEM}:${SystemEventAction.SHUTDOWN}`,
310
- ERROR: `${CoreEventScope.SYSTEM}:${SystemEventAction.ERROR}`,
311
- WARNING: `${CoreEventScope.SYSTEM}:${SystemEventAction.WARNING}`
312
- },
313
- ENTITY: {
314
- CREATING: `${CoreEventScope.ENTITY}:${EntityEventAction.CREATING}`,
315
- UPDATING: `${CoreEventScope.ENTITY}:${EntityEventAction.UPDATING}`,
316
- PATCHING: `${CoreEventScope.ENTITY}:${EntityEventAction.PATCHING}`,
317
- DELETING: `${CoreEventScope.ENTITY}:${EntityEventAction.DELETING}`,
318
- CREATED: `${CoreEventScope.ENTITY}:${EntityEventAction.CREATED}`,
319
- UPDATED: `${CoreEventScope.ENTITY}:${EntityEventAction.UPDATED}`,
320
- PATCHED: `${CoreEventScope.ENTITY}:${EntityEventAction.PATCHED}`,
321
- DELETED: `${CoreEventScope.ENTITY}:${EntityEventAction.DELETED}`,
322
- ERROR: `${CoreEventScope.ENTITY}:${EntityEventAction.ERROR}`,
323
- COMPLETE: `${CoreEventScope.ENTITY}:${EntityEventAction.COMPLETE}`,
324
- BULK_CREATED: `${CoreEventScope.ENTITY}:${EntityEventAction.BULK_CREATED}`,
325
- BULK_DELETED: `${CoreEventScope.ENTITY}:${EntityEventAction.BULK_DELETED}`
326
- },
327
- VALIDATION: {
328
- STARTED: `${CoreEventScope.VALIDATION}:${ValidationEventAction.STARTED}`,
329
- SUCCESS: `${CoreEventScope.VALIDATION}:${ValidationEventAction.SUCCESS}`,
330
- FAILED: `${CoreEventScope.VALIDATION}:${ValidationEventAction.FAILED}`
331
- },
332
- SANITIZATION: {
333
- STARTED: `${CoreEventScope.SANITIZATION}:${SanitizationEventAction.STARTED}`,
334
- SUCCESS: `${CoreEventScope.SANITIZATION}:${SanitizationEventAction.SUCCESS}`,
335
- FAILED: `${CoreEventScope.SANITIZATION}:${SanitizationEventAction.FAILED}`
336
- },
337
- API: {
338
- REQUEST_START: `${CoreEventScope.API}:${ApiEventAction.REQUEST_START}`,
339
- REQUEST_SUCCESS: `${CoreEventScope.API}:${ApiEventAction.REQUEST_SUCCESS}`,
340
- REQUEST_ERROR: `${CoreEventScope.API}:${ApiEventAction.REQUEST_ERROR}`,
341
- RETRY: `${CoreEventScope.API}:${ApiEventAction.RETRY}`,
342
- TIMEOUT: `${CoreEventScope.API}:${ApiEventAction.TIMEOUT}`
343
- },
344
- CACHE: {
345
- HIT: `${CoreEventScope.CACHE}:${CacheEventAction.HIT}`,
346
- MISS: `${CoreEventScope.CACHE}:${CacheEventAction.MISS}`,
347
- SET: `${CoreEventScope.CACHE}:${CacheEventAction.SET}`,
348
- DELETE: `${CoreEventScope.CACHE}:${CacheEventAction.DELETE}`,
349
- CLEAR: `${CoreEventScope.CACHE}:${CacheEventAction.CLEAR}`,
350
- EXPIRED: `${CoreEventScope.CACHE}:${CacheEventAction.EXPIRED}`
351
- },
352
- AUTH: {
353
- LOGIN: `${CoreEventScope.AUTH}:${AuthEventAction.LOGIN}`,
354
- LOGOUT: `${CoreEventScope.AUTH}:${AuthEventAction.LOGOUT}`,
355
- TOKEN_REFRESH: `${CoreEventScope.AUTH}:${AuthEventAction.TOKEN_REFRESH}`,
356
- SESSION_EXPIRED: `${CoreEventScope.AUTH}:${AuthEventAction.SESSION_EXPIRED}`,
357
- UNAUTHORIZED: `${CoreEventScope.AUTH}:${AuthEventAction.UNAUTHORIZED}`
358
- },
359
- DATABASE: {
360
- CONNECTED: `${CoreEventScope.DATABASE}:${DatabaseEventAction.CONNECTED}`,
361
- DISCONNECTED: `${CoreEventScope.DATABASE}:${DatabaseEventAction.DISCONNECTED}`,
362
- QUERY: `${CoreEventScope.DATABASE}:${DatabaseEventAction.QUERY}`,
363
- ERROR: `${CoreEventScope.DATABASE}:${DatabaseEventAction.ERROR}`,
364
- TRANSACTION_START: `${CoreEventScope.DATABASE}:${DatabaseEventAction.TRANSACTION_START}`,
365
- TRANSACTION_COMMIT: `${CoreEventScope.DATABASE}:${DatabaseEventAction.TRANSACTION_COMMIT}`,
366
- TRANSACTION_ROLLBACK: `${CoreEventScope.DATABASE}:${DatabaseEventAction.TRANSACTION_ROLLBACK}`
367
- },
368
- FEATURE_FLAG: {
369
- CHANGED: `${CoreEventScope.FEATURE_FLAG}:${FeatureFlagEventAction.CHANGED}`,
370
- EVALUATED: `${CoreEventScope.FEATURE_FLAG}:${FeatureFlagEventAction.EVALUATED}`,
371
- REFRESHED: `${CoreEventScope.FEATURE_FLAG}:${FeatureFlagEventAction.REFRESHED}`
372
- },
373
- STORE: {
374
- UPDATED: `${CoreEventScope.STORE}:${StoreEventAction.UPDATED}`,
375
- RESET: `${CoreEventScope.STORE}:${StoreEventAction.RESET}`,
376
- HYDRATED: `${CoreEventScope.STORE}:${StoreEventAction.HYDRATED}`
377
- },
378
- STORAGE: {
379
- UPLOADED: `${CoreEventScope.STORAGE}:${StorageEventAction.UPLOADED}`,
380
- DOWNLOADED: `${CoreEventScope.STORAGE}:${StorageEventAction.DOWNLOADED}`,
381
- DELETED: `${CoreEventScope.STORAGE}:${StorageEventAction.DELETED}`,
382
- ERROR: `${CoreEventScope.STORAGE}:${StorageEventAction.ERROR}`,
383
- HEALTH_CHECK: `${CoreEventScope.STORAGE}:${StorageEventAction.HEALTH_CHECK}`
384
- },
385
- NOTIFICATION: {
386
- SENT: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.SENT}`,
387
- FAILED: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.FAILED}`,
388
- DELIVERED: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.DELIVERED}`,
389
- OPENED: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.OPENED}`,
390
- CLICKED: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.CLICKED}`,
391
- ERROR: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.ERROR}`,
392
- HEALTH_CHECK: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.HEALTH_CHECK}`
393
- }
394
- };
395
-
396
- // src/core/services/keys.ts
397
- var SERVICE_KEYS = {
398
- /** Example domain service (backend) */
399
- EXAMPLE: "example",
400
- /** Example domain service (frontend) */
401
- EXAMPLE_FRONTEND: "example-frontend",
402
- /** Feature flags service */
403
- FEATURE_FLAGS: "featureFlags"
404
- };
405
- var ALL_SERVICE_KEYS = Object.values(SERVICE_KEYS);
406
-
407
- // src/errors/enums.ts
408
- var ERROR_TYPE = {
409
- /** A general validation error (e.g., form or input errors). */
410
- ValidationError: "validation.error",
411
- /** Error related to schema validation, such as JSON schema or API payload checks. */
412
- SchemaValidationError: "validation.schema.error",
413
- /** Unhandled or unexpected system error. */
414
- InternalError: "system.internal.error",
415
- /** System dependency is currently unavailable (e.g., database or external API). */
416
- ServiceUnavailable: "system.service.unavailable",
417
- /** The request took too long and timed out. */
418
- TimeoutError: "system.timeout",
419
- /** Too many requests made in a short period of time. */
420
- RateLimitExceeded: "system.rate.limit.exceeded"
421
- };
422
- var ERROR_SEVERITY = {
423
- /** Low severity - does not impact functionality significantly. */
424
- Low: "low",
425
- /** Medium severity - minor disruption or warning. */
426
- Medium: "medium",
427
- /** High severity - major issue requiring attention. */
428
- High: "high",
429
- /** Critical severity - blocking or crashing issue. */
430
- Critical: "critical"
431
- };
432
- var ERROR_CATEGORY = {
433
- /** Client-side error (e.g., invalid request). */
434
- Client: "client",
435
- /** Server-side error (e.g., logic failure or exception). */
436
- Server: "server",
437
- /** Network-related error (e.g., unreachable endpoint). */
438
- Network: "network",
439
- /** Blockchain-related error (e.g., transaction failure, gas limit). */
440
- Blockchain: "blockchain",
441
- /** Validation-specific error (e.g., failed constraints or field errors). */
442
- Validation: "validation",
443
- /** Authentication-related error (e.g., invalid credentials, expired token). */
444
- Authentication: "authentication",
445
- /** Authorization-related error (e.g., insufficient permissions). */
446
- Authorization: "authorization",
447
- /** Resource not found error. */
448
- NotFound: "not.found",
449
- /** Rate limiting error (too many requests). */
450
- RateLimit: "rate.limit",
451
- /** External service error (e.g., third-party API failure). */
452
- ExternalService: "external.service",
453
- /** Timeout error (request exceeded time limit). */
454
- Timeout: "timeout",
455
- /** Conflict error (e.g., resource state conflict). */
456
- Conflict: "conflict",
457
- /** Cache-related error. */
458
- Cache: "cache",
459
- /** Headers-related error (e.g., missing or invalid headers). */
460
- Headers: "headers",
461
- /** Retry-related error (e.g., max retries exceeded). */
462
- Retry: "retry",
463
- /** Strategy-related error (e.g., invalid retry or caching strategy). */
464
- Strategy: "strategy",
465
- /** Regional-related error (e.g., region detection failure). */
466
- Regional: "regional",
467
- /** Provider-related error (e.g., notification service provider failure). */
468
- Provider: "provider",
469
- /** Queue-related error (e.g., queue full or processing failed). */
470
- Queue: "queue",
471
- /** Webhook-related error (e.g., invalid signature or processing failure). */
472
- Webhook: "webhook",
473
- /** Template-related error (e.g., template not found or rendering failed). */
474
- Template: "template",
475
- /** Configuration-related error (e.g., invalid or missing configuration). */
476
- Configuration: "configuration",
477
- /** Payment processing-related error (e.g., capture or settlement failure). */
478
- Processing: "processing",
479
- /** Fraud detection or prevention failure. */
480
- Fraud: "fraud",
481
- /** Compliance-related error (e.g., AML/KYC validation failure). */
482
- Compliance: "compliance",
483
- /** Limits or quota-related error (e.g., exceeded transaction limit). */
484
- Limits: "limits",
485
- /** System-level error (unexpected internal issue). */
486
- System: "system",
487
- /** Refund-related error (e.g., duplicate or failed refund). */
488
- Refund: "refund",
489
- /** Security-related error (e.g., encryption or signature failure). */
490
- Security: "security",
491
- /** File operation error (e.g., upload, download, delete failure). */
492
- FileOperation: "file.operation",
493
- /** Plugin-related error (e.g., plugin initialization or execution failure). */
494
- Plugin: "plugin",
495
- /** Quota or storage limit error (e.g., exceeded storage quota). */
496
- Quota: "quota",
497
- /** Database-related error (e.g., query failure, connection error). */
498
- Database: "database",
499
- /** Unknown or unclassified error. */
500
- Unknown: "unknown"
501
- };
502
- var INTERNAL_STATUS_CODES = {
503
- // Configuration errors (1001-1009)
504
- INVALID_CONFIGURATION: 1001,
505
- MISSING_CONFIGURATION: 1002,
506
- CONFIGURATION_CONFLICT: 1003,
507
- CONFIGURATION_TRACKING_FAILED: 1004,
508
- DEBUG_TRACKING_FAILED: 1005,
509
- // Resource errors (1010-1019)
510
- RESOURCE_NOT_FOUND: 1010,
511
- RESOURCE_ALREADY_EXISTS: 1011,
512
- RESOURCE_UNAVAILABLE: 1012,
513
- // Validation errors (1020-1029)
514
- INVALID_PARAMETER: 1020,
515
- MISSING_PARAMETER: 1021,
516
- PARAMETER_OUT_OF_RANGE: 1022,
517
- // Strategy/preset errors (1030-1039)
518
- STRATEGY_NOT_FOUND: 1030,
519
- PRESET_NOT_FOUND: 1031,
520
- INVALID_STRATEGY: 1032,
521
- // Request/Response errors (1035-1039)
522
- REQUEST_FAILED: 1035,
523
- // Internal system errors (1040-1049)
524
- INITIALIZATION_FAILED: 1040,
525
- OPERATION_FAILED: 1041,
526
- STATE_CORRUPTION: 1042,
527
- SERIALIZATION_FAILED: 1043,
528
- DESERIALIZATION_FAILED: 1044,
529
- CONFIGURATION_INVALID: 1045,
530
- HEADER_PROCESSING_ERROR: 1046,
531
- REGION_DETECTION_ERROR: 1047,
532
- NETWORK_OVERRIDE_ERROR: 1048
533
- };
534
- var ERROR_CATEGORY_TO_EMITTER_KEY = {
535
- [ERROR_CATEGORY.Network]: "network",
536
- [ERROR_CATEGORY.Validation]: "validation",
537
- [ERROR_CATEGORY.Authentication]: "authentication",
538
- [ERROR_CATEGORY.Authorization]: "authorization",
539
- [ERROR_CATEGORY.RateLimit]: "rateLimit",
540
- [ERROR_CATEGORY.Server]: "server",
541
- [ERROR_CATEGORY.Timeout]: "timeout",
542
- [ERROR_CATEGORY.NotFound]: "notFound",
543
- [ERROR_CATEGORY.Conflict]: "conflict",
544
- [ERROR_CATEGORY.Client]: "client",
545
- [ERROR_CATEGORY.ExternalService]: "externalService",
546
- [ERROR_CATEGORY.Cache]: "cache",
547
- [ERROR_CATEGORY.Headers]: "headers",
548
- [ERROR_CATEGORY.Retry]: "retry",
549
- [ERROR_CATEGORY.Blockchain]: "blockchain",
550
- [ERROR_CATEGORY.Strategy]: "strategy",
551
- [ERROR_CATEGORY.Regional]: "regional",
552
- [ERROR_CATEGORY.Provider]: "provider",
553
- [ERROR_CATEGORY.Queue]: "queue",
554
- [ERROR_CATEGORY.Webhook]: "webhook",
555
- [ERROR_CATEGORY.Template]: "template",
556
- [ERROR_CATEGORY.Configuration]: "configuration",
557
- [ERROR_CATEGORY.Processing]: "processing",
558
- [ERROR_CATEGORY.Fraud]: "fraud",
559
- [ERROR_CATEGORY.Compliance]: "compliance",
560
- [ERROR_CATEGORY.Limits]: "limits",
561
- [ERROR_CATEGORY.System]: "system",
562
- [ERROR_CATEGORY.Refund]: "refund",
563
- [ERROR_CATEGORY.Security]: "security",
564
- [ERROR_CATEGORY.FileOperation]: "fileOperation",
565
- [ERROR_CATEGORY.Plugin]: "plugin",
566
- [ERROR_CATEGORY.Quota]: "quota",
567
- [ERROR_CATEGORY.Database]: "database",
568
- [ERROR_CATEGORY.Unknown]: "unknown"
569
- };
570
- var COMMON_OPERATIONS = {
571
- // Data operations
572
- STORAGE: "storage",
573
- RETRIEVAL: "retrieval",
574
- INVALIDATION: "invalidation",
575
- DELETION: "deletion",
576
- // Processing operations
577
- VALIDATION: "validation",
578
- ENRICHMENT: "enrichment",
579
- SERIALIZATION: "serialization",
580
- DESERIALIZATION: "deserialization",
581
- // API operations
582
- REQUEST: "request",
583
- RESPONSE: "response",
584
- RETRY: "retry",
585
- REVALIDATION: "revalidation",
586
- POLLING: "polling",
587
- // Configuration operations
588
- INITIALIZATION: "initialization",
589
- CONFIGURATION: "configuration",
590
- PRESET_LOOKUP: "preset-lookup",
591
- REGIONAL_DETECTION: "regional-detection",
592
- // Strategy operations
593
- STRATEGY_EXECUTION: "strategy-execution",
594
- FALLBACK: "fallback",
595
- // Event operations
596
- SUBSCRIPTION: "subscription",
597
- PUBLICATION: "publication",
598
- EVENT_HANDLING: "event-handling",
599
- // Debugging operations
600
- DEBUG: "debug",
601
- DEBUG_TRACKING: "debug-tracking",
602
- TRACKING: "tracking",
603
- MONITORING: "monitoring",
604
- // Network operations
605
- NETWORK_CHECK: "network-check",
606
- ENDPOINT_BUILD: "endpoint-build",
607
- CONTEXT_SETUP: "context-setup",
608
- // Notification operations
609
- SEND: "send",
610
- RENDER: "render",
611
- QUEUE: "queue",
612
- PROCESS: "process"
613
- };
614
- var COMMON_FIELDS = {
615
- // Storage fields
616
- STORAGE: "storage",
617
- CACHE: "cache",
618
- // Configuration fields
619
- CONFIG: "config",
620
- PRESET_NAME: "presetName",
621
- PRESET_ID: "presetId",
622
- // HTTP fields
623
- HEADERS: "headers",
624
- URL: "url",
625
- METHOD: "method",
626
- // Strategy fields
627
- STRATEGY: "strategy",
628
- // Retry fields
629
- RETRY_COUNT: "retryCount",
630
- MAX_RETRIES: "maxRetries",
631
- // Polling fields
632
- POLLING_INTERVAL: "pollingInterval",
633
- // Event fields
634
- TOPIC: "topic",
635
- CHANNEL: "channel",
636
- // API fields
637
- ENDPOINT: "endpoint",
638
- CLIENT: "client",
639
- // Network fields
640
- NETWORK_TYPE: "networkType",
641
- TIME_INTERVAL: "timeInterval",
642
- // Notification fields
643
- EMAIL: "email",
644
- PHONE: "phoneNumber",
645
- RECIPIENT: "recipient",
646
- TEMPLATE: "template",
647
- PROVIDER: "provider"
648
- };
649
- var COMMON_STORAGE_TYPES = {
650
- PRIMARY: "primary",
651
- FALLBACK: "fallback",
652
- MEMORY: "memory",
653
- SESSION: "session",
654
- LOCAL: "local",
655
- REDIS: "redis",
656
- DATABASE: "database"
657
- };
658
- var ERROR_EXCEPTIONS_NAMESPACES = {
659
- BASE: "base",
660
- API: "api",
661
- AUTH: "auth",
662
- NOTIFICATIONS: "notifications",
663
- STORAGE: "storage",
664
- DB: "db",
665
- VALIDATION: "validation",
666
- GENERIC: "generic",
667
- PAYMENTS: "payments",
668
- ERRORS: "errors",
669
- LOGGER: "logger",
670
- TYPES: "types",
671
- CONFIG: "config",
672
- UTILS: "utils",
673
- EVENTS: "events",
674
- TRANSLATIONS: "translations",
675
- UI: "ui",
676
- TESTING: "testing",
677
- CORE: "core",
678
- STORE: "store",
679
- WEB3: "web3",
680
- MONITORING: "monitoring",
681
- HOOKS: "hooks",
682
- COMMON: "common",
683
- COMPLIANCE: "compliance",
684
- PAYMENT_WEBHOOKS: "payment-webhook"
685
- };
686
-
687
9
  // src/http/constants.ts
688
10
  var HTTP_STATUS = {
689
11
  // 1xx Informational
@@ -941,6 +263,790 @@ var HTTP_STATUS = {
941
263
  NETWORK_AUTHENTICATION_REQUIRED: 511
942
264
  };
943
265
 
266
+ // src/auth/types.ts
267
+ var AUTH_ERROR_CODES = {
268
+ INVALID_CREDENTIALS: "AUTH_INVALID_CREDENTIALS",
269
+ TOKEN_EXPIRED: "AUTH_TOKEN_EXPIRED",
270
+ TOKEN_INVALID: "AUTH_TOKEN_INVALID",
271
+ TOKEN_REVOKED: "AUTH_TOKEN_REVOKED",
272
+ SESSION_EXPIRED: "AUTH_SESSION_EXPIRED",
273
+ MFA_REQUIRED: "AUTH_MFA_REQUIRED",
274
+ MFA_INVALID: "AUTH_MFA_INVALID",
275
+ INSUFFICIENT_PERMISSIONS: "AUTH_INSUFFICIENT_PERMISSIONS",
276
+ ROLE_REQUIRED: "AUTH_ROLE_REQUIRED",
277
+ WALLET_SIGNATURE_INVALID: "AUTH_WALLET_SIGNATURE_INVALID",
278
+ NONCE_EXPIRED: "AUTH_NONCE_EXPIRED",
279
+ NONCE_ALREADY_USED: "AUTH_NONCE_ALREADY_USED",
280
+ ACCOUNT_LOCKED: "AUTH_ACCOUNT_LOCKED",
281
+ ACCOUNT_SUSPENDED: "AUTH_ACCOUNT_SUSPENDED"
282
+ };
283
+
284
+ // src/auth/enums.ts
285
+ var USER_ROLE = {
286
+ /** A user who is an athlete and participates in sports activities. */
287
+ Athlete: "athlete",
288
+ /** A user who scouts and discovers talent. */
289
+ Scout: "scout",
290
+ /** A user who acts as an agent representing athletes or clubs. */
291
+ Agent: "agent",
292
+ /** A user representing a sports club or organization. */
293
+ Club: "club",
294
+ /** A fan or supporter of athletes or clubs. */
295
+ Fan: "fan",
296
+ /** A system administrator with access to management tools. */
297
+ Admin: "admin",
298
+ /** A super admin with the highest level of access and control. */
299
+ SuperAdmin: "super.admin"
300
+ };
301
+ var USER_STATUS = {
302
+ /** Active user with full access. */
303
+ Active: "active",
304
+ /** Inactive user, typically not currently using the platform. */
305
+ Inactive: "inactive",
306
+ /** User account is awaiting approval or completion of setup. */
307
+ Pending: "pending",
308
+ /** User has been temporarily suspended due to policy violations or manual review. */
309
+ Suspended: "suspended",
310
+ /** User has been permanently banned from the platform. */
311
+ Banned: "banned"
312
+ };
313
+ var AUTH_PROVIDER_TYPE = /* @__PURE__ */ ((AUTH_PROVIDER_TYPE2) => {
314
+ AUTH_PROVIDER_TYPE2["ClerkSupabase"] = "CLERK_SUPABASE";
315
+ AUTH_PROVIDER_TYPE2["InternalDb"] = "INTERNAL_DB";
316
+ return AUTH_PROVIDER_TYPE2;
317
+ })(AUTH_PROVIDER_TYPE || {});
318
+ var AUTH_PROVIDER = /* @__PURE__ */ ((AUTH_PROVIDER2) => {
319
+ AUTH_PROVIDER2["EMAIL"] = "EMAIL";
320
+ AUTH_PROVIDER2["CLERK"] = "CLERK";
321
+ AUTH_PROVIDER2["GOOGLE"] = "GOOGLE";
322
+ AUTH_PROVIDER2["FACEBOOK"] = "FACEBOOK";
323
+ AUTH_PROVIDER2["APPLE"] = "APPLE";
324
+ AUTH_PROVIDER2["WEB3"] = "WEB3";
325
+ return AUTH_PROVIDER2;
326
+ })(AUTH_PROVIDER || {});
327
+ var USER_ROLE_STATUS = /* @__PURE__ */ ((USER_ROLE_STATUS2) => {
328
+ USER_ROLE_STATUS2["ACTIVE"] = "ACTIVE";
329
+ USER_ROLE_STATUS2["INACTIVE"] = "INACTIVE";
330
+ USER_ROLE_STATUS2["SUSPENDED"] = "SUSPENDED";
331
+ return USER_ROLE_STATUS2;
332
+ })(USER_ROLE_STATUS || {});
333
+ var TOKEN_TYPE = /* @__PURE__ */ ((TOKEN_TYPE2) => {
334
+ TOKEN_TYPE2["BEARER"] = "Bearer";
335
+ TOKEN_TYPE2["JWT"] = "JWT";
336
+ return TOKEN_TYPE2;
337
+ })(TOKEN_TYPE || {});
338
+ var AUTH_ERROR_DEFINITIONS = {
339
+ [AUTH_ERROR_CODES.INVALID_CREDENTIALS]: {
340
+ status: HTTP_STATUS.UNAUTHORIZED,
341
+ message: "Wrong email/password.",
342
+ severity: "medium",
343
+ retryable: false
344
+ },
345
+ [AUTH_ERROR_CODES.TOKEN_EXPIRED]: {
346
+ status: HTTP_STATUS.UNAUTHORIZED,
347
+ message: "Access/refresh token expired.",
348
+ severity: "medium",
349
+ retryable: false
350
+ },
351
+ [AUTH_ERROR_CODES.TOKEN_INVALID]: {
352
+ status: HTTP_STATUS.UNAUTHORIZED,
353
+ message: "Token signature invalid.",
354
+ severity: "high",
355
+ retryable: false
356
+ },
357
+ [AUTH_ERROR_CODES.TOKEN_REVOKED]: {
358
+ status: HTTP_STATUS.UNAUTHORIZED,
359
+ message: "Token has been revoked.",
360
+ severity: "medium",
361
+ retryable: false
362
+ },
363
+ [AUTH_ERROR_CODES.SESSION_EXPIRED]: {
364
+ status: HTTP_STATUS.UNAUTHORIZED,
365
+ message: "Session no longer valid.",
366
+ severity: "medium",
367
+ retryable: false
368
+ },
369
+ [AUTH_ERROR_CODES.MFA_REQUIRED]: {
370
+ status: HTTP_STATUS.FORBIDDEN,
371
+ // 403 Forbidden is appropriate here
372
+ message: "MFA verification needed.",
373
+ severity: "low",
374
+ retryable: false
375
+ },
376
+ [AUTH_ERROR_CODES.MFA_INVALID]: {
377
+ status: HTTP_STATUS.UNAUTHORIZED,
378
+ message: "MFA code incorrect.",
379
+ severity: "medium",
380
+ retryable: false
381
+ },
382
+ [AUTH_ERROR_CODES.INSUFFICIENT_PERMISSIONS]: {
383
+ status: HTTP_STATUS.FORBIDDEN,
384
+ message: "User lacks required permission.",
385
+ severity: "medium",
386
+ retryable: false
387
+ },
388
+ [AUTH_ERROR_CODES.ROLE_REQUIRED]: {
389
+ status: HTTP_STATUS.FORBIDDEN,
390
+ message: "User lacks required role.",
391
+ severity: "medium",
392
+ retryable: false
393
+ },
394
+ [AUTH_ERROR_CODES.WALLET_SIGNATURE_INVALID]: {
395
+ status: HTTP_STATUS.UNAUTHORIZED,
396
+ message: "Web3 signature verification failed.",
397
+ severity: "high",
398
+ retryable: false
399
+ },
400
+ [AUTH_ERROR_CODES.NONCE_EXPIRED]: {
401
+ status: HTTP_STATUS.UNAUTHORIZED,
402
+ message: "SIWE nonce has expired.",
403
+ severity: "medium",
404
+ retryable: false
405
+ },
406
+ [AUTH_ERROR_CODES.NONCE_ALREADY_USED]: {
407
+ status: HTTP_STATUS.UNAUTHORIZED,
408
+ message: "Replay attack detected.",
409
+ severity: "high",
410
+ retryable: false
411
+ },
412
+ [AUTH_ERROR_CODES.ACCOUNT_LOCKED]: {
413
+ status: HTTP_STATUS.LOCKED,
414
+ // 423 Locked is perfect for this
415
+ message: "Too many failed attempts.",
416
+ severity: "high",
417
+ retryable: false
418
+ },
419
+ [AUTH_ERROR_CODES.ACCOUNT_SUSPENDED]: {
420
+ status: HTTP_STATUS.FORBIDDEN,
421
+ message: "Account has been suspended.",
422
+ severity: "high",
423
+ retryable: false
424
+ }
425
+ };
426
+ var DEFAULT_PASSWORD = 8;
427
+ var ContactUsFormSchema = zod.z.object({
428
+ name: zod.z.string({ error: "errors.form.missingField" }).min(1, "errors.form.nameMissing"),
429
+ email: zod.z.email({ error: "errors.form.emailInvalid" })
430
+ });
431
+ var SignupFormSchema = zod.z.object({
432
+ name: zod.z.string({ error: "errors.form.missingField" }).min(1, "errors.form.nameMissing"),
433
+ email: zod.z.email({ error: "errors.form.emailInvalid" }),
434
+ password: zod.z.string({ error: "errors.form.missingField" }).min(DEFAULT_PASSWORD, "errors.form.passwordTooShort")
435
+ });
436
+
437
+ // src/core/modules.ts
438
+ var BACKEND_RUNTIMES = [
439
+ "node",
440
+ "nestjs",
441
+ "express",
442
+ "deno",
443
+ "bun"
444
+ ];
445
+ var FRONTEND_RUNTIMES = ["browser"];
446
+ var UNIVERSAL_RUNTIMES = [
447
+ "nextjs",
448
+ "nuxt",
449
+ "edge"
450
+ ];
451
+ var APP_CONTEXTS = [
452
+ "webapp",
453
+ "backoffice",
454
+ "mobile",
455
+ "microapp",
456
+ "cli"
457
+ ];
458
+
459
+ // src/core/tables/enum.ts
460
+ var TABLES = /* @__PURE__ */ ((TABLES2) => {
461
+ TABLES2["User"] = "users";
462
+ return TABLES2;
463
+ })(TABLES || {});
464
+
465
+ // src/core/featureFlag/enums.ts
466
+ var SORT_DIRECTION = /* @__PURE__ */ ((SORT_DIRECTION2) => {
467
+ SORT_DIRECTION2["Asc"] = "asc";
468
+ SORT_DIRECTION2["Desc"] = "desc";
469
+ return SORT_DIRECTION2;
470
+ })(SORT_DIRECTION || {});
471
+ var FEATURE_FLAG_TABLE = /* @__PURE__ */ ((FEATURE_FLAG_TABLE2) => {
472
+ FEATURE_FLAG_TABLE2["FeatureFlags"] = "feature_flags";
473
+ FEATURE_FLAG_TABLE2["FeatureFlagRules"] = "feature_flag_rules";
474
+ FEATURE_FLAG_TABLE2["FeatureFlagEvaluations"] = "feature_flag_evaluations";
475
+ FEATURE_FLAG_TABLE2["FeatureFlagOverrides"] = "feature_flag_overrides";
476
+ return FEATURE_FLAG_TABLE2;
477
+ })(FEATURE_FLAG_TABLE || {});
478
+ var FEATURE_FLAG_FIELD = /* @__PURE__ */ ((FEATURE_FLAG_FIELD2) => {
479
+ FEATURE_FLAG_FIELD2["Key"] = "key";
480
+ FEATURE_FLAG_FIELD2["Name"] = "name";
481
+ FEATURE_FLAG_FIELD2["Value"] = "value";
482
+ FEATURE_FLAG_FIELD2["Type"] = "type";
483
+ FEATURE_FLAG_FIELD2["IsEnabled"] = "is_enabled";
484
+ FEATURE_FLAG_FIELD2["Environments"] = "environments";
485
+ FEATURE_FLAG_FIELD2["Description"] = "description";
486
+ FEATURE_FLAG_FIELD2["CreatedAt"] = "created_at";
487
+ FEATURE_FLAG_FIELD2["UpdatedAt"] = "updated_at";
488
+ return FEATURE_FLAG_FIELD2;
489
+ })(FEATURE_FLAG_FIELD || {});
490
+ var FEATURE_FLAG_RULE_FIELD = /* @__PURE__ */ ((FEATURE_FLAG_RULE_FIELD2) => {
491
+ FEATURE_FLAG_RULE_FIELD2["Id"] = "id";
492
+ FEATURE_FLAG_RULE_FIELD2["FlagKey"] = "flag_key";
493
+ FEATURE_FLAG_RULE_FIELD2["Name"] = "name";
494
+ FEATURE_FLAG_RULE_FIELD2["Conditions"] = "conditions";
495
+ FEATURE_FLAG_RULE_FIELD2["Value"] = "value";
496
+ FEATURE_FLAG_RULE_FIELD2["Priority"] = "priority";
497
+ FEATURE_FLAG_RULE_FIELD2["IsEnabled"] = "is_enabled";
498
+ return FEATURE_FLAG_RULE_FIELD2;
499
+ })(FEATURE_FLAG_RULE_FIELD || {});
500
+ var FEATURE_FLAG_PROVIDERS = /* @__PURE__ */ ((FEATURE_FLAG_PROVIDERS2) => {
501
+ FEATURE_FLAG_PROVIDERS2["MEMORY"] = "memory";
502
+ FEATURE_FLAG_PROVIDERS2["FILE"] = "file";
503
+ FEATURE_FLAG_PROVIDERS2["REDIS"] = "redis";
504
+ FEATURE_FLAG_PROVIDERS2["API"] = "api";
505
+ FEATURE_FLAG_PROVIDERS2["DATABASE"] = "database";
506
+ return FEATURE_FLAG_PROVIDERS2;
507
+ })(FEATURE_FLAG_PROVIDERS || {});
508
+ var NODE_ENVIRONMENTS = /* @__PURE__ */ ((NODE_ENVIRONMENTS2) => {
509
+ NODE_ENVIRONMENTS2["DEVELOPMENT"] = "development";
510
+ NODE_ENVIRONMENTS2["PRODUCTION"] = "production";
511
+ NODE_ENVIRONMENTS2["STAGING"] = "staging";
512
+ NODE_ENVIRONMENTS2["TEST"] = "test";
513
+ return NODE_ENVIRONMENTS2;
514
+ })(NODE_ENVIRONMENTS || {});
515
+ var DATABASE_FIELDS = /* @__PURE__ */ ((DATABASE_FIELDS2) => {
516
+ DATABASE_FIELDS2["Key"] = "key";
517
+ DATABASE_FIELDS2["FlagKey"] = "flag_key";
518
+ DATABASE_FIELDS2["UserId"] = "user_id";
519
+ DATABASE_FIELDS2["IsEnabled"] = "is_enabled";
520
+ DATABASE_FIELDS2["CreatedAt"] = "created_at";
521
+ DATABASE_FIELDS2["UpdatedAt"] = "updated_at";
522
+ DATABASE_FIELDS2["ExpiresAt"] = "expires_at";
523
+ DATABASE_FIELDS2["EvaluatedAt"] = "evaluated_at";
524
+ return DATABASE_FIELDS2;
525
+ })(DATABASE_FIELDS || {});
526
+ var SYSTEM_USERS = /* @__PURE__ */ ((SYSTEM_USERS2) => {
527
+ SYSTEM_USERS2["SYSTEM"] = "system";
528
+ return SYSTEM_USERS2;
529
+ })(SYSTEM_USERS || {});
530
+ var EVALUATION_REASONS = /* @__PURE__ */ ((EVALUATION_REASONS2) => {
531
+ EVALUATION_REASONS2["Default"] = "default";
532
+ EVALUATION_REASONS2["RuleMatch"] = "rule_match";
533
+ EVALUATION_REASONS2["Rollout"] = "rollout";
534
+ EVALUATION_REASONS2["Override"] = "override";
535
+ EVALUATION_REASONS2["Disabled"] = "disabled";
536
+ return EVALUATION_REASONS2;
537
+ })(EVALUATION_REASONS || {});
538
+ var FEATURE_FLAG_TYPES = /* @__PURE__ */ ((FEATURE_FLAG_TYPES2) => {
539
+ FEATURE_FLAG_TYPES2["BOOLEAN"] = "boolean";
540
+ FEATURE_FLAG_TYPES2["STRING"] = "string";
541
+ FEATURE_FLAG_TYPES2["NUMBER"] = "number";
542
+ FEATURE_FLAG_TYPES2["OBJECT"] = "object";
543
+ return FEATURE_FLAG_TYPES2;
544
+ })(FEATURE_FLAG_TYPES || {});
545
+
546
+ // src/core/featureFlag/constants.ts
547
+ var FEATURE_FLAG_DEFAULTS = {
548
+ CACHE_TTL: 300,
549
+ REFRESH_INTERVAL: 0,
550
+ POOL_SIZE: 10,
551
+ TIMEOUT: 3e4,
552
+ TABLE_NAME: "feature_flags"
553
+ };
554
+ var FEATURE_FLAG_METADATA = {
555
+ FLAG_CHECK: "plyaz:feature_flag_check",
556
+ // Single feature flag check
557
+ RESOLVE_FLAGS: "plyaz:resolve_feature_flags"
558
+ // Multiple flags resolved at once
559
+ };
560
+
561
+ // src/core/events/enums.ts
562
+ var CoreEventScope = {
563
+ SYSTEM: "system",
564
+ ENTITY: "entity",
565
+ VALIDATION: "validation",
566
+ SANITIZATION: "sanitization",
567
+ API: "api",
568
+ CACHE: "cache",
569
+ AUTH: "auth",
570
+ DATABASE: "database",
571
+ FEATURE_FLAG: "featureFlag",
572
+ STORE: "store",
573
+ STORAGE: "storage",
574
+ NOTIFICATION: "notification"
575
+ };
576
+ var SystemEventAction = {
577
+ INITIALIZED: "initialized",
578
+ READY: "ready",
579
+ SHUTDOWN: "shutdown",
580
+ ERROR: "error",
581
+ WARNING: "warning"
582
+ };
583
+ var EntityEventAction = {
584
+ // Lifecycle (before API call)
585
+ CREATING: "creating",
586
+ UPDATING: "updating",
587
+ PATCHING: "patching",
588
+ DELETING: "deleting",
589
+ // Completed (after API call)
590
+ CREATED: "created",
591
+ UPDATED: "updated",
592
+ PATCHED: "patched",
593
+ DELETED: "deleted",
594
+ // Error/Complete
595
+ ERROR: "error",
596
+ COMPLETE: "complete",
597
+ // Bulk operations
598
+ BULK_CREATED: "bulkCreated",
599
+ BULK_DELETED: "bulkDeleted"
600
+ };
601
+ var ValidationEventAction = {
602
+ STARTED: "started",
603
+ SUCCESS: "success",
604
+ FAILED: "failed"
605
+ };
606
+ var SanitizationEventAction = {
607
+ STARTED: "started",
608
+ SUCCESS: "success",
609
+ FAILED: "failed"
610
+ };
611
+ var ApiEventAction = {
612
+ REQUEST_START: "requestStart",
613
+ REQUEST_SUCCESS: "requestSuccess",
614
+ REQUEST_ERROR: "requestError",
615
+ RETRY: "retry",
616
+ TIMEOUT: "timeout"
617
+ };
618
+ var CacheEventAction = {
619
+ HIT: "hit",
620
+ MISS: "miss",
621
+ SET: "set",
622
+ DELETE: "delete",
623
+ CLEAR: "clear",
624
+ EXPIRED: "expired"
625
+ };
626
+ var AuthEventAction = {
627
+ LOGIN: "login",
628
+ LOGOUT: "logout",
629
+ TOKEN_REFRESH: "tokenRefresh",
630
+ SESSION_EXPIRED: "sessionExpired",
631
+ UNAUTHORIZED: "unauthorized"
632
+ };
633
+ var DatabaseEventAction = {
634
+ CONNECTED: "connected",
635
+ DISCONNECTED: "disconnected",
636
+ QUERY: "query",
637
+ ERROR: "error",
638
+ TRANSACTION_START: "transactionStart",
639
+ TRANSACTION_COMMIT: "transactionCommit",
640
+ TRANSACTION_ROLLBACK: "transactionRollback"
641
+ };
642
+ var FeatureFlagEventAction = {
643
+ CHANGED: "changed",
644
+ EVALUATED: "evaluated",
645
+ REFRESHED: "refreshed"
646
+ };
647
+ var StoreEventAction = {
648
+ UPDATED: "updated",
649
+ RESET: "reset",
650
+ HYDRATED: "hydrated"
651
+ };
652
+ var StorageEventAction = {
653
+ UPLOADED: "uploaded",
654
+ DOWNLOADED: "downloaded",
655
+ DELETED: "deleted",
656
+ ERROR: "error",
657
+ HEALTH_CHECK: "healthCheck"
658
+ };
659
+ var NotificationEventAction = {
660
+ SENT: "sent",
661
+ FAILED: "failed",
662
+ DELIVERED: "delivered",
663
+ OPENED: "opened",
664
+ CLICKED: "clicked",
665
+ ERROR: "error",
666
+ HEALTH_CHECK: "healthCheck"
667
+ };
668
+ var CORE_EVENTS = {
669
+ SYSTEM: {
670
+ INITIALIZED: `${CoreEventScope.SYSTEM}:${SystemEventAction.INITIALIZED}`,
671
+ READY: `${CoreEventScope.SYSTEM}:${SystemEventAction.READY}`,
672
+ SHUTDOWN: `${CoreEventScope.SYSTEM}:${SystemEventAction.SHUTDOWN}`,
673
+ ERROR: `${CoreEventScope.SYSTEM}:${SystemEventAction.ERROR}`,
674
+ WARNING: `${CoreEventScope.SYSTEM}:${SystemEventAction.WARNING}`
675
+ },
676
+ ENTITY: {
677
+ CREATING: `${CoreEventScope.ENTITY}:${EntityEventAction.CREATING}`,
678
+ UPDATING: `${CoreEventScope.ENTITY}:${EntityEventAction.UPDATING}`,
679
+ PATCHING: `${CoreEventScope.ENTITY}:${EntityEventAction.PATCHING}`,
680
+ DELETING: `${CoreEventScope.ENTITY}:${EntityEventAction.DELETING}`,
681
+ CREATED: `${CoreEventScope.ENTITY}:${EntityEventAction.CREATED}`,
682
+ UPDATED: `${CoreEventScope.ENTITY}:${EntityEventAction.UPDATED}`,
683
+ PATCHED: `${CoreEventScope.ENTITY}:${EntityEventAction.PATCHED}`,
684
+ DELETED: `${CoreEventScope.ENTITY}:${EntityEventAction.DELETED}`,
685
+ ERROR: `${CoreEventScope.ENTITY}:${EntityEventAction.ERROR}`,
686
+ COMPLETE: `${CoreEventScope.ENTITY}:${EntityEventAction.COMPLETE}`,
687
+ BULK_CREATED: `${CoreEventScope.ENTITY}:${EntityEventAction.BULK_CREATED}`,
688
+ BULK_DELETED: `${CoreEventScope.ENTITY}:${EntityEventAction.BULK_DELETED}`
689
+ },
690
+ VALIDATION: {
691
+ STARTED: `${CoreEventScope.VALIDATION}:${ValidationEventAction.STARTED}`,
692
+ SUCCESS: `${CoreEventScope.VALIDATION}:${ValidationEventAction.SUCCESS}`,
693
+ FAILED: `${CoreEventScope.VALIDATION}:${ValidationEventAction.FAILED}`
694
+ },
695
+ SANITIZATION: {
696
+ STARTED: `${CoreEventScope.SANITIZATION}:${SanitizationEventAction.STARTED}`,
697
+ SUCCESS: `${CoreEventScope.SANITIZATION}:${SanitizationEventAction.SUCCESS}`,
698
+ FAILED: `${CoreEventScope.SANITIZATION}:${SanitizationEventAction.FAILED}`
699
+ },
700
+ API: {
701
+ REQUEST_START: `${CoreEventScope.API}:${ApiEventAction.REQUEST_START}`,
702
+ REQUEST_SUCCESS: `${CoreEventScope.API}:${ApiEventAction.REQUEST_SUCCESS}`,
703
+ REQUEST_ERROR: `${CoreEventScope.API}:${ApiEventAction.REQUEST_ERROR}`,
704
+ RETRY: `${CoreEventScope.API}:${ApiEventAction.RETRY}`,
705
+ TIMEOUT: `${CoreEventScope.API}:${ApiEventAction.TIMEOUT}`
706
+ },
707
+ CACHE: {
708
+ HIT: `${CoreEventScope.CACHE}:${CacheEventAction.HIT}`,
709
+ MISS: `${CoreEventScope.CACHE}:${CacheEventAction.MISS}`,
710
+ SET: `${CoreEventScope.CACHE}:${CacheEventAction.SET}`,
711
+ DELETE: `${CoreEventScope.CACHE}:${CacheEventAction.DELETE}`,
712
+ CLEAR: `${CoreEventScope.CACHE}:${CacheEventAction.CLEAR}`,
713
+ EXPIRED: `${CoreEventScope.CACHE}:${CacheEventAction.EXPIRED}`
714
+ },
715
+ AUTH: {
716
+ LOGIN: `${CoreEventScope.AUTH}:${AuthEventAction.LOGIN}`,
717
+ LOGOUT: `${CoreEventScope.AUTH}:${AuthEventAction.LOGOUT}`,
718
+ TOKEN_REFRESH: `${CoreEventScope.AUTH}:${AuthEventAction.TOKEN_REFRESH}`,
719
+ SESSION_EXPIRED: `${CoreEventScope.AUTH}:${AuthEventAction.SESSION_EXPIRED}`,
720
+ UNAUTHORIZED: `${CoreEventScope.AUTH}:${AuthEventAction.UNAUTHORIZED}`
721
+ },
722
+ DATABASE: {
723
+ CONNECTED: `${CoreEventScope.DATABASE}:${DatabaseEventAction.CONNECTED}`,
724
+ DISCONNECTED: `${CoreEventScope.DATABASE}:${DatabaseEventAction.DISCONNECTED}`,
725
+ QUERY: `${CoreEventScope.DATABASE}:${DatabaseEventAction.QUERY}`,
726
+ ERROR: `${CoreEventScope.DATABASE}:${DatabaseEventAction.ERROR}`,
727
+ TRANSACTION_START: `${CoreEventScope.DATABASE}:${DatabaseEventAction.TRANSACTION_START}`,
728
+ TRANSACTION_COMMIT: `${CoreEventScope.DATABASE}:${DatabaseEventAction.TRANSACTION_COMMIT}`,
729
+ TRANSACTION_ROLLBACK: `${CoreEventScope.DATABASE}:${DatabaseEventAction.TRANSACTION_ROLLBACK}`
730
+ },
731
+ FEATURE_FLAG: {
732
+ CHANGED: `${CoreEventScope.FEATURE_FLAG}:${FeatureFlagEventAction.CHANGED}`,
733
+ EVALUATED: `${CoreEventScope.FEATURE_FLAG}:${FeatureFlagEventAction.EVALUATED}`,
734
+ REFRESHED: `${CoreEventScope.FEATURE_FLAG}:${FeatureFlagEventAction.REFRESHED}`
735
+ },
736
+ STORE: {
737
+ UPDATED: `${CoreEventScope.STORE}:${StoreEventAction.UPDATED}`,
738
+ RESET: `${CoreEventScope.STORE}:${StoreEventAction.RESET}`,
739
+ HYDRATED: `${CoreEventScope.STORE}:${StoreEventAction.HYDRATED}`
740
+ },
741
+ STORAGE: {
742
+ UPLOADED: `${CoreEventScope.STORAGE}:${StorageEventAction.UPLOADED}`,
743
+ DOWNLOADED: `${CoreEventScope.STORAGE}:${StorageEventAction.DOWNLOADED}`,
744
+ DELETED: `${CoreEventScope.STORAGE}:${StorageEventAction.DELETED}`,
745
+ ERROR: `${CoreEventScope.STORAGE}:${StorageEventAction.ERROR}`,
746
+ HEALTH_CHECK: `${CoreEventScope.STORAGE}:${StorageEventAction.HEALTH_CHECK}`
747
+ },
748
+ NOTIFICATION: {
749
+ SENT: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.SENT}`,
750
+ FAILED: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.FAILED}`,
751
+ DELIVERED: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.DELIVERED}`,
752
+ OPENED: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.OPENED}`,
753
+ CLICKED: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.CLICKED}`,
754
+ ERROR: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.ERROR}`,
755
+ HEALTH_CHECK: `${CoreEventScope.NOTIFICATION}:${NotificationEventAction.HEALTH_CHECK}`
756
+ }
757
+ };
758
+
759
+ // src/core/services/keys.ts
760
+ var SERVICE_KEYS = {
761
+ /** Example domain service (backend) */
762
+ EXAMPLE: "example",
763
+ /** Example domain service (frontend) */
764
+ EXAMPLE_FRONTEND: "example-frontend",
765
+ /** Feature flags service */
766
+ FEATURE_FLAGS: "featureFlags"
767
+ };
768
+ var ALL_SERVICE_KEYS = Object.values(SERVICE_KEYS);
769
+
770
+ // src/errors/enums.ts
771
+ var ERROR_TYPE = {
772
+ /** A general validation error (e.g., form or input errors). */
773
+ ValidationError: "validation.error",
774
+ /** Error related to schema validation, such as JSON schema or API payload checks. */
775
+ SchemaValidationError: "validation.schema.error",
776
+ /** Unhandled or unexpected system error. */
777
+ InternalError: "system.internal.error",
778
+ /** System dependency is currently unavailable (e.g., database or external API). */
779
+ ServiceUnavailable: "system.service.unavailable",
780
+ /** The request took too long and timed out. */
781
+ TimeoutError: "system.timeout",
782
+ /** Too many requests made in a short period of time. */
783
+ RateLimitExceeded: "system.rate.limit.exceeded"
784
+ };
785
+ var ERROR_SEVERITY = {
786
+ /** Low severity - does not impact functionality significantly. */
787
+ Low: "low",
788
+ /** Medium severity - minor disruption or warning. */
789
+ Medium: "medium",
790
+ /** High severity - major issue requiring attention. */
791
+ High: "high",
792
+ /** Critical severity - blocking or crashing issue. */
793
+ Critical: "critical"
794
+ };
795
+ var ERROR_CATEGORY = {
796
+ /** Client-side error (e.g., invalid request). */
797
+ Client: "client",
798
+ /** Server-side error (e.g., logic failure or exception). */
799
+ Server: "server",
800
+ /** Network-related error (e.g., unreachable endpoint). */
801
+ Network: "network",
802
+ /** Blockchain-related error (e.g., transaction failure, gas limit). */
803
+ Blockchain: "blockchain",
804
+ /** Validation-specific error (e.g., failed constraints or field errors). */
805
+ Validation: "validation",
806
+ /** Authentication-related error (e.g., invalid credentials, expired token). */
807
+ Authentication: "authentication",
808
+ /** Authorization-related error (e.g., insufficient permissions). */
809
+ Authorization: "authorization",
810
+ /** Resource not found error. */
811
+ NotFound: "not.found",
812
+ /** Rate limiting error (too many requests). */
813
+ RateLimit: "rate.limit",
814
+ /** External service error (e.g., third-party API failure). */
815
+ ExternalService: "external.service",
816
+ /** Timeout error (request exceeded time limit). */
817
+ Timeout: "timeout",
818
+ /** Conflict error (e.g., resource state conflict). */
819
+ Conflict: "conflict",
820
+ /** Cache-related error. */
821
+ Cache: "cache",
822
+ /** Headers-related error (e.g., missing or invalid headers). */
823
+ Headers: "headers",
824
+ /** Retry-related error (e.g., max retries exceeded). */
825
+ Retry: "retry",
826
+ /** Strategy-related error (e.g., invalid retry or caching strategy). */
827
+ Strategy: "strategy",
828
+ /** Regional-related error (e.g., region detection failure). */
829
+ Regional: "regional",
830
+ /** Provider-related error (e.g., notification service provider failure). */
831
+ Provider: "provider",
832
+ /** Queue-related error (e.g., queue full or processing failed). */
833
+ Queue: "queue",
834
+ /** Webhook-related error (e.g., invalid signature or processing failure). */
835
+ Webhook: "webhook",
836
+ /** Template-related error (e.g., template not found or rendering failed). */
837
+ Template: "template",
838
+ /** Configuration-related error (e.g., invalid or missing configuration). */
839
+ Configuration: "configuration",
840
+ /** Payment processing-related error (e.g., capture or settlement failure). */
841
+ Processing: "processing",
842
+ /** Fraud detection or prevention failure. */
843
+ Fraud: "fraud",
844
+ /** Compliance-related error (e.g., AML/KYC validation failure). */
845
+ Compliance: "compliance",
846
+ /** Limits or quota-related error (e.g., exceeded transaction limit). */
847
+ Limits: "limits",
848
+ /** System-level error (unexpected internal issue). */
849
+ System: "system",
850
+ /** Refund-related error (e.g., duplicate or failed refund). */
851
+ Refund: "refund",
852
+ /** Security-related error (e.g., encryption or signature failure). */
853
+ Security: "security",
854
+ /** File operation error (e.g., upload, download, delete failure). */
855
+ FileOperation: "file.operation",
856
+ /** Plugin-related error (e.g., plugin initialization or execution failure). */
857
+ Plugin: "plugin",
858
+ /** Quota or storage limit error (e.g., exceeded storage quota). */
859
+ Quota: "quota",
860
+ /** Database-related error (e.g., query failure, connection error). */
861
+ Database: "database",
862
+ /** Unknown or unclassified error. */
863
+ Unknown: "unknown"
864
+ };
865
+ var INTERNAL_STATUS_CODES = {
866
+ // Configuration errors (1001-1009)
867
+ INVALID_CONFIGURATION: 1001,
868
+ MISSING_CONFIGURATION: 1002,
869
+ CONFIGURATION_CONFLICT: 1003,
870
+ CONFIGURATION_TRACKING_FAILED: 1004,
871
+ DEBUG_TRACKING_FAILED: 1005,
872
+ // Resource errors (1010-1019)
873
+ RESOURCE_NOT_FOUND: 1010,
874
+ RESOURCE_ALREADY_EXISTS: 1011,
875
+ RESOURCE_UNAVAILABLE: 1012,
876
+ // Validation errors (1020-1029)
877
+ INVALID_PARAMETER: 1020,
878
+ MISSING_PARAMETER: 1021,
879
+ PARAMETER_OUT_OF_RANGE: 1022,
880
+ // Strategy/preset errors (1030-1039)
881
+ STRATEGY_NOT_FOUND: 1030,
882
+ PRESET_NOT_FOUND: 1031,
883
+ INVALID_STRATEGY: 1032,
884
+ // Request/Response errors (1035-1039)
885
+ REQUEST_FAILED: 1035,
886
+ // Internal system errors (1040-1049)
887
+ INITIALIZATION_FAILED: 1040,
888
+ OPERATION_FAILED: 1041,
889
+ STATE_CORRUPTION: 1042,
890
+ SERIALIZATION_FAILED: 1043,
891
+ DESERIALIZATION_FAILED: 1044,
892
+ CONFIGURATION_INVALID: 1045,
893
+ HEADER_PROCESSING_ERROR: 1046,
894
+ REGION_DETECTION_ERROR: 1047,
895
+ NETWORK_OVERRIDE_ERROR: 1048
896
+ };
897
+ var ERROR_CATEGORY_TO_EMITTER_KEY = {
898
+ [ERROR_CATEGORY.Network]: "network",
899
+ [ERROR_CATEGORY.Validation]: "validation",
900
+ [ERROR_CATEGORY.Authentication]: "authentication",
901
+ [ERROR_CATEGORY.Authorization]: "authorization",
902
+ [ERROR_CATEGORY.RateLimit]: "rateLimit",
903
+ [ERROR_CATEGORY.Server]: "server",
904
+ [ERROR_CATEGORY.Timeout]: "timeout",
905
+ [ERROR_CATEGORY.NotFound]: "notFound",
906
+ [ERROR_CATEGORY.Conflict]: "conflict",
907
+ [ERROR_CATEGORY.Client]: "client",
908
+ [ERROR_CATEGORY.ExternalService]: "externalService",
909
+ [ERROR_CATEGORY.Cache]: "cache",
910
+ [ERROR_CATEGORY.Headers]: "headers",
911
+ [ERROR_CATEGORY.Retry]: "retry",
912
+ [ERROR_CATEGORY.Blockchain]: "blockchain",
913
+ [ERROR_CATEGORY.Strategy]: "strategy",
914
+ [ERROR_CATEGORY.Regional]: "regional",
915
+ [ERROR_CATEGORY.Provider]: "provider",
916
+ [ERROR_CATEGORY.Queue]: "queue",
917
+ [ERROR_CATEGORY.Webhook]: "webhook",
918
+ [ERROR_CATEGORY.Template]: "template",
919
+ [ERROR_CATEGORY.Configuration]: "configuration",
920
+ [ERROR_CATEGORY.Processing]: "processing",
921
+ [ERROR_CATEGORY.Fraud]: "fraud",
922
+ [ERROR_CATEGORY.Compliance]: "compliance",
923
+ [ERROR_CATEGORY.Limits]: "limits",
924
+ [ERROR_CATEGORY.System]: "system",
925
+ [ERROR_CATEGORY.Refund]: "refund",
926
+ [ERROR_CATEGORY.Security]: "security",
927
+ [ERROR_CATEGORY.FileOperation]: "fileOperation",
928
+ [ERROR_CATEGORY.Plugin]: "plugin",
929
+ [ERROR_CATEGORY.Quota]: "quota",
930
+ [ERROR_CATEGORY.Database]: "database",
931
+ [ERROR_CATEGORY.Unknown]: "unknown"
932
+ };
933
+ var COMMON_OPERATIONS = {
934
+ // Data operations
935
+ STORAGE: "storage",
936
+ RETRIEVAL: "retrieval",
937
+ INVALIDATION: "invalidation",
938
+ DELETION: "deletion",
939
+ // Processing operations
940
+ VALIDATION: "validation",
941
+ ENRICHMENT: "enrichment",
942
+ SERIALIZATION: "serialization",
943
+ DESERIALIZATION: "deserialization",
944
+ // API operations
945
+ REQUEST: "request",
946
+ RESPONSE: "response",
947
+ RETRY: "retry",
948
+ REVALIDATION: "revalidation",
949
+ POLLING: "polling",
950
+ // Configuration operations
951
+ INITIALIZATION: "initialization",
952
+ CONFIGURATION: "configuration",
953
+ PRESET_LOOKUP: "preset-lookup",
954
+ REGIONAL_DETECTION: "regional-detection",
955
+ // Strategy operations
956
+ STRATEGY_EXECUTION: "strategy-execution",
957
+ FALLBACK: "fallback",
958
+ // Event operations
959
+ SUBSCRIPTION: "subscription",
960
+ PUBLICATION: "publication",
961
+ EVENT_HANDLING: "event-handling",
962
+ // Debugging operations
963
+ DEBUG: "debug",
964
+ DEBUG_TRACKING: "debug-tracking",
965
+ TRACKING: "tracking",
966
+ MONITORING: "monitoring",
967
+ // Network operations
968
+ NETWORK_CHECK: "network-check",
969
+ ENDPOINT_BUILD: "endpoint-build",
970
+ CONTEXT_SETUP: "context-setup",
971
+ // Notification operations
972
+ SEND: "send",
973
+ RENDER: "render",
974
+ QUEUE: "queue",
975
+ PROCESS: "process"
976
+ };
977
+ var COMMON_FIELDS = {
978
+ // Storage fields
979
+ STORAGE: "storage",
980
+ CACHE: "cache",
981
+ // Configuration fields
982
+ CONFIG: "config",
983
+ PRESET_NAME: "presetName",
984
+ PRESET_ID: "presetId",
985
+ // HTTP fields
986
+ HEADERS: "headers",
987
+ URL: "url",
988
+ METHOD: "method",
989
+ // Strategy fields
990
+ STRATEGY: "strategy",
991
+ // Retry fields
992
+ RETRY_COUNT: "retryCount",
993
+ MAX_RETRIES: "maxRetries",
994
+ // Polling fields
995
+ POLLING_INTERVAL: "pollingInterval",
996
+ // Event fields
997
+ TOPIC: "topic",
998
+ CHANNEL: "channel",
999
+ // API fields
1000
+ ENDPOINT: "endpoint",
1001
+ CLIENT: "client",
1002
+ // Network fields
1003
+ NETWORK_TYPE: "networkType",
1004
+ TIME_INTERVAL: "timeInterval",
1005
+ // Notification fields
1006
+ EMAIL: "email",
1007
+ PHONE: "phoneNumber",
1008
+ RECIPIENT: "recipient",
1009
+ TEMPLATE: "template",
1010
+ PROVIDER: "provider"
1011
+ };
1012
+ var COMMON_STORAGE_TYPES = {
1013
+ PRIMARY: "primary",
1014
+ FALLBACK: "fallback",
1015
+ MEMORY: "memory",
1016
+ SESSION: "session",
1017
+ LOCAL: "local",
1018
+ REDIS: "redis",
1019
+ DATABASE: "database"
1020
+ };
1021
+ var ERROR_EXCEPTIONS_NAMESPACES = {
1022
+ BASE: "base",
1023
+ API: "api",
1024
+ AUTH: "auth",
1025
+ NOTIFICATIONS: "notifications",
1026
+ STORAGE: "storage",
1027
+ DB: "db",
1028
+ VALIDATION: "validation",
1029
+ GENERIC: "generic",
1030
+ PAYMENTS: "payments",
1031
+ ERRORS: "errors",
1032
+ LOGGER: "logger",
1033
+ TYPES: "types",
1034
+ CONFIG: "config",
1035
+ UTILS: "utils",
1036
+ EVENTS: "events",
1037
+ TRANSLATIONS: "translations",
1038
+ UI: "ui",
1039
+ TESTING: "testing",
1040
+ CORE: "core",
1041
+ STORE: "store",
1042
+ WEB3: "web3",
1043
+ MONITORING: "monitoring",
1044
+ HOOKS: "hooks",
1045
+ COMMON: "common",
1046
+ COMPLIANCE: "compliance",
1047
+ PAYMENT_WEBHOOKS: "payment-webhook"
1048
+ };
1049
+
944
1050
  // src/errors/codes.ts
945
1051
  var ERROR_CODES = {
946
1052
  // ===== Generic/Common Errors =====
@@ -8741,6 +8847,7 @@ exports.API_ERROR_CODES = API_ERROR_CODES;
8741
8847
  exports.APP_CONTEXTS = APP_CONTEXTS;
8742
8848
  exports.ATHLETE_PROFILE_ERRORS = ATHLETE_PROFILE_ERRORS;
8743
8849
  exports.AUDIT_OPERATION = AUDIT_OPERATION;
8850
+ exports.AUTH_ERROR_DEFINITIONS = AUTH_ERROR_DEFINITIONS;
8744
8851
  exports.AUTH_PROVIDER = AUTH_PROVIDER;
8745
8852
  exports.AUTH_PROVIDER_TYPE = AUTH_PROVIDER_TYPE;
8746
8853
  exports.ApiEventAction = ApiEventAction;