@junobuild/functions 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +399 -223
- package/canisters/ckbtc/index.js +1 -1
- package/canisters/cketh/index.js +1 -1
- package/canisters/cmc/index.js +1 -1
- package/canisters/declarations/ckbtc/bitcoin.did.d.ts +1 -1
- package/canisters/declarations/ckbtc/minter.did.d.ts +1 -1
- package/canisters/declarations/cketh/minter.did.d.ts +1 -1
- package/canisters/declarations/cketh/orchestrator.did.d.ts +1 -1
- package/canisters/declarations/cmc/cmc.did.d.ts +1 -1
- package/canisters/declarations/ic-management/ic-management.did.d.ts +1 -1
- package/canisters/declarations/ledger-icp/index.did.d.ts +1 -1
- package/canisters/declarations/ledger-icp/ledger.did.d.ts +1 -1
- package/canisters/declarations/ledger-icrc/icrc_icrc-1.did.d.ts +1 -1
- package/canisters/declarations/ledger-icrc/icrc_icrc-10.did.d.ts +1 -1
- package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +1 -1
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +1 -1
- package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +1 -1
- package/canisters/declarations/nns/genesis_token.did.d.ts +1 -1
- package/canisters/declarations/nns/governance.did.d.ts +1 -1
- package/canisters/declarations/nns/governance_test.did.d.ts +1 -1
- package/canisters/declarations/nns/sns_wasm.did.d.ts +1 -1
- package/canisters/declarations/sns/governance.did.d.ts +1 -1
- package/canisters/declarations/sns/governance_test.did.d.ts +1 -1
- package/canisters/declarations/sns/root.did.d.ts +1 -1
- package/canisters/declarations/sns/swap.did.d.ts +1 -1
- package/canisters/ic-management/index.js +1 -1
- package/canisters/index.js +1 -1
- package/canisters/ledger/icp/index.js +1 -1
- package/canisters/ledger/icrc/index.js +1 -1
- package/canisters/nns/index.js +1 -1
- package/canisters/sns/index.js +1 -1
- package/{chunk-CAQXR2VB.js → chunk-I4MVAQHI.js} +1 -1
- package/{chunk-CAQXR2VB.js.map → chunk-I4MVAQHI.js.map} +1 -1
- package/chunk-JU5CZHLY.js +2 -0
- package/chunk-JU5CZHLY.js.map +7 -0
- package/chunk-VIFVPVUD.js +2 -0
- package/chunk-VIFVPVUD.js.map +7 -0
- package/chunk-X3EF7OU6.js +2 -0
- package/chunk-X3EF7OU6.js.map +7 -0
- package/chunk-YHNBR22R.js +2 -0
- package/chunk-YHNBR22R.js.map +7 -0
- package/chunk-ZBCLFWQJ.js +2 -0
- package/chunk-ZBCLFWQJ.js.map +7 -0
- package/functions/query.d.ts +8 -0
- package/functions/schemas/function.d.ts +27 -0
- package/functions/update.d.ts +8 -0
- package/global.d.ts +15 -6
- package/ic-cdk/http-request.ic-cdk.d.ts +10 -0
- package/ic-cdk/schemas/call.d.ts +1 -1
- package/ic-cdk/schemas/http-request.d.ts +142 -0
- package/ic-cdk.d.ts +2 -0
- package/ic-cdk.js +1 -1
- package/ic-cdk.js.map +4 -4
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +3 -3
- package/package.json +3 -3
- package/schemas/principal.d.ts +8 -0
- package/schemas/satellite.d.ts +1 -1
- package/sdk/access-keys.sdk.d.ts +50 -0
- package/sdk/guards.sdk.d.ts +25 -0
- package/sdk/schemas/{controllers.d.ts → access-keys.d.ts} +39 -38
- package/sdk.d.ts +3 -2
- package/sdk.js +1 -1
- package/sdk.js.map +4 -4
- package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +1 -1
- package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +1 -1
- package/src/canisters/declarations/ckbtc/minter.did.d.ts +1 -1
- package/src/canisters/declarations/ckbtc/minter.did.idl.js +1 -1
- package/src/canisters/declarations/cketh/minter.did.d.ts +1 -1
- package/src/canisters/declarations/cketh/minter.did.idl.js +1 -1
- package/src/canisters/declarations/cketh/orchestrator.did.d.ts +1 -1
- package/src/canisters/declarations/cketh/orchestrator.did.idl.js +1 -1
- package/src/canisters/declarations/cmc/cmc.did.d.ts +1 -1
- package/src/canisters/declarations/cmc/cmc.did.idl.js +1 -1
- package/src/canisters/declarations/ic-management/ic-management.did.d.ts +1 -1
- package/src/canisters/declarations/ic-management/ic-management.did.idl.js +1 -1
- package/src/canisters/declarations/ledger-icp/index.did.d.ts +1 -1
- package/src/canisters/declarations/ledger-icp/index.did.idl.js +1 -1
- package/src/canisters/declarations/ledger-icp/ledger.did.d.ts +1 -1
- package/src/canisters/declarations/ledger-icp/ledger.did.idl.js +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_icrc-1.did.d.ts +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_icrc-1.did.idl.js +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_icrc-10.did.d.ts +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_icrc-10.did.idl.js +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +1 -1
- package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.js +1 -1
- package/src/canisters/declarations/nns/genesis_token.did.d.ts +1 -1
- package/src/canisters/declarations/nns/genesis_token.did.idl.js +1 -1
- package/src/canisters/declarations/nns/governance.did.d.ts +1 -1
- package/src/canisters/declarations/nns/governance.did.idl.js +1 -1
- package/src/canisters/declarations/nns/governance_test.did.d.ts +1 -1
- package/src/canisters/declarations/nns/governance_test.did.idl.js +1 -1
- package/src/canisters/declarations/nns/sns_wasm.did.d.ts +1 -1
- package/src/canisters/declarations/nns/sns_wasm.did.idl.js +1 -1
- package/src/canisters/declarations/sns/governance.did.d.ts +1 -1
- package/src/canisters/declarations/sns/governance.did.idl.js +1 -1
- package/src/canisters/declarations/sns/governance_test.did.d.ts +1 -1
- package/src/canisters/declarations/sns/governance_test.did.idl.js +1 -1
- package/src/canisters/declarations/sns/root.did.d.ts +1 -1
- package/src/canisters/declarations/sns/root.did.idl.js +1 -1
- package/src/canisters/declarations/sns/swap.did.d.ts +1 -1
- package/src/canisters/declarations/sns/swap.did.idl.js +1 -1
- package/src/global.d.ts +15 -6
- package/chunk-3CCXJJ4Y.js +0 -2
- package/chunk-3CCXJJ4Y.js.map +0 -7
- package/chunk-5IWIJYKG.js +0 -2
- package/chunk-5IWIJYKG.js.map +0 -7
- package/chunk-6QTAU2M5.js +0 -2
- package/chunk-6QTAU2M5.js.map +0 -7
- package/chunk-BAYP4XBH.js +0 -2
- package/chunk-BAYP4XBH.js.map +0 -7
- package/chunk-EHQF2DOU.js +0 -2
- package/chunk-EHQF2DOU.js.map +0 -7
- package/schemas/candid.d.ts +0 -21
- package/sdk/controllers.sdk.d.ts +0 -39
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/schemas/principal.ts"],
|
|
4
|
+
"sourcesContent": ["import {j} from '@junobuild/schema';\n\n/**\n * @see RawPrincipal\n */\nexport const RawPrincipalSchema = j.uint8Array();\n\n/**\n * Represents a raw principal - a Uint8Array representation of a Principal.\n */\nexport type RawPrincipal = Uint8Array;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAQ,KAAAA,MAAQ,oBAKT,IAAMC,EAAqBD,EAAE,WAAW",
|
|
6
|
+
"names": ["j", "RawPrincipalSchema"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d}from"./chunk-JU5CZHLY.js";import{j as S}from"@junobuild/schema";import*as a from"zod";var o=a.bigint(),n=a.bigint(),s=d,H=S.principal(),h=a.string(),c=a.string(),r=a.string().max(1024);import{j as f}from"@junobuild/schema";import*as p from"zod";var l=f.uint8Array(),b=p.object({owner:s,data:l,description:r.optional(),created_at:o,updated_at:o,version:n.optional()}).strict(),M=b.optional(),N=p.object({data:l,description:r.optional(),version:n.optional()}).strict(),q=p.object({version:n.optional()}).strict();import{j as u}from"@junobuild/schema";import*as e from"zod";var T=e.tuple([e.string(),e.string()]),y=e.array(T),D=u.uint8Array(),A=D,w=e.instanceof(Uint8Array).refine(i=>i.length===32,{message:"Hash must be a Uint8Array of length 32"}),g=e.object({name:e.string(),full_path:e.string(),token:e.string().optional(),collection:h,owner:s,description:r.optional()}).strict(),x=e.object({modified:o,content_chunks:e.array(A),total_length:e.bigint(),sha256:w}),R=x.omit({content_chunks:!0}).strict(),m=e.enum(["identity","gzip","compress","deflate","br"]),z=e.object({key:g,headers:y,encodings:e.array(e.tuple([m,x])),created_at:o,updated_at:o,version:n.optional()}).strict(),Q=z.omit({encodings:!0}).extend({encodings:e.array(e.tuple([m,R]))}).strict(),j=e.bigint(),W=e.object({key:g,reference_id:j.optional(),expires_at:o,encoding_type:m.optional()}).strict(),I=e.bigint(),k=e.bigint(),X=e.object({batch_id:k,headers:y,chunk_ids:e.array(I)}).strict(),Y=e.string(),$=e.string().optional(),ee=z.optional();import*as t from"zod";var _=t.union([t.object({equal:o}),t.object({greater_than:o}),t.object({less_than:o}),t.object({between:t.tuple([o,o])})]),U=t.object({key:c.optional(),description:r.optional(),created_at:_.optional(),updated_at:_.optional()}).strict(),O=t.object({start_after:c.optional(),limit:t.bigint().optional()}).strict(),C=t.enum(["keys","created_at","updated_at"]),L=t.object({desc:t.boolean(),field:C}).strict(),ie=t.object({matcher:U.optional(),paginate:O.optional(),order:L.optional(),owner:s.optional()}).strict(),ae=i=>t.object({items:t.array(t.tuple([c,i])),items_length:t.bigint(),items_page:t.bigint().optional(),matches_length:t.bigint(),matches_pages:t.bigint().optional()}).strict();import{jsonReplacer as K,jsonReviver as B}from"@junobuild/utils";var se=i=>JSON.parse(__juno_satellite_datastore_raw_data_to_text(i),B),ce=i=>__juno_satellite_datastore_raw_data_from_text(JSON.stringify(i,K));export{o as a,n as b,s as c,H as d,h as e,c as f,r as g,l as h,b as i,M as j,N as k,q as l,y as m,D as n,g as o,x as p,z as q,Q as r,W as s,X as t,Y as u,$ as v,ee as w,_ as x,U as y,O as z,C as A,L as B,ie as C,ae as D,se as E,ce as F};
|
|
2
|
+
//# sourceMappingURL=chunk-VIFVPVUD.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/schemas/satellite.ts", "src/schemas/db.ts", "src/schemas/storage.ts", "src/schemas/list.ts", "src/sdk/serializer.sdk.ts"],
|
|
4
|
+
"sourcesContent": ["import {j} from '@junobuild/schema';\nimport * as z from 'zod';\nimport {type RawPrincipal, RawPrincipalSchema} from './principal';\n\n/**\n * @see Timestamp\n */\nexport const TimestampSchema = z.bigint();\n\n/**\n * Represents a timestamp in nanoseconds since the Unix epoch.\n *\n * Used for tracking when events occur, such as document creation and updates.\n */\nexport type Timestamp = z.infer<typeof TimestampSchema>;\n\n/**\n * @see Version\n */\nexport const VersionSchema = z.bigint();\n\n/**\n * Represents a version number for tracking changes.\n *\n * This is typically incremented with each update to ensure consistency.\n */\nexport type Version = z.infer<typeof VersionSchema>;\n\n/**\n * @see RawUserId\n */\nexport const RawUserIdSchema = RawPrincipalSchema;\n\n/**\n * Represents a raw user identifier.\n *\n * This is a principal associated with a user.\n */\nexport type RawUserId = RawPrincipal;\n\n/**\n * @see UserId\n */\nexport const UserIdSchema = j.principal();\n\n/**\n * Represents a user identifier.\n *\n * This is a principal associated with a user.\n */\nexport type UserId = z.infer<typeof UserIdSchema>;\n\n/**\n * @see Collection\n */\nexport const CollectionSchema = z.string();\n\n/**\n * A collection name where data are stored.\n */\nexport type Collection = z.infer<typeof CollectionSchema>;\n\n/**\n * @see Key\n */\nexport const KeySchema = z.string();\n\n/**\n * A key identifier within a collection.\n */\nexport type Key = z.infer<typeof KeySchema>;\n\n/**\n * @see Description\n */\nexport const DescriptionSchema = z.string().max(1024);\n\n/**\n * Represents a description with a maximum length of 1024 characters.\n * Used for document and asset fields which can be useful for search purpose.\n */\nexport type Description = z.infer<typeof DescriptionSchema>;\n", "import {j} from '@junobuild/schema';\nimport * as z from 'zod';\nimport {\n type Description,\n DescriptionSchema,\n type RawUserId,\n RawUserIdSchema,\n type Timestamp,\n TimestampSchema,\n type Version,\n VersionSchema\n} from './satellite';\n\n/**\n * @see RawData\n */\nexport const RawDataSchema = j.uint8Array();\n\n/**\n * Represents raw binary data.\n *\n * This is used to store structured data in a document.\n */\nexport type RawData = Uint8Array;\n\n/**\n * @see Doc\n */\nexport const DocSchema = z\n .object({\n owner: RawUserIdSchema,\n data: RawDataSchema,\n description: DescriptionSchema.optional(),\n created_at: TimestampSchema,\n updated_at: TimestampSchema,\n version: VersionSchema.optional()\n })\n .strict();\n\n/**\n * Represents a document stored in a collection.\n */\nexport interface Doc {\n /**\n * The user who owns this document.\n */\n owner: RawUserId;\n\n /**\n * The raw data of the document.\n */\n data: RawData;\n\n /**\n * An optional description of the document.\n */\n description?: Description;\n\n /**\n * The timestamp when the document was first created.\n */\n created_at: Timestamp;\n\n /**\n * The timestamp when the document was last updated.\n */\n updated_at: Timestamp;\n\n /**\n * The version number of the document, used for consistency checks.\n * If not provided, it's assumed to be the first version.\n */\n version?: Version;\n}\n\n/**\n * @see OptionDoc\n */\nexport const OptionDocSchema = DocSchema.optional();\n\n/**\n * A shorthand for a document that might or not be defined.\n */\nexport type OptionDoc = Doc | undefined;\n\n/**\n * @see SetDoc\n */\nexport const SetDocSchema = z\n .object({\n data: RawDataSchema,\n description: DescriptionSchema.optional(),\n version: VersionSchema.optional()\n })\n .strict();\n\n/**\n * Represents the proposed version of a document to be created or updated.\n * This can be validated before allowing the operation.\n */\nexport interface SetDoc {\n /**\n * The raw data of the document.\n */\n data: RawData;\n\n /**\n * An optional description of the document.\n */\n description?: Description;\n\n /**\n * The expected version number to ensure consistency.\n */\n version?: Version;\n}\n\n/**\n * @see DelDoc\n */\nexport const DelDocSchema = z\n .object({\n version: VersionSchema.optional()\n })\n .strict();\n\n/**\n * Represents the proposed version of a document to be deleted.\n * This can be validated before allowing the operation.\n */\nexport interface DelDoc {\n /**\n * The expected version number to ensure consistency.\n */\n version?: Version;\n}\n", "import {j} from '@junobuild/schema';\nimport * as z from 'zod';\nimport {\n type Collection,\n CollectionSchema,\n type Description,\n DescriptionSchema,\n type RawUserId,\n RawUserIdSchema,\n type Timestamp,\n TimestampSchema,\n type Version,\n VersionSchema\n} from './satellite';\n\n/**\n * @see HeaderField\n */\nconst HeaderFieldSchema = z.tuple([z.string(), z.string()]);\n\n/**\n * Represents a single HTTP header as a tuple of name and value.\n */\nexport type HeaderField = [string, string];\n\n/**\n * @see HeaderFields\n */\nexport const HeaderFieldsSchema = z.array(HeaderFieldSchema);\n\n/**\n * Represents a list of HTTP headers.\n */\nexport type HeaderFields = HeaderField[];\n\n/**\n * @see Blob\n */\nexport const BlobSchema = j.uint8Array();\n\n/**\n * Binary content used in asset encoding.\n */\nexport type Blob = Uint8Array;\n\n/**\n * @see BlobOrKey\n */\nconst BlobOrKeySchema = BlobSchema;\n\n/**\n * When stable memory is used, chunks are saved within a StableBTreeMap and their keys - StableEncodingChunkKey - are saved for reference as serialized values\n */\nexport type BlobOrKey = Uint8Array;\n\n/**\n * @see Hash\n */\nconst HashSchema = z.instanceof(Uint8Array).refine((val) => val.length === 32, {\n message: 'Hash must be a Uint8Array of length 32'\n});\n\n/**\n * Represents a SHA-256 hash as a 32-byte binary value.\n */\nexport type Hash = Uint8Array;\n\n/**\n * @see AssetKey\n */\nexport const AssetKeySchema = z\n .object({\n name: z.string(),\n full_path: z.string(),\n token: z.string().optional(),\n collection: CollectionSchema,\n owner: RawUserIdSchema,\n description: DescriptionSchema.optional()\n })\n .strict();\n\n/**\n * Metadata identifying an asset within a collection and the storage system.\n */\nexport interface AssetKey {\n /**\n * The name of the asset (e.g., \"logo.png\").\n */\n name: string;\n\n /**\n * The full relative path of the asset (e.g., \"/images/logo.png\").\n */\n full_path: string;\n\n /**\n * Optional access token for the asset.\n * If set, can be used using a query parameter e.g. /full_path/?token=1223-3345-5564-3333\n */\n token?: string;\n\n /**\n * The collection to which this asset belongs.\n */\n collection: Collection;\n\n /**\n * The owner of the asset.\n */\n owner: RawUserId;\n\n /**\n * Optional description of the asset for indexing/search.\n */\n description?: Description;\n}\n\n/**\n * @see AssetEncoding\n */\nexport const AssetEncodingSchema = z.object({\n modified: TimestampSchema,\n content_chunks: z.array(BlobOrKeySchema),\n total_length: z.bigint(),\n sha256: HashSchema\n});\n\n/**\n * Represents a specific encoding of an asset, such as \"gzip\" or \"identity\" (no compression).\n */\nexport interface AssetEncoding {\n /**\n * Timestamp when the encoding was last modified.\n */\n modified: Timestamp;\n\n /**\n * Chunks of binary content or references to them.\n */\n content_chunks: BlobOrKey[];\n\n /**\n * Total byte size of the encoded content.\n */\n total_length: bigint;\n\n /**\n * SHA-256 hash of the encoded content.\n */\n sha256: Hash;\n}\n\n/**\n * @see AssetEncodingNoContent\n */\nconst AssetEncodingNoContentSchema = AssetEncodingSchema.omit({content_chunks: true}).strict();\n\n/**\n * Represents a specific encoding of an asset, such as \"gzip\" or \"identity\" (no compression), without the chunks.\n */\nexport type AssetEncodingNoContent = Omit<AssetEncoding, 'content_chunks'>;\n\n/**\n * @see EncodingType\n */\nconst EncodingTypeSchema = z.enum(['identity', 'gzip', 'compress', 'deflate', 'br']);\n\n/**\n * A string identifier representing a specific encoding format (e.g., \"gzip\", \"identity\").\n */\nexport type EncodingType = 'identity' | 'gzip' | 'compress' | 'deflate' | 'br';\n\n/**\n * @see Asset\n */\nexport const AssetSchema = z\n .object({\n key: AssetKeySchema,\n headers: HeaderFieldsSchema,\n encodings: z.array(z.tuple([EncodingTypeSchema, AssetEncodingSchema])),\n created_at: TimestampSchema,\n updated_at: TimestampSchema,\n version: VersionSchema.optional()\n })\n .strict();\n\n/**\n * A stored asset including its metadata, encodings, and timestamps.\n */\nexport interface Asset {\n /**\n * Metadata about the asset's identity and ownership.\n */\n key: AssetKey;\n\n /**\n * Optional HTTP headers associated with the asset.\n */\n headers: HeaderField[];\n\n /**\n * A mapping from encoding types (e.g., \"identity\", \"gzip\") to the corresponding encoded version.\n */\n encodings: [EncodingType, AssetEncoding][];\n\n /**\n * Timestamp when the asset was created.\n */\n created_at: Timestamp;\n\n /**\n * Timestamp when the asset was last updated.\n */\n updated_at: Timestamp;\n\n /**\n * Optional version number of the asset.\n */\n version?: Version;\n}\n\n/**\n * @see AssetNoContent\n */\nexport const AssetNoContentSchema = AssetSchema.omit({encodings: true})\n .extend({\n encodings: z.array(z.tuple([EncodingTypeSchema, AssetEncodingNoContentSchema]))\n })\n .strict();\n\n/**\n * A stored asset including its metadata, encodings without chunks, and timestamps.\n */\nexport type AssetNoContent = Omit<Asset, 'encodings'> & {\n encodings: [EncodingType, AssetEncodingNoContent][];\n};\n\n/**\n * @see ReferenceId\n */\nconst ReferenceIdSchema = z.bigint();\n\n/**\n * A unique reference identifier for batches.\n */\nexport type ReferenceId = bigint;\n\n/**\n * @see Batch\n */\nexport const BatchSchema = z\n .object({\n key: AssetKeySchema,\n reference_id: ReferenceIdSchema.optional(),\n expires_at: TimestampSchema,\n encoding_type: EncodingTypeSchema.optional()\n })\n .strict();\n\n/**\n * Represents a batch of chunks to be uploaded and committed to an asset.\n */\nexport interface Batch {\n /**\n * The metadata key for the asset being uploaded.\n */\n key: AssetKey;\n\n /**\n * Optional reference ID for tracking or validation.\n */\n reference_id?: ReferenceId;\n\n /**\n * Timestamp when this batch expires.\n */\n expires_at: Timestamp;\n\n /**\n * Optional encoding format (e.g., \"gzip\").\n */\n encoding_type?: EncodingType;\n}\n\n/**\n * @see ChunkId\n */\nconst ChunkIdSchema = z.bigint();\n\n/**\n * A unique identifier representing a single chunk of data.\n */\nexport type ChunkId = bigint;\n\n/**\n * @see BatchId\n */\nconst BatchIdSchema = z.bigint();\n\n/**\n * A unique identifier representing a batch of upload.\n */\nexport type BatchId = bigint;\n\n/**\n * @see CommitBatch\n */\nexport const CommitBatchSchema = z\n .object({\n batch_id: BatchIdSchema,\n headers: HeaderFieldsSchema,\n chunk_ids: z.array(ChunkIdSchema)\n })\n .strict();\n\n/**\n * Represents the final step in uploading an asset, committing the batch to storage.\n */\nexport interface CommitBatch {\n /**\n * The ID of the batch being committed.\n */\n batch_id: BatchId;\n\n /**\n * HTTP headers associated with this asset.\n */\n headers: HeaderField[];\n\n /**\n * List of chunk IDs that make up the asset content.\n */\n chunk_ids: ChunkId[];\n}\n\n/**\n * @see FullPath\n */\nexport const FullPathSchema = z.string();\n\n/**\n * Represents the relative path of an asset in storage.\n * For assets that are not part of the frontend app, the collection must be included at the root of the path.\n *\n * Example: `/images/a-sun-above-the-mountains.png`\n */\nexport type FullPath = string;\n\n/**\n * @see AssetAccessToken\n */\nexport const AssetAccessTokenSchema = z.string().optional();\n\n/**\n * An optional access token that can be used to make an asset private on the web.\n * Private as in practically unguessable (if complex enough and not shared of course).\n *\n * Example: `/images/a-sun-above-the-mountains.png?token=a-super-long-unguessable-not-shared-id`\n */\nexport type AssetAccessToken = string | undefined;\n\n/**\n * @see OptionAsset\n */\nexport const OptionAssetSchema = AssetSchema.optional();\n\n/**\n * A shorthand for an asset that might or not be defined.\n */\nexport type OptionAsset = Asset | undefined;\n", "import * as z from 'zod';\nimport {\n type Description,\n type Key,\n type RawUserId,\n type Timestamp,\n DescriptionSchema,\n KeySchema,\n RawUserIdSchema,\n TimestampSchema\n} from './satellite';\n\n/**\n * @see TimestampMatcher\n */\nexport const TimestampMatcherSchema = z.union([\n z.object({equal: TimestampSchema}),\n z.object({greater_than: TimestampSchema}),\n z.object({less_than: TimestampSchema}),\n z.object({between: z.tuple([TimestampSchema, TimestampSchema])})\n]);\n\n/**\n * TimestampMatcher matches a timestamp field using a specific strategy.\n */\nexport type TimestampMatcher =\n | {equal: Timestamp}\n | {greater_than: Timestamp}\n | {less_than: Timestamp}\n | {between: [Timestamp, Timestamp]};\n\n/**\n * @see ListMatcher\n */\nexport const ListMatcherSchema = z\n .object({\n key: KeySchema.optional(),\n description: DescriptionSchema.optional(),\n created_at: TimestampMatcherSchema.optional(),\n updated_at: TimestampMatcherSchema.optional()\n })\n .strict();\n\n/**\n * Matcher used to filter list results.\n */\nexport interface ListMatcher {\n key?: Key;\n description?: Description;\n created_at?: TimestampMatcher;\n updated_at?: TimestampMatcher;\n}\n\n/**\n * @see ListPaginate\n */\nexport const ListPaginateSchema = z\n .object({\n start_after: KeySchema.optional(),\n limit: z.bigint().optional()\n })\n .strict();\n\n/**\n * Optional pagination controls for listing.\n */\nexport interface ListPaginate {\n start_after?: Key;\n limit?: bigint;\n}\n\n/**\n * @see ListOrderField\n */\nexport const ListOrderFieldSchema = z.enum(['keys', 'created_at', 'updated_at']);\n\n/**\n * Enum representing possible fields to order by.\n */\nexport type ListOrderField = 'keys' | 'updated_at' | 'created_at';\n\n/**\n * @see ListOrder\n */\nexport const ListOrderSchema = z\n .object({\n desc: z.boolean(),\n field: ListOrderFieldSchema\n })\n .strict();\n\n/**\n * Ordering strategy for listing documents.\n */\nexport interface ListOrder {\n desc: boolean;\n field: ListOrderField;\n}\n\n/**\n * @see ListParams\n */\nexport const ListParamsSchema = z\n .object({\n matcher: ListMatcherSchema.optional(),\n paginate: ListPaginateSchema.optional(),\n order: ListOrderSchema.optional(),\n owner: RawUserIdSchema.optional()\n })\n .strict();\n\n/**\n * Full set of listing parameters.\n */\nexport interface ListParams {\n matcher?: ListMatcher;\n paginate?: ListPaginate;\n order?: ListOrder;\n owner?: RawUserId;\n}\n\n/**\n * Represents a list result.\n *\n * @template T - The type of the data returned per item.\n * @see JsListResults\n */\nexport const createListResultsSchema = <T extends z.ZodTypeAny>(itemData: T) =>\n z\n .object({\n items: z.array(z.tuple([KeySchema, itemData])),\n items_length: z.bigint(),\n items_page: z.bigint().optional(),\n matches_length: z.bigint(),\n matches_pages: z.bigint().optional()\n })\n .strict();\n\n/**\n * List results, parameterized by type of returned item.\n */\nexport interface ListResults<T> {\n items: [Key, T][];\n items_length: bigint;\n items_page?: bigint;\n matches_length: bigint;\n matches_pages?: bigint;\n}\n", "import {jsonReplacer, jsonReviver} from '@junobuild/utils';\nimport type {RawData} from '../schemas/db';\n\n/**\n * Decodes the raw data of a document into a JavaScript object.\n *\n * @template T The expected type of the decoded object.\n * @param {RawData} data - The raw data to be decoded.\n * @returns {T} The parsed JavaScript object.\n */\nexport const decodeDocData = <T>(data: RawData): T =>\n JSON.parse(__juno_satellite_datastore_raw_data_to_text(data), jsonReviver);\n\n/**\n * Encodes a JavaScript object into a raw data format to be applied to a document.\n *\n * @template T The type of the object to be encoded.\n * @param {T} data - The data to be encoded.\n * @returns {RawData} The serialized raw data.\n */\nexport const encodeDocData = <T>(data: T): RawData =>\n __juno_satellite_datastore_raw_data_from_text(JSON.stringify(data, jsonReplacer));\n"],
|
|
5
|
+
"mappings": "wCAAA,OAAQ,KAAAA,MAAQ,oBAChB,UAAYC,MAAO,MAMZ,IAAMC,EAAoB,SAAO,EAY3BC,EAAkB,SAAO,EAYzBC,EAAkBC,EAYlBC,EAAeC,EAAE,UAAU,EAY3BC,EAAqB,SAAO,EAU5BC,EAAc,SAAO,EAUrBC,EAAsB,SAAO,EAAE,IAAI,IAAI,EC3EpD,OAAQ,KAAAC,MAAQ,oBAChB,UAAYC,MAAO,MAeZ,IAAMC,EAAgBC,EAAE,WAAW,EAY7BC,EACV,SAAO,CACN,MAAOC,EACP,KAAMH,EACN,YAAaI,EAAkB,SAAS,EACxC,WAAYC,EACZ,WAAYA,EACZ,QAASC,EAAc,SAAS,CAClC,CAAC,EACA,OAAO,EAyCGC,EAAkBL,EAAU,SAAS,EAUrCM,EACV,SAAO,CACN,KAAMR,EACN,YAAaI,EAAkB,SAAS,EACxC,QAASE,EAAc,SAAS,CAClC,CAAC,EACA,OAAO,EA0BGG,EACV,SAAO,CACN,QAASH,EAAc,SAAS,CAClC,CAAC,EACA,OAAO,EC5HV,OAAQ,KAAAI,MAAQ,oBAChB,UAAYC,MAAO,MAiBnB,IAAMC,EAAsB,QAAM,CAAG,SAAO,EAAK,SAAO,CAAC,CAAC,EAU7CC,EAAuB,QAAMD,CAAiB,EAU9CE,EAAaC,EAAE,WAAW,EAUjCC,EAAkBF,EAUlBG,EAAe,aAAW,UAAU,EAAE,OAAQC,GAAQA,EAAI,SAAW,GAAI,CAC7E,QAAS,wCACX,CAAC,EAUYC,EACV,SAAO,CACN,KAAQ,SAAO,EACf,UAAa,SAAO,EACpB,MAAS,SAAO,EAAE,SAAS,EAC3B,WAAYC,EACZ,MAAOC,EACP,YAAaC,EAAkB,SAAS,CAC1C,CAAC,EACA,OAAO,EAyCGC,EAAwB,SAAO,CAC1C,SAAUC,EACV,eAAkB,QAAMR,CAAe,EACvC,aAAgB,SAAO,EACvB,OAAQC,CACV,CAAC,EA8BKQ,EAA+BF,EAAoB,KAAK,CAAC,eAAgB,EAAI,CAAC,EAAE,OAAO,EAUvFG,EAAuB,OAAK,CAAC,WAAY,OAAQ,WAAY,UAAW,IAAI,CAAC,EAUtEC,EACV,SAAO,CACN,IAAKR,EACL,QAASN,EACT,UAAa,QAAQ,QAAM,CAACa,EAAoBH,CAAmB,CAAC,CAAC,EACrE,WAAYC,EACZ,WAAYA,EACZ,QAASI,EAAc,SAAS,CAClC,CAAC,EACA,OAAO,EAwCGC,EAAuBF,EAAY,KAAK,CAAC,UAAW,EAAI,CAAC,EACnE,OAAO,CACN,UAAa,QAAQ,QAAM,CAACD,EAAoBD,CAA4B,CAAC,CAAC,CAChF,CAAC,EACA,OAAO,EAYJK,EAAsB,SAAO,EAUtBC,EACV,SAAO,CACN,IAAKZ,EACL,aAAcW,EAAkB,SAAS,EACzC,WAAYN,EACZ,cAAeE,EAAmB,SAAS,CAC7C,CAAC,EACA,OAAO,EA8BJM,EAAkB,SAAO,EAUzBC,EAAkB,SAAO,EAUlBC,EACV,SAAO,CACN,SAAUD,EACV,QAASpB,EACT,UAAa,QAAMmB,CAAa,CAClC,CAAC,EACA,OAAO,EAyBGG,EAAmB,SAAO,EAa1BC,EAA2B,SAAO,EAAE,SAAS,EAa7CC,GAAoBV,EAAY,SAAS,EC5WtD,UAAYW,MAAO,MAeZ,IAAMC,EAA2B,QAAM,CAC1C,SAAO,CAAC,MAAOC,CAAe,CAAC,EAC/B,SAAO,CAAC,aAAcA,CAAe,CAAC,EACtC,SAAO,CAAC,UAAWA,CAAe,CAAC,EACnC,SAAO,CAAC,QAAW,QAAM,CAACA,EAAiBA,CAAe,CAAC,CAAC,CAAC,CACjE,CAAC,EAcYC,EACV,SAAO,CACN,IAAKC,EAAU,SAAS,EACxB,YAAaC,EAAkB,SAAS,EACxC,WAAYJ,EAAuB,SAAS,EAC5C,WAAYA,EAAuB,SAAS,CAC9C,CAAC,EACA,OAAO,EAeGK,EACV,SAAO,CACN,YAAaF,EAAU,SAAS,EAChC,MAAS,SAAO,EAAE,SAAS,CAC7B,CAAC,EACA,OAAO,EAaGG,EAAyB,OAAK,CAAC,OAAQ,aAAc,YAAY,CAAC,EAUlEC,EACV,SAAO,CACN,KAAQ,UAAQ,EAChB,MAAOD,CACT,CAAC,EACA,OAAO,EAaGE,GACV,SAAO,CACN,QAASN,EAAkB,SAAS,EACpC,SAAUG,EAAmB,SAAS,EACtC,MAAOE,EAAgB,SAAS,EAChC,MAAOE,EAAgB,SAAS,CAClC,CAAC,EACA,OAAO,EAkBGC,GAAmDC,GAE3D,SAAO,CACN,MAAS,QAAQ,QAAM,CAACR,EAAWQ,CAAQ,CAAC,CAAC,EAC7C,aAAgB,SAAO,EACvB,WAAc,SAAO,EAAE,SAAS,EAChC,eAAkB,SAAO,EACzB,cAAiB,SAAO,EAAE,SAAS,CACrC,CAAC,EACA,OAAO,ECxIZ,OAAQ,gBAAAC,EAAc,eAAAC,MAAkB,mBAUjC,IAAMC,GAAoBC,GAC/B,KAAK,MAAM,4CAA4CA,CAAI,EAAGF,CAAW,EAS9DG,GAAoBD,GAC/B,8CAA8C,KAAK,UAAUA,EAAMH,CAAY,CAAC",
|
|
6
|
+
"names": ["j", "z", "TimestampSchema", "VersionSchema", "RawUserIdSchema", "RawPrincipalSchema", "UserIdSchema", "j", "CollectionSchema", "KeySchema", "DescriptionSchema", "j", "z", "RawDataSchema", "j", "DocSchema", "RawUserIdSchema", "DescriptionSchema", "TimestampSchema", "VersionSchema", "OptionDocSchema", "SetDocSchema", "DelDocSchema", "j", "z", "HeaderFieldSchema", "HeaderFieldsSchema", "BlobSchema", "j", "BlobOrKeySchema", "HashSchema", "val", "AssetKeySchema", "CollectionSchema", "RawUserIdSchema", "DescriptionSchema", "AssetEncodingSchema", "TimestampSchema", "AssetEncodingNoContentSchema", "EncodingTypeSchema", "AssetSchema", "VersionSchema", "AssetNoContentSchema", "ReferenceIdSchema", "BatchSchema", "ChunkIdSchema", "BatchIdSchema", "CommitBatchSchema", "FullPathSchema", "AssetAccessTokenSchema", "OptionAssetSchema", "z", "TimestampMatcherSchema", "TimestampSchema", "ListMatcherSchema", "KeySchema", "DescriptionSchema", "ListPaginateSchema", "ListOrderFieldSchema", "ListOrderSchema", "ListParamsSchema", "RawUserIdSchema", "createListResultsSchema", "itemData", "jsonReplacer", "jsonReviver", "decodeDocData", "data", "encodeDocData"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/canisters/schemas.ts"],
|
|
4
|
+
"sourcesContent": ["import {j} from '@junobuild/schema';\nimport * as z from 'zod';\n\n/**\n * @see CanisterOptions\n */\nexport const CanisterOptionsSchema = z.strictObject({\n canisterId: j.principal().optional()\n});\n\n/**\n * The options to initialize a canister.\n */\nexport type CanisterOptions = z.infer<typeof CanisterOptionsSchema>;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAQ,KAAAA,MAAQ,oBAChB,UAAYC,MAAO,MAKZ,IAAMC,EAA0B,eAAa,CAClD,WAAYF,EAAE,UAAU,EAAE,SAAS,CACrC,CAAC",
|
|
6
|
+
"names": ["j", "z", "CanisterOptionsSchema"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as o}from"./chunk-JU5CZHLY.js";import{IDL as w}from"@icp-sdk/core/candid";import{j as A}from"@junobuild/schema";import*as e from"zod";var s=e.custom(r=>r instanceof w.Type,{message:"Invalid IDL.Type"}),P=e.tuple([s,e.unknown()]),z=e.array(P),S=s,n=e.object({canisterId:o.or(A.principal()),method:e.string().min(1),args:z.optional(),result:S.optional()});var t=class extends Error{constructor(){super(),this.message="More than one object returned by the response. This is unexpected."}};import{IDL as p}from"@icp-sdk/core/candid";import{Principal as D}from"@icp-sdk/core/principal";import{toNullable as L}from"@junobuild/utils";var N=async r=>{n.parse(r);let{canisterId:l,method:i,args:c,result:m}=r,y=D.from(l).toUint8Array(),[f,u]=(c??[]).reduce(([C,I],[x,T])=>[[...C,x],[...I,T]],[[],[]]),d=new Uint8Array(p.encode([...f],[...u])),h=await __ic_cdk_call_raw(y,i,d),a=p.decode(L(m),h);if(a.length>1)throw new t;let[g]=a;return g};export{s as a,P as b,z as c,S as d,n as e,t as f,N as g};
|
|
2
|
+
//# sourceMappingURL=chunk-YHNBR22R.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/ic-cdk/schemas/call.ts", "src/ic-cdk/types/errors.ts", "src/ic-cdk/call.ic-cdk.ts"],
|
|
4
|
+
"sourcesContent": ["import {IDL} from '@icp-sdk/core/candid';\nimport type {Principal} from '@icp-sdk/core/principal';\nimport {j} from '@junobuild/schema';\nimport * as z from 'zod';\nimport {type RawPrincipal, RawPrincipalSchema} from '../../schemas/principal';\n\n/**\n * @see IDLType\n */\nexport const IDLTypeSchema = z.custom<IDL.Type<unknown>>((val) => val instanceof IDL.Type, {\n message: 'Invalid IDL.Type'\n});\n\n/**\n * Custom validation function to verify if a value is an instance of `IDL.Type` from `@icp-sdk/core/candid`.\n */\nexport type IDLType = z.infer<typeof IDLTypeSchema>;\n\n/**\n * @see CallArg\n */\nexport const CallArgSchema = z.tuple([IDLTypeSchema, z.unknown()]);\n\n/**\n * A call argument consisting of its IDL type and corresponding value.\n */\nexport type CallArg = z.infer<typeof CallArgSchema>;\n\n/**\n * Schema for encoding the call arguments.\n *\n * @see CallArgs\n */\nexport const CallArgsSchema = z.array(CallArgSchema);\n\n/**\n * Represents the arguments for a canister call on the IC.\n *\n * Requests and responses on the IC are encoded using Candid.\n * This schema ensures that each argument is provided with both its type and value\n * for proper encoding.\n *\n * The order of arguments is preserved for the function call.\n */\nexport type CallArgs = z.infer<typeof CallArgsSchema>;\n\n/**\n * @see CallResult\n */\nexport const CallResultSchema = IDLTypeSchema;\n\n/**\n * Defines the type used to decode the result of a canister call.\n */\nexport type CallResult = z.infer<typeof CallResultSchema>;\n\n/**\n * @see CallParams\n */\nexport const CallParamsSchema = z.object({\n canisterId: RawPrincipalSchema.or(j.principal()),\n method: z.string().min(1),\n args: CallArgsSchema.optional(),\n result: CallResultSchema.optional()\n});\n\n/**\n * Type representing the parameters required to make a canister call.\n */\nexport interface CallParams {\n /**\n * The target canister's ID.\n */\n canisterId: RawPrincipal | Principal;\n\n /**\n * The name of the method to call. Minimum one character.\n */\n method: string;\n\n /**\n * The arguments, including types and values, for the canister call.\n */\n args?: CallArgs;\n\n /**\n * The expected result type used for decoding the response.\n */\n result?: CallResult;\n}\n", "export class CallResponseLengthError extends Error {\n constructor() {\n super();\n\n this.message = 'More than one object returned by the response. This is unexpected.';\n }\n}\n", "import {IDL} from '@icp-sdk/core/candid';\nimport {Principal} from '@icp-sdk/core/principal';\nimport {toNullable} from '@junobuild/utils';\nimport {type CallParams, type IDLType, CallParamsSchema} from './schemas/call';\nimport {CallResponseLengthError} from './types/errors';\n\n/**\n * Makes an asynchronous call to a canister on the Internet Computer.\n *\n * This function encodes the provided arguments using Candid, performs the canister call,\n * and decodes the response based on the expected result types.\n *\n * @template T - The expected return type of the canister call.\n * @param {CallParams} params - The parameters required for the canister call\n * @returns {Promise<T | undefined>} A promise resolving to the decoded result of the call.\n * Returns `undefined` if the canister response is empty.\n * @throws {ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the canister call fails.\n */\nexport const call = async <T>(params: CallParams): Promise<T> => {\n CallParamsSchema.parse(params);\n\n const {canisterId: providedCanisterId, method, args: providedArgs, result: resultType} = params;\n\n const canisterId = Principal.from(providedCanisterId).toUint8Array();\n\n const [argsTypes, argsValues] = (providedArgs ?? []).reduce<[IDLType[], unknown[]]>(\n ([argsTypes, argsValues], [type, value]) => [\n [...argsTypes, type],\n [...argsValues, value]\n ],\n [[], []]\n );\n\n const args = new Uint8Array(IDL.encode([...argsTypes], [...argsValues]));\n\n const bytes: Uint8Array<ArrayBuffer> = await __ic_cdk_call_raw(canisterId, method, args);\n\n const result = IDL.decode(toNullable(resultType), bytes);\n\n // We have no test covering this use case because decode seems to never return more than one element, as we never specify more than one return type.\n if (result.length > 1) {\n throw new CallResponseLengthError();\n }\n\n const [response] = result as unknown as [T];\n return response;\n};\n"],
|
|
5
|
+
"mappings": "wCAAA,OAAQ,OAAAA,MAAU,uBAElB,OAAQ,KAAAC,MAAQ,oBAChB,UAAYC,MAAO,MAMZ,IAAMC,EAAkB,SAA2BC,GAAQA,aAAeC,EAAI,KAAM,CACzF,QAAS,kBACX,CAAC,EAUYC,EAAkB,QAAM,CAACH,EAAiB,UAAQ,CAAC,CAAC,EAYpDI,EAAmB,QAAMD,CAAa,EAgBtCE,EAAmBL,EAUnBM,EAAqB,SAAO,CACvC,WAAYC,EAAmB,GAAGC,EAAE,UAAU,CAAC,EAC/C,OAAU,SAAO,EAAE,IAAI,CAAC,EACxB,KAAMJ,EAAe,SAAS,EAC9B,OAAQC,EAAiB,SAAS,CACpC,CAAC,EChEM,IAAMI,EAAN,cAAsC,KAAM,CACjD,aAAc,CACZ,MAAM,EAEN,KAAK,QAAU,oEACjB,CACF,ECNA,OAAQ,OAAAC,MAAU,uBAClB,OAAQ,aAAAC,MAAgB,0BACxB,OAAQ,cAAAC,MAAiB,mBAiBlB,IAAMC,EAAO,MAAUC,GAAmC,CAC/DC,EAAiB,MAAMD,CAAM,EAE7B,GAAM,CAAC,WAAYE,EAAoB,OAAAC,EAAQ,KAAMC,EAAc,OAAQC,CAAU,EAAIL,EAEnFM,EAAaC,EAAU,KAAKL,CAAkB,EAAE,aAAa,EAE7D,CAACM,EAAWC,CAAU,GAAKL,GAAgB,CAAC,GAAG,OACnD,CAAC,CAACI,EAAWC,CAAU,EAAG,CAACC,EAAMC,CAAK,IAAM,CAC1C,CAAC,GAAGH,EAAWE,CAAI,EACnB,CAAC,GAAGD,EAAYE,CAAK,CACvB,EACA,CAAC,CAAC,EAAG,CAAC,CAAC,CACT,EAEMC,EAAO,IAAI,WAAWC,EAAI,OAAO,CAAC,GAAGL,CAAS,EAAG,CAAC,GAAGC,CAAU,CAAC,CAAC,EAEjEK,EAAiC,MAAM,kBAAkBR,EAAYH,EAAQS,CAAI,EAEjFG,EAASF,EAAI,OAAOG,EAAWX,CAAU,EAAGS,CAAK,EAGvD,GAAIC,EAAO,OAAS,EAClB,MAAM,IAAIE,EAGZ,GAAM,CAACC,CAAQ,EAAIH,EACnB,OAAOG,CACT",
|
|
6
|
+
"names": ["IDL", "j", "z", "IDLTypeSchema", "val", "IDL", "CallArgSchema", "CallArgsSchema", "CallResultSchema", "CallParamsSchema", "RawPrincipalSchema", "j", "CallResponseLengthError", "IDL", "Principal", "toNullable", "call", "params", "CallParamsSchema", "providedCanisterId", "method", "providedArgs", "resultType", "canisterId", "Principal", "argsTypes", "argsValues", "type", "value", "args", "IDL", "bytes", "result", "toNullable", "CallResponseLengthError", "response"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/canisters/_canister.ts"],
|
|
4
|
+
"sourcesContent": ["import type {Principal} from '@icp-sdk/core/principal';\nimport {j} from '@junobuild/schema';\nimport * as z from 'zod';\n\n/**\n * @see CanisterParameters\n */\nexport const CanisterParametersSchema = z.strictObject({\n canisterId: j.principal()\n});\n\n/**\n * The parameters that define a canister.\n */\nexport type CanisterParameters = z.infer<typeof CanisterParametersSchema>;\n\nexport abstract class Canister {\n readonly #id: Principal;\n\n protected constructor({canisterId}: CanisterParameters) {\n this.#id = canisterId;\n }\n\n get canisterId(): Principal {\n return this.#id;\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,OAAQ,KAAAA,MAAQ,oBAChB,UAAYC,MAAO,MAKZ,IAAMC,EAA6B,eAAa,CACrD,WAAYF,EAAE,UAAU,CAC1B,CAAC,EAOqBG,EAAf,KAAwB,CACpBC,GAEC,YAAY,CAAC,WAAAC,CAAU,EAAuB,CACtD,KAAKD,GAAMC,CACb,CAEA,IAAI,YAAwB,CAC1B,OAAO,KAAKD,EACd,CACF",
|
|
6
|
+
"names": ["j", "z", "CanisterParametersSchema", "Canister", "#id", "canisterId"]
|
|
7
|
+
}
|
package/functions/query.d.ts
CHANGED
|
@@ -10,17 +10,25 @@ export declare const QuerySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
10
10
|
args: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
11
11
|
result: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
12
12
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>>;
|
|
13
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
14
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
13
15
|
}, z.core.$strict>, z.ZodObject<{
|
|
14
16
|
type: z.ZodLiteral<"__juno_function_query">;
|
|
15
17
|
args: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
16
18
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
19
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
20
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
17
21
|
}, z.core.$strict>, z.ZodObject<{
|
|
18
22
|
type: z.ZodLiteral<"__juno_function_query">;
|
|
19
23
|
result: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
20
24
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>>;
|
|
25
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
26
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
21
27
|
}, z.core.$strict>, z.ZodObject<{
|
|
22
28
|
type: z.ZodLiteral<"__juno_function_query">;
|
|
23
29
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
30
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
31
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
24
32
|
}, z.core.$strict>]>;
|
|
25
33
|
/**
|
|
26
34
|
* The input shape for defining a query serverless function.
|
|
@@ -5,6 +5,7 @@ import { JUNO_FUNCTION_TYPE } from '../constants';
|
|
|
5
5
|
* to discover the functions when parsing the code.
|
|
6
6
|
*/
|
|
7
7
|
export type CustomFunctionType = (typeof JUNO_FUNCTION_TYPE)[keyof typeof JUNO_FUNCTION_TYPE];
|
|
8
|
+
export declare const CustomFunctionGuardSchema: z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>;
|
|
8
9
|
/**
|
|
9
10
|
* @see CustomFunctionWithArgsAndResult
|
|
10
11
|
*/
|
|
@@ -12,6 +13,8 @@ export declare const CustomFunctionWithArgsAndResultSchema: z.ZodObject<{
|
|
|
12
13
|
args: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
13
14
|
result: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
14
15
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>>;
|
|
16
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
17
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
15
18
|
type: z.ZodEnum<{
|
|
16
19
|
__juno_function_query: "__juno_function_query";
|
|
17
20
|
__juno_function_update: "__juno_function_update";
|
|
@@ -23,6 +26,8 @@ export declare const CustomFunctionWithArgsAndResultSchema: z.ZodObject<{
|
|
|
23
26
|
export declare const CustomFunctionWithArgsSchema: z.ZodObject<{
|
|
24
27
|
args: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
25
28
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
29
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
30
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
26
31
|
type: z.ZodEnum<{
|
|
27
32
|
__juno_function_query: "__juno_function_query";
|
|
28
33
|
__juno_function_update: "__juno_function_update";
|
|
@@ -34,6 +39,8 @@ export declare const CustomFunctionWithArgsSchema: z.ZodObject<{
|
|
|
34
39
|
export declare const CustomFunctionWithResultSchema: z.ZodObject<{
|
|
35
40
|
result: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
36
41
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>>;
|
|
42
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
43
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
37
44
|
type: z.ZodEnum<{
|
|
38
45
|
__juno_function_query: "__juno_function_query";
|
|
39
46
|
__juno_function_update: "__juno_function_update";
|
|
@@ -44,6 +51,8 @@ export declare const CustomFunctionWithResultSchema: z.ZodObject<{
|
|
|
44
51
|
*/
|
|
45
52
|
export declare const CustomFunctionWithoutArgsAndResultSchema: z.ZodObject<{
|
|
46
53
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
54
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
55
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
47
56
|
type: z.ZodEnum<{
|
|
48
57
|
__juno_function_query: "__juno_function_query";
|
|
49
58
|
__juno_function_update: "__juno_function_update";
|
|
@@ -56,6 +65,8 @@ export declare const CustomFunctionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
56
65
|
args: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
57
66
|
result: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
58
67
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>>;
|
|
68
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
69
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
59
70
|
type: z.ZodEnum<{
|
|
60
71
|
__juno_function_query: "__juno_function_query";
|
|
61
72
|
__juno_function_update: "__juno_function_update";
|
|
@@ -63,6 +74,8 @@ export declare const CustomFunctionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
63
74
|
}, z.core.$strict>, z.ZodObject<{
|
|
64
75
|
args: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
65
76
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
77
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
78
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
66
79
|
type: z.ZodEnum<{
|
|
67
80
|
__juno_function_query: "__juno_function_query";
|
|
68
81
|
__juno_function_update: "__juno_function_update";
|
|
@@ -70,12 +83,16 @@ export declare const CustomFunctionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
70
83
|
}, z.core.$strict>, z.ZodObject<{
|
|
71
84
|
result: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
72
85
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>>;
|
|
86
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
87
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
73
88
|
type: z.ZodEnum<{
|
|
74
89
|
__juno_function_query: "__juno_function_query";
|
|
75
90
|
__juno_function_update: "__juno_function_update";
|
|
76
91
|
}>;
|
|
77
92
|
}, z.core.$strict>, z.ZodObject<{
|
|
78
93
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
94
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
95
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
79
96
|
type: z.ZodEnum<{
|
|
80
97
|
__juno_function_query: "__juno_function_query";
|
|
81
98
|
__juno_function_update: "__juno_function_update";
|
|
@@ -89,6 +106,16 @@ interface CustomFunctionBase {
|
|
|
89
106
|
* The type of the function, either a query or an update.
|
|
90
107
|
*/
|
|
91
108
|
type: CustomFunctionType;
|
|
109
|
+
/**
|
|
110
|
+
* An optional function that runs before the function is executed.
|
|
111
|
+
* If the guard throws, the function is not executed.
|
|
112
|
+
*/
|
|
113
|
+
guard?: () => void;
|
|
114
|
+
/**
|
|
115
|
+
* If true, the function is not exposed in the public Candid interface.
|
|
116
|
+
* Useful for internal functions such as HTTP response transform functions.
|
|
117
|
+
*/
|
|
118
|
+
hidden?: boolean;
|
|
92
119
|
}
|
|
93
120
|
/**
|
|
94
121
|
* A serverless function with both input arguments and an output result.
|
package/functions/update.d.ts
CHANGED
|
@@ -10,17 +10,25 @@ export declare const UpdateSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
10
10
|
args: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
11
11
|
result: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
12
12
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>>;
|
|
13
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
14
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
13
15
|
}, z.core.$strict>, z.ZodObject<{
|
|
14
16
|
type: z.ZodLiteral<"__juno_function_update">;
|
|
15
17
|
args: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
16
18
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
19
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
20
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
17
21
|
}, z.core.$strict>, z.ZodObject<{
|
|
18
22
|
type: z.ZodLiteral<"__juno_function_update">;
|
|
19
23
|
result: z.ZodCustom<z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>, z.ZodObject<z.core.$ZodLooseShape, z.core.$strip>>;
|
|
20
24
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodUnknown, z.ZodPromise<z.ZodUnknown>]>>>;
|
|
25
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
26
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
21
27
|
}, z.core.$strict>, z.ZodObject<{
|
|
22
28
|
type: z.ZodLiteral<"__juno_function_update">;
|
|
23
29
|
handler: z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.core.$InferInnerFunctionType<z.ZodTuple<[], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
|
|
30
|
+
guard: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>, z.core.$InferInnerFunctionType<z.core.$ZodFunctionArgs, z.ZodVoid>>>;
|
|
31
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
24
32
|
}, z.core.$strict>]>;
|
|
25
33
|
/**
|
|
26
34
|
* The input shape for defining an update serverless function.
|
package/global.d.ts
CHANGED
|
@@ -13,17 +13,25 @@ import type {
|
|
|
13
13
|
HeaderFields,
|
|
14
14
|
OptionAsset
|
|
15
15
|
} from './schemas/storage';
|
|
16
|
+
import type {AccessKeys} from './sdk/schemas/access-keys';
|
|
16
17
|
import type {Memory} from './sdk/schemas/collections';
|
|
17
|
-
import type {Controllers} from './sdk/schemas/controllers';
|
|
18
18
|
|
|
19
19
|
declare global {
|
|
20
|
-
function
|
|
21
|
-
function
|
|
22
|
-
function
|
|
20
|
+
function __juno_satellite_get_admin_access_keys(): AccessKeys;
|
|
21
|
+
function __juno_satellite_get_access_keys(): AccessKeys;
|
|
22
|
+
function __juno_satellite_is_write_access_key(
|
|
23
23
|
caller: RawUserId,
|
|
24
|
-
controllers:
|
|
24
|
+
controllers: AccessKeys
|
|
25
25
|
): boolean;
|
|
26
|
-
function
|
|
26
|
+
function __juno_satellite_is_valid_access_key(
|
|
27
|
+
caller: RawUserId,
|
|
28
|
+
controllers: AccessKeys
|
|
29
|
+
): boolean;
|
|
30
|
+
function __juno_satellite_is_admin_controller(caller: RawUserId, accessKeys: AccessKeys): boolean;
|
|
31
|
+
|
|
32
|
+
function __juno_satellite_caller_is_admin();
|
|
33
|
+
function __juno_satellite_caller_has_write_permission();
|
|
34
|
+
function __juno_satellite_caller_is_access_key();
|
|
27
35
|
|
|
28
36
|
function __juno_satellite_random(): number;
|
|
29
37
|
|
|
@@ -118,4 +126,5 @@ declare global {
|
|
|
118
126
|
method: string,
|
|
119
127
|
args: Uint8Array<ArrayBuffer>
|
|
120
128
|
): Promise<Uint8Array<ArrayBuffer>>;
|
|
129
|
+
function __ic_cdk_http_request(args: HttpRequestArgs): Promise<HttpRequestResult>;
|
|
121
130
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type HttpRequestArgs, type HttpRequestResult } from './schemas/http-request';
|
|
2
|
+
/**
|
|
3
|
+
* Performs an HTTP request from a Juno serverless function.
|
|
4
|
+
*
|
|
5
|
+
* @param {HttpRequestArgs} args - The HTTP request parameters
|
|
6
|
+
* @returns {Promise<HttpRequestResult>} A promise resolving to the HTTP response.
|
|
7
|
+
* @throws {ZodError} If the provided arguments do not match the expected schema.
|
|
8
|
+
* @throws {Error} If the HTTP request fails.
|
|
9
|
+
*/
|
|
10
|
+
export declare const httpRequest: (args: HttpRequestArgs) => Promise<HttpRequestResult>;
|
package/ic-cdk/schemas/call.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IDL } from '@icp-sdk/core/candid';
|
|
2
2
|
import type { Principal } from '@icp-sdk/core/principal';
|
|
3
3
|
import * as z from 'zod';
|
|
4
|
-
import { type RawPrincipal } from '../../schemas/
|
|
4
|
+
import { type RawPrincipal } from '../../schemas/principal';
|
|
5
5
|
/**
|
|
6
6
|
* @see IDLType
|
|
7
7
|
*/
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see HttpHeader
|
|
3
|
+
*/
|
|
4
|
+
export declare const HttpHeaderSchema: import("zod").ZodObject<{
|
|
5
|
+
name: import("zod").ZodString;
|
|
6
|
+
value: import("zod").ZodString;
|
|
7
|
+
}, import("zod/v4/core").$strip>;
|
|
8
|
+
/**
|
|
9
|
+
* @see HttpMethod
|
|
10
|
+
*/
|
|
11
|
+
export declare const HttpMethodSchema: import("zod").ZodEnum<{
|
|
12
|
+
GET: "GET";
|
|
13
|
+
POST: "POST";
|
|
14
|
+
HEAD: "HEAD";
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* @see HttpRequestArgs
|
|
18
|
+
*/
|
|
19
|
+
export declare const HttpRequestArgsSchema: import("zod").ZodObject<{
|
|
20
|
+
url: import("zod").ZodURL;
|
|
21
|
+
method: import("zod").ZodEnum<{
|
|
22
|
+
GET: "GET";
|
|
23
|
+
POST: "POST";
|
|
24
|
+
HEAD: "HEAD";
|
|
25
|
+
}>;
|
|
26
|
+
headers: import("zod").ZodArray<import("zod").ZodObject<{
|
|
27
|
+
name: import("zod").ZodString;
|
|
28
|
+
value: import("zod").ZodString;
|
|
29
|
+
}, import("zod/v4/core").$strip>>;
|
|
30
|
+
body: import("zod").ZodOptional<import("zod").ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
31
|
+
maxResponseBytes: import("zod").ZodOptional<import("zod").ZodBigInt>;
|
|
32
|
+
transform: import("zod").ZodOptional<import("zod").ZodString>;
|
|
33
|
+
isReplicated: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
34
|
+
}, import("zod/v4/core").$strip>;
|
|
35
|
+
/**
|
|
36
|
+
* @see HttpRequestResult
|
|
37
|
+
*/
|
|
38
|
+
export declare const HttpRequestResultSchema: import("zod").ZodObject<{
|
|
39
|
+
status: import("zod").ZodBigInt;
|
|
40
|
+
headers: import("zod").ZodArray<import("zod").ZodObject<{
|
|
41
|
+
name: import("zod").ZodString;
|
|
42
|
+
value: import("zod").ZodString;
|
|
43
|
+
}, import("zod/v4/core").$strip>>;
|
|
44
|
+
body: import("zod").ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
|
|
45
|
+
}, import("zod/v4/core").$strip>;
|
|
46
|
+
/**
|
|
47
|
+
* @see TransformArgs
|
|
48
|
+
*/
|
|
49
|
+
export declare const TransformArgsSchema: import("zod").ZodObject<{
|
|
50
|
+
response: import("zod").ZodObject<{
|
|
51
|
+
status: import("zod").ZodBigInt;
|
|
52
|
+
headers: import("zod").ZodArray<import("zod").ZodObject<{
|
|
53
|
+
name: import("zod").ZodString;
|
|
54
|
+
value: import("zod").ZodString;
|
|
55
|
+
}, import("zod/v4/core").$strip>>;
|
|
56
|
+
body: import("zod").ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
|
|
57
|
+
}, import("zod/v4/core").$strip>;
|
|
58
|
+
context: import("zod").ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
|
|
59
|
+
}, import("zod/v4/core").$strip>;
|
|
60
|
+
/**
|
|
61
|
+
* An HTTP header consisting of a name and value.
|
|
62
|
+
*/
|
|
63
|
+
export interface HttpHeader {
|
|
64
|
+
/**
|
|
65
|
+
* The header name.
|
|
66
|
+
*/
|
|
67
|
+
name: string;
|
|
68
|
+
/**
|
|
69
|
+
* The header value.
|
|
70
|
+
*/
|
|
71
|
+
value: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The HTTP method for the request.
|
|
75
|
+
*/
|
|
76
|
+
export type HttpMethod = 'GET' | 'POST' | 'HEAD';
|
|
77
|
+
/**
|
|
78
|
+
* The arguments for an HTTP request.
|
|
79
|
+
*/
|
|
80
|
+
export interface HttpRequestArgs {
|
|
81
|
+
/**
|
|
82
|
+
* The requested URL.
|
|
83
|
+
*/
|
|
84
|
+
url: string;
|
|
85
|
+
/**
|
|
86
|
+
* The HTTP method.
|
|
87
|
+
*/
|
|
88
|
+
method: HttpMethod;
|
|
89
|
+
/**
|
|
90
|
+
* List of HTTP request headers and their corresponding values.
|
|
91
|
+
*/
|
|
92
|
+
headers: HttpHeader[];
|
|
93
|
+
/**
|
|
94
|
+
* Optionally provide request body.
|
|
95
|
+
*/
|
|
96
|
+
body?: Uint8Array<ArrayBuffer>;
|
|
97
|
+
/**
|
|
98
|
+
* The maximal size of the response in bytes.
|
|
99
|
+
*/
|
|
100
|
+
maxResponseBytes?: bigint;
|
|
101
|
+
/**
|
|
102
|
+
* The name of a query function used to transform the response before consensus - for example, to trim headers.
|
|
103
|
+
* If provided, a corresponding query must be declared using {@link defineQuery}.
|
|
104
|
+
*/
|
|
105
|
+
transform?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Whether all nodes should perform the request and agree on the response, or just one node.
|
|
108
|
+
* Using a single node is cheaper but the response is not verified by others - suitable when you trust the data source or consistency is not critical.
|
|
109
|
+
* Defaults to all nodes if not specified.
|
|
110
|
+
*/
|
|
111
|
+
isReplicated?: boolean;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The result of an HTTP request.
|
|
115
|
+
*/
|
|
116
|
+
export interface HttpRequestResult {
|
|
117
|
+
/**
|
|
118
|
+
* The response status (e.g. 200, 404).
|
|
119
|
+
*/
|
|
120
|
+
status: bigint;
|
|
121
|
+
/**
|
|
122
|
+
* List of HTTP response headers and their corresponding values.
|
|
123
|
+
*/
|
|
124
|
+
headers: HttpHeader[];
|
|
125
|
+
/**
|
|
126
|
+
* The response's body.
|
|
127
|
+
*/
|
|
128
|
+
body: Uint8Array<ArrayBuffer>;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The arguments passed to an HTTP response transform function.
|
|
132
|
+
*/
|
|
133
|
+
export interface TransformArgs {
|
|
134
|
+
/**
|
|
135
|
+
* The raw HTTP response to be transformed.
|
|
136
|
+
*/
|
|
137
|
+
response: HttpRequestResult;
|
|
138
|
+
/**
|
|
139
|
+
* Context for response transformation
|
|
140
|
+
*/
|
|
141
|
+
context: Uint8Array<ArrayBuffer>;
|
|
142
|
+
}
|
package/ic-cdk.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './ic-cdk/call.ic-cdk';
|
|
2
2
|
export * from './ic-cdk/caller.ic-cdk';
|
|
3
|
+
export * from './ic-cdk/http-request.ic-cdk';
|
|
3
4
|
export * from './ic-cdk/id.ic-cdk';
|
|
4
5
|
export * from './ic-cdk/schemas/call';
|
|
6
|
+
export * from './ic-cdk/schemas/http-request';
|
|
5
7
|
export * from './ic-cdk/time.ic-cdk';
|
|
6
8
|
export * from './ic-cdk/types/errors';
|
package/ic-cdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as H,b as y,c as R,d as A,e as g,f as h,g as _}from"./chunk-YHNBR22R.js";import"./chunk-JU5CZHLY.js";import"./chunk-4C666HHU.js";import{Principal as m}from"@icp-sdk/core/principal";var l=()=>m.fromUint8Array(__ic_cdk_caller()),q=()=>l();import{convertCamelToSnake as f,nonNullish as x}from"@junobuild/utils";import{j as t}from"@junobuild/schema";var s=t.object({name:t.string(),value:t.string()}),u=t.enum(["GET","POST","HEAD"]),n=t.object({url:t.url(),method:u,headers:t.array(s),body:t.uint8Array().optional(),maxResponseBytes:t.bigint().optional(),transform:t.string().optional(),isReplicated:t.boolean().optional()}),r=t.object({status:t.nat(),headers:t.array(s),body:t.uint8Array()}),T=t.object({response:r,context:t.uint8Array()});var U=async e=>{n.parse(e);let{transform:o,...a}=e,i={...a,...x(o)&&{transform:`app_${f(o)}`}},c=await __ic_cdk_http_request(i);return r.parse(c)};import{Principal as d}from"@icp-sdk/core/principal";var p=()=>d.fromUint8Array(__ic_cdk_id()),M=()=>p(),C=()=>p();var G=()=>__ic_cdk_time();export{y as CallArgSchema,R as CallArgsSchema,g as CallParamsSchema,h as CallResponseLengthError,A as CallResultSchema,s as HttpHeaderSchema,u as HttpMethodSchema,n as HttpRequestArgsSchema,r as HttpRequestResultSchema,H as IDLTypeSchema,T as TransformArgsSchema,_ as call,q as caller,p as canisterSelf,U as httpRequest,M as id,l as msgCaller,C as satelliteSelf,G as time};
|
|
2
2
|
//# sourceMappingURL=ic-cdk.js.map
|
package/ic-cdk.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["src/ic-cdk/caller.ic-cdk.ts", "src/ic-cdk/id.ic-cdk.ts", "src/ic-cdk/time.ic-cdk.ts"],
|
|
4
|
-
"sourcesContent": ["import {Principal} from '@icp-sdk/core/principal';\n\n/**\n * Retrieves the caller's Principal ID.\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::api::msg_caller()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.msg_caller.html), which returns\n * the Principal of the caller of the current call.\n *\n * @returns {Principal} The Principal ID of the caller.\n */\nexport const msgCaller = (): Principal => {\n const principal = Principal.fromUint8Array(__ic_cdk_caller());\n\n return principal;\n};\n\n/**\n * @deprecated Use {@link msgCaller} instead.\n */\nexport const caller = (): Principal => msgCaller();\n", "import {Principal} from '@icp-sdk/core/principal';\n\n/**\n * Retrieves the Satellite's Principal ID.\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::api::canister_self()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.canister_self.html), which returns\n * the Principal of the executing canister.\n *\n * @returns {Principal} The Principal ID of the Satellite.\n */\nexport const canisterSelf = (): Principal => {\n const principal = Principal.fromUint8Array(__ic_cdk_id());\n\n // We assume the Principal is always built using the global function and is therefore always valid.\n // In other words, we do not validate it to conserve resources and optimize performance.\n\n return principal;\n};\n\n/**\n * @deprecated Use {@link canisterSelf} instead.\n */\nexport const id = (): Principal => canisterSelf();\n\n/**\n * Retrieves the Satellite's Principal ID.\n *\n * @returns {Principal} The Principal ID of the Satellite.\n */\nexport const satelliteSelf = (): Principal => canisterSelf();\n", "/**\n * Gets current timestamp, in nanoseconds since the epoch (1970-01-01)\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::time()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.time.html), which returns\n * the system time publicly exposed and verified part of the IC state tree\n *\n * @returns {bigint} The current timestamp.\n */\nexport const time = (): bigint => __ic_cdk_time();\n"],
|
|
5
|
-
"mappings": "0IAAA,OAAQ,aAAAA,MAAgB,0BAWjB,IAAMC,EAAY,IACLD,EAAU,eAAe,gBAAgB,CAAC,EAQjDE,EAAS,IAAiBD,EAAU,ECpBjD,OAAQ,aAAAE,MAAgB,0BAWjB,IAAMC,EAAe,IACRD,EAAU,eAAe,YAAY,CAAC,EAW7CE,EAAK,IAAiBD,EAAa,EAOnCE,EAAgB,IAAiBF,EAAa,ECrBpD,IAAMG,EAAO,IAAc,cAAc",
|
|
6
|
-
"names": ["Principal", "msgCaller", "caller", "Principal", "canisterSelf", "id", "satelliteSelf", "time"]
|
|
3
|
+
"sources": ["src/ic-cdk/caller.ic-cdk.ts", "src/ic-cdk/http-request.ic-cdk.ts", "src/ic-cdk/schemas/http-request.ts", "src/ic-cdk/id.ic-cdk.ts", "src/ic-cdk/time.ic-cdk.ts"],
|
|
4
|
+
"sourcesContent": ["import {Principal} from '@icp-sdk/core/principal';\n\n/**\n * Retrieves the caller's Principal ID.\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::api::msg_caller()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.msg_caller.html), which returns\n * the Principal of the caller of the current call.\n *\n * @returns {Principal} The Principal ID of the caller.\n */\nexport const msgCaller = (): Principal => {\n const principal = Principal.fromUint8Array(__ic_cdk_caller());\n\n return principal;\n};\n\n/**\n * @deprecated Use {@link msgCaller} instead.\n */\nexport const caller = (): Principal => msgCaller();\n", "import {convertCamelToSnake, nonNullish} from '@junobuild/utils';\nimport {\n type HttpRequestArgs,\n type HttpRequestResult,\n HttpRequestArgsSchema,\n HttpRequestResultSchema\n} from './schemas/http-request';\n\n/**\n * Performs an HTTP request from a Juno serverless function.\n *\n * @param {HttpRequestArgs} args - The HTTP request parameters\n * @returns {Promise<HttpRequestResult>} A promise resolving to the HTTP response.\n * @throws {ZodError} If the provided arguments do not match the expected schema.\n * @throws {Error} If the HTTP request fails.\n */\nexport const httpRequest = async (args: HttpRequestArgs): Promise<HttpRequestResult> => {\n HttpRequestArgsSchema.parse(args);\n\n const {transform, ...rest} = args;\n\n const normalizedArgs = {\n ...rest,\n // TODO: app_ duplicates functions-tools BACKEND_FUNCTION_NAMESPACE constants\n ...(nonNullish(transform) && {transform: `app_${convertCamelToSnake(transform)}`})\n };\n\n const result = await __ic_cdk_http_request(normalizedArgs);\n\n return HttpRequestResultSchema.parse(result);\n};\n", "import {j} from '@junobuild/schema';\n\n/**\n * @see HttpHeader\n */\nexport const HttpHeaderSchema = j.object({\n name: j.string(),\n value: j.string()\n});\n\n/**\n * @see HttpMethod\n */\nexport const HttpMethodSchema = j.enum(['GET', 'POST', 'HEAD']);\n\n/**\n * @see HttpRequestArgs\n */\nexport const HttpRequestArgsSchema = j.object({\n url: j.url(),\n method: HttpMethodSchema,\n headers: j.array(HttpHeaderSchema),\n body: j.uint8Array().optional(),\n maxResponseBytes: j.bigint().optional(),\n transform: j.string().optional(),\n isReplicated: j.boolean().optional()\n});\n\n/**\n * @see HttpRequestResult\n */\nexport const HttpRequestResultSchema = j.object({\n status: j.nat(),\n headers: j.array(HttpHeaderSchema),\n body: j.uint8Array()\n});\n\n/**\n * @see TransformArgs\n */\nexport const TransformArgsSchema = j.object({\n response: HttpRequestResultSchema,\n context: j.uint8Array()\n});\n\n/**\n * An HTTP header consisting of a name and value.\n */\nexport interface HttpHeader {\n /**\n * The header name.\n */\n name: string;\n\n /**\n * The header value.\n */\n value: string;\n}\n\n/**\n * The HTTP method for the request.\n */\nexport type HttpMethod = 'GET' | 'POST' | 'HEAD';\n\n/**\n * The arguments for an HTTP request.\n */\nexport interface HttpRequestArgs {\n /**\n * The requested URL.\n */\n url: string;\n\n /**\n * The HTTP method.\n */\n method: HttpMethod;\n\n /**\n * List of HTTP request headers and their corresponding values.\n */\n headers: HttpHeader[];\n\n /**\n * Optionally provide request body.\n */\n body?: Uint8Array<ArrayBuffer>;\n\n /**\n * The maximal size of the response in bytes.\n */\n maxResponseBytes?: bigint;\n\n /**\n * The name of a query function used to transform the response before consensus - for example, to trim headers.\n * If provided, a corresponding query must be declared using {@link defineQuery}.\n */\n transform?: string;\n\n /**\n * Whether all nodes should perform the request and agree on the response, or just one node.\n * Using a single node is cheaper but the response is not verified by others - suitable when you trust the data source or consistency is not critical.\n * Defaults to all nodes if not specified.\n */\n isReplicated?: boolean;\n}\n\n/**\n * The result of an HTTP request.\n */\nexport interface HttpRequestResult {\n /**\n * The response status (e.g. 200, 404).\n */\n status: bigint;\n\n /**\n * List of HTTP response headers and their corresponding values.\n */\n headers: HttpHeader[];\n\n /**\n * The response's body.\n */\n body: Uint8Array<ArrayBuffer>;\n}\n\n/**\n * The arguments passed to an HTTP response transform function.\n */\nexport interface TransformArgs {\n /**\n * The raw HTTP response to be transformed.\n */\n response: HttpRequestResult;\n\n /**\n * Context for response transformation\n */\n context: Uint8Array<ArrayBuffer>;\n}\n", "import {Principal} from '@icp-sdk/core/principal';\n\n/**\n * Retrieves the Satellite's Principal ID.\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::api::canister_self()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.canister_self.html), which returns\n * the Principal of the executing canister.\n *\n * @returns {Principal} The Principal ID of the Satellite.\n */\nexport const canisterSelf = (): Principal => {\n const principal = Principal.fromUint8Array(__ic_cdk_id());\n\n // We assume the Principal is always built using the global function and is therefore always valid.\n // In other words, we do not validate it to conserve resources and optimize performance.\n\n return principal;\n};\n\n/**\n * @deprecated Use {@link canisterSelf} instead.\n */\nexport const id = (): Principal => canisterSelf();\n\n/**\n * Retrieves the Satellite's Principal ID.\n *\n * @returns {Principal} The Principal ID of the Satellite.\n */\nexport const satelliteSelf = (): Principal => canisterSelf();\n", "/**\n * Gets current timestamp, in nanoseconds since the epoch (1970-01-01)\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::time()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.time.html), which returns\n * the system time publicly exposed and verified part of the IC state tree\n *\n * @returns {bigint} The current timestamp.\n */\nexport const time = (): bigint => __ic_cdk_time();\n"],
|
|
5
|
+
"mappings": "0IAAA,OAAQ,aAAAA,MAAgB,0BAWjB,IAAMC,EAAY,IACLD,EAAU,eAAe,gBAAgB,CAAC,EAQjDE,EAAS,IAAiBD,EAAU,ECpBjD,OAAQ,uBAAAE,EAAqB,cAAAC,MAAiB,mBCA9C,OAAQ,KAAAC,MAAQ,oBAKT,IAAMC,EAAmBD,EAAE,OAAO,CACvC,KAAMA,EAAE,OAAO,EACf,MAAOA,EAAE,OAAO,CAClB,CAAC,EAKYE,EAAmBF,EAAE,KAAK,CAAC,MAAO,OAAQ,MAAM,CAAC,EAKjDG,EAAwBH,EAAE,OAAO,CAC5C,IAAKA,EAAE,IAAI,EACX,OAAQE,EACR,QAASF,EAAE,MAAMC,CAAgB,EACjC,KAAMD,EAAE,WAAW,EAAE,SAAS,EAC9B,iBAAkBA,EAAE,OAAO,EAAE,SAAS,EACtC,UAAWA,EAAE,OAAO,EAAE,SAAS,EAC/B,aAAcA,EAAE,QAAQ,EAAE,SAAS,CACrC,CAAC,EAKYI,EAA0BJ,EAAE,OAAO,CAC9C,OAAQA,EAAE,IAAI,EACd,QAASA,EAAE,MAAMC,CAAgB,EACjC,KAAMD,EAAE,WAAW,CACrB,CAAC,EAKYK,EAAsBL,EAAE,OAAO,CAC1C,SAAUI,EACV,QAASJ,EAAE,WAAW,CACxB,CAAC,ED3BM,IAAMM,EAAc,MAAOC,GAAsD,CACtFC,EAAsB,MAAMD,CAAI,EAEhC,GAAM,CAAC,UAAAE,EAAW,GAAGC,CAAI,EAAIH,EAEvBI,EAAiB,CACrB,GAAGD,EAEH,GAAIE,EAAWH,CAAS,GAAK,CAAC,UAAW,OAAOI,EAAoBJ,CAAS,CAAC,EAAE,CAClF,EAEMK,EAAS,MAAM,sBAAsBH,CAAc,EAEzD,OAAOI,EAAwB,MAAMD,CAAM,CAC7C,EE9BA,OAAQ,aAAAE,MAAgB,0BAWjB,IAAMC,EAAe,IACRD,EAAU,eAAe,YAAY,CAAC,EAW7CE,EAAK,IAAiBD,EAAa,EAOnCE,EAAgB,IAAiBF,EAAa,ECrBpD,IAAMG,EAAO,IAAc,cAAc",
|
|
6
|
+
"names": ["Principal", "msgCaller", "caller", "convertCamelToSnake", "nonNullish", "j", "HttpHeaderSchema", "HttpMethodSchema", "HttpRequestArgsSchema", "HttpRequestResultSchema", "TransformArgsSchema", "httpRequest", "args", "HttpRequestArgsSchema", "transform", "rest", "normalizedArgs", "nonNullish", "convertCamelToSnake", "result", "HttpRequestResultSchema", "Principal", "canisterSelf", "id", "satelliteSelf", "time"]
|
|
7
7
|
}
|
package/index.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ export * from './hooks/schemas/db/context';
|
|
|
9
9
|
export * from './hooks/schemas/db/payload';
|
|
10
10
|
export * from './hooks/schemas/storage/context';
|
|
11
11
|
export * from './hooks/schemas/storage/payload';
|
|
12
|
-
export * from './schemas/candid';
|
|
13
12
|
export * from './schemas/db';
|
|
14
13
|
export * from './schemas/list';
|
|
14
|
+
export * from './schemas/principal';
|
|
15
15
|
export * from './schemas/satellite';
|
|
16
16
|
export * from './schemas/satellite.env';
|
|
17
17
|
export * from './schemas/storage';
|