@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/dist/core.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ import type OpenAI from "openai";
2
+ import type { ClientOptions } from "openai";
3
+ import { type AudioClient } from "./audio";
4
+ import { type endpointsT } from "./config";
5
+ import { type FilesClient } from "./files";
6
+ import { type ModelsClient } from "./models";
7
+ import { type ToolsClient } from "./tools";
8
+ import type { DEKStore, EncryptionKeys } from "./types";
9
+ export interface RvencClientOptions {
10
+ apiKey: string;
11
+ attest?: boolean;
12
+ encryptionKeys?: EncryptionKeys;
13
+ clientKEK?: string;
14
+ dekStore?: DEKStore;
15
+ requestTimeoutMs?: number;
16
+ maxBufferSize?: number;
17
+ config?: {
18
+ endpoints?: endpointsT;
19
+ openAIClientOptions?: ClientOptions;
20
+ };
21
+ }
22
+ export interface RvencClient extends Omit<OpenAI, "files" | "audio" | "models"> {
23
+ files: FilesClient;
24
+ tools: ToolsClient;
25
+ audio: AudioClient;
26
+ dekStore: DEKStore;
27
+ models: ModelsClient;
28
+ }
29
+ export declare function createRvencClient(options: RvencClientOptions): Promise<RvencClient>;
30
+ export type { ModelsClient } from "./models";
31
+ export type { ToolsClient } from "./tools";
32
+ export type { ApiErrorResponse, DEKStore, DecryptedFile, DeleteFileOptions, DeleteFileResponse, DeleteIndexOptions, DeleteIndexResponse, EncryptionKeys, FileMetadata, FileUploadOptions, GetFileOptions, IndexFileInput, IndexFilesOptions, IndexFilesResponse, ListFilesOptions, ListFilesResponse, ListModelsParams, ListModelsResponse, Model, PaginationInfo, UploadedFile } from "./types";
33
+ export { generateEncryptionKeys } from "./utils/crypto";
34
+ export { deserializeDEKStore, generateNewClientKEK, getClientKEK, getClientKID, initializeDEKStore, serializeDEKStore, } from "./utils/dek-store";
35
+ export type { OpenAI };
36
+ export { getGatewayErrorMessage, isAttestationError, isGatewayError } from './utils/attestation';
37
+ export default createRvencClient;
@@ -0,0 +1,16 @@
1
+ import type { DEKStore, DeleteFileOptions, DeleteIndexOptions, DeleteIndexResponse, FileMetadata, FileUploadOptions, GetFileOptions, IndexFilesOptions, IndexFilesResponse, ListFilesOptions, ListFilesResponse, UploadedFile } from '../types';
2
+ export declare function uploadFile(apiKey: string, dekStore: DEKStore, options: FileUploadOptions, clientKEK?: string, timeoutMs?: number): Promise<UploadedFile>;
3
+ export declare function listFiles(apiKey: string, options?: ListFilesOptions, timeoutMs?: number): Promise<ListFilesResponse['data']>;
4
+ export declare function getFile(apiKey: string, options: GetFileOptions, timeoutMs?: number): Promise<FileMetadata>;
5
+ export declare function deleteFile(apiKey: string, options: DeleteFileOptions, timeoutMs?: number): Promise<void>;
6
+ export declare function indexFiles(apiKey: string, dekStore: DEKStore, options: IndexFilesOptions, clientKEK?: string, timeoutMs?: number): Promise<IndexFilesResponse>;
7
+ export declare function deleteIndex(apiKey: string, dekStore: DEKStore, options: DeleteIndexOptions, clientKEK?: string, timeoutMs?: number): Promise<DeleteIndexResponse>;
8
+ export interface FilesClient {
9
+ upload: (options: FileUploadOptions) => Promise<UploadedFile>;
10
+ list: (options?: ListFilesOptions) => Promise<ListFilesResponse['data']>;
11
+ get: (options: GetFileOptions) => Promise<FileMetadata>;
12
+ delete: (options: DeleteFileOptions) => Promise<void>;
13
+ index: (options: IndexFilesOptions) => Promise<IndexFilesResponse>;
14
+ deleteIndex: (options: DeleteIndexOptions) => Promise<DeleteIndexResponse>;
15
+ }
16
+ export declare function createFilesClient(apiKey: string, dekStore: DEKStore, clientKEK?: string, timeoutMs?: number): FilesClient;