saferx-pharma-sdk 1.4.3 → 2.0.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.
- package/README.md +31 -0
- package/dist/client.d.ts +47 -0
- package/dist/client.js +166 -0
- package/package.json +11 -85
- package/src/client.ts +117 -0
- package/dist/cjs/BaseClient.d.ts +0 -39
- package/dist/cjs/BaseClient.js +0 -62
- package/dist/cjs/Client.d.ts +0 -29
- package/dist/cjs/Client.js +0 -88
- package/dist/cjs/api/errors/BadRequestError.d.ts +0 -5
- package/dist/cjs/api/errors/BadRequestError.js +0 -54
- package/dist/cjs/api/errors/ForbiddenError.d.ts +0 -5
- package/dist/cjs/api/errors/ForbiddenError.js +0 -54
- package/dist/cjs/api/errors/InternalServerError.d.ts +0 -5
- package/dist/cjs/api/errors/InternalServerError.js +0 -54
- package/dist/cjs/api/errors/TooManyRequestsError.d.ts +0 -5
- package/dist/cjs/api/errors/TooManyRequestsError.js +0 -54
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +0 -6
- package/dist/cjs/api/errors/UnauthorizedError.js +0 -54
- package/dist/cjs/api/errors/index.d.ts +0 -5
- package/dist/cjs/api/errors/index.js +0 -21
- package/dist/cjs/api/index.d.ts +0 -3
- package/dist/cjs/api/index.js +0 -19
- package/dist/cjs/api/resources/developers/client/Client.d.ts +0 -56
- package/dist/cjs/api/resources/developers/client/Client.js +0 -186
- package/dist/cjs/api/resources/developers/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/developers/client/index.js +0 -17
- package/dist/cjs/api/resources/developers/client/requests/CreateFreeKeyDevelopersRequest.d.ts +0 -10
- package/dist/cjs/api/resources/developers/client/requests/CreateFreeKeyDevelopersRequest.js +0 -3
- package/dist/cjs/api/resources/developers/client/requests/VerifyFreeKeyDevelopersRequest.d.ts +0 -13
- package/dist/cjs/api/resources/developers/client/requests/VerifyFreeKeyDevelopersRequest.js +0 -3
- package/dist/cjs/api/resources/developers/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/developers/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/developers/exports.d.ts +0 -2
- package/dist/cjs/api/resources/developers/exports.js +0 -21
- package/dist/cjs/api/resources/developers/index.d.ts +0 -2
- package/dist/cjs/api/resources/developers/index.js +0 -18
- package/dist/cjs/api/resources/developers/types/CreateFreeKeyDevelopersResponse.d.ts +0 -18
- package/dist/cjs/api/resources/developers/types/CreateFreeKeyDevelopersResponse.js +0 -3
- package/dist/cjs/api/resources/developers/types/VerifyFreeKeyDevelopersResponse.d.ts +0 -12
- package/dist/cjs/api/resources/developers/types/VerifyFreeKeyDevelopersResponse.js +0 -3
- package/dist/cjs/api/resources/developers/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/developers/types/index.js +0 -18
- package/dist/cjs/api/resources/drugSafety/client/Client.d.ts +0 -132
- package/dist/cjs/api/resources/drugSafety/client/Client.js +0 -290
- package/dist/cjs/api/resources/drugSafety/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/drugSafety/client/index.js +0 -17
- package/dist/cjs/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.ts +0 -98
- package/dist/cjs/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.js +0 -15
- package/dist/cjs/api/resources/drugSafety/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/drugSafety/client/requests/index.js +0 -5
- package/dist/cjs/api/resources/drugSafety/exports.d.ts +0 -2
- package/dist/cjs/api/resources/drugSafety/exports.js +0 -21
- package/dist/cjs/api/resources/drugSafety/index.d.ts +0 -2
- package/dist/cjs/api/resources/drugSafety/index.js +0 -18
- package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.ts +0 -14
- package/dist/cjs/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.js +0 -11
- package/dist/cjs/api/resources/drugSafety/types/index.d.ts +0 -1
- package/dist/cjs/api/resources/drugSafety/types/index.js +0 -17
- package/dist/cjs/api/resources/index.d.ts +0 -6
- package/dist/cjs/api/resources/index.js +0 -45
- package/dist/cjs/api/types/AdverseEffect.d.ts +0 -43
- package/dist/cjs/api/types/AdverseEffect.js +0 -3
- package/dist/cjs/api/types/Alert.d.ts +0 -70
- package/dist/cjs/api/types/Alert.js +0 -41
- package/dist/cjs/api/types/AllergyCrossReactivityReference.d.ts +0 -16
- package/dist/cjs/api/types/AllergyCrossReactivityReference.js +0 -3
- package/dist/cjs/api/types/AllergyData.d.ts +0 -24
- package/dist/cjs/api/types/AllergyData.js +0 -11
- package/dist/cjs/api/types/AllergyFamilyReference.d.ts +0 -10
- package/dist/cjs/api/types/AllergyFamilyReference.js +0 -3
- package/dist/cjs/api/types/AllergyInputEntry.d.ts +0 -10
- package/dist/cjs/api/types/AllergyInputEntry.js +0 -3
- package/dist/cjs/api/types/AllergyProductFamilyReference.d.ts +0 -9
- package/dist/cjs/api/types/AllergyProductFamilyReference.js +0 -3
- package/dist/cjs/api/types/AllergySummary.d.ts +0 -14
- package/dist/cjs/api/types/AllergySummary.js +0 -3
- package/dist/cjs/api/types/AllergyWarning.d.ts +0 -30
- package/dist/cjs/api/types/AllergyWarning.js +0 -11
- package/dist/cjs/api/types/BadRequestErrorBody.d.ts +0 -3
- package/dist/cjs/api/types/BadRequestErrorBody.js +0 -3
- package/dist/cjs/api/types/BlackBoxWarning.d.ts +0 -15
- package/dist/cjs/api/types/BlackBoxWarning.js +0 -3
- package/dist/cjs/api/types/BlockedResponse.d.ts +0 -9
- package/dist/cjs/api/types/BlockedResponse.js +0 -3
- package/dist/cjs/api/types/ClinicalAlert.d.ts +0 -56
- package/dist/cjs/api/types/ClinicalAlert.js +0 -3
- package/dist/cjs/api/types/ClinicalConcern.d.ts +0 -15
- package/dist/cjs/api/types/ClinicalConcern.js +0 -3
- package/dist/cjs/api/types/ClinicalContextApplied.d.ts +0 -10
- package/dist/cjs/api/types/ClinicalContextApplied.js +0 -3
- package/dist/cjs/api/types/ClinicalData.d.ts +0 -17
- package/dist/cjs/api/types/ClinicalData.js +0 -3
- package/dist/cjs/api/types/Condition.d.ts +0 -22
- package/dist/cjs/api/types/Condition.js +0 -25
- package/dist/cjs/api/types/DailyLimit.d.ts +0 -20
- package/dist/cjs/api/types/DailyLimit.js +0 -13
- package/dist/cjs/api/types/DomainCode.d.ts +0 -20
- package/dist/cjs/api/types/DomainCode.js +0 -23
- package/dist/cjs/api/types/DoseClassification.d.ts +0 -40
- package/dist/cjs/api/types/DoseClassification.js +0 -22
- package/dist/cjs/api/types/DoseComponent.d.ts +0 -30
- package/dist/cjs/api/types/DoseComponent.js +0 -12
- package/dist/cjs/api/types/DosingData.d.ts +0 -63
- package/dist/cjs/api/types/DosingData.js +0 -18
- package/dist/cjs/api/types/DrugClinicalData.d.ts +0 -7
- package/dist/cjs/api/types/DrugClinicalData.js +0 -3
- package/dist/cjs/api/types/DrugSafetyCheckResponse.d.ts +0 -29
- package/dist/cjs/api/types/DrugSafetyCheckResponse.js +0 -11
- package/dist/cjs/api/types/ErrorResponse.d.ts +0 -29
- package/dist/cjs/api/types/ErrorResponse.js +0 -3
- package/dist/cjs/api/types/FoodConflict.d.ts +0 -21
- package/dist/cjs/api/types/FoodConflict.js +0 -3
- package/dist/cjs/api/types/FoodData.d.ts +0 -11
- package/dist/cjs/api/types/FoodData.js +0 -3
- package/dist/cjs/api/types/ForbiddenErrorBody.d.ts +0 -4
- package/dist/cjs/api/types/ForbiddenErrorBody.js +0 -3
- package/dist/cjs/api/types/IdentityMatch.d.ts +0 -13
- package/dist/cjs/api/types/IdentityMatch.js +0 -3
- package/dist/cjs/api/types/IntelligenceClinicalProfile.d.ts +0 -24
- package/dist/cjs/api/types/IntelligenceClinicalProfile.js +0 -13
- package/dist/cjs/api/types/IntelligenceContext.d.ts +0 -17
- package/dist/cjs/api/types/IntelligenceContext.js +0 -3
- package/dist/cjs/api/types/IntelligenceProcessorError.d.ts +0 -4
- package/dist/cjs/api/types/IntelligenceProcessorError.js +0 -3
- package/dist/cjs/api/types/IntelligenceResult.d.ts +0 -16
- package/dist/cjs/api/types/IntelligenceResult.js +0 -3
- package/dist/cjs/api/types/IntelligenceSynthesis.d.ts +0 -6
- package/dist/cjs/api/types/IntelligenceSynthesis.js +0 -3
- package/dist/cjs/api/types/Interaction.d.ts +0 -59
- package/dist/cjs/api/types/Interaction.js +0 -14
- package/dist/cjs/api/types/InteractionSummary.d.ts +0 -13
- package/dist/cjs/api/types/InteractionSummary.js +0 -3
- package/dist/cjs/api/types/InteractionsData.d.ts +0 -11
- package/dist/cjs/api/types/InteractionsData.js +0 -3
- package/dist/cjs/api/types/InternalServerErrorBody.d.ts +0 -3
- package/dist/cjs/api/types/InternalServerErrorBody.js +0 -3
- package/dist/cjs/api/types/MealTiming.d.ts +0 -26
- package/dist/cjs/api/types/MealTiming.js +0 -3
- package/dist/cjs/api/types/MedicationHistoryItem.d.ts +0 -22
- package/dist/cjs/api/types/MedicationHistoryItem.js +0 -15
- package/dist/cjs/api/types/Meta.d.ts +0 -29
- package/dist/cjs/api/types/Meta.js +0 -14
- package/dist/cjs/api/types/MetadataResponse.d.ts +0 -93
- package/dist/cjs/api/types/MetadataResponse.js +0 -17
- package/dist/cjs/api/types/Monitoring.d.ts +0 -22
- package/dist/cjs/api/types/Monitoring.js +0 -3
- package/dist/cjs/api/types/PatientProfile.d.ts +0 -43
- package/dist/cjs/api/types/PatientProfile.js +0 -20
- package/dist/cjs/api/types/Population.d.ts +0 -16
- package/dist/cjs/api/types/Population.js +0 -19
- package/dist/cjs/api/types/PopulationMonitoring.d.ts +0 -26
- package/dist/cjs/api/types/PopulationMonitoring.js +0 -3
- package/dist/cjs/api/types/QuotaMeta.d.ts +0 -11
- package/dist/cjs/api/types/QuotaMeta.js +0 -3
- package/dist/cjs/api/types/RateLimitResponse.d.ts +0 -37
- package/dist/cjs/api/types/RateLimitResponse.js +0 -13
- package/dist/cjs/api/types/ReferenceDose.d.ts +0 -11
- package/dist/cjs/api/types/ReferenceDose.js +0 -3
- package/dist/cjs/api/types/ReproductiveSafetyData.d.ts +0 -58
- package/dist/cjs/api/types/ReproductiveSafetyData.js +0 -3
- package/dist/cjs/api/types/ReproductiveWarning.d.ts +0 -13
- package/dist/cjs/api/types/ReproductiveWarning.js +0 -3
- package/dist/cjs/api/types/ResolvedDrug.d.ts +0 -70
- package/dist/cjs/api/types/ResolvedDrug.js +0 -3
- package/dist/cjs/api/types/SafetyData.d.ts +0 -23
- package/dist/cjs/api/types/SafetyData.js +0 -3
- package/dist/cjs/api/types/SideEffectsData.d.ts +0 -38
- package/dist/cjs/api/types/SideEffectsData.js +0 -18
- package/dist/cjs/api/types/TooManyRequestsErrorBody.d.ts +0 -3
- package/dist/cjs/api/types/TooManyRequestsErrorBody.js +0 -3
- package/dist/cjs/api/types/index.d.ts +0 -55
- package/dist/cjs/api/types/index.js +0 -71
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +0 -20
- package/dist/cjs/auth/HeaderAuthProvider.js +0 -80
- package/dist/cjs/auth/index.d.ts +0 -1
- package/dist/cjs/auth/index.js +0 -5
- package/dist/cjs/core/auth/AuthProvider.d.ts +0 -7
- package/dist/cjs/core/auth/AuthProvider.js +0 -2
- package/dist/cjs/core/auth/AuthRequest.d.ts +0 -9
- package/dist/cjs/core/auth/AuthRequest.js +0 -2
- package/dist/cjs/core/auth/BasicAuth.d.ts +0 -8
- package/dist/cjs/core/auth/BasicAuth.js +0 -27
- package/dist/cjs/core/auth/BearerToken.d.ts +0 -7
- package/dist/cjs/core/auth/BearerToken.js +0 -16
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +0 -5
- package/dist/cjs/core/auth/NoOpAuthProvider.js +0 -9
- package/dist/cjs/core/auth/index.d.ts +0 -5
- package/dist/cjs/core/auth/index.js +0 -9
- package/dist/cjs/core/base64.d.ts +0 -2
- package/dist/cjs/core/base64.js +0 -26
- package/dist/cjs/core/exports.d.ts +0 -1
- package/dist/cjs/core/exports.js +0 -17
- package/dist/cjs/core/fetcher/APIResponse.d.ts +0 -20
- package/dist/cjs/core/fetcher/APIResponse.js +0 -2
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +0 -19
- package/dist/cjs/core/fetcher/BinaryResponse.js +0 -17
- package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +0 -13
- package/dist/cjs/core/fetcher/EndpointMetadata.js +0 -2
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +0 -12
- package/dist/cjs/core/fetcher/EndpointSupplier.js +0 -22
- package/dist/cjs/core/fetcher/Fetcher.d.ts +0 -48
- package/dist/cjs/core/fetcher/Fetcher.js +0 -322
- package/dist/cjs/core/fetcher/Headers.d.ts +0 -2
- package/dist/cjs/core/fetcher/Headers.js +0 -84
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +0 -58
- package/dist/cjs/core/fetcher/HttpResponsePromise.js +0 -103
- package/dist/cjs/core/fetcher/RawResponse.d.ts +0 -29
- package/dist/cjs/core/fetcher/RawResponse.js +0 -44
- package/dist/cjs/core/fetcher/Supplier.d.ts +0 -4
- package/dist/cjs/core/fetcher/Supplier.js +0 -22
- package/dist/cjs/core/fetcher/createRequestUrl.d.ts +0 -1
- package/dist/cjs/core/fetcher/createRequestUrl.js +0 -8
- package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +0 -1
- package/dist/cjs/core/fetcher/getErrorResponseBody.js +0 -45
- package/dist/cjs/core/fetcher/getFetchFn.d.ts +0 -1
- package/dist/cjs/core/fetcher/getFetchFn.js +0 -17
- package/dist/cjs/core/fetcher/getHeader.d.ts +0 -1
- package/dist/cjs/core/fetcher/getHeader.js +0 -11
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +0 -7
- package/dist/cjs/core/fetcher/getRequestBody.js +0 -27
- package/dist/cjs/core/fetcher/getResponseBody.d.ts +0 -1
- package/dist/cjs/core/fetcher/getResponseBody.js +0 -69
- package/dist/cjs/core/fetcher/index.d.ts +0 -13
- package/dist/cjs/core/fetcher/index.js +0 -19
- package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +0 -49
- package/dist/cjs/core/fetcher/makePassthroughRequest.js +0 -135
- package/dist/cjs/core/fetcher/makeRequest.d.ts +0 -6
- package/dist/cjs/core/fetcher/makeRequest.js +0 -61
- package/dist/cjs/core/fetcher/requestWithRetries.d.ts +0 -1
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -67
- package/dist/cjs/core/fetcher/signals.d.ts +0 -5
- package/dist/cjs/core/fetcher/signals.js +0 -24
- package/dist/cjs/core/headers.d.ts +0 -2
- package/dist/cjs/core/headers.js +0 -31
- package/dist/cjs/core/index.d.ts +0 -6
- package/dist/cjs/core/index.js +0 -45
- package/dist/cjs/core/json.d.ts +0 -15
- package/dist/cjs/core/json.js +0 -24
- package/dist/cjs/core/logging/exports.d.ts +0 -18
- package/dist/cjs/core/logging/exports.js +0 -45
- package/dist/cjs/core/logging/index.d.ts +0 -1
- package/dist/cjs/core/logging/index.js +0 -17
- package/dist/cjs/core/logging/logger.d.ts +0 -126
- package/dist/cjs/core/logging/logger.js +0 -144
- package/dist/cjs/core/runtime/index.d.ts +0 -1
- package/dist/cjs/core/runtime/index.js +0 -5
- package/dist/cjs/core/runtime/runtime.d.ts +0 -9
- package/dist/cjs/core/runtime/runtime.js +0 -104
- package/dist/cjs/core/url/encodePathParam.d.ts +0 -1
- package/dist/cjs/core/url/encodePathParam.js +0 -21
- package/dist/cjs/core/url/index.d.ts +0 -3
- package/dist/cjs/core/url/index.js +0 -9
- package/dist/cjs/core/url/join.d.ts +0 -1
- package/dist/cjs/core/url/join.js +0 -68
- package/dist/cjs/core/url/qs.d.ts +0 -6
- package/dist/cjs/core/url/qs.js +0 -64
- package/dist/cjs/environments.d.ts +0 -4
- package/dist/cjs/environments.js +0 -7
- package/dist/cjs/errors/SafeRxError.d.ts +0 -12
- package/dist/cjs/errors/SafeRxError.js +0 -32
- package/dist/cjs/errors/SafeRxTimeoutError.d.ts +0 -3
- package/dist/cjs/errors/SafeRxTimeoutError.js +0 -15
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +0 -2
- package/dist/cjs/errors/handleNonStatusCodeError.js +0 -65
- package/dist/cjs/errors/index.d.ts +0 -2
- package/dist/cjs/errors/index.js +0 -7
- package/dist/cjs/exports.d.ts +0 -1
- package/dist/cjs/exports.js +0 -17
- package/dist/cjs/index.d.ts +0 -6
- package/dist/cjs/index.js +0 -48
- package/dist/cjs/version.d.ts +0 -1
- package/dist/cjs/version.js +0 -4
- package/dist/esm/BaseClient.d.mts +0 -39
- package/dist/esm/BaseClient.mjs +0 -25
- package/dist/esm/Client.d.mts +0 -29
- package/dist/esm/Client.mjs +0 -51
- package/dist/esm/api/errors/BadRequestError.d.mts +0 -5
- package/dist/esm/api/errors/BadRequestError.mjs +0 -17
- package/dist/esm/api/errors/ForbiddenError.d.mts +0 -5
- package/dist/esm/api/errors/ForbiddenError.mjs +0 -17
- package/dist/esm/api/errors/InternalServerError.d.mts +0 -5
- package/dist/esm/api/errors/InternalServerError.mjs +0 -17
- package/dist/esm/api/errors/TooManyRequestsError.d.mts +0 -5
- package/dist/esm/api/errors/TooManyRequestsError.mjs +0 -17
- package/dist/esm/api/errors/UnauthorizedError.d.mts +0 -6
- package/dist/esm/api/errors/UnauthorizedError.mjs +0 -17
- package/dist/esm/api/errors/index.d.mts +0 -5
- package/dist/esm/api/errors/index.mjs +0 -5
- package/dist/esm/api/index.d.mts +0 -3
- package/dist/esm/api/index.mjs +0 -3
- package/dist/esm/api/resources/developers/client/Client.d.mts +0 -56
- package/dist/esm/api/resources/developers/client/Client.mjs +0 -149
- package/dist/esm/api/resources/developers/client/index.d.mts +0 -1
- package/dist/esm/api/resources/developers/client/index.mjs +0 -1
- package/dist/esm/api/resources/developers/client/requests/CreateFreeKeyDevelopersRequest.d.mts +0 -10
- package/dist/esm/api/resources/developers/client/requests/CreateFreeKeyDevelopersRequest.mjs +0 -2
- package/dist/esm/api/resources/developers/client/requests/VerifyFreeKeyDevelopersRequest.d.mts +0 -13
- package/dist/esm/api/resources/developers/client/requests/VerifyFreeKeyDevelopersRequest.mjs +0 -2
- package/dist/esm/api/resources/developers/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/developers/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/developers/exports.d.mts +0 -2
- package/dist/esm/api/resources/developers/exports.mjs +0 -3
- package/dist/esm/api/resources/developers/index.d.mts +0 -2
- package/dist/esm/api/resources/developers/index.mjs +0 -2
- package/dist/esm/api/resources/developers/types/CreateFreeKeyDevelopersResponse.d.mts +0 -18
- package/dist/esm/api/resources/developers/types/CreateFreeKeyDevelopersResponse.mjs +0 -2
- package/dist/esm/api/resources/developers/types/VerifyFreeKeyDevelopersResponse.d.mts +0 -12
- package/dist/esm/api/resources/developers/types/VerifyFreeKeyDevelopersResponse.mjs +0 -2
- package/dist/esm/api/resources/developers/types/index.d.mts +0 -2
- package/dist/esm/api/resources/developers/types/index.mjs +0 -2
- package/dist/esm/api/resources/drugSafety/client/Client.d.mts +0 -132
- package/dist/esm/api/resources/drugSafety/client/Client.mjs +0 -253
- package/dist/esm/api/resources/drugSafety/client/index.d.mts +0 -1
- package/dist/esm/api/resources/drugSafety/client/index.mjs +0 -1
- package/dist/esm/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.d.mts +0 -98
- package/dist/esm/api/resources/drugSafety/client/requests/DrugSafetyCheckRequest.mjs +0 -12
- package/dist/esm/api/resources/drugSafety/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/drugSafety/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/drugSafety/exports.d.mts +0 -2
- package/dist/esm/api/resources/drugSafety/exports.mjs +0 -3
- package/dist/esm/api/resources/drugSafety/index.d.mts +0 -2
- package/dist/esm/api/resources/drugSafety/index.mjs +0 -2
- package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.d.mts +0 -14
- package/dist/esm/api/resources/drugSafety/types/GetDrugSafetyHealthResponse.mjs +0 -8
- package/dist/esm/api/resources/drugSafety/types/index.d.mts +0 -1
- package/dist/esm/api/resources/drugSafety/types/index.mjs +0 -1
- package/dist/esm/api/resources/index.d.mts +0 -6
- package/dist/esm/api/resources/index.mjs +0 -6
- package/dist/esm/api/types/AdverseEffect.d.mts +0 -43
- package/dist/esm/api/types/AdverseEffect.mjs +0 -2
- package/dist/esm/api/types/Alert.d.mts +0 -70
- package/dist/esm/api/types/Alert.mjs +0 -38
- package/dist/esm/api/types/AllergyCrossReactivityReference.d.mts +0 -16
- package/dist/esm/api/types/AllergyCrossReactivityReference.mjs +0 -2
- package/dist/esm/api/types/AllergyData.d.mts +0 -24
- package/dist/esm/api/types/AllergyData.mjs +0 -8
- package/dist/esm/api/types/AllergyFamilyReference.d.mts +0 -10
- package/dist/esm/api/types/AllergyFamilyReference.mjs +0 -2
- package/dist/esm/api/types/AllergyInputEntry.d.mts +0 -10
- package/dist/esm/api/types/AllergyInputEntry.mjs +0 -2
- package/dist/esm/api/types/AllergyProductFamilyReference.d.mts +0 -9
- package/dist/esm/api/types/AllergyProductFamilyReference.mjs +0 -2
- package/dist/esm/api/types/AllergySummary.d.mts +0 -14
- package/dist/esm/api/types/AllergySummary.mjs +0 -2
- package/dist/esm/api/types/AllergyWarning.d.mts +0 -30
- package/dist/esm/api/types/AllergyWarning.mjs +0 -8
- package/dist/esm/api/types/BadRequestErrorBody.d.mts +0 -3
- package/dist/esm/api/types/BadRequestErrorBody.mjs +0 -2
- package/dist/esm/api/types/BlackBoxWarning.d.mts +0 -15
- package/dist/esm/api/types/BlackBoxWarning.mjs +0 -2
- package/dist/esm/api/types/BlockedResponse.d.mts +0 -9
- package/dist/esm/api/types/BlockedResponse.mjs +0 -2
- package/dist/esm/api/types/ClinicalAlert.d.mts +0 -56
- package/dist/esm/api/types/ClinicalAlert.mjs +0 -2
- package/dist/esm/api/types/ClinicalConcern.d.mts +0 -15
- package/dist/esm/api/types/ClinicalConcern.mjs +0 -2
- package/dist/esm/api/types/ClinicalContextApplied.d.mts +0 -10
- package/dist/esm/api/types/ClinicalContextApplied.mjs +0 -2
- package/dist/esm/api/types/ClinicalData.d.mts +0 -17
- package/dist/esm/api/types/ClinicalData.mjs +0 -2
- package/dist/esm/api/types/Condition.d.mts +0 -22
- package/dist/esm/api/types/Condition.mjs +0 -22
- package/dist/esm/api/types/DailyLimit.d.mts +0 -20
- package/dist/esm/api/types/DailyLimit.mjs +0 -10
- package/dist/esm/api/types/DomainCode.d.mts +0 -20
- package/dist/esm/api/types/DomainCode.mjs +0 -20
- package/dist/esm/api/types/DoseClassification.d.mts +0 -40
- package/dist/esm/api/types/DoseClassification.mjs +0 -19
- package/dist/esm/api/types/DoseComponent.d.mts +0 -30
- package/dist/esm/api/types/DoseComponent.mjs +0 -9
- package/dist/esm/api/types/DosingData.d.mts +0 -63
- package/dist/esm/api/types/DosingData.mjs +0 -15
- package/dist/esm/api/types/DrugClinicalData.d.mts +0 -7
- package/dist/esm/api/types/DrugClinicalData.mjs +0 -2
- package/dist/esm/api/types/DrugSafetyCheckResponse.d.mts +0 -29
- package/dist/esm/api/types/DrugSafetyCheckResponse.mjs +0 -8
- package/dist/esm/api/types/ErrorResponse.d.mts +0 -29
- package/dist/esm/api/types/ErrorResponse.mjs +0 -2
- package/dist/esm/api/types/FoodConflict.d.mts +0 -21
- package/dist/esm/api/types/FoodConflict.mjs +0 -2
- package/dist/esm/api/types/FoodData.d.mts +0 -11
- package/dist/esm/api/types/FoodData.mjs +0 -2
- package/dist/esm/api/types/ForbiddenErrorBody.d.mts +0 -4
- package/dist/esm/api/types/ForbiddenErrorBody.mjs +0 -2
- package/dist/esm/api/types/IdentityMatch.d.mts +0 -13
- package/dist/esm/api/types/IdentityMatch.mjs +0 -2
- package/dist/esm/api/types/IntelligenceClinicalProfile.d.mts +0 -24
- package/dist/esm/api/types/IntelligenceClinicalProfile.mjs +0 -10
- package/dist/esm/api/types/IntelligenceContext.d.mts +0 -17
- package/dist/esm/api/types/IntelligenceContext.mjs +0 -2
- package/dist/esm/api/types/IntelligenceProcessorError.d.mts +0 -4
- package/dist/esm/api/types/IntelligenceProcessorError.mjs +0 -2
- package/dist/esm/api/types/IntelligenceResult.d.mts +0 -16
- package/dist/esm/api/types/IntelligenceResult.mjs +0 -2
- package/dist/esm/api/types/IntelligenceSynthesis.d.mts +0 -6
- package/dist/esm/api/types/IntelligenceSynthesis.mjs +0 -2
- package/dist/esm/api/types/Interaction.d.mts +0 -59
- package/dist/esm/api/types/Interaction.mjs +0 -11
- package/dist/esm/api/types/InteractionSummary.d.mts +0 -13
- package/dist/esm/api/types/InteractionSummary.mjs +0 -2
- package/dist/esm/api/types/InteractionsData.d.mts +0 -11
- package/dist/esm/api/types/InteractionsData.mjs +0 -2
- package/dist/esm/api/types/InternalServerErrorBody.d.mts +0 -3
- package/dist/esm/api/types/InternalServerErrorBody.mjs +0 -2
- package/dist/esm/api/types/MealTiming.d.mts +0 -26
- package/dist/esm/api/types/MealTiming.mjs +0 -2
- package/dist/esm/api/types/MedicationHistoryItem.d.mts +0 -22
- package/dist/esm/api/types/MedicationHistoryItem.mjs +0 -12
- package/dist/esm/api/types/Meta.d.mts +0 -29
- package/dist/esm/api/types/Meta.mjs +0 -11
- package/dist/esm/api/types/MetadataResponse.d.mts +0 -93
- package/dist/esm/api/types/MetadataResponse.mjs +0 -14
- package/dist/esm/api/types/Monitoring.d.mts +0 -22
- package/dist/esm/api/types/Monitoring.mjs +0 -2
- package/dist/esm/api/types/PatientProfile.d.mts +0 -43
- package/dist/esm/api/types/PatientProfile.mjs +0 -17
- package/dist/esm/api/types/Population.d.mts +0 -16
- package/dist/esm/api/types/Population.mjs +0 -16
- package/dist/esm/api/types/PopulationMonitoring.d.mts +0 -26
- package/dist/esm/api/types/PopulationMonitoring.mjs +0 -2
- package/dist/esm/api/types/QuotaMeta.d.mts +0 -11
- package/dist/esm/api/types/QuotaMeta.mjs +0 -2
- package/dist/esm/api/types/RateLimitResponse.d.mts +0 -37
- package/dist/esm/api/types/RateLimitResponse.mjs +0 -10
- package/dist/esm/api/types/ReferenceDose.d.mts +0 -11
- package/dist/esm/api/types/ReferenceDose.mjs +0 -2
- package/dist/esm/api/types/ReproductiveSafetyData.d.mts +0 -58
- package/dist/esm/api/types/ReproductiveSafetyData.mjs +0 -2
- package/dist/esm/api/types/ReproductiveWarning.d.mts +0 -13
- package/dist/esm/api/types/ReproductiveWarning.mjs +0 -2
- package/dist/esm/api/types/ResolvedDrug.d.mts +0 -70
- package/dist/esm/api/types/ResolvedDrug.mjs +0 -2
- package/dist/esm/api/types/SafetyData.d.mts +0 -23
- package/dist/esm/api/types/SafetyData.mjs +0 -2
- package/dist/esm/api/types/SideEffectsData.d.mts +0 -38
- package/dist/esm/api/types/SideEffectsData.mjs +0 -15
- package/dist/esm/api/types/TooManyRequestsErrorBody.d.mts +0 -3
- package/dist/esm/api/types/TooManyRequestsErrorBody.mjs +0 -2
- package/dist/esm/api/types/index.d.mts +0 -55
- package/dist/esm/api/types/index.mjs +0 -55
- package/dist/esm/auth/HeaderAuthProvider.d.mts +0 -20
- package/dist/esm/auth/HeaderAuthProvider.mjs +0 -43
- package/dist/esm/auth/index.d.mts +0 -1
- package/dist/esm/auth/index.mjs +0 -1
- package/dist/esm/core/auth/AuthProvider.d.mts +0 -7
- package/dist/esm/core/auth/AuthProvider.mjs +0 -1
- package/dist/esm/core/auth/AuthRequest.d.mts +0 -9
- package/dist/esm/core/auth/AuthRequest.mjs +0 -1
- package/dist/esm/core/auth/BasicAuth.d.mts +0 -8
- package/dist/esm/core/auth/BasicAuth.mjs +0 -24
- package/dist/esm/core/auth/BearerToken.d.mts +0 -7
- package/dist/esm/core/auth/BearerToken.mjs +0 -13
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +0 -5
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +0 -5
- package/dist/esm/core/auth/index.d.mts +0 -5
- package/dist/esm/core/auth/index.mjs +0 -3
- package/dist/esm/core/base64.d.mts +0 -2
- package/dist/esm/core/base64.mjs +0 -22
- package/dist/esm/core/exports.d.mts +0 -1
- package/dist/esm/core/exports.mjs +0 -1
- package/dist/esm/core/fetcher/APIResponse.d.mts +0 -20
- package/dist/esm/core/fetcher/APIResponse.mjs +0 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +0 -19
- package/dist/esm/core/fetcher/BinaryResponse.mjs +0 -14
- package/dist/esm/core/fetcher/EndpointMetadata.d.mts +0 -13
- package/dist/esm/core/fetcher/EndpointMetadata.mjs +0 -1
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +0 -12
- package/dist/esm/core/fetcher/EndpointSupplier.mjs +0 -19
- package/dist/esm/core/fetcher/Fetcher.d.mts +0 -48
- package/dist/esm/core/fetcher/Fetcher.mjs +0 -318
- package/dist/esm/core/fetcher/Headers.d.mts +0 -2
- package/dist/esm/core/fetcher/Headers.mjs +0 -82
- package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +0 -58
- package/dist/esm/core/fetcher/HttpResponsePromise.mjs +0 -99
- package/dist/esm/core/fetcher/RawResponse.d.mts +0 -29
- package/dist/esm/core/fetcher/RawResponse.mjs +0 -40
- package/dist/esm/core/fetcher/Supplier.d.mts +0 -4
- package/dist/esm/core/fetcher/Supplier.mjs +0 -19
- package/dist/esm/core/fetcher/createRequestUrl.d.mts +0 -1
- package/dist/esm/core/fetcher/createRequestUrl.mjs +0 -5
- package/dist/esm/core/fetcher/getErrorResponseBody.d.mts +0 -1
- package/dist/esm/core/fetcher/getErrorResponseBody.mjs +0 -42
- package/dist/esm/core/fetcher/getFetchFn.d.mts +0 -1
- package/dist/esm/core/fetcher/getFetchFn.mjs +0 -14
- package/dist/esm/core/fetcher/getHeader.d.mts +0 -1
- package/dist/esm/core/fetcher/getHeader.mjs +0 -8
- package/dist/esm/core/fetcher/getRequestBody.d.mts +0 -7
- package/dist/esm/core/fetcher/getRequestBody.mjs +0 -24
- package/dist/esm/core/fetcher/getResponseBody.d.mts +0 -1
- package/dist/esm/core/fetcher/getResponseBody.mjs +0 -66
- package/dist/esm/core/fetcher/index.d.mts +0 -13
- package/dist/esm/core/fetcher/index.mjs +0 -7
- package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +0 -49
- package/dist/esm/core/fetcher/makePassthroughRequest.mjs +0 -132
- package/dist/esm/core/fetcher/makeRequest.d.mts +0 -6
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -55
- package/dist/esm/core/fetcher/requestWithRetries.d.mts +0 -1
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -64
- package/dist/esm/core/fetcher/signals.d.mts +0 -5
- package/dist/esm/core/fetcher/signals.mjs +0 -20
- package/dist/esm/core/headers.d.mts +0 -2
- package/dist/esm/core/headers.mjs +0 -27
- package/dist/esm/core/index.d.mts +0 -6
- package/dist/esm/core/index.mjs +0 -6
- package/dist/esm/core/json.d.mts +0 -15
- package/dist/esm/core/json.mjs +0 -19
- package/dist/esm/core/logging/exports.d.mts +0 -18
- package/dist/esm/core/logging/exports.mjs +0 -9
- package/dist/esm/core/logging/index.d.mts +0 -1
- package/dist/esm/core/logging/index.mjs +0 -1
- package/dist/esm/core/logging/logger.d.mts +0 -126
- package/dist/esm/core/logging/logger.mjs +0 -138
- package/dist/esm/core/runtime/index.d.mts +0 -1
- package/dist/esm/core/runtime/index.mjs +0 -1
- package/dist/esm/core/runtime/runtime.d.mts +0 -9
- package/dist/esm/core/runtime/runtime.mjs +0 -101
- package/dist/esm/core/url/encodePathParam.d.mts +0 -1
- package/dist/esm/core/url/encodePathParam.mjs +0 -18
- package/dist/esm/core/url/index.d.mts +0 -3
- package/dist/esm/core/url/index.mjs +0 -3
- package/dist/esm/core/url/join.d.mts +0 -1
- package/dist/esm/core/url/join.mjs +0 -65
- package/dist/esm/core/url/qs.d.mts +0 -6
- package/dist/esm/core/url/qs.mjs +0 -61
- package/dist/esm/environments.d.mts +0 -4
- package/dist/esm/environments.mjs +0 -4
- package/dist/esm/errors/SafeRxError.d.mts +0 -12
- package/dist/esm/errors/SafeRxError.mjs +0 -28
- package/dist/esm/errors/SafeRxTimeoutError.d.mts +0 -3
- package/dist/esm/errors/SafeRxTimeoutError.mjs +0 -11
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +0 -2
- package/dist/esm/errors/handleNonStatusCodeError.mjs +0 -29
- package/dist/esm/errors/index.d.mts +0 -2
- package/dist/esm/errors/index.mjs +0 -2
- package/dist/esm/exports.d.mts +0 -1
- package/dist/esm/exports.mjs +0 -1
- package/dist/esm/index.d.mts +0 -6
- package/dist/esm/index.mjs +0 -5
- package/dist/esm/version.d.mts +0 -1
- package/dist/esm/version.mjs +0 -1
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Special patient population.
|
|
3
|
-
* - `pediatric` — children and adolescents
|
|
4
|
-
* - `geriatric` — elderly patients (65+)
|
|
5
|
-
* - `cardiac` — patients with cardiac conditions
|
|
6
|
-
* - `hepatic` — patients with liver impairment
|
|
7
|
-
* - `renal` — patients with kidney impairment
|
|
8
|
-
*/
|
|
9
|
-
export declare const Population: {
|
|
10
|
-
readonly Pediatric: "pediatric";
|
|
11
|
-
readonly Geriatric: "geriatric";
|
|
12
|
-
readonly Cardiac: "cardiac";
|
|
13
|
-
readonly Hepatic: "hepatic";
|
|
14
|
-
readonly Renal: "renal";
|
|
15
|
-
};
|
|
16
|
-
export type Population = (typeof Population)[keyof typeof Population];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
/**
|
|
3
|
-
* Special patient population.
|
|
4
|
-
* - `pediatric` — children and adolescents
|
|
5
|
-
* - `geriatric` — elderly patients (65+)
|
|
6
|
-
* - `cardiac` — patients with cardiac conditions
|
|
7
|
-
* - `hepatic` — patients with liver impairment
|
|
8
|
-
* - `renal` — patients with kidney impairment
|
|
9
|
-
*/
|
|
10
|
-
export const Population = {
|
|
11
|
-
Pediatric: "pediatric",
|
|
12
|
-
Geriatric: "geriatric",
|
|
13
|
-
Cardiac: "cardiac",
|
|
14
|
-
Hepatic: "hepatic",
|
|
15
|
-
Renal: "renal",
|
|
16
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export interface PopulationMonitoring {
|
|
2
|
-
/** Drug name */
|
|
3
|
-
name?: string | undefined;
|
|
4
|
-
/** Whether the drug is contraindicated in this population */
|
|
5
|
-
contraindicated?: boolean | undefined;
|
|
6
|
-
/** Whether eGFR monitoring is needed (renal population) */
|
|
7
|
-
requires_egfr_check?: boolean | undefined;
|
|
8
|
-
/** Whether dialysis considerations apply (renal population) */
|
|
9
|
-
requires_dialysis_check?: boolean | undefined;
|
|
10
|
-
/** Child-Pugh grade contraindication status (hepatic population) */
|
|
11
|
-
liver_function_grades?: PopulationMonitoring.LiverFunctionGrades | undefined;
|
|
12
|
-
/** Severity in this population (1-5) */
|
|
13
|
-
severity?: number | undefined;
|
|
14
|
-
/** Severity label in this population */
|
|
15
|
-
severity_label?: string | undefined;
|
|
16
|
-
}
|
|
17
|
-
export declare namespace PopulationMonitoring {
|
|
18
|
-
/**
|
|
19
|
-
* Child-Pugh grade contraindication status (hepatic population)
|
|
20
|
-
*/
|
|
21
|
-
interface LiverFunctionGrades {
|
|
22
|
-
A?: boolean | undefined;
|
|
23
|
-
B?: boolean | undefined;
|
|
24
|
-
C?: boolean | undefined;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Monthly quota accounting for the request.
|
|
3
|
-
*/
|
|
4
|
-
export interface QuotaMeta {
|
|
5
|
-
monthly_limit?: number | undefined;
|
|
6
|
-
monthly_used?: number | undefined;
|
|
7
|
-
monthly_remaining?: number | undefined;
|
|
8
|
-
reset_at?: string | undefined;
|
|
9
|
-
/** Units consumed by this response. Unresolved-only checks return 0. */
|
|
10
|
-
billable_units?: number | undefined;
|
|
11
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Response when rate limit is exceeded
|
|
3
|
-
*/
|
|
4
|
-
export interface RateLimitResponse {
|
|
5
|
-
error?: string | undefined;
|
|
6
|
-
/** Your per-minute limit */
|
|
7
|
-
limit_per_minute?: number | undefined;
|
|
8
|
-
/** Requests made in the current minute */
|
|
9
|
-
requests_this_minute?: number | undefined;
|
|
10
|
-
/** Your daily limit (present on daily limit errors) */
|
|
11
|
-
daily_limit?: number | undefined;
|
|
12
|
-
/** Requests made today (present on daily limit errors) */
|
|
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
|
-
tier?: RateLimitResponse.Tier | undefined;
|
|
25
|
-
/** Upgrade guidance */
|
|
26
|
-
hint?: string | undefined;
|
|
27
|
-
support?: string | undefined;
|
|
28
|
-
}
|
|
29
|
-
export declare namespace RateLimitResponse {
|
|
30
|
-
const Tier: {
|
|
31
|
-
readonly Free: "free";
|
|
32
|
-
readonly Startup: "startup";
|
|
33
|
-
readonly Pro: "pro";
|
|
34
|
-
readonly Enterprise: "enterprise";
|
|
35
|
-
};
|
|
36
|
-
type Tier = (typeof Tier)[keyof typeof Tier];
|
|
37
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export var RateLimitResponse;
|
|
3
|
-
(function (RateLimitResponse) {
|
|
4
|
-
RateLimitResponse.Tier = {
|
|
5
|
-
Free: "free",
|
|
6
|
-
Startup: "startup",
|
|
7
|
-
Pro: "pro",
|
|
8
|
-
Enterprise: "enterprise",
|
|
9
|
-
};
|
|
10
|
-
})(RateLimitResponse || (RateLimitResponse = {}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WHO Defined Daily Dose (DDD) reference data
|
|
3
|
-
*/
|
|
4
|
-
export interface ReferenceDose {
|
|
5
|
-
/** DDD value */
|
|
6
|
-
value?: number | undefined;
|
|
7
|
-
/** DDD unit (g, mg, etc.) */
|
|
8
|
-
unit?: string | undefined;
|
|
9
|
-
/** Number of dosage units per DDD */
|
|
10
|
-
units_per_ddd?: number | undefined;
|
|
11
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type * as SafeRx from "../index.mjs";
|
|
2
|
-
/**
|
|
3
|
-
* Pregnancy and lactation safety data for a single drug
|
|
4
|
-
*/
|
|
5
|
-
export interface ReproductiveSafetyData {
|
|
6
|
-
/**
|
|
7
|
-
* Pregnancy risk score on the SafeRx 0-7 scale.
|
|
8
|
-
* - `0` — Unknown
|
|
9
|
-
* - `1` — Safe
|
|
10
|
-
* - `2` — Likely Safe
|
|
11
|
-
* - `3` — Possibly Unsafe
|
|
12
|
-
* - `4` — Likely Unsafe
|
|
13
|
-
* - `5` — Unsafe
|
|
14
|
-
* - `6` — Contraindicated
|
|
15
|
-
* - `7` — Absolutely Contraindicated
|
|
16
|
-
*/
|
|
17
|
-
pregnancy_risk_level?: number | undefined;
|
|
18
|
-
/** Human-readable pregnancy risk label */
|
|
19
|
-
pregnancy_risk_name?: string | undefined;
|
|
20
|
-
/** Lactation risk score (same 0-7 scale as pregnancy) */
|
|
21
|
-
lactation_risk_level?: number | undefined;
|
|
22
|
-
/** Human-readable lactation risk label */
|
|
23
|
-
lactation_risk_name?: string | undefined;
|
|
24
|
-
/** Clinical rationale for the pregnancy risk rating (English) */
|
|
25
|
-
pregnancy_rationale?: string | undefined;
|
|
26
|
-
/** Clinical rationale for the pregnancy risk rating (Arabic) */
|
|
27
|
-
pregnancy_rationale_ar?: string | undefined;
|
|
28
|
-
/** Clinical rationale for the lactation risk rating (English) */
|
|
29
|
-
lactation_rationale?: string | undefined;
|
|
30
|
-
/** Clinical rationale for the lactation risk rating (Arabic) */
|
|
31
|
-
lactation_rationale_ar?: string | undefined;
|
|
32
|
-
pregnancy_warning?: SafeRx.ReproductiveWarning | undefined;
|
|
33
|
-
lactation_warning?: SafeRx.ReproductiveWarning | undefined;
|
|
34
|
-
/** First trimester pregnancy risk classification */
|
|
35
|
-
preg_t1_risk?: (string | null) | undefined;
|
|
36
|
-
/** First trimester clinical note */
|
|
37
|
-
preg_t1_note?: (string | null) | undefined;
|
|
38
|
-
/** First trimester note in Arabic */
|
|
39
|
-
preg_t1_note_ar?: (string | null) | undefined;
|
|
40
|
-
/** Second trimester pregnancy risk classification */
|
|
41
|
-
preg_t2_risk?: (string | null) | undefined;
|
|
42
|
-
/** Second trimester clinical note */
|
|
43
|
-
preg_t2_note?: (string | null) | undefined;
|
|
44
|
-
/** Second trimester note in Arabic */
|
|
45
|
-
preg_t2_note_ar?: (string | null) | undefined;
|
|
46
|
-
/** Third trimester pregnancy risk classification */
|
|
47
|
-
preg_t3_risk?: (string | null) | undefined;
|
|
48
|
-
/** Third trimester clinical note */
|
|
49
|
-
preg_t3_note?: (string | null) | undefined;
|
|
50
|
-
/** Third trimester note in Arabic */
|
|
51
|
-
preg_t3_note_ar?: (string | null) | undefined;
|
|
52
|
-
/** Measured drug concentration in breast milk (mg/L) */
|
|
53
|
-
lact_milk_level_mgl?: (number | null) | undefined;
|
|
54
|
-
/** Milk-to-plasma concentration ratio */
|
|
55
|
-
lact_mp_ratio?: (number | null) | undefined;
|
|
56
|
-
/** Relative Infant Dose (%) — percentage of maternal dose received by infant */
|
|
57
|
-
lact_rid?: (number | null) | undefined;
|
|
58
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pregnancy or lactation specific warning (bilingual)
|
|
3
|
-
*/
|
|
4
|
-
export interface ReproductiveWarning {
|
|
5
|
-
/** Whether a specific warning exists */
|
|
6
|
-
has_warning?: boolean | undefined;
|
|
7
|
-
/** Warning text in English */
|
|
8
|
-
text_en?: (string | null) | undefined;
|
|
9
|
-
/** Warning text in Arabic */
|
|
10
|
-
text_ar?: (string | null) | undefined;
|
|
11
|
-
/** Warning categories */
|
|
12
|
-
categories?: string[] | undefined;
|
|
13
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type * as SafeRx from "../index.mjs";
|
|
2
|
-
export interface ResolvedDrug {
|
|
3
|
-
/** The original drug name as submitted in the request */
|
|
4
|
-
input: string;
|
|
5
|
-
/** Always `true` for drugs in this array */
|
|
6
|
-
resolved: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* SafeRx product identifier. Primary key used across all safety
|
|
9
|
-
* domains. Format: `SRX-{category}-{sequence}`.
|
|
10
|
-
*/
|
|
11
|
-
sfrx_id: string;
|
|
12
|
-
/**
|
|
13
|
-
* Parent product identifier for strength/pack variants of the same drug.
|
|
14
|
-
* Null if this product has no parent.
|
|
15
|
-
*/
|
|
16
|
-
parent_sfrx_id?: (string | null) | undefined;
|
|
17
|
-
/** Registered trade name with strength and pack size */
|
|
18
|
-
brand_name: string;
|
|
19
|
-
/** Arabic trade name */
|
|
20
|
-
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
|
-
/** Active pharmaceutical ingredient(s), pipe-separated for combinations */
|
|
26
|
-
active_ingredient: string;
|
|
27
|
-
/** Arabic active ingredient name */
|
|
28
|
-
active_ingredient_ar?: string | undefined;
|
|
29
|
-
/** Short generic drug name */
|
|
30
|
-
generic_name?: string | undefined;
|
|
31
|
-
/** Arabic generic drug name */
|
|
32
|
-
generic_name_ar?: string | undefined;
|
|
33
|
-
/** Pharmaceutical dosage form */
|
|
34
|
-
form: string;
|
|
35
|
-
/** Arabic dosage form */
|
|
36
|
-
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
|
-
/** Marketing authorization holder */
|
|
42
|
-
manufacturer_en?: string | undefined;
|
|
43
|
-
/** ATC-based therapeutic classification, pipe-separated hierarchy */
|
|
44
|
-
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
|
-
/** Primary prescribing specialty */
|
|
62
|
-
medical_specialty?: string | undefined;
|
|
63
|
-
/** Distribution/supply company (may be empty) */
|
|
64
|
-
supplier_en?: string | undefined;
|
|
65
|
-
/** Product barcode (may be empty) */
|
|
66
|
-
barcode?: string | undefined;
|
|
67
|
-
/** Current price in Egyptian Pounds (EGP) */
|
|
68
|
-
price_egp?: number | undefined;
|
|
69
|
-
identity_match?: SafeRx.IdentityMatch | undefined;
|
|
70
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type * as SafeRx from "../index.mjs";
|
|
2
|
-
/**
|
|
3
|
-
* Safety screening results organized by domain. Each domain key maps
|
|
4
|
-
* to domain-specific data. Domains not requested via `include` will
|
|
5
|
-
* be absent from this object.
|
|
6
|
-
*/
|
|
7
|
-
export interface SafetyData {
|
|
8
|
-
/**
|
|
9
|
-
* Adverse effects data keyed by sfrx_id. Includes risk level,
|
|
10
|
-
* Black Box Warnings, severe/common effects, monitoring, and
|
|
11
|
-
* dose classification.
|
|
12
|
-
*/
|
|
13
|
-
side_effects?: Record<string, SafeRx.SideEffectsData> | undefined;
|
|
14
|
-
interactions?: SafeRx.InteractionsData | undefined;
|
|
15
|
-
/** Pregnancy & lactation risk data keyed by sfrx_id */
|
|
16
|
-
reproductive_safety?: Record<string, SafeRx.ReproductiveSafetyData> | undefined;
|
|
17
|
-
/** Food-drug interaction data keyed by sfrx_id */
|
|
18
|
-
food?: Record<string, SafeRx.FoodData> | undefined;
|
|
19
|
-
clinical?: SafeRx.ClinicalData | undefined;
|
|
20
|
-
/** Maximum daily dose data keyed by sfrx_id */
|
|
21
|
-
dosing?: Record<string, SafeRx.DosingData> | undefined;
|
|
22
|
-
allergy?: SafeRx.AllergyData | undefined;
|
|
23
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type * as SafeRx from "../index.mjs";
|
|
2
|
-
export interface SideEffectsData {
|
|
3
|
-
/**
|
|
4
|
-
* Overall adverse effect risk level.
|
|
5
|
-
* - `HIGH` — has a Black Box Warning
|
|
6
|
-
* - `MODERATE` — more than 5 severe effects
|
|
7
|
-
* - `LOW` — 5 or fewer severe effects, no BBW
|
|
8
|
-
*/
|
|
9
|
-
risk_level?: SideEffectsData.RiskLevel | undefined;
|
|
10
|
-
/** Whether this drug has an FDA Black Box Warning */
|
|
11
|
-
has_black_box_warning?: boolean | undefined;
|
|
12
|
-
/** Black Box Warning details, or null if none exists */
|
|
13
|
-
black_box_warning?: (SafeRx.BlackBoxWarning | null) | undefined;
|
|
14
|
-
/** Total number of known adverse effects */
|
|
15
|
-
total_count?: number | undefined;
|
|
16
|
-
/** Number of severe adverse effects */
|
|
17
|
-
severe_total?: number | undefined;
|
|
18
|
-
/** Top 5 most severe adverse effects */
|
|
19
|
-
severe?: SafeRx.AdverseEffect[] | undefined;
|
|
20
|
-
/** Top 5 most common adverse effects */
|
|
21
|
-
common?: SafeRx.AdverseEffect[] | undefined;
|
|
22
|
-
monitoring?: SafeRx.Monitoring | undefined;
|
|
23
|
-
dose_classification?: SafeRx.DoseClassification | undefined;
|
|
24
|
-
}
|
|
25
|
-
export declare namespace SideEffectsData {
|
|
26
|
-
/**
|
|
27
|
-
* Overall adverse effect risk level.
|
|
28
|
-
* - `HIGH` — has a Black Box Warning
|
|
29
|
-
* - `MODERATE` — more than 5 severe effects
|
|
30
|
-
* - `LOW` — 5 or fewer severe effects, no BBW
|
|
31
|
-
*/
|
|
32
|
-
const RiskLevel: {
|
|
33
|
-
readonly Low: "LOW";
|
|
34
|
-
readonly Moderate: "MODERATE";
|
|
35
|
-
readonly High: "HIGH";
|
|
36
|
-
};
|
|
37
|
-
type RiskLevel = (typeof RiskLevel)[keyof typeof RiskLevel];
|
|
38
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export var SideEffectsData;
|
|
3
|
-
(function (SideEffectsData) {
|
|
4
|
-
/**
|
|
5
|
-
* Overall adverse effect risk level.
|
|
6
|
-
* - `HIGH` — has a Black Box Warning
|
|
7
|
-
* - `MODERATE` — more than 5 severe effects
|
|
8
|
-
* - `LOW` — 5 or fewer severe effects, no BBW
|
|
9
|
-
*/
|
|
10
|
-
SideEffectsData.RiskLevel = {
|
|
11
|
-
Low: "LOW",
|
|
12
|
-
Moderate: "MODERATE",
|
|
13
|
-
High: "HIGH",
|
|
14
|
-
};
|
|
15
|
-
})(SideEffectsData || (SideEffectsData = {}));
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export * from "./AdverseEffect.mjs";
|
|
2
|
-
export * from "./Alert.mjs";
|
|
3
|
-
export * from "./AllergyCrossReactivityReference.mjs";
|
|
4
|
-
export * from "./AllergyData.mjs";
|
|
5
|
-
export * from "./AllergyFamilyReference.mjs";
|
|
6
|
-
export * from "./AllergyInputEntry.mjs";
|
|
7
|
-
export * from "./AllergyProductFamilyReference.mjs";
|
|
8
|
-
export * from "./AllergySummary.mjs";
|
|
9
|
-
export * from "./AllergyWarning.mjs";
|
|
10
|
-
export * from "./BadRequestErrorBody.mjs";
|
|
11
|
-
export * from "./BlackBoxWarning.mjs";
|
|
12
|
-
export * from "./BlockedResponse.mjs";
|
|
13
|
-
export * from "./ClinicalAlert.mjs";
|
|
14
|
-
export * from "./ClinicalConcern.mjs";
|
|
15
|
-
export * from "./ClinicalContextApplied.mjs";
|
|
16
|
-
export * from "./ClinicalData.mjs";
|
|
17
|
-
export * from "./Condition.mjs";
|
|
18
|
-
export * from "./DailyLimit.mjs";
|
|
19
|
-
export * from "./DomainCode.mjs";
|
|
20
|
-
export * from "./DoseClassification.mjs";
|
|
21
|
-
export * from "./DoseComponent.mjs";
|
|
22
|
-
export * from "./DosingData.mjs";
|
|
23
|
-
export * from "./DrugClinicalData.mjs";
|
|
24
|
-
export * from "./DrugSafetyCheckResponse.mjs";
|
|
25
|
-
export * from "./ErrorResponse.mjs";
|
|
26
|
-
export * from "./FoodConflict.mjs";
|
|
27
|
-
export * from "./FoodData.mjs";
|
|
28
|
-
export * from "./ForbiddenErrorBody.mjs";
|
|
29
|
-
export * from "./IdentityMatch.mjs";
|
|
30
|
-
export * from "./IntelligenceClinicalProfile.mjs";
|
|
31
|
-
export * from "./IntelligenceContext.mjs";
|
|
32
|
-
export * from "./IntelligenceProcessorError.mjs";
|
|
33
|
-
export * from "./IntelligenceResult.mjs";
|
|
34
|
-
export * from "./IntelligenceSynthesis.mjs";
|
|
35
|
-
export * from "./Interaction.mjs";
|
|
36
|
-
export * from "./InteractionSummary.mjs";
|
|
37
|
-
export * from "./InteractionsData.mjs";
|
|
38
|
-
export * from "./InternalServerErrorBody.mjs";
|
|
39
|
-
export * from "./MealTiming.mjs";
|
|
40
|
-
export * from "./MedicationHistoryItem.mjs";
|
|
41
|
-
export * from "./Meta.mjs";
|
|
42
|
-
export * from "./MetadataResponse.mjs";
|
|
43
|
-
export * from "./Monitoring.mjs";
|
|
44
|
-
export * from "./PatientProfile.mjs";
|
|
45
|
-
export * from "./Population.mjs";
|
|
46
|
-
export * from "./PopulationMonitoring.mjs";
|
|
47
|
-
export * from "./QuotaMeta.mjs";
|
|
48
|
-
export * from "./RateLimitResponse.mjs";
|
|
49
|
-
export * from "./ReferenceDose.mjs";
|
|
50
|
-
export * from "./ReproductiveSafetyData.mjs";
|
|
51
|
-
export * from "./ReproductiveWarning.mjs";
|
|
52
|
-
export * from "./ResolvedDrug.mjs";
|
|
53
|
-
export * from "./SafetyData.mjs";
|
|
54
|
-
export * from "./SideEffectsData.mjs";
|
|
55
|
-
export * from "./TooManyRequestsErrorBody.mjs";
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export * from "./AdverseEffect.mjs";
|
|
2
|
-
export * from "./Alert.mjs";
|
|
3
|
-
export * from "./AllergyCrossReactivityReference.mjs";
|
|
4
|
-
export * from "./AllergyData.mjs";
|
|
5
|
-
export * from "./AllergyFamilyReference.mjs";
|
|
6
|
-
export * from "./AllergyInputEntry.mjs";
|
|
7
|
-
export * from "./AllergyProductFamilyReference.mjs";
|
|
8
|
-
export * from "./AllergySummary.mjs";
|
|
9
|
-
export * from "./AllergyWarning.mjs";
|
|
10
|
-
export * from "./BadRequestErrorBody.mjs";
|
|
11
|
-
export * from "./BlackBoxWarning.mjs";
|
|
12
|
-
export * from "./BlockedResponse.mjs";
|
|
13
|
-
export * from "./ClinicalAlert.mjs";
|
|
14
|
-
export * from "./ClinicalConcern.mjs";
|
|
15
|
-
export * from "./ClinicalContextApplied.mjs";
|
|
16
|
-
export * from "./ClinicalData.mjs";
|
|
17
|
-
export * from "./Condition.mjs";
|
|
18
|
-
export * from "./DailyLimit.mjs";
|
|
19
|
-
export * from "./DomainCode.mjs";
|
|
20
|
-
export * from "./DoseClassification.mjs";
|
|
21
|
-
export * from "./DoseComponent.mjs";
|
|
22
|
-
export * from "./DosingData.mjs";
|
|
23
|
-
export * from "./DrugClinicalData.mjs";
|
|
24
|
-
export * from "./DrugSafetyCheckResponse.mjs";
|
|
25
|
-
export * from "./ErrorResponse.mjs";
|
|
26
|
-
export * from "./FoodConflict.mjs";
|
|
27
|
-
export * from "./FoodData.mjs";
|
|
28
|
-
export * from "./ForbiddenErrorBody.mjs";
|
|
29
|
-
export * from "./IdentityMatch.mjs";
|
|
30
|
-
export * from "./IntelligenceClinicalProfile.mjs";
|
|
31
|
-
export * from "./IntelligenceContext.mjs";
|
|
32
|
-
export * from "./IntelligenceProcessorError.mjs";
|
|
33
|
-
export * from "./IntelligenceResult.mjs";
|
|
34
|
-
export * from "./IntelligenceSynthesis.mjs";
|
|
35
|
-
export * from "./Interaction.mjs";
|
|
36
|
-
export * from "./InteractionSummary.mjs";
|
|
37
|
-
export * from "./InteractionsData.mjs";
|
|
38
|
-
export * from "./InternalServerErrorBody.mjs";
|
|
39
|
-
export * from "./MealTiming.mjs";
|
|
40
|
-
export * from "./MedicationHistoryItem.mjs";
|
|
41
|
-
export * from "./Meta.mjs";
|
|
42
|
-
export * from "./MetadataResponse.mjs";
|
|
43
|
-
export * from "./Monitoring.mjs";
|
|
44
|
-
export * from "./PatientProfile.mjs";
|
|
45
|
-
export * from "./Population.mjs";
|
|
46
|
-
export * from "./PopulationMonitoring.mjs";
|
|
47
|
-
export * from "./QuotaMeta.mjs";
|
|
48
|
-
export * from "./RateLimitResponse.mjs";
|
|
49
|
-
export * from "./ReferenceDose.mjs";
|
|
50
|
-
export * from "./ReproductiveSafetyData.mjs";
|
|
51
|
-
export * from "./ReproductiveWarning.mjs";
|
|
52
|
-
export * from "./ResolvedDrug.mjs";
|
|
53
|
-
export * from "./SafetyData.mjs";
|
|
54
|
-
export * from "./SideEffectsData.mjs";
|
|
55
|
-
export * from "./TooManyRequestsErrorBody.mjs";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as core from "../core/index.mjs";
|
|
2
|
-
declare const PARAM_KEY: "apiKey";
|
|
3
|
-
export declare class HeaderAuthProvider implements core.AuthProvider {
|
|
4
|
-
private readonly options;
|
|
5
|
-
constructor(options: HeaderAuthProvider.Options);
|
|
6
|
-
static canCreate(options: Partial<HeaderAuthProvider.Options>): boolean;
|
|
7
|
-
getAuthRequest({ endpointMetadata, }?: {
|
|
8
|
-
endpointMetadata?: core.EndpointMetadata;
|
|
9
|
-
}): Promise<core.AuthRequest>;
|
|
10
|
-
}
|
|
11
|
-
export declare namespace HeaderAuthProvider {
|
|
12
|
-
const AUTH_SCHEME: "SafeRxAPIKey";
|
|
13
|
-
const AUTH_CONFIG_ERROR_MESSAGE: string;
|
|
14
|
-
type Options = AuthOptions;
|
|
15
|
-
type AuthOptions = {
|
|
16
|
-
[PARAM_KEY]?: core.Supplier<string>;
|
|
17
|
-
};
|
|
18
|
-
function createInstance(options: Options): core.AuthProvider;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
import * as core from "../core/index.mjs";
|
|
12
|
-
import * as errors from "../errors/index.mjs";
|
|
13
|
-
const PARAM_KEY = "apiKey";
|
|
14
|
-
const HEADER_NAME = "X-SafeRx-API-Key";
|
|
15
|
-
export class HeaderAuthProvider {
|
|
16
|
-
constructor(options) {
|
|
17
|
-
this.options = options;
|
|
18
|
-
}
|
|
19
|
-
static canCreate(options) {
|
|
20
|
-
return (options === null || options === void 0 ? void 0 : options[PARAM_KEY]) != null;
|
|
21
|
-
}
|
|
22
|
-
getAuthRequest() {
|
|
23
|
-
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
24
|
-
const headerValue = yield core.Supplier.get(this.options[PARAM_KEY]);
|
|
25
|
-
if (headerValue == null) {
|
|
26
|
-
throw new errors.SafeRxError({
|
|
27
|
-
message: HeaderAuthProvider.AUTH_CONFIG_ERROR_MESSAGE,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
headers: { [HEADER_NAME]: headerValue },
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
(function (HeaderAuthProvider) {
|
|
37
|
-
HeaderAuthProvider.AUTH_SCHEME = "SafeRxAPIKey";
|
|
38
|
-
HeaderAuthProvider.AUTH_CONFIG_ERROR_MESSAGE = `Please provide '${PARAM_KEY}' when initializing the client`;
|
|
39
|
-
function createInstance(options) {
|
|
40
|
-
return new HeaderAuthProvider(options);
|
|
41
|
-
}
|
|
42
|
-
HeaderAuthProvider.createInstance = createInstance;
|
|
43
|
-
})(HeaderAuthProvider || (HeaderAuthProvider = {}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { HeaderAuthProvider } from "./HeaderAuthProvider.mjs";
|
package/dist/esm/auth/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { HeaderAuthProvider } from "./HeaderAuthProvider.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { base64Decode, base64Encode } from "../base64.mjs";
|
|
2
|
-
const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
|
|
3
|
-
export const BasicAuth = {
|
|
4
|
-
toAuthorizationHeader: (basicAuth) => {
|
|
5
|
-
if (basicAuth == null) {
|
|
6
|
-
return undefined;
|
|
7
|
-
}
|
|
8
|
-
const token = base64Encode(`${basicAuth.username}:${basicAuth.password}`);
|
|
9
|
-
return `Basic ${token}`;
|
|
10
|
-
},
|
|
11
|
-
fromAuthorizationHeader: (header) => {
|
|
12
|
-
const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
|
|
13
|
-
const decoded = base64Decode(credentials);
|
|
14
|
-
const [username, ...passwordParts] = decoded.split(":");
|
|
15
|
-
const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined;
|
|
16
|
-
if (username == null || password == null) {
|
|
17
|
-
throw new Error("Invalid basic auth");
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
username,
|
|
21
|
-
password,
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type BearerToken = string;
|
|
2
|
-
declare function toAuthorizationHeader(token: string | undefined): string | undefined;
|
|
3
|
-
export declare const BearerToken: {
|
|
4
|
-
toAuthorizationHeader: typeof toAuthorizationHeader;
|
|
5
|
-
fromAuthorizationHeader: (header: string) => BearerToken;
|
|
6
|
-
};
|
|
7
|
-
export {};
|