@crewdle/web-sdk-types 1.0.10 → 1.0.12

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 (51) hide show
  1. package/dist/ai/GenerativeAIContext.d.ts +16 -0
  2. package/dist/ai/GenerativeAIContext.js +1 -0
  3. package/dist/ai/GenerativeAIWorker.d.ts +10 -0
  4. package/dist/ai/GenerativeAIWorker.js +1 -0
  5. package/dist/ai/GenerativeAIWorkerConnector.d.ts +32 -0
  6. package/dist/ai/GenerativeAIWorkerConnector.js +1 -0
  7. package/dist/ai/GenerativeAIWorkerConnectorConstructor.d.ts +6 -0
  8. package/dist/ai/GenerativeAIWorkerConnectorConstructor.js +1 -0
  9. package/dist/ai/VectorDatabaseConnector.d.ts +22 -0
  10. package/dist/ai/VectorDatabaseConnector.js +1 -0
  11. package/dist/ai/VectorDatabaseConnectorConstructor.d.ts +6 -0
  12. package/dist/ai/VectorDatabaseConnectorConstructor.js +1 -0
  13. package/dist/ai/index.d.ts +6 -0
  14. package/dist/ai/index.js +6 -0
  15. package/dist/core/cluster/Cluster.d.ts +24 -2
  16. package/dist/core/node/agent/AgentCapacity.d.ts +1 -0
  17. package/dist/core/sdk/SDKOptions.d.ts +9 -0
  18. package/dist/core/stream/ContentType.d.ts +5 -1
  19. package/dist/core/stream/ContentType.js +4 -0
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.js +2 -0
  22. package/dist/job/Job.d.ts +108 -0
  23. package/dist/job/Job.js +34 -0
  24. package/dist/job/JobDispatcher.d.ts +30 -0
  25. package/dist/job/JobDispatcher.js +1 -0
  26. package/dist/job/JobWorker.d.ts +10 -0
  27. package/dist/job/JobWorker.js +1 -0
  28. package/dist/job/JobWorkerConnector.d.ts +12 -0
  29. package/dist/job/JobWorkerConnector.js +1 -0
  30. package/dist/job/index.d.ts +4 -0
  31. package/dist/job/index.js +4 -0
  32. package/dist/object-storage/FileDescriptor.d.ts +11 -1
  33. package/dist/object-storage/FilePayload.d.ts +4 -0
  34. package/dist/object-storage/FileStatus.d.ts +17 -0
  35. package/dist/object-storage/FileStatus.js +18 -0
  36. package/dist/object-storage/FolderDescriptor.d.ts +4 -0
  37. package/dist/object-storage/ObjectStoreBucket.d.ts +2 -1
  38. package/dist/object-storage/ObjectStoreBucketOptions.d.ts +10 -0
  39. package/dist/object-storage/ObjectStoreBucketOptions.js +1 -0
  40. package/dist/object-storage/ObjectStoreConnector.d.ts +8 -4
  41. package/dist/object-storage/ObjectStoreListOptions.d.ts +15 -0
  42. package/dist/object-storage/ObjectStoreListOptions.js +1 -0
  43. package/dist/object-storage/event/StorageEvent.d.ts +2 -2
  44. package/dist/object-storage/event/StorageEventType.d.ts +4 -0
  45. package/dist/object-storage/event/StorageEventType.js +4 -0
  46. package/dist/object-storage/event/SyncCompleteEvent.d.ts +11 -0
  47. package/dist/object-storage/event/SyncCompleteEvent.js +1 -0
  48. package/dist/object-storage/event/index.d.ts +1 -0
  49. package/dist/object-storage/index.d.ts +3 -0
  50. package/dist/object-storage/index.js +1 -0
  51. package/package.json +6 -1
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Represents a context for a Generative AI service.
3
+ * @category AI
4
+ */
5
+ export interface IGenerativeAIContext {
6
+ /**
7
+ * Prompt the Generative AI Context to start processing a prompt.
8
+ * @param prompt The prompt to start processing.
9
+ * @returns The response from the AI service.
10
+ */
11
+ prompt(prompt: string): Promise<string>;
12
+ /**
13
+ * Close the Generative AI Context.
14
+ */
15
+ close(): void;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The Generative AI Worker interface.
3
+ * @category AI
4
+ */
5
+ export interface IGenerativeAIWorker {
6
+ /**
7
+ * Close the Generative AI Worker.
8
+ */
9
+ close(): void;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import { IJob, IJobWorkerConnector, IJobResult } from '../job';
2
+ /**
3
+ * The generative AI worker connector interface.
4
+ * @category Connector
5
+ */
6
+ export interface IGenerativeAIWorkerConnector extends IJobWorkerConnector {
7
+ /**
8
+ * Initialize the machine learning model.
9
+ * @param llmModel The path to the LLM model.
10
+ * @param similarityModel The path to the similarity model.
11
+ * @returns A promise that resolves when the model has been initialized.
12
+ */
13
+ initialize(llmModel?: string, similarityModel?: string): Promise<void>;
14
+ /**
15
+ * Add content to the machine learning model.
16
+ * @param name The name of the content.
17
+ * @param content The content to add.
18
+ * @returns A promise that resolves when the content has been added.
19
+ */
20
+ addContent(name: string, content: string): Promise<void>;
21
+ /**
22
+ * Remove content from the machine learning model.
23
+ * @param name The name of the content.
24
+ */
25
+ removeContent(name: string): void;
26
+ /**
27
+ * Process a job.
28
+ * @param job The job to process.
29
+ * @returns An async generator that yields the job result.
30
+ */
31
+ processJob(job: IJob): AsyncGenerator<IJobResult>;
32
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { IGenerativeAIWorkerConnector, VectorDatabaseConnectorConstructor } from '.';
2
+ /**
3
+ * The generative AI worker connector constructor type.
4
+ * @category AI
5
+ */
6
+ export type GenerativeAIWorkerConnectorConstructor = new (vectorDatabaseConnector: VectorDatabaseConnectorConstructor) => IGenerativeAIWorkerConnector;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The vector database connector interface.
3
+ * @category Connector
4
+ */
5
+ export interface IVectorDatabaseConnector {
6
+ /**
7
+ * Search for the k nearest vectors.
8
+ * @param vector The vector to search for.
9
+ * @param k The number of nearest vectors to return.
10
+ */
11
+ search(vector: number[], k: number): number[];
12
+ /**
13
+ * Insert vectors into the database.
14
+ * @param vectors The vectors to insert.
15
+ */
16
+ insert(vectors: number[][]): void;
17
+ /**
18
+ * Remove vectors from the database.
19
+ * @param ids The IDs of the vectors to remove.
20
+ */
21
+ remove(ids: number[]): void;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { IVectorDatabaseConnector } from '.';
2
+ /**
3
+ * The vector database connector constructor type.
4
+ * @category AI
5
+ */
6
+ export type VectorDatabaseConnectorConstructor = new () => IVectorDatabaseConnector;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from './GenerativeAIContext';
2
+ export * from './GenerativeAIWorker';
3
+ export * from './GenerativeAIWorkerConnector';
4
+ export * from './GenerativeAIWorkerConnectorConstructor';
5
+ export * from './VectorDatabaseConnector';
6
+ export * from './VectorDatabaseConnectorConstructor';
@@ -0,0 +1,6 @@
1
+ export * from './GenerativeAIContext';
2
+ export * from './GenerativeAIWorker';
3
+ export * from './GenerativeAIWorkerConnector';
4
+ export * from './GenerativeAIWorkerConnectorConstructor';
5
+ export * from './VectorDatabaseConnector';
6
+ export * from './VectorDatabaseConnectorConstructor';
@@ -1,7 +1,8 @@
1
1
  import { IClusterEventEmitter } from '.';
2
+ import { IGenerativeAIContext, IGenerativeAIWorker } from '../../ai';
2
3
  import { IKeyValueDatabase, IDatabaseLayout, ILayoutBuilder } from '../../key-value-database';
3
4
  import { ILocalMediaStream, ILocalDynamicMediaStream, IRemoteMediaStream, MediaStreamSource } from '../../media-stream';
4
- import { IObjectStoreBucket } from '../../object-storage';
5
+ import { IObjectStoreBucket, IObjectStoreBucketOptions } from '../../object-storage';
5
6
  import { IPubSubTopic } from '../../pubsub';
6
7
  import { LocalNode, Node } from '../node';
7
8
  /**
@@ -24,11 +25,12 @@ export interface ICluster extends IClusterEventEmitter {
24
25
  /**
25
26
  * Open a object store bucket.
26
27
  * @param name The name of the Object Store bucket.
28
+ * @param syncContent Whether to sync the content of the object store.
27
29
  * @throws {@link SDKClientErrorCodes.ObjectStoreAlreadyExists} if the data stream is already open.
28
30
  * @throws {@link SDKClientErrorCodes.ObjectStoreNameNotString} if the name is not a string.
29
31
  * @returns A promise that resolves with the data stream.
30
32
  */
31
- openObjectStoreBucket(name: string): Promise<IObjectStoreBucket>;
33
+ openObjectStoreBucket(name: string, options?: IObjectStoreBucketOptions): Promise<IObjectStoreBucket>;
32
34
  /**
33
35
  * Open a key-value database.
34
36
  * @param name The name of the key-value database.
@@ -39,6 +41,16 @@ export interface ICluster extends IClusterEventEmitter {
39
41
  * @returns A promise that resolves with the key-value database.
40
42
  */
41
43
  openKeyValueDatabase(name: string, layout: IDatabaseLayout | ILayoutBuilder): Promise<IKeyValueDatabase>;
44
+ /**
45
+ * Open a generative AI context.
46
+ * @param label The label of the generative AI context.
47
+ */
48
+ openGenerativeAIContext(label: string): Promise<IGenerativeAIContext>;
49
+ /**
50
+ * Open a generative AI worker.
51
+ * @param label The label of the generative AI Worker.
52
+ */
53
+ openGenerativeAIWorker(label: string): Promise<IGenerativeAIWorker>;
42
54
  /**
43
55
  * Publish a local media stream.
44
56
  * @param label The label of the media stream.
@@ -70,6 +82,16 @@ export interface ICluster extends IClusterEventEmitter {
70
82
  * @param strategy The strategy to use to filter the key-value databases.
71
83
  */
72
84
  getKeyValueDatabases(strategy?: (item: IKeyValueDatabase) => boolean): IKeyValueDatabase[];
85
+ /**
86
+ * Get an array of opened generative AI contexts.
87
+ * @param strategy The strategy to use to filter the job dispatchers.
88
+ */
89
+ getGenerativeAIContexts(strategy?: (item: IGenerativeAIContext) => boolean): IGenerativeAIContext[];
90
+ /**
91
+ * Get an array of opened generative AI workers.
92
+ * @param strategy The strategy to use to filter the job workers.
93
+ */
94
+ getGenerativeAIWorkers(strategy?: (item: IGenerativeAIWorker) => boolean): IGenerativeAIWorker[];
73
95
  /**
74
96
  * Get an array of published local media streams.
75
97
  * @param strategy The strategy to use to filter the media streams.
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The agent capacity interface used for reporting the agent's capacity.
3
+ * @category Core
3
4
  */
4
5
  export interface IAgentCapacity {
5
6
  /**
@@ -2,6 +2,7 @@ import { KeyValueDatabaseConnectorConstructor } from '../../key-value-database';
2
2
  import { ILoggingConnector } from '.';
3
3
  import { ObjectStoreConnectorConstructor } from '../../object-storage';
4
4
  import { PeerConnectionConnectorConstructor } from '../connection';
5
+ import { GenerativeAIWorkerConnectorConstructor, VectorDatabaseConnectorConstructor } from '../../ai';
5
6
  /**
6
7
  * Options to configure the SDK.
7
8
  * @category Core
@@ -34,6 +35,14 @@ export interface ISDKOptions {
34
35
  * If not provided, the default peer connection connector is WebRTC in browser.
35
36
  */
36
37
  peerConnectionConnector?: PeerConnectionConnectorConstructor;
38
+ /**
39
+ * The custom generative AI worker connector to use for generative AI tasks.
40
+ */
41
+ generativeAIWorkerConnector?: GenerativeAIWorkerConnectorConstructor;
42
+ /**
43
+ * The custom vector database connector to use for vector database tasks.
44
+ */
45
+ vectorDatabaseConnector?: VectorDatabaseConnectorConstructor;
37
46
  /**
38
47
  * The maximum number of outgoing subscriptions.
39
48
  */
@@ -26,5 +26,9 @@ export declare enum ContentType {
26
26
  /**
27
27
  * @ignore
28
28
  */
29
- KeyValueDatabase = "keyvaluedatabase"
29
+ KeyValueDatabase = "keyvaluedatabase",
30
+ /**
31
+ * @ignore
32
+ */
33
+ Job = "job"
30
34
  }
@@ -29,4 +29,8 @@ export var ContentType;
29
29
  * @ignore
30
30
  */
31
31
  ContentType["KeyValueDatabase"] = "keyvaluedatabase";
32
+ /**
33
+ * @ignore
34
+ */
35
+ ContentType["Job"] = "job";
32
36
  })(ContentType || (ContentType = {}));
package/dist/index.d.ts CHANGED
@@ -3,3 +3,5 @@ export * from './key-value-database';
3
3
  export * from './media-stream';
4
4
  export * from './object-storage';
5
5
  export * from './pubsub';
6
+ export * from './job';
7
+ export * from './ai';
package/dist/index.js CHANGED
@@ -3,3 +3,5 @@ export * from './key-value-database';
3
3
  export * from './media-stream';
4
4
  export * from './object-storage';
5
5
  export * from './pubsub';
6
+ export * from './job';
7
+ export * from './ai';
@@ -0,0 +1,108 @@
1
+ /**
2
+ * IJob Interface
3
+ * Represents a job to be executed by the JobService.
4
+ * @ignore
5
+ */
6
+ export interface IJob {
7
+ /**
8
+ * The ID of the job.
9
+ */
10
+ id: string;
11
+ /**
12
+ * The parameters of the job.
13
+ */
14
+ parameters: JobParameters;
15
+ /**
16
+ * The status of the job.
17
+ */
18
+ status?: JobStatus;
19
+ }
20
+ /**
21
+ * JobType Enum
22
+ * Provide this to create a job with a specific type.
23
+ * @ignore
24
+ */
25
+ export declare enum JobType {
26
+ AI = 0,
27
+ Other = 1
28
+ }
29
+ /**
30
+ * JobStatus Enum
31
+ * Represents the status of a job.
32
+ * @ignore
33
+ */
34
+ export declare enum JobStatus {
35
+ /**
36
+ * The job is pending.
37
+ */
38
+ Pending = "Pending",
39
+ /**
40
+ * The job is processing.
41
+ */
42
+ Processing = "Processing",
43
+ /**
44
+ * The job is completed.
45
+ */
46
+ Completed = "Completed",
47
+ /**
48
+ * The job has failed.
49
+ */
50
+ Failed = "Failed"
51
+ }
52
+ /**
53
+ * Base IJobParameters Interface
54
+ * Allows providing parameters specific to the job type.
55
+ * @ignore
56
+ */
57
+ export interface IJobParameters {
58
+ jobType: JobType;
59
+ }
60
+ /**
61
+ * IJobParametersAI Interface
62
+ * Parameters for AI job type.
63
+ * @ignore
64
+ */
65
+ export interface IJobParametersAI extends IJobParameters {
66
+ jobType: JobType.AI;
67
+ prompt: string;
68
+ }
69
+ /**
70
+ * JobParameters Type
71
+ * Union of all job parameters interfaces.
72
+ * @ignore
73
+ */
74
+ export type JobParameters = IJobParametersAI;
75
+ /**
76
+ * IJobResult Interface
77
+ * Represents the result of a job.
78
+ * @ignore
79
+ */
80
+ export interface IJobResult {
81
+ /**
82
+ * The ID of the job.
83
+ */
84
+ id: string;
85
+ /**
86
+ * The status of the job result.
87
+ */
88
+ status: JobStatus;
89
+ /**
90
+ * The result of the job.
91
+ */
92
+ result: JobResult;
93
+ }
94
+ /**
95
+ * IJobResultAI Interface
96
+ * Represents the result of an AI job.
97
+ * @ignore
98
+ */
99
+ export interface IJobResultAI {
100
+ jobType: JobType.AI;
101
+ output: string;
102
+ }
103
+ /**
104
+ * JobResult Type
105
+ * Union of all job result interfaces.
106
+ * @ignore
107
+ */
108
+ export type JobResult = IJobResultAI;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * JobType Enum
3
+ * Provide this to create a job with a specific type.
4
+ * @ignore
5
+ */
6
+ export var JobType;
7
+ (function (JobType) {
8
+ JobType[JobType["AI"] = 0] = "AI";
9
+ JobType[JobType["Other"] = 1] = "Other";
10
+ })(JobType || (JobType = {}));
11
+ /**
12
+ * JobStatus Enum
13
+ * Represents the status of a job.
14
+ * @ignore
15
+ */
16
+ export var JobStatus;
17
+ (function (JobStatus) {
18
+ /**
19
+ * The job is pending.
20
+ */
21
+ JobStatus["Pending"] = "Pending";
22
+ /**
23
+ * The job is processing.
24
+ */
25
+ JobStatus["Processing"] = "Processing";
26
+ /**
27
+ * The job is completed.
28
+ */
29
+ JobStatus["Completed"] = "Completed";
30
+ /**
31
+ * The job has failed.
32
+ */
33
+ JobStatus["Failed"] = "Failed";
34
+ })(JobStatus || (JobStatus = {}));
@@ -0,0 +1,30 @@
1
+ import type { Observable } from 'rxjs';
2
+ import { IDataStream } from '../core/stream';
3
+ import { IJob, IJobResult } from './Job';
4
+ /**
5
+ * The Job Dispatcher interface.
6
+ * @ignore
7
+ */
8
+ export interface IJobDispatcher extends IDataStream {
9
+ /**
10
+ * Create a new job.
11
+ * @param jobId The ID of the job.
12
+ * @param parameters The parameters of the job.
13
+ */
14
+ createJob(job: IJob): Promise<Observable<IJobResult>>;
15
+ /**
16
+ * Get a job by ID.
17
+ * @param id The ID of the job to get.
18
+ * @returns The job.
19
+ */
20
+ getJob(id: string): IJob;
21
+ /**
22
+ * Get all jobs.
23
+ * @returns All jobs.
24
+ */
25
+ getJobs(): IJob[];
26
+ /**
27
+ * Close the Job Dispatcher.
28
+ */
29
+ close(): void;
30
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The Job Worker interface.
3
+ * @ignore
4
+ */
5
+ export interface IJobWorker {
6
+ /**
7
+ * Close the Job Worker.
8
+ */
9
+ close(): void;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import { IJob, IJobResult } from './Job';
2
+ /**
3
+ * The Job Worker Connector interface.
4
+ * @ignore
5
+ */
6
+ export interface IJobWorkerConnector {
7
+ /**
8
+ * Process a job.
9
+ * @param job The job to process.
10
+ */
11
+ processJob(job: IJob): AsyncGenerator<IJobResult>;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './Job';
2
+ export * from './JobDispatcher';
3
+ export * from './JobWorkerConnector';
4
+ export * from './JobWorker';
@@ -0,0 +1,4 @@
1
+ export * from './Job';
2
+ export * from './JobDispatcher';
3
+ export * from './JobWorkerConnector';
4
+ export * from './JobWorker';
@@ -1,4 +1,5 @@
1
- import { ObjectKind } from '.';
1
+ import { ObjectKind } from './';
2
+ import { FileStatus } from './FileStatus';
2
3
  /**
3
4
  * The file descriptor interface.
4
5
  * @category Object Storage
@@ -28,4 +29,13 @@ export interface IFileDescriptor {
28
29
  * The path name of the file (a combination of the path and the name).
29
30
  */
30
31
  pathName: string;
32
+ /**
33
+ * The absolute path name of the file (a combination of the path and the name).
34
+ */
35
+ absolutePathName?: string;
36
+ /**
37
+ * The status of the file.
38
+ *
39
+ */
40
+ status: FileStatus;
31
41
  }
@@ -16,4 +16,8 @@ export interface IFilePayload {
16
16
  * The path of the file.
17
17
  */
18
18
  path?: string;
19
+ /**
20
+ * The flag to skip encryption.
21
+ */
22
+ skipEncryption?: boolean;
19
23
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * File status enum
3
+ */
4
+ export declare enum FileStatus {
5
+ /**
6
+ * The file is pending, the content is not available.
7
+ */
8
+ Pending = "pending",
9
+ /**
10
+ * The file is syncing, the content is out of date.
11
+ */
12
+ Syncing = "syncing",
13
+ /**
14
+ * The file is synced, the content is available.
15
+ */
16
+ Synced = "synced"
17
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * File status enum
3
+ */
4
+ export var FileStatus;
5
+ (function (FileStatus) {
6
+ /**
7
+ * The file is pending, the content is not available.
8
+ */
9
+ FileStatus["Pending"] = "pending";
10
+ /**
11
+ * The file is syncing, the content is out of date.
12
+ */
13
+ FileStatus["Syncing"] = "syncing";
14
+ /**
15
+ * The file is synced, the content is available.
16
+ */
17
+ FileStatus["Synced"] = "synced";
18
+ })(FileStatus || (FileStatus = {}));
@@ -20,6 +20,10 @@ export interface IFolderDescriptor {
20
20
  * The path name of the folder (a combination of the path and the name).
21
21
  */
22
22
  pathName: string;
23
+ /**
24
+ * The absolute path name of the folder (a combination of the path and the name).
25
+ */
26
+ absolutePathName?: string;
23
27
  /**
24
28
  * The folder entries.
25
29
  */
@@ -1,6 +1,7 @@
1
1
  import { IDataStream } from '../core/stream';
2
2
  import { ObjectDescriptor, Payload } from '.';
3
3
  import { StorageEvent } from './event';
4
+ import { IObjectStoreListOptions } from './ObjectStoreListOptions';
4
5
  /**
5
6
  * The object store bucket interface.
6
7
  * @category Object Storage
@@ -51,5 +52,5 @@ export interface IObjectStoreBucket extends IDataStream {
51
52
  * @param recursive Whether to list the objects and folders recursively.
52
53
  * @returns The list of objects and folders.
53
54
  */
54
- list(path: string, recursive?: boolean): Promise<ObjectDescriptor[]>;
55
+ list(path: string, options?: IObjectStoreListOptions): Promise<ObjectDescriptor[]>;
55
56
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Options for creating an Object Store bucket.
3
+ * @category Object Storage
4
+ */
5
+ export interface IObjectStoreBucketOptions {
6
+ /**
7
+ * Whether to sync the content of the bucket.
8
+ */
9
+ syncContent?: boolean;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { ObjectDescriptor, ObjectKind } from '.';
1
+ import { IFileDescriptor, IFolderDescriptor, ObjectDescriptor, ObjectKind } from '.';
2
2
  /**
3
3
  * The object store connector interface.
4
4
  * @category Connector
@@ -20,24 +20,28 @@ export interface IObjectStoreConnector {
20
20
  /**
21
21
  * Creates a folder.
22
22
  * @param path The path to the folder.
23
- * @returns A promise that resolves when the folder is created.
23
+ * @returns A promise that resolves with the folder descriptor.
24
24
  */
25
- createFolder(path: string): Promise<void>;
25
+ createFolder(path: string): Promise<IFolderDescriptor>;
26
26
  /**
27
27
  * Writes a file.
28
28
  * @param file The file to write.
29
29
  * @param path The path to write the file to.
30
+ * @param skipEncryption Whether to skip encryption.
31
+ * @returns A promise that resolves with the file descriptor.
30
32
  */
31
- writeFile(file: File, path?: string): Promise<void>;
33
+ writeFile(file: File, path?: string, skipEncryption?: boolean): Promise<IFileDescriptor>;
32
34
  /**
33
35
  * Moves an object.
34
36
  * @param path The path to the object.
35
37
  * @param newPath The path to move the object to.
38
+ * @returns A promise that resolves with the object kind.
36
39
  */
37
40
  moveObject(path: string, newPath: string): Promise<ObjectKind>;
38
41
  /**
39
42
  * Deletes an object.
40
43
  * @param path The path to the object.
44
+ * @returns A promise that resolves with the object kind.
41
45
  */
42
46
  deleteObject(path: string): Promise<ObjectKind>;
43
47
  /**
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Options for the list function on an Object Store Bucket
3
+ * @category Object Storage
4
+ */
5
+ export interface IObjectStoreListOptions {
6
+ /**
7
+ * List folders recursively.
8
+ */
9
+ recursive?: boolean;
10
+ /**
11
+ * List files that are not synced with the object store.
12
+ * i.e. the content of the file is not available.
13
+ */
14
+ includeSyncingFiles: boolean;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
- import { IFileDeleteEvent, IFileMoveEvent, IFileWriteEvent, IFolderCreateEvent, IFolderDeleteEvent, IFolderMoveEvent } from '.';
1
+ import { IFileDeleteEvent, IFileMoveEvent, IFileWriteEvent, IFolderCreateEvent, IFolderDeleteEvent, IFolderMoveEvent, ISyncCompleteEvent } from '.';
2
2
  /**
3
3
  * The object store event.
4
4
  * @category Object Storage
5
5
  */
6
- export type StorageEvent = IFileWriteEvent | IFileDeleteEvent | IFileMoveEvent | IFolderCreateEvent | IFolderDeleteEvent | IFolderMoveEvent;
6
+ export type StorageEvent = IFileWriteEvent | IFileDeleteEvent | IFileMoveEvent | IFolderCreateEvent | IFolderDeleteEvent | IFolderMoveEvent | ISyncCompleteEvent;
@@ -3,6 +3,10 @@
3
3
  * @category Object Storage
4
4
  */
5
5
  export declare enum StorageEventType {
6
+ /**
7
+ * The sync complete event.
8
+ */
9
+ SyncComplete = "sync-complete",
6
10
  /**
7
11
  * The file write event.
8
12
  */
@@ -4,6 +4,10 @@
4
4
  */
5
5
  export var StorageEventType;
6
6
  (function (StorageEventType) {
7
+ /**
8
+ * The sync complete event.
9
+ */
10
+ StorageEventType["SyncComplete"] = "sync-complete";
7
11
  /**
8
12
  * The file write event.
9
13
  */
@@ -0,0 +1,11 @@
1
+ import { StorageEventType } from '.';
2
+ export interface ISyncCompleteEvent {
3
+ /**
4
+ * The event type.
5
+ */
6
+ event: StorageEventType.SyncComplete;
7
+ /**
8
+ * The sync complete event payload.
9
+ */
10
+ payload: null;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -8,5 +8,6 @@ export { IFolderDeleteEvent } from './FolderDeleteEvent';
8
8
  export { IFolderMoveEvent } from './FolderMoveEvent';
9
9
  export { IObjectDeleteEventPayload } from './ObjectDeleteEventPayload';
10
10
  export { IObjectMoveEventPayload } from './ObjectMoveEventPayload';
11
+ export { ISyncCompleteEvent } from './SyncCompleteEvent';
11
12
  export { StorageEvent } from './StorageEvent';
12
13
  export { StorageEventType } from './StorageEventType';
@@ -1,4 +1,5 @@
1
1
  export * from './event';
2
+ export { FileStatus } from './FileStatus';
2
3
  export { IFileDescriptor } from './FileDescriptor';
3
4
  export { IFilePayload } from './FilePayload';
4
5
  export { IFolderDescriptor } from './FolderDescriptor';
@@ -7,7 +8,9 @@ export { IMovePayload } from './MovePayload';
7
8
  export { ObjectDescriptor } from './ObjectDescriptor';
8
9
  export { ObjectKind } from './ObjectKind';
9
10
  export { IObjectStoreBucket } from './ObjectStoreBucket';
11
+ export { IObjectStoreBucketOptions } from './ObjectStoreBucketOptions';
10
12
  export { IObjectStoreConnector } from './ObjectStoreConnector';
13
+ export { IObjectStoreListOptions } from './ObjectStoreListOptions';
11
14
  export { ObjectStoreConnectorConstructor } from './ObjectStoreConnectorConstructor';
12
15
  export { Payload } from './Payload';
13
16
  export { PayloadAction } from './PayloadAction';
@@ -1,3 +1,4 @@
1
1
  export * from './event';
2
+ export { FileStatus } from './FileStatus';
2
3
  export { ObjectKind } from './ObjectKind';
3
4
  export { PayloadAction } from './PayloadAction';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewdle/web-sdk-types",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
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",
@@ -17,6 +17,11 @@
17
17
  "url": "https://github.com/Crewdle/web-sdk-types/issues"
18
18
  },
19
19
  "homepage": "https://github.com/Crewdle/web-sdk-types#readme",
20
+ "peerDependencies": {
21
+ "rxjs": "^7.8.1"
22
+ },
23
+ "dependencies": {
24
+ },
20
25
  "devDependencies": {
21
26
  "typescript": "^5.4.3"
22
27
  },