@squidcloud/local-backend 1.0.159 → 1.0.161

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 (169) hide show
  1. package/dist/internal-common/src/code-executor.types.d.ts +15 -0
  2. package/dist/internal-common/src/code-executor.types.js +3 -0
  3. package/dist/internal-common/src/code-executor.types.js.map +1 -0
  4. package/dist/internal-common/src/local-dev.types.d.ts +54 -0
  5. package/dist/internal-common/src/local-dev.types.js +11 -0
  6. package/dist/internal-common/src/local-dev.types.js.map +1 -0
  7. package/dist/internal-common/src/public-types/ai-chatbot.public-types.d.ts +27 -0
  8. package/dist/internal-common/src/public-types/ai-chatbot.public-types.js +11 -0
  9. package/dist/internal-common/src/public-types/ai-chatbot.public-types.js.map +1 -0
  10. package/dist/internal-common/src/public-types/application.public-types.d.ts +201 -0
  11. package/dist/internal-common/src/public-types/application.public-types.js +90 -0
  12. package/dist/internal-common/src/public-types/application.public-types.js.map +1 -0
  13. package/dist/internal-common/src/public-types/bundle-api.public-types.d.ts +55 -0
  14. package/dist/internal-common/src/public-types/bundle-api.public-types.js +3 -0
  15. package/dist/internal-common/src/public-types/bundle-api.public-types.js.map +1 -0
  16. package/dist/internal-common/src/public-types/bundle-data.public-types.d.ts +5 -0
  17. package/dist/internal-common/src/public-types/bundle-data.public-types.js +3 -0
  18. package/dist/internal-common/src/public-types/bundle-data.public-types.js.map +1 -0
  19. package/dist/internal-common/src/public-types/communication.public-types.d.ts +9 -0
  20. package/dist/internal-common/src/public-types/communication.public-types.js +6 -0
  21. package/dist/internal-common/src/public-types/communication.public-types.js.map +1 -0
  22. package/dist/internal-common/src/public-types/context.public-types.d.ts +24 -0
  23. package/dist/internal-common/src/public-types/context.public-types.js +3 -0
  24. package/dist/internal-common/src/public-types/context.public-types.js.map +1 -0
  25. package/dist/internal-common/src/public-types/document.public-types.d.ts +25 -0
  26. package/dist/internal-common/src/public-types/document.public-types.js +3 -0
  27. package/dist/internal-common/src/public-types/document.public-types.js.map +1 -0
  28. package/dist/internal-common/src/public-types/graphql.public-types.d.ts +9 -0
  29. package/dist/internal-common/src/public-types/graphql.public-types.js +3 -0
  30. package/dist/internal-common/src/public-types/graphql.public-types.js.map +1 -0
  31. package/dist/internal-common/src/public-types/integration.public-types.d.ts +62 -0
  32. package/dist/internal-common/src/public-types/integration.public-types.js +69 -0
  33. package/dist/internal-common/src/public-types/integration.public-types.js.map +1 -0
  34. package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +32 -0
  35. package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.js +3 -0
  36. package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.js.map +1 -0
  37. package/dist/internal-common/src/public-types/integrations/api.types.d.ts +81 -0
  38. package/dist/internal-common/src/public-types/integrations/api.types.js +3 -0
  39. package/dist/internal-common/src/public-types/integrations/api.types.js.map +1 -0
  40. package/dist/internal-common/src/public-types/integrations/auth.types.d.ts +46 -0
  41. package/dist/internal-common/src/public-types/integrations/auth.types.js +3 -0
  42. package/dist/internal-common/src/public-types/integrations/auth.types.js.map +1 -0
  43. package/dist/internal-common/src/public-types/integrations/database.types.d.ts +275 -0
  44. package/dist/internal-common/src/public-types/integrations/database.types.js +3 -0
  45. package/dist/internal-common/src/public-types/integrations/database.types.js.map +1 -0
  46. package/dist/internal-common/src/public-types/integrations/observability.types.d.ts +24 -0
  47. package/dist/internal-common/src/public-types/integrations/observability.types.js +24 -0
  48. package/dist/internal-common/src/public-types/integrations/observability.types.js.map +1 -0
  49. package/dist/internal-common/src/public-types/integrations/queue-types.d.ts +40 -0
  50. package/dist/internal-common/src/public-types/integrations/queue-types.js +3 -0
  51. package/dist/internal-common/src/public-types/integrations/queue-types.js.map +1 -0
  52. package/dist/internal-common/src/public-types/integrations/schemas.d.ts +79 -0
  53. package/dist/internal-common/src/public-types/integrations/schemas.js +48 -0
  54. package/dist/internal-common/src/public-types/integrations/schemas.js.map +1 -0
  55. package/dist/internal-common/src/public-types/mutation.public-context.d.ts +13 -0
  56. package/dist/internal-common/src/public-types/mutation.public-context.js +27 -0
  57. package/dist/internal-common/src/public-types/mutation.public-context.js.map +1 -0
  58. package/dist/internal-common/src/public-types/mutation.public-types.d.ts +44 -0
  59. package/dist/internal-common/src/public-types/mutation.public-types.js +3 -0
  60. package/dist/internal-common/src/public-types/mutation.public-types.js.map +1 -0
  61. package/dist/internal-common/src/public-types/query.public-context.d.ts +47 -0
  62. package/dist/internal-common/src/public-types/query.public-context.js +161 -0
  63. package/dist/internal-common/src/public-types/query.public-context.js.map +1 -0
  64. package/dist/internal-common/src/public-types/query.public-types.d.ts +56 -0
  65. package/dist/internal-common/src/public-types/query.public-types.js +8 -0
  66. package/dist/internal-common/src/public-types/query.public-types.js.map +1 -0
  67. package/dist/internal-common/src/public-types/schema.public-types.d.ts +22 -0
  68. package/dist/internal-common/src/public-types/schema.public-types.js +3 -0
  69. package/dist/internal-common/src/public-types/schema.public-types.js.map +1 -0
  70. package/dist/internal-common/src/public-types/secret.public-types.d.ts +13 -0
  71. package/dist/internal-common/src/public-types/secret.public-types.js +3 -0
  72. package/dist/internal-common/src/public-types/secret.public-types.js.map +1 -0
  73. package/dist/internal-common/src/public-types/socket.public-types.d.ts +5 -0
  74. package/dist/internal-common/src/public-types/socket.public-types.js +10 -0
  75. package/dist/internal-common/src/public-types/socket.public-types.js.map +1 -0
  76. package/dist/internal-common/src/public-types/topic.public-context.d.ts +10 -0
  77. package/dist/internal-common/src/public-types/topic.public-context.js +3 -0
  78. package/dist/internal-common/src/public-types/topic.public-context.js.map +1 -0
  79. package/dist/internal-common/src/public-types/typescript.public-types.d.ts +21 -0
  80. package/dist/internal-common/src/public-types/typescript.public-types.js +3 -0
  81. package/dist/internal-common/src/public-types/typescript.public-types.js.map +1 -0
  82. package/dist/internal-common/src/types/ai-chatbot.context.d.ts +13 -0
  83. package/dist/internal-common/src/types/ai-chatbot.context.js +20 -0
  84. package/dist/internal-common/src/types/ai-chatbot.context.js.map +1 -0
  85. package/dist/internal-common/src/types/ai-chatbot.types.d.ts +101 -0
  86. package/dist/internal-common/src/types/ai-chatbot.types.js +21 -0
  87. package/dist/internal-common/src/types/ai-chatbot.types.js.map +1 -0
  88. package/dist/internal-common/src/types/api-call.context.d.ts +13 -0
  89. package/dist/internal-common/src/types/api-call.context.js +17 -0
  90. package/dist/internal-common/src/types/api-call.context.js.map +1 -0
  91. package/dist/internal-common/src/types/api.types.d.ts +22 -0
  92. package/dist/internal-common/src/types/api.types.js +3 -0
  93. package/dist/internal-common/src/types/api.types.js.map +1 -0
  94. package/dist/internal-common/src/types/backend-run.types.d.ts +53 -0
  95. package/dist/internal-common/src/types/backend-run.types.js +30 -0
  96. package/dist/internal-common/src/types/backend-run.types.js.map +1 -0
  97. package/dist/internal-common/src/types/bundle-data.types.d.ts +82 -0
  98. package/dist/internal-common/src/types/bundle-data.types.js +3 -0
  99. package/dist/internal-common/src/types/bundle-data.types.js.map +1 -0
  100. package/dist/internal-common/src/types/communication.types.d.ts +13 -0
  101. package/dist/internal-common/src/types/communication.types.js +40 -0
  102. package/dist/internal-common/src/types/communication.types.js.map +1 -0
  103. package/dist/internal-common/src/types/distributed-lock.context.d.ts +4 -0
  104. package/dist/internal-common/src/types/distributed-lock.context.js +10 -0
  105. package/dist/internal-common/src/types/distributed-lock.context.js.map +1 -0
  106. package/dist/internal-common/src/types/graphql.context.d.ts +14 -0
  107. package/dist/internal-common/src/types/graphql.context.js +13 -0
  108. package/dist/internal-common/src/types/graphql.context.js.map +1 -0
  109. package/dist/internal-common/src/types/logger.types.d.ts +21 -0
  110. package/dist/internal-common/src/types/logger.types.js +12 -0
  111. package/dist/internal-common/src/types/logger.types.js.map +1 -0
  112. package/dist/internal-common/src/types/native-query.context.d.ts +7 -0
  113. package/dist/internal-common/src/types/native-query.context.js +12 -0
  114. package/dist/internal-common/src/types/native-query.context.js.map +1 -0
  115. package/dist/internal-common/src/types/openapi-response.d.ts +6 -0
  116. package/dist/internal-common/src/types/openapi-response.js +3 -0
  117. package/dist/internal-common/src/types/openapi-response.js.map +1 -0
  118. package/dist/internal-common/src/types/openapi.types.d.ts +26 -0
  119. package/dist/internal-common/src/types/openapi.types.js +3 -0
  120. package/dist/internal-common/src/types/openapi.types.js.map +1 -0
  121. package/dist/internal-common/src/types/query.types.d.ts +34 -0
  122. package/dist/internal-common/src/types/query.types.js +94 -0
  123. package/dist/internal-common/src/types/query.types.js.map +1 -0
  124. package/dist/internal-common/src/types/secret.types.d.ts +55 -0
  125. package/dist/internal-common/src/types/secret.types.js +6 -0
  126. package/dist/internal-common/src/types/secret.types.js.map +1 -0
  127. package/dist/internal-common/src/types/security.types.d.ts +22 -0
  128. package/dist/internal-common/src/types/security.types.js +3 -0
  129. package/dist/internal-common/src/types/security.types.js.map +1 -0
  130. package/dist/internal-common/src/utils/backend-transforms.d.ts +3 -0
  131. package/dist/internal-common/src/utils/backend-transforms.js +93 -0
  132. package/dist/internal-common/src/utils/backend-transforms.js.map +1 -0
  133. package/dist/internal-common/src/utils/global.utils.d.ts +11 -0
  134. package/dist/internal-common/src/utils/global.utils.js +51 -0
  135. package/dist/internal-common/src/utils/global.utils.js.map +1 -0
  136. package/dist/internal-common/src/utils/http.d.ts +2 -0
  137. package/dist/internal-common/src/utils/http.js +57 -0
  138. package/dist/internal-common/src/utils/http.js.map +1 -0
  139. package/dist/internal-common/src/utils/serialization.d.ts +5 -0
  140. package/dist/internal-common/src/utils/serialization.js +74 -0
  141. package/dist/internal-common/src/utils/serialization.js.map +1 -0
  142. package/dist/internal-common/src/websocket.impl.d.ts +21 -0
  143. package/dist/internal-common/src/websocket.impl.js +80 -0
  144. package/dist/internal-common/src/websocket.impl.js.map +1 -0
  145. package/dist/local-backend/openapi-template.hbs +1 -0
  146. package/dist/local-backend/package.json +54 -0
  147. package/dist/local-backend/src/index.d.ts +4 -0
  148. package/dist/local-backend/src/index.js.map +1 -0
  149. package/dist/local-backend/src/local-backend-socket.service.d.ts +22 -0
  150. package/dist/local-backend/src/local-backend-socket.service.js +213 -0
  151. package/dist/local-backend/src/local-backend-socket.service.js.map +1 -0
  152. package/dist/local-backend/src/local-backend.app.d.ts +2 -0
  153. package/dist/local-backend/src/local-backend.app.js +26 -0
  154. package/dist/local-backend/src/local-backend.app.js.map +1 -0
  155. package/dist/local-backend/src/local-backend.controller.d.ts +9 -0
  156. package/dist/local-backend/src/local-backend.controller.js +50 -0
  157. package/dist/local-backend/src/local-backend.controller.js.map +1 -0
  158. package/dist/local-backend/src/local-backend.module.d.ts +8 -0
  159. package/dist/local-backend/src/local-backend.module.js +54 -0
  160. package/dist/local-backend/src/local-backend.module.js.map +1 -0
  161. package/dist/local-backend/src/local-backend.service.d.ts +17 -0
  162. package/dist/local-backend/src/local-backend.service.js +180 -0
  163. package/dist/local-backend/src/local-backend.service.js.map +1 -0
  164. package/dist/local-backend/src/utils/shell-runner.d.ts +4 -0
  165. package/dist/local-backend/src/utils/shell-runner.js +28 -0
  166. package/dist/local-backend/src/utils/shell-runner.js.map +1 -0
  167. package/dist/local-backend/tsoa.json +15 -0
  168. package/dist/tsconfig.build.tsbuildinfo +1 -0
  169. package/package.json +2 -2
@@ -0,0 +1,40 @@
1
+ import { IntegrationType } from '../integration.public-types';
2
+ import { BaseIntegrationConfig, QueueIntegrationTypes } from './schemas';
3
+ export type QueueIntegrationType = (typeof QueueIntegrationTypes)[number];
4
+ export interface BaseQueueIntegrationConfig extends BaseIntegrationConfig {
5
+ type: QueueIntegrationType;
6
+ }
7
+ export interface KafkaConnectionSecretOptions {
8
+ password?: string;
9
+ }
10
+ export interface KafkaConnectionOptions {
11
+ secrets?: KafkaConnectionSecretOptions;
12
+ username?: string;
13
+ bootstrapServers: string;
14
+ }
15
+ export interface KafkaIntegrationConfiguration {
16
+ connectionOptions: KafkaConnectionOptions;
17
+ }
18
+ export interface KafkaIntegrationConfig extends BaseQueueIntegrationConfig {
19
+ type: IntegrationType.kafka;
20
+ configuration: KafkaIntegrationConfiguration;
21
+ }
22
+ export interface ConfluentIntegrationConfig extends BaseQueueIntegrationConfig {
23
+ type: IntegrationType.confluent;
24
+ configuration: KafkaIntegrationConfiguration;
25
+ }
26
+ export interface BuiltInQueueIntegrationConfig extends BaseQueueIntegrationConfig {
27
+ type: IntegrationType.built_in_queue;
28
+ }
29
+ export interface TestKafkaConnectionRequest {
30
+ type: IntegrationType.kafka;
31
+ configuration: {
32
+ connectionOptions: KafkaConnectionOptions;
33
+ };
34
+ }
35
+ export interface TestConfluentConnectionRequest {
36
+ type: IntegrationType.confluent;
37
+ configuration: {
38
+ connectionOptions: KafkaConnectionOptions;
39
+ };
40
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=queue-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-types.js","sourceRoot":"","sources":["../../../../../../internal-common/src/public-types/integrations/queue-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
1
+ import { AiChatbotIntegrationConfig } from './ai_chatbot.types';
2
+ import { GraphQLIntegrationConfig, HttpApiIntegrationConfig, IntegrationApiSchema, IntegrationGraphQLSchema, TestGraphQLDataConnectionRequest } from './api.types';
3
+ import { Auth0IntegrationConfig, CognitoIntegrationConfig, DescopeIntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig, OktaIntegrationConfig } from './auth.types';
4
+ import { BaseDatabaseIntegrationConfig, BigQueryIntegrationConfig, CockroachIntegrationConfig, IntegrationDataSchema, InternalIntegrationConfig, MongoIntegrationConfig, MssqlIntegrationConfig, MySqlIntegrationConfig, OracleIntegrationConfig, PinotIntegrationConfig, PostgresIntegrationConfig, SnowflakeIntegrationConfig, TestDataConnectionRequest } from './database.types';
5
+ import { DatadogIntegrationConfig, NewRelicIntegrationConfig } from './observability.types';
6
+ import { IntegrationSchemaType, IntegrationType } from '../integration.public-types';
7
+ import { BuiltInQueueIntegrationConfig, ConfluentIntegrationConfig, KafkaIntegrationConfig, TestConfluentConnectionRequest, TestKafkaConnectionRequest } from './queue-types';
8
+ import { IntegrationId } from '../communication.public-types';
9
+ export interface IntegrationConfigTypes {
10
+ [IntegrationType.built_in_db]: InternalIntegrationConfig;
11
+ [IntegrationType.mongo]: MongoIntegrationConfig;
12
+ [IntegrationType.mysql]: MySqlIntegrationConfig;
13
+ [IntegrationType.bigquery]: BigQueryIntegrationConfig;
14
+ [IntegrationType.oracledb]: OracleIntegrationConfig;
15
+ [IntegrationType.pinot]: PinotIntegrationConfig;
16
+ [IntegrationType.mssql]: MssqlIntegrationConfig;
17
+ [IntegrationType.postgres]: PostgresIntegrationConfig;
18
+ [IntegrationType.cockroach]: CockroachIntegrationConfig;
19
+ [IntegrationType.snowflake]: SnowflakeIntegrationConfig;
20
+ [IntegrationType.api]: HttpApiIntegrationConfig;
21
+ [IntegrationType.graphql]: GraphQLIntegrationConfig;
22
+ [IntegrationType.datadog]: DatadogIntegrationConfig;
23
+ [IntegrationType.newrelic]: NewRelicIntegrationConfig;
24
+ [IntegrationType.auth0]: Auth0IntegrationConfig;
25
+ [IntegrationType.jwt_rsa]: JwtRsaIntegrationConfig;
26
+ [IntegrationType.jwt_hmac]: JwtHmacIntegrationConfig;
27
+ [IntegrationType.ai_chatbot]: AiChatbotIntegrationConfig;
28
+ [IntegrationType.cognito]: CognitoIntegrationConfig;
29
+ [IntegrationType.okta]: OktaIntegrationConfig;
30
+ [IntegrationType.kafka]: KafkaIntegrationConfig;
31
+ [IntegrationType.confluent]: ConfluentIntegrationConfig;
32
+ [IntegrationType.built_in_queue]: BuiltInQueueIntegrationConfig;
33
+ [IntegrationType.descope]: DescopeIntegrationConfig;
34
+ }
35
+ export interface IntegrationSchemaTypes {
36
+ [IntegrationType.built_in_db]: IntegrationDataSchema;
37
+ [IntegrationType.mongo]: IntegrationDataSchema;
38
+ [IntegrationType.mysql]: IntegrationDataSchema;
39
+ [IntegrationType.oracledb]: IntegrationDataSchema;
40
+ [IntegrationType.bigquery]: IntegrationDataSchema;
41
+ [IntegrationType.pinot]: IntegrationDataSchema;
42
+ [IntegrationType.mssql]: IntegrationDataSchema;
43
+ [IntegrationType.postgres]: IntegrationDataSchema;
44
+ [IntegrationType.cockroach]: IntegrationDataSchema;
45
+ [IntegrationType.snowflake]: IntegrationDataSchema;
46
+ [IntegrationType.api]: IntegrationApiSchema;
47
+ [IntegrationType.graphql]: IntegrationGraphQLSchema;
48
+ }
49
+ export type IntegrationTypeWithConfig = keyof IntegrationConfigTypes;
50
+ export type IntegrationSchemaKeys = keyof IntegrationSchemaTypes;
51
+ export type IntegrationConfig = IntegrationConfigTypes[IntegrationTypeWithConfig];
52
+ export type IntegrationSchema = IntegrationSchemaTypes[IntegrationSchemaKeys];
53
+ export declare const DatabaseIntegrationTypes: readonly [IntegrationType.built_in_db, IntegrationType.mongo, IntegrationType.mysql, IntegrationType.bigquery, IntegrationType.mssql, IntegrationType.postgres, IntegrationType.cockroach, IntegrationType.snowflake, IntegrationType.oracledb, IntegrationType.pinot];
54
+ export type DatabaseIntegrationType = (typeof DatabaseIntegrationTypes)[number];
55
+ export type DatabaseIntegrationConfig = IntegrationConfigTypes[DatabaseIntegrationType];
56
+ export declare const ApiIntegrationTypes: readonly [IntegrationType.api, IntegrationType.graphql];
57
+ export declare const ObservabilityIntegrationTypes: readonly [IntegrationType.datadog, IntegrationType.newrelic];
58
+ export declare const AuthIntegrationTypes: readonly [IntegrationType.auth0, IntegrationType.jwt_rsa, IntegrationType.jwt_hmac, IntegrationType.cognito, IntegrationType.okta, IntegrationType.descope];
59
+ export declare const QueueIntegrationTypes: readonly [IntegrationType.built_in_queue, IntegrationType.kafka, IntegrationType.confluent];
60
+ export type ApiIntegrationType = (typeof ApiIntegrationTypes)[number];
61
+ export type ApiIntegrationConfig = IntegrationConfigTypes[ApiIntegrationType];
62
+ export type ObservabilityIntegrationType = (typeof ObservabilityIntegrationTypes)[number];
63
+ export type ObservabilityIntegrationConfig = IntegrationConfigTypes[ObservabilityIntegrationType];
64
+ export type AuthIntegrationType = (typeof AuthIntegrationTypes)[number];
65
+ export type AuthIntegrationConfig = IntegrationConfigTypes[AuthIntegrationType];
66
+ export declare function isDataIntegrationType(type: unknown): type is DatabaseIntegrationType;
67
+ export declare function isDataIntegration(integration: any): integration is BaseDatabaseIntegrationConfig;
68
+ export declare function isAuthIntegrationType(type: IntegrationType): type is AuthIntegrationType;
69
+ export declare function isAuthIntegration(integration: any): integration is AuthIntegrationConfig;
70
+ export interface BaseIntegrationConfig {
71
+ id: IntegrationId;
72
+ type: IntegrationTypeWithConfig;
73
+ creationDate: Date;
74
+ updateDate: Date;
75
+ }
76
+ export interface BaseIntegrationSchema {
77
+ type: IntegrationSchemaType;
78
+ }
79
+ export type TestConnectionRequest = TestDataConnectionRequest | TestGraphQLDataConnectionRequest | TestKafkaConnectionRequest | TestConfluentConnectionRequest;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAuthIntegration = exports.isAuthIntegrationType = exports.isDataIntegration = exports.isDataIntegrationType = exports.QueueIntegrationTypes = exports.AuthIntegrationTypes = exports.ObservabilityIntegrationTypes = exports.ApiIntegrationTypes = exports.DatabaseIntegrationTypes = void 0;
4
+ const integration_public_types_1 = require("../integration.public-types");
5
+ exports.DatabaseIntegrationTypes = [
6
+ integration_public_types_1.IntegrationType.built_in_db,
7
+ integration_public_types_1.IntegrationType.mongo,
8
+ integration_public_types_1.IntegrationType.mysql,
9
+ integration_public_types_1.IntegrationType.bigquery,
10
+ integration_public_types_1.IntegrationType.mssql,
11
+ integration_public_types_1.IntegrationType.postgres,
12
+ integration_public_types_1.IntegrationType.cockroach,
13
+ integration_public_types_1.IntegrationType.snowflake,
14
+ integration_public_types_1.IntegrationType.oracledb,
15
+ integration_public_types_1.IntegrationType.pinot,
16
+ ];
17
+ exports.ApiIntegrationTypes = [integration_public_types_1.IntegrationType.api, integration_public_types_1.IntegrationType.graphql];
18
+ exports.ObservabilityIntegrationTypes = [integration_public_types_1.IntegrationType.datadog, integration_public_types_1.IntegrationType.newrelic];
19
+ exports.AuthIntegrationTypes = [
20
+ integration_public_types_1.IntegrationType.auth0,
21
+ integration_public_types_1.IntegrationType.jwt_rsa,
22
+ integration_public_types_1.IntegrationType.jwt_hmac,
23
+ integration_public_types_1.IntegrationType.cognito,
24
+ integration_public_types_1.IntegrationType.okta,
25
+ integration_public_types_1.IntegrationType.descope,
26
+ ];
27
+ exports.QueueIntegrationTypes = [
28
+ integration_public_types_1.IntegrationType.built_in_queue,
29
+ integration_public_types_1.IntegrationType.kafka,
30
+ integration_public_types_1.IntegrationType.confluent,
31
+ ];
32
+ function isDataIntegrationType(type) {
33
+ return exports.DatabaseIntegrationTypes.includes(type);
34
+ }
35
+ exports.isDataIntegrationType = isDataIntegrationType;
36
+ function isDataIntegration(integration) {
37
+ return isDataIntegrationType(integration.type);
38
+ }
39
+ exports.isDataIntegration = isDataIntegration;
40
+ function isAuthIntegrationType(type) {
41
+ return exports.AuthIntegrationTypes.includes(type);
42
+ }
43
+ exports.isAuthIntegrationType = isAuthIntegrationType;
44
+ function isAuthIntegration(integration) {
45
+ return isAuthIntegrationType(integration.type);
46
+ }
47
+ exports.isAuthIntegration = isAuthIntegration;
48
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../../../internal-common/src/public-types/integrations/schemas.ts"],"names":[],"mappings":";;;AAgCA,0EAAqF;AA0DxE,QAAA,wBAAwB,GAAG;IACtC,0CAAe,CAAC,WAAW;IAC3B,0CAAe,CAAC,KAAK;IACrB,0CAAe,CAAC,KAAK;IACrB,0CAAe,CAAC,QAAQ;IACxB,0CAAe,CAAC,KAAK;IACrB,0CAAe,CAAC,QAAQ;IACxB,0CAAe,CAAC,SAAS;IACzB,0CAAe,CAAC,SAAS;IACzB,0CAAe,CAAC,QAAQ;IACxB,0CAAe,CAAC,KAAK;CACb,CAAC;AAKE,QAAA,mBAAmB,GAAG,CAAC,0CAAe,CAAC,GAAG,EAAE,0CAAe,CAAC,OAAO,CAAU,CAAC;AAE9E,QAAA,6BAA6B,GAAG,CAAC,0CAAe,CAAC,OAAO,EAAE,0CAAe,CAAC,QAAQ,CAAU,CAAC;AAE7F,QAAA,oBAAoB,GAAG;IAClC,0CAAe,CAAC,KAAK;IACrB,0CAAe,CAAC,OAAO;IACvB,0CAAe,CAAC,QAAQ;IACxB,0CAAe,CAAC,OAAO;IACvB,0CAAe,CAAC,IAAI;IACpB,0CAAe,CAAC,OAAO;CACf,CAAC;AAEE,QAAA,qBAAqB,GAAG;IACnC,0CAAe,CAAC,cAAc;IAC9B,0CAAe,CAAC,KAAK;IACrB,0CAAe,CAAC,SAAS;CACjB,CAAC;AAWX,SAAgB,qBAAqB,CAAC,IAAa;IACjD,OAAO,gCAAwB,CAAC,QAAQ,CAAC,IAA+B,CAAC,CAAC;AAC5E,CAAC;AAFD,sDAEC;AAED,SAAgB,iBAAiB,CAAC,WAAgB;IAChD,OAAO,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC;AAFD,8CAEC;AAED,SAAgB,qBAAqB,CAAC,IAAqB;IACzD,OAAQ,4BAAmD,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7E,CAAC;AAFD,sDAEC;AAED,SAAgB,iBAAiB,CAAC,WAAgB;IAChD,OAAO,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC;AAFD,8CAEC"}
@@ -0,0 +1,13 @@
1
+ import { Paths } from './typescript.public-types';
2
+ import { BeforeAndAfterDocs } from './document.public-types';
3
+ import { Mutation, MutationType } from './mutation.public-types';
4
+ export declare class MutationPublicContext<T = any> {
5
+ readonly mutation: Mutation<T>;
6
+ readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
7
+ readonly serverTimeStamp: Date;
8
+ constructor(mutation: Mutation<T>, beforeAndAfterDocs: BeforeAndAfterDocs<T>, serverTimeStamp: Date);
9
+ getMutationType(): MutationType;
10
+ get before(): T | undefined;
11
+ get after(): T | undefined;
12
+ affectsPath(path: Paths<T>): boolean;
13
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MutationPublicContext = void 0;
4
+ const _ = require("lodash");
5
+ class MutationPublicContext {
6
+ constructor(mutation, beforeAndAfterDocs, serverTimeStamp) {
7
+ this.mutation = mutation;
8
+ this.beforeAndAfterDocs = beforeAndAfterDocs;
9
+ this.serverTimeStamp = serverTimeStamp;
10
+ }
11
+ getMutationType() {
12
+ return this.mutation.type;
13
+ }
14
+ get before() {
15
+ return this.beforeAndAfterDocs.before;
16
+ }
17
+ get after() {
18
+ return this.beforeAndAfterDocs.after;
19
+ }
20
+ affectsPath(path) {
21
+ const before = this.before ? _.get(this.before, path) : undefined;
22
+ const after = this.after ? _.get(this.after, path) : undefined;
23
+ return !_.isEqual(before, after);
24
+ }
25
+ }
26
+ exports.MutationPublicContext = MutationPublicContext;
27
+ //# sourceMappingURL=mutation.public-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation.public-context.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/mutation.public-context.ts"],"names":[],"mappings":";;;AAAA,4BAA4B;AAM5B,MAAa,qBAAqB;IAIhC,YACW,QAAqB,EACrB,kBAAyC,EACzC,eAAqB;QAFrB,aAAQ,GAAR,QAAQ,CAAa;QACrB,uBAAkB,GAAlB,kBAAkB,CAAuB;QACzC,oBAAe,GAAf,eAAe,CAAM;IAC7B,CAAC;IAEJ,eAAe;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC;IACxC,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;IACvC,CAAC;IAGD,WAAW,CAAC,IAAc;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAClE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/D,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC;CACF;AA5BD,sDA4BC"}
@@ -0,0 +1,44 @@
1
+ import { SquidDocIdObj } from './document.public-types';
2
+ interface BaseMutation {
3
+ type: MutationType;
4
+ squidDocIdObj: SquidDocIdObj;
5
+ }
6
+ export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
7
+ export type MutationType = 'insert' | 'update' | 'delete';
8
+ export interface DeleteMutation extends BaseMutation {
9
+ type: 'delete';
10
+ }
11
+ export interface UpdateMutation<T = any> extends BaseMutation {
12
+ type: 'update';
13
+ properties: {
14
+ [key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
15
+ };
16
+ }
17
+ export interface InsertMutation<T = any> extends BaseMutation {
18
+ type: 'insert';
19
+ properties: T;
20
+ }
21
+ export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
22
+ export interface ValueUpdatePropertyMutation<Value = any> {
23
+ type: 'update';
24
+ value: Value;
25
+ }
26
+ export interface ApplyNumericFnPropertyMutation {
27
+ type: 'applyNumericFn';
28
+ fn: 'increment';
29
+ value: number;
30
+ }
31
+ export interface RemovePropertyMutation {
32
+ type: 'removeProperty';
33
+ }
34
+ interface ApplyExtendString {
35
+ type: 'applyStringFn';
36
+ fn: 'extendString';
37
+ value: string;
38
+ }
39
+ interface ApplyTrimString {
40
+ type: 'applyStringFn';
41
+ fn: 'trim';
42
+ }
43
+ export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
44
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=mutation.public-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/mutation.public-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import { FieldSort, Operator, Query, SimpleCondition } from './query.public-types';
2
+ import { DeepRecord, FieldOf, PartialBy, Paths } from './typescript.public-types';
3
+ import { CollectionName, DocumentData } from './document.public-types';
4
+ import { IntegrationId } from './communication.public-types';
5
+ export declare class QueryContext<T extends DocumentData = any> {
6
+ readonly query: Query<T>;
7
+ private readonly parsedConditions;
8
+ constructor(query: Query<T>);
9
+ get integrationId(): IntegrationId;
10
+ get collectionName(): CollectionName;
11
+ get limit(): number;
12
+ sortedBy(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
13
+ sortedByExact(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
14
+ isSubqueryOf<F extends Paths<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O> | null): boolean;
15
+ isSubqueryOfCondition(condition: GeneralCondition<T>): boolean;
16
+ isSubqueryOfConditions(conditions: GeneralConditions<T>): boolean;
17
+ isSubqueryOfQuery(query: Query<T>): boolean;
18
+ getConditionsFor<K extends Paths<T>>(...fieldNames: Array<K>): ContextConditions<T, K>;
19
+ getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
20
+ documentMatchesQuery(doc: DocumentData): boolean;
21
+ private evaluateSubset;
22
+ private evaluateIncludes;
23
+ private parseConditions;
24
+ }
25
+ export type ContextConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<ContextCondition<Doc, F>>;
26
+ type ContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = InContextCondition<Doc, F> | NotInContextCondition<Doc, F> | OtherContextCondition<Doc, F>;
27
+ interface InContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'in'> {
28
+ operator: 'in';
29
+ value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
30
+ }
31
+ interface NotInContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'not in'> {
32
+ operator: 'not in';
33
+ value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
34
+ }
35
+ interface OtherContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, Exclude<ContextOperator, 'in' | 'not in'>> {
36
+ operator: Exclude<ContextOperator, 'in' | 'not in'>;
37
+ value: FieldOf<DeepRecord<Doc>, Paths<Doc>> | any;
38
+ }
39
+ interface GeneralCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, AllOperators> {
40
+ operator: AllOperators;
41
+ value: any;
42
+ }
43
+ type GeneralConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<GeneralCondition<Doc, F>>;
44
+ type ContextOperator = Exclude<Operator, '==' | '!='> | 'in' | 'not in';
45
+ type AllOperators = Operator | 'in' | 'not in';
46
+ type GenericValue<Doc = any, F extends Paths<Doc> = Paths<Doc>, O extends AllOperators = any> = O extends 'in' ? Array<DeepRecord<Doc>[F]> | null : O extends 'not in' ? Array<DeepRecord<Doc>[F]> | null : DeepRecord<Doc>[F] | null;
47
+ export {};
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueryContext = void 0;
4
+ const _ = require("lodash");
5
+ const lodash_1 = require("lodash");
6
+ const query_public_types_1 = require("./query.public-types");
7
+ const query_types_1 = require("../types/query.types");
8
+ const CompareTable = {
9
+ 'in:in': (a, b) => a.every((c) => b.includes(c)),
10
+ 'in:not in': (a, b) => a.every((c) => !b.includes(c)),
11
+ 'not in:not in': (a, b) => b.every((c) => a.includes(c)),
12
+ '>:not in': (a, b) => b.every((c) => a >= c),
13
+ '>=:not in': (a, b) => b.every((c) => a > c),
14
+ '<:not in': (a, b) => b.every((c) => a <= c),
15
+ '<=:not in': (a, b) => b.every((c) => a < c),
16
+ '>:>': (a, b) => a >= b,
17
+ '>=:>': (a, b) => a > b,
18
+ 'in:>': (a, b) => a.every((c) => c > b),
19
+ '>:>=': (a, b) => a >= b,
20
+ '>=:>=': (a, b) => a >= b,
21
+ 'in:>=': (a, b) => a.every((c) => c >= b),
22
+ '<:<': (a, b) => a <= b,
23
+ '<=:<': (a, b) => a < b,
24
+ 'in:<': (a, b) => a.every((c) => c < b),
25
+ '<:<=': (a, b) => a <= b,
26
+ '<=:<=': (a, b) => a <= b,
27
+ 'in:<=': (a, b) => a.every((c) => c <= b),
28
+ };
29
+ class QueryContext {
30
+ constructor(query) {
31
+ this.query = query;
32
+ this.query = query;
33
+ this.parsedConditions = this.parseConditions(this.query.conditions.filter(query_public_types_1.isSimpleCondition));
34
+ }
35
+ get integrationId() {
36
+ return this.query.integrationId;
37
+ }
38
+ get collectionName() {
39
+ return this.query.collectionName;
40
+ }
41
+ get limit() {
42
+ return this.query.limit;
43
+ }
44
+ sortedBy(sorts) {
45
+ const mismatch = sorts.find((fieldSort, index) => {
46
+ var _a;
47
+ return !(0, lodash_1.isEqual)(this.query.sortOrder[index], Object.assign(Object.assign({}, fieldSort), { asc: (_a = fieldSort.asc) !== null && _a !== void 0 ? _a : true }));
48
+ });
49
+ return !mismatch;
50
+ }
51
+ sortedByExact(sorts) {
52
+ if (sorts.length !== this.query.sortOrder.length)
53
+ return false;
54
+ return this.sortedBy(sorts);
55
+ }
56
+ isSubqueryOf(fieldName, operator, value) {
57
+ return this.isSubqueryOfCondition({
58
+ fieldName,
59
+ operator,
60
+ value,
61
+ });
62
+ }
63
+ isSubqueryOfCondition(condition) {
64
+ const conditions = this.parsedConditions.filter(c => c.fieldName === condition.fieldName);
65
+ return !!conditions.find(c => this.evaluateSubset(c, condition));
66
+ }
67
+ isSubqueryOfConditions(conditions) {
68
+ const parsedConditions = this.parseConditions(conditions);
69
+ return parsedConditions.every(c => this.isSubqueryOfCondition(c));
70
+ }
71
+ isSubqueryOfQuery(query) {
72
+ if (query.collectionName !== this.collectionName || query.integrationId !== this.integrationId)
73
+ return false;
74
+ const simpleConditions = query.conditions.filter(query_public_types_1.isSimpleCondition);
75
+ const subsetOfConditions = this.isSubqueryOfConditions(simpleConditions);
76
+ const subsetOfOrder = this.sortedBy(query.sortOrder);
77
+ const withinLimit = query.limit === -1 || (this.limit > -1 && this.limit < query.limit);
78
+ return subsetOfConditions && subsetOfOrder && withinLimit;
79
+ }
80
+ getConditionsFor(...fieldNames) {
81
+ return this.parsedConditions.filter(cond => fieldNames.includes(cond.fieldName));
82
+ }
83
+ getConditionsForField(fieldName) {
84
+ return this.parsedConditions.filter(cond => cond.fieldName === fieldName);
85
+ }
86
+ documentMatchesQuery(doc) {
87
+ for (const contextCondition of this.parsedConditions) {
88
+ const fieldNameOrPath = contextCondition.fieldName;
89
+ const operator = contextCondition.operator;
90
+ const valueInDoc = _.get(doc, fieldNameOrPath);
91
+ if (operator === 'in') {
92
+ if (contextCondition.value.includes(valueInDoc)) {
93
+ continue;
94
+ }
95
+ return false;
96
+ }
97
+ else if (operator === 'not in') {
98
+ if (contextCondition.value.includes(valueInDoc)) {
99
+ return false;
100
+ }
101
+ continue;
102
+ }
103
+ if (!(0, query_types_1.compareOperator)(contextCondition.value, valueInDoc, operator)) {
104
+ return false;
105
+ }
106
+ }
107
+ return true;
108
+ }
109
+ evaluateSubset(queryCondition, testCondition) {
110
+ const { operator: queryOperator, value: queryValue } = queryCondition;
111
+ const { operator, value } = this.parseConditions([testCondition])[0];
112
+ const compareFunction = CompareTable[`${queryOperator}:${operator}`];
113
+ if (!compareFunction)
114
+ return false;
115
+ return compareFunction(queryValue, value);
116
+ }
117
+ evaluateIncludes(queryCondition, testCondition) {
118
+ const { operator: queryOperator, value: queryValue } = queryCondition;
119
+ const { operator, value } = this.parseConditions([testCondition])[0];
120
+ const sortedQueryValue = Array.isArray(queryValue) ? queryValue.sort() : queryValue;
121
+ const sortedValue = Array.isArray(value) ? value.sort() : value;
122
+ return operator === queryOperator && (0, lodash_1.isEqual)(sortedValue, sortedQueryValue);
123
+ }
124
+ parseConditions(conditions) {
125
+ const parsedConditions = [];
126
+ const inMap = new Map();
127
+ const notInMap = new Map();
128
+ conditions.forEach(c => {
129
+ switch (c.operator) {
130
+ case '==':
131
+ case 'in':
132
+ inMap.set(c.fieldName, (inMap.get(c.fieldName) || []).concat(c.value));
133
+ break;
134
+ case '!=':
135
+ case 'not in':
136
+ notInMap.set(c.fieldName, (notInMap.get(c.fieldName) || []).concat(c.value));
137
+ break;
138
+ default:
139
+ parsedConditions.push(c);
140
+ break;
141
+ }
142
+ });
143
+ inMap.forEach((value, fieldName) => {
144
+ parsedConditions.push({
145
+ fieldName: fieldName,
146
+ operator: 'in',
147
+ value: value,
148
+ });
149
+ });
150
+ notInMap.forEach((value, fieldName) => {
151
+ parsedConditions.push({
152
+ fieldName: fieldName,
153
+ operator: 'not in',
154
+ value: value,
155
+ });
156
+ });
157
+ return parsedConditions;
158
+ }
159
+ }
160
+ exports.QueryContext = QueryContext;
161
+ //# sourceMappingURL=query.public-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.public-context.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/query.public-context.ts"],"names":[],"mappings":";;;AAAA,4BAA4B;AAC5B,mCAAiC;AACjC,6DAAsG;AAItG,sDAAuD;AAevD,MAAM,YAAY,GAAgD;IAChE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAA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ACR;oBACE,gBAAgB,CAAC,IAAI,CAAC,CAA+B,CAAC,CAAC;oBACvD,MAAM;aACT;QACH,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;YACjC,gBAAgB,CAAC,IAAI,CAAC;gBACpB,SAAS,EAAE,SAAgB;gBAC3B,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,KAAY;aACpB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;YACpC,gBAAgB,CAAC,IAAI,CAAC;gBACpB,SAAS,EAAE,SAAgB;gBAC3B,QAAQ,EAAE,QAAQ;gBAClB,KAAK,EAAE,KAAY;aACpB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AArPD,oCAqPC"}
@@ -0,0 +1,56 @@
1
+ import { CollectionName, DocumentData, FieldName } from './document.public-types';
2
+ import { Paths } from './typescript.public-types';
3
+ import { TriggerId } from './application.public-types';
4
+ import { ClientRequestId } from './communication.public-types';
5
+ export type Alias = string;
6
+ export interface JoinCondition {
7
+ leftAlias: Alias;
8
+ left: FieldName;
9
+ right: FieldName;
10
+ isInner: boolean;
11
+ }
12
+ export type Condition<Doc extends DocumentData = any> = SimpleCondition<Doc> | CompositeCondition<Doc>;
13
+ export type Conditions<Doc extends DocumentData = any> = Array<Condition<Doc>>;
14
+ export interface SimpleCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>, MyOperator = Operator> {
15
+ fieldName: F;
16
+ operator: MyOperator;
17
+ value: any;
18
+ }
19
+ export interface CompositeCondition<Doc extends DocumentData = any> {
20
+ fields: Array<SimpleCondition<Doc, Paths<Doc>, CompositeConditionOperator>>;
21
+ }
22
+ export declare function isSimpleCondition(condition: Condition): condition is SimpleCondition;
23
+ type CompositeConditionOperator = '>=' | '<=' | '>' | '<';
24
+ export type Operator = '==' | '!=' | CompositeConditionOperator | 'like' | 'not like' | 'like_cs' | 'not like_cs';
25
+ export interface FieldSort<Doc> {
26
+ fieldName: FieldName<Doc>;
27
+ asc: boolean;
28
+ }
29
+ interface RegularQueryKey {
30
+ queryType: 'query';
31
+ clientId: string;
32
+ clientRequestId: string;
33
+ }
34
+ interface TriggerKey {
35
+ queryType: 'trigger';
36
+ triggerId: TriggerId;
37
+ }
38
+ export type QueryKey = RegularQueryKey | TriggerKey;
39
+ export interface Query<Doc extends DocumentData = any> {
40
+ collectionName: CollectionName;
41
+ integrationId: string;
42
+ conditions: Conditions<Doc>;
43
+ sortOrder: Array<FieldSort<Doc>>;
44
+ limit: number;
45
+ limitBy?: {
46
+ limit: number;
47
+ fields: Array<FieldName<Doc>>;
48
+ reverseSort: boolean;
49
+ };
50
+ }
51
+ export interface QueryRegisterRequest {
52
+ clientRequestId: ClientRequestId;
53
+ query: Query;
54
+ parentClientRequestId: ClientRequestId;
55
+ }
56
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isSimpleCondition = void 0;
4
+ function isSimpleCondition(condition) {
5
+ return 'fieldName' in condition;
6
+ }
7
+ exports.isSimpleCondition = isSimpleCondition;
8
+ //# sourceMappingURL=query.public-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/query.public-types.ts"],"names":[],"mappings":";;;AA+CA,SAAgB,iBAAiB,CAAC,SAAoB;IACpD,OAAO,WAAW,IAAI,SAAS,CAAC;AAClC,CAAC;AAFD,8CAEC"}
@@ -0,0 +1,22 @@
1
+ import { JSONSchema } from 'json-schema-typed';
2
+ type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
3
+ properties?: Record<string, ConvertDeep<JSONSchema>>;
4
+ patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
5
+ nullable?: boolean;
6
+ applyDefaultValueOn?: 'always' | 'empty' | 'updateOrEmpty';
7
+ isDate?: boolean;
8
+ isJSON?: boolean;
9
+ insertable?: boolean;
10
+ deletable?: boolean;
11
+ };
12
+ export type PropertySchema = ConvertDeep<JSONSchema>;
13
+ export type TopLevelPropertySchema = PropertySchema & {
14
+ primaryKey?: boolean;
15
+ isComputed?: boolean;
16
+ isDefaultComputed?: boolean;
17
+ dataType?: string;
18
+ };
19
+ export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
20
+ properties?: Record<string, TopLevelPropertySchema>;
21
+ };
22
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=schema.public-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/schema.public-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ export type ApiKey = string;
2
+ export type SecretKey = string;
3
+ export type SecretValue = string | number | boolean;
4
+ export interface SecretMetadata {
5
+ key: SecretKey;
6
+ lastUpdated: number;
7
+ }
8
+ export interface SecretEntry<T extends SecretValue = SecretValue> extends SecretMetadata {
9
+ value: T;
10
+ }
11
+ export interface ApiKeyEntry extends SecretMetadata {
12
+ value: string;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=secret.public-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/secret.public-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export declare enum ClientConnectionState {
2
+ CONNECTED = "CONNECTED",
3
+ DISCONNECTED = "DISCONNECTED",
4
+ REMOVED = "REMOVED"
5
+ }