@squidcloud/client 1.0.145-beta → 1.0.146-beta
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 -50433
- package/dist/esm/index.js +1 -0
- package/dist/internal-common/src/metric-name.d.ts +9 -0
- package/dist/internal-common/src/public-types/ai-agent-integrations.public-types.d.ts +47 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +895 -0
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +31 -0
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +185 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +431 -0
- package/dist/internal-common/src/public-types/ai-matchmaking.public-types.d.ts +186 -0
- package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +170 -0
- package/dist/internal-common/src/public-types/api-client.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/api.public-types.d.ts +91 -0
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +50 -0
- package/dist/{common/src/backend-function.schemas.d.ts → internal-common/src/public-types/code-executor.public-types.d.ts} +1 -1
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +30 -0
- package/dist/internal-common/src/public-types/context.public-types.d.ts +83 -0
- package/dist/internal-common/src/public-types/document.public-types.d.ts +71 -0
- package/dist/internal-common/src/public-types/external-auth/external-auth.public-types.d.ts +39 -0
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +183 -0
- package/dist/internal-common/src/public-types/http-status.public-types.d.ts +415 -0
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +51 -0
- package/dist/internal-common/src/public-types/job.public-types.d.ts +59 -0
- package/dist/internal-common/src/public-types/metric.public-types.d.ts +154 -0
- package/dist/internal-common/src/public-types/openapi.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/query.public-types.d.ts +113 -0
- package/dist/internal-common/src/public-types/regions.public-types.d.ts +4 -0
- package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +43 -0
- package/dist/{common/src/schema/schema.types.d.ts → internal-common/src/public-types/schema.public-types.d.ts} +54 -54
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +51 -0
- package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +60 -0
- package/dist/internal-common/src/public-types/socket.public-types.d.ts +4 -0
- package/dist/{common/src/types.d.ts → internal-common/src/public-types/typescript.public-types.d.ts} +20 -14
- package/dist/internal-common/src/public-types/web.public-types.d.ts +93 -0
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
- package/dist/{common/src/query/query-context.d.ts → internal-common/src/public-types-backend/query.public-context.d.ts} +177 -137
- package/dist/{common/src/ai-chatbot.schemas.d.ts → internal-common/src/public-utils/context-utils.d.ts} +1 -1
- package/dist/internal-common/src/public-utils/id-utils.d.ts +44 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +199 -0
- package/dist/{common/src/mutation.schemas.d.ts → internal-common/src/types/ai-assistant.types.d.ts} +1 -1
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
- package/dist/{common/src → internal-common/src/types}/backend-function.types.d.ts +1 -1
- package/dist/internal-common/src/types/communication.types.d.ts +1 -0
- package/dist/internal-common/src/types/document.types.d.ts +1 -0
- package/dist/internal-common/src/types/file.types.d.ts +6 -0
- package/dist/internal-common/src/types/headers.types.d.ts +17 -0
- package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
- package/dist/internal-common/src/types/notification.types.d.ts +5 -0
- package/dist/internal-common/src/types/observability.types.d.ts +78 -0
- package/dist/internal-common/src/types/query.types.d.ts +13 -0
- package/dist/internal-common/src/types/secret.types.d.ts +7 -0
- package/dist/internal-common/src/types/socket.types.d.ts +1 -0
- package/dist/internal-common/src/types/stage.d.ts +9 -0
- package/dist/{common/src → internal-common/src/types}/time-units.d.ts +1 -1
- package/dist/internal-common/src/types/url-shortener.types.d.ts +41 -0
- package/dist/internal-common/src/utils/array.d.ts +7 -0
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
- package/dist/{common → internal-common}/src/utils/global.utils.d.ts +1 -1
- package/dist/internal-common/src/utils/http.d.ts +5 -0
- package/dist/{common → internal-common}/src/utils/lock.manager.d.ts +14 -14
- package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
- package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
- package/dist/internal-common/src/utils/object.d.ts +58 -0
- package/dist/internal-common/src/utils/serialization.d.ts +17 -0
- package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
- package/dist/internal-common/src/utils/validation.d.ts +19 -0
- package/dist/{common → internal-common}/src/websocket.impl.d.ts +26 -21
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
- package/dist/typescript-client/src/admin-client.d.ts +23 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +181 -0
- package/dist/typescript-client/src/agent/ai-agent-client.d.ts +37 -0
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +69 -0
- package/dist/typescript-client/src/ai-assistant-client.d.ts +72 -73
- package/dist/typescript-client/src/ai-audio-client.d.ts +25 -0
- package/dist/typescript-client/src/ai-client.d.ts +129 -0
- package/dist/typescript-client/src/ai-files-client.d.ts +33 -0
- package/dist/typescript-client/src/ai-image-client.d.ts +25 -0
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +86 -0
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client.d.ts +28 -0
- package/dist/typescript-client/src/ai-matchmaking-client.d.ts +99 -0
- package/dist/typescript-client/src/api-client.d.ts +69 -0
- package/dist/typescript-client/src/auth.manager.d.ts +11 -26
- package/dist/typescript-client/src/backend-function.manager.d.ts +1 -9
- package/dist/typescript-client/src/client-customization.utils.d.ts +1 -0
- package/dist/typescript-client/src/client-id.service.d.ts +1 -27
- package/dist/typescript-client/src/collection-reference.d.ts +105 -80
- package/dist/typescript-client/src/collection-reference.factory.d.ts +1 -13
- package/dist/typescript-client/src/connection-details.d.ts +24 -23
- package/dist/typescript-client/src/console-utils.d.ts +1 -0
- package/dist/typescript-client/src/data.manager.d.ts +1 -173
- package/dist/typescript-client/src/destruct.manager.d.ts +1 -12
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +39 -16
- package/dist/typescript-client/src/document-identity.service.d.ts +1 -12
- package/dist/typescript-client/src/document-reference.d.ts +151 -140
- package/dist/typescript-client/src/document-reference.factory.d.ts +1 -13
- package/dist/typescript-client/src/document-store.d.ts +1 -14
- package/dist/typescript-client/src/execute-function-options.d.ts +73 -0
- package/dist/typescript-client/src/external-auth-client.d.ts +36 -0
- package/dist/typescript-client/src/extraction-client.d.ts +32 -0
- package/dist/typescript-client/src/file-args-transformer.d.ts +1 -0
- package/dist/typescript-client/src/file-utils.d.ts +1 -0
- package/dist/typescript-client/src/index.d.ts +63 -9
- package/dist/typescript-client/src/integration-client.d.ts +60 -0
- package/dist/typescript-client/src/job-client.d.ts +32 -0
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +1 -10
- package/dist/typescript-client/src/native-query-manager.d.ts +1 -7
- package/dist/typescript-client/src/notification-client.d.ts +20 -0
- package/dist/typescript-client/src/observability-client.d.ts +43 -0
- package/dist/typescript-client/src/public-types.d.ts +30 -0
- package/dist/typescript-client/src/public-utils.d.ts +1 -0
- package/dist/typescript-client/src/query/deserializer.d.ts +10 -3
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +316 -161
- package/dist/typescript-client/src/query/local-query-manager.d.ts +1 -9
- package/dist/{common → typescript-client}/src/query/pagination.d.ts +65 -62
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +228 -77
- package/dist/typescript-client/src/query/query-sender.d.ts +1 -33
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +1 -130
- package/dist/typescript-client/src/query/query.types.d.ts +16 -49
- package/dist/typescript-client/src/query/snapshot-emitter.d.ts +41 -0
- package/dist/typescript-client/src/query-utils.d.ts +18 -0
- package/dist/typescript-client/src/queue.manager.d.ts +12 -0
- package/dist/typescript-client/src/rate-limiter.d.ts +1 -32
- package/dist/typescript-client/src/rpc.manager.d.ts +1 -30
- package/dist/typescript-client/src/scheduler-client.d.ts +31 -0
- package/dist/typescript-client/src/secret.client.d.ts +96 -22
- package/dist/typescript-client/src/socket.manager.d.ts +1 -43
- package/dist/typescript-client/src/squid-http-client.d.ts +11 -0
- package/dist/typescript-client/src/squid.d.ts +378 -269
- package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
- package/dist/typescript-client/src/storage-client.d.ts +145 -0
- package/dist/typescript-client/src/types.d.ts +27 -2
- package/dist/typescript-client/src/version.d.ts +5 -0
- package/dist/typescript-client/src/web-client.d.ts +63 -0
- package/dist/typescript-client/src/webhook.manager.d.ts +10 -0
- package/package.json +34 -18
- package/dist/common/src/ai-assistant.types.d.ts +0 -25
- package/dist/common/src/ai-chatbot.context.d.ts +0 -12
- package/dist/common/src/ai-chatbot.types.d.ts +0 -27
- package/dist/common/src/api-call.context.d.ts +0 -13
- package/dist/common/src/api.types.d.ts +0 -4
- package/dist/common/src/application.schemas.d.ts +0 -66
- package/dist/common/src/application.types.d.ts +0 -143
- package/dist/common/src/backend-run.types.d.ts +0 -2
- package/dist/common/src/bundle-api.types.d.ts +0 -43
- package/dist/common/src/bundle-data.types.d.ts +0 -5
- package/dist/common/src/communication.types.d.ts +0 -8
- package/dist/common/src/context.types.d.ts +0 -40
- package/dist/common/src/distributed-lock.context.d.ts +0 -4
- package/dist/common/src/document.types.d.ts +0 -22
- package/dist/common/src/graphql.context.d.ts +0 -7
- package/dist/common/src/graphql.types.d.ts +0 -9
- package/dist/common/src/heartbeat.types.d.ts +0 -1
- package/dist/common/src/http-status.enum.d.ts +0 -50
- package/dist/common/src/index.d.ts +0 -57
- package/dist/common/src/integrations/ai_chatbot.types.d.ts +0 -31
- package/dist/common/src/integrations/api.types.d.ts +0 -80
- package/dist/common/src/integrations/auth.types.d.ts +0 -47
- package/dist/common/src/integrations/database.types.d.ts +0 -274
- package/dist/common/src/integrations/index.d.ts +0 -134
- package/dist/common/src/integrations/observability.types.d.ts +0 -23
- package/dist/common/src/logger.types.d.ts +0 -21
- package/dist/common/src/metrics.types.d.ts +0 -1
- package/dist/common/src/mutation.context.d.ts +0 -14
- package/dist/common/src/mutation.types.d.ts +0 -53
- package/dist/common/src/named-query.context.d.ts +0 -4
- package/dist/common/src/named-query.schemas.d.ts +0 -1
- package/dist/common/src/named-query.types.d.ts +0 -1
- package/dist/common/src/native-query.context.d.ts +0 -7
- package/dist/common/src/native-query.types.d.ts +0 -16
- package/dist/common/src/query/base-query-builder.d.ts +0 -147
- package/dist/common/src/query/index.d.ts +0 -4
- package/dist/common/src/query/serialized-query.types.d.ts +0 -24
- package/dist/common/src/query.types.d.ts +0 -64
- package/dist/common/src/regions.d.ts +0 -1
- package/dist/common/src/secret.schemas.d.ts +0 -1
- package/dist/common/src/secret.types.d.ts +0 -22
- package/dist/common/src/security.types.d.ts +0 -1
- package/dist/common/src/socket.schemas.d.ts +0 -1
- package/dist/common/src/socket.types.d.ts +0 -5
- package/dist/common/src/trigger.types.d.ts +0 -1
- package/dist/common/src/utils/array.d.ts +0 -1
- package/dist/common/src/utils/assert.d.ts +0 -1
- package/dist/common/src/utils/error.d.ts +0 -4
- package/dist/common/src/utils/http.d.ts +0 -2
- package/dist/common/src/utils/id.d.ts +0 -2
- package/dist/common/src/utils/object.d.ts +0 -5
- package/dist/common/src/utils/serialization.d.ts +0 -6
- package/dist/common/src/utils/transforms.d.ts +0 -18
- package/dist/common/src/utils/url.d.ts +0 -1
- package/dist/common/src/utils/validation.d.ts +0 -25
- package/dist/common/src/webhook-response.d.ts +0 -1
- package/dist/typescript-client/src/ai-chatbot-client.d.ts +0 -174
- package/dist/typescript-client/src/ai-chatbot-client.factory.d.ts +0 -8
- package/dist/typescript-client/src/ai.types.d.ts +0 -61
- package/dist/typescript-client/src/api.manager.d.ts +0 -11
- package/dist/typescript-client/src/graphql-client.d.ts +0 -14
- package/dist/typescript-client/src/graphql-client.factory.d.ts +0 -11
- package/dist/typescript-client/src/named-query.manager.d.ts +0 -11
- package/dist/typescript-client/src/state/action.applier.d.ts +0 -7
- package/dist/typescript-client/src/state/actions.d.ts +0 -29
- package/dist/typescript-client/src/state/path_trie.d.ts +0 -27
- package/dist/typescript-client/src/state/state.service.d.ts +0 -22
- package/dist/typescript-client/src/testing/setup-tests.d.ts +0 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name of metrics publicly provided by the system.
|
|
3
|
+
* - Metrics suffixed by '_time' are 'gauge' metrics.
|
|
4
|
+
* - Metrics suffixed by '_count' are 'count' metrics.
|
|
5
|
+
* All Squid metrics starts with `squid_` prefix.
|
|
6
|
+
*/
|
|
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'). */
|
|
9
|
+
export type SquidMetricName = (typeof SQUID_METRIC_NAMES)[number];
|
|
10
|
+
/** Aggregation function used in metric queries (e.g., 'sum', 'max', 'median'). */
|
|
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'). */
|
|
13
|
+
export type MetricFunction = (typeof METRIC_FUNCTIONS)[number];
|
|
14
|
+
/** Defines source of the metric: reported by user or automatically collected by the system (Squid). */
|
|
15
|
+
export declare const METRIC_DOMAIN: readonly ["user", "squid"];
|
|
16
|
+
/** Domain of the metric: 'user' for custom metrics, 'squid' for built-in system metrics. */
|
|
17
|
+
export type MetricDomain = (typeof METRIC_DOMAIN)[number];
|
|
18
|
+
/** Defines how to align data points in a metric query interval. */
|
|
19
|
+
export declare const METRIC_INTERVAL_ALIGNMENT: readonly ["align-by-start-time", "align-by-end-time"];
|
|
20
|
+
/** Indicates how to align per-point periods in metric queries. */
|
|
21
|
+
export type MetricIntervalAlignment = (typeof METRIC_INTERVAL_ALIGNMENT)[number];
|
|
22
|
+
/** Common parameters shared by all metric query requests. */
|
|
23
|
+
export interface QueryMetricsRequestCommon {
|
|
24
|
+
/** Kind of the metrics (domain) to query. */
|
|
25
|
+
domain: MetricDomain;
|
|
26
|
+
/** Start of the queried interval. Must be an integer value. */
|
|
27
|
+
periodStartSeconds: number;
|
|
28
|
+
/** End of the queried interval. Must be an integer value. */
|
|
29
|
+
periodEndSeconds: number;
|
|
30
|
+
/**
|
|
31
|
+
* Time interval per point. Must be less than periodEndSeconds - periodStartSeconds.
|
|
32
|
+
* Set to 0 or keep undefined to have only 1 value in the result.
|
|
33
|
+
*/
|
|
34
|
+
pointIntervalSeconds?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Specifies the alignment of the per-point interval.
|
|
37
|
+
* Default: 'align-by-start-time'
|
|
38
|
+
*/
|
|
39
|
+
pointIntervalAlignment?: MetricIntervalAlignment;
|
|
40
|
+
/** Aggregation functions that maps multiple points per point region to a single point value. */
|
|
41
|
+
fn: MetricFunction | Array<MetricFunction>;
|
|
42
|
+
/**
|
|
43
|
+
* If there is no data in the specified region this value will be used to fill the gap.
|
|
44
|
+
* Default: null.
|
|
45
|
+
*/
|
|
46
|
+
fillValue?: number | null;
|
|
47
|
+
/**
|
|
48
|
+
* Tag filters.
|
|
49
|
+
* TODO: add operations to exclude tags: !=, !contains...
|
|
50
|
+
*/
|
|
51
|
+
tagFilter?: Record<string, string>;
|
|
52
|
+
/**
|
|
53
|
+
* A mapping of known tag values that must be present in the response groups.
|
|
54
|
+
*
|
|
55
|
+
* This ensures that the result will include groups for all specified tag values,
|
|
56
|
+
* even if there is no data for some values in the database.
|
|
57
|
+
*
|
|
58
|
+
* Example: Consider a tag 'isError' with two possible values: '0' and '1'.
|
|
59
|
+
* When 'tagDomains' contains `{'isError': ['0', '1']}`, the result will include
|
|
60
|
+
* groups for both 'isError: 0' and 'isError: 1'. If the database lacks data for
|
|
61
|
+
* 'isError: 1', the points in this group will be set to 'fillValue' (default is 'null').
|
|
62
|
+
*
|
|
63
|
+
* The tags in the new groups will be copied from the existing resultGroups,
|
|
64
|
+
* along with one of the tag domain values.
|
|
65
|
+
*
|
|
66
|
+
* @property {Record<string, string[]>} tagDomains - A record where each key is a tag name and
|
|
67
|
+
* each value is an array of possible values for that tag. Should only contain tags listed in 'groupByTags' field.
|
|
68
|
+
*/
|
|
69
|
+
tagDomains?: Record<string, string[]>;
|
|
70
|
+
/** List of ordered tag names for a 'GROUP BY'. */
|
|
71
|
+
groupByTags?: string[];
|
|
72
|
+
/** The results will be ordered by the specified tags (ORDER BY). */
|
|
73
|
+
orderByTags?: string[];
|
|
74
|
+
/**
|
|
75
|
+
* Specifies what result will be returned if there were no records found in the database.
|
|
76
|
+
* In this case the 'resultGroups' array will be empty (default), or can be filled with a default
|
|
77
|
+
* values if 'return-result-group-with-default-values' is specified.
|
|
78
|
+
* The generated result group will have 'tagValues' set to empty strings.
|
|
79
|
+
*
|
|
80
|
+
* May be useful to get a ready-to-render array with no additional post-processing required.
|
|
81
|
+
*
|
|
82
|
+
* Note: 'tagDomains' can provide similar functionality when set of tag values is defined: multiple result groups
|
|
83
|
+
* will be filled with default values. There is no need to use this option if 'tagDomains' is used.
|
|
84
|
+
*
|
|
85
|
+
* Default: 'return-no-result-groups'
|
|
86
|
+
*/
|
|
87
|
+
noDataBehavior?: 'return-no-result-groups' | 'return-result-group-with-default-values';
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Request structure for querying user-defined metrics.
|
|
91
|
+
* @category Metrics
|
|
92
|
+
*/
|
|
93
|
+
export interface QueryUserMetricsRequest<NameType extends string = string> extends QueryMetricsRequestCommon {
|
|
94
|
+
/** Specifies the user domain for custom metrics. */
|
|
95
|
+
domain: 'user';
|
|
96
|
+
/** Name of the user-defined metric to query. */
|
|
97
|
+
name: NameType;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Request structure for querying built-in Squid metrics.
|
|
101
|
+
* @category Metrics
|
|
102
|
+
*/
|
|
103
|
+
export interface QuerySquidMetricsRequest<NameType extends SquidMetricName = SquidMetricName> extends QueryMetricsRequestCommon {
|
|
104
|
+
/** Specifies the squid domain for built-in system metrics. */
|
|
105
|
+
domain: 'squid';
|
|
106
|
+
/** Name of the built-in Squid metric to query. */
|
|
107
|
+
name: NameType;
|
|
108
|
+
}
|
|
109
|
+
/** A request to query metrics, either Squid or user-defined, depending on the domain and metric name. */
|
|
110
|
+
export type QueryMetricsRequest<NameType extends string = string> = QuerySquidMetricsRequest<NameType extends SquidMetricName ? NameType : SquidMetricName> | QueryUserMetricsRequest<NameType>;
|
|
111
|
+
/**
|
|
112
|
+
* Every result point is a list of [timestamp, values...],
|
|
113
|
+
* where list of values are defined by the list of functions in the request.
|
|
114
|
+
* If there is no data for the point 'null' is used as a 'value'.
|
|
115
|
+
* The timestamp is always equal to the point period start date and is measured in Unix epoch seconds.
|
|
116
|
+
*/
|
|
117
|
+
export type QueryMetricsResultPoint = [number, ...(number | null)[]];
|
|
118
|
+
/** A group of metric results that share the same tag values. */
|
|
119
|
+
export interface QueryMetricsResultGroup {
|
|
120
|
+
/** Values of the tags in the group. The tags are ordered the same way as in request.groupByTags collection. */
|
|
121
|
+
tagValues: string[];
|
|
122
|
+
/** List of result points for the group. */
|
|
123
|
+
points: Array<QueryMetricsResultPoint>;
|
|
124
|
+
}
|
|
125
|
+
/** Common structure for metric query responses. */
|
|
126
|
+
export interface QueryMetricsResponseCommon {
|
|
127
|
+
/**
|
|
128
|
+
* Result of the metrics query.
|
|
129
|
+
* Contains only 1 element if `groupByTags` are empty, otherwise contains multiple results grouped by tags.
|
|
130
|
+
*/
|
|
131
|
+
resultGroups: Array<QueryMetricsResultGroup>;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Response for a user-defined metric query.
|
|
135
|
+
* @category Metrics
|
|
136
|
+
*/
|
|
137
|
+
export interface QueryUserMetricsResponse<NameType extends string = string> extends QueryMetricsResponseCommon {
|
|
138
|
+
/** Specifies the user domain for custom metrics. */
|
|
139
|
+
domain: 'user';
|
|
140
|
+
/** Name of the queried user-defined metric. */
|
|
141
|
+
metricName: NameType;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* A single metric response for 'SquidMetricsRequest'.
|
|
145
|
+
* @category Metrics
|
|
146
|
+
*/
|
|
147
|
+
export interface QuerySquidMetricsResponse<NameType extends SquidMetricName> extends QueryMetricsResponseCommon {
|
|
148
|
+
/** Specifies the squid domain for built-in system metrics. */
|
|
149
|
+
domain: 'squid';
|
|
150
|
+
/** Name of the queried built-in Squid metric. */
|
|
151
|
+
metricName: NameType;
|
|
152
|
+
}
|
|
153
|
+
/** Final normalized response for a metrics query, required fields guaranteed. */
|
|
154
|
+
export type QueryMetricsResponse<NameType extends string = string> = Required<QuerySquidMetricsResponse<NameType extends SquidMetricName ? NameType : SquidMetricName> | QueryUserMetricsResponse<NameType>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Represents a standardized HTTP response in OpenAPI format. */
|
|
2
|
+
export interface OpenApiResponse {
|
|
3
|
+
/** HTTP headers returned in the response. */
|
|
4
|
+
headers: Record<string, any>;
|
|
5
|
+
/** Body content of the response. */
|
|
6
|
+
body: any;
|
|
7
|
+
/** HTTP status code of the response. */
|
|
8
|
+
statusCode: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { CollectionName, DocumentData, FieldName } from './document.public-types';
|
|
2
|
+
import { Paths } from './typescript.public-types';
|
|
3
|
+
/**
|
|
4
|
+
* An alias for a join result. This is used to disambiguate fields in the result.
|
|
5
|
+
* @category Database
|
|
6
|
+
*/
|
|
7
|
+
export type Alias = string;
|
|
8
|
+
/**
|
|
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
|
+
* @category Database
|
|
12
|
+
*/
|
|
13
|
+
export interface JoinCondition {
|
|
14
|
+
/** The alias of the left table in the join operation. */
|
|
15
|
+
leftAlias: Alias;
|
|
16
|
+
/** The field name from the left table to join on. */
|
|
17
|
+
left: FieldName;
|
|
18
|
+
/** The field name from the right table to join on. */
|
|
19
|
+
right: FieldName;
|
|
20
|
+
/** Indicates whether the join is an inner join (true) or outer join (false). */
|
|
21
|
+
isInner: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A list of query conditions.
|
|
25
|
+
* @category Database
|
|
26
|
+
*/
|
|
27
|
+
export type Condition<Doc extends DocumentData = any> = SimpleCondition<Doc> | CompositeCondition<Doc>;
|
|
28
|
+
/**
|
|
29
|
+
* A list of query conditions.
|
|
30
|
+
* @category Database
|
|
31
|
+
*/
|
|
32
|
+
export type Conditions<Doc extends DocumentData = any> = Array<Condition<Doc>>;
|
|
33
|
+
/**
|
|
34
|
+
* A single field query condition for filtering database records.
|
|
35
|
+
* @category Database
|
|
36
|
+
*/
|
|
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. */
|
|
39
|
+
fieldName: F;
|
|
40
|
+
/** The operator to use for comparing the field value. */
|
|
41
|
+
operator: MyOperator;
|
|
42
|
+
/** The value to compare against the field. */
|
|
43
|
+
value: any;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A composite fields query condition combining multiple simple conditions.
|
|
47
|
+
* Just a list of simple conditions with specific set of operators. It should be
|
|
48
|
+
* evaluated this way:
|
|
49
|
+
* If A, B, C are the conditions and A' = A with '==' operator:
|
|
50
|
+
* A || (A' && B) || (A' && B' && C)
|
|
51
|
+
* @category Database
|
|
52
|
+
*/
|
|
53
|
+
export interface CompositeCondition<Doc extends DocumentData = any> {
|
|
54
|
+
/** An array of simple conditions with restricted operators for composite evaluation. */
|
|
55
|
+
fields: Array<SimpleCondition<Doc, Paths<Doc>, CompositeConditionOperator>>;
|
|
56
|
+
}
|
|
57
|
+
type CompositeConditionOperator = '>=' | '<=' | '>' | '<';
|
|
58
|
+
/**
|
|
59
|
+
* The list of operators related to arrays.
|
|
60
|
+
* @category Database
|
|
61
|
+
*/
|
|
62
|
+
export declare const ARRAY_OPERATORS: readonly ["in", "not in", "array_includes_some", "array_includes_all", "array_not_includes"];
|
|
63
|
+
/**
|
|
64
|
+
* The list of all operators.
|
|
65
|
+
* @category Database
|
|
66
|
+
*/
|
|
67
|
+
export declare const ALL_OPERATORS: readonly ["in", "not in", "array_includes_some", "array_includes_all", "array_not_includes", "==", "!=", ">=", "<=", ">", "<", "like", "not like", "like_cs", "not like_cs"];
|
|
68
|
+
/**
|
|
69
|
+
* An operator in a query condition.
|
|
70
|
+
* @category Database
|
|
71
|
+
*/
|
|
72
|
+
export type Operator = (typeof ALL_OPERATORS)[number];
|
|
73
|
+
/**
|
|
74
|
+
* A definition of a sort order by a field in a database query.
|
|
75
|
+
* @category Database
|
|
76
|
+
*/
|
|
77
|
+
export interface FieldSort<Doc> {
|
|
78
|
+
/** The name of the field to sort by. */
|
|
79
|
+
fieldName: FieldName<Doc>;
|
|
80
|
+
/** Indicates whether the sort is ascending (true) or descending (false). */
|
|
81
|
+
asc: boolean;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A query object defining a database retrieval operation.
|
|
85
|
+
* @category Database
|
|
86
|
+
*/
|
|
87
|
+
export interface Query<Doc extends DocumentData = any> {
|
|
88
|
+
/** The full collection path such as "c1" or "c1/d1/c2". */
|
|
89
|
+
collectionName: CollectionName;
|
|
90
|
+
/** The ID of the integration associated with the query. */
|
|
91
|
+
integrationId: string;
|
|
92
|
+
/** An array of conditions to filter the query results. */
|
|
93
|
+
conditions: Conditions<Doc>;
|
|
94
|
+
/** An array of field sort definitions to order the results. */
|
|
95
|
+
sortOrder: Array<FieldSort<Doc>>;
|
|
96
|
+
/** The maximum number of records to return. */
|
|
97
|
+
limit: number;
|
|
98
|
+
/** Optional configuration to limit results by specific fields with custom sorting. */
|
|
99
|
+
limitBy?: LimitBy<Doc>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A configuration object used to apply additional field-based limits to a query.
|
|
103
|
+
* @category Database
|
|
104
|
+
*/
|
|
105
|
+
export interface LimitBy<Doc extends DocumentData = any> {
|
|
106
|
+
/** The maximum number of records to return for this limit configuration. */
|
|
107
|
+
limit: number;
|
|
108
|
+
/** The fields to apply the limit to. */
|
|
109
|
+
fields: Array<FieldName<Doc>>;
|
|
110
|
+
/** Indicates whether to reverse the sort order for this limit. */
|
|
111
|
+
reverseSort: boolean;
|
|
112
|
+
}
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ServiceFunctionName } from './backend.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for a scheduled task in the platform.
|
|
4
|
+
* @category Platform
|
|
5
|
+
*/
|
|
6
|
+
export interface SchedulerConfig {
|
|
7
|
+
/** The name of the service function to be executed on the schedule. */
|
|
8
|
+
functionName: ServiceFunctionName;
|
|
9
|
+
/** The cron expression defining the schedule timing. */
|
|
10
|
+
cronExpression: string;
|
|
11
|
+
/** Indicates whether the scheduler should run exclusively, preventing overlaps. */
|
|
12
|
+
exclusive: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Information about a scheduler instance in the platform.
|
|
16
|
+
* @category Platform
|
|
17
|
+
*/
|
|
18
|
+
export interface SchedulerInfo {
|
|
19
|
+
/** The unique identifier for the scheduler. */
|
|
20
|
+
schedulerId: string;
|
|
21
|
+
/** The configuration details for the scheduler. */
|
|
22
|
+
config: SchedulerConfig;
|
|
23
|
+
/** Indicates whether the scheduler is currently enabled. */
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Options for updating an existing scheduler in the platform.
|
|
28
|
+
* @category Platform
|
|
29
|
+
*/
|
|
30
|
+
export interface UpdateSchedulerOptions {
|
|
31
|
+
/** The unique identifier of the scheduler to update. */
|
|
32
|
+
schedulerId: string;
|
|
33
|
+
/** Optional flag to enable or disable the scheduler. */
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Request structure for updating multiple schedulers in the platform.
|
|
38
|
+
* @category Platform
|
|
39
|
+
*/
|
|
40
|
+
export interface UpdateSchedulersRequest {
|
|
41
|
+
/** An array of scheduler update options. */
|
|
42
|
+
schedulers: UpdateSchedulerOptions[];
|
|
43
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { JSONSchema } from 'json-schema-typed';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export {};
|
|
1
|
+
import { JSONSchema } from 'json-schema-typed';
|
|
2
|
+
type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
|
|
3
|
+
properties?: Record<string, ConvertDeep<JSONSchema>>;
|
|
4
|
+
patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
|
|
5
|
+
nullable?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The default value will be applied (default to 'empty'):
|
|
8
|
+
* 'always' - no matter what the client sent, both on update and insert. In case of readOnly - applies only on insert.
|
|
9
|
+
* 'empty' - only if the value of the field is empty (undefined)
|
|
10
|
+
* 'updateOrEmpty' - no matter what the client sent, updating the record will use the default value
|
|
11
|
+
*/
|
|
12
|
+
applyDefaultValueOn?: 'always' | 'empty' | 'updateOrEmpty';
|
|
13
|
+
isDate?: boolean;
|
|
14
|
+
isJSON?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Applies to the top level schema, a record in a nested object, or a regular property.
|
|
17
|
+
* Basically, whether this property can participate in an insert mutation.
|
|
18
|
+
*/
|
|
19
|
+
insertable?: boolean;
|
|
20
|
+
/** Applies to the top level schema or a record in a nested object. */
|
|
21
|
+
deletable?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** Extended JSON schema for a single property, supporting nested structures and Squid-specific metadata. */
|
|
24
|
+
export type PropertySchema = ConvertDeep<JSONSchema>;
|
|
25
|
+
/** Extended JSON schema for a top-level property, including database-related metadata. */
|
|
26
|
+
export type TopLevelPropertySchema = PropertySchema & {
|
|
27
|
+
/** Marks the property as a primary key. */
|
|
28
|
+
primaryKey?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the property is computed based on other properties or some formula.
|
|
31
|
+
* If true, readonly also needs to be true and this field should not be part of an insert statement.
|
|
32
|
+
*/
|
|
33
|
+
isComputed?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the default value generated by the database. CURRENT_DATE is something generated by the database vs
|
|
36
|
+
* 'Hello' which is a constant.
|
|
37
|
+
*/
|
|
38
|
+
isDefaultComputed?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The database data type that is represented by this property. This is often different from the actual property
|
|
41
|
+
* type, with is a Javascript primitive. For example, for a SMALLINT the dataType would be 'smallint', but the type
|
|
42
|
+
* would be 'integer'.
|
|
43
|
+
*/
|
|
44
|
+
dataType?: string;
|
|
45
|
+
/**
|
|
46
|
+
* This indicates that although the field exists on the db, it should be ignored by squid.
|
|
47
|
+
*/
|
|
48
|
+
hidden?: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** Schema for a full collection, allowing partial property definitions with extended metadata. */
|
|
51
|
+
export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
|
|
52
|
+
properties?: Record<string, TopLevelPropertySchema>;
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A type alias for an ApiKey.
|
|
3
|
+
* @category Secret
|
|
4
|
+
*/
|
|
5
|
+
export type ApiKey = string;
|
|
6
|
+
/**
|
|
7
|
+
* The secret key, an alias for a string.
|
|
8
|
+
* @category Secret
|
|
9
|
+
*/
|
|
10
|
+
export type SecretKey = string;
|
|
11
|
+
/**
|
|
12
|
+
* The secret value.
|
|
13
|
+
* @category Secret
|
|
14
|
+
*/
|
|
15
|
+
export type SecretValue = string | number | boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Metadata for a secret, including its key and last updated timestamp.
|
|
18
|
+
* @category Secret
|
|
19
|
+
*/
|
|
20
|
+
export interface SecretMetadata {
|
|
21
|
+
/** The key identifying the secret. */
|
|
22
|
+
key: SecretKey;
|
|
23
|
+
/** The timestamp (in milliseconds) when the secret was last updated. */
|
|
24
|
+
lastUpdated: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A secret entry combining metadata with a typed value.
|
|
28
|
+
* @category Secret
|
|
29
|
+
*/
|
|
30
|
+
export interface SecretEntry<T extends SecretValue = SecretValue> extends SecretMetadata {
|
|
31
|
+
/** The value of the secret, constrained to the specified type. */
|
|
32
|
+
value: T;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* An API key entry combining metadata with a string value.
|
|
36
|
+
* @category Secret
|
|
37
|
+
*/
|
|
38
|
+
export interface ApiKeyEntry extends SecretMetadata {
|
|
39
|
+
/** The string value of the API key. */
|
|
40
|
+
value: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A request structure for setting a secret with a key-value pair.
|
|
44
|
+
* @category Secret
|
|
45
|
+
*/
|
|
46
|
+
export interface SetSecretRequestEntry {
|
|
47
|
+
/** The key identifying the secret to set. */
|
|
48
|
+
key: SecretKey;
|
|
49
|
+
/** The value to assign to the secret. */
|
|
50
|
+
value: SecretValue;
|
|
51
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { DocumentData } from './document.public-types';
|
|
2
|
+
import { Alias, JoinCondition, Query } from './query.public-types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a simple serialized query structure for database operations.
|
|
5
|
+
* @category Database
|
|
6
|
+
*/
|
|
7
|
+
export type SerializedSimpleQuery = {
|
|
8
|
+
/** Specifies that this is a simple query type. */
|
|
9
|
+
type: 'simple';
|
|
10
|
+
/** The query object defining the database operation. */
|
|
11
|
+
query: Query;
|
|
12
|
+
/** Indicates whether references should be dereferenced during query execution. */
|
|
13
|
+
dereference: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Represents a serialized join query structure for database operations with multiple table relationships.
|
|
17
|
+
* @category Database
|
|
18
|
+
*/
|
|
19
|
+
export type SerializedJoinQuery = {
|
|
20
|
+
/** Specifies that this is a join query type. */
|
|
21
|
+
type: 'join';
|
|
22
|
+
/** Specifies if the results should be grouped by the root alias. */
|
|
23
|
+
grouped: boolean;
|
|
24
|
+
/** Indicates whether references should be dereferenced during query execution. */
|
|
25
|
+
dereference: boolean;
|
|
26
|
+
/** The root table configuration for the join operation. */
|
|
27
|
+
root: RootTableDetails;
|
|
28
|
+
/** A mapping of aliases to their dependent aliases, defining the join order from left to right. */
|
|
29
|
+
leftToRight: Record<Alias, Alias[]>;
|
|
30
|
+
/** A mapping of aliases to their corresponding queries for joined tables. */
|
|
31
|
+
joins: Record<Alias, Query<DocumentData>>;
|
|
32
|
+
/** A mapping of aliases to their join conditions. */
|
|
33
|
+
joinConditions: Record<Alias, JoinCondition>;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Configuration details for the root table used in a join query.
|
|
37
|
+
* The root table serves as the entry point for evaluating joined data across multiple tables.
|
|
38
|
+
* @category Database
|
|
39
|
+
*/
|
|
40
|
+
export interface RootTableDetails {
|
|
41
|
+
/** The alias for the root table in the join operation. */
|
|
42
|
+
alias: Alias;
|
|
43
|
+
/** The query object defining the root table's operation. */
|
|
44
|
+
query: Query;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Represents a serialized merged query structure combining multiple queries for database operations.
|
|
48
|
+
* @category Database
|
|
49
|
+
*/
|
|
50
|
+
export type SerializedMergedQuery = {
|
|
51
|
+
/** Specifies that this is a merged query type. */
|
|
52
|
+
type: 'merged';
|
|
53
|
+
/** An array of serialized queries to be merged. */
|
|
54
|
+
queries: Array<SerializedQuery>;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* A union type representing all possible serialized query structures for database operations.
|
|
58
|
+
* @category Database
|
|
59
|
+
*/
|
|
60
|
+
export type SerializedQuery = SerializedSimpleQuery | SerializedJoinQuery | SerializedMergedQuery;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Squid client connection state. Can be 'CONNECTED', 'DISCONNECTED', or 'REMOVED'. */
|
|
2
|
+
export declare const CLIENT_CONNECTION_STATES: readonly ["CONNECTED", "DISCONNECTED", "REMOVED"];
|
|
3
|
+
/** Squid client connection state. */
|
|
4
|
+
export type ClientConnectionState = (typeof CLIENT_CONNECTION_STATES)[number];
|
package/dist/{common/src/types.d.ts → internal-common/src/public-types/typescript.public-types.d.ts}
RENAMED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
/** Makes the specified keys in a type optional, leaving the rest unchanged. */
|
|
2
|
+
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
3
|
+
type PropertiesWithPrefix<Prefix extends string> = {
|
|
4
|
+
[key in `${Prefix}${string}`]: any;
|
|
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
|
+
*/
|
|
11
|
+
export type DeepRecord<T, RemainingDepth extends number & keyof Pred = 5, Prefix extends string = ''> = RemainingDepth extends 0 ? PropertiesWithPrefix<Prefix> : {
|
|
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;
|
|
13
|
+
}[keyof T];
|
|
14
|
+
/** Gets the union of keys from a union of object types. */
|
|
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`. */
|
|
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. */
|
|
19
|
+
export type Paths<T> = UnionKeys<DeepRecord<T>>;
|
|
20
|
+
export {};
|