@junobuild/functions
v0.5.2
Published
JavaScript and TypeScript utilities for Juno Serverless Functions
Downloads
3,294
Maintainers
Readme
Juno Functions
JavaScript and TypeScript utilities for [Juno] Serverless Functions.
:toolbox: Functions
- createFunctionSchema
- HookContextSchema
- AssertFunctionSchema
- RunFunctionSchema
- DocContextSchema
- AssertFnSchema
- AssertFnOrObjectSchema
- defineAssert
- defineAssert
- defineAssert
- defineAssert
- HookFnSchema
- HookFnOrObjectSchema
- defineHook
- defineHook
- defineHook
- defineHook
- createListResultsSchema
- normalizeCaller
- getAdminControllers
- getControllers
- isAdminController
- isController
- setDocStore
- deleteDocStore
- getDocStore
- listDocsStore
- countCollectionDocsStore
- countDocsStore
- deleteDocsStore
- deleteFilteredDocsStore
- decodeDocData
- encodeDocData
- countCollectionAssetsStore
- countAssetsStore
- setAssetHandler
- deleteAssetStore
- deleteAssetsStore
- deleteFilteredAssetsStore
- setAssetTokenStore
- getAssetStore
- listAssetsStore
- getContentChunksStore
- call
- id
- time
:gear: createFunctionSchema
Wraps a Zod function schema so that parsing returns the original function instead of Zod's wrapped validator.
Why?
In Zod v4, z.function({...}) normally returns a wrapper that validates
both arguments and the return value every time the function is called.
If your function's return type is void | Promise<void>, Zod tries to
validate it synchronously, which can throw
"Encountered Promise during synchronous parse"
when the implementation is async.
By using .implement, we tell Zod: “this is the function that satisfies
the schema.” That way the schema still validates the function shape at
parse time, but the returned value is the original function you passed
in — no runtime wrapper, no sync/async mismatch.
Reference: https://github.com/colinhacks/zod/issues/4143#issuecomment-2845134912*
| Function | Type |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------- |
| createFunctionSchema | <T extends z.ZodFunction>(schema: T) => ZodCustom<Parameters<T["implement"]>[0], Parameters<T["implement"]>[0]> |
:gear: HookContextSchema
| Function | Type |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HookContextSchema | <T extends z.ZodTypeAny>(dataSchema: T) => ZodObject<{ caller: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: T; }, $strict> |
References:
- HookContext
:gear: AssertFunctionSchema
| Function | Type |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssertFunctionSchema | <T extends z.ZodTypeAny>(contextSchema: T) => ZodCustom<$InferInnerFunctionType<ZodTuple<[T], null>, ZodVoid>, $InferInnerFunctionType<ZodTuple<[T], null>, ZodVoid>> |
References:
- AssertFunction
:gear: RunFunctionSchema
| Function | Type |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RunFunctionSchema | <T extends z.ZodTypeAny>(contextSchema: T) => ZodCustom<$InferInnerFunctionType<ZodTuple<[T], null>, ZodUnion<[ZodPromise<ZodVoid>, ZodVoid]>>, $InferInnerFunctionType<...>> |
References:
- RunFunction
:gear: DocContextSchema
| Function | Type |
| ------------------ | -------------------------------------------------------------------------------------------------------------------- |
| DocContextSchema | <T extends z.ZodTypeAny>(dataSchema: T) => ZodObject<{ collection: ZodString; key: ZodString; data: T; }, $strict> |
References:
- DocContext
:gear: AssertFnSchema
| Function | Type |
| ---------------- | ---------------------------------------------------------------------------------------------------------------- |
| AssertFnSchema | <T extends z.ZodTypeAny>(assertSchema: T) => ZodFunction<ZodTuple<[ZodRecord<ZodString, ZodString>], null>, T> |
:gear: AssertFnOrObjectSchema
| Function | Type |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssertFnOrObjectSchema | <T extends z.ZodTypeAny>(assertSchema: T) => ZodUnion<readonly [T, ZodCustom<$InferInnerFunctionType<ZodTuple<[ZodRecord<ZodString, ZodString>], null>, T>, $InferInnerFunctionType<...>>]> |
:gear: 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>; } |
:gear: 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>; } |
:gear: 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>; } |
:gear: 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>; } |
:gear: HookFnSchema
| Function | Type |
| -------------- | -------------------------------------------------------------------------------------------------------------- |
| HookFnSchema | <T extends z.ZodTypeAny>(hookSchema: T) => ZodFunction<ZodTuple<[ZodRecord<ZodString, ZodString>], null>, T> |
:gear: HookFnOrObjectSchema
| Function | Type |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HookFnOrObjectSchema | <T extends z.ZodTypeAny>(hookSchema: T) => ZodUnion<readonly [T, ZodCustom<$InferInnerFunctionType<ZodTuple<[ZodRecord<ZodString, ZodString>], null>, T>, $InferInnerFunctionType<...>>]> |
:gear: 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>; } |
:gear: 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>; } |
:gear: 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>; } |
:gear: 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>; } |
:gear: createListResultsSchema
Represents a list result.
| Function | Type |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| createListResultsSchema | <T extends z.ZodTypeAny>(itemData: T) => ZodObject<{ items: ZodArray<ZodTuple<[ZodString, T], null>>; items_length: ZodBigInt; items_page: ZodOptional<ZodBigInt>; matches_length: ZodBigInt; matches_pages: ZodOptional<...>; }, $strict> |
References:
- JsListResults
:gear: normalizeCaller
Normalizes a user ID into a raw Uint8Array representation.
| Function | Type |
| ----------------- | ---------------------------------------------- |
| normalizeCaller | (caller: any) => Uint8Array<ArrayBufferLike> |
Parameters:
caller: - The caller identity, either a rawUint8Arrayor aPrincipalinstance.
Returns:
The raw user ID as a Uint8Array.
:gear: getAdminControllers
Gets the list of admin controllers from the Satellite.
| Function | Type |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| getAdminControllers | () => [Uint8Array<ArrayBufferLike>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; }][] |
Returns:
The list of admin controllers.
:gear: getControllers
Gets the list of controllers from the Satellite.
| Function | Type |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| getControllers | () => [Uint8Array<ArrayBufferLike>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; }][] |
Returns:
The list of all controllers.
:gear: 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.
Returns:
Whether the caller is an admin.
:gear: 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.
Returns:
Whether the caller is a controller.
:gear: 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.
Returns:
The context of the stored or updated document, including its key, collection, and both the previous and current versions of the document.
:gear: 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.
Returns:
The context of the deleted document, including its key, collection, and optionally the previous document data if it existed.
:gear: getDocStore
Retrieve a document from the datastore.
| Function | Type |
| ------------- | ------------------------------------------ |
| getDocStore | (params: GetDocStoreParams) => OptionDoc |
Parameters:
params: - The parameters required to get the document.
Returns:
The document if found, or undefined if not.
:gear: 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.
Returns:
A list result containing matching documents and pagination metadata.
:gear: 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.
Returns:
The total number of documents in the specified collection.
:gear: 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.
Returns:
The number of documents that match the provided filters.
:gear: 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.
:gear: 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.
Returns:
The context resulting of the deletion of documents that match the provided filters.
:gear: 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.
Returns:
The parsed JavaScript object.
:gear: 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.
Returns:
The serialized raw data.
:gear: 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.
Returns:
The total number of assets in the specified collection.
:gear: 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.
Returns:
The number of assets that match the provided filters.
:gear: 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.
:gear: deleteAssetStore
Deletes an asset from the storage.
| Function | Type |
| ------------------ | ---------------------------------------------- |
| deleteAssetStore | (params: GetAssetStoreParams) => OptionAsset |
Parameters:
params: - The parameters required to delete the asset.
Returns:
The potentially deleted asset.
:gear: 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.
:gear: 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.
Returns:
The potential asset resulting of the deletion that match the provided filters.
:gear: setAssetTokenStore
Set or update an access token for an asset in a collection's store.
| Function | Type |
| -------------------- | -------------------------------------------- |
| setAssetTokenStore | (params: SetAssetTokenStoreParams) => void |
Parameters:
params: - The parameters required to set the token of the asset.
:gear: getAssetStore
Retrieve an asset from the storage.
| Function | Type |
| --------------- | ---------------------------------------------- |
| getAssetStore | (params: GetAssetStoreParams) => OptionAsset |
Parameters:
params: - The parameters required to get the asset.
Returns:
The asset if found, or undefined if not.
:gear: 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.
Returns:
A list result containing matching assets and pagination metadata.
:gear: 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.
Returns:
The content chunk if found, or undefined if not.
:gear: 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
Returns:
A promise resolving to the decoded result of the call.
Returns undefined if the canister response is empty.
:gear: 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 |
Returns:
The Principal ID of the Satellite.
:gear: 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 |
Returns:
The current timestamp.
:wrench: Constants
- Uint8ArraySchema
- RawPrincipalSchema
- PrincipalSchema
- TimestampSchema
- VersionSchema
- RawUserIdSchema
- UserIdSchema
- CollectionSchema
- KeySchema
- DescriptionSchema
- CollectionsSchema
- RawDataSchema
- DocSchema
- OptionDocSchema
- SetDocSchema
- DelDocSchema
- DocUpsertSchema
- DocAssertSetSchema
- DocAssertDeleteSchema
- OnSetDocContextSchema
- OnSetManyDocsContextSchema
- OnDeleteDocContextSchema
- OnDeleteManyDocsContextSchema
- OnDeleteFilteredDocsContextSchema
- AssertSetDocContextSchema
- AssertDeleteDocContextSchema
- SatelliteEnvSchema
- HeaderFieldsSchema
- BlobSchema
- AssetKeySchema
- AssetEncodingSchema
- AssetSchema
- AssetNoContentSchema
- BatchSchema
- CommitBatchSchema
- FullPathSchema
- AssetAccessTokenSchema
- OptionAssetSchema
- AssetAssertUploadSchema
- OnUploadAssetContextSchema
- OnDeleteAssetContextSchema
- OnDeleteManyAssetsContextSchema
- OnDeleteFilteredAssetsContextSchema
- AssertUploadAssetContextSchema
- AssertDeleteAssetContextSchema
- AssertSetDocSchema
- AssertDeleteDocSchema
- AssertUploadAssetSchema
- AssertDeleteAssetSchema
- AssertSchema
- OnSetDocSchema
- OnSetManyDocsSchema
- OnDeleteDocSchema
- OnDeleteManyDocsSchema
- OnDeleteFilteredDocsSchema
- OnUploadAssetSchema
- OnDeleteAssetSchema
- OnDeleteManyAssetsSchema
- OnDeleteFilteredAssetsSchema
- HookSchema
- TimestampMatcherSchema
- ListMatcherSchema
- ListPaginateSchema
- ListOrderFieldSchema
- ListOrderSchema
- ListParamsSchema
- ControllerScopeSchema
- MetadataSchema
- ControllerSchema
- ControllerRecordSchema
- ControllersSchema
- ControllerCheckParamsSchema
- CollectionParamsSchema
- ListStoreParamsSchema
- GetDocStoreParamsSchema
- SetDocStoreParamsSchema
- DeleteDocStoreParamsSchema
- CountCollectionDocsStoreParamsSchema
- CountDocsStoreParamsSchema
- ListDocsStoreParamsSchema
- DeleteDocsStoreParamsSchema
- DeleteFilteredDocsStoreParamsSchema
- MemorySchema
- GetAssetStoreParamsSchema
- CountCollectionAssetsStoreParamsSchema
- CountAssetsStoreParamsSchema
- SetAssetHandlerParamsSchema
- DeleteAssetsStoreParamsSchema
- DeleteFilteredAssetsStoreParamsSchema
- DeleteAssetStoreParamsSchema
- SetAssetTokenStoreParamsSchema
- ListAssetsStoreParamsSchema
- GetContentChunksStoreParamsSchema
- IDLTypeSchema
- CallArgSchema
- CallArgsSchema
- CallResultSchema
- CallParamsSchema
:gear: Uint8ArraySchema
A schema that validates a value is an Uint8Array.
| Constant | Type |
| ------------------ | --------------------------------------------------------------------- |
| Uint8ArraySchema | ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>> |
:gear: RawPrincipalSchema
| Constant | Type |
| -------------------- | --------------------------------------------------------------------- |
| RawPrincipalSchema | ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>> |
References:
- RawPrincipal
:gear: PrincipalSchema
| Constant | Type |
| ----------------- | --------------------------------------------- |
| PrincipalSchema | ZodCustom<CandidPrincipal, CandidPrincipal> |
References:
- Principal
:gear: TimestampSchema
| Constant | Type |
| ----------------- | ----------- |
| TimestampSchema | ZodBigInt |
References:
- Timestamp
:gear: VersionSchema
| Constant | Type |
| --------------- | ----------- |
| VersionSchema | ZodBigInt |
References:
- Version
:gear: RawUserIdSchema
| Constant | Type |
| ----------------- | --------------------------------------------------------------------- |
| RawUserIdSchema | ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>> |
References:
- RawUserId
:gear: UserIdSchema
| Constant | Type |
| -------------- | --------------------------------------------- |
| UserIdSchema | ZodCustom<CandidPrincipal, CandidPrincipal> |
References:
- UserId
:gear: CollectionSchema
| Constant | Type |
| ------------------ | ----------- |
| CollectionSchema | ZodString |
References:
- Collection
:gear: KeySchema
| Constant | Type |
| ----------- | ----------- |
| KeySchema | ZodString |
References:
- Key
:gear: DescriptionSchema
| Constant | Type |
| ------------------- | ----------- |
| DescriptionSchema | ZodString |
References:
- Description
:gear: CollectionsSchema
| Constant | Type |
| ------------------- | ------------------------------------------------------------------------ |
| CollectionsSchema | ZodObject<{ collections: ZodReadonly<ZodArray<ZodString>>; }, $strict> |
References:
- Collections
:gear: RawDataSchema
| Constant | Type |
| --------------- | --------------------------------------------------------------------- |
| RawDataSchema | ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>> |
References:
- RawData
:gear: DocSchema
| Constant | Type |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DocSchema | ZodObject<{ owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<...>>; description: ZodOptional<...>; created_at: ZodBigInt; updated_at: ZodBigInt; version: ZodOptional<...>; }, $strict> |
References:
- Doc
:gear: OptionDocSchema
| Constant | Type |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OptionDocSchema | ZodOptional<ZodObject<{ owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<...>>; description: ZodOptional<...>; created_at: ZodBigInt; updated_at: ZodBigInt; version: ZodOptional<...>; }, $strict>> |
References:
- OptionDoc
:gear: SetDocSchema
| Constant | Type |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SetDocSchema | ZodObject<{ data: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; description: ZodOptional<ZodString>; version: ZodOptional<...>; }, $strict> |
References:
- SetDoc
:gear: DelDocSchema
| Constant | Type |
| -------------- | ---------------------------------------------------------- |
| DelDocSchema | ZodObject<{ version: ZodOptional<ZodBigInt>; }, $strict> |
References:
- DelDoc
:gear: DocUpsertSchema
| Constant | Type |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DocUpsertSchema | ZodObject<{ before: ZodOptional<ZodObject<{ owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodCustom<Uint8Array<...>, Uint8Array<...>>; description: ZodOptional<...>; created_at: ZodBigInt; updated_at: ZodBigInt; version: ZodOptional<...>; }, $strict>>; after: ZodObject<...>; }, $s... |
References:
- DocUpsert
:gear: DocAssertSetSchema
| Constant | Type |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| DocAssertSetSchema | ZodObject<{ current: ZodOptional<ZodObject<{ owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodCustom<...>; description: ZodOptional<...>; created_at: ZodBigInt; updated_at: ZodBigInt; version: ZodOptional<...>; }, $strict>>; proposed: ZodObject<...>; }, $strict> |
References:
- DocAssertSet
:gear: DocAssertDeleteSchema
| Constant | Type |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| DocAssertDeleteSchema | ZodObject<{ current: ZodOptional<ZodObject<{ owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodCustom<...>; description: ZodOptional<...>; created_at: ZodBigInt; updated_at: ZodBigInt; version: ZodOptional<...>; }, $strict>>; proposed: ZodObject<...>; }, $strict> |
References:
- DocAssertDelete
:gear: OnSetDocContextSchema
| Constant | Type |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OnSetDocContextSchema | ZodObject<{ caller: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodObject<{ collection: ZodString; key: ZodString; data: ZodObject<...>; }, $strict>; }, $strict> |
References:
- OnSetDocContext
:gear: OnSetManyDocsContextSchema
| Constant | Type |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| OnSetManyDocsContextSchema | ZodObject<{ caller: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodArray<ZodObject<{ collection: ZodString; key: ZodString; data: ZodObject<...>; }, $strict>>; }, $strict> |
References:
- OnSetManyDocsContext
:gear: OnDeleteDocContextSchema
| Constant | Type |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OnDeleteDocContextSchema | ZodObject<{ caller: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodObject<{ collection: ZodString; key: ZodString; data: ZodOptional<...>; }, $strict>; }, $strict> |
References:
- OnDeleteDocContext
:gear: OnDeleteManyDocsContextSchema
| Constant | Type |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OnDeleteManyDocsContextSchema | ZodObject<{ caller: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodArray<ZodObject<{ collection: ZodString; key: ZodString; data: ZodOptional<...>; }, $strict>>; }, $strict> |
References:
- OnDeleteManyDocsContext
:gear: OnDeleteFilteredDocsContextSchema
| Constant | Type |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OnDeleteFilteredDocsContextSchema | ZodObject<{ caller: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodArray<ZodObject<{ collection: ZodString; key: ZodString; data: ZodOptional<...>; }, $strict>>; }, $strict> |
References:
- OnDeleteFilteredDocsContext
:gear: AssertSetDocContextSchema
| Constant | Type |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssertSetDocContextSchema | ZodObject<{ caller: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodObject<{ collection: ZodString; key: ZodString; data: ZodObject<...>; }, $strict>; }, $strict> |
References:
- AssertSetDocContext
:gear: AssertDeleteDocContextSchema
| Constant | Type |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssertDeleteDocContextSchema | ZodObject<{ caller: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>; data: ZodObject<{ collection: ZodString; key: ZodString; data: ZodObject<...>; }, $strict>; }, $strict> |
References:
- AssertDeleteDocContext
:gear: SatelliteEnvSchema
| Constant | Type |
| -------------------- | --------------------------------- |
| SatelliteEnvSchema | ZodRecord<ZodString, ZodString> |
References:
- SatelliteEnv
:gear: HeaderFieldsSchema
| Constant | Type |
| -------------------- | -------------------------------------------------- |
| HeaderFieldsSchema | ZodArray<ZodTuple<[ZodString, ZodString], null>> |
References:
- HeaderFields
:gear: BlobSchema
| Constant | Type |
| ------------ | --------------------------------------------------------------------- |
| BlobSchema | ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>> |
References:
- Blob
:gear: AssetKeySchema
| Constant | Type |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssetKeySchema | ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<...>>; description: ZodOptional<...>; }, $strict> |
References:
- AssetKey
:gear: AssetEncodingSchema
| Constant | Type |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssetEncodingSchema | ZodObject<{ modified: ZodBigInt; content_chunks: ZodArray<ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>; total_length: ZodBigInt; sha256: ZodCustom<...>; }, $strip> |
References:
- AssetEncoding
:gear: AssetSchema
| Constant | Type |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssetSchema | ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<...>>; description: ZodOptional<...>; }, $strict>; ... 4 more ...; version: ZodOptional<...>; }, $strict> |
References:
- Asset
:gear: AssetNoContentSchema
| Constant | Type |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssetNoContentSchema | ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<...>>; description: ZodOptional<...>; }, $strict>; ... 4 more ...; encodings: ZodArray<...>; }, $strict> |
References:
- AssetNoContent
:gear: BatchSchema
| Constant | Type |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BatchSchema | ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<...>>; description: ZodOptional<...>; }, $strict>; reference_id: ZodOptional<...>; expires_at: ZodBigInt; encoding_type: ZodOptional<...>;... |
References:
- Batch
:gear: CommitBatchSchema
| Constant | Type |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| CommitBatchSchema | ZodObject<{ batch_id: ZodBigInt; headers: ZodArray<ZodTuple<[ZodString, ZodString], null>>; chunk_ids: ZodArray<ZodBigInt>; }, $strict> |
References:
- CommitBatch
:gear: FullPathSchema
| Constant | Type |
| ---------------- | ----------- |
| FullPathSchema | ZodString |
References:
- FullPath
:gear: AssetAccessTokenSchema
| Constant | Type |
| ------------------------ | ------------------------ |
| AssetAccessTokenSchema | ZodOptional<ZodString> |
References:
- AssetAccessToken
:gear: OptionAssetSchema
| Constant | Type |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OptionAssetSchema | ZodOptional<ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<...>>; description: ZodOptional<...>; }, $strict>; ... 4 more ...; version: ZodOptional<...>; }, $strict>> |
References:
- OptionAsset
:gear: AssetAssertUploadSchema
| Constant | Type |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AssetAssertUploadSchema | ZodObject<{ current: ZodOptional<ZodObject<{ key: ZodObject<{ name: ZodString; full_path: ZodString; token: ZodOptional<ZodString>; collection: ZodString; owner: ZodCustom<...>; description: ZodOptional<...>; }, $strict>; ... 4 more ...; version: ZodOptional<...>; }, $strict>>; batch: ZodObject<...>; commit_batch: Z... |
References:
- AssetAssertUpload
:gear: OnUploadAssetContextSchema
| Constant | Type
