@premai/api-sdk 1.0.29
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/README.md +899 -0
- package/dist/audio/index.d.ts +42 -0
- package/dist/cli.cjs +1684 -0
- package/dist/cli.d.ts +2 -0
- package/dist/config.d.ts +7 -0
- package/dist/core.browser.cjs +1404 -0
- package/dist/core.browser.mjs +1404 -0
- package/dist/core.d.ts +37 -0
- package/dist/files/index.d.ts +16 -0
- package/dist/index.cjs +1755 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +1691 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/rvenc/index.d.ts +4 -0
- package/dist/server.d.ts +5 -0
- package/dist/tools/index.d.ts +23 -0
- package/dist/types.d.ts +364 -0
- package/dist/utils/attestation.d.ts +15 -0
- package/dist/utils/crypto.d.ts +20 -0
- package/dist/utils/dek-store.d.ts +7 -0
- package/dist/utils/error.d.ts +1 -0
- package/dist/utils/files.d.ts +2 -0
- package/package.json +62 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ListModelsParams, ListModelsResponse } from "../types";
|
|
2
|
+
export interface ModelsClient {
|
|
3
|
+
list: (params?: ListModelsParams) => Promise<ListModelsResponse["data"]>;
|
|
4
|
+
}
|
|
5
|
+
export declare function createModelsClient(apiKey: string, timeoutMs?: number): ModelsClient;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import OpenAI, { type ClientOptions } from "openai";
|
|
2
|
+
import type { EncryptionKeys } from "../types";
|
|
3
|
+
export declare function createRvencChatClient(apiKey: string, encryptionKeys: EncryptionKeys, requestTimeoutMs: number | undefined, maxBufferSize: number | undefined, attest: boolean | undefined, OpenAIClientParams: ClientOptions): OpenAI;
|
|
4
|
+
export declare function createDecryptedStreamGenerator(reader: ReadableStreamDefaultReader<Uint8Array>, sharedSecret: Uint8Array, nonce: Uint8Array, maxBufferSize: number): AsyncGenerator<OpenAI.Chat.Completions.ChatCompletionChunk, void, unknown>;
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AudioDiarizationDecrypted, AudioDiarizationParams, AudioGenerateFromTextParams, CreateFileParams, DataFileContentDecrypted, DEKStore, DecryptedFile, GenerateImageParams, GetDataFileContentParams, GetFileContentOCRParams, GetPDFContentParams, GetSpreadsheetContentParams, GetTextDocumentContentParams, GetTimeDecrypted, GetTimeParams, ImageDescribeAndCaptionFallbackParams, ImageDescribeAndCaptionParams, PDFContentDecrypted, PowerPointContentDecrypted, PowerPointParams, SearchRagParams, SpreadsheetContentDecrypted, TextDocumentContentDecrypted, TranscribeAudioDecrypted, TranscribeParams, TranscribeWithDiarizationDecrypted, VideoDescribeAndCaptionParams, WebScraperParams, WebSearchParams } from '../types';
|
|
2
|
+
export interface ToolsClient {
|
|
3
|
+
generateImage: (params: GenerateImageParams) => Promise<DecryptedFile>;
|
|
4
|
+
audioGenerateFromText: (params: AudioGenerateFromTextParams) => Promise<DecryptedFile>;
|
|
5
|
+
createFileForUser: (params: CreateFileParams) => Promise<DecryptedFile>;
|
|
6
|
+
imageDescribeAndCaption: (params: ImageDescribeAndCaptionParams) => Promise<string>;
|
|
7
|
+
imageDescribeAndCaptionFallback: (params: ImageDescribeAndCaptionFallbackParams) => Promise<string>;
|
|
8
|
+
videoDescribeAndCaption: (params: VideoDescribeAndCaptionParams) => Promise<string>;
|
|
9
|
+
getPDFContent: (params: GetPDFContentParams) => Promise<PDFContentDecrypted>;
|
|
10
|
+
getTextDocumentContent: (params: GetTextDocumentContentParams) => Promise<TextDocumentContentDecrypted>;
|
|
11
|
+
transcribeAudioToText: (params: TranscribeParams) => Promise<TranscribeAudioDecrypted>;
|
|
12
|
+
transcribeAudioWithDiarization: (params: TranscribeParams) => Promise<TranscribeWithDiarizationDecrypted>;
|
|
13
|
+
audioDiarization: (params: AudioDiarizationParams) => Promise<AudioDiarizationDecrypted>;
|
|
14
|
+
getFileContentOCR: (params: GetFileContentOCRParams) => Promise<string>;
|
|
15
|
+
getSpreadsheetContent: (params: GetSpreadsheetContentParams) => Promise<SpreadsheetContentDecrypted>;
|
|
16
|
+
getDataFileContent: (params: GetDataFileContentParams) => Promise<DataFileContentDecrypted>;
|
|
17
|
+
getPowerPointContent: (params: PowerPointParams) => Promise<PowerPointContentDecrypted>;
|
|
18
|
+
getTime: (params: GetTimeParams) => Promise<GetTimeDecrypted>;
|
|
19
|
+
webSearchTool: (params: WebSearchParams) => Promise<string>;
|
|
20
|
+
webPageScraperTool: (params: WebScraperParams) => Promise<string>;
|
|
21
|
+
searchRag: (params: SearchRagParams) => Promise<string>;
|
|
22
|
+
}
|
|
23
|
+
export declare function createToolsClient(apiKey: string, dekStore: DEKStore, clientKEK?: string, timeoutMs?: number, attest?: boolean): ToolsClient;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
export interface EncryptionKeys {
|
|
2
|
+
sharedSecret: Uint8Array;
|
|
3
|
+
cipherText: Uint8Array;
|
|
4
|
+
}
|
|
5
|
+
export interface ApiErrorResponse {
|
|
6
|
+
status: number;
|
|
7
|
+
data: null;
|
|
8
|
+
error: string | null;
|
|
9
|
+
message: string | null;
|
|
10
|
+
env?: string;
|
|
11
|
+
log?: string | null;
|
|
12
|
+
validator?: unknown;
|
|
13
|
+
support_id?: string | null;
|
|
14
|
+
}
|
|
15
|
+
export interface DEKStore {
|
|
16
|
+
fileDEKs?: Map<string, Uint8Array>;
|
|
17
|
+
ragDEK?: Uint8Array;
|
|
18
|
+
ragVersion?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FileUploadOptions {
|
|
21
|
+
file: Uint8Array;
|
|
22
|
+
fileName: string;
|
|
23
|
+
mimeType?: string;
|
|
24
|
+
ragIndex?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface UploadedFile {
|
|
27
|
+
id: string;
|
|
28
|
+
version: string;
|
|
29
|
+
kid: string;
|
|
30
|
+
wrapped_dek: string;
|
|
31
|
+
original_name: string;
|
|
32
|
+
file_name: string;
|
|
33
|
+
file_path: string;
|
|
34
|
+
file_size: number;
|
|
35
|
+
is_duplicate: boolean;
|
|
36
|
+
type: string;
|
|
37
|
+
mime_type: string;
|
|
38
|
+
created_at: string;
|
|
39
|
+
updated_at: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface EncryptedResponse {
|
|
42
|
+
encryptedResponse: string;
|
|
43
|
+
nonce: string;
|
|
44
|
+
}
|
|
45
|
+
export interface EncryptedResponseData {
|
|
46
|
+
data: EncryptedResponse;
|
|
47
|
+
}
|
|
48
|
+
export interface UploadedFileResponse {
|
|
49
|
+
status: number;
|
|
50
|
+
data: UploadedFile;
|
|
51
|
+
error?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface DecryptedFile {
|
|
54
|
+
fileId?: string;
|
|
55
|
+
fileName: string;
|
|
56
|
+
mimeType: string;
|
|
57
|
+
content: Uint8Array;
|
|
58
|
+
fileSize: number;
|
|
59
|
+
}
|
|
60
|
+
export interface FileMetadata {
|
|
61
|
+
id: string;
|
|
62
|
+
user_id: string;
|
|
63
|
+
organization_id: string;
|
|
64
|
+
hash: string;
|
|
65
|
+
version: string;
|
|
66
|
+
kid: string;
|
|
67
|
+
wrapped_dek: string;
|
|
68
|
+
original_name: string;
|
|
69
|
+
file_name: string;
|
|
70
|
+
file_path: string;
|
|
71
|
+
mime_type: string;
|
|
72
|
+
file_size: number;
|
|
73
|
+
type: string;
|
|
74
|
+
created_at: string;
|
|
75
|
+
updated_at: string | null;
|
|
76
|
+
rag_status: string | null;
|
|
77
|
+
url: string;
|
|
78
|
+
is_duplicate?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export interface ListFilesOptions {
|
|
81
|
+
limit?: number;
|
|
82
|
+
offset?: number;
|
|
83
|
+
search?: string;
|
|
84
|
+
from?: string;
|
|
85
|
+
to?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface PaginationInfo {
|
|
88
|
+
total: number;
|
|
89
|
+
page: number;
|
|
90
|
+
limit: number;
|
|
91
|
+
pages: number;
|
|
92
|
+
}
|
|
93
|
+
export interface ListFilesResponse {
|
|
94
|
+
status: number;
|
|
95
|
+
data: {
|
|
96
|
+
files: FileMetadata[];
|
|
97
|
+
pagination: PaginationInfo;
|
|
98
|
+
};
|
|
99
|
+
error?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface GetFileOptions {
|
|
102
|
+
id: string;
|
|
103
|
+
url?: boolean;
|
|
104
|
+
}
|
|
105
|
+
export interface DeleteFileOptions {
|
|
106
|
+
id: string;
|
|
107
|
+
}
|
|
108
|
+
export interface DeleteFileResponse {
|
|
109
|
+
message: string;
|
|
110
|
+
}
|
|
111
|
+
export interface IndexFileInput {
|
|
112
|
+
fileId: string;
|
|
113
|
+
filePath: string;
|
|
114
|
+
fileDEK?: Uint8Array;
|
|
115
|
+
}
|
|
116
|
+
export interface IndexFilesOptions {
|
|
117
|
+
files: IndexFileInput[];
|
|
118
|
+
ragDEK?: Uint8Array;
|
|
119
|
+
}
|
|
120
|
+
export interface IndexFilesResponse {
|
|
121
|
+
data: {
|
|
122
|
+
results: Array<{
|
|
123
|
+
file_id: string;
|
|
124
|
+
rag_status: 'running' | 'stopped' | 'failure' | 'success' | null;
|
|
125
|
+
success: boolean;
|
|
126
|
+
error?: string;
|
|
127
|
+
}>;
|
|
128
|
+
enclave_response?: Record<string, unknown>;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export interface DeleteIndexOptions {
|
|
132
|
+
fileIds: string[];
|
|
133
|
+
ragDEK?: Uint8Array;
|
|
134
|
+
}
|
|
135
|
+
export interface DeleteIndexResponse {
|
|
136
|
+
data: {
|
|
137
|
+
results: Array<{
|
|
138
|
+
file_id: string;
|
|
139
|
+
success: boolean;
|
|
140
|
+
error?: string;
|
|
141
|
+
}>;
|
|
142
|
+
enclave_response?: Record<string, unknown>;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export interface GenerateImageParams {
|
|
146
|
+
prompt: string;
|
|
147
|
+
}
|
|
148
|
+
export interface AudioGenerateFromTextParams {
|
|
149
|
+
text: string;
|
|
150
|
+
}
|
|
151
|
+
export interface ImageDescribeAndCaptionParams {
|
|
152
|
+
fileId: string;
|
|
153
|
+
}
|
|
154
|
+
export interface ImageDescribeAndCaptionFallbackParams {
|
|
155
|
+
fileId: string;
|
|
156
|
+
}
|
|
157
|
+
export interface VideoDescribeAndCaptionParams {
|
|
158
|
+
fileId: string;
|
|
159
|
+
}
|
|
160
|
+
export interface GetPDFContentParams {
|
|
161
|
+
fileId: string;
|
|
162
|
+
}
|
|
163
|
+
export interface GetTextDocumentContentParams {
|
|
164
|
+
fileId: string;
|
|
165
|
+
}
|
|
166
|
+
export interface GetSpreadsheetContentParams {
|
|
167
|
+
fileId: string;
|
|
168
|
+
}
|
|
169
|
+
export interface GetDataFileContentParams {
|
|
170
|
+
fileId: string;
|
|
171
|
+
}
|
|
172
|
+
export interface GetPowerPointContentParams {
|
|
173
|
+
fileId: string;
|
|
174
|
+
slideNumbers?: number[];
|
|
175
|
+
}
|
|
176
|
+
export interface GetTimeParams {
|
|
177
|
+
timezone: string;
|
|
178
|
+
}
|
|
179
|
+
export interface SearchRagParams {
|
|
180
|
+
query: string;
|
|
181
|
+
}
|
|
182
|
+
export interface GetFileContentOCRParams {
|
|
183
|
+
fileId: string;
|
|
184
|
+
}
|
|
185
|
+
export interface AudioDiarizationParams {
|
|
186
|
+
fileId: string;
|
|
187
|
+
}
|
|
188
|
+
export interface CreateFileParams {
|
|
189
|
+
fileName: string;
|
|
190
|
+
fileExtension: string;
|
|
191
|
+
fileContent: string;
|
|
192
|
+
mimeType: string;
|
|
193
|
+
}
|
|
194
|
+
export interface TranscribeParams {
|
|
195
|
+
fileId: string;
|
|
196
|
+
language?: string;
|
|
197
|
+
}
|
|
198
|
+
export interface PowerPointParams {
|
|
199
|
+
fileId: string;
|
|
200
|
+
slideNumbers?: number[];
|
|
201
|
+
}
|
|
202
|
+
export interface WebSearchParams {
|
|
203
|
+
query: string;
|
|
204
|
+
country?: string;
|
|
205
|
+
searchLang?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface WebScraperParams {
|
|
208
|
+
url: string;
|
|
209
|
+
renderJs?: boolean;
|
|
210
|
+
}
|
|
211
|
+
export interface GetFileResponse {
|
|
212
|
+
status: number;
|
|
213
|
+
data: FileMetadata;
|
|
214
|
+
error?: string;
|
|
215
|
+
}
|
|
216
|
+
export interface FileOutputResponse {
|
|
217
|
+
fileId: string;
|
|
218
|
+
fileName: string;
|
|
219
|
+
fileSize: number;
|
|
220
|
+
handle: string;
|
|
221
|
+
mimeType: string;
|
|
222
|
+
s3Path: string;
|
|
223
|
+
success: boolean;
|
|
224
|
+
message?: string;
|
|
225
|
+
}
|
|
226
|
+
export interface EncryptedToolResponse {
|
|
227
|
+
encryptedResponse: string;
|
|
228
|
+
nonce: string;
|
|
229
|
+
_decryptedResponse?: unknown;
|
|
230
|
+
}
|
|
231
|
+
export interface GetTimeDecrypted {
|
|
232
|
+
now: string;
|
|
233
|
+
timezone: string;
|
|
234
|
+
}
|
|
235
|
+
export interface PDFContentDecrypted {
|
|
236
|
+
chunks: Array<{
|
|
237
|
+
pageContent: string;
|
|
238
|
+
metadata: Record<string, unknown>;
|
|
239
|
+
}>;
|
|
240
|
+
}
|
|
241
|
+
export interface TextDocumentContentDecrypted {
|
|
242
|
+
content: string;
|
|
243
|
+
chunks?: Array<{
|
|
244
|
+
pageContent: string;
|
|
245
|
+
metadata: Record<string, unknown>;
|
|
246
|
+
}>;
|
|
247
|
+
format: string;
|
|
248
|
+
wordCount?: number;
|
|
249
|
+
error?: string;
|
|
250
|
+
}
|
|
251
|
+
export interface TranscribeAudioDecrypted {
|
|
252
|
+
text: string;
|
|
253
|
+
segments?: Array<{
|
|
254
|
+
id: number;
|
|
255
|
+
start: number;
|
|
256
|
+
end: number;
|
|
257
|
+
text: string;
|
|
258
|
+
}>;
|
|
259
|
+
language?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface TranscribeWithDiarizationDecrypted {
|
|
262
|
+
segments: Array<{
|
|
263
|
+
speaker: string;
|
|
264
|
+
start: number;
|
|
265
|
+
end: number;
|
|
266
|
+
text: string;
|
|
267
|
+
}>;
|
|
268
|
+
speakers: string[];
|
|
269
|
+
totalDuration?: number;
|
|
270
|
+
totalWords?: number;
|
|
271
|
+
detectedLanguage?: string;
|
|
272
|
+
}
|
|
273
|
+
export interface SpreadsheetContentDecrypted {
|
|
274
|
+
format: 'csv' | 'xlsx';
|
|
275
|
+
data?: unknown[][];
|
|
276
|
+
sheets?: Array<{
|
|
277
|
+
name: string;
|
|
278
|
+
data: unknown[][];
|
|
279
|
+
preview?: string;
|
|
280
|
+
}>;
|
|
281
|
+
preview?: string;
|
|
282
|
+
rowCount: number;
|
|
283
|
+
columnCount: number;
|
|
284
|
+
error?: string;
|
|
285
|
+
}
|
|
286
|
+
export interface DataFileContentDecrypted {
|
|
287
|
+
format: 'json' | 'xml';
|
|
288
|
+
content: string;
|
|
289
|
+
summary?: {
|
|
290
|
+
type?: string;
|
|
291
|
+
length?: number;
|
|
292
|
+
keys?: string[];
|
|
293
|
+
keyCount?: number;
|
|
294
|
+
rootTag?: string;
|
|
295
|
+
elementCount?: number;
|
|
296
|
+
};
|
|
297
|
+
error?: string;
|
|
298
|
+
}
|
|
299
|
+
export interface PowerPointContentDecrypted {
|
|
300
|
+
slides: Array<{
|
|
301
|
+
slideNumber: number;
|
|
302
|
+
text: string;
|
|
303
|
+
notes?: string;
|
|
304
|
+
hasImages?: boolean;
|
|
305
|
+
imageCount?: number;
|
|
306
|
+
recommendedOcr?: boolean;
|
|
307
|
+
textLength?: number;
|
|
308
|
+
}>;
|
|
309
|
+
totalSlides: number;
|
|
310
|
+
format: string;
|
|
311
|
+
formattedContent: string;
|
|
312
|
+
ocrSummary?: {
|
|
313
|
+
slidesNeedingOcr?: number;
|
|
314
|
+
slidesWithImages?: number;
|
|
315
|
+
slidesWithMinimalText?: number;
|
|
316
|
+
};
|
|
317
|
+
error?: string;
|
|
318
|
+
}
|
|
319
|
+
export interface AudioDiarizationDecrypted {
|
|
320
|
+
speakers: Array<{
|
|
321
|
+
speaker: string;
|
|
322
|
+
segments: unknown[];
|
|
323
|
+
}>;
|
|
324
|
+
}
|
|
325
|
+
export type ExecuteToolResponse = FileOutputResponse | EncryptedToolResponse;
|
|
326
|
+
export interface ExecuteToolResponseWrapper {
|
|
327
|
+
status: number;
|
|
328
|
+
data: ExecuteToolResponse;
|
|
329
|
+
error?: string;
|
|
330
|
+
}
|
|
331
|
+
export type ServerOptions = {
|
|
332
|
+
host?: string;
|
|
333
|
+
port?: number;
|
|
334
|
+
proxyUrl?: string;
|
|
335
|
+
enclaveUrl?: string;
|
|
336
|
+
kek?: string;
|
|
337
|
+
attest?: boolean;
|
|
338
|
+
};
|
|
339
|
+
export interface ListModelsParams {
|
|
340
|
+
type?: string;
|
|
341
|
+
}
|
|
342
|
+
export interface ModelPriceConfig {
|
|
343
|
+
prompt_price_per_k: number;
|
|
344
|
+
audio_price_per_min: number;
|
|
345
|
+
reasoning_price_per_k: number;
|
|
346
|
+
completion_price_per_k: number;
|
|
347
|
+
}
|
|
348
|
+
export interface Model {
|
|
349
|
+
id: number;
|
|
350
|
+
name: string;
|
|
351
|
+
description: string;
|
|
352
|
+
model: string;
|
|
353
|
+
type: string;
|
|
354
|
+
enabled: number;
|
|
355
|
+
input_modalities: string[];
|
|
356
|
+
price_config: ModelPriceConfig | null;
|
|
357
|
+
created_at: string;
|
|
358
|
+
requires_auth: number;
|
|
359
|
+
}
|
|
360
|
+
export interface ListModelsResponse {
|
|
361
|
+
status: number;
|
|
362
|
+
data: Model[];
|
|
363
|
+
error?: string;
|
|
364
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GatewayError } from "@premai/prem-rs";
|
|
2
|
+
type AttestationError = Error & {
|
|
3
|
+
cause: string[];
|
|
4
|
+
kind?: GatewayError;
|
|
5
|
+
};
|
|
6
|
+
export declare function isAttestationError(err: unknown): err is AttestationError;
|
|
7
|
+
export declare function isGatewayError(err: unknown): err is AttestationError & {
|
|
8
|
+
kind: GatewayError;
|
|
9
|
+
};
|
|
10
|
+
export declare function getGatewayErrorMessage(err: unknown): string | null;
|
|
11
|
+
export declare function attest(apiKey: string, options?: {
|
|
12
|
+
model?: string;
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
}): Promise<string | null>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { EncryptionKeys } from '../types';
|
|
2
|
+
export declare function createMLKEMEncapsulation(publicKeyHex: string): EncryptionKeys;
|
|
3
|
+
export declare function encryptPayload(sharedSecret: Uint8Array, data: Uint8Array | string | object): {
|
|
4
|
+
encrypted: Uint8Array;
|
|
5
|
+
nonce: Uint8Array;
|
|
6
|
+
};
|
|
7
|
+
export declare function decryptPayload<T>(encryptedData: string, sharedSecret: Uint8Array, nonce: Uint8Array): T;
|
|
8
|
+
export declare function getEnclavePublicKey(timeoutMs?: number): Promise<string>;
|
|
9
|
+
export declare function generateEncryptionKeys(timeoutMs?: number): Promise<EncryptionKeys>;
|
|
10
|
+
export declare function keyIdFromKEK(kek: Uint8Array, context?: string, length?: number): Uint8Array;
|
|
11
|
+
export declare function encryptWithDEK(dek: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
12
|
+
export declare function encryptMetadataWithDEK(dek: Uint8Array, metadata: string): string;
|
|
13
|
+
export declare function wrapDEK(kek: Uint8Array, dek: Uint8Array): Uint8Array;
|
|
14
|
+
export declare function unwrapDEK(kek: Uint8Array, wrappedDEK: Uint8Array): Uint8Array;
|
|
15
|
+
export declare function decryptWithDEK(dek: Uint8Array, encryptedContent: Uint8Array): Uint8Array;
|
|
16
|
+
export declare function generateKidAndWrappedDEK(publicKeyHex: string, dek: Uint8Array, sharedSecret: Uint8Array): {
|
|
17
|
+
kid: string;
|
|
18
|
+
wrappedDEK: string;
|
|
19
|
+
wrappedDEKNonce: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DEKStore } from '../types';
|
|
2
|
+
export declare function initializeDEKStore(clientKEK?: string): DEKStore;
|
|
3
|
+
export declare function serializeDEKStore(store: DEKStore): string;
|
|
4
|
+
export declare function deserializeDEKStore(serialized: string): DEKStore;
|
|
5
|
+
export declare function getClientKEK(): Uint8Array;
|
|
6
|
+
export declare function getClientKID(clientKEK?: string): string;
|
|
7
|
+
export declare function generateNewClientKEK(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function throwIfErrorResponse(response: Response): Promise<never>;
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repository": {
|
|
3
|
+
"url": "https://github.com/premai-io/api-sdk-ts"
|
|
4
|
+
},
|
|
5
|
+
"homepage": "https://github.com/premai-io/api-sdk-ts",
|
|
6
|
+
"name": "@premai/api-sdk",
|
|
7
|
+
"version": "1.0.29",
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"bin": {
|
|
10
|
+
"pcci-proxy": "./dist/cli.cjs"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [],
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"description": "",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"node": "./dist/index.cjs",
|
|
19
|
+
"require": "./dist/index.cjs",
|
|
20
|
+
"import": "./dist/index.mjs",
|
|
21
|
+
"types": "./dist/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./browser": {
|
|
24
|
+
"require": "./dist/core.browser.cjs",
|
|
25
|
+
"import": "./dist/core.browser.mjs",
|
|
26
|
+
"types": "./dist/index.d.ts"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"./dist",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "bun run script.ts",
|
|
35
|
+
"build": "bun run types && bun scripts/build.ts",
|
|
36
|
+
"types": "tsc --emitDeclarationOnly",
|
|
37
|
+
"server": "bun run src/server.ts"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@deepgram/sdk": "^5.0.0",
|
|
41
|
+
"@noble/ciphers": "^2.1.1",
|
|
42
|
+
"@noble/curves": "^1.8.1",
|
|
43
|
+
"@noble/hashes": "^1.7.1",
|
|
44
|
+
"@noble/post-quantum": "^0.5.2",
|
|
45
|
+
"@premai/prem-rs": "0.3.0",
|
|
46
|
+
"date-fns": "^4.1.0",
|
|
47
|
+
"dotenv": "^17.2.3",
|
|
48
|
+
"express": "^4.18.2",
|
|
49
|
+
"multer": "^2.0.2",
|
|
50
|
+
"openai": "^6.9.1",
|
|
51
|
+
"typescript": "^5.9.3",
|
|
52
|
+
"zod": "^4.2.1"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@biomejs/biome": "2.3.10",
|
|
56
|
+
"@types/express": "^4.17.21",
|
|
57
|
+
"@types/multer": "^2.0.0",
|
|
58
|
+
"@types/bun": "^1.3.6",
|
|
59
|
+
"@types/node": "^22.15.21",
|
|
60
|
+
"ts-node": "^10.9.2"
|
|
61
|
+
}
|
|
62
|
+
}
|