@squidcloud/client 1.0.63 → 1.0.64
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/common/src/ai-assistant.context.d.ts +11 -11
- package/dist/common/src/ai-assistant.schemas.d.ts +210 -210
- package/dist/common/src/ai-assistant.types.d.ts +81 -81
- package/dist/common/src/api-call.context.d.ts +12 -12
- package/dist/common/src/api.types.d.ts +24 -24
- package/dist/common/src/application.schemas.d.ts +1060 -1060
- package/dist/common/src/application.types.d.ts +224 -224
- package/dist/common/src/auth.types.d.ts +4 -4
- package/dist/common/src/backend-function.schemas.d.ts +3 -3
- package/dist/common/src/backend-function.types.d.ts +7 -7
- package/dist/common/src/backend-run.types.d.ts +53 -53
- package/dist/common/src/bundle-api.types.d.ts +68 -68
- package/dist/common/src/bundle-data.types.d.ts +59 -59
- package/dist/common/src/communication.types.d.ts +4 -4
- package/dist/common/src/context.types.d.ts +32 -32
- package/dist/common/src/distributed-lock.context.d.ts +5 -5
- package/dist/common/src/document.types.d.ts +37 -37
- package/dist/common/src/graphql.context.d.ts +6 -6
- package/dist/common/src/graphql.types.d.ts +11 -11
- package/dist/common/src/http-status.enum.d.ts +50 -50
- package/dist/common/src/index.d.ts +54 -54
- package/dist/common/src/integrations/ai_assistant.types.d.ts +30 -30
- package/dist/common/src/integrations/api.types.d.ts +80 -80
- package/dist/common/src/integrations/auth.types.d.ts +22 -22
- package/dist/common/src/integrations/database.types.d.ts +236 -236
- package/dist/common/src/integrations/index.d.ts +97 -97
- package/dist/common/src/integrations/observability.types.d.ts +22 -22
- package/dist/common/src/logger.types.d.ts +21 -21
- package/dist/common/src/metrics.types.d.ts +58 -58
- package/dist/common/src/mutation.context.d.ts +10 -10
- package/dist/common/src/mutation.schemas.d.ts +5 -5
- package/dist/common/src/mutation.types.d.ts +72 -72
- package/dist/common/src/named-query.context.d.ts +4 -4
- package/dist/common/src/named-query.schemas.d.ts +3 -3
- package/dist/common/src/named-query.types.d.ts +9 -9
- package/dist/common/src/query/index.d.ts +2 -2
- package/dist/common/src/query/query-context.d.ts +37 -37
- package/dist/common/src/query/simple-query-builder.d.ts +137 -137
- package/dist/common/src/query.schemas.d.ts +5 -5
- package/dist/common/src/query.types.d.ts +118 -118
- package/dist/common/src/regions.d.ts +22 -22
- package/dist/common/src/schema/schema.types.d.ts +54 -54
- package/dist/common/src/secret.schemas.d.ts +6 -6
- package/dist/common/src/secret.types.d.ts +49 -49
- package/dist/common/src/security.types.d.ts +3 -3
- package/dist/common/src/socket.schemas.d.ts +3 -3
- package/dist/common/src/socket.types.d.ts +108 -108
- package/dist/common/src/time-units.d.ts +5 -5
- package/dist/common/src/trigger.types.d.ts +15 -15
- package/dist/common/src/types.d.ts +15 -15
- package/dist/common/src/utils/array.d.ts +8 -8
- package/dist/common/src/utils/assert.d.ts +8 -8
- package/dist/common/src/utils/error.d.ts +4 -4
- package/dist/common/src/utils/http.d.ts +2 -2
- package/dist/common/src/utils/id.d.ts +2 -2
- package/dist/common/src/utils/lock.manager.d.ts +14 -14
- package/dist/common/src/utils/nullish.d.ts +1 -1
- package/dist/common/src/utils/object.d.ts +6 -6
- package/dist/common/src/utils/serialization.d.ts +6 -6
- package/dist/common/src/utils/transforms.d.ts +18 -18
- package/dist/common/src/utils/url.d.ts +1 -1
- package/dist/common/src/utils/validation.d.ts +30 -30
- package/dist/common/src/webhook-response.d.ts +7 -7
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
- package/dist/typescript-client/src/ai-assistant-client.d.ts +66 -66
- package/dist/typescript-client/src/ai-client.factory.d.ts +13 -13
- package/dist/typescript-client/src/api.manager.d.ts +15 -15
- package/dist/typescript-client/src/auth.manager.d.ts +23 -23
- package/dist/typescript-client/src/backend-function.manager.d.ts +13 -13
- package/dist/typescript-client/src/client-id.service.d.ts +24 -24
- package/dist/typescript-client/src/collection-reference.d.ts +81 -81
- package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -16
- package/dist/typescript-client/src/data.manager.d.ts +172 -172
- package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +19 -19
- package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
- package/dist/typescript-client/src/document-reference.d.ts +134 -134
- package/dist/typescript-client/src/document-reference.factory.d.ts +9 -9
- package/dist/typescript-client/src/document-store.d.ts +11 -11
- package/dist/typescript-client/src/graphql-client.d.ts +12 -12
- package/dist/typescript-client/src/graphql-client.factory.d.ts +9 -9
- package/dist/typescript-client/src/index.d.ts +8 -8
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +12 -12
- package/dist/typescript-client/src/named-query.manager.d.ts +14 -14
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +72 -72
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +83 -83
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +64 -64
- package/dist/typescript-client/src/query/query.types.d.ts +14 -14
- package/dist/typescript-client/src/rpc.manager.d.ts +28 -28
- package/dist/typescript-client/src/socket.manager.d.ts +32 -32
- package/dist/typescript-client/src/squid.d.ts +188 -188
- package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
- package/dist/typescript-client/src/state/actions.d.ts +29 -29
- package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
- package/dist/typescript-client/src/state/state.service.d.ts +22 -22
- package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
- package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
- package/dist/typescript-client/src/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export type SquidCloudId = 'aws' | 'gcp' | 'azure';
|
|
2
|
-
/** The list of supported Squid regions. */
|
|
3
|
-
export type SupportedSquidRegion = 'us-east-1.aws' | 'local';
|
|
4
|
-
export declare const supportedSquidRegions: Array<SupportedSquidRegion>;
|
|
5
|
-
export interface SquidCloudRegion {
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
}
|
|
9
|
-
export interface SquidSupportedCloud {
|
|
10
|
-
id: SquidCloudId;
|
|
11
|
-
name: string;
|
|
12
|
-
icon: string;
|
|
13
|
-
regions: Array<SquidCloudRegion>;
|
|
14
|
-
tooltip?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const squidSupportedRegionMap: Record<SupportedSquidRegion, SquidCloudRegion>;
|
|
17
|
-
export declare function getSquidSupportedCloudMap(isLocal?: boolean): Record<SquidCloudId, SquidSupportedCloud>;
|
|
18
|
-
export declare function convertToSquidRegion(cloudId: SquidCloudId, region: string): SupportedSquidRegion;
|
|
19
|
-
export declare function convertFromSquidRegion(regionAndCloud: SupportedSquidRegion): {
|
|
20
|
-
cloudId: SquidCloudId;
|
|
21
|
-
region: string;
|
|
22
|
-
};
|
|
1
|
+
export type SquidCloudId = 'aws' | 'gcp' | 'azure';
|
|
2
|
+
/** The list of supported Squid regions. */
|
|
3
|
+
export type SupportedSquidRegion = 'us-east-1.aws' | 'local';
|
|
4
|
+
export declare const supportedSquidRegions: Array<SupportedSquidRegion>;
|
|
5
|
+
export interface SquidCloudRegion {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SquidSupportedCloud {
|
|
10
|
+
id: SquidCloudId;
|
|
11
|
+
name: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
regions: Array<SquidCloudRegion>;
|
|
14
|
+
tooltip?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const squidSupportedRegionMap: Record<SupportedSquidRegion, SquidCloudRegion>;
|
|
17
|
+
export declare function getSquidSupportedCloudMap(isLocal?: boolean): Record<SquidCloudId, SquidSupportedCloud>;
|
|
18
|
+
export declare function convertToSquidRegion(cloudId: SquidCloudId, region: string): SupportedSquidRegion;
|
|
19
|
+
export declare function convertFromSquidRegion(regionAndCloud: SupportedSquidRegion): {
|
|
20
|
+
cloudId: SquidCloudId;
|
|
21
|
+
region: string;
|
|
22
|
+
};
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { JSONSchema } from 'json-schema-typed';
|
|
2
|
-
export type FieldPlaceholder = '__SQUID_SERVER_TIMESTAMP__' | '__SQUID_CLIENT_IP__' | '__SQUID_USER_ID__' | '__SQUID_API_KEY__';
|
|
3
|
-
export type BasicFieldType = 'string' | 'integer' | 'number' | 'boolean' | 'map' | 'array' | 'any';
|
|
4
|
-
export type CustomFieldType = 'date' | 'json';
|
|
5
|
-
export type SupportedFieldType = BasicFieldType | CustomFieldType;
|
|
6
|
-
export declare const SUPPORTED_FIELD_TYPES_ARRAY: Array<SupportedFieldType>;
|
|
7
|
-
type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
|
|
8
|
-
properties?: Record<string, ConvertDeep<JSONSchema>>;
|
|
9
|
-
patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
|
|
10
|
-
nullable?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* The default value will be applied (default to 'empty'):
|
|
13
|
-
* 'always' - no matter what the client sent, both on update and insert. In case of readOnly - applies only on insert.
|
|
14
|
-
* 'empty' - only if the value of the filed is empty (undefined)
|
|
15
|
-
* 'updateOrEmpty' - no matter what the client sent, updating the record will use the default value
|
|
16
|
-
*/
|
|
17
|
-
applyDefaultValueOn?: 'always' | 'empty' | 'updateOrEmpty';
|
|
18
|
-
isDate?: boolean;
|
|
19
|
-
isJSON?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Applies to the top level schema, a record in a nested object, or a regular property.
|
|
22
|
-
* Basically, whether this property can participate in an insert mutation.
|
|
23
|
-
*/
|
|
24
|
-
insertable?: boolean;
|
|
25
|
-
/** Applies to the top level schema or a record in a nested object. */
|
|
26
|
-
deletable?: boolean;
|
|
27
|
-
};
|
|
28
|
-
export type PropertySchema = ConvertDeep<JSONSchema>;
|
|
29
|
-
export type TopLevelPropertySchema = PropertySchema & {
|
|
30
|
-
primaryKey?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the property is computed based on other properties or some formula.
|
|
33
|
-
* If true, readonly also needs to be true and this field should not be part of an insert statement.
|
|
34
|
-
*/
|
|
35
|
-
isComputed?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Whether the default value generated by the database. CURRENT_DATE is something generated by the database vs
|
|
38
|
-
* 'Hello' which is a constant.
|
|
39
|
-
*/
|
|
40
|
-
isDefaultComputed?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* The database data type that is represented by this property. This is often different from the actual property
|
|
43
|
-
* type, with is a Javascript primitive. For example, for a SMALLINT the dataType would be 'smallint', but the type
|
|
44
|
-
* would be 'integer'.
|
|
45
|
-
*/
|
|
46
|
-
dataType?: string;
|
|
47
|
-
};
|
|
48
|
-
export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
|
|
49
|
-
properties?: Record<string, TopLevelPropertySchema>;
|
|
50
|
-
};
|
|
51
|
-
export declare function compileSchema<S extends CollectionSchema>(schema: S): any;
|
|
52
|
-
export declare function validateSchema<S extends CollectionSchema>(schema: S, data: any, updatedPaths?: Array<string>, dataBefore?: any): void;
|
|
53
|
-
export declare function findMatchingPropertiesForKey<S extends CollectionSchema | PropertySchema>(schema: S, key: string): Array<PropertySchema>;
|
|
54
|
-
export {};
|
|
1
|
+
import { JSONSchema } from 'json-schema-typed';
|
|
2
|
+
export type FieldPlaceholder = '__SQUID_SERVER_TIMESTAMP__' | '__SQUID_CLIENT_IP__' | '__SQUID_USER_ID__' | '__SQUID_API_KEY__';
|
|
3
|
+
export type BasicFieldType = 'string' | 'integer' | 'number' | 'boolean' | 'map' | 'array' | 'any';
|
|
4
|
+
export type CustomFieldType = 'date' | 'json';
|
|
5
|
+
export type SupportedFieldType = BasicFieldType | CustomFieldType;
|
|
6
|
+
export declare const SUPPORTED_FIELD_TYPES_ARRAY: Array<SupportedFieldType>;
|
|
7
|
+
type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
|
|
8
|
+
properties?: Record<string, ConvertDeep<JSONSchema>>;
|
|
9
|
+
patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
|
|
10
|
+
nullable?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The default value will be applied (default to 'empty'):
|
|
13
|
+
* 'always' - no matter what the client sent, both on update and insert. In case of readOnly - applies only on insert.
|
|
14
|
+
* 'empty' - only if the value of the filed is empty (undefined)
|
|
15
|
+
* 'updateOrEmpty' - no matter what the client sent, updating the record will use the default value
|
|
16
|
+
*/
|
|
17
|
+
applyDefaultValueOn?: 'always' | 'empty' | 'updateOrEmpty';
|
|
18
|
+
isDate?: boolean;
|
|
19
|
+
isJSON?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Applies to the top level schema, a record in a nested object, or a regular property.
|
|
22
|
+
* Basically, whether this property can participate in an insert mutation.
|
|
23
|
+
*/
|
|
24
|
+
insertable?: boolean;
|
|
25
|
+
/** Applies to the top level schema or a record in a nested object. */
|
|
26
|
+
deletable?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type PropertySchema = ConvertDeep<JSONSchema>;
|
|
29
|
+
export type TopLevelPropertySchema = PropertySchema & {
|
|
30
|
+
primaryKey?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the property is computed based on other properties or some formula.
|
|
33
|
+
* If true, readonly also needs to be true and this field should not be part of an insert statement.
|
|
34
|
+
*/
|
|
35
|
+
isComputed?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the default value generated by the database. CURRENT_DATE is something generated by the database vs
|
|
38
|
+
* 'Hello' which is a constant.
|
|
39
|
+
*/
|
|
40
|
+
isDefaultComputed?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The database data type that is represented by this property. This is often different from the actual property
|
|
43
|
+
* type, with is a Javascript primitive. For example, for a SMALLINT the dataType would be 'smallint', but the type
|
|
44
|
+
* would be 'integer'.
|
|
45
|
+
*/
|
|
46
|
+
dataType?: string;
|
|
47
|
+
};
|
|
48
|
+
export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
|
|
49
|
+
properties?: Record<string, TopLevelPropertySchema>;
|
|
50
|
+
};
|
|
51
|
+
export declare function compileSchema<S extends CollectionSchema>(schema: S): any;
|
|
52
|
+
export declare function validateSchema<S extends CollectionSchema>(schema: S, data: any, updatedPaths?: Array<string>, dataBefore?: any): void;
|
|
53
|
+
export declare function findMatchingPropertiesForKey<S extends CollectionSchema | PropertySchema>(schema: S, key: string): Array<PropertySchema>;
|
|
54
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JSONSchemaType } from 'ajv';
|
|
2
|
-
import { DeleteApiKeyRequest, DeleteCustomSecretRequest, GenerateNewApiKeyRequest, SetCustomSecretRequest } from './secret.types';
|
|
3
|
-
export declare const SetCustomSecretRequestSchema: JSONSchemaType<SetCustomSecretRequest>;
|
|
4
|
-
export declare const DeleteCustomSecretRequestSchema: JSONSchemaType<DeleteCustomSecretRequest>;
|
|
5
|
-
export declare const DeleteApiKeyRequestSchema: JSONSchemaType<DeleteApiKeyRequest>;
|
|
6
|
-
export declare const GenerateNewApiKeyRequestSchema: JSONSchemaType<GenerateNewApiKeyRequest>;
|
|
1
|
+
import { JSONSchemaType } from 'ajv';
|
|
2
|
+
import { DeleteApiKeyRequest, DeleteCustomSecretRequest, GenerateNewApiKeyRequest, SetCustomSecretRequest } from './secret.types';
|
|
3
|
+
export declare const SetCustomSecretRequestSchema: JSONSchemaType<SetCustomSecretRequest>;
|
|
4
|
+
export declare const DeleteCustomSecretRequestSchema: JSONSchemaType<DeleteCustomSecretRequest>;
|
|
5
|
+
export declare const DeleteApiKeyRequestSchema: JSONSchemaType<DeleteApiKeyRequest>;
|
|
6
|
+
export declare const GenerateNewApiKeyRequestSchema: JSONSchemaType<GenerateNewApiKeyRequest>;
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/** The secret key, an alias for a string. */
|
|
2
|
-
export type SecretKey = string;
|
|
3
|
-
/** The secret value. */
|
|
4
|
-
export type SecretValue = string | number | boolean;
|
|
5
|
-
export type SecretTimestamp = number;
|
|
6
|
-
export type ApiKeyName = string;
|
|
7
|
-
export type ApiKey = string;
|
|
8
|
-
export interface ApplicationSecrets {
|
|
9
|
-
custom: Record<SecretKey, SecretEntry>;
|
|
10
|
-
apiKeys: Record<SecretKey, SecretEntry>;
|
|
11
|
-
}
|
|
12
|
-
export interface SystemSecrets {
|
|
13
|
-
sharedMongo: {
|
|
14
|
-
password: string;
|
|
15
|
-
};
|
|
16
|
-
datadog: {
|
|
17
|
-
appKey: string;
|
|
18
|
-
apiKey: string;
|
|
19
|
-
};
|
|
20
|
-
openai: {
|
|
21
|
-
apiKey: string;
|
|
22
|
-
};
|
|
23
|
-
pinecone: {
|
|
24
|
-
apiKey: string;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export interface SecretMetadata {
|
|
28
|
-
key: SecretKey;
|
|
29
|
-
lastUpdated: SecretTimestamp;
|
|
30
|
-
}
|
|
31
|
-
export interface SecretEntry extends SecretMetadata {
|
|
32
|
-
value: SecretValue;
|
|
33
|
-
}
|
|
34
|
-
export type SetCustomSecretRequest = Omit<SecretEntry, 'lastUpdated'>;
|
|
35
|
-
export interface DeleteCustomSecretRequest {
|
|
36
|
-
key: SecretKey;
|
|
37
|
-
}
|
|
38
|
-
export interface GetApiKeyResponse {
|
|
39
|
-
apiKey: string | undefined;
|
|
40
|
-
}
|
|
41
|
-
export type DeleteApiKeyRequest = Pick<SecretMetadata, 'key'>;
|
|
42
|
-
export interface ListApplicationSecretMetadataResponse {
|
|
43
|
-
custom: SecretMetadata[];
|
|
44
|
-
apiKeys: SecretMetadata[];
|
|
45
|
-
}
|
|
46
|
-
export type GenerateNewApiKeyRequest = Pick<SecretMetadata, 'key'>;
|
|
47
|
-
export interface GenerateNewApiKeyResponse {
|
|
48
|
-
apiKey: string;
|
|
49
|
-
}
|
|
1
|
+
/** The secret key, an alias for a string. */
|
|
2
|
+
export type SecretKey = string;
|
|
3
|
+
/** The secret value. */
|
|
4
|
+
export type SecretValue = string | number | boolean;
|
|
5
|
+
export type SecretTimestamp = number;
|
|
6
|
+
export type ApiKeyName = string;
|
|
7
|
+
export type ApiKey = string;
|
|
8
|
+
export interface ApplicationSecrets {
|
|
9
|
+
custom: Record<SecretKey, SecretEntry>;
|
|
10
|
+
apiKeys: Record<SecretKey, SecretEntry>;
|
|
11
|
+
}
|
|
12
|
+
export interface SystemSecrets {
|
|
13
|
+
sharedMongo: {
|
|
14
|
+
password: string;
|
|
15
|
+
};
|
|
16
|
+
datadog: {
|
|
17
|
+
appKey: string;
|
|
18
|
+
apiKey: string;
|
|
19
|
+
};
|
|
20
|
+
openai: {
|
|
21
|
+
apiKey: string;
|
|
22
|
+
};
|
|
23
|
+
pinecone: {
|
|
24
|
+
apiKey: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface SecretMetadata {
|
|
28
|
+
key: SecretKey;
|
|
29
|
+
lastUpdated: SecretTimestamp;
|
|
30
|
+
}
|
|
31
|
+
export interface SecretEntry extends SecretMetadata {
|
|
32
|
+
value: SecretValue;
|
|
33
|
+
}
|
|
34
|
+
export type SetCustomSecretRequest = Omit<SecretEntry, 'lastUpdated'>;
|
|
35
|
+
export interface DeleteCustomSecretRequest {
|
|
36
|
+
key: SecretKey;
|
|
37
|
+
}
|
|
38
|
+
export interface GetApiKeyResponse {
|
|
39
|
+
apiKey: string | undefined;
|
|
40
|
+
}
|
|
41
|
+
export type DeleteApiKeyRequest = Pick<SecretMetadata, 'key'>;
|
|
42
|
+
export interface ListApplicationSecretMetadataResponse {
|
|
43
|
+
custom: SecretMetadata[];
|
|
44
|
+
apiKeys: SecretMetadata[];
|
|
45
|
+
}
|
|
46
|
+
export type GenerateNewApiKeyRequest = Pick<SecretMetadata, 'key'>;
|
|
47
|
+
export interface GenerateNewApiKeyResponse {
|
|
48
|
+
apiKey: string;
|
|
49
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface SecureNamedQueryRequest {
|
|
2
|
-
params: Record<string, any>;
|
|
3
|
-
}
|
|
1
|
+
export interface SecureNamedQueryRequest {
|
|
2
|
+
params: Record<string, any>;
|
|
3
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JSONSchemaType } from 'ajv';
|
|
2
|
-
import { MessageFromClient } from './socket.types';
|
|
3
|
-
export declare const MessageFromClientSchema: JSONSchemaType<MessageFromClient>;
|
|
1
|
+
import { JSONSchemaType } from 'ajv';
|
|
2
|
+
import { MessageFromClient } from './socket.types';
|
|
3
|
+
export declare const MessageFromClientSchema: JSONSchemaType<MessageFromClient>;
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
import { ClientId, ClientRequestId, IntegrationId } from './communication.types';
|
|
2
|
-
import { AuthToken } from './context.types';
|
|
3
|
-
import { CollectionName, DocTimestamp, SquidDocId, SquidDocument } from './document.types';
|
|
4
|
-
import { MutationType } from './mutation.types';
|
|
5
|
-
export type MessageId = string;
|
|
6
|
-
export type MessageFromClientType = 'acknowledge' | 'catchup' | 'kill' | 'acquireLock' | 'releaseLock';
|
|
7
|
-
interface BaseMessageFromClient {
|
|
8
|
-
type: MessageFromClientType;
|
|
9
|
-
authToken?: AuthToken;
|
|
10
|
-
payload?: unknown;
|
|
11
|
-
}
|
|
12
|
-
export interface AcknowledgeMessage extends BaseMessageFromClient {
|
|
13
|
-
type: 'acknowledge';
|
|
14
|
-
payload: Array<MessageId>;
|
|
15
|
-
}
|
|
16
|
-
export interface CatchupMessage extends BaseMessageFromClient {
|
|
17
|
-
type: 'catchup';
|
|
18
|
-
}
|
|
19
|
-
export interface KillMessage extends BaseMessageFromClient {
|
|
20
|
-
type: 'kill';
|
|
21
|
-
}
|
|
22
|
-
export interface AcquireLockMessage extends BaseMessageFromClient {
|
|
23
|
-
type: 'acquireLock';
|
|
24
|
-
payload: {
|
|
25
|
-
mutex: string;
|
|
26
|
-
exclusive: boolean;
|
|
27
|
-
clientRequestId: ClientRequestId;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export interface ReleaseLockMessage extends BaseMessageFromClient {
|
|
31
|
-
type: 'releaseLock';
|
|
32
|
-
payload: {
|
|
33
|
-
lockId: string;
|
|
34
|
-
clientRequestId: ClientRequestId;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
export type MessageFromClient = AcknowledgeMessage | CatchupMessage | KillMessage | AcquireLockMessage | ReleaseLockMessage;
|
|
38
|
-
export type MessageToClientType = 'mutations' | 'query' | 'backendFunction' | 'api' | 'namedQuery' | 'lockAcquired' | 'lockReleased' | 'aiAssistant';
|
|
39
|
-
interface BaseMessageToClient {
|
|
40
|
-
type: MessageToClientType;
|
|
41
|
-
messageId: MessageId;
|
|
42
|
-
payload: unknown;
|
|
43
|
-
}
|
|
44
|
-
export interface BackendFunctionMessageToClient extends BaseMessageToClient {
|
|
45
|
-
type: 'backendFunction';
|
|
46
|
-
clientRequestId: ClientRequestId;
|
|
47
|
-
payload: string;
|
|
48
|
-
}
|
|
49
|
-
export interface NamedQueryMessageToClient extends BaseMessageToClient {
|
|
50
|
-
type: 'namedQuery';
|
|
51
|
-
clientRequestId: ClientRequestId;
|
|
52
|
-
payload: string;
|
|
53
|
-
}
|
|
54
|
-
export interface ApiResponseMessageToClient extends BaseMessageToClient {
|
|
55
|
-
type: 'api';
|
|
56
|
-
clientRequestId: ClientRequestId;
|
|
57
|
-
success: boolean;
|
|
58
|
-
httpStatus: number;
|
|
59
|
-
payload: string;
|
|
60
|
-
}
|
|
61
|
-
export interface LockAcquiredResponseMessageToClient extends BaseMessageToClient {
|
|
62
|
-
type: 'lockAcquired';
|
|
63
|
-
payload: {
|
|
64
|
-
clientRequestId: ClientRequestId;
|
|
65
|
-
lockId: string | undefined;
|
|
66
|
-
error?: string;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export interface LockReleasedResponseMessageToClient extends BaseMessageToClient {
|
|
70
|
-
type: 'lockReleased';
|
|
71
|
-
payload: {
|
|
72
|
-
clientRequestId: ClientRequestId;
|
|
73
|
-
lockId: string;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
export interface AiAssistantMessageToClient extends BaseMessageToClient {
|
|
77
|
-
type: 'aiAssistant';
|
|
78
|
-
clientRequestId: ClientRequestId;
|
|
79
|
-
payload: {
|
|
80
|
-
token: string;
|
|
81
|
-
complete: boolean;
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
export type MessageToClient = MutationsMessageToClient | QueryResultMessageToClient | BackendFunctionMessageToClient | NamedQueryMessageToClient | ApiResponseMessageToClient | LockAcquiredResponseMessageToClient | LockReleasedResponseMessageToClient | AiAssistantMessageToClient;
|
|
85
|
-
export interface MutationsMessageToClient extends BaseMessageToClient {
|
|
86
|
-
type: 'mutations';
|
|
87
|
-
payload: Array<MutationResultData>;
|
|
88
|
-
}
|
|
89
|
-
export interface MutationResultData {
|
|
90
|
-
squidDocId: SquidDocId;
|
|
91
|
-
clientRequestId: ClientRequestId;
|
|
92
|
-
mutationType: MutationType;
|
|
93
|
-
mutationTimestamp: DocTimestamp;
|
|
94
|
-
doc: SquidDocument | undefined;
|
|
95
|
-
}
|
|
96
|
-
export interface QueryResultData {
|
|
97
|
-
docs: Array<SquidDocument>;
|
|
98
|
-
integrationId: IntegrationId;
|
|
99
|
-
collectionName: CollectionName;
|
|
100
|
-
clientRequestId: ClientRequestId;
|
|
101
|
-
}
|
|
102
|
-
export interface QueryResultMessageToClient extends BaseMessageToClient {
|
|
103
|
-
type: 'query';
|
|
104
|
-
payload: QueryResultData;
|
|
105
|
-
}
|
|
106
|
-
export type PendingMessage = Omit<MessageToClient, 'messageId'>;
|
|
107
|
-
export type PendingMessages = Record<ClientId, Array<PendingMessage>>;
|
|
108
|
-
export {};
|
|
1
|
+
import { ClientId, ClientRequestId, IntegrationId } from './communication.types';
|
|
2
|
+
import { AuthToken } from './context.types';
|
|
3
|
+
import { CollectionName, DocTimestamp, SquidDocId, SquidDocument } from './document.types';
|
|
4
|
+
import { MutationType } from './mutation.types';
|
|
5
|
+
export type MessageId = string;
|
|
6
|
+
export type MessageFromClientType = 'acknowledge' | 'catchup' | 'kill' | 'acquireLock' | 'releaseLock';
|
|
7
|
+
interface BaseMessageFromClient {
|
|
8
|
+
type: MessageFromClientType;
|
|
9
|
+
authToken?: AuthToken;
|
|
10
|
+
payload?: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface AcknowledgeMessage extends BaseMessageFromClient {
|
|
13
|
+
type: 'acknowledge';
|
|
14
|
+
payload: Array<MessageId>;
|
|
15
|
+
}
|
|
16
|
+
export interface CatchupMessage extends BaseMessageFromClient {
|
|
17
|
+
type: 'catchup';
|
|
18
|
+
}
|
|
19
|
+
export interface KillMessage extends BaseMessageFromClient {
|
|
20
|
+
type: 'kill';
|
|
21
|
+
}
|
|
22
|
+
export interface AcquireLockMessage extends BaseMessageFromClient {
|
|
23
|
+
type: 'acquireLock';
|
|
24
|
+
payload: {
|
|
25
|
+
mutex: string;
|
|
26
|
+
exclusive: boolean;
|
|
27
|
+
clientRequestId: ClientRequestId;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface ReleaseLockMessage extends BaseMessageFromClient {
|
|
31
|
+
type: 'releaseLock';
|
|
32
|
+
payload: {
|
|
33
|
+
lockId: string;
|
|
34
|
+
clientRequestId: ClientRequestId;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export type MessageFromClient = AcknowledgeMessage | CatchupMessage | KillMessage | AcquireLockMessage | ReleaseLockMessage;
|
|
38
|
+
export type MessageToClientType = 'mutations' | 'query' | 'backendFunction' | 'api' | 'namedQuery' | 'lockAcquired' | 'lockReleased' | 'aiAssistant';
|
|
39
|
+
interface BaseMessageToClient {
|
|
40
|
+
type: MessageToClientType;
|
|
41
|
+
messageId: MessageId;
|
|
42
|
+
payload: unknown;
|
|
43
|
+
}
|
|
44
|
+
export interface BackendFunctionMessageToClient extends BaseMessageToClient {
|
|
45
|
+
type: 'backendFunction';
|
|
46
|
+
clientRequestId: ClientRequestId;
|
|
47
|
+
payload: string;
|
|
48
|
+
}
|
|
49
|
+
export interface NamedQueryMessageToClient extends BaseMessageToClient {
|
|
50
|
+
type: 'namedQuery';
|
|
51
|
+
clientRequestId: ClientRequestId;
|
|
52
|
+
payload: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ApiResponseMessageToClient extends BaseMessageToClient {
|
|
55
|
+
type: 'api';
|
|
56
|
+
clientRequestId: ClientRequestId;
|
|
57
|
+
success: boolean;
|
|
58
|
+
httpStatus: number;
|
|
59
|
+
payload: string;
|
|
60
|
+
}
|
|
61
|
+
export interface LockAcquiredResponseMessageToClient extends BaseMessageToClient {
|
|
62
|
+
type: 'lockAcquired';
|
|
63
|
+
payload: {
|
|
64
|
+
clientRequestId: ClientRequestId;
|
|
65
|
+
lockId: string | undefined;
|
|
66
|
+
error?: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface LockReleasedResponseMessageToClient extends BaseMessageToClient {
|
|
70
|
+
type: 'lockReleased';
|
|
71
|
+
payload: {
|
|
72
|
+
clientRequestId: ClientRequestId;
|
|
73
|
+
lockId: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export interface AiAssistantMessageToClient extends BaseMessageToClient {
|
|
77
|
+
type: 'aiAssistant';
|
|
78
|
+
clientRequestId: ClientRequestId;
|
|
79
|
+
payload: {
|
|
80
|
+
token: string;
|
|
81
|
+
complete: boolean;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export type MessageToClient = MutationsMessageToClient | QueryResultMessageToClient | BackendFunctionMessageToClient | NamedQueryMessageToClient | ApiResponseMessageToClient | LockAcquiredResponseMessageToClient | LockReleasedResponseMessageToClient | AiAssistantMessageToClient;
|
|
85
|
+
export interface MutationsMessageToClient extends BaseMessageToClient {
|
|
86
|
+
type: 'mutations';
|
|
87
|
+
payload: Array<MutationResultData>;
|
|
88
|
+
}
|
|
89
|
+
export interface MutationResultData {
|
|
90
|
+
squidDocId: SquidDocId;
|
|
91
|
+
clientRequestId: ClientRequestId;
|
|
92
|
+
mutationType: MutationType;
|
|
93
|
+
mutationTimestamp: DocTimestamp;
|
|
94
|
+
doc: SquidDocument | undefined;
|
|
95
|
+
}
|
|
96
|
+
export interface QueryResultData {
|
|
97
|
+
docs: Array<SquidDocument>;
|
|
98
|
+
integrationId: IntegrationId;
|
|
99
|
+
collectionName: CollectionName;
|
|
100
|
+
clientRequestId: ClientRequestId;
|
|
101
|
+
}
|
|
102
|
+
export interface QueryResultMessageToClient extends BaseMessageToClient {
|
|
103
|
+
type: 'query';
|
|
104
|
+
payload: QueryResultData;
|
|
105
|
+
}
|
|
106
|
+
export type PendingMessage = Omit<MessageToClient, 'messageId'>;
|
|
107
|
+
export type PendingMessages = Record<ClientId, Array<PendingMessage>>;
|
|
108
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const SECONDS_PER_MINUTE = 60;
|
|
2
|
-
export declare const SECONDS_PER_HOUR: number;
|
|
3
|
-
export declare const SECONDS_PER_DAY: number;
|
|
4
|
-
export declare const SECONDS_PER_WEEK: number;
|
|
5
|
-
export declare const SECONDS_PER_MONTH: number;
|
|
1
|
+
export declare const SECONDS_PER_MINUTE = 60;
|
|
2
|
+
export declare const SECONDS_PER_HOUR: number;
|
|
3
|
+
export declare const SECONDS_PER_DAY: number;
|
|
4
|
+
export declare const SECONDS_PER_WEEK: number;
|
|
5
|
+
export declare const SECONDS_PER_MONTH: number;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ServiceFunctionName } from './bundle-data.types';
|
|
2
|
-
import { AppId } from './communication.types';
|
|
3
|
-
import { SquidDocId, SquidDocument } from './document.types';
|
|
4
|
-
import { MutationType } from './mutation.types';
|
|
5
|
-
export interface DocTriggerParams {
|
|
6
|
-
squidDocId: SquidDocId;
|
|
7
|
-
mutationType: MutationType;
|
|
8
|
-
docBefore?: SquidDocument;
|
|
9
|
-
docAfter?: SquidDocument;
|
|
10
|
-
}
|
|
11
|
-
export interface TriggerMessage {
|
|
12
|
-
params: DocTriggerParams;
|
|
13
|
-
functionName: ServiceFunctionName;
|
|
14
|
-
appId: AppId;
|
|
15
|
-
}
|
|
1
|
+
import { ServiceFunctionName } from './bundle-data.types';
|
|
2
|
+
import { AppId } from './communication.types';
|
|
3
|
+
import { SquidDocId, SquidDocument } from './document.types';
|
|
4
|
+
import { MutationType } from './mutation.types';
|
|
5
|
+
export interface DocTriggerParams {
|
|
6
|
+
squidDocId: SquidDocId;
|
|
7
|
+
mutationType: MutationType;
|
|
8
|
+
docBefore?: SquidDocument;
|
|
9
|
+
docAfter?: SquidDocument;
|
|
10
|
+
}
|
|
11
|
+
export interface TriggerMessage {
|
|
12
|
+
params: DocTriggerParams;
|
|
13
|
+
functionName: ServiceFunctionName;
|
|
14
|
+
appId: AppId;
|
|
15
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export interface Type<T> extends Function {
|
|
2
|
-
new (...args: any[]): T;
|
|
3
|
-
}
|
|
4
|
-
export type Replace<TypeToBeChecked, KeyToBeReplaced extends keyof TypeToBeChecked, NewValueToUse> = Omit<TypeToBeChecked, KeyToBeReplaced> & {
|
|
5
|
-
[P in KeyToBeReplaced]: NewValueToUse;
|
|
6
|
-
};
|
|
7
|
-
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
8
|
-
export type WithRequired<T, K extends keyof T> = T & {
|
|
9
|
-
[P in K]-?: T[P];
|
|
10
|
-
};
|
|
11
|
-
type Pred = [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
12
|
-
export type Paths<T, RemainingDepth extends number & keyof Pred = 5, Prefix extends string = ''> = RemainingDepth extends 0 ? `${Prefix}${string}` : {
|
|
13
|
-
[k in keyof T]-?: k extends string | number ? `${Prefix}${k}` | (Required<T>[k] extends any[] ? never : Required<T>[k] extends object ? Paths<Required<T>[k], Pred[RemainingDepth], `${Prefix}${k}.`> : never) : never;
|
|
14
|
-
}[keyof T];
|
|
15
|
-
export {};
|
|
1
|
+
export interface Type<T> extends Function {
|
|
2
|
+
new (...args: any[]): T;
|
|
3
|
+
}
|
|
4
|
+
export type Replace<TypeToBeChecked, KeyToBeReplaced extends keyof TypeToBeChecked, NewValueToUse> = Omit<TypeToBeChecked, KeyToBeReplaced> & {
|
|
5
|
+
[P in KeyToBeReplaced]: NewValueToUse;
|
|
6
|
+
};
|
|
7
|
+
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
8
|
+
export type WithRequired<T, K extends keyof T> = T & {
|
|
9
|
+
[P in K]-?: T[P];
|
|
10
|
+
};
|
|
11
|
+
type Pred = [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
12
|
+
export type Paths<T, RemainingDepth extends number & keyof Pred = 5, Prefix extends string = ''> = RemainingDepth extends 0 ? `${Prefix}${string}` : {
|
|
13
|
+
[k in keyof T]-?: k extends string | number ? `${Prefix}${k}` | (Required<T>[k] extends any[] ? never : Required<T>[k] extends object ? Paths<Required<T>[k], Pred[RemainingDepth], `${Prefix}${k}.`> : never) : never;
|
|
14
|
+
}[keyof T];
|
|
15
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare function binarySearch<T>(arr: T[], key: T, comparator?: (a: T, b: T) => number, low?: number, high?: number): number;
|
|
2
|
-
export declare function insertSorted<T>(arr: T[], key: T, comparator?: (a: T, b: T) => number): void;
|
|
3
|
-
export declare function removeSorted<T>(arr: T[], key: T, comparator?: (a: T, b: T) => number): void;
|
|
4
|
-
export interface Grouped<T> {
|
|
5
|
-
[key: string]: T[];
|
|
6
|
-
}
|
|
7
|
-
export declare function asyncGroupBy<T>(arr: T[], groupNamer: (element: T) => Promise<string>): Promise<Grouped<T>>;
|
|
8
|
-
export declare const arrayMergeCustomizer: (a: any, b: any) => Array<any> | undefined;
|
|
1
|
+
export declare function binarySearch<T>(arr: T[], key: T, comparator?: (a: T, b: T) => number, low?: number, high?: number): number;
|
|
2
|
+
export declare function insertSorted<T>(arr: T[], key: T, comparator?: (a: T, b: T) => number): void;
|
|
3
|
+
export declare function removeSorted<T>(arr: T[], key: T, comparator?: (a: T, b: T) => number): void;
|
|
4
|
+
export interface Grouped<T> {
|
|
5
|
+
[key: string]: T[];
|
|
6
|
+
}
|
|
7
|
+
export declare function asyncGroupBy<T>(arr: T[], groupNamer: (element: T) => Promise<string>): Promise<Grouped<T>>;
|
|
8
|
+
export declare const arrayMergeCustomizer: (a: any, b: any) => Array<any> | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { StatusCode } from './validation';
|
|
2
|
-
export type AssertErrorProvider = () => Error | string;
|
|
3
|
-
export declare function assertTruthy(value: unknown, error?: string | Error | AssertErrorProvider): asserts value;
|
|
4
|
-
export declare function assertNotNullish(value: unknown, error?: string | Error | AssertErrorProvider): asserts value;
|
|
5
|
-
export declare function assertValidateTruthy(value: unknown, message: string, statusCode?: StatusCode, details?: Record<string, any>): asserts value;
|
|
6
|
-
export declare function truthy<T>(value: T, error?: string | Error | AssertErrorProvider): NonNullable<T>;
|
|
7
|
-
export declare function notNullish<T>(value: T, error?: string | Error | AssertErrorProvider): NonNullable<T>;
|
|
8
|
-
export declare function validateTruthy<T>(value: T, message: string, statusCode?: StatusCode, details?: Record<string, any>): NonNullable<T>;
|
|
1
|
+
import { StatusCode } from './validation';
|
|
2
|
+
export type AssertErrorProvider = () => Error | string;
|
|
3
|
+
export declare function assertTruthy(value: unknown, error?: string | Error | AssertErrorProvider): asserts value;
|
|
4
|
+
export declare function assertNotNullish(value: unknown, error?: string | Error | AssertErrorProvider): asserts value;
|
|
5
|
+
export declare function assertValidateTruthy(value: unknown, message: string, statusCode?: StatusCode, details?: Record<string, any>): asserts value;
|
|
6
|
+
export declare function truthy<T>(value: T, error?: string | Error | AssertErrorProvider): NonNullable<T>;
|
|
7
|
+
export declare function notNullish<T>(value: T, error?: string | Error | AssertErrorProvider): NonNullable<T>;
|
|
8
|
+
export declare function validateTruthy<T>(value: T, message: string, statusCode?: StatusCode, details?: Record<string, any>): NonNullable<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare class CodeExecutionError extends Error {
|
|
2
|
-
readonly details?: string | undefined;
|
|
3
|
-
constructor(error: string, details?: string | undefined);
|
|
4
|
-
}
|
|
1
|
+
export declare class CodeExecutionError extends Error {
|
|
2
|
+
readonly details?: string | undefined;
|
|
3
|
+
constructor(error: string, details?: string | undefined);
|
|
4
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getApplicationUrl(regionPrefix: string, appId: string): string;
|
|
2
|
-
export declare function getApplicationHttpHeaders(regionPrefix: string, appId: string): Record<string, string>;
|
|
1
|
+
export declare function getApplicationUrl(regionPrefix: string, appId: string): string;
|
|
2
|
+
export declare function getApplicationHttpHeaders(regionPrefix: string, appId: string): Record<string, string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function generateId(): string;
|
|
2
|
-
export declare function generateShortId(length?: number): string;
|
|
1
|
+
export declare function generateId(): string;
|
|
2
|
+
export declare function generateShortId(length?: number): string;
|