@squidcloud/backend 1.0.8 → 1.0.9
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/index.js +6 -10
- package/package.json +2 -2
- package/dist/backend/src/actions.d.ts +0 -13
- package/dist/backend/src/index.d.ts +0 -3
- package/dist/backend/src/metadata.d.ts +0 -234
- package/dist/backend/src/project.d.ts +0 -4
- package/dist/backend/src/service.d.ts +0 -18
- package/dist/common/src/api-call.context.d.ts +0 -17
- package/dist/common/src/api.types.d.ts +0 -10
- package/dist/common/src/application.schemas.d.ts +0 -608
- package/dist/common/src/application.types.d.ts +0 -197
- package/dist/common/src/backend-function.schemas.d.ts +0 -3
- package/dist/common/src/backend-function.types.d.ts +0 -7
- package/dist/common/src/backend-run.types.d.ts +0 -60
- package/dist/common/src/bundle-api.types.d.ts +0 -66
- package/dist/common/src/bundle-data.types.d.ts +0 -47
- package/dist/common/src/communication.types.d.ts +0 -4
- package/dist/common/src/context.types.d.ts +0 -21
- package/dist/common/src/document.types.d.ts +0 -35
- package/dist/common/src/executable.context.d.ts +0 -4
- package/dist/common/src/graphql.context.d.ts +0 -14
- package/dist/common/src/graphql.types.d.ts +0 -8
- package/dist/common/src/http-status.enum.d.ts +0 -50
- package/dist/common/src/index.d.ts +0 -50
- package/dist/common/src/integration.types.d.ts +0 -249
- package/dist/common/src/logger.types.d.ts +0 -22
- package/dist/common/src/metrics.schemas.d.ts +0 -3
- package/dist/common/src/metrics.types.d.ts +0 -65
- package/dist/common/src/mutation.context.d.ts +0 -11
- package/dist/common/src/mutation.schemas.d.ts +0 -5
- package/dist/common/src/mutation.types.d.ts +0 -72
- package/dist/common/src/named-query.context.d.ts +0 -4
- package/dist/common/src/named-query.schemas.d.ts +0 -3
- package/dist/common/src/named-query.types.d.ts +0 -9
- package/dist/common/src/query/index.d.ts +0 -2
- package/dist/common/src/query/query-context.d.ts +0 -38
- package/dist/common/src/query/simple-query-builder.d.ts +0 -14
- package/dist/common/src/query.schemas.d.ts +0 -5
- package/dist/common/src/query.types.d.ts +0 -118
- package/dist/common/src/regions.d.ts +0 -17
- package/dist/common/src/schema/schema.types.d.ts +0 -54
- package/dist/common/src/secret.schemas.d.ts +0 -6
- package/dist/common/src/secret.types.d.ts +0 -38
- package/dist/common/src/socket.schemas.d.ts +0 -3
- package/dist/common/src/socket.types.d.ts +0 -68
- package/dist/common/src/time-units.d.ts +0 -5
- package/dist/common/src/trigger.types.d.ts +0 -15
- package/dist/common/src/types.d.ts +0 -15
- package/dist/common/src/utils/array.d.ts +0 -8
- package/dist/common/src/utils/assert.d.ts +0 -8
- package/dist/common/src/utils/error.d.ts +0 -4
- package/dist/common/src/utils/id.d.ts +0 -1
- package/dist/common/src/utils/lock.manager.d.ts +0 -14
- package/dist/common/src/utils/nullish.d.ts +0 -1
- package/dist/common/src/utils/object.d.ts +0 -6
- package/dist/common/src/utils/serialization.d.ts +0 -6
- package/dist/common/src/utils/transforms.d.ts +0 -18
- package/dist/common/src/utils/url.d.ts +0 -1
- package/dist/common/src/utils/validation.d.ts +0 -30
- package/dist/common/src/webhook-response.d.ts +0 -7
- package/dist/index.js.LICENSE.txt +0 -38
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +0 -1239
- package/dist/typescript-client/src/api.manager.d.ts +0 -14
- package/dist/typescript-client/src/backend-function.manager.d.ts +0 -13
- package/dist/typescript-client/src/collection-reference.d.ts +0 -19
- package/dist/typescript-client/src/collection-reference.factory.d.ts +0 -16
- package/dist/typescript-client/src/data.manager.d.ts +0 -164
- package/dist/typescript-client/src/destruct.manager.d.ts +0 -9
- package/dist/typescript-client/src/document-identity.service.d.ts +0 -12
- package/dist/typescript-client/src/document-reference.d.ts +0 -23
- package/dist/typescript-client/src/document-reference.factory.d.ts +0 -9
- package/dist/typescript-client/src/document-store.d.ts +0 -11
- package/dist/typescript-client/src/graphql-client.d.ts +0 -9
- package/dist/typescript-client/src/graphql-client.factory.d.ts +0 -9
- package/dist/typescript-client/src/index.d.ts +0 -7
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +0 -11
- package/dist/typescript-client/src/named-query.manager.d.ts +0 -13
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +0 -35
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +0 -37
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +0 -59
- package/dist/typescript-client/src/query/query.types.d.ts +0 -7
- package/dist/typescript-client/src/rpc.manager.d.ts +0 -24
- package/dist/typescript-client/src/socket.manager.d.ts +0 -27
- package/dist/typescript-client/src/squid.d.ts +0 -51
- package/dist/typescript-client/src/state/action.applier.d.ts +0 -7
- package/dist/typescript-client/src/state/actions.d.ts +0 -29
- package/dist/typescript-client/src/state/path_trie.d.ts +0 -27
- package/dist/typescript-client/src/state/state.service.d.ts +0 -22
- package/dist/typescript-client/src/types.d.ts +0 -2
|
@@ -1,54 +0,0 @@
|
|
|
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 = ConvertDeep<JSONSchema> & {
|
|
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 +0,0 @@
|
|
|
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,38 +0,0 @@
|
|
|
1
|
-
export type SecretKey = string;
|
|
2
|
-
export type SecretValue = string | number | boolean;
|
|
3
|
-
export type SecretTimestamp = number;
|
|
4
|
-
export type ApiKeyName = string;
|
|
5
|
-
export type ApiKey = string;
|
|
6
|
-
export interface ApplicationSecrets {
|
|
7
|
-
custom: Record<SecretKey, SecretEntry>;
|
|
8
|
-
apiKeys: Record<SecretKey, SecretEntry>;
|
|
9
|
-
}
|
|
10
|
-
export interface SystemSecrets {
|
|
11
|
-
sharedMongo: Record<SecretKey, SecretValue>;
|
|
12
|
-
}
|
|
13
|
-
export interface SecretMetadata {
|
|
14
|
-
key: SecretKey;
|
|
15
|
-
lastUpdated: SecretTimestamp;
|
|
16
|
-
}
|
|
17
|
-
export interface SecretEntry extends SecretMetadata {
|
|
18
|
-
value: SecretValue;
|
|
19
|
-
}
|
|
20
|
-
export type SetCustomSecretRequest = Omit<SecretEntry, 'lastUpdated'>;
|
|
21
|
-
export interface DeleteCustomSecretRequest {
|
|
22
|
-
key: SecretKey;
|
|
23
|
-
}
|
|
24
|
-
export interface GetApiKeyRequest {
|
|
25
|
-
apiKeyName: ApiKeyName;
|
|
26
|
-
}
|
|
27
|
-
export interface GetApiKeyResponse {
|
|
28
|
-
apiKey: string | undefined;
|
|
29
|
-
}
|
|
30
|
-
export type DeleteApiKeyRequest = Pick<SecretMetadata, 'key'>;
|
|
31
|
-
export interface ListApplicationSecretMetadataResponse {
|
|
32
|
-
custom: SecretMetadata[];
|
|
33
|
-
apiKeys: SecretMetadata[];
|
|
34
|
-
}
|
|
35
|
-
export type GenerateNewApiKeyRequest = Pick<SecretMetadata, 'key'>;
|
|
36
|
-
export interface GenerateNewApiKeyResponse {
|
|
37
|
-
apiKey: string;
|
|
38
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { ClientId, ClientRequestId, IntegrationId } from './communication.types';
|
|
2
|
-
import { CollectionName, DocTimestamp, SquidDocId, SquidDocument } from './document.types';
|
|
3
|
-
import { MutationType } from './mutation.types';
|
|
4
|
-
export type MessageId = string;
|
|
5
|
-
export type MessageFromClientType = 'acknowledge' | 'catchup' | 'kill';
|
|
6
|
-
interface BaseMessageFromClient {
|
|
7
|
-
type: MessageFromClientType;
|
|
8
|
-
payload?: unknown;
|
|
9
|
-
}
|
|
10
|
-
export interface AcknowledgeMessage extends BaseMessageFromClient {
|
|
11
|
-
type: 'acknowledge';
|
|
12
|
-
payload: Array<MessageId>;
|
|
13
|
-
}
|
|
14
|
-
export interface CatchupMessage extends BaseMessageFromClient {
|
|
15
|
-
type: 'catchup';
|
|
16
|
-
}
|
|
17
|
-
export interface KillMessage extends BaseMessageFromClient {
|
|
18
|
-
type: 'kill';
|
|
19
|
-
}
|
|
20
|
-
export type MessageFromClient = AcknowledgeMessage | CatchupMessage | KillMessage;
|
|
21
|
-
export type MessageToClientType = 'mutations' | 'query' | 'backendFunction' | 'api' | 'namedQuery';
|
|
22
|
-
interface BaseMessageToClient {
|
|
23
|
-
type: MessageToClientType;
|
|
24
|
-
messageId: MessageId;
|
|
25
|
-
payload: unknown;
|
|
26
|
-
}
|
|
27
|
-
export interface BackendFunctionMessageToClient extends BaseMessageToClient {
|
|
28
|
-
type: 'backendFunction';
|
|
29
|
-
clientRequestId: ClientRequestId;
|
|
30
|
-
payload: string;
|
|
31
|
-
}
|
|
32
|
-
export interface NamedQueryMessageToClient extends BaseMessageToClient {
|
|
33
|
-
type: 'namedQuery';
|
|
34
|
-
clientRequestId: ClientRequestId;
|
|
35
|
-
payload: string;
|
|
36
|
-
}
|
|
37
|
-
export interface ApiResponseMessageToClient extends BaseMessageToClient {
|
|
38
|
-
type: 'api';
|
|
39
|
-
clientRequestId: ClientRequestId;
|
|
40
|
-
success: boolean;
|
|
41
|
-
httpStatus: number;
|
|
42
|
-
payload: string;
|
|
43
|
-
}
|
|
44
|
-
export type MessageToClient = MutationsMessageToClient | QueryResultMessageToClient | BackendFunctionMessageToClient | NamedQueryMessageToClient | ApiResponseMessageToClient;
|
|
45
|
-
export interface MutationsMessageToClient extends BaseMessageToClient {
|
|
46
|
-
type: 'mutations';
|
|
47
|
-
payload: Array<MutationResultData>;
|
|
48
|
-
}
|
|
49
|
-
export interface MutationResultData {
|
|
50
|
-
squidDocId: SquidDocId;
|
|
51
|
-
clientRequestId: ClientRequestId;
|
|
52
|
-
mutationType: MutationType;
|
|
53
|
-
mutationTimestamp: DocTimestamp;
|
|
54
|
-
doc: SquidDocument | undefined;
|
|
55
|
-
}
|
|
56
|
-
export interface QueryResultData {
|
|
57
|
-
docs: Array<SquidDocument>;
|
|
58
|
-
integrationId: IntegrationId;
|
|
59
|
-
collectionName: CollectionName;
|
|
60
|
-
clientRequestId: ClientRequestId;
|
|
61
|
-
}
|
|
62
|
-
export interface QueryResultMessageToClient extends BaseMessageToClient {
|
|
63
|
-
type: 'query';
|
|
64
|
-
payload: QueryResultData;
|
|
65
|
-
}
|
|
66
|
-
export type PendingMessage = Omit<MessageToClient, 'messageId'>;
|
|
67
|
-
export type PendingMessages = Record<ClientId, Array<PendingMessage>>;
|
|
68
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export declare function generateId(): string;
|
|
@@ -1,14 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export declare function isNotNullish<T>(t: T | undefined | null): t is T;
|
|
@@ -1,6 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export declare function normalizeJsonAsString(json: any): string;
|
|
2
|
-
export declare function serializeObj(obj: any): string;
|
|
3
|
-
export declare function deserializeObj<T = any>(serializedObj: 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 +0,0 @@
|
|
|
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 debeziumStringToInterval(string: string): Record<string, number>;
|
|
17
|
-
export declare function msPastMidnightToTimeString(ms: number): string;
|
|
18
|
-
export declare function dateToTimeString(date: Date): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getApplicationUrl(regionPrefix: string, appId: string): string;
|
|
@@ -1,30 +0,0 @@
|
|
|
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;
|
|
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
|
-
* 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,38 +0,0 @@
|
|
|
1
|
-
/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @license
|
|
18
|
-
* Lodash <https://lodash.com/>
|
|
19
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
20
|
-
* Released under MIT license <https://lodash.com/license>
|
|
21
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
22
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Wrapper for built-in http.js to emulate the browser XMLHttpRequest object.
|
|
27
|
-
*
|
|
28
|
-
* This can be used with JS designed for browsers to improve reuse of code and
|
|
29
|
-
* allow the use of existing libraries.
|
|
30
|
-
*
|
|
31
|
-
* Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs.
|
|
32
|
-
*
|
|
33
|
-
* @author Dan DeFelippi <dan@driverdan.com>
|
|
34
|
-
* @contributor David Ellis <d.f.ellis@ieee.org>
|
|
35
|
-
* @license MIT
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|