@squidcloud/client 1.0.342 → 1.0.344
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.
- package/dist/cjs/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +120 -24
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +7 -4
- package/dist/internal-common/src/public-types/ai-matchmaking.types.d.ts +19 -16
- package/dist/internal-common/src/public-types/api-client.public-types.d.ts +4 -0
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +12 -1
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +7 -0
- package/dist/internal-common/src/public-types/context.public-types.d.ts +14 -3
- package/dist/internal-common/src/public-types/document.public-types.d.ts +9 -2
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +17 -0
- package/dist/internal-common/src/public-types/http-status.enum.d.ts +1 -0
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +12 -1
- package/dist/internal-common/src/public-types/integrations/api.public-types.d.ts +40 -0
- package/dist/internal-common/src/public-types/metric.public-types.d.ts +32 -2
- package/dist/internal-common/src/public-types/openapi.public-types.d.ts +4 -0
- package/dist/internal-common/src/public-types/query.public-types.d.ts +26 -7
- package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +13 -0
- package/dist/internal-common/src/public-types/schema.public-types.d.ts +4 -0
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +10 -0
- package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +18 -0
- package/dist/internal-common/src/public-types/socket.public-types.d.ts +1 -0
- package/dist/internal-common/src/public-types/typescript.public-types.d.ts +8 -0
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +9 -0
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +28 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +12 -0
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +12 -1
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +6 -0
- package/dist/internal-common/src/types/file.types.d.ts +6 -0
- package/dist/typescript-client/src/admin-client.d.ts +6 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +9 -0
- package/dist/typescript-client/src/agent/ai-agent-client.d.ts +8 -0
- package/dist/typescript-client/src/ai-client.d.ts +16 -0
- package/dist/typescript-client/src/ai-image-client.d.ts +3 -2
- package/dist/typescript-client/src/api-client.d.ts +44 -0
- package/dist/typescript-client/src/extraction-client.d.ts +7 -0
- package/dist/typescript-client/src/integration-client.d.ts +30 -0
- package/dist/typescript-client/src/personal-storage-client.d.ts +8 -0
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +115 -8
- package/dist/typescript-client/src/scheduler-client.d.ts +17 -0
- package/dist/typescript-client/src/secret.client.d.ts +46 -0
- package/dist/typescript-client/src/squid.d.ts +26 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IntegrationId } from './communication.public-types';
|
|
2
2
|
/**
|
|
3
|
+
* Represents a primitive data type used in database fields.
|
|
3
4
|
* @category Database
|
|
4
5
|
*/
|
|
5
6
|
export type PrimitiveFieldType = string | number | boolean | null | Date;
|
|
6
7
|
/**
|
|
8
|
+
* Represents a recursive field type structure for database documents, including primitives, arrays, and nested objects.
|
|
7
9
|
* @category Database
|
|
8
10
|
*/
|
|
9
11
|
export type FieldType = PrimitiveFieldType | Array<FieldType> | {
|
|
@@ -45,20 +47,25 @@ export type DocumentData = Record<FieldName, any | undefined>;
|
|
|
45
47
|
*/
|
|
46
48
|
export type DocTimestamp = number;
|
|
47
49
|
/**
|
|
48
|
-
* The structure of a Squid Document.
|
|
50
|
+
* The structure of a Squid Document with metadata and dynamic fields.
|
|
49
51
|
* @category Database
|
|
50
52
|
*/
|
|
51
53
|
export interface SquidDocument {
|
|
54
|
+
/** The unique identifier of the document. */
|
|
52
55
|
__docId__: DocId;
|
|
56
|
+
/** The timestamp of the document, typically in milliseconds. */
|
|
53
57
|
__ts__: DocTimestamp;
|
|
54
58
|
[fieldName: string]: FieldType | undefined;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
|
-
* The full document
|
|
61
|
+
* The full document identifier, combining collection name, document ID, and integration ID.
|
|
58
62
|
* @category Database
|
|
59
63
|
*/
|
|
60
64
|
export interface SquidDocIdObj {
|
|
65
|
+
/** The name of the collection containing the document. */
|
|
61
66
|
collectionName: CollectionName;
|
|
67
|
+
/** The unique identifier of the document within the collection. */
|
|
62
68
|
docId: DocId;
|
|
69
|
+
/** The ID of the integration associated with the document. */
|
|
63
70
|
integrationId: IntegrationId;
|
|
64
71
|
}
|
|
@@ -3,43 +3,60 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export type DocumentFileDataType = 'image';
|
|
5
5
|
/**
|
|
6
|
+
* Options for extracting data from a document file stored in the storage system.
|
|
6
7
|
* @category Storage
|
|
7
8
|
*/
|
|
8
9
|
export interface ExtractDataFromDocumentFileOptions {
|
|
10
|
+
/** An optional password required to access the document file, if encrypted. */
|
|
9
11
|
password?: string;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
14
|
+
* Represents metadata for a file embedded within a document in the storage system.
|
|
12
15
|
* @category Storage
|
|
13
16
|
*/
|
|
14
17
|
export interface DocumentFileData {
|
|
18
|
+
/** The type of the embedded file (e.g., 'image'). */
|
|
15
19
|
type: DocumentFileDataType;
|
|
20
|
+
/** The storage path of the file within the bucket. */
|
|
16
21
|
pathInBucket: string;
|
|
17
22
|
}
|
|
18
23
|
/**
|
|
24
|
+
* Represents data for a single page within a document in the storage system.
|
|
19
25
|
* @category Storage
|
|
20
26
|
*/
|
|
21
27
|
export interface DocumentPageData {
|
|
28
|
+
/** An optional title for the page. */
|
|
22
29
|
title?: string;
|
|
30
|
+
/** The text content extracted from the page. */
|
|
23
31
|
text: string;
|
|
32
|
+
/** An array of file data objects embedded in the page. */
|
|
24
33
|
fileDataList: DocumentFileData[];
|
|
25
34
|
}
|
|
26
35
|
/**
|
|
36
|
+
* Response structure for data extracted from a document in the storage system.
|
|
27
37
|
* @category Storage
|
|
28
38
|
*/
|
|
29
39
|
export interface ExtractDataFromDocumentResponse {
|
|
40
|
+
/** The storage path of the document within the bucket, if available. */
|
|
30
41
|
documentPathInBucket?: string;
|
|
42
|
+
/** An array of page data extracted from the document. */
|
|
31
43
|
pages: DocumentPageData[];
|
|
32
44
|
}
|
|
33
45
|
/**
|
|
46
|
+
* Represents text-only data for a single page in a document.
|
|
34
47
|
* @category Storage
|
|
35
48
|
*/
|
|
36
49
|
export interface TextOnlyPageData {
|
|
50
|
+
/** The text content of the page. */
|
|
37
51
|
text: string;
|
|
52
|
+
/** An optional title for the page. */
|
|
38
53
|
title?: string;
|
|
39
54
|
}
|
|
40
55
|
/**
|
|
56
|
+
* Response structure containing text-only data extracted from a document.
|
|
41
57
|
* @category Storage
|
|
42
58
|
*/
|
|
43
59
|
export interface DocumentTextDataResponse {
|
|
60
|
+
/** An array of text-only page data extracted from the document. */
|
|
44
61
|
pages: TextOnlyPageData[];
|
|
45
62
|
}
|
|
@@ -9,10 +9,15 @@ export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db"
|
|
|
9
9
|
* @category Auth
|
|
10
10
|
*/
|
|
11
11
|
export declare const AUTH_INTEGRATION_TYPES: readonly ["auth0", "jwt_rsa", "jwt_hmac", "cognito", "okta", "descope", "firebase_auth"];
|
|
12
|
+
/** Supported integration types for GraphQL-based services. */
|
|
12
13
|
export declare const GRAPHQL_INTEGRATION_TYPES: readonly ["graphql", "linear"];
|
|
14
|
+
/** Supported integration types for HTTP-based services. */
|
|
13
15
|
export declare const HTTP_INTEGRATION_TYPES: readonly ["api", "confluence"];
|
|
16
|
+
/** Represents a supported integration type identifier, such as 'postgres', 'auth0', or 's3'. */
|
|
14
17
|
export type IntegrationType = (typeof INTEGRATION_TYPES)[number];
|
|
18
|
+
/** Supported schema types for integrations */
|
|
15
19
|
export declare const INTEGRATION_SCHEMA_TYPES: readonly ["data", "api", "graphql"];
|
|
20
|
+
/** Describes the type of schema the integration provides, such as data, API, or GraphQL schema. */
|
|
16
21
|
export type IntegrationSchemaType = (typeof INTEGRATION_SCHEMA_TYPES)[number];
|
|
17
22
|
/**
|
|
18
23
|
* @category Database
|
|
@@ -24,13 +29,19 @@ export declare const BUILT_IN_DB_INTEGRATION_ID: IntegrationId;
|
|
|
24
29
|
export declare const BUILT_IN_QUEUE_INTEGRATION_ID: IntegrationId;
|
|
25
30
|
/**
|
|
26
31
|
* ID for the cloud specific storage integration: s3 (built_in_s3) or gcs (built_in_gcs).
|
|
27
|
-
* @category
|
|
32
|
+
* @category
|
|
28
33
|
*/
|
|
29
34
|
export declare const BUILT_IN_STORAGE_INTEGRATION_ID: IntegrationId;
|
|
35
|
+
/** Metadata describing a configured integration, including its ID, type, timestamps, and optional configuration object. */
|
|
30
36
|
export interface IntegrationInfo<ConfigurationType = Record<string, any> | undefined> {
|
|
37
|
+
/** The unique identifier of the integration instance. */
|
|
31
38
|
id: IntegrationId;
|
|
39
|
+
/** The type of the integration (e.g., postgres, auth0, s3). */
|
|
32
40
|
type: IntegrationType;
|
|
41
|
+
/** The date when the integration was created. */
|
|
33
42
|
creationDate?: Date;
|
|
43
|
+
/** The date when the integration was last updated. */
|
|
34
44
|
updateDate?: Date;
|
|
45
|
+
/** The configuration object for the integration, if any. */
|
|
35
46
|
configuration: ConfigurationType;
|
|
36
47
|
}
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { FieldName } from '../document.public-types';
|
|
2
|
+
/** Represents the HTTP methods supported by an API endpoint. */
|
|
2
3
|
export type HttpMethod = 'post' | 'get' | 'delete' | 'patch' | 'put';
|
|
4
|
+
/** An identifier string used to uniquely represent an API endpoint. */
|
|
3
5
|
export type ApiEndpointId = string;
|
|
6
|
+
/** Represents the location in an API request where a parameter can be found. */
|
|
4
7
|
export type ApiParameterLocation = 'query' | 'body' | 'header' | 'path';
|
|
8
|
+
/** Represents the location in an API response where a value can appear. */
|
|
5
9
|
export type ApiResponseParameterLocation = 'header' | 'body';
|
|
10
|
+
/** Specifies the allowed locations where injection parameters can be inserted into the API request. */
|
|
6
11
|
export type ApiInjectionParameterLocation = 'header' | 'query';
|
|
12
|
+
/** A string path used to locate a specific field in a response structure. */
|
|
7
13
|
export type FieldPath = string;
|
|
14
|
+
/** A map of API endpoint definitions keyed by unique endpoint IDs. */
|
|
8
15
|
export type IntegrationApiEndpoints = Record<ApiEndpointId, ApiEndpoint>;
|
|
16
|
+
/** Describes a field included in an API request, including its location, optional description, and whether it is required. */
|
|
9
17
|
export interface ApiRequestField {
|
|
18
|
+
/** The location of the field in the API request (e.g., query, body, header, path). */
|
|
10
19
|
location: ApiParameterLocation;
|
|
20
|
+
/** An optional description of the field's purpose or usage. */
|
|
11
21
|
description?: string;
|
|
22
|
+
/** Indicates whether the field is mandatory for the request. */
|
|
12
23
|
required?: boolean;
|
|
13
24
|
}
|
|
14
25
|
/** The options for calling an API. */
|
|
@@ -23,38 +34,67 @@ export interface CallApiOptions {
|
|
|
23
34
|
}
|
|
24
35
|
/** A native API call response. */
|
|
25
36
|
export interface NativeApiCallResponse<BodyType = unknown> {
|
|
37
|
+
/** The response body, typed according to the expected content. */
|
|
26
38
|
body: BodyType;
|
|
39
|
+
/** A record of HTTP headers returned in the response. */
|
|
27
40
|
headers: Record<string, string>;
|
|
41
|
+
/** The HTTP status code of the response. */
|
|
28
42
|
status: number;
|
|
29
43
|
}
|
|
44
|
+
/** Describes a field included in an API response, optionally including the field path and a description. */
|
|
30
45
|
export interface ApiResponseField {
|
|
46
|
+
/** The location of the field in the API response (e.g., header, body). */
|
|
31
47
|
location: ApiResponseParameterLocation;
|
|
48
|
+
/** The path to the field within the response structure, if applicable. */
|
|
32
49
|
path?: FieldPath;
|
|
50
|
+
/** An optional description of the field's content or purpose. */
|
|
33
51
|
description?: string;
|
|
34
52
|
}
|
|
53
|
+
/** Represents the possible values for injected field types used in request modification (e.g., secret or regular). */
|
|
35
54
|
export declare const API_INJECTION_FIELD_TYPES: readonly ["secret", "regular"];
|
|
55
|
+
/** The type of value to inject into an API request, such as a secret or a regular value. */
|
|
36
56
|
export type ApiInjectionFieldType = (typeof API_INJECTION_FIELD_TYPES)[number];
|
|
57
|
+
/** Defines a value to be injected into the API call, such as a secret or query parameter, along with its location and type. */
|
|
37
58
|
export interface ApiInjectionField {
|
|
59
|
+
/** The value to be injected into the request. */
|
|
38
60
|
value: string;
|
|
61
|
+
/** The type of the injected value, either 'secret' or 'regular'. */
|
|
39
62
|
type: ApiInjectionFieldType;
|
|
63
|
+
/** The location in the request where the value should be injected (e.g., header, query). */
|
|
40
64
|
location: ApiInjectionParameterLocation;
|
|
41
65
|
}
|
|
66
|
+
/** Connection options for interacting with a GraphQL API. */
|
|
42
67
|
export interface GraphQLConnectionOptions {
|
|
68
|
+
/** The base URL of the GraphQL API endpoint. */
|
|
43
69
|
baseUrl: string;
|
|
70
|
+
/** An optional schema defining fields to inject into the GraphQL request. */
|
|
44
71
|
injectionSchema?: ApiInjectionSchema;
|
|
45
72
|
}
|
|
73
|
+
/** A mapping of field names to their corresponding injection field definitions. */
|
|
46
74
|
export type ApiInjectionSchema = Record<FieldName, ApiInjectionField>;
|
|
75
|
+
/** Options for discovering APIs via an OpenAPI specification. */
|
|
47
76
|
export interface OpenApiDiscoveryOptions {
|
|
77
|
+
/** The URL of the OpenAPI specification document. */
|
|
48
78
|
openApiSpecUrl: string;
|
|
49
79
|
}
|
|
80
|
+
/** Represents the structure of an API endpoint, including its path, method, schemas, and metadata. */
|
|
50
81
|
export interface ApiEndpoint {
|
|
82
|
+
/** The relative path of the endpoint (e.g., '/users'). */
|
|
51
83
|
relativePath: string;
|
|
84
|
+
/** The HTTP method used by the endpoint (e.g., 'get', 'post'). */
|
|
52
85
|
method: HttpMethod;
|
|
86
|
+
/** A schema defining the fields expected in the request, if any. */
|
|
53
87
|
requestSchema?: Record<FieldName, ApiRequestField>;
|
|
88
|
+
/** A schema defining the fields returned in the response, if any. */
|
|
54
89
|
responseSchema?: Record<FieldPath, ApiResponseField>;
|
|
90
|
+
/** A schema defining fields to inject into the request, if any. */
|
|
55
91
|
injectionSchema?: ApiInjectionSchema;
|
|
92
|
+
/** An optional array of tags categorizing the endpoint. */
|
|
56
93
|
tags?: Array<string>;
|
|
94
|
+
/** An optional description of the endpoint's purpose or behavior. */
|
|
57
95
|
description?: string;
|
|
96
|
+
/** The MIME type of the request body, if applicable (e.g., 'application/json'). */
|
|
58
97
|
bodyMimeType?: string;
|
|
98
|
+
/** Indicates whether the request body is mandatory for the endpoint. */
|
|
59
99
|
isRequestBodyRequired?: boolean;
|
|
60
100
|
}
|
|
@@ -5,15 +5,21 @@
|
|
|
5
5
|
* All Squid metrics starts with `squid_` prefix.
|
|
6
6
|
*/
|
|
7
7
|
export declare const SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time"];
|
|
8
|
+
/** Name of a built-in Squid metric ('squid_functionExecution_count' or 'squid_functionExecution_time'). */
|
|
8
9
|
export type SquidMetricName = (typeof SQUID_METRIC_NAMES)[number];
|
|
10
|
+
/** Aggregation function used in metric queries (e.g., 'sum', 'max', 'median'). */
|
|
9
11
|
export declare const METRIC_FUNCTIONS: readonly ["sum", "max", "min", "average", "median", "p95", "p99", "count"];
|
|
12
|
+
/** Aggregation function used in metric queries (e.g., 'sum', 'max', 'median'). */
|
|
10
13
|
export type MetricFunction = (typeof METRIC_FUNCTIONS)[number];
|
|
11
14
|
/** Defines source of the metric: reported by user or automatically collected by the system (Squid). */
|
|
12
15
|
export declare const METRIC_DOMAIN: readonly ["user", "squid"];
|
|
16
|
+
/** Domain of the metric: 'user' for custom metrics, 'squid' for built-in system metrics. */
|
|
13
17
|
export type MetricDomain = (typeof METRIC_DOMAIN)[number];
|
|
18
|
+
/** Defines how to align data points in a metric query interval. */
|
|
14
19
|
export declare const METRIC_INTERVAL_ALIGNMENT: readonly ["align-by-start-time", "align-by-end-time"];
|
|
15
20
|
/** Indicates how to align per-point periods in metric queries. */
|
|
16
21
|
export type MetricIntervalAlignment = (typeof METRIC_INTERVAL_ALIGNMENT)[number];
|
|
22
|
+
/** Common parameters shared by all metric query requests. */
|
|
17
23
|
export interface QueryMetricsRequestCommon {
|
|
18
24
|
/** Kind of the metrics (domain) to query. */
|
|
19
25
|
domain: MetricDomain;
|
|
@@ -80,16 +86,27 @@ export interface QueryMetricsRequestCommon {
|
|
|
80
86
|
*/
|
|
81
87
|
noDataBehavior?: 'return-no-result-groups' | 'return-result-group-with-default-values';
|
|
82
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Request structure for querying user-defined metrics.
|
|
91
|
+
* @category Metrics
|
|
92
|
+
*/
|
|
83
93
|
export interface QueryUserMetricsRequest<NameType extends string = string> extends QueryMetricsRequestCommon {
|
|
94
|
+
/** Specifies the user domain for custom metrics. */
|
|
84
95
|
domain: 'user';
|
|
85
|
-
/**
|
|
96
|
+
/** Name of the user-defined metric to query. */
|
|
86
97
|
name: NameType;
|
|
87
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Request structure for querying built-in Squid metrics.
|
|
101
|
+
* @category Metrics
|
|
102
|
+
*/
|
|
88
103
|
export interface QuerySquidMetricsRequest<NameType extends SquidMetricName = SquidMetricName> extends QueryMetricsRequestCommon {
|
|
104
|
+
/** Specifies the squid domain for built-in system metrics. */
|
|
89
105
|
domain: 'squid';
|
|
90
|
-
/**
|
|
106
|
+
/** Name of the built-in Squid metric to query. */
|
|
91
107
|
name: NameType;
|
|
92
108
|
}
|
|
109
|
+
/** A request to query metrics, either Squid or user-defined, depending on the domain and metric name. */
|
|
93
110
|
export type QueryMetricsRequest<NameType extends string = string> = QuerySquidMetricsRequest<NameType extends SquidMetricName ? NameType : SquidMetricName> | QueryUserMetricsRequest<NameType>;
|
|
94
111
|
/**
|
|
95
112
|
* Every result point is a list of [timestamp, values...],
|
|
@@ -98,11 +115,14 @@ export type QueryMetricsRequest<NameType extends string = string> = QuerySquidMe
|
|
|
98
115
|
* The timestamp is always equal to the point period start date and is measured in Unix epoch seconds.
|
|
99
116
|
*/
|
|
100
117
|
export type QueryMetricsResultPoint = [number, ...(number | null)[]];
|
|
118
|
+
/** A group of metric results that share the same tag values. */
|
|
101
119
|
export interface QueryMetricsResultGroup {
|
|
102
120
|
/** Values of the tags in the group. The tags are ordered the same way as in request.groupByTags collection. */
|
|
103
121
|
tagValues: string[];
|
|
122
|
+
/** List of result points for the group. */
|
|
104
123
|
points: Array<QueryMetricsResultPoint>;
|
|
105
124
|
}
|
|
125
|
+
/** Common structure for metric query responses. */
|
|
106
126
|
export interface QueryMetricsResponseCommon {
|
|
107
127
|
/**
|
|
108
128
|
* Result of the metrics query.
|
|
@@ -110,15 +130,25 @@ export interface QueryMetricsResponseCommon {
|
|
|
110
130
|
*/
|
|
111
131
|
resultGroups: Array<QueryMetricsResultGroup>;
|
|
112
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Response for a user-defined metric query.
|
|
135
|
+
* @category Metrics
|
|
136
|
+
*/
|
|
113
137
|
export interface QueryUserMetricsResponse<NameType extends string = string> extends QueryMetricsResponseCommon {
|
|
138
|
+
/** Specifies the user domain for custom metrics. */
|
|
114
139
|
domain: 'user';
|
|
140
|
+
/** Name of the queried user-defined metric. */
|
|
115
141
|
metricName: NameType;
|
|
116
142
|
}
|
|
117
143
|
/**
|
|
118
144
|
* A single metric response for 'SquidMetricsRequest'.
|
|
145
|
+
* @category Metrics
|
|
119
146
|
*/
|
|
120
147
|
export interface QuerySquidMetricsResponse<NameType extends SquidMetricName> extends QueryMetricsResponseCommon {
|
|
148
|
+
/** Specifies the squid domain for built-in system metrics. */
|
|
121
149
|
domain: 'squid';
|
|
150
|
+
/** Name of the queried built-in Squid metric. */
|
|
122
151
|
metricName: NameType;
|
|
123
152
|
}
|
|
153
|
+
/** Final normalized response for a metrics query, required fields guaranteed. */
|
|
124
154
|
export type QueryMetricsResponse<NameType extends string = string> = Required<QuerySquidMetricsResponse<NameType extends SquidMetricName ? NameType : SquidMetricName> | QueryUserMetricsResponse<NameType>>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/** Represents a standardized HTTP response in OpenAPI format. */
|
|
1
2
|
export interface OpenApiResponse {
|
|
3
|
+
/** HTTP headers returned in the response. */
|
|
2
4
|
headers: Record<string, any>;
|
|
5
|
+
/** Body content of the response. */
|
|
3
6
|
body: any;
|
|
7
|
+
/** HTTP status code of the response. */
|
|
4
8
|
statusCode: number;
|
|
5
9
|
}
|
|
@@ -6,14 +6,18 @@ import { Paths } from './typescript.public-types';
|
|
|
6
6
|
*/
|
|
7
7
|
export type Alias = string;
|
|
8
8
|
/**
|
|
9
|
-
* A join condition.
|
|
10
|
-
* The join conditions
|
|
9
|
+
* A join condition defining how two tables are related in a database query.
|
|
10
|
+
* The join conditions specify the alias for the left side of the join and the field names to join on.
|
|
11
11
|
* @category Database
|
|
12
12
|
*/
|
|
13
13
|
export interface JoinCondition {
|
|
14
|
+
/** The alias of the left table in the join operation. */
|
|
14
15
|
leftAlias: Alias;
|
|
16
|
+
/** The field name from the left table to join on. */
|
|
15
17
|
left: FieldName;
|
|
18
|
+
/** The field name from the right table to join on. */
|
|
16
19
|
right: FieldName;
|
|
20
|
+
/** Indicates whether the join is an inner join (true) or outer join (false). */
|
|
17
21
|
isInner: boolean;
|
|
18
22
|
}
|
|
19
23
|
/**
|
|
@@ -27,23 +31,27 @@ export type Condition<Doc extends DocumentData = any> = SimpleCondition<Doc> | C
|
|
|
27
31
|
*/
|
|
28
32
|
export type Conditions<Doc extends DocumentData = any> = Array<Condition<Doc>>;
|
|
29
33
|
/**
|
|
30
|
-
* A single field query condition.
|
|
34
|
+
* A single field query condition for filtering database records.
|
|
31
35
|
* @category Database
|
|
32
36
|
*/
|
|
33
37
|
export interface SimpleCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>, MyOperator = Operator> {
|
|
38
|
+
/** The field name to apply the condition to. */
|
|
34
39
|
fieldName: F;
|
|
40
|
+
/** The operator to use for comparing the field value. */
|
|
35
41
|
operator: MyOperator;
|
|
42
|
+
/** The value to compare against the field. */
|
|
36
43
|
value: any;
|
|
37
44
|
}
|
|
38
45
|
/**
|
|
39
|
-
* A composite fields query condition.
|
|
46
|
+
* A composite fields query condition combining multiple simple conditions.
|
|
40
47
|
* Just a list of simple conditions with specific set of operators. It should be
|
|
41
48
|
* evaluated this way:
|
|
42
|
-
* If A, B, C are the conditions and A
|
|
49
|
+
* If A, B, C are the conditions and A' = A with '==' operator:
|
|
43
50
|
* A || (A' && B) || (A' && B' && C)
|
|
44
51
|
* @category Database
|
|
45
52
|
*/
|
|
46
53
|
export interface CompositeCondition<Doc extends DocumentData = any> {
|
|
54
|
+
/** An array of simple conditions with restricted operators for composite evaluation. */
|
|
47
55
|
fields: Array<SimpleCondition<Doc, Paths<Doc>, CompositeConditionOperator>>;
|
|
48
56
|
}
|
|
49
57
|
type CompositeConditionOperator = '>=' | '<=' | '>' | '<';
|
|
@@ -63,26 +71,37 @@ export declare const ALL_OPERATORS: readonly ["in", "not in", "array_includes_so
|
|
|
63
71
|
*/
|
|
64
72
|
export type Operator = (typeof ALL_OPERATORS)[number];
|
|
65
73
|
/**
|
|
66
|
-
* A definition of a sort by a field.
|
|
74
|
+
* A definition of a sort order by a field in a database query.
|
|
67
75
|
* @category Database
|
|
68
76
|
*/
|
|
69
77
|
export interface FieldSort<Doc> {
|
|
78
|
+
/** The name of the field to sort by. */
|
|
70
79
|
fieldName: FieldName<Doc>;
|
|
80
|
+
/** Indicates whether the sort is ascending (true) or descending (false). */
|
|
71
81
|
asc: boolean;
|
|
72
82
|
}
|
|
73
83
|
/**
|
|
74
|
-
* A query object.
|
|
84
|
+
* A query object defining a database retrieval operation.
|
|
75
85
|
* @category Database
|
|
76
86
|
*/
|
|
77
87
|
export interface Query<Doc extends DocumentData = any> {
|
|
88
|
+
/** The full collection path such as "c1" or "c1/d1/c2". */
|
|
78
89
|
collectionName: CollectionName;
|
|
90
|
+
/** The ID of the integration associated with the query. */
|
|
79
91
|
integrationId: string;
|
|
92
|
+
/** An array of conditions to filter the query results. */
|
|
80
93
|
conditions: Conditions<Doc>;
|
|
94
|
+
/** An array of field sort definitions to order the results. */
|
|
81
95
|
sortOrder: Array<FieldSort<Doc>>;
|
|
96
|
+
/** The maximum number of records to return. */
|
|
82
97
|
limit: number;
|
|
98
|
+
/** Optional configuration to limit results by specific fields with custom sorting. */
|
|
83
99
|
limitBy?: {
|
|
100
|
+
/** The maximum number of records to return for this limit configuration. */
|
|
84
101
|
limit: number;
|
|
102
|
+
/** The fields to apply the limit to. */
|
|
85
103
|
fields: Array<FieldName<Doc>>;
|
|
104
|
+
/** Indicates whether to reverse the sort order for this limit. */
|
|
86
105
|
reverseSort: boolean;
|
|
87
106
|
};
|
|
88
107
|
}
|
|
@@ -1,30 +1,43 @@
|
|
|
1
1
|
import { ServiceFunctionName } from './backend.public-types';
|
|
2
2
|
/**
|
|
3
|
+
* Configuration for a scheduled task in the platform.
|
|
3
4
|
* @category Platform
|
|
4
5
|
*/
|
|
5
6
|
export interface SchedulerConfig {
|
|
7
|
+
/** The name of the service function to be executed on the schedule. */
|
|
6
8
|
functionName: ServiceFunctionName;
|
|
9
|
+
/** The cron expression defining the schedule timing. */
|
|
7
10
|
cronExpression: string;
|
|
11
|
+
/** Indicates whether the scheduler should run exclusively, preventing overlaps. */
|
|
8
12
|
exclusive: boolean;
|
|
9
13
|
}
|
|
10
14
|
/**
|
|
15
|
+
* Information about a scheduler instance in the platform.
|
|
11
16
|
* @category Platform
|
|
12
17
|
*/
|
|
13
18
|
export interface SchedulerInfo {
|
|
19
|
+
/** The unique identifier for the scheduler. */
|
|
14
20
|
schedulerId: string;
|
|
21
|
+
/** The configuration details for the scheduler. */
|
|
15
22
|
config: SchedulerConfig;
|
|
23
|
+
/** Indicates whether the scheduler is currently enabled. */
|
|
16
24
|
enabled: boolean;
|
|
17
25
|
}
|
|
18
26
|
/**
|
|
27
|
+
* Options for updating an existing scheduler in the platform.
|
|
19
28
|
* @category Platform
|
|
20
29
|
*/
|
|
21
30
|
export interface UpdateSchedulerOptions {
|
|
31
|
+
/** The unique identifier of the scheduler to update. */
|
|
22
32
|
schedulerId: string;
|
|
33
|
+
/** Optional flag to enable or disable the scheduler. */
|
|
23
34
|
enabled?: boolean;
|
|
24
35
|
}
|
|
25
36
|
/**
|
|
37
|
+
* Request structure for updating multiple schedulers in the platform.
|
|
26
38
|
* @category Platform
|
|
27
39
|
*/
|
|
28
40
|
export interface UpdateSchedulersRequest {
|
|
41
|
+
/** An array of scheduler update options. */
|
|
29
42
|
schedulers: UpdateSchedulerOptions[];
|
|
30
43
|
}
|
|
@@ -20,8 +20,11 @@ type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
|
|
|
20
20
|
/** Applies to the top level schema or a record in a nested object. */
|
|
21
21
|
deletable?: boolean;
|
|
22
22
|
};
|
|
23
|
+
/** Extended JSON schema for a single property, supporting nested structures and Squid-specific metadata. */
|
|
23
24
|
export type PropertySchema = ConvertDeep<JSONSchema>;
|
|
25
|
+
/** Extended JSON schema for a top-level property, including database-related metadata. */
|
|
24
26
|
export type TopLevelPropertySchema = PropertySchema & {
|
|
27
|
+
/** Marks the property as a primary key. */
|
|
25
28
|
primaryKey?: boolean;
|
|
26
29
|
/**
|
|
27
30
|
* Whether the property is computed based on other properties or some formula.
|
|
@@ -44,6 +47,7 @@ export type TopLevelPropertySchema = PropertySchema & {
|
|
|
44
47
|
*/
|
|
45
48
|
hidden?: boolean;
|
|
46
49
|
};
|
|
50
|
+
/** Schema for a full collection, allowing partial property definitions with extended metadata. */
|
|
47
51
|
export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
|
|
48
52
|
properties?: Record<string, TopLevelPropertySchema>;
|
|
49
53
|
};
|
|
@@ -14,28 +14,38 @@ export type SecretKey = string;
|
|
|
14
14
|
*/
|
|
15
15
|
export type SecretValue = string | number | boolean;
|
|
16
16
|
/**
|
|
17
|
+
* Metadata for a secret, including its key and last updated timestamp.
|
|
17
18
|
* @category Secret
|
|
18
19
|
*/
|
|
19
20
|
export interface SecretMetadata {
|
|
21
|
+
/** The key identifying the secret. */
|
|
20
22
|
key: SecretKey;
|
|
23
|
+
/** The timestamp (in milliseconds) when the secret was last updated. */
|
|
21
24
|
lastUpdated: number;
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
27
|
+
* A secret entry combining metadata with a typed value.
|
|
24
28
|
* @category Secret
|
|
25
29
|
*/
|
|
26
30
|
export interface SecretEntry<T extends SecretValue = SecretValue> extends SecretMetadata {
|
|
31
|
+
/** The value of the secret, constrained to the specified type. */
|
|
27
32
|
value: T;
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
35
|
+
* An API key entry combining metadata with a string value.
|
|
30
36
|
* @category Secret
|
|
31
37
|
*/
|
|
32
38
|
export interface ApiKeyEntry extends SecretMetadata {
|
|
39
|
+
/** The string value of the API key. */
|
|
33
40
|
value: string;
|
|
34
41
|
}
|
|
35
42
|
/**
|
|
43
|
+
* A request structure for setting a secret with a key-value pair.
|
|
36
44
|
* @category Secret
|
|
37
45
|
*/
|
|
38
46
|
export interface SetSecretRequestEntry {
|
|
47
|
+
/** The key identifying the secret to set. */
|
|
39
48
|
key: SecretKey;
|
|
49
|
+
/** The value to assign to the secret. */
|
|
40
50
|
value: SecretValue;
|
|
41
51
|
}
|
|
@@ -1,36 +1,54 @@
|
|
|
1
1
|
import { DocumentData } from './document.public-types';
|
|
2
2
|
import { Alias, JoinCondition, Query } from './query.public-types';
|
|
3
3
|
/**
|
|
4
|
+
* Represents a simple serialized query structure for database operations.
|
|
4
5
|
* @category Database
|
|
5
6
|
*/
|
|
6
7
|
export type SerializedSimpleQuery = {
|
|
8
|
+
/** Specifies that this is a simple query type. */
|
|
7
9
|
type: 'simple';
|
|
10
|
+
/** The query object defining the database operation. */
|
|
8
11
|
query: Query;
|
|
12
|
+
/** Indicates whether references should be dereferenced during query execution. */
|
|
9
13
|
dereference: boolean;
|
|
10
14
|
};
|
|
11
15
|
/**
|
|
16
|
+
* Represents a serialized join query structure for database operations with multiple table relationships.
|
|
12
17
|
* @category Database
|
|
13
18
|
*/
|
|
14
19
|
export type SerializedJoinQuery = {
|
|
20
|
+
/** Specifies that this is a join query type. */
|
|
15
21
|
type: 'join';
|
|
22
|
+
/** Specifies if the results should be grouped by the root alias. */
|
|
16
23
|
grouped: boolean;
|
|
24
|
+
/** Indicates whether references should be dereferenced during query execution. */
|
|
17
25
|
dereference: boolean;
|
|
26
|
+
/** The root table configuration for the join operation. */
|
|
18
27
|
root: {
|
|
28
|
+
/** The alias for the root table in the join operation. */
|
|
19
29
|
alias: Alias;
|
|
30
|
+
/** The query object defining the root table's operation. */
|
|
20
31
|
query: Query;
|
|
21
32
|
};
|
|
33
|
+
/** A mapping of aliases to their dependent aliases, defining the join order from left to right. */
|
|
22
34
|
leftToRight: Record<Alias, Alias[]>;
|
|
35
|
+
/** A mapping of aliases to their corresponding queries for joined tables. */
|
|
23
36
|
joins: Record<Alias, Query<DocumentData>>;
|
|
37
|
+
/** A mapping of aliases to their join conditions. */
|
|
24
38
|
joinConditions: Record<Alias, JoinCondition>;
|
|
25
39
|
};
|
|
26
40
|
/**
|
|
41
|
+
* Represents a serialized merged query structure combining multiple queries for database operations.
|
|
27
42
|
* @category Database
|
|
28
43
|
*/
|
|
29
44
|
export type SerializedMergedQuery = {
|
|
45
|
+
/** Specifies that this is a merged query type. */
|
|
30
46
|
type: 'merged';
|
|
47
|
+
/** An array of serialized queries to be merged. */
|
|
31
48
|
queries: Array<SerializedQuery>;
|
|
32
49
|
};
|
|
33
50
|
/**
|
|
51
|
+
* A union type representing all possible serialized query structures for database operations.
|
|
34
52
|
* @category Database
|
|
35
53
|
*/
|
|
36
54
|
export type SerializedQuery = SerializedSimpleQuery | SerializedJoinQuery | SerializedMergedQuery;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Squid client connection state. Can be 'CONNECTED', 'DISCONNECTED', or 'REMOVED'. */
|
|
1
2
|
export declare const CLIENT_CONNECTION_STATES: readonly ["CONNECTED", "DISCONNECTED", "REMOVED"];
|
|
2
3
|
/** Squid client connection state. */
|
|
3
4
|
export type ClientConnectionState = (typeof CLIENT_CONNECTION_STATES)[number];
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
/** Makes the specified keys in a type optional, leaving the rest unchanged. */
|
|
1
2
|
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
2
3
|
type PropertiesWithPrefix<Prefix extends string> = {
|
|
3
4
|
[key in `${Prefix}${string}`]: any;
|
|
4
5
|
};
|
|
5
6
|
type Pred = [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
7
|
+
/**
|
|
8
|
+
* Recursively flattens all keys of a type into dot notation paths up to a fixed depth.
|
|
9
|
+
* Used to map deeply nested fields with their access paths.
|
|
10
|
+
*/
|
|
6
11
|
export type DeepRecord<T, RemainingDepth extends number & keyof Pred = 5, Prefix extends string = ''> = RemainingDepth extends 0 ? PropertiesWithPrefix<Prefix> : {
|
|
7
12
|
[k in keyof T]-?: k extends string | number ? Record<`${Prefix}${k}`, T[k]> | (Required<T>[k] extends any[] ? never : Required<T>[k] extends object ? DeepRecord<Required<T>[k], Pred[RemainingDepth], `${Prefix}${k}.`> : never) : never;
|
|
8
13
|
}[keyof T];
|
|
14
|
+
/** Gets the union of keys from a union of object types. */
|
|
9
15
|
export type UnionKeys<T> = T extends any ? keyof T : never;
|
|
16
|
+
/** Extracts the type of specific field `K` from a union of object types `T`. */
|
|
10
17
|
export type FieldOf<T, K extends UnionKeys<T>> = Extract<T, Record<K, any>>[K];
|
|
18
|
+
/** All possible deeply nested field paths of a type, joined by dot notation. */
|
|
11
19
|
export type Paths<T> = UnionKeys<DeepRecord<T>>;
|
|
12
20
|
export {};
|
|
@@ -12,10 +12,19 @@ export declare class ApiCallContext {
|
|
|
12
12
|
readonly body: unknown;
|
|
13
13
|
readonly options: ApiOptions;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Represents a request to call an API through a specified integration and endpoint.
|
|
17
|
+
* Includes optional method override and additional request options.
|
|
18
|
+
*/
|
|
15
19
|
export interface CallApiRequest<BodyType = any> {
|
|
20
|
+
/** The identifier of the integration through which the API is called. */
|
|
16
21
|
integrationId: IntegrationId;
|
|
22
|
+
/** Target API endpoint to invoke. */
|
|
17
23
|
endpointId: ApiEndpointId;
|
|
24
|
+
/** Optional request payload. */
|
|
18
25
|
body?: BodyType;
|
|
26
|
+
/** Optional HTTP method override. Default is POST. */
|
|
19
27
|
overrideMethod?: HttpMethod;
|
|
28
|
+
/** Additional request options. */
|
|
20
29
|
options: ApiOptions;
|
|
21
30
|
}
|