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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +7 -2
- package/dist/cjs/api/resources/agent/errors/ConflictError.d.ts +5 -0
- package/dist/cjs/api/resources/agent/errors/ConflictError.js +54 -0
- package/dist/cjs/api/resources/agent/errors/index.d.ts +1 -0
- package/dist/cjs/api/resources/agent/errors/index.js +1 -0
- package/dist/cjs/api/resources/agent/resources/chat/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/agent/resources/chat/client/Client.js +5 -0
- package/dist/cjs/api/resources/agent/resources/chat/client/requests/AgentChatRequest.d.ts +1 -1
- package/dist/cjs/api/resources/agent/resources/chat/client/requests/AgentStreamChatRequest.d.ts +1 -1
- package/dist/cjs/api/resources/fhir2Omop/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/fhir2Omop/client/Client.js +26 -0
- package/dist/cjs/api/resources/fhir2Omop/client/requests/CreateOmopRequest.d.ts +6 -3
- package/dist/cjs/api/resources/fhir2Omop/types/CreateOmopResponse.d.ts +6 -1
- package/dist/cjs/api/resources/fhirProvider/types/Provider.d.ts +1 -0
- package/dist/cjs/api/resources/fhirProvider/types/Provider.js +1 -0
- package/dist/cjs/api/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.js +2 -1
- package/dist/cjs/api/resources/voice/client/Client.d.ts +12 -0
- package/dist/cjs/api/resources/voice/client/Client.js +16 -0
- package/dist/cjs/api/resources/voice/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/voice/client/index.js +2 -0
- package/dist/cjs/api/resources/voice/errors/BadGatewayError.d.ts +5 -0
- package/dist/cjs/api/resources/voice/errors/BadGatewayError.js +54 -0
- package/dist/cjs/api/resources/voice/errors/BadRequestError.d.ts +5 -0
- package/dist/cjs/api/resources/voice/errors/BadRequestError.js +54 -0
- package/dist/cjs/api/resources/voice/errors/ContentTooLargeError.d.ts +5 -0
- package/dist/cjs/api/resources/voice/errors/ContentTooLargeError.js +54 -0
- package/dist/cjs/api/resources/voice/errors/GatewayTimeoutError.d.ts +5 -0
- package/dist/cjs/api/resources/voice/errors/GatewayTimeoutError.js +54 -0
- package/dist/cjs/api/resources/voice/errors/PaymentRequiredError.d.ts +5 -0
- package/dist/cjs/api/resources/voice/errors/PaymentRequiredError.js +54 -0
- package/dist/cjs/api/resources/voice/errors/ServiceUnavailableError.d.ts +5 -0
- package/dist/cjs/api/resources/voice/errors/ServiceUnavailableError.js +54 -0
- package/dist/cjs/api/resources/voice/errors/UnauthorizedError.d.ts +5 -0
- package/dist/cjs/api/resources/voice/errors/UnauthorizedError.js +54 -0
- package/dist/cjs/api/resources/voice/errors/index.d.ts +7 -0
- package/dist/cjs/api/resources/voice/errors/index.js +23 -0
- package/dist/cjs/api/resources/voice/exports.d.ts +3 -0
- package/dist/cjs/api/resources/voice/exports.js +22 -0
- package/dist/cjs/api/resources/voice/index.d.ts +4 -0
- package/dist/cjs/api/resources/voice/index.js +20 -0
- package/dist/cjs/api/resources/voice/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/voice/resources/index.js +41 -0
- package/dist/cjs/api/resources/voice/resources/voice/client/Client.d.ts +41 -0
- package/dist/cjs/api/resources/voice/resources/voice/client/Client.js +146 -0
- package/dist/cjs/api/resources/voice/resources/voice/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/voice/resources/voice/client/index.js +17 -0
- package/dist/cjs/api/resources/voice/resources/voice/client/requests/TranscribeRequest.d.ts +4 -0
- package/dist/cjs/api/resources/voice/resources/voice/client/requests/TranscribeRequest.js +3 -0
- package/dist/cjs/api/resources/voice/resources/voice/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/voice/resources/voice/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/voice/resources/voice/exports.d.ts +2 -0
- package/dist/cjs/api/resources/voice/resources/voice/exports.js +21 -0
- package/dist/cjs/api/resources/voice/resources/voice/index.d.ts +1 -0
- package/dist/cjs/api/resources/voice/resources/voice/index.js +17 -0
- package/dist/cjs/api/resources/voice/types/TranscribeResponse.d.ts +4 -0
- package/dist/cjs/api/resources/voice/types/TranscribeResponse.js +3 -0
- package/dist/cjs/api/resources/voice/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/voice/types/index.js +17 -0
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/core/exports.js +1 -0
- package/dist/cjs/core/file/exports.d.ts +1 -0
- package/dist/cjs/core/file/exports.js +2 -0
- package/dist/cjs/core/file/file.d.ts +10 -0
- package/dist/cjs/core/file/file.js +222 -0
- package/dist/cjs/core/file/index.d.ts +2 -0
- package/dist/cjs/core/file/index.js +18 -0
- package/dist/cjs/core/file/types.d.ts +66 -0
- package/dist/cjs/core/file/types.js +2 -0
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +2 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/agent/errors/ConflictError.d.mts +5 -0
- package/dist/esm/api/resources/agent/errors/ConflictError.mjs +17 -0
- package/dist/esm/api/resources/agent/errors/index.d.mts +1 -0
- package/dist/esm/api/resources/agent/errors/index.mjs +1 -0
- package/dist/esm/api/resources/agent/resources/chat/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/agent/resources/chat/client/Client.mjs +5 -0
- package/dist/esm/api/resources/agent/resources/chat/client/requests/AgentChatRequest.d.mts +1 -1
- package/dist/esm/api/resources/agent/resources/chat/client/requests/AgentStreamChatRequest.d.mts +1 -1
- package/dist/esm/api/resources/fhir2Omop/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/fhir2Omop/client/Client.mjs +26 -0
- package/dist/esm/api/resources/fhir2Omop/client/requests/CreateOmopRequest.d.mts +6 -3
- package/dist/esm/api/resources/fhir2Omop/types/CreateOmopResponse.d.mts +6 -1
- package/dist/esm/api/resources/fhirProvider/types/Provider.d.mts +1 -0
- package/dist/esm/api/resources/fhirProvider/types/Provider.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/index.mjs +1 -0
- package/dist/esm/api/resources/voice/client/Client.d.mts +12 -0
- package/dist/esm/api/resources/voice/client/Client.mjs +12 -0
- package/dist/esm/api/resources/voice/client/index.d.mts +1 -0
- package/dist/esm/api/resources/voice/client/index.mjs +1 -0
- package/dist/esm/api/resources/voice/errors/BadGatewayError.d.mts +5 -0
- package/dist/esm/api/resources/voice/errors/BadGatewayError.mjs +17 -0
- package/dist/esm/api/resources/voice/errors/BadRequestError.d.mts +5 -0
- package/dist/esm/api/resources/voice/errors/BadRequestError.mjs +17 -0
- package/dist/esm/api/resources/voice/errors/ContentTooLargeError.d.mts +5 -0
- package/dist/esm/api/resources/voice/errors/ContentTooLargeError.mjs +17 -0
- package/dist/esm/api/resources/voice/errors/GatewayTimeoutError.d.mts +5 -0
- package/dist/esm/api/resources/voice/errors/GatewayTimeoutError.mjs +17 -0
- package/dist/esm/api/resources/voice/errors/PaymentRequiredError.d.mts +5 -0
- package/dist/esm/api/resources/voice/errors/PaymentRequiredError.mjs +17 -0
- package/dist/esm/api/resources/voice/errors/ServiceUnavailableError.d.mts +5 -0
- package/dist/esm/api/resources/voice/errors/ServiceUnavailableError.mjs +17 -0
- package/dist/esm/api/resources/voice/errors/UnauthorizedError.d.mts +5 -0
- package/dist/esm/api/resources/voice/errors/UnauthorizedError.mjs +17 -0
- package/dist/esm/api/resources/voice/errors/index.d.mts +7 -0
- package/dist/esm/api/resources/voice/errors/index.mjs +7 -0
- package/dist/esm/api/resources/voice/exports.d.mts +3 -0
- package/dist/esm/api/resources/voice/exports.mjs +4 -0
- package/dist/esm/api/resources/voice/index.d.mts +4 -0
- package/dist/esm/api/resources/voice/index.mjs +4 -0
- package/dist/esm/api/resources/voice/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/voice/resources/index.mjs +2 -0
- package/dist/esm/api/resources/voice/resources/voice/client/Client.d.mts +41 -0
- package/dist/esm/api/resources/voice/resources/voice/client/Client.mjs +109 -0
- package/dist/esm/api/resources/voice/resources/voice/client/index.d.mts +1 -0
- package/dist/esm/api/resources/voice/resources/voice/client/index.mjs +1 -0
- package/dist/esm/api/resources/voice/resources/voice/client/requests/TranscribeRequest.d.mts +4 -0
- package/dist/esm/api/resources/voice/resources/voice/client/requests/TranscribeRequest.mjs +2 -0
- package/dist/esm/api/resources/voice/resources/voice/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/voice/resources/voice/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/voice/resources/voice/exports.d.mts +2 -0
- package/dist/esm/api/resources/voice/resources/voice/exports.mjs +3 -0
- package/dist/esm/api/resources/voice/resources/voice/index.d.mts +1 -0
- package/dist/esm/api/resources/voice/resources/voice/index.mjs +1 -0
- package/dist/esm/api/resources/voice/types/TranscribeResponse.d.mts +4 -0
- package/dist/esm/api/resources/voice/types/TranscribeResponse.mjs +2 -0
- package/dist/esm/api/resources/voice/types/index.d.mts +1 -0
- package/dist/esm/api/resources/voice/types/index.mjs +1 -0
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/file/exports.d.mts +1 -0
- package/dist/esm/core/file/exports.mjs +1 -0
- package/dist/esm/core/file/file.d.mts +10 -0
- package/dist/esm/core/file/file.mjs +185 -0
- package/dist/esm/core/file/index.d.mts +2 -0
- package/dist/esm/core/file/index.mjs +2 -0
- package/dist/esm/core/file/types.d.mts +66 -0
- package/dist/esm/core/file/types.mjs +1 -0
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/openapi/openapi.json +110 -6
- package/package.json +12 -1
- package/reference.md +27 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export function toBinaryUploadRequest(file) {
|
|
11
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const { data, filename, contentLength, contentType } = yield getFileWithMetadata(file);
|
|
13
|
+
const request = {
|
|
14
|
+
body: data,
|
|
15
|
+
headers: {},
|
|
16
|
+
};
|
|
17
|
+
if (filename) {
|
|
18
|
+
request.headers["Content-Disposition"] = `attachment; filename="${filename}"`;
|
|
19
|
+
}
|
|
20
|
+
if (contentType) {
|
|
21
|
+
request.headers["Content-Type"] = contentType;
|
|
22
|
+
}
|
|
23
|
+
if (contentLength != null) {
|
|
24
|
+
request.headers["Content-Length"] = contentLength.toString();
|
|
25
|
+
}
|
|
26
|
+
return request;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export function toMultipartDataPart(file) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const { data, filename, contentType } = yield getFileWithMetadata(file, {
|
|
32
|
+
noSniffFileSize: true,
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
data,
|
|
36
|
+
filename,
|
|
37
|
+
contentType,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function getFileWithMetadata(file_1) {
|
|
42
|
+
return __awaiter(this, arguments, void 0, function* (file, { noSniffFileSize } = {}) {
|
|
43
|
+
var _a, _b, _c, _d, _e;
|
|
44
|
+
if (isFileLike(file)) {
|
|
45
|
+
return getFileWithMetadata({
|
|
46
|
+
data: file,
|
|
47
|
+
}, { noSniffFileSize });
|
|
48
|
+
}
|
|
49
|
+
if ("path" in file) {
|
|
50
|
+
const fs = yield import("fs");
|
|
51
|
+
if (!(fs === null || fs === void 0 ? void 0 : fs.createReadStream)) {
|
|
52
|
+
throw new Error("File path uploads are not supported in this environment.");
|
|
53
|
+
}
|
|
54
|
+
const data = fs.createReadStream(file.path);
|
|
55
|
+
const contentLength = (_a = file.contentLength) !== null && _a !== void 0 ? _a : (noSniffFileSize === true ? undefined : yield tryGetFileSizeFromPath(file.path));
|
|
56
|
+
const filename = (_b = file.filename) !== null && _b !== void 0 ? _b : getNameFromPath(file.path);
|
|
57
|
+
return {
|
|
58
|
+
data,
|
|
59
|
+
filename,
|
|
60
|
+
contentType: file.contentType,
|
|
61
|
+
contentLength,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if ("data" in file) {
|
|
65
|
+
const data = file.data;
|
|
66
|
+
const contentLength = (_c = file.contentLength) !== null && _c !== void 0 ? _c : (yield tryGetContentLengthFromFileLike(data, {
|
|
67
|
+
noSniffFileSize,
|
|
68
|
+
}));
|
|
69
|
+
const filename = (_d = file.filename) !== null && _d !== void 0 ? _d : tryGetNameFromFileLike(data);
|
|
70
|
+
return {
|
|
71
|
+
data,
|
|
72
|
+
filename,
|
|
73
|
+
contentType: (_e = file.contentType) !== null && _e !== void 0 ? _e : tryGetContentTypeFromFileLike(data),
|
|
74
|
+
contentLength,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
throw new Error(`Invalid FileUpload of type ${typeof file}: ${JSON.stringify(file)}`);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function isFileLike(value) {
|
|
81
|
+
return (isBuffer(value) ||
|
|
82
|
+
isArrayBufferView(value) ||
|
|
83
|
+
isArrayBuffer(value) ||
|
|
84
|
+
isUint8Array(value) ||
|
|
85
|
+
isBlob(value) ||
|
|
86
|
+
isFile(value) ||
|
|
87
|
+
isStreamLike(value) ||
|
|
88
|
+
isReadableStream(value));
|
|
89
|
+
}
|
|
90
|
+
function tryGetFileSizeFromPath(path) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
var _a;
|
|
93
|
+
try {
|
|
94
|
+
const fs = yield import("fs");
|
|
95
|
+
if (!((_a = fs === null || fs === void 0 ? void 0 : fs.promises) === null || _a === void 0 ? void 0 : _a.stat)) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
const fileStat = yield fs.promises.stat(path);
|
|
99
|
+
return fileStat.size;
|
|
100
|
+
}
|
|
101
|
+
catch (_fallbackError) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function tryGetNameFromFileLike(data) {
|
|
107
|
+
if (isNamedValue(data)) {
|
|
108
|
+
return data.name;
|
|
109
|
+
}
|
|
110
|
+
if (isPathedValue(data)) {
|
|
111
|
+
return getNameFromPath(data.path.toString());
|
|
112
|
+
}
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
function tryGetContentLengthFromFileLike(data_1) {
|
|
116
|
+
return __awaiter(this, arguments, void 0, function* (data, { noSniffFileSize } = {}) {
|
|
117
|
+
if (isBuffer(data)) {
|
|
118
|
+
return data.length;
|
|
119
|
+
}
|
|
120
|
+
if (isArrayBufferView(data)) {
|
|
121
|
+
return data.byteLength;
|
|
122
|
+
}
|
|
123
|
+
if (isArrayBuffer(data)) {
|
|
124
|
+
return data.byteLength;
|
|
125
|
+
}
|
|
126
|
+
if (isBlob(data)) {
|
|
127
|
+
return data.size;
|
|
128
|
+
}
|
|
129
|
+
if (isFile(data)) {
|
|
130
|
+
return data.size;
|
|
131
|
+
}
|
|
132
|
+
if (noSniffFileSize === true) {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
if (isPathedValue(data)) {
|
|
136
|
+
return yield tryGetFileSizeFromPath(data.path.toString());
|
|
137
|
+
}
|
|
138
|
+
return undefined;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function tryGetContentTypeFromFileLike(data) {
|
|
142
|
+
if (isBlob(data)) {
|
|
143
|
+
return data.type;
|
|
144
|
+
}
|
|
145
|
+
if (isFile(data)) {
|
|
146
|
+
return data.type;
|
|
147
|
+
}
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
function getNameFromPath(path) {
|
|
151
|
+
const lastForwardSlash = path.lastIndexOf("/");
|
|
152
|
+
const lastBackSlash = path.lastIndexOf("\\");
|
|
153
|
+
const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
|
|
154
|
+
return lastSlashIndex >= 0 ? path.substring(lastSlashIndex + 1) : path;
|
|
155
|
+
}
|
|
156
|
+
function isNamedValue(value) {
|
|
157
|
+
return typeof value === "object" && value != null && "name" in value;
|
|
158
|
+
}
|
|
159
|
+
function isPathedValue(value) {
|
|
160
|
+
return typeof value === "object" && value != null && "path" in value;
|
|
161
|
+
}
|
|
162
|
+
function isStreamLike(value) {
|
|
163
|
+
return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
|
|
164
|
+
}
|
|
165
|
+
function isReadableStream(value) {
|
|
166
|
+
return typeof value === "object" && value != null && "getReader" in value;
|
|
167
|
+
}
|
|
168
|
+
function isBuffer(value) {
|
|
169
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
|
|
170
|
+
}
|
|
171
|
+
function isArrayBufferView(value) {
|
|
172
|
+
return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value);
|
|
173
|
+
}
|
|
174
|
+
function isArrayBuffer(value) {
|
|
175
|
+
return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer;
|
|
176
|
+
}
|
|
177
|
+
function isUint8Array(value) {
|
|
178
|
+
return typeof Uint8Array !== "undefined" && value instanceof Uint8Array;
|
|
179
|
+
}
|
|
180
|
+
function isBlob(value) {
|
|
181
|
+
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
182
|
+
}
|
|
183
|
+
function isFile(value) {
|
|
184
|
+
return typeof File !== "undefined" && value instanceof File;
|
|
185
|
+
}
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./auth/index.mjs";
|
|
2
2
|
export * from "./base64.mjs";
|
|
3
3
|
export * from "./fetcher/index.mjs";
|
|
4
|
+
export * as file from "./file/index.mjs";
|
|
4
5
|
export * as logging from "./logging/index.mjs";
|
|
5
6
|
export * from "./runtime/index.mjs";
|
|
6
7
|
export * from "./stream/index.mjs";
|
package/dist/esm/core/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./auth/index.mjs";
|
|
2
2
|
export * from "./base64.mjs";
|
|
3
3
|
export * from "./fetcher/index.mjs";
|
|
4
|
+
export * as file from "./file/index.mjs";
|
|
4
5
|
export * as logging from "./logging/index.mjs";
|
|
5
6
|
export * from "./runtime/index.mjs";
|
|
6
7
|
export * from "./stream/index.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "17.
|
|
1
|
+
export declare const SDK_VERSION = "17.7.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "17.
|
|
1
|
+
export const SDK_VERSION = "17.7.0";
|
package/openapi/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.0.3",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Phenoml API",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "e2c477c4583f8f9e7d0d1a5b5591c1aa8cabef10"
|
|
6
6
|
},
|
|
7
7
|
"x-services": [
|
|
8
8
|
{
|
|
@@ -67,6 +67,13 @@
|
|
|
67
67
|
"description": "FHIR server operations including resource CRUD, search, and batch operations.",
|
|
68
68
|
"iconHint": "proxy",
|
|
69
69
|
"status": "ga"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "voice",
|
|
73
|
+
"name": "Voice",
|
|
74
|
+
"description": "Transcribe audio recordings into text with speech-to-text. Pair the transcript with Lang2FHIR to turn spoken clinical notes into structured FHIR resources.",
|
|
75
|
+
"iconHint": "voice",
|
|
76
|
+
"status": "alpha"
|
|
70
77
|
}
|
|
71
78
|
],
|
|
72
79
|
"paths": {
|
|
@@ -672,6 +679,9 @@
|
|
|
672
679
|
"404": {
|
|
673
680
|
"description": "Agent or session not found"
|
|
674
681
|
},
|
|
682
|
+
"409": {
|
|
683
|
+
"description": "Chat session already has an active request. Retry after the in-flight turn completes."
|
|
684
|
+
},
|
|
675
685
|
"500": {
|
|
676
686
|
"description": "Server error"
|
|
677
687
|
},
|
|
@@ -746,6 +756,9 @@
|
|
|
746
756
|
"404": {
|
|
747
757
|
"description": "Agent or session not found"
|
|
748
758
|
},
|
|
759
|
+
"409": {
|
|
760
|
+
"description": "Chat session already has an active request. Retry after the in-flight turn completes."
|
|
761
|
+
},
|
|
749
762
|
"500": {
|
|
750
763
|
"description": "Server error"
|
|
751
764
|
},
|
|
@@ -3021,7 +3034,7 @@
|
|
|
3021
3034
|
"post": {
|
|
3022
3035
|
"operationId": "fhir2omop_create",
|
|
3023
3036
|
"summary": "Map FHIR resources to OMOP CDM v5.4",
|
|
3024
|
-
"description": "Maps a FHIR R4 resource or Bundle into OMOP Common Data Model v5.4 rows\n(person, visit_occurrence, condition_occurrence, drug_exposure,\nprocedure_occurrence, measurement, observation).\n\nEach resource's primary clinical coding is resolved to a standard OMOP\n`concept_id`. Alongside the OMOP rows grouped by table (`tables`), the\nresponse carries `mappings` (how each source coding resolved, linked back\nto the row it produced), `dropped` (resources that could not be shaped\ninto a row), `vocab_version` (the OMOP vocabulary release codes were\nresolved against), and a small `summary` of the resolution outcomes.\n\nA `concept_id` of `0` is reported, not omitted (OMOP \"no matching\nconcept\" semantics): it covers both a coding with no standard match\n(`UNMAPPED`) and an unverified suggestion for a text-only resource\n(`UNCHECKED`). Only the primary clinical coding is resolved, so\n`gender`/`race`/`ethnicity`/`visit`/`value`/`unit` `concept_id`s are\nalways `0`; the one populated non-resolved concept is measurement\n`operator_concept_id`, set from a value comparator (`<`, `<=`, `>`, `>=`)\nrather than the resolver. Each `*_source_value` carries the verbatim FHIR\ncoding (`system#code`), and `*_type_concept_id` is set to `32817` (EHR).\n\nMedication codes are resolved whether they appear inline\n(`medicationCodeableConcept`) or via a `medicationReference` to a contained,\nrelative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.\nResources that cannot be shaped into a row \u2014 a medication with no usable\ncode, resolvable reference, or display, or any clinical resource whose\nsubject/patient reference cannot be tied to a person \u2014 are reported under\n`dropped` rather than emitted as blank rows. The\nbundle must contain at least one Patient resource.\n",
|
|
3037
|
+
"description": "Maps a FHIR R4 resource or Bundle into OMOP Common Data Model v5.4 rows\n(person, visit_occurrence, condition_occurrence, drug_exposure,\nprocedure_occurrence, measurement, observation).\n\nResource support is intentionally limited to the OMOP tables returned by\nthis endpoint:\n- `Patient` -> `person`\n- `Encounter` -> `visit_occurrence`\n- `Condition` -> `condition_occurrence`\n- `Procedure` -> `procedure_occurrence`\n- `MedicationRequest`, `MedicationStatement`, and\n `MedicationAdministration` -> `drug_exposure`\n- `Immunization` -> `drug_exposure`\n- `Observation` with a numeric `valueQuantity`, `valueInteger`, or\n numeric-looking `valueString` (for example `\"<2\"`) -> `measurement`\n- non-numeric `Observation` -> `observation`\n- `AllergyIntolerance` -> `observation`\n\n`Medication` is supported only as reference data for medication\nresources; it is not emitted as its own row because OMOP CDM has no\nMedication table. Other reference/admin resources such as `Practitioner`,\n`Organization`, `Location`, `Coverage`, and `Claim`, and clinical\nworkflow/document resources such as `DiagnosticReport`, `ServiceRequest`,\n`CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and\n`DeviceUseStatement`, are currently accepted in a Bundle but are not\nshaped into OMOP rows. Unsupported resource types are ignored rather than\nlisted under `dropped`; `dropped` is reserved for supported resource types\nthat were missing the subject/patient, code, or medication reference data\nneeded to produce a valid row.\n\nEach resource's primary clinical coding is resolved to a standard OMOP\n`concept_id`. Alongside the OMOP rows grouped by table (`tables`), the\nresponse carries `mappings` (how each source coding resolved, linked back\nto the row it produced), `dropped` (resources that could not be shaped\ninto a row), `vocab_version` (the OMOP vocabulary release codes were\nresolved against), and a small `summary` of the resolution outcomes.\n\nA `concept_id` of `0` is reported, not omitted (OMOP \"no matching\nconcept\" semantics): it covers both a coding with no standard match\n(`UNMAPPED`) and an unverified suggestion for a text-only resource\n(`UNCHECKED`). Only the primary clinical coding is resolved, so\n`gender`/`race`/`ethnicity`/`visit`/`value`/`unit` `concept_id`s are\nalways `0`; the one populated non-resolved concept is measurement\n`operator_concept_id`, set from a value comparator (`<`, `<=`, `>`, `>=`)\nrather than the resolver. Each `*_source_value` carries the verbatim FHIR\ncoding (`system#code`), and `*_type_concept_id` is set to `32817` (EHR).\n\nMedication codes are resolved whether they appear inline\n(`medicationCodeableConcept`) or via a `medicationReference` to a contained,\nrelative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.\nResources that cannot be shaped into a row \u2014 a medication with no usable\ncode, resolvable reference, or display, or any clinical resource whose\nsubject/patient reference cannot be tied to a person \u2014 are reported under\n`dropped` rather than emitted as blank rows. The\nbundle must contain at least one Patient resource.\n",
|
|
3025
3038
|
"requestBody": {
|
|
3026
3039
|
"required": true,
|
|
3027
3040
|
"content": {
|
|
@@ -6403,6 +6416,80 @@
|
|
|
6403
6416
|
"x-service": "tools"
|
|
6404
6417
|
}
|
|
6405
6418
|
},
|
|
6419
|
+
"/transcribe": {
|
|
6420
|
+
"post": {
|
|
6421
|
+
"tags": [
|
|
6422
|
+
"Voice / Voice"
|
|
6423
|
+
],
|
|
6424
|
+
"operationId": "voice_transcribe",
|
|
6425
|
+
"summary": "Transcribe audio",
|
|
6426
|
+
"description": "Transcribes an uploaded audio recording and returns the transcript.\nSend the raw audio bytes as the request body; the audio format is\ndetected automatically (WAV, FLAC, MP3, OGG/WebM Opus).\n\nSupports up to ~5 minutes of audio per request. This limit is on audio\nduration regardless of file size or format, so a compressed recording\nwithin the size limit can still be rejected for being too long. Pair the\ntranscript with a downstream text step (e.g. `POST /lang2fhir/create`)\nto turn it into a FHIR resource.\n",
|
|
6427
|
+
"parameters": [
|
|
6428
|
+
{
|
|
6429
|
+
"name": "language",
|
|
6430
|
+
"in": "query",
|
|
6431
|
+
"description": "BCP-47 language tag, repeatable for up to 4 candidate languages. Defaults to `en-US`.",
|
|
6432
|
+
"schema": {
|
|
6433
|
+
"type": "array",
|
|
6434
|
+
"items": {
|
|
6435
|
+
"type": "string"
|
|
6436
|
+
}
|
|
6437
|
+
}
|
|
6438
|
+
}
|
|
6439
|
+
],
|
|
6440
|
+
"requestBody": {
|
|
6441
|
+
"required": true,
|
|
6442
|
+
"description": "Raw audio bytes (WAV, FLAC, MP3, or OGG/WebM Opus).",
|
|
6443
|
+
"content": {
|
|
6444
|
+
"application/octet-stream": {
|
|
6445
|
+
"schema": {
|
|
6446
|
+
"type": "string",
|
|
6447
|
+
"format": "binary"
|
|
6448
|
+
}
|
|
6449
|
+
}
|
|
6450
|
+
}
|
|
6451
|
+
},
|
|
6452
|
+
"responses": {
|
|
6453
|
+
"200": {
|
|
6454
|
+
"description": "Transcription succeeded.",
|
|
6455
|
+
"content": {
|
|
6456
|
+
"application/json": {
|
|
6457
|
+
"schema": {
|
|
6458
|
+
"$ref": "#/components/schemas/voice_TranscribeResponse"
|
|
6459
|
+
}
|
|
6460
|
+
}
|
|
6461
|
+
}
|
|
6462
|
+
},
|
|
6463
|
+
"400": {
|
|
6464
|
+
"description": "Invalid request (empty body, too many languages, no transcript produced, or audio that is too long or in an unsupported format)"
|
|
6465
|
+
},
|
|
6466
|
+
"401": {
|
|
6467
|
+
"description": "Unauthorized"
|
|
6468
|
+
},
|
|
6469
|
+
"402": {
|
|
6470
|
+
"description": "Payment required (credits exhausted or subscription inactive)"
|
|
6471
|
+
},
|
|
6472
|
+
"413": {
|
|
6473
|
+
"description": "Audio exceeds the maximum size"
|
|
6474
|
+
},
|
|
6475
|
+
"502": {
|
|
6476
|
+
"description": "Speech recognition failed"
|
|
6477
|
+
},
|
|
6478
|
+
"503": {
|
|
6479
|
+
"description": "Transcription temporarily unavailable"
|
|
6480
|
+
},
|
|
6481
|
+
"504": {
|
|
6482
|
+
"description": "Transcription timed out"
|
|
6483
|
+
}
|
|
6484
|
+
},
|
|
6485
|
+
"security": [
|
|
6486
|
+
{
|
|
6487
|
+
"bearerAuth": []
|
|
6488
|
+
}
|
|
6489
|
+
],
|
|
6490
|
+
"x-service": "voice"
|
|
6491
|
+
}
|
|
6492
|
+
},
|
|
6406
6493
|
"/workflows": {
|
|
6407
6494
|
"get": {
|
|
6408
6495
|
"operationId": "workflows_list",
|
|
@@ -7345,7 +7432,7 @@
|
|
|
7345
7432
|
},
|
|
7346
7433
|
"session_id": {
|
|
7347
7434
|
"type": "string",
|
|
7348
|
-
"description": "Optional session ID for conversation continuity",
|
|
7435
|
+
"description": "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.",
|
|
7349
7436
|
"example": "session-abc123"
|
|
7350
7437
|
},
|
|
7351
7438
|
"agent_id": {
|
|
@@ -7381,7 +7468,7 @@
|
|
|
7381
7468
|
},
|
|
7382
7469
|
"session_id": {
|
|
7383
7470
|
"type": "string",
|
|
7384
|
-
"description": "Optional session ID for conversation continuity",
|
|
7471
|
+
"description": "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.",
|
|
7385
7472
|
"example": "session-abc123"
|
|
7386
7473
|
},
|
|
7387
7474
|
"agent_id": {
|
|
@@ -8544,7 +8631,7 @@
|
|
|
8544
8631
|
"fhir_resources": {
|
|
8545
8632
|
"type": "object",
|
|
8546
8633
|
"additionalProperties": true,
|
|
8547
|
-
"description": "FHIR resources (single resource or Bundle). Must contain at least one\nPatient resource.
|
|
8634
|
+
"description": "FHIR resources (single resource or Bundle). Must contain at least one\nPatient resource. Supported row-producing resources are Patient,\nEncounter, Condition, Procedure, MedicationRequest,\nMedicationStatement, MedicationAdministration, Immunization,\nObservation, and AllergyIntolerance. Standalone Medication resources\nare consumed by medication references rather than mapped to their own\ntable. Other resource types are accepted but ignored.\n"
|
|
8548
8635
|
}
|
|
8549
8636
|
}
|
|
8550
8637
|
},
|
|
@@ -8569,7 +8656,7 @@
|
|
|
8569
8656
|
},
|
|
8570
8657
|
"dropped": {
|
|
8571
8658
|
"type": "array",
|
|
8572
|
-
"description": "
|
|
8659
|
+
"description": "Supported resource instances that could not be shaped into an OMOP\nrow because required subject/patient, code, or medication reference\ndata was missing. Unsupported resource types are ignored and do not\nappear here.\n",
|
|
8573
8660
|
"items": {
|
|
8574
8661
|
"$ref": "#/components/schemas/fhir2omop_DroppedResource"
|
|
8575
8662
|
}
|
|
@@ -9323,6 +9410,7 @@
|
|
|
9323
9410
|
"type": "string",
|
|
9324
9411
|
"description": "Type of FHIR server provider.\n\nThe \"sandbox\" provider type is managed internally and cannot be created via API.\nIt is used on shared instances.\n",
|
|
9325
9412
|
"enum": [
|
|
9413
|
+
"aidbox",
|
|
9326
9414
|
"athenahealth",
|
|
9327
9415
|
"canvas",
|
|
9328
9416
|
"cerner",
|
|
@@ -11037,6 +11125,18 @@
|
|
|
11037
11125
|
}
|
|
11038
11126
|
}
|
|
11039
11127
|
},
|
|
11128
|
+
"voice_TranscribeResponse": {
|
|
11129
|
+
"type": "object",
|
|
11130
|
+
"required": [
|
|
11131
|
+
"transcript"
|
|
11132
|
+
],
|
|
11133
|
+
"properties": {
|
|
11134
|
+
"transcript": {
|
|
11135
|
+
"type": "string",
|
|
11136
|
+
"description": "The full transcript of the audio."
|
|
11137
|
+
}
|
|
11138
|
+
}
|
|
11139
|
+
},
|
|
11040
11140
|
"workflows_CreateWorkflowRequest": {
|
|
11041
11141
|
"type": "object",
|
|
11042
11142
|
"required": [
|
|
@@ -11825,6 +11925,10 @@
|
|
|
11825
11925
|
{
|
|
11826
11926
|
"name": "Tools / MCP Tools",
|
|
11827
11927
|
"description": "List and manage individual tools exposed by an MCP server."
|
|
11928
|
+
},
|
|
11929
|
+
{
|
|
11930
|
+
"name": "Voice / Voice",
|
|
11931
|
+
"description": "Speech-to-text transcription of audio recordings."
|
|
11828
11932
|
}
|
|
11829
11933
|
]
|
|
11830
11934
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phenoml",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -220,6 +220,17 @@
|
|
|
220
220
|
},
|
|
221
221
|
"default": "./dist/cjs/api/resources/tools/resources/mcpTools/exports.js"
|
|
222
222
|
},
|
|
223
|
+
"./voice": {
|
|
224
|
+
"import": {
|
|
225
|
+
"types": "./dist/esm/api/resources/voice/resources/voice/exports.d.mts",
|
|
226
|
+
"default": "./dist/esm/api/resources/voice/resources/voice/exports.mjs"
|
|
227
|
+
},
|
|
228
|
+
"require": {
|
|
229
|
+
"types": "./dist/cjs/api/resources/voice/resources/voice/exports.d.ts",
|
|
230
|
+
"default": "./dist/cjs/api/resources/voice/resources/voice/exports.js"
|
|
231
|
+
},
|
|
232
|
+
"default": "./dist/cjs/api/resources/voice/resources/voice/exports.js"
|
|
233
|
+
},
|
|
223
234
|
"./workflows": {
|
|
224
235
|
"import": {
|
|
225
236
|
"types": "./dist/esm/api/resources/workflows/exports.d.mts",
|
package/reference.md
CHANGED
|
@@ -2677,6 +2677,32 @@ Maps a FHIR R4 resource or Bundle into OMOP Common Data Model v5.4 rows
|
|
|
2677
2677
|
(person, visit_occurrence, condition_occurrence, drug_exposure,
|
|
2678
2678
|
procedure_occurrence, measurement, observation).
|
|
2679
2679
|
|
|
2680
|
+
Resource support is intentionally limited to the OMOP tables returned by
|
|
2681
|
+
this endpoint:
|
|
2682
|
+
- `Patient` -> `person`
|
|
2683
|
+
- `Encounter` -> `visit_occurrence`
|
|
2684
|
+
- `Condition` -> `condition_occurrence`
|
|
2685
|
+
- `Procedure` -> `procedure_occurrence`
|
|
2686
|
+
- `MedicationRequest`, `MedicationStatement`, and
|
|
2687
|
+
`MedicationAdministration` -> `drug_exposure`
|
|
2688
|
+
- `Immunization` -> `drug_exposure`
|
|
2689
|
+
- `Observation` with a numeric `valueQuantity`, `valueInteger`, or
|
|
2690
|
+
numeric-looking `valueString` (for example `"<2"`) -> `measurement`
|
|
2691
|
+
- non-numeric `Observation` -> `observation`
|
|
2692
|
+
- `AllergyIntolerance` -> `observation`
|
|
2693
|
+
|
|
2694
|
+
`Medication` is supported only as reference data for medication
|
|
2695
|
+
resources; it is not emitted as its own row because OMOP CDM has no
|
|
2696
|
+
Medication table. Other reference/admin resources such as `Practitioner`,
|
|
2697
|
+
`Organization`, `Location`, `Coverage`, and `Claim`, and clinical
|
|
2698
|
+
workflow/document resources such as `DiagnosticReport`, `ServiceRequest`,
|
|
2699
|
+
`CarePlan`, `DocumentReference`, `Composition`, `Specimen`, and
|
|
2700
|
+
`DeviceUseStatement`, are currently accepted in a Bundle but are not
|
|
2701
|
+
shaped into OMOP rows. Unsupported resource types are ignored rather than
|
|
2702
|
+
listed under `dropped`; `dropped` is reserved for supported resource types
|
|
2703
|
+
that were missing the subject/patient, code, or medication reference data
|
|
2704
|
+
needed to produce a valid row.
|
|
2705
|
+
|
|
2680
2706
|
Each resource's primary clinical coding is resolved to a standard OMOP
|
|
2681
2707
|
`concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
|
|
2682
2708
|
response carries `mappings` (how each source coding resolved, linked back
|
|
@@ -4887,6 +4913,7 @@ await client.tools.mcpTools.delete("mcp_server_tool_id");
|
|
|
4887
4913
|
</dl>
|
|
4888
4914
|
</details>
|
|
4889
4915
|
|
|
4916
|
+
## Voice
|
|
4890
4917
|
## Workflows
|
|
4891
4918
|
<details><summary><code>client.workflows.<a href="/src/api/resources/workflows/client/Client.ts">list</a>({ ...params }) -> phenoml.ListWorkflowsResponse</code></summary>
|
|
4892
4919
|
<dl>
|