phenoml 17.4.0 → 17.7.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 (153) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +7 -2
  4. package/dist/cjs/api/resources/agent/errors/ConflictError.d.ts +5 -0
  5. package/dist/cjs/api/resources/agent/errors/ConflictError.js +54 -0
  6. package/dist/cjs/api/resources/agent/errors/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/agent/errors/index.js +1 -0
  8. package/dist/cjs/api/resources/agent/resources/chat/client/Client.d.ts +1 -0
  9. package/dist/cjs/api/resources/agent/resources/chat/client/Client.js +5 -0
  10. package/dist/cjs/api/resources/agent/resources/chat/client/requests/AgentChatRequest.d.ts +1 -1
  11. package/dist/cjs/api/resources/agent/resources/chat/client/requests/AgentStreamChatRequest.d.ts +1 -1
  12. package/dist/cjs/api/resources/fhir2Omop/client/Client.d.ts +26 -0
  13. package/dist/cjs/api/resources/fhir2Omop/client/Client.js +26 -0
  14. package/dist/cjs/api/resources/fhir2Omop/client/requests/CreateOmopRequest.d.ts +6 -3
  15. package/dist/cjs/api/resources/fhir2Omop/types/CreateOmopResponse.d.ts +6 -1
  16. package/dist/cjs/api/resources/fhirProvider/types/Provider.d.ts +1 -0
  17. package/dist/cjs/api/resources/fhirProvider/types/Provider.js +1 -0
  18. package/dist/cjs/api/resources/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/index.js +2 -1
  20. package/dist/cjs/api/resources/voice/client/Client.d.ts +12 -0
  21. package/dist/cjs/api/resources/voice/client/Client.js +16 -0
  22. package/dist/cjs/api/resources/voice/client/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/voice/client/index.js +2 -0
  24. package/dist/cjs/api/resources/voice/errors/BadGatewayError.d.ts +5 -0
  25. package/dist/cjs/api/resources/voice/errors/BadGatewayError.js +54 -0
  26. package/dist/cjs/api/resources/voice/errors/BadRequestError.d.ts +5 -0
  27. package/dist/cjs/api/resources/voice/errors/BadRequestError.js +54 -0
  28. package/dist/cjs/api/resources/voice/errors/ContentTooLargeError.d.ts +5 -0
  29. package/dist/cjs/api/resources/voice/errors/ContentTooLargeError.js +54 -0
  30. package/dist/cjs/api/resources/voice/errors/GatewayTimeoutError.d.ts +5 -0
  31. package/dist/cjs/api/resources/voice/errors/GatewayTimeoutError.js +54 -0
  32. package/dist/cjs/api/resources/voice/errors/PaymentRequiredError.d.ts +5 -0
  33. package/dist/cjs/api/resources/voice/errors/PaymentRequiredError.js +54 -0
  34. package/dist/cjs/api/resources/voice/errors/ServiceUnavailableError.d.ts +5 -0
  35. package/dist/cjs/api/resources/voice/errors/ServiceUnavailableError.js +54 -0
  36. package/dist/cjs/api/resources/voice/errors/UnauthorizedError.d.ts +5 -0
  37. package/dist/cjs/api/resources/voice/errors/UnauthorizedError.js +54 -0
  38. package/dist/cjs/api/resources/voice/errors/index.d.ts +7 -0
  39. package/dist/cjs/api/resources/voice/errors/index.js +23 -0
  40. package/dist/cjs/api/resources/voice/exports.d.ts +3 -0
  41. package/dist/cjs/api/resources/voice/exports.js +22 -0
  42. package/dist/cjs/api/resources/voice/index.d.ts +4 -0
  43. package/dist/cjs/api/resources/voice/index.js +20 -0
  44. package/dist/cjs/api/resources/voice/resources/index.d.ts +2 -0
  45. package/dist/cjs/api/resources/voice/resources/index.js +41 -0
  46. package/dist/cjs/api/resources/voice/resources/voice/client/Client.d.ts +41 -0
  47. package/dist/cjs/api/resources/voice/resources/voice/client/Client.js +146 -0
  48. package/dist/cjs/api/resources/voice/resources/voice/client/index.d.ts +1 -0
  49. package/dist/cjs/api/resources/voice/resources/voice/client/index.js +17 -0
  50. package/dist/cjs/api/resources/voice/resources/voice/client/requests/TranscribeRequest.d.ts +4 -0
  51. package/dist/cjs/api/resources/voice/resources/voice/client/requests/TranscribeRequest.js +3 -0
  52. package/dist/cjs/api/resources/voice/resources/voice/client/requests/index.d.ts +1 -0
  53. package/dist/cjs/api/resources/voice/resources/voice/client/requests/index.js +2 -0
  54. package/dist/cjs/api/resources/voice/resources/voice/exports.d.ts +2 -0
  55. package/dist/cjs/api/resources/voice/resources/voice/exports.js +21 -0
  56. package/dist/cjs/api/resources/voice/resources/voice/index.d.ts +1 -0
  57. package/dist/cjs/api/resources/voice/resources/voice/index.js +17 -0
  58. package/dist/cjs/api/resources/voice/types/TranscribeResponse.d.ts +4 -0
  59. package/dist/cjs/api/resources/voice/types/TranscribeResponse.js +3 -0
  60. package/dist/cjs/api/resources/voice/types/index.d.ts +1 -0
  61. package/dist/cjs/api/resources/voice/types/index.js +17 -0
  62. package/dist/cjs/core/exports.d.ts +1 -0
  63. package/dist/cjs/core/exports.js +1 -0
  64. package/dist/cjs/core/file/exports.d.ts +1 -0
  65. package/dist/cjs/core/file/exports.js +2 -0
  66. package/dist/cjs/core/file/file.d.ts +10 -0
  67. package/dist/cjs/core/file/file.js +222 -0
  68. package/dist/cjs/core/file/index.d.ts +2 -0
  69. package/dist/cjs/core/file/index.js +18 -0
  70. package/dist/cjs/core/file/types.d.ts +66 -0
  71. package/dist/cjs/core/file/types.js +2 -0
  72. package/dist/cjs/core/index.d.ts +1 -0
  73. package/dist/cjs/core/index.js +2 -1
  74. package/dist/cjs/version.d.ts +1 -1
  75. package/dist/cjs/version.js +1 -1
  76. package/dist/esm/BaseClient.mjs +2 -2
  77. package/dist/esm/Client.d.mts +3 -0
  78. package/dist/esm/Client.mjs +5 -0
  79. package/dist/esm/api/resources/agent/errors/ConflictError.d.mts +5 -0
  80. package/dist/esm/api/resources/agent/errors/ConflictError.mjs +17 -0
  81. package/dist/esm/api/resources/agent/errors/index.d.mts +1 -0
  82. package/dist/esm/api/resources/agent/errors/index.mjs +1 -0
  83. package/dist/esm/api/resources/agent/resources/chat/client/Client.d.mts +1 -0
  84. package/dist/esm/api/resources/agent/resources/chat/client/Client.mjs +5 -0
  85. package/dist/esm/api/resources/agent/resources/chat/client/requests/AgentChatRequest.d.mts +1 -1
  86. package/dist/esm/api/resources/agent/resources/chat/client/requests/AgentStreamChatRequest.d.mts +1 -1
  87. package/dist/esm/api/resources/fhir2Omop/client/Client.d.mts +26 -0
  88. package/dist/esm/api/resources/fhir2Omop/client/Client.mjs +26 -0
  89. package/dist/esm/api/resources/fhir2Omop/client/requests/CreateOmopRequest.d.mts +6 -3
  90. package/dist/esm/api/resources/fhir2Omop/types/CreateOmopResponse.d.mts +6 -1
  91. package/dist/esm/api/resources/fhirProvider/types/Provider.d.mts +1 -0
  92. package/dist/esm/api/resources/fhirProvider/types/Provider.mjs +1 -0
  93. package/dist/esm/api/resources/index.d.mts +1 -0
  94. package/dist/esm/api/resources/index.mjs +1 -0
  95. package/dist/esm/api/resources/voice/client/Client.d.mts +12 -0
  96. package/dist/esm/api/resources/voice/client/Client.mjs +12 -0
  97. package/dist/esm/api/resources/voice/client/index.d.mts +1 -0
  98. package/dist/esm/api/resources/voice/client/index.mjs +1 -0
  99. package/dist/esm/api/resources/voice/errors/BadGatewayError.d.mts +5 -0
  100. package/dist/esm/api/resources/voice/errors/BadGatewayError.mjs +17 -0
  101. package/dist/esm/api/resources/voice/errors/BadRequestError.d.mts +5 -0
  102. package/dist/esm/api/resources/voice/errors/BadRequestError.mjs +17 -0
  103. package/dist/esm/api/resources/voice/errors/ContentTooLargeError.d.mts +5 -0
  104. package/dist/esm/api/resources/voice/errors/ContentTooLargeError.mjs +17 -0
  105. package/dist/esm/api/resources/voice/errors/GatewayTimeoutError.d.mts +5 -0
  106. package/dist/esm/api/resources/voice/errors/GatewayTimeoutError.mjs +17 -0
  107. package/dist/esm/api/resources/voice/errors/PaymentRequiredError.d.mts +5 -0
  108. package/dist/esm/api/resources/voice/errors/PaymentRequiredError.mjs +17 -0
  109. package/dist/esm/api/resources/voice/errors/ServiceUnavailableError.d.mts +5 -0
  110. package/dist/esm/api/resources/voice/errors/ServiceUnavailableError.mjs +17 -0
  111. package/dist/esm/api/resources/voice/errors/UnauthorizedError.d.mts +5 -0
  112. package/dist/esm/api/resources/voice/errors/UnauthorizedError.mjs +17 -0
  113. package/dist/esm/api/resources/voice/errors/index.d.mts +7 -0
  114. package/dist/esm/api/resources/voice/errors/index.mjs +7 -0
  115. package/dist/esm/api/resources/voice/exports.d.mts +3 -0
  116. package/dist/esm/api/resources/voice/exports.mjs +4 -0
  117. package/dist/esm/api/resources/voice/index.d.mts +4 -0
  118. package/dist/esm/api/resources/voice/index.mjs +4 -0
  119. package/dist/esm/api/resources/voice/resources/index.d.mts +2 -0
  120. package/dist/esm/api/resources/voice/resources/index.mjs +2 -0
  121. package/dist/esm/api/resources/voice/resources/voice/client/Client.d.mts +41 -0
  122. package/dist/esm/api/resources/voice/resources/voice/client/Client.mjs +109 -0
  123. package/dist/esm/api/resources/voice/resources/voice/client/index.d.mts +1 -0
  124. package/dist/esm/api/resources/voice/resources/voice/client/index.mjs +1 -0
  125. package/dist/esm/api/resources/voice/resources/voice/client/requests/TranscribeRequest.d.mts +4 -0
  126. package/dist/esm/api/resources/voice/resources/voice/client/requests/TranscribeRequest.mjs +2 -0
  127. package/dist/esm/api/resources/voice/resources/voice/client/requests/index.d.mts +1 -0
  128. package/dist/esm/api/resources/voice/resources/voice/client/requests/index.mjs +1 -0
  129. package/dist/esm/api/resources/voice/resources/voice/exports.d.mts +2 -0
  130. package/dist/esm/api/resources/voice/resources/voice/exports.mjs +3 -0
  131. package/dist/esm/api/resources/voice/resources/voice/index.d.mts +1 -0
  132. package/dist/esm/api/resources/voice/resources/voice/index.mjs +1 -0
  133. package/dist/esm/api/resources/voice/types/TranscribeResponse.d.mts +4 -0
  134. package/dist/esm/api/resources/voice/types/TranscribeResponse.mjs +2 -0
  135. package/dist/esm/api/resources/voice/types/index.d.mts +1 -0
  136. package/dist/esm/api/resources/voice/types/index.mjs +1 -0
  137. package/dist/esm/core/exports.d.mts +1 -0
  138. package/dist/esm/core/exports.mjs +1 -0
  139. package/dist/esm/core/file/exports.d.mts +1 -0
  140. package/dist/esm/core/file/exports.mjs +1 -0
  141. package/dist/esm/core/file/file.d.mts +10 -0
  142. package/dist/esm/core/file/file.mjs +185 -0
  143. package/dist/esm/core/file/index.d.mts +2 -0
  144. package/dist/esm/core/file/index.mjs +2 -0
  145. package/dist/esm/core/file/types.d.mts +66 -0
  146. package/dist/esm/core/file/types.mjs +1 -0
  147. package/dist/esm/core/index.d.mts +1 -0
  148. package/dist/esm/core/index.mjs +1 -0
  149. package/dist/esm/version.d.mts +1 -1
  150. package/dist/esm/version.mjs +1 -1
  151. package/openapi/openapi.json +110 -6
  152. package/package.json +12 -1
  153. package/reference.md +27 -0
@@ -0,0 +1,10 @@
1
+ import type { Uploadable } from "./types.js";
2
+ export declare function toBinaryUploadRequest(file: Uploadable): Promise<{
3
+ body: Uploadable.FileLike;
4
+ headers?: Record<string, string>;
5
+ }>;
6
+ export declare function toMultipartDataPart(file: Uploadable): Promise<{
7
+ data: Uploadable.FileLike;
8
+ filename?: string;
9
+ contentType?: string;
10
+ }>;
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.toBinaryUploadRequest = toBinaryUploadRequest;
46
+ exports.toMultipartDataPart = toMultipartDataPart;
47
+ function toBinaryUploadRequest(file) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ const { data, filename, contentLength, contentType } = yield getFileWithMetadata(file);
50
+ const request = {
51
+ body: data,
52
+ headers: {},
53
+ };
54
+ if (filename) {
55
+ request.headers["Content-Disposition"] = `attachment; filename="${filename}"`;
56
+ }
57
+ if (contentType) {
58
+ request.headers["Content-Type"] = contentType;
59
+ }
60
+ if (contentLength != null) {
61
+ request.headers["Content-Length"] = contentLength.toString();
62
+ }
63
+ return request;
64
+ });
65
+ }
66
+ function toMultipartDataPart(file) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ const { data, filename, contentType } = yield getFileWithMetadata(file, {
69
+ noSniffFileSize: true,
70
+ });
71
+ return {
72
+ data,
73
+ filename,
74
+ contentType,
75
+ };
76
+ });
77
+ }
78
+ function getFileWithMetadata(file_1) {
79
+ return __awaiter(this, arguments, void 0, function* (file, { noSniffFileSize } = {}) {
80
+ var _a, _b, _c, _d, _e;
81
+ if (isFileLike(file)) {
82
+ return getFileWithMetadata({
83
+ data: file,
84
+ }, { noSniffFileSize });
85
+ }
86
+ if ("path" in file) {
87
+ const fs = yield Promise.resolve().then(() => __importStar(require("fs")));
88
+ if (!(fs === null || fs === void 0 ? void 0 : fs.createReadStream)) {
89
+ throw new Error("File path uploads are not supported in this environment.");
90
+ }
91
+ const data = fs.createReadStream(file.path);
92
+ const contentLength = (_a = file.contentLength) !== null && _a !== void 0 ? _a : (noSniffFileSize === true ? undefined : yield tryGetFileSizeFromPath(file.path));
93
+ const filename = (_b = file.filename) !== null && _b !== void 0 ? _b : getNameFromPath(file.path);
94
+ return {
95
+ data,
96
+ filename,
97
+ contentType: file.contentType,
98
+ contentLength,
99
+ };
100
+ }
101
+ if ("data" in file) {
102
+ const data = file.data;
103
+ const contentLength = (_c = file.contentLength) !== null && _c !== void 0 ? _c : (yield tryGetContentLengthFromFileLike(data, {
104
+ noSniffFileSize,
105
+ }));
106
+ const filename = (_d = file.filename) !== null && _d !== void 0 ? _d : tryGetNameFromFileLike(data);
107
+ return {
108
+ data,
109
+ filename,
110
+ contentType: (_e = file.contentType) !== null && _e !== void 0 ? _e : tryGetContentTypeFromFileLike(data),
111
+ contentLength,
112
+ };
113
+ }
114
+ throw new Error(`Invalid FileUpload of type ${typeof file}: ${JSON.stringify(file)}`);
115
+ });
116
+ }
117
+ function isFileLike(value) {
118
+ return (isBuffer(value) ||
119
+ isArrayBufferView(value) ||
120
+ isArrayBuffer(value) ||
121
+ isUint8Array(value) ||
122
+ isBlob(value) ||
123
+ isFile(value) ||
124
+ isStreamLike(value) ||
125
+ isReadableStream(value));
126
+ }
127
+ function tryGetFileSizeFromPath(path) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ var _a;
130
+ try {
131
+ const fs = yield Promise.resolve().then(() => __importStar(require("fs")));
132
+ if (!((_a = fs === null || fs === void 0 ? void 0 : fs.promises) === null || _a === void 0 ? void 0 : _a.stat)) {
133
+ return undefined;
134
+ }
135
+ const fileStat = yield fs.promises.stat(path);
136
+ return fileStat.size;
137
+ }
138
+ catch (_fallbackError) {
139
+ return undefined;
140
+ }
141
+ });
142
+ }
143
+ function tryGetNameFromFileLike(data) {
144
+ if (isNamedValue(data)) {
145
+ return data.name;
146
+ }
147
+ if (isPathedValue(data)) {
148
+ return getNameFromPath(data.path.toString());
149
+ }
150
+ return undefined;
151
+ }
152
+ function tryGetContentLengthFromFileLike(data_1) {
153
+ return __awaiter(this, arguments, void 0, function* (data, { noSniffFileSize } = {}) {
154
+ if (isBuffer(data)) {
155
+ return data.length;
156
+ }
157
+ if (isArrayBufferView(data)) {
158
+ return data.byteLength;
159
+ }
160
+ if (isArrayBuffer(data)) {
161
+ return data.byteLength;
162
+ }
163
+ if (isBlob(data)) {
164
+ return data.size;
165
+ }
166
+ if (isFile(data)) {
167
+ return data.size;
168
+ }
169
+ if (noSniffFileSize === true) {
170
+ return undefined;
171
+ }
172
+ if (isPathedValue(data)) {
173
+ return yield tryGetFileSizeFromPath(data.path.toString());
174
+ }
175
+ return undefined;
176
+ });
177
+ }
178
+ function tryGetContentTypeFromFileLike(data) {
179
+ if (isBlob(data)) {
180
+ return data.type;
181
+ }
182
+ if (isFile(data)) {
183
+ return data.type;
184
+ }
185
+ return undefined;
186
+ }
187
+ function getNameFromPath(path) {
188
+ const lastForwardSlash = path.lastIndexOf("/");
189
+ const lastBackSlash = path.lastIndexOf("\\");
190
+ const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
191
+ return lastSlashIndex >= 0 ? path.substring(lastSlashIndex + 1) : path;
192
+ }
193
+ function isNamedValue(value) {
194
+ return typeof value === "object" && value != null && "name" in value;
195
+ }
196
+ function isPathedValue(value) {
197
+ return typeof value === "object" && value != null && "path" in value;
198
+ }
199
+ function isStreamLike(value) {
200
+ return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
201
+ }
202
+ function isReadableStream(value) {
203
+ return typeof value === "object" && value != null && "getReader" in value;
204
+ }
205
+ function isBuffer(value) {
206
+ return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
207
+ }
208
+ function isArrayBufferView(value) {
209
+ return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value);
210
+ }
211
+ function isArrayBuffer(value) {
212
+ return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer;
213
+ }
214
+ function isUint8Array(value) {
215
+ return typeof Uint8Array !== "undefined" && value instanceof Uint8Array;
216
+ }
217
+ function isBlob(value) {
218
+ return typeof Blob !== "undefined" && value instanceof Blob;
219
+ }
220
+ function isFile(value) {
221
+ return typeof File !== "undefined" && value instanceof File;
222
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./file.js";
2
+ export * from "./types.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./file.js"), exports);
18
+ __exportStar(require("./types.js"), exports);
@@ -0,0 +1,66 @@
1
+ /**
2
+ * A file that can be uploaded. Can be a file-like object (stream, buffer, blob, etc.),
3
+ * a path to a file, or an object with a file-like object and metadata.
4
+ */
5
+ export type Uploadable = Uploadable.FileLike | Uploadable.FromPath | Uploadable.WithMetadata;
6
+ export declare namespace Uploadable {
7
+ /**
8
+ * Various file-like objects that can be used to upload a file.
9
+ */
10
+ type FileLike = ArrayBuffer | ArrayBufferLike | ArrayBufferView | Uint8Array | import("buffer").Buffer | import("buffer").Blob | import("buffer").File | import("stream").Readable | import("stream/web").ReadableStream | globalThis.Blob | globalThis.File | ReadableStream;
11
+ /**
12
+ * A file path with optional metadata, used for uploading a file from the file system.
13
+ */
14
+ type FromPath = {
15
+ /** The path to the file to upload */
16
+ path: string;
17
+ /**
18
+ * Optional override for the file name (defaults to basename of path).
19
+ * This is used to set the `Content-Disposition` header in upload requests.
20
+ */
21
+ filename?: string;
22
+ /**
23
+ * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain').
24
+ * This is used to set the `Content-Type` header in upload requests.
25
+ */
26
+ contentType?: string;
27
+ /**
28
+ * Optional file size in bytes.
29
+ * If not provided, the file size will be determined from the file system.
30
+ * The content length is used to set the `Content-Length` header in upload requests.
31
+ */
32
+ contentLength?: number;
33
+ };
34
+ /**
35
+ * A file-like object with metadata, used for uploading files.
36
+ */
37
+ type WithMetadata = {
38
+ /** The file data */
39
+ data: FileLike;
40
+ /**
41
+ * Optional override for the file name (defaults to basename of path).
42
+ * This is used to set the `Content-Disposition` header in upload requests.
43
+ */
44
+ filename?: string;
45
+ /**
46
+ * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain').
47
+ * This is used to set the `Content-Type` header in upload requests.
48
+ *
49
+ * If not provided, the content type may be determined from the data itself.
50
+ * * If the data is a `File`, `Blob`, or similar, the content type will be determined from the file itself, if the type is set.
51
+ * * Any other data type will not have a content type set, and the upload request will use `Content-Type: application/octet-stream` instead.
52
+ */
53
+ contentType?: string;
54
+ /**
55
+ * Optional file size in bytes.
56
+ * The content length is used to set the `Content-Length` header in upload requests.
57
+ * If the content length is not provided and cannot be determined, the upload request will not include the `Content-Length` header, but will use `Transfer-Encoding: chunked` instead.
58
+ *
59
+ * If not provided, the file size will be determined depending on the data type.
60
+ * * If the data is of type `fs.ReadStream` (`createReadStream`), the size will be determined from the file system.
61
+ * * If the data is a `Buffer`, `ArrayBuffer`, `Uint8Array`, `Blob`, `File`, or similar, the size will be determined from the data itself.
62
+ * * If the data is a `Readable` or `ReadableStream`, the size will not be determined.
63
+ */
64
+ contentLength?: number;
65
+ };
66
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,7 @@
1
1
  export * from "./auth/index.js";
2
2
  export * from "./base64.js";
3
3
  export * from "./fetcher/index.js";
4
+ export * as file from "./file/index.js";
4
5
  export * as logging from "./logging/index.js";
5
6
  export * from "./runtime/index.js";
6
7
  export * from "./stream/index.js";
@@ -36,10 +36,11 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.url = exports.logging = void 0;
39
+ exports.url = exports.logging = exports.file = void 0;
40
40
  __exportStar(require("./auth/index.js"), exports);
41
41
  __exportStar(require("./base64.js"), exports);
42
42
  __exportStar(require("./fetcher/index.js"), exports);
43
+ exports.file = __importStar(require("./file/index.js"));
43
44
  exports.logging = __importStar(require("./logging/index.js"));
44
45
  __exportStar(require("./runtime/index.js"), exports);
45
46
  __exportStar(require("./stream/index.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "17.4.0";
1
+ export declare const SDK_VERSION = "17.7.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 = "17.4.0";
4
+ exports.SDK_VERSION = "17.7.0";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "phenoml",
9
- "X-Fern-SDK-Version": "17.4.0",
10
- "User-Agent": "phenoml/17.4.0",
9
+ "X-Fern-SDK-Version": "17.7.0",
10
+ "User-Agent": "phenoml/17.7.0",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -8,6 +8,7 @@ import { FhirProviderClient } from "./api/resources/fhirProvider/client/Client.m
8
8
  import { Lang2FhirClient } from "./api/resources/lang2Fhir/client/Client.mjs";
9
9
  import { SummaryClient } from "./api/resources/summary/client/Client.mjs";
10
10
  import { ToolsClient } from "./api/resources/tools/client/Client.mjs";
11
+ import { VoiceClient } from "./api/resources/voice/client/Client.mjs";
11
12
  import { WorkflowsClient } from "./api/resources/workflows/client/Client.mjs";
12
13
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
13
14
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
@@ -29,6 +30,7 @@ export declare class phenomlClient {
29
30
  protected _lang2Fhir: Lang2FhirClient | undefined;
30
31
  protected _summary: SummaryClient | undefined;
31
32
  protected _tools: ToolsClient | undefined;
33
+ protected _voice: VoiceClient | undefined;
32
34
  protected _workflows: WorkflowsClient | undefined;
33
35
  constructor(options?: phenomlClient.Options);
34
36
  get agent(): AgentClient;
@@ -41,6 +43,7 @@ export declare class phenomlClient {
41
43
  get lang2Fhir(): Lang2FhirClient;
42
44
  get summary(): SummaryClient;
43
45
  get tools(): ToolsClient;
46
+ get voice(): VoiceClient;
44
47
  get workflows(): WorkflowsClient;
45
48
  /**
46
49
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
@@ -18,6 +18,7 @@ import { FhirProviderClient } from "./api/resources/fhirProvider/client/Client.m
18
18
  import { Lang2FhirClient } from "./api/resources/lang2Fhir/client/Client.mjs";
19
19
  import { SummaryClient } from "./api/resources/summary/client/Client.mjs";
20
20
  import { ToolsClient } from "./api/resources/tools/client/Client.mjs";
21
+ import { VoiceClient } from "./api/resources/voice/client/Client.mjs";
21
22
  import { WorkflowsClient } from "./api/resources/workflows/client/Client.mjs";
22
23
  import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
23
24
  import * as core from "./core/index.mjs";
@@ -65,6 +66,10 @@ export class phenomlClient {
65
66
  var _a;
66
67
  return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new ToolsClient(this._options)));
67
68
  }
69
+ get voice() {
70
+ var _a;
71
+ return ((_a = this._voice) !== null && _a !== void 0 ? _a : (this._voice = new VoiceClient(this._options)));
72
+ }
68
73
  get workflows() {
69
74
  var _a;
70
75
  return ((_a = this._workflows) !== null && _a !== void 0 ? _a : (this._workflows = new WorkflowsClient(this._options)));
@@ -0,0 +1,5 @@
1
+ import type * as core from "../../../../core/index.mjs";
2
+ import * as errors from "../../../../errors/index.mjs";
3
+ export declare class ConflictError extends errors.phenomlError {
4
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
5
+ }
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../../../errors/index.mjs";
3
+ export class ConflictError extends errors.phenomlError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "ConflictError",
7
+ statusCode: 409,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = this.constructor.name;
16
+ }
17
+ }
@@ -1,4 +1,5 @@
1
1
  export * from "./BadRequestError.mjs";
2
+ export * from "./ConflictError.mjs";
2
3
  export * from "./ForbiddenError.mjs";
3
4
  export * from "./GatewayTimeoutError.mjs";
4
5
  export * from "./InternalServerError.mjs";
@@ -1,4 +1,5 @@
1
1
  export * from "./BadRequestError.mjs";
2
+ export * from "./ConflictError.mjs";
2
3
  export * from "./ForbiddenError.mjs";
3
4
  export * from "./GatewayTimeoutError.mjs";
4
5
  export * from "./InternalServerError.mjs";
@@ -23,6 +23,7 @@ export declare class ChatClient {
23
23
  * @throws {@link phenoml.agent.UnauthorizedError}
24
24
  * @throws {@link phenoml.agent.ForbiddenError}
25
25
  * @throws {@link phenoml.agent.NotFoundError}
26
+ * @throws {@link phenoml.agent.ConflictError}
26
27
  * @throws {@link phenoml.agent.InternalServerError}
27
28
  * @throws {@link phenoml.agent.GatewayTimeoutError}
28
29
  *
@@ -43,6 +43,7 @@ export class ChatClient {
43
43
  * @throws {@link phenoml.agent.UnauthorizedError}
44
44
  * @throws {@link phenoml.agent.ForbiddenError}
45
45
  * @throws {@link phenoml.agent.NotFoundError}
46
+ * @throws {@link phenoml.agent.ConflictError}
46
47
  * @throws {@link phenoml.agent.InternalServerError}
47
48
  * @throws {@link phenoml.agent.GatewayTimeoutError}
48
49
  *
@@ -104,6 +105,8 @@ export class ChatClient {
104
105
  throw new phenoml.agent.ForbiddenError(_response.error.body, _response.rawResponse);
105
106
  case 404:
106
107
  throw new phenoml.agent.NotFoundError(_response.error.body, _response.rawResponse);
108
+ case 409:
109
+ throw new phenoml.agent.ConflictError(_response.error.body, _response.rawResponse);
107
110
  case 500:
108
111
  throw new phenoml.agent.InternalServerError(_response.error.body, _response.rawResponse);
109
112
  case 504:
@@ -174,6 +177,8 @@ export class ChatClient {
174
177
  throw new phenoml.agent.ForbiddenError(_response.error.body, _response.rawResponse);
175
178
  case 404:
176
179
  throw new phenoml.agent.NotFoundError(_response.error.body, _response.rawResponse);
180
+ case 409:
181
+ throw new phenoml.agent.ConflictError(_response.error.body, _response.rawResponse);
177
182
  case 500:
178
183
  throw new phenoml.agent.InternalServerError(_response.error.body, _response.rawResponse);
179
184
  case 504:
@@ -33,7 +33,7 @@ export interface AgentChatRequest {
33
33
  message: string;
34
34
  /** Optional context for the conversation */
35
35
  context?: string;
36
- /** Optional session ID for conversation continuity */
36
+ /** Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict. */
37
37
  session_id?: string;
38
38
  /** The ID of the agent to chat with */
39
39
  agent_id: string;
@@ -23,7 +23,7 @@ export interface AgentStreamChatRequest {
23
23
  message: string;
24
24
  /** Optional context for the conversation */
25
25
  context?: string;
26
- /** Optional session ID for conversation continuity */
26
+ /** Optional session ID for conversation continuity. Only one request may be active for a session at a time; overlapping turns for the same session return 409 Conflict. */
27
27
  session_id?: string;
28
28
  /** The ID of the agent to chat with */
29
29
  agent_id: string;
@@ -15,6 +15,32 @@ export declare class Fhir2OmopClient {
15
15
  * (person, visit_occurrence, condition_occurrence, drug_exposure,
16
16
  * procedure_occurrence, measurement, observation).
17
17
  *
18
+ * Resource support is intentionally limited to the OMOP tables returned by
19
+ * this endpoint:
20
+ * - `Patient` -> `person`
21
+ * - `Encounter` -> `visit_occurrence`
22
+ * - `Condition` -> `condition_occurrence`
23
+ * - `Procedure` -> `procedure_occurrence`
24
+ * - `MedicationRequest`, `MedicationStatement`, and
25
+ * `MedicationAdministration` -> `drug_exposure`
26
+ * - `Immunization` -> `drug_exposure`
27
+ * - `Observation` with a numeric `valueQuantity`, `valueInteger`, or
28
+ * numeric-looking `valueString` (for example `"<2"`) -> `measurement`
29
+ * - non-numeric `Observation` -> `observation`
30
+ * - `AllergyIntolerance` -> `observation`
31
+ *
32
+ * `Medication` is supported only as reference data for medication
33
+ * resources; it is not emitted as its own row because OMOP CDM has no
34
+ * Medication table. Other reference/admin resources such as `Practitioner`,
35
+ * `Organization`, `Location`, `Coverage`, and `Claim`, and clinical
36
+ * workflow/document resources such as `DiagnosticReport`, `ServiceRequest`,
37
+ * `CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and
38
+ * `DeviceUseStatement`, are currently accepted in a Bundle but are not
39
+ * shaped into OMOP rows. Unsupported resource types are ignored rather than
40
+ * listed under `dropped`; `dropped` is reserved for supported resource types
41
+ * that were missing the subject/patient, code, or medication reference data
42
+ * needed to produce a valid row.
43
+ *
18
44
  * Each resource's primary clinical coding is resolved to a standard OMOP
19
45
  * `concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
20
46
  * response carries `mappings` (how each source coding resolved, linked back
@@ -24,6 +24,32 @@ export class Fhir2OmopClient {
24
24
  * (person, visit_occurrence, condition_occurrence, drug_exposure,
25
25
  * procedure_occurrence, measurement, observation).
26
26
  *
27
+ * Resource support is intentionally limited to the OMOP tables returned by
28
+ * this endpoint:
29
+ * - `Patient` -> `person`
30
+ * - `Encounter` -> `visit_occurrence`
31
+ * - `Condition` -> `condition_occurrence`
32
+ * - `Procedure` -> `procedure_occurrence`
33
+ * - `MedicationRequest`, `MedicationStatement`, and
34
+ * `MedicationAdministration` -> `drug_exposure`
35
+ * - `Immunization` -> `drug_exposure`
36
+ * - `Observation` with a numeric `valueQuantity`, `valueInteger`, or
37
+ * numeric-looking `valueString` (for example `"<2"`) -> `measurement`
38
+ * - non-numeric `Observation` -> `observation`
39
+ * - `AllergyIntolerance` -> `observation`
40
+ *
41
+ * `Medication` is supported only as reference data for medication
42
+ * resources; it is not emitted as its own row because OMOP CDM has no
43
+ * Medication table. Other reference/admin resources such as `Practitioner`,
44
+ * `Organization`, `Location`, `Coverage`, and `Claim`, and clinical
45
+ * workflow/document resources such as `DiagnosticReport`, `ServiceRequest`,
46
+ * `CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and
47
+ * `DeviceUseStatement`, are currently accepted in a Bundle but are not
48
+ * shaped into OMOP rows. Unsupported resource types are ignored rather than
49
+ * listed under `dropped`; `dropped` is reserved for supported resource types
50
+ * that were missing the subject/patient, code, or medication reference data
51
+ * needed to produce a valid row.
52
+ *
27
53
  * Each resource's primary clinical coding is resolved to a standard OMOP
28
54
  * `concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
29
55
  * response carries `mappings` (how each source coding resolved, linked back
@@ -68,9 +68,12 @@
68
68
  export interface CreateOmopRequest {
69
69
  /**
70
70
  * FHIR resources (single resource or Bundle). Must contain at least one
71
- * Patient resource. Resources are mapped to OMOP rows; standalone
72
- * Medication resources are consumed by medication references rather than
73
- * mapped to their own table.
71
+ * Patient resource. Supported row-producing resources are Patient,
72
+ * Encounter, Condition, Procedure, MedicationRequest,
73
+ * MedicationStatement, MedicationAdministration, Immunization,
74
+ * Observation, and AllergyIntolerance. Standalone Medication resources
75
+ * are consumed by medication references rather than mapped to their own
76
+ * table. Other resource types are accepted but ignored.
74
77
  */
75
78
  fhir_resources: Record<string, unknown>;
76
79
  }
@@ -5,7 +5,12 @@ export interface CreateOmopResponse {
5
5
  tables?: phenoml.fhir2Omop.OmopTables | undefined;
6
6
  /** One entry per source coding (or one entry for a text-only resource with no coding), describing how it resolved and linking back to the row it produced. */
7
7
  mappings?: phenoml.fhir2Omop.MappingEntry[] | undefined;
8
- /** Resources that could not be shaped into an OMOP row (rather than emitted as blank rows). */
8
+ /**
9
+ * Supported resource instances that could not be shaped into an OMOP
10
+ * row because required subject/patient, code, or medication reference
11
+ * data was missing. Unsupported resource types are ignored and do not
12
+ * appear here.
13
+ */
9
14
  dropped?: phenoml.fhir2Omop.DroppedResource[] | undefined;
10
15
  /**
11
16
  * The OMOP vocabulary release the clinical codes were resolved against
@@ -5,6 +5,7 @@
5
5
  * It is used on shared instances.
6
6
  */
7
7
  export declare const Provider: {
8
+ readonly Aidbox: "aidbox";
8
9
  readonly Athenahealth: "athenahealth";
9
10
  readonly Canvas: "canvas";
10
11
  readonly Cerner: "cerner";
@@ -6,6 +6,7 @@
6
6
  * It is used on shared instances.
7
7
  */
8
8
  export const Provider = {
9
+ Aidbox: "aidbox",
9
10
  Athenahealth: "athenahealth",
10
11
  Canvas: "canvas",
11
12
  Cerner: "cerner",
@@ -8,4 +8,5 @@ export * as fhirProvider from "./fhirProvider/index.mjs";
8
8
  export * as lang2Fhir from "./lang2Fhir/index.mjs";
9
9
  export * as summary from "./summary/index.mjs";
10
10
  export * as tools from "./tools/index.mjs";
11
+ export * as voice from "./voice/index.mjs";
11
12
  export * as workflows from "./workflows/index.mjs";
@@ -8,4 +8,5 @@ export * as fhirProvider from "./fhirProvider/index.mjs";
8
8
  export * as lang2Fhir from "./lang2Fhir/index.mjs";
9
9
  export * as summary from "./summary/index.mjs";
10
10
  export * as tools from "./tools/index.mjs";
11
+ export * as voice from "./voice/index.mjs";
11
12
  export * as workflows from "./workflows/index.mjs";