@squidcloud/client 1.0.160 → 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 (65) hide show
  1. package/dist/cjs/index.js +5729 -3248
  2. package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +1 -1
  3. package/dist/internal-common/src/public-types/{application.types.d.ts → application.public-types.d.ts} +2 -2
  4. package/dist/internal-common/src/public-types/{base-query-builder.d.ts → base-query-builder.public-types.d.ts} +4 -4
  5. package/dist/internal-common/src/public-types/{bundle-api.types.d.ts → bundle-api.public-types.d.ts} +21 -13
  6. package/dist/internal-common/src/public-types/{bundle-data.types.d.ts → bundle-data.public-types.d.ts} +1 -4
  7. package/dist/internal-common/src/public-types/{communication.types.d.ts → communication.public-types.d.ts} +4 -2
  8. package/dist/internal-common/src/public-types/{context.types.d.ts → context.public-types.d.ts} +1 -1
  9. package/dist/internal-common/src/public-types/{document.types.d.ts → document.public-types.d.ts} +18 -8
  10. package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +2 -2
  11. package/dist/internal-common/src/public-types/integrations/api.types.d.ts +3 -3
  12. package/dist/internal-common/src/public-types/integrations/auth.types.d.ts +1 -1
  13. package/dist/internal-common/src/public-types/integrations/database.types.d.ts +3 -3
  14. package/dist/internal-common/src/public-types/integrations/observability.types.d.ts +1 -1
  15. package/dist/internal-common/src/public-types/integrations/queue-types.d.ts +1 -1
  16. package/dist/internal-common/src/public-types/integrations/schemas.d.ts +2 -2
  17. package/dist/internal-common/src/public-types/{mutation.context.d.ts → mutation.public-context.d.ts} +4 -4
  18. package/dist/internal-common/src/public-types/{mutation.types.d.ts → mutation.public-types.d.ts} +5 -5
  19. package/dist/internal-common/src/public-types/{query-context.d.ts → query.public-context.d.ts} +4 -4
  20. package/dist/internal-common/src/public-types/{query.types.d.ts → query.public-types.d.ts} +3 -3
  21. package/dist/internal-common/src/public-types/regions.public-types.d.ts +5 -0
  22. package/dist/internal-common/src/{schema/schema.types.d.ts → public-types/schema.public-types.d.ts} +0 -8
  23. package/dist/internal-common/src/public-types/{secret.types.d.ts → secret.public-types.d.ts} +5 -11
  24. package/dist/internal-common/src/public-types/{serialized-query.types.d.ts → serialized-query.public-types.d.ts} +2 -2
  25. package/dist/internal-common/src/public-types/socket.public-types.d.ts +5 -0
  26. package/dist/internal-common/src/public-types/topic.public-context.d.ts +10 -0
  27. package/dist/internal-common/src/public-types/{types.d.ts → typescript.public-types.d.ts} +1 -0
  28. package/dist/internal-common/src/{public-types → types}/api-call.context.d.ts +1 -1
  29. package/dist/internal-common/src/types/bundle-data.types.d.ts +4 -0
  30. package/dist/internal-common/src/types/communication.types.d.ts +1 -0
  31. package/dist/internal-common/src/{public-types → types}/native-query.context.d.ts +1 -1
  32. package/dist/internal-common/src/types/openapi.types.d.ts +1 -0
  33. package/dist/internal-common/src/types/query.types.d.ts +1 -0
  34. package/dist/internal-common/src/types/secret.types.d.ts +11 -0
  35. package/dist/internal-common/src/types/socket.types.d.ts +7 -0
  36. package/dist/internal-common/src/utils/validation.d.ts +1 -1
  37. package/dist/typescript-client/src/client-id.service.d.ts +1 -1
  38. package/dist/typescript-client/src/connection-details.d.ts +1 -1
  39. package/dist/typescript-client/src/data.manager.d.ts +1 -1
  40. package/dist/typescript-client/src/document-identity.service.d.ts +1 -1
  41. package/dist/typescript-client/src/document-reference.d.ts +2 -1
  42. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +3 -2
  43. package/dist/typescript-client/src/public-types.d.ts +23 -32
  44. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +1 -1
  45. package/dist/typescript-client/src/query/query-sender.d.ts +2 -1
  46. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +4 -2
  47. package/dist/typescript-client/src/rpc.manager.d.ts +1 -1
  48. package/dist/typescript-client/src/secret.client.d.ts +2 -1
  49. package/dist/typescript-client/src/socket.manager.d.ts +2 -1
  50. package/package.json +1 -1
  51. package/dist/internal-common/src/public-types/heartbeat.types.d.ts +0 -1
  52. package/dist/internal-common/src/public-types/logger.types.d.ts +0 -21
  53. package/dist/internal-common/src/public-types/metrics.types.d.ts +0 -1
  54. package/dist/internal-common/src/public-types/regions.d.ts +0 -1
  55. package/dist/internal-common/src/public-types/socket.types.d.ts +0 -12
  56. /package/dist/internal-common/src/public-types/{graphql.types.d.ts → graphql.public-types.d.ts} +0 -0
  57. /package/dist/internal-common/src/public-types/{integration-types.d.ts → integration.public-types.d.ts} +0 -0
  58. /package/dist/internal-common/src/public-types/{native-query.types.d.ts → native-query.public-types.d.ts} +0 -0
  59. /package/dist/internal-common/src/public-types/{pagination.d.ts → pagination.public-types.d.ts} +0 -0
  60. /package/dist/internal-common/src/{public-types → types}/api.types.d.ts +0 -0
  61. /package/dist/internal-common/src/{public-types → types}/backend-run.types.d.ts +0 -0
  62. /package/dist/internal-common/src/{public-types → types}/distributed-lock.context.d.ts +0 -0
  63. /package/dist/internal-common/src/{public-types/openapi.types.d.ts → types/document.types.d.ts} +0 -0
  64. /package/dist/internal-common/src/{public-types → types}/graphql.context.d.ts +0 -0
  65. /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,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';
1
+ import { MutationPublicContext } from './mutation.public-context';
2
+ import { ApiCallContext } from '../types/api-call.context';
3
+ import { GraphqlContext } from '../types/graphql.context';
4
+ import { DistributedLockContext } from '../types/distributed-lock.context';
5
+ import { NativeQueryContext } from '../types/native-query.context';
6
+ import { QueryContext } from './query.public-context';
7
+ import { AiChatbotActionType, DatabaseActionType, TopicActionType } from './bundle-data.public-types';
13
8
  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>);
9
+ import { ClientConnectionState } from './socket.public-types';
10
+ import { DocumentData } from './document.public-types';
11
+ import { MutationType } from './mutation.public-types';
12
+ import { ClientId, SquidDocId } from './communication.public-types';
13
+ import { TopicReadContext, TopicWriteContext } from './topic.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;
@@ -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,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,5 +1,5 @@
1
1
  import { ApiHeaders } from './api.types';
2
- import { ApiEndpointId, HttpMethod } from './integrations/api.types';
2
+ import { ApiEndpointId, HttpMethod } from '../public-types/integrations/api.types';
3
3
  /** The context of an API call. */
4
4
  export declare class ApiCallContext {
5
5
  readonly endpointId: ApiEndpointId;
@@ -0,0 +1,4 @@
1
+ export interface LocalBackendData {
2
+ applicationBundleData: ApplicationBundleData;
3
+ openApiSpecStr?: string;
4
+ }
@@ -0,0 +1 @@
1
+ export type ChatId = string;
@@ -1,4 +1,4 @@
1
- import { ClientId } from './communication.types';
1
+ import { ClientId } from '../public-types/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;
@@ -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
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;
@@ -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;
@@ -1,41 +1,32 @@
1
1
  export * from '../../internal-common/src/public-types/ai-assistant.public-types';
2
2
  export * from '../../internal-common/src/public-types/ai-chatbot.public-types';
3
- export * from '../../internal-common/src/public-types/api-call.context';
4
- export * from '../../internal-common/src/public-types/api.types';
5
- export * from '../../internal-common/src/public-types/application.types';
6
- export * from '../../internal-common/src/public-types/backend-run.types';
7
- export * from '../../internal-common/src/public-types/base-query-builder';
8
- export * from '../../internal-common/src/public-types/bundle-api.types';
9
- export * from '../../internal-common/src/public-types/bundle-data.types';
10
- export * from '../../internal-common/src/public-types/communication.types';
11
- export * from '../../internal-common/src/public-types/context.types';
12
- export * from '../../internal-common/src/public-types/distributed-lock.context';
13
- export * from '../../internal-common/src/public-types/document.types';
14
- export * from '../../internal-common/src/public-types/graphql.context';
15
- export * from '../../internal-common/src/public-types/graphql.types';
16
- export * from '../../internal-common/src/public-types/heartbeat.types';
3
+ export * from '../../internal-common/src/public-types/application.public-types';
4
+ export * from '../../internal-common/src/public-types/base-query-builder.public-types';
5
+ export * from '../../internal-common/src/public-types/bundle-api.public-types';
6
+ export * from '../../internal-common/src/public-types/bundle-data.public-types';
7
+ export * from '../../internal-common/src/public-types/communication.public-types';
8
+ export * from '../../internal-common/src/public-types/context.public-types';
9
+ export * from '../../internal-common/src/public-types/document.public-types';
10
+ export * from '../../internal-common/src/public-types/graphql.public-types';
17
11
  export * from '../../internal-common/src/public-types/http-status.enum';
18
- export * from '../../internal-common/src/public-types/integration-types';
12
+ export * from '../../internal-common/src/public-types/integration.public-types';
19
13
  export * from '../../internal-common/src/public-types/integrations/ai_chatbot.types';
20
14
  export * from '../../internal-common/src/public-types/integrations/api.types';
21
15
  export * from '../../internal-common/src/public-types/integrations/auth.types';
22
16
  export * from '../../internal-common/src/public-types/integrations/database.types';
23
17
  export * from '../../internal-common/src/public-types/integrations/observability.types';
24
- export * from '../../internal-common/src/public-types/integrations/schemas';
25
18
  export * from '../../internal-common/src/public-types/integrations/queue-types';
26
- export * from '../../internal-common/src/public-types/logger.types';
27
- export * from '../../internal-common/src/public-types/metrics.types';
28
- export * from '../../internal-common/src/public-types/mutation.context';
29
- export * from '../../internal-common/src/public-types/mutation.types';
30
- export * from '../../internal-common/src/public-types/native-query.context';
31
- export * from '../../internal-common/src/public-types/native-query.types';
32
- export * from '../../internal-common/src/public-types/openapi.types';
33
- export * from '../../internal-common/src/public-types/pagination';
34
- export * from '../../internal-common/src/public-types/query-context';
35
- export * from '../../internal-common/src/public-types/query.types';
36
- export * from '../../internal-common/src/public-types/regions';
37
- export * from '../../internal-common/src/public-types/secret.types';
38
- export * from '../../internal-common/src/public-types/serialized-query.types';
39
- export * from '../../internal-common/src/public-types/socket.types';
40
- export * from '../../internal-common/src/public-types/topic.context';
41
- export * from '../../internal-common/src/public-types/types';
19
+ export * from '../../internal-common/src/public-types/integrations/schemas';
20
+ export * from '../../internal-common/src/public-types/mutation.public-context';
21
+ export * from '../../internal-common/src/public-types/mutation.public-types';
22
+ export * from '../../internal-common/src/public-types/native-query.public-types';
23
+ export * from '../../internal-common/src/public-types/pagination.public-types';
24
+ export * from '../../internal-common/src/public-types/query.public-context';
25
+ export * from '../../internal-common/src/public-types/query.public-types';
26
+ export * from '../../internal-common/src/public-types/regions.public-types';
27
+ export * from '../../internal-common/src/public-types/schema.public-types';
28
+ export * from '../../internal-common/src/public-types/secret.public-types';
29
+ export * from '../../internal-common/src/public-types/serialized-query.public-types';
30
+ export * from '../../internal-common/src/public-types/socket.public-types';
31
+ export * from '../../internal-common/src/public-types/topic.public-context';
32
+ export * from '../../internal-common/src/public-types/typescript.public-types';
@@ -106,7 +106,7 @@ export declare class JoinQueryBuilder<Aliases extends Record<Alias, Alias[]>, Re
106
106
  clone(): JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>;
107
107
  addCompositeCondition(conditions: Array<SimpleCondition>): JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>;
108
108
  flipSortOrder(): JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>;
109
- extractData(data: WithDocumentReferences<ReturnType>): any;
109
+ extractData(data: WithDocumentReferences<ReturnType>): Required<ReturnType>[RootAlias];
110
110
  serialize(): SerializedJoinQuery;
111
111
  paginate(options?: Partial<PaginationOptions>): Pagination<WithDocumentReferences<ReturnType>>;
112
112
  }
@@ -1,7 +1,8 @@
1
1
  import { RpcManager } from '../rpc.manager';
2
2
  import { BehaviorSubject } from 'rxjs';
3
3
  import { DestructManager } from '../destruct.manager';
4
- import { QueryRequest, QueryResultData } from '../public-types';
4
+ import { QueryRequest } from '../../../internal-common/src/types/query.types';
5
+ import { QueryResultData } from '../../../internal-common/src/types/socket.types';
5
6
  export declare class QuerySender {
6
7
  private readonly rpcManager;
7
8
  private readonly destructManager;