phenoml 6.0.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 (44) 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/cohort/client/Client.js +2 -1
  6. package/dist/cjs/api/resources/construe/client/Client.js +20 -10
  7. package/dist/cjs/api/resources/fhir/client/Client.js +12 -6
  8. package/dist/cjs/api/resources/fhirProvider/client/Client.js +14 -7
  9. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +10 -5
  10. package/dist/cjs/api/resources/summary/client/Client.js +12 -6
  11. package/dist/cjs/api/resources/tools/client/Client.js +8 -4
  12. package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +8 -4
  13. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +8 -4
  14. package/dist/cjs/api/resources/workflows/client/Client.js +12 -6
  15. package/dist/cjs/core/fetcher/Fetcher.d.ts +2 -1
  16. package/dist/cjs/core/fetcher/Fetcher.js +4 -4
  17. package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
  18. package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
  19. package/dist/cjs/core/headers.js +6 -4
  20. package/dist/cjs/version.d.ts +1 -1
  21. package/dist/cjs/version.js +1 -1
  22. package/dist/esm/BaseClient.d.mts +2 -0
  23. package/dist/esm/Client.mjs +2 -2
  24. package/dist/esm/api/resources/agent/client/Client.mjs +16 -8
  25. package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +14 -7
  26. package/dist/esm/api/resources/cohort/client/Client.mjs +2 -1
  27. package/dist/esm/api/resources/construe/client/Client.mjs +20 -10
  28. package/dist/esm/api/resources/fhir/client/Client.mjs +12 -6
  29. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +14 -7
  30. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +10 -5
  31. package/dist/esm/api/resources/summary/client/Client.mjs +12 -6
  32. package/dist/esm/api/resources/tools/client/Client.mjs +8 -4
  33. package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +8 -4
  34. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +8 -4
  35. package/dist/esm/api/resources/workflows/client/Client.mjs +12 -6
  36. package/dist/esm/core/fetcher/Fetcher.d.mts +2 -1
  37. package/dist/esm/core/fetcher/Fetcher.mjs +4 -4
  38. package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
  39. package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
  40. package/dist/esm/core/headers.mjs +6 -4
  41. package/dist/esm/version.d.mts +1 -1
  42. package/dist/esm/version.mjs +1 -1
  43. package/package.json +2 -2
  44. package/reference.md +1 -1
@@ -58,7 +58,7 @@ export class Tools {
58
58
  }
59
59
  __createFhirResource(request, requestOptions) {
60
60
  return __awaiter(this, void 0, void 0, function* () {
61
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
61
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
62
62
  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"]);
63
63
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
64
64
  Authorization: yield this._getAuthorizationHeader(),
@@ -76,6 +76,7 @@ export class Tools {
76
76
  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,
77
77
  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,
78
78
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
79
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
79
80
  });
80
81
  if (_response.ok) {
81
82
  return {
@@ -149,7 +150,7 @@ export class Tools {
149
150
  }
150
151
  __createFhirResourcesMulti(request, 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 { "X-Phenoml-On-Behalf-Of": phenomlOnBehalfOf, "X-Phenoml-Fhir-Provider": phenomlFhirProvider } = request, _body = __rest(request, ["X-Phenoml-On-Behalf-Of", "X-Phenoml-Fhir-Provider"]);
154
155
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
155
156
  Authorization: yield this._getAuthorizationHeader(),
@@ -167,6 +168,7 @@ export class Tools {
167
168
  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,
168
169
  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,
169
170
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
171
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
170
172
  });
171
173
  if (_response.ok) {
172
174
  return {
@@ -235,7 +237,7 @@ export class Tools {
235
237
  }
236
238
  __searchFhirResources(request, requestOptions) {
237
239
  return __awaiter(this, void 0, void 0, function* () {
238
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
240
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
239
241
  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"]);
240
242
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
241
243
  Authorization: yield this._getAuthorizationHeader(),
@@ -253,6 +255,7 @@ export class Tools {
253
255
  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,
254
256
  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,
255
257
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
258
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
256
259
  });
257
260
  if (_response.ok) {
258
261
  return {
@@ -321,7 +324,7 @@ export class Tools {
321
324
  }
322
325
  __analyzeCohort(request, requestOptions) {
323
326
  return __awaiter(this, void 0, void 0, function* () {
324
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
327
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
325
328
  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"]);
326
329
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
327
330
  Authorization: yield this._getAuthorizationHeader(),
@@ -339,6 +342,7 @@ export class Tools {
339
342
  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,
340
343
  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,
341
344
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
345
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
342
346
  });
343
347
  if (_response.ok) {
344
348
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -44,7 +44,7 @@ export class McpServer {
44
44
  }
45
45
  __create(request, requestOptions) {
46
46
  return __awaiter(this, void 0, void 0, function* () {
47
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48
48
  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);
49
49
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
50
50
  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"),
@@ -57,6 +57,7 @@ export class McpServer {
57
57
  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,
58
58
  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,
59
59
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
60
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
60
61
  });
61
62
  if (_response.ok) {
62
63
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -113,7 +114,7 @@ export class McpServer {
113
114
  }
114
115
  __list(requestOptions) {
115
116
  return __awaiter(this, void 0, void 0, function* () {
116
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
117
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
117
118
  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);
118
119
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
119
120
  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"),
@@ -123,6 +124,7 @@ export class McpServer {
123
124
  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,
124
125
  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,
125
126
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
127
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
126
128
  });
127
129
  if (_response.ok) {
128
130
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -178,7 +180,7 @@ export class McpServer {
178
180
  }
179
181
  __get(mcpServerId, requestOptions) {
180
182
  return __awaiter(this, void 0, void 0, function* () {
181
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
183
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
182
184
  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);
183
185
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
184
186
  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)}`),
@@ -188,6 +190,7 @@ export class McpServer {
188
190
  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,
189
191
  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,
190
192
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
193
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
191
194
  });
192
195
  if (_response.ok) {
193
196
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -243,7 +246,7 @@ export class McpServer {
243
246
  }
244
247
  __delete(mcpServerId, requestOptions) {
245
248
  return __awaiter(this, void 0, void 0, function* () {
246
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
249
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
247
250
  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);
248
251
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
249
252
  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)}`),
@@ -253,6 +256,7 @@ export class McpServer {
253
256
  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,
254
257
  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,
255
258
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
259
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
256
260
  });
257
261
  if (_response.ok) {
258
262
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -35,7 +35,7 @@ export class Tools {
35
35
  }
36
36
  __list(mcpServerId, requestOptions) {
37
37
  return __awaiter(this, void 0, void 0, function* () {
38
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
38
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
39
39
  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);
40
40
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
41
41
  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`),
@@ -45,6 +45,7 @@ export class Tools {
45
45
  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,
46
46
  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,
47
47
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
48
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
48
49
  });
49
50
  if (_response.ok) {
50
51
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -100,7 +101,7 @@ export class Tools {
100
101
  }
101
102
  __get(mcpServerToolId, requestOptions) {
102
103
  return __awaiter(this, void 0, void 0, function* () {
103
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
104
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
104
105
  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);
105
106
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
106
107
  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)}`),
@@ -110,6 +111,7 @@ export class Tools {
110
111
  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,
111
112
  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,
112
113
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
114
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
113
115
  });
114
116
  if (_response.ok) {
115
117
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -165,7 +167,7 @@ export class Tools {
165
167
  }
166
168
  __delete(mcpServerToolId, requestOptions) {
167
169
  return __awaiter(this, void 0, void 0, function* () {
168
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
170
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
169
171
  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);
170
172
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
171
173
  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)}`),
@@ -175,6 +177,7 @@ export class Tools {
175
177
  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,
176
178
  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,
177
179
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
180
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
178
181
  });
179
182
  if (_response.ok) {
180
183
  return { data: _response.body, rawResponse: _response.rawResponse };
@@ -236,7 +239,7 @@ export class Tools {
236
239
  }
237
240
  __call(mcpServerToolId, request, requestOptions) {
238
241
  return __awaiter(this, void 0, void 0, function* () {
239
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
242
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
240
243
  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);
241
244
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
242
245
  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`),
@@ -249,6 +252,7 @@ export class Tools {
249
252
  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,
250
253
  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,
251
254
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
255
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
252
256
  });
253
257
  if (_response.ok) {
254
258
  return {
@@ -48,7 +48,7 @@ export class Workflows {
48
48
  }
49
49
  __list() {
50
50
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
51
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
51
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
52
52
  const { verbose } = request;
53
53
  const _queryParams = {};
54
54
  if (verbose != null) {
@@ -63,6 +63,7 @@ export class Workflows {
63
63
  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,
64
64
  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,
65
65
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
66
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
66
67
  });
67
68
  if (_response.ok) {
68
69
  return {
@@ -132,7 +133,7 @@ export class Workflows {
132
133
  }
133
134
  __create(request, requestOptions) {
134
135
  return __awaiter(this, void 0, void 0, function* () {
135
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
136
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
136
137
  const { verbose } = request, _body = __rest(request, ["verbose"]);
137
138
  const _queryParams = {};
138
139
  if (verbose != null) {
@@ -150,6 +151,7 @@ export class Workflows {
150
151
  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,
151
152
  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,
152
153
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
154
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
153
155
  });
154
156
  if (_response.ok) {
155
157
  return {
@@ -214,7 +216,7 @@ export class Workflows {
214
216
  }
215
217
  __get(id_1) {
216
218
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
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 { verbose } = request;
219
221
  const _queryParams = {};
220
222
  if (verbose != null) {
@@ -229,6 +231,7 @@ export class Workflows {
229
231
  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,
230
232
  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,
231
233
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
234
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
232
235
  });
233
236
  if (_response.ok) {
234
237
  return {
@@ -302,7 +305,7 @@ export class Workflows {
302
305
  }
303
306
  __update(id, request, requestOptions) {
304
307
  return __awaiter(this, void 0, void 0, function* () {
305
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
308
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
306
309
  const { verbose } = request, _body = __rest(request, ["verbose"]);
307
310
  const _queryParams = {};
308
311
  if (verbose != null) {
@@ -320,6 +323,7 @@ export class Workflows {
320
323
  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,
321
324
  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,
322
325
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
326
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
323
327
  });
324
328
  if (_response.ok) {
325
329
  return {
@@ -383,7 +387,7 @@ export class Workflows {
383
387
  }
384
388
  __delete(id, requestOptions) {
385
389
  return __awaiter(this, void 0, void 0, function* () {
386
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
390
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
387
391
  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);
388
392
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
389
393
  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)}`),
@@ -393,6 +397,7 @@ export class Workflows {
393
397
  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,
394
398
  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,
395
399
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
400
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
396
401
  });
397
402
  if (_response.ok) {
398
403
  return {
@@ -463,7 +468,7 @@ export class Workflows {
463
468
  }
464
469
  __execute(id, request, requestOptions) {
465
470
  return __awaiter(this, void 0, void 0, function* () {
466
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
471
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
467
472
  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);
468
473
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
469
474
  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`),
@@ -476,6 +481,7 @@ export class Workflows {
476
481
  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,
477
482
  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,
478
483
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
484
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
479
485
  });
480
486
  if (_response.ok) {
481
487
  return {
@@ -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 {
@@ -43,13 +43,13 @@ function getHeaders(args) {
43
43
  }
44
44
  export function fetcherImpl(args) {
45
45
  return __awaiter(this, void 0, void 0, function* () {
46
- var _a;
46
+ var _a, _b, _c;
47
47
  const url = createRequestUrl(args.url, args.queryParameters);
48
48
  const requestBody = yield getRequestBody({
49
49
  body: args.body,
50
- type: args.requestType === "json" ? "json" : "other",
50
+ type: (_a = args.requestType) !== null && _a !== void 0 ? _a : "other",
51
51
  });
52
- const fetchFn = yield getFetchFn();
52
+ const fetchFn = (_b = args.fetchFn) !== null && _b !== void 0 ? _b : (yield getFetchFn());
53
53
  try {
54
54
  const response = yield requestWithRetries(() => __awaiter(this, void 0, void 0, function* () {
55
55
  return makeRequest(fetchFn, url, args.method, yield getHeaders(args), requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex);
@@ -75,7 +75,7 @@ export function fetcherImpl(args) {
75
75
  }
76
76
  }
77
77
  catch (error) {
78
- if ((_a = args.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {
78
+ if ((_c = args.abortSignal) === null || _c === void 0 ? void 0 : _c.aborted) {
79
79
  return {
80
80
  ok: false,
81
81
  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>;
@@ -8,8 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { toJson } from "../json.mjs";
11
+ import { toQueryString } from "../url/qs.mjs";
11
12
  export function getRequestBody(_a) {
12
13
  return __awaiter(this, arguments, void 0, function* ({ body, type }) {
14
+ if (type === "form") {
15
+ return toQueryString(body, { arrayFormat: "repeat", encode: true });
16
+ }
13
17
  if (type.includes("json")) {
14
18
  return toJson(body);
15
19
  }
@@ -3,11 +3,12 @@ export function mergeHeaders(...headersArray) {
3
3
  for (const [key, value] of headersArray
4
4
  .filter((headers) => headers != null)
5
5
  .flatMap((headers) => Object.entries(headers))) {
6
+ const insensitiveKey = key.toLowerCase();
6
7
  if (value != null) {
7
- result[key] = value;
8
+ result[insensitiveKey] = value;
8
9
  }
9
- else if (key in result) {
10
- delete result[key];
10
+ else if (insensitiveKey in result) {
11
+ delete result[insensitiveKey];
11
12
  }
12
13
  }
13
14
  return result;
@@ -17,8 +18,9 @@ export function mergeOnlyDefinedHeaders(...headersArray) {
17
18
  for (const [key, value] of headersArray
18
19
  .filter((headers) => headers != null)
19
20
  .flatMap((headers) => Object.entries(headers))) {
21
+ const insensitiveKey = key.toLowerCase();
20
22
  if (value != null) {
21
- result[key] = value;
23
+ result[insensitiveKey] = value;
22
24
  }
23
25
  }
24
26
  return result;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "6.0.0";
1
+ export declare const SDK_VERSION = "6.1.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "6.0.0";
1
+ export const SDK_VERSION = "6.1.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phenoml",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "private": false,
5
5
  "repository": "github:PhenoML/phenoml-ts-sdk",
6
6
  "type": "commonjs",
@@ -57,7 +57,7 @@
57
57
  "path": false,
58
58
  "stream": false
59
59
  },
60
- "packageManager": "pnpm@10.14.0",
60
+ "packageManager": "pnpm@10.20.0",
61
61
  "engines": {
62
62
  "node": ">=18.0.0"
63
63
  },
package/reference.md CHANGED
@@ -2217,7 +2217,7 @@ Examples:
2217
2217
  </dl>
2218
2218
  </details>
2219
2219
 
2220
- <details><summary><code>client.fhir.<a href="/src/api/resources/fhir/client/Client.ts">delete</a>(fhirProviderId, fhirPath, { ...params }) -> Record&lt;string, unknown&gt;</code></summary>
2220
+ <details><summary><code>client.fhir.<a href="/src/api/resources/fhir/client/Client.ts">delete</a>(fhirProviderId, fhirPath, { ...params }) -> Record<string, unknown></code></summary>
2221
2221
  <dl>
2222
2222
  <dd>
2223
2223