@squidcloud/client
Enumerations
- ClientConnectionState
- CronExpression
- HttpStatus
- IntegrationSchemaType
- IntegrationType
- LimitUnderflowState
Classes
- AiAssistantClient
- AiChatbotChatContext
- AiChatbotClient
- AiChatbotContextReference
- AiChatbotInstructionReference
- AiChatbotProfileReference
- AiClient
- AiImageClient
- ApiClient
- ApiKeysSecretClient
- BaseQueryBuilder
- Changes
- CollectionReference
- ConnectionDetails
- DestructManager
- DocumentReference
- DocumentStore
- ExtractionClient
- JoinQueryBuilder
- ObservabilityClient
- Pagination
- QueryBuilder
- RpcError
- SecretClient
- Squid
- StorageClient
Interfaces
- AiChatBotContextData
- AiChatbotChatOptions
- AiChatbotContextBase
- AiChatbotFileContext
- AiChatbotTextContext
- AiChatbotUrlContext
- AiFileUrl
- AiFunctionParam
- ApiEndpoint
- ApiInjectionField
- ApiKeyEntry
- ApiOptions
- ApiRequestField
- ApiResponseField
- ApplyNumericFnPropertyMutation
- AuthData
- AuthToken
- AuthWithApiKey
- AuthWithBearer
- BaseAiGenerateImageOptions
- BeforeAndAfterDocs
- BlobAndFilename
- CallApiOptions
- CompositeCondition
- DallEOptions
- DeleteFilesRequest
- DeleteMutation
- DiscoverOpenApiSchemaFromFileRequest
- DiscoverOpenApiSchemaRequest
- DistributedLock
- DocIdAndData
- DocTimestampMetadata
- DocsAndAlias
- DocumentFileData
- DocumentPageData
- DocumentTextDataResponse
- ExecuteAiQueryRequest
- ExecuteAiQueryResponse
- ExtractDataFromDocumentResponse
- FieldSort
- FileInDirectory
- GetDownloadUrlRequest
- GetDownloadUrlResponse
- GetFileMetadataRequest
- GetFileMetadataResponse
- GraphQLConnectionOptions
- HasDereference
- HttpResponse
- InsertMutation
- InstructionData
- JoinCondition
- JoinFields
- JoinOptions
- ListDirectoryContentsRequest
- ListDirectoryContentsResponse
- Metric
- NativeApiCallResponse
- OngoingQuery
- OpenApiDiscoveryOptions
- OpenApiResponse
- PaginationOptions
- PaginationState
- ProfileData
- Query
- QueryAssistantOptions
- QueueManager
- RemovePropertyMutation
- RunContext
- SecretEntry
- SecretMetadata
- SetSecretRequestEntry
- SimpleCondition
- SnapshotEmitter
- SquidAuthProvider
- SquidDocIdObj
- SquidDocument
- SquidOptions
- StableDiffusionCoreOptions
- StorageContext
- StorageFileUploadRequest
- TextOnlyPageData
- Type
- UpdateMutation
- ValueUpdatePropertyMutation
Type Aliases
AiChatModelName
Ƭ AiChatModelName: typeof AI_CHAT_MODEL_NAMES
[number
]
AiChatbotActionType
Ƭ AiChatbotActionType: "chat"
| "mutate"
| "all"
The different types of actions that can be performed on an AI chatbot.
AiChatbotConfiguration
Ƭ AiChatbotConfiguration: Object
Type declaration
Name | Type |
---|---|
apiKey? | string |
AiChatbotContext
Ƭ AiChatbotContext: AiChatbotTextContext
| AiChatbotUrlContext
| AiChatbotFileContext
AiChatbotContextMetadata
Ƭ AiChatbotContextMetadata: Object
Type declaration
Name | Type |
---|---|
preview | boolean |
sizeBytes? | number |
text | string |
title | string |
AiChatbotContextType
Ƭ AiChatbotContextType: "text"
| "url"
| "file"
AiChatbotMutationType
Ƭ AiChatbotMutationType: "insert"
| "update"
| "delete"
AiChatbotProfileMetadata
Ƭ AiChatbotProfileMetadata: Object
Type declaration
Name | Type |
---|---|
embeddingModelName? | AiEmbeddingsModelName |
instructions | Record <string , string > |
isPublic | boolean |
modelName | AiChatModelName |
strictContext | boolean |
vectorDbType? | VectorDbType |
AiChatbotResourceType
Ƭ AiChatbotResourceType: "instruction"
| "context"
| "profile"
AiEmbeddingsModelName
Ƭ AiEmbeddingsModelName: typeof AI_EMBEDDINGS_MODEL_NAMES
[number
]
AiFileUrlType
Ƭ AiFileUrlType: "image"
AiFunctionParamType
Ƭ AiFunctionParamType: "string"
| "number"
| "boolean"
| "date"
AiGenerateImageOptions
Ƭ AiGenerateImageOptions: DallEOptions
| StableDiffusionCoreOptions
AiImageModelName
Ƭ AiImageModelName: typeof AI_IMAGE_MODEL_NAMES
[number
]
Alias
Ƭ Alias: string
An alias for a join result. This is used to disambiguate fields in the result.
AnthropicChatModelName
Ƭ AnthropicChatModelName: typeof ANTHROPIC_CHAT_MODEL_NAMES
[number
]
ApiEndpointId
Ƭ ApiEndpointId: string
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.
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"
| "file_search"
Auth
Ƭ Auth: AuthWithBearer
| AuthWithApiKey
The authentication object for the current request.
AuthType
Ƭ AuthType: "Bearer"
| "ApiKey"
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
Name | Type |
---|---|
Doc | extends DocumentData = any |
Conditions
Ƭ Conditions<Doc
>: Condition
<Doc
>[]
Type parameters
Name | Type |
---|---|
Doc | extends DocumentData = any |
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
Name | Type |
---|---|
T | T |
RemainingDepth | extends number & keyof Pred = 5 |
Prefix | extends string = "" |
DestructorFn
Ƭ DestructorFn: () => Promise
<void
> | void
Type declaration
▸ (): Promise
<void
> | void
Returns
Promise
<void
> | void
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.
DocumentFileDataType
Ƭ DocumentFileDataType: "image"
EnvironmentId
Ƭ EnvironmentId: typeof ENVIRONMENT_IDS
[number
]
FieldName
Ƭ FieldName<T
>: string
& keyof T
A type alias for a field name.
Type parameters
Name | Type |
---|---|
T | any |
FieldOf
Ƭ FieldOf<T
, K
>: Extract
<T
, Record
<K
, any
>>[K
]
Type parameters
Name | Type |
---|---|
T | T |
K | extends UnionKeys <T > |
FieldPath
Ƭ FieldPath: string
FieldType
Ƭ FieldType: PrimitiveFieldType
| FieldType
[] | { [key: string]
: FieldType
; }
FunctionName
Ƭ FunctionName: string
GeminiChatModelName
Ƭ GeminiChatModelName: typeof GEMINI_CHAT_MODEL_NAMES
[number
]
HttpMethod
Ƭ HttpMethod: "post"
| "get"
| "delete"
| "patch"
| "put"
IntegrationApiEndpoints
Ƭ IntegrationApiEndpoints: Record
<ApiEndpointId
, ApiEndpoint
>
IntegrationId
Ƭ IntegrationId: string
A type alias for an integration id.
MetricType
Ƭ MetricType: typeof METRIC_TYPES
[number
]
@internal.
Mutation
Ƭ Mutation<T
>: UpdateMutation
<T
> | InsertMutation
<T
> | DeleteMutation
A mutation on a document.
Type parameters
Name | Type |
---|---|
T | any |
MutationType
Ƭ MutationType: typeof MUTATION_TYPES
[number
]
OpenAiChatModelName
Ƭ OpenAiChatModelName: typeof OPENAI_CHAT_MODEL_NAMES
[number
]
OpenAiImageModelName
Ƭ OpenAiImageModelName: typeof OPENAI_IMAGE_MODEL_NAMES
[number
]
OpenAiResponseFormat
Ƭ OpenAiResponseFormat: "text"
| "json_object"
Operator
Ƭ Operator: "=="
| "!="
| CompositeConditionOperator
| "like"
| "not like"
| "like_cs"
| "not like_cs"
| "array_includes_some"
| "array_includes_all"
| "array_not_includes"
An operator in a query condition.
PartialBy
Ƭ PartialBy<T
, K
>: Omit
<T
, K
> & Partial
<Pick
<T
, K
>>
Type parameters
Name | Type |
---|---|
T | T |
K | extends 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
Name | Type |
---|---|
Value | any |
PropertySchema
Ƭ PropertySchema: ConvertDeep
<JSONSchema
>
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.
SerializedJoinQuery
Ƭ SerializedJoinQuery: Object
Type declaration
Name | Type |
---|---|
dereference | boolean |
grouped | boolean |
joinConditions | Record <Alias , JoinCondition > |
joins | Record <Alias , Query <DocumentData >> |
leftToRight | Record <Alias , Alias []> |
root | { alias : Alias ; query : Query } |
root.alias | Alias |
root.query | Query |
type | "join" |
SerializedMergedQuery
Ƭ SerializedMergedQuery: Object
Type declaration
Name | Type |
---|---|
queries | SerializedQuery [] |
type | "merged" |
SerializedQuery
Ƭ SerializedQuery: SerializedSimpleQuery
| SerializedJoinQuery
| SerializedMergedQuery
SerializedSimpleQuery
Ƭ SerializedSimpleQuery: Object
Type declaration
Name | Type |
---|---|
dereference | boolean |
query | Query |
type | "simple" |
SetSecretEntry
Ƭ SetSecretEntry: Object
Type declaration
Name | Type |
---|---|
key | SecretKey |
value? | SecretValue |
SquidDeveloperId
Ƭ SquidDeveloperId: string
SquidDocId
Ƭ SquidDocId: string
SquidRegion
Ƭ SquidRegion: typeof SQUID_REGIONS
[number
]
Region type used by Squid.
StableDiffusionModelName
Ƭ StableDiffusionModelName: typeof STABLE_DIFFUSION_MODEL_NAMES
[number
]
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
TransactionId
Ƭ TransactionId: string
A transactionId - alias for string
TriggerId
Ƭ TriggerId: string
A type alias for a string that represents a trigger id.
UnionKeys
Ƭ UnionKeys<T
>: T
extends any
? keyof T
: never
Type parameters
Name |
---|
T |
VectorDbType
Ƭ VectorDbType: "pinecone"
| "postgres"
WebhookId
Ƭ WebhookId: string
A type alias for a string that represents a webhook.
Variables
AI_CHAT_MODEL_NAMES
• Const
AI_CHAT_MODEL_NAMES: readonly ["gpt-3.5-turbo"
, "gpt-3.5-turbo-1106"
, "gpt-4"
, "gpt-4-turbo-preview"
, "gpt-4o"
, "gpt-4o-mini"
, "gpt-4-turbo"
, "claude-3-opus-20240229"
, "claude-3-sonnet-20240229"
, "claude-3-haiku-20240307"
, "claude-3-5-sonnet-20240620"
, "gemini-pro"
]
The supported AI model names.
AI_EMBEDDINGS_MODEL_NAMES
• Const
AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small"
, "text-embedding-3-large"
, "text-embedding-ada-002"
]
AI_IMAGE_MODEL_NAMES
• Const
AI_IMAGE_MODEL_NAMES: readonly ["dall-e-3"
, "stable-diffusion-core"
]
ALL_OPERATORS
• Const
ALL_OPERATORS: Operator
[]
ANTHROPIC_CHAT_MODEL_NAMES
• Const
ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-opus-20240229"
, "claude-3-sonnet-20240229"
, "claude-3-haiku-20240307"
, "claude-3-5-sonnet-20240620"
]
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
GEMINI_CHAT_MODEL_NAMES
• Const
GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-pro"
]
LIMIT_UNDERFLOW_TRIGGER
• Const
LIMIT_UNDERFLOW_TRIGGER: 20
METRIC_TYPES
• Const
METRIC_TYPES: readonly ["gauge"
, "count"
]
@internal.
MUTATION_TYPES
• Const
MUTATION_TYPES: readonly ["insert"
, "update"
, "delete"
]
The mutation type.
OPENAI_CHAT_MODEL_NAMES
• Const
OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-3.5-turbo"
, "gpt-3.5-turbo-1106"
, "gpt-4"
, "gpt-4-turbo-preview"
, "gpt-4o"
, "gpt-4o-mini"
, "gpt-4-turbo"
]
The supported OpenAI models
OPENAI_EMBEDDINGS_MODEL_NAMES
• Const
OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small"
, "text-embedding-3-large"
, "text-embedding-ada-002"
]
OPENAI_IMAGE_MODEL_NAMES
• Const
OPENAI_IMAGE_MODEL_NAMES: readonly ["dall-e-3"
]
The supported AI image generation model names.
SQUID_REGIONS
• Const
SQUID_REGIONS: readonly ["us-east-1.aws"
, "ap-south-1.aws"
, "us-central1.gcp"
]
The list of regions in Squid.
STABLE_DIFFUSION_MODEL_NAMES
• Const
STABLE_DIFFUSION_MODEL_NAMES: readonly ["stable-diffusion-core"
]
SUPPORTED_SQUID_REGIONS
• Const
SUPPORTED_SQUID_REGIONS: readonly ["us-east-1.aws"
, "ap-south-1.aws"
, "us-central1.gcp"
] = SQUID_REGIONS
@deprecated: Use 'SQUID_REGIONS'.
allEnvironmentIds
• Const
allEnvironmentIds: EnvironmentId
[]
@deprecated. Use ENVIRONMENT_IDS.
Functions
deserializeQuery
▸ deserializeQuery<ReturnType
>(squid
, serializedQuery
): SnapshotEmitter
<ReturnType
>
Type parameters
Name | Type |
---|---|
ReturnType | any |
Parameters
Name | Type |
---|---|
squid | Squid |
serializedQuery | SerializedQuery |
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
Name | Type | Default value |
---|---|---|
length | number | DEFAULT_SHORT_ID_LENGTH |
prefix | string | '' |
Returns
string
isSimpleCondition
▸ isSimpleCondition(condition
): condition is SimpleCondition<any, string, Operator>
Parameters
Name | Type |
---|---|
condition | Condition <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
Name | Type |
---|---|
ResponseType | unknown |
RequestType | unknown |
Parameters
Name | Type |
---|---|
input | HttpPostInput <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
Name | Type |
---|---|
text | undefined | string |
Returns
T
| string
| undefined