@squidcloud/client 1.0.211 → 1.0.213
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 +3 -3
- package/dist/internal-common/src/public-types/ai-chatbot.public-types.d.ts +19 -0
- package/dist/internal-common/src/public-types/regions.public-types.d.ts +2 -2
- package/dist/internal-common/src/public-types-backend/ai-chatbot.public-context.d.ts +0 -19
- package/dist/internal-common/src/public-types-backend/bundle-api.public-types.d.ts +2 -1
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +4 -4
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -14
- package/dist/typescript-client/src/ai-chatbot-client.d.ts +1 -2
- package/dist/typescript-client/src/public-types-deprecated.d.ts +1 -15
- package/package.json +1 -1
- package/dist/internal-common/src/types/application.types.d.ts +0 -1
- package/dist/internal-common/src/types/backend-run.types.d.ts +0 -1
- package/dist/internal-common/src/types/bundle-data.types.d.ts +0 -1
- package/dist/internal-common/src/types/integrations/ai_chatbot.types.d.ts +0 -1
- package/dist/internal-common/src/types/integrations/api.types.d.ts +0 -1
- package/dist/internal-common/src/types/integrations/auth.types.d.ts +0 -1
- package/dist/internal-common/src/types/integrations/database.types.d.ts +0 -1
- package/dist/internal-common/src/types/integrations/observability.types.d.ts +0 -1
- package/dist/internal-common/src/types/integrations/queue-types.d.ts +0 -1
- package/dist/internal-common/src/types/integrations/schemas.d.ts +0 -1
- package/dist/internal-common/src/types/integrations/storage-types.d.ts +0 -1
- package/dist/internal-common/src/types/openapi.types.d.ts +0 -1
|
@@ -46,3 +46,22 @@ export interface AiChatbotChatOptions {
|
|
|
46
46
|
}
|
|
47
47
|
export type AiChatbotMutationType = 'insert' | 'update' | 'delete';
|
|
48
48
|
export type AiChatbotResourceType = 'instruction' | 'context' | 'profile';
|
|
49
|
+
export type AiChatbotContextType = 'text' | 'url' | 'file';
|
|
50
|
+
export interface AiChatbotContextBase {
|
|
51
|
+
type: AiChatbotContextType;
|
|
52
|
+
data: string;
|
|
53
|
+
}
|
|
54
|
+
export interface AiChatbotTextContext extends AiChatbotContextBase {
|
|
55
|
+
type: 'text';
|
|
56
|
+
}
|
|
57
|
+
export interface AiChatbotUrlContext extends AiChatbotContextBase {
|
|
58
|
+
type: 'url';
|
|
59
|
+
}
|
|
60
|
+
export interface AiChatbotFileContext extends AiChatbotContextBase {
|
|
61
|
+
type: 'file';
|
|
62
|
+
}
|
|
63
|
+
export declare class AiChatbotChatContext {
|
|
64
|
+
readonly prompt: string;
|
|
65
|
+
readonly profileId: string;
|
|
66
|
+
}
|
|
67
|
+
export type AiChatbotContext = AiChatbotTextContext | AiChatbotUrlContext | AiChatbotFileContext;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** The list of regions in Squid. */
|
|
2
|
-
export declare const SQUID_REGIONS: readonly ["us-east-1.aws"];
|
|
2
|
+
export declare const SQUID_REGIONS: readonly ["us-east-1.aws", "ap-south-1.aws"];
|
|
3
3
|
/** Region type used by Squid. */
|
|
4
4
|
export type SquidRegion = (typeof SQUID_REGIONS)[number];
|
|
5
5
|
/** @deprecated: Use 'SQUID_REGIONS'. */
|
|
6
|
-
export declare const SUPPORTED_SQUID_REGIONS: readonly ["us-east-1.aws"];
|
|
6
|
+
export declare const SUPPORTED_SQUID_REGIONS: readonly ["us-east-1.aws", "ap-south-1.aws"];
|
|
7
7
|
/** @deprecated: Use 'SquidRegion'. */
|
|
8
8
|
export type SupportedSquidRegion = SquidRegion;
|
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
import { AiChatbotMutationType, AiChatbotResourceType } from '../public-types/ai-chatbot.public-types';
|
|
2
|
-
export type AiChatbotContextType = 'text' | 'url' | 'file';
|
|
3
|
-
export interface AiChatbotContextBase {
|
|
4
|
-
type: AiChatbotContextType;
|
|
5
|
-
data: string;
|
|
6
|
-
}
|
|
7
|
-
export interface AiChatbotTextContext extends AiChatbotContextBase {
|
|
8
|
-
type: 'text';
|
|
9
|
-
}
|
|
10
|
-
export interface AiChatbotUrlContext extends AiChatbotContextBase {
|
|
11
|
-
type: 'url';
|
|
12
|
-
}
|
|
13
|
-
export interface AiChatbotFileContext extends AiChatbotContextBase {
|
|
14
|
-
type: 'file';
|
|
15
|
-
}
|
|
16
|
-
export declare class AiChatbotChatContext {
|
|
17
|
-
readonly prompt: string;
|
|
18
|
-
readonly profileId: string;
|
|
19
|
-
}
|
|
20
2
|
/** A context provided to the security rules of an AI Chatbot mutation. */
|
|
21
3
|
export declare class AiChatbotMutationContext {
|
|
22
4
|
readonly type: AiChatbotMutationType;
|
|
@@ -24,4 +6,3 @@ export declare class AiChatbotMutationContext {
|
|
|
24
6
|
readonly profileId: string;
|
|
25
7
|
readonly payload: any;
|
|
26
8
|
}
|
|
27
|
-
export type AiChatbotContext = AiChatbotTextContext | AiChatbotUrlContext | AiChatbotFileContext;
|
|
@@ -9,9 +9,10 @@ import { ClientId, SquidDocId } from '../public-types/communication.public-types
|
|
|
9
9
|
import { TopicReadContext, TopicWriteContext } from './topic.public-context';
|
|
10
10
|
import { DistributedLockContext } from './distributed-lock.public-context';
|
|
11
11
|
import { GraphqlContext } from './graphql.public-context';
|
|
12
|
-
import {
|
|
12
|
+
import { AiChatbotMutationContext } from './ai-chatbot.public-context';
|
|
13
13
|
import { StorageContext } from '../public-types/storage.types';
|
|
14
14
|
import { NativeQueryContext } from './native-query.public-context';
|
|
15
|
+
import { AiChatbotChatContext } from '../public-types/ai-chatbot.public-types';
|
|
15
16
|
export type SecureDatabaseAction<T extends DatabaseActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: QueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: MutationContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
16
17
|
export type SecureStorageAction<T extends StorageActionType> = T extends 'all' ? () => boolean | Promise<boolean> : (context: StorageContext) => boolean | Promise<boolean>;
|
|
17
18
|
export type SecureTopicAction<T extends TopicActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: TopicReadContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: TopicWriteContext<T>) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { IntegrationId } from '../public-types/communication.public-types';
|
|
2
2
|
export type NativeQueryRequestType = 'relational' | 'mongo';
|
|
3
|
-
interface
|
|
3
|
+
interface BaseNativeQueryContext {
|
|
4
4
|
type: NativeQueryRequestType;
|
|
5
5
|
integrationId: IntegrationId;
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface RelationalNativeQueryContext extends BaseNativeQueryContext {
|
|
8
8
|
type: 'relational';
|
|
9
9
|
query: string;
|
|
10
10
|
params: Record<string, any>;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface MongoNativeQueryContext extends BaseNativeQueryContext {
|
|
13
13
|
type: 'mongo';
|
|
14
14
|
collectionName: string;
|
|
15
15
|
aggregationPipeline: Array<any | undefined>;
|
|
16
16
|
}
|
|
17
|
-
export type NativeQueryContext =
|
|
17
|
+
export type NativeQueryContext = RelationalNativeQueryContext | MongoNativeQueryContext;
|
|
18
18
|
export {};
|
|
@@ -4,7 +4,6 @@ import { CollectionName, DocumentData } from '../public-types/document.public-ty
|
|
|
4
4
|
import { IntegrationId } from '../public-types/communication.public-types';
|
|
5
5
|
export declare class QueryContext<T extends DocumentData = any> {
|
|
6
6
|
readonly query: Query<T>;
|
|
7
|
-
private readonly parsedConditions;
|
|
8
7
|
/**
|
|
9
8
|
* The ID of the integration being queried.
|
|
10
9
|
*/
|
|
@@ -93,19 +92,6 @@ export declare class QueryContext<T extends DocumentData = any> {
|
|
|
93
92
|
* The method does not account for limit and sort order.
|
|
94
93
|
*/
|
|
95
94
|
documentMatchesQuery(doc: DocumentData): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Compares a condition against a given operator and value to determine if the
|
|
98
|
-
* provided condition is a subset of the operator and value. A condition is
|
|
99
|
-
* considered a subset if all values that satisfy (return true for) the
|
|
100
|
-
* condition also satisfy the operator and value.
|
|
101
|
-
*
|
|
102
|
-
* This is done using the underlying CompareTable, which provides a comparison
|
|
103
|
-
* function for each operator pair, or undefined if the comparison would
|
|
104
|
-
* always be false, regardless of the values.
|
|
105
|
-
*/
|
|
106
|
-
private evaluateSubset;
|
|
107
|
-
private evaluateIncludes;
|
|
108
|
-
private parseConditions;
|
|
109
95
|
}
|
|
110
96
|
/** A list of context conditions */
|
|
111
97
|
export type ContextConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<ContextCondition<Doc, F>>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AiChatbotChatOptions, AiModelName } from './public-types';
|
|
1
|
+
import { AiChatbotChatOptions, AiChatbotContext, AiModelName } from './public-types';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { AiChatbotContext } from '../../internal-common/src/public-types-backend/ai-chatbot.public-context';
|
|
4
3
|
export declare class AiChatbotClient {
|
|
5
4
|
private readonly rpcManager;
|
|
6
5
|
private readonly socketManager;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MutationContext as MutationContextDeprecated } from '../../internal-common/src/public-types-backend/mutation.public-context';
|
|
2
|
-
import {
|
|
2
|
+
import { AiChatbotMutationContext as AiChatbotMutationContextDeprecated } from '../../internal-common/src/public-types-backend/ai-chatbot.public-context';
|
|
3
3
|
import { ApiCallContext as ApiCallContextDeprecated, ApiHeaders as ApiHeadersDeprecated, ApiOptions as ApiOptionsDeprecated, CallApiRequest as CallApiRequestDeprecated } from '../../internal-common/src/public-types-backend/api-call.public-context';
|
|
4
4
|
import { DistributedLockContext as DistributedLockContextDeprecated } from '../../internal-common/src/public-types-backend/distributed-lock.public-context';
|
|
5
5
|
import { GraphqlContext as GraphqlContextDeprecated } from '../../internal-common/src/public-types-backend/graphql.public-context';
|
|
@@ -12,22 +12,8 @@ import { AiChatbotActionType, DatabaseActionType, StorageActionType, TopicAction
|
|
|
12
12
|
/** @deprecated. Use import from @squidcloud/backend. */
|
|
13
13
|
export type MutationContext<T = any> = MutationContextDeprecated<T>;
|
|
14
14
|
/** @deprecated. Use import from @squidcloud/backend. */
|
|
15
|
-
export type AiChatbotContextType = AiChatbotContextTypeDeprecated;
|
|
16
|
-
/** @deprecated. Use import from @squidcloud/backend. */
|
|
17
|
-
export type AiChatbotContextBase = AiChatbotContextBaseDeprecated;
|
|
18
|
-
/** @deprecated. Use import from @squidcloud/backend. */
|
|
19
|
-
export type AiChatbotTextContext = AiChatbotTextContextDeprecated;
|
|
20
|
-
/** @deprecated. Use import from @squidcloud/backend. */
|
|
21
|
-
export type AiChatbotUrlContext = AiChatbotUrlContextDeprecated;
|
|
22
|
-
/** @deprecated. Use import from @squidcloud/backend. */
|
|
23
|
-
export type AiChatbotFileContext = AiChatbotFileContextDeprecated;
|
|
24
|
-
/** @deprecated. Use import from @squidcloud/backend. */
|
|
25
|
-
export type AiChatbotChatContext = AiChatbotChatContextDeprecated;
|
|
26
|
-
/** @deprecated. Use import from @squidcloud/backend. */
|
|
27
15
|
export type AiChatbotMutationContext = AiChatbotMutationContextDeprecated;
|
|
28
16
|
/** @deprecated. Use import from @squidcloud/backend. */
|
|
29
|
-
export type AiChatbotContext = AiChatbotContextDeprecated;
|
|
30
|
-
/** @deprecated. Use import from @squidcloud/backend. */
|
|
31
17
|
export type ApiHeaders = ApiHeadersDeprecated;
|
|
32
18
|
/** @deprecated. Use import from @squidcloud/backend. */
|
|
33
19
|
export type ApiCallContext = ApiCallContextDeprecated;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|