JavaScript and TypeScript utilities for Juno Serverless Functions.
Function
Type
HookContextSchema
<T extends z.ZodTypeAny>(dataSchema: T) => ZodObject<typeof schemaShape, "strict", ZodTypeAny, baseObjectOutputType<typeof schemaShape>, baseObjectInputType<typeof schemaShape>>
π Source
βοΈ AssertFunctionSchema
Function
Type
AssertFunctionSchema
<T extends z.ZodTypeAny>(contextSchema: T) => ZodFunction<ZodTuple<[T], ZodUnknown>, ZodVoid>
π Source
Function
Type
RunFunctionSchema
<T extends z.ZodTypeAny>(contextSchema: T) => ZodFunction<ZodTuple<[T], ZodUnknown>, ZodUnion<[ZodPromise<ZodVoid>, ZodVoid]>>
π Source
Function
Type
DocContextSchema
<T extends z.ZodTypeAny>(dataSchema: T) => ZodObject<typeof schemaShape, "strict", ZodTypeAny, baseObjectOutputType<typeof schemaShape>, baseObjectInputType<typeof schemaShape>>
π Source
Function
Type
AssertFnSchema
<T extends z.ZodTypeAny>(assertSchema: T) => ZodFunction<ZodTuple<[ZodRecord<ZodString, ZodUnknown>], ZodUnknown>, T>
π Source
βοΈ AssertFnOrObjectSchema
Function
Type
AssertFnOrObjectSchema
<T extends z.ZodTypeAny>(assertSchema: T) => ZodUnion<[T, ZodFunction<ZodTuple<[ZodRecord<ZodString, ZodUnknown>], ZodUnknown>, T>]>
π Source
Function
Type
defineAssert
{ <T extends Assert>(assert: T): T; <T extends Assert>(assert: AssertFn<T>): AssertFn<T>; <T extends Assert>(assert: AssertFnOrObject<T>): AssertFnOrObject<T>; }
π Source
Function
Type
defineAssert
{ <T extends Assert>(assert: T): T; <T extends Assert>(assert: AssertFn<T>): AssertFn<T>; <T extends Assert>(assert: AssertFnOrObject<T>): AssertFnOrObject<T>; }
π Source
Function
Type
defineAssert
{ <T extends Assert>(assert: T): T; <T extends Assert>(assert: AssertFn<T>): AssertFn<T>; <T extends Assert>(assert: AssertFnOrObject<T>): AssertFnOrObject<T>; }
π Source
Function
Type
defineAssert
{ <T extends Assert>(assert: T): T; <T extends Assert>(assert: AssertFn<T>): AssertFn<T>; <T extends Assert>(assert: AssertFnOrObject<T>): AssertFnOrObject<T>; }
π Source
Function
Type
HookFnSchema
<T extends z.ZodTypeAny>(hookSchema: T) => ZodFunction<ZodTuple<[ZodRecord<ZodString, ZodUnknown>], ZodUnknown>, T>
π Source
βοΈ HookFnOrObjectSchema
Function
Type
HookFnOrObjectSchema
<T extends z.ZodTypeAny>(hookSchema: T) => ZodUnion<[T, ZodFunction<ZodTuple<[ZodRecord<ZodString, ZodUnknown>], ZodUnknown>, T>]>
π Source
Function
Type
defineHook
{ <T extends Hook>(hook: T): T; <T extends Hook>(hook: HookFn<T>): HookFn<T>; <T extends Hook>(hook: HookFnOrObject<T>): HookFnOrObject<T>; }
π Source
Function
Type
defineHook
{ <T extends Hook>(hook: T): T; <T extends Hook>(hook: HookFn<T>): HookFn<T>; <T extends Hook>(hook: HookFnOrObject<T>): HookFnOrObject<T>; }
π Source
Function
Type
defineHook
{ <T extends Hook>(hook: T): T; <T extends Hook>(hook: HookFn<T>): HookFn<T>; <T extends Hook>(hook: HookFnOrObject<T>): HookFnOrObject<T>; }
π Source
Function
Type
defineHook
{ <T extends Hook>(hook: T): T; <T extends Hook>(hook: HookFn<T>): HookFn<T>; <T extends Hook>(hook: HookFnOrObject<T>): HookFnOrObject<T>; }
π Source
βοΈ createListResultsSchema
Represents a list result.
Function
Type
createListResultsSchema
<T extends z.ZodTypeAny>(itemData: T) => ZodObject<{ items: ZodArray<ZodTuple<[ZodString, T], null>, "many">; items_length: ZodBigInt; items_page: ZodOptional<...>; matches_length: ZodBigInt; matches_pages: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
Normalizes a user ID into a raw Uint8Array
representation.
Function
Type
normalizeCaller
(caller: Uint8Array<ArrayBufferLike> or Principal) => Uint8Array<ArrayBufferLike>
Parameters:
caller
: - The caller identity, either a raw Uint8Array
or a Principal
instance.
π Source
βοΈ getAdminControllers
Gets the list of admin controllers from the Satellite.
Function
Type
getAdminControllers
() => [Uint8Array<ArrayBufferLike>, { created_at: bigint; updated_at: bigint; metadata: [string, string][]; scope: "write" or "admin"; expires_at?: bigint or undefined; }][]
π Source
Gets the list of controllers from the Satellite.
Function
Type
getControllers
() => [Uint8Array<ArrayBufferLike>, { created_at: bigint; updated_at: bigint; metadata: [string, string][]; scope: "write" or "admin"; expires_at?: bigint or undefined; }][]
π Source
Checks if the given caller is an admin among the provided controllers.
Function
Type
isAdminController
(params: ControllerCheckParams) => boolean
Parameters:
params
: - The parameters including the caller identity
and the list of controllers to verify against.
π Source
Checks if the given caller exists among the provided controllers.
Function
Type
isController
(params: ControllerCheckParams) => boolean
Parameters:
params
: - The parameters including the caller identity
and the list of controllers to verify against.
π Source
Stores or updates a document in the datastore.
The data must have been encoded - using encodeDocData - before calling this function.
Function
Type
setDocStore
(params: SetDocStoreParams) => DocContext<DocUpsert>
Parameters:
params
: - The parameters required to store the document,
including the caller, collection, key, and document data.
π Source
Deletes a document from the datastore.
Function
Type
deleteDocStore
(params: DeleteDocStoreParams) => DocContext<OptionDoc>
Parameters:
params
: - The parameters required to delete the document,
including the caller, collection, key, and the expected version of the document.
π Source
Retrieve a document from the datastore.
Function
Type
getDocStore
(params: GetDocStoreParams) => OptionDoc
Parameters:
params
: - The parameters required to get the document.
π Source
Lists documents from the datastore using optional filtering, pagination, and ordering parameters.
Function
Type
listDocsStore
(params: ListStoreParams) => ListResults<Doc>
Parameters:
params
: - The parameters required to perform the list operation.
π Source
βοΈ countCollectionDocsStore
Counts the number of documents in a specific collection.
Function
Type
countCollectionDocsStore
(params: CollectionParams) => bigint
Parameters:
params
: - The parameters required to count documents in the collection.
π Source
Counts the number of documents in a collection matching specific filters and owned by a specific caller.
Function
Type
countDocsStore
(params: ListStoreParams) => bigint
Parameters:
params
: - The parameters required to perform the filtered count.
π Source
Delete documents in a specific collection of the Datastore.
Function
Type
deleteDocsStore
(params: CollectionParams) => void
Parameters:
params
: - The parameters required to delete documents in the collection.
π Source
βοΈ deleteFilteredDocsStore
Delete documents in a collection matching specific filters and owned by a specific caller.
Function
Type
deleteFilteredDocsStore
(params: ListStoreParams) => DocContext<OptionDoc>[]
Parameters:
params
: - The parameters required to perform the filtered deletion.
π Source
Decodes the raw data of a document into a JavaScript object.
Function
Type
decodeDocData
<T>(data: Uint8Array<ArrayBufferLike>) => T
Parameters:
data
: - The raw data to be decoded.
π Source
Encodes a JavaScript object into a raw data format to be applied to a document.
Function
Type
encodeDocData
<T>(data: T) => Uint8Array<ArrayBufferLike>
Parameters:
data
: - The data to be encoded.
π Source
βοΈ countCollectionAssetsStore
Counts the number of assets in a specific collection.
Function
Type
countCollectionAssetsStore
(params: CollectionParams) => bigint
Parameters:
params
: - The parameters required to count assets in the collection.
π Source
Counts the number of assets in a collection matching specific filters and owned by a specific caller.
Function
Type
countAssetsStore
(params: ListStoreParams) => bigint
Parameters:
params
: - The parameters required to perform the filtered count.
π Source
Sets or updates an asset in the storage.
Function
Type
setAssetHandler
(params: SetAssetHandlerParams) => void
Parameters:
params
: - The parameters required to set or update an asset.
π Source
Deletes an asset from the storage.
Function
Type
deleteAssetStore
(params: GetAssetStoreParams) => OptionAsset
Parameters:
params
: - The parameters required to delete the asset.
π Source
Delete assets in a specific collection of the Storage.
Function
Type
deleteAssetsStore
(params: CollectionParams) => void
Parameters:
params
: - The parameters required to delete assets in the collection.
π Source
βοΈ deleteFilteredAssetsStore
Delete assets in a collection matching specific filters and owned by a specific caller.
Function
Type
deleteFilteredAssetsStore
(params: ListStoreParams) => OptionAsset[]
Parameters:
params
: - The parameters required to perform the filtered deletion.
π Source
Retrieve an asset from the storage.
Function
Type
getAssetStore
(params: GetAssetStoreParams) => OptionAsset
Parameters:
params
: - The parameters required to get the asset.
π Source
Lists assets (without content) from the storage using optional filtering, pagination, and ordering parameters.
Function
Type
listAssetsStore
(params: ListStoreParams) => ListResults<AssetNoContent>
Parameters:
params
: - The parameters required to perform the list operation.
π Source
βοΈ getContentChunksStore
Retrieves content chunks of an asset.
This function fetches a content chunk of a given asset encoding using the specified parameters.
Function
Type
getContentChunksStore
(params: GetContentChunksStoreParams) => Blob or undefined
Parameters:
params
: - The parameters including encoding, chunk index, and memory type.
π Source
Makes an asynchronous call to a canister on the Internet Computer.
This function encodes the provided arguments using Candid, performs the canister call,
and decodes the response based on the expected result types.
Function
Type
call
<T>(params: CallParams) => Promise<T>
Parameters:
params
: - The parameters required for the canister call
π Source
Retrieves the Satellite's Principal ID.
This function is a JavaScript binding for the Rust function
ic_cdk::id()
, which returns
the Principal of the executing canister.
Function
Type
id
() => Principal
π Source
Gets current timestamp, in nanoseconds since the epoch (1970-01-01)
This function is a JavaScript binding for the Rust function
ic_cdk::time()
, which returns
the system time publicly exposed and verified part of the IC state tree
Function
Type
time
() => bigint
π Source
A schema that validates a value is an Uint8Array.
Constant
Type
Uint8ArraySchema
ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>
π Source
βοΈ RawPrincipalSchema
Constant
Type
RawPrincipalSchema
ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>
π Source
Constant
Type
PrincipalSchema
ZodType<Principal, ZodTypeDef, Principal>
π Source
Constant
Type
TimestampSchema
ZodBigInt
π Source
Constant
Type
VersionSchema
ZodBigInt
π Source
Constant
Type
RawUserIdSchema
ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>
π Source
Constant
Type
UserIdSchema
ZodType<Principal, ZodTypeDef, Principal>
π Source
Constant
Type
CollectionSchema
ZodString
π Source
Constant
Type
KeySchema
ZodString
π Source
Constant
Type
DescriptionSchema
ZodString
π Source
Constant
Type
CollectionsSchema
ZodObject<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, "strict", ZodTypeAny, { collections: readonly string[]; }, { collections: readonly string[]; }>
π Source
Constant
Type
RawDataSchema
ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>
π Source
Constant
Type
DocSchema
ZodObject<{ owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; ... 4 more ...; version: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
Constant
Type
OptionDocSchema
ZodOptional<ZodObject<{ owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; ... 4 more ...; version: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>>
π Source
Constant
Type
SetDocSchema
ZodObject<{ data: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; description: ZodOptional<...>; version: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
Constant
Type
DelDocSchema
ZodObject<{ version: ZodOptional<ZodBigInt>; }, "strict", ZodTypeAny, { version?: bigint or undefined; }, { version?: bigint or undefined; }>
π Source
Constant
Type
DocUpsertSchema
ZodObject<{ before: ZodOptional<ZodObject<{ owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; ... 4 more ...; version: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>>; after: ZodObject<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ DocAssertSetSchema
Constant
Type
DocAssertSetSchema
ZodObject<{ current: ZodOptional<ZodObject<{ owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; ... 4 more ...; version: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>>; proposed: ZodObject<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ DocAssertDeleteSchema
Constant
Type
DocAssertDeleteSchema
ZodObject<{ current: ZodOptional<ZodObject<{ owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; ... 4 more ...; version: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>>; proposed: ZodObject<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ OnSetDocContextSchema
Constant
Type
OnSetDocContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ OnSetManyDocsContextSchema
Constant
Type
OnSetManyDocsContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ OnDeleteDocContextSchema
Constant
Type
OnDeleteDocContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ OnDeleteManyDocsContextSchema
Constant
Type
OnDeleteManyDocsContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ OnDeleteFilteredDocsContextSchema
Constant
Type
OnDeleteFilteredDocsContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ AssertSetDocContextSchema
Constant
Type
AssertSetDocContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ AssertDeleteDocContextSchema
Constant
Type
AssertDeleteDocContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ SatelliteEnvSchema
Constant
Type
SatelliteEnvSchema
ZodRecord<ZodString, ZodUnknown>
π Source
βοΈ HeaderFieldsSchema
Constant
Type
HeaderFieldsSchema
ZodArray<ZodTuple<[ZodString, ZodString], null>, "many">
π Source
Constant
Type
BlobSchema
ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>
π Source
Constant
Type
AssetKeySchema
ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; description: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ AssetEncodingSchema
Constant
Type
AssetEncodingSchema
ZodObject<{ modified: ZodBigInt; content_chunks: ZodArray<ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, "many">; total_length: ZodBigInt; sha256: ZodEffects<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>
π Source
Constant
Type
AssetSchema
ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; description: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>; ... 4 more ...; version: ZodOptional<...>; }...
π Source
βοΈ AssetNoContentSchema
Constant
Type
AssetNoContentSchema
ZodObject<extendShape<Omit<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; description: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>; ... 4 more ...; version: Zo...
π Source
Constant
Type
BatchSchema
ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; description: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>; reference_id: ZodOptional<...>; expires_at: ...
π Source
Constant
Type
CommitBatchSchema
ZodObject<{ batch_id: ZodBigInt; headers: ZodArray<ZodTuple<[ZodString, ZodString], null>, "many">; chunk_ids: ZodArray<ZodBigInt, "many">; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
Constant
Type
FullPathSchema
ZodString
π Source
Constant
Type
OptionAssetSchema
ZodOptional<ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; description: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>; ... 4 more ...; version: ZodOpti...
π Source
βοΈ AssetAssertUploadSchema
Constant
Type
AssetAssertUploadSchema
ZodObject<{ current: ZodOptional<ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodType<...>; description: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>; ... 4 more ...; version: ZodOptional<...>; }, "strict", ZodTypeA...
π Source
βοΈ OnUploadAssetContextSchema
Constant
Type
OnUploadAssetContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ OnDeleteAssetContextSchema
Constant
Type
OnDeleteAssetContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodOptional<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ OnDeleteManyAssetsContextSchema
Constant
Type
OnDeleteManyAssetsContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ OnDeleteFilteredAssetsContextSchema
Constant
Type
OnDeleteFilteredAssetsContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ AssertUploadAssetContextSchema
Constant
Type
AssertUploadAssetContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ AssertDeleteAssetContextSchema
Constant
Type
AssertDeleteAssetContextSchema
ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>
π Source
βοΈ AssertSetDocSchema
Constant
Type
AssertSetDocSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { assert: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, Z...
π Source
βοΈ AssertDeleteDocSchema
Constant
Type
AssertDeleteDocSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { assert: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, Z...
π Source
βοΈ AssertUploadAssetSchema
Constant
Type
AssertUploadAssetSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { assert: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, Z...
π Source
βοΈ AssertDeleteAssetSchema
Constant
Type
AssertDeleteAssetSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { assert: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, Z...
π Source
Constant
Type
AssertSchema
ZodUnion<[ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { assert: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodU...
π Source
Constant
Type
OnSetDocSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, ZodU...
π Source
βοΈ OnSetManyDocsSchema
Constant
Type
OnSetManyDocsSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, ZodUn...
π Source
Constant
Type
OnDeleteDocSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, ZodU...
π Source
βοΈ OnDeleteManyDocsSchema
Constant
Type
OnDeleteManyDocsSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, ZodUn...
π Source
βοΈ OnDeleteFilteredDocsSchema
Constant
Type
OnDeleteFilteredDocsSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, ZodUn...
π Source
βοΈ OnUploadAssetSchema
Constant
Type
OnUploadAssetSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, ZodU...
π Source
βοΈ OnDeleteAssetSchema
Constant
Type
OnDeleteAssetSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodOptional<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, Zo...
π Source
βοΈ OnDeleteManyAssetsSchema
Constant
Type
OnDeleteManyAssetsSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, ZodUn...
π Source
βοΈ OnDeleteFilteredAssetsSchema
Constant
Type
OnDeleteFilteredAssetsSchema
ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodArray<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnknown>, ZodUn...
π Source
Constant
Type
HookSchema
ZodUnion<[ZodObject<extendShape<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, { run: ZodFunction<ZodTuple<[ZodObject<{ caller: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; data: ZodObject<...>; }, "strict", ZodTypeAny, baseObjectOutputType<...>, baseObjectInputType<...>>], ZodUnkn...
π Source
βοΈ TimestampMatcherSchema
Constant
Type
TimestampMatcherSchema
ZodUnion<[ZodObject<{ equal: ZodBigInt; }, "strip", ZodTypeAny, { equal: bigint; }, { equal: bigint; }>, ZodObject<{ greater_than: ZodBigInt; }, "strip", ZodTypeAny, { ...; }, { ...; }>, ZodObject<...>, ZodObject<...>]>
π Source
Constant
Type
ListMatcherSchema
ZodObject<{ key: ZodOptional<ZodString>; description: ZodOptional<ZodString>; created_at: ZodOptional<ZodUnion<[ZodObject<{ equal: ZodBigInt; }, "strip", ZodTypeAny, { ...; }, { ...; }>, ZodObject<...>, ZodObject<...>, ZodObject<...>]>>; updated_at: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ ListPaginateSchema
Constant
Type
ListPaginateSchema
ZodObject<{ start_after: ZodOptional<ZodString>; limit: ZodOptional<ZodBigInt>; }, "strict", ZodTypeAny, { start_after?: string or undefined; limit?: bigint or undefined; }, { ...; }>
π Source
βοΈ ListOrderFieldSchema
Constant
Type
ListOrderFieldSchema
ZodEnum<["keys", "created_at", "updated_at"]>
π Source
Constant
Type
ListOrderSchema
ZodObject<{ desc: ZodBoolean; field: ZodEnum<["keys", "created_at", "updated_at"]>; }, "strict", ZodTypeAny, { desc: boolean; field: "keys" or "created_at" or "updated_at"; }, { ...; }>
π Source
Constant
Type
ListParamsSchema
ZodObject<{ matcher: ZodOptional<ZodObject<{ key: ZodOptional<ZodString>; description: ZodOptional<ZodString>; created_at: ZodOptional<ZodUnion<[ZodObject<{ equal: ZodBigInt; }, "strip", ZodTypeAny, { ...; }, { ...; }>, ZodObject<...>, ZodObject<...>, ZodObject<...>]>>; updated_at: ZodOptional<...>; }, "strict", Zod...
π Source
βοΈ ControllerScopeSchema
Constant
Type
ControllerScopeSchema
ZodEnum<["write", "admin"]>
π Source
Constant
Type
MetadataSchema
ZodTuple<[ZodString, ZodString], null>
π Source
Constant
Type
ControllerSchema
ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>, "many">; created_at: ZodBigInt; updated_at: ZodBigInt; expires_at: ZodOptional<...>; scope: ZodEnum<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ ControllerRecordSchema
Constant
Type
ControllerRecordSchema
ZodTuple<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodObject<...>], null>
π Source
βοΈ ControllersSchema
Constant
Type
ControllersSchema
ZodArray<ZodTuple<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodObject<...>], null>, "many">
π Source
βοΈ ControllerCheckParamsSchema
Constant
Type
ControllerCheckParamsSchema
ZodObject<{ caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; controllers: ZodArray<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ CollectionParamsSchema
Constant
Type
CollectionParamsSchema
ZodObject<{ collection: ZodString; }, "strict", ZodTypeAny, { collection: string; }, { collection: string; }>
π Source
βοΈ ListStoreParamsSchema
Constant
Type
ListStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; params: ZodObject<...>; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ GetDocStoreParamsSchema
Constant
Type
GetDocStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; key: ZodString; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ SetDocStoreParamsSchema
Constant
Type
SetDocStoreParamsSchema
ZodObject<extendShape<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; key: ZodString; }>, { ...; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ DeleteDocStoreParamsSchema
Constant
Type
DeleteDocStoreParamsSchema
ZodObject<extendShape<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; key: ZodString; }>, { ...; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ CountCollectionDocsStoreParamsSchema
Constant
Type
CountCollectionDocsStoreParamsSchema
ZodObject<{ collection: ZodString; }, "strict", ZodTypeAny, { collection: string; }, { collection: string; }>
π Source
βοΈ CountDocsStoreParamsSchema
Constant
Type
CountDocsStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; params: ZodObject<...>; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ ListDocsStoreParamsSchema
Constant
Type
ListDocsStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; params: ZodObject<...>; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ DeleteDocsStoreParamsSchema
Constant
Type
DeleteDocsStoreParamsSchema
ZodObject<{ collection: ZodString; }, "strict", ZodTypeAny, { collection: string; }, { collection: string; }>
π Source
βοΈ DeleteFilteredDocsStoreParamsSchema
Constant
Type
DeleteFilteredDocsStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; params: ZodObject<...>; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
Constant
Type
MemorySchema
ZodEnum<["heap", "stable"]>
π Source
βοΈ GetAssetStoreParamsSchema
Constant
Type
GetAssetStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; full_path: ZodString; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ CountCollectionAssetsStoreParamsSchema
Constant
Type
CountCollectionAssetsStoreParamsSchema
ZodObject<{ collection: ZodString; }, "strict", ZodTypeAny, { collection: string; }, { collection: string; }>
π Source
βοΈ CountAssetsStoreParamsSchema
Constant
Type
CountAssetsStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; params: ZodObject<...>; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ SetAssetHandlerParamsSchema
Constant
Type
SetAssetHandlerParamsSchema
ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<...>>; description: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>; content: ZodType<...>; headers: ZodArray<......
π Source
βοΈ DeleteAssetsStoreParamsSchema
Constant
Type
DeleteAssetsStoreParamsSchema
ZodObject<{ collection: ZodString; }, "strict", ZodTypeAny, { collection: string; }, { collection: string; }>
π Source
βοΈ DeleteFilteredAssetsStoreParamsSchema
Constant
Type
DeleteFilteredAssetsStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; params: ZodObject<...>; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ DeleteAssetStoreParamsSchema
Constant
Type
DeleteAssetStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; full_path: ZodString; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ ListAssetsStoreParamsSchema
Constant
Type
ListAssetsStoreParamsSchema
ZodObject<extendShape<{ collection: ZodString; }, { caller: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; params: ZodObject<...>; }>, "strict", ZodTypeAny, { ...; }, { ...; }>
π Source
βοΈ GetContentChunksStoreParamsSchema
Constant
Type
GetContentChunksStoreParamsSchema
ZodObject<{ encoding: ZodObject<{ modified: ZodBigInt; content_chunks: ZodArray<ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, "many">; total_length: ZodBigInt; sha256: ZodEffects<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>; chunk_index: ZodBigInt; memory: ZodEnum<...>; }, "stri...
π Source
Constant
Type
IDLTypeSchema
ZodType<Type<unknown>, ZodTypeDef, Type<unknown>>
π Source
Constant
Type
CallArgSchema
ZodTuple<[ZodType<Type<unknown>, ZodTypeDef, Type<unknown>>, ZodUnknown], null>
π Source
Schema for encoding the call arguments.
Constant
Type
CallArgsSchema
ZodArray<ZodTuple<[ZodType<Type<unknown>, ZodTypeDef, Type<unknown>>, ZodUnknown], null>, "many">
π Source
Constant
Type
CallResultSchema
ZodType<Type<unknown>, ZodTypeDef, Type<unknown>>
π Source
Constant
Type
CallParamsSchema
ZodObject<{ canisterId: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; method: ZodString; args: ZodOptional<...>; result: ZodOptional<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>
π Source
π CallResponseLengthError
π Source
Defines the collections where a hook or assertion should run.
Property
Type
Description
collections
readonly string[]
An array of collection names where the hook or assertion will run. If empty, no hooks or assertions are triggered.
Represents the context provided to hooks, containing information about the caller and related data.
Property
Type
Description
caller
Uint8Array<ArrayBufferLike>
The user who originally triggered the function that in turn triggered the hook.
data
T
The data associated with the hook execution.
Represents a document stored in a collection.
Property
Type
Description
owner
Uint8Array<ArrayBufferLike>
The user who owns this document.
data
Uint8Array<ArrayBufferLike>
The raw data of the document.
description
string or undefined
An optional description of the document.
created_at
bigint
The timestamp when the document was first created.
updated_at
bigint
The timestamp when the document was last updated.
version
bigint or undefined
The version number of the document, used for consistency checks. If not provided, it's assumed to be the first version.
Represents the proposed version of a document to be created or updated.
This can be validated before allowing the operation.
Property
Type
Description
data
Uint8Array<ArrayBufferLike>
The raw data of the document.
description
string or undefined
An optional description of the document.
version
bigint or undefined
The expected version number to ensure consistency.
Represents the proposed version of a document to be deleted.
This can be validated before allowing the operation.
Property
Type
Description
version
bigint or undefined
The expected version number to ensure consistency.
Represents a document update operation.
This is used in hooks where a document is either being created or updated.
Property
Type
Description
before
Doc or undefined
The previous version of the document before the update. Undefined if this is a new document.
after
Doc
The new version of the document after the update.
Represents a validation check before setting a document.
The developer can compare the current
and proposed
versions and
throw an error if their validation fails.
Property
Type
Description
current
Doc or undefined
The current version of the document before the operation. Undefined if this is a new document.
proposed
SetDoc
The proposed version of the document. This can be validated before allowing the operation.
Represents a validation check before deleting a document.
The developer can compare the current
and proposed
versions and
throw an error if their validation fails.
Property
Type
Description
current
Doc or undefined
The current version of the document before the operation. Undefined if the document does not exist.
proposed
DelDoc
The proposed version of the document. This can be validated before allowing the operation.
Represents the context of a document operation within a collection.
Property
Type
Description
collection
string
The name of the collection where the document is stored.
key
string
The key identifying the document within the collection.
data
T
The data associated with the document operation.
Metadata identifying an asset within a collection and the storage system.
Property
Type
Description
name
string
The name of the asset (e.g., "logo.png").
full_path
string
The full relative path of the asset (e.g., "/images/logo.png").
token
string or undefined
Optional access token for the asset. If set, can be used using a query parameter e.g. /full_path/?token=1223-3345-5564-3333
collection
string
The collection to which this asset belongs.
owner
Uint8Array<ArrayBufferLike>
The owner of the asset.
description
string or undefined
Optional description of the asset for indexing/search.
Represents a specific encoding of an asset, such as "gzip" or "identity" (no compression).
Property
Type
Description
modified
bigint
Timestamp when the encoding was last modified.
content_chunks
BlobOrKey[]
Chunks of binary content or references to them.
total_length
bigint
Total byte size of the encoded content.
sha256
Hash
SHA-256 hash of the encoded content.
A stored asset including its metadata, encodings, and timestamps.
Property
Type
Description
key
AssetKey
Metadata about the asset's identity and ownership.
headers
HeaderField[]
Optional HTTP headers associated with the asset.
encodings
[EncodingType, AssetEncoding][]
A mapping from encoding types (e.g., "identity", "gzip") to the corresponding encoded version.
created_at
bigint
Timestamp when the asset was created.
updated_at
bigint
Timestamp when the asset was last updated.
version
bigint or undefined
Optional version number of the asset.
Represents a batch of chunks to be uploaded and committed to an asset.
Property
Type
Description
key
AssetKey
The metadata key for the asset being uploaded.
reference_id
bigint or undefined
Optional reference ID for tracking or validation.
expires_at
bigint
Timestamp when this batch expires.
encoding_type
EncodingType or undefined
Optional encoding format (e.g., "gzip").
Represents the final step in uploading an asset, committing the batch to storage.
Property
Type
Description
batch_id
bigint
The ID of the batch being committed.
headers
HeaderField[]
HTTP headers associated with this asset.
chunk_ids
bigint[]
List of chunk IDs that make up the asset content.
Represents a validation context before uploading an asset.
Property
Type
Description
current
Asset or undefined
The current asset already stored (if any).
batch
Batch
The batch metadata being uploaded.
commit_batch
CommitBatch
The commit data describing headers and chunk ids.
Matcher used to filter list results.
Property
Type
Description
key
string or undefined
description
string or undefined
created_at
TimestampMatcher or undefined
updated_at
TimestampMatcher or undefined
Optional pagination controls for listing.
Property
Type
Description
start_after
string or undefined
limit
bigint or undefined
Ordering strategy for listing documents.
Property
Type
Description
desc
boolean
field
ListOrderField
Full set of listing parameters.
Property
Type
Description
matcher
ListMatcher or undefined
paginate
ListPaginate or undefined
order
ListOrder or undefined
owner
Uint8Array<ArrayBufferLike> or undefined
List results, parameterized by type of returned item.
Property
Type
Description
items
[string, T][]
items_length
bigint
items_page
bigint or undefined
matches_length
bigint
matches_pages
bigint or undefined
Represents a controller with access scope and associated metadata.
Property
Type
Description
metadata
[string, string][]
A list of key-value metadata pairs associated with the controller.
created_at
bigint
The timestamp when the controller was created.
updated_at
bigint
The timestamp when the controller was last updated.
expires_at
bigint or undefined
Optional expiration timestamp for the controller. π It's a placeholder for future implementation.
scope
"write" or "admin"
The scope assigned to the controller.
βοΈ ControllerCheckParams
Represents the parameters required to perform controller checks.
Property
Type
Description
caller
Uint8Array<ArrayBufferLike> or Principal
The identity of the caller to verify against the controller list.
controllers
[Uint8Array<ArrayBufferLike>, { created_at: bigint; updated_at: bigint; metadata: [string, string][]; scope: "write" or "admin"; expires_at?: bigint or undefined; }][]
The list of controllers to check against.
The parameters required to scope an operation to a collection.
Property
Type
Description
collection
string
The name of the collection to target.
βοΈ SetAssetHandlerParams
The parameters required to set (or update) an asset.
Property
Type
Description
key
AssetKey
The key identifying the asset.
content
Blob
The binary content of the asset.
headers
HeaderFields
Associated HTTP headers.
βοΈ GetContentChunksStoreParams
The parameters required to retrieve a specific chunk from an asset.
Property
Type
Description
encoding
AssetEncoding
The encoding of the chunks.
chunk_index
bigint
The index of the chunk to retrieve.
memory
"heap" or "stable"
The memory type to retrieve the chunk from.
Type representing the parameters required to make a canister call.
Property
Type
Description
canisterId
Uint8Array<ArrayBufferLike> or Principal
The target canister's ID.
method
string
The name of the method to call. Minimum one character.
args
[Type<unknown>, unknown][] or undefined
The arguments, including types and values, for the canister call.
result
Type<unknown> or undefined
The expected result type used for decoding the response.
Represents a raw principal - a Uint8Array representation of a Principal.
Type
Type
RawPrincipal
z.infer<typeof RawPrincipalSchema>
π Source
Represents a principal - i.e. an object instantiated with the class Principal.
Type
Type
Principal
z.infer<typeof PrincipalSchema>
π Source
Represents a timestamp in nanoseconds since the Unix epoch.
Used for tracking when events occur, such as document creation and updates.
Type
Type
Timestamp
z.infer<typeof TimestampSchema>
π Source
Represents a version number for tracking changes.
This is typically incremented with each update to ensure consistency.
Type
Type
Version
z.infer<typeof VersionSchema>
π Source
Represents a raw user identifier.
This is a principal associated with a user.
Type
Type
RawUserId
z.infer<typeof RawUserIdSchema>
π Source
Represents a user identifier.
This is a principal associated with a user.
Type
Type
UserId
z.infer<typeof UserIdSchema>
π Source
A collection name where data are stored.
Type
Type
Collection
z.infer<typeof CollectionSchema>
π Source
A key identifier within a collection.
Type
Type
Key
z.infer<typeof KeySchema>
π Source
Represents a description with a maximum length of 1024 characters.
Used for document and asset fields which can be useful for search purpose.
Type
Type
Description
z.infer<typeof DescriptionSchema>
π Source
Defines the assert
function schema for assertions.
The function takes a context argument and returns void
.
Type
Type
AssertFunction
(context: T) => void
π Source
Defines the run
function schema for hooks.
The function takes a context argument and returns either a Promise<void>
or void
.
Type
Type
RunFunction
(context: T) => void or Promise<void>
π Source
Represents raw binary data.
This is used to store structured data in a document.
Type
Type
RawData
z.infer<typeof Uint8ArraySchema>
π Source
A shorthand for a document that might or not be defined.
Type
Type
OptionDoc
Doc or undefined
π Source
The context provided to the onSetDoc
hook.
This context contains information about the document being created or updated,
along with details about the user who triggered the operation.
Type
Type
OnSetDocContext
HookContext<DocContext<DocUpsert>>
π Source
βοΈ OnSetManyDocsContext
The context provided to the onSetManyDocs
hook.
This context contains information about multiple documents being created or updated
in a single operation, along with details about the user who triggered it.
Type
Type
OnSetManyDocsContext
HookContext<DocContext<DocUpsert>[]>
π Source
βοΈ OnDeleteDocContext
The context provided to the onDeleteDoc
hook.
This context contains information about a single document being deleted,
along with details about the user who triggered the operation.
Type
Type
OnDeleteDocContext
HookContext<DocContext<OptionDoc>>
π Source
βοΈ OnDeleteManyDocsContext
The context provided to the onDeleteManyDocs
hook.
This context contains information about multiple documents being deleted,
along with details about the user who triggered the operation.
Type
Type
OnDeleteManyDocsContext
HookContext<DocContext<OptionDoc>[]>
π Source
βοΈ OnDeleteFilteredDocsContext
The context provided to the onDeleteFilteredDocs
hook.
This context contains information about documents deleted as a result of a filter,
along with details about the user who triggered the operation.
Type
Type
OnDeleteFilteredDocsContext
HookContext<DocContext<OptionDoc>[]>
π Source
βοΈ AssertSetDocContext
The context provided to the assertDeleteDoc
hook.
This context contains information about the document being validated before
it is created or updated. If validation fails, the developer should throw an error.
Type
Type
AssertSetDocContext
HookContext<DocContext<DocAssertSet>>
π Source
βοΈ AssertDeleteDocContext
The context provided to the assertDeleteDoc
hook.
This context contains information about the document being validated before
it is deleted. If validation fails, the developer should throw an error.
Type
Type
AssertDeleteDocContext
HookContext<DocContext<DocAssertDelete>>
π Source
Placeholder for future environment-specific configurations.
Currently unused, but it may support features such as:
Defining the execution mode (e.g., staging or production).
Providing environment-specific values like ckBtcLedgerId
for test or production.
Type
Type
SatelliteEnv
z.infer<typeof SatelliteEnvSchema>
π Source
βοΈ HeaderField
Represents a single HTTP header as a tuple of name and value.
Type
Type
HeaderField
[string, string]
π Source
βοΈ HeaderFields
Represents a list of HTTP headers.
Type
Type
HeaderFields
HeaderField[]
π Source
Binary content used in asset encoding.
Type
Type
Blob
Uint8Array
π Source
When stable memory is used, chunks are saved within a StableBTreeMap and their keys - StableEncodingChunkKey - are saved for reference as serialized values
Type
Type
BlobOrKey
Uint8Array
π Source
Represents a SHA-256 hash as a 32-byte binary value.
Type
Type
Hash
Uint8Array
π Source
βοΈ AssetEncodingNoContent
Represents a specific encoding of an asset, such as "gzip" or "identity" (no compression), without the chunks.
Type
Type
AssetEncodingNoContent
Omit<AssetEncoding, 'content_chunks'>
π Source
A string identifier representing a specific encoding format (e.g., "gzip", "identity").
Type
Type
EncodingType
'identity' or 'gzip' or 'compress' or 'deflate' or 'br'
π Source
A stored asset including its metadata, encodings without chunks, and timestamps.
Type
Type
AssetNoContent
Omit<Asset, 'encodings'> and { encodings: [EncodingType, AssetEncodingNoContent][]; }
π Source
A unique reference identifier for batches.
π Source
A unique identifier representing a single chunk of data.
π Source
A unique identifier representing a batch of upload.
π Source
Represents the relative path of an asset in storage.
For assets that are not part of the frontend app, the collection must be included at the root of the path.
Example: /images/a-sun-above-the-mountains.png
π Source
A shorthand for an asset that might or not be defined.
Type
Type
OptionAsset
Asset or undefined
π Source
βοΈ OnUploadAssetContext
Context for the onUploadAsset
hook.
This context contains information about the asset that was uploaded.
Type
Type
OnUploadAssetContext
HookContext<Asset>
π Source
βοΈ OnDeleteAssetContext
Context for the onDeleteAsset
hook.
This context contains information about a single asset being deleted, along with details about the user who triggered the operation.
If undefined, the asset did not exist.
Type
Type
OnDeleteAssetContext
HookContext<Asset or undefined>
π Source
βοΈ OnDeleteManyAssetsContext
Context for the onDeleteManyAssets
hook.
This context contains information about multiple assets being potentially deleted, along with details about the user who triggered the operation.
Type
Type
OnDeleteManyAssetsContext
HookContext<Array<Asset or undefined>>
π Source
βοΈ OnDeleteFilteredAssetsContext
Context for the onDeleteFilteredAssets
hook.
This context contains information about documents deleted as a result of a filter, along with details about the user who triggered the operation.
Type
Type
OnDeleteFilteredAssetsContext
HookContext<Array<Asset or undefined>>
π Source
βοΈ AssertUploadAssetContext
Context for the assertUploadAsset
hook.
This context contains information about the asset being validated before it is uploaded. If validation fails, the developer should throw an error.
Type
Type
AssertUploadAssetContext
HookContext<AssetAssertUpload>
π Source
βοΈ AssertDeleteAssetContext
Context for the assertDeleteAsset
hook.
This context contains information about the asset being validated before it is deleted. If validation fails, the developer should throw an error.
Type
Type
AssertDeleteAssetContext
HookContext<Asset>
π Source
A generic schema for defining assertions related to collections.
Type
Type
OnAssert
Collections and { assert: AssertFunction<T>; }
π Source
An assertion that runs when a document is created or updated.
Type
Type
AssertSetDoc
OnAssert<AssertSetDocContext>
π Source
An assertion that runs when a document is deleted.
Type
Type
AssertDeleteDoc
OnAssert<AssertDeleteDocContext>
π Source
An assertion that runs before an asset is uploaded.
Type
Type
AssertUploadAsset
OnAssert<AssertUploadAssetContext>
π Source
An assertion that runs before an asset is deleted.
Type
Type
AssertDeleteAsset
OnAssert<AssertDeleteAssetContext>
π Source
All assertions definitions.
Type
Type
Assert
AssertSetDoc or AssertDeleteDoc or AssertUploadAsset or AssertDeleteAsset
π Source
Type
Type
AssertFn
(assert: z.infer<typeof SatelliteEnvSchema>) => T
π Source
Type
Type
AssertFnOrObject
T or AssertFn<T>
π Source
A generic schema for defining hooks related to collections.
Type
Type
OnHook
Collections and { /** * A function that runs when the hook is triggered for the specified collections. * * @param {T} context - Contains information about the affected document(s). * @returns {Promise<void>} Resolves when the operation completes. */ run: RunFunction<T>; }
π Source
A hook that runs when a document is created or updated.
Type
Type
OnSetDoc
OnHook<OnSetDocContext>
π Source
A hook that runs when multiple documents are created or updated.
Type
Type
OnSetManyDocs
OnHook<OnSetManyDocsContext>
π Source
A hook that runs when a single document is deleted.
Type
Type
OnDeleteDoc
OnHook<OnDeleteDocContext>
π Source
A hook that runs when multiple documents are deleted.
Type
Type
OnDeleteManyDocs
OnHook<OnDeleteManyDocsContext>
π Source
βοΈ OnDeleteFilteredDocs
A hook that runs when a filtered set of documents is deleted based on query conditions.
Type
Type
OnDeleteFilteredDocs
OnHook<OnDeleteFilteredDocsContext>
π Source
A hook that runs when a single asset is uploaded.
Type
Type
OnUploadAsset
OnHook<OnUploadAssetContext>
π Source
A hook that runs when a single asset is potentially deleted.
Type
Type
OnDeleteAsset
OnHook<OnDeleteAssetContext>
π Source
βοΈ OnDeleteManyAssets
A hook that runs when multiple assets are potentially deleted.
Type
Type
OnDeleteManyAssets
OnHook<OnDeleteManyAssetsContext>
π Source
βοΈ OnDeleteFilteredAssets
A hook that runs when a filtered set of assets is deleted based on query conditions.
Type
Type
OnDeleteFilteredAssets
OnHook<OnDeleteFilteredAssetsContext>
π Source
All hooks definitions.
| Type | Type |
| ------ | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Hook
| | OnSetDoc or OnSetManyDocs or OnDeleteDoc or OnDeleteManyDocs or OnDeleteFilteredDocs or OnUploadAsset or OnDeleteAsset or OnDeleteManyAssets or OnDeleteFilteredAssets
|
π Source
Type
Type
HookFn
(hook: z.infer<typeof SatelliteEnvSchema>) => T
π Source
Type
Type
HookFnOrObject
T or HookFn<T>
π Source
TimestampMatcher matches a timestamp field using a specific strategy.
| Type | Type |
| ------------------ | ---- | --------------------------------------------------------------------------------------------------------------- |
| TimestampMatcher
| | {equal: Timestamp} or {greater_than: Timestamp} or {less_than: Timestamp} or {between: [Timestamp, Timestamp]}
|
π Source
Enum representing possible fields to order by.
Type
Type
ListOrderField
'keys' or 'updated_at' or 'created_at'
π Source
Represents the permission scope of a controller.
Type
Type
ControllerScope
z.infer<typeof ControllerScopeSchema>
π Source
Represents a single metadata entry as a key-value tuple.
Type
Type
Metadata
z.infer<typeof MetadataSchema>
π Source
Represents a tuple containing the principal ID and associated controller data.
Type
Type
ControllerRecord
z.infer<typeof ControllerRecordSchema>
π Source
Represents a list of controllers.
Type
Type
Controllers
z.infer<typeof ControllersSchema>
π Source
The parameters required to list documents from the datastore respectively assets from the storage.
Type
Type
ListStoreParams
CollectionParams and { /** * The identity of the caller requesting the list operation. */ caller: RawUserId or UserId; /** * Optional filtering, ordering, and pagination parameters. */ params: ListParams; }
π Source
Represents the base parameters required to access the datastore and modify a document.
Type
Type
GetDocStoreParams
CollectionParams and { /** * The caller who initiate the document operation. */ caller: RawUserId or UserId; /** * The key identifying the document within the collection. */ key: Key; }
π Source
Represents the parameters required to store or update a document.
This includes the document data along with metadata such as the caller,
collection, and key.
Type
Type
SetDocStoreParams
GetDocStoreParams and { /** * The data, optional description and version required to create or update a document. */ doc: SetDoc; }
π Source
βοΈ DeleteDocStoreParams
Represents the parameters required to delete a document.
This includes the document version along with metadata such as the caller,
collection, and key.
Type
Type
DeleteDocStoreParams
GetDocStoreParams and { /** * The version required to delete a document. */ doc: DelDoc; }
π Source
βοΈ CountCollectionDocsStoreParams
The parameters required to count documents from the datastore.
Type
Type
CountCollectionDocsStoreParams
CollectionParams
π Source
βοΈ CountDocsStoreParams
The parameters required to count documents from the datastore.
Type
Type
CountDocsStoreParams
ListStoreParams
π Source
βοΈ ListDocsStoreParams
The parameters required to list documents from the datastore.
Type
Type
ListDocsStoreParams
ListStoreParams
π Source
βοΈ DeleteDocsStoreParams
The parameters required to delete the documents from a collection of the datastore.
Type
Type
DeleteDocsStoreParams
CollectionParams
π Source
βοΈ DeleteFilteredDocsStoreParams
The parameters required to delete documents from the datastore.
Type
Type
DeleteFilteredDocsStoreParams
ListStoreParams
π Source
Memory type used to select storage or datastore location.
Type
Type
Memory
z.infer<typeof MemorySchema>
π Source
βοΈ GetAssetStoreParams
Represents the base parameters required to access the storage and modify an asset.
Type
Type
GetAssetStoreParams
CollectionParams and { /** * The caller who initiate the document operation. */ caller: RawUserId or UserId; /** * The full_path identifying the asset within the collection. */ full_path: FullPath; }
π Source
βοΈ CountCollectionAssetsStoreParams
The parameters required to count documents from the storage.
Type
Type
CountCollectionAssetsStoreParams
CollectionParams
π Source
βοΈ CountAssetsStoreParams
The parameters required to count documents from the storage.
Type
Type
CountAssetsStoreParams
ListStoreParams
π Source
βοΈ DeleteAssetsStoreParams
The parameters required to delete the assets from a collection of the storage.
Type
Type
DeleteAssetsStoreParams
CollectionParams
π Source
βοΈ DeleteFilteredAssetsStoreParams
The parameters required to delete assets from the storage.
Type
Type
DeleteFilteredAssetsStoreParams
ListStoreParams
π Source
βοΈ DeleteAssetStoreParams
Represents the parameters required to delete an asset.
Type
Type
DeleteAssetStoreParams
GetAssetStoreParams
π Source
βοΈ ListAssetsStoreParams
The parameters required to list documents from the datastore.
Type
Type
ListAssetsStoreParams
ListStoreParams
π Source
Custom validation function to verify if a value is an instance of IDL.Type
from @dfinity/candid
.
Type
Type
IDLType
z.infer<typeof IDLTypeSchema>
π Source
A call argument consisting of its IDL type and corresponding value.
Type
Type
CallArg
z.infer<typeof CallArgSchema>
π Source
Represents the arguments for a canister call on the IC.
Requests and responses on the IC are encoded using Candid.
This schema ensures that each argument is provided with both its type and value
for proper encoding.
The order of arguments is preserved for the function call.
Type
Type
CallArgs
z.infer<typeof CallArgsSchema>
π Source
Defines the type used to decode the result of a canister call.
Type
Type
CallResult
z.infer<typeof CallResultSchema>
π Source
MIT Β© David Dal Busco