@junobuild/functions 0.5.5 → 0.5.6

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 CHANGED
@@ -270,9 +270,9 @@ The raw user ID as a `Uint8Array`.
270
270
 
271
271
  Gets the list of admin controllers from the Satellite.
272
272
 
273
- | Function | Type |
274
- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
275
- | `getAdminControllers` | `() => [Uint8Array<ArrayBufferLike>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; }][]` |
273
+ | Function | Type |
274
+ | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
275
+ | `getAdminControllers` | `() => [Uint8Array<ArrayBufferLike>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` |
276
276
 
277
277
  Returns:
278
278
 
@@ -284,9 +284,9 @@ The list of admin controllers.
284
284
 
285
285
  Gets the list of controllers from the Satellite.
286
286
 
287
- | Function | Type |
288
- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
289
- | `getControllers` | `() => [Uint8Array<ArrayBufferLike>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; }][]` |
287
+ | Function | Type |
288
+ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
289
+ | `getControllers` | `() => [Uint8Array<ArrayBufferLike>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` |
290
290
 
291
291
  Returns:
292
292
 
@@ -811,6 +811,7 @@ The current timestamp.
811
811
  - [ListOrderSchema](#gear-listorderschema)
812
812
  - [ListParamsSchema](#gear-listparamsschema)
813
813
  - [ControllerScopeSchema](#gear-controllerscopeschema)
814
+ - [ControllerKindSchema](#gear-controllerkindschema)
814
815
  - [MetadataSchema](#gear-metadataschema)
815
816
  - [ControllerSchema](#gear-controllerschema)
816
817
  - [ControllerRecordSchema](#gear-controllerrecordschema)
@@ -1641,10 +1642,22 @@ References:
1641
1642
 
1642
1643
  References:
1643
1644
 
1644
- - ControllerScopeSchema
1645
+ - ControllerScope
1645
1646
 
1646
1647
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L15)
1647
1648
 
1649
+ #### :gear: ControllerKindSchema
1650
+
1651
+ | Constant | Type |
1652
+ | ---------------------- | -------------------------------------------------------------- |
1653
+ | `ControllerKindSchema` | `ZodEnum<{ automation: "automation"; emulator: "emulator"; }>` |
1654
+
1655
+ References:
1656
+
1657
+ - ControllerKind
1658
+
1659
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L25)
1660
+
1648
1661
  #### :gear: MetadataSchema
1649
1662
 
1650
1663
  | Constant | Type |
@@ -1655,43 +1668,43 @@ References:
1655
1668
 
1656
1669
  - MetadataSchema
1657
1670
 
1658
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L25)
1671
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L35)
1659
1672
 
1660
1673
  #### :gear: ControllerSchema
1661
1674
 
1662
- | Constant | Type |
1663
- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1664
- | `ControllerSchema` | `ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; created_at: ZodBigInt; updated_at: ZodBigInt; expires_at: ZodOptional<...>; scope: ZodEnum<...>; }, $strict>` |
1675
+ | Constant | Type |
1676
+ | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1677
+ | `ControllerSchema` | `ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; created_at: ZodBigInt; updated_at: ZodBigInt; expires_at: ZodOptional<...>; scope: ZodEnum<...>; kind: ZodOptional<...>; }, $strict>` |
1665
1678
 
1666
1679
  References:
1667
1680
 
1668
1681
  - ControllerSchema
1669
1682
 
1670
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L35)
1683
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L45)
1671
1684
 
1672
1685
  #### :gear: ControllerRecordSchema
1673
1686
 
1674
- | Constant | Type |
1675
- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1676
- | `ControllerRecordSchema` | `ZodTuple<[ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; created_at: ZodBigInt; updated_at: ZodBigInt; expires_at: ZodOptional<...>; scope: ZodEnum<...>; }, $strict>], null>` |
1687
+ | Constant | Type |
1688
+ | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1689
+ | `ControllerRecordSchema` | `ZodTuple<[ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; ... 4 more ...; kind: ZodOptional<...>; }, $strict>], null>` |
1677
1690
 
1678
1691
  References:
1679
1692
 
1680
1693
  - ControllerRecordSchema
1681
1694
 
1682
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L79)
1695
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L94)
1683
1696
 
1684
1697
  #### :gear: ControllersSchema
1685
1698
 
1686
- | Constant | Type |
1687
- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1688
- | `ControllersSchema` | `ZodArray<ZodTuple<[ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; created_at: ZodBigInt; updated_at: ZodBigInt; expires_at: ZodOptional<...>; scope: ZodEnum<...>; }, $strict>], null>>` |
1699
+ | Constant | Type |
1700
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1701
+ | `ControllersSchema` | `ZodArray<ZodTuple<[ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, ZodObject<{ metadata: ZodArray<ZodTuple<[ZodString, ZodString], null>>; ... 4 more ...; kind: ZodOptional<...>; }, $strict>], null>>` |
1689
1702
 
1690
1703
  References:
1691
1704
 
1692
1705
  - ControllersSchema
1693
1706
 
1694
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L89)
1707
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L104)
1695
1708
 
1696
1709
  #### :gear: ControllerCheckParamsSchema
1697
1710
 
@@ -1703,7 +1716,7 @@ References:
1703
1716
 
1704
1717
  - ControllerCheckParamsSchema
1705
1718
 
1706
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L99)
1719
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L114)
1707
1720
 
1708
1721
  #### :gear: CollectionParamsSchema
1709
1722
 
@@ -2311,26 +2324,27 @@ List results, parameterized by type of returned item.
2311
2324
 
2312
2325
  Represents a controller with access scope and associated metadata.
2313
2326
 
2314
- | Property | Type | Description |
2315
- | ------------ | -------------------------------- | -------------------------------------------------------------------------------------------------- |
2316
- | `metadata` | `[string, string][]` | A list of key-value metadata pairs associated with the controller. |
2317
- | `created_at` | `bigint` | The timestamp when the controller was created. |
2318
- | `updated_at` | `bigint` | The timestamp when the controller was last updated. |
2319
- | `expires_at` | `bigint or undefined` | Optional expiration timestamp for the controller. 👉 It's a placeholder for future implementation. |
2320
- | `scope` | `"write" or "admin" or "submit"` | The scope assigned to the controller. |
2327
+ | Property | Type | Description |
2328
+ | ------------ | ----------------------------------------- | ------------------------------------------------------------------ |
2329
+ | `metadata` | `[string, string][]` | A list of key-value metadata pairs associated with the controller. |
2330
+ | `created_at` | `bigint` | The timestamp when the controller was created. |
2331
+ | `updated_at` | `bigint` | The timestamp when the controller was last updated. |
2332
+ | `expires_at` | `bigint or undefined` | Optional expiration timestamp for the controller. |
2333
+ | `scope` | `"write" or "admin" or "submit"` | The scope assigned to the controller. |
2334
+ | `kind` | `"automation" or "emulator" or undefined` | An optional kind identifier of the controller. |
2321
2335
 
2322
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L48)
2336
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L59)
2323
2337
 
2324
2338
  #### :gear: ControllerCheckParams
2325
2339
 
2326
2340
  Represents the parameters required to perform controller checks.
2327
2341
 
2328
- | Property | Type | Description |
2329
- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
2330
- | `caller` | `any` | The identity of the caller to verify against the controller list. |
2331
- | `controllers` | `[Uint8Array<ArrayBufferLike>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; }][]` | The list of controllers to check against. |
2342
+ | Property | Type | Description |
2343
+ | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
2344
+ | `caller` | `any` | The identity of the caller to verify against the controller list. |
2345
+ | `controllers` | `[Uint8Array<ArrayBufferLike>, { metadata: [string, string][]; created_at: bigint; updated_at: bigint; scope: "write" or "admin" or "submit"; expires_at?: bigint or undefined; kind?: "automation" or ... 1 more ... or undefined; }][]` | The list of controllers to check against. |
2332
2346
 
2333
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L107)
2347
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L122)
2334
2348
 
2335
2349
  #### :gear: CollectionParams
2336
2350
 
@@ -2446,6 +2460,7 @@ Type representing the parameters required to make a canister call.
2446
2460
  - [TimestampMatcher](#gear-timestampmatcher)
2447
2461
  - [ListOrderField](#gear-listorderfield)
2448
2462
  - [ControllerScope](#gear-controllerscope)
2463
+ - [ControllerKind](#gear-controllerkind)
2449
2464
  - [Metadata](#gear-metadata)
2450
2465
  - [ControllerRecord](#gear-controllerrecord)
2451
2466
  - [Controllers](#gear-controllers)
@@ -3175,6 +3190,16 @@ Represents the permission scope of a controller.
3175
3190
 
3176
3191
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L20)
3177
3192
 
3193
+ #### :gear: ControllerKind
3194
+
3195
+ Represents a specific kind of controller. Meant for informational purposes.
3196
+
3197
+ | Type | Type |
3198
+ | ---------------- | -------------------------------------- |
3199
+ | `ControllerKind` | `z.infer<typeof ControllerKindSchema>` |
3200
+
3201
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L30)
3202
+
3178
3203
  #### :gear: Metadata
3179
3204
 
3180
3205
  Represents a single metadata entry as a key-value tuple.
@@ -3183,7 +3208,7 @@ Represents a single metadata entry as a key-value tuple.
3183
3208
  | ---------- | -------------------------------- |
3184
3209
  | `Metadata` | `z.infer<typeof MetadataSchema>` |
3185
3210
 
3186
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L30)
3211
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L40)
3187
3212
 
3188
3213
  #### :gear: ControllerRecord
3189
3214
 
@@ -3193,7 +3218,7 @@ Represents a tuple containing the principal ID and associated controller data.
3193
3218
  | ------------------ | ---------------------------------------- |
3194
3219
  | `ControllerRecord` | `z.infer<typeof ControllerRecordSchema>` |
3195
3220
 
3196
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L84)
3221
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L99)
3197
3222
 
3198
3223
  #### :gear: Controllers
3199
3224
 
@@ -3203,7 +3228,7 @@ Represents a list of controllers.
3203
3228
  | ------------- | ----------------------------------- |
3204
3229
  | `Controllers` | `z.infer<typeof ControllersSchema>` |
3205
3230
 
3206
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L94)
3231
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/functions/src/sdk/schemas/controllers.ts#L109)
3207
3232
 
3208
3233
  #### :gear: ListStoreParams
3209
3234
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/functions",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "JavaScript and TypeScript utilities for Juno Serverless Functions",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  import * as z from 'zod';
2
2
  import { type RawUserId, type Timestamp, type UserId } from '../../schemas/satellite';
3
3
  /**
4
- * @see ControllerScopeSchema
4
+ * @see ControllerScope
5
5
  */
6
6
  export declare const ControllerScopeSchema: z.ZodEnum<{
7
7
  write: "write";
@@ -12,6 +12,17 @@ export declare const ControllerScopeSchema: z.ZodEnum<{
12
12
  * Represents the permission scope of a controller.
13
13
  */
14
14
  export type ControllerScope = z.infer<typeof ControllerScopeSchema>;
15
+ /**
16
+ * @see ControllerKind
17
+ */
18
+ export declare const ControllerKindSchema: z.ZodEnum<{
19
+ automation: "automation";
20
+ emulator: "emulator";
21
+ }>;
22
+ /**
23
+ * Represents a specific kind of controller. Meant for informational purposes.
24
+ */
25
+ export type ControllerKind = z.infer<typeof ControllerKindSchema>;
15
26
  /**
16
27
  * @see MetadataSchema
17
28
  */
@@ -33,6 +44,10 @@ export declare const ControllerSchema: z.ZodObject<{
33
44
  admin: "admin";
34
45
  submit: "submit";
35
46
  }>;
47
+ kind: z.ZodOptional<z.ZodEnum<{
48
+ automation: "automation";
49
+ emulator: "emulator";
50
+ }>>;
36
51
  }, z.core.$strict>;
37
52
  /**
38
53
  * Represents a controller with access scope and associated metadata.
@@ -52,13 +67,16 @@ export interface Controller {
52
67
  updated_at: Timestamp;
53
68
  /**
54
69
  * Optional expiration timestamp for the controller.
55
- * 👉 It's a placeholder for future implementation.
56
70
  */
57
71
  expires_at?: Timestamp;
58
72
  /**
59
73
  * The scope assigned to the controller.
60
74
  */
61
75
  scope: ControllerScope;
76
+ /**
77
+ * An optional kind identifier of the controller.
78
+ */
79
+ kind?: ControllerKind;
62
80
  }
63
81
  /**
64
82
  * @see ControllerRecordSchema
@@ -73,6 +91,10 @@ export declare const ControllerRecordSchema: z.ZodTuple<[z.ZodCustom<Uint8Array<
73
91
  admin: "admin";
74
92
  submit: "submit";
75
93
  }>;
94
+ kind: z.ZodOptional<z.ZodEnum<{
95
+ automation: "automation";
96
+ emulator: "emulator";
97
+ }>>;
76
98
  }, z.core.$strict>], null>;
77
99
  /**
78
100
  * Represents a tuple containing the principal ID and associated controller data.
@@ -91,6 +113,10 @@ export declare const ControllersSchema: z.ZodArray<z.ZodTuple<[z.ZodCustom<Uint8
91
113
  admin: "admin";
92
114
  submit: "submit";
93
115
  }>;
116
+ kind: z.ZodOptional<z.ZodEnum<{
117
+ automation: "automation";
118
+ emulator: "emulator";
119
+ }>>;
94
120
  }, z.core.$strict>], null>>;
95
121
  /**
96
122
  * Represents a list of controllers.
@@ -111,6 +137,10 @@ export declare const ControllerCheckParamsSchema: z.ZodObject<{
111
137
  admin: "admin";
112
138
  submit: "submit";
113
139
  }>;
140
+ kind: z.ZodOptional<z.ZodEnum<{
141
+ automation: "automation";
142
+ emulator: "emulator";
143
+ }>>;
114
144
  }, z.core.$strict>], null>>;
115
145
  }, z.core.$strip>;
116
146
  /**
package/sdk.js CHANGED
@@ -1,2 +1,2 @@
1
- import{C as I,a as _,c as n,d as m,e as y,f as D,k as x,l as u,m as A,n as f,o as k,p as g,u as U,v as j}from"./chunk-KVADXJMF.js";import{b as C}from"./chunk-7B6WU32N.js";import"./chunk-4C666HHU.js";import*as l from"zod";var V=l.enum(["write","admin","submit"]),W=l.tuple([l.string(),l.string()]),X=l.object({metadata:l.array(W),created_at:_,updated_at:_,expires_at:_.optional(),scope:V}).strict(),Y=l.tuple([C,X]),Z=l.array(Y),h=l.object({caller:n.or(m),controllers:Z});import{Principal as $}from"@icp-sdk/core/principal";var a=e=>$.from(e).toUint8Array();var me=()=>__juno_satellite_get_admin_controllers(),ie=()=>__juno_satellite_get_controllers(),pe=e=>{h.parse(e);let{caller:t,controllers:o}=e,r=a(t);return __juno_satellite_is_admin_controller(r,o)},Se=e=>{h.parse(e);let{caller:t,controllers:o}=e,r=a(t);return __juno_satellite_is_controller(r,o)};import*as L from"zod";var c=L.object({collection:y}).strict(),i=c.extend({caller:n.or(m),params:I}).strict();var d=c.extend({caller:n.or(m),key:D}).strict(),R=d.extend({doc:x}).strict(),z=d.extend({doc:u}).strict(),b=c,w=i,v=i,G=c,F=i;var fe=e=>{R.parse(e);let{caller:t,collection:o,key:r,doc:s}=e,p=a(t);return __juno_satellite_datastore_set_doc_store(p,o,r,s)},ke=e=>{z.parse(e);let{caller:t,collection:o,key:r,doc:s}=e,p=a(t);return __juno_satellite_datastore_delete_doc_store(p,o,r,s)},ge=e=>{d.parse(e);let{caller:t,collection:o,key:r}=e,s=a(t);return __juno_satellite_datastore_get_doc_store(s,o,r)},Ue=e=>{v.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_datastore_list_docs_store(s,o,r)},je=e=>{b.parse(e);let{collection:t}=e;return __juno_satellite_datastore_count_collection_docs_store(t)},Ie=e=>{w.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_datastore_count_docs_store(s,o,r)},Le=e=>{G.parse(e);let{collection:t}=e;__juno_satellite_datastore_delete_docs_store(t)},Re=e=>{F.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_datastore_delete_filtered_docs_store(s,o,r)};import*as T from"zod";var M=T.enum(["heap","stable"]);import*as S from"zod";var P=c.extend({caller:n.or(m),full_path:U}).strict(),O=c,H=i,K=S.object({key:k,content:f,headers:A}).strict(),B=c,N=i,E=P,J=P.extend({token:j}),q=i,Q=S.object({encoding:g,chunk_index:S.bigint(),memory:M}).strict();import{jsonReplacer as ee,jsonReviver as te}from"@dfinity/utils";var Oe=e=>JSON.parse(__juno_satellite_datastore_raw_data_to_text(e),te),He=e=>__juno_satellite_datastore_raw_data_from_text(JSON.stringify(e,ee));var Ee=e=>{O.parse(e);let{collection:t}=e;return __juno_satellite_storage_count_collection_assets_store(t)},Je=e=>{H.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_storage_count_assets_store(s,o,r)},qe=e=>{K.parse(e);let{key:t,content:o,headers:r}=e;__juno_satellite_storage_set_asset_handler(t,o,r)},Qe=e=>{E.parse(e);let{caller:t,collection:o,full_path:r}=e,s=a(t);return __juno_satellite_storage_delete_asset_store(s,o,r)},Ve=e=>{B.parse(e);let{collection:t}=e;__juno_satellite_storage_delete_assets_store(t)},We=e=>{N.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_storage_delete_filtered_assets_store(s,o,r)},Xe=e=>{J.parse(e);let{caller:t,collection:o,full_path:r,token:s}=e,p=a(t);__juno_satellite_storage_set_asset_token_store(p,o,r,s)},Ye=e=>{P.parse(e);let{caller:t,collection:o,full_path:r}=e,s=a(t);return __juno_satellite_storage_get_asset_store(s,o,r)},Ze=e=>{q.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_storage_list_assets_store(s,o,r)},$e=e=>{Q.parse(e);let{encoding:t,chunk_index:o,memory:r}=e;return __juno_satellite_storage_get_content_chunks_store(t,o,r)};export{c as CollectionParamsSchema,h as ControllerCheckParamsSchema,Y as ControllerRecordSchema,X as ControllerSchema,V as ControllerScopeSchema,Z as ControllersSchema,H as CountAssetsStoreParamsSchema,O as CountCollectionAssetsStoreParamsSchema,b as CountCollectionDocsStoreParamsSchema,w as CountDocsStoreParamsSchema,E as DeleteAssetStoreParamsSchema,B as DeleteAssetsStoreParamsSchema,z as DeleteDocStoreParamsSchema,G as DeleteDocsStoreParamsSchema,N as DeleteFilteredAssetsStoreParamsSchema,F as DeleteFilteredDocsStoreParamsSchema,P as GetAssetStoreParamsSchema,Q as GetContentChunksStoreParamsSchema,d as GetDocStoreParamsSchema,q as ListAssetsStoreParamsSchema,v as ListDocsStoreParamsSchema,i as ListStoreParamsSchema,M as MemorySchema,W as MetadataSchema,K as SetAssetHandlerParamsSchema,J as SetAssetTokenStoreParamsSchema,R as SetDocStoreParamsSchema,Je as countAssetsStore,Ee as countCollectionAssetsStore,je as countCollectionDocsStore,Ie as countDocsStore,Oe as decodeDocData,Qe as deleteAssetStore,Ve as deleteAssetsStore,ke as deleteDocStore,Le as deleteDocsStore,We as deleteFilteredAssetsStore,Re as deleteFilteredDocsStore,He as encodeDocData,me as getAdminControllers,Ye as getAssetStore,$e as getContentChunksStore,ie as getControllers,ge as getDocStore,pe as isAdminController,Se as isController,Ze as listAssetsStore,Ue as listDocsStore,qe as setAssetHandler,Xe as setAssetTokenStore,fe as setDocStore};
1
+ import{C as z,a as _,c as n,d as m,e as y,f as x,k as D,l as u,m as A,n as f,o as k,p as g,u as U,v as j}from"./chunk-KVADXJMF.js";import{b as h}from"./chunk-7B6WU32N.js";import"./chunk-4C666HHU.js";import*as l from"zod";var V=l.enum(["write","admin","submit"]),W=l.enum(["automation","emulator"]),X=l.tuple([l.string(),l.string()]),Y=l.object({metadata:l.array(X),created_at:_,updated_at:_,expires_at:_.optional(),scope:V,kind:W.optional()}).strict(),Z=l.tuple([h,Y]),$=l.array(Z),C=l.object({caller:n.or(m),controllers:$});import{Principal as ee}from"@icp-sdk/core/principal";var a=e=>ee.from(e).toUint8Array();var ie=()=>__juno_satellite_get_admin_controllers(),pe=()=>__juno_satellite_get_controllers(),Se=e=>{C.parse(e);let{caller:t,controllers:o}=e,r=a(t);return __juno_satellite_is_admin_controller(r,o)},_e=e=>{C.parse(e);let{caller:t,controllers:o}=e,r=a(t);return __juno_satellite_is_controller(r,o)};import*as I from"zod";var c=I.object({collection:y}).strict(),i=c.extend({caller:n.or(m),params:z}).strict();var d=c.extend({caller:n.or(m),key:x}).strict(),L=d.extend({doc:D}).strict(),R=d.extend({doc:u}).strict(),b=c,w=i,v=i,G=c,F=i;var ke=e=>{L.parse(e);let{caller:t,collection:o,key:r,doc:s}=e,p=a(t);return __juno_satellite_datastore_set_doc_store(p,o,r,s)},ge=e=>{R.parse(e);let{caller:t,collection:o,key:r,doc:s}=e,p=a(t);return __juno_satellite_datastore_delete_doc_store(p,o,r,s)},Ue=e=>{d.parse(e);let{caller:t,collection:o,key:r}=e,s=a(t);return __juno_satellite_datastore_get_doc_store(s,o,r)},je=e=>{v.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_datastore_list_docs_store(s,o,r)},ze=e=>{b.parse(e);let{collection:t}=e;return __juno_satellite_datastore_count_collection_docs_store(t)},Ie=e=>{w.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_datastore_count_docs_store(s,o,r)},Le=e=>{G.parse(e);let{collection:t}=e;__juno_satellite_datastore_delete_docs_store(t)},Re=e=>{F.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_datastore_delete_filtered_docs_store(s,o,r)};import*as T from"zod";var K=T.enum(["heap","stable"]);import*as S from"zod";var P=c.extend({caller:n.or(m),full_path:U}).strict(),M=c,O=i,H=S.object({key:k,content:f,headers:A}).strict(),B=c,N=i,E=P,J=P.extend({token:j}),q=i,Q=S.object({encoding:g,chunk_index:S.bigint(),memory:K}).strict();import{jsonReplacer as te,jsonReviver as oe}from"@dfinity/utils";var Oe=e=>JSON.parse(__juno_satellite_datastore_raw_data_to_text(e),oe),He=e=>__juno_satellite_datastore_raw_data_from_text(JSON.stringify(e,te));var Je=e=>{M.parse(e);let{collection:t}=e;return __juno_satellite_storage_count_collection_assets_store(t)},qe=e=>{O.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_storage_count_assets_store(s,o,r)},Qe=e=>{H.parse(e);let{key:t,content:o,headers:r}=e;__juno_satellite_storage_set_asset_handler(t,o,r)},Ve=e=>{E.parse(e);let{caller:t,collection:o,full_path:r}=e,s=a(t);return __juno_satellite_storage_delete_asset_store(s,o,r)},We=e=>{B.parse(e);let{collection:t}=e;__juno_satellite_storage_delete_assets_store(t)},Xe=e=>{N.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_storage_delete_filtered_assets_store(s,o,r)},Ye=e=>{J.parse(e);let{caller:t,collection:o,full_path:r,token:s}=e,p=a(t);__juno_satellite_storage_set_asset_token_store(p,o,r,s)},Ze=e=>{P.parse(e);let{caller:t,collection:o,full_path:r}=e,s=a(t);return __juno_satellite_storage_get_asset_store(s,o,r)},$e=e=>{q.parse(e);let{caller:t,collection:o,params:r}=e,s=a(t);return __juno_satellite_storage_list_assets_store(s,o,r)},et=e=>{Q.parse(e);let{encoding:t,chunk_index:o,memory:r}=e;return __juno_satellite_storage_get_content_chunks_store(t,o,r)};export{c as CollectionParamsSchema,C as ControllerCheckParamsSchema,W as ControllerKindSchema,Z as ControllerRecordSchema,Y as ControllerSchema,V as ControllerScopeSchema,$ as ControllersSchema,O as CountAssetsStoreParamsSchema,M as CountCollectionAssetsStoreParamsSchema,b as CountCollectionDocsStoreParamsSchema,w as CountDocsStoreParamsSchema,E as DeleteAssetStoreParamsSchema,B as DeleteAssetsStoreParamsSchema,R as DeleteDocStoreParamsSchema,G as DeleteDocsStoreParamsSchema,N as DeleteFilteredAssetsStoreParamsSchema,F as DeleteFilteredDocsStoreParamsSchema,P as GetAssetStoreParamsSchema,Q as GetContentChunksStoreParamsSchema,d as GetDocStoreParamsSchema,q as ListAssetsStoreParamsSchema,v as ListDocsStoreParamsSchema,i as ListStoreParamsSchema,K as MemorySchema,X as MetadataSchema,H as SetAssetHandlerParamsSchema,J as SetAssetTokenStoreParamsSchema,L as SetDocStoreParamsSchema,qe as countAssetsStore,Je as countCollectionAssetsStore,ze as countCollectionDocsStore,Ie as countDocsStore,Oe as decodeDocData,Ve as deleteAssetStore,We as deleteAssetsStore,ge as deleteDocStore,Le as deleteDocsStore,Xe as deleteFilteredAssetsStore,Re as deleteFilteredDocsStore,He as encodeDocData,ie as getAdminControllers,Ze as getAssetStore,et as getContentChunksStore,pe as getControllers,Ue as getDocStore,Se as isAdminController,_e as isController,$e as listAssetsStore,je as listDocsStore,Qe as setAssetHandler,Ye as setAssetTokenStore,ke as setDocStore};
2
2
  //# sourceMappingURL=sdk.js.map
package/sdk.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["src/sdk/schemas/controllers.ts", "src/sdk/utils/caller.utils.ts", "src/sdk/controllers.sdk.ts", "src/sdk/schemas/params.ts", "src/sdk/schemas/db.ts", "src/sdk/db.sdk.ts", "src/sdk/schemas/collections.ts", "src/sdk/schemas/storage.ts", "src/sdk/serializer.sdk.ts", "src/sdk/storage.sdk.ts"],
4
- "sourcesContent": ["import * as z from 'zod';\nimport {RawPrincipalSchema} from '../../schemas/candid';\nimport {\n type RawUserId,\n type Timestamp,\n type UserId,\n RawUserIdSchema,\n TimestampSchema,\n UserIdSchema\n} from '../../schemas/satellite';\n\n/**\n * @see ControllerScopeSchema\n */\nexport const ControllerScopeSchema = z.enum(['write', 'admin', 'submit']);\n\n/**\n * Represents the permission scope of a controller.\n */\nexport type ControllerScope = z.infer<typeof ControllerScopeSchema>;\n\n/**\n * @see MetadataSchema\n */\nexport const MetadataSchema = z.tuple([z.string(), z.string()]);\n\n/**\n * Represents a single metadata entry as a key-value tuple.\n */\nexport type Metadata = z.infer<typeof MetadataSchema>;\n\n/**\n * @see ControllerSchema\n */\nexport const ControllerSchema = z\n .object({\n metadata: z.array(MetadataSchema),\n created_at: TimestampSchema,\n updated_at: TimestampSchema,\n expires_at: TimestampSchema.optional(),\n scope: ControllerScopeSchema\n })\n .strict();\n\n/**\n * Represents a controller with access scope and associated metadata.\n */\nexport interface Controller {\n /**\n * A list of key-value metadata pairs associated with the controller.\n */\n metadata: Metadata[];\n\n /**\n * The timestamp when the controller was created.\n */\n created_at: Timestamp;\n\n /**\n * The timestamp when the controller was last updated.\n */\n updated_at: Timestamp;\n\n /**\n * Optional expiration timestamp for the controller.\n * \uD83D\uDC49 It's a placeholder for future implementation.\n */\n expires_at?: Timestamp;\n\n /**\n * The scope assigned to the controller.\n */\n scope: ControllerScope;\n}\n\n/**\n * @see ControllerRecordSchema\n */\nexport const ControllerRecordSchema = z.tuple([RawPrincipalSchema, ControllerSchema]);\n\n/**\n * Represents a tuple containing the principal ID and associated controller data.\n */\nexport type ControllerRecord = z.infer<typeof ControllerRecordSchema>;\n\n/**\n * @see ControllersSchema\n */\nexport const ControllersSchema = z.array(ControllerRecordSchema);\n\n/**\n * Represents a list of controllers.\n */\nexport type Controllers = z.infer<typeof ControllersSchema>;\n\n/**\n * @see ControllerCheckParamsSchema\n */\nexport const ControllerCheckParamsSchema = z.object({\n caller: RawUserIdSchema.or(UserIdSchema),\n controllers: ControllersSchema\n});\n\n/**\n * Represents the parameters required to perform controller checks.\n */\nexport interface ControllerCheckParams {\n /**\n * The identity of the caller to verify against the controller list.\n */\n caller: RawUserId | UserId;\n\n /**\n * The list of controllers to check against.\n */\n controllers: Controllers;\n}\n", "import {Principal} from '@icp-sdk/core/principal';\nimport type {RawUserId, UserId} from '../../schemas/satellite';\n\n/**\n * Normalizes a user ID into a raw `Uint8Array` representation.\n *\n * @param {RawUserId | UserId} caller - The caller identity, either a raw `Uint8Array`\n * or a `Principal` instance.\n *\n * @returns {RawUserId} The raw user ID as a `Uint8Array`.\n */\nexport const normalizeCaller = (caller: RawUserId | UserId): RawUserId =>\n Principal.from(caller).toUint8Array();\n", "import {\n type ControllerCheckParams,\n type Controllers,\n ControllerCheckParamsSchema\n} from './schemas/controllers';\nimport {normalizeCaller} from './utils/caller.utils';\n\n/**\n * Gets the list of admin controllers from the Satellite.\n *\n * @returns {Controllers} The list of admin controllers.\n *\n * @throws {z.ZodError} If the returned value does not match the expected schema.\n */\nexport const getAdminControllers = (): Controllers => __juno_satellite_get_admin_controllers();\n\n/**\n * Gets the list of controllers from the Satellite.\n *\n * @returns {Controllers} The list of all controllers.\n *\n * @throws {z.ZodError} If the returned value does not match the expected schema.\n */\nexport const getControllers = (): Controllers => __juno_satellite_get_controllers();\n\n/**\n * Checks if the given caller is an admin among the provided controllers.\n *\n * @param {ControllerCheckParams} params - The parameters including the caller identity\n * and the list of controllers to verify against.\n *\n * @returns {boolean} Whether the caller is an admin.\n *\n * @throws {z.ZodError} If any input does not match the expected schema.\n */\nexport const isAdminController = (params: ControllerCheckParams): boolean => {\n ControllerCheckParamsSchema.parse(params);\n\n const {caller: providedCaller, controllers} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_is_admin_controller(caller, controllers);\n};\n\n/**\n * Checks if the given caller exists among the provided controllers.\n *\n * @param {ControllerCheckParams} params - The parameters including the caller identity\n * and the list of controllers to verify against.\n *\n * @returns {boolean} Whether the caller is a controller.\n *\n * @throws {z.ZodError} If any input does not match the expected schema.\n */\nexport const isController = (params: ControllerCheckParams): boolean => {\n ControllerCheckParamsSchema.parse(params);\n\n const {caller: providedCaller, controllers} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_is_controller(caller, controllers);\n};\n", "import * as z from 'zod';\nimport {type ListParams, ListParamsSchema} from '../../schemas/list';\nimport {\n type Collection,\n CollectionSchema,\n type RawUserId,\n RawUserIdSchema,\n type UserId,\n UserIdSchema\n} from '../../schemas/satellite';\n\n/**\n * @see CollectionParams\n */\nexport const CollectionParamsSchema = z\n .object({\n collection: CollectionSchema\n })\n .strict();\n\n/**\n * The parameters required to scope an operation to a collection.\n */\nexport interface CollectionParams {\n /**\n * The name of the collection to target.\n */\n collection: Collection;\n}\n\n/**\n * @see ListStoreParams\n */\nexport const ListStoreParamsSchema = CollectionParamsSchema.extend({\n caller: RawUserIdSchema.or(UserIdSchema),\n params: ListParamsSchema\n}).strict();\n\n/**\n * The parameters required to list documents from the datastore respectively assets from the storage.\n */\nexport type ListStoreParams = CollectionParams & {\n /**\n * The identity of the caller requesting the list operation.\n */\n caller: RawUserId | UserId;\n\n /**\n * Optional filtering, ordering, and pagination parameters.\n */\n params: ListParams;\n};\n", "import {type DelDoc, DelDocSchema, type SetDoc, SetDocSchema} from '../../schemas/db';\nimport {\n type Key,\n KeySchema,\n type RawUserId,\n RawUserIdSchema,\n type UserId,\n UserIdSchema\n} from '../../schemas/satellite';\nimport {\n type CollectionParams,\n CollectionParamsSchema,\n type ListStoreParams,\n ListStoreParamsSchema\n} from './params';\n\n/**\n * @see GetDocStoreParams\n */\nexport const GetDocStoreParamsSchema = CollectionParamsSchema.extend({\n caller: RawUserIdSchema.or(UserIdSchema),\n key: KeySchema\n}).strict();\n\n/**\n * Represents the base parameters required to access the datastore and modify a document.\n */\nexport type GetDocStoreParams = CollectionParams & {\n /**\n * The caller who initiate the document operation.\n */\n caller: RawUserId | UserId;\n\n /**\n * The key identifying the document within the collection.\n */\n key: Key;\n};\n\n/**\n * @see SetDocStoreParams\n */\nexport const SetDocStoreParamsSchema = GetDocStoreParamsSchema.extend({\n doc: SetDocSchema\n}).strict();\n\n/**\n * Represents the parameters required to store or update a document.\n *\n * This includes the document data along with metadata such as the caller,\n * collection, and key.\n */\nexport type SetDocStoreParams = GetDocStoreParams & {\n /**\n * The data, optional description and version required to create or update a document.\n */\n doc: SetDoc;\n};\n\n/**\n * @see DeleteDocStoreParams\n */\nexport const DeleteDocStoreParamsSchema = GetDocStoreParamsSchema.extend({\n doc: DelDocSchema\n}).strict();\n\n/**\n * Represents the parameters required to delete a document.\n *\n * This includes the document version along with metadata such as the caller,\n * collection, and key.\n */\nexport type DeleteDocStoreParams = GetDocStoreParams & {\n /**\n * The version required to delete a document.\n */\n doc: DelDoc;\n};\n\n/**\n * @see CountCollectionDocsStoreParams\n */\nexport const CountCollectionDocsStoreParamsSchema = CollectionParamsSchema;\n\n/**\n * The parameters required to count documents from the datastore.\n */\nexport type CountCollectionDocsStoreParams = CollectionParams;\n\n/**\n * @see CountDocsStoreParams\n */\nexport const CountDocsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to count documents from the datastore.\n */\nexport type CountDocsStoreParams = ListStoreParams;\n\n/**\n * @see ListDocsStoreParams\n */\nexport const ListDocsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to list documents from the datastore.\n */\nexport type ListDocsStoreParams = ListStoreParams;\n\n/**\n * @see DeleteDocsStoreParams\n */\nexport const DeleteDocsStoreParamsSchema = CollectionParamsSchema;\n\n/**\n * The parameters required to delete the documents from a collection of the datastore.\n */\nexport type DeleteDocsStoreParams = CollectionParams;\n\n/**\n * @see DeleteFilteredDocsParams\n */\nexport const DeleteFilteredDocsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to delete documents from the datastore.\n */\nexport type DeleteFilteredDocsStoreParams = ListStoreParams;\n", "import type {DocContext} from '../hooks/schemas/db/context';\nimport type {DocUpsert} from '../hooks/schemas/db/payload';\nimport type {Doc, OptionDoc} from '../schemas/db';\nimport type {ListResults} from '../schemas/list';\nimport {\n type CountCollectionDocsStoreParams,\n CountCollectionDocsStoreParamsSchema,\n type CountDocsStoreParams,\n CountDocsStoreParamsSchema,\n type DeleteDocsStoreParams,\n DeleteDocsStoreParamsSchema,\n type DeleteDocStoreParams,\n DeleteDocStoreParamsSchema,\n type DeleteFilteredDocsStoreParams,\n DeleteFilteredDocsStoreParamsSchema,\n type GetDocStoreParams,\n GetDocStoreParamsSchema,\n type ListDocsStoreParams,\n ListDocsStoreParamsSchema,\n type SetDocStoreParams,\n SetDocStoreParamsSchema\n} from './schemas/db';\nimport {normalizeCaller} from './utils/caller.utils';\n\n/**\n * Stores or updates a document in the datastore.\n *\n * The data must have been encoded - using encodeDocData - before calling this function.\n *\n * @param {SetDocStoreParams} params - The parameters required to store the document,\n * including the caller, collection, key, and document data.\n *\n * @returns {DocContext<DocUpsert>} The context of the stored or updated document,\n * including its key, collection, and both the previous and current versions of the document.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails to validate or store the document.\n */\nexport const setDocStore = (params: SetDocStoreParams): DocContext<DocUpsert> => {\n SetDocStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, key, doc} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_set_doc_store(caller, collection, key, doc);\n};\n\n/**\n * Deletes a document from the datastore.\n *\n * @param {DeleteDocStoreParams} params - The parameters required to delete the document,\n * including the caller, collection, key, and the expected version of the document.\n *\n * @returns {DocContext<OptionDoc>} The context of the deleted document,\n * including its key, collection, and optionally the previous document data if it existed.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails to validate the request or the document cannot be deleted.\n */\nexport const deleteDocStore = (params: DeleteDocStoreParams): DocContext<OptionDoc> => {\n DeleteDocStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, key, doc} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_delete_doc_store(caller, collection, key, doc);\n};\n\n/**\n * Retrieve a document from the datastore.\n *\n * @param {GetDocStoreParams} params - The parameters required to get the document.\n *\n * @returns {OptionDoc} The document if found, or undefined if not.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails while retrieving the document.\n */\nexport const getDocStore = (params: GetDocStoreParams): OptionDoc => {\n GetDocStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, key} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_get_doc_store(caller, collection, key);\n};\n\n/**\n * Lists documents from the datastore using optional filtering, pagination, and ordering parameters.\n *\n * @param {ListStoreParams} params - The parameters required to perform the list operation.\n *\n * @returns {ListResults<Doc>} A list result containing matching documents and pagination metadata.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the listing operation.\n */\nexport const listDocsStore = (params: ListDocsStoreParams): ListResults<Doc> => {\n ListDocsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_list_docs_store(caller, collection, listParams);\n};\n\n/**\n * Counts the number of documents in a specific collection.\n *\n * @param {CountCollectionDocsStoreParams} params - The parameters required to count documents in the collection.\n *\n * @returns {bigint} The total number of documents in the specified collection.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const countCollectionDocsStore = (params: CountCollectionDocsStoreParams): bigint => {\n CountCollectionDocsStoreParamsSchema.parse(params);\n\n const {collection} = params;\n\n return __juno_satellite_datastore_count_collection_docs_store(collection);\n};\n\n/**\n * Counts the number of documents in a collection matching specific filters and owned by a specific caller.\n *\n * @param {CountDocsStoreParams} params - The parameters required to perform the filtered count.\n *\n * @returns {bigint} The number of documents that match the provided filters.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const countDocsStore = (params: CountDocsStoreParams): bigint => {\n CountDocsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_count_docs_store(caller, collection, listParams);\n};\n\n/**\n * Delete documents in a specific collection of the Datastore.\n *\n * @param {DeleteDocsStoreParams} params - The parameters required to delete documents in the collection.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const deleteDocsStore = (params: DeleteDocsStoreParams): void => {\n DeleteDocsStoreParamsSchema.parse(params);\n\n const {collection} = params;\n\n __juno_satellite_datastore_delete_docs_store(collection);\n};\n\n/**\n * Delete documents in a collection matching specific filters and owned by a specific caller.\n *\n * @param {DeleteFilteredDocsStoreParams} params - The parameters required to perform the filtered deletion.\n *\n * @returns {DocContext<OptionDoc>[]} The context resulting of the deletion of documents that match the provided filters.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const deleteFilteredDocsStore = (\n params: DeleteFilteredDocsStoreParams\n): DocContext<OptionDoc>[] => {\n DeleteFilteredDocsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_delete_filtered_docs_store(caller, collection, listParams);\n};\n", "import * as z from 'zod';\n\n/**\n * @see Memory\n */\nexport const MemorySchema = z.enum(['heap', 'stable']);\n\n/**\n * Memory type used to select storage or datastore location.\n */\nexport type Memory = z.infer<typeof MemorySchema>;\n", "import * as z from 'zod';\nimport {type RawUserId, type UserId, RawUserIdSchema, UserIdSchema} from '../../schemas/satellite';\nimport {\n type AssetAccessToken,\n type AssetEncoding,\n type AssetKey,\n type Blob,\n type FullPath,\n type HeaderFields,\n AssetAccessTokenSchema,\n AssetEncodingSchema,\n AssetKeySchema,\n BlobSchema,\n FullPathSchema,\n HeaderFieldsSchema\n} from '../../schemas/storage';\nimport {type Memory, MemorySchema} from './collections';\nimport {\n type CollectionParams,\n type ListStoreParams,\n CollectionParamsSchema,\n ListStoreParamsSchema\n} from './params';\n\n/**\n * @see GetAssetStoreParams\n */\nexport const GetAssetStoreParamsSchema = CollectionParamsSchema.extend({\n caller: RawUserIdSchema.or(UserIdSchema),\n full_path: FullPathSchema\n}).strict();\n\n/**\n * Represents the base parameters required to access the storage and modify an asset.\n */\nexport type GetAssetStoreParams = CollectionParams & {\n /**\n * The caller who initiate the document operation.\n */\n caller: RawUserId | UserId;\n\n /**\n * The full_path identifying the asset within the collection.\n */\n full_path: FullPath;\n};\n\n/**\n * @see CountCollectionAssetsStoreParams\n */\nexport const CountCollectionAssetsStoreParamsSchema = CollectionParamsSchema;\n\n/**\n * The parameters required to count documents from the storage.\n */\nexport type CountCollectionAssetsStoreParams = CollectionParams;\n\n/**\n * @see CountAssetsStoreParams\n */\nexport const CountAssetsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to count documents from the storage.\n */\nexport type CountAssetsStoreParams = ListStoreParams;\n\n/**\n * @see SetAssetHandlerParams\n */\nexport const SetAssetHandlerParamsSchema = z\n .object({\n key: AssetKeySchema,\n content: BlobSchema,\n headers: HeaderFieldsSchema\n })\n .strict();\n\n/**\n * The parameters required to set (or update) an asset.\n */\nexport interface SetAssetHandlerParams {\n /**\n * The key identifying the asset.\n */\n key: AssetKey;\n\n /**\n * The binary content of the asset.\n */\n content: Blob;\n\n /**\n * Associated HTTP headers.\n */\n headers: HeaderFields;\n}\n\n/**\n * @see DeleteAssetsStoreParams\n */\nexport const DeleteAssetsStoreParamsSchema = CollectionParamsSchema;\n\n/**\n * The parameters required to delete the assets from a collection of the storage.\n */\nexport type DeleteAssetsStoreParams = CollectionParams;\n\n/**\n * @see DeleteFilteredAssetsParams\n */\nexport const DeleteFilteredAssetsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to delete assets from the storage.\n */\nexport type DeleteFilteredAssetsStoreParams = ListStoreParams;\n\n/**\n * @see DeleteAssetStoreParams\n */\nexport const DeleteAssetStoreParamsSchema = GetAssetStoreParamsSchema;\n\n/**\n * Represents the parameters required to delete an asset.\n */\nexport type DeleteAssetStoreParams = GetAssetStoreParams;\n\n/**\n * @see SetAssetTokenStoreParams\n */\nexport const SetAssetTokenStoreParamsSchema = GetAssetStoreParamsSchema.extend({\n token: AssetAccessTokenSchema\n});\n\n/**\n * Represents the parameters required to delete an asset.\n */\nexport type SetAssetTokenStoreParams = GetAssetStoreParams & {\n /**\n * The token to apply to the asset.\n * Setting `undefined` removes the protection and makes the asset public.\n */\n token: AssetAccessToken;\n};\n\n/**\n * @see ListAssetsStoreParams\n */\nexport const ListAssetsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to list documents from the datastore.\n */\nexport type ListAssetsStoreParams = ListStoreParams;\n\n/**\n * @see GetContentChunksStoreParams\n */\nexport const GetContentChunksStoreParamsSchema = z\n .object({\n encoding: AssetEncodingSchema,\n chunk_index: z.bigint(),\n memory: MemorySchema\n })\n .strict();\n\n/**\n * The parameters required to retrieve a specific chunk from an asset.\n */\nexport interface GetContentChunksStoreParams {\n /**\n * The encoding of the chunks.\n */\n encoding: AssetEncoding;\n\n /**\n * The index of the chunk to retrieve.\n */\n chunk_index: bigint;\n\n /**\n * The memory type to retrieve the chunk from.\n */\n memory: Memory;\n}\n", "import {jsonReplacer, jsonReviver} from '@dfinity/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", "import type {ListResults} from '../schemas/list';\nimport type {AssetNoContent, Blob, OptionAsset} from '../schemas/storage';\nimport {\n type CountAssetsStoreParams,\n CountAssetsStoreParamsSchema,\n type CountCollectionAssetsStoreParams,\n CountCollectionAssetsStoreParamsSchema,\n type DeleteAssetsStoreParams,\n DeleteAssetsStoreParamsSchema,\n type DeleteAssetStoreParams,\n DeleteAssetStoreParamsSchema,\n type DeleteFilteredAssetsStoreParams,\n DeleteFilteredAssetsStoreParamsSchema,\n type GetAssetStoreParams,\n GetAssetStoreParamsSchema,\n type GetContentChunksStoreParams,\n GetContentChunksStoreParamsSchema,\n type ListAssetsStoreParams,\n ListAssetsStoreParamsSchema,\n type SetAssetHandlerParams,\n SetAssetHandlerParamsSchema,\n type SetAssetTokenStoreParams,\n SetAssetTokenStoreParamsSchema\n} from './schemas/storage';\nimport {normalizeCaller} from './utils/caller.utils';\n\n/**\n * Counts the number of assets in a specific collection.\n *\n * @param {CountCollectionAssetsStoreParams} params - The parameters required to count assets in the collection.\n *\n * @returns {bigint} The total number of assets in the specified collection.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const countCollectionAssetsStore = (params: CountCollectionAssetsStoreParams): bigint => {\n CountCollectionAssetsStoreParamsSchema.parse(params);\n\n const {collection} = params;\n\n return __juno_satellite_storage_count_collection_assets_store(collection);\n};\n\n/**\n * Counts the number of assets in a collection matching specific filters and owned by a specific caller.\n *\n * @param {CountAssetsStoreParams} params - The parameters required to perform the filtered count.\n *\n * @returns {bigint} The number of assets that match the provided filters.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const countAssetsStore = (params: CountAssetsStoreParams): bigint => {\n CountAssetsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_count_assets_store(caller, collection, listParams);\n};\n\n/**\n * Sets or updates an asset in the storage.\n *\n * @param {SetAssetHandlerParams} params - The parameters required to set or update an asset.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the operation.\n */\nexport const setAssetHandler = (params: SetAssetHandlerParams): void => {\n SetAssetHandlerParamsSchema.parse(params);\n\n const {key, content, headers} = params;\n\n __juno_satellite_storage_set_asset_handler(key, content, headers);\n};\n\n/**\n * Deletes an asset from the storage.\n *\n * @param {DeleteAssetStoreParams} params - The parameters required to delete the asset.\n *\n * @returns {OptionAsset} The potentially deleted asset.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails to validate the request or the asset cannot be deleted.\n */\nexport const deleteAssetStore = (params: DeleteAssetStoreParams): OptionAsset => {\n DeleteAssetStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, full_path} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_delete_asset_store(caller, collection, full_path);\n};\n\n/**\n * Delete assets in a specific collection of the Storage.\n *\n * @param {DeleteAssetsStoreParams} params - The parameters required to delete assets in the collection.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const deleteAssetsStore = (params: DeleteAssetsStoreParams): void => {\n DeleteAssetsStoreParamsSchema.parse(params);\n\n const {collection} = params;\n\n __juno_satellite_storage_delete_assets_store(collection);\n};\n\n/**\n * Delete assets in a collection matching specific filters and owned by a specific caller.\n *\n * @param {DeleteFilteredAssetsStoreParams} params - The parameters required to perform the filtered deletion.\n *\n * @returns {OptionAsset[]} The potential asset resulting of the deletion that match the provided filters.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const deleteFilteredAssetsStore = (\n params: DeleteFilteredAssetsStoreParams\n): OptionAsset[] => {\n DeleteFilteredAssetsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_delete_filtered_assets_store(caller, collection, listParams);\n};\n\n/**\n * Set or update an access token for an asset in a collection's store.\n *\n * @param {SetAssetTokenStoreParams} params - The parameters required to set the token of the asset.\n *\n *@throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails to validate the request or the token cannot be set.\n */\nexport const setAssetTokenStore = (params: SetAssetTokenStoreParams): void => {\n SetAssetTokenStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, full_path, token} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n __juno_satellite_storage_set_asset_token_store(caller, collection, full_path, token);\n};\n\n/**\n * Retrieve an asset from the storage.\n *\n * @param {GetAssetStoreParams} params - The parameters required to get the asset.\n *\n * @returns {OptionAsset} The asset if found, or undefined if not.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails while retrieving the document.\n */\nexport const getAssetStore = (params: GetAssetStoreParams): OptionAsset => {\n GetAssetStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, full_path} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_get_asset_store(caller, collection, full_path);\n};\n\n/**\n * Lists assets (without content) from the storage using optional filtering, pagination, and ordering parameters.\n *\n * @param {ListStoreParams} params - The parameters required to perform the list operation.\n *\n * @returns {ListResults<AssetNoContent>} A list result containing matching assets and pagination metadata.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the listing operation.\n */\nexport const listAssetsStore = (params: ListAssetsStoreParams): ListResults<AssetNoContent> => {\n ListAssetsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_list_assets_store(caller, collection, listParams);\n};\n\n/**\n * Retrieves content chunks of an asset.\n *\n * This function fetches a content chunk of a given asset encoding using the specified parameters.\n *\n * @param {GetContentChunksStoreParams} params - The parameters including encoding, chunk index, and memory type.\n *\n * @returns {Blob | undefined} The content chunk if found, or `undefined` if not.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite throws an internal error during retrieval.\n */\nexport const getContentChunksStore = (params: GetContentChunksStoreParams): Blob | undefined => {\n GetContentChunksStoreParamsSchema.parse(params);\n\n const {encoding, chunk_index, memory} = params;\n\n return __juno_satellite_storage_get_content_chunks_store(encoding, chunk_index, memory);\n};\n"],
5
- "mappings": "uMAAA,UAAYA,MAAO,MAcZ,IAAMC,EAA0B,OAAK,CAAC,QAAS,QAAS,QAAQ,CAAC,EAU3DC,EAAmB,QAAM,CAAG,SAAO,EAAK,SAAO,CAAC,CAAC,EAUjDC,EACV,SAAO,CACN,SAAY,QAAMD,CAAc,EAChC,WAAYE,EACZ,WAAYA,EACZ,WAAYA,EAAgB,SAAS,EACrC,MAAOH,CACT,CAAC,EACA,OAAO,EAoCGI,EAA2B,QAAM,CAACC,EAAoBH,CAAgB,CAAC,EAUvEI,EAAsB,QAAMF,CAAsB,EAUlDG,EAAgC,SAAO,CAClD,OAAQC,EAAgB,GAAGC,CAAY,EACvC,YAAaH,CACf,CAAC,ECrGD,OAAQ,aAAAI,MAAgB,0BAWjB,IAAMC,EAAmBC,GAC9BF,EAAU,KAAKE,CAAM,EAAE,aAAa,ECE/B,IAAMC,GAAsB,IAAmB,uCAAuC,EAShFC,GAAiB,IAAmB,iCAAiC,EAYrEC,GAAqBC,GAA2C,CAC3EC,EAA4B,MAAMD,CAAM,EAExC,GAAM,CAAC,OAAQE,EAAgB,YAAAC,CAAW,EAAIH,EAExCI,EAASC,EAAgBH,CAAc,EAE7C,OAAO,qCAAqCE,EAAQD,CAAW,CACjE,EAYaG,GAAgBN,GAA2C,CACtEC,EAA4B,MAA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,CAAC,OAAQK,EAAgB,WAAAH,EAAY,OAAQI,CAAU,EAAIN,EAE3DO,EAASC,EAAgBH,CAAc,EAE7C,OAAO,sDAAsDE,EAAQL,EAAYI,CAAU,CAC7F,EAUae,GAAsBrB,GAA2C,CAC5EsB,EAA+B,MAAMtB,CAAM,EAE3C,GAAM,CAAC,OAAQK,EAAgB,WAAAH,EAAY,UAAAc,EAAW,MAAAO,CAAK,EAAIvB,EAEzDO,EAASC,EAAgBH,CAAc,EAE7C,+CAA+CE,EAAQL,EAAYc,EAAWO,CAAK,CACrF,EAYaC,GAAiBxB,GAA6C,CACzEyB,EAA0B,MAAMzB,CAAM,EAEtC,GAAM,CAAC,OAAQK,EAAgB,WAAAH,EAAY,UAAAc,CAAS,EAAIhB,EAElDO,EAASC,EAAgBH,CAAc,EAE7C,OAAO,yCAAyCE,EAAQL,EAAYc,CAAS,CAC/E,EAYaU,GAAmB1B,GAA+D,CAC7F2B,EAA4B,MAAM3B,CAAM,EAExC,GAAM,CAAC,OAAQK,EAAgB,WAAAH,EAAY,OAAQI,CAAU,EAAIN,EAE3DO,EAASC,EAAgBH,CAAc,EAE7C,OAAO,2CAA2CE,EAAQL,EAAYI,CAAU,CAClF,EAcasB,GAAyB5B,GAA0D,CAC9F6B,EAAkC,MAAM7B,CAAM,EAE9C,GAAM,CAAC,SAAA8B,EAAU,YAAAC,EAAa,OAAAC,CAAM,EAAIhC,EAExC,OAAO,kDAAkD8B,EAAUC,EAAaC,CAAM,CACxF",
6
- "names": ["z", "ControllerScopeSchema", "MetadataSchema", "ControllerSchema", "TimestampSchema", "ControllerRecordSchema", "RawPrincipalSchema", "ControllersSchema", "ControllerCheckParamsSchema", "RawUserIdSchema", "UserIdSchema", "Principal", "normalizeCaller", "caller", "getAdminControllers", "getControllers", "isAdminController", "params", "ControllerCheckParamsSchema", "providedCaller", "controllers", "caller", "normalizeCaller", "isController", "z", "CollectionParamsSchema", "CollectionSchema", "ListStoreParamsSchema", "RawUserIdSchema", "UserIdSchema", "ListParamsSchema", "GetDocStoreParamsSchema", "CollectionParamsSchema", "RawUserIdSchema", "UserIdSchema", "KeySchema", "SetDocStoreParamsSchema", "SetDocSchema", "DeleteDocStoreParamsSchema", "DelDocSchema", "CountCollectionDocsStoreParamsSchema", "CountDocsStoreParamsSchema", "ListStoreParamsSchema", "ListDocsStoreParamsSchema", "DeleteDocsStoreParamsSchema", "DeleteFilteredDocsStoreParamsSchema", "setDocStore", "params", "SetDocStoreParamsSchema", "providedCaller", "collection", "key", "doc", "caller", "normalizeCaller", "deleteDocStore", "DeleteDocStoreParamsSchema", "getDocStore", "GetDocStoreParamsSchema", "listDocsStore", "ListDocsStoreParamsSchema", "listParams", "countCollectionDocsStore", "CountCollectionDocsStoreParamsSchema", "countDocsStore", "CountDocsStoreParamsSchema", "deleteDocsStore", "DeleteDocsStoreParamsSchema", "deleteFilteredDocsStore", "DeleteFilteredDocsStoreParamsSchema", "z", "MemorySchema", "z", "GetAssetStoreParamsSchema", "CollectionParamsSchema", "RawUserIdSchema", "UserIdSchema", "FullPathSchema", "CountCollectionAssetsStoreParamsSchema", "CountAssetsStoreParamsSchema", "ListStoreParamsSchema", "SetAssetHandlerParamsSchema", "AssetKeySchema", "BlobSchema", "HeaderFieldsSchema", "DeleteAssetsStoreParamsSchema", "DeleteFilteredAssetsStoreParamsSchema", "DeleteAssetStoreParamsSchema", "SetAssetTokenStoreParamsSchema", "AssetAccessTokenSchema", "ListAssetsStoreParamsSchema", "GetContentChunksStoreParamsSchema", "AssetEncodingSchema", "MemorySchema", "jsonReplacer", "jsonReviver", "decodeDocData", "data", "encodeDocData", "countCollectionAssetsStore", "params", "CountCollectionAssetsStoreParamsSchema", "collection", "countAssetsStore", "CountAssetsStoreParamsSchema", "providedCaller", "listParams", "caller", "normalizeCaller", "setAssetHandler", "SetAssetHandlerParamsSchema", "key", "content", "headers", "deleteAssetStore", "DeleteAssetStoreParamsSchema", "full_path", "deleteAssetsStore", "DeleteAssetsStoreParamsSchema", "deleteFilteredAssetsStore", "DeleteFilteredAssetsStoreParamsSchema", "setAssetTokenStore", "SetAssetTokenStoreParamsSchema", "token", "getAssetStore", "GetAssetStoreParamsSchema", "listAssetsStore", "ListAssetsStoreParamsSchema", "getContentChunksStore", "GetContentChunksStoreParamsSchema", "encoding", "chunk_index", "memory"]
4
+ "sourcesContent": ["import * as z from 'zod';\nimport {RawPrincipalSchema} from '../../schemas/candid';\nimport {\n type RawUserId,\n type Timestamp,\n type UserId,\n RawUserIdSchema,\n TimestampSchema,\n UserIdSchema\n} from '../../schemas/satellite';\n\n/**\n * @see ControllerScope\n */\nexport const ControllerScopeSchema = z.enum(['write', 'admin', 'submit']);\n\n/**\n * Represents the permission scope of a controller.\n */\nexport type ControllerScope = z.infer<typeof ControllerScopeSchema>;\n\n/**\n * @see ControllerKind\n */\nexport const ControllerKindSchema = z.enum(['automation', 'emulator']);\n\n/**\n * Represents a specific kind of controller. Meant for informational purposes.\n */\nexport type ControllerKind = z.infer<typeof ControllerKindSchema>;\n\n/**\n * @see MetadataSchema\n */\nexport const MetadataSchema = z.tuple([z.string(), z.string()]);\n\n/**\n * Represents a single metadata entry as a key-value tuple.\n */\nexport type Metadata = z.infer<typeof MetadataSchema>;\n\n/**\n * @see ControllerSchema\n */\nexport const ControllerSchema = z\n .object({\n metadata: z.array(MetadataSchema),\n created_at: TimestampSchema,\n updated_at: TimestampSchema,\n expires_at: TimestampSchema.optional(),\n scope: ControllerScopeSchema,\n kind: ControllerKindSchema.optional()\n })\n .strict();\n\n/**\n * Represents a controller with access scope and associated metadata.\n */\nexport interface Controller {\n /**\n * A list of key-value metadata pairs associated with the controller.\n */\n metadata: Metadata[];\n\n /**\n * The timestamp when the controller was created.\n */\n created_at: Timestamp;\n\n /**\n * The timestamp when the controller was last updated.\n */\n updated_at: Timestamp;\n\n /**\n * Optional expiration timestamp for the controller.\n */\n expires_at?: Timestamp;\n\n /**\n * The scope assigned to the controller.\n */\n scope: ControllerScope;\n\n /**\n * An optional kind identifier of the controller.\n */\n kind?: ControllerKind;\n}\n\n/**\n * @see ControllerRecordSchema\n */\nexport const ControllerRecordSchema = z.tuple([RawPrincipalSchema, ControllerSchema]);\n\n/**\n * Represents a tuple containing the principal ID and associated controller data.\n */\nexport type ControllerRecord = z.infer<typeof ControllerRecordSchema>;\n\n/**\n * @see ControllersSchema\n */\nexport const ControllersSchema = z.array(ControllerRecordSchema);\n\n/**\n * Represents a list of controllers.\n */\nexport type Controllers = z.infer<typeof ControllersSchema>;\n\n/**\n * @see ControllerCheckParamsSchema\n */\nexport const ControllerCheckParamsSchema = z.object({\n caller: RawUserIdSchema.or(UserIdSchema),\n controllers: ControllersSchema\n});\n\n/**\n * Represents the parameters required to perform controller checks.\n */\nexport interface ControllerCheckParams {\n /**\n * The identity of the caller to verify against the controller list.\n */\n caller: RawUserId | UserId;\n\n /**\n * The list of controllers to check against.\n */\n controllers: Controllers;\n}\n", "import {Principal} from '@icp-sdk/core/principal';\nimport type {RawUserId, UserId} from '../../schemas/satellite';\n\n/**\n * Normalizes a user ID into a raw `Uint8Array` representation.\n *\n * @param {RawUserId | UserId} caller - The caller identity, either a raw `Uint8Array`\n * or a `Principal` instance.\n *\n * @returns {RawUserId} The raw user ID as a `Uint8Array`.\n */\nexport const normalizeCaller = (caller: RawUserId | UserId): RawUserId =>\n Principal.from(caller).toUint8Array();\n", "import {\n type ControllerCheckParams,\n type Controllers,\n ControllerCheckParamsSchema\n} from './schemas/controllers';\nimport {normalizeCaller} from './utils/caller.utils';\n\n/**\n * Gets the list of admin controllers from the Satellite.\n *\n * @returns {Controllers} The list of admin controllers.\n *\n * @throws {z.ZodError} If the returned value does not match the expected schema.\n */\nexport const getAdminControllers = (): Controllers => __juno_satellite_get_admin_controllers();\n\n/**\n * Gets the list of controllers from the Satellite.\n *\n * @returns {Controllers} The list of all controllers.\n *\n * @throws {z.ZodError} If the returned value does not match the expected schema.\n */\nexport const getControllers = (): Controllers => __juno_satellite_get_controllers();\n\n/**\n * Checks if the given caller is an admin among the provided controllers.\n *\n * @param {ControllerCheckParams} params - The parameters including the caller identity\n * and the list of controllers to verify against.\n *\n * @returns {boolean} Whether the caller is an admin.\n *\n * @throws {z.ZodError} If any input does not match the expected schema.\n */\nexport const isAdminController = (params: ControllerCheckParams): boolean => {\n ControllerCheckParamsSchema.parse(params);\n\n const {caller: providedCaller, controllers} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_is_admin_controller(caller, controllers);\n};\n\n/**\n * Checks if the given caller exists among the provided controllers.\n *\n * @param {ControllerCheckParams} params - The parameters including the caller identity\n * and the list of controllers to verify against.\n *\n * @returns {boolean} Whether the caller is a controller.\n *\n * @throws {z.ZodError} If any input does not match the expected schema.\n */\nexport const isController = (params: ControllerCheckParams): boolean => {\n ControllerCheckParamsSchema.parse(params);\n\n const {caller: providedCaller, controllers} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_is_controller(caller, controllers);\n};\n", "import * as z from 'zod';\nimport {type ListParams, ListParamsSchema} from '../../schemas/list';\nimport {\n type Collection,\n CollectionSchema,\n type RawUserId,\n RawUserIdSchema,\n type UserId,\n UserIdSchema\n} from '../../schemas/satellite';\n\n/**\n * @see CollectionParams\n */\nexport const CollectionParamsSchema = z\n .object({\n collection: CollectionSchema\n })\n .strict();\n\n/**\n * The parameters required to scope an operation to a collection.\n */\nexport interface CollectionParams {\n /**\n * The name of the collection to target.\n */\n collection: Collection;\n}\n\n/**\n * @see ListStoreParams\n */\nexport const ListStoreParamsSchema = CollectionParamsSchema.extend({\n caller: RawUserIdSchema.or(UserIdSchema),\n params: ListParamsSchema\n}).strict();\n\n/**\n * The parameters required to list documents from the datastore respectively assets from the storage.\n */\nexport type ListStoreParams = CollectionParams & {\n /**\n * The identity of the caller requesting the list operation.\n */\n caller: RawUserId | UserId;\n\n /**\n * Optional filtering, ordering, and pagination parameters.\n */\n params: ListParams;\n};\n", "import {type DelDoc, DelDocSchema, type SetDoc, SetDocSchema} from '../../schemas/db';\nimport {\n type Key,\n KeySchema,\n type RawUserId,\n RawUserIdSchema,\n type UserId,\n UserIdSchema\n} from '../../schemas/satellite';\nimport {\n type CollectionParams,\n CollectionParamsSchema,\n type ListStoreParams,\n ListStoreParamsSchema\n} from './params';\n\n/**\n * @see GetDocStoreParams\n */\nexport const GetDocStoreParamsSchema = CollectionParamsSchema.extend({\n caller: RawUserIdSchema.or(UserIdSchema),\n key: KeySchema\n}).strict();\n\n/**\n * Represents the base parameters required to access the datastore and modify a document.\n */\nexport type GetDocStoreParams = CollectionParams & {\n /**\n * The caller who initiate the document operation.\n */\n caller: RawUserId | UserId;\n\n /**\n * The key identifying the document within the collection.\n */\n key: Key;\n};\n\n/**\n * @see SetDocStoreParams\n */\nexport const SetDocStoreParamsSchema = GetDocStoreParamsSchema.extend({\n doc: SetDocSchema\n}).strict();\n\n/**\n * Represents the parameters required to store or update a document.\n *\n * This includes the document data along with metadata such as the caller,\n * collection, and key.\n */\nexport type SetDocStoreParams = GetDocStoreParams & {\n /**\n * The data, optional description and version required to create or update a document.\n */\n doc: SetDoc;\n};\n\n/**\n * @see DeleteDocStoreParams\n */\nexport const DeleteDocStoreParamsSchema = GetDocStoreParamsSchema.extend({\n doc: DelDocSchema\n}).strict();\n\n/**\n * Represents the parameters required to delete a document.\n *\n * This includes the document version along with metadata such as the caller,\n * collection, and key.\n */\nexport type DeleteDocStoreParams = GetDocStoreParams & {\n /**\n * The version required to delete a document.\n */\n doc: DelDoc;\n};\n\n/**\n * @see CountCollectionDocsStoreParams\n */\nexport const CountCollectionDocsStoreParamsSchema = CollectionParamsSchema;\n\n/**\n * The parameters required to count documents from the datastore.\n */\nexport type CountCollectionDocsStoreParams = CollectionParams;\n\n/**\n * @see CountDocsStoreParams\n */\nexport const CountDocsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to count documents from the datastore.\n */\nexport type CountDocsStoreParams = ListStoreParams;\n\n/**\n * @see ListDocsStoreParams\n */\nexport const ListDocsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to list documents from the datastore.\n */\nexport type ListDocsStoreParams = ListStoreParams;\n\n/**\n * @see DeleteDocsStoreParams\n */\nexport const DeleteDocsStoreParamsSchema = CollectionParamsSchema;\n\n/**\n * The parameters required to delete the documents from a collection of the datastore.\n */\nexport type DeleteDocsStoreParams = CollectionParams;\n\n/**\n * @see DeleteFilteredDocsParams\n */\nexport const DeleteFilteredDocsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to delete documents from the datastore.\n */\nexport type DeleteFilteredDocsStoreParams = ListStoreParams;\n", "import type {DocContext} from '../hooks/schemas/db/context';\nimport type {DocUpsert} from '../hooks/schemas/db/payload';\nimport type {Doc, OptionDoc} from '../schemas/db';\nimport type {ListResults} from '../schemas/list';\nimport {\n type CountCollectionDocsStoreParams,\n CountCollectionDocsStoreParamsSchema,\n type CountDocsStoreParams,\n CountDocsStoreParamsSchema,\n type DeleteDocsStoreParams,\n DeleteDocsStoreParamsSchema,\n type DeleteDocStoreParams,\n DeleteDocStoreParamsSchema,\n type DeleteFilteredDocsStoreParams,\n DeleteFilteredDocsStoreParamsSchema,\n type GetDocStoreParams,\n GetDocStoreParamsSchema,\n type ListDocsStoreParams,\n ListDocsStoreParamsSchema,\n type SetDocStoreParams,\n SetDocStoreParamsSchema\n} from './schemas/db';\nimport {normalizeCaller} from './utils/caller.utils';\n\n/**\n * Stores or updates a document in the datastore.\n *\n * The data must have been encoded - using encodeDocData - before calling this function.\n *\n * @param {SetDocStoreParams} params - The parameters required to store the document,\n * including the caller, collection, key, and document data.\n *\n * @returns {DocContext<DocUpsert>} The context of the stored or updated document,\n * including its key, collection, and both the previous and current versions of the document.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails to validate or store the document.\n */\nexport const setDocStore = (params: SetDocStoreParams): DocContext<DocUpsert> => {\n SetDocStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, key, doc} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_set_doc_store(caller, collection, key, doc);\n};\n\n/**\n * Deletes a document from the datastore.\n *\n * @param {DeleteDocStoreParams} params - The parameters required to delete the document,\n * including the caller, collection, key, and the expected version of the document.\n *\n * @returns {DocContext<OptionDoc>} The context of the deleted document,\n * including its key, collection, and optionally the previous document data if it existed.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails to validate the request or the document cannot be deleted.\n */\nexport const deleteDocStore = (params: DeleteDocStoreParams): DocContext<OptionDoc> => {\n DeleteDocStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, key, doc} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_delete_doc_store(caller, collection, key, doc);\n};\n\n/**\n * Retrieve a document from the datastore.\n *\n * @param {GetDocStoreParams} params - The parameters required to get the document.\n *\n * @returns {OptionDoc} The document if found, or undefined if not.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails while retrieving the document.\n */\nexport const getDocStore = (params: GetDocStoreParams): OptionDoc => {\n GetDocStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, key} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_get_doc_store(caller, collection, key);\n};\n\n/**\n * Lists documents from the datastore using optional filtering, pagination, and ordering parameters.\n *\n * @param {ListStoreParams} params - The parameters required to perform the list operation.\n *\n * @returns {ListResults<Doc>} A list result containing matching documents and pagination metadata.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the listing operation.\n */\nexport const listDocsStore = (params: ListDocsStoreParams): ListResults<Doc> => {\n ListDocsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_list_docs_store(caller, collection, listParams);\n};\n\n/**\n * Counts the number of documents in a specific collection.\n *\n * @param {CountCollectionDocsStoreParams} params - The parameters required to count documents in the collection.\n *\n * @returns {bigint} The total number of documents in the specified collection.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const countCollectionDocsStore = (params: CountCollectionDocsStoreParams): bigint => {\n CountCollectionDocsStoreParamsSchema.parse(params);\n\n const {collection} = params;\n\n return __juno_satellite_datastore_count_collection_docs_store(collection);\n};\n\n/**\n * Counts the number of documents in a collection matching specific filters and owned by a specific caller.\n *\n * @param {CountDocsStoreParams} params - The parameters required to perform the filtered count.\n *\n * @returns {bigint} The number of documents that match the provided filters.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const countDocsStore = (params: CountDocsStoreParams): bigint => {\n CountDocsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_count_docs_store(caller, collection, listParams);\n};\n\n/**\n * Delete documents in a specific collection of the Datastore.\n *\n * @param {DeleteDocsStoreParams} params - The parameters required to delete documents in the collection.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const deleteDocsStore = (params: DeleteDocsStoreParams): void => {\n DeleteDocsStoreParamsSchema.parse(params);\n\n const {collection} = params;\n\n __juno_satellite_datastore_delete_docs_store(collection);\n};\n\n/**\n * Delete documents in a collection matching specific filters and owned by a specific caller.\n *\n * @param {DeleteFilteredDocsStoreParams} params - The parameters required to perform the filtered deletion.\n *\n * @returns {DocContext<OptionDoc>[]} The context resulting of the deletion of documents that match the provided filters.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const deleteFilteredDocsStore = (\n params: DeleteFilteredDocsStoreParams\n): DocContext<OptionDoc>[] => {\n DeleteFilteredDocsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_datastore_delete_filtered_docs_store(caller, collection, listParams);\n};\n", "import * as z from 'zod';\n\n/**\n * @see Memory\n */\nexport const MemorySchema = z.enum(['heap', 'stable']);\n\n/**\n * Memory type used to select storage or datastore location.\n */\nexport type Memory = z.infer<typeof MemorySchema>;\n", "import * as z from 'zod';\nimport {type RawUserId, type UserId, RawUserIdSchema, UserIdSchema} from '../../schemas/satellite';\nimport {\n type AssetAccessToken,\n type AssetEncoding,\n type AssetKey,\n type Blob,\n type FullPath,\n type HeaderFields,\n AssetAccessTokenSchema,\n AssetEncodingSchema,\n AssetKeySchema,\n BlobSchema,\n FullPathSchema,\n HeaderFieldsSchema\n} from '../../schemas/storage';\nimport {type Memory, MemorySchema} from './collections';\nimport {\n type CollectionParams,\n type ListStoreParams,\n CollectionParamsSchema,\n ListStoreParamsSchema\n} from './params';\n\n/**\n * @see GetAssetStoreParams\n */\nexport const GetAssetStoreParamsSchema = CollectionParamsSchema.extend({\n caller: RawUserIdSchema.or(UserIdSchema),\n full_path: FullPathSchema\n}).strict();\n\n/**\n * Represents the base parameters required to access the storage and modify an asset.\n */\nexport type GetAssetStoreParams = CollectionParams & {\n /**\n * The caller who initiate the document operation.\n */\n caller: RawUserId | UserId;\n\n /**\n * The full_path identifying the asset within the collection.\n */\n full_path: FullPath;\n};\n\n/**\n * @see CountCollectionAssetsStoreParams\n */\nexport const CountCollectionAssetsStoreParamsSchema = CollectionParamsSchema;\n\n/**\n * The parameters required to count documents from the storage.\n */\nexport type CountCollectionAssetsStoreParams = CollectionParams;\n\n/**\n * @see CountAssetsStoreParams\n */\nexport const CountAssetsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to count documents from the storage.\n */\nexport type CountAssetsStoreParams = ListStoreParams;\n\n/**\n * @see SetAssetHandlerParams\n */\nexport const SetAssetHandlerParamsSchema = z\n .object({\n key: AssetKeySchema,\n content: BlobSchema,\n headers: HeaderFieldsSchema\n })\n .strict();\n\n/**\n * The parameters required to set (or update) an asset.\n */\nexport interface SetAssetHandlerParams {\n /**\n * The key identifying the asset.\n */\n key: AssetKey;\n\n /**\n * The binary content of the asset.\n */\n content: Blob;\n\n /**\n * Associated HTTP headers.\n */\n headers: HeaderFields;\n}\n\n/**\n * @see DeleteAssetsStoreParams\n */\nexport const DeleteAssetsStoreParamsSchema = CollectionParamsSchema;\n\n/**\n * The parameters required to delete the assets from a collection of the storage.\n */\nexport type DeleteAssetsStoreParams = CollectionParams;\n\n/**\n * @see DeleteFilteredAssetsParams\n */\nexport const DeleteFilteredAssetsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to delete assets from the storage.\n */\nexport type DeleteFilteredAssetsStoreParams = ListStoreParams;\n\n/**\n * @see DeleteAssetStoreParams\n */\nexport const DeleteAssetStoreParamsSchema = GetAssetStoreParamsSchema;\n\n/**\n * Represents the parameters required to delete an asset.\n */\nexport type DeleteAssetStoreParams = GetAssetStoreParams;\n\n/**\n * @see SetAssetTokenStoreParams\n */\nexport const SetAssetTokenStoreParamsSchema = GetAssetStoreParamsSchema.extend({\n token: AssetAccessTokenSchema\n});\n\n/**\n * Represents the parameters required to delete an asset.\n */\nexport type SetAssetTokenStoreParams = GetAssetStoreParams & {\n /**\n * The token to apply to the asset.\n * Setting `undefined` removes the protection and makes the asset public.\n */\n token: AssetAccessToken;\n};\n\n/**\n * @see ListAssetsStoreParams\n */\nexport const ListAssetsStoreParamsSchema = ListStoreParamsSchema;\n\n/**\n * The parameters required to list documents from the datastore.\n */\nexport type ListAssetsStoreParams = ListStoreParams;\n\n/**\n * @see GetContentChunksStoreParams\n */\nexport const GetContentChunksStoreParamsSchema = z\n .object({\n encoding: AssetEncodingSchema,\n chunk_index: z.bigint(),\n memory: MemorySchema\n })\n .strict();\n\n/**\n * The parameters required to retrieve a specific chunk from an asset.\n */\nexport interface GetContentChunksStoreParams {\n /**\n * The encoding of the chunks.\n */\n encoding: AssetEncoding;\n\n /**\n * The index of the chunk to retrieve.\n */\n chunk_index: bigint;\n\n /**\n * The memory type to retrieve the chunk from.\n */\n memory: Memory;\n}\n", "import {jsonReplacer, jsonReviver} from '@dfinity/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", "import type {ListResults} from '../schemas/list';\nimport type {AssetNoContent, Blob, OptionAsset} from '../schemas/storage';\nimport {\n type CountAssetsStoreParams,\n CountAssetsStoreParamsSchema,\n type CountCollectionAssetsStoreParams,\n CountCollectionAssetsStoreParamsSchema,\n type DeleteAssetsStoreParams,\n DeleteAssetsStoreParamsSchema,\n type DeleteAssetStoreParams,\n DeleteAssetStoreParamsSchema,\n type DeleteFilteredAssetsStoreParams,\n DeleteFilteredAssetsStoreParamsSchema,\n type GetAssetStoreParams,\n GetAssetStoreParamsSchema,\n type GetContentChunksStoreParams,\n GetContentChunksStoreParamsSchema,\n type ListAssetsStoreParams,\n ListAssetsStoreParamsSchema,\n type SetAssetHandlerParams,\n SetAssetHandlerParamsSchema,\n type SetAssetTokenStoreParams,\n SetAssetTokenStoreParamsSchema\n} from './schemas/storage';\nimport {normalizeCaller} from './utils/caller.utils';\n\n/**\n * Counts the number of assets in a specific collection.\n *\n * @param {CountCollectionAssetsStoreParams} params - The parameters required to count assets in the collection.\n *\n * @returns {bigint} The total number of assets in the specified collection.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const countCollectionAssetsStore = (params: CountCollectionAssetsStoreParams): bigint => {\n CountCollectionAssetsStoreParamsSchema.parse(params);\n\n const {collection} = params;\n\n return __juno_satellite_storage_count_collection_assets_store(collection);\n};\n\n/**\n * Counts the number of assets in a collection matching specific filters and owned by a specific caller.\n *\n * @param {CountAssetsStoreParams} params - The parameters required to perform the filtered count.\n *\n * @returns {bigint} The number of assets that match the provided filters.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const countAssetsStore = (params: CountAssetsStoreParams): bigint => {\n CountAssetsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_count_assets_store(caller, collection, listParams);\n};\n\n/**\n * Sets or updates an asset in the storage.\n *\n * @param {SetAssetHandlerParams} params - The parameters required to set or update an asset.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the operation.\n */\nexport const setAssetHandler = (params: SetAssetHandlerParams): void => {\n SetAssetHandlerParamsSchema.parse(params);\n\n const {key, content, headers} = params;\n\n __juno_satellite_storage_set_asset_handler(key, content, headers);\n};\n\n/**\n * Deletes an asset from the storage.\n *\n * @param {DeleteAssetStoreParams} params - The parameters required to delete the asset.\n *\n * @returns {OptionAsset} The potentially deleted asset.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails to validate the request or the asset cannot be deleted.\n */\nexport const deleteAssetStore = (params: DeleteAssetStoreParams): OptionAsset => {\n DeleteAssetStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, full_path} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_delete_asset_store(caller, collection, full_path);\n};\n\n/**\n * Delete assets in a specific collection of the Storage.\n *\n * @param {DeleteAssetsStoreParams} params - The parameters required to delete assets in the collection.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const deleteAssetsStore = (params: DeleteAssetsStoreParams): void => {\n DeleteAssetsStoreParamsSchema.parse(params);\n\n const {collection} = params;\n\n __juno_satellite_storage_delete_assets_store(collection);\n};\n\n/**\n * Delete assets in a collection matching specific filters and owned by a specific caller.\n *\n * @param {DeleteFilteredAssetsStoreParams} params - The parameters required to perform the filtered deletion.\n *\n * @returns {OptionAsset[]} The potential asset resulting of the deletion that match the provided filters.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the count operation.\n */\nexport const deleteFilteredAssetsStore = (\n params: DeleteFilteredAssetsStoreParams\n): OptionAsset[] => {\n DeleteFilteredAssetsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_delete_filtered_assets_store(caller, collection, listParams);\n};\n\n/**\n * Set or update an access token for an asset in a collection's store.\n *\n * @param {SetAssetTokenStoreParams} params - The parameters required to set the token of the asset.\n *\n *@throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails to validate the request or the token cannot be set.\n */\nexport const setAssetTokenStore = (params: SetAssetTokenStoreParams): void => {\n SetAssetTokenStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, full_path, token} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n __juno_satellite_storage_set_asset_token_store(caller, collection, full_path, token);\n};\n\n/**\n * Retrieve an asset from the storage.\n *\n * @param {GetAssetStoreParams} params - The parameters required to get the asset.\n *\n * @returns {OptionAsset} The asset if found, or undefined if not.\n *\n * @throws {z.ZodError} If the provided parameters do not match the expected schema.\n * @throws {Error} If the Satellite fails while retrieving the document.\n */\nexport const getAssetStore = (params: GetAssetStoreParams): OptionAsset => {\n GetAssetStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, full_path} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_get_asset_store(caller, collection, full_path);\n};\n\n/**\n * Lists assets (without content) from the storage using optional filtering, pagination, and ordering parameters.\n *\n * @param {ListStoreParams} params - The parameters required to perform the list operation.\n *\n * @returns {ListResults<AssetNoContent>} A list result containing matching assets and pagination metadata.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite fails while performing the listing operation.\n */\nexport const listAssetsStore = (params: ListAssetsStoreParams): ListResults<AssetNoContent> => {\n ListAssetsStoreParamsSchema.parse(params);\n\n const {caller: providedCaller, collection, params: listParams} = params;\n\n const caller = normalizeCaller(providedCaller);\n\n return __juno_satellite_storage_list_assets_store(caller, collection, listParams);\n};\n\n/**\n * Retrieves content chunks of an asset.\n *\n * This function fetches a content chunk of a given asset encoding using the specified parameters.\n *\n * @param {GetContentChunksStoreParams} params - The parameters including encoding, chunk index, and memory type.\n *\n * @returns {Blob | undefined} The content chunk if found, or `undefined` if not.\n *\n * @throws {z.ZodError} If the input parameters do not conform to the schema.\n * @throws {Error} If the Satellite throws an internal error during retrieval.\n */\nexport const getContentChunksStore = (params: GetContentChunksStoreParams): Blob | undefined => {\n GetContentChunksStoreParamsSchema.parse(params);\n\n const {encoding, chunk_index, memory} = params;\n\n return __juno_satellite_storage_get_content_chunks_store(encoding, chunk_index, memory);\n};\n"],
5
+ "mappings": "uMAAA,UAAYA,MAAO,MAcZ,IAAMC,EAA0B,OAAK,CAAC,QAAS,QAAS,QAAQ,CAAC,EAU3DC,EAAyB,OAAK,CAAC,aAAc,UAAU,CAAC,EAUxDC,EAAmB,QAAM,CAAG,SAAO,EAAK,SAAO,CAAC,CAAC,EAUjDC,EACV,SAAO,CACN,SAAY,QAAMD,CAAc,EAChC,WAAYE,EACZ,WAAYA,EACZ,WAAYA,EAAgB,SAAS,EACrC,MAAOJ,EACP,KAAMC,E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AU,EAAIN,EAE3DO,EAASC,EAAgBH,CAAc,EAE7C,OAAO,2CAA2CE,EAAQL,EAAYI,CAAU,CAClF,EAcasB,GAAyB5B,GAA0D,CAC9F6B,EAAkC,MAAM7B,CAAM,EAE9C,GAAM,CAAC,SAAA8B,EAAU,YAAAC,EAAa,OAAAC,CAAM,EAAIhC,EAExC,OAAO,kDAAkD8B,EAAUC,EAAaC,CAAM,CACxF",
6
+ "names": ["z", "ControllerScopeSchema", "ControllerKindSchema", "MetadataSchema", "ControllerSchema", "TimestampSchema", "ControllerRecordSchema", "RawPrincipalSchema", "ControllersSchema", "ControllerCheckParamsSchema", "RawUserIdSchema", "UserIdSchema", "Principal", "normalizeCaller", "caller", "getAdminControllers", "getControllers", "isAdminController", "params", "ControllerCheckParamsSchema", "providedCaller", "controllers", "caller", "normalizeCaller", "isController", "z", "CollectionParamsSchema", "CollectionSchema", "ListStoreParamsSchema", "RawUserIdSchema", "UserIdSchema", "ListParamsSchema", "GetDocStoreParamsSchema", "CollectionParamsSchema", "RawUserIdSchema", "UserIdSchema", "KeySchema", "SetDocStoreParamsSchema", "SetDocSchema", "DeleteDocStoreParamsSchema", "DelDocSchema", "CountCollectionDocsStoreParamsSchema", "CountDocsStoreParamsSchema", "ListStoreParamsSchema", "ListDocsStoreParamsSchema", "DeleteDocsStoreParamsSchema", "DeleteFilteredDocsStoreParamsSchema", "setDocStore", "params", "SetDocStoreParamsSchema", "providedCaller", "collection", "key", "doc", "caller", "normalizeCaller", "deleteDocStore", "DeleteDocStoreParamsSchema", "getDocStore", "GetDocStoreParamsSchema", "listDocsStore", "ListDocsStoreParamsSchema", "listParams", "countCollectionDocsStore", "CountCollectionDocsStoreParamsSchema", "countDocsStore", "CountDocsStoreParamsSchema", "deleteDocsStore", "DeleteDocsStoreParamsSchema", "deleteFilteredDocsStore", "DeleteFilteredDocsStoreParamsSchema", "z", "MemorySchema", "z", "GetAssetStoreParamsSchema", "CollectionParamsSchema", "RawUserIdSchema", "UserIdSchema", "FullPathSchema", "CountCollectionAssetsStoreParamsSchema", "CountAssetsStoreParamsSchema", "ListStoreParamsSchema", "SetAssetHandlerParamsSchema", "AssetKeySchema", "BlobSchema", "HeaderFieldsSchema", "DeleteAssetsStoreParamsSchema", "DeleteFilteredAssetsStoreParamsSchema", "DeleteAssetStoreParamsSchema", "SetAssetTokenStoreParamsSchema", "AssetAccessTokenSchema", "ListAssetsStoreParamsSchema", "GetContentChunksStoreParamsSchema", "AssetEncodingSchema", "MemorySchema", "jsonReplacer", "jsonReviver", "decodeDocData", "data", "encodeDocData", "countCollectionAssetsStore", "params", "CountCollectionAssetsStoreParamsSchema", "collection", "countAssetsStore", "CountAssetsStoreParamsSchema", "providedCaller", "listParams", "caller", "normalizeCaller", "setAssetHandler", "SetAssetHandlerParamsSchema", "key", "content", "headers", "deleteAssetStore", "DeleteAssetStoreParamsSchema", "full_path", "deleteAssetsStore", "DeleteAssetsStoreParamsSchema", "deleteFilteredAssetsStore", "DeleteFilteredAssetsStoreParamsSchema", "setAssetTokenStore", "SetAssetTokenStoreParamsSchema", "token", "getAssetStore", "GetAssetStoreParamsSchema", "listAssetsStore", "ListAssetsStoreParamsSchema", "getContentChunksStore", "GetContentChunksStoreParamsSchema", "encoding", "chunk_index", "memory"]
7
7
  }