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
@@ -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 {
@@ -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 */
@@ -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 {
@@ -2,8 +2,6 @@ import type * as phenoml from "../../../index.mjs";
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.mjs";
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 {
@@ -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 = "5.3.0";
1
+ export declare const SDK_VERSION = "6.1.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "5.3.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": "5.3.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
@@ -1154,8 +1154,9 @@ await client.cohort.analyze({
1154
1154
  <dd>
1155
1155
 
1156
1156
  Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
1157
- Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
1158
- subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
1157
+ Returns 202 immediately; embedding generation runs asynchronously. Poll
1158
+ GET /construe/codes/systems/{codesystem}?version={version} to check when status
1159
+ transitions from "processing" to "ready" or "failed".
1159
1160
  </dd>
1160
1161
  </dl>
1161
1162
  </dd>
@@ -1171,12 +1172,9 @@ subsequently use the code system for construe/extract and lang2fhir/create (comi
1171
1172
 
1172
1173
  ```typescript
1173
1174
  await client.construe.uploadCodeSystem({
1174
- format: "csv",
1175
1175
  name: "CUSTOM_CODES",
1176
1176
  version: "1.0",
1177
- file: "file",
1178
- code_col: "code",
1179
- desc_col: "description"
1177
+ format: "csv"
1180
1178
  });
1181
1179
 
1182
1180
  ```
@@ -1193,7 +1191,7 @@ await client.construe.uploadCodeSystem({
1193
1191
  <dl>
1194
1192
  <dd>
1195
1193
 
1196
- **request:** `phenoml.UploadRequest`
1194
+ **request:** `phenoml.construe.UploadRequest`
1197
1195
 
1198
1196
  </dd>
1199
1197
  </dl>
@@ -2219,7 +2217,7 @@ Examples:
2219
2217
  </dl>
2220
2218
  </details>
2221
2219
 
2222
- <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>
2223
2221
  <dl>
2224
2222
  <dd>
2225
2223
 
@@ -1,10 +0,0 @@
1
- import type * as phenoml from "../../../index.js";
2
- export type UploadRequest = phenoml.construe.UploadRequest.Csv | phenoml.construe.UploadRequest.Json;
3
- export declare namespace UploadRequest {
4
- interface Csv extends phenoml.construe.UploadRequestCsv {
5
- format: "csv";
6
- }
7
- interface Json extends phenoml.construe.UploadRequestJson {
8
- format: "json";
9
- }
10
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,32 +0,0 @@
1
- export interface UploadRequestCsv {
2
- /**
3
- * Name of the code system. Names are case-insensitive and stored uppercase.
4
- * Builtin system names (e.g. ICD-10-CM, SNOMED_CT_US_LITE, LOINC, CPT, etc.) are
5
- * reserved and cannot be used for custom uploads; attempts return HTTP 403 Forbidden.
6
- */
7
- name: string;
8
- /** Version of the code system */
9
- version: string;
10
- /** Optional revision number */
11
- revision?: number;
12
- /** The CSV file contents as a base64-encoded string. */
13
- file: string;
14
- /** Column name containing codes */
15
- code_col: string;
16
- /** Column name containing descriptions */
17
- desc_col: string;
18
- /** Optional column name containing long definitions */
19
- defn_col?: string;
20
- /**
21
- * If true, replaces an existing code system with the same name and version.
22
- * Builtin systems cannot be replaced; attempts to do so return HTTP 403 Forbidden.
23
- * When false (default), uploading a duplicate returns 409 Conflict.
24
- */
25
- replace?: boolean;
26
- /**
27
- * If true, returns 202 Accepted immediately after validation and starts processing
28
- * in the background. Poll GET /construe/codes/systems/{name}?version={version} to
29
- * check when status transitions from "processing" to "ready" or "failed".
30
- */
31
- async?: boolean;
32
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,40 +0,0 @@
1
- import type * as phenoml from "../../../index.js";
2
- /**
3
- * Upload codes in JSON format. Either 'file' or 'codes' must be provided.
4
- * If both are provided, 'codes' takes precedence.
5
- */
6
- export interface UploadRequestJson {
7
- /**
8
- * Name of the code system. Names are case-insensitive and stored uppercase.
9
- * Builtin system names (e.g. ICD-10-CM, SNOMED_CT_US_LITE, LOINC, CPT, etc.) are
10
- * reserved and cannot be used for custom uploads; attempts return HTTP 403 Forbidden.
11
- */
12
- name: string;
13
- /** Version of the code system */
14
- version: string;
15
- /** Optional revision number */
16
- revision?: number;
17
- /**
18
- * The file contents as a base64-encoded JSON array string.
19
- * Prefer using 'codes' instead to pass the array directly without base64 encoding.
20
- */
21
- file?: string;
22
- /**
23
- * The codes to upload as a JSON array.
24
- * This is the preferred way to upload JSON codes, as it avoids unnecessary base64 encoding.
25
- * If both 'codes' and 'file' are provided, 'codes' takes precedence.
26
- */
27
- codes?: phenoml.construe.CodeResponse[];
28
- /**
29
- * If true, replaces an existing code system with the same name and version.
30
- * Builtin systems cannot be replaced; attempts to do so return HTTP 403 Forbidden.
31
- * When false (default), uploading a duplicate returns 409 Conflict.
32
- */
33
- replace?: boolean;
34
- /**
35
- * If true, returns 202 Accepted immediately after validation and starts processing
36
- * in the background. Poll GET /construe/codes/systems/{name}?version={version} to
37
- * check when status transitions from "processing" to "ready" or "failed".
38
- */
39
- async?: boolean;
40
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- import type * as phenoml from "../../../index.mjs";
2
- export type UploadRequest = phenoml.construe.UploadRequest.Csv | phenoml.construe.UploadRequest.Json;
3
- export declare namespace UploadRequest {
4
- interface Csv extends phenoml.construe.UploadRequestCsv {
5
- format: "csv";
6
- }
7
- interface Json extends phenoml.construe.UploadRequestJson {
8
- format: "json";
9
- }
10
- }