Skip to content

Latest commit

Β 

History

History

functions

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

npm license

Juno Functions

JavaScript and TypeScript utilities for Juno Serverless Functions.

🧰 Functions

βš™οΈ HookContextSchema

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

βš™οΈ RunFunctionSchema

Function Type
RunFunctionSchema <T extends z.ZodTypeAny>(contextSchema: T) => ZodFunction<ZodTuple<[T], ZodUnknown>, ZodUnion<[ZodPromise<ZodVoid>, ZodVoid]>>

πŸ”— Source

βš™οΈ DocContextSchema

Function Type
DocContextSchema <T extends z.ZodTypeAny>(dataSchema: T) => ZodObject<typeof schemaShape, "strict", ZodTypeAny, baseObjectOutputType<typeof schemaShape>, baseObjectInputType<typeof schemaShape>>

πŸ”— Source

βš™οΈ AssertFnSchema

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

βš™οΈ defineAssert

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

βš™οΈ defineAssert

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

βš™οΈ defineAssert

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

βš™οΈ defineAssert

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

βš™οΈ HookFnSchema

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

βš™οΈ defineHook

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

βš™οΈ defineHook

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

βš™οΈ defineHook

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

βš™οΈ defineHook

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

βš™οΈ normalizeCaller

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

βš™οΈ getControllers

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

βš™οΈ isAdminController

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

βš™οΈ isController

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

βš™οΈ setDocStore

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

βš™οΈ deleteDocStore

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

βš™οΈ getDocStore

Retrieve a document from the datastore.

Function Type
getDocStore (params: GetDocStoreParams) => OptionDoc

Parameters:

  • params: - The parameters required to get the document.

πŸ”— Source

βš™οΈ listDocsStore

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

βš™οΈ countDocsStore

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

βš™οΈ deleteDocsStore

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

βš™οΈ decodeDocData

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

βš™οΈ encodeDocData

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

βš™οΈ countAssetsStore

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

βš™οΈ setAssetHandler

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

βš™οΈ deleteAssetStore

Deletes an asset from the storage.

Function Type
deleteAssetStore (params: GetAssetStoreParams) => OptionAsset

Parameters:

  • params: - The parameters required to delete the asset.

πŸ”— Source

βš™οΈ deleteAssetsStore

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

βš™οΈ getAssetStore

Retrieve an asset from the storage.

Function Type
getAssetStore (params: GetAssetStoreParams) => OptionAsset

Parameters:

  • params: - The parameters required to get the asset.

πŸ”— Source

βš™οΈ listAssetsStore

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

βš™οΈ call

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

βš™οΈ id

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

βš™οΈ time

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

πŸ”§ Constants

βš™οΈ Uint8ArraySchema

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

βš™οΈ PrincipalSchema

Constant Type
PrincipalSchema ZodType<Principal, ZodTypeDef, Principal>

πŸ”— Source

βš™οΈ TimestampSchema

Constant Type
TimestampSchema ZodBigInt

πŸ”— Source

βš™οΈ VersionSchema

Constant Type
VersionSchema ZodBigInt

πŸ”— Source

βš™οΈ RawUserIdSchema

Constant Type
RawUserIdSchema ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>

πŸ”— Source

βš™οΈ UserIdSchema

Constant Type
UserIdSchema ZodType<Principal, ZodTypeDef, Principal>

πŸ”— Source

βš™οΈ CollectionSchema

Constant Type
CollectionSchema ZodString

πŸ”— Source

βš™οΈ KeySchema

Constant Type
KeySchema ZodString

πŸ”— Source

βš™οΈ DescriptionSchema

Constant Type
DescriptionSchema ZodString

πŸ”— Source

βš™οΈ CollectionsSchema

Constant Type
CollectionsSchema ZodObject<{ collections: ZodReadonly<ZodArray<ZodString, "many">>; }, "strict", ZodTypeAny, { collections: readonly string[]; }, { collections: readonly string[]; }>

πŸ”— Source

βš™οΈ RawDataSchema

Constant Type
RawDataSchema ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>

πŸ”— Source

βš™οΈ DocSchema

Constant Type
DocSchema ZodObject<{ owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; ... 4 more ...; version: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>

πŸ”— Source

βš™οΈ OptionDocSchema

Constant Type
OptionDocSchema ZodOptional<ZodObject<{ owner: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; ... 4 more ...; version: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>>

πŸ”— Source

βš™οΈ SetDocSchema

Constant Type
SetDocSchema ZodObject<{ data: ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>; description: ZodOptional<...>; version: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>

πŸ”— Source

βš™οΈ DelDocSchema

Constant Type
DelDocSchema ZodObject<{ version: ZodOptional<ZodBigInt>; }, "strict", ZodTypeAny, { version?: bigint or undefined; }, { version?: bigint or undefined; }>

πŸ”— Source

βš™οΈ DocUpsertSchema

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

βš™οΈ BlobSchema

Constant Type
BlobSchema ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>

πŸ”— Source

βš™οΈ AssetKeySchema

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

βš™οΈ AssetSchema

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

βš™οΈ BatchSchema

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

βš™οΈ CommitBatchSchema

Constant Type
CommitBatchSchema ZodObject<{ batch_id: ZodBigInt; headers: ZodArray<ZodTuple<[ZodString, ZodString], null>, "many">; chunk_ids: ZodArray<ZodBigInt, "many">; }, "strict", ZodTypeAny, { ...; }, { ...; }>

πŸ”— Source

βš™οΈ FullPathSchema

Constant Type
FullPathSchema ZodString

πŸ”— Source

βš™οΈ OptionAssetSchema

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

βš™οΈ AssertSchema

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

βš™οΈ OnSetDocSchema

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

βš™οΈ OnDeleteDocSchema

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

βš™οΈ HookSchema

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

βš™οΈ ListMatcherSchema

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

βš™οΈ ListOrderSchema

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

βš™οΈ ListParamsSchema

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

βš™οΈ MetadataSchema

Constant Type
MetadataSchema ZodTuple<[ZodString, ZodString], null>

πŸ”— Source

βš™οΈ ControllerSchema

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

βš™οΈ MemorySchema

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

βš™οΈ IDLTypeSchema

Constant Type
IDLTypeSchema ZodType<Type<unknown>, ZodTypeDef, Type<unknown>>

πŸ”— Source

βš™οΈ CallArgSchema

Constant Type
CallArgSchema ZodTuple<[ZodType<Type<unknown>, ZodTypeDef, Type<unknown>>, ZodUnknown], null>

πŸ”— Source

βš™οΈ CallArgsSchema

Schema for encoding the call arguments.

Constant Type
CallArgsSchema ZodArray<ZodTuple<[ZodType<Type<unknown>, ZodTypeDef, Type<unknown>>, ZodUnknown], null>, "many">

πŸ”— Source

βš™οΈ CallResultSchema

Constant Type
CallResultSchema ZodType<Type<unknown>, ZodTypeDef, Type<unknown>>

πŸ”— Source

βš™οΈ CallParamsSchema

Constant Type
CallParamsSchema ZodObject<{ canisterId: ZodUnion<[ZodType<Uint8Array<ArrayBufferLike>, ZodTypeDef, Uint8Array<ArrayBufferLike>>, ZodType<...>]>; method: ZodString; args: ZodOptional<...>; result: ZodOptional<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>

πŸ”— Source

🏭 CallResponseLengthError

πŸ”— Source

🍹 Interfaces

βš™οΈ Collections

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.

βš™οΈ HookContext

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.

βš™οΈ Doc

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.

βš™οΈ SetDoc

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.

βš™οΈ DelDoc

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.

βš™οΈ DocUpsert

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.

βš™οΈ DocAssertSet

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.

βš™οΈ DocAssertDelete

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.

βš™οΈ DocContext

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.

βš™οΈ AssetKey

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.

βš™οΈ AssetEncoding

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.

βš™οΈ Asset

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.

βš™οΈ Batch

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").

βš™οΈ CommitBatch

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.

βš™οΈ AssetAssertUpload

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.

βš™οΈ ListMatcher

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

βš™οΈ ListPaginate

Optional pagination controls for listing.

Property Type Description
start_after string or undefined
limit bigint or undefined

βš™οΈ ListOrder

Ordering strategy for listing documents.

Property Type Description
desc boolean
field ListOrderField

βš™οΈ ListParams

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

βš™οΈ ListResults

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

βš™οΈ Controller

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.

βš™οΈ CollectionParams

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.

βš™οΈ CallParams

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.

🍸 Types

βš™οΈ RawPrincipal

Represents a raw principal - a Uint8Array representation of a Principal.

Type Type
RawPrincipal z.infer<typeof RawPrincipalSchema>

πŸ”— Source

βš™οΈ Principal

Represents a principal - i.e. an object instantiated with the class Principal.

Type Type
Principal z.infer<typeof PrincipalSchema>

πŸ”— Source

βš™οΈ Timestamp

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

βš™οΈ Version

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

βš™οΈ RawUserId

Represents a raw user identifier.

This is a principal associated with a user.

Type Type
RawUserId z.infer<typeof RawUserIdSchema>

πŸ”— Source

βš™οΈ UserId

Represents a user identifier.

This is a principal associated with a user.

Type Type
UserId z.infer<typeof UserIdSchema>

πŸ”— Source

βš™οΈ Collection

A collection name where data are stored.

Type Type
Collection z.infer<typeof CollectionSchema>

πŸ”— Source

βš™οΈ Key

A key identifier within a collection.

Type Type
Key z.infer<typeof KeySchema>

πŸ”— Source

βš™οΈ Description

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

βš™οΈ AssertFunction

Defines the assert function schema for assertions.

The function takes a context argument and returns void.

Type Type
AssertFunction (context: T) => void

πŸ”— Source

βš™οΈ RunFunction

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

βš™οΈ RawData

Represents raw binary data.

This is used to store structured data in a document.

Type Type
RawData z.infer<typeof Uint8ArraySchema>

πŸ”— Source

βš™οΈ OptionDoc

A shorthand for a document that might or not be defined.

Type Type
OptionDoc Doc or undefined

πŸ”— Source

βš™οΈ OnSetDocContext

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

βš™οΈ SatelliteEnv

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

βš™οΈ Blob

Binary content used in asset encoding.

Type Type
Blob Uint8Array

πŸ”— Source

βš™οΈ BlobOrKey

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

βš™οΈ Hash

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

βš™οΈ EncodingType

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

βš™οΈ AssetNoContent

A stored asset including its metadata, encodings without chunks, and timestamps.

Type Type
AssetNoContent Omit<Asset, 'encodings'> and { encodings: [EncodingType, AssetEncodingNoContent][]; }

πŸ”— Source

βš™οΈ ReferenceId

A unique reference identifier for batches.

Type Type
ReferenceId

πŸ”— Source

βš™οΈ ChunkId

A unique identifier representing a single chunk of data.

Type Type
ChunkId

πŸ”— Source

βš™οΈ BatchId

A unique identifier representing a batch of upload.

Type Type
BatchId

πŸ”— Source

βš™οΈ FullPath

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

Type Type
FullPath

πŸ”— Source

βš™οΈ OptionAsset

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

βš™οΈ OnAssert

A generic schema for defining assertions related to collections.

Type Type
OnAssert Collections and { assert: AssertFunction<T>; }

πŸ”— Source

βš™οΈ AssertSetDoc

An assertion that runs when a document is created or updated.

Type Type
AssertSetDoc OnAssert<AssertSetDocContext>

πŸ”— Source

βš™οΈ AssertDeleteDoc

An assertion that runs when a document is deleted.

Type Type
AssertDeleteDoc OnAssert<AssertDeleteDocContext>

πŸ”— Source

βš™οΈ AssertUploadAsset

An assertion that runs before an asset is uploaded.

Type Type
AssertUploadAsset OnAssert<AssertUploadAssetContext>

πŸ”— Source

βš™οΈ AssertDeleteAsset

An assertion that runs before an asset is deleted.

Type Type
AssertDeleteAsset OnAssert<AssertDeleteAssetContext>

πŸ”— Source

βš™οΈ Assert

All assertions definitions.

Type Type
Assert AssertSetDoc or AssertDeleteDoc or AssertUploadAsset or AssertDeleteAsset

πŸ”— Source

βš™οΈ AssertFn

Type Type
AssertFn (assert: z.infer<typeof SatelliteEnvSchema>) => T

πŸ”— Source

βš™οΈ AssertFnOrObject

Type Type
AssertFnOrObject T or AssertFn<T>

πŸ”— Source

βš™οΈ OnHook

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

βš™οΈ OnSetDoc

A hook that runs when a document is created or updated.

Type Type
OnSetDoc OnHook<OnSetDocContext>

πŸ”— Source

βš™οΈ OnSetManyDocs

A hook that runs when multiple documents are created or updated.

Type Type
OnSetManyDocs OnHook<OnSetManyDocsContext>

πŸ”— Source

βš™οΈ OnDeleteDoc

A hook that runs when a single document is deleted.

Type Type
OnDeleteDoc OnHook<OnDeleteDocContext>

πŸ”— Source

βš™οΈ OnDeleteManyDocs

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

βš™οΈ OnUploadAsset

A hook that runs when a single asset is uploaded.

Type Type
OnUploadAsset OnHook<OnUploadAssetContext>

πŸ”— Source

βš™οΈ OnDeleteAsset

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

βš™οΈ Hook

All hooks definitions.

| Type | Type | | ------ | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Hook | | OnSetDoc or OnSetManyDocs or OnDeleteDoc or OnDeleteManyDocs or OnDeleteFilteredDocs or OnUploadAsset or OnDeleteAsset or OnDeleteManyAssets or OnDeleteFilteredAssets |

πŸ”— Source

βš™οΈ HookFn

Type Type
HookFn (hook: z.infer<typeof SatelliteEnvSchema>) => T

πŸ”— Source

βš™οΈ HookFnOrObject

Type Type
HookFnOrObject T or HookFn<T>

πŸ”— Source

βš™οΈ TimestampMatcher

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

βš™οΈ ListOrderField

Enum representing possible fields to order by.

Type Type
ListOrderField 'keys' or 'updated_at' or 'created_at'

πŸ”— Source

βš™οΈ ControllerScope

Represents the permission scope of a controller.

Type Type
ControllerScope z.infer<typeof ControllerScopeSchema>

πŸ”— Source

βš™οΈ Metadata

Represents a single metadata entry as a key-value tuple.

Type Type
Metadata z.infer<typeof MetadataSchema>

πŸ”— Source

βš™οΈ ControllerRecord

Represents a tuple containing the principal ID and associated controller data.

Type Type
ControllerRecord z.infer<typeof ControllerRecordSchema>

πŸ”— Source

βš™οΈ Controllers

Represents a list of controllers.

Type Type
Controllers z.infer<typeof ControllersSchema>

πŸ”— Source

βš™οΈ ListStoreParams

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

βš™οΈ GetDocStoreParams

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

βš™οΈ SetDocStoreParams

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

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

βš™οΈ IDLType

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

βš™οΈ CallArg

A call argument consisting of its IDL type and corresponding value.

Type Type
CallArg z.infer<typeof CallArgSchema>

πŸ”— Source

βš™οΈ CallArgs

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

βš™οΈ CallResult

Defines the type used to decode the result of a canister call.

Type Type
CallResult z.infer<typeof CallResultSchema>

πŸ”— Source

License

MIT Β© David Dal Busco