@squidcloud/client 1.0.64 → 1.0.66

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 (100) hide show
  1. package/dist/common/src/ai-assistant.context.d.ts +12 -11
  2. package/dist/common/src/ai-assistant.schemas.d.ts +1 -210
  3. package/dist/common/src/ai-assistant.types.d.ts +2 -81
  4. package/dist/common/src/api-call.context.d.ts +13 -12
  5. package/dist/common/src/api.types.d.ts +4 -24
  6. package/dist/common/src/application.schemas.d.ts +1 -1060
  7. package/dist/common/src/application.types.d.ts +184 -224
  8. package/dist/common/src/auth.types.d.ts +1 -4
  9. package/dist/common/src/backend-function.schemas.d.ts +1 -3
  10. package/dist/common/src/backend-function.types.d.ts +1 -7
  11. package/dist/common/src/backend-run.types.d.ts +2 -53
  12. package/dist/common/src/bundle-api.types.d.ts +36 -68
  13. package/dist/common/src/bundle-data.types.d.ts +4 -59
  14. package/dist/common/src/communication.types.d.ts +22 -4
  15. package/dist/common/src/context.types.d.ts +32 -32
  16. package/dist/common/src/distributed-lock.context.d.ts +5 -5
  17. package/dist/common/src/document.types.d.ts +22 -37
  18. package/dist/common/src/graphql.context.d.ts +7 -6
  19. package/dist/common/src/graphql.types.d.ts +9 -11
  20. package/dist/common/src/http-status.enum.d.ts +50 -50
  21. package/dist/common/src/index.d.ts +54 -54
  22. package/dist/common/src/integrations/ai_assistant.types.d.ts +30 -30
  23. package/dist/common/src/integrations/api.types.d.ts +80 -80
  24. package/dist/common/src/integrations/auth.types.d.ts +22 -22
  25. package/dist/common/src/integrations/database.types.d.ts +236 -236
  26. package/dist/common/src/integrations/index.d.ts +97 -97
  27. package/dist/common/src/integrations/observability.types.d.ts +22 -22
  28. package/dist/common/src/logger.types.d.ts +21 -21
  29. package/dist/common/src/metrics.types.d.ts +1 -58
  30. package/dist/common/src/mutation.context.d.ts +12 -10
  31. package/dist/common/src/mutation.schemas.d.ts +1 -5
  32. package/dist/common/src/mutation.types.d.ts +53 -72
  33. package/dist/common/src/named-query.context.d.ts +4 -4
  34. package/dist/common/src/named-query.schemas.d.ts +1 -3
  35. package/dist/common/src/named-query.types.d.ts +1 -9
  36. package/dist/common/src/query/index.d.ts +2 -2
  37. package/dist/common/src/query/query-context.d.ts +37 -37
  38. package/dist/common/src/query/simple-query-builder.d.ts +137 -137
  39. package/dist/common/src/query.schemas.d.ts +1 -5
  40. package/dist/common/src/query.types.d.ts +51 -118
  41. package/dist/common/src/regions.d.ts +1 -22
  42. package/dist/common/src/schema/schema.types.d.ts +54 -54
  43. package/dist/common/src/secret.schemas.d.ts +1 -6
  44. package/dist/common/src/secret.types.d.ts +8 -49
  45. package/dist/common/src/security.types.d.ts +1 -3
  46. package/dist/common/src/socket.schemas.d.ts +1 -3
  47. package/dist/common/src/socket.types.d.ts +1 -108
  48. package/dist/common/src/time-units.d.ts +1 -5
  49. package/dist/common/src/trigger.types.d.ts +1 -15
  50. package/dist/common/src/types.d.ts +8 -15
  51. package/dist/common/src/utils/array.d.ts +1 -8
  52. package/dist/common/src/utils/assert.d.ts +1 -8
  53. package/dist/common/src/utils/error.d.ts +4 -4
  54. package/dist/common/src/utils/http.d.ts +2 -2
  55. package/dist/common/src/utils/id.d.ts +2 -2
  56. package/dist/common/src/utils/lock.manager.d.ts +14 -14
  57. package/dist/common/src/utils/nullish.d.ts +1 -1
  58. package/dist/common/src/utils/object.d.ts +6 -6
  59. package/dist/common/src/utils/serialization.d.ts +6 -6
  60. package/dist/common/src/utils/transforms.d.ts +18 -18
  61. package/dist/common/src/utils/url.d.ts +1 -1
  62. package/dist/common/src/utils/validation.d.ts +30 -30
  63. package/dist/common/src/webhook-response.d.ts +1 -7
  64. package/dist/index.js +2 -2
  65. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
  66. package/dist/typescript-client/src/ai-assistant-client.d.ts +66 -66
  67. package/dist/typescript-client/src/ai-client.factory.d.ts +13 -13
  68. package/dist/typescript-client/src/api.manager.d.ts +15 -15
  69. package/dist/typescript-client/src/auth.manager.d.ts +23 -23
  70. package/dist/typescript-client/src/backend-function.manager.d.ts +13 -13
  71. package/dist/typescript-client/src/client-id.service.d.ts +24 -24
  72. package/dist/typescript-client/src/collection-reference.d.ts +81 -81
  73. package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -16
  74. package/dist/typescript-client/src/data.manager.d.ts +172 -172
  75. package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
  76. package/dist/typescript-client/src/distributed-lock.manager.d.ts +19 -19
  77. package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
  78. package/dist/typescript-client/src/document-reference.d.ts +134 -134
  79. package/dist/typescript-client/src/document-reference.factory.d.ts +9 -9
  80. package/dist/typescript-client/src/document-store.d.ts +11 -11
  81. package/dist/typescript-client/src/graphql-client.d.ts +12 -12
  82. package/dist/typescript-client/src/graphql-client.factory.d.ts +9 -9
  83. package/dist/typescript-client/src/index.d.ts +8 -8
  84. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +12 -12
  85. package/dist/typescript-client/src/named-query.manager.d.ts +14 -14
  86. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +72 -72
  87. package/dist/typescript-client/src/query/query-builder.factory.d.ts +83 -83
  88. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +64 -64
  89. package/dist/typescript-client/src/query/query.types.d.ts +14 -14
  90. package/dist/typescript-client/src/rpc.manager.d.ts +28 -28
  91. package/dist/typescript-client/src/socket.manager.d.ts +32 -32
  92. package/dist/typescript-client/src/squid.d.ts +196 -188
  93. package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
  94. package/dist/typescript-client/src/state/actions.d.ts +29 -29
  95. package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
  96. package/dist/typescript-client/src/state/state.service.d.ts +22 -22
  97. package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
  98. package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
  99. package/dist/typescript-client/src/types.d.ts +2 -2
  100. package/package.json +1 -1
@@ -1,97 +1,97 @@
1
- export * from './ai_assistant.types';
2
- export * from './api.types';
3
- export * from './auth.types';
4
- export * from './database.types';
5
- export * from './observability.types';
6
- import { IntegrationId } from '../communication.types';
7
- import { AiAssistantIntegrationConfig } from './ai_assistant.types';
8
- import { GraphQLIntegrationConfig, HttpApiIntegrationConfig, TestGraphQLDataConnectionRequest } from './api.types';
9
- import { Auth0IntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig } from './auth.types';
10
- import { BaseDatabaseIntegrationConfig, CockroachIntegrationConfig, InternalIntegrationConfig, MongoIntegrationConfig, MssqlIntegrationConfig, MySqlIntegrationConfig, OracleIntegrationConfig, PostgresIntegrationConfig, SnowflakeIntegrationConfig, TestDataConnectionRequest } from './database.types';
11
- import { DatadogIntegrationConfig, NewRelicIntegrationConfig } from './observability.types';
12
- export declare enum IntegrationCategory {
13
- 'database' = "database",
14
- 'api' = "api",
15
- 'observability' = "observability",
16
- 'crm' = "crm",
17
- 'auth' = "auth",
18
- 'ai' = "ai"
19
- }
20
- export declare enum IntegrationType {
21
- 'built_in_db' = "built_in_db",
22
- 'mongo' = "mongo",
23
- 'mysql' = "mysql",
24
- 'mssql' = "mssql",
25
- 'postgres' = "postgres",
26
- 'cockroach' = "cockroach",
27
- 'api' = "api",
28
- 'graphql' = "graphql",
29
- 'snowflake' = "snowflake",
30
- 'datadog' = "datadog",
31
- 'newrelic' = "newrelic",
32
- 'auth0' = "auth0",
33
- 'jwt_rsa' = "jwt_rsa",
34
- 'jwt_hmac' = "jwt_hmac",
35
- 'ai_assistant' = "ai_assistant",
36
- 'algolia' = "algolia",
37
- 'elastic_observability' = "elastic_observability",
38
- 'elastic_search' = "elastic_search",
39
- 'elastic_enterprise_search' = "elastic_enterprise_search",
40
- 'sentry' = "sentry",
41
- 'sap_hana' = "sap_hana",
42
- 'salesforce_crm' = "salesforce_crm",
43
- 'documentdb' = "documentdb",
44
- 'dynamodb' = "dynamodb",
45
- 'cassandra' = "cassandra",
46
- 'clickhouse' = "clickhouse",
47
- 'alloydb' = "alloydb",
48
- 'spanner' = "spanner",
49
- 'db2' = "db2",
50
- 'mariadb' = "mariadb",
51
- 'oracledb' = "oracledb",
52
- 'redis' = "redis",
53
- 'xata' = "xata",
54
- 'azure_sql' = "azure_sql"
55
- }
56
- export interface IntegrationConfigTypes {
57
- [IntegrationType.built_in_db]: InternalIntegrationConfig;
58
- [IntegrationType.mongo]: MongoIntegrationConfig;
59
- [IntegrationType.mysql]: MySqlIntegrationConfig;
60
- [IntegrationType.oracledb]: OracleIntegrationConfig;
61
- [IntegrationType.mssql]: MssqlIntegrationConfig;
62
- [IntegrationType.postgres]: PostgresIntegrationConfig;
63
- [IntegrationType.cockroach]: CockroachIntegrationConfig;
64
- [IntegrationType.snowflake]: SnowflakeIntegrationConfig;
65
- [IntegrationType.api]: HttpApiIntegrationConfig;
66
- [IntegrationType.graphql]: GraphQLIntegrationConfig;
67
- [IntegrationType.datadog]: DatadogIntegrationConfig;
68
- [IntegrationType.newrelic]: NewRelicIntegrationConfig;
69
- [IntegrationType.auth0]: Auth0IntegrationConfig;
70
- [IntegrationType.jwt_rsa]: JwtRsaIntegrationConfig;
71
- [IntegrationType.jwt_hmac]: JwtHmacIntegrationConfig;
72
- [IntegrationType.ai_assistant]: AiAssistantIntegrationConfig;
73
- }
74
- export declare const DatabaseIntegrationTypes: readonly [IntegrationType.built_in_db, IntegrationType.mongo, IntegrationType.mysql, IntegrationType.mssql, IntegrationType.postgres, IntegrationType.cockroach, IntegrationType.snowflake, IntegrationType.oracledb];
75
- export type DatabaseIntegrationType = (typeof DatabaseIntegrationTypes)[number];
76
- export type DatabaseIntegrationConfig = IntegrationConfigTypes[DatabaseIntegrationType];
77
- export declare const ApiIntegrationTypes: readonly [IntegrationType.api, IntegrationType.graphql];
78
- export declare const ObservabilityIntegrationTypes: readonly [IntegrationType.datadog, IntegrationType.newrelic];
79
- export declare const AuthIntegrationTypes: readonly [IntegrationType.auth0, IntegrationType.jwt_rsa, IntegrationType.jwt_hmac];
80
- export type ApiIntegrationType = (typeof ApiIntegrationTypes)[number];
81
- export type ApiIntegrationConfig = IntegrationConfigTypes[ApiIntegrationType];
82
- export type ObservabilityIntegrationType = (typeof ObservabilityIntegrationTypes)[number];
83
- export type ObservabilityIntegrationConfig = IntegrationConfigTypes[ObservabilityIntegrationType];
84
- export type AuthIntegrationType = (typeof AuthIntegrationTypes)[number];
85
- export type AuthIntegrationConfig = IntegrationConfigTypes[AuthIntegrationType];
86
- export declare function isDataIntegrationType(type: IntegrationType): type is DatabaseIntegrationType;
87
- export declare function isDataIntegration(integration: any): integration is BaseDatabaseIntegrationConfig;
88
- export declare function isAuthIntegrationType(type: IntegrationType): type is AuthIntegrationType;
89
- export declare function isAuthIntegration(integration: any): integration is AuthIntegrationConfig;
90
- export type IntegrationConfig = DatabaseIntegrationConfig | ApiIntegrationConfig | ObservabilityIntegrationConfig | AuthIntegrationConfig | AiAssistantIntegrationConfig;
91
- export interface BaseIntegrationConfig {
92
- id: IntegrationId;
93
- type: IntegrationType;
94
- creationDate: Date;
95
- updateDate: Date;
96
- }
97
- export type TestConnectionRequest = TestDataConnectionRequest | TestGraphQLDataConnectionRequest;
1
+ export * from './ai_assistant.types';
2
+ export * from './api.types';
3
+ export * from './auth.types';
4
+ export * from './database.types';
5
+ export * from './observability.types';
6
+ import { IntegrationId } from '../communication.types';
7
+ import { AiAssistantIntegrationConfig } from './ai_assistant.types';
8
+ import { GraphQLIntegrationConfig, HttpApiIntegrationConfig, TestGraphQLDataConnectionRequest } from './api.types';
9
+ import { Auth0IntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig } from './auth.types';
10
+ import { BaseDatabaseIntegrationConfig, CockroachIntegrationConfig, InternalIntegrationConfig, MongoIntegrationConfig, MssqlIntegrationConfig, MySqlIntegrationConfig, OracleIntegrationConfig, PostgresIntegrationConfig, SnowflakeIntegrationConfig, TestDataConnectionRequest } from './database.types';
11
+ import { DatadogIntegrationConfig, NewRelicIntegrationConfig } from './observability.types';
12
+ export declare enum IntegrationCategory {
13
+ 'database' = "database",
14
+ 'api' = "api",
15
+ 'observability' = "observability",
16
+ 'crm' = "crm",
17
+ 'auth' = "auth",
18
+ 'ai' = "ai"
19
+ }
20
+ export declare enum IntegrationType {
21
+ 'built_in_db' = "built_in_db",
22
+ 'mongo' = "mongo",
23
+ 'mysql' = "mysql",
24
+ 'mssql' = "mssql",
25
+ 'postgres' = "postgres",
26
+ 'cockroach' = "cockroach",
27
+ 'api' = "api",
28
+ 'graphql' = "graphql",
29
+ 'snowflake' = "snowflake",
30
+ 'datadog' = "datadog",
31
+ 'newrelic' = "newrelic",
32
+ 'auth0' = "auth0",
33
+ 'jwt_rsa' = "jwt_rsa",
34
+ 'jwt_hmac' = "jwt_hmac",
35
+ 'ai_assistant' = "ai_assistant",
36
+ 'algolia' = "algolia",
37
+ 'elastic_observability' = "elastic_observability",
38
+ 'elastic_search' = "elastic_search",
39
+ 'elastic_enterprise_search' = "elastic_enterprise_search",
40
+ 'sentry' = "sentry",
41
+ 'sap_hana' = "sap_hana",
42
+ 'salesforce_crm' = "salesforce_crm",
43
+ 'documentdb' = "documentdb",
44
+ 'dynamodb' = "dynamodb",
45
+ 'cassandra' = "cassandra",
46
+ 'clickhouse' = "clickhouse",
47
+ 'alloydb' = "alloydb",
48
+ 'spanner' = "spanner",
49
+ 'db2' = "db2",
50
+ 'mariadb' = "mariadb",
51
+ 'oracledb' = "oracledb",
52
+ 'redis' = "redis",
53
+ 'xata' = "xata",
54
+ 'azure_sql' = "azure_sql"
55
+ }
56
+ export interface IntegrationConfigTypes {
57
+ [IntegrationType.built_in_db]: InternalIntegrationConfig;
58
+ [IntegrationType.mongo]: MongoIntegrationConfig;
59
+ [IntegrationType.mysql]: MySqlIntegrationConfig;
60
+ [IntegrationType.oracledb]: OracleIntegrationConfig;
61
+ [IntegrationType.mssql]: MssqlIntegrationConfig;
62
+ [IntegrationType.postgres]: PostgresIntegrationConfig;
63
+ [IntegrationType.cockroach]: CockroachIntegrationConfig;
64
+ [IntegrationType.snowflake]: SnowflakeIntegrationConfig;
65
+ [IntegrationType.api]: HttpApiIntegrationConfig;
66
+ [IntegrationType.graphql]: GraphQLIntegrationConfig;
67
+ [IntegrationType.datadog]: DatadogIntegrationConfig;
68
+ [IntegrationType.newrelic]: NewRelicIntegrationConfig;
69
+ [IntegrationType.auth0]: Auth0IntegrationConfig;
70
+ [IntegrationType.jwt_rsa]: JwtRsaIntegrationConfig;
71
+ [IntegrationType.jwt_hmac]: JwtHmacIntegrationConfig;
72
+ [IntegrationType.ai_assistant]: AiAssistantIntegrationConfig;
73
+ }
74
+ export declare const DatabaseIntegrationTypes: readonly [IntegrationType.built_in_db, IntegrationType.mongo, IntegrationType.mysql, IntegrationType.mssql, IntegrationType.postgres, IntegrationType.cockroach, IntegrationType.snowflake, IntegrationType.oracledb];
75
+ export type DatabaseIntegrationType = (typeof DatabaseIntegrationTypes)[number];
76
+ export type DatabaseIntegrationConfig = IntegrationConfigTypes[DatabaseIntegrationType];
77
+ export declare const ApiIntegrationTypes: readonly [IntegrationType.api, IntegrationType.graphql];
78
+ export declare const ObservabilityIntegrationTypes: readonly [IntegrationType.datadog, IntegrationType.newrelic];
79
+ export declare const AuthIntegrationTypes: readonly [IntegrationType.auth0, IntegrationType.jwt_rsa, IntegrationType.jwt_hmac];
80
+ export type ApiIntegrationType = (typeof ApiIntegrationTypes)[number];
81
+ export type ApiIntegrationConfig = IntegrationConfigTypes[ApiIntegrationType];
82
+ export type ObservabilityIntegrationType = (typeof ObservabilityIntegrationTypes)[number];
83
+ export type ObservabilityIntegrationConfig = IntegrationConfigTypes[ObservabilityIntegrationType];
84
+ export type AuthIntegrationType = (typeof AuthIntegrationTypes)[number];
85
+ export type AuthIntegrationConfig = IntegrationConfigTypes[AuthIntegrationType];
86
+ export declare function isDataIntegrationType(type: IntegrationType): type is DatabaseIntegrationType;
87
+ export declare function isDataIntegration(integration: any): integration is BaseDatabaseIntegrationConfig;
88
+ export declare function isAuthIntegrationType(type: IntegrationType): type is AuthIntegrationType;
89
+ export declare function isAuthIntegration(integration: any): integration is AuthIntegrationConfig;
90
+ export type IntegrationConfig = DatabaseIntegrationConfig | ApiIntegrationConfig | ObservabilityIntegrationConfig | AuthIntegrationConfig | AiAssistantIntegrationConfig;
91
+ export interface BaseIntegrationConfig {
92
+ id: IntegrationId;
93
+ type: IntegrationType;
94
+ creationDate: Date;
95
+ updateDate: Date;
96
+ }
97
+ export type TestConnectionRequest = TestDataConnectionRequest | TestGraphQLDataConnectionRequest;
@@ -1,22 +1,22 @@
1
- import { BaseIntegrationConfig, IntegrationType } from './index';
2
- export interface DatadogIntegrationConfig extends BaseIntegrationConfig {
3
- type: IntegrationType.datadog;
4
- configuration: DatadogIntegrationConfiguration;
5
- }
6
- export interface NewRelicIntegrationConfig extends BaseIntegrationConfig {
7
- type: IntegrationType.newrelic;
8
- configuration: NewRelicIntegrationConfiguration;
9
- }
10
- export type DatadogRegion = 'us1' | 'us3' | 'us5' | 'eu1' | 'us1-fed';
11
- export declare const datadogRegionMap: Record<DatadogRegion, string>;
12
- export interface DatadogIntegrationConfiguration {
13
- apiKey: string;
14
- appKey: string;
15
- datadogRegion: DatadogRegion;
16
- }
17
- export type NewRelicRegion = 'worldwide' | 'eu';
18
- export declare const newRelicRegionMap: Record<NewRelicRegion, string>;
19
- export interface NewRelicIntegrationConfiguration {
20
- apiKey: string;
21
- newRelicRegion: NewRelicRegion;
22
- }
1
+ import { BaseIntegrationConfig, IntegrationType } from './index';
2
+ export interface DatadogIntegrationConfig extends BaseIntegrationConfig {
3
+ type: IntegrationType.datadog;
4
+ configuration: DatadogIntegrationConfiguration;
5
+ }
6
+ export interface NewRelicIntegrationConfig extends BaseIntegrationConfig {
7
+ type: IntegrationType.newrelic;
8
+ configuration: NewRelicIntegrationConfiguration;
9
+ }
10
+ export type DatadogRegion = 'us1' | 'us3' | 'us5' | 'eu1' | 'us1-fed';
11
+ export declare const datadogRegionMap: Record<DatadogRegion, string>;
12
+ export interface DatadogIntegrationConfiguration {
13
+ apiKey: string;
14
+ appKey: string;
15
+ datadogRegion: DatadogRegion;
16
+ }
17
+ export type NewRelicRegion = 'worldwide' | 'eu';
18
+ export declare const newRelicRegionMap: Record<NewRelicRegion, string>;
19
+ export interface NewRelicIntegrationConfiguration {
20
+ apiKey: string;
21
+ newRelicRegion: NewRelicRegion;
22
+ }
@@ -1,21 +1,21 @@
1
- export type LoggerContext = Record<string, any>;
2
- export interface Logger {
3
- trace(message: string, context?: LoggerContext): void;
4
- debug(message: string, context?: LoggerContext): void;
5
- info(message: string, context?: LoggerContext): void;
6
- warn(message: string, context?: LoggerContext): void;
7
- error(message: string, context?: LoggerContext): void;
8
- log(record: LogRecord): void;
9
- }
10
- export declare enum LogLevel {
11
- TRACE = "trace",
12
- DEBUG = "debug",
13
- INFO = "info",
14
- WARN = "warn",
15
- ERROR = "error"
16
- }
17
- export interface LogRecord {
18
- level?: LogLevel;
19
- message?: string;
20
- [key: string]: any;
21
- }
1
+ export type LoggerContext = Record<string, any>;
2
+ export interface Logger {
3
+ trace(message: string, context?: LoggerContext): void;
4
+ debug(message: string, context?: LoggerContext): void;
5
+ info(message: string, context?: LoggerContext): void;
6
+ warn(message: string, context?: LoggerContext): void;
7
+ error(message: string, context?: LoggerContext): void;
8
+ log(record: LogRecord): void;
9
+ }
10
+ export declare enum LogLevel {
11
+ TRACE = "trace",
12
+ DEBUG = "debug",
13
+ INFO = "info",
14
+ WARN = "warn",
15
+ ERROR = "error"
16
+ }
17
+ export interface LogRecord {
18
+ level?: LogLevel;
19
+ message?: string;
20
+ [key: string]: any;
21
+ }
@@ -1,58 +1 @@
1
- export type MetricType = 'count' | 'gauge';
2
- export type AggregationPeriod = '1m' | '5m' | '15m' | '1h' | '1d' | '1w';
3
- export declare const aggregationPeriodMap: Record<AggregationPeriod, number>;
4
- export interface CountMetricHistogramData {
5
- stepInterval: number;
6
- sumInStep: number;
7
- cumulativeSum: number;
8
- rate: number;
9
- }
10
- export interface CountMetricSummary {
11
- cumulativeRate: number;
12
- cumulativeSum: number;
13
- }
14
- export interface GaugeMetricHistogramData {
15
- stepInterval: number;
16
- sumInStep: number;
17
- countInStep: number;
18
- minInStep: number;
19
- maxInStep: number;
20
- avgInStep: number;
21
- medianInStep: number;
22
- }
23
- export interface GaugeMetricSummary {
24
- cumulativeSum: number;
25
- cumulativeMin: number;
26
- cumulativeMax: number;
27
- cumulativeAvg: number;
28
- cumulativeCount: number;
29
- }
30
- interface BaseMetricResponse {
31
- type: MetricType;
32
- }
33
- export interface CountMetricResponse extends BaseMetricResponse {
34
- type: 'count';
35
- histogram: Array<CountMetricHistogramData>;
36
- summary: CountMetricSummary;
37
- }
38
- export interface GaugeMetricResponse extends BaseMetricResponse {
39
- type: 'gauge';
40
- histogram: Array<GaugeMetricHistogramData>;
41
- summary: GaugeMetricSummary;
42
- }
43
- export type MetricResponse = CountMetricResponse | GaugeMetricResponse;
44
- export interface GetSingleMetricRequest {
45
- metricName: string;
46
- tagFilters: Record<string, string | Array<string>>;
47
- metricType: MetricType;
48
- }
49
- export interface GetMetricsRequest {
50
- requests: Array<GetSingleMetricRequest>;
51
- from: number;
52
- to: number;
53
- aggregationPeriod: AggregationPeriod;
54
- }
55
- export interface GetMetricsResponse {
56
- responses: Array<MetricResponse>;
57
- }
58
- export {};
1
+ export type MetricType = 'count' | 'gauge';
@@ -1,10 +1,12 @@
1
- import { Mutation, MutationType } from './mutation.types';
2
- import { BeforeAndAfterDocs } from './document.types';
3
- import { Paths } from './types';
4
- export declare class MutationContext<T = any> {
5
- readonly mutation: Mutation<T>;
6
- readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
7
- readonly serverTimeStamp: Date;
8
- getMutationType(): MutationType;
9
- affectsPath(path: Paths<T>): boolean;
10
- }
1
+ import { Mutation, MutationType } from './mutation.types';
2
+ import { BeforeAndAfterDocs } from './document.types';
3
+ import { Paths } from './types';
4
+ /** The mutation context that will be provided to the security function. */
5
+ export declare class MutationContext<T = any> {
6
+ readonly mutation: Mutation<T>;
7
+ readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
8
+ readonly serverTimeStamp: Date;
9
+ getMutationType(): MutationType;
10
+ /** Returns true if the mutation affects the provided path. */
11
+ affectsPath(path: Paths<T>): boolean;
12
+ }
@@ -1,5 +1 @@
1
- import { JSONSchemaType } from 'ajv';
2
- import { MutateRequest } from './mutation.types';
3
- type DocumentBase = Record<string, any>;
4
- export declare const MutationRequestSchema: JSONSchemaType<MutateRequest<DocumentBase>>;
5
- export {};
1
+ export {};
@@ -1,72 +1,53 @@
1
- import { ClientId, IntegrationId } from './communication.types';
2
- import { DocTimestamp, FieldName, SquidDocId, SquidDocIdObj, SquidDocument } from './document.types';
3
- export interface MutateRequest<T = any> {
4
- clientId: ClientId;
5
- integrationId: IntegrationId;
6
- mutations: Array<Mutation<T>>;
7
- }
8
- export interface ExecuteMutationsResponse {
9
- timestamp: DocTimestamp;
10
- idResolutionMap?: IdResolutionMap;
11
- afterDocs: Record<SquidDocId, SquidDocument>;
12
- }
13
- export interface MutateResponse extends Omit<ExecuteMutationsResponse, 'afterDocs'> {
14
- refreshList: Array<SquidDocId>;
15
- }
16
- export type IdResolutionMap = Record<SquidDocId, SquidDocId>;
17
- export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
18
- export type MutationType = 'insert' | 'update' | 'delete';
19
- interface BaseMutation {
20
- type: MutationType;
21
- squidDocIdObj: SquidDocIdObj;
22
- }
23
- export interface DeleteMutation extends BaseMutation {
24
- type: 'delete';
25
- }
26
- export interface UpdateMutation<T = any> extends BaseMutation {
27
- type: 'update';
28
- properties: {
29
- [key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
30
- };
31
- }
32
- export interface InsertMutation<T = any> extends BaseMutation {
33
- type: 'insert';
34
- properties: T;
35
- }
36
- export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
37
- export interface ValueUpdatePropertyMutation<Value = any> {
38
- type: 'update';
39
- value: Value;
40
- }
41
- export interface ApplyNumericFnPropertyMutation {
42
- type: 'applyNumericFn';
43
- fn: 'increment';
44
- value: number;
45
- }
46
- export interface RemovePropertyMutation {
47
- type: 'removeProperty';
48
- }
49
- interface ApplyExtendString {
50
- type: 'applyStringFn';
51
- fn: 'extendString';
52
- value: string;
53
- }
54
- interface ApplyTrimString {
55
- type: 'applyStringFn';
56
- fn: 'trim';
57
- }
58
- export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
59
- /**
60
- * Sorts the update mutation properties in the order the properties should be applied. If the update mutation has
61
- * updates for both 'a' and 'a.b', the update should be applied first to 'a' and then to 'a.b'.
62
- */
63
- export declare function sortUpdateMutationProperties(updateMutation: UpdateMutation): Array<[FieldName, Array<PropertyMutation>]>;
64
- export declare function mergeMutations(mutationA: Mutation, mutationB: Mutation): Mutation;
65
- export declare function applyUpdateMutation<T extends SquidDocument>(doc: T, updateMutation: UpdateMutation<T>): T | undefined;
66
- export declare function convertInsertToUpdate(insertMutation: InsertMutation): UpdateMutation;
67
- /**
68
- * Reduces the list of mutations such that each document will have a single mutation. If for example there are multiple
69
- * updates to the same document, those will be merged and a single update will be returned.
70
- */
71
- export declare function reduceMutations(mutations: Array<Mutation<unknown>>): Array<Mutation<unknown>>;
72
- export {};
1
+ import { SquidDocIdObj } from './document.types';
2
+ /** A mutation on a document. */
3
+ export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
4
+ /** The mutation type. */
5
+ export type MutationType = 'insert' | 'update' | 'delete';
6
+ interface BaseMutation {
7
+ type: MutationType;
8
+ squidDocIdObj: SquidDocIdObj;
9
+ }
10
+ export interface DeleteMutation extends BaseMutation {
11
+ type: 'delete';
12
+ }
13
+ export interface UpdateMutation<T = any> extends BaseMutation {
14
+ type: 'update';
15
+ /** The updated properties */
16
+ properties: {
17
+ [key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
18
+ };
19
+ }
20
+ export interface InsertMutation<T = any> extends BaseMutation {
21
+ type: 'insert';
22
+ /** The inserted document */
23
+ properties: T;
24
+ }
25
+ /** A representation of a single property update */
26
+ export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
27
+ /** A value update property mutation */
28
+ export interface ValueUpdatePropertyMutation<Value = any> {
29
+ type: 'update';
30
+ value: Value;
31
+ }
32
+ /** Applying a numeric function to a property */
33
+ export interface ApplyNumericFnPropertyMutation {
34
+ type: 'applyNumericFn';
35
+ fn: 'increment';
36
+ value: number;
37
+ }
38
+ /** A property update that removes a property from a document */
39
+ export interface RemovePropertyMutation {
40
+ type: 'removeProperty';
41
+ }
42
+ interface ApplyExtendString {
43
+ type: 'applyStringFn';
44
+ fn: 'extendString';
45
+ value: string;
46
+ }
47
+ interface ApplyTrimString {
48
+ type: 'applyStringFn';
49
+ fn: 'trim';
50
+ }
51
+ /** A property mutation that modifies a string */
52
+ export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
53
+ export {};
@@ -1,4 +1,4 @@
1
- export declare class NamedQueryContext {
2
- readonly params: Record<string, any>;
3
- constructor(params: Record<string, any>);
4
- }
1
+ /** The context provided to the secure named query function. */
2
+ export declare class NamedQueryContext {
3
+ readonly params: Record<string, any>;
4
+ }
@@ -1,3 +1 @@
1
- import { JSONSchemaType } from 'ajv';
2
- import { ExecuteNamedQueryRequest } from './named-query.types';
3
- export declare const ExecuteNamedQueryRequestSchema: JSONSchemaType<ExecuteNamedQueryRequest>;
1
+ export {};
@@ -1,9 +1 @@
1
- import { ClientId, ClientRequestId, IntegrationId } from './communication.types';
2
- import { QueryName } from './application.types';
3
- export interface ExecuteNamedQueryRequest {
4
- integrationId: IntegrationId;
5
- queryName: QueryName;
6
- paramsRecordStr: string;
7
- clientRequestId: ClientRequestId;
8
- clientId: ClientId;
9
- }
1
+ export {};
@@ -1,2 +1,2 @@
1
- export * from './query-context';
2
- export * from './simple-query-builder';
1
+ export * from './query-context';
2
+ export * from './simple-query-builder';
@@ -1,37 +1,37 @@
1
- import { IntegrationId } from '../communication.types';
2
- import { CollectionName, FieldName } from '../document.types';
3
- import { AllOperators, ContextCondition, ContextConditions, FieldSort, GeneralCondition, GeneralConditions, GenericValue, Query } from '../query.types';
4
- import { PartialBy, Paths } from '../types';
5
- export declare class QueryContext<T = any> {
6
- readonly query: Query<T>;
7
- private readonly parsedConditions;
8
- get integrationId(): IntegrationId;
9
- get collectionName(): CollectionName;
10
- get limit(): number;
11
- sortedBy(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
12
- sortedByExact(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
13
- includes<F extends FieldName<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O>): boolean;
14
- includesCondition(condition: ContextCondition<T>): boolean;
15
- includesConditions(conditions: GeneralConditions<T>): boolean;
16
- matchesConditions(conditions: GeneralConditions<T>): boolean;
17
- matchesQuery(query: Query<T>): boolean;
18
- isSubsetOf<F extends FieldName<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O> | null): boolean;
19
- isSubsetOfCondition(condition: GeneralCondition<T>): boolean;
20
- isSubsetOfConditions(conditions: GeneralConditions<T>): boolean;
21
- isSubsetOfQuery(query: Query<T>): boolean;
22
- getConditionsFor<K extends FieldName<T>>(...fieldNames: K[]): ContextConditions<T, K>;
23
- getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
24
- /**
25
- * Compares a condition against a given operator and value to determine if the
26
- * provided condition is a subset of the operator and value. A condition is
27
- * considered a subset if all values that satisfy (return true for) the
28
- * condition also satisfy the operator and value.
29
- *
30
- * This is done using the underlying CompareTable, which provides a comparison
31
- * function for each operator pair, or undefined if the comparison would
32
- * always be false, regardless of the values.
33
- */
34
- private evaluateSubset;
35
- private evaluateIncludes;
36
- private parseConditions;
37
- }
1
+ import { IntegrationId } from '../communication.types';
2
+ import { CollectionName, FieldName } from '../document.types';
3
+ import { AllOperators, ContextCondition, ContextConditions, FieldSort, GeneralCondition, GeneralConditions, GenericValue, Query } from '../query.types';
4
+ import { PartialBy, Paths } from '../types';
5
+ export declare class QueryContext<T = any> {
6
+ readonly query: Query<T>;
7
+ private readonly parsedConditions;
8
+ get integrationId(): IntegrationId;
9
+ get collectionName(): CollectionName;
10
+ get limit(): number;
11
+ sortedBy(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
12
+ sortedByExact(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
13
+ includes<F extends FieldName<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O>): boolean;
14
+ includesCondition(condition: ContextCondition<T>): boolean;
15
+ includesConditions(conditions: GeneralConditions<T>): boolean;
16
+ matchesConditions(conditions: GeneralConditions<T>): boolean;
17
+ matchesQuery(query: Query<T>): boolean;
18
+ isSubsetOf<F extends FieldName<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O> | null): boolean;
19
+ isSubsetOfCondition(condition: GeneralCondition<T>): boolean;
20
+ isSubsetOfConditions(conditions: GeneralConditions<T>): boolean;
21
+ isSubsetOfQuery(query: Query<T>): boolean;
22
+ getConditionsFor<K extends FieldName<T>>(...fieldNames: K[]): ContextConditions<T, K>;
23
+ getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
24
+ /**
25
+ * Compares a condition against a given operator and value to determine if the
26
+ * provided condition is a subset of the operator and value. A condition is
27
+ * considered a subset if all values that satisfy (return true for) the
28
+ * condition also satisfy the operator and value.
29
+ *
30
+ * This is done using the underlying CompareTable, which provides a comparison
31
+ * function for each operator pair, or undefined if the comparison would
32
+ * always be false, regardless of the values.
33
+ */
34
+ private evaluateSubset;
35
+ private evaluateIncludes;
36
+ private parseConditions;
37
+ }