Skip to main content

@squidcloud/client

Enumerations

Classes

Interfaces

Type Aliases

ActionMethodDecorator

Ƭ ActionMethodDecorator<U>: ActionMethodDecoratorDeprecated<U>

@deprecated. Use import from @squidcloud/backend.

Type parameters

Name
U

AiChatbotActionType

Ƭ AiChatbotActionType: "chat" | "mutate" | "all"

The different types of actions that can be performed on an AI chatbot.


AiChatbotConfiguration

Ƭ AiChatbotConfiguration: Object

Type declaration

NameType
apiKey?string

AiChatbotContext

Ƭ AiChatbotContext: AiChatbotTextContext | AiChatbotUrlContext | AiChatbotFileContext


AiChatbotContextMetadata

Ƭ AiChatbotContextMetadata: Object

Type declaration

NameType
previewboolean
sizeBytes?number
textstring
titlestring

AiChatbotContextType

Ƭ AiChatbotContextType: "text" | "url" | "file"


AiChatbotMutationContext

Ƭ AiChatbotMutationContext: AiChatbotMutationContextDeprecated

@deprecated. Use import from @squidcloud/backend.


AiChatbotMutationType

Ƭ AiChatbotMutationType: "insert" | "update" | "delete"


AiChatbotProfileMetadata

Ƭ AiChatbotProfileMetadata: Object

Type declaration

NameType
instructionsRecord<string, string>
isPublicboolean
modelNameAiModelName
strictContextboolean

AiChatbotResourceType

Ƭ AiChatbotResourceType: "instruction" | "context" | "profile"


AiFunctionAction

Ƭ AiFunctionAction<T>: AiFunctionActionDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Textends Record<string, any> = any

AiFunctionParamType

Ƭ AiFunctionParamType: "string" | "number" | "boolean" | "date"


AiGenerateImageOptions

Ƭ AiGenerateImageOptions: DallEOptions | StableDiffusionCoreOptions


AiImageGenerationModelName

Ƭ AiImageGenerationModelName: typeof AI_IMAGE_GENERATION_MODEL_NAMES[number]


AiModelName

Ƭ AiModelName: typeof AI_MODEL_NAMES[number]


Alias

Ƭ Alias: string

An alias for a join result. This is used to disambiguate fields in the result.


ApiCallContext

Ƭ ApiCallContext: ApiCallContextDeprecated

@deprecated. Use import from @squidcloud/backend.


ApiEndpointId

Ƭ ApiEndpointId: string


ApiHeaders

Ƭ ApiHeaders: ApiHeadersDeprecated

@deprecated. Use import from @squidcloud/backend.


ApiInjectionFieldType

Ƭ ApiInjectionFieldType: "secret" | "regular"


ApiInjectionParameterLocation

Ƭ ApiInjectionParameterLocation: "header" | "query"


ApiInjectionSchema

Ƭ ApiInjectionSchema: Record<FieldName, ApiInjectionField>


ApiKey

Ƭ ApiKey: string

A type alias for an ApiKey.


ApiKeySource

Ƭ ApiKeySource: "user" | "system"

The possible sources for the LLM provider API key.


ApiOptions

Ƭ ApiOptions: ApiOptionsDeprecated

@deprecated. Use import from @squidcloud/backend.


ApiParameterLocation

Ƭ ApiParameterLocation: "query" | "body" | "header" | "path"


ApiResponseParameterLocation

Ƭ ApiResponseParameterLocation: "header" | "body"


AppId

Ƭ AppId: string

A type alias for an application id.


ApplyStringFnPropertyMutation

Ƭ ApplyStringFnPropertyMutation: ApplyExtendString | ApplyTrimString

A property mutation that modifies a string


AssistantToolType

Ƭ AssistantToolType: "code_interpreter" | "retrieval"


Auth

Ƭ Auth: AuthWithBearer | AuthWithApiKey

The authentication object for the current request.


AuthType

Ƭ AuthType: "Bearer" | "ApiKey"


CallApiRequest

Ƭ CallApiRequest<BodyType>: CallApiRequestDeprecated<BodyType>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
BodyTypeany

ClientConnectionStateChangeAction

Ƭ ClientConnectionStateChangeAction: ClientConnectionStateChangeActionDeprecated

@deprecated. Use import from @squidcloud/backend.


ClientId

Ƭ ClientId: string


ClientRequestId

Ƭ ClientRequestId: string


CollectionName

Ƭ CollectionName: string

A type alias for a collection name.


CollectionSchema

Ƭ CollectionSchema: Omit<ConvertDeep<JSONSchema>, "properties"> & { properties?: Record<string, TopLevelPropertySchema> }


Condition

Ƭ Condition<Doc>: SimpleCondition<Doc> | CompositeCondition<Doc>

A list of query conditions.

Type parameters

NameType
Docextends DocumentData = any

Conditions

Ƭ Conditions<Doc>: Condition<Doc>[]

Type parameters

NameType
Docextends DocumentData = any

ContextConditions

Ƭ ContextConditions<Doc, F>: ContextConditionsDeprecated<Doc, F>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Docextends DocumentData = any
Fextends Paths<Doc> = Paths<Doc>

CronExpressionString

Ƭ CronExpressionString: `${string} ${string} ${string} ${string} ${string}` | `${string} ${string} ${string} ${string}`

The supported cron expression string.


DatabaseActionType

Ƭ DatabaseActionType: "read" | "write" | "update" | "insert" | "delete" | "all"

The different types of actions that can be performed on a database.


DeepRecord

Ƭ DeepRecord<T, RemainingDepth, Prefix>: RemainingDepth extends 0 ? PropertiesWithPrefix<Prefix> : { [k in keyof T]-?: k extends string | number ? Record<`${Prefix}${k}`, T[k]> | (Required<T>[k] extends any[] ? never : Required<T>[k] extends object ? DeepRecord<Required<T>[k], Pred[RemainingDepth], `${Prefix}${k}.`> : never) : never }[keyof T]

Type parameters

NameType
TT
RemainingDepthextends number & keyof Pred = 5
Prefixextends string = ""

DestructorFn

Ƭ DestructorFn: () => Promise<void> | void

Type declaration

▸ (): Promise<void> | void

Returns

Promise<void> | void


DistributedLockContext

Ƭ DistributedLockContext: DistributedLockContextDeprecated

@deprecated. Use import from @squidcloud/backend.


DocId

Ƭ DocId: string

A type alias for a document id as string.


DocIdObj

Ƭ DocIdObj: Record<FieldName, any>

A type alias for a document id object when the ID is a composite of primary keys.


DocIdOrDocIdObj

Ƭ DocIdOrDocIdObj: DocId | DocIdObj

A type alias for a document id or a document id object.


DocTimestamp

Ƭ DocTimestamp: number


DocumentData

Ƭ DocumentData: Record<FieldName, any | undefined>

A generic document data type.


EnvironmentId

Ƭ EnvironmentId: typeof ENVIRONMENT_IDS[number]


ExecutableAction

Ƭ ExecutableAction: ExecutableActionDeprecated

@deprecated. Use import from @squidcloud/backend.


FieldName

Ƭ FieldName<T>: string & keyof T

A type alias for a field name.

Type parameters

NameType
Tany

FieldOf

Ƭ FieldOf<T, K>: Extract<T, Record<K, any>>[K]

Type parameters

NameType
TT
Kextends UnionKeys<T>

FieldPath

Ƭ FieldPath: string


FieldType

Ƭ FieldType: PrimitiveFieldType | FieldType[] | { [key: string]: FieldType; }


FunctionName

Ƭ FunctionName: string


GraphqlContext

Ƭ GraphqlContext: GraphqlContextDeprecated

@deprecated. Use import from @squidcloud/backend.


HttpMethod

Ƭ HttpMethod: "post" | "get" | "delete" | "patch" | "put"


IntegrationApiEndpoints

Ƭ IntegrationApiEndpoints: Record<ApiEndpointId, ApiEndpoint>


IntegrationId

Ƭ IntegrationId: string

A type alias for an integration id.


LimitedAction

Ƭ LimitedAction: LimitedActionDeprecated

@deprecated. Use import from @squidcloud/backend.


LimiterConfig

Ƭ LimiterConfig: LimiterConfigDeprecated

@deprecated. Use import from @squidcloud/backend.


LimiterOptions

Ƭ LimiterOptions: LimiterOptionsDeprecated

@deprecated. Use import from @squidcloud/backend.


LimiterScope

Ƭ LimiterScope: LimiterScopeDeprecated

@deprecated. Use import from @squidcloud/backend.


Mutation

Ƭ Mutation<T>: UpdateMutation<T> | InsertMutation<T> | DeleteMutation

A mutation on a document.

Type parameters

NameType
Tany

MutationContext

Ƭ MutationContext<T>: MutationContextDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Tany

MutationType

Ƭ MutationType: "insert" | "update" | "delete"

The mutation type.


NativeQueryContext

Ƭ NativeQueryContext: RelationalNativeQueryContext | MongoNativeQueryContext


NativeQueryRequestType

Ƭ NativeQueryRequestType: "relational" | "mongo"


OpenAiResponseFormat

Ƭ OpenAiResponseFormat: "text" | "json_object"


Operator

Ƭ Operator: "==" | "!=" | CompositeConditionOperator | "like" | "not like" | "like_cs" | "not like_cs"

An operator in a query condition.


PartialBy

Ƭ PartialBy<T, K>: Omit<T, K> & Partial<Pick<T, K>>

Type parameters

NameType
TT
Kextends keyof T

Paths

Ƭ Paths<T>: UnionKeys<DeepRecord<T>>

Type parameters

Name
T

PrimitiveFieldType

Ƭ PrimitiveFieldType: string | number | boolean | null | Date


PropertyMutation

Ƭ PropertyMutation<Value>: ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation

A representation of a single property update

Type parameters

NameType
Valueany

PropertySchema

Ƭ PropertySchema: ConvertDeep<JSONSchema>


QueryContext

Ƭ QueryContext<T>: QueryContextDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Textends DocumentData = any

QuotaLimitOptions

Ƭ QuotaLimitOptions: QuotaLimitOptionsDeprecated

@deprecated. Use import from @squidcloud/backend.


QuotaRenewPeriod

Ƭ QuotaRenewPeriod: QuotaRenewPeriodDeprecated

@deprecated. Use import from @squidcloud/backend.


RateLimitOptions

Ƭ RateLimitOptions: RateLimitOptionsDeprecated

@deprecated. Use import from @squidcloud/backend.


SchedulerAction

Ƭ SchedulerAction: SchedulerActionDeprecated

@deprecated. Use import from @squidcloud/backend.


SchedulerId

Ƭ SchedulerId: string

A type alias for a string that represents a scheduler id.


SecretKey

Ƭ SecretKey: string

The secret key, an alias for a string.


SecretValue

Ƭ SecretValue: string | number | boolean

The secret value.


SecureAiChatbotAction

Ƭ SecureAiChatbotAction<T>: SecureAiChatbotActionDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Textends AiChatbotActionType

SecureApiAction

Ƭ SecureApiAction: SecureApiActionDeprecated

@deprecated. Use import from @squidcloud/backend.


SecureDatabaseAction

Ƭ SecureDatabaseAction<T>: SecureDatabaseActionDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Textends DatabaseActionType

SecureDistributedLockAction

Ƭ SecureDistributedLockAction: SecureDistributedLockActionDeprecated


SecureGraphQLAction

Ƭ SecureGraphQLAction: SecureGraphQLActionDeprecated

@deprecated. Use import from @squidcloud/backend.


SecureNativeQueryAction

Ƭ SecureNativeQueryAction: SecureNativeQueryActionDeprecated

@deprecated. Use import from @squidcloud/backend.


SecureStorageAction

Ƭ SecureStorageAction<T>: SecureStorageActionDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Textends StorageActionType

SecureTopicAction

Ƭ SecureTopicAction<T>: SecureTopicActionDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Textends TopicActionType

SerializedJoinQuery

Ƭ SerializedJoinQuery: Object

Type declaration

NameType
dereferenceboolean
groupedboolean
joinConditionsRecord<Alias, JoinCondition>
joinsRecord<Alias, Query<DocumentData>>
leftToRightRecord<Alias, Alias[]>
root{ alias: Alias ; query: Query }
root.aliasAlias
root.queryQuery
type"join"

SerializedMergedQuery

Ƭ SerializedMergedQuery: Object

Type declaration

NameType
queriesSerializedQuery[]
type"merged"

SerializedQuery

Ƭ SerializedQuery: SerializedSimpleQuery | SerializedJoinQuery | SerializedMergedQuery


SerializedSimpleQuery

Ƭ SerializedSimpleQuery: Object

Type declaration

NameType
dereferenceboolean
queryQuery
type"simple"

SetSecretEntry

Ƭ SetSecretEntry: Object

Type declaration

NameType
keySecretKey
value?SecretValue

SquidDeveloperId

Ƭ SquidDeveloperId: string


SquidDocId

Ƭ SquidDocId: string


SquidFile

Ƭ SquidFile: SquidFileDeprecated

@deprecated. Use import from @squidcloud/backend.


SquidRegion

Ƭ SquidRegion: typeof SQUID_REGIONS[number]

Region type used by Squid.


StorageActionType

Ƭ StorageActionType: "read" | "write" | "update" | "insert" | "delete" | "all"

The different types of actions that can be performed for storage.


StorageFunctionality

Ƭ StorageFunctionality: "fileUpload" | "getFileMetadata" | "getDownloadUrl" | "deleteFiles" | "listDirectoryContents"


SupportedSquidRegion

Ƭ SupportedSquidRegion: SquidRegion

@deprecated: Use 'SquidRegion'.


TopLevelPropertySchema

Ƭ TopLevelPropertySchema: PropertySchema & { dataType?: string ; hidden?: boolean ; isComputed?: boolean ; isDefaultComputed?: boolean ; primaryKey?: boolean }


TopicActionType

Ƭ TopicActionType: "read" | "write" | "all"

The different types of actions that can be performed on a topic.


TopicName

Ƭ TopicName: string


TopicReadContext

Ƭ TopicReadContext: TopicReadContextDeprecated

@deprecated. Use import from @squidcloud/backend.


TopicWriteContext

Ƭ TopicWriteContext<T>: TopicWriteContextDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

Name
T

TransactionId

Ƭ TransactionId: string

A transactionId - alias for string


TriggerAction

Ƭ TriggerAction: TriggerActionDeprecated

@deprecated. Use import from @squidcloud/backend.


TriggerId

Ƭ TriggerId: string

A type alias for a string that represents a trigger id.


TriggerRequest

Ƭ TriggerRequest<T>: TriggerRequestDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Textends DocumentData = any

UnionKeys

Ƭ UnionKeys<T>: T extends any ? keyof T : never

Type parameters

Name
T

WebhookAction

Ƭ WebhookAction: WebhookActionDeprecated

@deprecated. Use import from @squidcloud/backend.


WebhookId

Ƭ WebhookId: string

A type alias for a string that represents a webhook.


WebhookRequest

Ƭ WebhookRequest<T>: WebhookRequestDeprecated<T>

@deprecated. Use import from @squidcloud/backend.

Type parameters

NameType
Tany

WebhookResponse

Ƭ WebhookResponse: WebhookResponseDeprecated

@deprecated. Use import from @squidcloud/backend.

Variables

AI_IMAGE_GENERATION_MODEL_NAMES

Const AI_IMAGE_GENERATION_MODEL_NAMES: readonly ["dall-e-3", "stable-diffusion-core"]

The supported AI image generation model names.


AI_MODEL_NAMES

Const AI_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "gpt-4-turbo-preview"]

The supported AI model names.


ALL_OPERATORS

Const ALL_OPERATORS: Operator[]


DEFAULT_SHORT_ID_LENGTH

Const DEFAULT_SHORT_ID_LENGTH: 18

Default length if ID produced by generateShortId.


ENVIRONMENT_IDS

Const ENVIRONMENT_IDS: readonly ["dev", "prod"]


FETCH_BEYOND_LIMIT

Const FETCH_BEYOND_LIMIT: 100


LIMIT_UNDERFLOW_TRIGGER

Const LIMIT_UNDERFLOW_TRIGGER: 20


SQUID_REGIONS

Const SQUID_REGIONS: readonly ["us-east-1.aws", "ap-south-1.aws"]

The list of regions in Squid.


SUPPORTED_SQUID_REGIONS

Const SUPPORTED_SQUID_REGIONS: readonly ["us-east-1.aws", "ap-south-1.aws"] = SQUID_REGIONS

@deprecated: Use 'SQUID_REGIONS'.


allEnvironmentIds

Const allEnvironmentIds: EnvironmentId[]

@deprecated. Use ENVIRONMENT_IDS.

Functions

deserializeQuery

deserializeQuery<ReturnType>(squid, serializedQuery): SnapshotEmitter<ReturnType>

Type parameters

NameType
ReturnTypeany

Parameters

NameType
squidSquid
serializedQuerySerializedQuery

Returns

SnapshotEmitter<ReturnType>


generateId

generateId(): string

Generates a UUID-style ID.

Returns

string


generateShortId

generateShortId(length?, prefix?): string

Generates an ID of the given length using lowercase latin letters and digits. If the 'prefix' provided replaces the first generated characters with the prefix.

Parameters

NameTypeDefault value
lengthnumberDEFAULT_SHORT_ID_LENGTH
prefixstring''

Returns

string


isSimpleCondition

isSimpleCondition(condition): condition is SimpleCondition<any, string, Operator>

Parameters

NameType
conditionCondition<any>

Returns

condition is SimpleCondition<any, string, Operator>


rawSquidHttpPost

rawSquidHttpPost<ResponseType, RequestType>(input): Promise<HttpResponse<ResponseType>>

Runs a post request to the given URL. @internal.

Type parameters

NameType
ResponseTypeunknown
RequestTypeunknown

Parameters

NameType
inputHttpPostInput<RequestType>

Returns

Promise<HttpResponse<ResponseType>>


tryDeserializing

tryDeserializing<T>(text): T | string | undefined

@internal.

note: this method hides potential error. Every endpoint call should know what kind result to expect and call 'deserializeObj' directly.

Type parameters

Name
T

Parameters

NameType
textundefined | string

Returns

T | string | undefined