@oystehr/sdk 4.0.0-alpha.6 → 4.1.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.
Files changed (164) hide show
  1. package/dist/cjs/client/client.cjs +259 -0
  2. package/dist/cjs/client/client.cjs.map +1 -0
  3. package/dist/cjs/errors/index.cjs +58 -0
  4. package/dist/cjs/errors/index.cjs.map +1 -0
  5. package/dist/cjs/index.cjs +11 -1980
  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.cjs +88 -0
  10. package/dist/cjs/resources/classes/application.cjs.map +1 -0
  11. package/dist/cjs/resources/classes/charge.cjs +44 -0
  12. package/dist/cjs/resources/classes/charge.cjs.map +1 -0
  13. package/dist/cjs/resources/classes/conversation-ext.cjs +31 -0
  14. package/dist/cjs/resources/classes/conversation-ext.cjs.map +1 -0
  15. package/dist/cjs/resources/classes/conversation.cjs +84 -0
  16. package/dist/cjs/resources/classes/conversation.cjs.map +1 -0
  17. package/dist/cjs/resources/classes/developer.cjs +72 -0
  18. package/dist/cjs/resources/classes/developer.cjs.map +1 -0
  19. package/dist/cjs/resources/classes/erx.cjs +88 -0
  20. package/dist/cjs/resources/classes/erx.cjs.map +1 -0
  21. package/dist/cjs/resources/classes/erx.d.ts +5 -1
  22. package/dist/cjs/resources/classes/erxV1.cjs +46 -0
  23. package/dist/cjs/resources/classes/erxV1.cjs.map +1 -0
  24. package/dist/cjs/resources/classes/erxV2.cjs +22 -0
  25. package/dist/cjs/resources/classes/erxV2.cjs.map +1 -0
  26. package/dist/cjs/resources/classes/fax.cjs +46 -0
  27. package/dist/cjs/resources/classes/fax.cjs.map +1 -0
  28. package/dist/cjs/resources/classes/fhir-ext.cjs +200 -0
  29. package/dist/cjs/resources/classes/fhir-ext.cjs.map +1 -0
  30. package/dist/cjs/resources/classes/fhir-ext.d.ts +7 -7
  31. package/dist/cjs/resources/classes/fhir.cjs +34 -0
  32. package/dist/cjs/resources/classes/fhir.cjs.map +1 -0
  33. package/dist/cjs/resources/classes/fhir.d.ts +2 -2
  34. package/dist/cjs/resources/classes/index.cjs +88 -0
  35. package/dist/cjs/resources/classes/index.cjs.map +1 -0
  36. package/dist/cjs/resources/classes/lab.cjs +76 -0
  37. package/dist/cjs/resources/classes/lab.cjs.map +1 -0
  38. package/dist/cjs/resources/classes/m2m.cjs +81 -0
  39. package/dist/cjs/resources/classes/m2m.cjs.map +1 -0
  40. package/dist/cjs/resources/classes/messaging.cjs +22 -0
  41. package/dist/cjs/resources/classes/messaging.cjs.map +1 -0
  42. package/dist/cjs/resources/classes/paymentMethod.cjs +88 -0
  43. package/dist/cjs/resources/classes/paymentMethod.cjs.map +1 -0
  44. package/dist/cjs/resources/classes/project.cjs +34 -0
  45. package/dist/cjs/resources/classes/project.cjs.map +1 -0
  46. package/dist/cjs/resources/classes/rcm.cjs +55 -0
  47. package/dist/cjs/resources/classes/rcm.cjs.map +1 -0
  48. package/dist/cjs/resources/classes/role.cjs +62 -0
  49. package/dist/cjs/resources/classes/role.cjs.map +1 -0
  50. package/dist/cjs/resources/classes/secret.cjs +52 -0
  51. package/dist/cjs/resources/classes/secret.cjs.map +1 -0
  52. package/dist/cjs/resources/classes/telemed.cjs +43 -0
  53. package/dist/cjs/resources/classes/telemed.cjs.map +1 -0
  54. package/dist/cjs/resources/classes/transactionalSMS.cjs +34 -0
  55. package/dist/cjs/resources/classes/transactionalSMS.cjs.map +1 -0
  56. package/dist/cjs/resources/classes/user.cjs +80 -0
  57. package/dist/cjs/resources/classes/user.cjs.map +1 -0
  58. package/dist/cjs/resources/classes/version.cjs +22 -0
  59. package/dist/cjs/resources/classes/version.cjs.map +1 -0
  60. package/dist/cjs/resources/classes/z3-ext.cjs +81 -0
  61. package/dist/cjs/resources/classes/z3-ext.cjs.map +1 -0
  62. package/dist/cjs/resources/classes/z3.cjs +88 -0
  63. package/dist/cjs/resources/classes/z3.cjs.map +1 -0
  64. package/dist/cjs/resources/classes/zambda-ext.cjs +15 -0
  65. package/dist/cjs/resources/classes/zambda-ext.cjs.map +1 -0
  66. package/dist/cjs/resources/classes/zambda.cjs +89 -0
  67. package/dist/cjs/resources/classes/zambda.cjs.map +1 -0
  68. package/dist/cjs/resources/classes/zambdaLogStream.cjs +43 -0
  69. package/dist/cjs/resources/classes/zambdaLogStream.cjs.map +1 -0
  70. package/dist/cjs/resources/types/ErxCheckMedicationInteractionsResponse.d.ts +11 -2
  71. package/dist/cjs/resources/types/ErxCheckPrecheckInteractionsResponse.d.ts +11 -2
  72. package/dist/cjs/resources/types/ErxGetConfigurationResponse.d.ts +9 -0
  73. package/dist/cjs/resources/types/ZambdaCreateParams.d.ts +5 -1
  74. package/dist/cjs/resources/types/ZambdaFunction.d.ts +1 -1
  75. package/dist/cjs/resources/types/ZambdaUpdateParams.d.ts +1 -1
  76. package/dist/cjs/resources/types/index.d.ts +1 -0
  77. package/dist/esm/client/client.js +68 -67
  78. package/dist/esm/client/client.js.map +1 -1
  79. package/dist/esm/errors/index.js +3 -2
  80. package/dist/esm/errors/index.js.map +1 -1
  81. package/dist/esm/index.js +2 -2
  82. package/dist/esm/index.js.map +1 -1
  83. package/dist/esm/index.min.js +1 -1
  84. package/dist/esm/index.min.js.map +1 -1
  85. package/dist/esm/node_modules/tslib/package.json +1 -0
  86. package/dist/esm/resources/classes/application.js +11 -15
  87. package/dist/esm/resources/classes/application.js.map +1 -1
  88. package/dist/esm/resources/classes/charge.js +5 -9
  89. package/dist/esm/resources/classes/charge.js.map +1 -1
  90. package/dist/esm/resources/classes/conversation-ext.js +4 -5
  91. package/dist/esm/resources/classes/conversation-ext.js.map +1 -1
  92. package/dist/esm/resources/classes/conversation.js +16 -20
  93. package/dist/esm/resources/classes/conversation.js.map +1 -1
  94. package/dist/esm/resources/classes/developer.js +9 -13
  95. package/dist/esm/resources/classes/developer.js.map +1 -1
  96. package/dist/esm/resources/classes/erx.d.ts +5 -1
  97. package/dist/esm/resources/classes/erx.js +20 -18
  98. package/dist/esm/resources/classes/erx.js.map +1 -1
  99. package/dist/esm/resources/classes/erxV1.js +8 -12
  100. package/dist/esm/resources/classes/erxV1.js.map +1 -1
  101. package/dist/esm/resources/classes/erxV2.js +4 -8
  102. package/dist/esm/resources/classes/erxV2.js.map +1 -1
  103. package/dist/esm/resources/classes/fax.js +6 -10
  104. package/dist/esm/resources/classes/fax.js.map +1 -1
  105. package/dist/esm/resources/classes/fhir-ext.d.ts +7 -7
  106. package/dist/esm/resources/classes/fhir-ext.js +71 -62
  107. package/dist/esm/resources/classes/fhir-ext.js.map +1 -1
  108. package/dist/esm/resources/classes/fhir.d.ts +2 -2
  109. package/dist/esm/resources/classes/fhir.js +20 -20
  110. package/dist/esm/resources/classes/fhir.js.map +1 -1
  111. package/dist/esm/resources/classes/index.js +28 -5
  112. package/dist/esm/resources/classes/index.js.map +1 -1
  113. package/dist/esm/resources/classes/lab.js +9 -13
  114. package/dist/esm/resources/classes/lab.js.map +1 -1
  115. package/dist/esm/resources/classes/m2m.js +10 -14
  116. package/dist/esm/resources/classes/m2m.js.map +1 -1
  117. package/dist/esm/resources/classes/messaging.js +4 -8
  118. package/dist/esm/resources/classes/messaging.js.map +1 -1
  119. package/dist/esm/resources/classes/paymentMethod.js +7 -11
  120. package/dist/esm/resources/classes/paymentMethod.js.map +1 -1
  121. package/dist/esm/resources/classes/project.js +5 -9
  122. package/dist/esm/resources/classes/project.js.map +1 -1
  123. package/dist/esm/resources/classes/rcm.js +6 -10
  124. package/dist/esm/resources/classes/rcm.js.map +1 -1
  125. package/dist/esm/resources/classes/role.js +8 -12
  126. package/dist/esm/resources/classes/role.js.map +1 -1
  127. package/dist/esm/resources/classes/secret.js +7 -11
  128. package/dist/esm/resources/classes/secret.js.map +1 -1
  129. package/dist/esm/resources/classes/telemed.js +5 -9
  130. package/dist/esm/resources/classes/telemed.js.map +1 -1
  131. package/dist/esm/resources/classes/transactionalSMS.js +4 -8
  132. package/dist/esm/resources/classes/transactionalSMS.js.map +1 -1
  133. package/dist/esm/resources/classes/user.js +10 -14
  134. package/dist/esm/resources/classes/user.js.map +1 -1
  135. package/dist/esm/resources/classes/version.js +4 -8
  136. package/dist/esm/resources/classes/version.js.map +1 -1
  137. package/dist/esm/resources/classes/z3-ext.js +47 -56
  138. package/dist/esm/resources/classes/z3-ext.js.map +1 -1
  139. package/dist/esm/resources/classes/z3.js +26 -30
  140. package/dist/esm/resources/classes/z3.js.map +1 -1
  141. package/dist/esm/resources/classes/zambda-ext.js +6 -11
  142. package/dist/esm/resources/classes/zambda-ext.js.map +1 -1
  143. package/dist/esm/resources/classes/zambda.js +12 -16
  144. package/dist/esm/resources/classes/zambda.js.map +1 -1
  145. package/dist/esm/resources/classes/zambdaLogStream.js +6 -10
  146. package/dist/esm/resources/classes/zambdaLogStream.js.map +1 -1
  147. package/dist/esm/resources/types/ErxCheckMedicationInteractionsResponse.d.ts +11 -2
  148. package/dist/esm/resources/types/ErxCheckPrecheckInteractionsResponse.d.ts +11 -2
  149. package/dist/esm/resources/types/ErxGetConfigurationResponse.d.ts +9 -0
  150. package/dist/esm/resources/types/ZambdaCreateParams.d.ts +5 -1
  151. package/dist/esm/resources/types/ZambdaFunction.d.ts +1 -1
  152. package/dist/esm/resources/types/ZambdaUpdateParams.d.ts +1 -1
  153. package/dist/esm/resources/types/index.d.ts +1 -0
  154. package/package.json +5 -4
  155. package/rollup.config-cjs.mjs +97 -18
  156. package/src/resources/classes/erx.ts +7 -0
  157. package/src/resources/classes/fhir-ext.ts +5 -5
  158. package/src/resources/types/ErxCheckMedicationInteractionsResponse.ts +11 -2
  159. package/src/resources/types/ErxCheckPrecheckInteractionsResponse.ts +11 -2
  160. package/src/resources/types/ErxGetConfigurationResponse.ts +11 -0
  161. package/src/resources/types/ZambdaCreateParams.ts +5 -1
  162. package/src/resources/types/ZambdaFunction.ts +1 -1
  163. package/src/resources/types/ZambdaUpdateParams.ts +1 -1
  164. package/src/resources/types/index.ts +1 -0
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+
3
+ var client = require('../../client/client.cjs');
4
+
5
+ // AUTOGENERATED -- DO NOT EDIT
6
+ class User extends client.SDKResource {
7
+ constructor(config) {
8
+ super(config);
9
+ }
10
+ #baseUrlThunk() {
11
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
12
+ }
13
+ /**
14
+ * Get your own User details. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
15
+ *
16
+ * Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.
17
+ */
18
+ me(request) {
19
+ return this.request('/user/me', 'get', this.#baseUrlThunk.bind(this))(request);
20
+ }
21
+ /**
22
+ * Get the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
23
+ *
24
+ * Access Policy Action: `App:GetUser`
25
+ * Access Policy Resource: `App:User`
26
+ */
27
+ get(params, request) {
28
+ return this.request('/user/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);
29
+ }
30
+ /**
31
+ * Update the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
32
+ *
33
+ * Access Policy Action: `App:UpdateUser`
34
+ * Access Policy Resource: `App:User`
35
+ */
36
+ update(params, request) {
37
+ return this.request('/user/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);
38
+ }
39
+ /**
40
+ * Delete the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
41
+ *
42
+ * Access Policy Action: `App:DeleteUser`
43
+ * Access Policy Resource: `App:User`
44
+ */
45
+ delete(params, request) {
46
+ return this.request('/user/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
47
+ }
48
+ /**
49
+ * Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
50
+ *
51
+ * Access Policy Action: `App:CreateUser`
52
+ * Access Policy Resource: `App:User`
53
+ */
54
+ invite(params, request) {
55
+ return this.request('/user/invite', 'post', this.#baseUrlThunk.bind(this))(params, request);
56
+ }
57
+ /**
58
+ * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.
59
+ *
60
+ * Get all Users in the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
61
+ *
62
+ * Access Policy Action: `App:ListAllUsers`
63
+ * Access Policy Resource: `App:User`
64
+ */
65
+ list(request) {
66
+ return this.request('/user', 'get', this.#baseUrlThunk.bind(this))(request);
67
+ }
68
+ /**
69
+ * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
70
+ *
71
+ * Access Policy Action: `Project:ListAllUsers`
72
+ * Access Policy Resource: `Project:Settings`
73
+ */
74
+ listV2(params, request) {
75
+ return this.request('/user/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);
76
+ }
77
+ }
78
+
79
+ exports.User = User;
80
+ //# sourceMappingURL=user.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.cjs","sources":["../../../../src/resources/classes/user.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n UserDeleteParams,\n UserGetParams,\n UserGetResponse,\n UserInviteParams,\n UserInviteResponse,\n UserListResponse,\n UserListV2Params,\n UserListV2Response,\n UserMeResponse,\n UserUpdateParams,\n UserUpdateResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class User 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 your own User details. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.\n */\n me(request?: OystehrClientRequest): Promise<UserMeResponse> {\n return this.request('/user/me', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Get the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:GetUser`\n * Access Policy Resource: `App:User`\n */\n get(params: UserGetParams, request?: OystehrClientRequest): Promise<UserGetResponse> {\n return this.request('/user/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Update the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:UpdateUser`\n * Access Policy Resource: `App:User`\n */\n update(params: UserUpdateParams, request?: OystehrClientRequest): Promise<UserUpdateResponse> {\n return this.request('/user/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:DeleteUser`\n * Access Policy Resource: `App:User`\n */\n delete(params: UserDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/user/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:CreateUser`\n * Access Policy Resource: `App:User`\n */\n invite(params: UserInviteParams, request?: OystehrClientRequest): Promise<UserInviteResponse> {\n return this.request('/user/invite', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.\n *\n * Get all Users in the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:ListAllUsers`\n * Access Policy Resource: `App:User`\n */\n list(request?: OystehrClientRequest): Promise<UserListResponse> {\n return this.request('/user', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(params: UserListV2Params, request?: OystehrClientRequest): Promise<UserListV2Response>;\n /**\n * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(request?: OystehrClientRequest): Promise<UserListV2Response>;\n /**\n * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(\n params?: UserListV2Params | OystehrClientRequest,\n request?: OystehrClientRequest\n ): Promise<UserListV2Response> {\n return this.request('/user/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAmBM,MAAO,IAAK,SAAQA,kBAAW,CAAA;AACnC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;KACvF;AACD;;;;AAIG;AACH,IAAA,EAAE,CAAC,OAA8B,EAAA;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAChF;AACD;;;;;AAKG;IACH,GAAG,CAAC,MAAqB,EAAE,OAA8B,EAAA;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC1F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAwB,EAAE,OAA8B,EAAA;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAwB,EAAE,OAA8B,EAAA;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAwB,EAAE,OAA8B,EAAA;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACD;;;;;;;AAOG;AACH,IAAA,IAAI,CAAC,OAA8B,EAAA;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAC7E;AAeD;;;;;AAKG;IACH,MAAM,CACJ,MAAgD,EAChD,OAA8B,EAAA;QAE9B,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACF;;;;"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var client = require('../../client/client.cjs');
4
+
5
+ // AUTOGENERATED -- DO NOT EDIT
6
+ class Version extends client.SDKResource {
7
+ constructor(config) {
8
+ super(config);
9
+ }
10
+ #baseUrlThunk() {
11
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
12
+ }
13
+ /**
14
+ * Get project API version. This endpoint is public so there are no access policy requirements.
15
+ */
16
+ get(request) {
17
+ return this.request('/version', 'get', this.#baseUrlThunk.bind(this))(request);
18
+ }
19
+ }
20
+
21
+ exports.Version = Version;
22
+ //# sourceMappingURL=version.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.cjs","sources":["../../../../src/resources/classes/version.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport { OystehrClientRequest, VersionGetResponse } from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class Version 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 project API version. This endpoint is public so there are no access policy requirements.\n */\n get(request?: OystehrClientRequest): Promise<VersionGetResponse> {\n return this.request('/version', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAMM,MAAO,OAAQ,SAAQA,kBAAW,CAAA;AACtC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;KACvF;AACD;;AAEG;AACH,IAAA,GAAG,CAAC,OAA8B,EAAA;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAChF;AACF;;;;"}
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+
3
+ var client = require('../../client/client.cjs');
4
+ var index = require('../../errors/index.cjs');
5
+
6
+ function baseUrlThunk() {
7
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
8
+ }
9
+ /**
10
+ * Uploads a file to the bucket and key. Files should be Blobs.
11
+ *
12
+ * @param params upload file params
13
+ */
14
+ async function uploadFile({ bucketName, 'objectPath+': key, file, }) {
15
+ const uploadUrl = await this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk.bind(this))({
16
+ action: 'upload',
17
+ bucketName,
18
+ 'objectPath+': key,
19
+ });
20
+ await fetch(uploadUrl.signedUrl, {
21
+ method: 'PUT',
22
+ body: file,
23
+ });
24
+ }
25
+ /**
26
+ * Downloads an object matching the bucket and key. File content is returned as an ArrayBuffer.
27
+ *
28
+ * @param params download file params
29
+ */
30
+ async function downloadFile({ bucketName, 'objectPath+': key, }) {
31
+ const uploadUrl = await this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk.bind(this))({
32
+ action: 'download',
33
+ bucketName,
34
+ 'objectPath+': key,
35
+ });
36
+ const resp = await fetch(uploadUrl.signedUrl, {
37
+ method: 'GET',
38
+ });
39
+ if (!resp.ok) {
40
+ throw new Error('Failed to download file');
41
+ }
42
+ return resp.arrayBuffer();
43
+ }
44
+ /**
45
+ * This helper performs a `getPresignedUrl` request for Z3 URLs of the forms
46
+ * `https://projects-api.oystehr.com/v1/z3/<bucket>/<key>` or `z3://<bucket>/<key>`
47
+ * instead of the standard SDK `Z3GetPresignedUrlParams`.
48
+ *
49
+ * @param params url and action
50
+ */
51
+ async function getPresignedUrlForZ3Url(params) {
52
+ let bucket;
53
+ let key;
54
+ const url = new URL(params.url);
55
+ if (url.protocol === 'z3:') {
56
+ // remove leading forward slash
57
+ const z3PathParts = url.pathname.split('/').slice(1);
58
+ bucket = url.hostname;
59
+ key = z3PathParts.join('/');
60
+ }
61
+ else if (url.href.startsWith(this.config.services?.['projectApiUrl'] ?? client.defaultProjectApiUrl)) {
62
+ // remove leading `/v1/z3`
63
+ const httpsPathParts = url.pathname.split('/').slice(3);
64
+ bucket = httpsPathParts[0];
65
+ key = httpsPathParts.slice(1).join('/');
66
+ }
67
+ else {
68
+ throw new index.OystehrSdkError({ message: 'Invalid Z3 URL', code: 400 });
69
+ }
70
+ const requestParams = {
71
+ action: 'upload',
72
+ bucketName: bucket,
73
+ 'objectPath+': key,
74
+ };
75
+ return this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk.bind(this))(requestParams);
76
+ }
77
+
78
+ exports.downloadFile = downloadFile;
79
+ exports.getPresignedUrlForZ3Url = getPresignedUrlForZ3Url;
80
+ exports.uploadFile = uploadFile;
81
+ //# sourceMappingURL=z3-ext.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"z3-ext.cjs","sources":["../../../../src/resources/classes/z3-ext.ts"],"sourcesContent":["import { defaultProjectApiUrl, SDKResource } from '../../client/client';\nimport { OystehrSdkError } from '../../errors';\nimport { Z3GetPresignedUrlParams, Z3GetPresignedUrlResponse } from '../types';\n\nfunction baseUrlThunk(this: SDKResource): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n}\n\n/**\n * Uploads a file to the bucket and key. Files should be Blobs.\n *\n * @param params upload file params\n */\nexport async function uploadFile(\n this: SDKResource,\n {\n bucketName,\n 'objectPath+': key,\n file,\n }: {\n bucketName: string;\n 'objectPath+': string;\n file: Blob;\n }\n): Promise<void> {\n const uploadUrl = await this.request(\n '/z3/{bucketName}/{objectPath+}',\n 'post',\n baseUrlThunk.bind(this)\n )({\n action: 'upload',\n bucketName,\n 'objectPath+': key,\n });\n await fetch(uploadUrl.signedUrl, {\n method: 'PUT',\n body: file,\n });\n}\n\n/**\n * Downloads an object matching the bucket and key. File content is returned as an ArrayBuffer.\n *\n * @param params download file params\n */\nexport async function downloadFile(\n this: SDKResource,\n {\n bucketName,\n 'objectPath+': key,\n }: {\n bucketName: string;\n 'objectPath+': string;\n }\n): Promise<ArrayBuffer> {\n const uploadUrl = await this.request(\n '/z3/{bucketName}/{objectPath+}',\n 'post',\n baseUrlThunk.bind(this)\n )({\n action: 'download',\n bucketName,\n 'objectPath+': key,\n });\n const resp = await fetch(uploadUrl.signedUrl, {\n method: 'GET',\n });\n if (!resp.ok) {\n throw new Error('Failed to download file');\n }\n return resp.arrayBuffer();\n}\n\n/**\n * This helper performs a `getPresignedUrl` request for Z3 URLs of the forms\n * `https://projects-api.oystehr.com/v1/z3/<bucket>/<key>` or `z3://<bucket>/<key>`\n * instead of the standard SDK `Z3GetPresignedUrlParams`.\n *\n * @param params url and action\n */\nexport async function getPresignedUrlForZ3Url(\n this: SDKResource,\n params: { url: string; action: Z3GetPresignedUrlParams['action'] }\n): Promise<Z3GetPresignedUrlResponse> {\n let bucket: string;\n let key: string;\n const url = new URL(params.url);\n if (url.protocol === 'z3:') {\n // remove leading forward slash\n const z3PathParts = url.pathname.split('/').slice(1);\n bucket = url.hostname;\n key = z3PathParts.join('/');\n } else if (url.href.startsWith(this.config.services?.['projectApiUrl'] ?? defaultProjectApiUrl)) {\n // remove leading `/v1/z3`\n const httpsPathParts = url.pathname.split('/').slice(3);\n bucket = httpsPathParts[0];\n key = httpsPathParts.slice(1).join('/');\n } else {\n throw new OystehrSdkError({ message: 'Invalid Z3 URL', code: 400 });\n }\n const requestParams: Z3GetPresignedUrlParams = {\n action: 'upload',\n bucketName: bucket,\n 'objectPath+': key,\n };\n return this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk.bind(this))(requestParams);\n}\n"],"names":["defaultProjectApiUrl","OystehrSdkError"],"mappings":";;;;;AAIA,SAAS,YAAY,GAAA;IACnB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;AACxF,CAAC;AAED;;;;AAIG;AACI,eAAe,UAAU,CAE9B,EACE,UAAU,EACV,aAAa,EAAE,GAAG,EAClB,IAAI,GAKL,EAAA;AAED,IAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAClC,gCAAgC,EAChC,MAAM,EACN,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CACxB,CAAC;AACA,QAAA,MAAM,EAAE,QAAQ;QAChB,UAAU;AACV,QAAA,aAAa,EAAE,GAAG;AACnB,KAAA,CAAC,CAAC;AACH,IAAA,MAAM,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE;AAC/B,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,IAAI,EAAE,IAAI;AACX,KAAA,CAAC,CAAC;AACL,CAAC;AAED;;;;AAIG;AACI,eAAe,YAAY,CAEhC,EACE,UAAU,EACV,aAAa,EAAE,GAAG,GAInB,EAAA;AAED,IAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAClC,gCAAgC,EAChC,MAAM,EACN,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CACxB,CAAC;AACA,QAAA,MAAM,EAAE,UAAU;QAClB,UAAU;AACV,QAAA,aAAa,EAAE,GAAG;AACnB,KAAA,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE;AAC5C,QAAA,MAAM,EAAE,KAAK;AACd,KAAA,CAAC,CAAC;AACH,IAAA,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;KAC5C;AACD,IAAA,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,CAAC;AAED;;;;;;AAMG;AACI,eAAe,uBAAuB,CAE3C,MAAkE,EAAA;AAElE,IAAA,IAAI,MAAc,CAAC;AACnB,IAAA,IAAI,GAAW,CAAC;IAChB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAChC,IAAA,IAAI,GAAG,CAAC,QAAQ,KAAK,KAAK,EAAE;;AAE1B,QAAA,MAAM,WAAW,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACrD,QAAA,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC;AACtB,QAAA,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC7B;AAAM,SAAA,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAIA,2BAAoB,CAAC,EAAE;;AAE/F,QAAA,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,QAAA,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;AAC3B,QAAA,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACzC;SAAM;AACL,QAAA,MAAM,IAAIC,qBAAe,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;KACrE;AACD,IAAA,MAAM,aAAa,GAA4B;AAC7C,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,UAAU,EAAE,MAAM;AAClB,QAAA,aAAa,EAAE,GAAG;KACnB,CAAC;AACF,IAAA,OAAO,IAAI,CAAC,OAAO,CAAC,gCAAgC,EAAE,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;AACxG;;;;;;"}
@@ -0,0 +1,88 @@
1
+ 'use strict';
2
+
3
+ var client = require('../../client/client.cjs');
4
+ var z3Ext = require('./z3-ext.cjs');
5
+
6
+ // AUTOGENERATED -- DO NOT EDIT
7
+ class Z3 extends client.SDKResource {
8
+ constructor(config) {
9
+ super(config);
10
+ }
11
+ #baseUrlThunk() {
12
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
13
+ }
14
+ /**
15
+ * Uploads a file to the bucket and key. Files should be Blobs.
16
+ * @param params upload file params
17
+ */
18
+ uploadFile = z3Ext.uploadFile;
19
+ /**
20
+ * Downloads an object matching the bucket and key. File content is returned as an ArrayBuffer.
21
+ * @param params download file params
22
+ */
23
+ downloadFile = z3Ext.downloadFile;
24
+ /**
25
+ * This helper performs a `getPresignedUrl` request for Z3 URLs of the forms
26
+ * `https://projects-api.oystehr.com/v1/z3/<bucket>/<key>` or `z3://<bucket>/<key>`
27
+ * instead of the standard SDK `Z3GetPresignedUrlParams`.
28
+ * @param params url and action
29
+ */
30
+ getPresignedUrlForZ3Url = z3Ext.getPresignedUrlForZ3Url;
31
+ /**
32
+ * List all Z3 Buckets. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
33
+ *
34
+ * Access Policy Action: `Z3:ListBuckets`
35
+ * Access Policy Resource: `Z3:BucketName`
36
+ */
37
+ listBuckets(request) {
38
+ return this.request('/z3', 'get', this.#baseUrlThunk.bind(this))(request);
39
+ }
40
+ /**
41
+ * Create a Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
42
+ *
43
+ * Access Policy Action: `Z3:CreateBucket`
44
+ * Access Policy Resource: `Z3:*`
45
+ */
46
+ createBucket(params, request) {
47
+ return this.request('/z3/{bucketName}', 'put', this.#baseUrlThunk.bind(this))(params, request);
48
+ }
49
+ /**
50
+ * Delete the Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
51
+ *
52
+ * Access Policy Action: `Z3:DeleteBucket`
53
+ * Access Policy Resource: `Z3:BucketName`
54
+ */
55
+ deleteBucket(params, request) {
56
+ return this.request('/z3/{bucketName}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
57
+ }
58
+ /**
59
+ * List all Z3 Objects at the provided path in the Bucket with the provided name [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
60
+ *
61
+ * Access Policy Action: `Z3:ListObjects`
62
+ * Access Policy Resource: `Z3:BucketName:ObjectPath`
63
+ */
64
+ listObjects(params, request) {
65
+ return this.request('/z3/{bucketName}/{objectPath+}', 'get', this.#baseUrlThunk.bind(this))(params, request);
66
+ }
67
+ /**
68
+ * Get a link for downloading or uploading a Z3 Object to the provided path in the Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
69
+ *
70
+ * Access Policy Action: `Z3:PutObject` or `Z3:GetObject`
71
+ * Access Policy Resource: `Z3:BucketName:ObjectPath`
72
+ */
73
+ getPresignedUrl(params, request) {
74
+ return this.request('/z3/{bucketName}/{objectPath+}', 'post', this.#baseUrlThunk.bind(this))(params, request);
75
+ }
76
+ /**
77
+ * Delete the Z3 Object at the provided path in the Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
78
+ *
79
+ * Access Policy Action: `Z3:DeleteObject`
80
+ * Access Policy Resource: `Z3:BucketName:ObjectPath`
81
+ */
82
+ deleteObject(params, request) {
83
+ return this.request('/z3/{bucketName}/{objectPath+}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
84
+ }
85
+ }
86
+
87
+ exports.Z3 = Z3;
88
+ //# sourceMappingURL=z3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"z3.cjs","sources":["../../../../src/resources/classes/z3.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n Z3CreateBucketParams,\n Z3CreateBucketResponse,\n Z3DeleteBucketParams,\n Z3DeleteObjectParams,\n Z3GetPresignedUrlParams,\n Z3GetPresignedUrlResponse,\n Z3ListBucketsResponse,\n Z3ListObjectsParams,\n Z3ListObjectsResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\nimport * as ext from './z3-ext';\n\nexport class Z3 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 * Uploads a file to the bucket and key. Files should be Blobs.\n * @param params upload file params\n */\n uploadFile = ext.uploadFile;\n /**\n * Downloads an object matching the bucket and key. File content is returned as an ArrayBuffer.\n * @param params download file params\n */\n downloadFile = ext.downloadFile;\n /**\n * This helper performs a `getPresignedUrl` request for Z3 URLs of the forms\n * `https://projects-api.oystehr.com/v1/z3/<bucket>/<key>` or `z3://<bucket>/<key>`\n * instead of the standard SDK `Z3GetPresignedUrlParams`.\n * @param params url and action\n */\n getPresignedUrlForZ3Url = ext.getPresignedUrlForZ3Url;\n /**\n * List all Z3 Buckets. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.\n *\n * Access Policy Action: `Z3:ListBuckets`\n * Access Policy Resource: `Z3:BucketName`\n */\n listBuckets(request?: OystehrClientRequest): Promise<Z3ListBucketsResponse> {\n return this.request('/z3', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Create a Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.\n *\n * Access Policy Action: `Z3:CreateBucket`\n * Access Policy Resource: `Z3:*`\n */\n createBucket(params: Z3CreateBucketParams, request?: OystehrClientRequest): Promise<Z3CreateBucketResponse> {\n return this.request('/z3/{bucketName}', 'put', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete the Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.\n *\n * Access Policy Action: `Z3:DeleteBucket`\n * Access Policy Resource: `Z3:BucketName`\n */\n deleteBucket(params: Z3DeleteBucketParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/z3/{bucketName}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * List all Z3 Objects at the provided path in the Bucket with the provided name [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.\n *\n * Access Policy Action: `Z3:ListObjects`\n * Access Policy Resource: `Z3:BucketName:ObjectPath`\n */\n listObjects(params: Z3ListObjectsParams, request?: OystehrClientRequest): Promise<Z3ListObjectsResponse> {\n return this.request('/z3/{bucketName}/{objectPath+}', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get a link for downloading or uploading a Z3 Object to the provided path in the Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.\n *\n * Access Policy Action: `Z3:PutObject` or `Z3:GetObject`\n * Access Policy Resource: `Z3:BucketName:ObjectPath`\n */\n getPresignedUrl(params: Z3GetPresignedUrlParams, request?: OystehrClientRequest): Promise<Z3GetPresignedUrlResponse> {\n return this.request('/z3/{bucketName}/{objectPath+}', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete the Z3 Object at the provided path in the Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.\n *\n * Access Policy Action: `Z3:DeleteObject`\n * Access Policy Resource: `Z3:BucketName:ObjectPath`\n */\n deleteObject(params: Z3DeleteObjectParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/z3/{bucketName}/{objectPath+}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource","ext.uploadFile","ext.downloadFile","ext.getPresignedUrlForZ3Url"],"mappings":";;;;;AAAA;AAkBM,MAAO,EAAG,SAAQA,kBAAW,CAAA;AACjC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;KACvF;AACD;;;AAGG;AACH,IAAA,UAAU,GAAGC,gBAAc,CAAC;AAC5B;;;AAGG;AACH,IAAA,YAAY,GAAGC,kBAAgB,CAAC;AAChC;;;;;AAKG;AACH,IAAA,uBAAuB,GAAGC,6BAA2B,CAAC;AACtD;;;;;AAKG;AACH,IAAA,WAAW,CAAC,OAA8B,EAAA;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAC3E;AACD;;;;;AAKG;IACH,YAAY,CAAC,MAA4B,EAAE,OAA8B,EAAA;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChG;AACD;;;;;AAKG;IACH,YAAY,CAAC,MAA4B,EAAE,OAA8B,EAAA;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnG;AACD;;;;;AAKG;IACH,WAAW,CAAC,MAA2B,EAAE,OAA8B,EAAA;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,gCAAgC,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC9G;AACD;;;;;AAKG;IACH,eAAe,CAAC,MAA+B,EAAE,OAA8B,EAAA;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,gCAAgC,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/G;AACD;;;;;AAKG;IACH,YAAY,CAAC,MAA4B,EAAE,OAA8B,EAAA;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,gCAAgC,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACjH;AACF;;;;"}
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ function baseUrlThunk() {
4
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
5
+ }
6
+ async function uploadFile({ id, file, filename, }) {
7
+ const uploadUrl = await this.request('/zambda/{id}/s3-upload', 'post', baseUrlThunk.bind(this))({ id, filename });
8
+ await fetch(uploadUrl.signedUrl, {
9
+ method: 'PUT',
10
+ body: file,
11
+ });
12
+ }
13
+
14
+ exports.uploadFile = uploadFile;
15
+ //# sourceMappingURL=zambda-ext.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zambda-ext.cjs","sources":["../../../../src/resources/classes/zambda-ext.ts"],"sourcesContent":["import { SDKResource } from '../../client/client';\n\nfunction baseUrlThunk(this: SDKResource): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n}\n\nexport async function uploadFile(\n this: SDKResource,\n {\n id,\n file,\n filename,\n }: {\n id: string;\n file: Blob;\n filename?: string | undefined;\n }\n): Promise<void> {\n const uploadUrl = await this.request('/zambda/{id}/s3-upload', 'post', baseUrlThunk.bind(this))({ id, filename });\n await fetch(uploadUrl.signedUrl, {\n method: 'PUT',\n body: file,\n });\n}\n"],"names":[],"mappings":";;AAEA,SAAS,YAAY,GAAA;IACnB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;AACxF,CAAC;AAEM,eAAe,UAAU,CAE9B,EACE,EAAE,EACF,IAAI,EACJ,QAAQ,GAKT,EAAA;IAED,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClH,IAAA,MAAM,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE;AAC/B,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,IAAI,EAAE,IAAI;AACX,KAAA,CAAC,CAAC;AACL;;;;"}
@@ -0,0 +1,89 @@
1
+ 'use strict';
2
+
3
+ var client = require('../../client/client.cjs');
4
+ var zambdaExt = require('./zambda-ext.cjs');
5
+
6
+ // AUTOGENERATED -- DO NOT EDIT
7
+ class Zambda extends client.SDKResource {
8
+ constructor(config) {
9
+ super(config);
10
+ }
11
+ #baseUrlThunk() {
12
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
13
+ }
14
+ uploadFile = zambdaExt.uploadFile;
15
+ /**
16
+ * Get a list of all Zambda Functions in the Project. [Zambdas](https://docs.oystehr.com/oystehr/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.
17
+ *
18
+ * Access Policy Action: `Zambda:ListAllFunctions`
19
+ * Access Policy Resource: `Zambda:Function`
20
+ */
21
+ list(request) {
22
+ return this.request('/zambda', 'get', this.#baseUrlThunk.bind(this))(request);
23
+ }
24
+ /**
25
+ * Create a new Zambda Function. [Zambdas](https://docs.oystehr.com/oystehr/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.
26
+ *
27
+ * Access Policy Action: `Zambda:CreateFunction`
28
+ * Access Policy Resource: `Zambda:Function`
29
+ */
30
+ create(params, request) {
31
+ return this.request('/zambda', 'post', this.#baseUrlThunk.bind(this))(params, request);
32
+ }
33
+ /**
34
+ * Get the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/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.
35
+ *
36
+ * Access Policy Action: `Zambda:GetFunction`
37
+ * Access Policy Resource: `Zambda:Function`
38
+ */
39
+ get(params, request) {
40
+ return this.request('/zambda/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);
41
+ }
42
+ /**
43
+ * Update the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/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.
44
+ *
45
+ * Access Policy Action: `Zambda:UpdateFunction`
46
+ * Access Policy Resource: `Zambda:Function`
47
+ */
48
+ update(params, request) {
49
+ return this.request('/zambda/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);
50
+ }
51
+ /**
52
+ * Delete the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/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.
53
+ *
54
+ * Access Policy Action: `Zambda:DeleteFunction`
55
+ * Access Policy Resource: `Zambda:Function`
56
+ */
57
+ delete(params, request) {
58
+ return this.request('/zambda/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
59
+ }
60
+ /**
61
+ * Execute the [Authenticated Zambda Function](https://docs.oystehr.com/oystehr/services/zambda/types/authenticated/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/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.
62
+ *
63
+ * Access Policy Action: `Zambda:InvokeFunction`
64
+ * Access Policy Resource: `Zambda:Function`
65
+ */
66
+ execute(params, request) {
67
+ return this.request('/zambda/{id}/execute', 'post', this.#baseUrlThunk.bind(this))(params, request);
68
+ }
69
+ /**
70
+ * Execute the [Public Zambda Function](https://docs.oystehr.com/oystehr/services/zambda/types/public/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/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.
71
+ *
72
+ * Execute a zambda that has method http_open. This endpoint is public so there are no access policy requirements.
73
+ */
74
+ executePublic(params, request) {
75
+ return this.request('/zambda/{id}/execute-public', 'post', this.#baseUrlThunk.bind(this))(params, request);
76
+ }
77
+ /**
78
+ * Returns a URL that is used to deploy code to the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/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.
79
+ *
80
+ * Access Policy Action: `Zambda:UpdateFunction`
81
+ * Access Policy Resource: `Zambda:Function`
82
+ */
83
+ s3Upload(params, request) {
84
+ return this.request('/zambda/{id}/s3-upload', 'post', this.#baseUrlThunk.bind(this))(params, request);
85
+ }
86
+ }
87
+
88
+ exports.Zambda = Zambda;
89
+ //# sourceMappingURL=zambda.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zambda.cjs","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/oystehr/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/oystehr/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/oystehr/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/oystehr/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/oystehr/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/oystehr/services/zambda/types/authenticated/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/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/oystehr/services/zambda/types/public/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/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/oystehr/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":["SDKResource","ext.uploadFile"],"mappings":";;;;;AAAA;AAuBM,MAAO,MAAO,SAAQA,kBAAW,CAAA;AACrC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;KACvF;AACD,IAAA,UAAU,GAAGC,oBAAc,CAAC;AAC5B;;;;;AAKG;AACH,IAAA,IAAI,CAAC,OAA8B,EAAA;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAC/E;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAA0B,EAAE,OAA8B,EAAA;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACxF;AACD;;;;;AAKG;IACH,GAAG,CAAC,MAAuB,EAAE,OAA8B,EAAA;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAA0B,EAAE,OAA8B,EAAA;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC9F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAA0B,EAAE,OAA8B,EAAA;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/F;AACD;;;;;AAKG;IACH,OAAO,CAAC,MAA2B,EAAE,OAA8B,EAAA;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACrG;AACD;;;;AAIG;IACH,aAAa,CACX,MAAiC,EACjC,OAA8B,EAAA;QAE9B,OAAO,IAAI,CAAC,OAAO,CAAC,6BAA6B,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5G;AACD;;;;;AAKG;IACH,QAAQ,CAAC,MAA4B,EAAE,OAA8B,EAAA;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACvG;AACF;;;;"}
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ var client = require('../../client/client.cjs');
4
+
5
+ // AUTOGENERATED -- DO NOT EDIT
6
+ class ZambdaLogStream extends client.SDKResource {
7
+ constructor(config) {
8
+ super(config);
9
+ }
10
+ #baseUrlThunk() {
11
+ return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
12
+ }
13
+ /**
14
+ * Get the log streams for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/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.
15
+ *
16
+ * Access Policy Action: `Zambda:ReadLogs`
17
+ * Access Policy Resource: `Zambda:Function`
18
+ */
19
+ list(params, request) {
20
+ return this.request('/zambda/{id}/logStream', 'post', this.#baseUrlThunk.bind(this))(params, request);
21
+ }
22
+ /**
23
+ * 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/oystehr/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.
24
+ *
25
+ * Access Policy Action: `Zambda:ReadLogs`
26
+ * Access Policy Resource: `Zambda:Function`
27
+ */
28
+ search(params, request) {
29
+ return this.request('/zambda/{id}/logStream/search', 'post', this.#baseUrlThunk.bind(this))(params, request);
30
+ }
31
+ /**
32
+ * Get the logs from the specified log stream for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/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.
33
+ *
34
+ * Access Policy Action: `Zambda:ReadLogs`
35
+ * Access Policy Resource: `Zambda:Function`
36
+ */
37
+ get(params, request) {
38
+ return this.request('/zambda/{id}/logStream/{logStreamName}', 'post', this.#baseUrlThunk.bind(this))(params, request);
39
+ }
40
+ }
41
+
42
+ exports.ZambdaLogStream = ZambdaLogStream;
43
+ //# sourceMappingURL=zambdaLogStream.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zambdaLogStream.cjs","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/oystehr/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/oystehr/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/oystehr/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":["SDKResource"],"mappings":";;;;AAAA;AAcM,MAAO,eAAgB,SAAQA,kBAAW,CAAA;AAC9C,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;KACvF;AACD;;;;;AAKG;IACH,IAAI,CAAC,MAAiC,EAAE,OAA8B,EAAA;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACvG;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAmC,EAAE,OAA8B,EAAA;QACxE,OAAO,IAAI,CAAC,OAAO,CAAC,+BAA+B,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC9G;AACD;;;;;AAKG;IACH,GAAG,CAAC,MAAgC,EAAE,OAA8B,EAAA;QAClE,OAAO,IAAI,CAAC,OAAO,CACjB,wCAAwC,EACxC,MAAM,EACN,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAC9B,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpB;AACF;;;;"}
@@ -11,9 +11,18 @@ export type ErxCheckMedicationInteractionsResponse = {
11
11
  */
12
12
  severityLevel: 'MajorInteraction' | 'ModerateInteraction' | 'MinorInteraction' | 'Unknown';
13
13
  /**
14
- * List of drug IDs involved in the interaction.
14
+ * List of medications involved in the interaction.
15
15
  */
16
- drugIds: number[];
16
+ medications?: {
17
+ /**
18
+ * The Medi-Span identifier for the medication.
19
+ */
20
+ id: number;
21
+ /**
22
+ * Human readable name of medication.
23
+ */
24
+ name: string;
25
+ }[];
17
26
  /**
18
27
  * Indicates if the interaction includes pending medications.
19
28
  */
@@ -18,9 +18,18 @@ export interface ErxCheckPrecheckInteractionsResponse {
18
18
  */
19
19
  severityLevel: 'MajorInteraction' | 'ModerateInteraction' | 'MinorInteraction' | 'Unknown';
20
20
  /**
21
- * List of drug IDs involved in the interaction.
21
+ * List of medications involved in the interaction.
22
22
  */
23
- drugIds: number[];
23
+ medications?: {
24
+ /**
25
+ * The Medi-Span identifier for the medication.
26
+ */
27
+ id: number;
28
+ /**
29
+ * Human readable name of medication.
30
+ */
31
+ name: string;
32
+ }[];
24
33
  /**
25
34
  * Indicates if the interaction includes pending medications.
26
35
  */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Configuration
3
+ */
4
+ export interface ErxGetConfigurationResponse {
5
+ /**
6
+ * True if the project is configured for eRx.
7
+ */
8
+ configured?: boolean;
9
+ }
@@ -9,12 +9,16 @@ export interface ZambdaCreateParams {
9
9
  */
10
10
  triggerMethod?: 'http_auth' | 'http_open' | 'subscription' | 'cron';
11
11
  schedule?: ZambdaSchedule;
12
+ /**
13
+ * The runtime to use for the Zambda Function. This property is optional and defaults to "nodejs20.x".
14
+ */
15
+ runtime?: 'nodejs18.x' | 'nodejs20.x' | 'nodejs22.x' | 'python3.13' | 'python3.12' | 'java21' | 'dotnet9' | 'ruby3.3';
12
16
  /**
13
17
  * The amount of memory in MB to allocate to the Zambda Function. If not specified, a system default (1024MB) will be used. Min: 128MB, Max: 10240MB.
14
18
  */
15
19
  memorySize?: number;
16
20
  /**
17
- * The timeout for the Zambda Function in seconds. If not specified, a system default (27 seconds) will be used. Min: 1s, Max: 900s (15 minutes). Note: For 'http_auth' and 'http_open' trigger methods, the timeout cannot exceed 29 seconds due to API Gateway limitations.
21
+ * The timeout for the Zambda Function in seconds. If not specified, a system default (27 seconds) will be used. Min: 1s, Max: 900s (15 minutes). Note: For 'http_auth' and 'http_open' trigger methods, the timeout cannot exceed 27 seconds due to API Gateway limitations.
18
22
  */
19
23
  timeoutInSeconds?: number;
20
24
  }
@@ -40,7 +40,7 @@ export interface ZambdaFunction {
40
40
  */
41
41
  memorySize?: number;
42
42
  /**
43
- * The timeout for the Zambda Function in seconds. If not specified, a system default (27 seconds) will be used. Min: 1s, Max: 900s (15 minutes). Note: For 'http_auth' and 'http_open' trigger methods, the timeout cannot exceed 29 seconds due to API Gateway limitations.
43
+ * The timeout for the Zambda Function in seconds. If not specified, a system default (27 seconds) will be used. Min: 1s, Max: 900s (15 minutes). Note: For 'http_auth' and 'http_open' trigger methods, the timeout cannot exceed 27 seconds due to API Gateway limitations.
44
44
  */
45
45
  timeoutInSeconds?: number;
46
46
  }
@@ -18,7 +18,7 @@ export interface ZambdaUpdateParams {
18
18
  */
19
19
  memorySize?: number;
20
20
  /**
21
- * The timeout for the Zambda Function in seconds. If not specified, a system default (27 seconds) will be used. Min: 1s, Max: 900s (15 minutes). Note: For 'http_auth' and 'http_open' trigger methods, the timeout cannot exceed 29 seconds due to API Gateway limitations.
21
+ * The timeout for the Zambda Function in seconds. If not specified, a system default (27 seconds) will be used. Min: 1s, Max: 900s (15 minutes). Note: For 'http_auth' and 'http_open' trigger methods, the timeout cannot exceed 27 seconds due to API Gateway limitations.
22
22
  */
23
23
  timeoutInSeconds?: number;
24
24
  id: string;
@@ -176,6 +176,7 @@ export * from './ErxSearchAllergensParams';
176
176
  export * from './ErxSearchAllergensResponse';
177
177
  export * from './ErxSearchMedicationsParams';
178
178
  export * from './ErxSearchMedicationsResponse';
179
+ export * from './ErxGetConfigurationResponse';
179
180
  export * from './ErxCheckAllergyInteractionsParams';
180
181
  export * from './ErxCheckAllergyInteractionsResponse';
181
182
  export * from './ErxCheckMedicationInteractionsParams';