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
@@ -69,7 +69,7 @@ class Summary {
69
69
  }
70
70
  __listTemplates(requestOptions) {
71
71
  return __awaiter(this, void 0, void 0, function* () {
72
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
72
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
73
73
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
74
74
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
75
75
  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, "fhir2summary/templates"),
@@ -79,6 +79,7 @@ class Summary {
79
79
  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,
80
80
  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,
81
81
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
82
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
82
83
  });
83
84
  if (_response.ok) {
84
85
  return {
@@ -140,7 +141,7 @@ class Summary {
140
141
  }
141
142
  __createTemplate(request, requestOptions) {
142
143
  return __awaiter(this, void 0, void 0, function* () {
143
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
144
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
144
145
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
145
146
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
146
147
  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, "fhir2summary/template"),
@@ -153,6 +154,7 @@ class Summary {
153
154
  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,
154
155
  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,
155
156
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
157
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
156
158
  });
157
159
  if (_response.ok) {
158
160
  return {
@@ -212,7 +214,7 @@ class Summary {
212
214
  }
213
215
  __getTemplate(id, requestOptions) {
214
216
  return __awaiter(this, void 0, void 0, function* () {
215
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
217
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
216
218
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
217
219
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
218
220
  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, `fhir2summary/template/${core.url.encodePathParam(id)}`),
@@ -222,6 +224,7 @@ class Summary {
222
224
  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,
223
225
  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,
224
226
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
227
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
225
228
  });
226
229
  if (_response.ok) {
227
230
  return {
@@ -290,7 +293,7 @@ class Summary {
290
293
  }
291
294
  __updateTemplate(id, request, requestOptions) {
292
295
  return __awaiter(this, void 0, void 0, function* () {
293
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
296
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
294
297
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
295
298
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
296
299
  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, `fhir2summary/template/${core.url.encodePathParam(id)}`),
@@ -303,6 +306,7 @@ class Summary {
303
306
  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,
304
307
  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,
305
308
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
309
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
306
310
  });
307
311
  if (_response.ok) {
308
312
  return {
@@ -366,7 +370,7 @@ class Summary {
366
370
  }
367
371
  __deleteTemplate(id, requestOptions) {
368
372
  return __awaiter(this, void 0, void 0, function* () {
369
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
373
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
370
374
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
371
375
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
372
376
  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, `fhir2summary/template/${core.url.encodePathParam(id)}`),
@@ -376,6 +380,7 @@ class Summary {
376
380
  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,
377
381
  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,
378
382
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
383
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
379
384
  });
380
385
  if (_response.ok) {
381
386
  return {
@@ -445,7 +450,7 @@ class Summary {
445
450
  }
446
451
  __create(request, requestOptions) {
447
452
  return __awaiter(this, void 0, void 0, function* () {
448
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
453
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
449
454
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
450
455
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
451
456
  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, "fhir2summary/create"),
@@ -458,6 +463,7 @@ class Summary {
458
463
  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,
459
464
  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,
460
465
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
466
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
461
467
  });
462
468
  if (_response.ok) {
463
469
  return {
@@ -1,6 +1,5 @@
1
1
  export interface SummaryTemplate {
2
2
  id?: string;
3
- user_id?: string;
4
3
  name?: string;
5
4
  description?: string;
6
5
  /** Template with {{resource.field}} placeholders */
@@ -94,7 +94,7 @@ class Tools {
94
94
  }
95
95
  __createFhirResource(request, requestOptions) {
96
96
  return __awaiter(this, void 0, void 0, function* () {
97
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
97
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
98
98
  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"]);
99
99
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
100
100
  Authorization: yield this._getAuthorizationHeader(),
@@ -112,6 +112,7 @@ class Tools {
112
112
  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,
113
113
  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,
114
114
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
115
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
115
116
  });
116
117
  if (_response.ok) {
117
118
  return {
@@ -185,7 +186,7 @@ class Tools {
185
186
  }
186
187
  __createFhirResourcesMulti(request, requestOptions) {
187
188
  return __awaiter(this, void 0, void 0, function* () {
188
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
189
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
189
190
  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"]);
190
191
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
191
192
  Authorization: yield this._getAuthorizationHeader(),
@@ -203,6 +204,7 @@ class Tools {
203
204
  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,
204
205
  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,
205
206
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
207
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
206
208
  });
207
209
  if (_response.ok) {
208
210
  return {
@@ -271,7 +273,7 @@ class Tools {
271
273
  }
272
274
  __searchFhirResources(request, requestOptions) {
273
275
  return __awaiter(this, void 0, void 0, function* () {
274
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
276
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
275
277
  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"]);
276
278
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
277
279
  Authorization: yield this._getAuthorizationHeader(),
@@ -289,6 +291,7 @@ class Tools {
289
291
  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,
290
292
  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,
291
293
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
294
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
292
295
  });
293
296
  if (_response.ok) {
294
297
  return {
@@ -357,7 +360,7 @@ class Tools {
357
360
  }
358
361
  __analyzeCohort(request, requestOptions) {
359
362
  return __awaiter(this, void 0, void 0, function* () {
360
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
363
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
361
364
  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"]);
362
365
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
363
366
  Authorization: yield this._getAuthorizationHeader(),
@@ -375,6 +378,7 @@ class Tools {
375
378
  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,
376
379
  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,
377
380
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
381
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
378
382
  });
379
383
  if (_response.ok) {
380
384
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -80,7 +80,7 @@ class McpServer {
80
80
  }
81
81
  __create(request, requestOptions) {
82
82
  return __awaiter(this, void 0, void 0, function* () {
83
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
83
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
84
84
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
85
85
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
86
86
  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, "tools/mcp-server/create"),
@@ -93,6 +93,7 @@ class McpServer {
93
93
  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,
94
94
  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,
95
95
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
96
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
96
97
  });
97
98
  if (_response.ok) {
98
99
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -149,7 +150,7 @@ class McpServer {
149
150
  }
150
151
  __list(requestOptions) {
151
152
  return __awaiter(this, void 0, void 0, function* () {
152
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
153
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
153
154
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
154
155
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
155
156
  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, "tools/mcp-server/list"),
@@ -159,6 +160,7 @@ class McpServer {
159
160
  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,
160
161
  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,
161
162
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
163
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
162
164
  });
163
165
  if (_response.ok) {
164
166
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -214,7 +216,7 @@ class McpServer {
214
216
  }
215
217
  __get(mcpServerId, requestOptions) {
216
218
  return __awaiter(this, void 0, void 0, function* () {
217
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
219
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
218
220
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
219
221
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
220
222
  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, `tools/mcp-server/${core.url.encodePathParam(mcpServerId)}`),
@@ -224,6 +226,7 @@ class McpServer {
224
226
  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,
225
227
  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,
226
228
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
229
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
227
230
  });
228
231
  if (_response.ok) {
229
232
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -279,7 +282,7 @@ class McpServer {
279
282
  }
280
283
  __delete(mcpServerId, requestOptions) {
281
284
  return __awaiter(this, void 0, void 0, function* () {
282
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
285
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
283
286
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
284
287
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
285
288
  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, `tools/mcp-server/${core.url.encodePathParam(mcpServerId)}`),
@@ -289,6 +292,7 @@ class McpServer {
289
292
  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,
290
293
  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,
291
294
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
295
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
292
296
  });
293
297
  if (_response.ok) {
294
298
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -71,7 +71,7 @@ class Tools {
71
71
  }
72
72
  __list(mcpServerId, requestOptions) {
73
73
  return __awaiter(this, void 0, void 0, function* () {
74
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
74
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
75
75
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
76
76
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
77
77
  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, `tools/mcp-server/${core.url.encodePathParam(mcpServerId)}/list`),
@@ -81,6 +81,7 @@ class Tools {
81
81
  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,
82
82
  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,
83
83
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
84
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
84
85
  });
85
86
  if (_response.ok) {
86
87
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -136,7 +137,7 @@ class Tools {
136
137
  }
137
138
  __get(mcpServerToolId, requestOptions) {
138
139
  return __awaiter(this, void 0, void 0, function* () {
139
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
140
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
140
141
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
141
142
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
142
143
  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, `tools/mcp-server/tool/${core.url.encodePathParam(mcpServerToolId)}`),
@@ -146,6 +147,7 @@ class Tools {
146
147
  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,
147
148
  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,
148
149
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
150
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
149
151
  });
150
152
  if (_response.ok) {
151
153
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -201,7 +203,7 @@ class Tools {
201
203
  }
202
204
  __delete(mcpServerToolId, requestOptions) {
203
205
  return __awaiter(this, void 0, void 0, function* () {
204
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
206
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
205
207
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
206
208
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
207
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, `tools/mcp-server/tool/${core.url.encodePathParam(mcpServerToolId)}`),
@@ -211,6 +213,7 @@ class Tools {
211
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,
212
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,
213
215
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
216
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
214
217
  });
215
218
  if (_response.ok) {
216
219
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -272,7 +275,7 @@ class Tools {
272
275
  }
273
276
  __call(mcpServerToolId, request, requestOptions) {
274
277
  return __awaiter(this, void 0, void 0, function* () {
275
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
278
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
276
279
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
277
280
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
278
281
  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, `tools/mcp-server/tool/${core.url.encodePathParam(mcpServerToolId)}/call`),
@@ -285,6 +288,7 @@ class Tools {
285
288
  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,
286
289
  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,
287
290
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
291
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
288
292
  });
289
293
  if (_response.ok) {
290
294
  return {
@@ -13,8 +13,6 @@ export declare namespace McpServerResponse {
13
13
  interface Data {
14
14
  /** ID of the MCP server */
15
15
  id?: string;
16
- /** ID of the user who created the MCP server */
17
- user_id?: string;
18
16
  /** Name of the MCP server */
19
17
  name?: string;
20
18
  /** Description of the MCP server */
@@ -13,8 +13,6 @@ export declare namespace McpServerToolResponse {
13
13
  interface Data {
14
14
  /** ID of the MCP server tool */
15
15
  id?: string;
16
- /** ID of the user who created the MCP server tool */
17
- user_id?: string;
18
16
  /** Name of the MCP server tool */
19
17
  name?: string;
20
18
  /** Description of the MCP server tool */
@@ -84,7 +84,7 @@ class Workflows {
84
84
  }
85
85
  __list() {
86
86
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
87
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
87
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
88
88
  const { verbose } = request;
89
89
  const _queryParams = {};
90
90
  if (verbose != null) {
@@ -99,6 +99,7 @@ class Workflows {
99
99
  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,
100
100
  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,
101
101
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
102
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
102
103
  });
103
104
  if (_response.ok) {
104
105
  return {
@@ -168,7 +169,7 @@ class Workflows {
168
169
  }
169
170
  __create(request, requestOptions) {
170
171
  return __awaiter(this, void 0, void 0, function* () {
171
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
172
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
172
173
  const { verbose } = request, _body = __rest(request, ["verbose"]);
173
174
  const _queryParams = {};
174
175
  if (verbose != null) {
@@ -186,6 +187,7 @@ class Workflows {
186
187
  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,
187
188
  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,
188
189
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
190
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
189
191
  });
190
192
  if (_response.ok) {
191
193
  return {
@@ -250,7 +252,7 @@ class Workflows {
250
252
  }
251
253
  __get(id_1) {
252
254
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
253
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
255
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
254
256
  const { verbose } = request;
255
257
  const _queryParams = {};
256
258
  if (verbose != null) {
@@ -265,6 +267,7 @@ class Workflows {
265
267
  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,
266
268
  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,
267
269
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
270
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
268
271
  });
269
272
  if (_response.ok) {
270
273
  return {
@@ -338,7 +341,7 @@ class Workflows {
338
341
  }
339
342
  __update(id, request, requestOptions) {
340
343
  return __awaiter(this, void 0, void 0, function* () {
341
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
344
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
342
345
  const { verbose } = request, _body = __rest(request, ["verbose"]);
343
346
  const _queryParams = {};
344
347
  if (verbose != null) {
@@ -356,6 +359,7 @@ class Workflows {
356
359
  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
360
  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
361
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
362
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
359
363
  });
360
364
  if (_response.ok) {
361
365
  return {
@@ -419,7 +423,7 @@ class Workflows {
419
423
  }
420
424
  __delete(id, requestOptions) {
421
425
  return __awaiter(this, void 0, void 0, function* () {
422
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
426
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
423
427
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
424
428
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
425
429
  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, `workflows/${core.url.encodePathParam(id)}`),
@@ -429,6 +433,7 @@ class Workflows {
429
433
  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,
430
434
  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,
431
435
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
436
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
432
437
  });
433
438
  if (_response.ok) {
434
439
  return {
@@ -499,7 +504,7 @@ class Workflows {
499
504
  }
500
505
  __execute(id, request, requestOptions) {
501
506
  return __awaiter(this, void 0, void 0, function* () {
502
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
507
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
503
508
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
504
509
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
505
510
  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, `workflows/${core.url.encodePathParam(id)}/execute`),
@@ -512,6 +517,7 @@ class Workflows {
512
517
  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,
513
518
  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,
514
519
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
520
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
515
521
  });
516
522
  if (_response.ok) {
517
523
  return {
@@ -2,8 +2,6 @@ import type * as phenoml from "../../../index.js";
2
2
  export interface WorkflowDefinition {
3
3
  /** Unique identifier for the workflow */
4
4
  id?: string;
5
- /** ID of the user who created the workflow */
6
- user_id?: string;
7
5
  /** Human-readable name for the workflow */
8
6
  name?: string;
9
7
  /** Natural language instructions that define the workflow logic */
@@ -5,8 +5,6 @@ import type * as phenoml from "../../../index.js";
5
5
  export interface WorkflowResponse {
6
6
  /** Unique identifier for the workflow */
7
7
  id?: string;
8
- /** ID of the user who created the workflow */
9
- user_id?: string;
10
8
  /** Human-readable name for the workflow */
11
9
  name?: string;
12
10
  /** Natural language instructions that define the workflow logic */
@@ -14,10 +14,11 @@ export declare namespace Fetcher {
14
14
  maxRetries?: number;
15
15
  withCredentials?: boolean;
16
16
  abortSignal?: AbortSignal;
17
- requestType?: "json" | "file" | "bytes";
17
+ requestType?: "json" | "file" | "bytes" | "form" | "other";
18
18
  responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response";
19
19
  duplex?: "half";
20
20
  endpointMetadata?: EndpointMetadata;
21
+ fetchFn?: typeof fetch;
21
22
  }
22
23
  type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
23
24
  interface FailedStatusCodeError {
@@ -47,13 +47,13 @@ function getHeaders(args) {
47
47
  }
48
48
  function fetcherImpl(args) {
49
49
  return __awaiter(this, void 0, void 0, function* () {
50
- var _a;
50
+ var _a, _b, _c;
51
51
  const url = (0, createRequestUrl_js_1.createRequestUrl)(args.url, args.queryParameters);
52
52
  const requestBody = yield (0, getRequestBody_js_1.getRequestBody)({
53
53
  body: args.body,
54
- type: args.requestType === "json" ? "json" : "other",
54
+ type: (_a = args.requestType) !== null && _a !== void 0 ? _a : "other",
55
55
  });
56
- const fetchFn = yield (0, getFetchFn_js_1.getFetchFn)();
56
+ const fetchFn = (_b = args.fetchFn) !== null && _b !== void 0 ? _b : (yield (0, getFetchFn_js_1.getFetchFn)());
57
57
  try {
58
58
  const response = yield (0, requestWithRetries_js_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
59
59
  return (0, makeRequest_js_1.makeRequest)(fetchFn, url, args.method, yield getHeaders(args), requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex);
@@ -79,7 +79,7 @@ function fetcherImpl(args) {
79
79
  }
80
80
  }
81
81
  catch (error) {
82
- if ((_a = args.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {
82
+ if ((_c = args.abortSignal) === null || _c === void 0 ? void 0 : _c.aborted) {
83
83
  return {
84
84
  ok: false,
85
85
  error: {
@@ -1,7 +1,7 @@
1
1
  export declare namespace GetRequestBody {
2
2
  interface Args {
3
3
  body: unknown;
4
- type: "json" | "file" | "bytes" | "other";
4
+ type: "json" | "file" | "bytes" | "form" | "other";
5
5
  }
6
6
  }
7
7
  export declare function getRequestBody({ body, type }: GetRequestBody.Args): Promise<BodyInit | undefined>;
@@ -11,8 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getRequestBody = getRequestBody;
13
13
  const json_js_1 = require("../json.js");
14
+ const qs_js_1 = require("../url/qs.js");
14
15
  function getRequestBody(_a) {
15
16
  return __awaiter(this, arguments, void 0, function* ({ body, type }) {
17
+ if (type === "form") {
18
+ return (0, qs_js_1.toQueryString)(body, { arrayFormat: "repeat", encode: true });
19
+ }
16
20
  if (type.includes("json")) {
17
21
  return (0, json_js_1.toJson)(body);
18
22
  }
@@ -7,11 +7,12 @@ function mergeHeaders(...headersArray) {
7
7
  for (const [key, value] of headersArray
8
8
  .filter((headers) => headers != null)
9
9
  .flatMap((headers) => Object.entries(headers))) {
10
+ const insensitiveKey = key.toLowerCase();
10
11
  if (value != null) {
11
- result[key] = value;
12
+ result[insensitiveKey] = value;
12
13
  }
13
- else if (key in result) {
14
- delete result[key];
14
+ else if (insensitiveKey in result) {
15
+ delete result[insensitiveKey];
15
16
  }
16
17
  }
17
18
  return result;
@@ -21,8 +22,9 @@ function mergeOnlyDefinedHeaders(...headersArray) {
21
22
  for (const [key, value] of headersArray
22
23
  .filter((headers) => headers != null)
23
24
  .flatMap((headers) => Object.entries(headers))) {
25
+ const insensitiveKey = key.toLowerCase();
24
26
  if (value != null) {
25
- result[key] = value;
27
+ result[insensitiveKey] = value;
26
28
  }
27
29
  }
28
30
  return result;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "5.3.0";
1
+ export declare const SDK_VERSION = "6.1.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "5.3.0";
4
+ exports.SDK_VERSION = "6.1.0";
@@ -11,6 +11,8 @@ export interface BaseClientOptions {
11
11
  timeoutInSeconds?: number;
12
12
  /** The default number of times to retry the request. Defaults to 2. */
13
13
  maxRetries?: number;
14
+ /** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
15
+ fetch?: typeof fetch;
14
16
  fetcher?: core.FetchFunction;
15
17
  }
16
18
  export interface BaseRequestOptions {
@@ -16,8 +16,8 @@ export class phenomlClient {
16
16
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
17
17
  "X-Fern-Language": "JavaScript",
18
18
  "X-Fern-SDK-Name": "phenoml",
19
- "X-Fern-SDK-Version": "5.3.0",
20
- "User-Agent": "phenoml/5.3.0",
19
+ "X-Fern-SDK-Version": "6.1.0",
20
+ "User-Agent": "phenoml/6.1.0",
21
21
  "X-Fern-Runtime": core.RUNTIME.type,
22
22
  "X-Fern-Runtime-Version": core.RUNTIME.version,
23
23
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });