@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.
Files changed (99) hide show
  1. package/dist/common/src/ai-assistant.context.d.ts +11 -11
  2. package/dist/common/src/ai-assistant.schemas.d.ts +210 -210
  3. package/dist/common/src/ai-assistant.types.d.ts +81 -81
  4. package/dist/common/src/api-call.context.d.ts +12 -12
  5. package/dist/common/src/api.types.d.ts +24 -24
  6. package/dist/common/src/application.schemas.d.ts +1060 -1060
  7. package/dist/common/src/application.types.d.ts +224 -224
  8. package/dist/common/src/auth.types.d.ts +4 -4
  9. package/dist/common/src/backend-function.schemas.d.ts +3 -3
  10. package/dist/common/src/backend-function.types.d.ts +7 -7
  11. package/dist/common/src/backend-run.types.d.ts +53 -53
  12. package/dist/common/src/bundle-api.types.d.ts +68 -68
  13. package/dist/common/src/bundle-data.types.d.ts +59 -59
  14. package/dist/common/src/communication.types.d.ts +4 -4
  15. package/dist/common/src/context.types.d.ts +32 -32
  16. package/dist/common/src/distributed-lock.context.d.ts +5 -5
  17. package/dist/common/src/document.types.d.ts +37 -37
  18. package/dist/common/src/graphql.context.d.ts +6 -6
  19. package/dist/common/src/graphql.types.d.ts +11 -11
  20. package/dist/common/src/http-status.enum.d.ts +50 -50
  21. package/dist/common/src/index.d.ts +54 -54
  22. package/dist/common/src/integrations/ai_assistant.types.d.ts +30 -30
  23. package/dist/common/src/integrations/api.types.d.ts +80 -80
  24. package/dist/common/src/integrations/auth.types.d.ts +22 -22
  25. package/dist/common/src/integrations/database.types.d.ts +236 -236
  26. package/dist/common/src/integrations/index.d.ts +97 -97
  27. package/dist/common/src/integrations/observability.types.d.ts +22 -22
  28. package/dist/common/src/logger.types.d.ts +21 -21
  29. package/dist/common/src/metrics.types.d.ts +58 -58
  30. package/dist/common/src/mutation.context.d.ts +10 -10
  31. package/dist/common/src/mutation.schemas.d.ts +5 -5
  32. package/dist/common/src/mutation.types.d.ts +72 -72
  33. package/dist/common/src/named-query.context.d.ts +4 -4
  34. package/dist/common/src/named-query.schemas.d.ts +3 -3
  35. package/dist/common/src/named-query.types.d.ts +9 -9
  36. package/dist/common/src/query/index.d.ts +2 -2
  37. package/dist/common/src/query/query-context.d.ts +37 -37
  38. package/dist/common/src/query/simple-query-builder.d.ts +137 -137
  39. package/dist/common/src/query.schemas.d.ts +5 -5
  40. package/dist/common/src/query.types.d.ts +118 -118
  41. package/dist/common/src/regions.d.ts +22 -22
  42. package/dist/common/src/schema/schema.types.d.ts +54 -54
  43. package/dist/common/src/secret.schemas.d.ts +6 -6
  44. package/dist/common/src/secret.types.d.ts +49 -49
  45. package/dist/common/src/security.types.d.ts +3 -3
  46. package/dist/common/src/socket.schemas.d.ts +3 -3
  47. package/dist/common/src/socket.types.d.ts +108 -108
  48. package/dist/common/src/time-units.d.ts +5 -5
  49. package/dist/common/src/trigger.types.d.ts +15 -15
  50. package/dist/common/src/types.d.ts +15 -15
  51. package/dist/common/src/utils/array.d.ts +8 -8
  52. package/dist/common/src/utils/assert.d.ts +8 -8
  53. package/dist/common/src/utils/error.d.ts +4 -4
  54. package/dist/common/src/utils/http.d.ts +2 -2
  55. package/dist/common/src/utils/id.d.ts +2 -2
  56. package/dist/common/src/utils/lock.manager.d.ts +14 -14
  57. package/dist/common/src/utils/nullish.d.ts +1 -1
  58. package/dist/common/src/utils/object.d.ts +6 -6
  59. package/dist/common/src/utils/serialization.d.ts +6 -6
  60. package/dist/common/src/utils/transforms.d.ts +18 -18
  61. package/dist/common/src/utils/url.d.ts +1 -1
  62. package/dist/common/src/utils/validation.d.ts +30 -30
  63. package/dist/common/src/webhook-response.d.ts +7 -7
  64. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
  65. package/dist/typescript-client/src/ai-assistant-client.d.ts +66 -66
  66. package/dist/typescript-client/src/ai-client.factory.d.ts +13 -13
  67. package/dist/typescript-client/src/api.manager.d.ts +15 -15
  68. package/dist/typescript-client/src/auth.manager.d.ts +23 -23
  69. package/dist/typescript-client/src/backend-function.manager.d.ts +13 -13
  70. package/dist/typescript-client/src/client-id.service.d.ts +24 -24
  71. package/dist/typescript-client/src/collection-reference.d.ts +81 -81
  72. package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -16
  73. package/dist/typescript-client/src/data.manager.d.ts +172 -172
  74. package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
  75. package/dist/typescript-client/src/distributed-lock.manager.d.ts +19 -19
  76. package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
  77. package/dist/typescript-client/src/document-reference.d.ts +134 -134
  78. package/dist/typescript-client/src/document-reference.factory.d.ts +9 -9
  79. package/dist/typescript-client/src/document-store.d.ts +11 -11
  80. package/dist/typescript-client/src/graphql-client.d.ts +12 -12
  81. package/dist/typescript-client/src/graphql-client.factory.d.ts +9 -9
  82. package/dist/typescript-client/src/index.d.ts +8 -8
  83. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +12 -12
  84. package/dist/typescript-client/src/named-query.manager.d.ts +14 -14
  85. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +72 -72
  86. package/dist/typescript-client/src/query/query-builder.factory.d.ts +83 -83
  87. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +64 -64
  88. package/dist/typescript-client/src/query/query.types.d.ts +14 -14
  89. package/dist/typescript-client/src/rpc.manager.d.ts +28 -28
  90. package/dist/typescript-client/src/socket.manager.d.ts +32 -32
  91. package/dist/typescript-client/src/squid.d.ts +188 -188
  92. package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
  93. package/dist/typescript-client/src/state/actions.d.ts +29 -29
  94. package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
  95. package/dist/typescript-client/src/state/state.service.d.ts +22 -22
  96. package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
  97. package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
  98. package/dist/typescript-client/src/types.d.ts +2 -2
  99. package/package.json +1 -1
@@ -1,68 +1,68 @@
1
- import { AiAssistantActionType, DatabaseActionType } from './bundle-data.types';
2
- import { Auth, RunContext } from './context.types';
3
- import { DocumentData, SquidDocId, SquidDocument } from './document.types';
4
- import { Logger } from './logger.types';
5
- import { MutationContext } from './mutation.context';
6
- import { Mutation, MutationType } from './mutation.types';
7
- import { QueryContext } from './query';
8
- import { SecretKey } from './secret.types';
9
- import { ApiCallContext } from './api-call.context';
10
- import { NamedQueryContext } from './named-query.context';
11
- import { GraphqlContext } from './graphql.context';
12
- import { DistributedLockContext } from './distributed-lock.context';
13
- import { AiAssistantChatContext, AiAssistantMutationContext } from './ai-assistant.context';
14
- export type DocHash = string;
15
- export type SecurityResponse = {
16
- docsToHash: Record<SquidDocId, DocHash | undefined>;
17
- rulesPassed: true;
18
- } | {
19
- rulesPassed: false;
20
- };
21
- export interface ServiceConfig {
22
- context: RunContext;
23
- logger: Logger;
24
- secrets: Record<SecretKey, any>;
25
- backendApiKey: string;
26
- codeDir: string;
27
- auth: Auth | undefined;
28
- }
29
- export type SecureDatabaseAction<T extends DatabaseActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? (context?: QueryContext) => boolean | Promise<boolean> : (context?: MutationContext) => boolean | Promise<boolean>;
30
- export type SecureApiAction = (context?: ApiCallContext) => boolean | Promise<boolean>;
31
- export type SecureNamedQueryAction = (context?: NamedQueryContext) => boolean | Promise<boolean>;
32
- export type SecureDistributedLockAction = (context?: DistributedLockContext) => boolean | Promise<boolean>;
33
- export type SecureGraphQLAction = (context?: GraphqlContext) => boolean | Promise<boolean>;
34
- export type SecureAiAssistantAction<T extends AiAssistantActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'chat' ? (context?: AiAssistantChatContext) => boolean | Promise<boolean> : (context?: AiAssistantMutationContext) => boolean | Promise<boolean>;
35
- export type TransformDatabaseAction<T extends DatabaseActionType> = T extends 'read' ? (request?: TransformDatabaseReadRequest) => TransformDatabaseReadResponse | Promise<TransformDatabaseReadResponse> : (request?: TransformDatabaseWriteRequest) => TransformDatabaseWriteResponse | Promise<TransformDatabaseWriteResponse>;
36
- export interface TransformDatabaseReadRequest {
37
- documents: Array<SquidDocument>;
38
- }
39
- export interface TransformDatabaseWriteRequest {
40
- mutations: Array<Mutation>;
41
- }
42
- export type TransformDatabaseReadResponse = Array<SquidDocument>;
43
- export type TransformDatabaseWriteResponse = Array<Mutation>;
44
- export type ExecutableAction = (...args: any[]) => any;
45
- export type TriggerAction = (request?: TriggerRequest) => void | Promise<void>;
46
- export interface TriggerRequest<T extends DocumentData = any> {
47
- squidDocId: SquidDocId;
48
- mutationType: MutationType;
49
- docBefore?: T;
50
- docAfter?: T;
51
- }
52
- export type SchedulerAction = () => void | Promise<void>;
53
- export type WebhookAction = (request?: WebhookRequest) => any;
54
- export interface WebhookRequest {
55
- body: any;
56
- queryParams: Record<string, string>;
57
- headers: Record<string, string>;
58
- files: Array<SquidFile>;
59
- }
60
- export interface SquidFile {
61
- data: Uint8Array;
62
- fieldName: string;
63
- mimetype: string;
64
- originalName: string;
65
- size: number;
66
- encoding?: string;
67
- }
68
- export type ActionMethodDecorator<U> = <T extends U>(target: Object, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
1
+ import { AiAssistantActionType, DatabaseActionType } from './bundle-data.types';
2
+ import { Auth, RunContext } from './context.types';
3
+ import { DocumentData, SquidDocId, SquidDocument } from './document.types';
4
+ import { Logger } from './logger.types';
5
+ import { MutationContext } from './mutation.context';
6
+ import { Mutation, MutationType } from './mutation.types';
7
+ import { QueryContext } from './query';
8
+ import { SecretKey } from './secret.types';
9
+ import { ApiCallContext } from './api-call.context';
10
+ import { NamedQueryContext } from './named-query.context';
11
+ import { GraphqlContext } from './graphql.context';
12
+ import { DistributedLockContext } from './distributed-lock.context';
13
+ import { AiAssistantChatContext, AiAssistantMutationContext } from './ai-assistant.context';
14
+ export type DocHash = string;
15
+ export type SecurityResponse = {
16
+ docsToHash: Record<SquidDocId, DocHash | undefined>;
17
+ rulesPassed: true;
18
+ } | {
19
+ rulesPassed: false;
20
+ };
21
+ export interface ServiceConfig {
22
+ context: RunContext;
23
+ logger: Logger;
24
+ secrets: Record<SecretKey, any>;
25
+ backendApiKey: string;
26
+ codeDir: string;
27
+ auth: Auth | undefined;
28
+ }
29
+ export type SecureDatabaseAction<T extends DatabaseActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? (context?: QueryContext) => boolean | Promise<boolean> : (context?: MutationContext) => boolean | Promise<boolean>;
30
+ export type SecureApiAction = (context?: ApiCallContext) => boolean | Promise<boolean>;
31
+ export type SecureNamedQueryAction = (context?: NamedQueryContext) => boolean | Promise<boolean>;
32
+ export type SecureDistributedLockAction = (context?: DistributedLockContext) => boolean | Promise<boolean>;
33
+ export type SecureGraphQLAction = (context?: GraphqlContext) => boolean | Promise<boolean>;
34
+ export type SecureAiAssistantAction<T extends AiAssistantActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'chat' ? (context?: AiAssistantChatContext) => boolean | Promise<boolean> : (context?: AiAssistantMutationContext) => boolean | Promise<boolean>;
35
+ export type TransformDatabaseAction<T extends DatabaseActionType> = T extends 'read' ? (request?: TransformDatabaseReadRequest) => TransformDatabaseReadResponse | Promise<TransformDatabaseReadResponse> : (request?: TransformDatabaseWriteRequest) => TransformDatabaseWriteResponse | Promise<TransformDatabaseWriteResponse>;
36
+ export interface TransformDatabaseReadRequest {
37
+ documents: Array<SquidDocument>;
38
+ }
39
+ export interface TransformDatabaseWriteRequest {
40
+ mutations: Array<Mutation>;
41
+ }
42
+ export type TransformDatabaseReadResponse = Array<SquidDocument>;
43
+ export type TransformDatabaseWriteResponse = Array<Mutation>;
44
+ export type ExecutableAction = (...args: any[]) => any;
45
+ export type TriggerAction = (request?: TriggerRequest) => void | Promise<void>;
46
+ export interface TriggerRequest<T extends DocumentData = any> {
47
+ squidDocId: SquidDocId;
48
+ mutationType: MutationType;
49
+ docBefore?: T;
50
+ docAfter?: T;
51
+ }
52
+ export type SchedulerAction = () => void | Promise<void>;
53
+ export type WebhookAction = (request?: WebhookRequest) => any;
54
+ export interface WebhookRequest {
55
+ body: any;
56
+ queryParams: Record<string, string>;
57
+ headers: Record<string, string>;
58
+ files: Array<SquidFile>;
59
+ }
60
+ export interface SquidFile {
61
+ data: Uint8Array;
62
+ fieldName: string;
63
+ mimetype: string;
64
+ originalName: string;
65
+ size: number;
66
+ encoding?: string;
67
+ }
68
+ export type ActionMethodDecorator<U> = <T extends U>(target: Object, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
@@ -1,59 +1,59 @@
1
- import { QueryName, SchedulerConfig, SchedulerId, TriggerConfig, TriggerId, WebhookConfig, WebhookId } from './application.types';
2
- import { IntegrationId } from './communication.types';
3
- import { CollectionName } from './document.types';
4
- import { ApiEndpointId } from './integrations';
5
- export type DatabaseActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
6
- export type AiAssistantActionType = 'chat' | 'mutate' | 'all';
7
- export type ServiceName = string;
8
- export type FunctionName = string;
9
- export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
10
- export interface ApplicationBundleData {
11
- databases: Record<IntegrationId, DatabaseMetadata>;
12
- apis: Record<IntegrationId, {
13
- endpoints: Record<ApiEndpointId, ApiMetadata>;
14
- } & ApiMetadata>;
15
- graphql: Record<IntegrationId, GraphQLMetadata>;
16
- executables: Record<FunctionName, ExecutableMetadata>;
17
- triggers: Record<TriggerId, TriggerConfig>;
18
- schedulers: Record<SchedulerId, SchedulerConfig>;
19
- webhooks: Record<WebhookId, WebhookConfig>;
20
- namedQueries: Record<IntegrationId, Record<QueryName, NamedQueryMetadata>>;
21
- distributedLocks: {
22
- security?: Array<ServiceFunctionName>;
23
- mutexes?: Record<string, {
24
- security?: Array<ServiceFunctionName>;
25
- }>;
26
- };
27
- aiAssistants: Record<IntegrationId, {
28
- profiles: Record<string, AiAssistantMetadata>;
29
- } & AiAssistantMetadata>;
30
- }
31
- export interface DatabaseMetadata {
32
- collections: Record<CollectionName, CollectionMetadata>;
33
- security?: Record<DatabaseActionType, Array<ServiceFunctionName>>;
34
- transform?: Record<DatabaseActionType, DatabaseTransformMetadata>;
35
- }
36
- export interface CollectionMetadata {
37
- security?: Record<DatabaseActionType, Array<ServiceFunctionName>>;
38
- transform?: Record<DatabaseActionType, DatabaseTransformMetadata>;
39
- }
40
- export interface DatabaseTransformMetadata {
41
- serviceFunction: ServiceFunctionName;
42
- }
43
- export interface ExecutableMetadata {
44
- serviceFunction: ServiceFunctionName;
45
- }
46
- export interface NamedQueryMetadata {
47
- security?: Array<ServiceFunctionName>;
48
- queryString: string;
49
- }
50
- export interface ApiMetadata {
51
- security: Array<ServiceFunctionName>;
52
- }
53
- interface GraphQLMetadata {
54
- security: Array<ServiceFunctionName>;
55
- }
56
- export interface AiAssistantMetadata {
57
- security: Record<AiAssistantActionType, Array<ServiceFunctionName>>;
58
- }
59
- export {};
1
+ import { QueryName, SchedulerConfig, SchedulerId, TriggerConfig, TriggerId, WebhookConfig, WebhookId } from './application.types';
2
+ import { IntegrationId } from './communication.types';
3
+ import { CollectionName } from './document.types';
4
+ import { ApiEndpointId } from './integrations';
5
+ export type DatabaseActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
6
+ export type AiAssistantActionType = 'chat' | 'mutate' | 'all';
7
+ export type ServiceName = string;
8
+ export type FunctionName = string;
9
+ export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
10
+ export interface ApplicationBundleData {
11
+ databases: Record<IntegrationId, DatabaseMetadata>;
12
+ apis: Record<IntegrationId, {
13
+ endpoints: Record<ApiEndpointId, ApiMetadata>;
14
+ } & ApiMetadata>;
15
+ graphql: Record<IntegrationId, GraphQLMetadata>;
16
+ executables: Record<FunctionName, ExecutableMetadata>;
17
+ triggers: Record<TriggerId, TriggerConfig>;
18
+ schedulers: Record<SchedulerId, SchedulerConfig>;
19
+ webhooks: Record<WebhookId, WebhookConfig>;
20
+ namedQueries: Record<IntegrationId, Record<QueryName, NamedQueryMetadata>>;
21
+ distributedLocks: {
22
+ security?: Array<ServiceFunctionName>;
23
+ mutexes?: Record<string, {
24
+ security?: Array<ServiceFunctionName>;
25
+ }>;
26
+ };
27
+ aiAssistants: Record<IntegrationId, {
28
+ profiles: Record<string, AiAssistantMetadata>;
29
+ } & AiAssistantMetadata>;
30
+ }
31
+ export interface DatabaseMetadata {
32
+ collections: Record<CollectionName, CollectionMetadata>;
33
+ security?: Record<DatabaseActionType, Array<ServiceFunctionName>>;
34
+ transform?: Record<DatabaseActionType, DatabaseTransformMetadata>;
35
+ }
36
+ export interface CollectionMetadata {
37
+ security?: Record<DatabaseActionType, Array<ServiceFunctionName>>;
38
+ transform?: Record<DatabaseActionType, DatabaseTransformMetadata>;
39
+ }
40
+ export interface DatabaseTransformMetadata {
41
+ serviceFunction: ServiceFunctionName;
42
+ }
43
+ export interface ExecutableMetadata {
44
+ serviceFunction: ServiceFunctionName;
45
+ }
46
+ export interface NamedQueryMetadata {
47
+ security?: Array<ServiceFunctionName>;
48
+ queryString: string;
49
+ }
50
+ export interface ApiMetadata {
51
+ security: Array<ServiceFunctionName>;
52
+ }
53
+ interface GraphQLMetadata {
54
+ security: Array<ServiceFunctionName>;
55
+ }
56
+ export interface AiAssistantMetadata {
57
+ security: Record<AiAssistantActionType, Array<ServiceFunctionName>>;
58
+ }
59
+ export {};
@@ -1,4 +1,4 @@
1
- export type AppId = string;
2
- export type IntegrationId = string;
3
- export type ClientId = string;
4
- export type ClientRequestId = string;
1
+ export type AppId = string;
2
+ export type IntegrationId = string;
3
+ export type ClientId = string;
4
+ export type ClientRequestId = string;
@@ -1,32 +1,32 @@
1
- export type AuthType = 'Bearer' | 'ApiKey';
2
- /**
3
- * The payload of a JWT token in case an auth token was used.
4
- */
5
- export interface AuthWithBearer {
6
- type: 'Bearer';
7
- userId: string;
8
- expiration: number;
9
- attributes: Record<string, any>;
10
- }
11
- /**
12
- * The authentication object for the current request in case an API key is used.
13
- */
14
- export interface AuthWithApiKey {
15
- type: 'ApiKey';
16
- apiKey: string;
17
- }
18
- /** The authentication object for the current request. */
19
- export type Auth = AuthWithBearer | AuthWithApiKey;
20
- export interface AuthToken {
21
- type: AuthType;
22
- token: string;
23
- integrationId?: string;
24
- }
25
- /**
26
- * The context of a request to a service.
27
- */
28
- export interface RunContext {
29
- appId: string;
30
- sourceIp?: string;
31
- headers?: Record<string, any>;
32
- }
1
+ export type AuthType = 'Bearer' | 'ApiKey';
2
+ /**
3
+ * The payload of a JWT token in case an auth token was used.
4
+ */
5
+ export interface AuthWithBearer {
6
+ type: 'Bearer';
7
+ userId: string;
8
+ expiration: number;
9
+ attributes: Record<string, any>;
10
+ }
11
+ /**
12
+ * The authentication object for the current request in case an API key is used.
13
+ */
14
+ export interface AuthWithApiKey {
15
+ type: 'ApiKey';
16
+ apiKey: string;
17
+ }
18
+ /** The authentication object for the current request. */
19
+ export type Auth = AuthWithBearer | AuthWithApiKey;
20
+ export interface AuthToken {
21
+ type: AuthType;
22
+ token: string;
23
+ integrationId?: string;
24
+ }
25
+ /**
26
+ * The context of a request to a service.
27
+ */
28
+ export interface RunContext {
29
+ appId: string;
30
+ sourceIp?: string;
31
+ headers?: Record<string, any>;
32
+ }
@@ -1,5 +1,5 @@
1
- export declare class DistributedLockContext {
2
- readonly mutex: string;
3
- readonly exclusive: boolean;
4
- constructor(mutex: string, exclusive: boolean);
5
- }
1
+ export declare class DistributedLockContext {
2
+ readonly mutex: string;
3
+ readonly exclusive: boolean;
4
+ constructor(mutex: string, exclusive: boolean);
5
+ }
@@ -1,37 +1,37 @@
1
- import { IntegrationId } from './communication.types';
2
- export type FieldName<T = any> = string & keyof T;
3
- export type PrimitiveFieldType = string | number | boolean | null | Date;
4
- export type FieldType = PrimitiveFieldType | Array<FieldType> | {
5
- [key: string]: FieldType;
6
- };
7
- export type DocId = string;
8
- export type DocIdObj = Record<FieldName, any>;
9
- export type CollectionName = string;
10
- /** The collection name with the db name or schema depends on the database type (e.g, mySchema.myTable) */
11
- export type FullCollectionName = string;
12
- export type DocTimestamp = number;
13
- export interface SquidDocIdObj {
14
- collectionName: CollectionName;
15
- docId: DocId;
16
- integrationId: IntegrationId;
17
- }
18
- export interface BeforeAndAfterDocs<T = SquidDocument> {
19
- before: T | undefined;
20
- after: T | undefined;
21
- }
22
- export type SquidDocId = string;
23
- export interface SquidDocument {
24
- __docId__: DocId;
25
- __ts__: DocTimestamp;
26
- [fieldName: string]: FieldType | undefined;
27
- }
28
- export type DocumentData = Record<FieldName, any | undefined>;
29
- export declare function parseSquidDocId(squidDocId: SquidDocId): SquidDocIdObj;
30
- export declare function getSquidDocId(squidDocIdObj: SquidDocIdObj): SquidDocId;
31
- export declare function getSquidDocId(docId: DocId, collectionName: CollectionName, integrationId: IntegrationId): SquidDocId;
32
- /**
33
- * Determines whether a beforeDoc and an afterDoc have the same properties.
34
- * Our internal properties such as __docId__ and __ts__ are excluded from the
35
- * comparison, as well as any primary keys changes.
36
- */
37
- export declare function hasDocumentDiff(beforeDoc: SquidDocument | undefined, afterDoc: SquidDocument | undefined): boolean;
1
+ import { IntegrationId } from './communication.types';
2
+ export type FieldName<T = any> = string & keyof T;
3
+ export type PrimitiveFieldType = string | number | boolean | null | Date;
4
+ export type FieldType = PrimitiveFieldType | Array<FieldType> | {
5
+ [key: string]: FieldType;
6
+ };
7
+ export type DocId = string;
8
+ export type DocIdObj = Record<FieldName, any>;
9
+ export type CollectionName = string;
10
+ /** The collection name with the db name or schema depends on the database type (e.g, mySchema.myTable) */
11
+ export type FullCollectionName = string;
12
+ export type DocTimestamp = number;
13
+ export interface SquidDocIdObj {
14
+ collectionName: CollectionName;
15
+ docId: DocId;
16
+ integrationId: IntegrationId;
17
+ }
18
+ export interface BeforeAndAfterDocs<T = SquidDocument> {
19
+ before: T | undefined;
20
+ after: T | undefined;
21
+ }
22
+ export type SquidDocId = string;
23
+ export interface SquidDocument {
24
+ __docId__: DocId;
25
+ __ts__: DocTimestamp;
26
+ [fieldName: string]: FieldType | undefined;
27
+ }
28
+ export type DocumentData = Record<FieldName, any | undefined>;
29
+ export declare function parseSquidDocId(squidDocId: SquidDocId): SquidDocIdObj;
30
+ export declare function getSquidDocId(squidDocIdObj: SquidDocIdObj): SquidDocId;
31
+ export declare function getSquidDocId(docId: DocId, collectionName: CollectionName, integrationId: IntegrationId): SquidDocId;
32
+ /**
33
+ * Determines whether a beforeDoc and an afterDoc have the same properties.
34
+ * Our internal properties such as __docId__ and __ts__ are excluded from the
35
+ * comparison, as well as any primary keys changes.
36
+ */
37
+ export declare function hasDocumentDiff(beforeDoc: SquidDocument | undefined, afterDoc: SquidDocument | undefined): boolean;
@@ -1,6 +1,6 @@
1
- export declare class GraphqlContext {
2
- readonly isGraphiQL: boolean;
3
- readonly query: string | undefined;
4
- readonly variables: string | Record<string, any> | undefined;
5
- readonly operationName: string | undefined;
6
- }
1
+ export declare class GraphqlContext {
2
+ readonly isGraphiQL: boolean;
3
+ readonly query: string | undefined;
4
+ readonly variables: string | Record<string, any> | undefined;
5
+ readonly operationName: string | undefined;
6
+ }
@@ -1,11 +1,11 @@
1
- import { IntrospectionQuery } from 'graphql';
2
- export { ExecutionResult, IntrospectionQuery } from 'graphql';
3
- export interface GraphQLRequest {
4
- operationName?: string;
5
- query?: string;
6
- variables?: string | Record<string, any>;
7
- }
8
- export interface SecureGraphQLRequest extends GraphQLRequest {
9
- isGraphiQL: boolean;
10
- }
11
- export declare const EmptyIntrospection: IntrospectionQuery;
1
+ import { IntrospectionQuery } from 'graphql';
2
+ export { ExecutionResult, IntrospectionQuery } from 'graphql';
3
+ export interface GraphQLRequest {
4
+ operationName?: string;
5
+ query?: string;
6
+ variables?: string | Record<string, any>;
7
+ }
8
+ export interface SecureGraphQLRequest extends GraphQLRequest {
9
+ isGraphiQL: boolean;
10
+ }
11
+ export declare const EmptyIntrospection: IntrospectionQuery;
@@ -1,50 +1,50 @@
1
- export declare enum HttpStatus {
2
- CONTINUE = 100,
3
- SWITCHING_PROTOCOLS = 101,
4
- PROCESSING = 102,
5
- EARLYHINTS = 103,
6
- OK = 200,
7
- CREATED = 201,
8
- ACCEPTED = 202,
9
- NON_AUTHORITATIVE_INFORMATION = 203,
10
- NO_CONTENT = 204,
11
- RESET_CONTENT = 205,
12
- PARTIAL_CONTENT = 206,
13
- AMBIGUOUS = 300,
14
- MOVED_PERMANENTLY = 301,
15
- FOUND = 302,
16
- SEE_OTHER = 303,
17
- NOT_MODIFIED = 304,
18
- TEMPORARY_REDIRECT = 307,
19
- PERMANENT_REDIRECT = 308,
20
- BAD_REQUEST = 400,
21
- UNAUTHORIZED = 401,
22
- PAYMENT_REQUIRED = 402,
23
- FORBIDDEN = 403,
24
- NOT_FOUND = 404,
25
- METHOD_NOT_ALLOWED = 405,
26
- NOT_ACCEPTABLE = 406,
27
- PROXY_AUTHENTICATION_REQUIRED = 407,
28
- REQUEST_TIMEOUT = 408,
29
- CONFLICT = 409,
30
- GONE = 410,
31
- LENGTH_REQUIRED = 411,
32
- PRECONDITION_FAILED = 412,
33
- PAYLOAD_TOO_LARGE = 413,
34
- URI_TOO_LONG = 414,
35
- UNSUPPORTED_MEDIA_TYPE = 415,
36
- REQUESTED_RANGE_NOT_SATISFIABLE = 416,
37
- EXPECTATION_FAILED = 417,
38
- I_AM_A_TEAPOT = 418,
39
- MISDIRECTED = 421,
40
- UNPROCESSABLE_ENTITY = 422,
41
- FAILED_DEPENDENCY = 424,
42
- PRECONDITION_REQUIRED = 428,
43
- TOO_MANY_REQUESTS = 429,
44
- INTERNAL_SERVER_ERROR = 500,
45
- NOT_IMPLEMENTED = 501,
46
- BAD_GATEWAY = 502,
47
- SERVICE_UNAVAILABLE = 503,
48
- GATEWAY_TIMEOUT = 504,
49
- HTTP_VERSION_NOT_SUPPORTED = 505
50
- }
1
+ export declare enum HttpStatus {
2
+ CONTINUE = 100,
3
+ SWITCHING_PROTOCOLS = 101,
4
+ PROCESSING = 102,
5
+ EARLYHINTS = 103,
6
+ OK = 200,
7
+ CREATED = 201,
8
+ ACCEPTED = 202,
9
+ NON_AUTHORITATIVE_INFORMATION = 203,
10
+ NO_CONTENT = 204,
11
+ RESET_CONTENT = 205,
12
+ PARTIAL_CONTENT = 206,
13
+ AMBIGUOUS = 300,
14
+ MOVED_PERMANENTLY = 301,
15
+ FOUND = 302,
16
+ SEE_OTHER = 303,
17
+ NOT_MODIFIED = 304,
18
+ TEMPORARY_REDIRECT = 307,
19
+ PERMANENT_REDIRECT = 308,
20
+ BAD_REQUEST = 400,
21
+ UNAUTHORIZED = 401,
22
+ PAYMENT_REQUIRED = 402,
23
+ FORBIDDEN = 403,
24
+ NOT_FOUND = 404,
25
+ METHOD_NOT_ALLOWED = 405,
26
+ NOT_ACCEPTABLE = 406,
27
+ PROXY_AUTHENTICATION_REQUIRED = 407,
28
+ REQUEST_TIMEOUT = 408,
29
+ CONFLICT = 409,
30
+ GONE = 410,
31
+ LENGTH_REQUIRED = 411,
32
+ PRECONDITION_FAILED = 412,
33
+ PAYLOAD_TOO_LARGE = 413,
34
+ URI_TOO_LONG = 414,
35
+ UNSUPPORTED_MEDIA_TYPE = 415,
36
+ REQUESTED_RANGE_NOT_SATISFIABLE = 416,
37
+ EXPECTATION_FAILED = 417,
38
+ I_AM_A_TEAPOT = 418,
39
+ MISDIRECTED = 421,
40
+ UNPROCESSABLE_ENTITY = 422,
41
+ FAILED_DEPENDENCY = 424,
42
+ PRECONDITION_REQUIRED = 428,
43
+ TOO_MANY_REQUESTS = 429,
44
+ INTERNAL_SERVER_ERROR = 500,
45
+ NOT_IMPLEMENTED = 501,
46
+ BAD_GATEWAY = 502,
47
+ SERVICE_UNAVAILABLE = 503,
48
+ GATEWAY_TIMEOUT = 504,
49
+ HTTP_VERSION_NOT_SUPPORTED = 505
50
+ }