@squidcloud/client 1.0.160 → 1.0.162

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 (69) hide show
  1. package/dist/cjs/index.js +5799 -3224
  2. package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +1 -1
  3. package/dist/internal-common/src/{types/ai-chatbot.context.d.ts → public-types/ai-chatbot.public-context.d.ts} +1 -1
  4. package/dist/internal-common/src/public-types/ai-chatbot.public-types.d.ts +2 -0
  5. package/dist/internal-common/src/public-types/{api-call.context.d.ts → api-call.public-context.d.ts} +2 -1
  6. package/dist/internal-common/src/public-types/{application.types.d.ts → application.public-types.d.ts} +2 -2
  7. package/dist/internal-common/src/public-types/{base-query-builder.d.ts → base-query-builder.public-types.d.ts} +4 -4
  8. package/dist/internal-common/src/public-types/{bundle-api.types.d.ts → bundle-api.public-types.d.ts} +22 -14
  9. package/dist/internal-common/src/public-types/{bundle-data.types.d.ts → bundle-data.public-types.d.ts} +1 -4
  10. package/dist/internal-common/src/public-types/{communication.types.d.ts → communication.public-types.d.ts} +4 -2
  11. package/dist/internal-common/src/public-types/{context.types.d.ts → context.public-types.d.ts} +1 -1
  12. package/dist/internal-common/src/public-types/{document.types.d.ts → document.public-types.d.ts} +18 -8
  13. package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +2 -2
  14. package/dist/internal-common/src/public-types/integrations/api.types.d.ts +3 -3
  15. package/dist/internal-common/src/public-types/integrations/auth.types.d.ts +1 -1
  16. package/dist/internal-common/src/public-types/integrations/database.types.d.ts +3 -3
  17. package/dist/internal-common/src/public-types/integrations/observability.types.d.ts +1 -1
  18. package/dist/internal-common/src/public-types/integrations/queue-types.d.ts +1 -1
  19. package/dist/internal-common/src/public-types/integrations/schemas.d.ts +5 -5
  20. package/dist/internal-common/src/public-types/{mutation.context.d.ts → mutation.public-context.d.ts} +4 -4
  21. package/dist/internal-common/src/public-types/{mutation.types.d.ts → mutation.public-types.d.ts} +5 -5
  22. package/dist/internal-common/src/public-types/{native-query.context.d.ts → native-query.public-context.d.ts} +1 -1
  23. package/dist/internal-common/src/public-types/{query-context.d.ts → query.public-context.d.ts} +4 -4
  24. package/dist/internal-common/src/public-types/{query.types.d.ts → query.public-types.d.ts} +3 -3
  25. package/dist/internal-common/src/public-types/regions.public-types.d.ts +5 -0
  26. package/dist/internal-common/src/{schema/schema.types.d.ts → public-types/schema.public-types.d.ts} +0 -8
  27. package/dist/internal-common/src/public-types/{secret.types.d.ts → secret.public-types.d.ts} +5 -11
  28. package/dist/internal-common/src/public-types/{serialized-query.types.d.ts → serialized-query.public-types.d.ts} +2 -2
  29. package/dist/internal-common/src/public-types/socket.public-types.d.ts +5 -0
  30. package/dist/internal-common/src/public-types/topic.public-context.d.ts +10 -0
  31. package/dist/internal-common/src/public-types/{types.d.ts → typescript.public-types.d.ts} +1 -0
  32. package/dist/internal-common/src/{public-types → types}/api.types.d.ts +0 -2
  33. package/dist/internal-common/src/types/bundle-data.types.d.ts +4 -0
  34. package/dist/internal-common/src/types/communication.types.d.ts +1 -0
  35. package/dist/internal-common/src/types/openapi.types.d.ts +1 -0
  36. package/dist/internal-common/src/types/query.types.d.ts +1 -0
  37. package/dist/internal-common/src/types/secret.types.d.ts +11 -0
  38. package/dist/internal-common/src/types/socket.types.d.ts +7 -0
  39. package/dist/internal-common/src/utils/object.d.ts +3 -3
  40. package/dist/internal-common/src/utils/serialization.d.ts +2 -2
  41. package/dist/internal-common/src/utils/validation.d.ts +5 -5
  42. package/dist/typescript-client/src/client-id.service.d.ts +1 -1
  43. package/dist/typescript-client/src/connection-details.d.ts +1 -1
  44. package/dist/typescript-client/src/data.manager.d.ts +1 -1
  45. package/dist/typescript-client/src/document-identity.service.d.ts +1 -1
  46. package/dist/typescript-client/src/document-reference.d.ts +2 -1
  47. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +3 -2
  48. package/dist/typescript-client/src/public-types.d.ts +28 -32
  49. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +1 -1
  50. package/dist/typescript-client/src/query/query-sender.d.ts +2 -1
  51. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +4 -2
  52. package/dist/typescript-client/src/rpc.manager.d.ts +1 -1
  53. package/dist/typescript-client/src/secret.client.d.ts +2 -1
  54. package/dist/typescript-client/src/socket.manager.d.ts +2 -1
  55. package/package.json +1 -1
  56. package/dist/internal-common/src/public-types/heartbeat.types.d.ts +0 -1
  57. package/dist/internal-common/src/public-types/logger.types.d.ts +0 -21
  58. package/dist/internal-common/src/public-types/metrics.types.d.ts +0 -1
  59. package/dist/internal-common/src/public-types/regions.d.ts +0 -1
  60. package/dist/internal-common/src/public-types/socket.types.d.ts +0 -12
  61. /package/dist/internal-common/src/public-types/{distributed-lock.context.d.ts → distributed-lock.public-context.d.ts} +0 -0
  62. /package/dist/internal-common/src/public-types/{graphql.context.d.ts → graphql.public-context.d.ts} +0 -0
  63. /package/dist/internal-common/src/public-types/{graphql.types.d.ts → graphql.public-types.d.ts} +0 -0
  64. /package/dist/internal-common/src/public-types/{integration-types.d.ts → integration.public-types.d.ts} +0 -0
  65. /package/dist/internal-common/src/public-types/{native-query.types.d.ts → native-query.public-types.d.ts} +0 -0
  66. /package/dist/internal-common/src/public-types/{pagination.d.ts → pagination.public-types.d.ts} +0 -0
  67. /package/dist/internal-common/src/{public-types → types}/backend-run.types.d.ts +0 -0
  68. /package/dist/internal-common/src/{public-types/openapi.types.d.ts → types/document.types.d.ts} +0 -0
  69. /package/dist/internal-common/src/{public-types/topic.context.d.ts → types/mutation.types.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { FunctionName } from './bundle-data.types';
1
+ import { FunctionName } from './bundle-data.public-types';
2
2
  export type AssistantToolType = 'code_interpreter' | 'retrieval';
3
3
  export interface CreateAssistantRequest {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { AiChatbotMutationType, AiChatbotResourceType } from './ai-chatbot.types';
1
+ import { AiChatbotMutationType, AiChatbotResourceType } from './ai-chatbot.public-types';
2
2
  export declare class AiChatbotChatContext {
3
3
  readonly prompt: string;
4
4
  readonly profileId: string;
@@ -26,4 +26,6 @@ export interface AiChatbotChatOptions {
26
26
  includeReference?: boolean;
27
27
  responseFormat?: OpenAiResponseFormat;
28
28
  }
29
+ export type AiChatbotMutationType = 'insert' | 'update' | 'delete';
30
+ export type AiChatbotResourceType = 'instruction' | 'context' | 'profile';
29
31
  export {};
@@ -1,5 +1,6 @@
1
- import { ApiHeaders } from './api.types';
2
1
  import { ApiEndpointId, HttpMethod } from './integrations/api.types';
2
+ /** The headers of an API call. */
3
+ export type ApiHeaders = Record<string, string | number | boolean>;
3
4
  /** The context of an API call. */
4
5
  export declare class ApiCallContext {
5
6
  readonly endpointId: ApiEndpointId;
@@ -1,6 +1,6 @@
1
- import { AppId, EnvironmentId, IntegrationId } from './communication.types';
2
1
  import { AuthIntegrationType, DatabaseIntegrationType, IntegrationConfig, IntegrationConfigTypes, IntegrationSchema, IntegrationSchemaKeys, IntegrationSchemaTypes, IntegrationTypeWithConfig } from './integrations/schemas';
3
- import { IntegrationType } from './integration-types';
2
+ import { IntegrationType } from './integration.public-types';
3
+ import { AppId, EnvironmentId, IntegrationId } from './communication.public-types';
4
4
  /** A type alias for a string that represents a webhook. */
5
5
  export type WebhookId = string;
6
6
  /** A type alias for a string that represents a trigger id. */
@@ -1,8 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
- import { SerializedQuery } from './serialized-query.types';
3
- import { Pagination, PaginationOptions } from './pagination';
4
- import { DocumentData, FieldName, PrimitiveFieldType } from './document.types';
5
- import { Operator } from './query.types';
2
+ import { SerializedQuery } from './serialized-query.public-types';
3
+ import { Pagination, PaginationOptions } from './pagination.public-types';
4
+ import { Operator } from './query.public-types';
5
+ import { DocumentData, FieldName, PrimitiveFieldType } from './document.public-types';
6
6
  export interface SnapshotEmitter<ReturnType> {
7
7
  /**
8
8
  * Returns a promise that resolves to the query results.
@@ -1,17 +1,17 @@
1
- import { MutationContext } from './mutation.context';
2
- import { ApiCallContext } from './api-call.context';
3
- import { GraphqlContext } from './graphql.context';
4
- import { DistributedLockContext } from './distributed-lock.context';
5
- import { NativeQueryContext } from './native-query.context';
6
- import { QueryContext } from './query-context';
7
- import { AiChatbotActionType, DatabaseActionType, TopicActionType } from './bundle-data.types';
8
- import { ClientId } from './communication.types';
9
- import { DocumentData, SquidDocId } from './document.types';
10
- import { MutationType } from './mutation.types';
11
- import { ClientConnectionState } from './socket.types';
12
- import { TopicReadContext, TopicWriteContext } from './topic.context';
13
- import { AiChatbotChatContext, AiChatbotMutationContext } from '../types/ai-chatbot.context';
14
- export type SecureDatabaseAction<T extends DatabaseActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: QueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: MutationContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
1
+ import { MutationPublicContext } from './mutation.public-context';
2
+ import { ApiCallContext } from './api-call.public-context';
3
+ import { QueryContext } from './query.public-context';
4
+ import { AiChatbotActionType, DatabaseActionType, TopicActionType } from './bundle-data.public-types';
5
+ import { ClientConnectionState } from './socket.public-types';
6
+ import { DocumentData } from './document.public-types';
7
+ import { MutationType } from './mutation.public-types';
8
+ import { ClientId, SquidDocId } from './communication.public-types';
9
+ import { TopicReadContext, TopicWriteContext } from './topic.public-context';
10
+ import { NativeQueryContext } from './native-query.public-context';
11
+ import { DistributedLockContext } from './distributed-lock.public-context';
12
+ import { GraphqlContext } from './graphql.public-context';
13
+ import { AiChatbotChatContext, AiChatbotMutationContext } from './ai-chatbot.public-context';
14
+ export type SecureDatabaseAction<T extends DatabaseActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: QueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: MutationPublicContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
15
15
  export type SecureTopicAction<T extends TopicActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: TopicReadContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: TopicWriteContext<T>) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
16
16
  export type SecureApiAction = ((context: ApiCallContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
17
17
  export type SecureNativeQueryAction = ((context: NativeQueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
@@ -46,4 +46,12 @@ export interface WebhookResponse {
46
46
  statusCode: number;
47
47
  __isWebhookResponse__: true;
48
48
  }
49
+ export interface SquidFile {
50
+ data: Uint8Array;
51
+ fieldName: string;
52
+ mimetype: string;
53
+ originalName: string;
54
+ size: number;
55
+ encoding?: string;
56
+ }
49
57
  export type ActionMethodDecorator<U> = <T extends U>(target: Object, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
@@ -4,8 +4,5 @@ export type DatabaseActionType = 'read' | 'write' | 'update' | 'insert' | 'delet
4
4
  export type TopicActionType = 'read' | 'write' | 'all';
5
5
  /** The different types of actions that can be performed on an AI chatbot. */
6
6
  export type AiChatbotActionType = 'chat' | 'mutate' | 'all';
7
- export interface LocalBackendData {
8
- applicationBundleData: ApplicationBundleData;
9
- openApiSpecStr?: string;
10
- }
11
7
  export type AiFunctionParamType = 'string' | 'number' | 'boolean' | 'date';
8
+ export type FunctionName = string;
@@ -2,9 +2,11 @@
2
2
  export type AppId = string;
3
3
  export declare const ENVIRONMENT_IDS: readonly ["dev", "prod"];
4
4
  export type EnvironmentId = (typeof ENVIRONMENT_IDS)[number];
5
+ export type SquidDeveloperId = string;
5
6
  /** @deprecated. Use ENVIRONMENT_IDS. */
6
7
  export declare const allEnvironmentIds: Array<EnvironmentId>;
7
8
  /** A type alias for an integration id. */
8
9
  export type IntegrationId = string;
9
- export type ChatId = string;
10
- export type SquidDeveloperId = string;
10
+ export type ClientId = string;
11
+ export type SquidDocId = string;
12
+ export type ClientRequestId = string;
@@ -1,4 +1,4 @@
1
- import { AppId, ClientId } from './communication.types';
1
+ import { AppId, ClientId } from './communication.public-types';
2
2
  export type AuthType = 'Bearer' | 'ApiKey';
3
3
  /**
4
4
  * The payload of a JWT token in case an auth token was used.
@@ -1,4 +1,8 @@
1
- import { IntegrationId } from './communication.types';
1
+ import { IntegrationId } from './communication.public-types';
2
+ export type PrimitiveFieldType = string | number | boolean | null | Date;
3
+ export type FieldType = PrimitiveFieldType | Array<FieldType> | {
4
+ [key: string]: FieldType;
5
+ };
2
6
  /** A type alias for a field name. */
3
7
  export type FieldName<T = any> = string & keyof T;
4
8
  /** A type alias for a document id as string. */
@@ -7,16 +11,22 @@ export type DocId = string;
7
11
  export type DocIdObj = Record<FieldName, any>;
8
12
  /** A type alias for a collection name. */
9
13
  export type CollectionName = string;
10
- /** The full document id, including the collection name and the integration id. */
11
- export interface SquidDocIdObj {
12
- collectionName: CollectionName;
13
- docId: DocId;
14
- integrationId: IntegrationId;
14
+ /** A generic document data type. */
15
+ export type DocumentData = Record<FieldName, any | undefined>;
16
+ export type DocTimestamp = number;
17
+ export interface SquidDocument {
18
+ __docId__: DocId;
19
+ __ts__: DocTimestamp;
20
+ [fieldName: string]: FieldType | undefined;
15
21
  }
16
22
  /** The before and after documents of a document change. */
17
23
  export interface BeforeAndAfterDocs<T = SquidDocument> {
18
24
  before: T | undefined;
19
25
  after: T | undefined;
20
26
  }
21
- /** A generic document data type. */
22
- export type DocumentData = Record<FieldName, any | undefined>;
27
+ /** The full document id, including the collection name and the integration id. */
28
+ export interface SquidDocIdObj {
29
+ collectionName: CollectionName;
30
+ docId: DocId;
31
+ integrationId: IntegrationId;
32
+ }
@@ -1,7 +1,7 @@
1
1
  import { BaseIntegrationConfig } from './schemas';
2
2
  import { AiModelName } from '../ai-chatbot.public-types';
3
- import { IntegrationId } from '../communication.types';
4
- import { IntegrationType } from '../integration-types';
3
+ import { IntegrationType } from '../integration.public-types';
4
+ import { IntegrationId } from '../communication.public-types';
5
5
  export interface AiChatbotIntegrationConfig extends BaseIntegrationConfig {
6
6
  type: IntegrationType.ai_chatbot;
7
7
  configuration: AiChatbotConfiguration;
@@ -1,7 +1,7 @@
1
- import { FieldName } from '../document.types';
2
- import { IntrospectionQuery } from '../graphql.types';
3
1
  import { BaseIntegrationConfig, BaseIntegrationSchema } from './schemas';
4
- import { IntegrationSchemaType, IntegrationType } from '../integration-types';
2
+ import { IntegrationSchemaType, IntegrationType } from '../integration.public-types';
3
+ import { IntrospectionQuery } from '../graphql.public-types';
4
+ import { FieldName } from '../document.public-types';
5
5
  export type HttpMethod = 'post' | 'get' | 'delete' | 'patch' | 'put';
6
6
  export type ApiEndpointId = string;
7
7
  export type ApiParameterLocation = 'query' | 'body' | 'header' | 'path';
@@ -1,5 +1,5 @@
1
1
  import { BaseIntegrationConfig } from './schemas';
2
- import { IntegrationType } from '../integration-types';
2
+ import { IntegrationType } from '../integration.public-types';
3
3
  export interface Auth0IntegrationConfig extends BaseIntegrationConfig {
4
4
  type: IntegrationType.auth0;
5
5
  configuration: {
@@ -1,7 +1,7 @@
1
1
  import { BaseIntegrationConfig, BaseIntegrationSchema, DatabaseIntegrationType } from './schemas';
2
- import { CollectionSchema } from '../../schema/schema.types';
3
- import { CollectionName } from '../document.types';
4
- import { IntegrationSchemaType, IntegrationType } from '../integration-types';
2
+ import { IntegrationSchemaType, IntegrationType } from '../integration.public-types';
3
+ import { CollectionName } from '../document.public-types';
4
+ import { CollectionSchema } from '../schema.public-types';
5
5
  export interface MongoConnectionSecretOptions {
6
6
  password?: string;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import { BaseIntegrationConfig } from './schemas';
2
- import { IntegrationType } from '../integration-types';
2
+ import { IntegrationType } from '../integration.public-types';
3
3
  export interface DatadogIntegrationConfig extends BaseIntegrationConfig {
4
4
  type: IntegrationType.datadog;
5
5
  configuration: DatadogIntegrationConfiguration;
@@ -1,4 +1,4 @@
1
- import { IntegrationType } from '../integration-types';
1
+ import { IntegrationType } from '../integration.public-types';
2
2
  import { BaseIntegrationConfig, QueueIntegrationTypes } from './schemas';
3
3
  export type QueueIntegrationType = (typeof QueueIntegrationTypes)[number];
4
4
  export interface BaseQueueIntegrationConfig extends BaseIntegrationConfig {
@@ -3,9 +3,9 @@ import { GraphQLIntegrationConfig, HttpApiIntegrationConfig, IntegrationApiSchem
3
3
  import { Auth0IntegrationConfig, CognitoIntegrationConfig, DescopeIntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig, OktaIntegrationConfig } from './auth.types';
4
4
  import { BaseDatabaseIntegrationConfig, BigQueryIntegrationConfig, CockroachIntegrationConfig, IntegrationDataSchema, InternalIntegrationConfig, MongoIntegrationConfig, MssqlIntegrationConfig, MySqlIntegrationConfig, OracleIntegrationConfig, PinotIntegrationConfig, PostgresIntegrationConfig, SnowflakeIntegrationConfig, TestDataConnectionRequest } from './database.types';
5
5
  import { DatadogIntegrationConfig, NewRelicIntegrationConfig } from './observability.types';
6
- import { IntegrationId } from '../communication.types';
7
- import { IntegrationSchemaType, IntegrationType } from '../integration-types';
6
+ import { IntegrationSchemaType, IntegrationType } from '../integration.public-types';
8
7
  import { BuiltInQueueIntegrationConfig, ConfluentIntegrationConfig, KafkaIntegrationConfig, TestConfluentConnectionRequest, TestKafkaConnectionRequest } from './queue-types';
8
+ import { IntegrationId } from '../communication.public-types';
9
9
  export interface IntegrationConfigTypes {
10
10
  [IntegrationType.built_in_db]: InternalIntegrationConfig;
11
11
  [IntegrationType.mongo]: MongoIntegrationConfig;
@@ -64,9 +64,9 @@ export type ObservabilityIntegrationConfig = IntegrationConfigTypes[Observabilit
64
64
  export type AuthIntegrationType = (typeof AuthIntegrationTypes)[number];
65
65
  export type AuthIntegrationConfig = IntegrationConfigTypes[AuthIntegrationType];
66
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;
67
+ export declare function isDataIntegration(integration: unknown): integration is BaseDatabaseIntegrationConfig;
68
+ export declare function isAuthIntegrationType(type: unknown): type is AuthIntegrationType;
69
+ export declare function isAuthIntegration(integration: unknown): integration is AuthIntegrationConfig;
70
70
  export interface BaseIntegrationConfig {
71
71
  id: IntegrationId;
72
72
  type: IntegrationTypeWithConfig;
@@ -1,8 +1,8 @@
1
- import { Mutation, MutationType } from './mutation.types';
2
- import { BeforeAndAfterDocs } from './document.types';
3
- import { Paths } from './types';
1
+ import { Paths } from './typescript.public-types';
2
+ import { BeforeAndAfterDocs } from './document.public-types';
3
+ import { Mutation, MutationType } from './mutation.public-types';
4
4
  /** The mutation context that will be provided to the security function. */
5
- export declare class MutationContext<T = any> {
5
+ export declare class MutationPublicContext<T = any> {
6
6
  readonly mutation: Mutation<T>;
7
7
  readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
8
8
  readonly serverTimeStamp: Date;
@@ -1,12 +1,12 @@
1
- import { SquidDocIdObj } from './document.types';
2
- /** A mutation on a document. */
3
- export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
4
- /** The mutation type. */
5
- export type MutationType = 'insert' | 'update' | 'delete';
1
+ import { SquidDocIdObj } from './document.public-types';
6
2
  interface BaseMutation {
7
3
  type: MutationType;
8
4
  squidDocIdObj: SquidDocIdObj;
9
5
  }
6
+ /** A mutation on a document. */
7
+ export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
8
+ /** The mutation type. */
9
+ export type MutationType = 'insert' | 'update' | 'delete';
10
10
  export interface DeleteMutation extends BaseMutation {
11
11
  type: 'delete';
12
12
  }
@@ -1,4 +1,4 @@
1
- import { ClientId } from './communication.types';
1
+ import { ClientId } from './communication.public-types';
2
2
  /** The context provided to the secure native query function. */
3
3
  export declare class NativeQueryContext {
4
4
  readonly query: string;
@@ -1,7 +1,7 @@
1
- import { FieldSort, Operator, Query, SimpleCondition } from './query.types';
2
- import { DeepRecord, FieldOf, PartialBy, Paths } from './types';
3
- import { CollectionName, DocumentData } from './document.types';
4
- import { IntegrationId } from './communication.types';
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
5
  export declare class QueryContext<T extends DocumentData = any> {
6
6
  readonly query: Query<T>;
7
7
  private readonly parsedConditions;
@@ -1,6 +1,6 @@
1
- import { CollectionName, DocumentData, FieldName } from './document.types';
2
- import { Paths } from './types';
3
- import { ClientRequestId } from './communication.types';
1
+ import { CollectionName, DocumentData, FieldName } from './document.public-types';
2
+ import { Paths } from './typescript.public-types';
3
+ import { ClientRequestId } from './communication.public-types';
4
4
  /**
5
5
  * An alias for a join result. This is used to disambiguate fields in the result.
6
6
  */
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The list of supported Squid regions.
3
+ */
4
+ export declare const SUPPORTED_SQUID_REGIONS: readonly ["us-east-1.aws"];
5
+ export type SupportedSquidRegion = (typeof SUPPORTED_SQUID_REGIONS)[number];
@@ -1,9 +1,4 @@
1
1
  import { JSONSchema } from 'json-schema-typed';
2
- export type FieldPlaceholder = '__SQUID_SERVER_TIMESTAMP__' | '__SQUID_CLIENT_IP__' | '__SQUID_USER_ID__' | '__SQUID_API_KEY__';
3
- export declare const BASIC_FIELD_TYPES: readonly ["string", "integer", "number", "boolean", "map", "array", "any"];
4
- export declare const CUSTOM_FIELD_TYPES: readonly ["date", "json", "objectId"];
5
- export declare const DATA_SCHEMA_FIELD_TYPES: readonly ["string", "integer", "number", "boolean", "map", "array", "any", "date", "json", "objectId"];
6
- export type DataSchemaFieldType = (typeof DATA_SCHEMA_FIELD_TYPES)[number];
7
2
  type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
8
3
  properties?: Record<string, ConvertDeep<JSONSchema>>;
9
4
  patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
@@ -48,7 +43,4 @@ export type TopLevelPropertySchema = PropertySchema & {
48
43
  export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
49
44
  properties?: Record<string, TopLevelPropertySchema>;
50
45
  };
51
- export declare function compileSchema<S extends CollectionSchema>(schema: S): any;
52
- export declare function validateSchema<S extends CollectionSchema>(schema: S, data: any, updatedPaths?: Array<string>, dataBefore?: any): void;
53
- export declare function findMatchingPropertiesForKey<S extends CollectionSchema | PropertySchema>(schema: S, key: string): Array<PropertySchema>;
54
46
  export {};
@@ -1,22 +1,16 @@
1
+ /** A type alias for an ApiKey. */
2
+ export type ApiKey = string;
1
3
  /** The secret key, an alias for a string. */
2
4
  export type SecretKey = string;
3
5
  /** The secret value. */
4
6
  export type SecretValue = string | number | boolean;
5
- /** A type alias for an ApiKey. */
6
- export type ApiKey = string;
7
- export type SetSecretEntry = {
7
+ export interface SecretMetadata {
8
8
  key: SecretKey;
9
- value?: SecretValue;
10
- };
11
- export declare const BACKEND_API_KEY = "_BACKEND_API_KEY";
12
- export declare const APP_API_KEY = "APP_API_KEY";
9
+ lastUpdated: number;
10
+ }
13
11
  export interface SecretEntry<T extends SecretValue = SecretValue> extends SecretMetadata {
14
12
  value: T;
15
13
  }
16
14
  export interface ApiKeyEntry extends SecretMetadata {
17
15
  value: string;
18
16
  }
19
- export interface SetSecretRequestEntry {
20
- key: SecretKey;
21
- value: SecretValue;
22
- }
@@ -1,5 +1,5 @@
1
- import { Alias, JoinCondition, Query } from './query.types';
2
- import { DocumentData } from './document.types';
1
+ import { DocumentData } from './document.public-types';
2
+ import { Alias, JoinCondition, Query } from './query.public-types';
3
3
  export type SerializedSimpleQuery = {
4
4
  type: 'simple';
5
5
  query: Query;
@@ -0,0 +1,5 @@
1
+ export declare enum ClientConnectionState {
2
+ CONNECTED = "CONNECTED",
3
+ DISCONNECTED = "DISCONNECTED",
4
+ REMOVED = "REMOVED"
5
+ }
@@ -0,0 +1,10 @@
1
+ import { IntegrationId } from './communication.public-types';
2
+ export interface TopicReadContext {
3
+ integrationId: IntegrationId;
4
+ topicName: string;
5
+ }
6
+ export interface TopicWriteContext<T> {
7
+ integrationId: IntegrationId;
8
+ topicName: string;
9
+ messages: Array<T>;
10
+ }
@@ -1,6 +1,7 @@
1
1
  export interface Type<T> extends Function {
2
2
  new (...args: any[]): T;
3
3
  }
4
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
4
5
  type PropertiesWithPrefix<Prefix extends string> = {
5
6
  [key in `${Prefix}${string}`]: any;
6
7
  };
@@ -1,4 +1,2 @@
1
- /** The headers of an API call. */
2
- export type ApiHeaders = Record<string, string | number | boolean>;
3
1
  /** The query parameters of an API call. */
4
2
  export type ApiQueryParams = Record<string, string | number | boolean>;
@@ -0,0 +1,4 @@
1
+ export interface LocalBackendData {
2
+ applicationBundleData: ApplicationBundleData;
3
+ openApiSpecStr?: string;
4
+ }
@@ -0,0 +1 @@
1
+ export type ChatId = string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { SecretKey, SecretValue } from '../public-types/secret.public-types';
2
+ export type SetSecretEntry = {
3
+ key: SecretKey;
4
+ value?: SecretValue;
5
+ };
6
+ export declare const BACKEND_API_KEY = "_BACKEND_API_KEY";
7
+ export declare const APP_API_KEY = "APP_API_KEY";
8
+ export interface SetSecretRequestEntry {
9
+ key: SecretKey;
10
+ value: SecretValue;
11
+ }
@@ -0,0 +1,7 @@
1
+ import { IntegrationId } from '../public-types/communication.public-types';
2
+ export interface QueueMessageToClient extends BaseMessageToClient {
3
+ type: 'queue';
4
+ integrationId: IntegrationId;
5
+ topicName: string;
6
+ payload: string[];
7
+ }
@@ -1,5 +1,5 @@
1
- export declare function getInPath(obj: any, path: string, delimiter?: string): any;
2
- export declare function setInPath(obj: any, path: string, value: any, delimiter?: string): void;
3
- export declare function deleteInPath(obj: any, path: string, delimiter?: string): void;
1
+ export declare function getInPath(obj: Readonly<Record<string, unknown>>, path: string, delimiter?: string): any;
2
+ export declare function setInPath(obj: object, path: string, value: unknown, delimiter?: string): void;
3
+ export declare function deleteInPath(obj: object, path: string, delimiter?: string): void;
4
4
  export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
5
5
  export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
@@ -1,5 +1,5 @@
1
- export declare function normalizeJsonAsString(json: any): string;
1
+ export declare function normalizeJsonAsString(json: unknown): string;
2
2
  export declare function serializeObj(obj: unknown): string;
3
3
  export declare function deserializeObj<T = any>(str: string): T;
4
- export declare function encodeValueForMapping(value: any): string;
4
+ export declare function encodeValueForMapping(value: unknown): string;
5
5
  export declare function decodeValueForMapping(encodedString: string): any;
@@ -1,5 +1,5 @@
1
1
  import { HttpStatus } from '../public-types/http-status.enum';
2
- import { OpenIdProvider } from '../public-types/application.types';
2
+ import { OpenIdProvider } from '../public-types/application.public-types';
3
3
  export type StatusCode = HttpStatus.BAD_REQUEST | HttpStatus.NOT_FOUND | HttpStatus.FORBIDDEN | HttpStatus.UNAUTHORIZED | HttpStatus.CONFLICT;
4
4
  export declare class ValidationError extends Error {
5
5
  readonly statusCode: StatusCode;
@@ -8,11 +8,11 @@ export declare class ValidationError extends Error {
8
8
  }
9
9
  export declare function isValidId(id: unknown): boolean;
10
10
  export declare function validateId(id: unknown, message: string): void;
11
- export declare function validateFieldSort(fieldSort: any): void;
11
+ export declare function validateFieldSort(fieldSort: unknown): void;
12
12
  export declare function validateOpenIdProvider(openIdProvider: OpenIdProvider | undefined): OpenIdProvider;
13
- export declare function validateOpenIdProviderType(providerType: any): void;
14
- export declare function validateMutations(mutations: any): void;
15
- export declare function validateQueryLimit(limit: any): void;
13
+ export declare function validateOpenIdProviderType(providerType: unknown): void;
14
+ export declare function validateMutations(mutations: unknown): void;
15
+ export declare function validateQueryLimit(limit: unknown): void;
16
16
  /** Returns true if the value is not an empty string (undefined/null are considered empty). */
17
17
  export declare function isNotEmpty(value: string | undefined | null): value is string;
18
18
  /**
@@ -1,6 +1,6 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { DestructManager } from './destruct.manager';
3
- import { ClientId } from './public-types';
3
+ import { ClientId } from '../../internal-common/src/public-types/communication.public-types';
4
4
  /**
5
5
  * Whenever a squid client is created, it assigns itself a client id.
6
6
  * Later on, if the squid client disconnects for a specified time interval, it will generate itself a new client id.
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ClientId } from './public-types';
2
+ import { ClientId } from '../../internal-common/src/public-types/communication.public-types';
3
3
  /**
4
4
  * Provides information about the connection to the Squid Server.
5
5
  */
@@ -8,7 +8,7 @@ import { QuerySender } from './query/query-sender';
8
8
  import { QuerySubscriptionManager } from './query/query-subscription.manager';
9
9
  import { SocketManager } from './socket.manager';
10
10
  import { TransactionId } from './types';
11
- import { LockManager } from '@squidcloud/internal-common/utils/lock.manager';
11
+ import { LockManager } from '../../internal-common/src/utils/lock.manager';
12
12
  export interface DocTimestampMetadata {
13
13
  timestamp: DocTimestamp;
14
14
  expireTimestamp?: number;
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { DestructManager } from './destruct.manager';
3
3
  import { DocumentStore } from './document-store';
4
- import { IdResolutionMap } from './public-types';
4
+ import { IdResolutionMap } from '../../internal-common/src/types/mutation.types';
5
5
  export default class DocumentIdentityService {
6
6
  private readonly documentStore;
7
7
  private readonly destructManager;
@@ -1,6 +1,7 @@
1
- import { DeepRecord, DocumentData, Paths } from './public-types';
1
+ import { DocumentData } from './public-types';
2
2
  import { Observable } from 'rxjs';
3
3
  import { TransactionId } from './types';
4
+ import { DeepRecord, Paths } from '../../internal-common/src/public-types/typescript.public-types';
4
5
  /**
5
6
  * Holds a reference to a document. A document reference is a reference to a specific record in a collection. You can
6
7
  * use it to read or write data to the document. A document can refer to a row in a table in a relational database or a
@@ -1,7 +1,8 @@
1
1
  import { RpcManager } from '../rpc.manager';
2
2
  import { QuerySender } from '../query/query-sender';
3
- import { LockManager } from '@squidcloud/internal-common/utils/lock.manager';
4
- import { IntegrationId, MutateResponse, Mutation } from '../public-types';
3
+ import { LockManager } from '../../../internal-common/src/utils/lock.manager';
4
+ import { IntegrationId, Mutation } from '../public-types';
5
+ import { MutateResponse } from '../../../internal-common/src/types/mutation.types';
5
6
  export declare class MutationSender {
6
7
  private readonly rpcManager;
7
8
  private readonly lockManager;