@squidcloud/client 1.0.192 → 1.0.193
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/index.js
CHANGED
|
@@ -29356,7 +29356,7 @@ const AI_MODEL_NAMES = [
|
|
|
29356
29356
|
'gpt-3.5-turbo-1106',
|
|
29357
29357
|
'gpt-4',
|
|
29358
29358
|
'claude-2',
|
|
29359
|
-
'gpt-4-
|
|
29359
|
+
'gpt-4-turbo-preview',
|
|
29360
29360
|
];
|
|
29361
29361
|
|
|
29362
29362
|
;// CONCATENATED MODULE: ../internal-common/src/public-types/api-call.public-context.ts
|
|
@@ -51246,43 +51246,82 @@ class StorageClient {
|
|
|
51246
51246
|
this.integrationId = integrationId;
|
|
51247
51247
|
this.rpcManager = rpcManager;
|
|
51248
51248
|
}
|
|
51249
|
-
|
|
51249
|
+
/**
|
|
51250
|
+
* Uploads a file to a specified directory within the bucket.
|
|
51251
|
+
*
|
|
51252
|
+
* @param dirPathInBucket - The directory path within the bucket where the file should be uploaded.
|
|
51253
|
+
* @param file - The file or blob (with filename) to upload.
|
|
51254
|
+
* @param expirationInSeconds - Optional expiration time in seconds for the upload.
|
|
51255
|
+
* @returns A promise that resolves to void when the upload is complete.
|
|
51256
|
+
*/
|
|
51257
|
+
async uploadFile(dirPathInBucket, file, expirationInSeconds) {
|
|
51250
51258
|
const request = {
|
|
51251
51259
|
integrationId: this.integrationId,
|
|
51252
|
-
pathInBucket,
|
|
51260
|
+
pathInBucket: dirPathInBucket,
|
|
51253
51261
|
expirationInSeconds,
|
|
51254
51262
|
};
|
|
51255
51263
|
await this.rpcManager.post('storage/uploadFile', request, [file]);
|
|
51256
51264
|
}
|
|
51257
|
-
|
|
51265
|
+
/**
|
|
51266
|
+
* Retrieves metadata for a file located in a specified path within the bucket.
|
|
51267
|
+
*
|
|
51268
|
+
* @param filePathInBucket - The path of the file within the bucket.
|
|
51269
|
+
* @returns A promise that resolves to a `GetFileMetadataResponse` containing the file's metadata.
|
|
51270
|
+
*/
|
|
51271
|
+
async getFileMetadata(filePathInBucket) {
|
|
51258
51272
|
const request = {
|
|
51259
51273
|
integrationId: this.integrationId,
|
|
51260
|
-
pathInBucket,
|
|
51274
|
+
pathInBucket: filePathInBucket,
|
|
51261
51275
|
};
|
|
51262
51276
|
return await this.rpcManager.post('storage/getFileMetadata', request);
|
|
51263
51277
|
}
|
|
51264
|
-
|
|
51278
|
+
/**
|
|
51279
|
+
* Generates a URL for downloading a file from a specified path within the bucket.
|
|
51280
|
+
*
|
|
51281
|
+
* @param filePathInBucket - The path of the file within the bucket for which to generate the download URL.
|
|
51282
|
+
* @param urlExpirationInSeconds - Optional expiration time in seconds for the download URL.
|
|
51283
|
+
* @returns A promise that resolves to a `GetDownloadUrlResponse` containing the download URL.
|
|
51284
|
+
*/
|
|
51285
|
+
async getDownloadUrl(filePathInBucket, urlExpirationInSeconds) {
|
|
51265
51286
|
const request = {
|
|
51266
51287
|
integrationId: this.integrationId,
|
|
51267
|
-
pathInBucket,
|
|
51288
|
+
pathInBucket: filePathInBucket,
|
|
51268
51289
|
urlExpirationInSeconds,
|
|
51269
51290
|
};
|
|
51270
51291
|
return await this.rpcManager.post('storage/getDownloadUrl', request);
|
|
51271
51292
|
}
|
|
51272
|
-
|
|
51293
|
+
/**
|
|
51294
|
+
* Lists the contents of a directory within the bucket.
|
|
51295
|
+
*
|
|
51296
|
+
* @param dirPathInBucket - The path of the directory within the bucket.
|
|
51297
|
+
* @returns A promise that resolves to a `ListDirectoryContentsResponse` containing the directory contents.
|
|
51298
|
+
*/
|
|
51299
|
+
async listDirectoryContents(dirPathInBucket) {
|
|
51273
51300
|
const request = {
|
|
51274
51301
|
integrationId: this.integrationId,
|
|
51275
|
-
pathInBucket,
|
|
51302
|
+
pathInBucket: dirPathInBucket,
|
|
51276
51303
|
};
|
|
51277
51304
|
return await this.rpcManager.post('storage/listDirectoryContents', request);
|
|
51278
51305
|
}
|
|
51279
|
-
|
|
51280
|
-
|
|
51306
|
+
/**
|
|
51307
|
+
* Deletes a single file from a specified path within the bucket.
|
|
51308
|
+
*
|
|
51309
|
+
* @param filePathInBucket - The path of the file within the bucket to be deleted.
|
|
51310
|
+
* @returns A promise that resolves to void when the file has been deleted.
|
|
51311
|
+
*/
|
|
51312
|
+
async deleteFile(filePathInBucket) {
|
|
51313
|
+
await this.deleteFiles([filePathInBucket]);
|
|
51281
51314
|
}
|
|
51282
|
-
|
|
51315
|
+
/**
|
|
51316
|
+
* Deletes multiple files from specified paths within the bucket.
|
|
51317
|
+
*
|
|
51318
|
+
* @param filePathsInBucket - An array of paths for the files within the bucket to be deleted.
|
|
51319
|
+
* @returns A promise that resolves to void when all specified files have been deleted.
|
|
51320
|
+
*/
|
|
51321
|
+
async deleteFiles(filePathsInBucket) {
|
|
51283
51322
|
const request = {
|
|
51284
51323
|
integrationId: this.integrationId,
|
|
51285
|
-
pathsInBucket,
|
|
51324
|
+
pathsInBucket: filePathsInBucket,
|
|
51286
51325
|
};
|
|
51287
51326
|
await this.rpcManager.post('storage/deleteFiles', request);
|
|
51288
51327
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The supported AI model names. */
|
|
2
|
-
export declare const AI_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "claude-2", "gpt-4-
|
|
2
|
+
export declare const AI_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "claude-2", "gpt-4-turbo-preview"];
|
|
3
3
|
export type AiModelName = (typeof AI_MODEL_NAMES)[number];
|
|
4
4
|
/** The possible sources for the LLM provider API key. */
|
|
5
5
|
export type ApiKeySource = 'user' | 'system';
|
|
@@ -44,10 +44,49 @@ export interface ListDirectoryContentsResponse {
|
|
|
44
44
|
export declare class StorageClient {
|
|
45
45
|
private readonly integrationId;
|
|
46
46
|
private readonly rpcManager;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Uploads a file to a specified directory within the bucket.
|
|
49
|
+
*
|
|
50
|
+
* @param dirPathInBucket - The directory path within the bucket where the file should be uploaded.
|
|
51
|
+
* @param file - The file or blob (with filename) to upload.
|
|
52
|
+
* @param expirationInSeconds - Optional expiration time in seconds for the upload.
|
|
53
|
+
* @returns A promise that resolves to void when the upload is complete.
|
|
54
|
+
*/
|
|
55
|
+
uploadFile(dirPathInBucket: string, file: File | BlobAndFilename, expirationInSeconds?: number): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Retrieves metadata for a file located in a specified path within the bucket.
|
|
58
|
+
*
|
|
59
|
+
* @param filePathInBucket - The path of the file within the bucket.
|
|
60
|
+
* @returns A promise that resolves to a `GetFileMetadataResponse` containing the file's metadata.
|
|
61
|
+
*/
|
|
62
|
+
getFileMetadata(filePathInBucket: string): Promise<GetFileMetadataResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Generates a URL for downloading a file from a specified path within the bucket.
|
|
65
|
+
*
|
|
66
|
+
* @param filePathInBucket - The path of the file within the bucket for which to generate the download URL.
|
|
67
|
+
* @param urlExpirationInSeconds - Optional expiration time in seconds for the download URL.
|
|
68
|
+
* @returns A promise that resolves to a `GetDownloadUrlResponse` containing the download URL.
|
|
69
|
+
*/
|
|
70
|
+
getDownloadUrl(filePathInBucket: string, urlExpirationInSeconds?: number): Promise<GetDownloadUrlResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* Lists the contents of a directory within the bucket.
|
|
73
|
+
*
|
|
74
|
+
* @param dirPathInBucket - The path of the directory within the bucket.
|
|
75
|
+
* @returns A promise that resolves to a `ListDirectoryContentsResponse` containing the directory contents.
|
|
76
|
+
*/
|
|
77
|
+
listDirectoryContents(dirPathInBucket: string): Promise<ListDirectoryContentsResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* Deletes a single file from a specified path within the bucket.
|
|
80
|
+
*
|
|
81
|
+
* @param filePathInBucket - The path of the file within the bucket to be deleted.
|
|
82
|
+
* @returns A promise that resolves to void when the file has been deleted.
|
|
83
|
+
*/
|
|
84
|
+
deleteFile(filePathInBucket: string): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Deletes multiple files from specified paths within the bucket.
|
|
87
|
+
*
|
|
88
|
+
* @param filePathsInBucket - An array of paths for the files within the bucket to be deleted.
|
|
89
|
+
* @returns A promise that resolves to void when all specified files have been deleted.
|
|
90
|
+
*/
|
|
91
|
+
deleteFiles(filePathsInBucket: Array<string>): Promise<void>;
|
|
53
92
|
}
|