@squidcloud/client 1.0.191 → 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 +67 -15
- package/dist/internal-common/src/public-types/ai-chatbot.public-types.d.ts +1 -1
- package/dist/internal-common/src/utils/object.d.ts +5 -0
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +2 -2
- package/dist/typescript-client/src/storage-client.d.ts +45 -6
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -29013,6 +29013,19 @@ function groupBy(array, getKey) {
|
|
|
29013
29013
|
return result;
|
|
29014
29014
|
}, {});
|
|
29015
29015
|
}
|
|
29016
|
+
/**
|
|
29017
|
+
* Picks selected fields from the object and returns a new object with the fields selected.
|
|
29018
|
+
* The selected fields are assigned by reference (there is no cloning).
|
|
29019
|
+
*/
|
|
29020
|
+
function pick(obj, keys) {
|
|
29021
|
+
const result = {};
|
|
29022
|
+
for (const key of keys) {
|
|
29023
|
+
if (key in obj) {
|
|
29024
|
+
result[key] = obj[key];
|
|
29025
|
+
}
|
|
29026
|
+
}
|
|
29027
|
+
return result;
|
|
29028
|
+
}
|
|
29016
29029
|
|
|
29017
29030
|
;// CONCATENATED MODULE: ../internal-common/src/utils/serialization.ts
|
|
29018
29031
|
|
|
@@ -29343,7 +29356,7 @@ const AI_MODEL_NAMES = [
|
|
|
29343
29356
|
'gpt-3.5-turbo-1106',
|
|
29344
29357
|
'gpt-4',
|
|
29345
29358
|
'claude-2',
|
|
29346
|
-
'gpt-4-
|
|
29359
|
+
'gpt-4-turbo-preview',
|
|
29347
29360
|
];
|
|
29348
29361
|
|
|
29349
29362
|
;// CONCATENATED MODULE: ../internal-common/src/public-types/api-call.public-context.ts
|
|
@@ -30775,7 +30788,7 @@ class BaseQueryBuilder {
|
|
|
30775
30788
|
* A shortcut for where(fieldName, 'like', pattern).
|
|
30776
30789
|
*
|
|
30777
30790
|
* @param fieldName The name of the field to query.
|
|
30778
|
-
* @param pattern The pattern to compare against. '%' matches 0 or more
|
|
30791
|
+
* @param pattern The pattern to compare against. '%' matches 0 or more characters. '_' matches exactly one character. '\' can be used to escape '%', '_'. or another '\'. Note that any '\' that is not followed by '%', '_', or '\' is invalid.
|
|
30779
30792
|
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
30780
30793
|
* @returns The query builder.
|
|
30781
30794
|
*/
|
|
@@ -30787,7 +30800,7 @@ class BaseQueryBuilder {
|
|
|
30787
30800
|
* A shortcut for where(fieldName, 'not like', pattern).
|
|
30788
30801
|
*
|
|
30789
30802
|
* @param fieldName The name of the field to query.
|
|
30790
|
-
* @param pattern The pattern to compare against. '%' matches 0 or more
|
|
30803
|
+
* @param pattern The pattern to compare against. '%' matches 0 or more characters. '_' matches exactly one character. '\' can be used to escape '%', '_'. or another '\'. Note that any '\' that is not followed by '%', '_', or '\' is invalid.
|
|
30791
30804
|
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
30792
30805
|
* @returns The query builder.
|
|
30793
30806
|
*/
|
|
@@ -51233,43 +51246,82 @@ class StorageClient {
|
|
|
51233
51246
|
this.integrationId = integrationId;
|
|
51234
51247
|
this.rpcManager = rpcManager;
|
|
51235
51248
|
}
|
|
51236
|
-
|
|
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) {
|
|
51237
51258
|
const request = {
|
|
51238
51259
|
integrationId: this.integrationId,
|
|
51239
|
-
pathInBucket,
|
|
51260
|
+
pathInBucket: dirPathInBucket,
|
|
51240
51261
|
expirationInSeconds,
|
|
51241
51262
|
};
|
|
51242
51263
|
await this.rpcManager.post('storage/uploadFile', request, [file]);
|
|
51243
51264
|
}
|
|
51244
|
-
|
|
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) {
|
|
51245
51272
|
const request = {
|
|
51246
51273
|
integrationId: this.integrationId,
|
|
51247
|
-
pathInBucket,
|
|
51274
|
+
pathInBucket: filePathInBucket,
|
|
51248
51275
|
};
|
|
51249
51276
|
return await this.rpcManager.post('storage/getFileMetadata', request);
|
|
51250
51277
|
}
|
|
51251
|
-
|
|
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) {
|
|
51252
51286
|
const request = {
|
|
51253
51287
|
integrationId: this.integrationId,
|
|
51254
|
-
pathInBucket,
|
|
51288
|
+
pathInBucket: filePathInBucket,
|
|
51255
51289
|
urlExpirationInSeconds,
|
|
51256
51290
|
};
|
|
51257
51291
|
return await this.rpcManager.post('storage/getDownloadUrl', request);
|
|
51258
51292
|
}
|
|
51259
|
-
|
|
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) {
|
|
51260
51300
|
const request = {
|
|
51261
51301
|
integrationId: this.integrationId,
|
|
51262
|
-
pathInBucket,
|
|
51302
|
+
pathInBucket: dirPathInBucket,
|
|
51263
51303
|
};
|
|
51264
51304
|
return await this.rpcManager.post('storage/listDirectoryContents', request);
|
|
51265
51305
|
}
|
|
51266
|
-
|
|
51267
|
-
|
|
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]);
|
|
51268
51314
|
}
|
|
51269
|
-
|
|
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) {
|
|
51270
51322
|
const request = {
|
|
51271
51323
|
integrationId: this.integrationId,
|
|
51272
|
-
pathsInBucket,
|
|
51324
|
+
pathsInBucket: filePathsInBucket,
|
|
51273
51325
|
};
|
|
51274
51326
|
await this.rpcManager.post('storage/deleteFiles', request);
|
|
51275
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';
|
|
@@ -20,3 +20,8 @@ export declare function compareValues(v1: unknown, v2: unknown): number;
|
|
|
20
20
|
export declare function mapValues<ResultType extends object = Record<string, unknown>, InputType extends Record<string, unknown> = Record<string, unknown>>(obj: InputType, valueMapperFn: (value: any, key: keyof InputType, obj: InputType) => unknown): ResultType;
|
|
21
21
|
/** Groups elements of the array by key. See _.groupBy for details. */
|
|
22
22
|
export declare function groupBy<T, K extends PropertyKey>(array: T[], getKey: (item: T) => K): Record<K, T[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Picks selected fields from the object and returns a new object with the fields selected.
|
|
25
|
+
* The selected fields are assigned by reference (there is no cloning).
|
|
26
|
+
*/
|
|
27
|
+
export declare function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
@@ -87,7 +87,7 @@ export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
|
|
|
87
87
|
* A shortcut for where(fieldName, 'like', pattern).
|
|
88
88
|
*
|
|
89
89
|
* @param fieldName The name of the field to query.
|
|
90
|
-
* @param pattern The pattern to compare against. '%' matches 0 or more
|
|
90
|
+
* @param pattern The pattern to compare against. '%' matches 0 or more characters. '_' matches exactly one character. '\' can be used to escape '%', '_'. or another '\'. Note that any '\' that is not followed by '%', '_', or '\' is invalid.
|
|
91
91
|
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
92
92
|
* @returns The query builder.
|
|
93
93
|
*/
|
|
@@ -96,7 +96,7 @@ export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
|
|
|
96
96
|
* A shortcut for where(fieldName, 'not like', pattern).
|
|
97
97
|
*
|
|
98
98
|
* @param fieldName The name of the field to query.
|
|
99
|
-
* @param pattern The pattern to compare against. '%' matches 0 or more
|
|
99
|
+
* @param pattern The pattern to compare against. '%' matches 0 or more characters. '_' matches exactly one character. '\' can be used to escape '%', '_'. or another '\'. Note that any '\' that is not followed by '%', '_', or '\' is invalid.
|
|
100
100
|
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
101
101
|
* @returns The query builder.
|
|
102
102
|
*/
|
|
@@ -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
|
}
|