@oystehr/sdk 3.0.6 → 3.0.8

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 (192) hide show
  1. package/README.md +28 -12
  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 +313 -155
  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 +6 -5
  10. package/dist/cjs/resources/classes/charge.d.ts +1 -0
  11. package/dist/cjs/resources/classes/conversation.d.ts +6 -5
  12. package/dist/cjs/resources/classes/developer.d.ts +14 -6
  13. package/dist/cjs/resources/classes/erx.d.ts +9 -0
  14. package/dist/cjs/resources/classes/fax.d.ts +4 -3
  15. package/dist/cjs/resources/classes/fhir.d.ts +1 -0
  16. package/dist/cjs/resources/classes/index.d.ts +1 -1
  17. package/dist/cjs/resources/classes/m2m.d.ts +15 -7
  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 +10 -2
  21. package/dist/cjs/resources/classes/rcm.d.ts +4 -3
  22. package/dist/cjs/resources/classes/role.d.ts +6 -5
  23. package/dist/cjs/resources/classes/secret.d.ts +1 -0
  24. package/dist/cjs/resources/classes/telemed.d.ts +2 -1
  25. package/dist/cjs/resources/classes/transactionalSMS.d.ts +2 -1
  26. package/dist/cjs/resources/classes/user.d.ts +15 -7
  27. package/dist/cjs/resources/classes/version.d.ts +1 -0
  28. package/dist/cjs/resources/classes/z3.d.ts +7 -6
  29. package/dist/cjs/resources/classes/zambda.d.ts +9 -8
  30. package/dist/cjs/resources/classes/zambdaLogStream.d.ts +4 -3
  31. package/dist/cjs/resources/types/AccessPolicy.d.ts +8 -3
  32. package/dist/cjs/resources/types/ChargeIssueParams.d.ts +1 -1
  33. package/dist/cjs/resources/types/ChargeStatusParams.d.ts +1 -1
  34. package/dist/cjs/resources/types/DeveloperInviteResponse.d.ts +0 -4
  35. package/dist/cjs/resources/types/DeveloperListV2Params.d.ts +2 -2
  36. package/dist/cjs/resources/types/FaxSendParams.d.ts +1 -1
  37. package/dist/cjs/resources/types/M2mListV2Params.d.ts +2 -2
  38. package/dist/cjs/resources/types/M2mRotateSecretResponse.d.ts +1 -1
  39. package/dist/cjs/resources/types/RcmEligibilityCheckParams.d.ts +1 -1
  40. package/dist/cjs/resources/types/RoleUpdateParams.d.ts +0 -4
  41. package/dist/cjs/resources/types/TelemedCreateMeetingParams.d.ts +1 -1
  42. package/dist/cjs/resources/types/UserListV2Params.d.ts +2 -2
  43. package/dist/cjs/resources/types/ZambdaCreateParams.d.ts +1 -1
  44. package/dist/cjs/resources/types/ZambdaFunction.d.ts +1 -1
  45. package/dist/cjs/resources/types/ZambdaUpdateParams.d.ts +2 -2
  46. package/dist/cjs/resources/types/index.d.ts +2 -2
  47. package/dist/cjs/tests/setup/constants.d.ts +2 -6
  48. package/dist/cjs/tests/setup/global.d.ts +1 -0
  49. package/dist/esm/client/client.d.ts +1 -1
  50. package/dist/esm/client/client.js +4 -4
  51. package/dist/esm/client/client.js.map +1 -1
  52. package/dist/esm/config.d.ts +5 -0
  53. package/dist/esm/errors/index.d.ts +4 -1
  54. package/dist/esm/errors/index.js +18 -2
  55. package/dist/esm/errors/index.js.map +1 -1
  56. package/dist/esm/index.min.js +1 -1
  57. package/dist/esm/index.min.js.map +1 -1
  58. package/dist/esm/resources/classes/application.d.ts +6 -5
  59. package/dist/esm/resources/classes/application.js +20 -13
  60. package/dist/esm/resources/classes/application.js.map +1 -1
  61. package/dist/esm/resources/classes/charge.d.ts +1 -0
  62. package/dist/esm/resources/classes/charge.js +9 -2
  63. package/dist/esm/resources/classes/charge.js.map +1 -1
  64. package/dist/esm/resources/classes/conversation.d.ts +6 -5
  65. package/dist/esm/resources/classes/conversation.js +17 -10
  66. package/dist/esm/resources/classes/conversation.js.map +1 -1
  67. package/dist/esm/resources/classes/developer.d.ts +14 -6
  68. package/dist/esm/resources/classes/developer.js +18 -11
  69. package/dist/esm/resources/classes/developer.js.map +1 -1
  70. package/dist/esm/resources/classes/erx.d.ts +9 -0
  71. package/dist/esm/resources/classes/erx.js +13 -6
  72. package/dist/esm/resources/classes/erx.js.map +1 -1
  73. package/dist/esm/resources/classes/fax.d.ts +4 -3
  74. package/dist/esm/resources/classes/fax.js +13 -6
  75. package/dist/esm/resources/classes/fax.js.map +1 -1
  76. package/dist/esm/resources/classes/fhir.d.ts +1 -0
  77. package/dist/esm/resources/classes/fhir.js +3 -0
  78. package/dist/esm/resources/classes/fhir.js.map +1 -1
  79. package/dist/esm/resources/classes/index.d.ts +1 -1
  80. package/dist/esm/resources/classes/index.js +6 -1
  81. package/dist/esm/resources/classes/index.js.map +1 -1
  82. package/dist/esm/resources/classes/m2m.d.ts +15 -7
  83. package/dist/esm/resources/classes/m2m.js +20 -13
  84. package/dist/esm/resources/classes/m2m.js.map +1 -1
  85. package/dist/esm/resources/classes/messaging.d.ts +1 -0
  86. package/dist/esm/resources/classes/messaging.js +8 -1
  87. package/dist/esm/resources/classes/messaging.js.map +1 -1
  88. package/dist/esm/resources/classes/paymentMethod.d.ts +1 -0
  89. package/dist/esm/resources/classes/paymentMethod.js +11 -4
  90. package/dist/esm/resources/classes/paymentMethod.js.map +1 -1
  91. package/dist/esm/resources/classes/project.d.ts +10 -2
  92. package/dist/esm/resources/classes/project.js +10 -3
  93. package/dist/esm/resources/classes/project.js.map +1 -1
  94. package/dist/esm/resources/classes/rcm.d.ts +4 -3
  95. package/dist/esm/resources/classes/rcm.js +13 -6
  96. package/dist/esm/resources/classes/rcm.js.map +1 -1
  97. package/dist/esm/resources/classes/role.d.ts +6 -5
  98. package/dist/esm/resources/classes/role.js +17 -10
  99. package/dist/esm/resources/classes/role.js.map +1 -1
  100. package/dist/esm/resources/classes/secret.d.ts +1 -0
  101. package/dist/esm/resources/classes/secret.js +11 -4
  102. package/dist/esm/resources/classes/secret.js.map +1 -1
  103. package/dist/esm/resources/classes/telemed.d.ts +2 -1
  104. package/dist/esm/resources/classes/telemed.js +10 -3
  105. package/dist/esm/resources/classes/telemed.js.map +1 -1
  106. package/dist/esm/resources/classes/transactionalSMS.d.ts +2 -1
  107. package/dist/esm/resources/classes/transactionalSMS.js +9 -2
  108. package/dist/esm/resources/classes/transactionalSMS.js.map +1 -1
  109. package/dist/esm/resources/classes/user.d.ts +15 -7
  110. package/dist/esm/resources/classes/user.js +20 -13
  111. package/dist/esm/resources/classes/user.js.map +1 -1
  112. package/dist/esm/resources/classes/version.d.ts +1 -0
  113. package/dist/esm/resources/classes/version.js +8 -1
  114. package/dist/esm/resources/classes/version.js.map +1 -1
  115. package/dist/esm/resources/classes/z3-ext.js +9 -5
  116. package/dist/esm/resources/classes/z3-ext.js.map +1 -1
  117. package/dist/esm/resources/classes/z3.d.ts +7 -6
  118. package/dist/esm/resources/classes/z3.js +19 -12
  119. package/dist/esm/resources/classes/z3.js.map +1 -1
  120. package/dist/esm/resources/classes/zambda-ext.js +5 -1
  121. package/dist/esm/resources/classes/zambda-ext.js.map +1 -1
  122. package/dist/esm/resources/classes/zambda.d.ts +9 -8
  123. package/dist/esm/resources/classes/zambda.js +23 -16
  124. package/dist/esm/resources/classes/zambda.js.map +1 -1
  125. package/dist/esm/resources/classes/zambdaLogStream.d.ts +4 -3
  126. package/dist/esm/resources/classes/zambdaLogStream.js +13 -6
  127. package/dist/esm/resources/classes/zambdaLogStream.js.map +1 -1
  128. package/dist/esm/resources/types/AccessPolicy.d.ts +8 -3
  129. package/dist/esm/resources/types/ChargeIssueParams.d.ts +1 -1
  130. package/dist/esm/resources/types/ChargeStatusParams.d.ts +1 -1
  131. package/dist/esm/resources/types/DeveloperInviteResponse.d.ts +0 -4
  132. package/dist/esm/resources/types/DeveloperListV2Params.d.ts +2 -2
  133. package/dist/esm/resources/types/FaxSendParams.d.ts +1 -1
  134. package/dist/esm/resources/types/M2mListV2Params.d.ts +2 -2
  135. package/dist/esm/resources/types/M2mRotateSecretResponse.d.ts +1 -1
  136. package/dist/esm/resources/types/RcmEligibilityCheckParams.d.ts +1 -1
  137. package/dist/esm/resources/types/RoleUpdateParams.d.ts +0 -4
  138. package/dist/esm/resources/types/TelemedCreateMeetingParams.d.ts +1 -1
  139. package/dist/esm/resources/types/UserListV2Params.d.ts +2 -2
  140. package/dist/esm/resources/types/ZambdaCreateParams.d.ts +1 -1
  141. package/dist/esm/resources/types/ZambdaFunction.d.ts +1 -1
  142. package/dist/esm/resources/types/ZambdaUpdateParams.d.ts +2 -2
  143. package/dist/esm/resources/types/index.d.ts +2 -2
  144. package/dist/esm/tests/setup/constants.d.ts +2 -6
  145. package/dist/esm/tests/setup/global.d.ts +1 -0
  146. package/package.json +3 -3
  147. package/src/client/client.ts +6 -6
  148. package/src/config.ts +5 -0
  149. package/src/errors/index.ts +18 -2
  150. package/src/resources/classes/application.ts +24 -13
  151. package/src/resources/classes/charge.ts +5 -2
  152. package/src/resources/classes/conversation.ts +25 -10
  153. package/src/resources/classes/developer.ts +32 -12
  154. package/src/resources/classes/erx.ts +31 -6
  155. package/src/resources/classes/fax.ts +9 -6
  156. package/src/resources/classes/fhir.ts +3 -0
  157. package/src/resources/classes/index.ts +5 -2
  158. package/src/resources/classes/m2m.ts +31 -14
  159. package/src/resources/classes/messaging.ts +4 -1
  160. package/src/resources/classes/paymentMethod.ts +7 -4
  161. package/src/resources/classes/project.ts +24 -4
  162. package/src/resources/classes/rcm.ts +9 -6
  163. package/src/resources/classes/role.ts +13 -10
  164. package/src/resources/classes/secret.ts +7 -4
  165. package/src/resources/classes/telemed.ts +10 -3
  166. package/src/resources/classes/transactionalSMS.ts +5 -2
  167. package/src/resources/classes/user.ts +34 -14
  168. package/src/resources/classes/version.ts +4 -1
  169. package/src/resources/classes/z3-ext.ts +10 -4
  170. package/src/resources/classes/z3.ts +15 -12
  171. package/src/resources/classes/zambda-ext.ts +5 -1
  172. package/src/resources/classes/zambda.ts +19 -16
  173. package/src/resources/classes/zambdaLogStream.ts +13 -6
  174. package/src/resources/types/AccessPolicy.ts +12 -3
  175. package/src/resources/types/ChargeIssueParams.ts +1 -1
  176. package/src/resources/types/ChargeStatusParams.ts +1 -1
  177. package/src/resources/types/DeveloperInviteResponse.ts +0 -4
  178. package/src/resources/types/DeveloperListV2Params.ts +2 -2
  179. package/src/resources/types/FaxSendParams.ts +1 -1
  180. package/src/resources/types/M2mListV2Params.ts +2 -2
  181. package/src/resources/types/M2mRotateSecretResponse.ts +1 -1
  182. package/src/resources/types/RcmEligibilityCheckParams.ts +1 -1
  183. package/src/resources/types/RoleUpdateParams.ts +0 -4
  184. package/src/resources/types/TelemedCreateMeetingParams.ts +1 -1
  185. package/src/resources/types/UserListV2Params.ts +2 -2
  186. package/src/resources/types/ZambdaCreateParams.ts +1 -1
  187. package/src/resources/types/ZambdaFunction.ts +1 -1
  188. package/src/resources/types/ZambdaUpdateParams.ts +2 -2
  189. package/src/resources/types/index.ts +2 -2
  190. package/dist/esm/node_modules/tslib/package.json +0 -1
  191. package/dist/esm/node_modules/tslib/tslib.es6.js +0 -34
  192. package/dist/esm/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -3,8 +3,8 @@
3
3
  var uuid = require('uuid');
4
4
 
5
5
  class OystehrSdkError extends Error {
6
- constructor({ message, code }) {
7
- super(message);
6
+ constructor({ message, code, cause }) {
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 @@ class OystehrSdkError extends Error {
12
12
  toString() {
13
13
  return `${this.name}: ${this.message} (code: ${this.code})`;
14
14
  }
15
+ toJSON() {
16
+ return {
17
+ name: this.name,
18
+ message: this.message,
19
+ code: this.code,
20
+ cause: this.cause,
21
+ };
22
+ }
15
23
  }
16
24
  function transformOperationOutcomeToErrorMessage(cause) {
17
25
  var _a;
@@ -36,6 +44,14 @@ class OystehrFHIRError extends OystehrSdkError {
36
44
  this.cause = error;
37
45
  this.name = 'OystehrFHIRError';
38
46
  }
47
+ toJSON() {
48
+ return {
49
+ name: this.name,
50
+ message: this.message,
51
+ code: this.code,
52
+ cause: this.cause,
53
+ };
54
+ }
39
55
  }
40
56
 
41
57
  /******************************************************************************
@@ -65,6 +81,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
65
81
  });
66
82
  }
67
83
 
84
+ function __classPrivateFieldGet(receiver, state, kind, f) {
85
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
86
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
87
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
88
+ }
89
+
68
90
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
69
91
  var e = new Error(message);
70
92
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -87,23 +109,22 @@ class SDKResource {
87
109
  constructor(config) {
88
110
  this.config = config;
89
111
  }
90
- request(path, method) {
112
+ request(path, method, baseUrlThunk) {
91
113
  return (params, request) => __awaiter(this, void 0, void 0, function* () {
92
- const baseUrlThunk = () => { var _a; return (_a = this.config.projectApiUrl) !== null && _a !== void 0 ? _a : defaultProjectApiUrl; };
93
114
  const configThunk = () => this.config;
94
115
  try {
95
116
  return yield fetcher(baseUrlThunk, configThunk, path, method)(params, request);
96
117
  }
97
118
  catch (err) {
98
119
  const error = err;
99
- throw new OystehrSdkError({ message: error.message, code: error.code });
120
+ throw new OystehrSdkError({ message: error.message, code: error.code, cause: error.cause });
100
121
  }
101
122
  });
102
123
  }
103
124
  fhirRequest(path, method) {
104
125
  return (params, request) => __awaiter(this, void 0, void 0, function* () {
105
126
  try {
106
- const baseUrlThunk = () => { var _a; return (_a = this.config.fhirApiUrl) !== null && _a !== void 0 ? _a : defaultFhirApiUrl; };
127
+ const baseUrlThunk = () => { var _a, _b; return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a.fhirApiUrl) !== null && _b !== void 0 ? _b : defaultFhirApiUrl; };
107
128
  const configThunk = () => this.config;
108
129
  // must await here to catch
109
130
  return yield fetcher(baseUrlThunk, configThunk, path, method)(params, request);
@@ -115,6 +136,7 @@ class SDKResource {
115
136
  throw new OystehrSdkError({
116
137
  message: fullError.message,
117
138
  code: fullError.code,
139
+ cause: fullError.cause,
118
140
  });
119
141
  }
120
142
  throw new OystehrFHIRError({
@@ -319,54 +341,56 @@ function addParamsToSearch(params, search) {
319
341
  }
320
342
 
321
343
  // AUTOGENERATED -- DO NOT EDIT
344
+ var _Application_instances, _Application_baseUrlThunk;
322
345
  class Application extends SDKResource {
323
346
  constructor(config) {
324
347
  super(config);
348
+ _Application_instances.add(this);
325
349
  }
326
350
  /**
327
- * 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.
351
+ * Get a list of Applications. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
328
352
  *
329
353
  * Access Policy Action: `App:ListAllApplications`
330
354
  * Access Policy Resource: `App:Application`
331
355
  */
332
356
  list(request) {
333
- return this.request('/application', 'get')(request);
357
+ return this.request('/application', 'get', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(request);
334
358
  }
335
359
  /**
336
- * 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.
360
+ * Create a new Application. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
337
361
  *
338
362
  * Access Policy Action: `App:CreateApplication`
339
363
  * Access Policy Resource: `App:Application`
340
364
  */
341
365
  create(params, request) {
342
- return this.request('/application', 'post')(params, request);
366
+ return this.request('/application', 'post', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
343
367
  }
344
368
  /**
345
- * 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.
369
+ * Get the Application with the provided ID. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
346
370
  *
347
371
  * Access Policy Action: `App:GetApplication`
348
372
  * Access Policy Resource: `App:Application`
349
373
  */
350
374
  get(params, request) {
351
- return this.request('/application/{id}', 'get')(params, request);
375
+ return this.request('/application/{id}', 'get', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
352
376
  }
353
377
  /**
354
- * 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.
378
+ * Update the Application with the provided ID. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
355
379
  *
356
380
  * Access Policy Action: `App:UpdateApplication`
357
381
  * Access Policy Resource: `App:Application`
358
382
  */
359
383
  update(params, request) {
360
- return this.request('/application/{id}', 'patch')(params, request);
384
+ return this.request('/application/{id}', 'patch', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
361
385
  }
362
386
  /**
363
- * 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.
387
+ * Delete the Application with the provided ID. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
364
388
  *
365
389
  * Access Policy Action: `App:DeleteApplication`
366
390
  * Access Policy Resource: `App:Application`
367
391
  */
368
392
  delete(params, request) {
369
- return this.request('/application/{id}', 'delete')(params, request);
393
+ return this.request('/application/{id}', 'delete', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
370
394
  }
371
395
  /**
372
396
  * Rotate client's secrete associated with an application.
@@ -375,7 +399,7 @@ class Application extends SDKResource {
375
399
  * Access Policy Resource: `App:Application`
376
400
  */
377
401
  rotateSecret(params, request) {
378
- return this.request('/application/{id}/rotate-secret', 'post')(params, request);
402
+ return this.request('/application/{id}/rotate-secret', 'post', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
379
403
  }
380
404
  /**
381
405
  * Revokes user's refresh token issued for the application.
@@ -384,7 +408,7 @@ class Application extends SDKResource {
384
408
  * Access Policy Resource: `App:Application`
385
409
  */
386
410
  revokeRefreshToken(params, request) {
387
- return this.request('/application/{id}/revoke-refresh-token', 'post')(params, request);
411
+ return this.request('/application/{id}/revoke-refresh-token', 'post', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
388
412
  }
389
413
  /**
390
414
  * Revokes user's access token issued for the application.
@@ -393,14 +417,20 @@ class Application extends SDKResource {
393
417
  * Access Policy Resource: `App:Application`
394
418
  */
395
419
  revokeAccessToken(params, request) {
396
- return this.request('/application/{id}/revoke-access-token', 'post')(params, request);
420
+ return this.request('/application/{id}/revoke-access-token', 'post', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
397
421
  }
398
422
  }
423
+ _Application_instances = new WeakSet(), _Application_baseUrlThunk = function _Application_baseUrlThunk() {
424
+ var _a, _b;
425
+ 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';
426
+ };
399
427
 
400
428
  // AUTOGENERATED -- DO NOT EDIT
429
+ var _Charge_instances, _Charge_baseUrlThunk;
401
430
  class Charge extends SDKResource {
402
431
  constructor(config) {
403
432
  super(config);
433
+ _Charge_instances.add(this);
404
434
  }
405
435
  /**
406
436
  * Charge patient's default payment method for a specified encounter or charge item.
@@ -414,7 +444,7 @@ class Charge extends SDKResource {
414
444
  * Access Policy Resources: `FHIR:Patient:*,FHIR:Encounter:*,FHIR:Coverage:*`
415
445
  */
416
446
  issue(params, request) {
417
- return this.request('/payment/charge/issue', 'post')(params, request);
447
+ return this.request('/payment/charge/issue', 'post', __classPrivateFieldGet(this, _Charge_instances, "m", _Charge_baseUrlThunk).bind(this))(params, request);
418
448
  }
419
449
  /**
420
450
  * Retrieve charge status for a specified encounter or charge item.
@@ -428,9 +458,13 @@ class Charge extends SDKResource {
428
458
  * Access Policy Resources: `FHIR:Patient:*,FHIR:Encounter:*,FHIR:Coverage:*`
429
459
  */
430
460
  status(params, request) {
431
- return this.request('/payment/charge/status', 'post')(params, request);
461
+ return this.request('/payment/charge/status', 'post', __classPrivateFieldGet(this, _Charge_instances, "m", _Charge_baseUrlThunk).bind(this))(params, request);
432
462
  }
433
463
  }
464
+ _Charge_instances = new WeakSet(), _Charge_baseUrlThunk = function _Charge_baseUrlThunk() {
465
+ var _a, _b;
466
+ 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';
467
+ };
434
468
 
435
469
  const ENCOUNTER_VS_EXTENSION_URL = 'https://extensions.fhir.zapehr.com/encounter-virtual-service-pre-release';
436
470
  const ENCOUNTER_VS_EXTENSION_RELATIVE_URL = 'addressString';
@@ -459,9 +493,11 @@ function getConversationIdFromEncounter(encounter) {
459
493
  }
460
494
 
461
495
  // AUTOGENERATED -- DO NOT EDIT
496
+ var _Conversation_instances, _Conversation_baseUrlThunk;
462
497
  class Conversation extends SDKResource {
463
498
  constructor(config) {
464
499
  super(config);
500
+ _Conversation_instances.add(this);
465
501
  this.ENCOUNTER_VS_EXTENSION_URL = ENCOUNTER_VS_EXTENSION_URL;
466
502
  this.ENCOUNTER_VS_EXTENSION_RELATIVE_URL = ENCOUNTER_VS_EXTENSION_RELATIVE_URL;
467
503
  /**
@@ -472,7 +508,7 @@ class Conversation extends SDKResource {
472
508
  this.getConversationIdFromEncounter = getConversationIdFromEncounter;
473
509
  }
474
510
  /**
475
- * Create a new 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.
511
+ * Create a new Conversation. [Conversations](https://docs.oystehr.com/oystehr/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.
476
512
  *
477
513
  * Access Policy Requirements:
478
514
  * Action: `Messaging:CreateConversation`
@@ -483,19 +519,19 @@ class Conversation extends SDKResource {
483
519
  * Access Policy Resource: `FHIR:Encounter`
484
520
  */
485
521
  create(params, request) {
486
- return this.request('/messaging/conversation', 'post')(params, request);
522
+ return this.request('/messaging/conversation', 'post', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(params, request);
487
523
  }
488
524
  /**
489
- * 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.
525
+ * Get a Conversation Token. Conversation Tokens are used to join the Conversation with the Twilio Conversations SDKs. [Conversations](https://docs.oystehr.com/oystehr/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.
490
526
  *
491
527
  * Access Policy Action: `Messaging:GetConversationToken`
492
528
  * Access Policy Resource: `Messaging:Conversation`.
493
529
  */
494
530
  getToken(request) {
495
- return this.request('/messaging/conversation/token', 'get')(request);
531
+ return this.request('/messaging/conversation/token', 'get', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(request);
496
532
  }
497
533
  /**
498
- * 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.
534
+ * Add a participant to a Conversation. [Conversations](https://docs.oystehr.com/oystehr/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.
499
535
  *
500
536
  * Access Policy Requirements:
501
537
  * Action: `Messaging:ConversationAddParticipant`
@@ -506,10 +542,10 @@ class Conversation extends SDKResource {
506
542
  * Access Policy Resource: `FHIR:Encounter`
507
543
  */
508
544
  addParticipant(params, request) {
509
- return this.request('/messaging/conversation/{conversationId}/participant', 'post')(params, request);
545
+ return this.request('/messaging/conversation/{conversationId}/participant', 'post', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(params, request);
510
546
  }
511
547
  /**
512
- * 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.
548
+ * Remove a participant from a Conversation. [Conversations](https://docs.oystehr.com/oystehr/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.
513
549
  *
514
550
  * Access Policy Requirements:
515
551
  * Action: `Messaging:ConversationRemoveParticipant`
@@ -518,71 +554,77 @@ class Conversation extends SDKResource {
518
554
  * Access Policy Resource: `FHIR:Patient`, `FHIR:Practitioner`, or `FHIR:RelatedPerson`
519
555
  */
520
556
  removeParticipant(params, request) {
521
- return this.request('/messaging/conversation/{conversationId}/participant', 'delete')(params, request);
557
+ return this.request('/messaging/conversation/{conversationId}/participant', 'delete', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(params, request);
522
558
  }
523
559
  /**
524
- * 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.
560
+ * Send a message to a Conversation. [Conversations](https://docs.oystehr.com/oystehr/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.
525
561
  *
526
562
  * Access Policy Requirements:
527
563
  * Action: `Messaging:ConversationSendMessage`
528
564
  * Access Policy Resource: `Messaging:Conversation`
529
565
  */
530
566
  message(params, request) {
531
- return this.request('/messaging/conversation/{conversationId}/message', 'post')(params, request);
567
+ return this.request('/messaging/conversation/{conversationId}/message', 'post', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(params, request);
532
568
  }
533
569
  }
570
+ _Conversation_instances = new WeakSet(), _Conversation_baseUrlThunk = function _Conversation_baseUrlThunk() {
571
+ var _a, _b;
572
+ 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';
573
+ };
534
574
 
535
575
  // AUTOGENERATED -- DO NOT EDIT
576
+ var _Developer_instances, _Developer_baseUrlThunk;
536
577
  class Developer extends SDKResource {
537
578
  constructor(config) {
538
579
  super(config);
580
+ _Developer_instances.add(this);
539
581
  }
540
582
  /**
541
- * 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.
583
+ * 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/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
542
584
  *
543
585
  * Access Policy Action: `IAM:GetDeveloper`
544
586
  * Access Policy Resource: `IAM:Developer`
545
587
  */
546
588
  get(params, request) {
547
- return this.request('/developer/{id}', 'get')(params, request);
589
+ return this.request('/developer/{id}', 'get', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
548
590
  }
549
591
  /**
550
- * 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.
592
+ * 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/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
551
593
  *
552
594
  * Access Policy Action: `IAM:UpdateDeveloper`
553
595
  * Access Policy Resource: `IAM:Developer`
554
596
  */
555
597
  update(params, request) {
556
- return this.request('/developer/{id}', 'patch')(params, request);
598
+ return this.request('/developer/{id}', 'patch', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
557
599
  }
558
600
  /**
559
- * 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.
601
+ * 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/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
560
602
  *
561
603
  * Access Policy Action: `IAM:RemoveDeveloper`
562
604
  * Access Policy Resource: `IAM:Developer`
563
605
  */
564
606
  delete(params, request) {
565
- return this.request('/developer/{id}', 'delete')(params, request);
607
+ return this.request('/developer/{id}', 'delete', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
566
608
  }
567
609
  /**
568
- * 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.
610
+ * 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/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
569
611
  *
570
612
  * Access Policy Action: `IAM:InviteDeveloper`
571
613
  * Access Policy Resource: `IAM:Developer`
572
614
  */
573
615
  invite(params, request) {
574
- return this.request('/developer/invite', 'post')(params, request);
616
+ return this.request('/developer/invite', 'post', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
575
617
  }
576
618
  /**
577
619
  * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_developer-v2-list) instead.
578
620
  *
579
- * Get a list of all Developers who are part of 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.
621
+ * Get a list of all Developers who are part of the Project. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
580
622
  *
581
623
  * Access Policy Action: `IAM:ListAllDevelopers`
582
624
  * Access Policy Resource: `IAM:Developer`
583
625
  */
584
626
  list(request) {
585
- return this.request('/developer', 'get')(request);
627
+ return this.request('/developer', 'get', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(request);
586
628
  }
587
629
  /**
588
630
  * 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.
@@ -591,89 +633,105 @@ class Developer extends SDKResource {
591
633
  * Access Policy Resource: `Project:Settings`
592
634
  */
593
635
  listV2(params, request) {
594
- return this.request('/developer/v2/list', 'get')(params, request);
636
+ return this.request('/developer/v2/list', 'get', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
595
637
  }
596
638
  }
639
+ _Developer_instances = new WeakSet(), _Developer_baseUrlThunk = function _Developer_baseUrlThunk() {
640
+ var _a, _b;
641
+ 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';
642
+ };
597
643
 
598
644
  // AUTOGENERATED -- DO NOT EDIT
645
+ var _Erx_instances, _Erx_baseUrlThunk;
599
646
  class Erx extends SDKResource {
600
647
  constructor(config) {
601
648
  super(config);
649
+ _Erx_instances.add(this);
602
650
  }
603
651
  /**
604
652
  * Retrieve patient properties from FHIR service and sync them with eRx service
605
653
  */
606
654
  syncPatient(params, request) {
607
- return this.request('/erx/sync-patient/{patientId}', 'post')(params, request);
655
+ return this.request('/erx/sync-patient/{patientId}', 'post', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
608
656
  }
609
657
  /**
610
658
  * Search for allergies
611
659
  */
612
660
  allergySearch(params, request) {
613
- return this.request('/erx/allergy/search', 'get')(params, request);
661
+ return this.request('/erx/allergy/search', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
614
662
  }
615
663
  /**
616
664
  * Cancel photon order
617
665
  */
618
666
  cancelOrder(params, request) {
619
- return this.request('/erx/cancel-order', 'post')(params, request);
667
+ return this.request('/erx/cancel-order', 'post', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
620
668
  }
621
669
  /**
622
670
  * Cancel photon prescription
623
671
  */
624
672
  cancelPrescription(params, request) {
625
- return this.request('/erx/cancel-prescription', 'post')(params, request);
673
+ return this.request('/erx/cancel-prescription', 'post', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
626
674
  }
627
675
  /**
628
676
  * Search for medications. Provide at least one of code or name filters
629
677
  */
630
678
  medicationSearch(params, request) {
631
- return this.request('/erx/medication/search', 'get')(params, request);
679
+ return this.request('/erx/medication/search', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
632
680
  }
633
681
  /**
634
682
  * Search for medications. Provide at least one of code or name filters
635
683
  */
636
684
  medicationSearchV2(params, request) {
637
- return this.request('/erx/v2/medication/search', 'get')(params, request);
685
+ return this.request('/erx/v2/medication/search', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
638
686
  }
639
687
  }
688
+ _Erx_instances = new WeakSet(), _Erx_baseUrlThunk = function _Erx_baseUrlThunk() {
689
+ var _a, _b;
690
+ 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';
691
+ };
640
692
 
641
693
  // AUTOGENERATED -- DO NOT EDIT
694
+ var _Fax_instances, _Fax_baseUrlThunk;
642
695
  class Fax extends SDKResource {
643
696
  constructor(config) {
644
697
  super(config);
698
+ _Fax_instances.add(this);
645
699
  }
646
700
  /**
647
- * Offboard a fax number. Oystehr's [offboard](https://docs.oystehr.com/services/fax/number/) feature makes it easy to stop using the fax service and release the project's assigned fax number with a single API call. Please note there is no way to guarantee getting the same number back again, so if you think this can break your project in any way we recommend not offboarding and avoid sending faxes until you're sure.
701
+ * Offboard a fax number. Oystehr's [offboard](https://docs.oystehr.com/oystehr/services/fax/number/) feature makes it easy to stop using the fax service and release the project's assigned fax number with a single API call. Please note there is no way to guarantee getting the same number back again, so if you think this can break your project in any way we recommend not offboarding and avoid sending faxes until you're sure.
648
702
  *
649
703
  * Access Policy Requirements:
650
704
  * Action: `Fax:Offboard`
651
705
  * Access Policy Resource: `Fax:Number`
652
706
  */
653
707
  offboard(request) {
654
- return this.request('/fax/offboard', 'post')(request);
708
+ return this.request('/offboard', 'post', __classPrivateFieldGet(this, _Fax_instances, "m", _Fax_baseUrlThunk).bind(this))(request);
655
709
  }
656
710
  /**
657
- * Onboard a fax number. Oystehr's [onboard](https://docs.oystehr.com/services/fax/number/) feature makes it easy to start using the fax service and purchase a new fax number for your project with a single API call.
711
+ * Onboard a fax number. Oystehr's [onboard](https://docs.oystehr.com/oystehr/services/fax/number/) feature makes it easy to start using the fax service and purchase a new fax number for your project with a single API call.
658
712
  *
659
713
  * Access Policy Requirements:
660
714
  * Action: `Fax:Onboard`
661
715
  * Access Policy Resource: `Fax:Number`
662
716
  */
663
717
  onboard(request) {
664
- return this.request('/fax/onboard', 'post')(request);
718
+ return this.request('/onboard', 'post', __classPrivateFieldGet(this, _Fax_instances, "m", _Fax_baseUrlThunk).bind(this))(request);
665
719
  }
666
720
  /**
667
- * Send a fax. Oystehr's [fax sending](https://docs.oystehr.com/services/fax/send/) feature makes it easy to send a fax to a chosen recipient with a single API call. You can use this feature to send referrals, medical records, prescriptions, and other documents that require fax transmission e.g. for HIPAA compliance.
721
+ * Send a fax. Oystehr's [fax sending](https://docs.oystehr.com/oystehr/services/fax/send/) feature makes it easy to send a fax to a chosen recipient with a single API call. You can use this feature to send referrals, medical records, prescriptions, and other documents that require fax transmission e.g. for HIPAA compliance.
668
722
  *
669
723
  * Access Policy Requirements:
670
724
  * Action: `Fax:Send`
671
725
  * Access Policy Resource: `Fax:Fax`
672
726
  */
673
727
  send(params, request) {
674
- return this.request('/fax/send', 'post')(params, request);
728
+ return this.request('/send', 'post', __classPrivateFieldGet(this, _Fax_instances, "m", _Fax_baseUrlThunk).bind(this))(params, request);
675
729
  }
676
730
  }
731
+ _Fax_instances = new WeakSet(), _Fax_baseUrlThunk = function _Fax_baseUrlThunk() {
732
+ var _a, _b;
733
+ return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['faxApiUrl']) !== null && _b !== void 0 ? _b : 'https://fax-api.zapehr.com/v1';
734
+ };
677
735
 
678
736
  /**
679
737
  * Performs a FHIR search and returns the results as a Bundle resource
@@ -850,9 +908,11 @@ function formatHumanName(name, options) {
850
908
  }
851
909
 
852
910
  // AUTOGENERATED -- DO NOT EDIT
911
+ var _Fhir_instances;
853
912
  class Fhir extends SDKResource {
854
913
  constructor(config) {
855
914
  super(config);
915
+ _Fhir_instances.add(this);
856
916
  /**
857
917
  * Performs a FHIR search and returns the results as a Bundle resource
858
918
  * @param options FHIR resource type and FHIR search parameters
@@ -872,67 +932,70 @@ class Fhir extends SDKResource {
872
932
  this.formatHumanName = formatHumanName;
873
933
  }
874
934
  }
935
+ _Fhir_instances = new WeakSet();
875
936
 
876
937
  // AUTOGENERATED -- DO NOT EDIT
938
+ var _M2m_instances, _M2m_baseUrlThunk;
877
939
  class M2m extends SDKResource {
878
940
  constructor(config) {
879
941
  super(config);
942
+ _M2m_instances.add(this);
880
943
  }
881
944
  /**
882
945
  * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_m2m-v2-list) instead.
883
946
  *
884
- * Get a list of all M2M Clients. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
947
+ * Get a list of all M2M Clients. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
885
948
  *
886
949
  * Access Policy Action: `App:ListAllM2MClients`
887
950
  * Access Policy Resource: `IAM:M2MClient`
888
951
  */
889
952
  list(request) {
890
- return this.request('/m2m', 'get')(request);
953
+ return this.request('/m2m', 'get', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(request);
891
954
  }
892
955
  /**
893
- * Create a new M2M Client. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
956
+ * Create a new M2M Client. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
894
957
  *
895
958
  * Access Policy Action: `App:CreateM2MClient`
896
959
  * Access Policy Resource: `IAM:M2MClient`
897
960
  */
898
961
  create(params, request) {
899
- return this.request('/m2m', 'post')(params, request);
962
+ return this.request('/m2m', 'post', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
900
963
  }
901
964
  /**
902
- * Get the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
965
+ * Get the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
903
966
  *
904
967
  * Access Policy Action: `App:GetM2MClient`
905
968
  * Access Policy Resource: `IAM:M2MClient`
906
969
  */
907
970
  get(params, request) {
908
- return this.request('/m2m/{id}', 'get')(params, request);
971
+ return this.request('/m2m/{id}', 'get', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
909
972
  }
910
973
  /**
911
- * Update the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
974
+ * Update the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
912
975
  *
913
976
  * Access Policy Action: `App:UpdateM2MClient`
914
977
  * Access Policy Resource: `IAM:M2MClient`
915
978
  */
916
979
  update(params, request) {
917
- return this.request('/m2m/{id}', 'patch')(params, request);
980
+ return this.request('/m2m/{id}', 'patch', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
918
981
  }
919
982
  /**
920
- * Delete the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
983
+ * Delete the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
921
984
  *
922
985
  * Access Policy Action: `App:DeleteM2MClient`
923
986
  * Access Policy Resource: `IAM:M2MClient`
924
987
  */
925
988
  delete(params, request) {
926
- return this.request('/m2m/{id}', 'delete')(params, request);
989
+ return this.request('/m2m/{id}', 'delete', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
927
990
  }
928
991
  /**
929
- * Rotate the client secret for the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
992
+ * Rotate the client secret for the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
930
993
  *
931
994
  * Access Policy Action: `App:RotateM2MClientSecret`
932
995
  * Access Policy Resource: `IAM:M2MClient`
933
996
  */
934
997
  rotateSecret(params, request) {
935
- return this.request('/m2m/{id}/rotate-secret', 'post')(params, request);
998
+ return this.request('/m2m/{id}/rotate-secret', 'post', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
936
999
  }
937
1000
  /**
938
1001
  * Get M2M clients in the Project with pagination, sort, sort Order and filtering. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
@@ -941,27 +1004,39 @@ class M2m extends SDKResource {
941
1004
  * Access Policy Resource: `IAM:M2MClient`
942
1005
  */
943
1006
  listV2(params, request) {
944
- return this.request('/m2m/v2/list', 'get')(params, request);
1007
+ return this.request('/m2m/v2/list', 'get', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
945
1008
  }
946
1009
  }
1010
+ _M2m_instances = new WeakSet(), _M2m_baseUrlThunk = function _M2m_baseUrlThunk() {
1011
+ var _a, _b;
1012
+ 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';
1013
+ };
947
1014
 
948
1015
  // AUTOGENERATED -- DO NOT EDIT
1016
+ var _Messaging_instances, _Messaging_baseUrlThunk;
949
1017
  class Messaging extends SDKResource {
950
1018
  constructor(config) {
951
1019
  super(config);
1020
+ _Messaging_instances.add(this);
952
1021
  }
953
1022
  /**
954
1023
  * Get an information about the Messaging services configuration. This information includes phone number, phone number type and also rate limits of each service.
955
1024
  */
956
1025
  getMessagingConfig(request) {
957
- return this.request('/messaging/config', 'get')(request);
1026
+ return this.request('/messaging/config', 'get', __classPrivateFieldGet(this, _Messaging_instances, "m", _Messaging_baseUrlThunk).bind(this))(request);
958
1027
  }
959
1028
  }
1029
+ _Messaging_instances = new WeakSet(), _Messaging_baseUrlThunk = function _Messaging_baseUrlThunk() {
1030
+ var _a, _b;
1031
+ 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';
1032
+ };
960
1033
 
961
1034
  // AUTOGENERATED -- DO NOT EDIT
1035
+ var _PaymentMethod_instances, _PaymentMethod_baseUrlThunk;
962
1036
  class PaymentMethod extends SDKResource {
963
1037
  constructor(config) {
964
1038
  super(config);
1039
+ _PaymentMethod_instances.add(this);
965
1040
  }
966
1041
  /**
967
1042
  * Enter a new credit card or other payment method for the user.
@@ -979,7 +1054,7 @@ class PaymentMethod extends SDKResource {
979
1054
  * Access Policy Resource: `FHIR:Patient`
980
1055
  */
981
1056
  setUp(params, request) {
982
- return this.request('/payment/payment-method/setup', 'post')(params, request);
1057
+ return this.request('/payment/payment-method/setup', 'post', __classPrivateFieldGet(this, _PaymentMethod_instances, "m", _PaymentMethod_baseUrlThunk).bind(this))(params, request);
983
1058
  }
984
1059
  /**
985
1060
  * Set a specified payment method for the user as default.
@@ -997,7 +1072,7 @@ class PaymentMethod extends SDKResource {
997
1072
  * Access Policy Resource: `FHIR:Patient`
998
1073
  */
999
1074
  setDefault(params, request) {
1000
- return this.request('/payment/payment-method/set-default', 'post')(params, request);
1075
+ return this.request('/payment/payment-method/set-default', 'post', __classPrivateFieldGet(this, _PaymentMethod_instances, "m", _PaymentMethod_baseUrlThunk).bind(this))(params, request);
1001
1076
  }
1002
1077
  /**
1003
1078
  * Delete a specified payment method for the beneficiary.
@@ -1015,7 +1090,7 @@ class PaymentMethod extends SDKResource {
1015
1090
  * Access Policy Resource: `FHIR:Patient`
1016
1091
  */
1017
1092
  delete(params, request) {
1018
- return this.request('/payment/payment-method', 'delete')(params, request);
1093
+ return this.request('/payment/payment-method', 'delete', __classPrivateFieldGet(this, _PaymentMethod_instances, "m", _PaymentMethod_baseUrlThunk).bind(this))(params, request);
1019
1094
  }
1020
1095
  /**
1021
1096
  * List all payment methods for the patient.
@@ -1033,23 +1108,29 @@ class PaymentMethod extends SDKResource {
1033
1108
  * Access Policy Resource: `FHIR:Patient`
1034
1109
  */
1035
1110
  list(params, request) {
1036
- return this.request('/payment/payment-method/list', 'post')(params, request);
1111
+ return this.request('/payment/payment-method/list', 'post', __classPrivateFieldGet(this, _PaymentMethod_instances, "m", _PaymentMethod_baseUrlThunk).bind(this))(params, request);
1037
1112
  }
1038
1113
  }
1114
+ _PaymentMethod_instances = new WeakSet(), _PaymentMethod_baseUrlThunk = function _PaymentMethod_baseUrlThunk() {
1115
+ var _a, _b;
1116
+ 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';
1117
+ };
1039
1118
 
1040
1119
  // AUTOGENERATED -- DO NOT EDIT
1120
+ var _Project_instances, _Project_baseUrlThunk;
1041
1121
  class Project extends SDKResource {
1042
1122
  constructor(config) {
1043
1123
  super(config);
1124
+ _Project_instances.add(this);
1044
1125
  }
1045
1126
  /**
1046
- * Get the Project settings for a Project. Developers must specify a [project ID](https://docs.oystehr.com/core-documentation/authenticating-api-requests/#x-zapehr-project-id-header) in the header. A Project is the logically-isolated instance of Oystehr that segments your data from other Projects. [Projects](https://docs.oystehr.com/services/project/) are completely independent from each other, having their own separate [FHIR store](https://docs.oystehr.com/services/fhir/basics/), [Applications](https://docs.oystehr.com/services/app/applications/), [Users](https://docs.oystehr.com/services/app/users/), etc .
1127
+ * Get the Project settings for a Project. Developers must specify a [project ID](https://docs.oystehr.com/oystehr/core-documentation/authenticating-api-requests/#x-zapehr-project-id-header) in the header. A Project is the logically-isolated instance of Oystehr that segments your data from other Projects. [Projects](https://docs.oystehr.com/oystehr/services/project/) are completely independent from each other, having their own separate [FHIR store](https://docs.oystehr.com/oystehr/services/fhir/basics/), [Applications](https://docs.oystehr.com/oystehr/services/app/applications/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), etc .
1047
1128
  *
1048
1129
  * Access Policy Action: `Project:GetProjectInfo`
1049
1130
  * Access Policy Resource: `Project:Settings`
1050
1131
  */
1051
1132
  get(request) {
1052
- return this.request('/project', 'get')(request);
1133
+ return this.request('/project', 'get', __classPrivateFieldGet(this, _Project_instances, "m", _Project_baseUrlThunk).bind(this))(request);
1053
1134
  }
1054
1135
  /**
1055
1136
  * Update the Project settings for the Project that corresponds to the project-id in the request header. A [Project](https://docs.oystehr.com/services/project/) is the logically-isolated instance of Oystehr that segments your data from other Projects. Projects are completely independent from each other, having their own separate [FHIR store](https://docs.oystehr.com/services/fhir/basics/), [Applications](https://docs.oystehr.com/services/app/applications/), [Users](https://docs.oystehr.com/services/app/users/), etc .
@@ -1058,17 +1139,23 @@ class Project extends SDKResource {
1058
1139
  * Access Policy Resource: `Project:Settings`
1059
1140
  */
1060
1141
  update(params, request) {
1061
- return this.request('/project', 'patch')(params, request);
1142
+ return this.request('/project', 'patch', __classPrivateFieldGet(this, _Project_instances, "m", _Project_baseUrlThunk).bind(this))(params, request);
1062
1143
  }
1063
1144
  }
1145
+ _Project_instances = new WeakSet(), _Project_baseUrlThunk = function _Project_baseUrlThunk() {
1146
+ var _a, _b;
1147
+ 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';
1148
+ };
1064
1149
 
1065
1150
  // AUTOGENERATED -- DO NOT EDIT
1151
+ var _Rcm_instances, _Rcm_baseUrlThunk;
1066
1152
  class Rcm extends SDKResource {
1067
1153
  constructor(config) {
1068
1154
  super(config);
1155
+ _Rcm_instances.add(this);
1069
1156
  }
1070
1157
  /**
1071
- * Check [Insurance Eligibility](https://docs.oystehr.com/services/rcm/eligibility/).
1158
+ * Check [Insurance Eligibility](https://docs.oystehr.com/oystehr/services/rcm/eligibility/).
1072
1159
  *
1073
1160
  * Access Policy Action: `RCM:CheckInsuranceEligibility`
1074
1161
  * Access Policy Resource: `RCM:InsuranceEligibility`
@@ -1077,10 +1164,10 @@ class Rcm extends SDKResource {
1077
1164
  * Access Policy Resource: `FHIR:CoverageEligibilityResponse`
1078
1165
  */
1079
1166
  eligibilityCheck(params, request) {
1080
- return this.request('/rcm/eligibility-check', 'post')(params, request);
1167
+ return this.request('/rcm/eligibility-check', 'post', __classPrivateFieldGet(this, _Rcm_instances, "m", _Rcm_baseUrlThunk).bind(this))(params, request);
1081
1168
  }
1082
1169
  /**
1083
- * Check [Validate Professional Claim](https://docs.oystehr.com/services/rcm/professional-claim-submission/).
1170
+ * Check [Validate Professional Claim](https://docs.oystehr.com/oystehr/services/rcm/professional-claim-submission/).
1084
1171
  *
1085
1172
  * Access Policy Action: `RCM:ValidateProfessionalClaim`
1086
1173
  * Access Policy Resource: `RCM:Claim`
@@ -1089,10 +1176,10 @@ class Rcm extends SDKResource {
1089
1176
  * Access Policy Resource: `FHIR:AuditEvent`
1090
1177
  */
1091
1178
  validateProfessionalClaim(params, request) {
1092
- return this.request('/rcm/professional-claim/validate', 'post')(params, request);
1179
+ return this.request('/rcm/professional-claim/validate', 'post', __classPrivateFieldGet(this, _Rcm_instances, "m", _Rcm_baseUrlThunk).bind(this))(params, request);
1093
1180
  }
1094
1181
  /**
1095
- * Check [Submit Professional Claim](https://docs.oystehr.com/services/rcm/professional-claim-submission/).
1182
+ * Check [Submit Professional Claim](https://docs.oystehr.com/oystehr/services/rcm/professional-claim-submission/).
1096
1183
  *
1097
1184
  * Access Policy Action: `RCM:SubmitProfessionalClaim`
1098
1185
  * Access Policy Resource: `RCM:Claim`
@@ -1104,67 +1191,79 @@ class Rcm extends SDKResource {
1104
1191
  * Access Policy Resource: `FHIR:Claim`
1105
1192
  */
1106
1193
  submitProfessionalClaim(params, request) {
1107
- return this.request('/rcm/professional-claim/submit', 'post')(params, request);
1194
+ return this.request('/rcm/professional-claim/submit', 'post', __classPrivateFieldGet(this, _Rcm_instances, "m", _Rcm_baseUrlThunk).bind(this))(params, request);
1108
1195
  }
1109
1196
  }
1197
+ _Rcm_instances = new WeakSet(), _Rcm_baseUrlThunk = function _Rcm_baseUrlThunk() {
1198
+ var _a, _b;
1199
+ 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';
1200
+ };
1110
1201
 
1111
1202
  // AUTOGENERATED -- DO NOT EDIT
1203
+ var _Role_instances, _Role_baseUrlThunk;
1112
1204
  class Role extends SDKResource {
1113
1205
  constructor(config) {
1114
1206
  super(config);
1207
+ _Role_instances.add(this);
1115
1208
  }
1116
1209
  /**
1117
- * Get a list of all Roles. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
1210
+ * Get a list of all Roles. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
1118
1211
  *
1119
1212
  * Access Policy Action: `IAM:ListAllRoles`
1120
1213
  * Access Policy Resource: `IAM:Role`
1121
1214
  */
1122
1215
  list(request) {
1123
- return this.request('/iam/role', 'get')(request);
1216
+ return this.request('/iam/role', 'get', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(request);
1124
1217
  }
1125
1218
  /**
1126
- * Create a new Role. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
1219
+ * Create a new Role. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
1127
1220
  *
1128
1221
  * Access Policy Action: `IAM:CreateRole`
1129
1222
  * Access Policy Resource: `IAM:Role`
1130
1223
  */
1131
1224
  create(params, request) {
1132
- return this.request('/iam/role', 'post')(params, request);
1225
+ return this.request('/iam/role', 'post', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(params, request);
1133
1226
  }
1134
1227
  /**
1135
- * Get the Role with the provided ID. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
1228
+ * Get the Role with the provided ID. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
1136
1229
  *
1137
1230
  * Access Policy Action: `IAM:GetRole`
1138
1231
  * Access Policy Resource: `IAM:Role`
1139
1232
  */
1140
1233
  get(params, request) {
1141
- return this.request('/iam/role/{roleId}', 'get')(params, request);
1234
+ return this.request('/iam/role/{roleId}', 'get', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(params, request);
1142
1235
  }
1143
1236
  /**
1144
- * Update the Role with the provided ID. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
1237
+ * Update the Role with the provided ID. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
1145
1238
  *
1146
1239
  * Access Policy Action: `IAM:UpdateRole`
1147
1240
  * Access Policy Resource: `IAM:Role`
1148
1241
  */
1149
1242
  update(params, request) {
1150
- return this.request('/iam/role/{roleId}', 'patch')(params, request);
1243
+ return this.request('/iam/role/{roleId}', 'patch', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(params, request);
1151
1244
  }
1152
1245
  /**
1153
- * Delete the Role with the provided ID. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
1246
+ * Delete the Role with the provided ID. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
1154
1247
  *
1155
1248
  * Access Policy Action: `IAM:DeleteRole`
1156
1249
  * Access Policy Resource: `IAM:Role`
1157
1250
  * Will fail if any entities hold the Role or if Role is assigned as the default patient role for the project
1158
1251
  */
1159
1252
  delete(params, request) {
1160
- return this.request('/iam/role/{roleId}', 'delete')(params, request);
1253
+ return this.request('/iam/role/{roleId}', 'delete', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(params, request);
1161
1254
  }
1162
1255
  }
1256
+ _Role_instances = new WeakSet(), _Role_baseUrlThunk = function _Role_baseUrlThunk() {
1257
+ var _a, _b;
1258
+ 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';
1259
+ };
1163
1260
 
1164
1261
  // AUTOGENERATED -- DO NOT EDIT
1262
+ var _Secret_instances, _Secret_baseUrlThunk;
1165
1263
  class Secret extends SDKResource {
1166
1264
  constructor(config) {
1167
1265
  super(config);
1266
+ _Secret_instances.add(this);
1168
1267
  }
1169
1268
  /**
1170
1269
  * Get a list of all secrets in the Project.
@@ -1173,7 +1272,7 @@ class Secret extends SDKResource {
1173
1272
  * Access Policy Resource: `Zambda:Secret`
1174
1273
  */
1175
1274
  list(request) {
1176
- return this.request('/secret', 'get')(request);
1275
+ return this.request('/secret', 'get', __classPrivateFieldGet(this, _Secret_instances, "m", _Secret_baseUrlThunk).bind(this))(request);
1177
1276
  }
1178
1277
  /**
1179
1278
  * Create a secret for a project. If the secret is already defined, update it.
@@ -1182,7 +1281,7 @@ class Secret extends SDKResource {
1182
1281
  * Access Policy Resource: `Zambda:Secret`
1183
1282
  */
1184
1283
  set(params, request) {
1185
- return this.request('/secret', 'post')(params, request);
1284
+ return this.request('/secret', 'post', __classPrivateFieldGet(this, _Secret_instances, "m", _Secret_baseUrlThunk).bind(this))(params, request);
1186
1285
  }
1187
1286
  /**
1188
1287
  * Get the secret with the provided name.
@@ -1191,7 +1290,7 @@ class Secret extends SDKResource {
1191
1290
  * Access Policy Resource: `Zambda:Secret`
1192
1291
  */
1193
1292
  get(params, request) {
1194
- return this.request('/secret/{name}', 'get')(params, request);
1293
+ return this.request('/secret/{name}', 'get', __classPrivateFieldGet(this, _Secret_instances, "m", _Secret_baseUrlThunk).bind(this))(params, request);
1195
1294
  }
1196
1295
  /**
1197
1296
  * Delete the secret with the provided name.
@@ -1200,17 +1299,23 @@ class Secret extends SDKResource {
1200
1299
  * Access Policy Resource: `Zambda:Secret`
1201
1300
  */
1202
1301
  delete(params, request) {
1203
- return this.request('/secret/{name}', 'delete')(params, request);
1302
+ return this.request('/secret/{name}', 'delete', __classPrivateFieldGet(this, _Secret_instances, "m", _Secret_baseUrlThunk).bind(this))(params, request);
1204
1303
  }
1205
1304
  }
1305
+ _Secret_instances = new WeakSet(), _Secret_baseUrlThunk = function _Secret_baseUrlThunk() {
1306
+ var _a, _b;
1307
+ 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';
1308
+ };
1206
1309
 
1207
1310
  // AUTOGENERATED -- DO NOT EDIT
1311
+ var _Telemed_instances, _Telemed_baseUrlThunk;
1208
1312
  class Telemed extends SDKResource {
1209
1313
  constructor(config) {
1210
1314
  super(config);
1315
+ _Telemed_instances.add(this);
1211
1316
  }
1212
1317
  /**
1213
- * Create a [telemedicine video meeting](https://docs.oystehr.com/services/telemed/).
1318
+ * Create a [telemedicine video meeting](https://docs.oystehr.com/oystehr/services/telemed/).
1214
1319
  *
1215
1320
  * Access Policy Requirements:
1216
1321
  * Action: `Telemed:CreateMeeting`
@@ -1221,7 +1326,7 @@ class Telemed extends SDKResource {
1221
1326
  * Access Policy Resource: `FHIR:Encounter`
1222
1327
  */
1223
1328
  createMeeting(params, request) {
1224
- return this.request('/telemed/v2/meeting', 'post')(params, request);
1329
+ return this.request('/telemed/v2/meeting', 'post', __classPrivateFieldGet(this, _Telemed_instances, "m", _Telemed_baseUrlThunk).bind(this))(params, request);
1225
1330
  }
1226
1331
  /**
1227
1332
  * Get Meeting and Attendee objects necessary to join a telemedicine video meeting.
@@ -1234,17 +1339,23 @@ class Telemed extends SDKResource {
1234
1339
  * Access Policy Resource: `Telemed:Meeting`
1235
1340
  */
1236
1341
  joinMeeting(params, request) {
1237
- return this.request('/telemed/v2/meeting/{encounterId}/join', 'get')(params, request);
1342
+ return this.request('/telemed/v2/meeting/{encounterId}/join', 'get', __classPrivateFieldGet(this, _Telemed_instances, "m", _Telemed_baseUrlThunk).bind(this))(params, request);
1238
1343
  }
1239
1344
  }
1345
+ _Telemed_instances = new WeakSet(), _Telemed_baseUrlThunk = function _Telemed_baseUrlThunk() {
1346
+ var _a, _b;
1347
+ 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';
1348
+ };
1240
1349
 
1241
1350
  // AUTOGENERATED -- DO NOT EDIT
1351
+ var _TransactionalSMS_instances, _TransactionalSMS_baseUrlThunk;
1242
1352
  class TransactionalSMS extends SDKResource {
1243
1353
  constructor(config) {
1244
1354
  super(config);
1355
+ _TransactionalSMS_instances.add(this);
1245
1356
  }
1246
1357
  /**
1247
- * Send an SMS to any phone number. Oystehr's [Transactional SMS](https://docs.oystehr.com/services/messaging/transactional-sms/) feature makes it easy to send a text message to your [Users](https://docs.oystehr.com/services/app/users/) with a single API call. You can use this feature to send appointment reminders, prescription refill reminders, discharge information, and more.
1358
+ * Send an SMS to any phone number. Oystehr's [Transactional SMS](https://docs.oystehr.com/oystehr/services/messaging/transactional-sms/) feature makes it easy to send a text message to your [Users](https://docs.oystehr.com/oystehr/services/app/users/) with a single API call. You can use this feature to send appointment reminders, prescription refill reminders, discharge information, and more.
1248
1359
  *
1249
1360
  * Access Policy Requirements:
1250
1361
  * Action: `Messaging:SendTransactionalSMS`
@@ -1259,69 +1370,75 @@ class TransactionalSMS extends SDKResource {
1259
1370
  * Access Policy Resource: `FHIR:Patient`
1260
1371
  */
1261
1372
  send(params, request) {
1262
- return this.request('/messaging/transactional-sms/send', 'post')(params, request);
1373
+ return this.request('/messaging/transactional-sms/send', 'post', __classPrivateFieldGet(this, _TransactionalSMS_instances, "m", _TransactionalSMS_baseUrlThunk).bind(this))(params, request);
1263
1374
  }
1264
1375
  }
1376
+ _TransactionalSMS_instances = new WeakSet(), _TransactionalSMS_baseUrlThunk = function _TransactionalSMS_baseUrlThunk() {
1377
+ var _a, _b;
1378
+ 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';
1379
+ };
1265
1380
 
1266
1381
  // AUTOGENERATED -- DO NOT EDIT
1382
+ var _User_instances, _User_baseUrlThunk;
1267
1383
  class User extends SDKResource {
1268
1384
  constructor(config) {
1269
1385
  super(config);
1386
+ _User_instances.add(this);
1270
1387
  }
1271
1388
  /**
1272
- * Get your own User details. [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.
1389
+ * 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.
1273
1390
  *
1274
1391
  * Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.
1275
1392
  */
1276
1393
  me(request) {
1277
- return this.request('/user/me', 'get')(request);
1394
+ return this.request('/user/me', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(request);
1278
1395
  }
1279
1396
  /**
1280
- * Get the User with the provided ID. [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.
1397
+ * 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.
1281
1398
  *
1282
1399
  * Access Policy Action: `App:GetUser`
1283
1400
  * Access Policy Resource: `App:User`
1284
1401
  */
1285
1402
  get(params, request) {
1286
- return this.request('/user/{id}', 'get')(params, request);
1403
+ return this.request('/user/{id}', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
1287
1404
  }
1288
1405
  /**
1289
- * Update the User with the provided ID. [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.
1406
+ * 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.
1290
1407
  *
1291
1408
  * Access Policy Action: `App:UpdateUser`
1292
1409
  * Access Policy Resource: `App:User`
1293
1410
  */
1294
1411
  update(params, request) {
1295
- return this.request('/user/{id}', 'patch')(params, request);
1412
+ return this.request('/user/{id}', 'patch', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
1296
1413
  }
1297
1414
  /**
1298
- * Delete the User with the provided ID. [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.
1415
+ * 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.
1299
1416
  *
1300
1417
  * Access Policy Action: `App:DeleteUser`
1301
1418
  * Access Policy Resource: `App:User`
1302
1419
  */
1303
1420
  delete(params, request) {
1304
- return this.request('/user/{id}', 'delete')(params, request);
1421
+ return this.request('/user/{id}', 'delete', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
1305
1422
  }
1306
1423
  /**
1307
- * Invite a User to the Project. [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.
1424
+ * 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.
1308
1425
  *
1309
1426
  * Access Policy Action: `App:CreateUser`
1310
1427
  * Access Policy Resource: `App:User`
1311
1428
  */
1312
1429
  invite(params, request) {
1313
- return this.request('/user/invite', 'post')(params, request);
1430
+ return this.request('/user/invite', 'post', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
1314
1431
  }
1315
1432
  /**
1316
1433
  * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.
1317
1434
  *
1318
- * Get all Users in the Project. [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.
1435
+ * 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.
1319
1436
  *
1320
1437
  * Access Policy Action: `App:ListAllUsers`
1321
1438
  * Access Policy Resource: `App:User`
1322
1439
  */
1323
1440
  list(request) {
1324
- return this.request('/user', 'get')(request);
1441
+ return this.request('/user', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(request);
1325
1442
  }
1326
1443
  /**
1327
1444
  * Get Users 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.
@@ -1330,23 +1447,37 @@ class User extends SDKResource {
1330
1447
  * Access Policy Resource: `Project:Settings`
1331
1448
  */
1332
1449
  listV2(params, request) {
1333
- return this.request('/user/v2/list', 'get')(params, request);
1450
+ return this.request('/user/v2/list', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
1334
1451
  }
1335
1452
  }
1453
+ _User_instances = new WeakSet(), _User_baseUrlThunk = function _User_baseUrlThunk() {
1454
+ var _a, _b;
1455
+ 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';
1456
+ };
1336
1457
 
1337
1458
  // AUTOGENERATED -- DO NOT EDIT
1459
+ var _Version_instances, _Version_baseUrlThunk;
1338
1460
  class Version extends SDKResource {
1339
1461
  constructor(config) {
1340
1462
  super(config);
1463
+ _Version_instances.add(this);
1341
1464
  }
1342
1465
  /**
1343
1466
  * Get project API version. This endpoint is public so there are no access policy requirements.
1344
1467
  */
1345
1468
  get(request) {
1346
- return this.request('/version', 'get')(request);
1469
+ return this.request('/version', 'get', __classPrivateFieldGet(this, _Version_instances, "m", _Version_baseUrlThunk).bind(this))(request);
1347
1470
  }
1348
1471
  }
1472
+ _Version_instances = new WeakSet(), _Version_baseUrlThunk = function _Version_baseUrlThunk() {
1473
+ var _a, _b;
1474
+ 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';
1475
+ };
1349
1476
 
1477
+ function baseUrlThunk$1() {
1478
+ var _a, _b;
1479
+ 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';
1480
+ }
1350
1481
  /**
1351
1482
  * Uploads a file to the bucket and key. Files should be Blobs.
1352
1483
  *
@@ -1354,7 +1485,7 @@ class Version extends SDKResource {
1354
1485
  */
1355
1486
  function uploadFile$1({ bucketName, 'objectPath+': key, file, }) {
1356
1487
  return __awaiter(this, void 0, void 0, function* () {
1357
- const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post')({
1488
+ const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk$1.bind(this))({
1358
1489
  action: 'upload',
1359
1490
  bucketName,
1360
1491
  'objectPath+': key,
@@ -1372,7 +1503,7 @@ function uploadFile$1({ bucketName, 'objectPath+': key, file, }) {
1372
1503
  */
1373
1504
  function downloadFile({ bucketName, 'objectPath+': key, }) {
1374
1505
  return __awaiter(this, void 0, void 0, function* () {
1375
- const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post')({
1506
+ const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk$1.bind(this))({
1376
1507
  action: 'download',
1377
1508
  bucketName,
1378
1509
  'objectPath+': key,
@@ -1394,7 +1525,7 @@ function downloadFile({ bucketName, 'objectPath+': key, }) {
1394
1525
  * @param params url and action
1395
1526
  */
1396
1527
  function getPresignedUrlForZ3Url(params) {
1397
- var _a;
1528
+ var _a, _b;
1398
1529
  return __awaiter(this, void 0, void 0, function* () {
1399
1530
  let bucket;
1400
1531
  let key;
@@ -1405,7 +1536,7 @@ function getPresignedUrlForZ3Url(params) {
1405
1536
  bucket = url.hostname;
1406
1537
  key = z3PathParts.join('/');
1407
1538
  }
1408
- else if (url.href.startsWith((_a = this.config.projectApiUrl) !== null && _a !== void 0 ? _a : defaultProjectApiUrl)) {
1539
+ else if (url.href.startsWith((_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : defaultProjectApiUrl)) {
1409
1540
  // remove leading `/v1/z3`
1410
1541
  const httpsPathParts = url.pathname.split('/').slice(3);
1411
1542
  bucket = httpsPathParts[0];
@@ -1419,14 +1550,16 @@ function getPresignedUrlForZ3Url(params) {
1419
1550
  bucketName: bucket,
1420
1551
  'objectPath+': key,
1421
1552
  };
1422
- return this.request('/z3/{bucketName}/{objectPath+}', 'post')(requestParams);
1553
+ return this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk$1.bind(this))(requestParams);
1423
1554
  });
1424
1555
  }
1425
1556
 
1426
1557
  // AUTOGENERATED -- DO NOT EDIT
1558
+ var _Z3_instances, _Z3_baseUrlThunk;
1427
1559
  class Z3 extends SDKResource {
1428
1560
  constructor(config) {
1429
1561
  super(config);
1562
+ _Z3_instances.add(this);
1430
1563
  /**
1431
1564
  * Uploads a file to the bucket and key. Files should be Blobs.
1432
1565
  * @param params upload file params
@@ -1446,64 +1579,72 @@ class Z3 extends SDKResource {
1446
1579
  this.getPresignedUrlForZ3Url = getPresignedUrlForZ3Url;
1447
1580
  }
1448
1581
  /**
1449
- * List all Z3 Buckets. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
1582
+ * List all Z3 Buckets. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
1450
1583
  *
1451
1584
  * Access Policy Action: `Z3:ListBuckets`
1452
1585
  * Access Policy Resource: `Z3:BucketName`
1453
1586
  */
1454
1587
  listBuckets(request) {
1455
- return this.request('/z3', 'get')(request);
1588
+ return this.request('/z3', 'get', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(request);
1456
1589
  }
1457
1590
  /**
1458
- * Create a Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
1591
+ * 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.
1459
1592
  *
1460
1593
  * Access Policy Action: `Z3:CreateBucket`
1461
1594
  * Access Policy Resource: `Z3:BucketName`
1462
1595
  */
1463
1596
  createBucket(params, request) {
1464
- return this.request('/z3/{bucketName}', 'put')(params, request);
1597
+ return this.request('/z3/{bucketName}', 'put', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
1465
1598
  }
1466
1599
  /**
1467
- * Delete the Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
1600
+ * 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.
1468
1601
  *
1469
1602
  * Access Policy Action: `Z3:DeleteBucket`
1470
1603
  * Access Policy Resource: `Z3:BucketName`
1471
1604
  */
1472
1605
  deleteBucket(params, request) {
1473
- return this.request('/z3/{bucketName}', 'delete')(params, request);
1606
+ return this.request('/z3/{bucketName}', 'delete', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
1474
1607
  }
1475
1608
  /**
1476
- * List all Z3 Objects at the provided path in the Bucket with the provided name [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
1609
+ * 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.
1477
1610
  *
1478
1611
  * Access Policy Action: `Z3:ListObjects`
1479
1612
  * Access Policy Resource: `Z3:BucketName:ObjectPath`
1480
1613
  */
1481
1614
  listObjects(params, request) {
1482
- return this.request('/z3/{bucketName}/{objectPath+}', 'get')(params, request);
1615
+ return this.request('/z3/{bucketName}/{objectPath+}', 'get', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
1483
1616
  }
1484
1617
  /**
1485
- * 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/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
1618
+ * 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.
1486
1619
  *
1487
1620
  * Access Policy Action: `Z3:PutObject` or `Z3:GetObject`
1488
1621
  * Access Policy Resource: `Z3:BucketName:ObjectPath`
1489
1622
  */
1490
1623
  getPresignedUrl(params, request) {
1491
- return this.request('/z3/{bucketName}/{objectPath+}', 'post')(params, request);
1624
+ return this.request('/z3/{bucketName}/{objectPath+}', 'post', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
1492
1625
  }
1493
1626
  /**
1494
- * Delete the Z3 Object at the provided path in the Bucket with the provided name. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
1627
+ * 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.
1495
1628
  *
1496
1629
  * Access Policy Action: `Z3:DeleteObject`
1497
1630
  * Access Policy Resource: `Z3:BucketName:ObjectPath`
1498
1631
  */
1499
1632
  deleteObject(params, request) {
1500
- return this.request('/z3/{bucketName}/{objectPath+}', 'delete')(params, request);
1633
+ return this.request('/z3/{bucketName}/{objectPath+}', 'delete', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
1501
1634
  }
1502
1635
  }
1636
+ _Z3_instances = new WeakSet(), _Z3_baseUrlThunk = function _Z3_baseUrlThunk() {
1637
+ var _a, _b;
1638
+ 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';
1639
+ };
1503
1640
 
1641
+ function baseUrlThunk() {
1642
+ var _a, _b;
1643
+ 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';
1644
+ }
1504
1645
  function uploadFile({ id, file, filename, }) {
1505
1646
  return __awaiter(this, void 0, void 0, function* () {
1506
- const uploadUrl = yield this.request('/zambda/{id}/s3-upload', 'post')({ id, filename });
1647
+ const uploadUrl = yield this.request('/zambda/{id}/s3-upload', 'post', baseUrlThunk.bind(this))({ id, filename });
1507
1648
  yield fetch(uploadUrl.signedUrl, {
1508
1649
  method: 'PUT',
1509
1650
  body: file,
@@ -1512,122 +1653,139 @@ function uploadFile({ id, file, filename, }) {
1512
1653
  }
1513
1654
 
1514
1655
  // AUTOGENERATED -- DO NOT EDIT
1656
+ var _Zambda_instances, _Zambda_baseUrlThunk;
1515
1657
  class Zambda extends SDKResource {
1516
1658
  constructor(config) {
1517
1659
  super(config);
1660
+ _Zambda_instances.add(this);
1518
1661
  this.uploadFile = uploadFile;
1519
1662
  }
1520
1663
  /**
1521
- * 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.
1664
+ * 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.
1522
1665
  *
1523
1666
  * Access Policy Action: `Zambda:ListAllFunctions`
1524
1667
  * Access Policy Resource: `Zambda:Function`
1525
1668
  */
1526
1669
  list(request) {
1527
- return this.request('/zambda', 'get')(request);
1670
+ return this.request('/zambda', 'get', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(request);
1528
1671
  }
1529
1672
  /**
1530
- * 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.
1673
+ * 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.
1531
1674
  *
1532
1675
  * Access Policy Action: `Zambda:CreateFunction`
1533
1676
  * Access Policy Resource: `Zambda:Function`
1534
1677
  */
1535
1678
  create(params, request) {
1536
- return this.request('/zambda', 'post')(params, request);
1679
+ return this.request('/zambda', 'post', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
1537
1680
  }
1538
1681
  /**
1539
- * 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.
1682
+ * 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.
1540
1683
  *
1541
1684
  * Access Policy Action: `Zambda:GetFunction`
1542
1685
  * Access Policy Resource: `Zambda:Function`
1543
1686
  */
1544
1687
  get(params, request) {
1545
- return this.request('/zambda/{id}', 'get')(params, request);
1688
+ return this.request('/zambda/{id}', 'get', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
1546
1689
  }
1547
1690
  /**
1548
- * 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.
1691
+ * 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.
1549
1692
  *
1550
1693
  * Access Policy Action: `Zambda:UpdateFunction`
1551
1694
  * Access Policy Resource: `Zambda:Function`
1552
1695
  */
1553
1696
  update(params, request) {
1554
- return this.request('/zambda/{id}', 'patch')(params, request);
1697
+ return this.request('/zambda/{id}', 'patch', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
1555
1698
  }
1556
1699
  /**
1557
- * 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.
1700
+ * 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.
1558
1701
  *
1559
1702
  * Access Policy Action: `Zambda:DeleteFunction`
1560
1703
  * Access Policy Resource: `Zambda:Function`
1561
1704
  */
1562
1705
  delete(params, request) {
1563
- return this.request('/zambda/{id}', 'delete')(params, request);
1706
+ return this.request('/zambda/{id}', 'delete', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
1564
1707
  }
1565
1708
  /**
1566
- * 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.
1709
+ * 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.
1567
1710
  *
1568
1711
  * Access Policy Action: `Zambda:InvokeFunction`
1569
1712
  * Access Policy Resource: `Zambda:Function`
1570
1713
  */
1571
1714
  execute(params, request) {
1572
- return this.request('/zambda/{id}/execute', 'post')(params, request);
1715
+ return this.request('/zambda/{id}/execute', 'post', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
1573
1716
  }
1574
1717
  /**
1575
- * 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.
1718
+ * 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.
1576
1719
  *
1577
1720
  * Execute a zambda that has method http_open. This endpoint is public so there are no access policy requirements.
1578
1721
  */
1579
1722
  executePublic(params, request) {
1580
- return this.request('/zambda/{id}/execute-public', 'post')(params, request);
1723
+ return this.request('/zambda/{id}/execute-public', 'post', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
1581
1724
  }
1582
1725
  /**
1583
- * 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.
1726
+ * 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.
1584
1727
  *
1585
1728
  * Access Policy Action: `Zambda:UpdateFunction`
1586
1729
  * Access Policy Resource: `Zambda:Function`
1587
1730
  */
1588
1731
  s3Upload(params, request) {
1589
- return this.request('/zambda/{id}/s3-upload', 'post')(params, request);
1732
+ return this.request('/zambda/{id}/s3-upload', 'post', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
1590
1733
  }
1591
1734
  }
1735
+ _Zambda_instances = new WeakSet(), _Zambda_baseUrlThunk = function _Zambda_baseUrlThunk() {
1736
+ var _a, _b;
1737
+ 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';
1738
+ };
1592
1739
 
1593
1740
  // AUTOGENERATED -- DO NOT EDIT
1741
+ var _ZambdaLogStream_instances, _ZambdaLogStream_baseUrlThunk;
1594
1742
  class ZambdaLogStream extends SDKResource {
1595
1743
  constructor(config) {
1596
1744
  super(config);
1745
+ _ZambdaLogStream_instances.add(this);
1597
1746
  }
1598
1747
  /**
1599
- * 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.
1748
+ * 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.
1600
1749
  *
1601
1750
  * Access Policy Action: `Zambda:ReadLogs`
1602
1751
  * Access Policy Resource: `Zambda:Function`
1603
1752
  */
1604
1753
  list(params, request) {
1605
- return this.request('/zambda/{id}/logStream', 'post')(params, request);
1754
+ return this.request('/zambda/{id}/logStream', 'post', __classPrivateFieldGet(this, _ZambdaLogStream_instances, "m", _ZambdaLogStream_baseUrlThunk).bind(this))(params, request);
1606
1755
  }
1607
1756
  /**
1608
- * 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.
1757
+ * 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.
1609
1758
  *
1610
1759
  * Access Policy Action: `Zambda:ReadLogs`
1611
1760
  * Access Policy Resource: `Zambda:Function`
1612
1761
  */
1613
1762
  search(params, request) {
1614
- return this.request('/zambda/{id}/logStream/search', 'post')(params, request);
1763
+ return this.request('/zambda/{id}/logStream/search', 'post', __classPrivateFieldGet(this, _ZambdaLogStream_instances, "m", _ZambdaLogStream_baseUrlThunk).bind(this))(params, request);
1615
1764
  }
1616
1765
  /**
1617
- * 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.
1766
+ * 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.
1618
1767
  *
1619
1768
  * Access Policy Action: `Zambda:ReadLogs`
1620
1769
  * Access Policy Resource: `Zambda:Function`
1621
1770
  */
1622
1771
  get(params, request) {
1623
- return this.request('/zambda/{id}/logStream/{logStreamName}', 'post')(params, request);
1772
+ return this.request('/zambda/{id}/logStream/{logStreamName}', 'post', __classPrivateFieldGet(this, _ZambdaLogStream_instances, "m", _ZambdaLogStream_baseUrlThunk).bind(this))(params, request);
1624
1773
  }
1625
1774
  }
1775
+ _ZambdaLogStream_instances = new WeakSet(), _ZambdaLogStream_baseUrlThunk = function _ZambdaLogStream_baseUrlThunk() {
1776
+ var _a, _b;
1777
+ 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';
1778
+ };
1626
1779
 
1627
1780
  // AUTOGENERATED -- DO NOT EDIT
1628
1781
  let Oystehr$1 = class Oystehr {
1629
1782
  constructor(config) {
1783
+ var _a, _b, _c;
1784
+ var _d, _e, _f;
1630
1785
  this.config = config;
1786
+ (_a = (_d = this.config).services) !== null && _a !== void 0 ? _a : (_d.services = {});
1787
+ (_b = (_e = this.config.services)['projectApiUrl']) !== null && _b !== void 0 ? _b : (_e['projectApiUrl'] = config.projectApiUrl);
1788
+ (_c = (_f = this.config.services)['fhirApiUrl']) !== null && _c !== void 0 ? _c : (_f['fhirApiUrl'] = config.fhirApiUrl);
1631
1789
  this.application = new Application(config);
1632
1790
  this.developer = new Developer(config);
1633
1791
  this.m2m = new M2m(config);
@@ -1639,7 +1797,6 @@ let Oystehr$1 = class Oystehr {
1639
1797
  this.project = new Project(config);
1640
1798
  this.rcm = new Rcm(config);
1641
1799
  this.erx = new Erx(config);
1642
- this.fax = new Fax(config);
1643
1800
  this.role = new Role(config);
1644
1801
  this.secret = new Secret(config);
1645
1802
  this.telemed = new Telemed(config);
@@ -1648,6 +1805,7 @@ let Oystehr$1 = class Oystehr {
1648
1805
  this.z3 = new Z3(config);
1649
1806
  this.zambda = new Zambda(config);
1650
1807
  this.zambdaLogStream = new ZambdaLogStream(config);
1808
+ this.fax = new Fax(config);
1651
1809
  this.fhir = new Fhir(config);
1652
1810
  }
1653
1811
  };