@plyaz/api 1.2.2 → 1.4.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.
Files changed (170) hide show
  1. package/dist/api/client/clientEventManager.d.ts +8 -2
  2. package/dist/api/client/clientEventManager.d.ts.map +1 -1
  3. package/dist/api/client/createApiClient.d.ts.map +1 -1
  4. package/dist/api/client/helpers/interceptors.d.ts +2 -2
  5. package/dist/api/client/helpers/interceptors.d.ts.map +1 -1
  6. package/dist/api/config/global.d.ts.map +1 -1
  7. package/dist/api/debugger/DebugReport.d.ts.map +1 -1
  8. package/dist/api/debugger/UnifiedDebugger.d.ts.map +1 -1
  9. package/dist/api/debugger/queue/DebuggerQueueManager.d.ts.map +1 -1
  10. package/dist/api/debugger/queue/OperationTracker.d.ts.map +1 -1
  11. package/dist/api/endpoints/campaigns.d.ts.map +1 -1
  12. package/dist/api/endpoints/cdn.d.ts +122 -0
  13. package/dist/api/endpoints/cdn.d.ts.map +1 -0
  14. package/dist/api/endpoints/index.d.ts +89 -4
  15. package/dist/api/endpoints/index.d.ts.map +1 -1
  16. package/dist/api/endpoints/infobip.d.ts +209 -0
  17. package/dist/api/endpoints/infobip.d.ts.map +1 -0
  18. package/dist/api/endpoints/virustotal.d.ts +91 -0
  19. package/dist/api/endpoints/virustotal.d.ts.map +1 -0
  20. package/dist/api/errors/adapter.d.ts +71 -0
  21. package/dist/api/errors/adapter.d.ts.map +1 -0
  22. package/dist/api/errors/index.d.ts +3 -15
  23. package/dist/api/errors/index.d.ts.map +1 -1
  24. package/dist/api/events/EventManager.d.ts.map +1 -1
  25. package/dist/api/events/factories/base.d.ts +11 -3
  26. package/dist/api/events/factories/base.d.ts.map +1 -1
  27. package/dist/api/events/factories/errors.d.ts +10 -10
  28. package/dist/api/events/factories/errors.d.ts.map +1 -1
  29. package/dist/api/events/queue/ConfigUpdateQueueManager.d.ts.map +1 -1
  30. package/dist/api/events/queue/EventQueueManager.d.ts.map +1 -1
  31. package/dist/api/headers/headerBuilder.d.ts.map +1 -1
  32. package/dist/api/hooks/factories/createApiMutation.d.ts +3 -3
  33. package/dist/api/hooks/factories/createApiMutation.d.ts.map +1 -1
  34. package/dist/api/hooks/factories/createApiQuery.d.ts +3 -3
  35. package/dist/api/hooks/factories/createApiQuery.d.ts.map +1 -1
  36. package/dist/api/hooks/index.d.ts +0 -1
  37. package/dist/api/hooks/index.d.ts.map +1 -1
  38. package/dist/api/index.d.ts +1 -1
  39. package/dist/api/index.d.ts.map +1 -1
  40. package/dist/api/network/frameworks/express.d.ts.map +1 -1
  41. package/dist/api/network/frameworks/nestjs/decorators.d.ts +9 -1
  42. package/dist/api/network/frameworks/nestjs/decorators.d.ts.map +1 -1
  43. package/dist/api/network/frameworks/nestjs/enrichedHeadersGuard.d.ts.map +1 -1
  44. package/dist/api/network/frameworks/nestjs/enrichedHeadersInterceptor.d.ts.map +1 -1
  45. package/dist/api/network/networkConfigurationManager.d.ts.map +1 -1
  46. package/dist/api/network/status.d.ts +1 -4
  47. package/dist/api/network/status.d.ts.map +1 -1
  48. package/dist/api/performance/performanceMonitor.d.ts.map +1 -1
  49. package/dist/api/polling/index.d.ts +1 -1
  50. package/dist/api/polling/index.d.ts.map +1 -1
  51. package/dist/api/polling/strategies.d.ts +1 -5
  52. package/dist/api/polling/strategies.d.ts.map +1 -1
  53. package/dist/api/polling/utils.d.ts.map +1 -1
  54. package/dist/api/pubsub/index.d.ts.map +1 -1
  55. package/dist/api/pubsub/react.d.ts +6 -10
  56. package/dist/api/pubsub/react.d.ts.map +1 -1
  57. package/dist/api/queue/BaseOperationTracker.d.ts.map +1 -1
  58. package/dist/api/queue/EventQueueManager.d.ts.map +1 -1
  59. package/dist/api/queue/QueueOrchestrator.d.ts.map +1 -1
  60. package/dist/api/services/campaigns/GET/useCampaign.d.ts +1 -1
  61. package/dist/api/services/campaigns/GET/useCampaign.d.ts.map +1 -1
  62. package/dist/api/services/campaigns/GET/useCampaignParticipants.d.ts +1 -11
  63. package/dist/api/services/campaigns/GET/useCampaignParticipants.d.ts.map +1 -1
  64. package/dist/api/services/campaigns/GET/useCampaignStats.d.ts +1 -1
  65. package/dist/api/services/campaigns/GET/useCampaignStats.d.ts.map +1 -1
  66. package/dist/api/services/campaigns/GET/useCampaigns.d.ts +1 -1
  67. package/dist/api/services/campaigns/GET/useCampaigns.d.ts.map +1 -1
  68. package/dist/api/services/campaigns/PUT/useUpdateCampaign.d.ts +1 -9
  69. package/dist/api/services/campaigns/PUT/useUpdateCampaign.d.ts.map +1 -1
  70. package/dist/api/services/cdn/cloudflare/POST/cloudflarePurgeCache.d.ts +35 -0
  71. package/dist/api/services/cdn/cloudflare/POST/cloudflarePurgeCache.d.ts.map +1 -0
  72. package/dist/api/services/cdn/cloudflare/POST/index.d.ts +5 -0
  73. package/dist/api/services/cdn/cloudflare/POST/index.d.ts.map +1 -0
  74. package/dist/api/services/cdn/cloudflare/index.d.ts +5 -0
  75. package/dist/api/services/cdn/cloudflare/index.d.ts.map +1 -0
  76. package/dist/api/services/cdn/cloudfront/POST/cloudFrontCreateInvalidation.d.ts +38 -0
  77. package/dist/api/services/cdn/cloudfront/POST/cloudFrontCreateInvalidation.d.ts.map +1 -0
  78. package/dist/api/services/cdn/cloudfront/POST/index.d.ts +5 -0
  79. package/dist/api/services/cdn/cloudfront/POST/index.d.ts.map +1 -0
  80. package/dist/api/services/cdn/cloudfront/index.d.ts +5 -0
  81. package/dist/api/services/cdn/cloudfront/index.d.ts.map +1 -0
  82. package/dist/api/services/cdn/fastly/POST/fastlyPurgeUrl.d.ts +35 -0
  83. package/dist/api/services/cdn/fastly/POST/fastlyPurgeUrl.d.ts.map +1 -0
  84. package/dist/api/services/cdn/fastly/POST/index.d.ts +5 -0
  85. package/dist/api/services/cdn/fastly/POST/index.d.ts.map +1 -0
  86. package/dist/api/services/cdn/fastly/index.d.ts +5 -0
  87. package/dist/api/services/cdn/fastly/index.d.ts.map +1 -0
  88. package/dist/api/services/cdn/index.d.ts +8 -0
  89. package/dist/api/services/cdn/index.d.ts.map +1 -0
  90. package/dist/api/services/index.d.ts +3 -0
  91. package/dist/api/services/index.d.ts.map +1 -1
  92. package/dist/api/services/infobip/email/GET/fetchEmailLogs.d.ts +50 -0
  93. package/dist/api/services/infobip/email/GET/fetchEmailLogs.d.ts.map +1 -0
  94. package/dist/api/services/infobip/email/GET/fetchEmailReports.d.ts +44 -0
  95. package/dist/api/services/infobip/email/GET/fetchEmailReports.d.ts.map +1 -0
  96. package/dist/api/services/infobip/email/GET/fetchScheduledEmailStatuses.d.ts +28 -0
  97. package/dist/api/services/infobip/email/GET/fetchScheduledEmailStatuses.d.ts.map +1 -0
  98. package/dist/api/services/infobip/email/GET/fetchScheduledEmails.d.ts +27 -0
  99. package/dist/api/services/infobip/email/GET/fetchScheduledEmails.d.ts.map +1 -0
  100. package/dist/api/services/infobip/email/GET/fetchValidations.d.ts +60 -0
  101. package/dist/api/services/infobip/email/GET/fetchValidations.d.ts.map +1 -0
  102. package/dist/api/services/infobip/email/GET/index.d.ts +10 -0
  103. package/dist/api/services/infobip/email/GET/index.d.ts.map +1 -0
  104. package/dist/api/services/infobip/email/POST/bulkValidateEmails.d.ts +50 -0
  105. package/dist/api/services/infobip/email/POST/bulkValidateEmails.d.ts.map +1 -0
  106. package/dist/api/services/infobip/email/POST/index.d.ts +9 -0
  107. package/dist/api/services/infobip/email/POST/index.d.ts.map +1 -0
  108. package/dist/api/services/infobip/email/POST/sendAdvancedEmail.d.ts +67 -0
  109. package/dist/api/services/infobip/email/POST/sendAdvancedEmail.d.ts.map +1 -0
  110. package/dist/api/services/infobip/email/POST/sendEmail.d.ts +60 -0
  111. package/dist/api/services/infobip/email/POST/sendEmail.d.ts.map +1 -0
  112. package/dist/api/services/infobip/email/POST/validateEmail.d.ts +40 -0
  113. package/dist/api/services/infobip/email/POST/validateEmail.d.ts.map +1 -0
  114. package/dist/api/services/infobip/email/PUT/index.d.ts +7 -0
  115. package/dist/api/services/infobip/email/PUT/index.d.ts.map +1 -0
  116. package/dist/api/services/infobip/email/PUT/rescheduleEmails.d.ts +29 -0
  117. package/dist/api/services/infobip/email/PUT/rescheduleEmails.d.ts.map +1 -0
  118. package/dist/api/services/infobip/email/PUT/updateScheduledEmailStatuses.d.ts +36 -0
  119. package/dist/api/services/infobip/email/PUT/updateScheduledEmailStatuses.d.ts.map +1 -0
  120. package/dist/api/services/infobip/email/index.d.ts +8 -0
  121. package/dist/api/services/infobip/email/index.d.ts.map +1 -0
  122. package/dist/api/services/infobip/index.d.ts +6 -0
  123. package/dist/api/services/infobip/index.d.ts.map +1 -0
  124. package/dist/api/services/virustotal/analyses/GET/getAnalysisResult.d.ts +35 -0
  125. package/dist/api/services/virustotal/analyses/GET/getAnalysisResult.d.ts.map +1 -0
  126. package/dist/api/services/virustotal/analyses/GET/index.d.ts +6 -0
  127. package/dist/api/services/virustotal/analyses/GET/index.d.ts.map +1 -0
  128. package/dist/api/services/virustotal/analyses/index.d.ts +6 -0
  129. package/dist/api/services/virustotal/analyses/index.d.ts.map +1 -0
  130. package/dist/api/services/virustotal/files/POST/index.d.ts +6 -0
  131. package/dist/api/services/virustotal/files/POST/index.d.ts.map +1 -0
  132. package/dist/api/services/virustotal/files/POST/uploadFileForScanning.d.ts +36 -0
  133. package/dist/api/services/virustotal/files/POST/uploadFileForScanning.d.ts.map +1 -0
  134. package/dist/api/services/virustotal/files/index.d.ts +6 -0
  135. package/dist/api/services/virustotal/files/index.d.ts.map +1 -0
  136. package/dist/api/services/virustotal/index.d.ts +8 -0
  137. package/dist/api/services/virustotal/index.d.ts.map +1 -0
  138. package/dist/api/utils/aws/index.d.ts +7 -0
  139. package/dist/api/utils/aws/index.d.ts.map +1 -0
  140. package/dist/api/utils/aws/signature-v4.d.ts +41 -0
  141. package/dist/api/utils/aws/signature-v4.d.ts.map +1 -0
  142. package/dist/api/utils/aws/xml/cloudfront.d.ts +37 -0
  143. package/dist/api/utils/aws/xml/cloudfront.d.ts.map +1 -0
  144. package/dist/api/utils/aws/xml/index.d.ts +6 -0
  145. package/dist/api/utils/aws/xml/index.d.ts.map +1 -0
  146. package/dist/api/utils/index.d.ts +0 -3
  147. package/dist/api/utils/index.d.ts.map +1 -1
  148. package/dist/index.cjs +1586 -1384
  149. package/dist/index.cjs.map +1 -1
  150. package/dist/index.mjs +1522 -1354
  151. package/dist/index.mjs.map +1 -1
  152. package/package.json +7 -5
  153. package/dist/api/errors/ApiPackageError.d.ts +0 -101
  154. package/dist/api/errors/ApiPackageError.d.ts.map +0 -1
  155. package/dist/api/errors/definitions.d.ts +0 -24
  156. package/dist/api/errors/definitions.d.ts.map +0 -1
  157. package/dist/api/errors/error-codes.d.ts +0 -116
  158. package/dist/api/errors/error-codes.d.ts.map +0 -1
  159. package/dist/api/errors/error-events.d.ts +0 -63
  160. package/dist/api/errors/error-events.d.ts.map +0 -1
  161. package/dist/api/errors/types-constants.d.ts +0 -64
  162. package/dist/api/errors/types-constants.d.ts.map +0 -1
  163. package/dist/api/hooks/types.d.ts +0 -82
  164. package/dist/api/hooks/types.d.ts.map +0 -1
  165. package/dist/api/utils/generation/correlation-id.d.ts +0 -206
  166. package/dist/api/utils/generation/correlation-id.d.ts.map +0 -1
  167. package/dist/api/utils/generation/id-generator.d.ts +0 -133
  168. package/dist/api/utils/generation/id-generator.d.ts.map +0 -1
  169. package/dist/api/utils/generation/request-id.d.ts +0 -106
  170. package/dist/api/utils/generation/request-id.d.ts.map +0 -1
@@ -1,206 +0,0 @@
1
- /**
2
- * Correlation ID Generation Utilities
3
- * Provides correlation-specific ID generation for distributed tracing and event correlation
4
- */
5
- import { CORRELATION_TYPE, type IdGenerationOptions } from '@plyaz/types/api';
6
- /**
7
- * Generate a correlation ID
8
- * Uses timestamp-based format for efficient sorting and tracing
9
- *
10
- * @param type - Type of correlation (defaults to GENERIC)
11
- * @param options - Optional ID generation options
12
- * @returns Correlation identifier
13
- *
14
- * @example
15
- * ```typescript
16
- * const correlationId = generateCorrelationId();
17
- * // 'corr_1a2b3c4d_5e6f7g8h'
18
- *
19
- * const networkId = generateCorrelationId(CORRELATION_TYPE.NETWORK);
20
- * // 'net_1a2b3c4d_5e6f7g8h'
21
- *
22
- * const apiId = generateCorrelationId(CORRELATION_TYPE.API);
23
- * // 'api_1a2b3c4d_5e6f7g8h'
24
- * ```
25
- */
26
- export declare function generateCorrelationId(type?: CORRELATION_TYPE | string, options?: IdGenerationOptions): string;
27
- /**
28
- * Generate a contextual correlation ID
29
- * Includes context information for better tracing
30
- *
31
- * @param context - Context information
32
- * @param type - Type of correlation
33
- * @param options - Optional ID generation options
34
- * @returns Contextualized correlation ID
35
- *
36
- * @example
37
- * ```typescript
38
- * const correlationId = generateContextualCorrelationId({
39
- * service: 'api',
40
- * operation: 'getUserProfile'
41
- * });
42
- * // 'api:getUserProfile:corr_1a2b3c4d_5e6f7g8h'
43
- *
44
- * const networkId = generateContextualCorrelationId(
45
- * { quality: 'POOR', trigger: 'rtt' },
46
- * CORRELATION_TYPE.NETWORK
47
- * );
48
- * // 'POOR:rtt:net_1a2b3c4d_5e6f7g8h'
49
- * ```
50
- */
51
- export declare function generateContextualCorrelationId(context: Record<string, string | number | undefined>, type?: CORRELATION_TYPE | string, options?: IdGenerationOptions): string;
52
- /**
53
- * Generate a network correlation ID
54
- * Specialized for network event correlation
55
- *
56
- * @param options - Optional ID generation options
57
- * @returns Network correlation identifier
58
- *
59
- * @example
60
- * ```typescript
61
- * const networkId = generateNetworkCorrelationId();
62
- * // 'net_1a2b3c4d_5e6f7g8h'
63
- * ```
64
- */
65
- export declare function generateNetworkCorrelationId(options?: IdGenerationOptions): string;
66
- /**
67
- * Generate an API correlation ID
68
- * Specialized for API request correlation
69
- *
70
- * @param options - Optional ID generation options
71
- * @returns API correlation identifier
72
- *
73
- * @example
74
- * ```typescript
75
- * const apiId = generateApiCorrelationId();
76
- * // 'api_1a2b3c4d_5e6f7g8h'
77
- * ```
78
- */
79
- export declare function generateApiCorrelationId(options?: IdGenerationOptions): string;
80
- /**
81
- * Generate a session correlation ID
82
- * Specialized for user session correlation
83
- *
84
- * @param options - Optional ID generation options
85
- * @returns Session correlation identifier
86
- *
87
- * @example
88
- * ```typescript
89
- * const sessionId = generateSessionCorrelationId();
90
- * // 'session_1a2b3c4d_5e6f7g8h'
91
- * ```
92
- */
93
- export declare function generateSessionCorrelationId(options?: IdGenerationOptions): string;
94
- /**
95
- * Generate a trace correlation ID
96
- * Specialized for distributed tracing
97
- *
98
- * @param options - Optional ID generation options
99
- * @returns Trace correlation identifier
100
- *
101
- * @example
102
- * ```typescript
103
- * const traceId = generateTraceCorrelationId();
104
- * // 'trace_1a2b3c4d_5e6f7g8h'
105
- * ```
106
- */
107
- export declare function generateTraceCorrelationId(options?: IdGenerationOptions): string;
108
- /**
109
- * Extract base correlation ID from contextual correlation ID
110
- * Removes context and prefix to get the core ID
111
- *
112
- * @param contextualId - Contextual correlation ID
113
- * @returns Base correlation ID
114
- *
115
- * @example
116
- * ```typescript
117
- * const baseId = extractBaseCorrelationId('api:getUserProfile:corr_1a2b3c4d_5e6f7g8h');
118
- * // '1a2b3c4d_5e6f7g8h'
119
- *
120
- * const baseId = extractBaseCorrelationId('net_1a2b3c4d_5e6f7g8h');
121
- * // '1a2b3c4d_5e6f7g8h'
122
- * ```
123
- */
124
- export declare function extractBaseCorrelationId(contextualId: string): string;
125
- /**
126
- * Extract correlation type from ID
127
- *
128
- * @param id - Correlation ID
129
- * @returns Correlation type or undefined
130
- *
131
- * @example
132
- * ```typescript
133
- * const type = extractCorrelationType('net_1a2b3c4d_5e6f7g8h');
134
- * // 'net'
135
- *
136
- * const type = extractCorrelationType('api:getUserProfile:api_1a2b3c4d_5e6f7g8h');
137
- * // 'api'
138
- * ```
139
- */
140
- export declare function extractCorrelationType(id: string): CORRELATION_TYPE | undefined;
141
- /**
142
- * Check if a string is a valid correlation ID format
143
- *
144
- * @param id - String to check
145
- * @returns True if valid correlation ID format
146
- *
147
- * @example
148
- * ```typescript
149
- * isValidCorrelationId('corr_1a2b3c4d_5e6f7g8h'); // true
150
- * isValidCorrelationId('net_1a2b3c4d_5e6f7g8h'); // true
151
- * isValidCorrelationId('api:getUserProfile:api_1a2b3c4d_5e6f7g8h'); // true
152
- * isValidCorrelationId('invalid'); // false
153
- * ```
154
- */
155
- export declare function isValidCorrelationId(id: string): boolean;
156
- /**
157
- * Create a correlation ID generator with custom options
158
- *
159
- * @param type - Default correlation type
160
- * @param defaultOptions - Default options for the generator
161
- * @returns Custom correlation ID generator
162
- *
163
- * @example
164
- * ```typescript
165
- * const generateServiceCorrelationId = createCorrelationIdGenerator(
166
- * 'service',
167
- * { randomLength: 12 }
168
- * );
169
- *
170
- * const id = generateServiceCorrelationId();
171
- * // 'service_1a2b3c4d_5e6f7g8h9i0j'
172
- * ```
173
- */
174
- export declare function createCorrelationIdGenerator(type?: CORRELATION_TYPE | string, defaultOptions?: IdGenerationOptions): (options?: IdGenerationOptions) => string;
175
- /**
176
- * Link multiple correlation IDs together
177
- * Useful for tracing related operations
178
- *
179
- * @param ids - Correlation IDs to link
180
- * @param separator - Separator for linked IDs
181
- * @returns Linked correlation ID
182
- *
183
- * @example
184
- * ```typescript
185
- * const linkedId = linkCorrelationIds(
186
- * 'api_1a2b3c4d_5e6f7g8h',
187
- * 'net_9i0j1k2l_3m4n5o6p'
188
- * );
189
- * // 'api_1a2b3c4d_5e6f7g8h->net_9i0j1k2l_3m4n5o6p'
190
- * ```
191
- */
192
- export declare function linkCorrelationIds(...ids: string[]): string;
193
- /**
194
- * Extract linked correlation IDs
195
- *
196
- * @param linkedId - Linked correlation ID
197
- * @returns Array of individual correlation IDs
198
- *
199
- * @example
200
- * ```typescript
201
- * const ids = extractLinkedCorrelationIds('api_1a2b3c4d_5e6f7g8h->net_9i0j1k2l_3m4n5o6p');
202
- * // ['api_1a2b3c4d_5e6f7g8h', 'net_9i0j1k2l_3m4n5o6p']
203
- * ```
204
- */
205
- export declare function extractLinkedCorrelationIds(linkedId: string): string[];
206
- //# sourceMappingURL=correlation-id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"correlation-id.d.ts","sourceRoot":"","sources":["../../../../src/api/utils/generation/correlation-id.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA+B9E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,GAAE,gBAAgB,GAAG,MAAiC,EAC1D,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CAGR;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EACpD,IAAI,GAAE,gBAAgB,GAAG,MAAiC,EAC1D,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CASR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAElF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAE9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAElF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAEhF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAcrE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAqB/E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAexD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,GAAE,gBAAgB,GAAG,MAAiC,EAC1D,cAAc,GAAE,mBAAwB,GACvC,CAAC,OAAO,CAAC,EAAE,mBAAmB,KAAK,MAAM,CAS3C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,CAE3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAEtE"}
@@ -1,133 +0,0 @@
1
- /**
2
- * Base ID Generation Utilities
3
- * Provides core ID generation functionality for request IDs, correlation IDs, and other identifiers
4
- */
5
- import type { IdGenerationOptions } from '@plyaz/types/api';
6
- /**
7
- * Generate a base unique identifier
8
- * Core function used by all ID generators
9
- *
10
- * @param options - ID generation options
11
- * @returns Generated unique identifier
12
- *
13
- * @example
14
- * ```typescript
15
- * // UUID-based ID
16
- * const id = generateBaseId();
17
- * // '550e8400-e29b-41d4-a716-446655440000'
18
- *
19
- * // Timestamp-based ID
20
- * const id = generateBaseId({ useTimestamp: true });
21
- * // '1a2b3c4d5e_f6g7h8i9'
22
- *
23
- * // With prefix
24
- * const id = generateBaseId({ prefix: 'req' });
25
- * // 'req_550e8400-e29b-41d4-a716-446655440000'
26
- * ```
27
- */
28
- export declare function generateBaseId(options?: IdGenerationOptions): string;
29
- /**
30
- * Generate a contextual ID with metadata
31
- * Includes context information for debugging and tracing
32
- *
33
- * @param context - Context object with metadata
34
- * @param options - ID generation options
35
- * @returns Contextualized ID
36
- *
37
- * @example
38
- * ```typescript
39
- * const id = generateContextualId({
40
- * method: 'GET',
41
- * path: '/api/users'
42
- * });
43
- * // 'GET:/api/users:550e8400-e29b-41d4-a716-446655440000'
44
- * ```
45
- */
46
- export declare function generateContextualId(context: Record<string, string | number | undefined>, options?: IdGenerationOptions): string;
47
- /**
48
- * Extract base ID from a contextualized or prefixed ID
49
- *
50
- * @param id - Full ID with context or prefix
51
- * @param options - Options for extraction
52
- * @returns Base ID without context or prefix
53
- *
54
- * @example
55
- * ```typescript
56
- * const baseId = extractBaseId('req_550e8400-e29b-41d4-a716-446655440000');
57
- * // '550e8400-e29b-41d4-a716-446655440000'
58
- *
59
- * const baseId = extractBaseId('GET:/api/users:550e8400-e29b-41d4-a716-446655440000');
60
- * // '550e8400-e29b-41d4-a716-446655440000'
61
- * ```
62
- */
63
- export declare function extractBaseId(id: string, options?: {
64
- separator?: string;
65
- extractLast?: boolean;
66
- }): string;
67
- /**
68
- * Validate ID format
69
- * Checks if string matches expected ID patterns
70
- *
71
- * @param id - String to validate
72
- * @param options - Validation options
73
- * @returns True if valid ID format
74
- *
75
- * @example
76
- * ```typescript
77
- * isValidId('550e8400-e29b-41d4-a716-446655440000'); // true (UUID)
78
- * isValidId('req_123456'); // true (prefixed)
79
- * isValidId('net_1a2b3c_4d5e6f'); // true (timestamp)
80
- * isValidId('invalid'); // false
81
- * ```
82
- */
83
- export declare function isValidId(id: string, options?: {
84
- allowUuid?: boolean;
85
- allowTimestamp?: boolean;
86
- allowPrefix?: boolean;
87
- minLength?: number;
88
- }): boolean;
89
- /**
90
- * Parse an ID to extract its components
91
- *
92
- * @param id - ID to parse
93
- * @param options - Parsing options
94
- * @returns Parsed components
95
- *
96
- * @example
97
- * ```typescript
98
- * const parts = parseId('req_123_abc');
99
- * // { prefix: 'req', core: '123', suffix: 'abc' }
100
- *
101
- * const parts = parseId('GET:/api/users:550e8400');
102
- * // { context: 'GET:/api/users', core: '550e8400' }
103
- * ```
104
- */
105
- export declare function parseId(id: string, options?: {
106
- separator?: string;
107
- }): {
108
- prefix?: string;
109
- core: string;
110
- suffix?: string;
111
- context?: string;
112
- full: string;
113
- };
114
- /**
115
- * Create a custom ID generator with preset options
116
- *
117
- * @param defaultOptions - Default options for the generator
118
- * @returns Custom ID generator function
119
- *
120
- * @example
121
- * ```typescript
122
- * const generateRequestId = createIdGenerator({ prefix: 'req' });
123
- * const generateCorrelationId = createIdGenerator({
124
- * prefix: 'corr',
125
- * useTimestamp: true
126
- * });
127
- *
128
- * const reqId = generateRequestId(); // 'req_550e8400-...'
129
- * const corrId = generateCorrelationId(); // 'corr_1a2b3c_4d5e6f'
130
- * ```
131
- */
132
- export declare function createIdGenerator(defaultOptions?: IdGenerationOptions): (options?: IdGenerationOptions) => string;
133
- //# sourceMappingURL=id-generator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"id-generator.d.ts","sourceRoot":"","sources":["../../../../src/api/utils/generation/id-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA4B5D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAoCxE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EACpD,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAgBR;AAwDD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1D,MAAM,CAQR;AAmGD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CACvB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,OAAO,CAST;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CACrB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACnC;IACD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAoCA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,GAAE,mBAAwB,GACvC,CAAC,OAAO,CAAC,EAAE,mBAAmB,KAAK,MAAM,CAI3C"}
@@ -1,106 +0,0 @@
1
- /**
2
- * Request ID Generation Utilities
3
- * Provides request-specific ID generation using the base ID generator
4
- */
5
- import type { IdGenerationOptions } from '@plyaz/types/api';
6
- /**
7
- * Generate a unique request ID
8
- * Uses UUID format with 'req' prefix for guaranteed uniqueness
9
- *
10
- * @param options - Optional ID generation options to override defaults
11
- * @returns Unique request identifier
12
- *
13
- * @example
14
- * ```typescript
15
- * const requestId = generateRequestId();
16
- * // 'req_550e8400-e29b-41d4-a716-446655440000'
17
- * ```
18
- */
19
- export declare function generateRequestId(options?: IdGenerationOptions): string;
20
- /**
21
- * Generate a request ID with context
22
- * Includes method and URL information for debugging
23
- *
24
- * @param method - HTTP method
25
- * @param url - Request URL
26
- * @param options - Optional ID generation options
27
- * @returns Contextualized request ID
28
- *
29
- * @example
30
- * ```typescript
31
- * const requestId = generateContextualRequestId('GET', '/api/users');
32
- * // 'GET:/api/users:req_550e8400-e29b-41d4-a716-446655440000'
33
- *
34
- * const requestId = generateContextualRequestId('POST', '/api/data', {
35
- * useTimestamp: true
36
- * });
37
- * // 'POST:/api/data:req_1a2b3c4d_5e6f7g8h'
38
- * ```
39
- */
40
- export declare function generateContextualRequestId(method?: string, url?: string, options?: IdGenerationOptions): string;
41
- /**
42
- * Extract base request ID from contextual request ID
43
- * Removes context and prefix to get the core ID
44
- *
45
- * @param contextualId - Contextual request ID
46
- * @returns Base request ID
47
- *
48
- * @example
49
- * ```typescript
50
- * const baseId = extractBaseRequestId('GET:/api/users:req_550e8400-e29b-41d4-a716-446655440000');
51
- * // '550e8400-e29b-41d4-a716-446655440000'
52
- *
53
- * const baseId = extractBaseRequestId('req_550e8400-e29b-41d4-a716-446655440000');
54
- * // '550e8400-e29b-41d4-a716-446655440000'
55
- * ```
56
- */
57
- export declare function extractBaseRequestId(contextualId: string): string;
58
- /**
59
- * Check if a string is a valid request ID format
60
- *
61
- * @param id - String to check
62
- * @returns True if valid request ID format
63
- *
64
- * @example
65
- * ```typescript
66
- * isValidRequestId('req_550e8400-e29b-41d4-a716-446655440000'); // true
67
- * isValidRequestId('GET:/api:req_550e8400-e29b-41d4-a716-446655440000'); // true
68
- * isValidRequestId('550e8400-e29b-41d4-a716-446655440000'); // true (UUID)
69
- * isValidRequestId('invalid'); // false
70
- * ```
71
- */
72
- export declare function isValidRequestId(id: string): boolean;
73
- /**
74
- * Generate a short request ID for logging
75
- * Useful when you need a shorter identifier
76
- *
77
- * @param options - Optional ID generation options
78
- * @returns Short request identifier
79
- *
80
- * @example
81
- * ```typescript
82
- * const shortId = generateShortRequestId();
83
- * // 'req_1a2b3c4d_5e6f7g8h'
84
- * ```
85
- */
86
- export declare function generateShortRequestId(options?: IdGenerationOptions): string;
87
- /**
88
- * Create a request ID generator with custom options
89
- * Useful for creating specialized request ID generators
90
- *
91
- * @param defaultOptions - Default options for the generator
92
- * @returns Custom request ID generator
93
- *
94
- * @example
95
- * ```typescript
96
- * const generateApiRequestId = createRequestIdGenerator({
97
- * prefix: 'api-req',
98
- * useTimestamp: true
99
- * });
100
- *
101
- * const id = generateApiRequestId();
102
- * // 'api-req_1a2b3c4d_5e6f7g8h'
103
- * ```
104
- */
105
- export declare function createRequestIdGenerator(defaultOptions?: IdGenerationOptions): (options?: IdGenerationOptions) => string;
106
- //# sourceMappingURL=request-id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-id.d.ts","sourceRoot":"","sources":["../../../../src/api/utils/generation/request-id.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAiB5D;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAEvE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CAYR;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAUjE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAQpD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAM5E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,GAAE,mBAAwB,GACvC,CAAC,OAAO,CAAC,EAAE,mBAAmB,KAAK,MAAM,CAK3C"}