@oystehr/sdk 3.0.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/.eslintrc.js +14 -0
- package/LICENSE.md +9 -0
- package/README.md +339 -0
- package/dist/cjs/client/client.d.ts +49 -0
- package/dist/cjs/config.d.ts +45 -0
- package/dist/cjs/errors/index.d.ts +17 -0
- package/dist/cjs/fhir/fhir-types.d.ts +9 -0
- package/dist/cjs/fhir/index.d.ts +2 -0
- package/dist/cjs/fhir/utils.d.ts +14 -0
- package/dist/cjs/index.cjs +1333 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +16 -0
- package/dist/cjs/index.d.ts +16 -0
- package/dist/cjs/index.min.cjs +2 -0
- package/dist/cjs/index.min.cjs.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/resources/classes/application.d.ts +62 -0
- package/dist/cjs/resources/classes/charge.d.ts +30 -0
- package/dist/cjs/resources/classes/conversation-ext.d.ts +10 -0
- package/dist/cjs/resources/classes/conversation.d.ts +64 -0
- package/dist/cjs/resources/classes/developer.d.ts +50 -0
- package/dist/cjs/resources/classes/erx.d.ts +18 -0
- package/dist/cjs/resources/classes/fhir-ext.d.ts +58 -0
- package/dist/cjs/resources/classes/fhir.d.ts +21 -0
- package/dist/cjs/resources/classes/index.d.ts +44 -0
- package/dist/cjs/resources/classes/m2m.d.ts +57 -0
- package/dist/cjs/resources/classes/messaging.d.ts +10 -0
- package/dist/cjs/resources/classes/paymentMethod.d.ts +70 -0
- package/dist/cjs/resources/classes/project.d.ts +20 -0
- package/dist/cjs/resources/classes/rcm.d.ts +39 -0
- package/dist/cjs/resources/classes/role.d.ts +42 -0
- package/dist/cjs/resources/classes/secret.d.ts +34 -0
- package/dist/cjs/resources/classes/telemed.d.ts +29 -0
- package/dist/cjs/resources/classes/transactionalSMS.d.ts +22 -0
- package/dist/cjs/resources/classes/user.d.ts +56 -0
- package/dist/cjs/resources/classes/version.d.ts +10 -0
- package/dist/cjs/resources/classes/z3-ext.d.ts +10 -0
- package/dist/cjs/resources/classes/z3.d.ts +51 -0
- package/dist/cjs/resources/classes/zambda-ext.d.ts +6 -0
- package/dist/cjs/resources/classes/zambda.d.ts +63 -0
- package/dist/cjs/resources/classes/zambdaLogStream.d.ts +27 -0
- package/dist/cjs/resources/index.d.ts +1 -0
- package/dist/cjs/resources/types/AccessPolicy.d.ts +7 -0
- package/dist/cjs/resources/types/Application.d.ts +59 -0
- package/dist/cjs/resources/types/ApplicationCreateParams.d.ts +59 -0
- package/dist/cjs/resources/types/ApplicationCreateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ApplicationDeleteParams.d.ts +3 -0
- package/dist/cjs/resources/types/ApplicationGetParams.d.ts +3 -0
- package/dist/cjs/resources/types/ApplicationGetResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ApplicationListItem.d.ts +15 -0
- package/dist/cjs/resources/types/ApplicationListResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ApplicationRevokeAccessTokenParams.d.ts +4 -0
- package/dist/cjs/resources/types/ApplicationRevokeAccessTokenResponse.d.ts +6 -0
- package/dist/cjs/resources/types/ApplicationRevokeRefreshTokenParams.d.ts +4 -0
- package/dist/cjs/resources/types/ApplicationRevokeRefreshTokenResponse.d.ts +6 -0
- package/dist/cjs/resources/types/ApplicationRotateSecretParams.d.ts +3 -0
- package/dist/cjs/resources/types/ApplicationRotateSecretResponse.d.ts +6 -0
- package/dist/cjs/resources/types/ApplicationUpdateParams.d.ts +59 -0
- package/dist/cjs/resources/types/ApplicationUpdateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/Card.d.ts +8 -0
- package/dist/cjs/resources/types/CardIdentifier.d.ts +7 -0
- package/dist/cjs/resources/types/ChargeDetails.d.ts +8 -0
- package/dist/cjs/resources/types/ChargeIssueParams.d.ts +6 -0
- package/dist/cjs/resources/types/ChargeStatusParams.d.ts +6 -0
- package/dist/cjs/resources/types/ChargeStatusResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ClaimAddress.d.ts +7 -0
- package/dist/cjs/resources/types/ClaimCMS1500.d.ts +100 -0
- package/dist/cjs/resources/types/ClaimDate.d.ts +5 -0
- package/dist/cjs/resources/types/ClaimDatePeriod.d.ts +5 -0
- package/dist/cjs/resources/types/ClaimDateWithQualifier.d.ts +5 -0
- package/dist/cjs/resources/types/ClaimId.d.ts +4 -0
- package/dist/cjs/resources/types/ClaimName.d.ts +6 -0
- package/dist/cjs/resources/types/ConversationAddParticipantParams.d.ts +21 -0
- package/dist/cjs/resources/types/ConversationCreateParams.d.ts +7 -0
- package/dist/cjs/resources/types/ConversationCreateResponse.d.ts +10 -0
- package/dist/cjs/resources/types/ConversationGetTokenResponse.d.ts +9 -0
- package/dist/cjs/resources/types/ConversationMessageParams.d.ts +13 -0
- package/dist/cjs/resources/types/ConversationRemoveParticipantParams.d.ts +11 -0
- package/dist/cjs/resources/types/Developer.d.ts +20 -0
- package/dist/cjs/resources/types/DeveloperDeleteParams.d.ts +3 -0
- package/dist/cjs/resources/types/DeveloperGetParams.d.ts +3 -0
- package/dist/cjs/resources/types/DeveloperGetResponse.d.ts +5 -0
- package/dist/cjs/resources/types/DeveloperInviteParams.d.ts +17 -0
- package/dist/cjs/resources/types/DeveloperInviteResponse.d.ts +23 -0
- package/dist/cjs/resources/types/DeveloperListItem.d.ts +7 -0
- package/dist/cjs/resources/types/DeveloperListResponse.d.ts +5 -0
- package/dist/cjs/resources/types/DeveloperListV2Params.d.ts +11 -0
- package/dist/cjs/resources/types/DeveloperListV2Response.d.ts +29 -0
- package/dist/cjs/resources/types/DeveloperUpdateParams.d.ts +9 -0
- package/dist/cjs/resources/types/DeveloperUpdateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ErxAllergySearchParams.d.ts +3 -0
- package/dist/cjs/resources/types/ErxAllergySearchResponse.d.ts +19 -0
- package/dist/cjs/resources/types/ErxMedicationSearchParams.d.ts +6 -0
- package/dist/cjs/resources/types/ErxMedicationSearchResponse.d.ts +38 -0
- package/dist/cjs/resources/types/ErxSyncPatientParams.d.ts +3 -0
- package/dist/cjs/resources/types/ErxSyncPatientResponse.d.ts +9 -0
- package/dist/cjs/resources/types/M2m.d.ts +30 -0
- package/dist/cjs/resources/types/M2mCreateParams.d.ts +20 -0
- package/dist/cjs/resources/types/M2mCreateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/M2mDeleteParams.d.ts +3 -0
- package/dist/cjs/resources/types/M2mGetParams.d.ts +3 -0
- package/dist/cjs/resources/types/M2mGetResponse.d.ts +5 -0
- package/dist/cjs/resources/types/M2mListItem.d.ts +25 -0
- package/dist/cjs/resources/types/M2mListResponse.d.ts +5 -0
- package/dist/cjs/resources/types/M2mListV2Params.d.ts +10 -0
- package/dist/cjs/resources/types/M2mListV2Response.d.ts +16 -0
- package/dist/cjs/resources/types/M2mRotateSecretParams.d.ts +3 -0
- package/dist/cjs/resources/types/M2mRotateSecretResponse.d.ts +6 -0
- package/dist/cjs/resources/types/M2mUpdateParams.d.ts +21 -0
- package/dist/cjs/resources/types/M2mUpdateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/MessagingGetMessagingConfigResponse.d.ts +8 -0
- package/dist/cjs/resources/types/MessagingServiceInfo.d.ts +14 -0
- package/dist/cjs/resources/types/PaymentMethodDeleteParams.d.ts +16 -0
- package/dist/cjs/resources/types/PaymentMethodListParams.d.ts +12 -0
- package/dist/cjs/resources/types/PaymentMethodListResponse.d.ts +8 -0
- package/dist/cjs/resources/types/PaymentMethodSetDefaultParams.d.ts +16 -0
- package/dist/cjs/resources/types/PaymentMethodSetUpParams.d.ts +12 -0
- package/dist/cjs/resources/types/PaymentMethodSetUpResponse.d.ts +9 -0
- package/dist/cjs/resources/types/Project.d.ts +17 -0
- package/dist/cjs/resources/types/ProjectGetResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ProjectUpdateParams.d.ts +16 -0
- package/dist/cjs/resources/types/ProjectUpdateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/RcmEligibilityCheckParams.d.ts +6 -0
- package/dist/cjs/resources/types/RcmEligibilityCheckResponse.d.ts +5 -0
- package/dist/cjs/resources/types/RcmSubmitProfessionalClaimParams.d.ts +10 -0
- package/dist/cjs/resources/types/RcmSubmitProfessionalClaimResponse.d.ts +5 -0
- package/dist/cjs/resources/types/RcmValidateProfessionalClaimParams.d.ts +6 -0
- package/dist/cjs/resources/types/RcmValidateProfessionalClaimResponse.d.ts +21 -0
- package/dist/cjs/resources/types/Role.d.ts +16 -0
- package/dist/cjs/resources/types/RoleCreateParams.d.ts +12 -0
- package/dist/cjs/resources/types/RoleCreateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/RoleDeleteParams.d.ts +3 -0
- package/dist/cjs/resources/types/RoleGetParams.d.ts +3 -0
- package/dist/cjs/resources/types/RoleGetResponse.d.ts +5 -0
- package/dist/cjs/resources/types/RoleListItem.d.ts +14 -0
- package/dist/cjs/resources/types/RoleListResponse.d.ts +5 -0
- package/dist/cjs/resources/types/RoleStub.d.ts +10 -0
- package/dist/cjs/resources/types/RoleUpdateParams.d.ts +17 -0
- package/dist/cjs/resources/types/RoleUpdateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/Secret.d.ts +10 -0
- package/dist/cjs/resources/types/SecretDeleteParams.d.ts +3 -0
- package/dist/cjs/resources/types/SecretGetParams.d.ts +3 -0
- package/dist/cjs/resources/types/SecretGetResponse.d.ts +5 -0
- package/dist/cjs/resources/types/SecretListItem.d.ts +6 -0
- package/dist/cjs/resources/types/SecretListResponse.d.ts +5 -0
- package/dist/cjs/resources/types/SecretSetParams.d.ts +10 -0
- package/dist/cjs/resources/types/SecretSetResponse.d.ts +5 -0
- package/dist/cjs/resources/types/TelemedCreateMeetingParams.d.ts +7 -0
- package/dist/cjs/resources/types/TelemedCreateMeetingResponse.d.ts +10 -0
- package/dist/cjs/resources/types/TelemedJoinMeetingParams.d.ts +4 -0
- package/dist/cjs/resources/types/TelemedJoinMeetingResponse.d.ts +27 -0
- package/dist/cjs/resources/types/TransactionalSMSSendParams.d.ts +10 -0
- package/dist/cjs/resources/types/TransactionalSMSSendResponse.d.ts +9 -0
- package/dist/cjs/resources/types/User.d.ts +36 -0
- package/dist/cjs/resources/types/UserDeleteParams.d.ts +3 -0
- package/dist/cjs/resources/types/UserGetParams.d.ts +3 -0
- package/dist/cjs/resources/types/UserGetResponse.d.ts +5 -0
- package/dist/cjs/resources/types/UserInviteParams.d.ts +35 -0
- package/dist/cjs/resources/types/UserInviteResponse.d.ts +37 -0
- package/dist/cjs/resources/types/UserListItem.d.ts +15 -0
- package/dist/cjs/resources/types/UserListResponse.d.ts +5 -0
- package/dist/cjs/resources/types/UserListV2Params.d.ts +11 -0
- package/dist/cjs/resources/types/UserListV2Response.d.ts +16 -0
- package/dist/cjs/resources/types/UserMeResponse.d.ts +5 -0
- package/dist/cjs/resources/types/UserUpdateParams.d.ts +9 -0
- package/dist/cjs/resources/types/UserUpdateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/VersionGetResponse.d.ts +17 -0
- package/dist/cjs/resources/types/Z3CreateBucketParams.d.ts +3 -0
- package/dist/cjs/resources/types/Z3CreateBucketResponse.d.ts +10 -0
- package/dist/cjs/resources/types/Z3DeleteBucketParams.d.ts +3 -0
- package/dist/cjs/resources/types/Z3DeleteObjectParams.d.ts +8 -0
- package/dist/cjs/resources/types/Z3GetPresignedUrlParams.d.ts +9 -0
- package/dist/cjs/resources/types/Z3GetPresignedUrlResponse.d.ts +9 -0
- package/dist/cjs/resources/types/Z3ListBucketsResponse.d.ts +14 -0
- package/dist/cjs/resources/types/Z3ListObjectsParams.d.ts +4 -0
- package/dist/cjs/resources/types/Z3ListObjectsResponse.d.ts +13 -0
- package/dist/cjs/resources/types/ZambdaCreateParams.d.ts +12 -0
- package/dist/cjs/resources/types/ZambdaCreateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ZambdaDeleteParams.d.ts +3 -0
- package/dist/cjs/resources/types/ZambdaExecuteParams.d.ts +4 -0
- package/dist/cjs/resources/types/ZambdaExecutePublicParams.d.ts +4 -0
- package/dist/cjs/resources/types/ZambdaExecutePublicResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ZambdaExecuteResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ZambdaExecuteResult.d.ts +10 -0
- package/dist/cjs/resources/types/ZambdaFunction.d.ts +38 -0
- package/dist/cjs/resources/types/ZambdaGetParams.d.ts +3 -0
- package/dist/cjs/resources/types/ZambdaGetResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ZambdaListResponse.d.ts +5 -0
- package/dist/cjs/resources/types/ZambdaLogStreamGetParams.d.ts +8 -0
- package/dist/cjs/resources/types/ZambdaLogStreamGetResponse.d.ts +27 -0
- package/dist/cjs/resources/types/ZambdaLogStreamListParams.d.ts +4 -0
- package/dist/cjs/resources/types/ZambdaLogStreamListResponse.d.ts +46 -0
- package/dist/cjs/resources/types/ZambdaLogStreamSearchParams.d.ts +19 -0
- package/dist/cjs/resources/types/ZambdaLogStreamSearchResponse.d.ts +23 -0
- package/dist/cjs/resources/types/ZambdaS3UploadParams.d.ts +7 -0
- package/dist/cjs/resources/types/ZambdaS3UploadResponse.d.ts +9 -0
- package/dist/cjs/resources/types/ZambdaSchedule.d.ts +30 -0
- package/dist/cjs/resources/types/ZambdaUpdateParams.d.ts +17 -0
- package/dist/cjs/resources/types/ZambdaUpdateResponse.d.ts +5 -0
- package/dist/cjs/resources/types/fhir.d.ts +46 -0
- package/dist/cjs/resources/types/index.d.ts +158 -0
- package/dist/cjs/tests/common.d.ts +2 -0
- package/dist/cjs/tests/setup/constants.d.ts +12 -0
- package/dist/cjs/tests/setup/global.d.ts +1 -0
- package/dist/cjs/tests/setup/per-test.d.ts +1 -0
- package/dist/esm/client/client.d.ts +49 -0
- package/dist/esm/client/client.js +251 -0
- package/dist/esm/client/client.js.map +1 -0
- package/dist/esm/config.d.ts +45 -0
- package/dist/esm/errors/index.d.ts +17 -0
- package/dist/esm/errors/index.js +38 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/fhir/fhir-types.d.ts +9 -0
- package/dist/esm/fhir/index.d.ts +2 -0
- package/dist/esm/fhir/utils.d.ts +14 -0
- package/dist/esm/index.d.ts +16 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.min.js +2 -0
- package/dist/esm/index.min.js.map +1 -0
- package/dist/esm/node_modules/tslib/package.json +1 -0
- package/dist/esm/node_modules/tslib/tslib.es6.js +34 -0
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/resources/classes/application.d.ts +62 -0
- package/dist/esm/resources/classes/application.js +67 -0
- package/dist/esm/resources/classes/application.js.map +1 -0
- package/dist/esm/resources/classes/charge.d.ts +30 -0
- package/dist/esm/resources/classes/charge.js +35 -0
- package/dist/esm/resources/classes/charge.js.map +1 -0
- package/dist/esm/resources/classes/conversation-ext.d.ts +10 -0
- package/dist/esm/resources/classes/conversation-ext.js +28 -0
- package/dist/esm/resources/classes/conversation-ext.js.map +1 -0
- package/dist/esm/resources/classes/conversation.d.ts +64 -0
- package/dist/esm/resources/classes/conversation.js +69 -0
- package/dist/esm/resources/classes/conversation.js.map +1 -0
- package/dist/esm/resources/classes/developer.d.ts +50 -0
- package/dist/esm/resources/classes/developer.js +55 -0
- package/dist/esm/resources/classes/developer.js.map +1 -0
- package/dist/esm/resources/classes/erx.d.ts +18 -0
- package/dist/esm/resources/classes/erx.js +23 -0
- package/dist/esm/resources/classes/erx.js.map +1 -0
- package/dist/esm/resources/classes/fhir-ext.d.ts +58 -0
- package/dist/esm/resources/classes/fhir-ext.js +130 -0
- package/dist/esm/resources/classes/fhir-ext.js.map +1 -0
- package/dist/esm/resources/classes/fhir.d.ts +21 -0
- package/dist/esm/resources/classes/fhir.js +27 -0
- package/dist/esm/resources/classes/fhir.js.map +1 -0
- package/dist/esm/resources/classes/index.d.ts +44 -0
- package/dist/esm/resources/classes/index.js +49 -0
- package/dist/esm/resources/classes/index.js.map +1 -0
- package/dist/esm/resources/classes/m2m.d.ts +57 -0
- package/dist/esm/resources/classes/m2m.js +62 -0
- package/dist/esm/resources/classes/m2m.js.map +1 -0
- package/dist/esm/resources/classes/messaging.d.ts +10 -0
- package/dist/esm/resources/classes/messaging.js +15 -0
- package/dist/esm/resources/classes/messaging.js.map +1 -0
- package/dist/esm/resources/classes/paymentMethod.d.ts +70 -0
- package/dist/esm/resources/classes/paymentMethod.js +75 -0
- package/dist/esm/resources/classes/paymentMethod.js.map +1 -0
- package/dist/esm/resources/classes/project.d.ts +20 -0
- package/dist/esm/resources/classes/project.js +25 -0
- package/dist/esm/resources/classes/project.js.map +1 -0
- package/dist/esm/resources/classes/rcm.d.ts +39 -0
- package/dist/esm/resources/classes/rcm.js +44 -0
- package/dist/esm/resources/classes/rcm.js.map +1 -0
- package/dist/esm/resources/classes/role.d.ts +42 -0
- package/dist/esm/resources/classes/role.js +47 -0
- package/dist/esm/resources/classes/role.js.map +1 -0
- package/dist/esm/resources/classes/secret.d.ts +34 -0
- package/dist/esm/resources/classes/secret.js +39 -0
- package/dist/esm/resources/classes/secret.js.map +1 -0
- package/dist/esm/resources/classes/telemed.d.ts +29 -0
- package/dist/esm/resources/classes/telemed.js +34 -0
- package/dist/esm/resources/classes/telemed.js.map +1 -0
- package/dist/esm/resources/classes/transactionalSMS.d.ts +22 -0
- package/dist/esm/resources/classes/transactionalSMS.js +27 -0
- package/dist/esm/resources/classes/transactionalSMS.js.map +1 -0
- package/dist/esm/resources/classes/user.d.ts +56 -0
- package/dist/esm/resources/classes/user.js +61 -0
- package/dist/esm/resources/classes/user.js.map +1 -0
- package/dist/esm/resources/classes/version.d.ts +10 -0
- package/dist/esm/resources/classes/version.js +15 -0
- package/dist/esm/resources/classes/version.js.map +1 -0
- package/dist/esm/resources/classes/z3-ext.d.ts +10 -0
- package/dist/esm/resources/classes/z3-ext.js +34 -0
- package/dist/esm/resources/classes/z3-ext.js.map +1 -0
- package/dist/esm/resources/classes/z3.d.ts +51 -0
- package/dist/esm/resources/classes/z3.js +56 -0
- package/dist/esm/resources/classes/z3.js.map +1 -0
- package/dist/esm/resources/classes/zambda-ext.d.ts +6 -0
- package/dist/esm/resources/classes/zambda-ext.js +14 -0
- package/dist/esm/resources/classes/zambda-ext.js.map +1 -0
- package/dist/esm/resources/classes/zambda.d.ts +63 -0
- package/dist/esm/resources/classes/zambda.js +68 -0
- package/dist/esm/resources/classes/zambda.js.map +1 -0
- package/dist/esm/resources/classes/zambdaLogStream.d.ts +27 -0
- package/dist/esm/resources/classes/zambdaLogStream.js +32 -0
- package/dist/esm/resources/classes/zambdaLogStream.js.map +1 -0
- package/dist/esm/resources/index.d.ts +1 -0
- package/dist/esm/resources/types/AccessPolicy.d.ts +7 -0
- package/dist/esm/resources/types/Application.d.ts +59 -0
- package/dist/esm/resources/types/ApplicationCreateParams.d.ts +59 -0
- package/dist/esm/resources/types/ApplicationCreateResponse.d.ts +5 -0
- package/dist/esm/resources/types/ApplicationDeleteParams.d.ts +3 -0
- package/dist/esm/resources/types/ApplicationGetParams.d.ts +3 -0
- package/dist/esm/resources/types/ApplicationGetResponse.d.ts +5 -0
- package/dist/esm/resources/types/ApplicationListItem.d.ts +15 -0
- package/dist/esm/resources/types/ApplicationListResponse.d.ts +5 -0
- package/dist/esm/resources/types/ApplicationRevokeAccessTokenParams.d.ts +4 -0
- package/dist/esm/resources/types/ApplicationRevokeAccessTokenResponse.d.ts +6 -0
- package/dist/esm/resources/types/ApplicationRevokeRefreshTokenParams.d.ts +4 -0
- package/dist/esm/resources/types/ApplicationRevokeRefreshTokenResponse.d.ts +6 -0
- package/dist/esm/resources/types/ApplicationRotateSecretParams.d.ts +3 -0
- package/dist/esm/resources/types/ApplicationRotateSecretResponse.d.ts +6 -0
- package/dist/esm/resources/types/ApplicationUpdateParams.d.ts +59 -0
- package/dist/esm/resources/types/ApplicationUpdateResponse.d.ts +5 -0
- package/dist/esm/resources/types/Card.d.ts +8 -0
- package/dist/esm/resources/types/CardIdentifier.d.ts +7 -0
- package/dist/esm/resources/types/ChargeDetails.d.ts +8 -0
- package/dist/esm/resources/types/ChargeIssueParams.d.ts +6 -0
- package/dist/esm/resources/types/ChargeStatusParams.d.ts +6 -0
- package/dist/esm/resources/types/ChargeStatusResponse.d.ts +5 -0
- package/dist/esm/resources/types/ClaimAddress.d.ts +7 -0
- package/dist/esm/resources/types/ClaimCMS1500.d.ts +100 -0
- package/dist/esm/resources/types/ClaimDate.d.ts +5 -0
- package/dist/esm/resources/types/ClaimDatePeriod.d.ts +5 -0
- package/dist/esm/resources/types/ClaimDateWithQualifier.d.ts +5 -0
- package/dist/esm/resources/types/ClaimId.d.ts +4 -0
- package/dist/esm/resources/types/ClaimName.d.ts +6 -0
- package/dist/esm/resources/types/ConversationAddParticipantParams.d.ts +21 -0
- package/dist/esm/resources/types/ConversationCreateParams.d.ts +7 -0
- package/dist/esm/resources/types/ConversationCreateResponse.d.ts +10 -0
- package/dist/esm/resources/types/ConversationGetTokenResponse.d.ts +9 -0
- package/dist/esm/resources/types/ConversationMessageParams.d.ts +13 -0
- package/dist/esm/resources/types/ConversationRemoveParticipantParams.d.ts +11 -0
- package/dist/esm/resources/types/Developer.d.ts +20 -0
- package/dist/esm/resources/types/DeveloperDeleteParams.d.ts +3 -0
- package/dist/esm/resources/types/DeveloperGetParams.d.ts +3 -0
- package/dist/esm/resources/types/DeveloperGetResponse.d.ts +5 -0
- package/dist/esm/resources/types/DeveloperInviteParams.d.ts +17 -0
- package/dist/esm/resources/types/DeveloperInviteResponse.d.ts +23 -0
- package/dist/esm/resources/types/DeveloperListItem.d.ts +7 -0
- package/dist/esm/resources/types/DeveloperListResponse.d.ts +5 -0
- package/dist/esm/resources/types/DeveloperListV2Params.d.ts +11 -0
- package/dist/esm/resources/types/DeveloperListV2Response.d.ts +29 -0
- package/dist/esm/resources/types/DeveloperUpdateParams.d.ts +9 -0
- package/dist/esm/resources/types/DeveloperUpdateResponse.d.ts +5 -0
- package/dist/esm/resources/types/ErxAllergySearchParams.d.ts +3 -0
- package/dist/esm/resources/types/ErxAllergySearchResponse.d.ts +19 -0
- package/dist/esm/resources/types/ErxMedicationSearchParams.d.ts +6 -0
- package/dist/esm/resources/types/ErxMedicationSearchResponse.d.ts +38 -0
- package/dist/esm/resources/types/ErxSyncPatientParams.d.ts +3 -0
- package/dist/esm/resources/types/ErxSyncPatientResponse.d.ts +9 -0
- package/dist/esm/resources/types/M2m.d.ts +30 -0
- package/dist/esm/resources/types/M2mCreateParams.d.ts +20 -0
- package/dist/esm/resources/types/M2mCreateResponse.d.ts +5 -0
- package/dist/esm/resources/types/M2mDeleteParams.d.ts +3 -0
- package/dist/esm/resources/types/M2mGetParams.d.ts +3 -0
- package/dist/esm/resources/types/M2mGetResponse.d.ts +5 -0
- package/dist/esm/resources/types/M2mListItem.d.ts +25 -0
- package/dist/esm/resources/types/M2mListResponse.d.ts +5 -0
- package/dist/esm/resources/types/M2mListV2Params.d.ts +10 -0
- package/dist/esm/resources/types/M2mListV2Response.d.ts +16 -0
- package/dist/esm/resources/types/M2mRotateSecretParams.d.ts +3 -0
- package/dist/esm/resources/types/M2mRotateSecretResponse.d.ts +6 -0
- package/dist/esm/resources/types/M2mUpdateParams.d.ts +21 -0
- package/dist/esm/resources/types/M2mUpdateResponse.d.ts +5 -0
- package/dist/esm/resources/types/MessagingGetMessagingConfigResponse.d.ts +8 -0
- package/dist/esm/resources/types/MessagingServiceInfo.d.ts +14 -0
- package/dist/esm/resources/types/PaymentMethodDeleteParams.d.ts +16 -0
- package/dist/esm/resources/types/PaymentMethodListParams.d.ts +12 -0
- package/dist/esm/resources/types/PaymentMethodListResponse.d.ts +8 -0
- package/dist/esm/resources/types/PaymentMethodSetDefaultParams.d.ts +16 -0
- package/dist/esm/resources/types/PaymentMethodSetUpParams.d.ts +12 -0
- package/dist/esm/resources/types/PaymentMethodSetUpResponse.d.ts +9 -0
- package/dist/esm/resources/types/Project.d.ts +17 -0
- package/dist/esm/resources/types/ProjectGetResponse.d.ts +5 -0
- package/dist/esm/resources/types/ProjectUpdateParams.d.ts +16 -0
- package/dist/esm/resources/types/ProjectUpdateResponse.d.ts +5 -0
- package/dist/esm/resources/types/RcmEligibilityCheckParams.d.ts +6 -0
- package/dist/esm/resources/types/RcmEligibilityCheckResponse.d.ts +5 -0
- package/dist/esm/resources/types/RcmSubmitProfessionalClaimParams.d.ts +10 -0
- package/dist/esm/resources/types/RcmSubmitProfessionalClaimResponse.d.ts +5 -0
- package/dist/esm/resources/types/RcmValidateProfessionalClaimParams.d.ts +6 -0
- package/dist/esm/resources/types/RcmValidateProfessionalClaimResponse.d.ts +21 -0
- package/dist/esm/resources/types/Role.d.ts +16 -0
- package/dist/esm/resources/types/RoleCreateParams.d.ts +12 -0
- package/dist/esm/resources/types/RoleCreateResponse.d.ts +5 -0
- package/dist/esm/resources/types/RoleDeleteParams.d.ts +3 -0
- package/dist/esm/resources/types/RoleGetParams.d.ts +3 -0
- package/dist/esm/resources/types/RoleGetResponse.d.ts +5 -0
- package/dist/esm/resources/types/RoleListItem.d.ts +14 -0
- package/dist/esm/resources/types/RoleListResponse.d.ts +5 -0
- package/dist/esm/resources/types/RoleStub.d.ts +10 -0
- package/dist/esm/resources/types/RoleUpdateParams.d.ts +17 -0
- package/dist/esm/resources/types/RoleUpdateResponse.d.ts +5 -0
- package/dist/esm/resources/types/Secret.d.ts +10 -0
- package/dist/esm/resources/types/SecretDeleteParams.d.ts +3 -0
- package/dist/esm/resources/types/SecretGetParams.d.ts +3 -0
- package/dist/esm/resources/types/SecretGetResponse.d.ts +5 -0
- package/dist/esm/resources/types/SecretListItem.d.ts +6 -0
- package/dist/esm/resources/types/SecretListResponse.d.ts +5 -0
- package/dist/esm/resources/types/SecretSetParams.d.ts +10 -0
- package/dist/esm/resources/types/SecretSetResponse.d.ts +5 -0
- package/dist/esm/resources/types/TelemedCreateMeetingParams.d.ts +7 -0
- package/dist/esm/resources/types/TelemedCreateMeetingResponse.d.ts +10 -0
- package/dist/esm/resources/types/TelemedJoinMeetingParams.d.ts +4 -0
- package/dist/esm/resources/types/TelemedJoinMeetingResponse.d.ts +27 -0
- package/dist/esm/resources/types/TransactionalSMSSendParams.d.ts +10 -0
- package/dist/esm/resources/types/TransactionalSMSSendResponse.d.ts +9 -0
- package/dist/esm/resources/types/User.d.ts +36 -0
- package/dist/esm/resources/types/UserDeleteParams.d.ts +3 -0
- package/dist/esm/resources/types/UserGetParams.d.ts +3 -0
- package/dist/esm/resources/types/UserGetResponse.d.ts +5 -0
- package/dist/esm/resources/types/UserInviteParams.d.ts +35 -0
- package/dist/esm/resources/types/UserInviteResponse.d.ts +37 -0
- package/dist/esm/resources/types/UserListItem.d.ts +15 -0
- package/dist/esm/resources/types/UserListResponse.d.ts +5 -0
- package/dist/esm/resources/types/UserListV2Params.d.ts +11 -0
- package/dist/esm/resources/types/UserListV2Response.d.ts +16 -0
- package/dist/esm/resources/types/UserMeResponse.d.ts +5 -0
- package/dist/esm/resources/types/UserUpdateParams.d.ts +9 -0
- package/dist/esm/resources/types/UserUpdateResponse.d.ts +5 -0
- package/dist/esm/resources/types/VersionGetResponse.d.ts +17 -0
- package/dist/esm/resources/types/Z3CreateBucketParams.d.ts +3 -0
- package/dist/esm/resources/types/Z3CreateBucketResponse.d.ts +10 -0
- package/dist/esm/resources/types/Z3DeleteBucketParams.d.ts +3 -0
- package/dist/esm/resources/types/Z3DeleteObjectParams.d.ts +8 -0
- package/dist/esm/resources/types/Z3GetPresignedUrlParams.d.ts +9 -0
- package/dist/esm/resources/types/Z3GetPresignedUrlResponse.d.ts +9 -0
- package/dist/esm/resources/types/Z3ListBucketsResponse.d.ts +14 -0
- package/dist/esm/resources/types/Z3ListObjectsParams.d.ts +4 -0
- package/dist/esm/resources/types/Z3ListObjectsResponse.d.ts +13 -0
- package/dist/esm/resources/types/ZambdaCreateParams.d.ts +12 -0
- package/dist/esm/resources/types/ZambdaCreateResponse.d.ts +5 -0
- package/dist/esm/resources/types/ZambdaDeleteParams.d.ts +3 -0
- package/dist/esm/resources/types/ZambdaExecuteParams.d.ts +4 -0
- package/dist/esm/resources/types/ZambdaExecutePublicParams.d.ts +4 -0
- package/dist/esm/resources/types/ZambdaExecutePublicResponse.d.ts +5 -0
- package/dist/esm/resources/types/ZambdaExecuteResponse.d.ts +5 -0
- package/dist/esm/resources/types/ZambdaExecuteResult.d.ts +10 -0
- package/dist/esm/resources/types/ZambdaFunction.d.ts +38 -0
- package/dist/esm/resources/types/ZambdaGetParams.d.ts +3 -0
- package/dist/esm/resources/types/ZambdaGetResponse.d.ts +5 -0
- package/dist/esm/resources/types/ZambdaListResponse.d.ts +5 -0
- package/dist/esm/resources/types/ZambdaLogStreamGetParams.d.ts +8 -0
- package/dist/esm/resources/types/ZambdaLogStreamGetResponse.d.ts +27 -0
- package/dist/esm/resources/types/ZambdaLogStreamListParams.d.ts +4 -0
- package/dist/esm/resources/types/ZambdaLogStreamListResponse.d.ts +46 -0
- package/dist/esm/resources/types/ZambdaLogStreamSearchParams.d.ts +19 -0
- package/dist/esm/resources/types/ZambdaLogStreamSearchResponse.d.ts +23 -0
- package/dist/esm/resources/types/ZambdaS3UploadParams.d.ts +7 -0
- package/dist/esm/resources/types/ZambdaS3UploadResponse.d.ts +9 -0
- package/dist/esm/resources/types/ZambdaSchedule.d.ts +30 -0
- package/dist/esm/resources/types/ZambdaUpdateParams.d.ts +17 -0
- package/dist/esm/resources/types/ZambdaUpdateResponse.d.ts +5 -0
- package/dist/esm/resources/types/fhir.d.ts +46 -0
- package/dist/esm/resources/types/index.d.ts +158 -0
- package/dist/esm/tests/common.d.ts +2 -0
- package/dist/esm/tests/setup/constants.d.ts +12 -0
- package/dist/esm/tests/setup/global.d.ts +1 -0
- package/dist/esm/tests/setup/per-test.d.ts +1 -0
- package/package.json +59 -0
- package/rollup.config-cjs.mjs +49 -0
- package/rollup.config-mjs.mjs +49 -0
- package/src/client/client.ts +307 -0
- package/src/config.ts +56 -0
- package/src/errors/index.ts +41 -0
- package/src/fhir/fhir-types.ts +15 -0
- package/src/fhir/index.ts +2 -0
- package/src/fhir/utils.ts +68 -0
- package/src/index.cts +22 -0
- package/src/index.ts +27 -0
- package/src/resources/classes/application.ts +100 -0
- package/src/resources/classes/charge.ts +37 -0
- package/src/resources/classes/conversation-ext.ts +31 -0
- package/src/resources/classes/conversation.ts +82 -0
- package/src/resources/classes/developer.ts +72 -0
- package/src/resources/classes/erx.ts +36 -0
- package/src/resources/classes/fhir-ext.ts +214 -0
- package/src/resources/classes/fhir.ts +26 -0
- package/src/resources/classes/index.ts +68 -0
- package/src/resources/classes/m2m.ts +82 -0
- package/src/resources/classes/messaging.ts +16 -0
- package/src/resources/classes/paymentMethod.ts +87 -0
- package/src/resources/classes/project.ts +26 -0
- package/src/resources/classes/rcm.ts +63 -0
- package/src/resources/classes/role.ts +61 -0
- package/src/resources/classes/secret.ts +50 -0
- package/src/resources/classes/telemed.ts +47 -0
- package/src/resources/classes/transactionalSMS.ts +28 -0
- package/src/resources/classes/user.ts +79 -0
- package/src/resources/classes/version.ts +15 -0
- package/src/resources/classes/z3-ext.ts +54 -0
- package/src/resources/classes/z3.ts +74 -0
- package/src/resources/classes/zambda-ext.ts +20 -0
- package/src/resources/classes/zambda.ts +93 -0
- package/src/resources/classes/zambdaLogStream.ts +45 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/types/AccessPolicy.ts +9 -0
- package/src/resources/types/Application.ts +61 -0
- package/src/resources/types/ApplicationCreateParams.ts +61 -0
- package/src/resources/types/ApplicationCreateResponse.ts +7 -0
- package/src/resources/types/ApplicationDeleteParams.ts +5 -0
- package/src/resources/types/ApplicationGetParams.ts +5 -0
- package/src/resources/types/ApplicationGetResponse.ts +7 -0
- package/src/resources/types/ApplicationListItem.ts +17 -0
- package/src/resources/types/ApplicationListResponse.ts +7 -0
- package/src/resources/types/ApplicationRevokeAccessTokenParams.ts +6 -0
- package/src/resources/types/ApplicationRevokeAccessTokenResponse.ts +8 -0
- package/src/resources/types/ApplicationRevokeRefreshTokenParams.ts +6 -0
- package/src/resources/types/ApplicationRevokeRefreshTokenResponse.ts +8 -0
- package/src/resources/types/ApplicationRotateSecretParams.ts +5 -0
- package/src/resources/types/ApplicationRotateSecretResponse.ts +8 -0
- package/src/resources/types/ApplicationUpdateParams.ts +61 -0
- package/src/resources/types/ApplicationUpdateResponse.ts +7 -0
- package/src/resources/types/Card.ts +10 -0
- package/src/resources/types/CardIdentifier.ts +9 -0
- package/src/resources/types/ChargeDetails.ts +11 -0
- package/src/resources/types/ChargeIssueParams.ts +8 -0
- package/src/resources/types/ChargeStatusParams.ts +8 -0
- package/src/resources/types/ChargeStatusResponse.ts +7 -0
- package/src/resources/types/ClaimAddress.ts +9 -0
- package/src/resources/types/ClaimCMS1500.ts +103 -0
- package/src/resources/types/ClaimDate.ts +7 -0
- package/src/resources/types/ClaimDatePeriod.ts +8 -0
- package/src/resources/types/ClaimDateWithQualifier.ts +8 -0
- package/src/resources/types/ClaimId.ts +6 -0
- package/src/resources/types/ClaimName.ts +8 -0
- package/src/resources/types/ConversationAddParticipantParams.ts +23 -0
- package/src/resources/types/ConversationCreateParams.ts +10 -0
- package/src/resources/types/ConversationCreateResponse.ts +12 -0
- package/src/resources/types/ConversationGetTokenResponse.ts +11 -0
- package/src/resources/types/ConversationMessageParams.ts +15 -0
- package/src/resources/types/ConversationRemoveParticipantParams.ts +13 -0
- package/src/resources/types/Developer.ts +23 -0
- package/src/resources/types/DeveloperDeleteParams.ts +5 -0
- package/src/resources/types/DeveloperGetParams.ts +5 -0
- package/src/resources/types/DeveloperGetResponse.ts +7 -0
- package/src/resources/types/DeveloperInviteParams.ts +20 -0
- package/src/resources/types/DeveloperInviteResponse.ts +25 -0
- package/src/resources/types/DeveloperListItem.ts +9 -0
- package/src/resources/types/DeveloperListResponse.ts +7 -0
- package/src/resources/types/DeveloperListV2Params.ts +13 -0
- package/src/resources/types/DeveloperListV2Response.ts +31 -0
- package/src/resources/types/DeveloperUpdateParams.ts +12 -0
- package/src/resources/types/DeveloperUpdateResponse.ts +7 -0
- package/src/resources/types/ErxAllergySearchParams.ts +5 -0
- package/src/resources/types/ErxAllergySearchResponse.ts +21 -0
- package/src/resources/types/ErxMedicationSearchParams.ts +8 -0
- package/src/resources/types/ErxMedicationSearchResponse.ts +40 -0
- package/src/resources/types/ErxSyncPatientParams.ts +5 -0
- package/src/resources/types/ErxSyncPatientResponse.ts +11 -0
- package/src/resources/types/M2m.ts +33 -0
- package/src/resources/types/M2mCreateParams.ts +23 -0
- package/src/resources/types/M2mCreateResponse.ts +7 -0
- package/src/resources/types/M2mDeleteParams.ts +5 -0
- package/src/resources/types/M2mGetParams.ts +5 -0
- package/src/resources/types/M2mGetResponse.ts +7 -0
- package/src/resources/types/M2mListItem.ts +28 -0
- package/src/resources/types/M2mListResponse.ts +7 -0
- package/src/resources/types/M2mListV2Params.ts +12 -0
- package/src/resources/types/M2mListV2Response.ts +18 -0
- package/src/resources/types/M2mRotateSecretParams.ts +5 -0
- package/src/resources/types/M2mRotateSecretResponse.ts +8 -0
- package/src/resources/types/M2mUpdateParams.ts +24 -0
- package/src/resources/types/M2mUpdateResponse.ts +7 -0
- package/src/resources/types/MessagingGetMessagingConfigResponse.ts +10 -0
- package/src/resources/types/MessagingServiceInfo.ts +16 -0
- package/src/resources/types/PaymentMethodDeleteParams.ts +18 -0
- package/src/resources/types/PaymentMethodListParams.ts +14 -0
- package/src/resources/types/PaymentMethodListResponse.ts +10 -0
- package/src/resources/types/PaymentMethodSetDefaultParams.ts +18 -0
- package/src/resources/types/PaymentMethodSetUpParams.ts +14 -0
- package/src/resources/types/PaymentMethodSetUpResponse.ts +11 -0
- package/src/resources/types/Project.ts +20 -0
- package/src/resources/types/ProjectGetResponse.ts +7 -0
- package/src/resources/types/ProjectUpdateParams.ts +18 -0
- package/src/resources/types/ProjectUpdateResponse.ts +7 -0
- package/src/resources/types/RcmEligibilityCheckParams.ts +8 -0
- package/src/resources/types/RcmEligibilityCheckResponse.ts +7 -0
- package/src/resources/types/RcmSubmitProfessionalClaimParams.ts +13 -0
- package/src/resources/types/RcmSubmitProfessionalClaimResponse.ts +7 -0
- package/src/resources/types/RcmValidateProfessionalClaimParams.ts +9 -0
- package/src/resources/types/RcmValidateProfessionalClaimResponse.ts +23 -0
- package/src/resources/types/Role.ts +19 -0
- package/src/resources/types/RoleCreateParams.ts +15 -0
- package/src/resources/types/RoleCreateResponse.ts +7 -0
- package/src/resources/types/RoleDeleteParams.ts +5 -0
- package/src/resources/types/RoleGetParams.ts +5 -0
- package/src/resources/types/RoleGetResponse.ts +7 -0
- package/src/resources/types/RoleListItem.ts +16 -0
- package/src/resources/types/RoleListResponse.ts +7 -0
- package/src/resources/types/RoleStub.ts +12 -0
- package/src/resources/types/RoleUpdateParams.ts +20 -0
- package/src/resources/types/RoleUpdateResponse.ts +7 -0
- package/src/resources/types/Secret.ts +12 -0
- package/src/resources/types/SecretDeleteParams.ts +5 -0
- package/src/resources/types/SecretGetParams.ts +5 -0
- package/src/resources/types/SecretGetResponse.ts +7 -0
- package/src/resources/types/SecretListItem.ts +8 -0
- package/src/resources/types/SecretListResponse.ts +7 -0
- package/src/resources/types/SecretSetParams.ts +12 -0
- package/src/resources/types/SecretSetResponse.ts +7 -0
- package/src/resources/types/TelemedCreateMeetingParams.ts +10 -0
- package/src/resources/types/TelemedCreateMeetingResponse.ts +12 -0
- package/src/resources/types/TelemedJoinMeetingParams.ts +6 -0
- package/src/resources/types/TelemedJoinMeetingResponse.ts +29 -0
- package/src/resources/types/TransactionalSMSSendParams.ts +12 -0
- package/src/resources/types/TransactionalSMSSendResponse.ts +11 -0
- package/src/resources/types/User.ts +39 -0
- package/src/resources/types/UserDeleteParams.ts +5 -0
- package/src/resources/types/UserGetParams.ts +5 -0
- package/src/resources/types/UserGetResponse.ts +7 -0
- package/src/resources/types/UserInviteParams.ts +38 -0
- package/src/resources/types/UserInviteResponse.ts +39 -0
- package/src/resources/types/UserListItem.ts +17 -0
- package/src/resources/types/UserListResponse.ts +7 -0
- package/src/resources/types/UserListV2Params.ts +13 -0
- package/src/resources/types/UserListV2Response.ts +18 -0
- package/src/resources/types/UserMeResponse.ts +7 -0
- package/src/resources/types/UserUpdateParams.ts +12 -0
- package/src/resources/types/UserUpdateResponse.ts +7 -0
- package/src/resources/types/VersionGetResponse.ts +19 -0
- package/src/resources/types/Z3CreateBucketParams.ts +5 -0
- package/src/resources/types/Z3CreateBucketResponse.ts +12 -0
- package/src/resources/types/Z3DeleteBucketParams.ts +5 -0
- package/src/resources/types/Z3DeleteObjectParams.ts +10 -0
- package/src/resources/types/Z3GetPresignedUrlParams.ts +11 -0
- package/src/resources/types/Z3GetPresignedUrlResponse.ts +11 -0
- package/src/resources/types/Z3ListBucketsResponse.ts +16 -0
- package/src/resources/types/Z3ListObjectsParams.ts +6 -0
- package/src/resources/types/Z3ListObjectsResponse.ts +15 -0
- package/src/resources/types/ZambdaCreateParams.ts +15 -0
- package/src/resources/types/ZambdaCreateResponse.ts +7 -0
- package/src/resources/types/ZambdaDeleteParams.ts +5 -0
- package/src/resources/types/ZambdaExecuteParams.ts +6 -0
- package/src/resources/types/ZambdaExecutePublicParams.ts +6 -0
- package/src/resources/types/ZambdaExecutePublicResponse.ts +7 -0
- package/src/resources/types/ZambdaExecuteResponse.ts +7 -0
- package/src/resources/types/ZambdaExecuteResult.ts +12 -0
- package/src/resources/types/ZambdaFunction.ts +41 -0
- package/src/resources/types/ZambdaGetParams.ts +5 -0
- package/src/resources/types/ZambdaGetResponse.ts +7 -0
- package/src/resources/types/ZambdaListResponse.ts +7 -0
- package/src/resources/types/ZambdaLogStreamGetParams.ts +10 -0
- package/src/resources/types/ZambdaLogStreamGetResponse.ts +29 -0
- package/src/resources/types/ZambdaLogStreamListParams.ts +6 -0
- package/src/resources/types/ZambdaLogStreamListResponse.ts +48 -0
- package/src/resources/types/ZambdaLogStreamSearchParams.ts +21 -0
- package/src/resources/types/ZambdaLogStreamSearchResponse.ts +25 -0
- package/src/resources/types/ZambdaS3UploadParams.ts +9 -0
- package/src/resources/types/ZambdaS3UploadResponse.ts +11 -0
- package/src/resources/types/ZambdaSchedule.ts +32 -0
- package/src/resources/types/ZambdaUpdateParams.ts +20 -0
- package/src/resources/types/ZambdaUpdateResponse.ts +7 -0
- package/src/resources/types/fhir.ts +75 -0
- package/src/resources/types/index.ts +160 -0
- package/turbo.json +13 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export * from './fhir';
|
|
2
|
+
export * from './Card';
|
|
3
|
+
export * from './ChargeDetails';
|
|
4
|
+
export * from './CardIdentifier';
|
|
5
|
+
export * from './Project';
|
|
6
|
+
export * from './ApplicationListItem';
|
|
7
|
+
export * from './Application';
|
|
8
|
+
export * from './RoleStub';
|
|
9
|
+
export * from './RoleListItem';
|
|
10
|
+
export * from './Role';
|
|
11
|
+
export * from './ZambdaSchedule';
|
|
12
|
+
export * from './ZambdaFunction';
|
|
13
|
+
export * from './ZambdaExecuteResult';
|
|
14
|
+
export * from './Secret';
|
|
15
|
+
export * from './SecretListItem';
|
|
16
|
+
export * from './UserListItem';
|
|
17
|
+
export * from './User';
|
|
18
|
+
export * from './DeveloperListItem';
|
|
19
|
+
export * from './Developer';
|
|
20
|
+
export * from './ClaimName';
|
|
21
|
+
export * from './ClaimDate';
|
|
22
|
+
export * from './ClaimDatePeriod';
|
|
23
|
+
export * from './ClaimDateWithQualifier';
|
|
24
|
+
export * from './ClaimAddress';
|
|
25
|
+
export * from './ClaimId';
|
|
26
|
+
export * from './ClaimCMS1500';
|
|
27
|
+
export * from './M2mListItem';
|
|
28
|
+
export * from './M2m';
|
|
29
|
+
export * from './AccessPolicy';
|
|
30
|
+
export * from './MessagingServiceInfo';
|
|
31
|
+
export * from './ApplicationListResponse';
|
|
32
|
+
export * from './ApplicationCreateParams';
|
|
33
|
+
export * from './ApplicationCreateResponse';
|
|
34
|
+
export * from './ApplicationGetParams';
|
|
35
|
+
export * from './ApplicationGetResponse';
|
|
36
|
+
export * from './ApplicationUpdateParams';
|
|
37
|
+
export * from './ApplicationUpdateResponse';
|
|
38
|
+
export * from './ApplicationDeleteParams';
|
|
39
|
+
export * from './ApplicationRotateSecretParams';
|
|
40
|
+
export * from './ApplicationRotateSecretResponse';
|
|
41
|
+
export * from './ApplicationRevokeRefreshTokenParams';
|
|
42
|
+
export * from './ApplicationRevokeRefreshTokenResponse';
|
|
43
|
+
export * from './ApplicationRevokeAccessTokenParams';
|
|
44
|
+
export * from './ApplicationRevokeAccessTokenResponse';
|
|
45
|
+
export * from './DeveloperGetParams';
|
|
46
|
+
export * from './DeveloperGetResponse';
|
|
47
|
+
export * from './DeveloperUpdateParams';
|
|
48
|
+
export * from './DeveloperUpdateResponse';
|
|
49
|
+
export * from './DeveloperDeleteParams';
|
|
50
|
+
export * from './DeveloperInviteParams';
|
|
51
|
+
export * from './DeveloperInviteResponse';
|
|
52
|
+
export * from './DeveloperListResponse';
|
|
53
|
+
export * from './DeveloperListV2Params';
|
|
54
|
+
export * from './DeveloperListV2Response';
|
|
55
|
+
export * from './M2mListResponse';
|
|
56
|
+
export * from './M2mCreateParams';
|
|
57
|
+
export * from './M2mCreateResponse';
|
|
58
|
+
export * from './M2mGetParams';
|
|
59
|
+
export * from './M2mGetResponse';
|
|
60
|
+
export * from './M2mUpdateParams';
|
|
61
|
+
export * from './M2mUpdateResponse';
|
|
62
|
+
export * from './M2mDeleteParams';
|
|
63
|
+
export * from './M2mRotateSecretParams';
|
|
64
|
+
export * from './M2mRotateSecretResponse';
|
|
65
|
+
export * from './M2mListV2Params';
|
|
66
|
+
export * from './M2mListV2Response';
|
|
67
|
+
export * from './MessagingGetMessagingConfigResponse';
|
|
68
|
+
export * from './ConversationCreateParams';
|
|
69
|
+
export * from './ConversationCreateResponse';
|
|
70
|
+
export * from './ConversationGetTokenResponse';
|
|
71
|
+
export * from './ConversationAddParticipantParams';
|
|
72
|
+
export * from './ConversationRemoveParticipantParams';
|
|
73
|
+
export * from './ConversationMessageParams';
|
|
74
|
+
export * from './TransactionalSMSSendParams';
|
|
75
|
+
export * from './TransactionalSMSSendResponse';
|
|
76
|
+
export * from './PaymentMethodSetUpParams';
|
|
77
|
+
export * from './PaymentMethodSetUpResponse';
|
|
78
|
+
export * from './PaymentMethodSetDefaultParams';
|
|
79
|
+
export * from './PaymentMethodDeleteParams';
|
|
80
|
+
export * from './PaymentMethodListParams';
|
|
81
|
+
export * from './PaymentMethodListResponse';
|
|
82
|
+
export * from './ChargeIssueParams';
|
|
83
|
+
export * from './ChargeStatusParams';
|
|
84
|
+
export * from './ChargeStatusResponse';
|
|
85
|
+
export * from './ProjectGetResponse';
|
|
86
|
+
export * from './ProjectUpdateParams';
|
|
87
|
+
export * from './ProjectUpdateResponse';
|
|
88
|
+
export * from './RcmEligibilityCheckParams';
|
|
89
|
+
export * from './RcmEligibilityCheckResponse';
|
|
90
|
+
export * from './RcmValidateProfessionalClaimParams';
|
|
91
|
+
export * from './RcmValidateProfessionalClaimResponse';
|
|
92
|
+
export * from './RcmSubmitProfessionalClaimParams';
|
|
93
|
+
export * from './RcmSubmitProfessionalClaimResponse';
|
|
94
|
+
export * from './ErxSyncPatientParams';
|
|
95
|
+
export * from './ErxSyncPatientResponse';
|
|
96
|
+
export * from './ErxAllergySearchParams';
|
|
97
|
+
export * from './ErxAllergySearchResponse';
|
|
98
|
+
export * from './ErxMedicationSearchParams';
|
|
99
|
+
export * from './ErxMedicationSearchResponse';
|
|
100
|
+
export * from './RoleListResponse';
|
|
101
|
+
export * from './RoleCreateParams';
|
|
102
|
+
export * from './RoleCreateResponse';
|
|
103
|
+
export * from './RoleGetParams';
|
|
104
|
+
export * from './RoleGetResponse';
|
|
105
|
+
export * from './RoleUpdateParams';
|
|
106
|
+
export * from './RoleUpdateResponse';
|
|
107
|
+
export * from './RoleDeleteParams';
|
|
108
|
+
export * from './SecretListResponse';
|
|
109
|
+
export * from './SecretSetParams';
|
|
110
|
+
export * from './SecretSetResponse';
|
|
111
|
+
export * from './SecretGetParams';
|
|
112
|
+
export * from './SecretGetResponse';
|
|
113
|
+
export * from './SecretDeleteParams';
|
|
114
|
+
export * from './TelemedCreateMeetingParams';
|
|
115
|
+
export * from './TelemedCreateMeetingResponse';
|
|
116
|
+
export * from './TelemedJoinMeetingParams';
|
|
117
|
+
export * from './TelemedJoinMeetingResponse';
|
|
118
|
+
export * from './UserMeResponse';
|
|
119
|
+
export * from './UserGetParams';
|
|
120
|
+
export * from './UserGetResponse';
|
|
121
|
+
export * from './UserUpdateParams';
|
|
122
|
+
export * from './UserUpdateResponse';
|
|
123
|
+
export * from './UserDeleteParams';
|
|
124
|
+
export * from './UserInviteParams';
|
|
125
|
+
export * from './UserInviteResponse';
|
|
126
|
+
export * from './UserListResponse';
|
|
127
|
+
export * from './UserListV2Params';
|
|
128
|
+
export * from './UserListV2Response';
|
|
129
|
+
export * from './VersionGetResponse';
|
|
130
|
+
export * from './Z3ListBucketsResponse';
|
|
131
|
+
export * from './Z3CreateBucketParams';
|
|
132
|
+
export * from './Z3CreateBucketResponse';
|
|
133
|
+
export * from './Z3DeleteBucketParams';
|
|
134
|
+
export * from './Z3ListObjectsParams';
|
|
135
|
+
export * from './Z3ListObjectsResponse';
|
|
136
|
+
export * from './Z3GetPresignedUrlParams';
|
|
137
|
+
export * from './Z3GetPresignedUrlResponse';
|
|
138
|
+
export * from './Z3DeleteObjectParams';
|
|
139
|
+
export * from './ZambdaListResponse';
|
|
140
|
+
export * from './ZambdaCreateParams';
|
|
141
|
+
export * from './ZambdaCreateResponse';
|
|
142
|
+
export * from './ZambdaGetParams';
|
|
143
|
+
export * from './ZambdaGetResponse';
|
|
144
|
+
export * from './ZambdaUpdateParams';
|
|
145
|
+
export * from './ZambdaUpdateResponse';
|
|
146
|
+
export * from './ZambdaDeleteParams';
|
|
147
|
+
export * from './ZambdaExecuteParams';
|
|
148
|
+
export * from './ZambdaExecuteResponse';
|
|
149
|
+
export * from './ZambdaExecutePublicParams';
|
|
150
|
+
export * from './ZambdaExecutePublicResponse';
|
|
151
|
+
export * from './ZambdaLogStreamListParams';
|
|
152
|
+
export * from './ZambdaLogStreamListResponse';
|
|
153
|
+
export * from './ZambdaS3UploadParams';
|
|
154
|
+
export * from './ZambdaS3UploadResponse';
|
|
155
|
+
export * from './ZambdaLogStreamSearchParams';
|
|
156
|
+
export * from './ZambdaLogStreamSearchResponse';
|
|
157
|
+
export * from './ZambdaLogStreamGetParams';
|
|
158
|
+
export * from './ZambdaLogStreamGetResponse';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const accessToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IllhcGtmeERqb3FvVnR1YUtlcHllZyJ9.eyJpc3MiOiJodHRwczovL2Rldi1hdXRoLnphcGVoci5jb20vIiwic3ViIjoiYXV0aDB8NjQ4MjRmYTYxODY2YmVmY2NiNTU5NTY4IiwiYXVkIjpbImh0dHBzOi8vZGV2LmFwaS56YXBlaHIuY29tIiwiaHR0cHM6Ly96YXBlaHItZGV2LnVzLmF1dGgwLmNvbS91c2VyaW5mbyJdLCJpYXQiOjE2ODYyNjE2NzIsImV4cCI6MTY4NjM0ODA3MiwiYXpwIjoiZzNPV0xIb1dhUEhHWkRyd1lTYW5QdDBCcUp6ZXgzTnYiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIn0.EBSaOYp5NMJ94GZyd9cg57QWnozlN-ua4XAO3iIrPal16yWOW-_TeVgj-1j-PwAhHaxW8QoTuojMXwhWVkNUwUw1AomxFubrvL98jm871VMZTXayQRGGlZHUsREmUDWpojGKAf0wAegEPC-kSw5KAc79V5SOrcVzhTmk5AMnR1aDzck9ZbXpTCPWWmyjyf4BiCb4N3zw3Zt3iQ0c5YDKvdMa_aAKiUZ9jaOw1TnQZ4tivKsn2uVfRGPZ5WFmj7B2MQTpzw4rokHtnSYtbKb-1h5wMxsdmzy_gKMYYaiPGqkJVt1twtjH9O1nZZMSDjGQI5B96TnrVjBFm6ow8jpBKg";
|
|
2
|
+
export declare const projectId = "eb1306aa-fba5-416a-a2a4-6b69eca58d87";
|
|
3
|
+
export declare const FHIR_API_URL = "http://localhost:3030/dev";
|
|
4
|
+
export declare const PLATFORM_API_URL = "http://localhost:3031/dev";
|
|
5
|
+
export declare const PROJECT_API_URL = "http://localhost:3032/dev";
|
|
6
|
+
export declare const FHIR_VERSION: import("@zapehr/core").FhirVersion;
|
|
7
|
+
export declare const config: {
|
|
8
|
+
accessToken: string;
|
|
9
|
+
projectId: string;
|
|
10
|
+
fhirApiUrl: string;
|
|
11
|
+
projectApiUrl: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function registerUserAndProject(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oystehr/sdk",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Oystehr SDK",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"lint": "eslint .",
|
|
7
|
+
"check-types": "tsc --noEmit",
|
|
8
|
+
"clean": "rimraf dist",
|
|
9
|
+
"build": "npm run clean && npm run rollup",
|
|
10
|
+
"rollup": "npm run rollup-cjs && npm run rollup-mjs",
|
|
11
|
+
"rollup-cjs": "node --max-old-space-size=8192 ../../node_modules/rollup/dist/bin/rollup --config rollup.config-cjs.mjs",
|
|
12
|
+
"rollup-mjs": "node --max-old-space-size=8192 ../../node_modules/rollup/dist/bin/rollup --config rollup.config-mjs.mjs",
|
|
13
|
+
"test": "jest \".*\\.ts\" --runInBand",
|
|
14
|
+
"parser": "ts-node debug-parser.ts",
|
|
15
|
+
"publish-to-npmjs": "npm run build && npm publish",
|
|
16
|
+
"publish-to-npmjs-next": "npm run build && npm publish --tag next",
|
|
17
|
+
"generate": "ts-node scripts/generate-sdk-v3 project src/resources"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"npm": ">=8.0.0",
|
|
21
|
+
"node": ">=18.0.0"
|
|
22
|
+
},
|
|
23
|
+
"author": "Oystehr <info@oystehr.com>",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"main": "dist/cjs/index.cjs",
|
|
26
|
+
"module": "dist/esm/index.js",
|
|
27
|
+
"exports": {
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/esm/index.d.ts",
|
|
30
|
+
"default": "./dist/esm/index.js"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./dist/cjs/index.d.cts",
|
|
34
|
+
"default": "./dist/cjs/index.cjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@types/fhir": "0.0.41",
|
|
39
|
+
"@types/node": "20.11.25",
|
|
40
|
+
"fast-json-patch": "3.1.1",
|
|
41
|
+
"uuid": "10.0.0"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"oystehr",
|
|
45
|
+
"zapehr",
|
|
46
|
+
"zap",
|
|
47
|
+
"ehr ",
|
|
48
|
+
"medical",
|
|
49
|
+
"healthcare",
|
|
50
|
+
"headless",
|
|
51
|
+
"fhir",
|
|
52
|
+
"r4b",
|
|
53
|
+
"r4",
|
|
54
|
+
"r5",
|
|
55
|
+
"dstu2",
|
|
56
|
+
"stu3",
|
|
57
|
+
"hl7"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import json from '@rollup/plugin-json';
|
|
2
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
+
import typescript from '@rollup/plugin-typescript';
|
|
4
|
+
import { mkdirSync, writeFileSync } from 'fs';
|
|
5
|
+
import terser from '@rollup/plugin-terser';
|
|
6
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
7
|
+
import externals from 'rollup-plugin-node-externals';
|
|
8
|
+
|
|
9
|
+
const extensions = ['.ts', '.json'];
|
|
10
|
+
|
|
11
|
+
const sourcemapPathTransform = (path) => path.replaceAll('\\', '/').replaceAll('../../../src', '../../src');
|
|
12
|
+
|
|
13
|
+
export default [
|
|
14
|
+
{
|
|
15
|
+
// special entrypoint for commonjs default export syntax
|
|
16
|
+
input: 'src/index.cts',
|
|
17
|
+
output: [
|
|
18
|
+
{
|
|
19
|
+
file: 'dist/cjs/index.cjs',
|
|
20
|
+
format: 'cjs',
|
|
21
|
+
name: 'osytehr.sdk',
|
|
22
|
+
sourcemap: true,
|
|
23
|
+
sourcemapPathTransform,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
file: 'dist/cjs/index.min.cjs',
|
|
27
|
+
format: 'cjs',
|
|
28
|
+
name: 'osytehr.sdk',
|
|
29
|
+
plugins: [terser()],
|
|
30
|
+
sourcemap: true,
|
|
31
|
+
sourcemapPathTransform,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
plugins: [
|
|
35
|
+
json(),
|
|
36
|
+
externals(),
|
|
37
|
+
typescript({ tsconfig: 'tsconfig.cjs.json', resolveJsonModule: true }),
|
|
38
|
+
commonjs(),
|
|
39
|
+
resolve({ extensions }),
|
|
40
|
+
{
|
|
41
|
+
buildEnd: () => {
|
|
42
|
+
mkdirSync('./dist/cjs', { recursive: true });
|
|
43
|
+
writeFileSync('./dist/cjs/package.json', '{"type": "commonjs"}');
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
strictDeprecations: true,
|
|
48
|
+
},
|
|
49
|
+
];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import json from '@rollup/plugin-json';
|
|
2
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
+
import typescript from '@rollup/plugin-typescript';
|
|
4
|
+
import { mkdirSync, writeFileSync } from 'fs';
|
|
5
|
+
import terser from '@rollup/plugin-terser';
|
|
6
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
7
|
+
import externals from 'rollup-plugin-node-externals';
|
|
8
|
+
|
|
9
|
+
const extensions = ['.ts', '.json'];
|
|
10
|
+
|
|
11
|
+
const sourcemapPathTransform = (path) => path.replaceAll('\\', '/').replaceAll('../../../src', '../../src');
|
|
12
|
+
|
|
13
|
+
export default [
|
|
14
|
+
{
|
|
15
|
+
input: 'src/index.ts',
|
|
16
|
+
output: [
|
|
17
|
+
{
|
|
18
|
+
dir: 'dist/esm',
|
|
19
|
+
format: 'esm',
|
|
20
|
+
preserveModules: true,
|
|
21
|
+
preserveModulesRoot: 'src',
|
|
22
|
+
sourcemap: true,
|
|
23
|
+
sourcemapPathTransform,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
file: 'dist/esm/index.min.js',
|
|
27
|
+
format: 'esm',
|
|
28
|
+
plugins: [terser()],
|
|
29
|
+
sourcemap: true,
|
|
30
|
+
sourcemapPathTransform,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
plugins: [
|
|
34
|
+
json(),
|
|
35
|
+
externals(),
|
|
36
|
+
resolve({ extensions }),
|
|
37
|
+
typescript({ tsconfig: 'tsconfig.esm.json', resolveJsonModule: true }),
|
|
38
|
+
commonjs(),
|
|
39
|
+
{
|
|
40
|
+
buildEnd: () => {
|
|
41
|
+
mkdirSync('./dist/esm/node_modules/tslib', { recursive: true });
|
|
42
|
+
writeFileSync('./dist/esm/package.json', '{"type": "module"}');
|
|
43
|
+
writeFileSync('./dist/esm/node_modules/tslib/package.json', '{"type": "module"}');
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
strictDeprecations: true,
|
|
48
|
+
},
|
|
49
|
+
];
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
import { OystehrConfig } from '../config';
|
|
3
|
+
import { OystehrFHIRError, OystehrSdkError } from '../errors';
|
|
4
|
+
import { FhirBundle, FhirResource, OperationOutcome } from '../resources/types';
|
|
5
|
+
|
|
6
|
+
type HttpMethod = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace';
|
|
7
|
+
const defaultProjectApiUrl = 'https://project-api.zapehr.com/v1';
|
|
8
|
+
const defaultFhirApiUrl = 'https://fhir-api.zapehr.com';
|
|
9
|
+
const STATUS_CODES_TO_RETRY = [408, 429, 500, 502, 503, 504];
|
|
10
|
+
const ERROR_CODES_TO_RETRY = [
|
|
11
|
+
'ECONNRESET',
|
|
12
|
+
'ECONNREFUSED',
|
|
13
|
+
'EPIPE',
|
|
14
|
+
'ETIMEDOUT',
|
|
15
|
+
'UND_ERR_CONNECT_TIMEOUT',
|
|
16
|
+
'UND_ERR_HEADERS_TIMEOUT',
|
|
17
|
+
'UND_ERR_HEADERS_TIMEOUT',
|
|
18
|
+
'UND_ERR_SOCKET',
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Optional parameter that can be passed to the client methods. It allows
|
|
23
|
+
* overriding the access token or project ID, and setting various headers,
|
|
24
|
+
* such as 'Content-Type'.
|
|
25
|
+
*/
|
|
26
|
+
export interface OystehrClientRequest {
|
|
27
|
+
/**
|
|
28
|
+
* The access token to use for the request. If not provided, the access token from `oystehr.init()` will be used.
|
|
29
|
+
*/
|
|
30
|
+
accessToken?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The project ID to use for the request. If not provided, the project ID from `oystehr.init()` will be used.
|
|
33
|
+
*/
|
|
34
|
+
projectId?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The value of the 'Content-Type' header to use for the request.
|
|
37
|
+
*/
|
|
38
|
+
contentType?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Unique identifier for this request.
|
|
41
|
+
*/
|
|
42
|
+
requestId?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface InternalClientRequest extends OystehrClientRequest {
|
|
46
|
+
ifMatch?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type FhirData<T extends FhirResource> = T | T[] | FhirBundle<T>;
|
|
50
|
+
export type FhirFetcherResponse<T extends FhirData<FhirResource> = any> = T;
|
|
51
|
+
|
|
52
|
+
export class SDKResource {
|
|
53
|
+
private readonly config: OystehrConfig;
|
|
54
|
+
constructor(config: OystehrConfig) {
|
|
55
|
+
this.config = config;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
request(path: string, method: string): FetcherFunction {
|
|
59
|
+
return async (params: any, request?: InternalClientRequest): Promise<FetcherResponse> => {
|
|
60
|
+
const baseUrlThunk = (): string => this.config.projectApiUrl ?? defaultProjectApiUrl;
|
|
61
|
+
const configThunk = (): OystehrConfig => this.config;
|
|
62
|
+
try {
|
|
63
|
+
return await fetcher(baseUrlThunk, configThunk, path, method)(params, request);
|
|
64
|
+
} catch (err: any) {
|
|
65
|
+
const error = err as { message: string; code: number };
|
|
66
|
+
throw new OystehrSdkError({ message: error.message, code: error.code });
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
fhirRequest<T extends FhirResource = any>(path: string, method: string) {
|
|
72
|
+
return async (params: any, request?: InternalClientRequest): Promise<FhirFetcherResponse<T>> => {
|
|
73
|
+
try {
|
|
74
|
+
const baseUrlThunk = (): string => this.config.fhirApiUrl ?? defaultFhirApiUrl;
|
|
75
|
+
const configThunk = (): OystehrConfig => this.config;
|
|
76
|
+
// must await here to catch
|
|
77
|
+
return await fetcher(baseUrlThunk, configThunk, path, method)(params, request);
|
|
78
|
+
} catch (err: unknown) {
|
|
79
|
+
// FHIR API error messages are JSON strings
|
|
80
|
+
const fullError = err as { message: string | Record<string, any>; code: number };
|
|
81
|
+
if (typeof fullError.message === 'string') {
|
|
82
|
+
throw new OystehrSdkError({
|
|
83
|
+
message: fullError.message,
|
|
84
|
+
code: fullError.code,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
throw new OystehrFHIRError({
|
|
88
|
+
error: fullError.message as OperationOutcome,
|
|
89
|
+
code: fullError.code,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type FetcherError = { message: string; code: number };
|
|
97
|
+
export type FetcherResponse = any;
|
|
98
|
+
export type FetcherFunction = (
|
|
99
|
+
params?: Record<string, any> | [any] | InternalClientRequest,
|
|
100
|
+
request?: InternalClientRequest
|
|
101
|
+
) => Promise<FetcherResponse>;
|
|
102
|
+
|
|
103
|
+
function isInternalClientRequest(request: Record<string, any>): request is InternalClientRequest {
|
|
104
|
+
return 'accessToken' in request;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function fetcher(
|
|
108
|
+
baseUrlThunk: () => string,
|
|
109
|
+
configThunk: () => OystehrConfig,
|
|
110
|
+
path: string,
|
|
111
|
+
methodParam: string
|
|
112
|
+
): FetcherFunction {
|
|
113
|
+
return async (
|
|
114
|
+
params?: Record<string, unknown> | [any] | InternalClientRequest,
|
|
115
|
+
request?: InternalClientRequest
|
|
116
|
+
): Promise<FetcherResponse> => {
|
|
117
|
+
// this function supports multiple signatures. fetcher(baseUrl, path, method)(params, request) or fetcher(baseUrl, path, method)(request)
|
|
118
|
+
// or fetcher(baseUrl, path, method)(params) or fetcher(baseUrl, path, method)(). the types for this are handled by Client<Path, Methods>
|
|
119
|
+
// and this is the backend implementation behind it. the heuristic we're using is that if the first param is an object with an accessToken
|
|
120
|
+
// and there is no second param, assume the first one is the request object instead
|
|
121
|
+
const providedParams: Record<string, unknown> | [any] =
|
|
122
|
+
!!params && !request && !Array.isArray(params) && isInternalClientRequest(params)
|
|
123
|
+
? {}
|
|
124
|
+
: (params as Record<string, unknown>) ?? {};
|
|
125
|
+
const requestCtx =
|
|
126
|
+
!!params && !request && !Array.isArray(params) && isInternalClientRequest(params)
|
|
127
|
+
? (params as InternalClientRequest)
|
|
128
|
+
: request;
|
|
129
|
+
const method = methodParam.toLowerCase() as HttpMethod;
|
|
130
|
+
const config = configThunk();
|
|
131
|
+
const fetchImpl = config.fetch ?? fetch;
|
|
132
|
+
const accessToken = requestCtx?.accessToken ?? config.accessToken;
|
|
133
|
+
const projectId = requestCtx?.projectId ?? configThunk().projectId;
|
|
134
|
+
let finalPath = path;
|
|
135
|
+
let finalParams = providedParams;
|
|
136
|
+
if (!Array.isArray(providedParams)) {
|
|
137
|
+
const [subbedPath, addlParams] = subParamsInPath(path, providedParams);
|
|
138
|
+
finalPath = subbedPath;
|
|
139
|
+
finalParams = addlParams;
|
|
140
|
+
}
|
|
141
|
+
finalPath = finalPath.replace(/^\//, ''); // remove leading slash
|
|
142
|
+
const baseUrlEvaluated = baseUrlThunk();
|
|
143
|
+
const fullBaseUrl = baseUrlEvaluated.endsWith('/') ? baseUrlEvaluated : baseUrlEvaluated + '/';
|
|
144
|
+
const url = new URL(finalPath, fullBaseUrl);
|
|
145
|
+
let body: any;
|
|
146
|
+
|
|
147
|
+
if (Array.isArray(finalParams)) {
|
|
148
|
+
body = JSON.stringify(finalParams);
|
|
149
|
+
} else if (Object.keys(finalParams).length) {
|
|
150
|
+
if (method === 'get') {
|
|
151
|
+
addParamsToSearch(finalParams, url.searchParams);
|
|
152
|
+
} else if (requestCtx?.contentType === 'application/x-www-form-urlencoded') {
|
|
153
|
+
const search = new URLSearchParams();
|
|
154
|
+
addParamsToSearch(finalParams, search);
|
|
155
|
+
body = search.toString();
|
|
156
|
+
} else {
|
|
157
|
+
body = JSON.stringify(finalParams);
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
// override for rpc call
|
|
161
|
+
if (requestCtx?.contentType !== 'application/x-www-form-urlencoded' && method === 'post') {
|
|
162
|
+
body = '{}';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const headers: Record<string, string> = Object.assign(
|
|
167
|
+
projectId
|
|
168
|
+
? {
|
|
169
|
+
'x-zapehr-project-id': projectId,
|
|
170
|
+
'x-oystehr-project-id': projectId,
|
|
171
|
+
}
|
|
172
|
+
: {},
|
|
173
|
+
{
|
|
174
|
+
'content-type': requestCtx?.contentType ?? 'application/json',
|
|
175
|
+
},
|
|
176
|
+
accessToken ? { Authorization: `Bearer ${accessToken}` } : {},
|
|
177
|
+
requestCtx?.ifMatch ? { 'If-Match': requestCtx.ifMatch } : {},
|
|
178
|
+
{ 'x-oystehr-request-id': requestCtx?.requestId ?? uuidv4() }
|
|
179
|
+
);
|
|
180
|
+
const retryConfig: ConstructedRetryConfig = {
|
|
181
|
+
retries: config.retry?.retries ?? 3,
|
|
182
|
+
onRetry: config.retry?.onRetry,
|
|
183
|
+
// Using array instead of set because the length is too short for uniqueness to be important
|
|
184
|
+
retryOn: [...(config.retry?.retryOn ?? []), ...STATUS_CODES_TO_RETRY],
|
|
185
|
+
};
|
|
186
|
+
retryConfig.retryOn.push(...STATUS_CODES_TO_RETRY);
|
|
187
|
+
return retry(async (attempt) => {
|
|
188
|
+
const response = await fetchImpl(
|
|
189
|
+
new Request(url, {
|
|
190
|
+
method: method.toUpperCase(),
|
|
191
|
+
body,
|
|
192
|
+
headers,
|
|
193
|
+
})
|
|
194
|
+
);
|
|
195
|
+
const responseBody = response.body ? await response.text() : null;
|
|
196
|
+
let responseJson: Record<string, unknown> | null;
|
|
197
|
+
try {
|
|
198
|
+
responseJson =
|
|
199
|
+
responseBody &&
|
|
200
|
+
(response.headers.get('content-type')?.includes('application/json') ||
|
|
201
|
+
response.headers.get('content-type')?.includes('application/fhir+json'))
|
|
202
|
+
? JSON.parse(responseBody)
|
|
203
|
+
: null;
|
|
204
|
+
} catch (err) {
|
|
205
|
+
// ignore JSON.parse errors
|
|
206
|
+
responseJson = null;
|
|
207
|
+
}
|
|
208
|
+
const isError = !response.ok || response.status >= 400;
|
|
209
|
+
if (isError) {
|
|
210
|
+
headers['x-oystehr-fetch-attempts'] = `${attempt}`;
|
|
211
|
+
const errObj = {
|
|
212
|
+
message: responseJson?.message ?? responseJson ?? responseBody ?? response.statusText,
|
|
213
|
+
code: responseJson?.code ?? response.status,
|
|
214
|
+
response,
|
|
215
|
+
};
|
|
216
|
+
throw errObj;
|
|
217
|
+
}
|
|
218
|
+
return responseJson;
|
|
219
|
+
}, retryConfig);
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
type ConstructedRetryConfig = Omit<NonNullable<OystehrConfig['retry']>, 'retryOn'> & {
|
|
224
|
+
retryOn: NonNullable<NonNullable<OystehrConfig['retry']>['retryOn']>;
|
|
225
|
+
};
|
|
226
|
+
async function retry<T>(work: (attempt: number) => Promise<T>, config: ConstructedRetryConfig): Promise<T> {
|
|
227
|
+
let lastErr;
|
|
228
|
+
for (const attempt of Array.from({ length: (config.retries ?? 0) + 1 }, (_, index) => index)) {
|
|
229
|
+
try {
|
|
230
|
+
return await work(attempt);
|
|
231
|
+
} catch (e: any) {
|
|
232
|
+
let isRetryable = false;
|
|
233
|
+
if ('response' in e) {
|
|
234
|
+
// error from API
|
|
235
|
+
const err = e as FetcherError;
|
|
236
|
+
isRetryable = config.retryOn.includes(err.code);
|
|
237
|
+
// Removes response
|
|
238
|
+
lastErr = { message: e.message, code: e.code };
|
|
239
|
+
} else {
|
|
240
|
+
lastErr = e;
|
|
241
|
+
// error from fetch
|
|
242
|
+
if ('code' in e && typeof e.code === 'string') {
|
|
243
|
+
const err = e as { code: string };
|
|
244
|
+
isRetryable = ERROR_CODES_TO_RETRY.includes(err.code);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (!isRetryable) {
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
if (config.onRetry && attempt !== (config.retries ?? 0)) {
|
|
251
|
+
config.onRetry(attempt + 1);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
throw lastErr;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Substitutes params in a path and returns the path with params substituted and any unused params.
|
|
260
|
+
*
|
|
261
|
+
* Uses the property names in the params object to determine the param to substitute in the path.
|
|
262
|
+
*
|
|
263
|
+
* @param path JSON API resource URI
|
|
264
|
+
* @param params all params provided to the client method
|
|
265
|
+
* @returns resource URI with params substituted and any unused params
|
|
266
|
+
*/
|
|
267
|
+
function subParamsInPath(path: string, params: Record<string, unknown>): [string, Record<string, string>] {
|
|
268
|
+
const unusedParams = { ...params };
|
|
269
|
+
// capture everything of the form `{paramName}` and replace with the value of `params[paramName]`
|
|
270
|
+
const subbedPath = path.replace(/\{([^}]+)\}/g, (_, paramName) => {
|
|
271
|
+
delete unusedParams[paramName];
|
|
272
|
+
// override for path params that are paths, indicated by a `+` at the end
|
|
273
|
+
if (paramName.match(/^.*\+$/)) {
|
|
274
|
+
return params[paramName] + '';
|
|
275
|
+
}
|
|
276
|
+
// error if param value is empty
|
|
277
|
+
if (!params[paramName] || params[paramName] === '') {
|
|
278
|
+
throw new OystehrSdkError({ message: `Required path parameter is an empty string: ${paramName}`, code: 400 });
|
|
279
|
+
}
|
|
280
|
+
// encode search params
|
|
281
|
+
if (params[paramName]) {
|
|
282
|
+
return encodeURIComponent(params[paramName] + ''); // coerce to string
|
|
283
|
+
}
|
|
284
|
+
return '';
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
const unusedKeys = Object.keys(unusedParams);
|
|
288
|
+
const addlParams = unusedKeys.length
|
|
289
|
+
? unusedKeys.reduce((acc, key) => ({ ...acc, [key]: unusedParams[key] }), {})
|
|
290
|
+
: {};
|
|
291
|
+
return [subbedPath, addlParams];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Adds params to a URLSearchParams object in such a way as to preserve array values.
|
|
296
|
+
* @param params params
|
|
297
|
+
* @param search URLSearchParams object
|
|
298
|
+
*/
|
|
299
|
+
export function addParamsToSearch(params: Record<string, unknown>, search: URLSearchParams): void {
|
|
300
|
+
for (const [key, value] of Object.entries(params)) {
|
|
301
|
+
if (Array.isArray(value)) {
|
|
302
|
+
value.forEach((v) => search.append(key, v as string));
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
search.append(key, value as string);
|
|
306
|
+
}
|
|
307
|
+
}
|