@oystehr/sdk 3.0.5 → 3.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +24 -8
  2. package/dist/cjs/client/client.d.ts +1 -1
  3. package/dist/cjs/config.d.ts +5 -0
  4. package/dist/cjs/errors/index.d.ts +4 -1
  5. package/dist/cjs/index.cjs +255 -92
  6. package/dist/cjs/index.cjs.map +1 -1
  7. package/dist/cjs/index.min.cjs +1 -1
  8. package/dist/cjs/index.min.cjs.map +1 -1
  9. package/dist/cjs/resources/classes/application.d.ts +1 -0
  10. package/dist/cjs/resources/classes/charge.d.ts +1 -0
  11. package/dist/cjs/resources/classes/conversation.d.ts +1 -0
  12. package/dist/cjs/resources/classes/developer.d.ts +1 -0
  13. package/dist/cjs/resources/classes/erx.d.ts +10 -1
  14. package/dist/cjs/resources/classes/fax.d.ts +31 -0
  15. package/dist/cjs/resources/classes/fhir.d.ts +1 -0
  16. package/dist/cjs/resources/classes/index.d.ts +2 -0
  17. package/dist/cjs/resources/classes/m2m.d.ts +1 -0
  18. package/dist/cjs/resources/classes/messaging.d.ts +1 -0
  19. package/dist/cjs/resources/classes/paymentMethod.d.ts +1 -0
  20. package/dist/cjs/resources/classes/project.d.ts +1 -0
  21. package/dist/cjs/resources/classes/rcm.d.ts +2 -1
  22. package/dist/cjs/resources/classes/role.d.ts +1 -0
  23. package/dist/cjs/resources/classes/secret.d.ts +1 -0
  24. package/dist/cjs/resources/classes/telemed.d.ts +1 -0
  25. package/dist/cjs/resources/classes/transactionalSMS.d.ts +1 -0
  26. package/dist/cjs/resources/classes/user.d.ts +1 -0
  27. package/dist/cjs/resources/classes/version.d.ts +1 -0
  28. package/dist/cjs/resources/classes/z3.d.ts +1 -0
  29. package/dist/cjs/resources/classes/zambda.d.ts +1 -0
  30. package/dist/cjs/resources/classes/zambdaLogStream.d.ts +1 -0
  31. package/dist/cjs/resources/types/DeveloperInviteResponse.d.ts +0 -4
  32. package/dist/cjs/resources/types/ErxCancelOrderParams.d.ts +6 -0
  33. package/dist/cjs/resources/types/ErxCancelOrderResponse.d.ts +6 -0
  34. package/dist/cjs/resources/types/ErxCancelPrescriptionParams.d.ts +6 -0
  35. package/dist/cjs/resources/types/ErxCancelPrescriptionResponse.d.ts +6 -0
  36. package/dist/cjs/resources/types/FaxSendParams.d.ts +18 -0
  37. package/dist/cjs/resources/types/FaxSendResponse.d.ts +10 -0
  38. package/dist/cjs/resources/types/index.d.ts +6 -0
  39. package/dist/cjs/tests/setup/constants.d.ts +2 -6
  40. package/dist/cjs/tests/setup/global.d.ts +1 -0
  41. package/dist/esm/client/client.d.ts +1 -1
  42. package/dist/esm/client/client.js +4 -4
  43. package/dist/esm/client/client.js.map +1 -1
  44. package/dist/esm/config.d.ts +5 -0
  45. package/dist/esm/errors/index.d.ts +4 -1
  46. package/dist/esm/errors/index.js +18 -2
  47. package/dist/esm/errors/index.js.map +1 -1
  48. package/dist/esm/index.min.js +1 -1
  49. package/dist/esm/index.min.js.map +1 -1
  50. package/dist/esm/resources/classes/application.d.ts +1 -0
  51. package/dist/esm/resources/classes/application.js +12 -8
  52. package/dist/esm/resources/classes/application.js.map +1 -1
  53. package/dist/esm/resources/classes/charge.d.ts +1 -0
  54. package/dist/esm/resources/classes/charge.js +6 -2
  55. package/dist/esm/resources/classes/charge.js.map +1 -1
  56. package/dist/esm/resources/classes/conversation.d.ts +1 -0
  57. package/dist/esm/resources/classes/conversation.js +9 -5
  58. package/dist/esm/resources/classes/conversation.js.map +1 -1
  59. package/dist/esm/resources/classes/developer.d.ts +1 -0
  60. package/dist/esm/resources/classes/developer.js +10 -6
  61. package/dist/esm/resources/classes/developer.js.map +1 -1
  62. package/dist/esm/resources/classes/erx.d.ts +10 -1
  63. package/dist/esm/resources/classes/erx.js +20 -4
  64. package/dist/esm/resources/classes/erx.js.map +1 -1
  65. package/dist/esm/resources/classes/fax.d.ts +31 -0
  66. package/dist/esm/resources/classes/fax.js +45 -0
  67. package/dist/esm/resources/classes/fax.js.map +1 -0
  68. package/dist/esm/resources/classes/fhir.d.ts +1 -0
  69. package/dist/esm/resources/classes/fhir.js +4 -0
  70. package/dist/esm/resources/classes/fhir.js.map +1 -1
  71. package/dist/esm/resources/classes/index.d.ts +2 -0
  72. package/dist/esm/resources/classes/index.js +7 -0
  73. package/dist/esm/resources/classes/index.js.map +1 -1
  74. package/dist/esm/resources/classes/m2m.d.ts +1 -0
  75. package/dist/esm/resources/classes/m2m.js +11 -7
  76. package/dist/esm/resources/classes/m2m.js.map +1 -1
  77. package/dist/esm/resources/classes/messaging.d.ts +1 -0
  78. package/dist/esm/resources/classes/messaging.js +5 -1
  79. package/dist/esm/resources/classes/messaging.js.map +1 -1
  80. package/dist/esm/resources/classes/paymentMethod.d.ts +1 -0
  81. package/dist/esm/resources/classes/paymentMethod.js +8 -4
  82. package/dist/esm/resources/classes/paymentMethod.js.map +1 -1
  83. package/dist/esm/resources/classes/project.d.ts +1 -0
  84. package/dist/esm/resources/classes/project.js +6 -2
  85. package/dist/esm/resources/classes/project.js.map +1 -1
  86. package/dist/esm/resources/classes/rcm.d.ts +2 -1
  87. package/dist/esm/resources/classes/rcm.js +8 -4
  88. package/dist/esm/resources/classes/rcm.js.map +1 -1
  89. package/dist/esm/resources/classes/role.d.ts +1 -0
  90. package/dist/esm/resources/classes/role.js +9 -5
  91. package/dist/esm/resources/classes/role.js.map +1 -1
  92. package/dist/esm/resources/classes/secret.d.ts +1 -0
  93. package/dist/esm/resources/classes/secret.js +8 -4
  94. package/dist/esm/resources/classes/secret.js.map +1 -1
  95. package/dist/esm/resources/classes/telemed.d.ts +1 -0
  96. package/dist/esm/resources/classes/telemed.js +6 -2
  97. package/dist/esm/resources/classes/telemed.js.map +1 -1
  98. package/dist/esm/resources/classes/transactionalSMS.d.ts +1 -0
  99. package/dist/esm/resources/classes/transactionalSMS.js +5 -1
  100. package/dist/esm/resources/classes/transactionalSMS.js.map +1 -1
  101. package/dist/esm/resources/classes/user.d.ts +1 -0
  102. package/dist/esm/resources/classes/user.js +11 -7
  103. package/dist/esm/resources/classes/user.js.map +1 -1
  104. package/dist/esm/resources/classes/version.d.ts +1 -0
  105. package/dist/esm/resources/classes/version.js +5 -1
  106. package/dist/esm/resources/classes/version.js.map +1 -1
  107. package/dist/esm/resources/classes/z3-ext.js +9 -5
  108. package/dist/esm/resources/classes/z3-ext.js.map +1 -1
  109. package/dist/esm/resources/classes/z3.d.ts +1 -0
  110. package/dist/esm/resources/classes/z3.js +10 -6
  111. package/dist/esm/resources/classes/z3.js.map +1 -1
  112. package/dist/esm/resources/classes/zambda-ext.js +5 -1
  113. package/dist/esm/resources/classes/zambda-ext.js.map +1 -1
  114. package/dist/esm/resources/classes/zambda.d.ts +1 -0
  115. package/dist/esm/resources/classes/zambda.js +12 -8
  116. package/dist/esm/resources/classes/zambda.js.map +1 -1
  117. package/dist/esm/resources/classes/zambdaLogStream.d.ts +1 -0
  118. package/dist/esm/resources/classes/zambdaLogStream.js +7 -3
  119. package/dist/esm/resources/classes/zambdaLogStream.js.map +1 -1
  120. package/dist/esm/resources/types/DeveloperInviteResponse.d.ts +0 -4
  121. package/dist/esm/resources/types/ErxCancelOrderParams.d.ts +6 -0
  122. package/dist/esm/resources/types/ErxCancelOrderResponse.d.ts +6 -0
  123. package/dist/esm/resources/types/ErxCancelPrescriptionParams.d.ts +6 -0
  124. package/dist/esm/resources/types/ErxCancelPrescriptionResponse.d.ts +6 -0
  125. package/dist/esm/resources/types/FaxSendParams.d.ts +18 -0
  126. package/dist/esm/resources/types/FaxSendResponse.d.ts +10 -0
  127. package/dist/esm/resources/types/index.d.ts +6 -0
  128. package/dist/esm/tests/setup/constants.d.ts +2 -6
  129. package/dist/esm/tests/setup/global.d.ts +1 -0
  130. package/package.json +4 -4
  131. package/src/client/client.ts +6 -6
  132. package/src/config.ts +5 -0
  133. package/src/errors/index.ts +18 -2
  134. package/src/resources/classes/application.ts +15 -8
  135. package/src/resources/classes/charge.ts +5 -2
  136. package/src/resources/classes/conversation.ts +20 -5
  137. package/src/resources/classes/developer.ts +9 -6
  138. package/src/resources/classes/erx.ts +26 -4
  139. package/src/resources/classes/fax.ts +44 -0
  140. package/src/resources/classes/fhir.ts +3 -0
  141. package/src/resources/classes/index.ts +6 -0
  142. package/src/resources/classes/m2m.ts +10 -7
  143. package/src/resources/classes/messaging.ts +4 -1
  144. package/src/resources/classes/paymentMethod.ts +7 -4
  145. package/src/resources/classes/project.ts +5 -2
  146. package/src/resources/classes/rcm.ts +7 -4
  147. package/src/resources/classes/role.ts +8 -5
  148. package/src/resources/classes/secret.ts +7 -4
  149. package/src/resources/classes/telemed.ts +5 -2
  150. package/src/resources/classes/transactionalSMS.ts +4 -1
  151. package/src/resources/classes/user.ts +10 -7
  152. package/src/resources/classes/version.ts +4 -1
  153. package/src/resources/classes/z3-ext.ts +10 -4
  154. package/src/resources/classes/z3.ts +9 -6
  155. package/src/resources/classes/zambda-ext.ts +5 -1
  156. package/src/resources/classes/zambda.ts +11 -8
  157. package/src/resources/classes/zambdaLogStream.ts +10 -3
  158. package/src/resources/types/DeveloperInviteResponse.ts +0 -4
  159. package/src/resources/types/ErxCancelOrderParams.ts +8 -0
  160. package/src/resources/types/ErxCancelOrderResponse.ts +8 -0
  161. package/src/resources/types/ErxCancelPrescriptionParams.ts +8 -0
  162. package/src/resources/types/ErxCancelPrescriptionResponse.ts +8 -0
  163. package/src/resources/types/FaxSendParams.ts +20 -0
  164. package/src/resources/types/FaxSendResponse.ts +12 -0
  165. package/src/resources/types/index.ts +6 -0
  166. /package/dist/cjs/tests/{common.d.ts → integrational/common.d.ts} +0 -0
  167. /package/dist/esm/tests/{common.d.ts → integrational/common.d.ts} +0 -0
@@ -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
  /******************************************************************************
@@ -87,23 +103,22 @@ class SDKResource {
87
103
  constructor(config) {
88
104
  this.config = config;
89
105
  }
90
- request(path, method) {
106
+ request(path, method, baseUrlThunk) {
91
107
  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
108
  const configThunk = () => this.config;
94
109
  try {
95
110
  return yield fetcher(baseUrlThunk, configThunk, path, method)(params, request);
96
111
  }
97
112
  catch (err) {
98
113
  const error = err;
99
- throw new OystehrSdkError({ message: error.message, code: error.code });
114
+ throw new OystehrSdkError({ message: error.message, code: error.code, cause: error.cause });
100
115
  }
101
116
  });
102
117
  }
103
118
  fhirRequest(path, method) {
104
119
  return (params, request) => __awaiter(this, void 0, void 0, function* () {
105
120
  try {
106
- const baseUrlThunk = () => { var _a; return (_a = this.config.fhirApiUrl) !== null && _a !== void 0 ? _a : defaultFhirApiUrl; };
121
+ 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
122
  const configThunk = () => this.config;
108
123
  // must await here to catch
109
124
  return yield fetcher(baseUrlThunk, configThunk, path, method)(params, request);
@@ -115,6 +130,7 @@ class SDKResource {
115
130
  throw new OystehrSdkError({
116
131
  message: fullError.message,
117
132
  code: fullError.code,
133
+ cause: fullError.cause,
118
134
  });
119
135
  }
120
136
  throw new OystehrFHIRError({
@@ -323,6 +339,10 @@ class Application extends SDKResource {
323
339
  constructor(config) {
324
340
  super(config);
325
341
  }
342
+ baseUrlThunk() {
343
+ var _a, _b;
344
+ 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';
345
+ }
326
346
  /**
327
347
  * 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.
328
348
  *
@@ -330,7 +350,7 @@ class Application extends SDKResource {
330
350
  * Access Policy Resource: `App:Application`
331
351
  */
332
352
  list(request) {
333
- return this.request('/application', 'get')(request);
353
+ return this.request('/application', 'get', this.baseUrlThunk.bind(this))(request);
334
354
  }
335
355
  /**
336
356
  * 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.
@@ -339,7 +359,7 @@ class Application extends SDKResource {
339
359
  * Access Policy Resource: `App:Application`
340
360
  */
341
361
  create(params, request) {
342
- return this.request('/application', 'post')(params, request);
362
+ return this.request('/application', 'post', this.baseUrlThunk.bind(this))(params, request);
343
363
  }
344
364
  /**
345
365
  * 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.
@@ -348,7 +368,7 @@ class Application extends SDKResource {
348
368
  * Access Policy Resource: `App:Application`
349
369
  */
350
370
  get(params, request) {
351
- return this.request('/application/{id}', 'get')(params, request);
371
+ return this.request('/application/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);
352
372
  }
353
373
  /**
354
374
  * 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.
@@ -357,7 +377,7 @@ class Application extends SDKResource {
357
377
  * Access Policy Resource: `App:Application`
358
378
  */
359
379
  update(params, request) {
360
- return this.request('/application/{id}', 'patch')(params, request);
380
+ return this.request('/application/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);
361
381
  }
362
382
  /**
363
383
  * 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.
@@ -366,7 +386,7 @@ class Application extends SDKResource {
366
386
  * Access Policy Resource: `App:Application`
367
387
  */
368
388
  delete(params, request) {
369
- return this.request('/application/{id}', 'delete')(params, request);
389
+ return this.request('/application/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);
370
390
  }
371
391
  /**
372
392
  * Rotate client's secrete associated with an application.
@@ -375,7 +395,7 @@ class Application extends SDKResource {
375
395
  * Access Policy Resource: `App:Application`
376
396
  */
377
397
  rotateSecret(params, request) {
378
- return this.request('/application/{id}/rotate-secret', 'post')(params, request);
398
+ return this.request('/application/{id}/rotate-secret', 'post', this.baseUrlThunk.bind(this))(params, request);
379
399
  }
380
400
  /**
381
401
  * Revokes user's refresh token issued for the application.
@@ -384,7 +404,7 @@ class Application extends SDKResource {
384
404
  * Access Policy Resource: `App:Application`
385
405
  */
386
406
  revokeRefreshToken(params, request) {
387
- return this.request('/application/{id}/revoke-refresh-token', 'post')(params, request);
407
+ return this.request('/application/{id}/revoke-refresh-token', 'post', this.baseUrlThunk.bind(this))(params, request);
388
408
  }
389
409
  /**
390
410
  * Revokes user's access token issued for the application.
@@ -393,7 +413,7 @@ class Application extends SDKResource {
393
413
  * Access Policy Resource: `App:Application`
394
414
  */
395
415
  revokeAccessToken(params, request) {
396
- return this.request('/application/{id}/revoke-access-token', 'post')(params, request);
416
+ return this.request('/application/{id}/revoke-access-token', 'post', this.baseUrlThunk.bind(this))(params, request);
397
417
  }
398
418
  }
399
419
 
@@ -402,6 +422,10 @@ class Charge extends SDKResource {
402
422
  constructor(config) {
403
423
  super(config);
404
424
  }
425
+ baseUrlThunk() {
426
+ var _a, _b;
427
+ 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';
428
+ }
405
429
  /**
406
430
  * Charge patient's default payment method for a specified encounter or charge item.
407
431
  *
@@ -414,7 +438,7 @@ class Charge extends SDKResource {
414
438
  * Access Policy Resources: `FHIR:Patient:*,FHIR:Encounter:*,FHIR:Coverage:*`
415
439
  */
416
440
  issue(params, request) {
417
- return this.request('/payment/charge/issue', 'post')(params, request);
441
+ return this.request('/payment/charge/issue', 'post', this.baseUrlThunk.bind(this))(params, request);
418
442
  }
419
443
  /**
420
444
  * Retrieve charge status for a specified encounter or charge item.
@@ -428,7 +452,7 @@ class Charge extends SDKResource {
428
452
  * Access Policy Resources: `FHIR:Patient:*,FHIR:Encounter:*,FHIR:Coverage:*`
429
453
  */
430
454
  status(params, request) {
431
- return this.request('/payment/charge/status', 'post')(params, request);
455
+ return this.request('/payment/charge/status', 'post', this.baseUrlThunk.bind(this))(params, request);
432
456
  }
433
457
  }
434
458
 
@@ -471,6 +495,10 @@ class Conversation extends SDKResource {
471
495
  */
472
496
  this.getConversationIdFromEncounter = getConversationIdFromEncounter;
473
497
  }
498
+ baseUrlThunk() {
499
+ var _a, _b;
500
+ 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';
501
+ }
474
502
  /**
475
503
  * 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.
476
504
  *
@@ -483,7 +511,7 @@ class Conversation extends SDKResource {
483
511
  * Access Policy Resource: `FHIR:Encounter`
484
512
  */
485
513
  create(params, request) {
486
- return this.request('/messaging/conversation', 'post')(params, request);
514
+ return this.request('/messaging/conversation', 'post', this.baseUrlThunk.bind(this))(params, request);
487
515
  }
488
516
  /**
489
517
  * 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.
@@ -492,7 +520,7 @@ class Conversation extends SDKResource {
492
520
  * Access Policy Resource: `Messaging:Conversation`.
493
521
  */
494
522
  getToken(request) {
495
- return this.request('/messaging/conversation/token', 'get')(request);
523
+ return this.request('/messaging/conversation/token', 'get', this.baseUrlThunk.bind(this))(request);
496
524
  }
497
525
  /**
498
526
  * 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.
@@ -506,7 +534,7 @@ class Conversation extends SDKResource {
506
534
  * Access Policy Resource: `FHIR:Encounter`
507
535
  */
508
536
  addParticipant(params, request) {
509
- return this.request('/messaging/conversation/{conversationId}/participant', 'post')(params, request);
537
+ return this.request('/messaging/conversation/{conversationId}/participant', 'post', this.baseUrlThunk.bind(this))(params, request);
510
538
  }
511
539
  /**
512
540
  * 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.
@@ -518,7 +546,7 @@ class Conversation extends SDKResource {
518
546
  * Access Policy Resource: `FHIR:Patient`, `FHIR:Practitioner`, or `FHIR:RelatedPerson`
519
547
  */
520
548
  removeParticipant(params, request) {
521
- return this.request('/messaging/conversation/{conversationId}/participant', 'delete')(params, request);
549
+ return this.request('/messaging/conversation/{conversationId}/participant', 'delete', this.baseUrlThunk.bind(this))(params, request);
522
550
  }
523
551
  /**
524
552
  * 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.
@@ -528,7 +556,7 @@ class Conversation extends SDKResource {
528
556
  * Access Policy Resource: `Messaging:Conversation`
529
557
  */
530
558
  message(params, request) {
531
- return this.request('/messaging/conversation/{conversationId}/message', 'post')(params, request);
559
+ return this.request('/messaging/conversation/{conversationId}/message', 'post', this.baseUrlThunk.bind(this))(params, request);
532
560
  }
533
561
  }
534
562
 
@@ -537,6 +565,10 @@ class Developer extends SDKResource {
537
565
  constructor(config) {
538
566
  super(config);
539
567
  }
568
+ baseUrlThunk() {
569
+ var _a, _b;
570
+ 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';
571
+ }
540
572
  /**
541
573
  * 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.
542
574
  *
@@ -544,7 +576,7 @@ class Developer extends SDKResource {
544
576
  * Access Policy Resource: `IAM:Developer`
545
577
  */
546
578
  get(params, request) {
547
- return this.request('/developer/{id}', 'get')(params, request);
579
+ return this.request('/developer/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);
548
580
  }
549
581
  /**
550
582
  * 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.
@@ -553,7 +585,7 @@ class Developer extends SDKResource {
553
585
  * Access Policy Resource: `IAM:Developer`
554
586
  */
555
587
  update(params, request) {
556
- return this.request('/developer/{id}', 'patch')(params, request);
588
+ return this.request('/developer/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);
557
589
  }
558
590
  /**
559
591
  * 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.
@@ -562,7 +594,7 @@ class Developer extends SDKResource {
562
594
  * Access Policy Resource: `IAM:Developer`
563
595
  */
564
596
  delete(params, request) {
565
- return this.request('/developer/{id}', 'delete')(params, request);
597
+ return this.request('/developer/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);
566
598
  }
567
599
  /**
568
600
  * 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.
@@ -571,7 +603,7 @@ class Developer extends SDKResource {
571
603
  * Access Policy Resource: `IAM:Developer`
572
604
  */
573
605
  invite(params, request) {
574
- return this.request('/developer/invite', 'post')(params, request);
606
+ return this.request('/developer/invite', 'post', this.baseUrlThunk.bind(this))(params, request);
575
607
  }
576
608
  /**
577
609
  * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_developer-v2-list) instead.
@@ -582,7 +614,7 @@ class Developer extends SDKResource {
582
614
  * Access Policy Resource: `IAM:Developer`
583
615
  */
584
616
  list(request) {
585
- return this.request('/developer', 'get')(request);
617
+ return this.request('/developer', 'get', this.baseUrlThunk.bind(this))(request);
586
618
  }
587
619
  /**
588
620
  * 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,7 +623,7 @@ class Developer extends SDKResource {
591
623
  * Access Policy Resource: `Project:Settings`
592
624
  */
593
625
  listV2(params, request) {
594
- return this.request('/developer/v2/list', 'get')(params, request);
626
+ return this.request('/developer/v2/list', 'get', this.baseUrlThunk.bind(this))(params, request);
595
627
  }
596
628
  }
597
629
 
@@ -600,29 +632,86 @@ class Erx extends SDKResource {
600
632
  constructor(config) {
601
633
  super(config);
602
634
  }
635
+ baseUrlThunk() {
636
+ var _a, _b;
637
+ 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';
638
+ }
603
639
  /**
604
640
  * Retrieve patient properties from FHIR service and sync them with eRx service
605
641
  */
606
642
  syncPatient(params, request) {
607
- return this.request('/erx/sync-patient/{patientId}', 'post')(params, request);
643
+ return this.request('/erx/sync-patient/{patientId}', 'post', this.baseUrlThunk.bind(this))(params, request);
608
644
  }
609
645
  /**
610
646
  * Search for allergies
611
647
  */
612
648
  allergySearch(params, request) {
613
- return this.request('/erx/allergy/search', 'get')(params, request);
649
+ return this.request('/erx/allergy/search', 'get', this.baseUrlThunk.bind(this))(params, request);
650
+ }
651
+ /**
652
+ * Cancel photon order
653
+ */
654
+ cancelOrder(params, request) {
655
+ return this.request('/erx/cancel-order', 'post', this.baseUrlThunk.bind(this))(params, request);
656
+ }
657
+ /**
658
+ * Cancel photon prescription
659
+ */
660
+ cancelPrescription(params, request) {
661
+ return this.request('/erx/cancel-prescription', 'post', this.baseUrlThunk.bind(this))(params, request);
614
662
  }
615
663
  /**
616
664
  * Search for medications. Provide at least one of code or name filters
617
665
  */
618
666
  medicationSearch(params, request) {
619
- return this.request('/erx/medication/search', 'get')(params, request);
667
+ return this.request('/erx/medication/search', 'get', this.baseUrlThunk.bind(this))(params, request);
620
668
  }
621
669
  /**
622
670
  * Search for medications. Provide at least one of code or name filters
623
671
  */
624
672
  medicationSearchV2(params, request) {
625
- return this.request('/erx/v2/medication/search', 'get')(params, request);
673
+ return this.request('/erx/v2/medication/search', 'get', this.baseUrlThunk.bind(this))(params, request);
674
+ }
675
+ }
676
+
677
+ // AUTOGENERATED -- DO NOT EDIT
678
+ class Fax extends SDKResource {
679
+ constructor(config) {
680
+ super(config);
681
+ }
682
+ baseUrlThunk() {
683
+ var _a, _b;
684
+ 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';
685
+ }
686
+ /**
687
+ * 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.
688
+ *
689
+ * Access Policy Requirements:
690
+ * Action: `Fax:Offboard`
691
+ * Access Policy Resource: `Fax:Number`
692
+ */
693
+ offboard(request) {
694
+ return this.request('/offboard', 'post', this.baseUrlThunk.bind(this))(request);
695
+ }
696
+ /**
697
+ * 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.
698
+ *
699
+ * Access Policy Requirements:
700
+ * Action: `Fax:Onboard`
701
+ * Access Policy Resource: `Fax:Number`
702
+ */
703
+ onboard(request) {
704
+ return this.request('/onboard', 'post', this.baseUrlThunk.bind(this))(request);
705
+ }
706
+ /**
707
+ * 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.
708
+ *
709
+ * Access Policy Requirements:
710
+ * Action: `Fax:Send`
711
+ * Access Policy Resource: `Fax:Fax`
712
+ */
713
+ send(params, request) {
714
+ return this.request('/send', 'post', this.baseUrlThunk.bind(this))(params, request);
626
715
  }
627
716
  }
628
717
 
@@ -822,6 +911,10 @@ class Fhir extends SDKResource {
822
911
  this.formatAddress = formatAddress;
823
912
  this.formatHumanName = formatHumanName;
824
913
  }
914
+ baseUrlThunk() {
915
+ var _a, _b;
916
+ return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['fhirApiUrl']) !== null && _b !== void 0 ? _b : 'https://fhir-api.zapehr.com';
917
+ }
825
918
  }
826
919
 
827
920
  // AUTOGENERATED -- DO NOT EDIT
@@ -829,6 +922,10 @@ class M2m extends SDKResource {
829
922
  constructor(config) {
830
923
  super(config);
831
924
  }
925
+ baseUrlThunk() {
926
+ var _a, _b;
927
+ 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';
928
+ }
832
929
  /**
833
930
  * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_m2m-v2-list) instead.
834
931
  *
@@ -838,7 +935,7 @@ class M2m extends SDKResource {
838
935
  * Access Policy Resource: `IAM:M2MClient`
839
936
  */
840
937
  list(request) {
841
- return this.request('/m2m', 'get')(request);
938
+ return this.request('/m2m', 'get', this.baseUrlThunk.bind(this))(request);
842
939
  }
843
940
  /**
844
941
  * 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).
@@ -847,7 +944,7 @@ class M2m extends SDKResource {
847
944
  * Access Policy Resource: `IAM:M2MClient`
848
945
  */
849
946
  create(params, request) {
850
- return this.request('/m2m', 'post')(params, request);
947
+ return this.request('/m2m', 'post', this.baseUrlThunk.bind(this))(params, request);
851
948
  }
852
949
  /**
853
950
  * 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).
@@ -856,7 +953,7 @@ class M2m extends SDKResource {
856
953
  * Access Policy Resource: `IAM:M2MClient`
857
954
  */
858
955
  get(params, request) {
859
- return this.request('/m2m/{id}', 'get')(params, request);
956
+ return this.request('/m2m/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);
860
957
  }
861
958
  /**
862
959
  * 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).
@@ -865,7 +962,7 @@ class M2m extends SDKResource {
865
962
  * Access Policy Resource: `IAM:M2MClient`
866
963
  */
867
964
  update(params, request) {
868
- return this.request('/m2m/{id}', 'patch')(params, request);
965
+ return this.request('/m2m/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);
869
966
  }
870
967
  /**
871
968
  * 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).
@@ -874,7 +971,7 @@ class M2m extends SDKResource {
874
971
  * Access Policy Resource: `IAM:M2MClient`
875
972
  */
876
973
  delete(params, request) {
877
- return this.request('/m2m/{id}', 'delete')(params, request);
974
+ return this.request('/m2m/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);
878
975
  }
879
976
  /**
880
977
  * 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).
@@ -883,7 +980,7 @@ class M2m extends SDKResource {
883
980
  * Access Policy Resource: `IAM:M2MClient`
884
981
  */
885
982
  rotateSecret(params, request) {
886
- return this.request('/m2m/{id}/rotate-secret', 'post')(params, request);
983
+ return this.request('/m2m/{id}/rotate-secret', 'post', this.baseUrlThunk.bind(this))(params, request);
887
984
  }
888
985
  /**
889
986
  * 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).
@@ -892,7 +989,7 @@ class M2m extends SDKResource {
892
989
  * Access Policy Resource: `IAM:M2MClient`
893
990
  */
894
991
  listV2(params, request) {
895
- return this.request('/m2m/v2/list', 'get')(params, request);
992
+ return this.request('/m2m/v2/list', 'get', this.baseUrlThunk.bind(this))(params, request);
896
993
  }
897
994
  }
898
995
 
@@ -901,11 +998,15 @@ class Messaging extends SDKResource {
901
998
  constructor(config) {
902
999
  super(config);
903
1000
  }
1001
+ baseUrlThunk() {
1002
+ var _a, _b;
1003
+ 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';
1004
+ }
904
1005
  /**
905
1006
  * Get an information about the Messaging services configuration. This information includes phone number, phone number type and also rate limits of each service.
906
1007
  */
907
1008
  getMessagingConfig(request) {
908
- return this.request('/messaging/config', 'get')(request);
1009
+ return this.request('/messaging/config', 'get', this.baseUrlThunk.bind(this))(request);
909
1010
  }
910
1011
  }
911
1012
 
@@ -914,6 +1015,10 @@ class PaymentMethod extends SDKResource {
914
1015
  constructor(config) {
915
1016
  super(config);
916
1017
  }
1018
+ baseUrlThunk() {
1019
+ var _a, _b;
1020
+ 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';
1021
+ }
917
1022
  /**
918
1023
  * Enter a new credit card or other payment method for the user.
919
1024
  *
@@ -930,7 +1035,7 @@ class PaymentMethod extends SDKResource {
930
1035
  * Access Policy Resource: `FHIR:Patient`
931
1036
  */
932
1037
  setUp(params, request) {
933
- return this.request('/payment/payment-method/setup', 'post')(params, request);
1038
+ return this.request('/payment/payment-method/setup', 'post', this.baseUrlThunk.bind(this))(params, request);
934
1039
  }
935
1040
  /**
936
1041
  * Set a specified payment method for the user as default.
@@ -948,7 +1053,7 @@ class PaymentMethod extends SDKResource {
948
1053
  * Access Policy Resource: `FHIR:Patient`
949
1054
  */
950
1055
  setDefault(params, request) {
951
- return this.request('/payment/payment-method/set-default', 'post')(params, request);
1056
+ return this.request('/payment/payment-method/set-default', 'post', this.baseUrlThunk.bind(this))(params, request);
952
1057
  }
953
1058
  /**
954
1059
  * Delete a specified payment method for the beneficiary.
@@ -966,7 +1071,7 @@ class PaymentMethod extends SDKResource {
966
1071
  * Access Policy Resource: `FHIR:Patient`
967
1072
  */
968
1073
  delete(params, request) {
969
- return this.request('/payment/payment-method', 'delete')(params, request);
1074
+ return this.request('/payment/payment-method', 'delete', this.baseUrlThunk.bind(this))(params, request);
970
1075
  }
971
1076
  /**
972
1077
  * List all payment methods for the patient.
@@ -984,7 +1089,7 @@ class PaymentMethod extends SDKResource {
984
1089
  * Access Policy Resource: `FHIR:Patient`
985
1090
  */
986
1091
  list(params, request) {
987
- return this.request('/payment/payment-method/list', 'post')(params, request);
1092
+ return this.request('/payment/payment-method/list', 'post', this.baseUrlThunk.bind(this))(params, request);
988
1093
  }
989
1094
  }
990
1095
 
@@ -993,6 +1098,10 @@ class Project extends SDKResource {
993
1098
  constructor(config) {
994
1099
  super(config);
995
1100
  }
1101
+ baseUrlThunk() {
1102
+ var _a, _b;
1103
+ 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';
1104
+ }
996
1105
  /**
997
1106
  * 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 .
998
1107
  *
@@ -1000,7 +1109,7 @@ class Project extends SDKResource {
1000
1109
  * Access Policy Resource: `Project:Settings`
1001
1110
  */
1002
1111
  get(request) {
1003
- return this.request('/project', 'get')(request);
1112
+ return this.request('/project', 'get', this.baseUrlThunk.bind(this))(request);
1004
1113
  }
1005
1114
  /**
1006
1115
  * 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 .
@@ -1009,7 +1118,7 @@ class Project extends SDKResource {
1009
1118
  * Access Policy Resource: `Project:Settings`
1010
1119
  */
1011
1120
  update(params, request) {
1012
- return this.request('/project', 'patch')(params, request);
1121
+ return this.request('/project', 'patch', this.baseUrlThunk.bind(this))(params, request);
1013
1122
  }
1014
1123
  }
1015
1124
 
@@ -1018,17 +1127,21 @@ class Rcm extends SDKResource {
1018
1127
  constructor(config) {
1019
1128
  super(config);
1020
1129
  }
1130
+ baseUrlThunk() {
1131
+ var _a, _b;
1132
+ 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';
1133
+ }
1021
1134
  /**
1022
1135
  * Check [Insurance Eligibility](https://docs.oystehr.com/services/rcm/eligibility/).
1023
1136
  *
1024
1137
  * Access Policy Action: `RCM:CheckInsuranceEligibility`
1025
1138
  * Access Policy Resource: `RCM:InsuranceEligibility`
1026
1139
  *
1027
- * nAccess Policy Action: `FHIR:Create`
1140
+ * Access Policy Action: `FHIR:Create`
1028
1141
  * Access Policy Resource: `FHIR:CoverageEligibilityResponse`
1029
1142
  */
1030
1143
  eligibilityCheck(params, request) {
1031
- return this.request('/rcm/eligibility-check', 'post')(params, request);
1144
+ return this.request('/rcm/eligibility-check', 'post', this.baseUrlThunk.bind(this))(params, request);
1032
1145
  }
1033
1146
  /**
1034
1147
  * Check [Validate Professional Claim](https://docs.oystehr.com/services/rcm/professional-claim-submission/).
@@ -1040,7 +1153,7 @@ class Rcm extends SDKResource {
1040
1153
  * Access Policy Resource: `FHIR:AuditEvent`
1041
1154
  */
1042
1155
  validateProfessionalClaim(params, request) {
1043
- return this.request('/rcm/professional-claim/validate', 'post')(params, request);
1156
+ return this.request('/rcm/professional-claim/validate', 'post', this.baseUrlThunk.bind(this))(params, request);
1044
1157
  }
1045
1158
  /**
1046
1159
  * Check [Submit Professional Claim](https://docs.oystehr.com/services/rcm/professional-claim-submission/).
@@ -1055,7 +1168,7 @@ class Rcm extends SDKResource {
1055
1168
  * Access Policy Resource: `FHIR:Claim`
1056
1169
  */
1057
1170
  submitProfessionalClaim(params, request) {
1058
- return this.request('/rcm/professional-claim/submit', 'post')(params, request);
1171
+ return this.request('/rcm/professional-claim/submit', 'post', this.baseUrlThunk.bind(this))(params, request);
1059
1172
  }
1060
1173
  }
1061
1174
 
@@ -1064,6 +1177,10 @@ class Role extends SDKResource {
1064
1177
  constructor(config) {
1065
1178
  super(config);
1066
1179
  }
1180
+ baseUrlThunk() {
1181
+ var _a, _b;
1182
+ 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';
1183
+ }
1067
1184
  /**
1068
1185
  * 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/).
1069
1186
  *
@@ -1071,7 +1188,7 @@ class Role extends SDKResource {
1071
1188
  * Access Policy Resource: `IAM:Role`
1072
1189
  */
1073
1190
  list(request) {
1074
- return this.request('/iam/role', 'get')(request);
1191
+ return this.request('/iam/role', 'get', this.baseUrlThunk.bind(this))(request);
1075
1192
  }
1076
1193
  /**
1077
1194
  * 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/).
@@ -1080,7 +1197,7 @@ class Role extends SDKResource {
1080
1197
  * Access Policy Resource: `IAM:Role`
1081
1198
  */
1082
1199
  create(params, request) {
1083
- return this.request('/iam/role', 'post')(params, request);
1200
+ return this.request('/iam/role', 'post', this.baseUrlThunk.bind(this))(params, request);
1084
1201
  }
1085
1202
  /**
1086
1203
  * 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/).
@@ -1089,7 +1206,7 @@ class Role extends SDKResource {
1089
1206
  * Access Policy Resource: `IAM:Role`
1090
1207
  */
1091
1208
  get(params, request) {
1092
- return this.request('/iam/role/{roleId}', 'get')(params, request);
1209
+ return this.request('/iam/role/{roleId}', 'get', this.baseUrlThunk.bind(this))(params, request);
1093
1210
  }
1094
1211
  /**
1095
1212
  * 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/).
@@ -1098,7 +1215,7 @@ class Role extends SDKResource {
1098
1215
  * Access Policy Resource: `IAM:Role`
1099
1216
  */
1100
1217
  update(params, request) {
1101
- return this.request('/iam/role/{roleId}', 'patch')(params, request);
1218
+ return this.request('/iam/role/{roleId}', 'patch', this.baseUrlThunk.bind(this))(params, request);
1102
1219
  }
1103
1220
  /**
1104
1221
  * 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/).
@@ -1108,7 +1225,7 @@ class Role extends SDKResource {
1108
1225
  * Will fail if any entities hold the Role or if Role is assigned as the default patient role for the project
1109
1226
  */
1110
1227
  delete(params, request) {
1111
- return this.request('/iam/role/{roleId}', 'delete')(params, request);
1228
+ return this.request('/iam/role/{roleId}', 'delete', this.baseUrlThunk.bind(this))(params, request);
1112
1229
  }
1113
1230
  }
1114
1231
 
@@ -1117,6 +1234,10 @@ class Secret extends SDKResource {
1117
1234
  constructor(config) {
1118
1235
  super(config);
1119
1236
  }
1237
+ baseUrlThunk() {
1238
+ var _a, _b;
1239
+ 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';
1240
+ }
1120
1241
  /**
1121
1242
  * Get a list of all secrets in the Project.
1122
1243
  *
@@ -1124,7 +1245,7 @@ class Secret extends SDKResource {
1124
1245
  * Access Policy Resource: `Zambda:Secret`
1125
1246
  */
1126
1247
  list(request) {
1127
- return this.request('/secret', 'get')(request);
1248
+ return this.request('/secret', 'get', this.baseUrlThunk.bind(this))(request);
1128
1249
  }
1129
1250
  /**
1130
1251
  * Create a secret for a project. If the secret is already defined, update it.
@@ -1133,7 +1254,7 @@ class Secret extends SDKResource {
1133
1254
  * Access Policy Resource: `Zambda:Secret`
1134
1255
  */
1135
1256
  set(params, request) {
1136
- return this.request('/secret', 'post')(params, request);
1257
+ return this.request('/secret', 'post', this.baseUrlThunk.bind(this))(params, request);
1137
1258
  }
1138
1259
  /**
1139
1260
  * Get the secret with the provided name.
@@ -1142,7 +1263,7 @@ class Secret extends SDKResource {
1142
1263
  * Access Policy Resource: `Zambda:Secret`
1143
1264
  */
1144
1265
  get(params, request) {
1145
- return this.request('/secret/{name}', 'get')(params, request);
1266
+ return this.request('/secret/{name}', 'get', this.baseUrlThunk.bind(this))(params, request);
1146
1267
  }
1147
1268
  /**
1148
1269
  * Delete the secret with the provided name.
@@ -1151,7 +1272,7 @@ class Secret extends SDKResource {
1151
1272
  * Access Policy Resource: `Zambda:Secret`
1152
1273
  */
1153
1274
  delete(params, request) {
1154
- return this.request('/secret/{name}', 'delete')(params, request);
1275
+ return this.request('/secret/{name}', 'delete', this.baseUrlThunk.bind(this))(params, request);
1155
1276
  }
1156
1277
  }
1157
1278
 
@@ -1160,6 +1281,10 @@ class Telemed extends SDKResource {
1160
1281
  constructor(config) {
1161
1282
  super(config);
1162
1283
  }
1284
+ baseUrlThunk() {
1285
+ var _a, _b;
1286
+ 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';
1287
+ }
1163
1288
  /**
1164
1289
  * Create a [telemedicine video meeting](https://docs.oystehr.com/services/telemed/).
1165
1290
  *
@@ -1172,7 +1297,7 @@ class Telemed extends SDKResource {
1172
1297
  * Access Policy Resource: `FHIR:Encounter`
1173
1298
  */
1174
1299
  createMeeting(params, request) {
1175
- return this.request('/telemed/v2/meeting', 'post')(params, request);
1300
+ return this.request('/telemed/v2/meeting', 'post', this.baseUrlThunk.bind(this))(params, request);
1176
1301
  }
1177
1302
  /**
1178
1303
  * Get Meeting and Attendee objects necessary to join a telemedicine video meeting.
@@ -1185,7 +1310,7 @@ class Telemed extends SDKResource {
1185
1310
  * Access Policy Resource: `Telemed:Meeting`
1186
1311
  */
1187
1312
  joinMeeting(params, request) {
1188
- return this.request('/telemed/v2/meeting/{encounterId}/join', 'get')(params, request);
1313
+ return this.request('/telemed/v2/meeting/{encounterId}/join', 'get', this.baseUrlThunk.bind(this))(params, request);
1189
1314
  }
1190
1315
  }
1191
1316
 
@@ -1194,6 +1319,10 @@ class TransactionalSMS extends SDKResource {
1194
1319
  constructor(config) {
1195
1320
  super(config);
1196
1321
  }
1322
+ baseUrlThunk() {
1323
+ var _a, _b;
1324
+ 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';
1325
+ }
1197
1326
  /**
1198
1327
  * 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.
1199
1328
  *
@@ -1210,7 +1339,7 @@ class TransactionalSMS extends SDKResource {
1210
1339
  * Access Policy Resource: `FHIR:Patient`
1211
1340
  */
1212
1341
  send(params, request) {
1213
- return this.request('/messaging/transactional-sms/send', 'post')(params, request);
1342
+ return this.request('/messaging/transactional-sms/send', 'post', this.baseUrlThunk.bind(this))(params, request);
1214
1343
  }
1215
1344
  }
1216
1345
 
@@ -1219,13 +1348,17 @@ class User extends SDKResource {
1219
1348
  constructor(config) {
1220
1349
  super(config);
1221
1350
  }
1351
+ baseUrlThunk() {
1352
+ var _a, _b;
1353
+ 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';
1354
+ }
1222
1355
  /**
1223
1356
  * 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.
1224
1357
  *
1225
1358
  * Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.
1226
1359
  */
1227
1360
  me(request) {
1228
- return this.request('/user/me', 'get')(request);
1361
+ return this.request('/user/me', 'get', this.baseUrlThunk.bind(this))(request);
1229
1362
  }
1230
1363
  /**
1231
1364
  * 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.
@@ -1234,7 +1367,7 @@ class User extends SDKResource {
1234
1367
  * Access Policy Resource: `App:User`
1235
1368
  */
1236
1369
  get(params, request) {
1237
- return this.request('/user/{id}', 'get')(params, request);
1370
+ return this.request('/user/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);
1238
1371
  }
1239
1372
  /**
1240
1373
  * 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.
@@ -1243,7 +1376,7 @@ class User extends SDKResource {
1243
1376
  * Access Policy Resource: `App:User`
1244
1377
  */
1245
1378
  update(params, request) {
1246
- return this.request('/user/{id}', 'patch')(params, request);
1379
+ return this.request('/user/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);
1247
1380
  }
1248
1381
  /**
1249
1382
  * 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.
@@ -1252,7 +1385,7 @@ class User extends SDKResource {
1252
1385
  * Access Policy Resource: `App:User`
1253
1386
  */
1254
1387
  delete(params, request) {
1255
- return this.request('/user/{id}', 'delete')(params, request);
1388
+ return this.request('/user/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);
1256
1389
  }
1257
1390
  /**
1258
1391
  * 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.
@@ -1261,7 +1394,7 @@ class User extends SDKResource {
1261
1394
  * Access Policy Resource: `App:User`
1262
1395
  */
1263
1396
  invite(params, request) {
1264
- return this.request('/user/invite', 'post')(params, request);
1397
+ return this.request('/user/invite', 'post', this.baseUrlThunk.bind(this))(params, request);
1265
1398
  }
1266
1399
  /**
1267
1400
  * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.
@@ -1272,7 +1405,7 @@ class User extends SDKResource {
1272
1405
  * Access Policy Resource: `App:User`
1273
1406
  */
1274
1407
  list(request) {
1275
- return this.request('/user', 'get')(request);
1408
+ return this.request('/user', 'get', this.baseUrlThunk.bind(this))(request);
1276
1409
  }
1277
1410
  /**
1278
1411
  * 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.
@@ -1281,7 +1414,7 @@ class User extends SDKResource {
1281
1414
  * Access Policy Resource: `Project:Settings`
1282
1415
  */
1283
1416
  listV2(params, request) {
1284
- return this.request('/user/v2/list', 'get')(params, request);
1417
+ return this.request('/user/v2/list', 'get', this.baseUrlThunk.bind(this))(params, request);
1285
1418
  }
1286
1419
  }
1287
1420
 
@@ -1290,14 +1423,22 @@ class Version extends SDKResource {
1290
1423
  constructor(config) {
1291
1424
  super(config);
1292
1425
  }
1426
+ baseUrlThunk() {
1427
+ var _a, _b;
1428
+ 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';
1429
+ }
1293
1430
  /**
1294
1431
  * Get project API version. This endpoint is public so there are no access policy requirements.
1295
1432
  */
1296
1433
  get(request) {
1297
- return this.request('/version', 'get')(request);
1434
+ return this.request('/version', 'get', this.baseUrlThunk.bind(this))(request);
1298
1435
  }
1299
1436
  }
1300
1437
 
1438
+ function baseUrlThunk$1() {
1439
+ var _a, _b;
1440
+ 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';
1441
+ }
1301
1442
  /**
1302
1443
  * Uploads a file to the bucket and key. Files should be Blobs.
1303
1444
  *
@@ -1305,7 +1446,7 @@ class Version extends SDKResource {
1305
1446
  */
1306
1447
  function uploadFile$1({ bucketName, 'objectPath+': key, file, }) {
1307
1448
  return __awaiter(this, void 0, void 0, function* () {
1308
- const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post')({
1449
+ const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk$1.bind(this))({
1309
1450
  action: 'upload',
1310
1451
  bucketName,
1311
1452
  'objectPath+': key,
@@ -1323,7 +1464,7 @@ function uploadFile$1({ bucketName, 'objectPath+': key, file, }) {
1323
1464
  */
1324
1465
  function downloadFile({ bucketName, 'objectPath+': key, }) {
1325
1466
  return __awaiter(this, void 0, void 0, function* () {
1326
- const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post')({
1467
+ const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk$1.bind(this))({
1327
1468
  action: 'download',
1328
1469
  bucketName,
1329
1470
  'objectPath+': key,
@@ -1345,7 +1486,7 @@ function downloadFile({ bucketName, 'objectPath+': key, }) {
1345
1486
  * @param params url and action
1346
1487
  */
1347
1488
  function getPresignedUrlForZ3Url(params) {
1348
- var _a;
1489
+ var _a, _b;
1349
1490
  return __awaiter(this, void 0, void 0, function* () {
1350
1491
  let bucket;
1351
1492
  let key;
@@ -1356,7 +1497,7 @@ function getPresignedUrlForZ3Url(params) {
1356
1497
  bucket = url.hostname;
1357
1498
  key = z3PathParts.join('/');
1358
1499
  }
1359
- else if (url.href.startsWith((_a = this.config.projectApiUrl) !== null && _a !== void 0 ? _a : defaultProjectApiUrl)) {
1500
+ else if (url.href.startsWith((_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : defaultProjectApiUrl)) {
1360
1501
  // remove leading `/v1/z3`
1361
1502
  const httpsPathParts = url.pathname.split('/').slice(3);
1362
1503
  bucket = httpsPathParts[0];
@@ -1370,7 +1511,7 @@ function getPresignedUrlForZ3Url(params) {
1370
1511
  bucketName: bucket,
1371
1512
  'objectPath+': key,
1372
1513
  };
1373
- return this.request('/z3/{bucketName}/{objectPath+}', 'post')(requestParams);
1514
+ return this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk$1.bind(this))(requestParams);
1374
1515
  });
1375
1516
  }
1376
1517
 
@@ -1396,6 +1537,10 @@ class Z3 extends SDKResource {
1396
1537
  */
1397
1538
  this.getPresignedUrlForZ3Url = getPresignedUrlForZ3Url;
1398
1539
  }
1540
+ baseUrlThunk() {
1541
+ var _a, _b;
1542
+ 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';
1543
+ }
1399
1544
  /**
1400
1545
  * List all Z3 Buckets. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
1401
1546
  *
@@ -1403,7 +1548,7 @@ class Z3 extends SDKResource {
1403
1548
  * Access Policy Resource: `Z3:BucketName`
1404
1549
  */
1405
1550
  listBuckets(request) {
1406
- return this.request('/z3', 'get')(request);
1551
+ return this.request('/z3', 'get', this.baseUrlThunk.bind(this))(request);
1407
1552
  }
1408
1553
  /**
1409
1554
  * 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.
@@ -1412,7 +1557,7 @@ class Z3 extends SDKResource {
1412
1557
  * Access Policy Resource: `Z3:BucketName`
1413
1558
  */
1414
1559
  createBucket(params, request) {
1415
- return this.request('/z3/{bucketName}', 'put')(params, request);
1560
+ return this.request('/z3/{bucketName}', 'put', this.baseUrlThunk.bind(this))(params, request);
1416
1561
  }
1417
1562
  /**
1418
1563
  * 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.
@@ -1421,7 +1566,7 @@ class Z3 extends SDKResource {
1421
1566
  * Access Policy Resource: `Z3:BucketName`
1422
1567
  */
1423
1568
  deleteBucket(params, request) {
1424
- return this.request('/z3/{bucketName}', 'delete')(params, request);
1569
+ return this.request('/z3/{bucketName}', 'delete', this.baseUrlThunk.bind(this))(params, request);
1425
1570
  }
1426
1571
  /**
1427
1572
  * 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.
@@ -1430,7 +1575,7 @@ class Z3 extends SDKResource {
1430
1575
  * Access Policy Resource: `Z3:BucketName:ObjectPath`
1431
1576
  */
1432
1577
  listObjects(params, request) {
1433
- return this.request('/z3/{bucketName}/{objectPath+}', 'get')(params, request);
1578
+ return this.request('/z3/{bucketName}/{objectPath+}', 'get', this.baseUrlThunk.bind(this))(params, request);
1434
1579
  }
1435
1580
  /**
1436
1581
  * 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.
@@ -1439,7 +1584,7 @@ class Z3 extends SDKResource {
1439
1584
  * Access Policy Resource: `Z3:BucketName:ObjectPath`
1440
1585
  */
1441
1586
  getPresignedUrl(params, request) {
1442
- return this.request('/z3/{bucketName}/{objectPath+}', 'post')(params, request);
1587
+ return this.request('/z3/{bucketName}/{objectPath+}', 'post', this.baseUrlThunk.bind(this))(params, request);
1443
1588
  }
1444
1589
  /**
1445
1590
  * 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.
@@ -1448,13 +1593,17 @@ class Z3 extends SDKResource {
1448
1593
  * Access Policy Resource: `Z3:BucketName:ObjectPath`
1449
1594
  */
1450
1595
  deleteObject(params, request) {
1451
- return this.request('/z3/{bucketName}/{objectPath+}', 'delete')(params, request);
1596
+ return this.request('/z3/{bucketName}/{objectPath+}', 'delete', this.baseUrlThunk.bind(this))(params, request);
1452
1597
  }
1453
1598
  }
1454
1599
 
1600
+ function baseUrlThunk() {
1601
+ var _a, _b;
1602
+ 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';
1603
+ }
1455
1604
  function uploadFile({ id, file, filename, }) {
1456
1605
  return __awaiter(this, void 0, void 0, function* () {
1457
- const uploadUrl = yield this.request('/zambda/{id}/s3-upload', 'post')({ id, filename });
1606
+ const uploadUrl = yield this.request('/zambda/{id}/s3-upload', 'post', baseUrlThunk.bind(this))({ id, filename });
1458
1607
  yield fetch(uploadUrl.signedUrl, {
1459
1608
  method: 'PUT',
1460
1609
  body: file,
@@ -1468,6 +1617,10 @@ class Zambda extends SDKResource {
1468
1617
  super(config);
1469
1618
  this.uploadFile = uploadFile;
1470
1619
  }
1620
+ baseUrlThunk() {
1621
+ var _a, _b;
1622
+ 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';
1623
+ }
1471
1624
  /**
1472
1625
  * 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.
1473
1626
  *
@@ -1475,7 +1628,7 @@ class Zambda extends SDKResource {
1475
1628
  * Access Policy Resource: `Zambda:Function`
1476
1629
  */
1477
1630
  list(request) {
1478
- return this.request('/zambda', 'get')(request);
1631
+ return this.request('/zambda', 'get', this.baseUrlThunk.bind(this))(request);
1479
1632
  }
1480
1633
  /**
1481
1634
  * 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.
@@ -1484,7 +1637,7 @@ class Zambda extends SDKResource {
1484
1637
  * Access Policy Resource: `Zambda:Function`
1485
1638
  */
1486
1639
  create(params, request) {
1487
- return this.request('/zambda', 'post')(params, request);
1640
+ return this.request('/zambda', 'post', this.baseUrlThunk.bind(this))(params, request);
1488
1641
  }
1489
1642
  /**
1490
1643
  * 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.
@@ -1493,7 +1646,7 @@ class Zambda extends SDKResource {
1493
1646
  * Access Policy Resource: `Zambda:Function`
1494
1647
  */
1495
1648
  get(params, request) {
1496
- return this.request('/zambda/{id}', 'get')(params, request);
1649
+ return this.request('/zambda/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);
1497
1650
  }
1498
1651
  /**
1499
1652
  * 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.
@@ -1502,7 +1655,7 @@ class Zambda extends SDKResource {
1502
1655
  * Access Policy Resource: `Zambda:Function`
1503
1656
  */
1504
1657
  update(params, request) {
1505
- return this.request('/zambda/{id}', 'patch')(params, request);
1658
+ return this.request('/zambda/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);
1506
1659
  }
1507
1660
  /**
1508
1661
  * 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.
@@ -1511,7 +1664,7 @@ class Zambda extends SDKResource {
1511
1664
  * Access Policy Resource: `Zambda:Function`
1512
1665
  */
1513
1666
  delete(params, request) {
1514
- return this.request('/zambda/{id}', 'delete')(params, request);
1667
+ return this.request('/zambda/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);
1515
1668
  }
1516
1669
  /**
1517
1670
  * 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.
@@ -1520,7 +1673,7 @@ class Zambda extends SDKResource {
1520
1673
  * Access Policy Resource: `Zambda:Function`
1521
1674
  */
1522
1675
  execute(params, request) {
1523
- return this.request('/zambda/{id}/execute', 'post')(params, request);
1676
+ return this.request('/zambda/{id}/execute', 'post', this.baseUrlThunk.bind(this))(params, request);
1524
1677
  }
1525
1678
  /**
1526
1679
  * 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.
@@ -1528,7 +1681,7 @@ class Zambda extends SDKResource {
1528
1681
  * Execute a zambda that has method http_open. This endpoint is public so there are no access policy requirements.
1529
1682
  */
1530
1683
  executePublic(params, request) {
1531
- return this.request('/zambda/{id}/execute-public', 'post')(params, request);
1684
+ return this.request('/zambda/{id}/execute-public', 'post', this.baseUrlThunk.bind(this))(params, request);
1532
1685
  }
1533
1686
  /**
1534
1687
  * 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.
@@ -1537,7 +1690,7 @@ class Zambda extends SDKResource {
1537
1690
  * Access Policy Resource: `Zambda:Function`
1538
1691
  */
1539
1692
  s3Upload(params, request) {
1540
- return this.request('/zambda/{id}/s3-upload', 'post')(params, request);
1693
+ return this.request('/zambda/{id}/s3-upload', 'post', this.baseUrlThunk.bind(this))(params, request);
1541
1694
  }
1542
1695
  }
1543
1696
 
@@ -1546,6 +1699,10 @@ class ZambdaLogStream extends SDKResource {
1546
1699
  constructor(config) {
1547
1700
  super(config);
1548
1701
  }
1702
+ baseUrlThunk() {
1703
+ var _a, _b;
1704
+ 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';
1705
+ }
1549
1706
  /**
1550
1707
  * 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.
1551
1708
  *
@@ -1553,7 +1710,7 @@ class ZambdaLogStream extends SDKResource {
1553
1710
  * Access Policy Resource: `Zambda:Function`
1554
1711
  */
1555
1712
  list(params, request) {
1556
- return this.request('/zambda/{id}/logStream', 'post')(params, request);
1713
+ return this.request('/zambda/{id}/logStream', 'post', this.baseUrlThunk.bind(this))(params, request);
1557
1714
  }
1558
1715
  /**
1559
1716
  * 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.
@@ -1562,7 +1719,7 @@ class ZambdaLogStream extends SDKResource {
1562
1719
  * Access Policy Resource: `Zambda:Function`
1563
1720
  */
1564
1721
  search(params, request) {
1565
- return this.request('/zambda/{id}/logStream/search', 'post')(params, request);
1722
+ return this.request('/zambda/{id}/logStream/search', 'post', this.baseUrlThunk.bind(this))(params, request);
1566
1723
  }
1567
1724
  /**
1568
1725
  * 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.
@@ -1571,14 +1728,19 @@ class ZambdaLogStream extends SDKResource {
1571
1728
  * Access Policy Resource: `Zambda:Function`
1572
1729
  */
1573
1730
  get(params, request) {
1574
- return this.request('/zambda/{id}/logStream/{logStreamName}', 'post')(params, request);
1731
+ return this.request('/zambda/{id}/logStream/{logStreamName}', 'post', this.baseUrlThunk.bind(this))(params, request);
1575
1732
  }
1576
1733
  }
1577
1734
 
1578
1735
  // AUTOGENERATED -- DO NOT EDIT
1579
1736
  let Oystehr$1 = class Oystehr {
1580
1737
  constructor(config) {
1738
+ var _a, _b, _c;
1739
+ var _d, _e, _f;
1581
1740
  this.config = config;
1741
+ (_a = (_d = this.config).services) !== null && _a !== void 0 ? _a : (_d.services = {});
1742
+ (_b = (_e = this.config.services).projectApiUrl) !== null && _b !== void 0 ? _b : (_e.projectApiUrl = config.projectApiUrl);
1743
+ (_c = (_f = this.config.services).fhirApiUrl) !== null && _c !== void 0 ? _c : (_f.fhirApiUrl = config.fhirApiUrl);
1582
1744
  this.application = new Application(config);
1583
1745
  this.developer = new Developer(config);
1584
1746
  this.m2m = new M2m(config);
@@ -1598,6 +1760,7 @@ let Oystehr$1 = class Oystehr {
1598
1760
  this.z3 = new Z3(config);
1599
1761
  this.zambda = new Zambda(config);
1600
1762
  this.zambdaLogStream = new ZambdaLogStream(config);
1763
+ this.fax = new Fax(config);
1601
1764
  this.fhir = new Fhir(config);
1602
1765
  }
1603
1766
  };