phenoml 5.3.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/cjs/BaseClient.d.ts +2 -0
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/agent/client/Client.js +16 -8
  4. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +14 -7
  5. package/dist/cjs/api/resources/agent/types/ChatMessageTemplate.d.ts +0 -2
  6. package/dist/cjs/api/resources/agent/types/ChatSessionTemplate.d.ts +0 -2
  7. package/dist/cjs/api/resources/cohort/client/Client.js +2 -1
  8. package/dist/cjs/api/resources/construe/client/Client.d.ts +7 -8
  9. package/dist/cjs/api/resources/construe/client/Client.js +33 -22
  10. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +55 -0
  11. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.js +12 -0
  12. package/dist/cjs/api/resources/construe/client/requests/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/construe/errors/GatewayTimeoutError.d.ts +5 -0
  14. package/dist/cjs/api/resources/construe/errors/GatewayTimeoutError.js +50 -0
  15. package/dist/cjs/api/resources/construe/errors/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/construe/errors/index.js +1 -0
  17. package/dist/cjs/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.ts +2 -0
  18. package/dist/cjs/api/resources/construe/types/ExtractedCodeResult.d.ts +1 -3
  19. package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.d.ts +4 -4
  20. package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.js +2 -2
  21. package/dist/cjs/api/resources/construe/types/index.d.ts +0 -3
  22. package/dist/cjs/api/resources/construe/types/index.js +0 -3
  23. package/dist/cjs/api/resources/fhir/client/Client.js +12 -6
  24. package/dist/cjs/api/resources/fhirProvider/client/Client.js +14 -7
  25. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +0 -2
  26. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +10 -5
  27. package/dist/cjs/api/resources/summary/client/Client.js +12 -6
  28. package/dist/cjs/api/resources/summary/types/SummaryTemplate.d.ts +0 -1
  29. package/dist/cjs/api/resources/tools/client/Client.js +8 -4
  30. package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +8 -4
  31. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +8 -4
  32. package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +0 -2
  33. package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +0 -2
  34. package/dist/cjs/api/resources/workflows/client/Client.js +12 -6
  35. package/dist/cjs/api/resources/workflows/types/WorkflowDefinition.d.ts +0 -2
  36. package/dist/cjs/api/resources/workflows/types/WorkflowResponse.d.ts +0 -2
  37. package/dist/cjs/core/fetcher/Fetcher.d.ts +2 -1
  38. package/dist/cjs/core/fetcher/Fetcher.js +4 -4
  39. package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
  40. package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
  41. package/dist/cjs/core/headers.js +6 -4
  42. package/dist/cjs/version.d.ts +1 -1
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/esm/BaseClient.d.mts +2 -0
  45. package/dist/esm/Client.mjs +2 -2
  46. package/dist/esm/api/resources/agent/client/Client.mjs +16 -8
  47. package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +14 -7
  48. package/dist/esm/api/resources/agent/types/ChatMessageTemplate.d.mts +0 -2
  49. package/dist/esm/api/resources/agent/types/ChatSessionTemplate.d.mts +0 -2
  50. package/dist/esm/api/resources/cohort/client/Client.mjs +2 -1
  51. package/dist/esm/api/resources/construe/client/Client.d.mts +7 -8
  52. package/dist/esm/api/resources/construe/client/Client.mjs +33 -22
  53. package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +55 -0
  54. package/dist/esm/api/resources/construe/client/requests/UploadRequest.mjs +9 -0
  55. package/dist/esm/api/resources/construe/client/requests/index.d.mts +1 -0
  56. package/dist/esm/api/resources/construe/errors/GatewayTimeoutError.d.mts +5 -0
  57. package/dist/esm/api/resources/construe/errors/GatewayTimeoutError.mjs +13 -0
  58. package/dist/esm/api/resources/construe/errors/index.d.mts +1 -0
  59. package/dist/esm/api/resources/construe/errors/index.mjs +1 -0
  60. package/dist/esm/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.mts +2 -0
  61. package/dist/esm/api/resources/construe/types/ExtractedCodeResult.d.mts +1 -3
  62. package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.d.mts +4 -4
  63. package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.mjs +2 -2
  64. package/dist/esm/api/resources/construe/types/index.d.mts +0 -3
  65. package/dist/esm/api/resources/construe/types/index.mjs +0 -3
  66. package/dist/esm/api/resources/fhir/client/Client.mjs +12 -6
  67. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +14 -7
  68. package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +0 -2
  69. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +10 -5
  70. package/dist/esm/api/resources/summary/client/Client.mjs +12 -6
  71. package/dist/esm/api/resources/summary/types/SummaryTemplate.d.mts +0 -1
  72. package/dist/esm/api/resources/tools/client/Client.mjs +8 -4
  73. package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +8 -4
  74. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +8 -4
  75. package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +0 -2
  76. package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +0 -2
  77. package/dist/esm/api/resources/workflows/client/Client.mjs +12 -6
  78. package/dist/esm/api/resources/workflows/types/WorkflowDefinition.d.mts +0 -2
  79. package/dist/esm/api/resources/workflows/types/WorkflowResponse.d.mts +0 -2
  80. package/dist/esm/core/fetcher/Fetcher.d.mts +2 -1
  81. package/dist/esm/core/fetcher/Fetcher.mjs +4 -4
  82. package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
  83. package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
  84. package/dist/esm/core/headers.mjs +6 -4
  85. package/dist/esm/version.d.mts +1 -1
  86. package/dist/esm/version.mjs +1 -1
  87. package/package.json +2 -2
  88. package/reference.md +6 -8
  89. package/dist/cjs/api/resources/construe/types/UploadRequest.d.ts +0 -10
  90. package/dist/cjs/api/resources/construe/types/UploadRequest.js +0 -3
  91. package/dist/cjs/api/resources/construe/types/UploadRequestCsv.d.ts +0 -32
  92. package/dist/cjs/api/resources/construe/types/UploadRequestCsv.js +0 -3
  93. package/dist/cjs/api/resources/construe/types/UploadRequestJson.d.ts +0 -40
  94. package/dist/cjs/api/resources/construe/types/UploadRequestJson.js +0 -3
  95. package/dist/esm/api/resources/construe/types/UploadRequest.d.mts +0 -10
  96. package/dist/esm/api/resources/construe/types/UploadRequest.mjs +0 -2
  97. package/dist/esm/api/resources/construe/types/UploadRequestCsv.d.mts +0 -32
  98. package/dist/esm/api/resources/construe/types/UploadRequestCsv.mjs +0 -2
  99. package/dist/esm/api/resources/construe/types/UploadRequestJson.d.mts +0 -40
  100. package/dist/esm/api/resources/construe/types/UploadRequestJson.mjs +0 -2
@@ -56,7 +56,7 @@ export class Agent {
56
56
  }
57
57
  __create(request, requestOptions) {
58
58
  return __awaiter(this, void 0, void 0, function* () {
59
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
59
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
60
60
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
61
61
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
62
62
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/create"),
@@ -69,6 +69,7 @@ export class Agent {
69
69
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
70
70
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
71
71
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
72
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
72
73
  });
73
74
  if (_response.ok) {
74
75
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -128,7 +129,7 @@ export class Agent {
128
129
  }
129
130
  __list() {
130
131
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
131
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
132
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
132
133
  const { tags } = request;
133
134
  const _queryParams = {};
134
135
  if (tags != null) {
@@ -143,6 +144,7 @@ export class Agent {
143
144
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
144
145
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
145
146
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
147
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
146
148
  });
147
149
  if (_response.ok) {
148
150
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -199,7 +201,7 @@ export class Agent {
199
201
  }
200
202
  __get(id, requestOptions) {
201
203
  return __awaiter(this, void 0, void 0, function* () {
202
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
204
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
203
205
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
204
206
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
205
207
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
@@ -209,6 +211,7 @@ export class Agent {
209
211
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
210
212
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
211
213
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
214
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
212
215
  });
213
216
  if (_response.ok) {
214
217
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -273,7 +276,7 @@ export class Agent {
273
276
  }
274
277
  __update(id, request, requestOptions) {
275
278
  return __awaiter(this, void 0, void 0, function* () {
276
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
279
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
277
280
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
278
281
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
279
282
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
@@ -286,6 +289,7 @@ export class Agent {
286
289
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
287
290
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
288
291
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
292
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
289
293
  });
290
294
  if (_response.ok) {
291
295
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -346,7 +350,7 @@ export class Agent {
346
350
  }
347
351
  __delete(id, requestOptions) {
348
352
  return __awaiter(this, void 0, void 0, function* () {
349
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
353
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
350
354
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
351
355
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
352
356
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
@@ -356,6 +360,7 @@ export class Agent {
356
360
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
357
361
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
358
362
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
363
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
359
364
  });
360
365
  if (_response.ok) {
361
366
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -427,7 +432,7 @@ export class Agent {
427
432
  }
428
433
  __patch(id, request, requestOptions) {
429
434
  return __awaiter(this, void 0, void 0, function* () {
430
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
435
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
431
436
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
432
437
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
433
438
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/${core.url.encodePathParam(id)}`),
@@ -440,6 +445,7 @@ export class Agent {
440
445
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
441
446
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
442
447
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
448
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
443
449
  });
444
450
  if (_response.ok) {
445
451
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -505,7 +511,7 @@ export class Agent {
505
511
  }
506
512
  __chat(request, requestOptions) {
507
513
  return __awaiter(this, void 0, void 0, function* () {
508
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
514
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
509
515
  const { "X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf, "X-Phenoml-Fhir-Provider": phenomlFhirProvider } = request, _body = __rest(request, ["X-Phenoml-On-Behalf-Of", "X-Phenoml-Fhir-Provider"]);
510
516
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
511
517
  Authorization: yield this._getAuthorizationHeader(),
@@ -523,6 +529,7 @@ export class Agent {
523
529
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
524
530
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
525
531
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
532
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
526
533
  });
527
534
  if (_response.ok) {
528
535
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -585,7 +592,7 @@ export class Agent {
585
592
  }
586
593
  __getChatMessages(request, requestOptions) {
587
594
  return __awaiter(this, void 0, void 0, function* () {
588
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
595
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
589
596
  const { chat_session_id: chatSessionId, num_messages: numMessages, role, order } = request;
590
597
  const _queryParams = {};
591
598
  _queryParams.chat_session_id = chatSessionId;
@@ -607,6 +614,7 @@ export class Agent {
607
614
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
608
615
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
609
616
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
617
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
610
618
  });
611
619
  if (_response.ok) {
612
620
  return {
@@ -39,7 +39,7 @@ export class Prompts {
39
39
  }
40
40
  __create(request, requestOptions) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
42
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
43
43
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
44
44
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
45
45
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/prompts"),
@@ -52,6 +52,7 @@ export class Prompts {
52
52
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
53
53
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
54
54
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
55
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
55
56
  });
56
57
  if (_response.ok) {
57
58
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -108,7 +109,7 @@ export class Prompts {
108
109
  }
109
110
  __list(requestOptions) {
110
111
  return __awaiter(this, void 0, void 0, function* () {
111
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
112
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
112
113
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
113
114
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
114
115
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/prompts/list"),
@@ -118,6 +119,7 @@ export class Prompts {
118
119
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
119
120
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
120
121
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
122
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
121
123
  });
122
124
  if (_response.ok) {
123
125
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -174,7 +176,7 @@ export class Prompts {
174
176
  }
175
177
  __get(id, requestOptions) {
176
178
  return __awaiter(this, void 0, void 0, function* () {
177
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
179
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
178
180
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
179
181
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
180
182
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/prompts/${core.url.encodePathParam(id)}`),
@@ -184,6 +186,7 @@ export class Prompts {
184
186
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
185
187
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
186
188
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
189
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
187
190
  });
188
191
  if (_response.ok) {
189
192
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -244,7 +247,7 @@ export class Prompts {
244
247
  }
245
248
  __update(id_1) {
246
249
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
247
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
250
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
248
251
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
249
252
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
250
253
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/prompts/${core.url.encodePathParam(id)}`),
@@ -257,6 +260,7 @@ export class Prompts {
257
260
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
258
261
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
259
262
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
263
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
260
264
  });
261
265
  if (_response.ok) {
262
266
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -317,7 +321,7 @@ export class Prompts {
317
321
  }
318
322
  __delete(id, requestOptions) {
319
323
  return __awaiter(this, void 0, void 0, function* () {
320
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
324
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
321
325
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
322
326
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
323
327
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/prompts/${core.url.encodePathParam(id)}`),
@@ -327,6 +331,7 @@ export class Prompts {
327
331
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
328
332
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
329
333
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
334
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
330
335
  });
331
336
  if (_response.ok) {
332
337
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -398,7 +403,7 @@ export class Prompts {
398
403
  }
399
404
  __patch(id, request, requestOptions) {
400
405
  return __awaiter(this, void 0, void 0, function* () {
401
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
406
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
402
407
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
403
408
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
404
409
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `agent/prompts/${core.url.encodePathParam(id)}`),
@@ -411,6 +416,7 @@ export class Prompts {
411
416
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
412
417
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
413
418
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
419
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
414
420
  });
415
421
  if (_response.ok) {
416
422
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -469,7 +475,7 @@ export class Prompts {
469
475
  }
470
476
  __loadDefaults(requestOptions) {
471
477
  return __awaiter(this, void 0, void 0, function* () {
472
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
478
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
473
479
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
474
480
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
475
481
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "agent/prompts/load-defaults"),
@@ -479,6 +485,7 @@ export class Prompts {
479
485
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
480
486
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
481
487
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
488
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
482
489
  });
483
490
  if (_response.ok) {
484
491
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -17,8 +17,6 @@ export interface ChatMessageTemplate {
17
17
  created?: string;
18
18
  /** Message updated time */
19
19
  updated?: string;
20
- /** User ID */
21
- user_id?: string;
22
20
  /** Function name */
23
21
  function_name?: string;
24
22
  /** Function arguments */
@@ -1,8 +1,6 @@
1
1
  export interface ChatSessionTemplate {
2
2
  /** Chat session ID */
3
3
  id?: string;
4
- /** User ID */
5
- user_id?: string;
6
4
  /** Chat session ID */
7
5
  session_id?: string;
8
6
  /** Chat session status */
@@ -37,7 +37,7 @@ export class Cohort {
37
37
  }
38
38
  __analyze(request, requestOptions) {
39
39
  return __awaiter(this, void 0, void 0, function* () {
40
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
41
41
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
42
42
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
43
43
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "cohort"),
@@ -50,6 +50,7 @@ export class Cohort {
50
50
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
51
51
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
52
52
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
53
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
53
54
  });
54
55
  if (_response.ok) {
55
56
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -12,8 +12,9 @@ export declare class Construe {
12
12
  constructor(_options: Construe.Options);
13
13
  /**
14
14
  * Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
15
- * Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
16
- * subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
15
+ * Returns 202 immediately; embedding generation runs asynchronously. Poll
16
+ * GET /construe/codes/systems/{codesystem}?version={version} to check when status
17
+ * transitions from "processing" to "ready" or "failed".
17
18
  *
18
19
  * @param {phenoml.construe.UploadRequest} request
19
20
  * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
@@ -27,12 +28,9 @@ export declare class Construe {
27
28
  *
28
29
  * @example
29
30
  * await client.construe.uploadCodeSystem({
30
- * format: "csv",
31
31
  * name: "CUSTOM_CODES",
32
32
  * version: "1.0",
33
- * file: "file",
34
- * code_col: "code",
35
- * desc_col: "description"
33
+ * format: "csv"
36
34
  * })
37
35
  */
38
36
  uploadCodeSystem(request: phenoml.construe.UploadRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ConstrueUploadCodeSystemResponse>;
@@ -47,8 +45,10 @@ export declare class Construe {
47
45
  *
48
46
  * @throws {@link phenoml.construe.BadRequestError}
49
47
  * @throws {@link phenoml.construe.UnauthorizedError}
50
- * @throws {@link phenoml.construe.FailedDependencyError}
48
+ * @throws {@link phenoml.construe.NotFoundError}
51
49
  * @throws {@link phenoml.construe.InternalServerError}
50
+ * @throws {@link phenoml.construe.ServiceUnavailableError}
51
+ * @throws {@link phenoml.construe.GatewayTimeoutError}
52
52
  *
53
53
  * @example
54
54
  * await client.construe.extractCodes({
@@ -253,7 +253,6 @@ export declare class Construe {
253
253
  * @throws {@link phenoml.construe.NotFoundError}
254
254
  * @throws {@link phenoml.construe.InternalServerError}
255
255
  * @throws {@link phenoml.construe.NotImplementedError}
256
- * @throws {@link phenoml.construe.ServiceUnavailableError}
257
256
  *
258
257
  * @example
259
258
  * await client.construe.terminologyServerTextSearch("ICD-10-CM", {
@@ -19,8 +19,9 @@ export class Construe {
19
19
  }
20
20
  /**
21
21
  * Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
22
- * Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
23
- * subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
22
+ * Returns 202 immediately; embedding generation runs asynchronously. Poll
23
+ * GET /construe/codes/systems/{codesystem}?version={version} to check when status
24
+ * transitions from "processing" to "ready" or "failed".
24
25
  *
25
26
  * @param {phenoml.construe.UploadRequest} request
26
27
  * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
@@ -34,12 +35,9 @@ export class Construe {
34
35
  *
35
36
  * @example
36
37
  * await client.construe.uploadCodeSystem({
37
- * format: "csv",
38
38
  * name: "CUSTOM_CODES",
39
39
  * version: "1.0",
40
- * file: "file",
41
- * code_col: "code",
42
- * desc_col: "description"
40
+ * format: "csv"
43
41
  * })
44
42
  */
45
43
  uploadCodeSystem(request, requestOptions) {
@@ -47,7 +45,7 @@ export class Construe {
47
45
  }
48
46
  __uploadCodeSystem(request, requestOptions) {
49
47
  return __awaiter(this, void 0, void 0, function* () {
50
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
51
49
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
52
50
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
53
51
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/upload"),
@@ -60,6 +58,7 @@ export class Construe {
60
58
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
61
59
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
62
60
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
61
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
63
62
  });
64
63
  if (_response.ok) {
65
64
  return {
@@ -116,8 +115,10 @@ export class Construe {
116
115
  *
117
116
  * @throws {@link phenoml.construe.BadRequestError}
118
117
  * @throws {@link phenoml.construe.UnauthorizedError}
119
- * @throws {@link phenoml.construe.FailedDependencyError}
118
+ * @throws {@link phenoml.construe.NotFoundError}
120
119
  * @throws {@link phenoml.construe.InternalServerError}
120
+ * @throws {@link phenoml.construe.ServiceUnavailableError}
121
+ * @throws {@link phenoml.construe.GatewayTimeoutError}
121
122
  *
122
123
  * @example
123
124
  * await client.construe.extractCodes({
@@ -129,7 +130,7 @@ export class Construe {
129
130
  }
130
131
  __extractCodes(request, requestOptions) {
131
132
  return __awaiter(this, void 0, void 0, function* () {
132
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
133
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
133
134
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
134
135
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
135
136
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/extract"),
@@ -142,6 +143,7 @@ export class Construe {
142
143
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
143
144
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
144
145
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
146
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
145
147
  });
146
148
  if (_response.ok) {
147
149
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -152,10 +154,14 @@ export class Construe {
152
154
  throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
153
155
  case 401:
154
156
  throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
155
- case 424:
156
- throw new phenoml.construe.FailedDependencyError(_response.error.body, _response.rawResponse);
157
+ case 404:
158
+ throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
157
159
  case 500:
158
160
  throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
161
+ case 503:
162
+ throw new phenoml.construe.ServiceUnavailableError(_response.error.body, _response.rawResponse);
163
+ case 504:
164
+ throw new phenoml.construe.GatewayTimeoutError(_response.error.body, _response.rawResponse);
159
165
  default:
160
166
  throw new errors.phenomlError({
161
167
  statusCode: _response.error.statusCode,
@@ -197,7 +203,7 @@ export class Construe {
197
203
  }
198
204
  __listAvailableCodeSystems(requestOptions) {
199
205
  return __awaiter(this, void 0, void 0, function* () {
200
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
206
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
201
207
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
202
208
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
203
209
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/codes/systems"),
@@ -207,6 +213,7 @@ export class Construe {
207
213
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
208
214
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
209
215
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
216
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
210
217
  });
211
218
  if (_response.ok) {
212
219
  return {
@@ -267,7 +274,7 @@ export class Construe {
267
274
  }
268
275
  __getCodeSystemDetail(codesystem_1) {
269
276
  return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
270
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
277
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
271
278
  const { version } = request;
272
279
  const _queryParams = {};
273
280
  if (version != null) {
@@ -282,6 +289,7 @@ export class Construe {
282
289
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
283
290
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
284
291
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
292
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
285
293
  });
286
294
  if (_response.ok) {
287
295
  return {
@@ -348,7 +356,7 @@ export class Construe {
348
356
  }
349
357
  __deleteCustomCodeSystem(codesystem_1) {
350
358
  return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
351
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
359
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
352
360
  const { version } = request;
353
361
  const _queryParams = {};
354
362
  if (version != null) {
@@ -363,6 +371,7 @@ export class Construe {
363
371
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
364
372
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
365
373
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
374
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
366
375
  });
367
376
  if (_response.ok) {
368
377
  return {
@@ -434,7 +443,7 @@ export class Construe {
434
443
  }
435
444
  __exportCustomCodeSystem(codesystem_1) {
436
445
  return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
437
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
446
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
438
447
  const { version } = request;
439
448
  const _queryParams = {};
440
449
  if (version != null) {
@@ -449,6 +458,7 @@ export class Construe {
449
458
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
450
459
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
451
460
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
461
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
452
462
  });
453
463
  if (_response.ok) {
454
464
  return {
@@ -523,7 +533,7 @@ export class Construe {
523
533
  }
524
534
  __listCodesInACodeSystem(codesystem_1) {
525
535
  return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
526
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
536
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
527
537
  const { version, cursor, limit } = request;
528
538
  const _queryParams = {};
529
539
  if (version != null) {
@@ -544,6 +554,7 @@ export class Construe {
544
554
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
545
555
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
546
556
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
557
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
547
558
  });
548
559
  if (_response.ok) {
549
560
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -608,7 +619,7 @@ export class Construe {
608
619
  }
609
620
  __getASpecificCode(codesystem_1, codeId_1) {
610
621
  return __awaiter(this, arguments, void 0, function* (codesystem, codeId, request = {}, requestOptions) {
611
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
622
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
612
623
  const { version } = request;
613
624
  const _queryParams = {};
614
625
  if (version != null) {
@@ -623,6 +634,7 @@ export class Construe {
623
634
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
624
635
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
625
636
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
637
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
626
638
  });
627
639
  if (_response.ok) {
628
640
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -704,7 +716,7 @@ export class Construe {
704
716
  }
705
717
  __semanticSearchEmbeddingBased(codesystem, request, requestOptions) {
706
718
  return __awaiter(this, void 0, void 0, function* () {
707
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
719
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
708
720
  const { text, version, limit } = request;
709
721
  const _queryParams = {};
710
722
  _queryParams.text = text;
@@ -723,6 +735,7 @@ export class Construe {
723
735
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
724
736
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
725
737
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
738
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
726
739
  });
727
740
  if (_response.ok) {
728
741
  return {
@@ -800,7 +813,6 @@ export class Construe {
800
813
  * @throws {@link phenoml.construe.NotFoundError}
801
814
  * @throws {@link phenoml.construe.InternalServerError}
802
815
  * @throws {@link phenoml.construe.NotImplementedError}
803
- * @throws {@link phenoml.construe.ServiceUnavailableError}
804
816
  *
805
817
  * @example
806
818
  * await client.construe.terminologyServerTextSearch("ICD-10-CM", {
@@ -814,7 +826,7 @@ export class Construe {
814
826
  }
815
827
  __terminologyServerTextSearch(codesystem, request, requestOptions) {
816
828
  return __awaiter(this, void 0, void 0, function* () {
817
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
829
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
818
830
  const { q, version, limit } = request;
819
831
  const _queryParams = {};
820
832
  _queryParams.q = q;
@@ -833,6 +845,7 @@ export class Construe {
833
845
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
834
846
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
835
847
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
848
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
836
849
  });
837
850
  if (_response.ok) {
838
851
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -849,8 +862,6 @@ export class Construe {
849
862
  throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
850
863
  case 501:
851
864
  throw new phenoml.construe.NotImplementedError(_response.error.body, _response.rawResponse);
852
- case 503:
853
- throw new phenoml.construe.ServiceUnavailableError(_response.error.body, _response.rawResponse);
854
865
  default:
855
866
  throw new errors.phenomlError({
856
867
  statusCode: _response.error.statusCode,