phenoml 17.7.0 → 17.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.d.ts +12 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +20 -10
- package/dist/cjs/api/resources/agent/client/Client.js +4 -3
- package/dist/cjs/api/resources/agent/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/agent/errors/ConflictError.js +1 -1
- package/dist/cjs/api/resources/agent/errors/ForbiddenError.js +1 -1
- package/dist/cjs/api/resources/agent/errors/GatewayTimeoutError.js +1 -1
- package/dist/cjs/api/resources/agent/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/agent/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/resources/agent/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/agent/resources/chat/client/Client.js +3 -2
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +4 -3
- package/dist/cjs/api/resources/authtoken/client/Client.js +2 -1
- package/dist/cjs/api/resources/authtoken/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/authtoken/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/authtoken/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/cohort/client/Client.js +2 -1
- package/dist/cjs/api/resources/cohort/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/cohort/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/cohort/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/construe/client/Client.js +2 -1
- package/dist/cjs/api/resources/construe/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/construe/errors/ConflictError.js +1 -1
- package/dist/cjs/api/resources/construe/errors/FailedDependencyError.js +1 -1
- package/dist/cjs/api/resources/construe/errors/ForbiddenError.js +1 -1
- package/dist/cjs/api/resources/construe/errors/GatewayTimeoutError.js +1 -1
- package/dist/cjs/api/resources/construe/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/construe/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/resources/construe/errors/NotImplementedError.js +1 -1
- package/dist/cjs/api/resources/construe/errors/ServiceUnavailableError.js +1 -1
- package/dist/cjs/api/resources/construe/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/construe/resources/codeSystems/client/Client.js +2 -1
- package/dist/cjs/api/resources/construe/resources/codeSystems/client/requests/DeleteRequest.d.ts +1 -1
- package/dist/cjs/api/resources/construe/resources/codeSystems/client/requests/ExportRequest.d.ts +1 -1
- package/dist/cjs/api/resources/construe/resources/codeSystems/client/requests/FindRequest.d.ts +1 -1
- package/dist/cjs/api/resources/construe/resources/codes/client/Client.d.ts +47 -0
- package/dist/cjs/api/resources/construe/resources/codes/client/Client.js +97 -1
- package/dist/cjs/api/resources/construe/resources/codes/client/requests/CodesListRequest.d.ts +1 -1
- package/dist/cjs/api/resources/construe/resources/codes/client/requests/ExtractRequest.d.ts +12 -0
- package/dist/cjs/api/resources/construe/resources/codes/client/requests/LookupRequest.d.ts +1 -1
- package/dist/cjs/api/resources/construe/resources/codes/client/requests/PhenoCrRequest.d.ts +16 -0
- package/dist/cjs/api/resources/construe/resources/codes/client/requests/SearchSemanticRequest.d.ts +1 -1
- package/dist/cjs/api/resources/construe/resources/codes/client/requests/SearchTextRequest.d.ts +1 -1
- package/dist/cjs/api/resources/construe/resources/codes/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/construe/types/ExtractRequestSystem.d.ts +11 -8
- package/dist/cjs/api/resources/construe/types/PhenocrExtractRequestSystem.d.ts +6 -0
- package/dist/cjs/api/resources/construe/types/PhenocrExtractRequestSystem.js +3 -0
- package/dist/cjs/api/resources/construe/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/construe/types/index.js +1 -0
- package/dist/cjs/api/resources/fhir/client/Client.js +5 -4
- package/dist/cjs/api/resources/fhir2Omop/client/Client.js +2 -1
- package/dist/cjs/api/resources/fhir2Omop/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/fhir2Omop/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/fhir2Omop/errors/ServiceUnavailableError.js +1 -1
- package/dist/cjs/api/resources/fhir2Omop/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/fhir2Omop/types/CareSiteRow.d.ts +8 -0
- package/dist/cjs/api/resources/fhir2Omop/types/CareSiteRow.js +3 -0
- package/dist/cjs/api/resources/fhir2Omop/types/ConditionOccurrenceRow.d.ts +1 -0
- package/dist/cjs/api/resources/fhir2Omop/types/DeathRow.d.ts +9 -0
- package/dist/cjs/api/resources/fhir2Omop/types/DeathRow.js +3 -0
- package/dist/cjs/api/resources/fhir2Omop/types/DrugExposureRow.d.ts +1 -0
- package/dist/cjs/api/resources/fhir2Omop/types/LocationRow.d.ts +14 -0
- package/dist/cjs/api/resources/fhir2Omop/types/LocationRow.js +3 -0
- package/dist/cjs/api/resources/fhir2Omop/types/MeasurementRow.d.ts +1 -0
- package/dist/cjs/api/resources/fhir2Omop/types/ObservationPeriodRow.d.ts +7 -0
- package/dist/cjs/api/resources/fhir2Omop/types/ObservationPeriodRow.js +3 -0
- package/dist/cjs/api/resources/fhir2Omop/types/ObservationRow.d.ts +1 -0
- package/dist/cjs/api/resources/fhir2Omop/types/OmopTables.d.ts +5 -0
- package/dist/cjs/api/resources/fhir2Omop/types/PersonRow.d.ts +1 -0
- package/dist/cjs/api/resources/fhir2Omop/types/ProcedureOccurrenceRow.d.ts +1 -0
- package/dist/cjs/api/resources/fhir2Omop/types/ProviderRow.d.ts +15 -0
- package/dist/cjs/api/resources/fhir2Omop/types/ProviderRow.js +3 -0
- package/dist/cjs/api/resources/fhir2Omop/types/VisitOccurrenceRow.d.ts +2 -0
- package/dist/cjs/api/resources/fhir2Omop/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/fhir2Omop/types/index.js +5 -0
- package/dist/cjs/api/resources/fhirProvider/client/Client.js +2 -1
- package/dist/cjs/api/resources/fhirProvider/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/fhirProvider/errors/ForbiddenError.js +1 -1
- package/dist/cjs/api/resources/fhirProvider/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/fhirProvider/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/resources/fhirProvider/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/fhirProvider/resources/authConfig/client/Client.js +4 -3
- package/dist/cjs/api/resources/implementationGuides/client/Client.d.ts +12 -0
- package/dist/cjs/api/resources/implementationGuides/client/Client.js +16 -0
- package/dist/cjs/api/resources/implementationGuides/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/implementationGuides/client/index.js +2 -0
- package/dist/cjs/api/resources/implementationGuides/errors/BadRequestError.d.ts +5 -0
- package/dist/cjs/api/resources/implementationGuides/errors/BadRequestError.js +54 -0
- package/dist/cjs/api/resources/implementationGuides/errors/ForbiddenError.d.ts +5 -0
- package/dist/cjs/api/resources/implementationGuides/errors/ForbiddenError.js +54 -0
- package/dist/cjs/api/resources/implementationGuides/errors/InternalServerError.d.ts +5 -0
- package/dist/cjs/api/resources/implementationGuides/errors/InternalServerError.js +54 -0
- package/dist/cjs/api/resources/implementationGuides/errors/NotFoundError.d.ts +5 -0
- package/dist/cjs/api/resources/implementationGuides/errors/NotFoundError.js +54 -0
- package/dist/cjs/api/resources/implementationGuides/errors/UnauthorizedError.d.ts +5 -0
- package/dist/cjs/api/resources/implementationGuides/errors/UnauthorizedError.js +54 -0
- package/dist/cjs/api/resources/implementationGuides/errors/index.d.ts +5 -0
- package/dist/cjs/api/resources/implementationGuides/errors/index.js +21 -0
- package/dist/cjs/api/resources/implementationGuides/exports.d.ts +3 -0
- package/dist/cjs/api/resources/implementationGuides/exports.js +22 -0
- package/dist/cjs/api/resources/implementationGuides/index.d.ts +4 -0
- package/dist/cjs/api/resources/implementationGuides/index.js +20 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/client/Client.d.ts +91 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/client/Client.js +316 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/client/index.js +17 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/client/requests/UpdateImplementationGuideRequest.d.ts +8 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/client/requests/UpdateImplementationGuideRequest.js +3 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/exports.d.ts +2 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/exports.js +21 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/index.d.ts +1 -0
- package/dist/cjs/api/resources/implementationGuides/resources/implementationGuides/index.js +17 -0
- package/dist/cjs/api/resources/implementationGuides/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/implementationGuides/resources/index.js +41 -0
- package/dist/cjs/api/resources/implementationGuides/types/ImplementationGuideDetail.d.ts +5 -0
- package/dist/cjs/api/resources/implementationGuides/types/ImplementationGuideDetail.js +3 -0
- package/dist/cjs/api/resources/implementationGuides/types/ImplementationGuideListResponse.d.ts +4 -0
- package/dist/cjs/api/resources/implementationGuides/types/ImplementationGuideListResponse.js +3 -0
- package/dist/cjs/api/resources/implementationGuides/types/ImplementationGuideSummary.d.ts +15 -0
- package/dist/cjs/api/resources/implementationGuides/types/ImplementationGuideSummary.js +3 -0
- package/dist/cjs/api/resources/implementationGuides/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/implementationGuides/types/index.js +19 -0
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +8 -0
- package/dist/cjs/api/resources/lang2Fhir/client/Client.js +15 -6
- package/dist/cjs/api/resources/lang2Fhir/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/ClientClosedRequestError.js +1 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/ForbiddenError.js +1 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/GatewayTimeoutError.js +1 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/lang2Fhir/errors/UnprocessableEntityError.js +1 -1
- package/dist/cjs/api/resources/lang2Fhir/types/CreateMultiResponse.d.ts +2 -0
- package/dist/cjs/api/resources/lang2Fhir/{client/requests → types}/ProfileUploadRequest.d.ts +2 -10
- package/dist/cjs/api/resources/lang2Fhir/types/ProfileUploadRequest.js +3 -0
- package/dist/cjs/api/resources/lang2Fhir/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/lang2Fhir/types/index.js +1 -0
- package/dist/cjs/api/resources/profiles/client/Client.d.ts +12 -0
- package/dist/cjs/api/resources/profiles/client/Client.js +16 -0
- package/dist/cjs/api/resources/profiles/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/profiles/client/index.js +2 -0
- package/dist/cjs/api/resources/profiles/errors/BadRequestError.d.ts +5 -0
- package/dist/cjs/api/resources/profiles/errors/BadRequestError.js +54 -0
- package/dist/cjs/api/resources/profiles/errors/ForbiddenError.d.ts +5 -0
- package/dist/cjs/api/resources/profiles/errors/ForbiddenError.js +54 -0
- package/dist/cjs/api/resources/profiles/errors/InternalServerError.d.ts +5 -0
- package/dist/cjs/api/resources/profiles/errors/InternalServerError.js +54 -0
- package/dist/cjs/api/resources/profiles/errors/NotFoundError.d.ts +5 -0
- package/dist/cjs/api/resources/profiles/errors/NotFoundError.js +54 -0
- package/dist/cjs/api/resources/profiles/errors/UnauthorizedError.d.ts +5 -0
- package/dist/cjs/api/resources/profiles/errors/UnauthorizedError.js +54 -0
- package/dist/cjs/api/resources/profiles/errors/index.d.ts +5 -0
- package/dist/cjs/api/resources/profiles/errors/index.js +21 -0
- package/dist/cjs/api/resources/profiles/exports.d.ts +3 -0
- package/dist/cjs/api/resources/profiles/exports.js +22 -0
- package/dist/cjs/api/resources/profiles/index.d.ts +4 -0
- package/dist/cjs/api/resources/profiles/index.js +20 -0
- package/dist/cjs/api/resources/profiles/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/profiles/resources/index.js +41 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/client/Client.d.ts +127 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/client/Client.js +397 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/client/index.js +17 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/client/requests/ListRequest.d.ts +10 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/client/requests/ListRequest.js +3 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/exports.d.ts +2 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/exports.js +21 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/index.d.ts +1 -0
- package/dist/cjs/api/resources/profiles/resources/profiles/index.js +17 -0
- package/dist/cjs/api/resources/profiles/types/FhirResource.d.ts +4 -0
- package/dist/cjs/api/resources/profiles/types/FhirResource.js +3 -0
- package/dist/cjs/api/resources/profiles/types/ProfileGetResponse.d.ts +5 -0
- package/dist/cjs/api/resources/profiles/types/ProfileGetResponse.js +3 -0
- package/dist/cjs/api/resources/profiles/types/ProfileListResponse.d.ts +4 -0
- package/dist/cjs/api/resources/profiles/types/ProfileListResponse.js +3 -0
- package/dist/cjs/api/resources/profiles/types/ProfileSummary.d.ts +26 -0
- package/dist/cjs/api/resources/profiles/types/ProfileSummary.js +12 -0
- package/dist/cjs/api/resources/profiles/types/ProfileUploadRequest.d.ts +7 -0
- package/dist/cjs/api/resources/profiles/types/ProfileUploadRequest.js +3 -0
- package/dist/cjs/api/resources/profiles/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/profiles/types/index.js +21 -0
- package/dist/cjs/api/resources/summary/client/Client.js +2 -1
- package/dist/cjs/api/resources/summary/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/summary/errors/ForbiddenError.js +1 -1
- package/dist/cjs/api/resources/summary/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/summary/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/resources/summary/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/summary/resources/templates/client/Client.js +3 -2
- package/dist/cjs/api/resources/tools/client/Client.js +5 -4
- package/dist/cjs/api/resources/tools/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/tools/errors/ForbiddenError.js +1 -1
- package/dist/cjs/api/resources/tools/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/tools/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/resources/tools/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/tools/resources/mcpServers/client/Client.js +2 -1
- package/dist/cjs/api/resources/voice/errors/BadGatewayError.js +1 -1
- package/dist/cjs/api/resources/voice/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/voice/errors/ContentTooLargeError.js +1 -1
- package/dist/cjs/api/resources/voice/errors/GatewayTimeoutError.js +1 -1
- package/dist/cjs/api/resources/voice/errors/PaymentRequiredError.js +1 -1
- package/dist/cjs/api/resources/voice/errors/ServiceUnavailableError.js +1 -1
- package/dist/cjs/api/resources/voice/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/resources/workflows/client/Client.js +4 -3
- package/dist/cjs/api/resources/workflows/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/resources/workflows/errors/ForbiddenError.js +1 -1
- package/dist/cjs/api/resources/workflows/errors/GatewayTimeoutError.js +1 -1
- package/dist/cjs/api/resources/workflows/errors/InternalServerError.js +1 -1
- package/dist/cjs/api/resources/workflows/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/resources/workflows/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/core/file/file.js +3 -0
- package/dist/cjs/core/requestBody.d.ts +12 -0
- package/dist/cjs/core/requestBody.js +26 -0
- package/dist/cjs/core/stream/Stream.d.ts +45 -1
- package/dist/cjs/core/stream/Stream.js +323 -84
- package/dist/cjs/core/stream/index.d.ts +1 -0
- package/dist/cjs/core/url/qs.js +2 -2
- package/dist/cjs/errors/phenomlError.d.ts +1 -0
- package/dist/cjs/errors/phenomlError.js +5 -1
- package/dist/cjs/errors/phenomlTimeoutError.d.ts +2 -2
- package/dist/cjs/errors/phenomlTimeoutError.js +40 -6
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +12 -0
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +6 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/resources/agent/client/Client.mjs +4 -3
- package/dist/esm/api/resources/agent/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/agent/errors/ConflictError.mjs +1 -1
- package/dist/esm/api/resources/agent/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/api/resources/agent/errors/GatewayTimeoutError.mjs +1 -1
- package/dist/esm/api/resources/agent/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/agent/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/resources/agent/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/agent/resources/chat/client/Client.mjs +3 -2
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +4 -3
- package/dist/esm/api/resources/authtoken/client/Client.mjs +2 -1
- package/dist/esm/api/resources/authtoken/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/authtoken/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/authtoken/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/cohort/client/Client.mjs +2 -1
- package/dist/esm/api/resources/cohort/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/cohort/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/cohort/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/construe/client/Client.mjs +2 -1
- package/dist/esm/api/resources/construe/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/ConflictError.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/FailedDependencyError.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/GatewayTimeoutError.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/NotImplementedError.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/ServiceUnavailableError.mjs +1 -1
- package/dist/esm/api/resources/construe/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/construe/resources/codeSystems/client/Client.mjs +2 -1
- package/dist/esm/api/resources/construe/resources/codeSystems/client/requests/DeleteRequest.d.mts +1 -1
- package/dist/esm/api/resources/construe/resources/codeSystems/client/requests/ExportRequest.d.mts +1 -1
- package/dist/esm/api/resources/construe/resources/codeSystems/client/requests/FindRequest.d.mts +1 -1
- package/dist/esm/api/resources/construe/resources/codes/client/Client.d.mts +47 -0
- package/dist/esm/api/resources/construe/resources/codes/client/Client.mjs +97 -1
- package/dist/esm/api/resources/construe/resources/codes/client/requests/CodesListRequest.d.mts +1 -1
- package/dist/esm/api/resources/construe/resources/codes/client/requests/ExtractRequest.d.mts +12 -0
- package/dist/esm/api/resources/construe/resources/codes/client/requests/LookupRequest.d.mts +1 -1
- package/dist/esm/api/resources/construe/resources/codes/client/requests/PhenoCrRequest.d.mts +16 -0
- package/dist/esm/api/resources/construe/resources/codes/client/requests/SearchSemanticRequest.d.mts +1 -1
- package/dist/esm/api/resources/construe/resources/codes/client/requests/SearchTextRequest.d.mts +1 -1
- package/dist/esm/api/resources/construe/resources/codes/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/construe/types/ExtractRequestSystem.d.mts +11 -8
- package/dist/esm/api/resources/construe/types/PhenocrExtractRequestSystem.d.mts +6 -0
- package/dist/esm/api/resources/construe/types/PhenocrExtractRequestSystem.mjs +2 -0
- package/dist/esm/api/resources/construe/types/index.d.mts +1 -0
- package/dist/esm/api/resources/construe/types/index.mjs +1 -0
- package/dist/esm/api/resources/fhir/client/Client.mjs +5 -4
- package/dist/esm/api/resources/fhir2Omop/client/Client.mjs +2 -1
- package/dist/esm/api/resources/fhir2Omop/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/fhir2Omop/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/fhir2Omop/errors/ServiceUnavailableError.mjs +1 -1
- package/dist/esm/api/resources/fhir2Omop/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/fhir2Omop/types/CareSiteRow.d.mts +8 -0
- package/dist/esm/api/resources/fhir2Omop/types/CareSiteRow.mjs +2 -0
- package/dist/esm/api/resources/fhir2Omop/types/ConditionOccurrenceRow.d.mts +1 -0
- package/dist/esm/api/resources/fhir2Omop/types/DeathRow.d.mts +9 -0
- package/dist/esm/api/resources/fhir2Omop/types/DeathRow.mjs +2 -0
- package/dist/esm/api/resources/fhir2Omop/types/DrugExposureRow.d.mts +1 -0
- package/dist/esm/api/resources/fhir2Omop/types/LocationRow.d.mts +14 -0
- package/dist/esm/api/resources/fhir2Omop/types/LocationRow.mjs +2 -0
- package/dist/esm/api/resources/fhir2Omop/types/MeasurementRow.d.mts +1 -0
- package/dist/esm/api/resources/fhir2Omop/types/ObservationPeriodRow.d.mts +7 -0
- package/dist/esm/api/resources/fhir2Omop/types/ObservationPeriodRow.mjs +2 -0
- package/dist/esm/api/resources/fhir2Omop/types/ObservationRow.d.mts +1 -0
- package/dist/esm/api/resources/fhir2Omop/types/OmopTables.d.mts +5 -0
- package/dist/esm/api/resources/fhir2Omop/types/PersonRow.d.mts +1 -0
- package/dist/esm/api/resources/fhir2Omop/types/ProcedureOccurrenceRow.d.mts +1 -0
- package/dist/esm/api/resources/fhir2Omop/types/ProviderRow.d.mts +15 -0
- package/dist/esm/api/resources/fhir2Omop/types/ProviderRow.mjs +2 -0
- package/dist/esm/api/resources/fhir2Omop/types/VisitOccurrenceRow.d.mts +2 -0
- package/dist/esm/api/resources/fhir2Omop/types/index.d.mts +5 -0
- package/dist/esm/api/resources/fhir2Omop/types/index.mjs +5 -0
- package/dist/esm/api/resources/fhirProvider/client/Client.mjs +2 -1
- package/dist/esm/api/resources/fhirProvider/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/fhirProvider/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/api/resources/fhirProvider/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/fhirProvider/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/resources/fhirProvider/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/fhirProvider/resources/authConfig/client/Client.mjs +4 -3
- package/dist/esm/api/resources/implementationGuides/client/Client.d.mts +12 -0
- package/dist/esm/api/resources/implementationGuides/client/Client.mjs +12 -0
- package/dist/esm/api/resources/implementationGuides/client/index.d.mts +1 -0
- package/dist/esm/api/resources/implementationGuides/client/index.mjs +1 -0
- package/dist/esm/api/resources/implementationGuides/errors/BadRequestError.d.mts +5 -0
- package/dist/esm/api/resources/implementationGuides/errors/BadRequestError.mjs +17 -0
- package/dist/esm/api/resources/implementationGuides/errors/ForbiddenError.d.mts +5 -0
- package/dist/esm/api/resources/implementationGuides/errors/ForbiddenError.mjs +17 -0
- package/dist/esm/api/resources/implementationGuides/errors/InternalServerError.d.mts +5 -0
- package/dist/esm/api/resources/implementationGuides/errors/InternalServerError.mjs +17 -0
- package/dist/esm/api/resources/implementationGuides/errors/NotFoundError.d.mts +5 -0
- package/dist/esm/api/resources/implementationGuides/errors/NotFoundError.mjs +17 -0
- package/dist/esm/api/resources/implementationGuides/errors/UnauthorizedError.d.mts +5 -0
- package/dist/esm/api/resources/implementationGuides/errors/UnauthorizedError.mjs +17 -0
- package/dist/esm/api/resources/implementationGuides/errors/index.d.mts +5 -0
- package/dist/esm/api/resources/implementationGuides/errors/index.mjs +5 -0
- package/dist/esm/api/resources/implementationGuides/exports.d.mts +3 -0
- package/dist/esm/api/resources/implementationGuides/exports.mjs +4 -0
- package/dist/esm/api/resources/implementationGuides/index.d.mts +4 -0
- package/dist/esm/api/resources/implementationGuides/index.mjs +4 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/client/Client.d.mts +91 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/client/Client.mjs +279 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/client/index.d.mts +1 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/client/index.mjs +1 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/client/requests/UpdateImplementationGuideRequest.d.mts +8 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/client/requests/UpdateImplementationGuideRequest.mjs +2 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/exports.d.mts +2 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/exports.mjs +3 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/index.d.mts +1 -0
- package/dist/esm/api/resources/implementationGuides/resources/implementationGuides/index.mjs +1 -0
- package/dist/esm/api/resources/implementationGuides/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/implementationGuides/resources/index.mjs +2 -0
- package/dist/esm/api/resources/implementationGuides/types/ImplementationGuideDetail.d.mts +5 -0
- package/dist/esm/api/resources/implementationGuides/types/ImplementationGuideDetail.mjs +2 -0
- package/dist/esm/api/resources/implementationGuides/types/ImplementationGuideListResponse.d.mts +4 -0
- package/dist/esm/api/resources/implementationGuides/types/ImplementationGuideListResponse.mjs +2 -0
- package/dist/esm/api/resources/implementationGuides/types/ImplementationGuideSummary.d.mts +15 -0
- package/dist/esm/api/resources/implementationGuides/types/ImplementationGuideSummary.mjs +2 -0
- package/dist/esm/api/resources/implementationGuides/types/index.d.mts +3 -0
- package/dist/esm/api/resources/implementationGuides/types/index.mjs +3 -0
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +8 -0
- package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +15 -6
- package/dist/esm/api/resources/lang2Fhir/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/lang2Fhir/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/lang2Fhir/errors/ClientClosedRequestError.mjs +1 -1
- package/dist/esm/api/resources/lang2Fhir/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/api/resources/lang2Fhir/errors/GatewayTimeoutError.mjs +1 -1
- package/dist/esm/api/resources/lang2Fhir/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/lang2Fhir/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/resources/lang2Fhir/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/lang2Fhir/errors/UnprocessableEntityError.mjs +1 -1
- package/dist/esm/api/resources/lang2Fhir/types/CreateMultiResponse.d.mts +2 -0
- package/dist/esm/api/resources/lang2Fhir/{client/requests → types}/ProfileUploadRequest.d.mts +2 -10
- package/dist/esm/api/resources/lang2Fhir/types/ProfileUploadRequest.mjs +2 -0
- package/dist/esm/api/resources/lang2Fhir/types/index.d.mts +1 -0
- package/dist/esm/api/resources/lang2Fhir/types/index.mjs +1 -0
- package/dist/esm/api/resources/profiles/client/Client.d.mts +12 -0
- package/dist/esm/api/resources/profiles/client/Client.mjs +12 -0
- package/dist/esm/api/resources/profiles/client/index.d.mts +1 -0
- package/dist/esm/api/resources/profiles/client/index.mjs +1 -0
- package/dist/esm/api/resources/profiles/errors/BadRequestError.d.mts +5 -0
- package/dist/esm/api/resources/profiles/errors/BadRequestError.mjs +17 -0
- package/dist/esm/api/resources/profiles/errors/ForbiddenError.d.mts +5 -0
- package/dist/esm/api/resources/profiles/errors/ForbiddenError.mjs +17 -0
- package/dist/esm/api/resources/profiles/errors/InternalServerError.d.mts +5 -0
- package/dist/esm/api/resources/profiles/errors/InternalServerError.mjs +17 -0
- package/dist/esm/api/resources/profiles/errors/NotFoundError.d.mts +5 -0
- package/dist/esm/api/resources/profiles/errors/NotFoundError.mjs +17 -0
- package/dist/esm/api/resources/profiles/errors/UnauthorizedError.d.mts +5 -0
- package/dist/esm/api/resources/profiles/errors/UnauthorizedError.mjs +17 -0
- package/dist/esm/api/resources/profiles/errors/index.d.mts +5 -0
- package/dist/esm/api/resources/profiles/errors/index.mjs +5 -0
- package/dist/esm/api/resources/profiles/exports.d.mts +3 -0
- package/dist/esm/api/resources/profiles/exports.mjs +4 -0
- package/dist/esm/api/resources/profiles/index.d.mts +4 -0
- package/dist/esm/api/resources/profiles/index.mjs +4 -0
- package/dist/esm/api/resources/profiles/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/profiles/resources/index.mjs +2 -0
- package/dist/esm/api/resources/profiles/resources/profiles/client/Client.d.mts +127 -0
- package/dist/esm/api/resources/profiles/resources/profiles/client/Client.mjs +360 -0
- package/dist/esm/api/resources/profiles/resources/profiles/client/index.d.mts +1 -0
- package/dist/esm/api/resources/profiles/resources/profiles/client/index.mjs +1 -0
- package/dist/esm/api/resources/profiles/resources/profiles/client/requests/ListRequest.d.mts +10 -0
- package/dist/esm/api/resources/profiles/resources/profiles/client/requests/ListRequest.mjs +2 -0
- package/dist/esm/api/resources/profiles/resources/profiles/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/profiles/resources/profiles/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/profiles/resources/profiles/exports.d.mts +2 -0
- package/dist/esm/api/resources/profiles/resources/profiles/exports.mjs +3 -0
- package/dist/esm/api/resources/profiles/resources/profiles/index.d.mts +1 -0
- package/dist/esm/api/resources/profiles/resources/profiles/index.mjs +1 -0
- package/dist/esm/api/resources/profiles/types/FhirResource.d.mts +4 -0
- package/dist/esm/api/resources/profiles/types/FhirResource.mjs +2 -0
- package/dist/esm/api/resources/profiles/types/ProfileGetResponse.d.mts +5 -0
- package/dist/esm/api/resources/profiles/types/ProfileGetResponse.mjs +2 -0
- package/dist/esm/api/resources/profiles/types/ProfileListResponse.d.mts +4 -0
- package/dist/esm/api/resources/profiles/types/ProfileListResponse.mjs +2 -0
- package/dist/esm/api/resources/profiles/types/ProfileSummary.d.mts +26 -0
- package/dist/esm/api/resources/profiles/types/ProfileSummary.mjs +9 -0
- package/dist/esm/api/resources/profiles/types/ProfileUploadRequest.d.mts +7 -0
- package/dist/esm/api/resources/profiles/types/ProfileUploadRequest.mjs +2 -0
- package/dist/esm/api/resources/profiles/types/index.d.mts +5 -0
- package/dist/esm/api/resources/profiles/types/index.mjs +5 -0
- package/dist/esm/api/resources/summary/client/Client.mjs +2 -1
- package/dist/esm/api/resources/summary/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/summary/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/api/resources/summary/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/summary/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/resources/summary/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/summary/resources/templates/client/Client.mjs +3 -2
- package/dist/esm/api/resources/tools/client/Client.mjs +5 -4
- package/dist/esm/api/resources/tools/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/tools/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/api/resources/tools/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/tools/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/resources/tools/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/tools/resources/mcpServers/client/Client.mjs +2 -1
- package/dist/esm/api/resources/voice/errors/BadGatewayError.mjs +1 -1
- package/dist/esm/api/resources/voice/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/voice/errors/ContentTooLargeError.mjs +1 -1
- package/dist/esm/api/resources/voice/errors/GatewayTimeoutError.mjs +1 -1
- package/dist/esm/api/resources/voice/errors/PaymentRequiredError.mjs +1 -1
- package/dist/esm/api/resources/voice/errors/ServiceUnavailableError.mjs +1 -1
- package/dist/esm/api/resources/voice/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/resources/workflows/client/Client.mjs +4 -3
- package/dist/esm/api/resources/workflows/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/resources/workflows/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/api/resources/workflows/errors/GatewayTimeoutError.mjs +1 -1
- package/dist/esm/api/resources/workflows/errors/InternalServerError.mjs +1 -1
- package/dist/esm/api/resources/workflows/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/resources/workflows/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/core/file/file.mjs +3 -0
- package/dist/esm/core/requestBody.d.mts +12 -0
- package/dist/esm/core/requestBody.mjs +23 -0
- package/dist/esm/core/stream/Stream.d.mts +45 -1
- package/dist/esm/core/stream/Stream.mjs +323 -84
- package/dist/esm/core/stream/index.d.mts +1 -0
- package/dist/esm/core/url/qs.mjs +2 -2
- package/dist/esm/errors/phenomlError.d.mts +1 -0
- package/dist/esm/errors/phenomlError.mjs +5 -1
- package/dist/esm/errors/phenomlTimeoutError.d.mts +2 -2
- package/dist/esm/errors/phenomlTimeoutError.mjs +7 -6
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/openapi/openapi.json +1224 -150
- package/package.json +23 -1
- package/reference.md +772 -71
- /package/dist/cjs/api/resources/{lang2Fhir/client/requests/ProfileUploadRequest.js → construe/resources/codes/client/requests/PhenoCrRequest.js} +0 -0
- /package/dist/esm/api/resources/{lang2Fhir/client/requests/ProfileUploadRequest.mjs → construe/resources/codes/client/requests/PhenoCrRequest.mjs} +0 -0
|
@@ -36,8 +36,14 @@ import { fromJson } from "../json.mjs";
|
|
|
36
36
|
import { RUNTIME } from "../runtime/index.mjs";
|
|
37
37
|
const DATA_PREFIX = "data:";
|
|
38
38
|
const EVENT_PREFIX = "event:";
|
|
39
|
+
const ID_PREFIX = "id:";
|
|
40
|
+
const RETRY_PREFIX = "retry:";
|
|
41
|
+
const DEFAULT_MAX_RECONNECTION_ATTEMPTS = 5;
|
|
42
|
+
const DEFAULT_RECONNECT_DELAY_MS = 1000;
|
|
43
|
+
const MAX_RECONNECT_DELAY_MS = 30000;
|
|
39
44
|
export class Stream {
|
|
40
|
-
constructor({ stream, parse, eventShape, signal }) {
|
|
45
|
+
constructor({ stream, parse, eventShape, signal, reconnectionEnabled, maxReconnectionAttempts, reconnect, }) {
|
|
46
|
+
var _a;
|
|
41
47
|
this.controller = new AbortController();
|
|
42
48
|
this.stream = stream;
|
|
43
49
|
this.parse = parse;
|
|
@@ -46,11 +52,20 @@ export class Stream {
|
|
|
46
52
|
this.messageTerminator = "\n";
|
|
47
53
|
this.streamTerminator = eventShape.streamTerminator;
|
|
48
54
|
this.eventDiscriminator = eventShape.eventDiscriminator;
|
|
55
|
+
this.resumable = (_a = eventShape.resumable) !== null && _a !== void 0 ? _a : false;
|
|
49
56
|
}
|
|
50
57
|
else {
|
|
51
58
|
this.messageTerminator = eventShape.messageTerminator;
|
|
59
|
+
this.resumable = false;
|
|
60
|
+
}
|
|
61
|
+
this.reconnectionEnabled = reconnectionEnabled !== null && reconnectionEnabled !== void 0 ? reconnectionEnabled : true;
|
|
62
|
+
this.maxReconnectionAttempts = maxReconnectionAttempts !== null && maxReconnectionAttempts !== void 0 ? maxReconnectionAttempts : DEFAULT_MAX_RECONNECTION_ATTEMPTS;
|
|
63
|
+
this.reconnect = reconnect;
|
|
64
|
+
if (signal != null) {
|
|
65
|
+
this.externalSignal = signal;
|
|
66
|
+
this.onExternalAbort = () => this.controller.abort();
|
|
67
|
+
signal.addEventListener("abort", this.onExternalAbort, { once: true });
|
|
52
68
|
}
|
|
53
|
-
signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", () => this.controller.abort());
|
|
54
69
|
// Initialize shared TextDecoder
|
|
55
70
|
if (typeof TextDecoder !== "undefined") {
|
|
56
71
|
this.decoder = new TextDecoder("utf-8");
|
|
@@ -69,98 +84,227 @@ export class Stream {
|
|
|
69
84
|
iterDataMessages() {
|
|
70
85
|
return __asyncGenerator(this, arguments, function* iterDataMessages_1() {
|
|
71
86
|
var _a, e_1, _b, _c;
|
|
72
|
-
|
|
73
|
-
let
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
let reconnectAttempts = 0;
|
|
88
|
+
let currentStream = this.stream;
|
|
89
|
+
let lastId;
|
|
90
|
+
// The id of the most recently *dispatched* event. Per the WHATWG
|
|
91
|
+
// EventSource spec, the "last event ID" is only committed when an event
|
|
92
|
+
// is dispatched, not when the `id:` line is parsed. Reconnecting with a
|
|
93
|
+
// parsed-but-undispatched id would skip an event that was never yielded
|
|
94
|
+
// (e.g. if the connection drops after `id:` but before the event's
|
|
95
|
+
// terminating blank line), so reconnection uses lastDispatchedId.
|
|
96
|
+
let lastDispatchedId;
|
|
97
|
+
let lastRetry;
|
|
98
|
+
while (true) {
|
|
99
|
+
const stream = readableStreamAsyncIterable(currentStream);
|
|
100
|
+
let buf = "";
|
|
101
|
+
let dataValue;
|
|
102
|
+
try {
|
|
103
|
+
for (var _d = true, stream_1 = (e_1 = void 0, __asyncValues(stream)), stream_1_1; stream_1_1 = yield __await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) {
|
|
104
|
+
_c = stream_1_1.value;
|
|
105
|
+
_d = false;
|
|
106
|
+
const chunk = _c;
|
|
107
|
+
buf += this.decodeChunk(chunk);
|
|
108
|
+
let terminatorIndex;
|
|
109
|
+
while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) {
|
|
110
|
+
const line = buf.slice(0, terminatorIndex);
|
|
111
|
+
buf = buf.slice(terminatorIndex + this.messageTerminator.length);
|
|
112
|
+
if (!line.trim()) {
|
|
113
|
+
if (this.prefix != null && dataValue != null) {
|
|
114
|
+
if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) {
|
|
115
|
+
return yield __await(void 0);
|
|
116
|
+
}
|
|
117
|
+
const data = yield __await(this.parse(fromJson(dataValue)));
|
|
118
|
+
yield yield __await({ data, id: lastId, retry: lastRetry, event: undefined });
|
|
119
|
+
lastDispatchedId = lastId;
|
|
120
|
+
reconnectAttempts = 0;
|
|
121
|
+
dataValue = undefined;
|
|
122
|
+
}
|
|
91
123
|
continue;
|
|
92
124
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
125
|
+
if (line.startsWith(ID_PREFIX)) {
|
|
126
|
+
const idValue = line.slice(ID_PREFIX.length).trim();
|
|
127
|
+
if (!idValue.includes("\0")) {
|
|
128
|
+
lastId = idValue;
|
|
129
|
+
}
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (line.startsWith(RETRY_PREFIX)) {
|
|
133
|
+
const retryValue = line.slice(RETRY_PREFIX.length).trim();
|
|
134
|
+
const parsed = parseInt(retryValue, 10);
|
|
135
|
+
if (!Number.isNaN(parsed) && String(parsed) === retryValue) {
|
|
136
|
+
lastRetry = parsed;
|
|
137
|
+
}
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (this.prefix != null) {
|
|
141
|
+
const prefixIndex = line.indexOf(this.prefix);
|
|
142
|
+
if (prefixIndex === -1) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const val = line.slice(prefixIndex + this.prefix.length).trim();
|
|
146
|
+
dataValue = dataValue != null ? `${dataValue}\n${val}` : val;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
if (this.streamTerminator != null && line.includes(this.streamTerminator)) {
|
|
150
|
+
return yield __await(void 0);
|
|
151
|
+
}
|
|
152
|
+
const data = yield __await(this.parse(fromJson(line)));
|
|
153
|
+
yield yield __await({ data, id: lastId, retry: lastRetry, event: undefined });
|
|
154
|
+
lastDispatchedId = lastId;
|
|
155
|
+
reconnectAttempts = 0;
|
|
156
|
+
}
|
|
98
157
|
}
|
|
99
|
-
const message = yield __await(this.parse(fromJson(line)));
|
|
100
|
-
yield yield __await(message);
|
|
101
|
-
prefixSeen = false;
|
|
102
158
|
}
|
|
103
159
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
160
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
161
|
+
finally {
|
|
162
|
+
try {
|
|
163
|
+
if (!_d && !_a && (_b = stream_1.return)) yield __await(_b.call(stream_1));
|
|
164
|
+
}
|
|
165
|
+
finally { if (e_1) throw e_1.error; }
|
|
166
|
+
}
|
|
167
|
+
if (this.prefix != null && dataValue != null) {
|
|
168
|
+
if (this.streamTerminator != null && dataValue.includes(this.streamTerminator)) {
|
|
169
|
+
return yield __await(void 0);
|
|
170
|
+
}
|
|
171
|
+
const data = yield __await(this.parse(fromJson(dataValue)));
|
|
172
|
+
yield yield __await({ data, id: lastId, retry: lastRetry, event: undefined });
|
|
173
|
+
lastDispatchedId = lastId;
|
|
174
|
+
reconnectAttempts = 0;
|
|
175
|
+
}
|
|
176
|
+
if (!this.shouldReconnect(lastDispatchedId, reconnectAttempts)) {
|
|
177
|
+
return yield __await(void 0);
|
|
178
|
+
}
|
|
179
|
+
reconnectAttempts++;
|
|
180
|
+
yield __await(this.delayReconnect(lastRetry));
|
|
181
|
+
if (this.controller.signal.aborted) {
|
|
182
|
+
return yield __await(void 0);
|
|
183
|
+
}
|
|
184
|
+
// Re-check after async delay; needed for TypeScript narrowing.
|
|
185
|
+
const reconnectFn = this.reconnect;
|
|
186
|
+
if (reconnectFn == null || lastDispatchedId == null) {
|
|
187
|
+
return yield __await(void 0);
|
|
188
|
+
}
|
|
107
189
|
try {
|
|
108
|
-
|
|
190
|
+
const reconnected = yield __await(reconnectFn(lastDispatchedId));
|
|
191
|
+
if (reconnected == null) {
|
|
192
|
+
currentStream = this.createEmptyStream();
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
currentStream = reconnected;
|
|
196
|
+
}
|
|
197
|
+
catch (_e) {
|
|
198
|
+
// Failed reconnect (e.g. HTTP error); assign an empty stream
|
|
199
|
+
// so the next iteration is a safe no-op before shouldReconnect.
|
|
200
|
+
currentStream = this.createEmptyStream();
|
|
109
201
|
}
|
|
110
|
-
finally { if (e_1) throw e_1.error; }
|
|
111
202
|
}
|
|
112
203
|
});
|
|
113
204
|
}
|
|
114
205
|
iterSseEvents() {
|
|
115
206
|
return __asyncGenerator(this, arguments, function* iterSseEvents_1() {
|
|
116
207
|
var _a, e_2, _b, _c;
|
|
117
|
-
|
|
118
|
-
let
|
|
119
|
-
let
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
208
|
+
let reconnectAttempts = 0;
|
|
209
|
+
let currentStream = this.stream;
|
|
210
|
+
let lastId;
|
|
211
|
+
// See iterDataMessages: reconnection uses the last *dispatched* id (per
|
|
212
|
+
// the EventSource spec), not the last *parsed* id, to avoid skipping an
|
|
213
|
+
// event that was never yielded when a drop lands mid-event.
|
|
214
|
+
let lastDispatchedId;
|
|
215
|
+
let lastRetry;
|
|
216
|
+
while (true) {
|
|
217
|
+
const stream = readableStreamAsyncIterable(currentStream);
|
|
218
|
+
let buf = "";
|
|
219
|
+
let eventType;
|
|
220
|
+
let dataValue;
|
|
221
|
+
try {
|
|
222
|
+
for (var _d = true, stream_2 = (e_2 = void 0, __asyncValues(stream)), stream_2_1; stream_2_1 = yield __await(stream_2.next()), _a = stream_2_1.done, !_a; _d = true) {
|
|
223
|
+
_c = stream_2_1.value;
|
|
224
|
+
_d = false;
|
|
225
|
+
const chunk = _c;
|
|
226
|
+
buf += this.decodeChunk(chunk);
|
|
227
|
+
let terminatorIndex;
|
|
228
|
+
while ((terminatorIndex = buf.indexOf("\n")) >= 0) {
|
|
229
|
+
const line = buf.slice(0, terminatorIndex).replace(/\r$/, "");
|
|
230
|
+
buf = buf.slice(terminatorIndex + 1);
|
|
231
|
+
if (!line.trim()) {
|
|
232
|
+
if (dataValue != null) {
|
|
233
|
+
const data = yield __await(this.dispatchSseEvent(dataValue, eventType));
|
|
234
|
+
if (data == null) {
|
|
235
|
+
return yield __await(void 0);
|
|
236
|
+
}
|
|
237
|
+
yield yield __await({ data, id: lastId, retry: lastRetry, event: eventType });
|
|
238
|
+
lastDispatchedId = lastId;
|
|
239
|
+
reconnectAttempts = 0;
|
|
240
|
+
}
|
|
241
|
+
eventType = undefined;
|
|
242
|
+
dataValue = undefined;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
if (line.startsWith(EVENT_PREFIX)) {
|
|
246
|
+
eventType = line.slice(EVENT_PREFIX.length).trim();
|
|
247
|
+
}
|
|
248
|
+
else if (line.startsWith(DATA_PREFIX)) {
|
|
249
|
+
const val = line.slice(DATA_PREFIX.length).trim();
|
|
250
|
+
dataValue = dataValue != null ? `${dataValue}\n${val}` : val;
|
|
251
|
+
}
|
|
252
|
+
else if (line.startsWith(ID_PREFIX)) {
|
|
253
|
+
const idValue = line.slice(ID_PREFIX.length).trim();
|
|
254
|
+
if (!idValue.includes("\0")) {
|
|
255
|
+
lastId = idValue;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
else if (line.startsWith(RETRY_PREFIX)) {
|
|
259
|
+
const retryValue = line.slice(RETRY_PREFIX.length).trim();
|
|
260
|
+
const parsed = parseInt(retryValue, 10);
|
|
261
|
+
if (!Number.isNaN(parsed) && String(parsed) === retryValue) {
|
|
262
|
+
lastRetry = parsed;
|
|
136
263
|
}
|
|
137
|
-
yield yield __await(message);
|
|
138
264
|
}
|
|
139
|
-
eventType = undefined;
|
|
140
|
-
dataValue = undefined;
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
if (line.startsWith(EVENT_PREFIX)) {
|
|
144
|
-
eventType = line.slice(EVENT_PREFIX.length).trim();
|
|
145
|
-
}
|
|
146
|
-
else if (line.startsWith(DATA_PREFIX)) {
|
|
147
|
-
const val = line.slice(DATA_PREFIX.length).trim();
|
|
148
|
-
dataValue = dataValue != null ? `${dataValue}\n${val}` : val;
|
|
149
265
|
}
|
|
150
266
|
}
|
|
151
267
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
268
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
269
|
+
finally {
|
|
270
|
+
try {
|
|
271
|
+
if (!_d && !_a && (_b = stream_2.return)) yield __await(_b.call(stream_2));
|
|
272
|
+
}
|
|
273
|
+
finally { if (e_2) throw e_2.error; }
|
|
274
|
+
}
|
|
275
|
+
if (dataValue != null) {
|
|
276
|
+
const data = yield __await(this.dispatchSseEvent(dataValue, eventType));
|
|
277
|
+
if (data != null) {
|
|
278
|
+
yield yield __await({ data, id: lastId, retry: lastRetry, event: eventType });
|
|
279
|
+
lastDispatchedId = lastId;
|
|
280
|
+
reconnectAttempts = 0;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (!this.shouldReconnect(lastDispatchedId, reconnectAttempts)) {
|
|
284
|
+
return yield __await(void 0);
|
|
285
|
+
}
|
|
286
|
+
reconnectAttempts++;
|
|
287
|
+
yield __await(this.delayReconnect(lastRetry));
|
|
288
|
+
if (this.controller.signal.aborted) {
|
|
289
|
+
return yield __await(void 0);
|
|
290
|
+
}
|
|
291
|
+
// Re-check after async delay; needed for TypeScript narrowing.
|
|
292
|
+
const reconnectFn = this.reconnect;
|
|
293
|
+
if (reconnectFn == null || lastDispatchedId == null) {
|
|
294
|
+
return yield __await(void 0);
|
|
295
|
+
}
|
|
155
296
|
try {
|
|
156
|
-
|
|
297
|
+
const reconnected = yield __await(reconnectFn(lastDispatchedId));
|
|
298
|
+
if (reconnected == null) {
|
|
299
|
+
currentStream = this.createEmptyStream();
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
currentStream = reconnected;
|
|
157
303
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (message != null) {
|
|
163
|
-
yield yield __await(message);
|
|
304
|
+
catch (_e) {
|
|
305
|
+
// Failed reconnect (e.g. HTTP error); assign an empty stream
|
|
306
|
+
// so the next iteration is a safe no-op before shouldReconnect.
|
|
307
|
+
currentStream = this.createEmptyStream();
|
|
164
308
|
}
|
|
165
309
|
}
|
|
166
310
|
});
|
|
@@ -176,6 +320,96 @@ export class Stream {
|
|
|
176
320
|
return this.parse(this.injectDiscriminator(fromJson(dataValue), eventType));
|
|
177
321
|
});
|
|
178
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Determines whether a reconnection attempt should be made.
|
|
325
|
+
*/
|
|
326
|
+
shouldReconnect(lastId, reconnectAttempts) {
|
|
327
|
+
if (!this.resumable) {
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
if (this.streamTerminator == null) {
|
|
331
|
+
// Without a terminator the client cannot distinguish a completed
|
|
332
|
+
// stream from a dropped connection, so reconnection is disabled.
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
// NOTE: When a terminator IS configured but the server never sends it
|
|
336
|
+
// (e.g. it drops the connection after emitting events every time),
|
|
337
|
+
// maxReconnectionAttempts is a per-consecutive-failure cap — each
|
|
338
|
+
// yielded event resets the counter. This matches EventSource semantics
|
|
339
|
+
// but means such a server can cause unbounded reconnections. Callers
|
|
340
|
+
// concerned about this should impose a wall-clock budget externally.
|
|
341
|
+
if (!this.reconnectionEnabled) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
if (this.reconnect == null) {
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
if (lastId == null || lastId === "") {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
if (reconnectAttempts >= this.maxReconnectionAttempts) {
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
if (this.controller.signal.aborted) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Delays before reconnecting, using a server-sent retry directive if provided
|
|
360
|
+
* (clamped to MAX_RECONNECT_DELAY_MS), otherwise falling back to
|
|
361
|
+
* DEFAULT_RECONNECT_DELAY_MS. The delay is abortable: if the stream's abort
|
|
362
|
+
* signal fires during the wait, the promise resolves immediately.
|
|
363
|
+
*/
|
|
364
|
+
delayReconnect(lastRetry) {
|
|
365
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
366
|
+
const base = lastRetry != null && lastRetry > 0 ? lastRetry : DEFAULT_RECONNECT_DELAY_MS;
|
|
367
|
+
const delay = Math.min(base, MAX_RECONNECT_DELAY_MS);
|
|
368
|
+
const signal = this.controller.signal;
|
|
369
|
+
if (signal.aborted) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
yield new Promise((resolve) => {
|
|
373
|
+
const timer = setTimeout(() => {
|
|
374
|
+
signal.removeEventListener("abort", onAbort);
|
|
375
|
+
resolve();
|
|
376
|
+
}, delay);
|
|
377
|
+
const onAbort = () => {
|
|
378
|
+
clearTimeout(timer);
|
|
379
|
+
resolve();
|
|
380
|
+
};
|
|
381
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
createEmptyStream() {
|
|
386
|
+
return new ReadableStream({
|
|
387
|
+
start(controller) {
|
|
388
|
+
controller.close();
|
|
389
|
+
},
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
removeAbortListener() {
|
|
393
|
+
if (this.externalSignal != null && this.onExternalAbort != null) {
|
|
394
|
+
this.externalSignal.removeEventListener("abort", this.onExternalAbort);
|
|
395
|
+
this.onExternalAbort = undefined;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
withMetadata() {
|
|
399
|
+
const self = this;
|
|
400
|
+
return {
|
|
401
|
+
[Symbol.asyncIterator]() {
|
|
402
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
403
|
+
try {
|
|
404
|
+
yield __await(yield* __asyncDelegator(__asyncValues(self.iterMessages())));
|
|
405
|
+
}
|
|
406
|
+
finally {
|
|
407
|
+
self.removeAbortListener();
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
},
|
|
411
|
+
};
|
|
412
|
+
}
|
|
179
413
|
injectDiscriminator(parsed, eventType) {
|
|
180
414
|
if (this.eventDiscriminator == null || eventType == null) {
|
|
181
415
|
return parsed;
|
|
@@ -193,19 +427,24 @@ export class Stream {
|
|
|
193
427
|
return __asyncGenerator(this, arguments, function* _a() {
|
|
194
428
|
var _b, e_3, _c, _d;
|
|
195
429
|
try {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
430
|
+
try {
|
|
431
|
+
for (var _e = true, _f = __asyncValues(this.iterMessages()), _g; _g = yield __await(_f.next()), _b = _g.done, !_b; _e = true) {
|
|
432
|
+
_d = _g.value;
|
|
433
|
+
_e = false;
|
|
434
|
+
const event = _d;
|
|
435
|
+
yield yield __await(event.data);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
439
|
+
finally {
|
|
440
|
+
try {
|
|
441
|
+
if (!_e && !_b && (_c = _f.return)) yield __await(_c.call(_f));
|
|
442
|
+
}
|
|
443
|
+
finally { if (e_3) throw e_3.error; }
|
|
201
444
|
}
|
|
202
445
|
}
|
|
203
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
204
446
|
finally {
|
|
205
|
-
|
|
206
|
-
if (!_e && !_b && (_c = _f.return)) yield __await(_c.call(_f));
|
|
207
|
-
}
|
|
208
|
-
finally { if (e_3) throw e_3.error; }
|
|
447
|
+
this.removeAbortListener();
|
|
209
448
|
}
|
|
210
449
|
});
|
|
211
450
|
}
|
package/dist/esm/core/url/qs.mjs
CHANGED
|
@@ -16,7 +16,7 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
16
16
|
const parts = [];
|
|
17
17
|
for (const [key, value] of Object.entries(obj)) {
|
|
18
18
|
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
19
|
-
if (value
|
|
19
|
+
if (value == null) {
|
|
20
20
|
continue;
|
|
21
21
|
}
|
|
22
22
|
if (Array.isArray(value)) {
|
|
@@ -36,7 +36,7 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
36
36
|
else {
|
|
37
37
|
for (let i = 0; i < value.length; i++) {
|
|
38
38
|
const item = value[i];
|
|
39
|
-
if (item
|
|
39
|
+
if (item == null) {
|
|
40
40
|
continue;
|
|
41
41
|
}
|
|
42
42
|
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
@@ -7,7 +7,7 @@ export class phenomlError extends Error {
|
|
|
7
7
|
if (Error.captureStackTrace) {
|
|
8
8
|
Error.captureStackTrace(this, this.constructor);
|
|
9
9
|
}
|
|
10
|
-
this.name =
|
|
10
|
+
this.name = "phenomlError";
|
|
11
11
|
this.statusCode = statusCode;
|
|
12
12
|
this.body = body;
|
|
13
13
|
this.rawResponse = rawResponse;
|
|
@@ -15,6 +15,10 @@ export class phenomlError extends Error {
|
|
|
15
15
|
this.cause = cause;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
get requestId() {
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
return (_c = (_b = (_a = this.rawResponse) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.get("x-request-id")) !== null && _c !== void 0 ? _c : undefined;
|
|
21
|
+
}
|
|
18
22
|
}
|
|
19
23
|
function buildMessage({ message, statusCode, body, }) {
|
|
20
24
|
const lines = [];
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
2
|
+
import * as errors from "./index.mjs";
|
|
3
|
+
export class phenomlTimeoutError extends errors.phenomlError {
|
|
3
4
|
constructor(message, opts) {
|
|
4
|
-
super(
|
|
5
|
+
super({
|
|
6
|
+
message: message,
|
|
7
|
+
cause: opts === null || opts === void 0 ? void 0 : opts.cause,
|
|
8
|
+
});
|
|
5
9
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
6
10
|
if (Error.captureStackTrace) {
|
|
7
11
|
Error.captureStackTrace(this, this.constructor);
|
|
8
12
|
}
|
|
9
|
-
this.name =
|
|
10
|
-
if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
|
|
11
|
-
this.cause = opts.cause;
|
|
12
|
-
}
|
|
13
|
+
this.name = "phenomlTimeoutError";
|
|
13
14
|
}
|
|
14
15
|
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "17.
|
|
1
|
+
export declare const SDK_VERSION = "17.9.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "17.
|
|
1
|
+
export const SDK_VERSION = "17.9.0";
|