@squidcloud/client 1.0.187 → 1.0.189
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 +21200 -21193
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +0 -9
- package/dist/internal-common/src/utils/object.d.ts +5 -1
- package/dist/internal-common/src/utils/squid-private-options.d.ts +0 -7
- package/dist/typescript-client/src/ai-assistant-client.d.ts +0 -2
- package/dist/typescript-client/src/ai-chatbot-client.d.ts +20 -25
- package/dist/typescript-client/src/api.manager.d.ts +1 -10
- package/dist/typescript-client/src/auth.manager.d.ts +1 -22
- package/dist/typescript-client/src/backend-function.manager.d.ts +1 -9
- package/dist/typescript-client/src/client-id.service.d.ts +1 -27
- package/dist/typescript-client/src/collection-reference.d.ts +2 -1
- package/dist/typescript-client/src/document-store.d.ts +2 -3
- package/dist/typescript-client/src/graphql-client.d.ts +1 -3
- package/dist/typescript-client/src/graphql-client.factory.d.ts +1 -11
- package/dist/typescript-client/src/index.d.ts +40 -10
- package/dist/typescript-client/src/native-query-manager.d.ts +1 -7
- package/dist/typescript-client/src/public-types.d.ts +0 -2
- package/dist/typescript-client/src/query/deserializer.d.ts +2 -1
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +12 -2
- package/dist/{internal-common/src/public-types/pagination.public-types.d.ts → typescript-client/src/query/pagination.d.ts} +1 -2
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +117 -10
- package/dist/typescript-client/src/query/snapshot-emitter.d.ts +34 -0
- package/dist/typescript-client/src/rate-limiter.d.ts +1 -32
- package/dist/typescript-client/src/rpc.manager.d.ts +1 -24
- package/dist/typescript-client/src/secret.client.d.ts +1 -5
- package/dist/typescript-client/src/squid-http-client.d.ts +0 -9
- package/package.json +1 -2
- package/dist/internal-common/src/public-types/base-query-builder.public-types.d.ts +0 -147
- package/dist/typescript-client/src/testing/setup-tests.d.ts +0 -1
|
@@ -1,24 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ClientIdService } from './client-id.service';
|
|
3
|
-
import { DestructManager } from './destruct.manager';
|
|
4
|
-
import { BlobAndFilename } from './types';
|
|
5
|
-
import { SquidRegion } from './public-types';
|
|
6
|
-
import { HttpResponse } from './squid-http-client';
|
|
7
|
-
export declare class RpcManager {
|
|
8
|
-
private readonly region;
|
|
9
|
-
private readonly appId;
|
|
10
|
-
private readonly authManager;
|
|
11
|
-
private readonly clientIdService;
|
|
12
|
-
private readonly staticHeaders;
|
|
13
|
-
private readonly onGoingRpcCounter;
|
|
14
|
-
private readonly rateLimiters;
|
|
15
|
-
constructor(region: SquidRegion, appId: string, destructManager: DestructManager, headers: Record<string, string>, authManager: AuthManager, clientIdService: ClientIdService);
|
|
16
|
-
private getAuthHeaders;
|
|
17
|
-
awaitAllSettled(): Promise<void>;
|
|
18
|
-
setStaticHeader(key: string, value: string): void;
|
|
19
|
-
deleteStaticHeader(key: string): void;
|
|
20
|
-
getStaticHeaders(): Record<string, string>;
|
|
21
|
-
post<ResponseType = unknown, RequestType = unknown>(path: string, message: RequestType, files?: Array<File | BlobAndFilename>, filesFieldName?: string): Promise<ResponseType>;
|
|
22
|
-
rawPost<ResponseType = unknown, RequestType = unknown>(path: string, message: RequestType, files?: Array<File | BlobAndFilename>, filesFieldName?: string, extractErrorMessage?: boolean): Promise<HttpResponse<ResponseType>>;
|
|
23
|
-
private getRateLimiterBucket;
|
|
24
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { SecretEntry, SecretKey, SecretValue, SetSecretRequestEntry } from './public-types';
|
|
2
|
-
import { RpcManager } from './rpc.manager';
|
|
3
2
|
export declare class SecretClient {
|
|
4
3
|
private readonly rpcManager;
|
|
5
|
-
constructor(rpcManager: RpcManager);
|
|
6
4
|
get(key: SecretKey): Promise<SecretEntry | undefined>;
|
|
7
5
|
getAll(): Promise<Record<SecretKey, SecretEntry>>;
|
|
8
6
|
upsert(key: SecretKey, value: SecretValue): Promise<SecretEntry>;
|
|
@@ -11,12 +9,10 @@ export declare class SecretClient {
|
|
|
11
9
|
deleteMany(keys: Array<SecretKey>): Promise<void>;
|
|
12
10
|
get apiKeys(): ApiKeysSecretClient;
|
|
13
11
|
}
|
|
14
|
-
declare class ApiKeysSecretClient {
|
|
12
|
+
export declare class ApiKeysSecretClient {
|
|
15
13
|
private readonly rpcManager;
|
|
16
|
-
constructor(rpcManager: RpcManager);
|
|
17
14
|
get(key: SecretKey): Promise<SecretEntry | undefined>;
|
|
18
15
|
getAll(): Promise<Record<SecretKey, SecretEntry>>;
|
|
19
16
|
upsert(key: SecretKey): Promise<SecretEntry>;
|
|
20
17
|
delete(key: SecretKey): Promise<void>;
|
|
21
18
|
}
|
|
22
|
-
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BlobAndFilename } from './types';
|
|
2
1
|
export declare class RpcError<BodyType = unknown> extends Error {
|
|
3
2
|
readonly statusCode: number;
|
|
4
3
|
readonly statusText: string;
|
|
@@ -6,14 +5,6 @@ export declare class RpcError<BodyType = unknown> extends Error {
|
|
|
6
5
|
readonly headers: Record<string, string>;
|
|
7
6
|
readonly body: BodyType;
|
|
8
7
|
}
|
|
9
|
-
export interface HttpPostInput<RequestBodyType = unknown> {
|
|
10
|
-
url: string;
|
|
11
|
-
headers: Record<string, string>;
|
|
12
|
-
message: RequestBodyType;
|
|
13
|
-
files: Array<File | BlobAndFilename>;
|
|
14
|
-
filesFieldName: string;
|
|
15
|
-
extractErrorMessage: boolean;
|
|
16
|
-
}
|
|
17
8
|
/** A response object with type T for the body. */
|
|
18
9
|
export interface HttpResponse<BodyType = unknown> {
|
|
19
10
|
status: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidcloud/client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.189",
|
|
4
4
|
"description": "A typescript implementation of the Squid client",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/typescript-client/src/index.d.ts",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"@supercharge/promise-pool": "^2.3.2",
|
|
40
40
|
"ajv": "^8.11.2",
|
|
41
41
|
"ajv-formats": "^2.1.1",
|
|
42
|
-
"axios": "^1.6.2",
|
|
43
42
|
"bufferutil": "^4.0.7",
|
|
44
43
|
"cross-fetch": "^3.1.5",
|
|
45
44
|
"date-fns": "^2.30.0",
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { SerializedQuery } from './serialized-query.public-types';
|
|
3
|
-
import { Pagination, PaginationOptions } from './pagination.public-types';
|
|
4
|
-
import { Operator } from './query.public-types';
|
|
5
|
-
import { DocumentData, FieldName, PrimitiveFieldType } from './document.public-types';
|
|
6
|
-
export interface SnapshotEmitter<ReturnType> {
|
|
7
|
-
/**
|
|
8
|
-
* Returns a promise that resolves to the query results.
|
|
9
|
-
*
|
|
10
|
-
* @returns A promise that resolves to the query results.
|
|
11
|
-
*/
|
|
12
|
-
snapshot(): Promise<Array<ReturnType>>;
|
|
13
|
-
/**
|
|
14
|
-
* Returns an observable that emits the query results and updates whenever the query results change unless
|
|
15
|
-
* `subscribe=false` is provided.
|
|
16
|
-
*
|
|
17
|
-
* Important: Make sure to unsubscribe from the observable when you are done with it.
|
|
18
|
-
*
|
|
19
|
-
* @param subscribe Whether to subscribe to changes to the query results. Defaults to `true`.
|
|
20
|
-
* @returns An observable for the query results.
|
|
21
|
-
*/
|
|
22
|
-
snapshots(subscribe?: boolean): Observable<Array<ReturnType>>;
|
|
23
|
-
/**
|
|
24
|
-
* Returns the results of the query based on the data that is currently available on the client. This method is useful
|
|
25
|
-
* for synchronously accessing data that has already been fetched by another query. The method will return an empty
|
|
26
|
-
* array if data has not yet been populated.
|
|
27
|
-
*
|
|
28
|
-
* @returns An array of query results.
|
|
29
|
-
*/
|
|
30
|
-
peek(): Array<ReturnType>;
|
|
31
|
-
limit(limit: number): SnapshotEmitter<ReturnType>;
|
|
32
|
-
/**
|
|
33
|
-
* Returns a pagination wrapper for this query.
|
|
34
|
-
* @param options The pagination options. Defaults to `{ subscribe: true, pageSize: 100 }`.
|
|
35
|
-
*/
|
|
36
|
-
paginate(options?: Partial<PaginationOptions>): Pagination<ReturnType>;
|
|
37
|
-
serialize(): SerializedQuery;
|
|
38
|
-
}
|
|
39
|
-
/** Query builder base class. */
|
|
40
|
-
export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
|
|
41
|
-
/**
|
|
42
|
-
* Adds a condition to the query.
|
|
43
|
-
* @param fieldName The name of the field to query.
|
|
44
|
-
* @param operator The operator to use.
|
|
45
|
-
* @param value The value to compare against.
|
|
46
|
-
* @returns The query builder.
|
|
47
|
-
*/
|
|
48
|
-
abstract where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
|
|
49
|
-
/**
|
|
50
|
-
* A shortcut for where(fieldName, '==', value)
|
|
51
|
-
*
|
|
52
|
-
* @param fieldName The name of the field to query.
|
|
53
|
-
* @param value The value to compare against.
|
|
54
|
-
* @returns The query builder.
|
|
55
|
-
*/
|
|
56
|
-
eq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
57
|
-
/**
|
|
58
|
-
* A shortcut for where(fieldName, '!=', value)
|
|
59
|
-
* @param fieldName The name of the field to query.
|
|
60
|
-
* @param value The value to compare against.
|
|
61
|
-
* @returns The query builder.
|
|
62
|
-
*/
|
|
63
|
-
neq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
64
|
-
/**
|
|
65
|
-
* A shortcut for where(fieldName, 'in', value)
|
|
66
|
-
* @param fieldName The name of the field to query.
|
|
67
|
-
* @param value An array of values to compare against.
|
|
68
|
-
* @returns The query builder.
|
|
69
|
-
*/
|
|
70
|
-
in(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
|
|
71
|
-
/**
|
|
72
|
-
* A shortcut for where(fieldName, 'not in', value)
|
|
73
|
-
* @param fieldName The name of the field to query.
|
|
74
|
-
* @param value An array of values to compare against.
|
|
75
|
-
* @returns The query builder.
|
|
76
|
-
*/
|
|
77
|
-
nin(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
|
|
78
|
-
/**
|
|
79
|
-
* A shortcut for where(fieldName, '>', value)
|
|
80
|
-
* @param fieldName The name of the field to query.
|
|
81
|
-
* @param value The value to compare against.
|
|
82
|
-
* @returns The query builder.
|
|
83
|
-
*/
|
|
84
|
-
gt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
85
|
-
/**
|
|
86
|
-
* A shortcut for where(fieldName, '>=', value)
|
|
87
|
-
* @param fieldName The name of the field to query.
|
|
88
|
-
* @param value The value to compare against.
|
|
89
|
-
* @returns The query builder.
|
|
90
|
-
*/
|
|
91
|
-
gte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
92
|
-
/**
|
|
93
|
-
* A shortcut for where(fieldName, '<', value)
|
|
94
|
-
* @param fieldName The name of the field to query.
|
|
95
|
-
* @param value The value to compare against.
|
|
96
|
-
* @returns The query builder.
|
|
97
|
-
*/
|
|
98
|
-
lt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
99
|
-
/**
|
|
100
|
-
* A shortcut for where(fieldName, '<=', value)
|
|
101
|
-
* @param fieldName The name of the field to query.
|
|
102
|
-
* @param value The value to compare against.
|
|
103
|
-
* @returns The query builder.
|
|
104
|
-
*/
|
|
105
|
-
lte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
106
|
-
/**
|
|
107
|
-
* A shortcut for where(fieldName, 'like', pattern).
|
|
108
|
-
*
|
|
109
|
-
* @param fieldName The name of the field to query.
|
|
110
|
-
* @param pattern The pattern to compare against. '%' is the only allowed wildcard
|
|
111
|
-
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
112
|
-
* @returns The query builder.
|
|
113
|
-
*/
|
|
114
|
-
like(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
|
|
115
|
-
/**
|
|
116
|
-
* A shortcut for where(fieldName, 'not like', pattern).
|
|
117
|
-
*
|
|
118
|
-
* @param fieldName The name of the field to query.
|
|
119
|
-
* @param pattern The pattern to compare against. '%' is the only allowed wildcard
|
|
120
|
-
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
121
|
-
* @returns The query builder.
|
|
122
|
-
*/
|
|
123
|
-
notLike(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
|
|
124
|
-
/**
|
|
125
|
-
* Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000
|
|
126
|
-
* if none is provided.
|
|
127
|
-
* @param limit The limit to set.
|
|
128
|
-
* @returns The query builder.
|
|
129
|
-
*/
|
|
130
|
-
abstract limit(limit: number): this;
|
|
131
|
-
/**
|
|
132
|
-
* Adds a sort order to the query. You can add multiple sort orders to the query. The order in which you add them
|
|
133
|
-
* determines the order in which they are applied.
|
|
134
|
-
* @param fieldName The name of the field to sort by.
|
|
135
|
-
* @param asc Whether to sort in ascending order. Defaults to true.
|
|
136
|
-
* @returns The query builder.
|
|
137
|
-
*/
|
|
138
|
-
abstract sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
|
|
139
|
-
}
|
|
140
|
-
export interface HasDereference {
|
|
141
|
-
/**
|
|
142
|
-
* Dereferences the document references in the result of this query. For example, collection.query().snapshot()
|
|
143
|
-
* returns an array of DocumentReference objects, but collection.query().dereference().snapshot() returns an array of
|
|
144
|
-
* the actual document data.
|
|
145
|
-
*/
|
|
146
|
-
dereference(): any;
|
|
147
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|