@squidcloud/backend 1.0.7 → 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.
Files changed (89) hide show
  1. package/dist/index.js +6 -10
  2. package/package.json +2 -2
  3. package/dist/backend/src/actions.d.ts +0 -13
  4. package/dist/backend/src/index.d.ts +0 -3
  5. package/dist/backend/src/metadata.d.ts +0 -234
  6. package/dist/backend/src/project.d.ts +0 -4
  7. package/dist/backend/src/service.d.ts +0 -18
  8. package/dist/common/src/api-call.context.d.ts +0 -17
  9. package/dist/common/src/api.types.d.ts +0 -10
  10. package/dist/common/src/application.schemas.d.ts +0 -608
  11. package/dist/common/src/application.types.d.ts +0 -197
  12. package/dist/common/src/backend-function.schemas.d.ts +0 -3
  13. package/dist/common/src/backend-function.types.d.ts +0 -7
  14. package/dist/common/src/backend-run.types.d.ts +0 -60
  15. package/dist/common/src/bundle-api.types.d.ts +0 -66
  16. package/dist/common/src/bundle-data.types.d.ts +0 -47
  17. package/dist/common/src/communication.types.d.ts +0 -4
  18. package/dist/common/src/context.types.d.ts +0 -21
  19. package/dist/common/src/document.types.d.ts +0 -35
  20. package/dist/common/src/executable.context.d.ts +0 -4
  21. package/dist/common/src/graphql.context.d.ts +0 -14
  22. package/dist/common/src/graphql.types.d.ts +0 -8
  23. package/dist/common/src/http-status.enum.d.ts +0 -50
  24. package/dist/common/src/index.d.ts +0 -50
  25. package/dist/common/src/integration.types.d.ts +0 -249
  26. package/dist/common/src/logger.types.d.ts +0 -22
  27. package/dist/common/src/metrics.schemas.d.ts +0 -3
  28. package/dist/common/src/metrics.types.d.ts +0 -65
  29. package/dist/common/src/mutation.context.d.ts +0 -11
  30. package/dist/common/src/mutation.schemas.d.ts +0 -5
  31. package/dist/common/src/mutation.types.d.ts +0 -72
  32. package/dist/common/src/named-query.context.d.ts +0 -4
  33. package/dist/common/src/named-query.schemas.d.ts +0 -3
  34. package/dist/common/src/named-query.types.d.ts +0 -9
  35. package/dist/common/src/query/index.d.ts +0 -2
  36. package/dist/common/src/query/query-context.d.ts +0 -38
  37. package/dist/common/src/query/simple-query-builder.d.ts +0 -14
  38. package/dist/common/src/query.schemas.d.ts +0 -5
  39. package/dist/common/src/query.types.d.ts +0 -118
  40. package/dist/common/src/regions.d.ts +0 -17
  41. package/dist/common/src/schema/schema.types.d.ts +0 -54
  42. package/dist/common/src/secret.schemas.d.ts +0 -6
  43. package/dist/common/src/secret.types.d.ts +0 -38
  44. package/dist/common/src/socket.schemas.d.ts +0 -3
  45. package/dist/common/src/socket.types.d.ts +0 -68
  46. package/dist/common/src/time-units.d.ts +0 -5
  47. package/dist/common/src/trigger.types.d.ts +0 -15
  48. package/dist/common/src/types.d.ts +0 -15
  49. package/dist/common/src/utils/array.d.ts +0 -8
  50. package/dist/common/src/utils/assert.d.ts +0 -8
  51. package/dist/common/src/utils/error.d.ts +0 -4
  52. package/dist/common/src/utils/id.d.ts +0 -1
  53. package/dist/common/src/utils/lock.manager.d.ts +0 -14
  54. package/dist/common/src/utils/nullish.d.ts +0 -1
  55. package/dist/common/src/utils/object.d.ts +0 -6
  56. package/dist/common/src/utils/serialization.d.ts +0 -6
  57. package/dist/common/src/utils/transforms.d.ts +0 -18
  58. package/dist/common/src/utils/url.d.ts +0 -1
  59. package/dist/common/src/utils/validation.d.ts +0 -30
  60. package/dist/common/src/webhook-response.d.ts +0 -7
  61. package/dist/index.js.LICENSE.txt +0 -38
  62. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +0 -1239
  63. package/dist/typescript-client/src/api.manager.d.ts +0 -14
  64. package/dist/typescript-client/src/backend-function.manager.d.ts +0 -13
  65. package/dist/typescript-client/src/collection-reference.d.ts +0 -19
  66. package/dist/typescript-client/src/collection-reference.factory.d.ts +0 -16
  67. package/dist/typescript-client/src/data.manager.d.ts +0 -164
  68. package/dist/typescript-client/src/destruct.manager.d.ts +0 -9
  69. package/dist/typescript-client/src/document-identity.service.d.ts +0 -12
  70. package/dist/typescript-client/src/document-reference.d.ts +0 -23
  71. package/dist/typescript-client/src/document-reference.factory.d.ts +0 -9
  72. package/dist/typescript-client/src/document-store.d.ts +0 -11
  73. package/dist/typescript-client/src/graphql-client.d.ts +0 -9
  74. package/dist/typescript-client/src/graphql-client.factory.d.ts +0 -9
  75. package/dist/typescript-client/src/index.d.ts +0 -7
  76. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +0 -11
  77. package/dist/typescript-client/src/named-query.manager.d.ts +0 -13
  78. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +0 -35
  79. package/dist/typescript-client/src/query/query-builder.factory.d.ts +0 -37
  80. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +0 -59
  81. package/dist/typescript-client/src/query/query.types.d.ts +0 -7
  82. package/dist/typescript-client/src/rpc.manager.d.ts +0 -24
  83. package/dist/typescript-client/src/socket.manager.d.ts +0 -27
  84. package/dist/typescript-client/src/squid.d.ts +0 -51
  85. package/dist/typescript-client/src/state/action.applier.d.ts +0 -7
  86. package/dist/typescript-client/src/state/actions.d.ts +0 -29
  87. package/dist/typescript-client/src/state/path_trie.d.ts +0 -27
  88. package/dist/typescript-client/src/state/state.service.d.ts +0 -22
  89. package/dist/typescript-client/src/types.d.ts +0 -2
@@ -1,197 +0,0 @@
1
- import { ApplicationBundleData, ServiceFunctionName } from './bundle-data.types';
2
- import { AppId, IntegrationId } from './communication.types';
3
- import { CollectionName } from './document.types';
4
- import { ApiEndpoint, ApiEndpointId, GraphQLConnectionOptions, Integration, IntegrationDataSchema, IntegrationGraphQLSchema, IntegrationType, MongoConnectionOptions, MssqlConnectionOptions, MySqlConnectionOptions, PostgresConnectionOptions } from './integration.types';
5
- export type WebhookId = string;
6
- export type QueryName = string;
7
- export type TriggerId = string;
8
- export type SchedulerId = string;
9
- export type CronExpressionString = `${string} ${string} ${string} ${string} ${string}` | `${string} ${string} ${string} ${string}`;
10
- export declare enum CronExpression {
11
- EVERY_SECOND = "* * * * * *",
12
- EVERY_5_SECONDS = "*/5 * * * * *",
13
- EVERY_10_SECONDS = "*/10 * * * * *",
14
- EVERY_30_SECONDS = "*/30 * * * * *",
15
- EVERY_MINUTE = "*/1 * * * *",
16
- EVERY_5_MINUTES = "0 */5 * * * *",
17
- EVERY_10_MINUTES = "0 */10 * * * *",
18
- EVERY_30_MINUTES = "0 */30 * * * *",
19
- EVERY_HOUR = "0 0-23/1 * * *",
20
- EVERY_2_HOURS = "0 0-23/2 * * *",
21
- EVERY_3_HOURS = "0 0-23/3 * * *",
22
- EVERY_4_HOURS = "0 0-23/4 * * *",
23
- EVERY_5_HOURS = "0 0-23/5 * * *",
24
- EVERY_6_HOURS = "0 0-23/6 * * *",
25
- EVERY_7_HOURS = "0 0-23/7 * * *",
26
- EVERY_8_HOURS = "0 0-23/8 * * *",
27
- EVERY_9_HOURS = "0 0-23/9 * * *",
28
- EVERY_10_HOURS = "0 0-23/10 * * *",
29
- EVERY_11_HOURS = "0 0-23/11 * * *",
30
- EVERY_12_HOURS = "0 0-23/12 * * *",
31
- EVERY_DAY_AT_1AM = "0 01 * * *",
32
- EVERY_DAY_AT_2AM = "0 02 * * *",
33
- EVERY_DAY_AT_3AM = "0 03 * * *",
34
- EVERY_DAY_AT_4AM = "0 04 * * *",
35
- EVERY_DAY_AT_5AM = "0 05 * * *",
36
- EVERY_DAY_AT_6AM = "0 06 * * *",
37
- EVERY_DAY_AT_7AM = "0 07 * * *",
38
- EVERY_DAY_AT_8AM = "0 08 * * *",
39
- EVERY_DAY_AT_9AM = "0 09 * * *",
40
- EVERY_DAY_AT_10AM = "0 10 * * *",
41
- EVERY_DAY_AT_11AM = "0 11 * * *",
42
- EVERY_DAY_AT_NOON = "0 12 * * *",
43
- EVERY_DAY_AT_1PM = "0 13 * * *",
44
- EVERY_DAY_AT_2PM = "0 14 * * *",
45
- EVERY_DAY_AT_3PM = "0 15 * * *",
46
- EVERY_DAY_AT_4PM = "0 16 * * *",
47
- EVERY_DAY_AT_5PM = "0 17 * * *",
48
- EVERY_DAY_AT_6PM = "0 18 * * *",
49
- EVERY_DAY_AT_7PM = "0 19 * * *",
50
- EVERY_DAY_AT_8PM = "0 20 * * *",
51
- EVERY_DAY_AT_9PM = "0 21 * * *",
52
- EVERY_DAY_AT_10PM = "0 22 * * *",
53
- EVERY_DAY_AT_11PM = "0 23 * * *",
54
- EVERY_DAY_AT_MIDNIGHT = "0 0 * * *",
55
- EVERY_WEEK = "0 0 * * 0",
56
- EVERY_WEEKDAY = "0 0 * * 1-5",
57
- EVERY_WEEKEND = "0 0 * * 6,0",
58
- EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT = "0 0 1 * *",
59
- EVERY_1ST_DAY_OF_MONTH_AT_NOON = "0 12 1 * *",
60
- EVERY_2ND_HOUR = "0 */2 * * *",
61
- EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM = "0 1-23/2 * * *",
62
- EVERY_2ND_MONTH = "0 0 1 */2 *",
63
- EVERY_QUARTER = "0 0 1 */3 *",
64
- EVERY_6_MONTHS = "0 0 1 */6 *",
65
- EVERY_YEAR = "0 0 1 0 *",
66
- EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM = "0 */30 9-17 * * *",
67
- EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM = "0 */30 9-18 * * *",
68
- EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM = "0 */30 10-19 * * *",
69
- MONDAY_TO_FRIDAY_AT_1AM = "0 0 01 * * 1-5",
70
- MONDAY_TO_FRIDAY_AT_2AM = "0 0 02 * * 1-5",
71
- MONDAY_TO_FRIDAY_AT_3AM = "0 0 03 * * 1-5",
72
- MONDAY_TO_FRIDAY_AT_4AM = "0 0 04 * * 1-5",
73
- MONDAY_TO_FRIDAY_AT_5AM = "0 0 05 * * 1-5",
74
- MONDAY_TO_FRIDAY_AT_6AM = "0 0 06 * * 1-5",
75
- MONDAY_TO_FRIDAY_AT_7AM = "0 0 07 * * 1-5",
76
- MONDAY_TO_FRIDAY_AT_8AM = "0 0 08 * * 1-5",
77
- MONDAY_TO_FRIDAY_AT_9AM = "0 0 09 * * 1-5",
78
- MONDAY_TO_FRIDAY_AT_09_30AM = "0 30 09 * * 1-5",
79
- MONDAY_TO_FRIDAY_AT_10AM = "0 0 10 * * 1-5",
80
- MONDAY_TO_FRIDAY_AT_11AM = "0 0 11 * * 1-5",
81
- MONDAY_TO_FRIDAY_AT_11_30AM = "0 30 11 * * 1-5",
82
- MONDAY_TO_FRIDAY_AT_12PM = "0 0 12 * * 1-5",
83
- MONDAY_TO_FRIDAY_AT_1PM = "0 0 13 * * 1-5",
84
- MONDAY_TO_FRIDAY_AT_2PM = "0 0 14 * * 1-5",
85
- MONDAY_TO_FRIDAY_AT_3PM = "0 0 15 * * 1-5",
86
- MONDAY_TO_FRIDAY_AT_4PM = "0 0 16 * * 1-5",
87
- MONDAY_TO_FRIDAY_AT_5PM = "0 0 17 * * 1-5",
88
- MONDAY_TO_FRIDAY_AT_6PM = "0 0 18 * * 1-5",
89
- MONDAY_TO_FRIDAY_AT_7PM = "0 0 19 * * 1-5",
90
- MONDAY_TO_FRIDAY_AT_8PM = "0 0 20 * * 1-5",
91
- MONDAY_TO_FRIDAY_AT_9PM = "0 0 21 * * 1-5",
92
- MONDAY_TO_FRIDAY_AT_10PM = "0 0 22 * * 1-5",
93
- MONDAY_TO_FRIDAY_AT_11PM = "0 0 23 * * 1-5"
94
- }
95
- export type OpenIdProviderType = 'auth0';
96
- export type CodeUrl = string;
97
- export interface TriggerConfig {
98
- integrationId: IntegrationId;
99
- collectionName: CollectionName;
100
- functionName: ServiceFunctionName;
101
- }
102
- export interface SchedulerConfig {
103
- functionName: ServiceFunctionName;
104
- cronExpression: string;
105
- }
106
- export interface WebhookConfig {
107
- functionName: ServiceFunctionName;
108
- }
109
- export interface OpenIdProvider {
110
- providerType: OpenIdProviderType;
111
- clientId: string;
112
- domain: string;
113
- }
114
- export interface Application {
115
- appId: AppId;
116
- createdAt: Date;
117
- updatedAt: Date;
118
- allowedHosts: string[];
119
- openIdProvider?: OpenIdProvider;
120
- integrations: Record<IntegrationId, Integration>;
121
- codeUrl?: string;
122
- bundleMetadata?: ApplicationBundleData;
123
- }
124
- export interface UpdateOpenIdProviderRequest {
125
- openIdProvider: OpenIdProvider;
126
- }
127
- export interface CreateApplicationResponse {
128
- appId: AppId;
129
- }
130
- export type UpsertIntegrationRequest = UpsertDataIntegrationRequest | UpsertGraphQLIntegrationRequest | UpsertApiIntegrationRequest;
131
- export type UpsertDataIntegrationRequest = UpsertInternalIntegrationRequest | UpsertMongoDbIntegrationRequest | UpsertMssqlIntegrationRequest | UpsertMySqlIntegrationRequest | UpsertPostgresIntegrationRequest | UpsertCockroachIntegrationRequest;
132
- interface BaseUpsertIntegrationRequest {
133
- id: IntegrationId;
134
- type: IntegrationType;
135
- secured?: boolean;
136
- }
137
- interface BaseUpsertDataIntegrationRequest extends BaseUpsertIntegrationRequest {
138
- supportsExternalChanges?: boolean;
139
- }
140
- export interface UpsertInternalIntegrationRequest extends BaseUpsertDataIntegrationRequest {
141
- type: IntegrationType.internal;
142
- schema?: IntegrationDataSchema;
143
- }
144
- export interface UpsertMongoDbIntegrationRequest extends BaseUpsertDataIntegrationRequest {
145
- type: IntegrationType.mongo;
146
- schema?: IntegrationDataSchema;
147
- configuration: {
148
- connectionOptions: MongoConnectionOptions;
149
- };
150
- }
151
- export interface UpsertMySqlIntegrationRequest extends BaseUpsertDataIntegrationRequest {
152
- type: IntegrationType.mysql;
153
- schema?: IntegrationDataSchema;
154
- configuration: {
155
- connectionOptions: MySqlConnectionOptions;
156
- };
157
- }
158
- export interface UpsertMssqlIntegrationRequest extends BaseUpsertDataIntegrationRequest {
159
- type: IntegrationType.mssql;
160
- schema?: IntegrationDataSchema;
161
- configuration: {
162
- connectionOptions: MssqlConnectionOptions;
163
- };
164
- }
165
- export interface UpsertPostgresIntegrationRequest extends BaseUpsertDataIntegrationRequest {
166
- type: IntegrationType.postgres;
167
- schema?: IntegrationDataSchema;
168
- configuration: {
169
- connectionOptions: PostgresConnectionOptions;
170
- };
171
- }
172
- export interface UpsertCockroachIntegrationRequest extends BaseUpsertDataIntegrationRequest {
173
- type: IntegrationType.cockroach;
174
- schema?: IntegrationDataSchema;
175
- configuration: {
176
- connectionOptions: PostgresConnectionOptions;
177
- };
178
- }
179
- export interface UpsertGraphQLIntegrationRequest extends BaseUpsertIntegrationRequest {
180
- type: IntegrationType.graphql;
181
- schema?: IntegrationGraphQLSchema;
182
- configuration: {
183
- connectionOptions: GraphQLConnectionOptions;
184
- };
185
- }
186
- export interface UpsertApiIntegrationRequest extends BaseUpsertIntegrationRequest {
187
- type: IntegrationType.api;
188
- baseUrl: string;
189
- endpoints: Record<ApiEndpointId, ApiEndpoint>;
190
- }
191
- export interface DeleteIntegrationRequest {
192
- integrationId: IntegrationId;
193
- }
194
- export interface UpdateAllowedHostsRequest {
195
- allowedHosts: string[];
196
- }
197
- export {};
@@ -1,3 +0,0 @@
1
- import { JSONSchemaType } from 'ajv';
2
- import { ExecuteBackendFunctionRequest } from './backend-function.types';
3
- export declare const ExecuteBackendFunctionRequestSchema: JSONSchemaType<ExecuteBackendFunctionRequest>;
@@ -1,7 +0,0 @@
1
- import { ClientId, ClientRequestId } from './communication.types';
2
- export interface ExecuteBackendFunctionRequest {
3
- functionName: string;
4
- paramsArrayStr: string;
5
- clientRequestId: ClientRequestId;
6
- clientId: ClientId;
7
- }
@@ -1,60 +0,0 @@
1
- import { Auth, RunContext } from './context.types';
2
- import { ServiceFunctionName } from './bundle-data.types';
3
- import { SecretKey, SecretValue } from './secret.types';
4
- export interface RunPermissions {
5
- hosts: Array<string>;
6
- }
7
- export interface ErrorResponse extends GeneralResponse {
8
- ok: false;
9
- error: string;
10
- details?: string;
11
- }
12
- export interface GeneralResponse {
13
- ok: boolean;
14
- }
15
- export interface RunConfiguration {
16
- codeUrl: string;
17
- codeUrlId: string;
18
- isSecurityRules: boolean;
19
- permissions: RunPermissions;
20
- }
21
- export interface RunConfigurationRequest {
22
- configuration: RunConfiguration;
23
- context: RunContext;
24
- auth: Auth | undefined;
25
- functionToRun: string;
26
- params: Array<unknown>;
27
- secrets?: RunSecrets;
28
- }
29
- export type EvaluateRulesFunctionRequest = {
30
- functionName: ServiceFunctionName;
31
- params: Array<any>;
32
- };
33
- export interface LoadJsPayload {
34
- codeUrl: string;
35
- }
36
- export interface ExecuteFunctionPayload {
37
- functionName: string;
38
- params: Array<unknown>;
39
- context: RunContext;
40
- auth: Auth | undefined;
41
- secrets?: Record<SecretKey, SecretValue>;
42
- backendApiKey: string;
43
- codeDir: string;
44
- }
45
- export type WorkerActionType = 'loadJs' | 'executeFunction' | 'ping' | 'terminate';
46
- export interface ActionRequest {
47
- action: WorkerActionType;
48
- payload?: LoadJsPayload | ExecuteFunctionPayload;
49
- traceContext?: any;
50
- }
51
- export type LoadJsResponse = GeneralResponse;
52
- export type TerminateResponse = GeneralResponse;
53
- export interface ExecuteFunctionResponse extends GeneralResponse {
54
- ok: true;
55
- functionResponse: unknown;
56
- }
57
- export interface RunSecrets {
58
- custom: Record<SecretKey, SecretValue>;
59
- backendApiKey: string;
60
- }
@@ -1,66 +0,0 @@
1
- import { ActionType } 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 { ExecutableContext } from './executable.context';
10
- import { ApiCallContext } from './api-call.context';
11
- import { NamedQueryContext } from './named-query.context';
12
- import { GraphqlContext } from './graphql.context';
13
- export type DocHash = string;
14
- export type SecurityResponse = {
15
- docsToHash: Record<SquidDocId, DocHash | undefined>;
16
- rulesPassed: true;
17
- } | {
18
- rulesPassed: false;
19
- };
20
- export interface ServiceConfig {
21
- context: RunContext;
22
- logger: Logger;
23
- secrets: Record<SecretKey, any>;
24
- backendApiKey: string;
25
- codeDir: string;
26
- auth: Auth | undefined;
27
- }
28
- export type SecureDatabaseAction<T extends ActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? (context?: QueryContext) => boolean | Promise<boolean> : (context?: MutationContext) => boolean | Promise<boolean>;
29
- export type SecureApiAction = (context?: ApiCallContext) => boolean | Promise<boolean>;
30
- export type SecureExecutableAction = (context?: ExecutableContext) => boolean | Promise<boolean>;
31
- export type SecureNamedQueryAction = (context?: NamedQueryContext) => boolean | Promise<boolean>;
32
- export type SecureGraphQLAction = (context?: GraphqlContext) => boolean | Promise<boolean>;
33
- export type TransformDatabaseAction<T extends ActionType> = T extends 'read' ? (request?: TransformDatabaseReadRequest) => TransformDatabaseReadResponse | Promise<TransformDatabaseReadResponse> : (request?: TransformDatabaseWriteRequest) => TransformDatabaseWriteResponse | Promise<TransformDatabaseWriteResponse>;
34
- export interface TransformDatabaseReadRequest {
35
- documents: Array<SquidDocument>;
36
- }
37
- export interface TransformDatabaseWriteRequest {
38
- mutations: Array<Mutation>;
39
- }
40
- export type TransformDatabaseReadResponse = Array<SquidDocument>;
41
- export type TransformDatabaseWriteResponse = Array<Mutation>;
42
- export type ExecutableAction = (...args: any[]) => any;
43
- export type TriggerAction = (request?: TriggerRequest) => void | Promise<void>;
44
- export interface TriggerRequest<T extends DocumentData = any> {
45
- squidDocId: SquidDocId;
46
- mutationType: MutationType;
47
- docBefore?: T;
48
- docAfter?: T;
49
- }
50
- export type SchedulerAction = () => void | Promise<void>;
51
- export type WebhookAction = (request?: WebhookRequest) => any;
52
- export interface WebhookRequest {
53
- body: any;
54
- queryParams: Record<string, string>;
55
- headers: Record<string, string>;
56
- files: Array<SquidFile>;
57
- }
58
- export interface SquidFile {
59
- data: Uint8Array;
60
- fieldName: string;
61
- mimetype: string;
62
- originalName: string;
63
- size: number;
64
- encoding?: string;
65
- }
66
- export type ActionMethodDecorator<U> = <T extends U>(target: Object, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
@@ -1,47 +0,0 @@
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 './integration.types';
5
- export type ActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
6
- export type ServiceName = string;
7
- export type FunctionName = string;
8
- export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
9
- export interface ApplicationBundleData {
10
- databases: Record<IntegrationId, DatabaseMetadata>;
11
- apis: Record<IntegrationId, {
12
- endpoints: Record<ApiEndpointId, ApiMetadata>;
13
- } & ApiMetadata>;
14
- graphql: Record<IntegrationId, GraphQLMetadata>;
15
- executables: Record<FunctionName, ExecutableMetadata>;
16
- triggers: Record<TriggerId, TriggerConfig>;
17
- schedulers: Record<SchedulerId, SchedulerConfig>;
18
- webhooks: Record<WebhookId, WebhookConfig>;
19
- namedQueries: Record<IntegrationId, Record<QueryName, NamedQueryMetadata>>;
20
- }
21
- export interface DatabaseMetadata {
22
- collections: Record<CollectionName, CollectionMetadata>;
23
- security?: Record<ActionType, Array<ServiceFunctionName>>;
24
- transform?: Record<ActionType, DatabaseTransformMetadata>;
25
- }
26
- export interface CollectionMetadata {
27
- security?: Record<ActionType, Array<ServiceFunctionName>>;
28
- transform?: Record<ActionType, DatabaseTransformMetadata>;
29
- }
30
- export interface DatabaseTransformMetadata {
31
- serviceFunction: ServiceFunctionName;
32
- }
33
- export interface ExecutableMetadata {
34
- security?: Array<ServiceFunctionName>;
35
- serviceFunction: ServiceFunctionName;
36
- }
37
- export interface NamedQueryMetadata {
38
- security?: Array<ServiceFunctionName>;
39
- queryString: string;
40
- }
41
- export interface ApiMetadata {
42
- security: Array<ServiceFunctionName>;
43
- }
44
- interface GraphQLMetadata {
45
- security: Array<ServiceFunctionName>;
46
- }
47
- export {};
@@ -1,4 +0,0 @@
1
- export type AppId = string;
2
- export type IntegrationId = string;
3
- export type ClientId = string;
4
- export type ClientRequestId = string;
@@ -1,21 +0,0 @@
1
- export type AuthType = 'Bearer' | 'ApiKey';
2
- export interface AuthWithBearer {
3
- type: 'Bearer';
4
- userId: string;
5
- expiration: number;
6
- attributes: Record<string, any>;
7
- }
8
- export interface AuthWithApiKey {
9
- type: 'ApiKey';
10
- apiKey: string;
11
- }
12
- export type Auth = AuthWithBearer | AuthWithApiKey;
13
- export interface AuthToken {
14
- type: AuthType;
15
- token: string;
16
- }
17
- export interface RunContext {
18
- appId: string;
19
- sourceIp?: string;
20
- headers?: Record<string, any>;
21
- }
@@ -1,35 +0,0 @@
1
- import { IntegrationId } from './communication.types';
2
- export type FieldName<T = any> = string & keyof T;
3
- export type PrimitiveFieldType = string | number | boolean | null;
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
- export type DocTimestamp = number;
11
- export interface SquidDocIdObj {
12
- collectionName: CollectionName;
13
- docId: DocId;
14
- integrationId: IntegrationId;
15
- }
16
- export interface BeforeAndAfterDocs<T = SquidDocument> {
17
- before: T | undefined;
18
- after: T | undefined;
19
- }
20
- export type SquidDocId = string;
21
- export interface SquidDocument {
22
- __docId__: DocId;
23
- __ts__: DocTimestamp;
24
- [fieldName: string]: FieldType | undefined;
25
- }
26
- export type DocumentData = Record<FieldName, any | undefined>;
27
- export declare function parseSquidDocId(squidDocId: SquidDocId): SquidDocIdObj;
28
- export declare function getSquidDocId(squidDocIdObj: SquidDocIdObj): SquidDocId;
29
- export declare function getSquidDocId(docId: DocId, collectionName: CollectionName, integrationId: IntegrationId): SquidDocId;
30
- /**
31
- * Determines whether a beforeDoc and an afterDoc have the same properties.
32
- * Our internal properties such as __docId__ and __ts__ are excluded from the
33
- * comparison, as well as any primary keys changes.
34
- */
35
- export declare function hasDocumentDiff(beforeDoc: SquidDocument | undefined, afterDoc: SquidDocument | undefined): boolean;
@@ -1,4 +0,0 @@
1
- export declare class ExecutableContext<F extends (...args: any[]) => any = (...args: any[]) => any> {
2
- readonly params: Parameters<F>;
3
- constructor(params: Parameters<F>);
4
- }
@@ -1,14 +0,0 @@
1
- interface GraphQlRequest {
2
- isGraphiQL: boolean;
3
- query?: string;
4
- operationName?: string;
5
- variables?: string | Record<string, any>;
6
- }
7
- export declare class GraphqlContext {
8
- readonly isGraphiQL: boolean;
9
- readonly query: string | undefined;
10
- readonly variables: string | Record<string, any> | undefined;
11
- readonly operationName: string | undefined;
12
- constructor(graphQlRequest: GraphQlRequest);
13
- }
14
- export {};
@@ -1,8 +0,0 @@
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 declare const EmptyIntrospection: IntrospectionQuery;
@@ -1,50 +0,0 @@
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,50 +0,0 @@
1
- export * from './api-call.context';
2
- export * from './api.types';
3
- export * from './application.schemas';
4
- export * from './application.types';
5
- export * from './backend-function.schemas';
6
- export * from './backend-function.types';
7
- export * from './backend-run.types';
8
- export * from './bundle-api.types';
9
- export * from './bundle-data.types';
10
- export * from './communication.types';
11
- export * from './context.types';
12
- export * from './document.types';
13
- export * from './executable.context';
14
- export * from './graphql.context';
15
- export * from './graphql.types';
16
- export * from './http-status.enum';
17
- export * from './integration.types';
18
- export * from './logger.types';
19
- export * from './metrics.schemas';
20
- export * from './metrics.types';
21
- export * from './mutation.context';
22
- export * from './mutation.schemas';
23
- export * from './mutation.types';
24
- export * from './named-query.context';
25
- export * from './named-query.schemas';
26
- export * from './named-query.types';
27
- export * from './query';
28
- export * from './query.schemas';
29
- export * from './query.types';
30
- export * from './regions';
31
- export * from './schema/schema.types';
32
- export * from './secret.schemas';
33
- export * from './secret.types';
34
- export * from './socket.schemas';
35
- export * from './socket.types';
36
- export * from './time-units';
37
- export * from './trigger.types';
38
- export * from './types';
39
- export * from './utils/array';
40
- export * from './utils/assert';
41
- export * from './utils/error';
42
- export * from './utils/id';
43
- export * from './utils/lock.manager';
44
- export * from './utils/nullish';
45
- export * from './utils/object';
46
- export * from './utils/serialization';
47
- export * from './utils/transforms';
48
- export * from './utils/url';
49
- export * from './utils/validation';
50
- export * from './webhook-response';