@squidcloud/client 1.0.65 → 1.0.67

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 (100) hide show
  1. package/dist/common/src/ai-assistant.context.d.ts +12 -11
  2. package/dist/common/src/ai-assistant.schemas.d.ts +1 -210
  3. package/dist/common/src/ai-assistant.types.d.ts +2 -81
  4. package/dist/common/src/api-call.context.d.ts +13 -12
  5. package/dist/common/src/api.types.d.ts +4 -24
  6. package/dist/common/src/application.schemas.d.ts +1 -1060
  7. package/dist/common/src/application.types.d.ts +184 -224
  8. package/dist/common/src/auth.types.d.ts +1 -4
  9. package/dist/common/src/backend-function.schemas.d.ts +1 -3
  10. package/dist/common/src/backend-function.types.d.ts +1 -7
  11. package/dist/common/src/backend-run.types.d.ts +2 -53
  12. package/dist/common/src/bundle-api.types.d.ts +36 -68
  13. package/dist/common/src/bundle-data.types.d.ts +4 -59
  14. package/dist/common/src/communication.types.d.ts +22 -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 +22 -37
  18. package/dist/common/src/graphql.context.d.ts +7 -6
  19. package/dist/common/src/graphql.types.d.ts +9 -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 +1 -58
  30. package/dist/common/src/mutation.context.d.ts +12 -10
  31. package/dist/common/src/mutation.schemas.d.ts +1 -5
  32. package/dist/common/src/mutation.types.d.ts +53 -72
  33. package/dist/common/src/named-query.context.d.ts +4 -4
  34. package/dist/common/src/named-query.schemas.d.ts +1 -3
  35. package/dist/common/src/named-query.types.d.ts +1 -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 +1 -5
  40. package/dist/common/src/query.types.d.ts +51 -118
  41. package/dist/common/src/regions.d.ts +1 -22
  42. package/dist/common/src/schema/schema.types.d.ts +54 -54
  43. package/dist/common/src/secret.schemas.d.ts +1 -6
  44. package/dist/common/src/secret.types.d.ts +8 -49
  45. package/dist/common/src/security.types.d.ts +1 -3
  46. package/dist/common/src/socket.schemas.d.ts +1 -3
  47. package/dist/common/src/socket.types.d.ts +1 -108
  48. package/dist/common/src/time-units.d.ts +1 -5
  49. package/dist/common/src/trigger.types.d.ts +1 -15
  50. package/dist/common/src/types.d.ts +8 -15
  51. package/dist/common/src/utils/array.d.ts +1 -8
  52. package/dist/common/src/utils/assert.d.ts +1 -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 +1 -7
  64. package/dist/index.js +2 -2
  65. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
  66. package/dist/typescript-client/src/ai-assistant-client.d.ts +66 -66
  67. package/dist/typescript-client/src/ai-client.factory.d.ts +13 -13
  68. package/dist/typescript-client/src/api.manager.d.ts +15 -15
  69. package/dist/typescript-client/src/auth.manager.d.ts +23 -23
  70. package/dist/typescript-client/src/backend-function.manager.d.ts +13 -13
  71. package/dist/typescript-client/src/client-id.service.d.ts +24 -24
  72. package/dist/typescript-client/src/collection-reference.d.ts +81 -81
  73. package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -16
  74. package/dist/typescript-client/src/data.manager.d.ts +172 -172
  75. package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
  76. package/dist/typescript-client/src/distributed-lock.manager.d.ts +19 -19
  77. package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
  78. package/dist/typescript-client/src/document-reference.d.ts +134 -134
  79. package/dist/typescript-client/src/document-reference.factory.d.ts +9 -9
  80. package/dist/typescript-client/src/document-store.d.ts +11 -11
  81. package/dist/typescript-client/src/graphql-client.d.ts +12 -12
  82. package/dist/typescript-client/src/graphql-client.factory.d.ts +9 -9
  83. package/dist/typescript-client/src/index.d.ts +8 -8
  84. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +12 -12
  85. package/dist/typescript-client/src/named-query.manager.d.ts +14 -14
  86. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +72 -72
  87. package/dist/typescript-client/src/query/query-builder.factory.d.ts +83 -83
  88. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +64 -64
  89. package/dist/typescript-client/src/query/query.types.d.ts +14 -14
  90. package/dist/typescript-client/src/rpc.manager.d.ts +28 -28
  91. package/dist/typescript-client/src/socket.manager.d.ts +32 -32
  92. package/dist/typescript-client/src/squid.d.ts +196 -188
  93. package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
  94. package/dist/typescript-client/src/state/actions.d.ts +29 -29
  95. package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
  96. package/dist/typescript-client/src/state/state.service.d.ts +22 -22
  97. package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
  98. package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
  99. package/dist/typescript-client/src/types.d.ts +2 -2
  100. package/package.json +1 -1
@@ -1,224 +1,184 @@
1
- import { RunPermissions } from './backend-run.types';
2
- import { ApplicationBundleData, ServiceFunctionName } from './bundle-data.types';
3
- import { AppId, IntegrationId } from './communication.types';
4
- import { CollectionName } from './document.types';
5
- import { AiAssistantConfiguration, GraphQLConnectionOptions, IntegrationAiAssistantSchema, IntegrationApiSchema, IntegrationConfig, IntegrationDataSchema, IntegrationGraphQLSchema, IntegrationType, MongoConnectionOptions, MssqlConnectionOptions, MySqlConnectionOptions, OpenApiDiscoveryOptions, OracleConnectionOptions, PostgresConnectionOptions, SnowflakeConnectionOptions } from './integrations';
6
- export type WebhookId = string;
7
- export type QueryName = string;
8
- export type TriggerId = string;
9
- export type SchedulerId = string;
10
- export type CronExpressionString = `${string} ${string} ${string} ${string} ${string}` | `${string} ${string} ${string} ${string}`;
11
- export declare enum CronExpression {
12
- EVERY_SECOND = "* * * * * *",
13
- EVERY_5_SECONDS = "*/5 * * * * *",
14
- EVERY_10_SECONDS = "*/10 * * * * *",
15
- EVERY_30_SECONDS = "*/30 * * * * *",
16
- EVERY_MINUTE = "*/1 * * * *",
17
- EVERY_5_MINUTES = "0 */5 * * * *",
18
- EVERY_10_MINUTES = "0 */10 * * * *",
19
- EVERY_30_MINUTES = "0 */30 * * * *",
20
- EVERY_HOUR = "0 0-23/1 * * *",
21
- EVERY_2_HOURS = "0 0-23/2 * * *",
22
- EVERY_3_HOURS = "0 0-23/3 * * *",
23
- EVERY_4_HOURS = "0 0-23/4 * * *",
24
- EVERY_5_HOURS = "0 0-23/5 * * *",
25
- EVERY_6_HOURS = "0 0-23/6 * * *",
26
- EVERY_7_HOURS = "0 0-23/7 * * *",
27
- EVERY_8_HOURS = "0 0-23/8 * * *",
28
- EVERY_9_HOURS = "0 0-23/9 * * *",
29
- EVERY_10_HOURS = "0 0-23/10 * * *",
30
- EVERY_11_HOURS = "0 0-23/11 * * *",
31
- EVERY_12_HOURS = "0 0-23/12 * * *",
32
- EVERY_DAY_AT_1AM = "0 01 * * *",
33
- EVERY_DAY_AT_2AM = "0 02 * * *",
34
- EVERY_DAY_AT_3AM = "0 03 * * *",
35
- EVERY_DAY_AT_4AM = "0 04 * * *",
36
- EVERY_DAY_AT_5AM = "0 05 * * *",
37
- EVERY_DAY_AT_6AM = "0 06 * * *",
38
- EVERY_DAY_AT_7AM = "0 07 * * *",
39
- EVERY_DAY_AT_8AM = "0 08 * * *",
40
- EVERY_DAY_AT_9AM = "0 09 * * *",
41
- EVERY_DAY_AT_10AM = "0 10 * * *",
42
- EVERY_DAY_AT_11AM = "0 11 * * *",
43
- EVERY_DAY_AT_NOON = "0 12 * * *",
44
- EVERY_DAY_AT_1PM = "0 13 * * *",
45
- EVERY_DAY_AT_2PM = "0 14 * * *",
46
- EVERY_DAY_AT_3PM = "0 15 * * *",
47
- EVERY_DAY_AT_4PM = "0 16 * * *",
48
- EVERY_DAY_AT_5PM = "0 17 * * *",
49
- EVERY_DAY_AT_6PM = "0 18 * * *",
50
- EVERY_DAY_AT_7PM = "0 19 * * *",
51
- EVERY_DAY_AT_8PM = "0 20 * * *",
52
- EVERY_DAY_AT_9PM = "0 21 * * *",
53
- EVERY_DAY_AT_10PM = "0 22 * * *",
54
- EVERY_DAY_AT_11PM = "0 23 * * *",
55
- EVERY_DAY_AT_MIDNIGHT = "0 0 * * *",
56
- EVERY_WEEK = "0 0 * * 0",
57
- EVERY_WEEKDAY = "0 0 * * 1-5",
58
- EVERY_WEEKEND = "0 0 * * 6,0",
59
- EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT = "0 0 1 * *",
60
- EVERY_1ST_DAY_OF_MONTH_AT_NOON = "0 12 1 * *",
61
- EVERY_2ND_HOUR = "0 */2 * * *",
62
- EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM = "0 1-23/2 * * *",
63
- EVERY_2ND_MONTH = "0 0 1 */2 *",
64
- EVERY_QUARTER = "0 0 1 */3 *",
65
- EVERY_6_MONTHS = "0 0 1 */6 *",
66
- EVERY_YEAR = "0 0 1 0 *",
67
- EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM = "0 */30 9-17 * * *",
68
- EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM = "0 */30 9-18 * * *",
69
- EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM = "0 */30 10-19 * * *",
70
- MONDAY_TO_FRIDAY_AT_1AM = "0 0 01 * * 1-5",
71
- MONDAY_TO_FRIDAY_AT_2AM = "0 0 02 * * 1-5",
72
- MONDAY_TO_FRIDAY_AT_3AM = "0 0 03 * * 1-5",
73
- MONDAY_TO_FRIDAY_AT_4AM = "0 0 04 * * 1-5",
74
- MONDAY_TO_FRIDAY_AT_5AM = "0 0 05 * * 1-5",
75
- MONDAY_TO_FRIDAY_AT_6AM = "0 0 06 * * 1-5",
76
- MONDAY_TO_FRIDAY_AT_7AM = "0 0 07 * * 1-5",
77
- MONDAY_TO_FRIDAY_AT_8AM = "0 0 08 * * 1-5",
78
- MONDAY_TO_FRIDAY_AT_9AM = "0 0 09 * * 1-5",
79
- MONDAY_TO_FRIDAY_AT_09_30AM = "0 30 09 * * 1-5",
80
- MONDAY_TO_FRIDAY_AT_10AM = "0 0 10 * * 1-5",
81
- MONDAY_TO_FRIDAY_AT_11AM = "0 0 11 * * 1-5",
82
- MONDAY_TO_FRIDAY_AT_11_30AM = "0 30 11 * * 1-5",
83
- MONDAY_TO_FRIDAY_AT_12PM = "0 0 12 * * 1-5",
84
- MONDAY_TO_FRIDAY_AT_1PM = "0 0 13 * * 1-5",
85
- MONDAY_TO_FRIDAY_AT_2PM = "0 0 14 * * 1-5",
86
- MONDAY_TO_FRIDAY_AT_3PM = "0 0 15 * * 1-5",
87
- MONDAY_TO_FRIDAY_AT_4PM = "0 0 16 * * 1-5",
88
- MONDAY_TO_FRIDAY_AT_5PM = "0 0 17 * * 1-5",
89
- MONDAY_TO_FRIDAY_AT_6PM = "0 0 18 * * 1-5",
90
- MONDAY_TO_FRIDAY_AT_7PM = "0 0 19 * * 1-5",
91
- MONDAY_TO_FRIDAY_AT_8PM = "0 0 20 * * 1-5",
92
- MONDAY_TO_FRIDAY_AT_9PM = "0 0 21 * * 1-5",
93
- MONDAY_TO_FRIDAY_AT_10PM = "0 0 22 * * 1-5",
94
- MONDAY_TO_FRIDAY_AT_11PM = "0 0 23 * * 1-5"
95
- }
96
- export type OpenIdProviderType = 'auth0';
97
- export type CodeUrl = string;
98
- export interface TriggerConfig {
99
- integrationId: IntegrationId;
100
- collectionName: CollectionName;
101
- functionName: ServiceFunctionName;
102
- }
103
- export interface SchedulerConfig {
104
- functionName: ServiceFunctionName;
105
- cronExpression: string;
106
- exclusive: boolean;
107
- }
108
- export interface WebhookConfig {
109
- functionName: ServiceFunctionName;
110
- }
111
- export interface OpenIdProvider {
112
- providerType: OpenIdProviderType;
113
- clientId: string;
114
- domain: string;
115
- }
116
- export interface Application {
117
- appId: AppId;
118
- createdAt: Date;
119
- updatedAt: Date;
120
- allowedHosts: string[];
121
- openIdProvider?: OpenIdProvider;
122
- integrations: Record<IntegrationId, IntegrationConfig>;
123
- codeUrl?: string;
124
- bundleMetadata?: ApplicationBundleData;
125
- }
126
- export interface ApplicationInitDetails {
127
- codeUrl: string;
128
- codeUrlId: string;
129
- permissions: RunPermissions;
130
- }
131
- export interface UpdateOpenIdProviderRequest {
132
- openIdProvider: OpenIdProvider;
133
- }
134
- export interface CreateApplicationResponse {
135
- appId: AppId;
136
- }
137
- export type UpsertIntegrationRequest = UpsertDataIntegrationRequest | UpsertGraphQLIntegrationRequest | UpsertApiIntegrationRequest | UpsertAiAssistantIntegrationRequest;
138
- export type UpsertDataIntegrationRequest = UpsertInternalIntegrationRequest | UpsertMongoDbIntegrationRequest | UpsertMssqlIntegrationRequest | UpsertMySqlIntegrationRequest | UpsertOracleIntegrationRequest | UpsertPostgresIntegrationRequest | UpsertCockroachIntegrationRequest | UpsertSnowflakeIntegrationRequest;
139
- interface BaseUpsertIntegrationRequest {
140
- id: IntegrationId;
141
- type: IntegrationType;
142
- }
143
- interface BaseUpsertDataIntegrationRequest extends BaseUpsertIntegrationRequest {
144
- supportsExternalChanges?: boolean;
145
- }
146
- export interface UpsertInternalIntegrationRequest extends BaseUpsertDataIntegrationRequest {
147
- type: IntegrationType.built_in_db;
148
- schema?: IntegrationDataSchema;
149
- }
150
- export interface UpsertMongoDbIntegrationRequest extends BaseUpsertDataIntegrationRequest {
151
- type: IntegrationType.mongo;
152
- schema?: IntegrationDataSchema;
153
- configuration: {
154
- connectionOptions: MongoConnectionOptions;
155
- };
156
- }
157
- export interface UpsertMySqlIntegrationRequest extends BaseUpsertDataIntegrationRequest {
158
- type: IntegrationType.mysql;
159
- schema?: IntegrationDataSchema;
160
- configuration: {
161
- connectionOptions: MySqlConnectionOptions;
162
- };
163
- }
164
- export interface UpsertOracleIntegrationRequest extends BaseUpsertDataIntegrationRequest {
165
- type: IntegrationType.oracledb;
166
- schema?: IntegrationDataSchema;
167
- configuration: {
168
- connectionOptions: OracleConnectionOptions;
169
- };
170
- }
171
- export interface UpsertMssqlIntegrationRequest extends BaseUpsertDataIntegrationRequest {
172
- type: IntegrationType.mssql;
173
- schema?: IntegrationDataSchema;
174
- configuration: {
175
- connectionOptions: MssqlConnectionOptions;
176
- };
177
- }
178
- export interface UpsertPostgresIntegrationRequest extends BaseUpsertDataIntegrationRequest {
179
- type: IntegrationType.postgres;
180
- schema?: IntegrationDataSchema;
181
- configuration: {
182
- connectionOptions: PostgresConnectionOptions;
183
- };
184
- }
185
- export interface UpsertCockroachIntegrationRequest extends BaseUpsertDataIntegrationRequest {
186
- type: IntegrationType.cockroach;
187
- schema?: IntegrationDataSchema;
188
- configuration: {
189
- connectionOptions: PostgresConnectionOptions;
190
- };
191
- }
192
- export interface UpsertSnowflakeIntegrationRequest extends BaseUpsertDataIntegrationRequest {
193
- type: IntegrationType.snowflake;
194
- schema?: IntegrationDataSchema;
195
- configuration: {
196
- connectionOptions: SnowflakeConnectionOptions;
197
- };
198
- }
199
- export interface UpsertGraphQLIntegrationRequest extends BaseUpsertIntegrationRequest {
200
- type: IntegrationType.graphql;
201
- schema?: IntegrationGraphQLSchema;
202
- configuration: {
203
- connectionOptions: GraphQLConnectionOptions;
204
- };
205
- }
206
- export interface UpsertApiIntegrationRequest extends BaseUpsertIntegrationRequest {
207
- type: IntegrationType.api;
208
- schema?: IntegrationApiSchema;
209
- configuration?: {
210
- discoveryOptions: OpenApiDiscoveryOptions;
211
- };
212
- }
213
- export interface UpsertAiAssistantIntegrationRequest extends BaseUpsertIntegrationRequest {
214
- type: IntegrationType.ai_assistant;
215
- schema?: IntegrationAiAssistantSchema;
216
- configuration: AiAssistantConfiguration;
217
- }
218
- export interface DeleteIntegrationRequest {
219
- integrationId: IntegrationId;
220
- }
221
- export interface UpdateAllowedHostsRequest {
222
- allowedHosts: string[];
223
- }
224
- export {};
1
+ import { AppId, EnvironmentId, IntegrationId } from './communication.types';
2
+ import { AiAssistantConfiguration, GraphQLConnectionOptions, IntegrationAiAssistantSchema, IntegrationApiSchema, IntegrationDataSchema, IntegrationGraphQLSchema, IntegrationType, MongoConnectionOptions, MssqlConnectionOptions, MySqlConnectionOptions, OpenApiDiscoveryOptions, OracleConnectionOptions, PostgresConnectionOptions, SnowflakeConnectionOptions } from './integrations';
3
+ /** A type alias for a string that represents a webhook. */
4
+ export type WebhookId = string;
5
+ /** A type alias for a string that represents a named query. */
6
+ export type QueryName = string;
7
+ /** A type alias for a string that represents a trigger id. */
8
+ export type TriggerId = string;
9
+ /** A type alias for a string that represents a scheduler id. */
10
+ export type SchedulerId = string;
11
+ /** The supported cron expression string. */
12
+ export type CronExpressionString = `${string} ${string} ${string} ${string} ${string}` | `${string} ${string} ${string} ${string}`;
13
+ /** A set of predefined cron expressions. */
14
+ export declare enum CronExpression {
15
+ EVERY_SECOND = "* * * * * *",
16
+ EVERY_5_SECONDS = "*/5 * * * * *",
17
+ EVERY_10_SECONDS = "*/10 * * * * *",
18
+ EVERY_30_SECONDS = "*/30 * * * * *",
19
+ EVERY_MINUTE = "*/1 * * * *",
20
+ EVERY_5_MINUTES = "0 */5 * * * *",
21
+ EVERY_10_MINUTES = "0 */10 * * * *",
22
+ EVERY_30_MINUTES = "0 */30 * * * *",
23
+ EVERY_HOUR = "0 0-23/1 * * *",
24
+ EVERY_2_HOURS = "0 0-23/2 * * *",
25
+ EVERY_3_HOURS = "0 0-23/3 * * *",
26
+ EVERY_4_HOURS = "0 0-23/4 * * *",
27
+ EVERY_5_HOURS = "0 0-23/5 * * *",
28
+ EVERY_6_HOURS = "0 0-23/6 * * *",
29
+ EVERY_7_HOURS = "0 0-23/7 * * *",
30
+ EVERY_8_HOURS = "0 0-23/8 * * *",
31
+ EVERY_9_HOURS = "0 0-23/9 * * *",
32
+ EVERY_10_HOURS = "0 0-23/10 * * *",
33
+ EVERY_11_HOURS = "0 0-23/11 * * *",
34
+ EVERY_12_HOURS = "0 0-23/12 * * *",
35
+ EVERY_DAY_AT_1AM = "0 01 * * *",
36
+ EVERY_DAY_AT_2AM = "0 02 * * *",
37
+ EVERY_DAY_AT_3AM = "0 03 * * *",
38
+ EVERY_DAY_AT_4AM = "0 04 * * *",
39
+ EVERY_DAY_AT_5AM = "0 05 * * *",
40
+ EVERY_DAY_AT_6AM = "0 06 * * *",
41
+ EVERY_DAY_AT_7AM = "0 07 * * *",
42
+ EVERY_DAY_AT_8AM = "0 08 * * *",
43
+ EVERY_DAY_AT_9AM = "0 09 * * *",
44
+ EVERY_DAY_AT_10AM = "0 10 * * *",
45
+ EVERY_DAY_AT_11AM = "0 11 * * *",
46
+ EVERY_DAY_AT_NOON = "0 12 * * *",
47
+ EVERY_DAY_AT_1PM = "0 13 * * *",
48
+ EVERY_DAY_AT_2PM = "0 14 * * *",
49
+ EVERY_DAY_AT_3PM = "0 15 * * *",
50
+ EVERY_DAY_AT_4PM = "0 16 * * *",
51
+ EVERY_DAY_AT_5PM = "0 17 * * *",
52
+ EVERY_DAY_AT_6PM = "0 18 * * *",
53
+ EVERY_DAY_AT_7PM = "0 19 * * *",
54
+ EVERY_DAY_AT_8PM = "0 20 * * *",
55
+ EVERY_DAY_AT_9PM = "0 21 * * *",
56
+ EVERY_DAY_AT_10PM = "0 22 * * *",
57
+ EVERY_DAY_AT_11PM = "0 23 * * *",
58
+ EVERY_DAY_AT_MIDNIGHT = "0 0 * * *",
59
+ EVERY_WEEK = "0 0 * * 0",
60
+ EVERY_WEEKDAY = "0 0 * * 1-5",
61
+ EVERY_WEEKEND = "0 0 * * 6,0",
62
+ EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT = "0 0 1 * *",
63
+ EVERY_1ST_DAY_OF_MONTH_AT_NOON = "0 12 1 * *",
64
+ EVERY_2ND_HOUR = "0 */2 * * *",
65
+ EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM = "0 1-23/2 * * *",
66
+ EVERY_2ND_MONTH = "0 0 1 */2 *",
67
+ EVERY_QUARTER = "0 0 1 */3 *",
68
+ EVERY_6_MONTHS = "0 0 1 */6 *",
69
+ EVERY_YEAR = "0 0 1 0 *",
70
+ EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM = "0 */30 9-17 * * *",
71
+ EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM = "0 */30 9-18 * * *",
72
+ EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM = "0 */30 10-19 * * *",
73
+ MONDAY_TO_FRIDAY_AT_1AM = "0 0 01 * * 1-5",
74
+ MONDAY_TO_FRIDAY_AT_2AM = "0 0 02 * * 1-5",
75
+ MONDAY_TO_FRIDAY_AT_3AM = "0 0 03 * * 1-5",
76
+ MONDAY_TO_FRIDAY_AT_4AM = "0 0 04 * * 1-5",
77
+ MONDAY_TO_FRIDAY_AT_5AM = "0 0 05 * * 1-5",
78
+ MONDAY_TO_FRIDAY_AT_6AM = "0 0 06 * * 1-5",
79
+ MONDAY_TO_FRIDAY_AT_7AM = "0 0 07 * * 1-5",
80
+ MONDAY_TO_FRIDAY_AT_8AM = "0 0 08 * * 1-5",
81
+ MONDAY_TO_FRIDAY_AT_9AM = "0 0 09 * * 1-5",
82
+ MONDAY_TO_FRIDAY_AT_09_30AM = "0 30 09 * * 1-5",
83
+ MONDAY_TO_FRIDAY_AT_10AM = "0 0 10 * * 1-5",
84
+ MONDAY_TO_FRIDAY_AT_11AM = "0 0 11 * * 1-5",
85
+ MONDAY_TO_FRIDAY_AT_11_30AM = "0 30 11 * * 1-5",
86
+ MONDAY_TO_FRIDAY_AT_12PM = "0 0 12 * * 1-5",
87
+ MONDAY_TO_FRIDAY_AT_1PM = "0 0 13 * * 1-5",
88
+ MONDAY_TO_FRIDAY_AT_2PM = "0 0 14 * * 1-5",
89
+ MONDAY_TO_FRIDAY_AT_3PM = "0 0 15 * * 1-5",
90
+ MONDAY_TO_FRIDAY_AT_4PM = "0 0 16 * * 1-5",
91
+ MONDAY_TO_FRIDAY_AT_5PM = "0 0 17 * * 1-5",
92
+ MONDAY_TO_FRIDAY_AT_6PM = "0 0 18 * * 1-5",
93
+ MONDAY_TO_FRIDAY_AT_7PM = "0 0 19 * * 1-5",
94
+ MONDAY_TO_FRIDAY_AT_8PM = "0 0 20 * * 1-5",
95
+ MONDAY_TO_FRIDAY_AT_9PM = "0 0 21 * * 1-5",
96
+ MONDAY_TO_FRIDAY_AT_10PM = "0 0 22 * * 1-5",
97
+ MONDAY_TO_FRIDAY_AT_11PM = "0 0 23 * * 1-5"
98
+ }
99
+ interface BaseUpsertDataIntegrationRequest extends BaseUpsertIntegrationRequest {
100
+ supportsExternalChanges?: boolean;
101
+ }
102
+ export interface UpsertInternalIntegrationRequest extends BaseUpsertDataIntegrationRequest {
103
+ type: IntegrationType.built_in_db;
104
+ schema?: IntegrationDataSchema;
105
+ }
106
+ export interface UpsertMongoDbIntegrationRequest extends BaseUpsertDataIntegrationRequest {
107
+ type: IntegrationType.mongo;
108
+ schema?: IntegrationDataSchema;
109
+ configuration: {
110
+ connectionOptions: MongoConnectionOptions;
111
+ };
112
+ }
113
+ export interface UpsertMySqlIntegrationRequest extends BaseUpsertDataIntegrationRequest {
114
+ type: IntegrationType.mysql;
115
+ schema?: IntegrationDataSchema;
116
+ configuration: {
117
+ connectionOptions: MySqlConnectionOptions;
118
+ };
119
+ }
120
+ export interface UpsertOracleIntegrationRequest extends BaseUpsertDataIntegrationRequest {
121
+ type: IntegrationType.oracledb;
122
+ schema?: IntegrationDataSchema;
123
+ configuration: {
124
+ connectionOptions: OracleConnectionOptions;
125
+ };
126
+ }
127
+ export interface UpsertMssqlIntegrationRequest extends BaseUpsertDataIntegrationRequest {
128
+ type: IntegrationType.mssql;
129
+ schema?: IntegrationDataSchema;
130
+ configuration: {
131
+ connectionOptions: MssqlConnectionOptions;
132
+ };
133
+ }
134
+ export interface UpsertPostgresIntegrationRequest extends BaseUpsertDataIntegrationRequest {
135
+ type: IntegrationType.postgres;
136
+ schema?: IntegrationDataSchema;
137
+ configuration: {
138
+ connectionOptions: PostgresConnectionOptions;
139
+ };
140
+ }
141
+ export interface UpsertCockroachIntegrationRequest extends BaseUpsertDataIntegrationRequest {
142
+ type: IntegrationType.cockroach;
143
+ schema?: IntegrationDataSchema;
144
+ configuration: {
145
+ connectionOptions: PostgresConnectionOptions;
146
+ };
147
+ }
148
+ export interface UpsertSnowflakeIntegrationRequest extends BaseUpsertDataIntegrationRequest {
149
+ type: IntegrationType.snowflake;
150
+ schema?: IntegrationDataSchema;
151
+ configuration: {
152
+ connectionOptions: SnowflakeConnectionOptions;
153
+ };
154
+ }
155
+ export interface UpsertGraphQLIntegrationRequest extends BaseUpsertIntegrationRequest {
156
+ type: IntegrationType.graphql;
157
+ schema?: IntegrationGraphQLSchema;
158
+ configuration: {
159
+ connectionOptions: GraphQLConnectionOptions;
160
+ };
161
+ }
162
+ export interface UpsertApiIntegrationRequest extends BaseUpsertIntegrationRequest {
163
+ type: IntegrationType.api;
164
+ schema?: IntegrationApiSchema;
165
+ configuration?: {
166
+ discoveryOptions: OpenApiDiscoveryOptions;
167
+ };
168
+ }
169
+ export interface UpsertAiAssistantIntegrationRequest extends BaseUpsertIntegrationRequest {
170
+ type: IntegrationType.ai_assistant;
171
+ schema?: IntegrationAiAssistantSchema;
172
+ configuration: AiAssistantConfiguration;
173
+ }
174
+ export interface DeleteIntegrationRequest {
175
+ integrationId: IntegrationId;
176
+ }
177
+ export interface UpdateAllowedHostsRequest {
178
+ allowedHosts: string[];
179
+ }
180
+ export interface CreateEnvironmentRequest {
181
+ sourceAppId: AppId;
182
+ environmentId: EnvironmentId;
183
+ }
184
+ export {};
@@ -1,4 +1 @@
1
- export interface Validations {
2
- aud?: string;
3
- iss?: string;
4
- }
1
+ export {};
@@ -1,3 +1 @@
1
- import { JSONSchemaType } from 'ajv';
2
- import { ExecuteBackendFunctionRequest } from './backend-function.types';
3
- export declare const ExecuteBackendFunctionRequestSchema: JSONSchemaType<ExecuteBackendFunctionRequest>;
1
+ export {};
@@ -1,7 +1 @@
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
+ export {};
@@ -1,53 +1,2 @@
1
- import { Auth, RunContext } from './context.types';
2
- import { SecretKey, SecretValue } from './secret.types';
3
- export interface RunPermissions {
4
- hosts: Array<string>;
5
- }
6
- export interface ErrorResponse extends GeneralResponse {
7
- ok: false;
8
- error: string;
9
- details?: string;
10
- functionName: 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 LoadJsPayload {
22
- codeUrl: string;
23
- }
24
- export declare const ExecuteFunctionSecureAnnotations: readonly ["secureDistributedLock", "secureQuery", "secureMutation", "secureNamedQuery", "secureGraphQL", "secureApi", "secureAiAssistantChat", "secureAiAssistantMutation"];
25
- export type ExecuteFunctionSecureAnnotationType = (typeof ExecuteFunctionSecureAnnotations)[number];
26
- export type ExecuteFunctionAnnotationType = 'executable' | 'webhook' | 'scheduler' | 'trigger' | 'transformRead' | 'transformWrite' | 'metadata' | ExecuteFunctionSecureAnnotationType;
27
- export interface ExecuteFunctionPayload {
28
- functionName: string;
29
- params: Array<unknown>;
30
- context: RunContext;
31
- auth: Auth | undefined;
32
- secrets?: Record<SecretKey, SecretValue>;
33
- backendApiKey: string;
34
- codeDir: string;
35
- executeFunctionAnnotationType: ExecuteFunctionAnnotationType;
36
- }
37
- export declare function transformParams(args: Array<any>, executeFunctionAnnotationType: ExecuteFunctionAnnotationType): unknown[];
38
- export declare function transformResponse(functionResponse: any, executeFunctionAnnotationType: ExecuteFunctionAnnotationType): any;
39
- export type WorkerActionType = 'loadJs' | 'executeFunction' | 'ping' | 'terminate';
40
- export interface ActionRequest {
41
- action: WorkerActionType;
42
- payload?: LoadJsPayload | ExecuteFunctionPayload;
43
- }
44
- export type LoadJsResponse = GeneralResponse;
45
- export type TerminateResponse = GeneralResponse;
46
- export interface ExecuteFunctionResponse extends GeneralResponse {
47
- ok: true;
48
- functionResponse: unknown;
49
- }
50
- export interface RunSecrets {
51
- custom: Record<SecretKey, SecretValue>;
52
- backendApiKey: string;
53
- }
1
+ import { ApplicationSecrets } from './secret.types';
2
+ export declare function convertToRunSecrets(appSecrets: ApplicationSecrets): RunSecrets;
@@ -1,68 +1,36 @@
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 { DocumentData, SquidDocId } from './document.types';
3
+ import { MutationContext } from './mutation.context';
4
+ import { MutationType } from './mutation.types';
5
+ import { QueryContext } from './query';
6
+ import { ApiCallContext } from './api-call.context';
7
+ import { NamedQueryContext } from './named-query.context';
8
+ import { GraphqlContext } from './graphql.context';
9
+ import { DistributedLockContext } from './distributed-lock.context';
10
+ import { AiAssistantChatContext, AiAssistantMutationContext } from './ai-assistant.context';
11
+ 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>;
12
+ export type SecureApiAction = (context?: ApiCallContext) => boolean | Promise<boolean>;
13
+ export type SecureNamedQueryAction = (context?: NamedQueryContext) => boolean | Promise<boolean>;
14
+ export type SecureDistributedLockAction = (context?: DistributedLockContext) => boolean | Promise<boolean>;
15
+ export type SecureGraphQLAction = (context?: GraphqlContext) => boolean | Promise<boolean>;
16
+ 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>;
17
+ export type TransformDatabaseAction<T extends DatabaseActionType> = T extends 'read' ? (request?: TransformDatabaseReadRequest) => TransformDatabaseReadResponse | Promise<TransformDatabaseReadResponse> : (request?: TransformDatabaseWriteRequest) => TransformDatabaseWriteResponse | Promise<TransformDatabaseWriteResponse>;
18
+ export type ExecutableAction = (...args: any[]) => any;
19
+ export type TriggerAction = (request?: TriggerRequest) => void | Promise<void>;
20
+ /** The context provided to a trigger function. */
21
+ export interface TriggerRequest<T extends DocumentData = any> {
22
+ squidDocId: SquidDocId;
23
+ mutationType: MutationType;
24
+ docBefore?: T;
25
+ docAfter?: T;
26
+ }
27
+ export type SchedulerAction = () => void | Promise<void>;
28
+ export type WebhookAction = (request?: WebhookRequest) => any;
29
+ /** The context provided to a webhook function. */
30
+ export interface WebhookRequest {
31
+ body: any;
32
+ queryParams: Record<string, string>;
33
+ headers: Record<string, string>;
34
+ files: Array<SquidFile>;
35
+ }
36
+ export type ActionMethodDecorator<U> = <T extends U>(target: Object, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;