@squidcloud/client 1.0.422 → 1.0.423

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 (44) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/esm/index.js +1 -1
  3. package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +1 -1
  4. package/dist/typescript-client/src/index.d.ts +0 -1
  5. package/dist/typescript-client/src/squid.d.ts +0 -7
  6. package/dist/typescript-client/src/version.d.ts +1 -1
  7. package/package.json +1 -1
  8. package/dist/internal-common/src/metric-name.d.ts +0 -9
  9. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -30
  10. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +0 -148
  11. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -72
  12. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -177
  13. package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -199
  14. package/dist/internal-common/src/types/ai-assistant.types.d.ts +0 -1
  15. package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +0 -202
  16. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -59
  17. package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
  18. package/dist/internal-common/src/types/communication.types.d.ts +0 -1
  19. package/dist/internal-common/src/types/document.types.d.ts +0 -1
  20. package/dist/internal-common/src/types/file.types.d.ts +0 -6
  21. package/dist/internal-common/src/types/headers.types.d.ts +0 -17
  22. package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
  23. package/dist/internal-common/src/types/notification.types.d.ts +0 -5
  24. package/dist/internal-common/src/types/observability.types.d.ts +0 -78
  25. package/dist/internal-common/src/types/query.types.d.ts +0 -13
  26. package/dist/internal-common/src/types/secret.types.d.ts +0 -7
  27. package/dist/internal-common/src/types/socket.types.d.ts +0 -1
  28. package/dist/internal-common/src/types/stage.d.ts +0 -9
  29. package/dist/internal-common/src/types/time-units.d.ts +0 -1
  30. package/dist/internal-common/src/types/url-shortener.types.d.ts +0 -41
  31. package/dist/internal-common/src/utils/array.d.ts +0 -7
  32. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
  33. package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
  34. package/dist/internal-common/src/utils/http.d.ts +0 -5
  35. package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
  36. package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
  37. package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
  38. package/dist/internal-common/src/utils/object.d.ts +0 -58
  39. package/dist/internal-common/src/utils/serialization.d.ts +0 -17
  40. package/dist/internal-common/src/utils/squid.constants.d.ts +0 -1
  41. package/dist/internal-common/src/utils/trace-id-generator.d.ts +0 -1
  42. package/dist/internal-common/src/utils/validation.d.ts +0 -19
  43. package/dist/internal-common/src/websocket.impl.d.ts +0 -26
  44. package/dist/typescript-client/src/personal-storage-client.d.ts +0 -85
@@ -1,5 +0,0 @@
1
- import { AppId } from '../public-types/communication.public-types';
2
- import { Stage } from '../types/stage';
3
- export declare const KOTLIN_CONTROLLERS: string[];
4
- export declare function getEnvironmentPrefix(shard: string | undefined, region: string, cloudId: string, stage: Stage): string;
5
- export declare function getApplicationUrl(environmentPrefix: string, appId: string, path: string, appIdPlaceholder?: AppId, environmentPrefixPlaceholder?: string, forceKotlin?: boolean): string;
@@ -1,14 +0,0 @@
1
- type LockMutex = string;
2
- /**
3
- * A simple lock manager that locks a list of mutexes.
4
- * When locking a list of mutexes, the lock will start only when all the mutexes are available - preventing partial lock
5
- * and potential deadlocks.
6
- */
7
- export declare class LockManager {
8
- private readonly locks;
9
- lock(...mutexes: LockMutex[]): Promise<void>;
10
- release(...mutexes: LockMutex[]): void;
11
- canGetLock(...mutexes: LockMutex[]): boolean;
12
- lockSync(...mutexes: LockMutex[]): void;
13
- }
14
- export {};
@@ -1,4 +0,0 @@
1
- import { QueryMetricsRequestCommon, QueryMetricsResultGroup } from '../public-types/metric.public-types';
2
- export type QueryMetricsRequestIntervals = Required<Pick<QueryMetricsRequestCommon, 'fillValue' | 'fn' | 'groupByTags' | 'periodEndSeconds' | 'periodStartSeconds' | 'pointIntervalAlignment' | 'pointIntervalSeconds' | 'tagDomains' | 'noDataBehavior'>>;
3
- /** Adds missed known tag domain groups and fills all missed points with a request.fillValue. */
4
- export declare function fillMissedPoints(request: QueryMetricsRequestIntervals, resultGroups: Array<QueryMetricsResultGroup>): void;
@@ -1,7 +0,0 @@
1
- /**
2
- * Type suffixes defines the type of the metric and can be used for
3
- * metric value validation for incoming metrics.
4
- */
5
- export declare const SQUID_METRIC_TYPE_SUFFIXES: readonly ["_count", "_time", "_size", "_entries", "_value"];
6
- /** Returns true if the given metric has a valid metric type. */
7
- export declare function hasValidMetricTypeSuffix(metricName: string): boolean;
@@ -1,58 +0,0 @@
1
- /** Returns a value by the `path`. Works with array indexes, like a.b[0]. */
2
- export declare function getInPath(obj: unknown, path: string): any;
3
- export declare function isDateObject(value: unknown): value is Date;
4
- /** Sets a value by path . Does not support array indexes. */
5
- export declare function setInPath(obj: object, path: string, value: unknown, delimiter?: string): void;
6
- export declare function deleteInPath(obj: object, path: string, delimiter?: string): void;
7
- export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
8
- export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
9
- export declare function isNil(obj: unknown): obj is null | undefined;
10
- export declare function isEqual(a: unknown, b: unknown): boolean;
11
- export declare function isEmpty(a: unknown): boolean;
12
- export declare function omit<T extends object, K extends PropertyKey[]>(object: T | null | undefined, ...fieldsToRemove: K): Pick<T, Exclude<keyof T, K[number]>>;
13
- export type CloneCustomizer = (value: unknown) => unknown | undefined;
14
- /**
15
- * Creates a deep copy of the specified object, including all nested objects and specifically handling Date, Map, and
16
- * Set fields.
17
- *
18
- * The customizer function can modify the cloning process for the object and its fields. If the customizer
19
- * returns 'undefined' for any input, the function falls back to the standard cloning logic.
20
- *
21
- * The cloning process is recursive, ensuring deep cloning of all objects.
22
- *
23
- * Note: This function does not support cloning objects with circular dependencies and will throw a system stack
24
- * overflow error if encountered.
25
- */
26
- export declare function cloneDeep<R = unknown>(value: R, customizer?: CloneCustomizer): R;
27
- /** Creates a shallow clone of the object. */
28
- export declare function cloneShallow<T>(value: T): T;
29
- export declare function deepMerge<T extends object, U extends object>(target: T, source: U): T & U;
30
- /** Returns true if the `value` is a defined object and is not an array. */
31
- export declare function isPlainObject(value: unknown): value is object;
32
- /** Compares 2 values. 'null' and 'undefined' values are considered equal and are less than any other values. */
33
- export declare function compareValues(v1: unknown, v2: unknown): number;
34
- /** Returns a new object with all top-level object fields re-mapped using `valueMapperFn`. */
35
- export declare function mapValues<ResultType extends object = Record<string, unknown>, InputType extends Record<string, unknown> = Record<string, unknown>>(obj: InputType, valueMapperFn: (value: any, key: keyof InputType, obj: InputType) => unknown): ResultType;
36
- /** Groups elements of the array by key. See _.groupBy for details. */
37
- export declare function groupBy<T, K extends PropertyKey>(array: T[], getKey: (item: T) => K): Record<K, T[]>;
38
- /**
39
- * Picks selected fields from the object and returns a new object with the fields selected.
40
- * The selected fields are assigned by reference (there is no cloning).
41
- */
42
- export declare function pick<T extends object, K extends keyof T>(obj: T, keys: ReadonlyArray<K>): Pick<T, K>;
43
- /** Inverts the record: swaps keys and values. */
44
- export declare function invert<K extends string | number, V extends string | number>(record: Record<K, V>): Record<V, K>;
45
- /**
46
- * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
47
- * If end is less than start a zero-length range is created unless a negative step is specified.
48
- *
49
- * Same as lodash range but with an additional parameter: `maximumNumberOfItems`.
50
- */
51
- export declare function range(start: number, end: number, step: number, maximumNumberOfItems?: number): number[];
52
- /** Returns count of top level properties in object. */
53
- export declare function countObjectKeys(obj: object | undefined): number;
54
- /** Returns object entries sorted by name. */
55
- export declare function getSortedEntries<T>(record: Record<string, T>): Array<[string, T]>;
56
- /** Removes top level fields which are empty objects. May be used for value formatting. */
57
- export declare function removeEmptyTopLevelRecords<T extends object>(record: T): Partial<T>;
58
- export declare function removeUndefinedValues<V>(tags: Record<string, V | undefined>): Record<string, V>;
@@ -1,17 +0,0 @@
1
- export declare function normalizeJsonAsString(json: unknown): string;
2
- export declare function serializeObj(obj: unknown): string;
3
- export declare function deserializeObj<T = any>(str: string): T;
4
- export declare function encodeValueForMapping(value: unknown): string;
5
- export declare function decodeValueForMapping(encodedString: string): any;
6
- /**
7
- * Compares 2 objects by their normalized JSON value.
8
- * This function should not be used with objects with circular references.
9
- * Returns true if the object are equal.
10
- */
11
- export declare function compareByNormalizedJsonValue<T>(v1: T | undefined, v2: T | undefined): boolean;
12
- /**
13
- * Compares 2 objects by their normalized JSON value for specific fields only.
14
- * This function should not be used with objects with circular references.
15
- * Returns true if the specified fields are equal.
16
- */
17
- export declare function compareByNormalizedJsonValueForFields<T>(v1: T | undefined, v2: T | undefined, fields: Array<keyof T>): boolean;
@@ -1 +0,0 @@
1
- export declare const SQUID_SUPPORT_EMAIL = "support@getsquid.ai";
@@ -1 +0,0 @@
1
- export declare function generateTraceId(prefix?: string): string;
@@ -1,19 +0,0 @@
1
- import { HttpStatusCode } from '../public-types/http-status.public-types';
2
- export declare class ValidationError extends Error {
3
- readonly statusCode: HttpStatusCode;
4
- readonly details?: any;
5
- constructor(error: string, statusCode: HttpStatusCode, details?: Record<string, unknown>);
6
- }
7
- export declare function isValidId(id: unknown, maxLength?: number): boolean;
8
- export declare function validateFieldSort(fieldSort: unknown): void;
9
- export declare function validateQueryLimit(limit: unknown): void;
10
- /**
11
- * All type names returned by 'typeof' supported by JavaScript:
12
- * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof}.
13
- * and a few other supported types.
14
- */
15
- export type JavascriptTypeName = 'undefined' | 'object' | 'boolean' | 'number' | 'bigint' | 'string' | 'symbol' | 'function';
16
- /** Returns true if 'typeof' of the 'value' is 'type' or 'type[]'. */
17
- export declare function isRightType(value: unknown, type: JavascriptTypeName): boolean;
18
- /** Returns true if 'obj' has only keys listed in the 'keys'. Object can't be an array. */
19
- export declare function hasOnlyKeys(obj: object, keys: string[]): boolean;
@@ -1,26 +0,0 @@
1
- interface Options {
2
- maxAttempts?: number;
3
- protocols?: string[];
4
- onmessage?: (event: any) => void;
5
- onopen?: (event: any) => void;
6
- onclose?: (event: any) => void;
7
- onerror?: (event: any) => void;
8
- onreconnect?: (event: any) => void;
9
- onmaximum?: (event: any) => void;
10
- timeoutMillis?: number;
11
- }
12
- export interface WebSocketWrapper {
13
- open: () => void;
14
- reconnect: (e: any) => void;
15
- json: (x: any) => void;
16
- send: (x: string) => void;
17
- close: (x?: number, y?: string) => void;
18
- connected: boolean;
19
- /**
20
- * Websocket is explicitly closed by calling socket.close().
21
- * Used to ignore errors after socket.closed() is called.
22
- */
23
- closeCalled: boolean;
24
- }
25
- export declare function createWebSocketWrapper(url: string, opts?: Options): WebSocketWrapper;
26
- export {};
@@ -1,85 +0,0 @@
1
- import { AiContextMetadata } from './public-types';
2
- /**
3
- * Response to a request to get the access token for a personal storage service.
4
- * @category Personal Storage
5
- */
6
- export interface PsGetAccessTokenResponse {
7
- /** The access token for the personal storage service. */
8
- accessToken: string;
9
- /** The expiration time of the access token. */
10
- expirationTime: Date;
11
- }
12
- /**
13
- * The type of a document in personal storage.
14
- * @category Personal Storage
15
- */
16
- export type PsDocumentType = 'file' | 'folder';
17
- /**
18
- * A document indexed for AI processing (as part of the personal storage connector).
19
- * @category Personal Storage
20
- */
21
- export interface PsIndexedDocument {
22
- /** The ID of the document. */
23
- id: string;
24
- /** The name of the document. */
25
- name: string;
26
- /** The type of the document (file or folder). */
27
- type: PsDocumentType;
28
- /** Metadata stored about the document */
29
- metadata: AiContextMetadata;
30
- /** The ID of the parent folder of the document. */
31
- folderDocumentId?: string;
32
- }
33
- /**
34
- * Client to handle personal storage integrations such as Google Drive or Microsoft OneDrive.
35
- * Provides methods for saving authentication tokens, indexing documents or folders for AI processing,
36
- * and unindexing documents from AI processing.
37
- * @category Personal Storage
38
- */
39
- export declare class PersonalStorageClient {
40
- private readonly integrationId;
41
- private readonly rpcManager;
42
- /**
43
- * Saves an authentication token for the personal storage service.
44
- *
45
- * @param authCode - The authorization code obtained from the OAuth flow for the personal storage service.
46
- * @param identifier - A user-provided identifier (usually a user ID) that will be associated with the token.
47
- * @returns A promise that resolves with the access token and expiration time.
48
- */
49
- saveAuthCode(authCode: string, identifier: string): Promise<PsGetAccessTokenResponse>;
50
- /**
51
- * Retrieves an access token for the personal storage service.
52
- *
53
- * @param identifier - A user-provided identifier (usually a user ID) that is associated with the token.
54
- * @returns A promise that resolves with the access token and expiration time.
55
- */
56
- getAccessToken(identifier: string): Promise<PsGetAccessTokenResponse>;
57
- /**
58
- * Indexes a document or folder for AI processing.
59
- *
60
- * @param documentOrFolderId - The ID of the document or folder to be indexed.
61
- * @param identifier - A user-provided identifier (usually a user ID) that will be associated with the document.
62
- * @param agentId - The agent ID for the AI processing configuration.
63
- * @param metadata - Metadata to include with the index
64
- * @returns A promise that resolves when the document or folder is successfully indexed.
65
- */
66
- indexDocumentOrFolder(documentOrFolderId: string, identifier: string, agentId: string, metadata?: AiContextMetadata): Promise<void>;
67
- /**
68
- * Lists all documents or folders that have been indexed for AI processing.
69
- *
70
- * @param identifier - A user-provided identifier (usually a user ID) associated with the indexed documents.
71
- * @param agentId - The AI agent ID used when indexing the documents.
72
- * @param type - (Optional) The type of items to list: `'file'` or `'folder'`. If omitted, returns both.
73
- * @returns A promise that resolves with an array of indexed documents or folders.
74
- */
75
- listIndexedDocuments(identifier: string, agentId: string, type?: PsDocumentType): Promise<Array<PsIndexedDocument>>;
76
- /**
77
- * Unindexes a previously indexed document, removing it from AI processing.
78
- *
79
- * @param documentId - The ID of the document to be unindexed.
80
- * @param identifier - A user-provided identifier (usually a user ID) that was associated with the document.
81
- * @param agentId - The agent ID for the AI processing configuration.
82
- * @returns A promise that resolves when the document is successfully unindexed.
83
- */
84
- unindexDocument(documentId: string, identifier: string, agentId: string): Promise<void>;
85
- }