@squidcloud/client 1.0.416 → 1.0.417

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 (43) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/esm/index.js +1 -1
  3. package/dist/internal-common/src/metric-name.d.ts +9 -0
  4. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
  5. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
  6. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
  7. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +177 -0
  8. package/dist/internal-common/src/types/ai-agent.types.d.ts +184 -0
  9. package/dist/internal-common/src/types/ai-assistant.types.d.ts +1 -0
  10. package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
  11. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
  12. package/dist/internal-common/src/types/backend-function.types.d.ts +1 -0
  13. package/dist/internal-common/src/types/communication.types.d.ts +1 -0
  14. package/dist/internal-common/src/types/document.types.d.ts +1 -0
  15. package/dist/internal-common/src/types/file.types.d.ts +6 -0
  16. package/dist/internal-common/src/types/headers.types.d.ts +17 -0
  17. package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
  18. package/dist/internal-common/src/types/notification.types.d.ts +5 -0
  19. package/dist/internal-common/src/types/observability.types.d.ts +78 -0
  20. package/dist/internal-common/src/types/query.types.d.ts +13 -0
  21. package/dist/internal-common/src/types/secret.types.d.ts +7 -0
  22. package/dist/internal-common/src/types/socket.types.d.ts +1 -0
  23. package/dist/internal-common/src/types/stage.d.ts +9 -0
  24. package/dist/internal-common/src/types/time-units.d.ts +1 -0
  25. package/dist/internal-common/src/types/url-shortener.types.d.ts +41 -0
  26. package/dist/internal-common/src/utils/array.d.ts +7 -0
  27. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
  28. package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
  29. package/dist/internal-common/src/utils/http.d.ts +5 -0
  30. package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
  31. package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
  32. package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
  33. package/dist/internal-common/src/utils/object.d.ts +58 -0
  34. package/dist/internal-common/src/utils/serialization.d.ts +17 -0
  35. package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
  36. package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
  37. package/dist/internal-common/src/utils/validation.d.ts +19 -0
  38. package/dist/internal-common/src/websocket.impl.d.ts +26 -0
  39. package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +2 -0
  40. package/dist/typescript-client/src/distributed-lock.manager.d.ts +13 -1
  41. package/dist/typescript-client/src/squid.d.ts +4 -2
  42. package/dist/typescript-client/src/version.d.ts +1 -1
  43. package/package.json +1 -1
@@ -69,10 +69,12 @@ export declare class AiKnowledgeBaseReference {
69
69
  }): Promise<Array<AiKnowledgeBaseSearchResultChunk>>;
70
70
  /**
71
71
  * Performs a semantic search in the knowledge base and returns contexts with reasoning.
72
+ * Can be used for matchmaking or similarity search.
72
73
  */
73
74
  searchContextsWithPrompt(request: Omit<AiKnowledgeBaseSearchContextsWithPromptRequest, 'knowledgeBaseId'>): Promise<Array<AiKnowledgeBaseContextWithReasoning>>;
74
75
  /**
75
76
  * Performs a semantic search in the knowledge base and returns contexts with reasoning.
77
+ * Can be used for matchmaking or similarity search.
76
78
  */
77
79
  searchContextsWithContextId(request: Omit<AiKnowledgeBaseSearchContextsWithContextIdRequest, 'knowledgeBaseId'>): Promise<Array<AiKnowledgeBaseContextWithReasoning>>;
78
80
  /**
@@ -1,4 +1,16 @@
1
1
  import { Observable } from 'rxjs';
2
+ /**
3
+ * Options for acquiring a distributed lock.
4
+ * @category Platform
5
+ */
6
+ export interface DistributedLockOptions {
7
+ /**
8
+ * The maximum time the lock can be held before it is automatically released.
9
+ * If not specified, the lock will be held until explicitly released or the connection is lost.
10
+ * @default undefined (no limit).
11
+ */
12
+ maxHoldTimeMillis?: number;
13
+ }
2
14
  /**
3
15
  * A handler for a distributed lock that can be released.
4
16
  * @category Platform
@@ -9,7 +21,7 @@ export interface DistributedLock {
9
21
  * The release process runs asynchronously. Use `observeRelease()` to be notified when the release completes.
10
22
  * @returns A promise that resolves when the release message is sent, or undefined for backward compatibility.
11
23
  */
12
- release(): Promise<void> | void;
24
+ release(): Promise<void>;
13
25
  /**
14
26
  * Whether the lock has been released.
15
27
  * @returns True if the lock has been released.
@@ -3,7 +3,7 @@ import { AiClient } from './ai-client';
3
3
  import { ApiClient } from './api-client';
4
4
  import { CollectionReference } from './collection-reference';
5
5
  import { ConnectionDetails } from './connection-details';
6
- import { DistributedLock } from './distributed-lock.manager';
6
+ import { DistributedLock, DistributedLockOptions } from './distributed-lock.manager';
7
7
  import { ExecuteFunctionOptions } from './execute-function-options';
8
8
  import { ExternalAuthClient } from './external-auth-client';
9
9
  import { ExtractionClient } from './extraction-client';
@@ -349,9 +349,11 @@ export declare class Squid {
349
349
  * The lock will be released when the release method on the returned object is invoked or whenever the connection
350
350
  * with the server is lost.
351
351
  * @param mutex A string that uniquely identifies the lock.
352
+ * @param options Optional configuration for the lock, including maxHoldTimeMillis to automatically release the lock
353
+ * after a specified duration.
352
354
  * @returns A promise that resolves with the lock object. The promise will reject if failed to acquire the lock.
353
355
  */
354
- acquireLock(mutex: string): Promise<DistributedLock>;
356
+ acquireLock(mutex: string, options?: DistributedLockOptions): Promise<DistributedLock>;
355
357
  /**
356
358
  * Executes the given callback while holding a lock for the given mutex. The lock will be released when the callback
357
359
  * finishes.
@@ -2,4 +2,4 @@
2
2
  * The current version of the SquidCloud client package.
3
3
  * @category Platform
4
4
  */
5
- export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.416";
5
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.417";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.416",
3
+ "version": "1.0.417",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",