Skip to content

Latest commit

 

History

History
2800 lines (1824 loc) · 170 KB

README.md

File metadata and controls

2800 lines (1824 loc) · 170 KB

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