@crewdle/web-sdk-types 1.0.24 → 1.0.26

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.
Files changed (27) hide show
  1. package/dist/core/cluster/Cluster.d.ts +1 -1
  2. package/dist/core/sdk/SDKCloseOptions.d.ts +1 -0
  3. package/dist/external-storage/ExternalStorageConnection.d.ts +1 -0
  4. package/dist/external-storage/ExternalStorageConnection.js +1 -0
  5. package/dist/generative-ai/GenerativeAIContext.d.ts +1 -1
  6. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptOptions.d.ts +10 -0
  7. package/dist/generative-ai/jobs/prompt/GenerativeAIPromptResult.d.ts +6 -0
  8. package/dist/generative-ai/jobs/prompt/options/PromptFunctionParamsType.d.ts +1 -0
  9. package/dist/generative-ai/jobs/prompt/options/PromptFunctionParamsType.js +1 -0
  10. package/dist/generative-ai/jobs/prompt/result/PromptTypeText.d.ts +1 -0
  11. package/dist/generative-ai/jobs/prompt/result/PromptTypeVector.d.ts +1 -0
  12. package/dist/graph-database/GraphDatabase.d.ts +10 -0
  13. package/dist/graph-database/GraphDatabaseConnector.d.ts +10 -0
  14. package/dist/graph-database/GraphDatabaseConnectorConstructor.d.ts +1 -1
  15. package/dist/job/JobWorkerConnector.d.ts +4 -0
  16. package/dist/key-value-database/DatabaseTable.d.ts +1 -1
  17. package/dist/object-storage/DocumentParserConnector.d.ts +4 -0
  18. package/dist/object-storage/DocumentParserConnectorConstructor.d.ts +4 -0
  19. package/dist/object-storage/ObjectStoreBucketOptions.d.ts +4 -0
  20. package/dist/object-storage/event/SyncCompleteEvent.d.ts +2 -2
  21. package/dist/object-storage/event/SyncCompleteEventPayload.d.ts +10 -0
  22. package/dist/object-storage/event/SyncCompleteEventPayload.js +1 -0
  23. package/dist/object-storage/event/index.d.ts +1 -0
  24. package/dist/vector-database/VectorDatabase.d.ts +10 -0
  25. package/dist/vector-database/VectorDatabaseConnector.d.ts +10 -0
  26. package/dist/vector-database/VectorDatabaseConnectorConstructor.d.ts +1 -1
  27. package/package.json +1 -1
@@ -41,7 +41,7 @@ export interface ICluster extends IClusterEventEmitter {
41
41
  * @param name The name of the external storage connection.
42
42
  * @param type The type of the external storage connection.
43
43
  * @throws {@link SDKClientErrorCodes.ExternalStorageConnectionAlreadyExists} if the external storage connection is already open.
44
- * @throws {@link SDKClientErrorCodes.ExternalStorageConnectionNameNotString} if the name is not a string.
44
+ * @throws {@link SDKClientErrorCodes.ExternalStorageNameNotString} if the name is not a string.
45
45
  * @returns The external storage connection.
46
46
  */
47
47
  openExternalStorageConnection(name: string, type: ExternalStorageType): Promise<IExternalStorageConnection>;
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Represents the options for closing the SDK.
3
+ * @category Core
3
4
  */
4
5
  export interface ISDKCloseOptions {
5
6
  /**
@@ -3,6 +3,7 @@ import { IDataStream } from '../core';
3
3
  import { IExternalStorageListOptions } from '.';
4
4
  /**
5
5
  * The type of external storage.
6
+ * @category External Storage
6
7
  */
7
8
  export declare enum ExternalStorageType {
8
9
  /**
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The type of external storage.
3
+ * @category External Storage
3
4
  */
4
5
  export var ExternalStorageType;
5
6
  (function (ExternalStorageType) {
@@ -26,7 +26,7 @@ export interface IGenerativeAIContext {
26
26
  ratePrompt(parameters: IGenerativeAIRatingCreateJobParameters): Promise<IGenerativeAIRatingResult>;
27
27
  /**
28
28
  * Download a document.
29
- * @param parameters The parameters of the download document job.
29
+ * @param documentPath The path of the document to download.
30
30
  * @returns A promise that resolves with the result containing the document as an ArrayBuffer.
31
31
  */
32
32
  downloadDocument(documentPath: string): Promise<IGenerativeAIDownloadDocumentResult>;
@@ -14,10 +14,20 @@ export interface IGenerativeAIPromptOptions extends IGenerativeAIOptions {
14
14
  * The instructions for the AI job.
15
15
  */
16
16
  instructions?: string;
17
+ /**
18
+ * The grammar to use for the AI job.
19
+ */
20
+ grammar?: string;
17
21
  /**
18
22
  * The context for the AI job.
19
23
  */
20
24
  history?: IPromptHistory[];
25
+ /**
26
+ * The internal context for the AI job.
27
+ */
28
+ internalContext?: {
29
+ [key: string]: string;
30
+ };
21
31
  /**
22
32
  * The maximum number of tokens to generate.
23
33
  */
@@ -20,6 +20,12 @@ export interface IGenerativeAIPromptResult extends IJobResultGenerativeAI {
20
20
  * The relevant context used by the AI job.
21
21
  */
22
22
  context?: ISearchResult[];
23
+ /**
24
+ * The internal context used by the AI job.
25
+ */
26
+ internalContext?: {
27
+ [key: string]: string;
28
+ };
23
29
  /**
24
30
  * The tokens used by the AI job.
25
31
  */
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The type of parameters supported for agentic functions
3
+ * @category AI
3
4
  */
4
5
  export declare enum PromptFunctionParamsType {
5
6
  /**
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The type of parameters supported for agentic functions
3
+ * @category AI
3
4
  */
4
5
  export var PromptFunctionParamsType;
5
6
  (function (PromptFunctionParamsType) {
@@ -1,4 +1,5 @@
1
1
  /**
2
2
  * The AI prompt type text
3
+ * @category AI
3
4
  */
4
5
  export type PromptTypeText = string | string[];
@@ -1,4 +1,5 @@
1
1
  /**
2
2
  * The AI prompt type vector
3
+ * @category AI
3
4
  */
4
5
  export type PromptTypeVector = number[];
@@ -46,4 +46,14 @@ export interface IGraphDatabase extends IDataStream {
46
46
  getContent(nodes: string[], maxDepth?: number, contentSize?: number): {
47
47
  [key: string]: string[];
48
48
  };
49
+ /**
50
+ * Save the database to disk.
51
+ * @param version The version of the data collection.
52
+ */
53
+ saveToDisk(version: string): void;
54
+ /**
55
+ * Load the database from disk.
56
+ * @param version The version of the data collection.
57
+ */
58
+ loadFromDisk(version: string): void;
49
59
  }
@@ -38,4 +38,14 @@ export interface IGraphDatabaseConnector {
38
38
  * @returns The size of the database.
39
39
  */
40
40
  getSize(): number;
41
+ /**
42
+ * Save the database to disk.
43
+ * @param version The version of the data collection.
44
+ */
45
+ saveToDisk(version: string): void;
46
+ /**
47
+ * Load the database from disk.
48
+ * @param version The version of the data collection.
49
+ */
50
+ loadFromDisk(version: string): void;
41
51
  }
@@ -3,4 +3,4 @@ import { IGraphDatabaseConnector } from './GraphDatabaseConnector';
3
3
  * The graph database connector constructor type.
4
4
  * @category Graph Database
5
5
  */
6
- export type GraphDatabaseConnectorConstructor = new () => IGraphDatabaseConnector;
6
+ export type GraphDatabaseConnectorConstructor = new (dbKey: string) => IGraphDatabaseConnector;
@@ -1,4 +1,8 @@
1
1
  import { IJobParameters, IJobResult } from './Job';
2
+ /**
3
+ * The Job Worker options.
4
+ * @category Job
5
+ */
2
6
  export interface IJobWorkerOptions {
3
7
  }
4
8
  /**
@@ -52,7 +52,7 @@ export interface IDatabaseTable<T extends IValueType> {
52
52
  count(query?: IDatabaseTableQuery | IQueryBuilder): Promise<number>;
53
53
  /**
54
54
  * Subscribe to changes in the database table.
55
- * @params callback The callback to call when the database table changes.
55
+ * @param callback The callback to call when the database table changes.
56
56
  */
57
57
  subscribe(callback: (event: IDatabaseTableEvent<T>) => void): void;
58
58
  /**
@@ -1,4 +1,8 @@
1
1
  import { IFile } from './File';
2
+ /**
3
+ * The interface for the document parser connector.
4
+ * @category Object Storage
5
+ */
2
6
  export interface IDocumentParserConnector {
3
7
  /**
4
8
  * Parses a document.
@@ -1,2 +1,6 @@
1
1
  import { IDocumentParserConnector } from './DocumentParserConnector';
2
+ /**
3
+ * The constructor for the document parser connector.
4
+ * @category Object Storage
5
+ */
2
6
  export type DocumentParserConnectorConstructor = new () => IDocumentParserConnector;
@@ -7,4 +7,8 @@ export interface IObjectStoreBucketOptions {
7
7
  * Whether to sync the content of the bucket.
8
8
  */
9
9
  syncContent?: boolean;
10
+ /**
11
+ * Whether the bucket is standalone.
12
+ */
13
+ standalone?: boolean;
10
14
  }
@@ -1,4 +1,4 @@
1
- import { StorageEventType } from '.';
1
+ import { StorageEventType, ISyncCompleteEventPayload } from '.';
2
2
  /**
3
3
  * The sync complete event.
4
4
  * @category Object Storage
@@ -11,5 +11,5 @@ export interface ISyncCompleteEvent {
11
11
  /**
12
12
  * The sync complete event payload.
13
13
  */
14
- payload: null;
14
+ payload: ISyncCompleteEventPayload;
15
15
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The sync complete event payload interface.
3
+ * @category Object Storage
4
+ */
5
+ export interface ISyncCompleteEventPayload {
6
+ /**
7
+ * The number of files synced.
8
+ */
9
+ filesSynced: number;
10
+ }
@@ -9,5 +9,6 @@ export { IFolderMoveEvent } from './FolderMoveEvent';
9
9
  export { IObjectDeleteEventPayload } from './ObjectDeleteEventPayload';
10
10
  export { IObjectMoveEventPayload } from './ObjectMoveEventPayload';
11
11
  export { ISyncCompleteEvent } from './SyncCompleteEvent';
12
+ export { ISyncCompleteEventPayload } from './SyncCompleteEventPayload';
12
13
  export { StorageEvent } from './StorageEvent';
13
14
  export { StorageEventType } from './StorageEventType';
@@ -39,4 +39,14 @@ export interface IVectorDatabase extends IDataStream {
39
39
  * @param name The name of the content.
40
40
  */
41
41
  remove(name: string): void;
42
+ /**
43
+ * Save the database to disk.
44
+ * @param version The version of the data collection.
45
+ */
46
+ saveToDisk(version: string): void;
47
+ /**
48
+ * Load the database from disk.
49
+ * @param version The version of the data collection.
50
+ */
51
+ loadFromDisk(version: string): void;
42
52
  }
@@ -31,4 +31,14 @@ export interface IVectorDatabaseConnector {
31
31
  * @returns The content of the database.
32
32
  */
33
33
  getBuffer(): ArrayBuffer;
34
+ /**
35
+ * Save the database to disk.
36
+ * @param version The version of the data collection.
37
+ */
38
+ saveToDisk(version: string): void;
39
+ /**
40
+ * Load the database from disk.
41
+ * @param version The version of the data collection.
42
+ */
43
+ loadFromDisk(version: string): void;
34
44
  }
@@ -3,4 +3,4 @@ import { IVectorDatabaseConnector } from '.';
3
3
  * The vector database connector constructor type.
4
4
  * @category Vector Database
5
5
  */
6
- export type VectorDatabaseConnectorConstructor = new () => IVectorDatabaseConnector;
6
+ export type VectorDatabaseConnectorConstructor = new (dbKey: string) => IVectorDatabaseConnector;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewdle/web-sdk-types",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "The Crewdle Mist Web SDK public types and interfaces",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",