@gpt-platform/client 0.10.5 → 0.11.1
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/_internal/client/client.gen.d.ts +3 -0
- package/dist/_internal/client/client.gen.d.ts.map +1 -0
- package/dist/_internal/client/index.d.ts +9 -0
- package/dist/_internal/client/index.d.ts.map +1 -0
- package/dist/_internal/client/types.gen.d.ts +118 -0
- package/dist/_internal/client/types.gen.d.ts.map +1 -0
- package/dist/_internal/client/utils.gen.d.ts +34 -0
- package/dist/_internal/client/utils.gen.d.ts.map +1 -0
- package/dist/_internal/client.gen.d.ts +13 -0
- package/dist/_internal/client.gen.d.ts.map +1 -0
- package/dist/_internal/core/auth.gen.d.ts +19 -0
- package/dist/_internal/core/auth.gen.d.ts.map +1 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts +26 -0
- package/dist/_internal/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/params.gen.d.ts +44 -0
- package/dist/_internal/core/params.gen.d.ts.map +1 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts +34 -0
- package/dist/_internal/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/_internal/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/_internal/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/_internal/core/types.gen.d.ts +79 -0
- package/dist/_internal/core/types.gen.d.ts.map +1 -0
- package/dist/_internal/core/utils.gen.d.ts +20 -0
- package/dist/_internal/core/utils.gen.d.ts.map +1 -0
- package/dist/_internal/index.d.ts +3 -0
- package/dist/_internal/index.d.ts.map +1 -0
- package/dist/_internal/sdk.gen.d.ts +7053 -0
- package/dist/_internal/sdk.gen.d.ts.map +1 -0
- package/dist/_internal/types.gen.d.ts +146633 -0
- package/dist/_internal/types.gen.d.ts.map +1 -0
- package/dist/base-client.d.ts +199 -0
- package/dist/base-client.d.ts.map +1 -0
- package/dist/errors/index.d.ts +128 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/events.d.ts +69 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/execution-events.d.ts +95 -0
- package/dist/execution-events.d.ts.map +1 -0
- package/dist/gpt-client.d.ts +2175 -0
- package/dist/gpt-client.d.ts.map +1 -0
- package/dist/index.d.ts +51 -30734
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +318 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +318 -9
- package/dist/index.mjs.map +1 -1
- package/dist/json-api.d.ts +26 -0
- package/dist/json-api.d.ts.map +1 -0
- package/dist/logging.d.ts +22 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/namespace-types.d.ts +79 -0
- package/dist/namespace-types.d.ts.map +1 -0
- package/dist/namespaces/access-grants.d.ts +71 -0
- package/dist/namespaces/access-grants.d.ts.map +1 -0
- package/dist/namespaces/agents.d.ts +1406 -0
- package/dist/namespaces/agents.d.ts.map +1 -0
- package/dist/namespaces/ai.d.ts +407 -0
- package/dist/namespaces/ai.d.ts.map +1 -0
- package/dist/namespaces/audit.d.ts +83 -0
- package/dist/namespaces/audit.d.ts.map +1 -0
- package/dist/namespaces/billing.d.ts +854 -0
- package/dist/namespaces/billing.d.ts.map +1 -0
- package/dist/namespaces/campaigns.d.ts +973 -0
- package/dist/namespaces/campaigns.d.ts.map +1 -0
- package/dist/namespaces/catalog.d.ts +964 -0
- package/dist/namespaces/catalog.d.ts.map +1 -0
- package/dist/namespaces/channels.d.ts +162 -0
- package/dist/namespaces/channels.d.ts.map +1 -0
- package/dist/namespaces/clinical.d.ts +2443 -0
- package/dist/namespaces/clinical.d.ts.map +1 -0
- package/dist/namespaces/communication.d.ts +439 -0
- package/dist/namespaces/communication.d.ts.map +1 -0
- package/dist/namespaces/compliance.d.ts +2310 -0
- package/dist/namespaces/compliance.d.ts.map +1 -0
- package/dist/namespaces/connectors.d.ts +1368 -0
- package/dist/namespaces/connectors.d.ts.map +1 -0
- package/dist/namespaces/content.d.ts +188 -0
- package/dist/namespaces/content.d.ts.map +1 -0
- package/dist/namespaces/crawler.d.ts +408 -0
- package/dist/namespaces/crawler.d.ts.map +1 -0
- package/dist/namespaces/crm-clusters.d.ts +31 -0
- package/dist/namespaces/crm-clusters.d.ts.map +1 -0
- package/dist/namespaces/crm.d.ts +1539 -0
- package/dist/namespaces/crm.d.ts.map +1 -0
- package/dist/namespaces/documents.d.ts +136 -0
- package/dist/namespaces/documents.d.ts.map +1 -0
- package/dist/namespaces/email.d.ts +550 -0
- package/dist/namespaces/email.d.ts.map +1 -0
- package/dist/namespaces/extraction.d.ts +1249 -0
- package/dist/namespaces/extraction.d.ts.map +1 -0
- package/dist/namespaces/identity.d.ts +411 -0
- package/dist/namespaces/identity.d.ts.map +1 -0
- package/dist/namespaces/imports.d.ts +177 -0
- package/dist/namespaces/imports.d.ts.map +1 -0
- package/dist/namespaces/index.d.ts +119 -0
- package/dist/namespaces/index.d.ts.map +1 -0
- package/dist/namespaces/memory.d.ts +105 -0
- package/dist/namespaces/memory.d.ts.map +1 -0
- package/dist/namespaces/models.d.ts +75 -0
- package/dist/namespaces/models.d.ts.map +1 -0
- package/dist/namespaces/permissions.d.ts +75 -0
- package/dist/namespaces/permissions.d.ts.map +1 -0
- package/dist/namespaces/pipeline-executions.d.ts +130 -0
- package/dist/namespaces/pipeline-executions.d.ts.map +1 -0
- package/dist/namespaces/pipelines.d.ts +120 -0
- package/dist/namespaces/pipelines.d.ts.map +1 -0
- package/dist/namespaces/platform.d.ts +1430 -0
- package/dist/namespaces/platform.d.ts.map +1 -0
- package/dist/namespaces/portal.d.ts +198 -0
- package/dist/namespaces/portal.d.ts.map +1 -0
- package/dist/namespaces/projects.d.ts +553 -0
- package/dist/namespaces/projects.d.ts.map +1 -0
- package/dist/namespaces/roles.d.ts +65 -0
- package/dist/namespaces/roles.d.ts.map +1 -0
- package/dist/namespaces/scheduling.d.ts +944 -0
- package/dist/namespaces/scheduling.d.ts.map +1 -0
- package/dist/namespaces/search.d.ts +224 -0
- package/dist/namespaces/search.d.ts.map +1 -0
- package/dist/namespaces/session-notes.d.ts +67 -0
- package/dist/namespaces/session-notes.d.ts.map +1 -0
- package/dist/namespaces/social.d.ts +330 -0
- package/dist/namespaces/social.d.ts.map +1 -0
- package/dist/namespaces/storage.d.ts +378 -0
- package/dist/namespaces/storage.d.ts.map +1 -0
- package/dist/namespaces/support.d.ts +427 -0
- package/dist/namespaces/support.d.ts.map +1 -0
- package/dist/namespaces/threads.d.ts +596 -0
- package/dist/namespaces/threads.d.ts.map +1 -0
- package/dist/namespaces/training.d.ts +358 -0
- package/dist/namespaces/training.d.ts.map +1 -0
- package/dist/namespaces/voice.d.ts +752 -0
- package/dist/namespaces/voice.d.ts.map +1 -0
- package/dist/namespaces/watcher.d.ts +425 -0
- package/dist/namespaces/watcher.d.ts.map +1 -0
- package/dist/namespaces/webhooks-ns.d.ts +3 -0
- package/dist/namespaces/webhooks-ns.d.ts.map +1 -0
- package/dist/pagination.d.ts +57 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/request-builder.d.ts +95 -0
- package/dist/request-builder.d.ts.map +1 -0
- package/dist/security.d.ts +32 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/streaming.d.ts +135 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/utils/retry.d.ts +63 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/webhook-signature.d.ts +109 -0
- package/dist/webhook-signature.d.ts.map +1 -0
- package/llms.txt +7 -1
- package/package.json +286 -36
- package/dist/index.d.mts +0 -30734
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import type { Bucket, StorageFile } from "../_internal/types.gen";
|
|
2
|
+
/** Parameters for requesting a presigned download URL. */
|
|
3
|
+
export interface RequestDownloadUrlParams {
|
|
4
|
+
/** Time in seconds until the URL expires (default: 3600). */
|
|
5
|
+
expires_in?: number;
|
|
6
|
+
}
|
|
7
|
+
/** Response from a presigned download URL request. */
|
|
8
|
+
export interface DownloadUrlResponse {
|
|
9
|
+
/** The presigned download URL. */
|
|
10
|
+
url: string;
|
|
11
|
+
/** When the URL expires (ISO 8601). */
|
|
12
|
+
expires_at: string;
|
|
13
|
+
}
|
|
14
|
+
/** Response from a presigned upload request. */
|
|
15
|
+
export interface PresignedUploadResponse {
|
|
16
|
+
url?: string;
|
|
17
|
+
fields?: Record<string, string>;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/** Attributes accepted when requesting a presigned upload URL. */
|
|
21
|
+
export type PresignedUploadAttributes = {
|
|
22
|
+
filename?: string;
|
|
23
|
+
content_type?: string;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
/** Attributes accepted when creating a storage bucket. */
|
|
27
|
+
export type CreateBucketAttributes = {
|
|
28
|
+
workspace_id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
/** Attributes accepted when updating a storage bucket (PATCH semantics). */
|
|
33
|
+
export type UpdateBucketAttributes = {
|
|
34
|
+
name?: string;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
import type { RequestOptions } from "../base-client";
|
|
38
|
+
import { RequestBuilder } from "../request-builder";
|
|
39
|
+
/**
|
|
40
|
+
* Creates the storage namespace, providing presigned upload URL generation for
|
|
41
|
+
* direct browser-to-storage uploads and full bucket management for the
|
|
42
|
+
* authenticated workspace.
|
|
43
|
+
*
|
|
44
|
+
* The platform uses an S3-compatible object storage backend (Google Cloud Storage
|
|
45
|
+
* in production, MinIO in local development). Files are never routed through the
|
|
46
|
+
* application server — the client uploads directly to the storage service using
|
|
47
|
+
* the presigned URL returned by `signUpload()`, which keeps latency low and
|
|
48
|
+
* avoids egress costs.
|
|
49
|
+
*
|
|
50
|
+
* Accessed via `client.storage.*`.
|
|
51
|
+
*
|
|
52
|
+
* @param rb - The internal `RequestBuilder` instance used to execute API calls.
|
|
53
|
+
* @returns An object containing the top-level `signUpload` method and the
|
|
54
|
+
* `buckets` sub-namespace.
|
|
55
|
+
*/
|
|
56
|
+
export declare function createStorageNamespace(rb: RequestBuilder): {
|
|
57
|
+
/**
|
|
58
|
+
* Generates a presigned S3-compatible URL that allows the browser (or any
|
|
59
|
+
* HTTP client) to upload a file directly to the platform's object storage
|
|
60
|
+
* backend without routing the binary data through the application server.
|
|
61
|
+
*
|
|
62
|
+
* **Upload flow:**
|
|
63
|
+
* 1. Call `signUpload()` to obtain a presigned URL and any required form
|
|
64
|
+
* fields (for POST-style uploads) or headers (for PUT-style uploads).
|
|
65
|
+
* 2. Upload the file directly from the browser to the returned URL using
|
|
66
|
+
* `fetch` or `XMLHttpRequest`.
|
|
67
|
+
* 3. After the upload completes, submit the returned storage path to the
|
|
68
|
+
* extraction pipeline (e.g., `client.extraction.documents.create(...)`)
|
|
69
|
+
* to trigger document processing.
|
|
70
|
+
*
|
|
71
|
+
* Presigned URLs are short-lived and must be used promptly after generation.
|
|
72
|
+
*
|
|
73
|
+
* @param attributes - Optional record of upload request attributes. Commonly
|
|
74
|
+
* used fields include `filename` (the original file name), `content_type`
|
|
75
|
+
* (the MIME type of the file, e.g., `"application/pdf"`), and `bucket_id`
|
|
76
|
+
* (the target bucket UUID, if not using the workspace default).
|
|
77
|
+
* @param options - Optional request options such as custom headers or an
|
|
78
|
+
* abort signal.
|
|
79
|
+
* @returns A promise resolving to a record containing at minimum `url` (the
|
|
80
|
+
* presigned upload endpoint) and `storage_path` (the object key to
|
|
81
|
+
* reference after upload). May also include `fields` for multipart POST
|
|
82
|
+
* form uploads.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
87
|
+
*
|
|
88
|
+
* // Step 1: Get a presigned URL
|
|
89
|
+
* const upload = await client.storage.signUpload({
|
|
90
|
+
* filename: 'contract-2026-q1.pdf',
|
|
91
|
+
* content_type: 'application/pdf',
|
|
92
|
+
* });
|
|
93
|
+
*
|
|
94
|
+
* // Step 2: Upload the file directly to storage
|
|
95
|
+
* await fetch(upload.url as string, {
|
|
96
|
+
* method: 'PUT',
|
|
97
|
+
* body: fileBlob,
|
|
98
|
+
* headers: { 'Content-Type': 'application/pdf' },
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* // Step 3: Hand off to extraction for processing
|
|
102
|
+
* await client.extraction.documents.create({
|
|
103
|
+
* storage_path: upload.storage_path,
|
|
104
|
+
* filename: 'contract-2026-q1.pdf',
|
|
105
|
+
* });
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
signUpload: (attributes?: PresignedUploadAttributes, options?: RequestOptions) => Promise<PresignedUploadResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* Sub-namespace for storage bucket operations.
|
|
111
|
+
*
|
|
112
|
+
* Buckets are logical containers that group related files within the workspace.
|
|
113
|
+
* Each workspace has a default bucket, but ISVs can create additional buckets
|
|
114
|
+
* to organise files by purpose (e.g., a "contracts" bucket, an "invoices"
|
|
115
|
+
* bucket). Bucket names must be unique within the workspace. Access control
|
|
116
|
+
* and retention policies are configured at the bucket level.
|
|
117
|
+
*/
|
|
118
|
+
buckets: {
|
|
119
|
+
/**
|
|
120
|
+
* Returns a single page of storage buckets for the current workspace.
|
|
121
|
+
*
|
|
122
|
+
* @param options - Optional pagination and request options.
|
|
123
|
+
* @param options.page - The 1-based page number to retrieve (default: 1).
|
|
124
|
+
* @param options.pageSize - The number of buckets to return per page.
|
|
125
|
+
* @returns A promise resolving to an array of `Bucket` objects for the
|
|
126
|
+
* requested page.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
131
|
+
*
|
|
132
|
+
* const buckets = await client.storage.buckets.list({ pageSize: 20 });
|
|
133
|
+
* buckets.forEach(b => console.log(b.name, b.file_count));
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
list: (options?: {
|
|
137
|
+
page?: number;
|
|
138
|
+
pageSize?: number;
|
|
139
|
+
} & RequestOptions) => Promise<Bucket[]>;
|
|
140
|
+
/**
|
|
141
|
+
* Fetches all storage buckets for the current workspace by automatically
|
|
142
|
+
* paginating through every result page.
|
|
143
|
+
*
|
|
144
|
+
* Use this when you need to enumerate all buckets without manual pagination,
|
|
145
|
+
* for example to render a full bucket selector in a file management UI.
|
|
146
|
+
*
|
|
147
|
+
* @param options - Optional request options such as custom headers or an
|
|
148
|
+
* abort signal.
|
|
149
|
+
* @returns A promise resolving to a flat array of all `Bucket` objects
|
|
150
|
+
* across every page.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
155
|
+
*
|
|
156
|
+
* const allBuckets = await client.storage.buckets.listAll();
|
|
157
|
+
* const defaultBucket = allBuckets.find(b => b.is_default);
|
|
158
|
+
* console.log(`Default bucket: ${defaultBucket?.name}`);
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
listAll: (options?: RequestOptions) => Promise<Bucket[]>;
|
|
162
|
+
/**
|
|
163
|
+
* Permanently deletes a storage bucket and all of its contents.
|
|
164
|
+
*
|
|
165
|
+
* This operation is irreversible. All files stored in the bucket will be
|
|
166
|
+
* permanently removed from object storage. The default workspace bucket
|
|
167
|
+
* cannot be deleted. Ensure the bucket is empty or that its contents are
|
|
168
|
+
* no longer needed before calling this method.
|
|
169
|
+
*
|
|
170
|
+
* @param id - The UUID of the bucket to delete.
|
|
171
|
+
* @param options - Optional request options such as custom headers or an
|
|
172
|
+
* abort signal.
|
|
173
|
+
* @returns A promise resolving to `true` when the deletion succeeds.
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
178
|
+
*
|
|
179
|
+
* await client.storage.buckets.delete('bkt_01HXYZ...');
|
|
180
|
+
* console.log('Bucket and all its contents deleted.');
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
184
|
+
/**
|
|
185
|
+
* Creates a new storage bucket within the current workspace.
|
|
186
|
+
*
|
|
187
|
+
* @param attributes - A record of bucket attributes. Commonly used fields
|
|
188
|
+
* include `name` (required, unique within the workspace), `description`
|
|
189
|
+
* (optional human-readable label), and `retention_days` (optional number
|
|
190
|
+
* of days after which files in this bucket are automatically deleted).
|
|
191
|
+
* @param options - Optional request options such as custom headers or an
|
|
192
|
+
* abort signal.
|
|
193
|
+
* @returns A promise resolving to the newly created `Bucket` object.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
198
|
+
*
|
|
199
|
+
* const bucket = await client.storage.buckets.create({
|
|
200
|
+
* name: 'contracts',
|
|
201
|
+
* description: 'Signed customer contracts',
|
|
202
|
+
* retention_days: 2555, // ~7 years
|
|
203
|
+
* });
|
|
204
|
+
* console.log(`Bucket created: ${bucket.id}`);
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
create: (attributes: CreateBucketAttributes, options?: RequestOptions) => Promise<Bucket>;
|
|
208
|
+
/**
|
|
209
|
+
* Retrieves a single storage bucket by its unique identifier.
|
|
210
|
+
*
|
|
211
|
+
* @param id - The UUID of the bucket to retrieve.
|
|
212
|
+
* @param options - Optional request options such as custom headers or an
|
|
213
|
+
* abort signal.
|
|
214
|
+
* @returns A promise resolving to the matching `Bucket` object, including
|
|
215
|
+
* its name, file count, size, and configuration.
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```typescript
|
|
219
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
220
|
+
*
|
|
221
|
+
* const bucket = await client.storage.buckets.get('bkt_01HXYZ...');
|
|
222
|
+
* console.log(`Bucket "${bucket.name}" contains ${bucket.file_count} file(s).`);
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
get: (id: string, options?: RequestOptions) => Promise<Bucket>;
|
|
226
|
+
/**
|
|
227
|
+
* Updates the mutable attributes of an existing storage bucket, such as
|
|
228
|
+
* its name, description, or retention policy.
|
|
229
|
+
*
|
|
230
|
+
* @param id - The UUID of the bucket to update.
|
|
231
|
+
* @param attributes - A partial record of bucket attributes to update.
|
|
232
|
+
* Only the provided keys are changed; omitted keys are preserved.
|
|
233
|
+
* @param options - Optional request options such as custom headers or an
|
|
234
|
+
* abort signal.
|
|
235
|
+
* @returns A promise resolving to the updated `Bucket` object.
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```typescript
|
|
239
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
240
|
+
*
|
|
241
|
+
* const updated = await client.storage.buckets.update('bkt_01HXYZ...', {
|
|
242
|
+
* description: 'Signed contracts — legal hold applied',
|
|
243
|
+
* retention_days: 3650, // 10 years
|
|
244
|
+
* });
|
|
245
|
+
* console.log(`Bucket updated: ${updated.name}`);
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
248
|
+
update: (id: string, attributes: UpdateBucketAttributes, options?: RequestOptions) => Promise<Bucket>;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Sub-namespace for storage file operations.
|
|
252
|
+
*
|
|
253
|
+
* Files are tracked as `StorageFile` records with lifecycle states
|
|
254
|
+
* (`pending_upload`, `active`, `archived`, `pending_deletion`).
|
|
255
|
+
* Use the `signUpload()` method to create a file, then confirm
|
|
256
|
+
* the upload once the binary has been written to object storage.
|
|
257
|
+
*/
|
|
258
|
+
files: {
|
|
259
|
+
/**
|
|
260
|
+
* Lists storage files in the current workspace.
|
|
261
|
+
*
|
|
262
|
+
* @param options - Optional pagination and request options.
|
|
263
|
+
* @returns A promise resolving to an array of `StorageFile` objects.
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```typescript
|
|
267
|
+
* const files = await client.storage.files.list({ pageSize: 50 });
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
list: (options?: {
|
|
271
|
+
page?: number;
|
|
272
|
+
pageSize?: number;
|
|
273
|
+
} & RequestOptions) => Promise<StorageFile[]>;
|
|
274
|
+
/**
|
|
275
|
+
* Retrieves a single storage file by ID.
|
|
276
|
+
*
|
|
277
|
+
* @param id - The UUID of the file.
|
|
278
|
+
* @param options - Optional request options.
|
|
279
|
+
* @returns A promise resolving to the `StorageFile` object.
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* ```typescript
|
|
283
|
+
* const file = await client.storage.files.get('file-uuid');
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
286
|
+
get: (id: string, options?: RequestOptions) => Promise<StorageFile>;
|
|
287
|
+
/**
|
|
288
|
+
* Archives a file, making it inactive but recoverable.
|
|
289
|
+
*
|
|
290
|
+
* @param id - The UUID of the file to archive.
|
|
291
|
+
* @param options - Optional request options.
|
|
292
|
+
* @returns A promise resolving to the updated `StorageFile`.
|
|
293
|
+
*/
|
|
294
|
+
archive: (id: string, options?: RequestOptions) => Promise<StorageFile>;
|
|
295
|
+
/**
|
|
296
|
+
* Restores an archived file back to active status.
|
|
297
|
+
*
|
|
298
|
+
* @param id - The UUID of the file to restore.
|
|
299
|
+
* @param options - Optional request options.
|
|
300
|
+
* @returns A promise resolving to the updated `StorageFile`.
|
|
301
|
+
*/
|
|
302
|
+
restore: (id: string, options?: RequestOptions) => Promise<StorageFile>;
|
|
303
|
+
/**
|
|
304
|
+
* Confirms a presigned upload, transitioning the file to active status.
|
|
305
|
+
*
|
|
306
|
+
* @param id - The UUID of the file to confirm.
|
|
307
|
+
* @param attributes - Optional attributes like `size_bytes` or `checksum`.
|
|
308
|
+
* @param options - Optional request options.
|
|
309
|
+
* @returns A promise resolving to the confirmed `StorageFile`.
|
|
310
|
+
*/
|
|
311
|
+
confirmUpload: (id: string, attributes?: Record<string, unknown>, options?: RequestOptions) => Promise<StorageFile>;
|
|
312
|
+
/**
|
|
313
|
+
* Soft-deletes a file, marking it for cleanup.
|
|
314
|
+
*
|
|
315
|
+
* @param id - The UUID of the file to soft-delete.
|
|
316
|
+
* @param options - Optional request options.
|
|
317
|
+
* @returns A promise resolving to the updated `StorageFile`.
|
|
318
|
+
*/
|
|
319
|
+
softDelete: (id: string, options?: RequestOptions) => Promise<StorageFile>;
|
|
320
|
+
/**
|
|
321
|
+
* Replaces the tags on a file.
|
|
322
|
+
*
|
|
323
|
+
* @param id - The UUID of the file to tag.
|
|
324
|
+
* @param tags - Array of tag strings.
|
|
325
|
+
* @param options - Optional request options.
|
|
326
|
+
* @returns A promise resolving to the updated `StorageFile`.
|
|
327
|
+
*/
|
|
328
|
+
tag: (id: string, tags: string[], options?: RequestOptions) => Promise<StorageFile>;
|
|
329
|
+
/**
|
|
330
|
+
* Merges new metadata into the file's existing metadata map.
|
|
331
|
+
*
|
|
332
|
+
* @param id - The UUID of the file.
|
|
333
|
+
* @param newMetadata - Key-value pairs to merge into existing metadata.
|
|
334
|
+
* @param options - Optional request options.
|
|
335
|
+
* @returns A promise resolving to the updated `StorageFile`.
|
|
336
|
+
*/
|
|
337
|
+
updateMetadata: (id: string, newMetadata: Record<string, unknown>, options?: RequestOptions) => Promise<StorageFile>;
|
|
338
|
+
/**
|
|
339
|
+
* Finds files matching a given checksum (for deduplication).
|
|
340
|
+
*
|
|
341
|
+
* @param checksum - The checksum string to search for.
|
|
342
|
+
* @param options - Optional request options.
|
|
343
|
+
* @returns A promise resolving to an array of matching `StorageFile` objects.
|
|
344
|
+
*/
|
|
345
|
+
byChecksum: (checksum: string, options?: RequestOptions) => Promise<StorageFile[]>;
|
|
346
|
+
/**
|
|
347
|
+
* Lists child files for a given parent ID (folder-like hierarchy).
|
|
348
|
+
*
|
|
349
|
+
* @param parentId - The UUID of the parent file.
|
|
350
|
+
* @param options - Optional request options.
|
|
351
|
+
* @returns A promise resolving to an array of child `StorageFile` objects.
|
|
352
|
+
*/
|
|
353
|
+
listChildren: (parentId: string, options?: RequestOptions) => Promise<StorageFile[]>;
|
|
354
|
+
/**
|
|
355
|
+
* Generate a short-lived presigned download URL for a file.
|
|
356
|
+
*
|
|
357
|
+
* Returns a URL that can be used to download the file directly from
|
|
358
|
+
* object storage (GCS in production, MinIO in dev) without routing
|
|
359
|
+
* through the application server.
|
|
360
|
+
*
|
|
361
|
+
* @param id - The UUID of the file to download.
|
|
362
|
+
* @param params - Optional parameters (e.g., custom `expires_in` seconds).
|
|
363
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
364
|
+
* @returns A promise resolving to the presigned URL and its expiry.
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* ```typescript
|
|
368
|
+
* const { url, expires_at } = await client.storage.files.requestDownloadUrl(
|
|
369
|
+
* 'file-uuid',
|
|
370
|
+
* { expires_in: 300 }, // 5 minutes
|
|
371
|
+
* );
|
|
372
|
+
* // Redirect browser to `url` for direct download
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
requestDownloadUrl: (id: string, params?: RequestDownloadUrlParams, options?: RequestOptions) => Promise<DownloadUrlResponse>;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/namespaces/storage.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAElE,0DAA0D;AAC1D,MAAM,WAAW,wBAAwB;IACvC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,sDAAsD;AACtD,MAAM,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