saferx-pharma-sdk 1.4.2 → 2.0.1

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 (167) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +0 -12
  3. package/dist/cjs/Client.js +0 -67
  4. package/dist/cjs/api/resources/developers/client/Client.d.ts +1 -1
  5. package/dist/cjs/api/resources/developers/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/drugSafety/client/Client.d.ts +5 -37
  7. package/dist/cjs/api/resources/drugSafety/client/Client.js +5 -37
  8. package/dist/cjs/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.ts +4 -38
  9. package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.ts +14 -2
  10. package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.js +11 -0
  11. package/dist/cjs/api/types/Alert.d.ts +2 -8
  12. package/dist/cjs/api/types/Alert.js +1 -5
  13. package/dist/cjs/api/types/ClinicalAlert.d.ts +0 -8
  14. package/dist/cjs/api/types/ClinicalData.d.ts +4 -7
  15. package/dist/cjs/api/types/DailyLimit.d.ts +1 -1
  16. package/dist/cjs/api/types/DomainCode.d.ts +2 -4
  17. package/dist/cjs/api/types/DomainCode.js +2 -4
  18. package/dist/cjs/api/types/DosingData.d.ts +12 -22
  19. package/dist/cjs/api/types/DosingData.js +3 -3
  20. package/dist/cjs/api/types/DrugSafetyCheckResponse.d.ts +0 -1
  21. package/dist/cjs/api/types/ErrorResponse.d.ts +0 -5
  22. package/dist/cjs/api/types/Interaction.d.ts +2 -0
  23. package/dist/cjs/api/types/InteractionSummary.d.ts +4 -4
  24. package/dist/cjs/api/types/Meta.d.ts +0 -2
  25. package/dist/cjs/api/types/Meta.js +0 -1
  26. package/dist/cjs/api/types/MetadataResponse.d.ts +6 -14
  27. package/dist/cjs/api/types/MetadataResponse.js +0 -1
  28. package/dist/cjs/api/types/PatientProfile.d.ts +0 -31
  29. package/dist/cjs/api/types/PatientProfile.js +0 -17
  30. package/dist/cjs/api/types/RateLimitResponse.d.ts +0 -11
  31. package/dist/cjs/api/types/RateLimitResponse.js +0 -1
  32. package/dist/cjs/api/types/ReproductiveSafetyData.d.ts +3 -3
  33. package/dist/cjs/api/types/ResolvedDrug.d.ts +0 -26
  34. package/dist/cjs/api/types/SafetyData.d.ts +0 -1
  35. package/dist/cjs/api/types/index.d.ts +0 -16
  36. package/dist/cjs/api/types/index.js +0 -16
  37. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
  38. package/dist/cjs/core/fetcher/Fetcher.js +1 -1
  39. package/dist/cjs/core/fetcher/index.d.ts +0 -2
  40. package/dist/cjs/core/fetcher/index.js +1 -3
  41. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -6
  42. package/dist/cjs/core/fetcher/makeRequest.js +9 -30
  43. package/dist/cjs/core/runtime/runtime.js +7 -8
  44. package/dist/cjs/version.d.ts +1 -1
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/esm/BaseClient.mjs +2 -2
  47. package/dist/esm/Client.d.mts +0 -12
  48. package/dist/esm/Client.mjs +0 -34
  49. package/dist/esm/api/resources/developers/client/Client.d.mts +1 -1
  50. package/dist/esm/api/resources/developers/client/Client.mjs +1 -1
  51. package/dist/esm/api/resources/drugSafety/client/Client.d.mts +5 -37
  52. package/dist/esm/api/resources/drugSafety/client/Client.mjs +5 -37
  53. package/dist/esm/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.mts +4 -38
  54. package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.mts +14 -2
  55. package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.mjs +11 -0
  56. package/dist/esm/api/types/Alert.d.mts +2 -8
  57. package/dist/esm/api/types/Alert.mjs +1 -5
  58. package/dist/esm/api/types/ClinicalAlert.d.mts +0 -8
  59. package/dist/esm/api/types/ClinicalData.d.mts +4 -7
  60. package/dist/esm/api/types/DailyLimit.d.mts +1 -1
  61. package/dist/esm/api/types/DomainCode.d.mts +2 -4
  62. package/dist/esm/api/types/DomainCode.mjs +2 -4
  63. package/dist/esm/api/types/DosingData.d.mts +12 -22
  64. package/dist/esm/api/types/DosingData.mjs +3 -3
  65. package/dist/esm/api/types/DrugSafetyCheckResponse.d.mts +0 -1
  66. package/dist/esm/api/types/ErrorResponse.d.mts +0 -5
  67. package/dist/esm/api/types/Interaction.d.mts +2 -0
  68. package/dist/esm/api/types/InteractionSummary.d.mts +4 -4
  69. package/dist/esm/api/types/Meta.d.mts +0 -2
  70. package/dist/esm/api/types/Meta.mjs +0 -1
  71. package/dist/esm/api/types/MetadataResponse.d.mts +6 -14
  72. package/dist/esm/api/types/MetadataResponse.mjs +0 -1
  73. package/dist/esm/api/types/PatientProfile.d.mts +0 -31
  74. package/dist/esm/api/types/PatientProfile.mjs +1 -16
  75. package/dist/esm/api/types/RateLimitResponse.d.mts +0 -11
  76. package/dist/esm/api/types/RateLimitResponse.mjs +0 -1
  77. package/dist/esm/api/types/ReproductiveSafetyData.d.mts +3 -3
  78. package/dist/esm/api/types/ResolvedDrug.d.mts +0 -26
  79. package/dist/esm/api/types/SafetyData.d.mts +0 -1
  80. package/dist/esm/api/types/index.d.mts +0 -16
  81. package/dist/esm/api/types/index.mjs +0 -16
  82. package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
  83. package/dist/esm/core/fetcher/Fetcher.mjs +1 -1
  84. package/dist/esm/core/fetcher/index.d.mts +0 -2
  85. package/dist/esm/core/fetcher/index.mjs +0 -1
  86. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -6
  87. package/dist/esm/core/fetcher/makeRequest.mjs +9 -28
  88. package/dist/esm/core/runtime/runtime.mjs +7 -8
  89. package/dist/esm/version.d.mts +1 -1
  90. package/dist/esm/version.mjs +1 -1
  91. package/package.json +9 -31
  92. package/dist/cjs/api/resources/developers/exports.d.ts +0 -2
  93. package/dist/cjs/api/resources/developers/exports.js +0 -21
  94. package/dist/cjs/api/resources/drugSafety/exports.d.ts +0 -2
  95. package/dist/cjs/api/resources/drugSafety/exports.js +0 -21
  96. package/dist/cjs/api/types/AllergyCrossReactivityReference.d.ts +0 -16
  97. package/dist/cjs/api/types/AllergyCrossReactivityReference.js +0 -3
  98. package/dist/cjs/api/types/AllergyData.d.ts +0 -24
  99. package/dist/cjs/api/types/AllergyData.js +0 -11
  100. package/dist/cjs/api/types/AllergyFamilyReference.d.ts +0 -10
  101. package/dist/cjs/api/types/AllergyFamilyReference.js +0 -3
  102. package/dist/cjs/api/types/AllergyInputEntry.d.ts +0 -10
  103. package/dist/cjs/api/types/AllergyInputEntry.js +0 -3
  104. package/dist/cjs/api/types/AllergyProductFamilyReference.d.ts +0 -9
  105. package/dist/cjs/api/types/AllergyProductFamilyReference.js +0 -3
  106. package/dist/cjs/api/types/AllergySummary.d.ts +0 -14
  107. package/dist/cjs/api/types/AllergySummary.js +0 -3
  108. package/dist/cjs/api/types/AllergyWarning.d.ts +0 -30
  109. package/dist/cjs/api/types/AllergyWarning.js +0 -11
  110. package/dist/cjs/api/types/ClinicalContextApplied.d.ts +0 -10
  111. package/dist/cjs/api/types/ClinicalContextApplied.js +0 -3
  112. package/dist/cjs/api/types/IdentityMatch.d.ts +0 -13
  113. package/dist/cjs/api/types/IdentityMatch.js +0 -3
  114. package/dist/cjs/api/types/IntelligenceClinicalProfile.d.ts +0 -24
  115. package/dist/cjs/api/types/IntelligenceClinicalProfile.js +0 -13
  116. package/dist/cjs/api/types/IntelligenceContext.d.ts +0 -17
  117. package/dist/cjs/api/types/IntelligenceContext.js +0 -3
  118. package/dist/cjs/api/types/IntelligenceProcessorError.d.ts +0 -4
  119. package/dist/cjs/api/types/IntelligenceProcessorError.js +0 -3
  120. package/dist/cjs/api/types/IntelligenceResult.d.ts +0 -16
  121. package/dist/cjs/api/types/IntelligenceResult.js +0 -3
  122. package/dist/cjs/api/types/IntelligenceSynthesis.d.ts +0 -6
  123. package/dist/cjs/api/types/IntelligenceSynthesis.js +0 -3
  124. package/dist/cjs/api/types/MedicationHistoryItem.d.ts +0 -22
  125. package/dist/cjs/api/types/MedicationHistoryItem.js +0 -15
  126. package/dist/cjs/api/types/QuotaMeta.d.ts +0 -11
  127. package/dist/cjs/api/types/QuotaMeta.js +0 -3
  128. package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +0 -49
  129. package/dist/cjs/core/fetcher/makePassthroughRequest.js +0 -135
  130. package/dist/esm/api/resources/developers/exports.d.mts +0 -2
  131. package/dist/esm/api/resources/developers/exports.mjs +0 -3
  132. package/dist/esm/api/resources/drugSafety/exports.d.mts +0 -2
  133. package/dist/esm/api/resources/drugSafety/exports.mjs +0 -3
  134. package/dist/esm/api/types/AllergyCrossReactivityReference.d.mts +0 -16
  135. package/dist/esm/api/types/AllergyCrossReactivityReference.mjs +0 -2
  136. package/dist/esm/api/types/AllergyData.d.mts +0 -24
  137. package/dist/esm/api/types/AllergyData.mjs +0 -8
  138. package/dist/esm/api/types/AllergyFamilyReference.d.mts +0 -10
  139. package/dist/esm/api/types/AllergyFamilyReference.mjs +0 -2
  140. package/dist/esm/api/types/AllergyInputEntry.d.mts +0 -10
  141. package/dist/esm/api/types/AllergyInputEntry.mjs +0 -2
  142. package/dist/esm/api/types/AllergyProductFamilyReference.d.mts +0 -9
  143. package/dist/esm/api/types/AllergyProductFamilyReference.mjs +0 -2
  144. package/dist/esm/api/types/AllergySummary.d.mts +0 -14
  145. package/dist/esm/api/types/AllergySummary.mjs +0 -2
  146. package/dist/esm/api/types/AllergyWarning.d.mts +0 -30
  147. package/dist/esm/api/types/AllergyWarning.mjs +0 -8
  148. package/dist/esm/api/types/ClinicalContextApplied.d.mts +0 -10
  149. package/dist/esm/api/types/ClinicalContextApplied.mjs +0 -2
  150. package/dist/esm/api/types/IdentityMatch.d.mts +0 -13
  151. package/dist/esm/api/types/IdentityMatch.mjs +0 -2
  152. package/dist/esm/api/types/IntelligenceClinicalProfile.d.mts +0 -24
  153. package/dist/esm/api/types/IntelligenceClinicalProfile.mjs +0 -10
  154. package/dist/esm/api/types/IntelligenceContext.d.mts +0 -17
  155. package/dist/esm/api/types/IntelligenceContext.mjs +0 -2
  156. package/dist/esm/api/types/IntelligenceProcessorError.d.mts +0 -4
  157. package/dist/esm/api/types/IntelligenceProcessorError.mjs +0 -2
  158. package/dist/esm/api/types/IntelligenceResult.d.mts +0 -16
  159. package/dist/esm/api/types/IntelligenceResult.mjs +0 -2
  160. package/dist/esm/api/types/IntelligenceSynthesis.d.mts +0 -6
  161. package/dist/esm/api/types/IntelligenceSynthesis.mjs +0 -2
  162. package/dist/esm/api/types/MedicationHistoryItem.d.mts +0 -22
  163. package/dist/esm/api/types/MedicationHistoryItem.mjs +0 -12
  164. package/dist/esm/api/types/QuotaMeta.d.mts +0 -11
  165. package/dist/esm/api/types/QuotaMeta.mjs +0 -2
  166. package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +0 -49
  167. package/dist/esm/core/fetcher/makePassthroughRequest.mjs +0 -132
@@ -2,12 +2,12 @@
2
2
  * Interaction count by severity level for quick triage
3
3
  */
4
4
  export interface InteractionSummary {
5
- /** Number of contraindicated (severity 4) interactions */
5
+ /** Number of contraindicated (severity 5) interactions */
6
6
  contraindicated?: number | undefined;
7
- /** Number of major (severity 3) interactions */
7
+ /** Number of major (severity 4) interactions */
8
8
  major?: number | undefined;
9
- /** Number of moderate (severity 2) interactions */
9
+ /** Number of moderate (severity 3) interactions */
10
10
  moderate?: number | undefined;
11
- /** Number of minor (severity 1) interactions */
11
+ /** Number of minor (severity 2) interactions */
12
12
  minor?: number | undefined;
13
13
  }
@@ -15,13 +15,11 @@ export interface Meta {
15
15
  unresolved_count?: number | undefined;
16
16
  /** Caller's current tier */
17
17
  tier?: Meta.Tier | undefined;
18
- quota?: SafeRx.QuotaMeta | undefined;
19
18
  }
20
19
  export declare namespace Meta {
21
20
  /** Caller's current tier */
22
21
  const Tier: {
23
22
  readonly Free: "free";
24
- readonly Startup: "startup";
25
23
  readonly Pro: "pro";
26
24
  readonly Enterprise: "enterprise";
27
25
  };
@@ -7,7 +7,6 @@ var Meta;
7
7
  /** Caller's current tier */
8
8
  Meta.Tier = {
9
9
  Free: "free",
10
- Startup: "startup",
11
10
  Pro: "pro",
12
11
  Enterprise: "enterprise",
13
12
  };
@@ -42,8 +42,6 @@ export declare namespace MetadataResponse {
42
42
  ae_risk_levels?: string[] | undefined;
43
43
  /** DDI severity scale: integer key → label */
44
44
  ddi_severity?: Record<string, string> | undefined;
45
- /** Allergy warning severity scale: integer key → label */
46
- allergy_severity?: Record<string, string> | undefined;
47
45
  }
48
46
  /**
49
47
  * Current database versions
@@ -54,8 +52,7 @@ export declare namespace MetadataResponse {
54
52
  clinical?: string | undefined;
55
53
  pllr?: string | undefined;
56
54
  food?: string | undefined;
57
- clinical_dose?: string | undefined;
58
- allergy?: string | undefined;
55
+ dose?: string | undefined;
59
56
  }
60
57
  /**
61
58
  * Database coverage statistics
@@ -72,20 +69,15 @@ export declare namespace MetadataResponse {
72
69
  /** Number of supported populations */
73
70
  clinical_populations?: number | undefined;
74
71
  /** Products with dose data */
75
- clinical_dose_products?: number | undefined;
76
- /** Dose data schema version */
77
- clinical_dose_schema_version?: string | undefined;
78
- /** Products with allergy reference data */
79
- allergy_products?: number | undefined;
80
- /** Allergy family count */
81
- allergy_families?: number | undefined;
82
- /** Allergy family cross-reaction pair count */
83
- allergy_cross_reaction_pairs?: number | undefined;
72
+ dose_products?: number | undefined;
73
+ /** Percentage of products with dose coverage */
74
+ dose_coverage_percent?: number | undefined;
75
+ /** Products with max units/day calculation */
76
+ dose_with_calculation?: number | undefined;
84
77
  }
85
78
  /** Caller's current tier */
86
79
  const Tier: {
87
80
  readonly Free: "free";
88
- readonly Startup: "startup";
89
81
  readonly Pro: "pro";
90
82
  readonly Enterprise: "enterprise";
91
83
  };
@@ -10,7 +10,6 @@ var MetadataResponse;
10
10
  /** Caller's current tier */
11
11
  MetadataResponse.Tier = {
12
12
  Free: "free",
13
- Startup: "startup",
14
13
  Pro: "pro",
15
14
  Enterprise: "enterprise",
16
15
  };
@@ -9,35 +9,4 @@ export interface PatientProfile {
9
9
  populations?: SafeRx.Population[] | undefined;
10
10
  /** Patient comorbidities (e.g., diabetes, hypertension) */
11
11
  conditions?: SafeRx.Condition[] | undefined;
12
- /** Known patient allergies for the `allergy` domain. */
13
- allergies?: string[] | undefined;
14
- /** Patient age in years. Used to infer pediatric or geriatric clinical-dose context. */
15
- age?: number | undefined;
16
- /** Patient weight in kilograms. Used for pediatric weight-based dose context when available. */
17
- weight_kg?: number | undefined;
18
- /** Creatinine clearance in mL/min. Supplying this infers the `renal` population and returns matched renal dose-adjustment context when available. */
19
- crcl?: number | undefined;
20
- /** eGFR value accepted as a fallback renal-function input when `crcl` is not supplied. */
21
- egfr?: number | undefined;
22
- /** Child-Pugh class. Supplying this infers the `hepatic` population and returns matched hepatic dose-adjustment context when available. */
23
- child_pugh?: PatientProfile.ChildPugh | undefined;
24
- /** Hepatic impairment severity. `mild`, `moderate`, and `severe` map to hepatic clinical-dose context when `child_pugh` is not supplied. */
25
- hepatic_status?: PatientProfile.HepaticStatus | undefined;
26
- }
27
- export declare namespace PatientProfile {
28
- /** Child-Pugh class. Supplying this infers the `hepatic` population and returns matched hepatic dose-adjustment context when available. */
29
- const ChildPugh: {
30
- readonly A: "A";
31
- readonly B: "B";
32
- readonly C: "C";
33
- };
34
- type ChildPugh = (typeof ChildPugh)[keyof typeof ChildPugh];
35
- /** Hepatic impairment severity. `mild`, `moderate`, and `severe` map to hepatic clinical-dose context when `child_pugh` is not supplied. */
36
- const HepaticStatus: {
37
- readonly Normal: "normal";
38
- readonly Mild: "mild";
39
- readonly Moderate: "moderate";
40
- readonly Severe: "severe";
41
- };
42
- type HepaticStatus = (typeof HepaticStatus)[keyof typeof HepaticStatus];
43
12
  }
@@ -1,20 +1,3 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PatientProfile = void 0;
5
- var PatientProfile;
6
- (function (PatientProfile) {
7
- /** Child-Pugh class. Supplying this infers the `hepatic` population and returns matched hepatic dose-adjustment context when available. */
8
- PatientProfile.ChildPugh = {
9
- A: "A",
10
- B: "B",
11
- C: "C",
12
- };
13
- /** Hepatic impairment severity. `mild`, `moderate`, and `severe` map to hepatic clinical-dose context when `child_pugh` is not supplied. */
14
- PatientProfile.HepaticStatus = {
15
- Normal: "normal",
16
- Mild: "mild",
17
- Moderate: "moderate",
18
- Severe: "severe",
19
- };
20
- })(PatientProfile || (exports.PatientProfile = PatientProfile = {}));
@@ -11,16 +11,6 @@ export interface RateLimitResponse {
11
11
  daily_limit?: number | undefined;
12
12
  /** Requests made today (present on daily limit errors) */
13
13
  requests_today?: number | undefined;
14
- /** Machine-readable limit reason */
15
- reason?: string | undefined;
16
- /** Your monthly commercial quota (present on monthly quota errors) */
17
- monthly_limit?: number | undefined;
18
- /** Requests consumed in the current monthly quota period */
19
- requests_this_month?: number | undefined;
20
- /** Remaining monthly quota units */
21
- monthly_remaining?: number | undefined;
22
- /** Monthly quota reset timestamp */
23
- reset_at?: string | undefined;
24
14
  tier?: RateLimitResponse.Tier | undefined;
25
15
  /** Upgrade guidance */
26
16
  hint?: string | undefined;
@@ -29,7 +19,6 @@ export interface RateLimitResponse {
29
19
  export declare namespace RateLimitResponse {
30
20
  const Tier: {
31
21
  readonly Free: "free";
32
- readonly Startup: "startup";
33
22
  readonly Pro: "pro";
34
23
  readonly Enterprise: "enterprise";
35
24
  };
@@ -6,7 +6,6 @@ var RateLimitResponse;
6
6
  (function (RateLimitResponse) {
7
7
  RateLimitResponse.Tier = {
8
8
  Free: "free",
9
- Startup: "startup",
10
9
  Pro: "pro",
11
10
  Enterprise: "enterprise",
12
11
  };
@@ -32,19 +32,19 @@ export interface ReproductiveSafetyData {
32
32
  pregnancy_warning?: SafeRx.ReproductiveWarning | undefined;
33
33
  lactation_warning?: SafeRx.ReproductiveWarning | undefined;
34
34
  /** First trimester pregnancy risk classification */
35
- preg_t1_risk?: (string | null) | undefined;
35
+ preg_t1_risk?: (number | null) | undefined;
36
36
  /** First trimester clinical note */
37
37
  preg_t1_note?: (string | null) | undefined;
38
38
  /** First trimester note in Arabic */
39
39
  preg_t1_note_ar?: (string | null) | undefined;
40
40
  /** Second trimester pregnancy risk classification */
41
- preg_t2_risk?: (string | null) | undefined;
41
+ preg_t2_risk?: (number | null) | undefined;
42
42
  /** Second trimester clinical note */
43
43
  preg_t2_note?: (string | null) | undefined;
44
44
  /** Second trimester note in Arabic */
45
45
  preg_t2_note_ar?: (string | null) | undefined;
46
46
  /** Third trimester pregnancy risk classification */
47
- preg_t3_risk?: (string | null) | undefined;
47
+ preg_t3_risk?: (number | null) | undefined;
48
48
  /** Third trimester clinical note */
49
49
  preg_t3_note?: (string | null) | undefined;
50
50
  /** Third trimester note in Arabic */
@@ -1,4 +1,3 @@
1
- import type * as SafeRx from "../index.js";
2
1
  export interface ResolvedDrug {
3
2
  /** The original drug name as submitted in the request */
4
3
  input: string;
@@ -18,10 +17,6 @@ export interface ResolvedDrug {
18
17
  brand_name: string;
19
18
  /** Arabic trade name */
20
19
  brand_name_ar?: string | undefined;
21
- /** Concise registered name plus strength, useful for app display and local matching. */
22
- display_name?: string | undefined;
23
- /** Arabic concise registered name plus strength, when available. */
24
- display_name_ar?: string | undefined;
25
20
  /** Active pharmaceutical ingredient(s), pipe-separated for combinations */
26
21
  active_ingredient: string;
27
22
  /** Arabic active ingredient name */
@@ -34,30 +29,10 @@ export interface ResolvedDrug {
34
29
  form: string;
35
30
  /** Arabic dosage form */
36
31
  form_ar?: string | undefined;
37
- /** Registered strength text as listed for the product. */
38
- strength?: string | undefined;
39
- /** Administration route, when available. */
40
- route?: string | undefined;
41
32
  /** Marketing authorization holder */
42
33
  manufacturer_en?: string | undefined;
43
34
  /** ATC-based therapeutic classification, pipe-separated hierarchy */
44
35
  therapeutic_class?: string | undefined;
45
- /** Public therapeutic/pharmacology summary in English. */
46
- therapeutic_class_detail?: string | undefined;
47
- /** Public therapeutic/pharmacology summary in Arabic, when available. */
48
- therapeutic_class_detail_ar?: string | undefined;
49
- /** Registered pharmaceutical uses or indications in English, when available. */
50
- pharma_uses?: string | undefined;
51
- /** Registered pharmaceutical uses or indications in Arabic, when available. */
52
- pharma_uses_ar?: string | undefined;
53
- /** Patient/app-friendly product description in English, when available. */
54
- description?: string | undefined;
55
- /** Patient/app-friendly product description in Arabic, when available. */
56
- description_ar?: string | undefined;
57
- /** Mechanism of action summary in English, when available. */
58
- mechanism?: string | undefined;
59
- /** Public warning summary in English, when available. */
60
- warnings?: string | undefined;
61
36
  /** Primary prescribing specialty */
62
37
  medical_specialty?: string | undefined;
63
38
  /** Distribution/supply company (may be empty) */
@@ -66,5 +41,4 @@ export interface ResolvedDrug {
66
41
  barcode?: string | undefined;
67
42
  /** Current price in Egyptian Pounds (EGP) */
68
43
  price_egp?: number | undefined;
69
- identity_match?: SafeRx.IdentityMatch | undefined;
70
44
  }
@@ -19,5 +19,4 @@ export interface SafetyData {
19
19
  clinical?: SafeRx.ClinicalData | undefined;
20
20
  /** Maximum daily dose data keyed by sfrx_id */
21
21
  dosing?: Record<string, SafeRx.DosingData> | undefined;
22
- allergy?: SafeRx.AllergyData | undefined;
23
22
  }
@@ -1,18 +1,10 @@
1
1
  export * from "./AdverseEffect.js";
2
2
  export * from "./Alert.js";
3
- export * from "./AllergyCrossReactivityReference.js";
4
- export * from "./AllergyData.js";
5
- export * from "./AllergyFamilyReference.js";
6
- export * from "./AllergyInputEntry.js";
7
- export * from "./AllergyProductFamilyReference.js";
8
- export * from "./AllergySummary.js";
9
- export * from "./AllergyWarning.js";
10
3
  export * from "./BadRequestErrorBody.js";
11
4
  export * from "./BlackBoxWarning.js";
12
5
  export * from "./BlockedResponse.js";
13
6
  export * from "./ClinicalAlert.js";
14
7
  export * from "./ClinicalConcern.js";
15
- export * from "./ClinicalContextApplied.js";
16
8
  export * from "./ClinicalData.js";
17
9
  export * from "./Condition.js";
18
10
  export * from "./DailyLimit.js";
@@ -26,25 +18,17 @@ export * from "./ErrorResponse.js";
26
18
  export * from "./FoodConflict.js";
27
19
  export * from "./FoodData.js";
28
20
  export * from "./ForbiddenErrorBody.js";
29
- export * from "./IdentityMatch.js";
30
- export * from "./IntelligenceClinicalProfile.js";
31
- export * from "./IntelligenceContext.js";
32
- export * from "./IntelligenceProcessorError.js";
33
- export * from "./IntelligenceResult.js";
34
- export * from "./IntelligenceSynthesis.js";
35
21
  export * from "./Interaction.js";
36
22
  export * from "./InteractionSummary.js";
37
23
  export * from "./InteractionsData.js";
38
24
  export * from "./InternalServerErrorBody.js";
39
25
  export * from "./MealTiming.js";
40
- export * from "./MedicationHistoryItem.js";
41
26
  export * from "./Meta.js";
42
27
  export * from "./MetadataResponse.js";
43
28
  export * from "./Monitoring.js";
44
29
  export * from "./PatientProfile.js";
45
30
  export * from "./Population.js";
46
31
  export * from "./PopulationMonitoring.js";
47
- export * from "./QuotaMeta.js";
48
32
  export * from "./RateLimitResponse.js";
49
33
  export * from "./ReferenceDose.js";
50
34
  export * from "./ReproductiveSafetyData.js";
@@ -16,19 +16,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./AdverseEffect.js"), exports);
18
18
  __exportStar(require("./Alert.js"), exports);
19
- __exportStar(require("./AllergyCrossReactivityReference.js"), exports);
20
- __exportStar(require("./AllergyData.js"), exports);
21
- __exportStar(require("./AllergyFamilyReference.js"), exports);
22
- __exportStar(require("./AllergyInputEntry.js"), exports);
23
- __exportStar(require("./AllergyProductFamilyReference.js"), exports);
24
- __exportStar(require("./AllergySummary.js"), exports);
25
- __exportStar(require("./AllergyWarning.js"), exports);
26
19
  __exportStar(require("./BadRequestErrorBody.js"), exports);
27
20
  __exportStar(require("./BlackBoxWarning.js"), exports);
28
21
  __exportStar(require("./BlockedResponse.js"), exports);
29
22
  __exportStar(require("./ClinicalAlert.js"), exports);
30
23
  __exportStar(require("./ClinicalConcern.js"), exports);
31
- __exportStar(require("./ClinicalContextApplied.js"), exports);
32
24
  __exportStar(require("./ClinicalData.js"), exports);
33
25
  __exportStar(require("./Condition.js"), exports);
34
26
  __exportStar(require("./DailyLimit.js"), exports);
@@ -42,25 +34,17 @@ __exportStar(require("./ErrorResponse.js"), exports);
42
34
  __exportStar(require("./FoodConflict.js"), exports);
43
35
  __exportStar(require("./FoodData.js"), exports);
44
36
  __exportStar(require("./ForbiddenErrorBody.js"), exports);
45
- __exportStar(require("./IdentityMatch.js"), exports);
46
- __exportStar(require("./IntelligenceClinicalProfile.js"), exports);
47
- __exportStar(require("./IntelligenceContext.js"), exports);
48
- __exportStar(require("./IntelligenceProcessorError.js"), exports);
49
- __exportStar(require("./IntelligenceResult.js"), exports);
50
- __exportStar(require("./IntelligenceSynthesis.js"), exports);
51
37
  __exportStar(require("./Interaction.js"), exports);
52
38
  __exportStar(require("./InteractionSummary.js"), exports);
53
39
  __exportStar(require("./InteractionsData.js"), exports);
54
40
  __exportStar(require("./InternalServerErrorBody.js"), exports);
55
41
  __exportStar(require("./MealTiming.js"), exports);
56
- __exportStar(require("./MedicationHistoryItem.js"), exports);
57
42
  __exportStar(require("./Meta.js"), exports);
58
43
  __exportStar(require("./MetadataResponse.js"), exports);
59
44
  __exportStar(require("./Monitoring.js"), exports);
60
45
  __exportStar(require("./PatientProfile.js"), exports);
61
46
  __exportStar(require("./Population.js"), exports);
62
47
  __exportStar(require("./PopulationMonitoring.js"), exports);
63
- __exportStar(require("./QuotaMeta.js"), exports);
64
48
  __exportStar(require("./RateLimitResponse.js"), exports);
65
49
  __exportStar(require("./ReferenceDose.js"), exports);
66
50
  __exportStar(require("./ReproductiveSafetyData.js"), exports);
@@ -14,6 +14,6 @@ export type BinaryResponse = {
14
14
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
15
15
  * Some versions of the Fetch API may not support this method.
16
16
  */
17
- bytes?(): Promise<Uint8Array>;
17
+ bytes?(): ReturnType<Response["bytes"]>;
18
18
  };
19
19
  export declare function getBinaryResponse(response: Response): BinaryResponse;
@@ -206,7 +206,7 @@ function fetcherImpl(args) {
206
206
  }
207
207
  try {
208
208
  const response = yield (0, requestWithRetries_js_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
209
- return (0, makeRequest_js_1.makeRequest)(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex, args.responseType === "streaming" || args.responseType === "sse");
209
+ return (0, makeRequest_js_1.makeRequest)(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex);
210
210
  }), args.maxRetries);
211
211
  if (response.status >= 200 && response.status < 400) {
212
212
  if (logger.isDebug()) {
@@ -6,8 +6,6 @@ export type { Fetcher, FetchFunction } from "./Fetcher.js";
6
6
  export { fetcher } from "./Fetcher.js";
7
7
  export { getHeader } from "./getHeader.js";
8
8
  export { HttpResponsePromise } from "./HttpResponsePromise.js";
9
- export type { PassthroughRequest } from "./makePassthroughRequest.js";
10
- export { makePassthroughRequest } from "./makePassthroughRequest.js";
11
9
  export type { RawResponse, WithRawResponse } from "./RawResponse.js";
12
10
  export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.js";
13
11
  export { Supplier } from "./Supplier.js";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Supplier = exports.unknownRawResponse = exports.toRawResponse = exports.abortRawResponse = exports.makePassthroughRequest = exports.HttpResponsePromise = exports.getHeader = exports.fetcher = exports.EndpointSupplier = void 0;
3
+ exports.Supplier = exports.unknownRawResponse = exports.toRawResponse = exports.abortRawResponse = exports.HttpResponsePromise = exports.getHeader = exports.fetcher = exports.EndpointSupplier = void 0;
4
4
  var EndpointSupplier_js_1 = require("./EndpointSupplier.js");
5
5
  Object.defineProperty(exports, "EndpointSupplier", { enumerable: true, get: function () { return EndpointSupplier_js_1.EndpointSupplier; } });
6
6
  var Fetcher_js_1 = require("./Fetcher.js");
@@ -9,8 +9,6 @@ var getHeader_js_1 = require("./getHeader.js");
9
9
  Object.defineProperty(exports, "getHeader", { enumerable: true, get: function () { return getHeader_js_1.getHeader; } });
10
10
  var HttpResponsePromise_js_1 = require("./HttpResponsePromise.js");
11
11
  Object.defineProperty(exports, "HttpResponsePromise", { enumerable: true, get: function () { return HttpResponsePromise_js_1.HttpResponsePromise; } });
12
- var makePassthroughRequest_js_1 = require("./makePassthroughRequest.js");
13
- Object.defineProperty(exports, "makePassthroughRequest", { enumerable: true, get: function () { return makePassthroughRequest_js_1.makePassthroughRequest; } });
14
12
  var RawResponse_js_1 = require("./RawResponse.js");
15
13
  Object.defineProperty(exports, "abortRawResponse", { enumerable: true, get: function () { return RawResponse_js_1.abortRawResponse; } });
16
14
  Object.defineProperty(exports, "toRawResponse", { enumerable: true, get: function () { return RawResponse_js_1.toRawResponse; } });
@@ -1,6 +1 @@
1
- export declare function isCacheNoStoreSupported(): boolean;
2
- /**
3
- * Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.
4
- */
5
- export declare function resetCacheNoStoreSupported(): void;
6
- export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Headers | Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half", disableCache?: boolean) => Promise<Response>;
1
+ export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Headers | Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half") => Promise<Response>;
@@ -10,35 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.makeRequest = void 0;
13
- exports.isCacheNoStoreSupported = isCacheNoStoreSupported;
14
- exports.resetCacheNoStoreSupported = resetCacheNoStoreSupported;
15
13
  const signals_js_1 = require("./signals.js");
16
- /**
17
- * Cached result of checking whether the current runtime supports
18
- * the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers)
19
- * throw a TypeError when this option is used.
20
- */
21
- let _cacheNoStoreSupported;
22
- function isCacheNoStoreSupported() {
23
- if (_cacheNoStoreSupported != null) {
24
- return _cacheNoStoreSupported;
25
- }
26
- try {
27
- new Request("http://localhost", { cache: "no-store" });
28
- _cacheNoStoreSupported = true;
29
- }
30
- catch (_a) {
31
- _cacheNoStoreSupported = false;
32
- }
33
- return _cacheNoStoreSupported;
34
- }
35
- /**
36
- * Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.
37
- */
38
- function resetCacheNoStoreSupported() {
39
- _cacheNoStoreSupported = undefined;
40
- }
41
- const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex, disableCache) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex) => __awaiter(void 0, void 0, void 0, function* () {
42
15
  const signals = [];
43
16
  let timeoutAbortId;
44
17
  if (timeoutMs != null) {
@@ -50,9 +23,15 @@ const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abor
50
23
  signals.push(abortSignal);
51
24
  }
52
25
  const newSignals = (0, signals_js_1.anySignal)(signals);
53
- const response = yield fetchFn(url, Object.assign({ method: method, headers, body: requestBody, signal: newSignals, credentials: withCredentials ? "include" : undefined,
26
+ const response = yield fetchFn(url, {
27
+ method: method,
28
+ headers,
29
+ body: requestBody,
30
+ signal: newSignals,
31
+ credentials: withCredentials ? "include" : undefined,
54
32
  // @ts-ignore
55
- duplex }, (disableCache && isCacheNoStoreSupported() ? { cache: "no-store" } : {})));
33
+ duplex,
34
+ });
56
35
  if (timeoutAbortId != null) {
57
36
  clearTimeout(timeoutAbortId);
58
37
  }
@@ -84,18 +84,17 @@ function evaluateRuntime() {
84
84
  }
85
85
  /**
86
86
  * A constant that indicates whether the environment the code is running is Node.JS.
87
- *
88
- * We assign `process` to a local variable first to avoid being flagged by
89
- * bundlers that perform static analysis on `process.versions` (e.g. Next.js
90
- * Edge Runtime warns about Node.js APIs even when they are guarded).
91
87
  */
92
- const _process = typeof process !== "undefined" ? process : undefined;
93
- const isNode = typeof _process !== "undefined" && typeof ((_e = _process.versions) === null || _e === void 0 ? void 0 : _e.node) === "string";
88
+ const isNode = typeof process !== "undefined" &&
89
+ "version" in process &&
90
+ !!process.version &&
91
+ "versions" in process &&
92
+ !!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
94
93
  if (isNode) {
95
94
  return {
96
95
  type: "node",
97
- version: _process.versions.node,
98
- parsedVersion: Number(_process.versions.node.split(".")[0]),
96
+ version: process.versions.node,
97
+ parsedVersion: Number(process.versions.node.split(".")[0]),
99
98
  };
100
99
  }
101
100
  return {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.4.2";
1
+ export declare const SDK_VERSION = "2.0.1";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.4.2";
4
+ exports.SDK_VERSION = "2.0.1";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "saferx-pharma-sdk",
9
- "X-Fern-SDK-Version": "1.4.2",
10
- "User-Agent": "saferx-pharma-sdk/1.4.2",
9
+ "X-Fern-SDK-Version": "2.0.1",
10
+ "User-Agent": "saferx-pharma-sdk/2.0.1",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -2,7 +2,6 @@ import { DevelopersClient } from "./api/resources/developers/client/Client.mjs";
2
2
  import { DrugSafetyClient } from "./api/resources/drugSafety/client/Client.mjs";
3
3
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
4
4
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
5
- import * as core from "./core/index.mjs";
6
5
  export declare namespace SafeRxClient {
7
6
  type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
@@ -15,15 +14,4 @@ export declare class SafeRxClient {
15
14
  constructor(options?: SafeRxClient.Options);
16
15
  get drugSafety(): DrugSafetyClient;
17
16
  get developers(): DevelopersClient;
18
- /**
19
- * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
20
- * This is useful for making requests to endpoints not yet supported in the SDK.
21
- * The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
22
- *
23
- * @param {Request | string | URL} input - The URL, path, or Request object.
24
- * @param {RequestInit} init - Standard fetch RequestInit options.
25
- * @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
26
- * @returns {Promise<Response>} A standard Response object.
27
- */
28
- fetch(input: Request | string | URL, init?: RequestInit, requestOptions?: core.PassthroughRequest.RequestOptions): Promise<Response>;
29
17
  }
@@ -1,17 +1,7 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  import { DevelopersClient } from "./api/resources/developers/client/Client.mjs";
12
3
  import { DrugSafetyClient } from "./api/resources/drugSafety/client/Client.mjs";
13
4
  import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
14
- import * as core from "./core/index.mjs";
15
5
  export class SafeRxClient {
16
6
  constructor(options = {}) {
17
7
  this._options = normalizeClientOptionsWithAuth(options);
@@ -24,28 +14,4 @@ export class SafeRxClient {
24
14
  var _a;
25
15
  return ((_a = this._developers) !== null && _a !== void 0 ? _a : (this._developers = new DevelopersClient(this._options)));
26
16
  }
27
- /**
28
- * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
29
- * This is useful for making requests to endpoints not yet supported in the SDK.
30
- * The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
31
- *
32
- * @param {Request | string | URL} input - The URL, path, or Request object.
33
- * @param {RequestInit} init - Standard fetch RequestInit options.
34
- * @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
35
- * @returns {Promise<Response>} A standard Response object.
36
- */
37
- fetch(input, init, requestOptions) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- var _a;
40
- return core.makePassthroughRequest(input, init, {
41
- baseUrl: (_a = this._options.baseUrl) !== null && _a !== void 0 ? _a : this._options.environment,
42
- headers: this._options.headers,
43
- timeoutInSeconds: this._options.timeoutInSeconds,
44
- maxRetries: this._options.maxRetries,
45
- fetch: this._options.fetch,
46
- logging: this._options.logging,
47
- getAuthHeaders: () => __awaiter(this, void 0, void 0, function* () { return (yield this._options.authProvider.getAuthRequest()).headers; }),
48
- }, requestOptions);
49
- });
50
- }
51
17
  }
@@ -37,7 +37,7 @@ export declare class DevelopersClient {
37
37
  * - Code expires after 30 minutes
38
38
  * - Max 5 wrong attempts per code (then must request new code)
39
39
  * - On success: issues sfx_free_ key (persistent, 1 per email)
40
- * - Free tier: 100 checks/month, 20 requests/minute anti-abuse, 60/day safety cap
40
+ * - Free tier: 20 requests/minute, 60 requests/day
41
41
  *
42
42
  * @param {SafeRx.VerifyFreeKeyDevelopersRequest} request
43
43
  * @param {DevelopersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -88,7 +88,7 @@ export class DevelopersClient {
88
88
  * - Code expires after 30 minutes
89
89
  * - Max 5 wrong attempts per code (then must request new code)
90
90
  * - On success: issues sfx_free_ key (persistent, 1 per email)
91
- * - Free tier: 100 checks/month, 20 requests/minute anti-abuse, 60/day safety cap
91
+ * - Free tier: 20 requests/minute, 60 requests/day
92
92
  *
93
93
  * @param {SafeRx.VerifyFreeKeyDevelopersRequest} request
94
94
  * @param {DevelopersClient.RequestOptions} requestOptions - Request-specific configuration.