@awell-health/awell-extensions 2.0.169 → 2.0.171

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.
@@ -50,6 +50,13 @@ export declare const actions: {
50
50
  description: string;
51
51
  required: false;
52
52
  };
53
+ rateLimitDuration: {
54
+ key: string;
55
+ label: string;
56
+ obfuscated: false;
57
+ description: string;
58
+ required: false;
59
+ };
53
60
  }, "status" | "firstName" | "lastName" | "email" | "dob" | "mobilePhone" | "preferredLanguage" | "sex" | "genderIdentity" | "middleName" | "notes" | "pronouns" | "ssn" | "race" | "ethnicity" | "primaryPhysicianId" | "caregiverPracticeId" | "mainPhone" | "actualName" | "legalGenderMarker" | "sexualOrientation" | "previousFirstName" | "previousLastName" | "preferredServiceLocationId" | "patientObject">;
54
61
  createPatient: import("@awell-health/extensions-core").Action<{
55
62
  firstName: {
@@ -236,6 +243,13 @@ export declare const actions: {
236
243
  description: string;
237
244
  required: false;
238
245
  };
246
+ rateLimitDuration: {
247
+ key: string;
248
+ label: string;
249
+ obfuscated: false;
250
+ description: string;
251
+ required: false;
252
+ };
239
253
  }, "patientId">;
240
254
  updatePatient: import("@awell-health/extensions-core").Action<{
241
255
  patientId: {
@@ -420,6 +434,13 @@ export declare const actions: {
420
434
  description: string;
421
435
  required: false;
422
436
  };
437
+ rateLimitDuration: {
438
+ key: string;
439
+ label: string;
440
+ obfuscated: false;
441
+ description: string;
442
+ required: false;
443
+ };
423
444
  }, never>;
424
445
  createAppointment: import("@awell-health/extensions-core").Action<{
425
446
  patientId: {
@@ -524,6 +545,13 @@ export declare const actions: {
524
545
  description: string;
525
546
  required: false;
526
547
  };
548
+ rateLimitDuration: {
549
+ key: string;
550
+ label: string;
551
+ obfuscated: false;
552
+ description: string;
553
+ required: false;
554
+ };
527
555
  }, "appointmentId">;
528
556
  getAppointment: import("@awell-health/extensions-core").Action<{
529
557
  appointmentId: {
@@ -576,6 +604,13 @@ export declare const actions: {
576
604
  description: string;
577
605
  required: false;
578
606
  };
607
+ rateLimitDuration: {
608
+ key: string;
609
+ label: string;
610
+ obfuscated: false;
611
+ description: string;
612
+ required: false;
613
+ };
579
614
  }, "practiceId" | "status" | "patientId" | "duration" | "reason" | "description" | "physicianId" | "appointment" | "scheduledDate" | "serviceLocationId" | "telehealthDetails">;
580
615
  findAppointments: import("@awell-health/extensions-core").Action<{
581
616
  patientId: {
@@ -661,6 +696,13 @@ export declare const actions: {
661
696
  description: string;
662
697
  required: false;
663
698
  };
699
+ rateLimitDuration: {
700
+ key: string;
701
+ label: string;
702
+ obfuscated: false;
703
+ description: string;
704
+ required: false;
705
+ };
664
706
  }, "appointments" | "appointment_exists">;
665
707
  getPharmacy: import("@awell-health/extensions-core").Action<{
666
708
  ncpdpId: {
@@ -713,6 +755,13 @@ export declare const actions: {
713
755
  description: string;
714
756
  required: false;
715
757
  };
758
+ rateLimitDuration: {
759
+ key: string;
760
+ label: string;
761
+ obfuscated: false;
762
+ description: string;
763
+ required: false;
764
+ };
716
765
  }, string>;
717
766
  getPhysician: import("@awell-health/extensions-core").Action<{
718
767
  physicianId: {
@@ -765,6 +814,13 @@ export declare const actions: {
765
814
  description: string;
766
815
  required: false;
767
816
  };
817
+ rateLimitDuration: {
818
+ key: string;
819
+ label: string;
820
+ obfuscated: false;
821
+ description: string;
822
+ required: false;
823
+ };
768
824
  }, "caregiverPracticeId" | "physicianFirstName" | "physicianLastName" | "physicianCredentials" | "physicianEmail" | "physicianNPI" | "physicianUserId">;
769
825
  findPhysician: import("@awell-health/extensions-core").Action<{
770
826
  firstName: {
@@ -831,6 +887,13 @@ export declare const actions: {
831
887
  description: string;
832
888
  required: false;
833
889
  };
890
+ rateLimitDuration: {
891
+ key: string;
892
+ label: string;
893
+ obfuscated: false;
894
+ description: string;
895
+ required: false;
896
+ };
834
897
  }, "physicianId" | "caregiverPracticeId" | "physicianFirstName" | "physicianLastName" | "physicianCredentials" | "physicianEmail" | "physicianNPI" | "physicianUserId">;
835
898
  createNonVisitNote: import("@awell-health/extensions-core").Action<{
836
899
  patientId: {
@@ -911,6 +974,13 @@ export declare const actions: {
911
974
  description: string;
912
975
  required: false;
913
976
  };
977
+ rateLimitDuration: {
978
+ key: string;
979
+ label: string;
980
+ obfuscated: false;
981
+ description: string;
982
+ required: false;
983
+ };
914
984
  }, "nonVisitNoteId" | "nonVisitNoteBulletId">;
915
985
  updateNonVisitNote: import("@awell-health/extensions-core").Action<{
916
986
  nonVisitNoteId: {
@@ -1033,6 +1103,13 @@ export declare const actions: {
1033
1103
  description: string;
1034
1104
  required: false;
1035
1105
  };
1106
+ rateLimitDuration: {
1107
+ key: string;
1108
+ label: string;
1109
+ obfuscated: false;
1110
+ description: string;
1111
+ required: false;
1112
+ };
1036
1113
  }, string>;
1037
1114
  getNonVisitNote: import("@awell-health/extensions-core").Action<{
1038
1115
  nonVisitNoteId: {
@@ -1085,6 +1162,13 @@ export declare const actions: {
1085
1162
  description: string;
1086
1163
  required: false;
1087
1164
  };
1165
+ rateLimitDuration: {
1166
+ key: string;
1167
+ label: string;
1168
+ obfuscated: false;
1169
+ description: string;
1170
+ required: false;
1171
+ };
1088
1172
  }, "practiceId" | "patientId" | "text" | "authorId" | "tags" | "documentDate" | "chartDate">;
1089
1173
  deleteNonVisitNote: import("@awell-health/extensions-core").Action<{
1090
1174
  nonVisitNoteId: {
@@ -1137,6 +1221,13 @@ export declare const actions: {
1137
1221
  description: string;
1138
1222
  required: false;
1139
1223
  };
1224
+ rateLimitDuration: {
1225
+ key: string;
1226
+ label: string;
1227
+ obfuscated: false;
1228
+ description: string;
1229
+ required: false;
1230
+ };
1140
1231
  }, string>;
1141
1232
  createVisitNote: import("@awell-health/extensions-core").Action<{
1142
1233
  patientId: {
@@ -1250,6 +1341,13 @@ export declare const actions: {
1250
1341
  description: string;
1251
1342
  required: false;
1252
1343
  };
1344
+ rateLimitDuration: {
1345
+ key: string;
1346
+ label: string;
1347
+ obfuscated: false;
1348
+ description: string;
1349
+ required: false;
1350
+ };
1253
1351
  }, "visitNoteId">;
1254
1352
  addVitals: import("@awell-health/extensions-core").Action<{
1255
1353
  patientId: {
@@ -1498,6 +1596,13 @@ export declare const actions: {
1498
1596
  description: string;
1499
1597
  required: false;
1500
1598
  };
1599
+ rateLimitDuration: {
1600
+ key: string;
1601
+ label: string;
1602
+ obfuscated: false;
1603
+ description: string;
1604
+ required: false;
1605
+ };
1501
1606
  }, "vitalsId">;
1502
1607
  addHistory: import("@awell-health/extensions-core").Action<{
1503
1608
  patientId: {
@@ -1570,6 +1675,13 @@ export declare const actions: {
1570
1675
  description: string;
1571
1676
  required: false;
1572
1677
  };
1678
+ rateLimitDuration: {
1679
+ key: string;
1680
+ label: string;
1681
+ obfuscated: false;
1682
+ description: string;
1683
+ required: false;
1684
+ };
1573
1685
  }, string>;
1574
1686
  addAllergy: import("@awell-health/extensions-core").Action<{
1575
1687
  patientId: {
@@ -1650,6 +1762,13 @@ export declare const actions: {
1650
1762
  description: string;
1651
1763
  required: false;
1652
1764
  };
1765
+ rateLimitDuration: {
1766
+ key: string;
1767
+ label: string;
1768
+ obfuscated: false;
1769
+ description: string;
1770
+ required: false;
1771
+ };
1653
1772
  }, "allergyId">;
1654
1773
  postLetter: import("@awell-health/extensions-core").Action<{
1655
1774
  patientId: {
@@ -1744,6 +1863,13 @@ export declare const actions: {
1744
1863
  description: string;
1745
1864
  required: false;
1746
1865
  };
1866
+ rateLimitDuration: {
1867
+ key: string;
1868
+ label: string;
1869
+ obfuscated: false;
1870
+ description: string;
1871
+ required: false;
1872
+ };
1747
1873
  }, "letterId">;
1748
1874
  createLabOrder: import("@awell-health/extensions-core").Action<{
1749
1875
  patientId: {
@@ -1845,6 +1971,13 @@ export declare const actions: {
1845
1971
  description: string;
1846
1972
  required: false;
1847
1973
  };
1974
+ rateLimitDuration: {
1975
+ key: string;
1976
+ label: string;
1977
+ obfuscated: false;
1978
+ description: string;
1979
+ required: false;
1980
+ };
1848
1981
  }, "labOrderId" | "printableLabOrderView">;
1849
1982
  createMessageThread: import("@awell-health/extensions-core").Action<{
1850
1983
  patientId: {
@@ -1953,6 +2086,13 @@ export declare const actions: {
1953
2086
  description: string;
1954
2087
  required: false;
1955
2088
  };
2089
+ rateLimitDuration: {
2090
+ key: string;
2091
+ label: string;
2092
+ obfuscated: false;
2093
+ description: string;
2094
+ required: false;
2095
+ };
1956
2096
  }, "messageThreadId">;
1957
2097
  addMessageToThread: import("@awell-health/extensions-core").Action<{
1958
2098
  threadId: {
@@ -2019,6 +2159,13 @@ export declare const actions: {
2019
2159
  description: string;
2020
2160
  required: false;
2021
2161
  };
2162
+ rateLimitDuration: {
2163
+ key: string;
2164
+ label: string;
2165
+ obfuscated: false;
2166
+ description: string;
2167
+ required: false;
2168
+ };
2022
2169
  }, "messageId">;
2023
2170
  getLetter: import("@awell-health/extensions-core").Action<{
2024
2171
  letterId: {
@@ -2071,6 +2218,13 @@ export declare const actions: {
2071
2218
  description: string;
2072
2219
  required: false;
2073
2220
  };
2221
+ rateLimitDuration: {
2222
+ key: string;
2223
+ label: string;
2224
+ obfuscated: false;
2225
+ description: string;
2226
+ required: false;
2227
+ };
2074
2228
  }, "body" | "signedBy">;
2075
2229
  createReferralOrder: import("@awell-health/extensions-core").Action<{
2076
2230
  patient: {
@@ -2171,6 +2325,13 @@ export declare const actions: {
2171
2325
  description: string;
2172
2326
  required: false;
2173
2327
  };
2328
+ rateLimitDuration: {
2329
+ key: string;
2330
+ label: string;
2331
+ obfuscated: false;
2332
+ description: string;
2333
+ required: false;
2334
+ };
2174
2335
  }, "id">;
2175
2336
  createCareGap: import("@awell-health/extensions-core").Action<{
2176
2337
  quality_program: {
@@ -2271,6 +2432,13 @@ export declare const actions: {
2271
2432
  description: string;
2272
2433
  required: false;
2273
2434
  };
2435
+ rateLimitDuration: {
2436
+ key: string;
2437
+ label: string;
2438
+ obfuscated: false;
2439
+ description: string;
2440
+ required: false;
2441
+ };
2274
2442
  }, "id">;
2275
2443
  closeCareGap: import("@awell-health/extensions-core").Action<{
2276
2444
  quality_program: {
@@ -2330,6 +2498,13 @@ export declare const actions: {
2330
2498
  description: string;
2331
2499
  required: false;
2332
2500
  };
2501
+ rateLimitDuration: {
2502
+ key: string;
2503
+ label: string;
2504
+ obfuscated: false;
2505
+ description: string;
2506
+ required: false;
2507
+ };
2333
2508
  }, never>;
2334
2509
  updatePatientTags: import("@awell-health/extensions-core").Action<{
2335
2510
  patientId: {
@@ -2389,6 +2564,13 @@ export declare const actions: {
2389
2564
  description: string;
2390
2565
  required: false;
2391
2566
  };
2567
+ rateLimitDuration: {
2568
+ key: string;
2569
+ label: string;
2570
+ obfuscated: false;
2571
+ description: string;
2572
+ required: false;
2573
+ };
2392
2574
  }, "updatedTags" | "explanation">;
2393
2575
  getReferralOrder: import("@awell-health/extensions-core").Action<{
2394
2576
  referralOrderId: {
@@ -2441,6 +2623,13 @@ export declare const actions: {
2441
2623
  description: string;
2442
2624
  required: false;
2443
2625
  };
2626
+ rateLimitDuration: {
2627
+ key: string;
2628
+ label: string;
2629
+ obfuscated: false;
2630
+ description: string;
2631
+ required: false;
2632
+ };
2444
2633
  }, "patientId" | "practice" | "letterId" | "consultantName" | "diagnosisCodes" | "diagnosisLabels">;
2445
2634
  findFutureAppointment: import("@awell-health/extensions-core").Action<{
2446
2635
  patientId: {
@@ -2500,6 +2689,13 @@ export declare const actions: {
2500
2689
  description: string;
2501
2690
  required: false;
2502
2691
  };
2692
+ rateLimitDuration: {
2693
+ key: string;
2694
+ label: string;
2695
+ obfuscated: false;
2696
+ description: string;
2697
+ required: false;
2698
+ };
2503
2699
  }, "appointment" | "explanation" | "appointmentExists">;
2504
2700
  findAppointmentsByPrompt: import("@awell-health/extensions-core").Action<{
2505
2701
  patientId: {
@@ -2559,6 +2755,13 @@ export declare const actions: {
2559
2755
  description: string;
2560
2756
  required: false;
2561
2757
  };
2758
+ rateLimitDuration: {
2759
+ key: string;
2760
+ label: string;
2761
+ obfuscated: false;
2762
+ description: string;
2763
+ required: false;
2764
+ };
2562
2765
  }, "appointments" | "explanation" | "appointmentCountsByStatus">;
2563
2766
  signNonVisitNote: import("@awell-health/extensions-core").Action<{
2564
2767
  nonVisitNoteId: {
@@ -2618,6 +2821,13 @@ export declare const actions: {
2618
2821
  description: string;
2619
2822
  required: false;
2620
2823
  };
2824
+ rateLimitDuration: {
2825
+ key: string;
2826
+ label: string;
2827
+ obfuscated: false;
2828
+ description: string;
2829
+ required: false;
2830
+ };
2621
2831
  }, never>;
2622
2832
  updateReferralOrderResolution: import("@awell-health/extensions-core").Action<{
2623
2833
  referralOrderId: {
@@ -2688,5 +2898,12 @@ export declare const actions: {
2688
2898
  description: string;
2689
2899
  required: false;
2690
2900
  };
2901
+ rateLimitDuration: {
2902
+ key: string;
2903
+ label: string;
2904
+ obfuscated: false;
2905
+ description: string;
2906
+ required: false;
2907
+ };
2691
2908
  }, never>;
2692
2909
  };
@@ -42,7 +42,15 @@ export declare const settings: {
42
42
  description: string;
43
43
  required: false;
44
44
  };
45
+ rateLimitDuration: {
46
+ key: string;
47
+ label: string;
48
+ obfuscated: false;
49
+ description: string;
50
+ required: false;
51
+ };
45
52
  };
53
+ export declare const rateLimitDurationSchema: z.ZodOptional<z.ZodEffects<z.ZodString, Duration, string>>;
46
54
  export declare const SettingsValidationSchema: z.ZodObject<{
47
55
  base_url: z.ZodString;
48
56
  auth_url: z.ZodString;
@@ -55,6 +63,7 @@ export declare const SettingsValidationSchema: z.ZodObject<{
55
63
  */
56
64
  username: z.ZodOptional<z.ZodString>;
57
65
  password: z.ZodOptional<z.ZodString>;
66
+ rateLimitDuration: z.ZodOptional<z.ZodEffects<z.ZodString, Duration, string>>;
58
67
  }, "strip", z.ZodTypeAny, {
59
68
  auth_url: string;
60
69
  client_id: string;
@@ -62,6 +71,7 @@ export declare const SettingsValidationSchema: z.ZodObject<{
62
71
  base_url: string;
63
72
  username?: string | undefined;
64
73
  password?: string | undefined;
74
+ rateLimitDuration?: Duration | undefined;
65
75
  }, {
66
76
  auth_url: string;
67
77
  client_id: string;
@@ -69,5 +79,6 @@ export declare const SettingsValidationSchema: z.ZodObject<{
69
79
  base_url: string;
70
80
  username?: string | undefined;
71
81
  password?: string | undefined;
82
+ rateLimitDuration?: string | undefined;
72
83
  }>;
73
84
  export type SettingsType = z.infer<typeof SettingsValidationSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SettingsValidationSchema = exports.settings = void 0;
3
+ exports.SettingsValidationSchema = exports.rateLimitDurationSchema = exports.settings = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.settings = {
6
6
  base_url: {
@@ -45,7 +45,22 @@ exports.settings = {
45
45
  description: '⚠️ Deprecated: Elation now uses client credentials authentication. This setting is no longer required and should be removed from your settings.',
46
46
  required: false,
47
47
  },
48
+ rateLimitDuration: {
49
+ key: 'rateLimitDuration',
50
+ label: 'Rate Limit Duration',
51
+ obfuscated: false,
52
+ description: "Rate limit Elation webhooks at a certain duration (e.g. only 1 event for a given appointment_id every '30 s', '1 m', '12 h', '30 d'). Value should be {number} {unit}.",
53
+ required: false,
54
+ },
48
55
  };
56
+ exports.rateLimitDurationSchema = zod_1.z
57
+ .string()
58
+ .regex(/^\d+\s+[smhd]$/, 'Duration must be in format {number} {unit} where unit is s,m,h,d')
59
+ .transform((val) => {
60
+ const [number, unit] = val.split(' ');
61
+ return `${number}${unit}`;
62
+ })
63
+ .optional();
49
64
  exports.SettingsValidationSchema = zod_1.z.object({
50
65
  base_url: zod_1.z.string().min(1),
51
66
  auth_url: zod_1.z.string().min(1),
@@ -58,5 +73,6 @@ exports.SettingsValidationSchema = zod_1.z.object({
58
73
  */
59
74
  username: zod_1.z.string().optional(),
60
75
  password: zod_1.z.string().optional(),
76
+ rateLimitDuration: exports.rateLimitDurationSchema,
61
77
  });
62
78
  //# sourceMappingURL=settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/elation/settings.ts"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;QACjB,GAAG,EAAE,mBAAmB;QACxB,KAAK,EAAE,qBAAqB;QAC5B,UAAU,EAAE,KAAK;QACjB,WAAW,EACT,wKAAwK;QAC1K,QAAQ,EAAE,KAAK;KAChB;CACgC,CAAA;AAEtB,QAAA,uBAAuB,GAAG,OAAC;KACrC,MAAM,EAAE;KACR,KAAK,CACJ,gBAAgB,EAChB,kEAAkE,CACnE;KACA,SAAS,CAAC,CAAC,GAAG,EAAY,EAAE;IAC3B,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACrC,OAAO,GAAG,MAAM,GAAG,IAAI,EAAc,CAAA;AACvC,CAAC,CAAC;KACD,QAAQ,EAAE,CAAA;AAEA,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC;;;;OAIG;IACH,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,iBAAiB,EAAE,+BAAuB;CACS,CAAC,CAAA"}
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.appointmentCreatedOrUpdated = void 0;
4
4
  const constants_1 = require("../constants");
5
+ const node_crypto_1 = require("node:crypto");
6
+ const settings_1 = require("../settings");
7
+ const lodash_1 = require("lodash");
5
8
  const dataPoints = {
6
9
  appointmentId: {
7
10
  key: 'appointmentId',
@@ -15,13 +18,32 @@ const dataPoints = {
15
18
  exports.appointmentCreatedOrUpdated = {
16
19
  key: 'appointmentCreatedOrUpdated',
17
20
  dataPoints,
18
- onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
21
+ onEvent: async ({ payload: { payload, settings }, onSuccess, onError, helpers, }) => {
19
22
  const { action, resource, data } = payload;
20
23
  const { id: appointmentId, patient: patientId } = data;
21
24
  // skip non 'saved' actions for that webhook
22
25
  if (action !== 'saved') {
23
26
  return;
24
27
  }
28
+ const rateLimitDuration = settings_1.rateLimitDurationSchema.parse(settings.rateLimitDuration);
29
+ if (!(0, lodash_1.isNil)(rateLimitDuration)) {
30
+ const rateLimiter = helpers.rateLimit(1, rateLimitDuration);
31
+ const strAppt = JSON.stringify(data);
32
+ const uniqueHash = (0, node_crypto_1.createHash)('sha256').update(strAppt).digest('hex');
33
+ // i'd rather use the unique hash here, but instead using an appointment ID
34
+ const { success } = await rateLimiter.limit(`elation-appointment-${appointmentId}`);
35
+ if (!success) {
36
+ console.log(`ELATION: Rate limited for appointment_id=${appointmentId}`);
37
+ // we're sending a 200 response to elation to avoid them retrying the request
38
+ await onError({
39
+ response: {
40
+ statusCode: 200,
41
+ message: 'Rate limit exceeded',
42
+ },
43
+ });
44
+ return;
45
+ }
46
+ }
25
47
  if (resource !== 'appointments') {
26
48
  await onError({
27
49
  response: {
@@ -1 +1 @@
1
- {"version":3,"file":"appointmentCreatedOrUpdated.js","sourceRoot":"","sources":["../../../../extensions/elation/webhooks/appointmentCreatedOrUpdated.ts"],"names":[],"mappings":";;;AAIA,4CAA6C;AAG7C,MAAM,UAAU,GAAG;IACjB,aAAa,EAAE;QACb,GAAG,EAAE,eAAe;QACpB,SAAS,EAAE,QAAQ;KACpB;IACD,WAAW,EAAE;QACX,GAAG,EAAE,aAAa;QAClB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA;AAElC,QAAA,2BAA2B,GAGpC;IACF,GAAG,EAAE,6BAA6B;IAClC,UAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QACrE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;QAC1C,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;QAEtD,6CAA6C;QAC7C,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAM;QACR,CAAC;QAED,IAAI,QAAQ,KAAK,cAAc,EAAE,CAAC;YAChC,MAAM,OAAO,CAAC;gBACZ,QAAQ,EAAE;oBACR,UAAU,EAAE,GAAG;oBACf,OAAO,EAAE,gCAAgC;iBAC1C;aACF,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC;oBACpC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;iBAClC;gBACD,kBAAkB,EAAE;oBAClB,MAAM,EAAE,0BAAc;oBACtB,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC;iBACzB;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"appointmentCreatedOrUpdated.js","sourceRoot":"","sources":["../../../../extensions/elation/webhooks/appointmentCreatedOrUpdated.ts"],"names":[],"mappings":";;;AAIA,4CAA6C;AAE7C,6CAAwC;AAExC,0CAAqD;AACrD,mCAA8B;AAE9B,MAAM,UAAU,GAAG;IACjB,aAAa,EAAE;QACb,GAAG,EAAE,eAAe;QACpB,SAAS,EAAE,QAAQ;KACpB;IACD,WAAW,EAAE;QACX,GAAG,EAAE,aAAa;QAClB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA;AAElC,QAAA,2BAA2B,GAGpC;IACF,GAAG,EAAE,6BAA6B;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MAAM,OAAO,CAAC;gBACZ,QAAQ,EAAE;oBACR,UAAU,EAAE,GAAG;oBACf,OAAO,EAAE,gCAAgC;iBAC1C;aACF,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC;oBACpC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;iBAClC;gBACD,kBAAkB,EAAE;oBAClB,MAAM,EAAE,0BAAc;oBACtB,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC;iBACzB;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.patientCreatedOrUpdated = void 0;
4
+ const settings_1 = require("../settings");
5
+ const node_crypto_1 = require("node:crypto");
6
+ const lodash_1 = require("lodash");
4
7
  const dataPoints = {
5
8
  patientId: {
6
9
  key: 'patientId',
@@ -14,12 +17,32 @@ const dataPoints = {
14
17
  exports.patientCreatedOrUpdated = {
15
18
  key: 'patientCreatedOrUpdated',
16
19
  dataPoints,
17
- onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
20
+ onEvent: async ({ payload: { payload, settings }, onSuccess, onError, helpers, }) => {
18
21
  const { data, resource, action } = payload;
22
+ const { id: patientId } = data;
19
23
  // skip non 'saved' actions for that webhook
20
24
  if (action !== 'saved') {
21
25
  return;
22
26
  }
27
+ const rateLimitDuration = settings_1.rateLimitDurationSchema.parse(settings.rateLimitDuration);
28
+ if (!(0, lodash_1.isNil)(rateLimitDuration)) {
29
+ const rateLimiter = helpers.rateLimit(1, rateLimitDuration);
30
+ const strPatient = JSON.stringify(data);
31
+ const uniqueHash = (0, node_crypto_1.createHash)('sha256').update(strPatient).digest('hex');
32
+ // i'd rather use the unique hash here, but instead using a patient ID
33
+ const { success } = await rateLimiter.limit(`elation-patient-${patientId}`);
34
+ if (!success) {
35
+ console.log(`ELATION: Rate limited for patient_id=${patientId}`);
36
+ // we're sending a 200 response to elation to avoid them retrying the request
37
+ await onError({
38
+ response: {
39
+ statusCode: 200,
40
+ message: 'Rate limit exceeded',
41
+ },
42
+ });
43
+ return;
44
+ }
45
+ }
23
46
  if (resource !== 'patients') {
24
47
  await onError({
25
48
  response: {
@@ -1 +1 @@
1
- {"version":3,"file":"patientCreatedOrUpdated.js","sourceRoot":"","sources":["../../../../extensions/elation/webhooks/patientCreatedOrUpdated.ts"],"names":[],"mappings":";;;AAMA,MAAM,UAAU,GAAG;IACjB,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,QAAQ;KACpB;IACD,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA;AAElC,QAAA,uBAAuB,GAGhC;IACF,GAAG,EAAE,yBAAyB;IAC9B,UAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QACrE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;QAE1C,4CAA4C;QAC5C,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAM;QACR,CAAC;QAED,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;YAC5B,MAAM,OAAO,CAAC;gBACZ,QAAQ,EAAE;oBACR,UAAU,EAAE,GAAG;oBACf,OAAO,EAAE,2BAA2B;iBACrC;aACF,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC1B,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;iBAC9B;gBACD,iDAAiD;gBACjD,kBAAkB,EAAE;oBAClB,MAAM,EAAE,gCAAgC;oBACxC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;iBACvB;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"patientCreatedOrUpdated.js","sourceRoot":"","sources":["../../../../extensions/elation/webhooks/patientCreatedOrUpdated.ts"],"names":[],"mappings":";;;AAMA,0CAAqD;AACrD,6CAAwC;AACxC,mCAA8B;AAE9B,MAAM,UAAU,GAAG;IACjB,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,QAAQ;KACpB;IACD,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA;AAElC,QAAA,uBAAuB,GAGhC;IACF,GAAG,EAAE,yBAAyB;IAC9B,UAAU;IACV,OAAO,EAAE,KAAK,EAAE,EACd,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAC9B,SAAS,EACT,OAAO,EACP,OAAO,GACR,EAAE,EAAE;QACH,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;QAC1C,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;QAE9B,4CAA4C;QAC5C,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAM;QACR,CAAC;QAED,MAAM,iBAAiB,GAAG,kCAAuB,CAAC,KAAK,CACrD,QAAQ,CAAC,iBAAiB,CAC3B,CAAA;QAED,IAAI,CAAC,IAAA,cAAK,EAAC,iBAAiB,CAAC,EAAE,CAAC;YAC9B,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,iBAA6B,CAAC,CAAA;YACvE,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YACvC,MAAM,UAAU,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACxE,sEAAsE;YACtE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,WAAW,CAAC,KAAK,CACzC,mBAAmB,SAAS,EAAE,CAC/B,CAAA;YACD,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,CAAC,GAAG,CAAC,wCAAwC,SAAS,EAAE,CAAC,CAAA;gBAChE,6EAA6E;gBAC7E,MAAM,OAAO,CAAC;oBACZ,QAAQ,EAAE;wBACR,UAAU,EAAE,GAAG;wBACf,OAAO,EAAE,qBAAqB;qBAC/B;iBACF,CAAC,CAAA;gBACF,OAAM;YACR,CAAC;QACH,CAAC;QAED,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;YAC5B,MAAM,OAAO,CAAC;gBACZ,QAAQ,EAAE;oBACR,UAAU,EAAE,GAAG;oBACf,OAAO,EAAE,2BAA2B;iBACrC;aACF,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC1B,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;iBAC9B;gBACD,iDAAiD;gBACjD,kBAAkB,EAAE;oBAClB,MAAM,EAAE,gCAAgC;oBACxC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;iBACvB;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -34,11 +34,11 @@ export declare const FieldsValidationSchema: z.ZodObject<{
34
34
  dateRight: z.ZodDate;
35
35
  unit: z.ZodEnum<["seconds", "minutes", "hours", "days", "weeks", "months", "years"]>;
36
36
  }, "strip", z.ZodTypeAny, {
37
+ unit: "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years";
37
38
  dateLeft: Date;
38
39
  dateRight: Date;
39
- unit: "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years";
40
40
  }, {
41
+ unit: "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years";
41
42
  dateLeft: Date;
42
43
  dateRight: Date;
43
- unit: "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years";
44
44
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "2.0.169",
3
+ "version": "2.0.171",
4
4
  "packageManager": "yarn@4.5.3",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {
@@ -79,7 +79,7 @@
79
79
  },
80
80
  "dependencies": {
81
81
  "@awell-health/awell-sdk": "^0.1.20",
82
- "@awell-health/extensions-core": "1.0.18",
82
+ "@awell-health/extensions-core": "1.0.20",
83
83
  "@awell-health/healthie-sdk": "^0.1.1",
84
84
  "@dropbox/sign": "^1.8.0",
85
85
  "@hubspot/api-client": "^11.2.0",
@@ -91,6 +91,7 @@
91
91
  "@sendgrid/helpers": "^7.7.0",
92
92
  "@sendgrid/mail": "^7.7.0",
93
93
  "@types/json-schema": "^7.0.15",
94
+ "@upstash/ratelimit": "^2.0.5",
94
95
  "api": "^6.0.0",
95
96
  "axios": "^1.6.8",
96
97
  "body-parser": "^1.20.2",