@plyaz/types 1.13.16 → 1.14.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 (45) hide show
  1. package/dist/api/endpoints/infobip/types.d.ts +6 -1
  2. package/dist/api/errors/types.d.ts +1 -1
  3. package/dist/api/index.cjs +158 -100
  4. package/dist/api/index.cjs.map +1 -1
  5. package/dist/api/index.js +60 -2
  6. package/dist/api/index.js.map +1 -1
  7. package/dist/auth/index.cjs +12 -4196
  8. package/dist/auth/index.cjs.map +1 -1
  9. package/dist/auth/index.js +10 -6
  10. package/dist/auth/index.js.map +1 -1
  11. package/dist/auth/schemas.d.ts +20 -21
  12. package/dist/db/database.types.d.ts +1 -1
  13. package/dist/db/features-config.types.d.ts +2 -2
  14. package/dist/db/index.cjs.map +1 -1
  15. package/dist/db/index.js.map +1 -1
  16. package/dist/db/replica.types.d.ts +2 -2
  17. package/dist/errors/index.cjs +158 -100
  18. package/dist/errors/index.cjs.map +1 -1
  19. package/dist/errors/index.js +60 -2
  20. package/dist/errors/index.js.map +1 -1
  21. package/dist/errors/types.d.ts +47 -6
  22. package/dist/http/constants.d.ts +265 -0
  23. package/dist/index.cjs +761 -4344
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.ts +4 -0
  26. package/dist/index.js +600 -7
  27. package/dist/index.js.map +1 -1
  28. package/dist/locale/types.d.ts +109 -0
  29. package/dist/notifications/enums.d.ts +0 -1
  30. package/dist/notifications/index.cjs +155 -4201
  31. package/dist/notifications/index.cjs.map +1 -1
  32. package/dist/notifications/index.d.ts +11 -0
  33. package/dist/notifications/index.js +133 -1
  34. package/dist/notifications/index.js.map +1 -1
  35. package/dist/notifications/schemas.d.ts +13 -3
  36. package/dist/notifications/types.d.ts +66 -24
  37. package/dist/notifications/webhooks.schemas.d.ts +278 -0
  38. package/dist/payments/base-error/types.d.ts +1 -1
  39. package/dist/payments/gateways/provider/types.d.ts +1 -1
  40. package/dist/payments/gateways/routings/types.d.ts +1 -1
  41. package/dist/payments/provider/adapter/types.d.ts +1 -1
  42. package/dist/payments/provider/core/types.d.ts +1 -1
  43. package/dist/payments/provider/payment-provider/types.d.ts +1 -1
  44. package/dist/payments/transaction/types.d.ts +1 -1
  45. package/package.json +4 -5
package/dist/index.d.ts CHANGED
@@ -4,6 +4,8 @@ export type * from './core';
4
4
  export type * from './entities';
5
5
  export * from './errors';
6
6
  export * from './events';
7
+ export * from './http/constants';
8
+ export * from './locale/types';
7
9
  export type * from './store';
8
10
  export type * from './ui';
9
11
  export * from './web3';
@@ -13,9 +15,11 @@ export type * from './testing';
13
15
  export type * from './lib';
14
16
  export type * from './logger';
15
17
  export * from './payments';
18
+ export type * from './notifications';
16
19
  export type * from './notifications/types';
17
20
  export * from './notifications/enums';
18
21
  export * from './notifications/schemas';
22
+ export * from './notifications/webhooks.schemas';
19
23
  export * from './api/events/enum';
20
24
  export * from './api/queue/enums';
21
25
  export * from './api/headers/enum';
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { HTTP_STATUS } from '@plyaz/config';
3
2
 
4
3
  // @plyaz package - Built with tsup
5
4
  var __defProp = Object.defineProperty;
@@ -45,11 +44,15 @@ var AUTH_PROVIDER_TYPE = /* @__PURE__ */ ((AUTH_PROVIDER_TYPE2) => {
45
44
  AUTH_PROVIDER_TYPE2["InternalDb"] = "INTERNAL_DB";
46
45
  return AUTH_PROVIDER_TYPE2;
47
46
  })(AUTH_PROVIDER_TYPE || {});
48
- var loginCredentialsSchema = z.object({
49
- // The user's email address. Must be a valid email format.
50
- email: z.string().email("Invalid email format"),
51
- // The user's password. No format constraints applied here.
52
- password: z.string()
47
+ var DEFAULT_PASSWORD = 8;
48
+ var ContactUsFormSchema = z.object({
49
+ name: z.string({ error: "errors.form.missingField" }).min(1, "errors.form.nameMissing"),
50
+ email: z.email({ error: "errors.form.emailInvalid" })
51
+ });
52
+ var SignupFormSchema = z.object({
53
+ name: z.string({ error: "errors.form.missingField" }).min(1, "errors.form.nameMissing"),
54
+ email: z.email({ error: "errors.form.emailInvalid" }),
55
+ password: z.string({ error: "errors.form.missingField" }).min(DEFAULT_PASSWORD, "errors.form.passwordTooShort")
53
56
  });
54
57
 
55
58
  // src/errors/enums.ts
@@ -270,6 +273,265 @@ var COMMON_STORAGE_TYPES = {
270
273
  REDIS: "redis",
271
274
  DATABASE: "database"
272
275
  };
276
+
277
+ // src/http/constants.ts
278
+ var HTTP_STATUS = {
279
+ // 1xx Informational
280
+ /**
281
+ * 100 Continue - The initial part of a request has been received
282
+ */
283
+ CONTINUE: 100,
284
+ /**
285
+ * 101 Switching Protocols - The server is switching protocols
286
+ */
287
+ SWITCHING_PROTOCOLS: 101,
288
+ /**
289
+ * 102 Processing - The server has received and is processing the request
290
+ */
291
+ PROCESSING: 102,
292
+ /**
293
+ * 103 Early Hints - Used to return some response headers before final HTTP message
294
+ */
295
+ EARLY_HINTS: 103,
296
+ // 2xx Success
297
+ /**
298
+ * 200 OK - The request succeeded
299
+ */
300
+ OK: 200,
301
+ /**
302
+ * 201 Created - The request succeeded and a new resource was created
303
+ */
304
+ CREATED: 201,
305
+ /**
306
+ * 202 Accepted - The request has been received but not yet acted upon
307
+ */
308
+ ACCEPTED: 202,
309
+ /**
310
+ * 203 Non-Authoritative Information - The returned metadata is not from the origin server
311
+ */
312
+ NON_AUTHORITATIVE_INFORMATION: 203,
313
+ /**
314
+ * 204 No Content - There is no content to send for this request
315
+ */
316
+ NO_CONTENT: 204,
317
+ /**
318
+ * 205 Reset Content - Tells the user agent to reset the document
319
+ */
320
+ RESET_CONTENT: 205,
321
+ /**
322
+ * 206 Partial Content - The server is delivering only part of the resource
323
+ */
324
+ PARTIAL_CONTENT: 206,
325
+ /**
326
+ * 207 Multi-Status - Conveys information about multiple resources
327
+ */
328
+ MULTI_STATUS: 207,
329
+ /**
330
+ * 208 Already Reported - The members of a DAV binding have already been enumerated
331
+ */
332
+ ALREADY_REPORTED: 208,
333
+ /**
334
+ * 226 IM Used - The server has fulfilled a request for the resource
335
+ */
336
+ IM_USED: 226,
337
+ // 3xx Redirection
338
+ /**
339
+ * 300 Multiple Choices - Multiple options for the resource are available
340
+ */
341
+ MULTIPLE_CHOICES: 300,
342
+ /**
343
+ * 301 Moved Permanently - The URL of the requested resource has been changed permanently
344
+ */
345
+ MOVED_PERMANENTLY: 301,
346
+ /**
347
+ * 302 Found - The resource resides temporarily under a different URI
348
+ */
349
+ FOUND: 302,
350
+ /**
351
+ * 303 See Other - Direct the client to get the resource at another URI
352
+ */
353
+ SEE_OTHER: 303,
354
+ /**
355
+ * 304 Not Modified - The cached version is still valid
356
+ */
357
+ NOT_MODIFIED: 304,
358
+ /**
359
+ * 305 Use Proxy - Defined in a previous version of the HTTP specification
360
+ */
361
+ USE_PROXY: 305,
362
+ /**
363
+ * 307 Temporary Redirect - The request should be repeated with another URI
364
+ */
365
+ TEMPORARY_REDIRECT: 307,
366
+ /**
367
+ * 308 Permanent Redirect - The resource is permanently located at another URI
368
+ */
369
+ PERMANENT_REDIRECT: 308,
370
+ // 4xx Client Errors
371
+ /**
372
+ * 400 Bad Request - The server cannot process the request due to client error
373
+ */
374
+ BAD_REQUEST: 400,
375
+ /**
376
+ * 401 Unauthorized - Authentication is required and has failed or not been provided
377
+ */
378
+ UNAUTHORIZED: 401,
379
+ /**
380
+ * 402 Payment Required - Reserved for future use
381
+ */
382
+ PAYMENT_REQUIRED: 402,
383
+ /**
384
+ * 403 Forbidden - The server understood the request but refuses to authorize it
385
+ */
386
+ FORBIDDEN: 403,
387
+ /**
388
+ * 404 Not Found - The server cannot find the requested resource
389
+ */
390
+ NOT_FOUND: 404,
391
+ /**
392
+ * 405 Method Not Allowed - The request method is not supported for the requested resource
393
+ */
394
+ METHOD_NOT_ALLOWED: 405,
395
+ /**
396
+ * 406 Not Acceptable - The requested resource is not available in a format acceptable to the client
397
+ */
398
+ NOT_ACCEPTABLE: 406,
399
+ /**
400
+ * 407 Proxy Authentication Required - The client must authenticate itself with the proxy
401
+ */
402
+ PROXY_AUTHENTICATION_REQUIRED: 407,
403
+ /**
404
+ * 408 Request Timeout - The server timed out waiting for the request
405
+ */
406
+ REQUEST_TIMEOUT: 408,
407
+ /**
408
+ * 409 Conflict - The request conflicts with the current state of the server
409
+ */
410
+ CONFLICT: 409,
411
+ /**
412
+ * 410 Gone - The requested resource is no longer available and will not be available again
413
+ */
414
+ GONE: 410,
415
+ /**
416
+ * 411 Length Required - The request did not specify the length of its content
417
+ */
418
+ LENGTH_REQUIRED: 411,
419
+ /**
420
+ * 412 Precondition Failed - The server does not meet one of the preconditions
421
+ */
422
+ PRECONDITION_FAILED: 412,
423
+ /**
424
+ * 413 Payload Too Large - The request is larger than the server is willing to process
425
+ */
426
+ PAYLOAD_TOO_LARGE: 413,
427
+ /**
428
+ * 414 URI Too Long - The URI provided was too long for the server to process
429
+ */
430
+ URI_TOO_LONG: 414,
431
+ /**
432
+ * 415 Unsupported Media Type - The request entity has a media type not supported by the server
433
+ */
434
+ UNSUPPORTED_MEDIA_TYPE: 415,
435
+ /**
436
+ * 416 Range Not Satisfiable - The client has asked for a portion of the file that the server cannot supply
437
+ */
438
+ RANGE_NOT_SATISFIABLE: 416,
439
+ /**
440
+ * 417 Expectation Failed - The server cannot meet the requirements of the Expect request-header field
441
+ */
442
+ EXPECTATION_FAILED: 417,
443
+ /**
444
+ * 418 I'm a teapot - The server refuses to brew coffee because it is a teapot
445
+ */
446
+ IM_A_TEAPOT: 418,
447
+ /**
448
+ * 421 Misdirected Request - The request was directed at a server that is not able to produce a response
449
+ */
450
+ MISDIRECTED_REQUEST: 421,
451
+ /**
452
+ * 422 Unprocessable Entity - The request was well-formed but was unable to be followed due to semantic errors
453
+ */
454
+ UNPROCESSABLE_ENTITY: 422,
455
+ /**
456
+ * 423 Locked - The resource that is being accessed is locked
457
+ */
458
+ LOCKED: 423,
459
+ /**
460
+ * 424 Failed Dependency - The request failed due to failure of a previous request
461
+ */
462
+ FAILED_DEPENDENCY: 424,
463
+ /**
464
+ * 425 Too Early - The server is unwilling to risk processing a request that might be replayed
465
+ */
466
+ TOO_EARLY: 425,
467
+ /**
468
+ * 426 Upgrade Required - The client should switch to a different protocol
469
+ */
470
+ UPGRADE_REQUIRED: 426,
471
+ /**
472
+ * 428 Precondition Required - The origin server requires the request to be conditional
473
+ */
474
+ PRECONDITION_REQUIRED: 428,
475
+ /**
476
+ * 429 Too Many Requests - The user has sent too many requests in a given amount of time
477
+ */
478
+ TOO_MANY_REQUESTS: 429,
479
+ /**
480
+ * 431 Request Header Fields Too Large - The server is unwilling to process the request because its header fields are too large
481
+ */
482
+ REQUEST_HEADER_FIELDS_TOO_LARGE: 431,
483
+ /**
484
+ * 451 Unavailable For Legal Reasons - The user requested a resource that cannot legally be provided
485
+ */
486
+ UNAVAILABLE_FOR_LEGAL_REASONS: 451,
487
+ // 5xx Server Errors
488
+ /**
489
+ * 500 Internal Server Error - The server encountered an unexpected condition
490
+ */
491
+ INTERNAL_SERVER_ERROR: 500,
492
+ /**
493
+ * 501 Not Implemented - The server does not support the functionality required to fulfill the request
494
+ */
495
+ NOT_IMPLEMENTED: 501,
496
+ /**
497
+ * 502 Bad Gateway - The server received an invalid response from the upstream server
498
+ */
499
+ BAD_GATEWAY: 502,
500
+ /**
501
+ * 503 Service Unavailable - The server is not ready to handle the request
502
+ */
503
+ SERVICE_UNAVAILABLE: 503,
504
+ /**
505
+ * 504 Gateway Timeout - The server did not get a response in time from the upstream server
506
+ */
507
+ GATEWAY_TIMEOUT: 504,
508
+ /**
509
+ * 505 HTTP Version Not Supported - The HTTP version used in the request is not supported by the server
510
+ */
511
+ HTTP_VERSION_NOT_SUPPORTED: 505,
512
+ /**
513
+ * 506 Variant Also Negotiates - The server has an internal configuration error
514
+ */
515
+ VARIANT_ALSO_NEGOTIATES: 506,
516
+ /**
517
+ * 507 Insufficient Storage - The server is unable to store the representation needed to complete the request
518
+ */
519
+ INSUFFICIENT_STORAGE: 507,
520
+ /**
521
+ * 508 Loop Detected - The server detected an infinite loop while processing the request
522
+ */
523
+ LOOP_DETECTED: 508,
524
+ /**
525
+ * 510 Not Extended - Further extensions to the request are required for the server to fulfill it
526
+ */
527
+ NOT_EXTENDED: 510,
528
+ /**
529
+ * 511 Network Authentication Required - The client needs to authenticate to gain network access
530
+ */
531
+ NETWORK_AUTHENTICATION_REQUIRED: 511
532
+ };
533
+
534
+ // src/errors/codes.ts
273
535
  var ERROR_CODES = {
274
536
  // ===== API Package Errors =====
275
537
  // Client Configuration
@@ -1434,6 +1696,205 @@ var EVENT_STATUS = {
1434
1696
  Retrying: "retrying"
1435
1697
  };
1436
1698
 
1699
+ // src/locale/types.ts
1700
+ var CURRENCY_CODES = {
1701
+ // Major currencies
1702
+ USD: "USD",
1703
+ // US Dollar
1704
+ EUR: "EUR",
1705
+ // Euro
1706
+ GBP: "GBP",
1707
+ // British Pound Sterling
1708
+ JPY: "JPY",
1709
+ // Japanese Yen
1710
+ CHF: "CHF",
1711
+ // Swiss Franc
1712
+ CAD: "CAD",
1713
+ // Canadian Dollar
1714
+ AUD: "AUD",
1715
+ // Australian Dollar
1716
+ CNY: "CNY",
1717
+ // Chinese Yuan Renminbi
1718
+ // Asian currencies
1719
+ INR: "INR",
1720
+ // Indian Rupee
1721
+ KRW: "KRW",
1722
+ // South Korean Won
1723
+ SGD: "SGD",
1724
+ // Singapore Dollar
1725
+ HKD: "HKD",
1726
+ // Hong Kong Dollar
1727
+ TWD: "TWD",
1728
+ // Taiwan New Dollar
1729
+ THB: "THB",
1730
+ // Thai Baht
1731
+ IDR: "IDR",
1732
+ // Indonesian Rupiah
1733
+ MYR: "MYR",
1734
+ // Malaysian Ringgit
1735
+ PHP: "PHP",
1736
+ // Philippine Peso
1737
+ VND: "VND",
1738
+ // Vietnamese Dong
1739
+ BDT: "BDT",
1740
+ // Bangladeshi Taka
1741
+ PKR: "PKR",
1742
+ // Pakistani Rupee
1743
+ LKR: "LKR",
1744
+ // Sri Lankan Rupee
1745
+ // European currencies
1746
+ SEK: "SEK",
1747
+ // Swedish Krona
1748
+ NOK: "NOK",
1749
+ // Norwegian Krone
1750
+ DKK: "DKK",
1751
+ // Danish Krone
1752
+ PLN: "PLN",
1753
+ // Polish Zloty
1754
+ CZK: "CZK",
1755
+ // Czech Koruna
1756
+ HUF: "HUF",
1757
+ // Hungarian Forint
1758
+ RON: "RON",
1759
+ // Romanian Leu
1760
+ BGN: "BGN",
1761
+ // Bulgarian Lev
1762
+ HRK: "HRK",
1763
+ // Croatian Kuna
1764
+ RSD: "RSD",
1765
+ // Serbian Dinar
1766
+ ISK: "ISK",
1767
+ // Icelandic Króna
1768
+ // Americas currencies
1769
+ BRL: "BRL",
1770
+ // Brazilian Real
1771
+ MXN: "MXN",
1772
+ // Mexican Peso
1773
+ ARS: "ARS",
1774
+ // Argentine Peso
1775
+ CLP: "CLP",
1776
+ // Chilean Peso
1777
+ COP: "COP",
1778
+ // Colombian Peso
1779
+ PEN: "PEN",
1780
+ // Peruvian Sol
1781
+ UYU: "UYU",
1782
+ // Uruguayan Peso
1783
+ VES: "VES",
1784
+ // Venezuelan Bolívar
1785
+ BOB: "BOB",
1786
+ // Bolivian Boliviano
1787
+ PYG: "PYG",
1788
+ // Paraguayan Guarani
1789
+ CRC: "CRC",
1790
+ // Costa Rican Colón
1791
+ GTQ: "GTQ",
1792
+ // Guatemalan Quetzal
1793
+ HNL: "HNL",
1794
+ // Honduran Lempira
1795
+ NIO: "NIO",
1796
+ // Nicaraguan Córdoba
1797
+ PAB: "PAB",
1798
+ // Panamanian Balboa
1799
+ DOP: "DOP",
1800
+ // Dominican Peso
1801
+ JMD: "JMD",
1802
+ // Jamaican Dollar
1803
+ TTD: "TTD",
1804
+ // Trinidad and Tobago Dollar
1805
+ BBD: "BBD",
1806
+ // Barbadian Dollar
1807
+ // Middle Eastern currencies
1808
+ AED: "AED",
1809
+ // UAE Dirham
1810
+ SAR: "SAR",
1811
+ // Saudi Riyal
1812
+ QAR: "QAR",
1813
+ // Qatari Riyal
1814
+ KWD: "KWD",
1815
+ // Kuwaiti Dinar
1816
+ BHD: "BHD",
1817
+ // Bahraini Dinar
1818
+ OMR: "OMR",
1819
+ // Omani Rial
1820
+ JOD: "JOD",
1821
+ // Jordanian Dinar
1822
+ ILS: "ILS",
1823
+ // Israeli New Shekel
1824
+ TRY: "TRY",
1825
+ // Turkish Lira
1826
+ IQD: "IQD",
1827
+ // Iraqi Dinar
1828
+ IRR: "IRR",
1829
+ // Iranian Rial
1830
+ LBP: "LBP",
1831
+ // Lebanese Pound
1832
+ SYP: "SYP",
1833
+ // Syrian Pound
1834
+ // African currencies
1835
+ ZAR: "ZAR",
1836
+ // South African Rand
1837
+ NGN: "NGN",
1838
+ // Nigerian Naira
1839
+ EGP: "EGP",
1840
+ // Egyptian Pound
1841
+ KES: "KES",
1842
+ // Kenyan Shilling
1843
+ GHS: "GHS",
1844
+ // Ghanaian Cedi
1845
+ MAD: "MAD",
1846
+ // Moroccan Dirham
1847
+ TND: "TND",
1848
+ // Tunisian Dinar
1849
+ DZD: "DZD",
1850
+ // Algerian Dinar
1851
+ ETB: "ETB",
1852
+ // Ethiopian Birr
1853
+ TZS: "TZS",
1854
+ // Tanzanian Shilling
1855
+ UGX: "UGX",
1856
+ // Ugandan Shilling
1857
+ ZMW: "ZMW",
1858
+ // Zambian Kwacha
1859
+ BWP: "BWP",
1860
+ // Botswana Pula
1861
+ MUR: "MUR",
1862
+ // Mauritian Rupee
1863
+ // Pacific currencies
1864
+ NZD: "NZD",
1865
+ // New Zealand Dollar
1866
+ FJD: "FJD",
1867
+ // Fijian Dollar
1868
+ PGK: "PGK",
1869
+ // Papua New Guinean Kina
1870
+ // Former Soviet Union currencies
1871
+ RUB: "RUB",
1872
+ // Russian Ruble
1873
+ UAH: "UAH",
1874
+ // Ukrainian Hryvnia
1875
+ BYN: "BYN",
1876
+ // Belarusian Ruble
1877
+ KZT: "KZT",
1878
+ // Kazakhstani Tenge
1879
+ UZS: "UZS",
1880
+ // Uzbekistani Som
1881
+ AZN: "AZN",
1882
+ // Azerbaijani Manat
1883
+ GEL: "GEL",
1884
+ // Georgian Lari
1885
+ AMD: "AMD",
1886
+ // Armenian Dram
1887
+ // Cryptocurrency representations (unofficial)
1888
+ BTC: "BTC",
1889
+ // Bitcoin
1890
+ ETH: "ETH",
1891
+ // Ethereum
1892
+ USDT: "USDT",
1893
+ // Tether
1894
+ USDC: "USDC"
1895
+ // USD Coin
1896
+ };
1897
+
1437
1898
  // src/web3/enums.ts
1438
1899
  var CHAIN_ID = {
1439
1900
  /** Ethereum Mainnet (Chain ID: 1). */
@@ -1945,6 +2406,138 @@ var QueuePrioritySchema = z.enum(["high", "normal", "low"]);
1945
2406
  var CorrelationIdSchema = z.string().uuid("Correlation ID must be a valid UUID v4").describe("UUID v4 correlation ID");
1946
2407
  var TemplateDataSchema = z.record(z.string(), z.unknown()).optional();
1947
2408
  var DeviceTokenSchema = z.string().min(1, "Device token is required").max(MAX_DEVICE_TOKEN_LENGTH, "Device token must be 512 characters or less");
2409
+ var InfobipEmailStatusSchema = z.object({
2410
+ groupId: z.number().optional(),
2411
+ groupName: z.string().optional(),
2412
+ id: z.number().optional(),
2413
+ name: z.string().optional(),
2414
+ description: z.string().optional(),
2415
+ action: z.string().optional()
2416
+ });
2417
+ var InfobipErrorInfoSchema = z.object({
2418
+ groupId: z.number().optional(),
2419
+ groupName: z.string().optional(),
2420
+ id: z.number().optional(),
2421
+ name: z.string().optional(),
2422
+ description: z.string().optional(),
2423
+ permanent: z.boolean().optional()
2424
+ });
2425
+ var InfobipPriceInfoSchema = z.object({
2426
+ pricePerMessage: z.number().optional(),
2427
+ currency: z.string().optional()
2428
+ });
2429
+ var InfobipDeliveryResultSchema = z.object({
2430
+ messageId: z.string().optional(),
2431
+ to: z.string().optional(),
2432
+ bulkId: z.string().optional(),
2433
+ sentAt: z.string().optional(),
2434
+ doneAt: z.string().optional(),
2435
+ status: InfobipEmailStatusSchema.optional(),
2436
+ error: InfobipErrorInfoSchema.optional(),
2437
+ attemptCount: z.number().optional(),
2438
+ timeToFirstAttempt: z.number().optional(),
2439
+ sendingIp: z.string().optional(),
2440
+ price: InfobipPriceInfoSchema.optional(),
2441
+ smsCount: z.number().optional(),
2442
+ browserLink: z.string().optional(),
2443
+ applicationId: z.string().optional(),
2444
+ entityId: z.string().optional(),
2445
+ campaignReferenceId: z.string().optional(),
2446
+ callbackData: z.string().optional()
2447
+ }).loose();
2448
+ var InfobipDeliveryWebhookSchema = z.object({
2449
+ results: z.array(InfobipDeliveryResultSchema)
2450
+ });
2451
+ var InfobipGeoLocationSchema = z.object({
2452
+ countryName: z.string().optional(),
2453
+ countryCode: z.string().optional(),
2454
+ regionName: z.string().optional(),
2455
+ city: z.string().optional(),
2456
+ latitude: z.number().optional(),
2457
+ longitude: z.number().optional()
2458
+ }).loose();
2459
+ var InfobipRecipientInfoSchema = z.object({
2460
+ messageId: z.number().optional(),
2461
+ to: z.string().optional(),
2462
+ requestId: z.string().optional(),
2463
+ sentDateTime: z.number().optional()
2464
+ }).loose();
2465
+ var InfobipTrackingEventSchema = z.object({
2466
+ messageId: z.number().optional(),
2467
+ bulkId: z.string().optional(),
2468
+ recipient: z.string().optional(),
2469
+ sender: z.string().optional(),
2470
+ domain: z.string().optional(),
2471
+ notificationType: z.string().optional(),
2472
+ // OPENED, CLICKED, COMPLAINED, LATE_BOUNCE, UNSUBSCRIBED
2473
+ eventId: z.string().optional(),
2474
+ sendDateTime: z.number().optional(),
2475
+ url: z.string().optional(),
2476
+ // For CLICKED events
2477
+ applicationId: z.string().optional(),
2478
+ entityId: z.string().optional(),
2479
+ campaignReferenceId: z.string().optional(),
2480
+ callbackData: z.string().optional(),
2481
+ geoLocation: InfobipGeoLocationSchema.optional(),
2482
+ recipientInfo: InfobipRecipientInfoSchema.optional()
2483
+ }).loose();
2484
+ var InfobipTrackingWebhookSchema = z.object({
2485
+ messageId: z.number().optional(),
2486
+ bulkId: z.string().optional(),
2487
+ recipient: z.string().optional(),
2488
+ sender: z.string().optional(),
2489
+ domain: z.string().optional(),
2490
+ notificationType: z.string().optional(),
2491
+ eventId: z.string().optional(),
2492
+ sendDateTime: z.number().optional(),
2493
+ url: z.string().optional(),
2494
+ applicationId: z.string().optional(),
2495
+ entityId: z.string().optional(),
2496
+ campaignReferenceId: z.string().optional(),
2497
+ callbackData: z.string().optional(),
2498
+ geoLocation: InfobipGeoLocationSchema.optional(),
2499
+ recipientInfo: InfobipRecipientInfoSchema.optional()
2500
+ }).loose();
2501
+ var SendGridEventSchema = z.object({
2502
+ email: z.string().email(),
2503
+ timestamp: z.number(),
2504
+ event: z.enum([
2505
+ "processed",
2506
+ "dropped",
2507
+ "delivered",
2508
+ "deferred",
2509
+ "bounce",
2510
+ "open",
2511
+ "click",
2512
+ "spam_report",
2513
+ "unsubscribe",
2514
+ "group_unsubscribe",
2515
+ "group_resubscribe"
2516
+ ]),
2517
+ sg_event_id: z.string(),
2518
+ sg_message_id: z.string(),
2519
+ // Custom args (our notification metadata)
2520
+ notification_id: z.string().optional(),
2521
+ recipient_id: z.string().optional(),
2522
+ category: z.string().optional(),
2523
+ // Event-specific fields
2524
+ url: z.string().optional(),
2525
+ // For click events
2526
+ reason: z.string().optional(),
2527
+ // For bounce/drop events
2528
+ status: z.string().optional(),
2529
+ // For drop/bounce events
2530
+ response: z.string().optional(),
2531
+ // For bounce events
2532
+ useragent: z.string().optional(),
2533
+ // For open/click events
2534
+ ip: z.string().optional(),
2535
+ // For open/click events
2536
+ // Unsubscribe-specific
2537
+ asm_group_id: z.number().optional()
2538
+ // Unsubscribe group ID
2539
+ }).loose();
2540
+ var SendGridWebhookSchema = z.array(SendGridEventSchema);
1948
2541
 
1949
2542
  // src/api/events/enum.ts
1950
2543
  var EVENT_NAMESPACES = {
@@ -2457,6 +3050,6 @@ var PUB_SUB_EVENT = {
2457
3050
  RequestAbort: "request:abort"
2458
3051
  };
2459
3052
 
2460
- export { ALERT_SEVERITIES, ALERT_TYPES, ALL_EVENTS, API_ERROR_CODES, AUTH_PROVIDER, AUTH_PROVIDER_TYPE, CACHE_DURATION_MS, CACHE_EVENTS, CHAIN_ID, CHANGE_TYPES, CLIENT_EVENTS, CLIENT_HINT_HEADERS, COMMON_FIELDS, COMMON_OPERATIONS, COMMON_STORAGE_TYPES, CONFIG_EVENTS, COORDINATES, CORRELATION_TYPE, COSTOPTIMIZATIONSTRATEGY, CorrelationIdSchema, DATA_SAVER_PRESETS, DEBUGGER_CONFIG_SOURCES, DEBUG_EVENTS, DEFAULT_THRESHOLDS, DeviceTokenSchema, ERROR_CATEGORY, ERROR_CATEGORY_TO_EMITTER_KEY, ERROR_CODES, ERROR_DEFINITIONS, ERROR_EVENTS, COMMON_FIELDS as ERROR_FIELDS, ERROR_SEVERITY, ERROR_TYPE, EVENTPROCESSINGSTATUS, EVENTS_CONFIG_SOURCES, EVENT_CONSTANTS, EVENT_NAMESPACES, EVENT_OPERATIONS, EVENT_PRIORITY, EVENT_PRIORITY_MAP, EVENT_SCOPES, EVENT_SCOPES_WITH_TEMPORARY, EVENT_STATUS, EVENT_TYPE, EmailSchema, FACTORY_OPERATIONS, FAILOVERSTRATEGY, FILE_EXTENSIONS, HANDLER_SCOPES, HEADER_EVENTS, HEADER_STAGES, HISTORY_TYPES, IMPACT_LEVELS, INTERNAL_STATUS_CODES, LOADBALANCINGSTRATEGY, LocaleSchema, MIME_TYPES, NETWORK_CONFIDENCE_LEVELS, NETWORK_EVENTS, NETWORK_QUALITY, NOTIFICATION_CATEGORIES, NOTIFICATION_CHANNELS, NOTIFICATION_ERROR_CODES, NOTIFICATION_PROVIDERS, NetworkPresetNames, NotificationCategorySchema, COMMON_OPERATIONS as OPERATIONS, INTERNAL_STATUS_CODES as PACKAGE_STATUS_CODES, PAYMENTERRORCATEGORY, PAYMENTEVENTCATEGORY, PAYMENTEVENTTYPE, PAYMENTMETHOD, PAYMENTPROVIDERTYPE, PAYMENTSTATUS, PAYMENT_ERROR_CATEGORY, PERFORMANCEMETRICTYPE, PERFORMANCE_EVENTS, PRIORITY_LEVEL, PRODUCTTYPE, PUB_SUB_EVENT, PhoneSchema, QUEUE_OPERATIONS, QueuePrioritySchema, REFUND_ERROR_TYPES, REFUND_NOT_ALLOWED_REASON, REGIONAL_CONFIDENCE_LEVELS, REGION_STORAGE_KEY, REGION_TO_PRESET, REGULATORYFRAMEWORK, REGULATORY_FRAMEWORK, REQUIREDACTIONTYPE, ROUTINGSTRATEGY, RTT_THRESHOLDS, SECURITY_THREAT_TYPE, SIGNATURE_METHOD, SPEED_THRESHOLDS, COMMON_STORAGE_TYPES as STORAGE_TYPES, TRACKING_PHASES, TRANSACTIONTYPE, TemplateDataSchema, TemplateIdSchema, UNIFIED_OPERATIONS, UPDATE_STRATEGIES, USERTYPE, USER_ROLE, USER_STATUS, UserIdSchema, VALIDATION_RANGES, WEBHOOK_ENCRYPTION_METHOD, WEBHOOK_EVENT_TYPE, WEBHOOK_VERIFICATION_REASON, isValidConfigSource, isValidHistoryType, isValidOperation, loginCredentialsSchema };
3053
+ export { ALERT_SEVERITIES, ALERT_TYPES, ALL_EVENTS, API_ERROR_CODES, AUTH_PROVIDER, AUTH_PROVIDER_TYPE, CACHE_DURATION_MS, CACHE_EVENTS, CHAIN_ID, CHANGE_TYPES, CLIENT_EVENTS, CLIENT_HINT_HEADERS, COMMON_FIELDS, COMMON_OPERATIONS, COMMON_STORAGE_TYPES, CONFIG_EVENTS, COORDINATES, CORRELATION_TYPE, COSTOPTIMIZATIONSTRATEGY, CURRENCY_CODES, ContactUsFormSchema, CorrelationIdSchema, DATA_SAVER_PRESETS, DEBUGGER_CONFIG_SOURCES, DEBUG_EVENTS, DEFAULT_THRESHOLDS, DeviceTokenSchema, ERROR_CATEGORY, ERROR_CATEGORY_TO_EMITTER_KEY, ERROR_CODES, ERROR_DEFINITIONS, ERROR_EVENTS, COMMON_FIELDS as ERROR_FIELDS, ERROR_SEVERITY, ERROR_TYPE, EVENTPROCESSINGSTATUS, EVENTS_CONFIG_SOURCES, EVENT_CONSTANTS, EVENT_NAMESPACES, EVENT_OPERATIONS, EVENT_PRIORITY, EVENT_PRIORITY_MAP, EVENT_SCOPES, EVENT_SCOPES_WITH_TEMPORARY, EVENT_STATUS, EVENT_TYPE, EmailSchema, FACTORY_OPERATIONS, FAILOVERSTRATEGY, FILE_EXTENSIONS, HANDLER_SCOPES, HEADER_EVENTS, HEADER_STAGES, HISTORY_TYPES, HTTP_STATUS, IMPACT_LEVELS, INTERNAL_STATUS_CODES, InfobipDeliveryResultSchema, InfobipDeliveryWebhookSchema, InfobipEmailStatusSchema, InfobipErrorInfoSchema, InfobipGeoLocationSchema, InfobipPriceInfoSchema, InfobipRecipientInfoSchema, InfobipTrackingEventSchema, InfobipTrackingWebhookSchema, LOADBALANCINGSTRATEGY, LocaleSchema, MIME_TYPES, NETWORK_CONFIDENCE_LEVELS, NETWORK_EVENTS, NETWORK_QUALITY, NOTIFICATION_CATEGORIES, NOTIFICATION_CHANNELS, NOTIFICATION_ERROR_CODES, NOTIFICATION_PROVIDERS, NetworkPresetNames, NotificationCategorySchema, COMMON_OPERATIONS as OPERATIONS, INTERNAL_STATUS_CODES as PACKAGE_STATUS_CODES, PAYMENTERRORCATEGORY, PAYMENTEVENTCATEGORY, PAYMENTEVENTTYPE, PAYMENTMETHOD, PAYMENTPROVIDERTYPE, PAYMENTSTATUS, PAYMENT_ERROR_CATEGORY, PERFORMANCEMETRICTYPE, PERFORMANCE_EVENTS, PRIORITY_LEVEL, PRODUCTTYPE, PUB_SUB_EVENT, PhoneSchema, QUEUE_OPERATIONS, QueuePrioritySchema, REFUND_ERROR_TYPES, REFUND_NOT_ALLOWED_REASON, REGIONAL_CONFIDENCE_LEVELS, REGION_STORAGE_KEY, REGION_TO_PRESET, REGULATORYFRAMEWORK, REGULATORY_FRAMEWORK, REQUIREDACTIONTYPE, ROUTINGSTRATEGY, RTT_THRESHOLDS, SECURITY_THREAT_TYPE, SIGNATURE_METHOD, SPEED_THRESHOLDS, COMMON_STORAGE_TYPES as STORAGE_TYPES, SendGridEventSchema, SendGridWebhookSchema, SignupFormSchema, TRACKING_PHASES, TRANSACTIONTYPE, TemplateDataSchema, TemplateIdSchema, UNIFIED_OPERATIONS, UPDATE_STRATEGIES, USERTYPE, USER_ROLE, USER_STATUS, UserIdSchema, VALIDATION_RANGES, WEBHOOK_ENCRYPTION_METHOD, WEBHOOK_EVENT_TYPE, WEBHOOK_VERIFICATION_REASON, isValidConfigSource, isValidHistoryType, isValidOperation };
2461
3054
  //# sourceMappingURL=index.js.map
2462
3055
  //# sourceMappingURL=index.js.map