@squidcloud/client 1.0.207 → 1.0.209

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.
@@ -25,6 +25,15 @@ export declare class AiChatbotClient {
25
25
  * that has been received so far.
26
26
  */
27
27
  chat(profileId: string, prompt: string, options?: AiChatbotChatOptions): Observable<string>;
28
+ /**
29
+ * Sends a prompt to the specified profile id and returns the response as a Promise of string.
30
+ *
31
+ * @param profileId - The profile id.
32
+ * @param prompt - The prompt.
33
+ * @param options - The options to send to the chat model.
34
+ * @returns A promise that resolves when the chat is complete. The resolved value is the entire response.
35
+ */
36
+ ask(profileId: string, prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<string>;
28
37
  private handleChatResponse;
29
38
  }
30
39
  export interface AiChatBotContextData {
@@ -52,6 +61,12 @@ export declare class AiChatbotProfileReference {
52
61
  * that has been received so far.
53
62
  */
54
63
  chat(prompt: string, options?: AiChatbotChatOptions): Observable<string>;
64
+ /**
65
+ * Sends a prompt to the current profile and returns the response as a Promise of string.
66
+ * @param prompt - The prompt.
67
+ * @param options - The chat options.
68
+ */
69
+ ask(prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<string>;
55
70
  /**
56
71
  * Retrieves a context reference for the current profile. A context reference can be used to add a new context entry
57
72
  * to the profile, or update/delete an existing entry context.
@@ -1,6 +1,6 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { DocumentReference } from '../document-reference';
3
- import { DocumentData, FieldName, FieldSort, Operator, PrimitiveFieldType, SimpleCondition } from '../public-types';
3
+ import { DocumentData, FieldName, FieldSort, Operator, PrimitiveFieldType, SerializedSimpleQuery, SimpleCondition } from '../public-types';
4
4
  import { Pagination, PaginationOptions } from './pagination';
5
5
  import { SnapshotEmitter } from './snapshot-emitter';
6
6
  /**
@@ -172,6 +172,7 @@ export declare class QueryBuilder<DocumentType extends DocumentData> extends Bas
172
172
  clone(): QueryBuilder<DocumentType>;
173
173
  addCompositeCondition(conditions: Array<SimpleCondition>): QueryBuilder<DocumentType>;
174
174
  flipSortOrder(): QueryBuilder<DocumentType>;
175
+ serialize(): SerializedSimpleQuery;
175
176
  paginate(options?: Partial<PaginationOptions>): Pagination<DocumentReference<DocumentType>>;
176
177
  }
177
178
  /** Describes the changes to a query result. */
@@ -1,4 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
+ import { SerializedQuery } from '../../../internal-common/src/public-types/serialized-query.public-types';
2
3
  import { Pagination, PaginationOptions } from './pagination';
3
4
  export interface SnapshotEmitter<ReturnType> {
4
5
  /**
@@ -31,4 +32,5 @@ export interface SnapshotEmitter<ReturnType> {
31
32
  * @param options The pagination options. Defaults to `{ subscribe: true, pageSize: 100 }`.
32
33
  */
33
34
  paginate(options?: Partial<PaginationOptions>): Pagination<ReturnType>;
35
+ serialize(): SerializedQuery;
34
36
  }
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
- export interface QueueManager {
2
+ export interface QueueManager<T> {
3
3
  /** Publish messages to the queue */
4
- produce(messages: unknown[]): Promise<void>;
4
+ produce(messages: T[]): Promise<void>;
5
5
  /** Consume messages from the queue */
6
- consume<T>(): Observable<T>;
6
+ consume(): Observable<T>;
7
7
  }
@@ -1,14 +1,14 @@
1
+ import { AiClient } from './ai.types';
2
+ import { ApiClient } from './api-client';
1
3
  import { CollectionReference } from './collection-reference';
2
4
  import { ConnectionDetails } from './connection-details';
3
5
  import { DistributedLock } from './distributed-lock.manager';
4
6
  import { GraphQLClient } from './graphql-client';
5
- import { SecretClient } from './secret.client';
6
- import { TransactionId } from './types';
7
- import { AiClient } from './ai.types';
8
7
  import { ApiEndpointId, ApiKey, AppId, CallApiOptions, CollectionName, DocumentData, EnvironmentId, IntegrationId, NativeApiCallResponse, SquidDeveloperId, SquidRegion } from './public-types';
9
8
  import { QueueManager } from './queue.manager';
10
- import { ApiClient } from './api-client';
9
+ import { SecretClient } from './secret.client';
11
10
  import { StorageClient } from './storage-client';
11
+ import { TransactionId } from './types';
12
12
  /** The different options that can be used to initialize a Squid instance. */
13
13
  export interface SquidOptions {
14
14
  /**
@@ -62,7 +62,7 @@ export interface SquidAuthProvider {
62
62
  * Optional Auth integration id.
63
63
  * Sent as a part of all Squid requests to the backend.
64
64
  */
65
- integrationId?: string;
65
+ integrationId: string;
66
66
  }
67
67
  /**
68
68
  * The main entry point to the Squid Client SDK.
@@ -239,7 +239,7 @@ export declare class Squid {
239
239
  * Returns a queue manager for the given topic name and integration id. Using the queue manager you can consume and
240
240
  * produce messages
241
241
  */
242
- queue(topicName: string, integrationId?: IntegrationId): QueueManager;
242
+ queue<T>(topicName: string, integrationId?: IntegrationId): QueueManager<T>;
243
243
  /**
244
244
  * Destructs the Squid Client. Unsubscribes from all ongoing queries or requests, and clears the local data.
245
245
  * After invoking this method, the Squid client will not be usable.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.207",
3
+ "version": "1.0.209",
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",