@squidcloud/client 1.0.85 → 1.0.87
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 +5 -5
- package/dist/common/src/ai-assistant.context.d.ts +12 -12
- package/dist/common/src/ai-assistant.schemas.d.ts +1 -1
- package/dist/common/src/ai-assistant.types.d.ts +2 -2
- package/dist/common/src/api-call.context.d.ts +13 -13
- package/dist/common/src/api.types.d.ts +4 -4
- package/dist/common/src/application.schemas.d.ts +1 -1
- package/dist/common/src/application.types.d.ts +184 -184
- package/dist/common/src/backend-function.schemas.d.ts +1 -1
- package/dist/common/src/backend-function.types.d.ts +1 -1
- package/dist/common/src/backend-run.types.d.ts +2 -2
- package/dist/common/src/bundle-api.types.d.ts +36 -36
- package/dist/common/src/bundle-data.types.d.ts +4 -4
- package/dist/common/src/communication.types.d.ts +12 -12
- package/dist/common/src/context.types.d.ts +40 -40
- package/dist/common/src/distributed-lock.context.d.ts +5 -5
- package/dist/common/src/document.types.d.ts +22 -22
- package/dist/common/src/graphql.context.d.ts +7 -7
- package/dist/common/src/graphql.types.d.ts +9 -9
- package/dist/common/src/heartbeat.types.d.ts +1 -1
- package/dist/common/src/http-status.enum.d.ts +50 -50
- package/dist/common/src/index.d.ts +53 -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 +39 -39
- package/dist/common/src/integrations/database.types.d.ts +236 -236
- package/dist/common/src/integrations/index.d.ts +101 -101
- package/dist/common/src/integrations/observability.types.d.ts +23 -23
- package/dist/common/src/logger.types.d.ts +21 -21
- package/dist/common/src/metrics.types.d.ts +1 -1
- package/dist/common/src/mutation.context.d.ts +14 -14
- package/dist/common/src/mutation.schemas.d.ts +1 -1
- package/dist/common/src/mutation.types.d.ts +53 -53
- package/dist/common/src/named-query.context.d.ts +4 -4
- package/dist/common/src/named-query.schemas.d.ts +1 -1
- package/dist/common/src/named-query.types.d.ts +1 -1
- package/dist/common/src/query/base-query-builder.d.ts +186 -130
- package/dist/common/src/query/index.d.ts +2 -2
- package/dist/common/src/query/query-context.d.ts +137 -109
- package/dist/common/src/query.types.d.ts +45 -57
- package/dist/common/src/regions.d.ts +1 -1
- package/dist/common/src/schema/schema.types.d.ts +54 -54
- package/dist/common/src/secret.schemas.d.ts +1 -1
- package/dist/common/src/secret.types.d.ts +8 -8
- package/dist/common/src/security.types.d.ts +1 -1
- package/dist/common/src/socket.schemas.d.ts +1 -1
- package/dist/common/src/socket.types.d.ts +1 -1
- package/dist/common/src/time-units.d.ts +1 -1
- package/dist/common/src/trigger.types.d.ts +1 -1
- package/dist/common/src/types.d.ts +14 -8
- package/dist/common/src/utils/array.d.ts +1 -1
- package/dist/common/src/utils/assert.d.ts +1 -1
- 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 +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
- package/dist/typescript-client/src/ai-assistant-client.d.ts +167 -167
- package/dist/typescript-client/src/ai-client.factory.d.ts +11 -11
- 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 +25 -25
- package/dist/typescript-client/src/collection-reference.d.ts +82 -82
- package/dist/typescript-client/src/collection-reference.factory.d.ts +13 -13
- package/dist/typescript-client/src/connection-details.d.ts +23 -23
- 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 +12 -12
- 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 +10 -10
- package/dist/typescript-client/src/named-query.manager.d.ts +12 -12
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +125 -122
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +64 -64
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +135 -135
- 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 +217 -217
- 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
- package/dist/common/src/query.schemas.d.ts +0 -3
|
@@ -1,57 +1,45 @@
|
|
|
1
|
-
import { ClientRequestId } from './communication.types';
|
|
2
|
-
import { CollectionName, FieldName } from './document.types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
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
|
-
export interface
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export
|
|
46
|
-
collectionName: CollectionName;
|
|
47
|
-
integrationId: string;
|
|
48
|
-
conditions: Conditions<Doc>;
|
|
49
|
-
sortOrder: Array<FieldSort<Doc>>;
|
|
50
|
-
limit: number;
|
|
51
|
-
}
|
|
52
|
-
export interface QueryRegisterRequest {
|
|
53
|
-
clientRequestId: ClientRequestId;
|
|
54
|
-
query: Query;
|
|
55
|
-
parentClientRequestId: ClientRequestId;
|
|
56
|
-
}
|
|
57
|
-
export {};
|
|
1
|
+
import { ClientRequestId } from './communication.types';
|
|
2
|
+
import { CollectionName, DocumentData, FieldName } from './document.types';
|
|
3
|
+
import { Paths } from './types';
|
|
4
|
+
/** A list of query conditions. */
|
|
5
|
+
export type Condition<Doc extends DocumentData = any> = SimpleCondition<Doc> | CompositeCondition<Doc>;
|
|
6
|
+
export type Conditions<Doc extends DocumentData = any> = Array<Condition<Doc>>;
|
|
7
|
+
/** A single field query condition. */
|
|
8
|
+
export interface SimpleCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>, MyOperator = Operator> {
|
|
9
|
+
fieldName: F;
|
|
10
|
+
operator: MyOperator;
|
|
11
|
+
value: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A composite fields query condition.
|
|
15
|
+
* Just a list of simple conditions with specific set of operators. It should be
|
|
16
|
+
* evaluated this way:
|
|
17
|
+
* If A, B, C are the conditions and A` = A with '==' operator:
|
|
18
|
+
* A || (A' && B) || (A' && B' && C)
|
|
19
|
+
*/
|
|
20
|
+
export interface CompositeCondition<Doc extends DocumentData = any> {
|
|
21
|
+
fields: Array<SimpleCondition<Doc, Paths<Doc>, CompositeConditionOperator>>;
|
|
22
|
+
}
|
|
23
|
+
export declare function isSimpleCondition(condition: Condition): condition is SimpleCondition;
|
|
24
|
+
type CompositeConditionOperator = '>=' | '<=' | '>' | '<';
|
|
25
|
+
/** An operator in a query condition. */
|
|
26
|
+
export type Operator = '==' | '!=' | CompositeConditionOperator | 'like' | 'not like' | 'like_cs' | 'not like_cs';
|
|
27
|
+
/** A definition of a sort by a filed. */
|
|
28
|
+
export interface FieldSort<Doc> {
|
|
29
|
+
fieldName: FieldName<Doc>;
|
|
30
|
+
asc: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** A query object. */
|
|
33
|
+
export interface Query<Doc extends DocumentData = any> {
|
|
34
|
+
collectionName: CollectionName;
|
|
35
|
+
integrationId: string;
|
|
36
|
+
conditions: Conditions<Doc>;
|
|
37
|
+
sortOrder: Array<FieldSort<Doc>>;
|
|
38
|
+
limit: number;
|
|
39
|
+
}
|
|
40
|
+
export interface QueryRegisterRequest {
|
|
41
|
+
clientRequestId: ClientRequestId;
|
|
42
|
+
query: Query;
|
|
43
|
+
parentClientRequestId: ClientRequestId;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type SupportedSquidRegion = (typeof SupportedSquidRegions)[number];
|
|
1
|
+
export type SupportedSquidRegion = (typeof SupportedSquidRegions)[number];
|
|
@@ -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' | 'objectId';
|
|
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' | 'objectId';
|
|
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 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
/** A type alias for an ApiKey. */
|
|
6
|
-
export type ApiKey = string;
|
|
7
|
-
export declare const BACKEND_API_KEY = "_BACKEND_API_KEY";
|
|
8
|
-
export declare const APP_API_KEY = "APP_API_KEY";
|
|
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
|
+
/** A type alias for an ApiKey. */
|
|
6
|
+
export type ApiKey = string;
|
|
7
|
+
export declare const BACKEND_API_KEY = "_BACKEND_API_KEY";
|
|
8
|
+
export declare const APP_API_KEY = "APP_API_KEY";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
export interface Type<T> extends Function {
|
|
2
|
-
new (...args: any[]): T;
|
|
3
|
-
}
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
1
|
+
export interface Type<T> extends Function {
|
|
2
|
+
new (...args: any[]): T;
|
|
3
|
+
}
|
|
4
|
+
type PropertiesWithPrefix<Prefix extends string> = {
|
|
5
|
+
[key in `${Prefix}${string}`]: any;
|
|
6
|
+
};
|
|
7
|
+
type Pred = [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
8
|
+
export type DeepRecord<T, RemainingDepth extends number & keyof Pred = 5, Prefix extends string = ''> = RemainingDepth extends 0 ? PropertiesWithPrefix<Prefix> : {
|
|
9
|
+
[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;
|
|
10
|
+
}[keyof T];
|
|
11
|
+
export type UnionKeys<T> = T extends any ? keyof T : never;
|
|
12
|
+
export type FieldOf<T, K extends UnionKeys<T>> = Extract<T, Record<K, any>>[K];
|
|
13
|
+
export type Paths<T> = UnionKeys<DeepRecord<T>>;
|
|
14
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
type LockMutex = string;
|
|
2
|
-
/**
|
|
3
|
-
* A simple lock manager that locks a list of mutexes.
|
|
4
|
-
* When locking a list of mutexes, the lock will start only when all the mutexes are available - preventing partial lock
|
|
5
|
-
* and potential deadlocks.
|
|
6
|
-
*/
|
|
7
|
-
export declare class LockManager {
|
|
8
|
-
private readonly locks;
|
|
9
|
-
lock(...mutexes: LockMutex[]): Promise<void>;
|
|
10
|
-
release(...mutexes: LockMutex[]): void;
|
|
11
|
-
canGetLock(...mutexes: LockMutex[]): boolean;
|
|
12
|
-
lockSync(...mutexes: LockMutex[]): void;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
1
|
+
type LockMutex = string;
|
|
2
|
+
/**
|
|
3
|
+
* A simple lock manager that locks a list of mutexes.
|
|
4
|
+
* When locking a list of mutexes, the lock will start only when all the mutexes are available - preventing partial lock
|
|
5
|
+
* and potential deadlocks.
|
|
6
|
+
*/
|
|
7
|
+
export declare class LockManager {
|
|
8
|
+
private readonly locks;
|
|
9
|
+
lock(...mutexes: LockMutex[]): Promise<void>;
|
|
10
|
+
release(...mutexes: LockMutex[]): void;
|
|
11
|
+
canGetLock(...mutexes: LockMutex[]): boolean;
|
|
12
|
+
lockSync(...mutexes: LockMutex[]): void;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isNotNullish<T>(t: T | undefined | null): t is T;
|
|
1
|
+
export declare function isNotNullish<T>(t: T | undefined | null): t is T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare function getInPath(obj: any, path: string, delimiter?: string): any;
|
|
2
|
-
export declare function setInPath(obj: any, path: string, value: any, delimiter?: string): void;
|
|
3
|
-
export declare function deleteInPath(obj: any, path: string, delimiter?: string): void;
|
|
4
|
-
export declare function deepReplace(obj: any, keyName: string, replacer: (from: any) => any): void;
|
|
5
|
-
export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
|
|
6
|
-
export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
|
|
1
|
+
export declare function getInPath(obj: any, path: string, delimiter?: string): any;
|
|
2
|
+
export declare function setInPath(obj: any, path: string, value: any, delimiter?: string): void;
|
|
3
|
+
export declare function deleteInPath(obj: any, path: string, delimiter?: string): void;
|
|
4
|
+
export declare function deepReplace(obj: any, keyName: string, replacer: (from: any) => any): void;
|
|
5
|
+
export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
|
|
6
|
+
export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare function normalizeJsonAsString(json: any): string;
|
|
2
|
-
export declare function serializeObj(obj: any): string;
|
|
3
|
-
export declare function deserializeObj<T = any>(str: string): T;
|
|
4
|
-
export declare function encodeValueForMapping(value: any): string;
|
|
5
|
-
export declare function decodeValueForMapping(encodedString: string): any;
|
|
6
|
-
export declare function recodeValue(value: any): any;
|
|
1
|
+
export declare function normalizeJsonAsString(json: any): string;
|
|
2
|
+
export declare function serializeObj(obj: any): string;
|
|
3
|
+
export declare function deserializeObj<T = any>(str: string): T;
|
|
4
|
+
export declare function encodeValueForMapping(value: any): string;
|
|
5
|
+
export declare function decodeValueForMapping(encodedString: string): any;
|
|
6
|
+
export declare function recodeValue(value: any): any;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare function unchanged(any: any): any;
|
|
2
|
-
export declare function booleanToInt(boolean: boolean): number;
|
|
3
|
-
export declare function intToBoolean(int: number): boolean;
|
|
4
|
-
export declare function stringToNumber(string: string): number;
|
|
5
|
-
export declare function numberToString(number: number): string;
|
|
6
|
-
export declare function bufferToString(buffer: ArrayBuffer): string;
|
|
7
|
-
export declare function stringToBuffer(string: string): ArrayBuffer;
|
|
8
|
-
export declare function stringToJSON(string: string): JSON;
|
|
9
|
-
export declare function JSONToString(json: JSON): string;
|
|
10
|
-
export declare function moneyStringToNumber(money: string): number;
|
|
11
|
-
export declare function daysPastEpochToDate(days: number): Date;
|
|
12
|
-
export declare function msToDate(ms: number): Date;
|
|
13
|
-
export declare function isoStringToDate(string: string): Date;
|
|
14
|
-
export declare function base64ToString(string: string): string;
|
|
15
|
-
export declare function base64ToBinary(string: string): string;
|
|
16
|
-
export declare function kafkaConnectStringToInterval(string: string): Record<string, number>;
|
|
17
|
-
export declare function msPastMidnightToTimeString(ms: number): string;
|
|
18
|
-
export declare function dateToTimeString(date: Date): string;
|
|
1
|
+
export declare function unchanged(any: any): any;
|
|
2
|
+
export declare function booleanToInt(boolean: boolean): number;
|
|
3
|
+
export declare function intToBoolean(int: number): boolean;
|
|
4
|
+
export declare function stringToNumber(string: string): number;
|
|
5
|
+
export declare function numberToString(number: number): string;
|
|
6
|
+
export declare function bufferToString(buffer: ArrayBuffer): string;
|
|
7
|
+
export declare function stringToBuffer(string: string): ArrayBuffer;
|
|
8
|
+
export declare function stringToJSON(string: string): JSON;
|
|
9
|
+
export declare function JSONToString(json: JSON): string;
|
|
10
|
+
export declare function moneyStringToNumber(money: string): number;
|
|
11
|
+
export declare function daysPastEpochToDate(days: number): Date;
|
|
12
|
+
export declare function msToDate(ms: number): Date;
|
|
13
|
+
export declare function isoStringToDate(string: string): Date;
|
|
14
|
+
export declare function base64ToString(string: string): string;
|
|
15
|
+
export declare function base64ToBinary(string: string): string;
|
|
16
|
+
export declare function kafkaConnectStringToInterval(string: string): Record<string, number>;
|
|
17
|
+
export declare function msPastMidnightToTimeString(ms: number): string;
|
|
18
|
+
export declare function dateToTimeString(date: Date): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function appendQueryParams(url: string, queryParams: Record<string, any>): string;
|
|
1
|
+
export declare function appendQueryParams(url: string, queryParams: Record<string, any>): string;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains general validators for the different objects being received from the client. The parameters are
|
|
3
|
-
* usually of type 'any' to make sure there are no assumptions that the object has the correct type.
|
|
4
|
-
* Also, this file should avoid importing from other files that are not for validation to avoid circular deps.
|
|
5
|
-
*/
|
|
6
|
-
import { OpenIdProvider } from '../application.types';
|
|
7
|
-
import { HttpStatus } from '../http-status.enum';
|
|
8
|
-
export type StatusCode = HttpStatus.BAD_REQUEST | HttpStatus.NOT_FOUND | HttpStatus.FORBIDDEN | HttpStatus.UNAUTHORIZED | HttpStatus.CONFLICT;
|
|
9
|
-
export declare class ValidationError extends Error {
|
|
10
|
-
readonly statusCode: StatusCode;
|
|
11
|
-
readonly details?: any;
|
|
12
|
-
constructor(error: string, statusCode: StatusCode, details?: Record<string, any>);
|
|
13
|
-
}
|
|
14
|
-
export declare function validateFieldSort(fieldSort: any): void;
|
|
15
|
-
export declare function validateOpenIdProvider(openIdProvider: OpenIdProvider | undefined): OpenIdProvider;
|
|
16
|
-
export declare function validateOpenIdProviderType(providerType: any): void;
|
|
17
|
-
export declare function validateMutations(mutations: any): void;
|
|
18
|
-
export declare function validateQueryLimit(limit: any): void;
|
|
19
|
-
/** Returns true if the value is not an empty string (undefined/null are considered empty). */
|
|
20
|
-
export declare function isNotEmpty(value: string | undefined | null): value is string;
|
|
21
|
-
/**
|
|
22
|
-
* All type names returned by 'typeof' supported by JavaScript:
|
|
23
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof}.
|
|
24
|
-
* and a few other supported types.
|
|
25
|
-
*/
|
|
26
|
-
export type JavascriptTypeName = 'undefined' | 'object' | 'boolean' | 'number' | 'bigint' | 'string' | 'symbol' | 'function';
|
|
27
|
-
/** Returns true if 'typeof' of the 'value' is 'type' or 'type[]'. */
|
|
28
|
-
export declare function isRightType(value: unknown, type: JavascriptTypeName): boolean;
|
|
29
|
-
/** Returns true if 'obj' has only keys listed in the 'keys'. Object can't be an array. */
|
|
30
|
-
export declare function hasOnlyKeys(obj: object, keys: string[]): boolean;
|
|
1
|
+
/**
|
|
2
|
+
* This file contains general validators for the different objects being received from the client. The parameters are
|
|
3
|
+
* usually of type 'any' to make sure there are no assumptions that the object has the correct type.
|
|
4
|
+
* Also, this file should avoid importing from other files that are not for validation to avoid circular deps.
|
|
5
|
+
*/
|
|
6
|
+
import { OpenIdProvider } from '../application.types';
|
|
7
|
+
import { HttpStatus } from '../http-status.enum';
|
|
8
|
+
export type StatusCode = HttpStatus.BAD_REQUEST | HttpStatus.NOT_FOUND | HttpStatus.FORBIDDEN | HttpStatus.UNAUTHORIZED | HttpStatus.CONFLICT;
|
|
9
|
+
export declare class ValidationError extends Error {
|
|
10
|
+
readonly statusCode: StatusCode;
|
|
11
|
+
readonly details?: any;
|
|
12
|
+
constructor(error: string, statusCode: StatusCode, details?: Record<string, any>);
|
|
13
|
+
}
|
|
14
|
+
export declare function validateFieldSort(fieldSort: any): void;
|
|
15
|
+
export declare function validateOpenIdProvider(openIdProvider: OpenIdProvider | undefined): OpenIdProvider;
|
|
16
|
+
export declare function validateOpenIdProviderType(providerType: any): void;
|
|
17
|
+
export declare function validateMutations(mutations: any): void;
|
|
18
|
+
export declare function validateQueryLimit(limit: any): void;
|
|
19
|
+
/** Returns true if the value is not an empty string (undefined/null are considered empty). */
|
|
20
|
+
export declare function isNotEmpty(value: string | undefined | null): value is string;
|
|
21
|
+
/**
|
|
22
|
+
* All type names returned by 'typeof' supported by JavaScript:
|
|
23
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof}.
|
|
24
|
+
* and a few other supported types.
|
|
25
|
+
*/
|
|
26
|
+
export type JavascriptTypeName = 'undefined' | 'object' | 'boolean' | 'number' | 'bigint' | 'string' | 'symbol' | 'function';
|
|
27
|
+
/** Returns true if 'typeof' of the 'value' is 'type' or 'type[]'. */
|
|
28
|
+
export declare function isRightType(value: unknown, type: JavascriptTypeName): boolean;
|
|
29
|
+
/** Returns true if 'obj' has only keys listed in the 'keys'. Object can't be an array. */
|
|
30
|
+
export declare function hasOnlyKeys(obj: object, keys: string[]): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|