@metriport/shared 0.32.1 → 0.32.2

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 (59) hide show
  1. package/dist/common/date.d.ts +1 -0
  2. package/dist/common/date.d.ts.map +1 -1
  3. package/dist/common/date.js +5 -1
  4. package/dist/common/date.js.map +1 -1
  5. package/dist/domain/patient/patient-import/schemas.js +1 -1
  6. package/dist/domain/patient/patient-import/schemas.js.map +1 -1
  7. package/dist/external/hl7v2/constants.d.ts +1 -1
  8. package/dist/external/hl7v2/constants.d.ts.map +1 -1
  9. package/dist/external/hl7v2/constants.js +2 -2
  10. package/dist/external/hl7v2/constants.js.map +1 -1
  11. package/dist/interface/external/ehr/canvas/cx-mapping.d.ts +3 -0
  12. package/dist/interface/external/ehr/canvas/cx-mapping.d.ts.map +1 -1
  13. package/dist/interface/external/ehr/canvas/cx-mapping.js +1 -0
  14. package/dist/interface/external/ehr/canvas/cx-mapping.js.map +1 -1
  15. package/dist/interface/external/ehr/canvas/external-event.d.ts +67 -0
  16. package/dist/interface/external/ehr/canvas/external-event.d.ts.map +1 -0
  17. package/dist/interface/external/ehr/canvas/external-event.js +48 -0
  18. package/dist/interface/external/ehr/canvas/external-event.js.map +1 -0
  19. package/dist/interface/external/ehr/canvas/index.d.ts +1 -0
  20. package/dist/interface/external/ehr/canvas/index.d.ts.map +1 -1
  21. package/dist/interface/external/ehr/canvas/index.js +1 -0
  22. package/dist/interface/external/ehr/canvas/index.js.map +1 -1
  23. package/dist/interface/external/ehr/canvas/jwt-token.d.ts +15 -0
  24. package/dist/interface/external/ehr/canvas/jwt-token.d.ts.map +1 -1
  25. package/dist/interface/external/ehr/canvas/jwt-token.js +7 -1
  26. package/dist/interface/external/ehr/canvas/jwt-token.js.map +1 -1
  27. package/dist/interface/external/ehr/healthie/allergy.d.ts +18 -18
  28. package/dist/interface/external/ehr/source.d.ts +2 -0
  29. package/dist/interface/external/ehr/source.d.ts.map +1 -1
  30. package/dist/interface/external/ehr/source.js +6 -1
  31. package/dist/interface/external/ehr/source.js.map +1 -1
  32. package/dist/medical/fhir/coding.d.ts +11 -0
  33. package/dist/medical/fhir/coding.d.ts.map +1 -1
  34. package/dist/medical/fhir/coding.js +27 -1
  35. package/dist/medical/fhir/coding.js.map +1 -1
  36. package/dist/medical/fhir/imaging-detection.d.ts +706 -0
  37. package/dist/medical/fhir/imaging-detection.d.ts.map +1 -0
  38. package/dist/medical/fhir/imaging-detection.js +361 -0
  39. package/dist/medical/fhir/imaging-detection.js.map +1 -0
  40. package/dist/medical/fhir/loinc/loinc-class-display-lookup.json +1730 -0
  41. package/dist/medical/fhir/loinc/loinc-code-class-lookup.json +432994 -0
  42. package/dist/medical/fhir/procedure-type.d.ts +1316 -0
  43. package/dist/medical/fhir/procedure-type.d.ts.map +1 -0
  44. package/dist/medical/fhir/procedure-type.js +263 -0
  45. package/dist/medical/fhir/procedure-type.js.map +1 -0
  46. package/dist/medical/index.d.ts +1 -0
  47. package/dist/medical/index.d.ts.map +1 -1
  48. package/dist/medical/index.js +1 -0
  49. package/dist/medical/index.js.map +1 -1
  50. package/dist/medical/webhook/webhook-request.d.ts +56 -56
  51. package/dist/util/index.d.ts +1 -0
  52. package/dist/util/index.d.ts.map +1 -1
  53. package/dist/util/index.js +1 -0
  54. package/dist/util/index.js.map +1 -1
  55. package/dist/util/sqs-delay-from-uuid.d.ts +11 -0
  56. package/dist/util/sqs-delay-from-uuid.d.ts.map +1 -0
  57. package/dist/util/sqs-delay-from-uuid.js +21 -0
  58. package/dist/util/sqs-delay-from-uuid.js.map +1 -0
  59. package/package.json +2 -2
@@ -240,27 +240,27 @@ export declare const documentDownloadWebhookPatientSchema: z.ZodObject<{
240
240
  display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
241
241
  }, "strip", z.ZodTypeAny, {
242
242
  code?: string | null | undefined;
243
- system?: string | null | undefined;
244
243
  display?: string | null | undefined;
244
+ system?: string | null | undefined;
245
245
  }, {
246
246
  code?: string | null | undefined;
247
- system?: string | null | undefined;
248
247
  display?: string | null | undefined;
248
+ system?: string | null | undefined;
249
249
  }>, "many">>;
250
250
  text: z.ZodOptional<z.ZodString>;
251
251
  }, "strip", z.ZodTypeAny, {
252
252
  text?: string | undefined;
253
253
  coding?: {
254
254
  code?: string | null | undefined;
255
- system?: string | null | undefined;
256
255
  display?: string | null | undefined;
256
+ system?: string | null | undefined;
257
257
  }[] | undefined;
258
258
  }, {
259
259
  text?: string | undefined;
260
260
  coding?: {
261
261
  code?: string | null | undefined;
262
- system?: string | null | undefined;
263
262
  display?: string | null | undefined;
263
+ system?: string | null | undefined;
264
264
  }[] | undefined;
265
265
  }>>;
266
266
  }, "strip", z.ZodTypeAny, {
@@ -270,8 +270,8 @@ export declare const documentDownloadWebhookPatientSchema: z.ZodObject<{
270
270
  text?: string | undefined;
271
271
  coding?: {
272
272
  code?: string | null | undefined;
273
- system?: string | null | undefined;
274
273
  display?: string | null | undefined;
274
+ system?: string | null | undefined;
275
275
  }[] | undefined;
276
276
  } | undefined;
277
277
  status?: string | undefined;
@@ -286,8 +286,8 @@ export declare const documentDownloadWebhookPatientSchema: z.ZodObject<{
286
286
  text?: string | undefined;
287
287
  coding?: {
288
288
  code?: string | null | undefined;
289
- system?: string | null | undefined;
290
289
  display?: string | null | undefined;
290
+ system?: string | null | undefined;
291
291
  }[] | undefined;
292
292
  } | undefined;
293
293
  status?: string | undefined;
@@ -306,8 +306,8 @@ export declare const documentDownloadWebhookPatientSchema: z.ZodObject<{
306
306
  text?: string | undefined;
307
307
  coding?: {
308
308
  code?: string | null | undefined;
309
- system?: string | null | undefined;
310
309
  display?: string | null | undefined;
310
+ system?: string | null | undefined;
311
311
  }[] | undefined;
312
312
  } | undefined;
313
313
  status?: string | undefined;
@@ -328,8 +328,8 @@ export declare const documentDownloadWebhookPatientSchema: z.ZodObject<{
328
328
  text?: string | undefined;
329
329
  coding?: {
330
330
  code?: string | null | undefined;
331
- system?: string | null | undefined;
332
331
  display?: string | null | undefined;
332
+ system?: string | null | undefined;
333
333
  }[] | undefined;
334
334
  } | undefined;
335
335
  status?: string | undefined;
@@ -386,27 +386,27 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
386
386
  display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
387
387
  }, "strip", z.ZodTypeAny, {
388
388
  code?: string | null | undefined;
389
- system?: string | null | undefined;
390
389
  display?: string | null | undefined;
390
+ system?: string | null | undefined;
391
391
  }, {
392
392
  code?: string | null | undefined;
393
- system?: string | null | undefined;
394
393
  display?: string | null | undefined;
394
+ system?: string | null | undefined;
395
395
  }>, "many">>;
396
396
  text: z.ZodOptional<z.ZodString>;
397
397
  }, "strip", z.ZodTypeAny, {
398
398
  text?: string | undefined;
399
399
  coding?: {
400
400
  code?: string | null | undefined;
401
- system?: string | null | undefined;
402
401
  display?: string | null | undefined;
402
+ system?: string | null | undefined;
403
403
  }[] | undefined;
404
404
  }, {
405
405
  text?: string | undefined;
406
406
  coding?: {
407
407
  code?: string | null | undefined;
408
- system?: string | null | undefined;
409
408
  display?: string | null | undefined;
409
+ system?: string | null | undefined;
410
410
  }[] | undefined;
411
411
  }>>;
412
412
  }, "strip", z.ZodTypeAny, {
@@ -416,8 +416,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
416
416
  text?: string | undefined;
417
417
  coding?: {
418
418
  code?: string | null | undefined;
419
- system?: string | null | undefined;
420
419
  display?: string | null | undefined;
420
+ system?: string | null | undefined;
421
421
  }[] | undefined;
422
422
  } | undefined;
423
423
  status?: string | undefined;
@@ -432,8 +432,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
432
432
  text?: string | undefined;
433
433
  coding?: {
434
434
  code?: string | null | undefined;
435
- system?: string | null | undefined;
436
435
  display?: string | null | undefined;
436
+ system?: string | null | undefined;
437
437
  }[] | undefined;
438
438
  } | undefined;
439
439
  status?: string | undefined;
@@ -452,8 +452,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
452
452
  text?: string | undefined;
453
453
  coding?: {
454
454
  code?: string | null | undefined;
455
- system?: string | null | undefined;
456
455
  display?: string | null | undefined;
456
+ system?: string | null | undefined;
457
457
  }[] | undefined;
458
458
  } | undefined;
459
459
  status?: string | undefined;
@@ -474,8 +474,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
474
474
  text?: string | undefined;
475
475
  coding?: {
476
476
  code?: string | null | undefined;
477
- system?: string | null | undefined;
478
477
  display?: string | null | undefined;
478
+ system?: string | null | undefined;
479
479
  }[] | undefined;
480
480
  } | undefined;
481
481
  status?: string | undefined;
@@ -505,8 +505,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
505
505
  text?: string | undefined;
506
506
  coding?: {
507
507
  code?: string | null | undefined;
508
- system?: string | null | undefined;
509
508
  display?: string | null | undefined;
509
+ system?: string | null | undefined;
510
510
  }[] | undefined;
511
511
  } | undefined;
512
512
  status?: string | undefined;
@@ -536,8 +536,8 @@ export declare const documentDownloadWebhookRequestSchema: z.ZodObject<{
536
536
  text?: string | undefined;
537
537
  coding?: {
538
538
  code?: string | null | undefined;
539
- system?: string | null | undefined;
540
539
  display?: string | null | undefined;
540
+ system?: string | null | undefined;
541
541
  }[] | undefined;
542
542
  } | undefined;
543
543
  status?: string | undefined;
@@ -658,27 +658,27 @@ export declare const documentBulkDownloadWebhookPatientSchema: z.ZodObject<{
658
658
  display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
659
659
  }, "strip", z.ZodTypeAny, {
660
660
  code?: string | null | undefined;
661
- system?: string | null | undefined;
662
661
  display?: string | null | undefined;
662
+ system?: string | null | undefined;
663
663
  }, {
664
664
  code?: string | null | undefined;
665
- system?: string | null | undefined;
666
665
  display?: string | null | undefined;
666
+ system?: string | null | undefined;
667
667
  }>, "many">>;
668
668
  text: z.ZodOptional<z.ZodString>;
669
669
  }, "strip", z.ZodTypeAny, {
670
670
  text?: string | undefined;
671
671
  coding?: {
672
672
  code?: string | null | undefined;
673
- system?: string | null | undefined;
674
673
  display?: string | null | undefined;
674
+ system?: string | null | undefined;
675
675
  }[] | undefined;
676
676
  }, {
677
677
  text?: string | undefined;
678
678
  coding?: {
679
679
  code?: string | null | undefined;
680
- system?: string | null | undefined;
681
680
  display?: string | null | undefined;
681
+ system?: string | null | undefined;
682
682
  }[] | undefined;
683
683
  }>>;
684
684
  }, {
@@ -691,8 +691,8 @@ export declare const documentBulkDownloadWebhookPatientSchema: z.ZodObject<{
691
691
  text?: string | undefined;
692
692
  coding?: {
693
693
  code?: string | null | undefined;
694
- system?: string | null | undefined;
695
694
  display?: string | null | undefined;
695
+ system?: string | null | undefined;
696
696
  }[] | undefined;
697
697
  } | undefined;
698
698
  status?: string | undefined;
@@ -708,8 +708,8 @@ export declare const documentBulkDownloadWebhookPatientSchema: z.ZodObject<{
708
708
  text?: string | undefined;
709
709
  coding?: {
710
710
  code?: string | null | undefined;
711
- system?: string | null | undefined;
712
711
  display?: string | null | undefined;
712
+ system?: string | null | undefined;
713
713
  }[] | undefined;
714
714
  } | undefined;
715
715
  status?: string | undefined;
@@ -729,8 +729,8 @@ export declare const documentBulkDownloadWebhookPatientSchema: z.ZodObject<{
729
729
  text?: string | undefined;
730
730
  coding?: {
731
731
  code?: string | null | undefined;
732
- system?: string | null | undefined;
733
732
  display?: string | null | undefined;
733
+ system?: string | null | undefined;
734
734
  }[] | undefined;
735
735
  } | undefined;
736
736
  status?: string | undefined;
@@ -752,8 +752,8 @@ export declare const documentBulkDownloadWebhookPatientSchema: z.ZodObject<{
752
752
  text?: string | undefined;
753
753
  coding?: {
754
754
  code?: string | null | undefined;
755
- system?: string | null | undefined;
756
755
  display?: string | null | undefined;
756
+ system?: string | null | undefined;
757
757
  }[] | undefined;
758
758
  } | undefined;
759
759
  status?: string | undefined;
@@ -810,27 +810,27 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
810
810
  display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
811
811
  }, "strip", z.ZodTypeAny, {
812
812
  code?: string | null | undefined;
813
- system?: string | null | undefined;
814
813
  display?: string | null | undefined;
814
+ system?: string | null | undefined;
815
815
  }, {
816
816
  code?: string | null | undefined;
817
- system?: string | null | undefined;
818
817
  display?: string | null | undefined;
818
+ system?: string | null | undefined;
819
819
  }>, "many">>;
820
820
  text: z.ZodOptional<z.ZodString>;
821
821
  }, "strip", z.ZodTypeAny, {
822
822
  text?: string | undefined;
823
823
  coding?: {
824
824
  code?: string | null | undefined;
825
- system?: string | null | undefined;
826
825
  display?: string | null | undefined;
826
+ system?: string | null | undefined;
827
827
  }[] | undefined;
828
828
  }, {
829
829
  text?: string | undefined;
830
830
  coding?: {
831
831
  code?: string | null | undefined;
832
- system?: string | null | undefined;
833
832
  display?: string | null | undefined;
833
+ system?: string | null | undefined;
834
834
  }[] | undefined;
835
835
  }>>;
836
836
  }, {
@@ -843,8 +843,8 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
843
843
  text?: string | undefined;
844
844
  coding?: {
845
845
  code?: string | null | undefined;
846
- system?: string | null | undefined;
847
846
  display?: string | null | undefined;
847
+ system?: string | null | undefined;
848
848
  }[] | undefined;
849
849
  } | undefined;
850
850
  status?: string | undefined;
@@ -860,8 +860,8 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
860
860
  text?: string | undefined;
861
861
  coding?: {
862
862
  code?: string | null | undefined;
863
- system?: string | null | undefined;
864
863
  display?: string | null | undefined;
864
+ system?: string | null | undefined;
865
865
  }[] | undefined;
866
866
  } | undefined;
867
867
  status?: string | undefined;
@@ -881,8 +881,8 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
881
881
  text?: string | undefined;
882
882
  coding?: {
883
883
  code?: string | null | undefined;
884
- system?: string | null | undefined;
885
884
  display?: string | null | undefined;
885
+ system?: string | null | undefined;
886
886
  }[] | undefined;
887
887
  } | undefined;
888
888
  status?: string | undefined;
@@ -904,8 +904,8 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
904
904
  text?: string | undefined;
905
905
  coding?: {
906
906
  code?: string | null | undefined;
907
- system?: string | null | undefined;
908
907
  display?: string | null | undefined;
908
+ system?: string | null | undefined;
909
909
  }[] | undefined;
910
910
  } | undefined;
911
911
  status?: string | undefined;
@@ -936,8 +936,8 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
936
936
  text?: string | undefined;
937
937
  coding?: {
938
938
  code?: string | null | undefined;
939
- system?: string | null | undefined;
940
939
  display?: string | null | undefined;
940
+ system?: string | null | undefined;
941
941
  }[] | undefined;
942
942
  } | undefined;
943
943
  status?: string | undefined;
@@ -968,8 +968,8 @@ export declare const documentBulkDownloadWebhookRequestSchema: z.ZodObject<{
968
968
  text?: string | undefined;
969
969
  coding?: {
970
970
  code?: string | null | undefined;
971
- system?: string | null | undefined;
972
971
  display?: string | null | undefined;
972
+ system?: string | null | undefined;
973
973
  }[] | undefined;
974
974
  } | undefined;
975
975
  status?: string | undefined;
@@ -2056,27 +2056,27 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2056
2056
  display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2057
2057
  }, "strip", z.ZodTypeAny, {
2058
2058
  code?: string | null | undefined;
2059
- system?: string | null | undefined;
2060
2059
  display?: string | null | undefined;
2060
+ system?: string | null | undefined;
2061
2061
  }, {
2062
2062
  code?: string | null | undefined;
2063
- system?: string | null | undefined;
2064
2063
  display?: string | null | undefined;
2064
+ system?: string | null | undefined;
2065
2065
  }>, "many">>;
2066
2066
  text: z.ZodOptional<z.ZodString>;
2067
2067
  }, "strip", z.ZodTypeAny, {
2068
2068
  text?: string | undefined;
2069
2069
  coding?: {
2070
2070
  code?: string | null | undefined;
2071
- system?: string | null | undefined;
2072
2071
  display?: string | null | undefined;
2072
+ system?: string | null | undefined;
2073
2073
  }[] | undefined;
2074
2074
  }, {
2075
2075
  text?: string | undefined;
2076
2076
  coding?: {
2077
2077
  code?: string | null | undefined;
2078
- system?: string | null | undefined;
2079
2078
  display?: string | null | undefined;
2079
+ system?: string | null | undefined;
2080
2080
  }[] | undefined;
2081
2081
  }>>;
2082
2082
  }, "strip", z.ZodTypeAny, {
@@ -2086,8 +2086,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2086
2086
  text?: string | undefined;
2087
2087
  coding?: {
2088
2088
  code?: string | null | undefined;
2089
- system?: string | null | undefined;
2090
2089
  display?: string | null | undefined;
2090
+ system?: string | null | undefined;
2091
2091
  }[] | undefined;
2092
2092
  } | undefined;
2093
2093
  status?: string | undefined;
@@ -2102,8 +2102,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2102
2102
  text?: string | undefined;
2103
2103
  coding?: {
2104
2104
  code?: string | null | undefined;
2105
- system?: string | null | undefined;
2106
2105
  display?: string | null | undefined;
2106
+ system?: string | null | undefined;
2107
2107
  }[] | undefined;
2108
2108
  } | undefined;
2109
2109
  status?: string | undefined;
@@ -2122,8 +2122,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2122
2122
  text?: string | undefined;
2123
2123
  coding?: {
2124
2124
  code?: string | null | undefined;
2125
- system?: string | null | undefined;
2126
2125
  display?: string | null | undefined;
2126
+ system?: string | null | undefined;
2127
2127
  }[] | undefined;
2128
2128
  } | undefined;
2129
2129
  status?: string | undefined;
@@ -2144,8 +2144,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2144
2144
  text?: string | undefined;
2145
2145
  coding?: {
2146
2146
  code?: string | null | undefined;
2147
- system?: string | null | undefined;
2148
2147
  display?: string | null | undefined;
2148
+ system?: string | null | undefined;
2149
2149
  }[] | undefined;
2150
2150
  } | undefined;
2151
2151
  status?: string | undefined;
@@ -2175,8 +2175,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2175
2175
  text?: string | undefined;
2176
2176
  coding?: {
2177
2177
  code?: string | null | undefined;
2178
- system?: string | null | undefined;
2179
2178
  display?: string | null | undefined;
2179
+ system?: string | null | undefined;
2180
2180
  }[] | undefined;
2181
2181
  } | undefined;
2182
2182
  status?: string | undefined;
@@ -2206,8 +2206,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2206
2206
  text?: string | undefined;
2207
2207
  coding?: {
2208
2208
  code?: string | null | undefined;
2209
- system?: string | null | undefined;
2210
2209
  display?: string | null | undefined;
2210
+ system?: string | null | undefined;
2211
2211
  }[] | undefined;
2212
2212
  } | undefined;
2213
2213
  status?: string | undefined;
@@ -2331,27 +2331,27 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2331
2331
  display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2332
2332
  }, "strip", z.ZodTypeAny, {
2333
2333
  code?: string | null | undefined;
2334
- system?: string | null | undefined;
2335
2334
  display?: string | null | undefined;
2335
+ system?: string | null | undefined;
2336
2336
  }, {
2337
2337
  code?: string | null | undefined;
2338
- system?: string | null | undefined;
2339
2338
  display?: string | null | undefined;
2339
+ system?: string | null | undefined;
2340
2340
  }>, "many">>;
2341
2341
  text: z.ZodOptional<z.ZodString>;
2342
2342
  }, "strip", z.ZodTypeAny, {
2343
2343
  text?: string | undefined;
2344
2344
  coding?: {
2345
2345
  code?: string | null | undefined;
2346
- system?: string | null | undefined;
2347
2346
  display?: string | null | undefined;
2347
+ system?: string | null | undefined;
2348
2348
  }[] | undefined;
2349
2349
  }, {
2350
2350
  text?: string | undefined;
2351
2351
  coding?: {
2352
2352
  code?: string | null | undefined;
2353
- system?: string | null | undefined;
2354
2353
  display?: string | null | undefined;
2354
+ system?: string | null | undefined;
2355
2355
  }[] | undefined;
2356
2356
  }>>;
2357
2357
  }, {
@@ -2364,8 +2364,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2364
2364
  text?: string | undefined;
2365
2365
  coding?: {
2366
2366
  code?: string | null | undefined;
2367
- system?: string | null | undefined;
2368
2367
  display?: string | null | undefined;
2368
+ system?: string | null | undefined;
2369
2369
  }[] | undefined;
2370
2370
  } | undefined;
2371
2371
  status?: string | undefined;
@@ -2381,8 +2381,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2381
2381
  text?: string | undefined;
2382
2382
  coding?: {
2383
2383
  code?: string | null | undefined;
2384
- system?: string | null | undefined;
2385
2384
  display?: string | null | undefined;
2385
+ system?: string | null | undefined;
2386
2386
  }[] | undefined;
2387
2387
  } | undefined;
2388
2388
  status?: string | undefined;
@@ -2402,8 +2402,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2402
2402
  text?: string | undefined;
2403
2403
  coding?: {
2404
2404
  code?: string | null | undefined;
2405
- system?: string | null | undefined;
2406
2405
  display?: string | null | undefined;
2406
+ system?: string | null | undefined;
2407
2407
  }[] | undefined;
2408
2408
  } | undefined;
2409
2409
  status?: string | undefined;
@@ -2425,8 +2425,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2425
2425
  text?: string | undefined;
2426
2426
  coding?: {
2427
2427
  code?: string | null | undefined;
2428
- system?: string | null | undefined;
2429
2428
  display?: string | null | undefined;
2429
+ system?: string | null | undefined;
2430
2430
  }[] | undefined;
2431
2431
  } | undefined;
2432
2432
  status?: string | undefined;
@@ -2457,8 +2457,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2457
2457
  text?: string | undefined;
2458
2458
  coding?: {
2459
2459
  code?: string | null | undefined;
2460
- system?: string | null | undefined;
2461
2460
  display?: string | null | undefined;
2461
+ system?: string | null | undefined;
2462
2462
  }[] | undefined;
2463
2463
  } | undefined;
2464
2464
  status?: string | undefined;
@@ -2489,8 +2489,8 @@ export declare const webhookRequestSchema: z.ZodUnion<[z.ZodObject<{
2489
2489
  text?: string | undefined;
2490
2490
  coding?: {
2491
2491
  code?: string | null | undefined;
2492
- system?: string | null | undefined;
2493
2492
  display?: string | null | undefined;
2493
+ system?: string | null | undefined;
2494
2494
  }[] | undefined;
2495
2495
  } | undefined;
2496
2496
  status?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  export * from "./base64";
2
2
  export * from "./duration";
3
+ export * from "./sqs-delay-from-uuid";
3
4
  export * from "./uuid-v7";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC"}
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./base64"), exports);
18
18
  __exportStar(require("./duration"), exports);
19
+ __exportStar(require("./sqs-delay-from-uuid"), exports);
19
20
  __exportStar(require("./uuid-v7"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,wDAAsC;AACtC,4CAA0B"}
@@ -0,0 +1,11 @@
1
+ /** SQS max delivery delay is 15 minutes (900 seconds). Delay must not exceed this. */
2
+ export declare const SQS_MAX_DELAY_SECONDS = 900;
3
+ /**
4
+ * Maps a string (e.g. cxId or UUID v4) to a delivery delay in seconds for SQS,
5
+ * evenly distributed across 0 to 15 minutes (max). Same input always gets the same delay (deterministic).
6
+ *
7
+ * @param id - Any string identifier (e.g. cxId, UUID v4)
8
+ * @returns Delay in seconds in [0, 900] (≤ 15 min, SQS max)
9
+ */
10
+ export declare function uuidToDelaySeconds(id: string, maxDelaySeconds?: number): number;
11
+ //# sourceMappingURL=sqs-delay-from-uuid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqs-delay-from-uuid.d.ts","sourceRoot":"","sources":["../../src/util/sqs-delay-from-uuid.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,MAAM,EACV,eAAe,GAAE,MAA8B,GAC9C,MAAM,CAKR"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uuidToDelaySeconds = exports.SQS_MAX_DELAY_SECONDS = void 0;
4
+ const node_crypto_1 = require("node:crypto");
5
+ /** SQS max delivery delay is 15 minutes (900 seconds). Delay must not exceed this. */
6
+ exports.SQS_MAX_DELAY_SECONDS = 900;
7
+ /**
8
+ * Maps a string (e.g. cxId or UUID v4) to a delivery delay in seconds for SQS,
9
+ * evenly distributed across 0 to 15 minutes (max). Same input always gets the same delay (deterministic).
10
+ *
11
+ * @param id - Any string identifier (e.g. cxId, UUID v4)
12
+ * @returns Delay in seconds in [0, 900] (≤ 15 min, SQS max)
13
+ */
14
+ function uuidToDelaySeconds(id, maxDelaySeconds = exports.SQS_MAX_DELAY_SECONDS) {
15
+ const BUCKET_COUNT = maxDelaySeconds + 1; // maxDelaySeconds + 1 → 0..maxDelaySeconds
16
+ const hash = (0, node_crypto_1.createHash)("sha256").update(id, "utf8").digest();
17
+ const value = hash.readUInt32BE(0) * 0x100000000 + hash.readUInt32BE(4);
18
+ return value % BUCKET_COUNT; // always in [0, maxDelaySeconds]
19
+ }
20
+ exports.uuidToDelaySeconds = uuidToDelaySeconds;
21
+ //# sourceMappingURL=sqs-delay-from-uuid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqs-delay-from-uuid.js","sourceRoot":"","sources":["../../src/util/sqs-delay-from-uuid.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,sFAAsF;AACzE,QAAA,qBAAqB,GAAG,GAAG,CAAC;AAEzC;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAChC,EAAU,EACV,kBAA0B,6BAAqB;IAE/C,MAAM,YAAY,GAAG,eAAe,GAAG,CAAC,CAAC,CAAC,2CAA2C;IACrF,MAAM,IAAI,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9D,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACxE,OAAO,KAAK,GAAG,YAAY,CAAC,CAAC,iCAAiC;AAChE,CAAC;AARD,gDAQC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metriport/shared",
3
- "version": "0.32.1",
3
+ "version": "0.32.2",
4
4
  "description": "Common code shared across packages - by Metriport Inc.",
5
5
  "author": "Metriport Inc. <contact@metriport.com>",
6
6
  "homepage": "https://metriport.com/",
@@ -128,5 +128,5 @@
128
128
  "ts-jest": "29.1.1",
129
129
  "typescript": "^4.9.5"
130
130
  },
131
- "gitHead": "ac98d7855f52db1edd7f16ae5d8a313f974f3875"
131
+ "gitHead": "47fb645e3b65d4e97ac5ded23d0b5ff02ebc2cd6"
132
132
  }