@oystehr/sdk 3.0.5 → 3.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +24 -8
  2. package/dist/cjs/client/client.d.ts +1 -1
  3. package/dist/cjs/config.d.ts +5 -0
  4. package/dist/cjs/errors/index.d.ts +4 -1
  5. package/dist/cjs/index.cjs +255 -92
  6. package/dist/cjs/index.cjs.map +1 -1
  7. package/dist/cjs/index.min.cjs +1 -1
  8. package/dist/cjs/index.min.cjs.map +1 -1
  9. package/dist/cjs/resources/classes/application.d.ts +1 -0
  10. package/dist/cjs/resources/classes/charge.d.ts +1 -0
  11. package/dist/cjs/resources/classes/conversation.d.ts +1 -0
  12. package/dist/cjs/resources/classes/developer.d.ts +1 -0
  13. package/dist/cjs/resources/classes/erx.d.ts +10 -1
  14. package/dist/cjs/resources/classes/fax.d.ts +31 -0
  15. package/dist/cjs/resources/classes/fhir.d.ts +1 -0
  16. package/dist/cjs/resources/classes/index.d.ts +2 -0
  17. package/dist/cjs/resources/classes/m2m.d.ts +1 -0
  18. package/dist/cjs/resources/classes/messaging.d.ts +1 -0
  19. package/dist/cjs/resources/classes/paymentMethod.d.ts +1 -0
  20. package/dist/cjs/resources/classes/project.d.ts +1 -0
  21. package/dist/cjs/resources/classes/rcm.d.ts +2 -1
  22. package/dist/cjs/resources/classes/role.d.ts +1 -0
  23. package/dist/cjs/resources/classes/secret.d.ts +1 -0
  24. package/dist/cjs/resources/classes/telemed.d.ts +1 -0
  25. package/dist/cjs/resources/classes/transactionalSMS.d.ts +1 -0
  26. package/dist/cjs/resources/classes/user.d.ts +1 -0
  27. package/dist/cjs/resources/classes/version.d.ts +1 -0
  28. package/dist/cjs/resources/classes/z3.d.ts +1 -0
  29. package/dist/cjs/resources/classes/zambda.d.ts +1 -0
  30. package/dist/cjs/resources/classes/zambdaLogStream.d.ts +1 -0
  31. package/dist/cjs/resources/types/DeveloperInviteResponse.d.ts +0 -4
  32. package/dist/cjs/resources/types/ErxCancelOrderParams.d.ts +6 -0
  33. package/dist/cjs/resources/types/ErxCancelOrderResponse.d.ts +6 -0
  34. package/dist/cjs/resources/types/ErxCancelPrescriptionParams.d.ts +6 -0
  35. package/dist/cjs/resources/types/ErxCancelPrescriptionResponse.d.ts +6 -0
  36. package/dist/cjs/resources/types/FaxSendParams.d.ts +18 -0
  37. package/dist/cjs/resources/types/FaxSendResponse.d.ts +10 -0
  38. package/dist/cjs/resources/types/index.d.ts +6 -0
  39. package/dist/cjs/tests/setup/constants.d.ts +2 -6
  40. package/dist/cjs/tests/setup/global.d.ts +1 -0
  41. package/dist/esm/client/client.d.ts +1 -1
  42. package/dist/esm/client/client.js +4 -4
  43. package/dist/esm/client/client.js.map +1 -1
  44. package/dist/esm/config.d.ts +5 -0
  45. package/dist/esm/errors/index.d.ts +4 -1
  46. package/dist/esm/errors/index.js +18 -2
  47. package/dist/esm/errors/index.js.map +1 -1
  48. package/dist/esm/index.min.js +1 -1
  49. package/dist/esm/index.min.js.map +1 -1
  50. package/dist/esm/resources/classes/application.d.ts +1 -0
  51. package/dist/esm/resources/classes/application.js +12 -8
  52. package/dist/esm/resources/classes/application.js.map +1 -1
  53. package/dist/esm/resources/classes/charge.d.ts +1 -0
  54. package/dist/esm/resources/classes/charge.js +6 -2
  55. package/dist/esm/resources/classes/charge.js.map +1 -1
  56. package/dist/esm/resources/classes/conversation.d.ts +1 -0
  57. package/dist/esm/resources/classes/conversation.js +9 -5
  58. package/dist/esm/resources/classes/conversation.js.map +1 -1
  59. package/dist/esm/resources/classes/developer.d.ts +1 -0
  60. package/dist/esm/resources/classes/developer.js +10 -6
  61. package/dist/esm/resources/classes/developer.js.map +1 -1
  62. package/dist/esm/resources/classes/erx.d.ts +10 -1
  63. package/dist/esm/resources/classes/erx.js +20 -4
  64. package/dist/esm/resources/classes/erx.js.map +1 -1
  65. package/dist/esm/resources/classes/fax.d.ts +31 -0
  66. package/dist/esm/resources/classes/fax.js +45 -0
  67. package/dist/esm/resources/classes/fax.js.map +1 -0
  68. package/dist/esm/resources/classes/fhir.d.ts +1 -0
  69. package/dist/esm/resources/classes/fhir.js +4 -0
  70. package/dist/esm/resources/classes/fhir.js.map +1 -1
  71. package/dist/esm/resources/classes/index.d.ts +2 -0
  72. package/dist/esm/resources/classes/index.js +7 -0
  73. package/dist/esm/resources/classes/index.js.map +1 -1
  74. package/dist/esm/resources/classes/m2m.d.ts +1 -0
  75. package/dist/esm/resources/classes/m2m.js +11 -7
  76. package/dist/esm/resources/classes/m2m.js.map +1 -1
  77. package/dist/esm/resources/classes/messaging.d.ts +1 -0
  78. package/dist/esm/resources/classes/messaging.js +5 -1
  79. package/dist/esm/resources/classes/messaging.js.map +1 -1
  80. package/dist/esm/resources/classes/paymentMethod.d.ts +1 -0
  81. package/dist/esm/resources/classes/paymentMethod.js +8 -4
  82. package/dist/esm/resources/classes/paymentMethod.js.map +1 -1
  83. package/dist/esm/resources/classes/project.d.ts +1 -0
  84. package/dist/esm/resources/classes/project.js +6 -2
  85. package/dist/esm/resources/classes/project.js.map +1 -1
  86. package/dist/esm/resources/classes/rcm.d.ts +2 -1
  87. package/dist/esm/resources/classes/rcm.js +8 -4
  88. package/dist/esm/resources/classes/rcm.js.map +1 -1
  89. package/dist/esm/resources/classes/role.d.ts +1 -0
  90. package/dist/esm/resources/classes/role.js +9 -5
  91. package/dist/esm/resources/classes/role.js.map +1 -1
  92. package/dist/esm/resources/classes/secret.d.ts +1 -0
  93. package/dist/esm/resources/classes/secret.js +8 -4
  94. package/dist/esm/resources/classes/secret.js.map +1 -1
  95. package/dist/esm/resources/classes/telemed.d.ts +1 -0
  96. package/dist/esm/resources/classes/telemed.js +6 -2
  97. package/dist/esm/resources/classes/telemed.js.map +1 -1
  98. package/dist/esm/resources/classes/transactionalSMS.d.ts +1 -0
  99. package/dist/esm/resources/classes/transactionalSMS.js +5 -1
  100. package/dist/esm/resources/classes/transactionalSMS.js.map +1 -1
  101. package/dist/esm/resources/classes/user.d.ts +1 -0
  102. package/dist/esm/resources/classes/user.js +11 -7
  103. package/dist/esm/resources/classes/user.js.map +1 -1
  104. package/dist/esm/resources/classes/version.d.ts +1 -0
  105. package/dist/esm/resources/classes/version.js +5 -1
  106. package/dist/esm/resources/classes/version.js.map +1 -1
  107. package/dist/esm/resources/classes/z3-ext.js +9 -5
  108. package/dist/esm/resources/classes/z3-ext.js.map +1 -1
  109. package/dist/esm/resources/classes/z3.d.ts +1 -0
  110. package/dist/esm/resources/classes/z3.js +10 -6
  111. package/dist/esm/resources/classes/z3.js.map +1 -1
  112. package/dist/esm/resources/classes/zambda-ext.js +5 -1
  113. package/dist/esm/resources/classes/zambda-ext.js.map +1 -1
  114. package/dist/esm/resources/classes/zambda.d.ts +1 -0
  115. package/dist/esm/resources/classes/zambda.js +12 -8
  116. package/dist/esm/resources/classes/zambda.js.map +1 -1
  117. package/dist/esm/resources/classes/zambdaLogStream.d.ts +1 -0
  118. package/dist/esm/resources/classes/zambdaLogStream.js +7 -3
  119. package/dist/esm/resources/classes/zambdaLogStream.js.map +1 -1
  120. package/dist/esm/resources/types/DeveloperInviteResponse.d.ts +0 -4
  121. package/dist/esm/resources/types/ErxCancelOrderParams.d.ts +6 -0
  122. package/dist/esm/resources/types/ErxCancelOrderResponse.d.ts +6 -0
  123. package/dist/esm/resources/types/ErxCancelPrescriptionParams.d.ts +6 -0
  124. package/dist/esm/resources/types/ErxCancelPrescriptionResponse.d.ts +6 -0
  125. package/dist/esm/resources/types/FaxSendParams.d.ts +18 -0
  126. package/dist/esm/resources/types/FaxSendResponse.d.ts +10 -0
  127. package/dist/esm/resources/types/index.d.ts +6 -0
  128. package/dist/esm/tests/setup/constants.d.ts +2 -6
  129. package/dist/esm/tests/setup/global.d.ts +1 -0
  130. package/package.json +4 -4
  131. package/src/client/client.ts +6 -6
  132. package/src/config.ts +5 -0
  133. package/src/errors/index.ts +18 -2
  134. package/src/resources/classes/application.ts +15 -8
  135. package/src/resources/classes/charge.ts +5 -2
  136. package/src/resources/classes/conversation.ts +20 -5
  137. package/src/resources/classes/developer.ts +9 -6
  138. package/src/resources/classes/erx.ts +26 -4
  139. package/src/resources/classes/fax.ts +44 -0
  140. package/src/resources/classes/fhir.ts +3 -0
  141. package/src/resources/classes/index.ts +6 -0
  142. package/src/resources/classes/m2m.ts +10 -7
  143. package/src/resources/classes/messaging.ts +4 -1
  144. package/src/resources/classes/paymentMethod.ts +7 -4
  145. package/src/resources/classes/project.ts +5 -2
  146. package/src/resources/classes/rcm.ts +7 -4
  147. package/src/resources/classes/role.ts +8 -5
  148. package/src/resources/classes/secret.ts +7 -4
  149. package/src/resources/classes/telemed.ts +5 -2
  150. package/src/resources/classes/transactionalSMS.ts +4 -1
  151. package/src/resources/classes/user.ts +10 -7
  152. package/src/resources/classes/version.ts +4 -1
  153. package/src/resources/classes/z3-ext.ts +10 -4
  154. package/src/resources/classes/z3.ts +9 -6
  155. package/src/resources/classes/zambda-ext.ts +5 -1
  156. package/src/resources/classes/zambda.ts +11 -8
  157. package/src/resources/classes/zambdaLogStream.ts +10 -3
  158. package/src/resources/types/DeveloperInviteResponse.ts +0 -4
  159. package/src/resources/types/ErxCancelOrderParams.ts +8 -0
  160. package/src/resources/types/ErxCancelOrderResponse.ts +8 -0
  161. package/src/resources/types/ErxCancelPrescriptionParams.ts +8 -0
  162. package/src/resources/types/ErxCancelPrescriptionResponse.ts +8 -0
  163. package/src/resources/types/FaxSendParams.ts +20 -0
  164. package/src/resources/types/FaxSendResponse.ts +12 -0
  165. package/src/resources/types/index.ts +6 -0
  166. /package/dist/cjs/tests/{common.d.ts → integrational/common.d.ts} +0 -0
  167. /package/dist/esm/tests/{common.d.ts → integrational/common.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"zambda.js","sources":["../../../../src/resources/classes/zambda.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n ZambdaCreateParams,\n ZambdaCreateResponse,\n ZambdaDeleteParams,\n ZambdaExecuteParams,\n ZambdaExecutePublicParams,\n ZambdaExecutePublicResponse,\n ZambdaExecuteResponse,\n ZambdaGetParams,\n ZambdaGetResponse,\n ZambdaListResponse,\n ZambdaS3UploadParams,\n ZambdaS3UploadResponse,\n ZambdaUpdateParams,\n ZambdaUpdateResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\nimport * as ext from './zambda-ext';\n\nexport class Zambda extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n uploadFile = ext.uploadFile;\n /**\n * Get a list of all Zambda Functions in the Project. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:ListAllFunctions`\n * Access Policy Resource: `Zambda:Function`\n */\n list(request?: OystehrClientRequest): Promise<ZambdaListResponse> {\n return this.request('/zambda', 'get')(request);\n }\n /**\n * Create a new Zambda Function. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:CreateFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n create(params: ZambdaCreateParams, request?: OystehrClientRequest): Promise<ZambdaCreateResponse> {\n return this.request('/zambda', 'post')(params, request);\n }\n /**\n * Get the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:GetFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n get(params: ZambdaGetParams, request?: OystehrClientRequest): Promise<ZambdaGetResponse> {\n return this.request('/zambda/{id}', 'get')(params, request);\n }\n /**\n * Update the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:UpdateFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n update(params: ZambdaUpdateParams, request?: OystehrClientRequest): Promise<ZambdaUpdateResponse> {\n return this.request('/zambda/{id}', 'patch')(params, request);\n }\n /**\n * Delete the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:DeleteFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n delete(params: ZambdaDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/zambda/{id}', 'delete')(params, request);\n }\n /**\n * Execute the [Authenticated Zambda Function](https://docs.oystehr.com/services/zambda/types/authenticated/) with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:InvokeFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n execute(params: ZambdaExecuteParams, request?: OystehrClientRequest): Promise<ZambdaExecuteResponse> {\n return this.request('/zambda/{id}/execute', 'post')(params, request);\n }\n /**\n * Execute the [Public Zambda Function](https://docs.oystehr.com/services/zambda/types/public/) with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Execute a zambda that has method http_open. This endpoint is public so there are no access policy requirements.\n */\n executePublic(\n params: ZambdaExecutePublicParams,\n request?: OystehrClientRequest\n ): Promise<ZambdaExecutePublicResponse> {\n return this.request('/zambda/{id}/execute-public', 'post')(params, request);\n }\n /**\n * Returns a URL that is used to deploy code to the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:UpdateFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n s3Upload(params: ZambdaS3UploadParams, request?: OystehrClientRequest): Promise<ZambdaS3UploadResponse> {\n return this.request('/zambda/{id}/s3-upload', 'post')(params, request);\n }\n}\n"],"names":["ext.uploadFile"],"mappings":";;;AAAA;AAuBM,MAAO,MAAO,SAAQ,WAAW,CAAA;AACrC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;AAEhB,QAAA,IAAA,CAAA,UAAU,GAAGA,UAAc,CAAC;KAD3B;AAED;;;;;AAKG;AACH,IAAA,IAAI,CAAC,OAA8B,EAAA;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;KAChD;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAA0B,EAAE,OAA8B,EAAA;AAC/D,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACzD;AACD;;;;;AAKG;IACH,GAAG,CAAC,MAAuB,EAAE,OAA8B,EAAA;AACzD,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7D;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAA0B,EAAE,OAA8B,EAAA;AAC/D,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/D;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAA0B,EAAE,OAA8B,EAAA;AAC/D,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChE;AACD;;;;;AAKG;IACH,OAAO,CAAC,MAA2B,EAAE,OAA8B,EAAA;AACjE,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtE;AACD;;;;AAIG;IACH,aAAa,CACX,MAAiC,EACjC,OAA8B,EAAA;AAE9B,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7E;AACD;;;;;AAKG;IACH,QAAQ,CAAC,MAA4B,EAAE,OAA8B,EAAA;AACnE,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACxE;AACF;;;;"}
1
+ {"version":3,"file":"zambda.js","sources":["../../../../src/resources/classes/zambda.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n ZambdaCreateParams,\n ZambdaCreateResponse,\n ZambdaDeleteParams,\n ZambdaExecuteParams,\n ZambdaExecutePublicParams,\n ZambdaExecutePublicResponse,\n ZambdaExecuteResponse,\n ZambdaGetParams,\n ZambdaGetResponse,\n ZambdaListResponse,\n ZambdaS3UploadParams,\n ZambdaS3UploadResponse,\n ZambdaUpdateParams,\n ZambdaUpdateResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\nimport * as ext from './zambda-ext';\n\nexport class Zambda extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n uploadFile = ext.uploadFile;\n /**\n * Get a list of all Zambda Functions in the Project. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:ListAllFunctions`\n * Access Policy Resource: `Zambda:Function`\n */\n list(request?: OystehrClientRequest): Promise<ZambdaListResponse> {\n return this.request('/zambda', 'get', this.baseUrlThunk.bind(this))(request);\n }\n /**\n * Create a new Zambda Function. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:CreateFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n create(params: ZambdaCreateParams, request?: OystehrClientRequest): Promise<ZambdaCreateResponse> {\n return this.request('/zambda', 'post', this.baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:GetFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n get(params: ZambdaGetParams, request?: OystehrClientRequest): Promise<ZambdaGetResponse> {\n return this.request('/zambda/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Update the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:UpdateFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n update(params: ZambdaUpdateParams, request?: OystehrClientRequest): Promise<ZambdaUpdateResponse> {\n return this.request('/zambda/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:DeleteFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n delete(params: ZambdaDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/zambda/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Execute the [Authenticated Zambda Function](https://docs.oystehr.com/services/zambda/types/authenticated/) with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:InvokeFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n execute(params: ZambdaExecuteParams, request?: OystehrClientRequest): Promise<ZambdaExecuteResponse> {\n return this.request('/zambda/{id}/execute', 'post', this.baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Execute the [Public Zambda Function](https://docs.oystehr.com/services/zambda/types/public/) with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Execute a zambda that has method http_open. This endpoint is public so there are no access policy requirements.\n */\n executePublic(\n params: ZambdaExecutePublicParams,\n request?: OystehrClientRequest\n ): Promise<ZambdaExecutePublicResponse> {\n return this.request('/zambda/{id}/execute-public', 'post', this.baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Returns a URL that is used to deploy code to the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:UpdateFunction`\n * Access Policy Resource: `Zambda:Function`\n */\n s3Upload(params: ZambdaS3UploadParams, request?: OystehrClientRequest): Promise<ZambdaS3UploadResponse> {\n return this.request('/zambda/{id}/s3-upload', 'post', this.baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["ext.uploadFile"],"mappings":";;;AAAA;AAuBM,MAAO,MAAO,SAAQ,WAAW,CAAA;AACrC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;AAKhB,QAAA,IAAA,CAAA,UAAU,GAAGA,UAAc,CAAC;KAJ3B;IACD,YAAY,GAAA;;AACV,QAAA,OAAO,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,eAAe,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,mCAAmC,CAAC;KACvF;AAED;;;;;AAKG;AACH,IAAA,IAAI,CAAC,OAA8B,EAAA;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAC9E;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAA0B,EAAE,OAA8B,EAAA;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACvF;AACD;;;;;AAKG;IACH,GAAG,CAAC,MAAuB,EAAE,OAA8B,EAAA;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC3F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAA0B,EAAE,OAA8B,EAAA;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAA0B,EAAE,OAA8B,EAAA;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC9F;AACD;;;;;AAKG;IACH,OAAO,CAAC,MAA2B,EAAE,OAA8B,EAAA;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpG;AACD;;;;AAIG;IACH,aAAa,CACX,MAAiC,EACjC,OAA8B,EAAA;QAE9B,OAAO,IAAI,CAAC,OAAO,CAAC,6BAA6B,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC3G;AACD;;;;;AAKG;IACH,QAAQ,CAAC,MAA4B,EAAE,OAA8B,EAAA;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtG;AACF;;;;"}
@@ -3,6 +3,7 @@ import { SDKResource } from '../../client/client';
3
3
  import { OystehrConfig } from '../../config';
4
4
  export declare class ZambdaLogStream extends SDKResource {
5
5
  constructor(config: OystehrConfig);
6
+ baseUrlThunk(): string;
6
7
  /**
7
8
  * Get the log streams for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
8
9
  *
@@ -5,6 +5,10 @@ class ZambdaLogStream extends SDKResource {
5
5
  constructor(config) {
6
6
  super(config);
7
7
  }
8
+ baseUrlThunk() {
9
+ var _a, _b;
10
+ return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : 'https://project-api.zapehr.com/v1';
11
+ }
8
12
  /**
9
13
  * Get the log streams for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
10
14
  *
@@ -12,7 +16,7 @@ class ZambdaLogStream extends SDKResource {
12
16
  * Access Policy Resource: `Zambda:Function`
13
17
  */
14
18
  list(params, request) {
15
- return this.request('/zambda/{id}/logStream', 'post')(params, request);
19
+ return this.request('/zambda/{id}/logStream', 'post', this.baseUrlThunk.bind(this))(params, request);
16
20
  }
17
21
  /**
18
22
  * Get all logs for the Zambda Function with the provided ID, filtered by any of: text in messages, minimum start date, and/or maximum end date. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
@@ -21,7 +25,7 @@ class ZambdaLogStream extends SDKResource {
21
25
  * Access Policy Resource: `Zambda:Function`
22
26
  */
23
27
  search(params, request) {
24
- return this.request('/zambda/{id}/logStream/search', 'post')(params, request);
28
+ return this.request('/zambda/{id}/logStream/search', 'post', this.baseUrlThunk.bind(this))(params, request);
25
29
  }
26
30
  /**
27
31
  * Get the logs from the specified log stream for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
@@ -30,7 +34,7 @@ class ZambdaLogStream extends SDKResource {
30
34
  * Access Policy Resource: `Zambda:Function`
31
35
  */
32
36
  get(params, request) {
33
- return this.request('/zambda/{id}/logStream/{logStreamName}', 'post')(params, request);
37
+ return this.request('/zambda/{id}/logStream/{logStreamName}', 'post', this.baseUrlThunk.bind(this))(params, request);
34
38
  }
35
39
  }
36
40
 
@@ -1 +1 @@
1
- {"version":3,"file":"zambdaLogStream.js","sources":["../../../../src/resources/classes/zambdaLogStream.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n ZambdaLogStreamGetParams,\n ZambdaLogStreamGetResponse,\n ZambdaLogStreamListParams,\n ZambdaLogStreamListResponse,\n ZambdaLogStreamSearchParams,\n ZambdaLogStreamSearchResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class ZambdaLogStream extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n /**\n * Get the log streams for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:ReadLogs`\n * Access Policy Resource: `Zambda:Function`\n */\n list(params: ZambdaLogStreamListParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamListResponse> {\n return this.request('/zambda/{id}/logStream', 'post')(params, request);\n }\n /**\n * Get all logs for the Zambda Function with the provided ID, filtered by any of: text in messages, minimum start date, and/or maximum end date. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:ReadLogs`\n * Access Policy Resource: `Zambda:Function`\n */\n search(params: ZambdaLogStreamSearchParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamSearchResponse> {\n return this.request('/zambda/{id}/logStream/search', 'post')(params, request);\n }\n /**\n * Get the logs from the specified log stream for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:ReadLogs`\n * Access Policy Resource: `Zambda:Function`\n */\n get(params: ZambdaLogStreamGetParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamGetResponse> {\n return this.request('/zambda/{id}/logStream/{logStreamName}', 'post')(params, request);\n }\n}\n"],"names":[],"mappings":";;AAAA;AAcM,MAAO,eAAgB,SAAQ,WAAW,CAAA;AAC9C,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;AACD;;;;;AAKG;IACH,IAAI,CAAC,MAAiC,EAAE,OAA8B,EAAA;AACpE,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACxE;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAmC,EAAE,OAA8B,EAAA;AACxE,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,+BAA+B,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/E;AACD;;;;;AAKG;IACH,GAAG,CAAC,MAAgC,EAAE,OAA8B,EAAA;AAClE,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,wCAAwC,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACxF;AACF;;;;"}
1
+ {"version":3,"file":"zambdaLogStream.js","sources":["../../../../src/resources/classes/zambdaLogStream.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n ZambdaLogStreamGetParams,\n ZambdaLogStreamGetResponse,\n ZambdaLogStreamListParams,\n ZambdaLogStreamListResponse,\n ZambdaLogStreamSearchParams,\n ZambdaLogStreamSearchResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class ZambdaLogStream extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * Get the log streams for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:ReadLogs`\n * Access Policy Resource: `Zambda:Function`\n */\n list(params: ZambdaLogStreamListParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamListResponse> {\n return this.request('/zambda/{id}/logStream', 'post', this.baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get all logs for the Zambda Function with the provided ID, filtered by any of: text in messages, minimum start date, and/or maximum end date. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:ReadLogs`\n * Access Policy Resource: `Zambda:Function`\n */\n search(params: ZambdaLogStreamSearchParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamSearchResponse> {\n return this.request('/zambda/{id}/logStream/search', 'post', this.baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get the logs from the specified log stream for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.\n *\n * Access Policy Action: `Zambda:ReadLogs`\n * Access Policy Resource: `Zambda:Function`\n */\n get(params: ZambdaLogStreamGetParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamGetResponse> {\n return this.request(\n '/zambda/{id}/logStream/{logStreamName}',\n 'post',\n this.baseUrlThunk.bind(this)\n )(params, request);\n }\n}\n"],"names":[],"mappings":";;AAAA;AAcM,MAAO,eAAgB,SAAQ,WAAW,CAAA;AAC9C,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,YAAY,GAAA;;AACV,QAAA,OAAO,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,eAAe,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,mCAAmC,CAAC;KACvF;AACD;;;;;AAKG;IACH,IAAI,CAAC,MAAiC,EAAE,OAA8B,EAAA;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtG;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAmC,EAAE,OAA8B,EAAA;QACxE,OAAO,IAAI,CAAC,OAAO,CAAC,+BAA+B,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7G;AACD;;;;;AAKG;IACH,GAAG,CAAC,MAAgC,EAAE,OAA8B,EAAA;QAClE,OAAO,IAAI,CAAC,OAAO,CACjB,wCAAwC,EACxC,MAAM,EACN,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAC7B,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpB;AACF;;;;"}
@@ -12,10 +12,6 @@ export interface DeveloperInviteResponse {
12
12
  * The ID of the FHIR Practitioner resource that represents the developer. Also known as the Developer's "profile".
13
13
  */
14
14
  practitionerId: string;
15
- /**
16
- * The ID of the invite
17
- */
18
- invitationUrl: string;
19
15
  /**
20
16
  * The roles assigned to the developer.
21
17
  */
@@ -0,0 +1,6 @@
1
+ export interface ErxCancelOrderParams {
2
+ /**
3
+ * A photon id of the order to cancel.
4
+ */
5
+ orderId: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Cancelled order
3
+ */
4
+ export interface ErxCancelOrderResponse {
5
+ orderId: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ export interface ErxCancelPrescriptionParams {
2
+ /**
3
+ * A photon id of the prescription to cancel.
4
+ */
5
+ prescriptionId: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Cancelled prescription
3
+ */
4
+ export interface ErxCancelPrescriptionResponse {
5
+ prescriptionId: string;
6
+ }
@@ -0,0 +1,18 @@
1
+ export interface FaxSendParams {
2
+ /**
3
+ * A Z3 URL of the document you want to send. Your user must have access to this document.
4
+ */
5
+ media: string;
6
+ /**
7
+ * The quality of the document you want sent.
8
+ */
9
+ quality: 'standard' | 'fine' | 'superfine';
10
+ /**
11
+ * The recipient of the fax. This must be a valid FHIR CareTeam, HealthcareService, Organization, Patient, Practitioner, PractitionerRole, or RelatedPerson relative reference in the format: `the-resource-type/some-valid-uuid`. This reference must be a valid resource and have a number in the `telecom` field with a `system` of `fax`.
12
+ */
13
+ recipient: string;
14
+ /**
15
+ * The sender of the fax. This must be a valid FHIR HealthcareService, Organization, Patient, Practitioner, PractitionerRole, or RelatedPerson relative reference in the format: `the-resource-type/some-valid-uuid`. This reference must be a valid resource and have your [onboarded fax number](https://docs.oystehr.com/services/fax/number/) in the `telecom` field with a `system` of `fax`.
16
+ */
17
+ sender: string;
18
+ }
@@ -0,0 +1,10 @@
1
+ import { Communication } from 'fhir/r4b';
2
+ /**
3
+ * Successfully sent a fax.
4
+ */
5
+ export interface FaxSendResponse {
6
+ /**
7
+ * The FHIR Communication resource that represents the sent fax in the FHIR Store modified to include the https://extensions.fhir.oystehr.com/outbound-fax-status extension which holds the fax status that will be updated automatically.
8
+ */
9
+ communicationResource: Communication;
10
+ }
@@ -95,6 +95,10 @@ export * from './ErxSyncPatientParams';
95
95
  export * from './ErxSyncPatientResponse';
96
96
  export * from './ErxAllergySearchParams';
97
97
  export * from './ErxAllergySearchResponse';
98
+ export * from './ErxCancelOrderParams';
99
+ export * from './ErxCancelOrderResponse';
100
+ export * from './ErxCancelPrescriptionParams';
101
+ export * from './ErxCancelPrescriptionResponse';
98
102
  export * from './ErxMedicationSearchParams';
99
103
  export * from './ErxMedicationSearchResponse';
100
104
  export * from './ErxMedicationSearchV2Params';
@@ -158,3 +162,5 @@ export * from './ZambdaLogStreamSearchParams';
158
162
  export * from './ZambdaLogStreamSearchResponse';
159
163
  export * from './ZambdaLogStreamGetParams';
160
164
  export * from './ZambdaLogStreamGetResponse';
165
+ export * from './FaxSendParams';
166
+ export * from './FaxSendResponse';
@@ -1,12 +1,8 @@
1
+ import { OystehrConfig } from '../../config';
1
2
  export declare const accessToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IllhcGtmeERqb3FvVnR1YUtlcHllZyJ9.eyJpc3MiOiJodHRwczovL2Rldi1hdXRoLnphcGVoci5jb20vIiwic3ViIjoiYXV0aDB8NjQ4MjRmYTYxODY2YmVmY2NiNTU5NTY4IiwiYXVkIjpbImh0dHBzOi8vZGV2LmFwaS56YXBlaHIuY29tIiwiaHR0cHM6Ly96YXBlaHItZGV2LnVzLmF1dGgwLmNvbS91c2VyaW5mbyJdLCJpYXQiOjE2ODYyNjE2NzIsImV4cCI6MTY4NjM0ODA3MiwiYXpwIjoiZzNPV0xIb1dhUEhHWkRyd1lTYW5QdDBCcUp6ZXgzTnYiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIn0.EBSaOYp5NMJ94GZyd9cg57QWnozlN-ua4XAO3iIrPal16yWOW-_TeVgj-1j-PwAhHaxW8QoTuojMXwhWVkNUwUw1AomxFubrvL98jm871VMZTXayQRGGlZHUsREmUDWpojGKAf0wAegEPC-kSw5KAc79V5SOrcVzhTmk5AMnR1aDzck9ZbXpTCPWWmyjyf4BiCb4N3zw3Zt3iQ0c5YDKvdMa_aAKiUZ9jaOw1TnQZ4tivKsn2uVfRGPZ5WFmj7B2MQTpzw4rokHtnSYtbKb-1h5wMxsdmzy_gKMYYaiPGqkJVt1twtjH9O1nZZMSDjGQI5B96TnrVjBFm6ow8jpBKg";
2
3
  export declare const projectId = "eb1306aa-fba5-416a-a2a4-6b69eca58d87";
3
4
  export declare const FHIR_API_URL = "http://localhost:3030/dev";
4
5
  export declare const PLATFORM_API_URL = "http://localhost:3031/dev";
5
6
  export declare const PROJECT_API_URL = "http://localhost:3032/dev";
6
7
  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
- };
8
+ export declare const config: OystehrConfig;
@@ -1 +1,2 @@
1
+ export declare function register(authToken: string, desiredProjectId?: string): Promise<string>;
1
2
  export default function registerUserAndProject(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oystehr/sdk",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "Oystehr SDK",
5
5
  "scripts": {
6
6
  "lint": "eslint .",
@@ -10,11 +10,11 @@
10
10
  "rollup": "npm run rollup-cjs && npm run rollup-mjs",
11
11
  "rollup-cjs": "node --max-old-space-size=8192 ../../node_modules/rollup/dist/bin/rollup --config rollup.config-cjs.mjs",
12
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",
13
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest --runInBand",
14
14
  "parser": "ts-node debug-parser.ts",
15
15
  "publish-to-npmjs": "npm run build && npm publish",
16
16
  "publish-to-npmjs-next": "npm run build && npm publish --tag next",
17
- "generate": "ts-node scripts/generate-sdk-v3 project src/resources"
17
+ "generate": "ts-node scripts/generate-sdk-v3 project,fax src/resources"
18
18
  },
19
19
  "engines": {
20
20
  "npm": ">=8.0.0",
@@ -56,4 +56,4 @@
56
56
  "stu3",
57
57
  "hl7"
58
58
  ]
59
- }
59
+ }
@@ -55,15 +55,14 @@ export class SDKResource {
55
55
  this.config = config;
56
56
  }
57
57
 
58
- protected request(path: string, method: string): FetcherFunction {
58
+ protected request(path: string, method: string, baseUrlThunk: () => string): FetcherFunction {
59
59
  return async (params: any, request?: InternalClientRequest): Promise<FetcherResponse> => {
60
- const baseUrlThunk = (): string => this.config.projectApiUrl ?? defaultProjectApiUrl;
61
60
  const configThunk = (): OystehrConfig => this.config;
62
61
  try {
63
62
  return await fetcher(baseUrlThunk, configThunk, path, method)(params, request);
64
63
  } catch (err: any) {
65
- const error = err as { message: string; code: number };
66
- throw new OystehrSdkError({ message: error.message, code: error.code });
64
+ const error = err as { message: string; code: number; cause?: unknown };
65
+ throw new OystehrSdkError({ message: error.message, code: error.code, cause: error.cause });
67
66
  }
68
67
  };
69
68
  }
@@ -71,17 +70,18 @@ export class SDKResource {
71
70
  protected fhirRequest<T extends FhirResource = any>(path: string, method: string) {
72
71
  return async (params: any, request?: InternalClientRequest): Promise<FhirFetcherResponse<T>> => {
73
72
  try {
74
- const baseUrlThunk = (): string => this.config.fhirApiUrl ?? defaultFhirApiUrl;
73
+ const baseUrlThunk = (): string => this.config.services?.fhirApiUrl ?? defaultFhirApiUrl;
75
74
  const configThunk = (): OystehrConfig => this.config;
76
75
  // must await here to catch
77
76
  return await fetcher(baseUrlThunk, configThunk, path, method)(params, request);
78
77
  } catch (err: unknown) {
79
78
  // FHIR API error messages are JSON strings
80
- const fullError = err as { message: string | Record<string, any>; code: number };
79
+ const fullError = err as { message: string | Record<string, any>; code: number; cause?: unknown };
81
80
  if (typeof fullError.message === 'string') {
82
81
  throw new OystehrSdkError({
83
82
  message: fullError.message,
84
83
  code: fullError.code,
84
+ cause: fullError.cause,
85
85
  });
86
86
  }
87
87
  throw new OystehrFHIRError({
package/src/config.ts CHANGED
@@ -12,6 +12,11 @@ export interface OystehrConfig {
12
12
  projectId?: string;
13
13
  fhirApiUrl?: string;
14
14
  projectApiUrl?: string;
15
+ services?: {
16
+ faxApiUrl?: string;
17
+ fhirApiUrl?: string;
18
+ projectApiUrl?: string;
19
+ };
15
20
  /**
16
21
  * Optionally provide a custom fetch implementation. This must conform to the
17
22
  * built-in node.js fetch implementation (undici fetch).
@@ -3,8 +3,8 @@ import { OperationOutcome as OperationOutcomeR5 } from 'fhir/r5';
3
3
 
4
4
  export class OystehrSdkError extends Error {
5
5
  code: number;
6
- constructor({ message, code }: { message: string; code: number }) {
7
- super(message);
6
+ constructor({ message, code, cause }: { message: string; code: number; cause?: unknown }) {
7
+ super(message, { cause });
8
8
  Object.setPrototypeOf(this, OystehrSdkError.prototype);
9
9
  this.code = code;
10
10
  this.name = 'OystehrSdkError';
@@ -12,6 +12,14 @@ export class OystehrSdkError extends Error {
12
12
  toString(): string {
13
13
  return `${this.name}: ${this.message} (code: ${this.code})`;
14
14
  }
15
+ toJSON(): any {
16
+ return {
17
+ name: this.name,
18
+ message: this.message,
19
+ code: this.code,
20
+ cause: this.cause,
21
+ };
22
+ }
15
23
  }
16
24
 
17
25
  function transformOperationOutcomeToErrorMessage(cause: OperationOutcomeR4B | OperationOutcomeR5): string {
@@ -38,4 +46,12 @@ export class OystehrFHIRError extends OystehrSdkError {
38
46
  this.cause = error as OperationOutcomeR4B | OperationOutcomeR5;
39
47
  this.name = 'OystehrFHIRError';
40
48
  }
49
+ toJSON(): any {
50
+ return {
51
+ name: this.name,
52
+ message: this.message,
53
+ code: this.code,
54
+ cause: this.cause,
55
+ };
56
+ }
41
57
  }
@@ -24,6 +24,9 @@ export class Application extends SDKResource {
24
24
  constructor(config: OystehrConfig) {
25
25
  super(config);
26
26
  }
27
+ baseUrlThunk(): string {
28
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
29
+ }
27
30
  /**
28
31
  * Get a list of Applications. [Applications](https://docs.oystehr.com/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
29
32
  *
@@ -31,7 +34,7 @@ export class Application extends SDKResource {
31
34
  * Access Policy Resource: `App:Application`
32
35
  */
33
36
  list(request?: OystehrClientRequest): Promise<ApplicationListResponse> {
34
- return this.request('/application', 'get')(request);
37
+ return this.request('/application', 'get', this.baseUrlThunk.bind(this))(request);
35
38
  }
36
39
  /**
37
40
  * Create a new Application. [Applications](https://docs.oystehr.com/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
@@ -40,7 +43,7 @@ export class Application extends SDKResource {
40
43
  * Access Policy Resource: `App:Application`
41
44
  */
42
45
  create(params: ApplicationCreateParams, request?: OystehrClientRequest): Promise<ApplicationCreateResponse> {
43
- return this.request('/application', 'post')(params, request);
46
+ return this.request('/application', 'post', this.baseUrlThunk.bind(this))(params, request);
44
47
  }
45
48
  /**
46
49
  * Get the Application with the provided ID. [Applications](https://docs.oystehr.com/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
@@ -49,7 +52,7 @@ export class Application extends SDKResource {
49
52
  * Access Policy Resource: `App:Application`
50
53
  */
51
54
  get(params: ApplicationGetParams, request?: OystehrClientRequest): Promise<ApplicationGetResponse> {
52
- return this.request('/application/{id}', 'get')(params, request);
55
+ return this.request('/application/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);
53
56
  }
54
57
  /**
55
58
  * Update the Application with the provided ID. [Applications](https://docs.oystehr.com/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
@@ -58,7 +61,7 @@ export class Application extends SDKResource {
58
61
  * Access Policy Resource: `App:Application`
59
62
  */
60
63
  update(params: ApplicationUpdateParams, request?: OystehrClientRequest): Promise<ApplicationUpdateResponse> {
61
- return this.request('/application/{id}', 'patch')(params, request);
64
+ return this.request('/application/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);
62
65
  }
63
66
  /**
64
67
  * Delete the Application with the provided ID. [Applications](https://docs.oystehr.com/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
@@ -67,7 +70,7 @@ export class Application extends SDKResource {
67
70
  * Access Policy Resource: `App:Application`
68
71
  */
69
72
  delete(params: ApplicationDeleteParams, request?: OystehrClientRequest): Promise<void> {
70
- return this.request('/application/{id}', 'delete')(params, request);
73
+ return this.request('/application/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);
71
74
  }
72
75
  /**
73
76
  * Rotate client's secrete associated with an application.
@@ -79,7 +82,7 @@ export class Application extends SDKResource {
79
82
  params: ApplicationRotateSecretParams,
80
83
  request?: OystehrClientRequest
81
84
  ): Promise<ApplicationRotateSecretResponse> {
82
- return this.request('/application/{id}/rotate-secret', 'post')(params, request);
85
+ return this.request('/application/{id}/rotate-secret', 'post', this.baseUrlThunk.bind(this))(params, request);
83
86
  }
84
87
  /**
85
88
  * Revokes user's refresh token issued for the application.
@@ -91,7 +94,11 @@ export class Application extends SDKResource {
91
94
  params: ApplicationRevokeRefreshTokenParams,
92
95
  request?: OystehrClientRequest
93
96
  ): Promise<ApplicationRevokeRefreshTokenResponse> {
94
- return this.request('/application/{id}/revoke-refresh-token', 'post')(params, request);
97
+ return this.request(
98
+ '/application/{id}/revoke-refresh-token',
99
+ 'post',
100
+ this.baseUrlThunk.bind(this)
101
+ )(params, request);
95
102
  }
96
103
  /**
97
104
  * Revokes user's access token issued for the application.
@@ -103,6 +110,6 @@ export class Application extends SDKResource {
103
110
  params: ApplicationRevokeAccessTokenParams,
104
111
  request?: OystehrClientRequest
105
112
  ): Promise<ApplicationRevokeAccessTokenResponse> {
106
- return this.request('/application/{id}/revoke-access-token', 'post')(params, request);
113
+ return this.request('/application/{id}/revoke-access-token', 'post', this.baseUrlThunk.bind(this))(params, request);
107
114
  }
108
115
  }
@@ -8,6 +8,9 @@ export class Charge extends SDKResource {
8
8
  constructor(config: OystehrConfig) {
9
9
  super(config);
10
10
  }
11
+ baseUrlThunk(): string {
12
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
13
+ }
11
14
  /**
12
15
  * Charge patient's default payment method for a specified encounter or charge item.
13
16
  *
@@ -20,7 +23,7 @@ export class Charge extends SDKResource {
20
23
  * Access Policy Resources: `FHIR:Patient:*,FHIR:Encounter:*,FHIR:Coverage:*`
21
24
  */
22
25
  issue(params: ChargeIssueParams, request?: OystehrClientRequest): Promise<void> {
23
- return this.request('/payment/charge/issue', 'post')(params, request);
26
+ return this.request('/payment/charge/issue', 'post', this.baseUrlThunk.bind(this))(params, request);
24
27
  }
25
28
  /**
26
29
  * Retrieve charge status for a specified encounter or charge item.
@@ -34,6 +37,6 @@ export class Charge extends SDKResource {
34
37
  * Access Policy Resources: `FHIR:Patient:*,FHIR:Encounter:*,FHIR:Coverage:*`
35
38
  */
36
39
  status(params: ChargeStatusParams, request?: OystehrClientRequest): Promise<ChargeStatusResponse> {
37
- return this.request('/payment/charge/status', 'post')(params, request);
40
+ return this.request('/payment/charge/status', 'post', this.baseUrlThunk.bind(this))(params, request);
38
41
  }
39
42
  }
@@ -17,6 +17,9 @@ export class Conversation extends SDKResource {
17
17
  constructor(config: OystehrConfig) {
18
18
  super(config);
19
19
  }
20
+ baseUrlThunk(): string {
21
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
22
+ }
20
23
  ENCOUNTER_VS_EXTENSION_URL = ext.ENCOUNTER_VS_EXTENSION_URL;
21
24
  ENCOUNTER_VS_EXTENSION_RELATIVE_URL = ext.ENCOUNTER_VS_EXTENSION_RELATIVE_URL;
22
25
  /**
@@ -37,7 +40,7 @@ export class Conversation extends SDKResource {
37
40
  * Access Policy Resource: `FHIR:Encounter`
38
41
  */
39
42
  create(params: ConversationCreateParams, request?: OystehrClientRequest): Promise<ConversationCreateResponse> {
40
- return this.request('/messaging/conversation', 'post')(params, request);
43
+ return this.request('/messaging/conversation', 'post', this.baseUrlThunk.bind(this))(params, request);
41
44
  }
42
45
  /**
43
46
  * Get a Conversation Token. Conversation Tokens are used to join the Conversation with the Twilio Conversations SDKs. [Conversations](https://docs.oystehr.com/services/messaging/conversations/) allow you to build multi-channel bi-directional messaging workflows. For example, you might create a Conversation where a provider messages with a patient through a web app, and the patient receives and responds to messages via SMS on their phone.
@@ -46,7 +49,7 @@ export class Conversation extends SDKResource {
46
49
  * Access Policy Resource: `Messaging:Conversation`.
47
50
  */
48
51
  getToken(request?: OystehrClientRequest): Promise<ConversationGetTokenResponse> {
49
- return this.request('/messaging/conversation/token', 'get')(request);
52
+ return this.request('/messaging/conversation/token', 'get', this.baseUrlThunk.bind(this))(request);
50
53
  }
51
54
  /**
52
55
  * Add a participant to a Conversation. [Conversations](https://docs.oystehr.com/services/messaging/conversations/) allow you to build multi-channel bi-directional messaging workflows. For example, you might create a Conversation where a provider messages with a patient through a web app, and the patient receives and responds to messages via SMS on their phone.
@@ -60,7 +63,11 @@ export class Conversation extends SDKResource {
60
63
  * Access Policy Resource: `FHIR:Encounter`
61
64
  */
62
65
  addParticipant(params: ConversationAddParticipantParams, request?: OystehrClientRequest): Promise<void> {
63
- return this.request('/messaging/conversation/{conversationId}/participant', 'post')(params, request);
66
+ return this.request(
67
+ '/messaging/conversation/{conversationId}/participant',
68
+ 'post',
69
+ this.baseUrlThunk.bind(this)
70
+ )(params, request);
64
71
  }
65
72
  /**
66
73
  * Remove a participant from a Conversation. [Conversations](https://docs.oystehr.com/services/messaging/conversations/) allow you to build multi-channel bi-directional messaging workflows. For example, you might create a Conversation where a provider messages with a patient through a web app, and the patient receives and responds to messages via SMS on their phone.
@@ -72,7 +79,11 @@ export class Conversation extends SDKResource {
72
79
  * Access Policy Resource: `FHIR:Patient`, `FHIR:Practitioner`, or `FHIR:RelatedPerson`
73
80
  */
74
81
  removeParticipant(params: ConversationRemoveParticipantParams, request?: OystehrClientRequest): Promise<void> {
75
- return this.request('/messaging/conversation/{conversationId}/participant', 'delete')(params, request);
82
+ return this.request(
83
+ '/messaging/conversation/{conversationId}/participant',
84
+ 'delete',
85
+ this.baseUrlThunk.bind(this)
86
+ )(params, request);
76
87
  }
77
88
  /**
78
89
  * Send a message to a Conversation. [Conversations](https://docs.oystehr.com/services/messaging/conversations/) allow you to build multi-channel bi-directional messaging workflows. For example, you might create a Conversation where a provider messages with a patient through a web app, and the patient receives and responds to messages via SMS on their phone.
@@ -82,6 +93,10 @@ export class Conversation extends SDKResource {
82
93
  * Access Policy Resource: `Messaging:Conversation`
83
94
  */
84
95
  message(params: ConversationMessageParams, request?: OystehrClientRequest): Promise<void> {
85
- return this.request('/messaging/conversation/{conversationId}/message', 'post')(params, request);
96
+ return this.request(
97
+ '/messaging/conversation/{conversationId}/message',
98
+ 'post',
99
+ this.baseUrlThunk.bind(this)
100
+ )(params, request);
86
101
  }
87
102
  }
@@ -20,6 +20,9 @@ export class Developer extends SDKResource {
20
20
  constructor(config: OystehrConfig) {
21
21
  super(config);
22
22
  }
23
+ baseUrlThunk(): string {
24
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
25
+ }
23
26
  /**
24
27
  * Get the Developer with the provided ID. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/services/project/). [Developers](https://docs.oystehr.com/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
25
28
  *
@@ -27,7 +30,7 @@ export class Developer extends SDKResource {
27
30
  * Access Policy Resource: `IAM:Developer`
28
31
  */
29
32
  get(params: DeveloperGetParams, request?: OystehrClientRequest): Promise<DeveloperGetResponse> {
30
- return this.request('/developer/{id}', 'get')(params, request);
33
+ return this.request('/developer/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);
31
34
  }
32
35
  /**
33
36
  * Update the Developer with the provided ID. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/services/project/). [Developers](https://docs.oystehr.com/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
@@ -36,7 +39,7 @@ export class Developer extends SDKResource {
36
39
  * Access Policy Resource: `IAM:Developer`
37
40
  */
38
41
  update(params: DeveloperUpdateParams, request?: OystehrClientRequest): Promise<DeveloperUpdateResponse> {
39
- return this.request('/developer/{id}', 'patch')(params, request);
42
+ return this.request('/developer/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);
40
43
  }
41
44
  /**
42
45
  * Remove the Developer with the provided ID from the project. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/services/project/). [Developers](https://docs.oystehr.com/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
@@ -45,7 +48,7 @@ export class Developer extends SDKResource {
45
48
  * Access Policy Resource: `IAM:Developer`
46
49
  */
47
50
  delete(params: DeveloperDeleteParams, request?: OystehrClientRequest): Promise<void> {
48
- return this.request('/developer/{id}', 'delete')(params, request);
51
+ return this.request('/developer/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);
49
52
  }
50
53
  /**
51
54
  * Invite a new Developer to the Project. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/services/project/). [Developers](https://docs.oystehr.com/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
@@ -54,7 +57,7 @@ export class Developer extends SDKResource {
54
57
  * Access Policy Resource: `IAM:Developer`
55
58
  */
56
59
  invite(params: DeveloperInviteParams, request?: OystehrClientRequest): Promise<DeveloperInviteResponse> {
57
- return this.request('/developer/invite', 'post')(params, request);
60
+ return this.request('/developer/invite', 'post', this.baseUrlThunk.bind(this))(params, request);
58
61
  }
59
62
  /**
60
63
  * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_developer-v2-list) instead.
@@ -65,7 +68,7 @@ export class Developer extends SDKResource {
65
68
  * Access Policy Resource: `IAM:Developer`
66
69
  */
67
70
  list(request?: OystehrClientRequest): Promise<DeveloperListResponse> {
68
- return this.request('/developer', 'get')(request);
71
+ return this.request('/developer', 'get', this.baseUrlThunk.bind(this))(request);
69
72
  }
70
73
  /**
71
74
  * Get Developers in the Project with pagination, sort, sort Order and filtering. [Users](https://docs.oystehr.com/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
@@ -74,6 +77,6 @@ export class Developer extends SDKResource {
74
77
  * Access Policy Resource: `Project:Settings`
75
78
  */
76
79
  listV2(params: DeveloperListV2Params, request?: OystehrClientRequest): Promise<DeveloperListV2Response> {
77
- return this.request('/developer/v2/list', 'get')(params, request);
80
+ return this.request('/developer/v2/list', 'get', this.baseUrlThunk.bind(this))(params, request);
78
81
  }
79
82
  }