@opengovsg/refx-ts-sdk 0.0.0-develop-1746623964
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/Client.d.ts +49 -0
- package/Client.js +47 -0
- package/README.md +176 -0
- package/api/errors/BadRequestError.d.ts +8 -0
- package/api/errors/BadRequestError.js +51 -0
- package/api/errors/NotFoundError.d.ts +7 -0
- package/api/errors/NotFoundError.js +51 -0
- package/api/errors/UnauthorizedError.d.ts +7 -0
- package/api/errors/UnauthorizedError.js +51 -0
- package/api/errors/index.d.ts +3 -0
- package/api/errors/index.js +19 -0
- package/api/index.d.ts +3 -0
- package/api/index.js +19 -0
- package/api/resources/eligibility/client/Client.d.ts +45 -0
- package/api/resources/eligibility/client/Client.js +136 -0
- package/api/resources/eligibility/client/index.d.ts +1 -0
- package/api/resources/eligibility/client/index.js +17 -0
- package/api/resources/eligibility/client/requests/EligibilityGetRequest.d.ts +30 -0
- package/api/resources/eligibility/client/requests/EligibilityGetRequest.js +5 -0
- package/api/resources/eligibility/client/requests/index.d.ts +1 -0
- package/api/resources/eligibility/client/requests/index.js +2 -0
- package/api/resources/eligibility/index.d.ts +1 -0
- package/api/resources/eligibility/index.js +17 -0
- package/api/resources/health/client/Client.d.ts +39 -0
- package/api/resources/health/client/Client.js +110 -0
- package/api/resources/health/client/index.d.ts +1 -0
- package/api/resources/health/client/index.js +2 -0
- package/api/resources/health/index.d.ts +1 -0
- package/api/resources/health/index.js +17 -0
- package/api/resources/index.d.ts +12 -0
- package/api/resources/index.js +51 -0
- package/api/resources/notes/client/Client.d.ts +45 -0
- package/api/resources/notes/client/Client.js +123 -0
- package/api/resources/notes/client/index.d.ts +1 -0
- package/api/resources/notes/client/index.js +17 -0
- package/api/resources/notes/client/requests/CreateNoteReq.d.ts +15 -0
- package/api/resources/notes/client/requests/CreateNoteReq.js +5 -0
- package/api/resources/notes/client/requests/index.d.ts +1 -0
- package/api/resources/notes/client/requests/index.js +2 -0
- package/api/resources/notes/index.d.ts +1 -0
- package/api/resources/notes/index.js +17 -0
- package/api/resources/offerings/client/Client.d.ts +56 -0
- package/api/resources/offerings/client/Client.js +191 -0
- package/api/resources/offerings/client/index.d.ts +1 -0
- package/api/resources/offerings/client/index.js +17 -0
- package/api/resources/offerings/client/requests/OfferingsListRequest.d.ts +19 -0
- package/api/resources/offerings/client/requests/OfferingsListRequest.js +5 -0
- package/api/resources/offerings/client/requests/OfferingsListTimeslotsRequest.d.ts +14 -0
- package/api/resources/offerings/client/requests/OfferingsListTimeslotsRequest.js +5 -0
- package/api/resources/offerings/client/requests/index.d.ts +2 -0
- package/api/resources/offerings/client/requests/index.js +2 -0
- package/api/resources/offerings/index.d.ts +1 -0
- package/api/resources/offerings/index.js +17 -0
- package/api/resources/public/client/Client.d.ts +43 -0
- package/api/resources/public/client/Client.js +131 -0
- package/api/resources/public/client/index.d.ts +1 -0
- package/api/resources/public/client/index.js +17 -0
- package/api/resources/public/client/requests/PublicGetReferralRequest.d.ts +11 -0
- package/api/resources/public/client/requests/PublicGetReferralRequest.js +5 -0
- package/api/resources/public/client/requests/index.d.ts +1 -0
- package/api/resources/public/client/requests/index.js +2 -0
- package/api/resources/public/index.d.ts +1 -0
- package/api/resources/public/index.js +17 -0
- package/api/resources/referrals/client/Client.d.ts +158 -0
- package/api/resources/referrals/client/Client.js +604 -0
- package/api/resources/referrals/client/index.d.ts +1 -0
- package/api/resources/referrals/client/index.js +17 -0
- package/api/resources/referrals/client/requests/AcceptReferralBody.d.ts +13 -0
- package/api/resources/referrals/client/requests/AcceptReferralBody.js +5 -0
- package/api/resources/referrals/client/requests/AmendReferralReq.d.ts +13 -0
- package/api/resources/referrals/client/requests/AmendReferralReq.js +5 -0
- package/api/resources/referrals/client/requests/CancelReferralReq.d.ts +13 -0
- package/api/resources/referrals/client/requests/CancelReferralReq.js +5 -0
- package/api/resources/referrals/client/requests/CreateReferralReq.d.ts +57 -0
- package/api/resources/referrals/client/requests/CreateReferralReq.js +5 -0
- package/api/resources/referrals/client/requests/ReferralsGetRequest.d.ts +11 -0
- package/api/resources/referrals/client/requests/ReferralsGetRequest.js +5 -0
- package/api/resources/referrals/client/requests/ReferralsListRequest.d.ts +29 -0
- package/api/resources/referrals/client/requests/ReferralsListRequest.js +5 -0
- package/api/resources/referrals/client/requests/RejectReferralBody.d.ts +13 -0
- package/api/resources/referrals/client/requests/RejectReferralBody.js +5 -0
- package/api/resources/referrals/client/requests/index.d.ts +7 -0
- package/api/resources/referrals/client/requests/index.js +2 -0
- package/api/resources/referrals/index.d.ts +1 -0
- package/api/resources/referrals/index.js +17 -0
- package/api/resources/webhooks/client/Client.d.ts +46 -0
- package/api/resources/webhooks/client/Client.js +154 -0
- package/api/resources/webhooks/client/index.d.ts +1 -0
- package/api/resources/webhooks/client/index.js +2 -0
- package/api/resources/webhooks/index.d.ts +1 -0
- package/api/resources/webhooks/index.js +17 -0
- package/api/types/AdditionalReferralField.d.ts +8 -0
- package/api/types/AdditionalReferralField.js +10 -0
- package/api/types/AttachmentDto.d.ts +8 -0
- package/api/types/AttachmentDto.js +5 -0
- package/api/types/BadRequestErrorBody.d.ts +8 -0
- package/api/types/BadRequestErrorBody.js +5 -0
- package/api/types/CreatePatientReq.d.ts +16 -0
- package/api/types/CreatePatientReq.js +5 -0
- package/api/types/CreatePatientReqGender.d.ts +11 -0
- package/api/types/CreatePatientReqGender.js +10 -0
- package/api/types/CreateReferralFormReq.d.ts +9 -0
- package/api/types/CreateReferralFormReq.js +5 -0
- package/api/types/EligibilityRes.d.ts +9 -0
- package/api/types/EligibilityRes.js +5 -0
- package/api/types/Form.d.ts +11 -0
- package/api/types/Form.js +5 -0
- package/api/types/FormMetadata.d.ts +17 -0
- package/api/types/FormMetadata.js +5 -0
- package/api/types/FormResponse.d.ts +9 -0
- package/api/types/FormResponse.js +5 -0
- package/api/types/FormResponseAnswer.d.ts +4 -0
- package/api/types/FormResponseAnswer.js +5 -0
- package/api/types/FullReferralDto.d.ts +26 -0
- package/api/types/FullReferralDto.js +5 -0
- package/api/types/FullReferralDtoStatus.d.ts +25 -0
- package/api/types/FullReferralDtoStatus.js +27 -0
- package/api/types/GetReferralPatientDto.d.ts +18 -0
- package/api/types/GetReferralPatientDto.js +5 -0
- package/api/types/GetReferralPatientDtoGender.d.ts +11 -0
- package/api/types/GetReferralPatientDtoGender.js +10 -0
- package/api/types/InstitutionCoreDto.d.ts +13 -0
- package/api/types/InstitutionCoreDto.js +5 -0
- package/api/types/NotFoundErrorBody.d.ts +8 -0
- package/api/types/NotFoundErrorBody.js +5 -0
- package/api/types/NoteDto.d.ts +11 -0
- package/api/types/NoteDto.js +5 -0
- package/api/types/OfferingDto.d.ts +19 -0
- package/api/types/OfferingDto.js +5 -0
- package/api/types/OfferingWithAllowedDto.d.ts +21 -0
- package/api/types/OfferingWithAllowedDto.js +5 -0
- package/api/types/OkResponse.d.ts +6 -0
- package/api/types/OkResponse.js +5 -0
- package/api/types/PaginatedQuery.d.ts +9 -0
- package/api/types/PaginatedQuery.js +5 -0
- package/api/types/PaginatedReferralsDto.d.ts +8 -0
- package/api/types/PaginatedReferralsDto.js +5 -0
- package/api/types/PaginationMetadata.d.ts +9 -0
- package/api/types/PaginationMetadata.js +5 -0
- package/api/types/PublicReferralDto.d.ts +21 -0
- package/api/types/PublicReferralDto.js +5 -0
- package/api/types/ReferralDto.d.ts +25 -0
- package/api/types/ReferralDto.js +5 -0
- package/api/types/ReferralDtoStatus.d.ts +25 -0
- package/api/types/ReferralDtoStatus.js +27 -0
- package/api/types/ReferralEligibility.d.ts +8 -0
- package/api/types/ReferralEligibility.js +5 -0
- package/api/types/ReferralRole.d.ts +8 -0
- package/api/types/ReferralRole.js +10 -0
- package/api/types/ReferralStatusFilter.d.ts +11 -0
- package/api/types/ReferralStatusFilter.js +13 -0
- package/api/types/ReferrerIdType.d.ts +7 -0
- package/api/types/ReferrerIdType.js +5 -0
- package/api/types/ReferringDoctorDto.d.ts +9 -0
- package/api/types/ReferringDoctorDto.js +5 -0
- package/api/types/SubsidyEligibility.d.ts +10 -0
- package/api/types/SubsidyEligibility.js +5 -0
- package/api/types/SubsidyEligibilityScheme.d.ts +9 -0
- package/api/types/SubsidyEligibilityScheme.js +11 -0
- package/api/types/System.d.ts +12 -0
- package/api/types/System.js +14 -0
- package/api/types/TimelineEventDto.d.ts +12 -0
- package/api/types/TimelineEventDto.js +5 -0
- package/api/types/TimelineEventDtoSystem.d.ts +15 -0
- package/api/types/TimelineEventDtoSystem.js +14 -0
- package/api/types/TimelineEventType.d.ts +30 -0
- package/api/types/TimelineEventType.js +32 -0
- package/api/types/Timeslot.d.ts +9 -0
- package/api/types/Timeslot.js +5 -0
- package/api/types/TimeslotPolicy.d.ts +15 -0
- package/api/types/TimeslotPolicy.js +11 -0
- package/api/types/TriggerEmailReminderBody.d.ts +7 -0
- package/api/types/TriggerEmailReminderBody.js +5 -0
- package/api/types/UnauthorizedErrorBody.d.ts +8 -0
- package/api/types/UnauthorizedErrorBody.js +5 -0
- package/api/types/index.d.ts +42 -0
- package/api/types/index.js +58 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/APIResponse.js +2 -0
- package/core/fetcher/Fetcher.d.ts +39 -0
- package/core/fetcher/Fetcher.js +100 -0
- package/core/fetcher/Supplier.d.ts +4 -0
- package/core/fetcher/Supplier.js +22 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +12 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +68 -0
- package/core/fetcher/getHeader.d.ts +1 -0
- package/core/fetcher/getHeader.js +11 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +54 -0
- package/core/fetcher/index.d.ts +5 -0
- package/core/fetcher/index.js +9 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +40 -0
- package/core/fetcher/signals.d.ts +11 -0
- package/core/fetcher/signals.js +36 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/core/index.d.ts +2 -0
- package/core/index.js +18 -0
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +9 -0
- package/core/runtime/runtime.js +103 -0
- package/dist/Client.d.ts +49 -0
- package/dist/Client.js +47 -0
- package/dist/api/errors/BadRequestError.d.ts +8 -0
- package/dist/api/errors/BadRequestError.js +51 -0
- package/dist/api/errors/NotFoundError.d.ts +7 -0
- package/dist/api/errors/NotFoundError.js +51 -0
- package/dist/api/errors/UnauthorizedError.d.ts +7 -0
- package/dist/api/errors/UnauthorizedError.js +51 -0
- package/dist/api/errors/index.d.ts +3 -0
- package/dist/api/errors/index.js +19 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +19 -0
- package/dist/api/resources/eligibility/client/Client.d.ts +45 -0
- package/dist/api/resources/eligibility/client/Client.js +136 -0
- package/dist/api/resources/eligibility/client/index.d.ts +1 -0
- package/dist/api/resources/eligibility/client/index.js +17 -0
- package/dist/api/resources/eligibility/client/requests/EligibilityGetRequest.d.ts +30 -0
- package/dist/api/resources/eligibility/client/requests/EligibilityGetRequest.js +5 -0
- package/dist/api/resources/eligibility/client/requests/index.d.ts +1 -0
- package/dist/api/resources/eligibility/client/requests/index.js +2 -0
- package/dist/api/resources/eligibility/index.d.ts +1 -0
- package/dist/api/resources/eligibility/index.js +17 -0
- package/dist/api/resources/health/client/Client.d.ts +39 -0
- package/dist/api/resources/health/client/Client.js +110 -0
- package/dist/api/resources/health/client/index.d.ts +1 -0
- package/dist/api/resources/health/client/index.js +2 -0
- package/dist/api/resources/health/index.d.ts +1 -0
- package/dist/api/resources/health/index.js +17 -0
- package/dist/api/resources/index.d.ts +12 -0
- package/dist/api/resources/index.js +51 -0
- package/dist/api/resources/notes/client/Client.d.ts +45 -0
- package/dist/api/resources/notes/client/Client.js +123 -0
- package/dist/api/resources/notes/client/index.d.ts +1 -0
- package/dist/api/resources/notes/client/index.js +17 -0
- package/dist/api/resources/notes/client/requests/CreateNoteReq.d.ts +15 -0
- package/dist/api/resources/notes/client/requests/CreateNoteReq.js +5 -0
- package/dist/api/resources/notes/client/requests/index.d.ts +1 -0
- package/dist/api/resources/notes/client/requests/index.js +2 -0
- package/dist/api/resources/notes/index.d.ts +1 -0
- package/dist/api/resources/notes/index.js +17 -0
- package/dist/api/resources/offerings/client/Client.d.ts +56 -0
- package/dist/api/resources/offerings/client/Client.js +191 -0
- package/dist/api/resources/offerings/client/index.d.ts +1 -0
- package/dist/api/resources/offerings/client/index.js +17 -0
- package/dist/api/resources/offerings/client/requests/OfferingsListRequest.d.ts +19 -0
- package/dist/api/resources/offerings/client/requests/OfferingsListRequest.js +5 -0
- package/dist/api/resources/offerings/client/requests/OfferingsListTimeslotsRequest.d.ts +14 -0
- package/dist/api/resources/offerings/client/requests/OfferingsListTimeslotsRequest.js +5 -0
- package/dist/api/resources/offerings/client/requests/index.d.ts +2 -0
- package/dist/api/resources/offerings/client/requests/index.js +2 -0
- package/dist/api/resources/offerings/index.d.ts +1 -0
- package/dist/api/resources/offerings/index.js +17 -0
- package/dist/api/resources/public/client/Client.d.ts +43 -0
- package/dist/api/resources/public/client/Client.js +131 -0
- package/dist/api/resources/public/client/index.d.ts +1 -0
- package/dist/api/resources/public/client/index.js +17 -0
- package/dist/api/resources/public/client/requests/PublicGetReferralRequest.d.ts +11 -0
- package/dist/api/resources/public/client/requests/PublicGetReferralRequest.js +5 -0
- package/dist/api/resources/public/client/requests/index.d.ts +1 -0
- package/dist/api/resources/public/client/requests/index.js +2 -0
- package/dist/api/resources/public/index.d.ts +1 -0
- package/dist/api/resources/public/index.js +17 -0
- package/dist/api/resources/referrals/client/Client.d.ts +158 -0
- package/dist/api/resources/referrals/client/Client.js +604 -0
- package/dist/api/resources/referrals/client/index.d.ts +1 -0
- package/dist/api/resources/referrals/client/index.js +17 -0
- package/dist/api/resources/referrals/client/requests/AcceptReferralBody.d.ts +13 -0
- package/dist/api/resources/referrals/client/requests/AcceptReferralBody.js +5 -0
- package/dist/api/resources/referrals/client/requests/AmendReferralReq.d.ts +13 -0
- package/dist/api/resources/referrals/client/requests/AmendReferralReq.js +5 -0
- package/dist/api/resources/referrals/client/requests/CancelReferralReq.d.ts +13 -0
- package/dist/api/resources/referrals/client/requests/CancelReferralReq.js +5 -0
- package/dist/api/resources/referrals/client/requests/CreateReferralReq.d.ts +57 -0
- package/dist/api/resources/referrals/client/requests/CreateReferralReq.js +5 -0
- package/dist/api/resources/referrals/client/requests/ReferralsGetRequest.d.ts +11 -0
- package/dist/api/resources/referrals/client/requests/ReferralsGetRequest.js +5 -0
- package/dist/api/resources/referrals/client/requests/ReferralsListRequest.d.ts +29 -0
- package/dist/api/resources/referrals/client/requests/ReferralsListRequest.js +5 -0
- package/dist/api/resources/referrals/client/requests/RejectReferralBody.d.ts +13 -0
- package/dist/api/resources/referrals/client/requests/RejectReferralBody.js +5 -0
- package/dist/api/resources/referrals/client/requests/index.d.ts +7 -0
- package/dist/api/resources/referrals/client/requests/index.js +2 -0
- package/dist/api/resources/referrals/index.d.ts +1 -0
- package/dist/api/resources/referrals/index.js +17 -0
- package/dist/api/resources/webhooks/client/Client.d.ts +46 -0
- package/dist/api/resources/webhooks/client/Client.js +154 -0
- package/dist/api/resources/webhooks/client/index.d.ts +1 -0
- package/dist/api/resources/webhooks/client/index.js +2 -0
- package/dist/api/resources/webhooks/index.d.ts +1 -0
- package/dist/api/resources/webhooks/index.js +17 -0
- package/dist/api/types/AdditionalReferralField.d.ts +8 -0
- package/dist/api/types/AdditionalReferralField.js +10 -0
- package/dist/api/types/AttachmentDto.d.ts +8 -0
- package/dist/api/types/AttachmentDto.js +5 -0
- package/dist/api/types/BadRequestErrorBody.d.ts +8 -0
- package/dist/api/types/BadRequestErrorBody.js +5 -0
- package/dist/api/types/CreatePatientReq.d.ts +16 -0
- package/dist/api/types/CreatePatientReq.js +5 -0
- package/dist/api/types/CreatePatientReqGender.d.ts +11 -0
- package/dist/api/types/CreatePatientReqGender.js +10 -0
- package/dist/api/types/CreateReferralFormReq.d.ts +9 -0
- package/dist/api/types/CreateReferralFormReq.js +5 -0
- package/dist/api/types/EligibilityRes.d.ts +9 -0
- package/dist/api/types/EligibilityRes.js +5 -0
- package/dist/api/types/Form.d.ts +11 -0
- package/dist/api/types/Form.js +5 -0
- package/dist/api/types/FormMetadata.d.ts +17 -0
- package/dist/api/types/FormMetadata.js +5 -0
- package/dist/api/types/FormResponse.d.ts +9 -0
- package/dist/api/types/FormResponse.js +5 -0
- package/dist/api/types/FormResponseAnswer.d.ts +4 -0
- package/dist/api/types/FormResponseAnswer.js +5 -0
- package/dist/api/types/FullReferralDto.d.ts +26 -0
- package/dist/api/types/FullReferralDto.js +5 -0
- package/dist/api/types/FullReferralDtoStatus.d.ts +25 -0
- package/dist/api/types/FullReferralDtoStatus.js +27 -0
- package/dist/api/types/GetReferralPatientDto.d.ts +18 -0
- package/dist/api/types/GetReferralPatientDto.js +5 -0
- package/dist/api/types/GetReferralPatientDtoGender.d.ts +11 -0
- package/dist/api/types/GetReferralPatientDtoGender.js +10 -0
- package/dist/api/types/InstitutionCoreDto.d.ts +13 -0
- package/dist/api/types/InstitutionCoreDto.js +5 -0
- package/dist/api/types/NotFoundErrorBody.d.ts +8 -0
- package/dist/api/types/NotFoundErrorBody.js +5 -0
- package/dist/api/types/NoteDto.d.ts +11 -0
- package/dist/api/types/NoteDto.js +5 -0
- package/dist/api/types/OfferingDto.d.ts +19 -0
- package/dist/api/types/OfferingDto.js +5 -0
- package/dist/api/types/OfferingWithAllowedDto.d.ts +21 -0
- package/dist/api/types/OfferingWithAllowedDto.js +5 -0
- package/dist/api/types/OkResponse.d.ts +6 -0
- package/dist/api/types/OkResponse.js +5 -0
- package/dist/api/types/PaginatedQuery.d.ts +9 -0
- package/dist/api/types/PaginatedQuery.js +5 -0
- package/dist/api/types/PaginatedReferralsDto.d.ts +8 -0
- package/dist/api/types/PaginatedReferralsDto.js +5 -0
- package/dist/api/types/PaginationMetadata.d.ts +9 -0
- package/dist/api/types/PaginationMetadata.js +5 -0
- package/dist/api/types/PublicReferralDto.d.ts +21 -0
- package/dist/api/types/PublicReferralDto.js +5 -0
- package/dist/api/types/ReferralDto.d.ts +25 -0
- package/dist/api/types/ReferralDto.js +5 -0
- package/dist/api/types/ReferralDtoStatus.d.ts +25 -0
- package/dist/api/types/ReferralDtoStatus.js +27 -0
- package/dist/api/types/ReferralEligibility.d.ts +8 -0
- package/dist/api/types/ReferralEligibility.js +5 -0
- package/dist/api/types/ReferralRole.d.ts +8 -0
- package/dist/api/types/ReferralRole.js +10 -0
- package/dist/api/types/ReferralStatusFilter.d.ts +11 -0
- package/dist/api/types/ReferralStatusFilter.js +13 -0
- package/dist/api/types/ReferrerIdType.d.ts +7 -0
- package/dist/api/types/ReferrerIdType.js +5 -0
- package/dist/api/types/ReferringDoctorDto.d.ts +9 -0
- package/dist/api/types/ReferringDoctorDto.js +5 -0
- package/dist/api/types/SubsidyEligibility.d.ts +10 -0
- package/dist/api/types/SubsidyEligibility.js +5 -0
- package/dist/api/types/SubsidyEligibilityScheme.d.ts +9 -0
- package/dist/api/types/SubsidyEligibilityScheme.js +11 -0
- package/dist/api/types/System.d.ts +12 -0
- package/dist/api/types/System.js +14 -0
- package/dist/api/types/TimelineEventDto.d.ts +12 -0
- package/dist/api/types/TimelineEventDto.js +5 -0
- package/dist/api/types/TimelineEventDtoSystem.d.ts +15 -0
- package/dist/api/types/TimelineEventDtoSystem.js +14 -0
- package/dist/api/types/TimelineEventType.d.ts +30 -0
- package/dist/api/types/TimelineEventType.js +32 -0
- package/dist/api/types/Timeslot.d.ts +9 -0
- package/dist/api/types/Timeslot.js +5 -0
- package/dist/api/types/TimeslotPolicy.d.ts +15 -0
- package/dist/api/types/TimeslotPolicy.js +11 -0
- package/dist/api/types/TriggerEmailReminderBody.d.ts +7 -0
- package/dist/api/types/TriggerEmailReminderBody.js +5 -0
- package/dist/api/types/UnauthorizedErrorBody.d.ts +8 -0
- package/dist/api/types/UnauthorizedErrorBody.js +5 -0
- package/dist/api/types/index.d.ts +42 -0
- package/dist/api/types/index.js +58 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/Fetcher.d.ts +39 -0
- package/dist/core/fetcher/Fetcher.js +100 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +22 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +68 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +11 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +54 -0
- package/dist/core/fetcher/index.d.ts +5 -0
- package/dist/core/fetcher/index.js +9 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +40 -0
- package/dist/core/fetcher/signals.d.ts +11 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +18 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +9 -0
- package/dist/core/runtime/runtime.js +103 -0
- package/dist/environments.d.ts +9 -0
- package/dist/environments.js +11 -0
- package/dist/errors/ReferralExchangeError.d.ts +12 -0
- package/dist/errors/ReferralExchangeError.js +33 -0
- package/dist/errors/ReferralExchangeTimeoutError.d.ts +6 -0
- package/dist/errors/ReferralExchangeTimeoutError.js +13 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +44 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/environments.d.ts +9 -0
- package/environments.js +11 -0
- package/errors/ReferralExchangeError.d.ts +12 -0
- package/errors/ReferralExchangeError.js +33 -0
- package/errors/ReferralExchangeTimeoutError.d.ts +6 -0
- package/errors/ReferralExchangeTimeoutError.js +13 -0
- package/errors/index.d.ts +2 -0
- package/errors/index.js +7 -0
- package/index.d.ts +4 -0
- package/index.js +44 -0
- package/jest.config.mjs +8 -0
- package/package.json +42 -0
- package/reference.md +918 -0
- package/scripts/rename-to-esm-files.js +115 -0
- package/version.d.ts +1 -0
- package/version.js +4 -0
package/Client.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "./environments";
|
|
5
|
+
import * as core from "./core";
|
|
6
|
+
import { Eligibility } from "./api/resources/eligibility/client/Client";
|
|
7
|
+
import { Referrals } from "./api/resources/referrals/client/Client";
|
|
8
|
+
import { Notes } from "./api/resources/notes/client/Client";
|
|
9
|
+
import { Offerings } from "./api/resources/offerings/client/Client";
|
|
10
|
+
import { Public } from "./api/resources/public/client/Client";
|
|
11
|
+
import { Webhooks } from "./api/resources/webhooks/client/Client";
|
|
12
|
+
import { Health } from "./api/resources/health/client/Client";
|
|
13
|
+
export declare namespace ReferralExchangeClient {
|
|
14
|
+
interface Options {
|
|
15
|
+
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
16
|
+
/** Specify a custom URL to connect the client to. */
|
|
17
|
+
baseUrl?: core.Supplier<string>;
|
|
18
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
19
|
+
fetcher?: core.FetchFunction;
|
|
20
|
+
}
|
|
21
|
+
interface RequestOptions {
|
|
22
|
+
/** The maximum time to wait for a response in seconds. */
|
|
23
|
+
timeoutInSeconds?: number;
|
|
24
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
25
|
+
maxRetries?: number;
|
|
26
|
+
/** A hook to abort the request. */
|
|
27
|
+
abortSignal?: AbortSignal;
|
|
28
|
+
/** Additional headers to include in the request. */
|
|
29
|
+
headers?: Record<string, string>;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export declare class ReferralExchangeClient {
|
|
33
|
+
protected readonly _options: ReferralExchangeClient.Options;
|
|
34
|
+
protected _eligibility: Eligibility | undefined;
|
|
35
|
+
protected _referrals: Referrals | undefined;
|
|
36
|
+
protected _notes: Notes | undefined;
|
|
37
|
+
protected _offerings: Offerings | undefined;
|
|
38
|
+
protected _public: Public | undefined;
|
|
39
|
+
protected _webhooks: Webhooks | undefined;
|
|
40
|
+
protected _health: Health | undefined;
|
|
41
|
+
constructor(_options?: ReferralExchangeClient.Options);
|
|
42
|
+
get eligibility(): Eligibility;
|
|
43
|
+
get referrals(): Referrals;
|
|
44
|
+
get notes(): Notes;
|
|
45
|
+
get offerings(): Offerings;
|
|
46
|
+
get public(): Public;
|
|
47
|
+
get webhooks(): Webhooks;
|
|
48
|
+
get health(): Health;
|
|
49
|
+
}
|
package/Client.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ReferralExchangeClient = void 0;
|
|
7
|
+
const Client_1 = require("./api/resources/eligibility/client/Client");
|
|
8
|
+
const Client_2 = require("./api/resources/referrals/client/Client");
|
|
9
|
+
const Client_3 = require("./api/resources/notes/client/Client");
|
|
10
|
+
const Client_4 = require("./api/resources/offerings/client/Client");
|
|
11
|
+
const Client_5 = require("./api/resources/public/client/Client");
|
|
12
|
+
const Client_6 = require("./api/resources/webhooks/client/Client");
|
|
13
|
+
const Client_7 = require("./api/resources/health/client/Client");
|
|
14
|
+
class ReferralExchangeClient {
|
|
15
|
+
constructor(_options = {}) {
|
|
16
|
+
this._options = _options;
|
|
17
|
+
}
|
|
18
|
+
get eligibility() {
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = this._eligibility) !== null && _a !== void 0 ? _a : (this._eligibility = new Client_1.Eligibility(this._options)));
|
|
21
|
+
}
|
|
22
|
+
get referrals() {
|
|
23
|
+
var _a;
|
|
24
|
+
return ((_a = this._referrals) !== null && _a !== void 0 ? _a : (this._referrals = new Client_2.Referrals(this._options)));
|
|
25
|
+
}
|
|
26
|
+
get notes() {
|
|
27
|
+
var _a;
|
|
28
|
+
return ((_a = this._notes) !== null && _a !== void 0 ? _a : (this._notes = new Client_3.Notes(this._options)));
|
|
29
|
+
}
|
|
30
|
+
get offerings() {
|
|
31
|
+
var _a;
|
|
32
|
+
return ((_a = this._offerings) !== null && _a !== void 0 ? _a : (this._offerings = new Client_4.Offerings(this._options)));
|
|
33
|
+
}
|
|
34
|
+
get public() {
|
|
35
|
+
var _a;
|
|
36
|
+
return ((_a = this._public) !== null && _a !== void 0 ? _a : (this._public = new Client_5.Public(this._options)));
|
|
37
|
+
}
|
|
38
|
+
get webhooks() {
|
|
39
|
+
var _a;
|
|
40
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_6.Webhooks(this._options)));
|
|
41
|
+
}
|
|
42
|
+
get health() {
|
|
43
|
+
var _a;
|
|
44
|
+
return ((_a = this._health) !== null && _a !== void 0 ? _a : (this._health = new Client_7.Health(this._options)));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ReferralExchangeClient = ReferralExchangeClient;
|
package/README.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Opengovsg TypeScript Library
|
|
2
|
+
|
|
3
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fopengovsg%2Frefer-ts-sdk)
|
|
4
|
+
[](https://www.npmjs.com/package/@opengovsg/refx-ts-sdk)
|
|
5
|
+
|
|
6
|
+
The Opengovsg TypeScript library provides convenient access to the Opengovsg API from TypeScript.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm i -s @opengovsg/refx-ts-sdk
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Reference
|
|
15
|
+
|
|
16
|
+
A full reference for this library is available [here](./reference.md).
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Instantiate and use the client with the following:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { ReferralExchangeClient } from "@opengovsg/refx-ts-sdk";
|
|
24
|
+
|
|
25
|
+
const client = new ReferralExchangeClient({ apiKey: "YOUR_API_KEY" });
|
|
26
|
+
await client.referrals.upsert({
|
|
27
|
+
patient: {
|
|
28
|
+
uin: "uin",
|
|
29
|
+
name: "name",
|
|
30
|
+
phoneNumber: "91234567",
|
|
31
|
+
dob: "1990-01-01",
|
|
32
|
+
gender: "Male",
|
|
33
|
+
},
|
|
34
|
+
offeringId: "offeringId",
|
|
35
|
+
senderHciCode: "senderHciCode",
|
|
36
|
+
senderInstitutionName: "senderInstitutionName",
|
|
37
|
+
doctorMcr: "doctorMcr",
|
|
38
|
+
doctorName: "doctorName",
|
|
39
|
+
doctorEmail: "doctorEmail",
|
|
40
|
+
doctorContactNumber: "doctorContactNumber",
|
|
41
|
+
isSubsidised: true,
|
|
42
|
+
isUrgent: true,
|
|
43
|
+
isDraft: true,
|
|
44
|
+
formResponses: [
|
|
45
|
+
{
|
|
46
|
+
question: "question",
|
|
47
|
+
id: "id",
|
|
48
|
+
answer: "answer",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Request And Response Types
|
|
55
|
+
|
|
56
|
+
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
|
|
57
|
+
following namespace:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { ReferralExchange } from "@opengovsg/refx-ts-sdk";
|
|
61
|
+
|
|
62
|
+
const request: ReferralExchange.EligibilityGetRequest = {
|
|
63
|
+
...
|
|
64
|
+
};
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Exception Handling
|
|
68
|
+
|
|
69
|
+
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
|
|
70
|
+
will be thrown.
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { ReferralExchangeError } from "@opengovsg/refx-ts-sdk";
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
await client.referrals.upsert(...);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
if (err instanceof ReferralExchangeError) {
|
|
79
|
+
console.log(err.statusCode);
|
|
80
|
+
console.log(err.message);
|
|
81
|
+
console.log(err.body);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Advanced
|
|
87
|
+
|
|
88
|
+
### Additional Headers
|
|
89
|
+
|
|
90
|
+
If you would like to send additional headers as part of the request, use the `headers` request option.
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
const response = await client.referrals.upsert(..., {
|
|
94
|
+
headers: {
|
|
95
|
+
'X-Custom-Header': 'custom value'
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Retries
|
|
101
|
+
|
|
102
|
+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
103
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
104
|
+
retry limit (default: 2).
|
|
105
|
+
|
|
106
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
107
|
+
|
|
108
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
109
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
110
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
111
|
+
|
|
112
|
+
Use the `maxRetries` request option to configure this behavior.
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
const response = await client.referrals.upsert(..., {
|
|
116
|
+
maxRetries: 0 // override maxRetries at the request level
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Timeouts
|
|
121
|
+
|
|
122
|
+
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
const response = await client.referrals.upsert(..., {
|
|
126
|
+
timeoutInSeconds: 30 // override timeout to 30s
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Aborting Requests
|
|
131
|
+
|
|
132
|
+
The SDK allows users to abort requests at any point by passing in an abort signal.
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
const controller = new AbortController();
|
|
136
|
+
const response = await client.referrals.upsert(..., {
|
|
137
|
+
abortSignal: controller.signal
|
|
138
|
+
});
|
|
139
|
+
controller.abort(); // aborts the request
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Runtime Compatibility
|
|
143
|
+
|
|
144
|
+
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
|
|
145
|
+
runtimes:
|
|
146
|
+
|
|
147
|
+
- Node.js 18+
|
|
148
|
+
- Vercel
|
|
149
|
+
- Cloudflare Workers
|
|
150
|
+
- Deno v1.25+
|
|
151
|
+
- Bun 1.0+
|
|
152
|
+
- React Native
|
|
153
|
+
|
|
154
|
+
### Customizing Fetch Client
|
|
155
|
+
|
|
156
|
+
The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an
|
|
157
|
+
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
import { ReferralExchangeClient } from "@opengovsg/refx-ts-sdk";
|
|
161
|
+
|
|
162
|
+
const client = new ReferralExchangeClient({
|
|
163
|
+
...
|
|
164
|
+
fetcher: // provide your implementation here
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Contributing
|
|
169
|
+
|
|
170
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
171
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
172
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
173
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
174
|
+
an issue first to discuss with us!
|
|
175
|
+
|
|
176
|
+
On the other hand, contributions to the README are always very welcome!
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../errors/index";
|
|
5
|
+
import * as ReferralExchange from "../index";
|
|
6
|
+
export declare class BadRequestError extends errors.ReferralExchangeError {
|
|
7
|
+
constructor(body: ReferralExchange.BadRequestErrorBody);
|
|
8
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.BadRequestError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../errors/index"));
|
|
41
|
+
class BadRequestError extends errors.ReferralExchangeError {
|
|
42
|
+
constructor(body) {
|
|
43
|
+
super({
|
|
44
|
+
message: "BadRequestError",
|
|
45
|
+
statusCode: 400,
|
|
46
|
+
body: body,
|
|
47
|
+
});
|
|
48
|
+
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.BadRequestError = BadRequestError;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.NotFoundError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../errors/index"));
|
|
41
|
+
class NotFoundError extends errors.ReferralExchangeError {
|
|
42
|
+
constructor(body) {
|
|
43
|
+
super({
|
|
44
|
+
message: "NotFoundError",
|
|
45
|
+
statusCode: 404,
|
|
46
|
+
body: body,
|
|
47
|
+
});
|
|
48
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.NotFoundError = NotFoundError;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.UnauthorizedError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../errors/index"));
|
|
41
|
+
class UnauthorizedError extends errors.ReferralExchangeError {
|
|
42
|
+
constructor(body) {
|
|
43
|
+
super({
|
|
44
|
+
message: "UnauthorizedError",
|
|
45
|
+
statusCode: 401,
|
|
46
|
+
body: body,
|
|
47
|
+
});
|
|
48
|
+
Object.setPrototypeOf(this, UnauthorizedError.prototype);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.UnauthorizedError = UnauthorizedError;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./UnauthorizedError"), exports);
|
|
18
|
+
__exportStar(require("./BadRequestError"), exports);
|
|
19
|
+
__exportStar(require("./NotFoundError"), exports);
|
package/api/index.d.ts
ADDED
package/api/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./errors"), exports);
|
|
19
|
+
__exportStar(require("./resources"), exports);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as ReferralExchange from "../../../index";
|
|
7
|
+
export declare namespace Eligibility {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ReferralExchangeEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
fetcher?: core.FetchFunction;
|
|
14
|
+
}
|
|
15
|
+
interface RequestOptions {
|
|
16
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
|
+
timeoutInSeconds?: number;
|
|
18
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
/** A hook to abort the request. */
|
|
21
|
+
abortSignal?: AbortSignal;
|
|
22
|
+
/** Additional headers to include in the request. */
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare class Eligibility {
|
|
27
|
+
protected readonly _options: Eligibility.Options;
|
|
28
|
+
constructor(_options?: Eligibility.Options);
|
|
29
|
+
/**
|
|
30
|
+
* @param {ReferralExchange.EligibilityGetRequest} request
|
|
31
|
+
* @param {Eligibility.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @throws {@link ReferralExchange.UnauthorizedError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.eligibility.get({
|
|
37
|
+
* uin: "uin",
|
|
38
|
+
* offeringId: "offeringId"
|
|
39
|
+
* })
|
|
40
|
+
*/
|
|
41
|
+
get(request: ReferralExchange.EligibilityGetRequest, requestOptions?: Eligibility.RequestOptions): Promise<ReferralExchange.EligibilityRes>;
|
|
42
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
43
|
+
Authorization: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
}
|