@junobuild/functions 0.5.6 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +753 -323
  2. package/canisters/_canister.d.ts +1 -1
  3. package/canisters/cmc/index.js +1 -1
  4. package/canisters/index.js +1 -1
  5. package/canisters/ledger/icp/index.js +1 -1
  6. package/canisters/ledger/icrc/index.js +1 -1
  7. package/canisters/ledger/icrc/schemas.d.ts +1 -1
  8. package/canisters/schemas.d.ts +1 -1
  9. package/{chunk-5NZMOUKF.js → chunk-2LVPADWI.js} +2 -2
  10. package/chunk-7JYM2CKB.js +2 -0
  11. package/chunk-7JYM2CKB.js.map +7 -0
  12. package/chunk-HVIYPRXX.js +2 -0
  13. package/chunk-HVIYPRXX.js.map +7 -0
  14. package/{chunk-EMQQE34V.js → chunk-W42LR3ZN.js} +2 -2
  15. package/chunk-XRHVLXYG.js +2 -0
  16. package/functions/constants.d.ts +8 -0
  17. package/functions/query.d.ts +49 -0
  18. package/functions/schemas/function.d.ts +170 -0
  19. package/functions/update.d.ts +49 -0
  20. package/functions/wrappers.d.ts +1 -0
  21. package/global.d.ts +1 -0
  22. package/hooks/assertions.d.ts +57 -57
  23. package/hooks/hooks.d.ts +116 -116
  24. package/hooks/schemas/context.d.ts +1 -1
  25. package/hooks/schemas/db/context.d.ts +26 -26
  26. package/hooks/schemas/db/payload.d.ts +9 -9
  27. package/hooks/schemas/storage/context.d.ts +19 -19
  28. package/hooks/schemas/storage/payload.d.ts +3 -3
  29. package/ic-cdk/caller.ic-cdk.d.ts +15 -0
  30. package/ic-cdk/id.ic-cdk.d.ts +11 -1
  31. package/ic-cdk/schemas/call.d.ts +1 -1
  32. package/ic-cdk.d.ts +1 -0
  33. package/ic-cdk.js +1 -1
  34. package/ic-cdk.js.map +4 -4
  35. package/index.d.ts +5 -1
  36. package/index.js +1 -1
  37. package/index.js.map +4 -4
  38. package/package.json +3 -2
  39. package/schemas/candid.d.ts +5 -6
  40. package/schemas/db.d.ts +7 -8
  41. package/schemas/list.d.ts +1 -1
  42. package/schemas/satellite.d.ts +4 -3
  43. package/schemas/storage.d.ts +9 -9
  44. package/sdk/schemas/controllers.d.ts +4 -4
  45. package/sdk/schemas/db.d.ts +10 -10
  46. package/sdk/schemas/params.d.ts +2 -2
  47. package/sdk/schemas/storage.d.ts +12 -12
  48. package/sdk.js +1 -1
  49. package/sdk.js.map +4 -4
  50. package/src/global.d.ts +1 -0
  51. package/utils/zod.utils.d.ts +4 -1
  52. package/chunk-7B6WU32N.js +0 -2
  53. package/chunk-7B6WU32N.js.map +0 -7
  54. package/chunk-KVADXJMF.js +0 -2
  55. package/chunk-KVADXJMF.js.map +0 -7
  56. package/chunk-TZVF5LQY.js +0 -2
  57. /package/{chunk-5NZMOUKF.js.map → chunk-2LVPADWI.js.map} +0 -0
  58. /package/{chunk-EMQQE34V.js.map → chunk-W42LR3ZN.js.map} +0 -0
  59. /package/{chunk-TZVF5LQY.js.map → chunk-XRHVLXYG.js.map} +0 -0
  60. /package/{hooks/schemas → schemas}/satellite.env.d.ts +0 -0
@@ -4,7 +4,7 @@ import { type RawUserId } from '../../schemas/satellite';
4
4
  * @see HookContext
5
5
  */
6
6
  export declare const HookContextSchema: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodObject<{
7
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
7
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
8
8
  data: T;
9
9
  }, z.core.$strict>;
10
10
  /**
@@ -34,22 +34,22 @@ export interface DocContext<T> {
34
34
  * @see OnSetDocContext
35
35
  */
36
36
  export declare const OnSetDocContextSchema: z.ZodObject<{
37
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
37
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
38
38
  data: z.ZodObject<{
39
39
  collection: z.ZodString;
40
40
  key: z.ZodString;
41
41
  data: z.ZodObject<{
42
42
  before: z.ZodOptional<z.ZodObject<{
43
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
44
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
43
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
44
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
45
45
  description: z.ZodOptional<z.ZodString>;
46
46
  created_at: z.ZodBigInt;
47
47
  updated_at: z.ZodBigInt;
48
48
  version: z.ZodOptional<z.ZodBigInt>;
49
49
  }, z.core.$strict>>;
50
50
  after: z.ZodObject<{
51
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
52
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
51
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
52
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
53
53
  description: z.ZodOptional<z.ZodString>;
54
54
  created_at: z.ZodBigInt;
55
55
  updated_at: z.ZodBigInt;
@@ -69,22 +69,22 @@ export type OnSetDocContext = HookContext<DocContext<DocUpsert>>;
69
69
  * @see OnSetManyDocsContext
70
70
  */
71
71
  export declare const OnSetManyDocsContextSchema: z.ZodObject<{
72
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
72
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
73
73
  data: z.ZodArray<z.ZodObject<{
74
74
  collection: z.ZodString;
75
75
  key: z.ZodString;
76
76
  data: z.ZodObject<{
77
77
  before: z.ZodOptional<z.ZodObject<{
78
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
79
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
78
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
79
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
80
80
  description: z.ZodOptional<z.ZodString>;
81
81
  created_at: z.ZodBigInt;
82
82
  updated_at: z.ZodBigInt;
83
83
  version: z.ZodOptional<z.ZodBigInt>;
84
84
  }, z.core.$strict>>;
85
85
  after: z.ZodObject<{
86
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
87
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
86
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
87
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
88
88
  description: z.ZodOptional<z.ZodString>;
89
89
  created_at: z.ZodBigInt;
90
90
  updated_at: z.ZodBigInt;
@@ -104,13 +104,13 @@ export type OnSetManyDocsContext = HookContext<DocContext<DocUpsert>[]>;
104
104
  * @see OnDeleteDocContext
105
105
  */
106
106
  export declare const OnDeleteDocContextSchema: z.ZodObject<{
107
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
107
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
108
108
  data: z.ZodObject<{
109
109
  collection: z.ZodString;
110
110
  key: z.ZodString;
111
111
  data: z.ZodOptional<z.ZodObject<{
112
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
113
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
112
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
113
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
114
114
  description: z.ZodOptional<z.ZodString>;
115
115
  created_at: z.ZodBigInt;
116
116
  updated_at: z.ZodBigInt;
@@ -129,13 +129,13 @@ export type OnDeleteDocContext = HookContext<DocContext<OptionDoc>>;
129
129
  * @see OnDeleteManyDocsContext
130
130
  */
131
131
  export declare const OnDeleteManyDocsContextSchema: z.ZodObject<{
132
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
132
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
133
133
  data: z.ZodArray<z.ZodObject<{
134
134
  collection: z.ZodString;
135
135
  key: z.ZodString;
136
136
  data: z.ZodOptional<z.ZodObject<{
137
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
138
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
137
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
138
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
139
139
  description: z.ZodOptional<z.ZodString>;
140
140
  created_at: z.ZodBigInt;
141
141
  updated_at: z.ZodBigInt;
@@ -154,13 +154,13 @@ export type OnDeleteManyDocsContext = HookContext<DocContext<OptionDoc>[]>;
154
154
  * @see OnDeleteFilteredDocsContext
155
155
  */
156
156
  export declare const OnDeleteFilteredDocsContextSchema: z.ZodObject<{
157
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
157
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
158
158
  data: z.ZodArray<z.ZodObject<{
159
159
  collection: z.ZodString;
160
160
  key: z.ZodString;
161
161
  data: z.ZodOptional<z.ZodObject<{
162
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
163
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
162
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
163
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
164
164
  description: z.ZodOptional<z.ZodString>;
165
165
  created_at: z.ZodBigInt;
166
166
  updated_at: z.ZodBigInt;
@@ -179,21 +179,21 @@ export type OnDeleteFilteredDocsContext = HookContext<DocContext<OptionDoc>[]>;
179
179
  * @see AssertSetDocContext
180
180
  */
181
181
  export declare const AssertSetDocContextSchema: z.ZodObject<{
182
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
182
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
183
183
  data: z.ZodObject<{
184
184
  collection: z.ZodString;
185
185
  key: z.ZodString;
186
186
  data: z.ZodObject<{
187
187
  current: z.ZodOptional<z.ZodObject<{
188
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
189
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
188
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
189
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
190
190
  description: z.ZodOptional<z.ZodString>;
191
191
  created_at: z.ZodBigInt;
192
192
  updated_at: z.ZodBigInt;
193
193
  version: z.ZodOptional<z.ZodBigInt>;
194
194
  }, z.core.$strict>>;
195
195
  proposed: z.ZodObject<{
196
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
196
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
197
197
  description: z.ZodOptional<z.ZodString>;
198
198
  version: z.ZodOptional<z.ZodBigInt>;
199
199
  }, z.core.$strict>;
@@ -211,14 +211,14 @@ export type AssertSetDocContext = HookContext<DocContext<DocAssertSet>>;
211
211
  * @see AssertDeleteDocContext
212
212
  */
213
213
  export declare const AssertDeleteDocContextSchema: z.ZodObject<{
214
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
214
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
215
215
  data: z.ZodObject<{
216
216
  collection: z.ZodString;
217
217
  key: z.ZodString;
218
218
  data: z.ZodObject<{
219
219
  current: z.ZodOptional<z.ZodObject<{
220
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
221
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
220
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
221
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
222
222
  description: z.ZodOptional<z.ZodString>;
223
223
  created_at: z.ZodBigInt;
224
224
  updated_at: z.ZodBigInt;
@@ -5,16 +5,16 @@ import { type DelDoc, type Doc, type SetDoc } from '../../../schemas/db';
5
5
  */
6
6
  export declare const DocUpsertSchema: z.ZodObject<{
7
7
  before: z.ZodOptional<z.ZodObject<{
8
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
9
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
8
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
9
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
10
10
  description: z.ZodOptional<z.ZodString>;
11
11
  created_at: z.ZodBigInt;
12
12
  updated_at: z.ZodBigInt;
13
13
  version: z.ZodOptional<z.ZodBigInt>;
14
14
  }, z.core.$strict>>;
15
15
  after: z.ZodObject<{
16
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
17
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
16
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
17
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
18
18
  description: z.ZodOptional<z.ZodString>;
19
19
  created_at: z.ZodBigInt;
20
20
  updated_at: z.ZodBigInt;
@@ -42,15 +42,15 @@ export interface DocUpsert {
42
42
  */
43
43
  export declare const DocAssertSetSchema: z.ZodObject<{
44
44
  current: z.ZodOptional<z.ZodObject<{
45
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
46
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
45
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
46
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
47
47
  description: z.ZodOptional<z.ZodString>;
48
48
  created_at: z.ZodBigInt;
49
49
  updated_at: z.ZodBigInt;
50
50
  version: z.ZodOptional<z.ZodBigInt>;
51
51
  }, z.core.$strict>>;
52
52
  proposed: z.ZodObject<{
53
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
53
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
54
54
  description: z.ZodOptional<z.ZodString>;
55
55
  version: z.ZodOptional<z.ZodBigInt>;
56
56
  }, z.core.$strict>;
@@ -78,8 +78,8 @@ export interface DocAssertSet {
78
78
  */
79
79
  export declare const DocAssertDeleteSchema: z.ZodObject<{
80
80
  current: z.ZodOptional<z.ZodObject<{
81
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
82
- data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
81
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
82
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
83
83
  description: z.ZodOptional<z.ZodString>;
84
84
  created_at: z.ZodBigInt;
85
85
  updated_at: z.ZodBigInt;
@@ -6,14 +6,14 @@ import { type AssetAssertUpload } from './payload';
6
6
  * @see OnUploadAssetContext
7
7
  */
8
8
  export declare const OnUploadAssetContextSchema: z.ZodObject<{
9
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
9
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
10
10
  data: z.ZodObject<{
11
11
  key: z.ZodObject<{
12
12
  name: z.ZodString;
13
13
  full_path: z.ZodString;
14
14
  token: z.ZodOptional<z.ZodString>;
15
15
  collection: z.ZodString;
16
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
16
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
17
17
  description: z.ZodOptional<z.ZodString>;
18
18
  }, z.core.$strict>;
19
19
  headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
@@ -25,7 +25,7 @@ export declare const OnUploadAssetContextSchema: z.ZodObject<{
25
25
  br: "br";
26
26
  }>, z.ZodObject<{
27
27
  modified: z.ZodBigInt;
28
- content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
28
+ content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
29
29
  total_length: z.ZodBigInt;
30
30
  sha256: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
31
31
  }, z.core.$strip>], null>>;
@@ -44,14 +44,14 @@ export type OnUploadAssetContext = HookContext<Asset>;
44
44
  * @see OnDeleteAssetContext
45
45
  */
46
46
  export declare const OnDeleteAssetContextSchema: z.ZodObject<{
47
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
47
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
48
48
  data: z.ZodOptional<z.ZodObject<{
49
49
  key: z.ZodObject<{
50
50
  name: z.ZodString;
51
51
  full_path: z.ZodString;
52
52
  token: z.ZodOptional<z.ZodString>;
53
53
  collection: z.ZodString;
54
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
54
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
55
55
  description: z.ZodOptional<z.ZodString>;
56
56
  }, z.core.$strict>;
57
57
  headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
@@ -63,7 +63,7 @@ export declare const OnDeleteAssetContextSchema: z.ZodObject<{
63
63
  br: "br";
64
64
  }>, z.ZodObject<{
65
65
  modified: z.ZodBigInt;
66
- content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
66
+ content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
67
67
  total_length: z.ZodBigInt;
68
68
  sha256: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
69
69
  }, z.core.$strip>], null>>;
@@ -84,14 +84,14 @@ export type OnDeleteAssetContext = HookContext<Asset | undefined>;
84
84
  * @see OnDeleteManyAssetsContext
85
85
  */
86
86
  export declare const OnDeleteManyAssetsContextSchema: z.ZodObject<{
87
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
87
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
88
88
  data: z.ZodArray<z.ZodOptional<z.ZodObject<{
89
89
  key: z.ZodObject<{
90
90
  name: z.ZodString;
91
91
  full_path: z.ZodString;
92
92
  token: z.ZodOptional<z.ZodString>;
93
93
  collection: z.ZodString;
94
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
94
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
95
95
  description: z.ZodOptional<z.ZodString>;
96
96
  }, z.core.$strict>;
97
97
  headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
@@ -103,7 +103,7 @@ export declare const OnDeleteManyAssetsContextSchema: z.ZodObject<{
103
103
  br: "br";
104
104
  }>, z.ZodObject<{
105
105
  modified: z.ZodBigInt;
106
- content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
106
+ content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
107
107
  total_length: z.ZodBigInt;
108
108
  sha256: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
109
109
  }, z.core.$strip>], null>>;
@@ -122,14 +122,14 @@ export type OnDeleteManyAssetsContext = HookContext<Array<Asset | undefined>>;
122
122
  * @see OnDeleteFilteredAssetsContext
123
123
  */
124
124
  export declare const OnDeleteFilteredAssetsContextSchema: z.ZodObject<{
125
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
125
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
126
126
  data: z.ZodArray<z.ZodOptional<z.ZodObject<{
127
127
  key: z.ZodObject<{
128
128
  name: z.ZodString;
129
129
  full_path: z.ZodString;
130
130
  token: z.ZodOptional<z.ZodString>;
131
131
  collection: z.ZodString;
132
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
132
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
133
133
  description: z.ZodOptional<z.ZodString>;
134
134
  }, z.core.$strict>;
135
135
  headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
@@ -141,7 +141,7 @@ export declare const OnDeleteFilteredAssetsContextSchema: z.ZodObject<{
141
141
  br: "br";
142
142
  }>, z.ZodObject<{
143
143
  modified: z.ZodBigInt;
144
- content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
144
+ content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
145
145
  total_length: z.ZodBigInt;
146
146
  sha256: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
147
147
  }, z.core.$strip>], null>>;
@@ -160,7 +160,7 @@ export type OnDeleteFilteredAssetsContext = HookContext<Array<Asset | undefined>
160
160
  * @see AssertUploadAssetContext
161
161
  */
162
162
  export declare const AssertUploadAssetContextSchema: z.ZodObject<{
163
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
163
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
164
164
  data: z.ZodObject<{
165
165
  current: z.ZodOptional<z.ZodObject<{
166
166
  key: z.ZodObject<{
@@ -168,7 +168,7 @@ export declare const AssertUploadAssetContextSchema: z.ZodObject<{
168
168
  full_path: z.ZodString;
169
169
  token: z.ZodOptional<z.ZodString>;
170
170
  collection: z.ZodString;
171
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
171
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
172
172
  description: z.ZodOptional<z.ZodString>;
173
173
  }, z.core.$strict>;
174
174
  headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
@@ -180,7 +180,7 @@ export declare const AssertUploadAssetContextSchema: z.ZodObject<{
180
180
  br: "br";
181
181
  }>, z.ZodObject<{
182
182
  modified: z.ZodBigInt;
183
- content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
183
+ content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
184
184
  total_length: z.ZodBigInt;
185
185
  sha256: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
186
186
  }, z.core.$strip>], null>>;
@@ -194,7 +194,7 @@ export declare const AssertUploadAssetContextSchema: z.ZodObject<{
194
194
  full_path: z.ZodString;
195
195
  token: z.ZodOptional<z.ZodString>;
196
196
  collection: z.ZodString;
197
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
197
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
198
198
  description: z.ZodOptional<z.ZodString>;
199
199
  }, z.core.$strict>;
200
200
  reference_id: z.ZodOptional<z.ZodBigInt>;
@@ -224,14 +224,14 @@ export type AssertUploadAssetContext = HookContext<AssetAssertUpload>;
224
224
  * @see AssertDeleteAssetContext
225
225
  */
226
226
  export declare const AssertDeleteAssetContextSchema: z.ZodObject<{
227
- caller: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
227
+ caller: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
228
228
  data: z.ZodObject<{
229
229
  key: z.ZodObject<{
230
230
  name: z.ZodString;
231
231
  full_path: z.ZodString;
232
232
  token: z.ZodOptional<z.ZodString>;
233
233
  collection: z.ZodString;
234
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
234
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
235
235
  description: z.ZodOptional<z.ZodString>;
236
236
  }, z.core.$strict>;
237
237
  headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
@@ -243,7 +243,7 @@ export declare const AssertDeleteAssetContextSchema: z.ZodObject<{
243
243
  br: "br";
244
244
  }>, z.ZodObject<{
245
245
  modified: z.ZodBigInt;
246
- content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
246
+ content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
247
247
  total_length: z.ZodBigInt;
248
248
  sha256: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
249
249
  }, z.core.$strip>], null>>;
@@ -10,7 +10,7 @@ export declare const AssetAssertUploadSchema: z.ZodObject<{
10
10
  full_path: z.ZodString;
11
11
  token: z.ZodOptional<z.ZodString>;
12
12
  collection: z.ZodString;
13
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
13
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
14
14
  description: z.ZodOptional<z.ZodString>;
15
15
  }, z.core.$strict>;
16
16
  headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
@@ -22,7 +22,7 @@ export declare const AssetAssertUploadSchema: z.ZodObject<{
22
22
  br: "br";
23
23
  }>, z.ZodObject<{
24
24
  modified: z.ZodBigInt;
25
- content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
25
+ content_chunks: z.ZodArray<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
26
26
  total_length: z.ZodBigInt;
27
27
  sha256: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
28
28
  }, z.core.$strip>], null>>;
@@ -36,7 +36,7 @@ export declare const AssetAssertUploadSchema: z.ZodObject<{
36
36
  full_path: z.ZodString;
37
37
  token: z.ZodOptional<z.ZodString>;
38
38
  collection: z.ZodString;
39
- owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
39
+ owner: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
40
40
  description: z.ZodOptional<z.ZodString>;
41
41
  }, z.core.$strict>;
42
42
  reference_id: z.ZodOptional<z.ZodBigInt>;
@@ -0,0 +1,15 @@
1
+ import { Principal } from '@icp-sdk/core/principal';
2
+ /**
3
+ * Retrieves the caller's Principal ID.
4
+ *
5
+ * This function is a JavaScript binding for the Rust function
6
+ * [`ic_cdk::api::msg_caller()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.msg_caller.html), which returns
7
+ * the Principal of the caller of the current call.
8
+ *
9
+ * @returns {Principal} The Principal ID of the caller.
10
+ */
11
+ export declare const msgCaller: () => Principal;
12
+ /**
13
+ * @deprecated Use {@link msgCaller} instead.
14
+ */
15
+ export declare const caller: () => Principal;
@@ -3,9 +3,19 @@ import { Principal } from '@icp-sdk/core/principal';
3
3
  * Retrieves the Satellite's Principal ID.
4
4
  *
5
5
  * This function is a JavaScript binding for the Rust function
6
- * [`ic_cdk::id()`](https://docs.rs/ic-cdk/latest/ic_cdk/fn.id.html), which returns
6
+ * [`ic_cdk::api::canister_self()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.canister_self.html), which returns
7
7
  * the Principal of the executing canister.
8
8
  *
9
9
  * @returns {Principal} The Principal ID of the Satellite.
10
10
  */
11
+ export declare const canisterSelf: () => Principal;
12
+ /**
13
+ * @deprecated Use {@link canisterSelf} instead.
14
+ */
11
15
  export declare const id: () => Principal;
16
+ /**
17
+ * Retrieves the Satellite's Principal ID.
18
+ *
19
+ * @returns {Principal} The Principal ID of the Satellite.
20
+ */
21
+ export declare const satelliteSelf: () => Principal;
@@ -46,7 +46,7 @@ export type CallResult = z.infer<typeof CallResultSchema>;
46
46
  * @see CallParams
47
47
  */
48
48
  export declare const CallParamsSchema: z.ZodObject<{
49
- canisterId: z.ZodUnion<[z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z.ZodCustom<Principal, Principal>]>;
49
+ canisterId: z.ZodUnion<[z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodPipe<z.ZodCustom<Principal, Principal>, z.ZodTransform<Principal, Principal>>]>;
50
50
  method: z.ZodString;
51
51
  args: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodCustom<IDL.Type<unknown>, IDL.Type<unknown>>, z.ZodUnknown], null>>>;
52
52
  result: z.ZodOptional<z.ZodCustom<IDL.Type<unknown>, IDL.Type<unknown>>>;
package/ic-cdk.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './ic-cdk/call.ic-cdk';
2
+ export * from './ic-cdk/caller.ic-cdk';
2
3
  export * from './ic-cdk/id.ic-cdk';
3
4
  export * from './ic-cdk/schemas/call';
4
5
  export * from './ic-cdk/time.ic-cdk';
package/ic-cdk.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as o,b as t,c as p,d as c,e,f as m,g as n}from"./chunk-EMQQE34V.js";import"./chunk-7B6WU32N.js";import"./chunk-4C666HHU.js";import{Principal as r}from"@icp-sdk/core/principal";var f=()=>r.fromUint8Array(__ic_cdk_id());var a=()=>__ic_cdk_time();export{t as CallArgSchema,p as CallArgsSchema,e as CallParamsSchema,m as CallResponseLengthError,c as CallResultSchema,o as IDLTypeSchema,n as call,f as id,a as time};
1
+ import{a as c,b as n,c as e,d as l,e as a,f as m,g as f}from"./chunk-W42LR3ZN.js";import"./chunk-7JYM2CKB.js";import"./chunk-4C666HHU.js";import{Principal as o}from"@icp-sdk/core/principal";var t=()=>o.fromUint8Array(__ic_cdk_caller()),_=()=>t();import{Principal as p}from"@icp-sdk/core/principal";var r=()=>p.fromUint8Array(__ic_cdk_id()),d=()=>r(),k=()=>r();var u=()=>__ic_cdk_time();export{n as CallArgSchema,e as CallArgsSchema,a as CallParamsSchema,m as CallResponseLengthError,l as CallResultSchema,c as IDLTypeSchema,f as call,_ as caller,r as canisterSelf,d as id,t as msgCaller,k as satelliteSelf,u as time};
2
2
  //# sourceMappingURL=ic-cdk.js.map
package/ic-cdk.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["src/ic-cdk/id.ic-cdk.ts", "src/ic-cdk/time.ic-cdk.ts"],
4
- "sourcesContent": ["import {Principal} from '@icp-sdk/core/principal';\n\n/**\n * Retrieves the Satellite's Principal ID.\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::id()`](https://docs.rs/ic-cdk/latest/ic_cdk/fn.id.html), which returns\n * the Principal of the executing canister.\n *\n * @returns {Principal} The Principal ID of the Satellite.\n */\nexport const id = (): Principal => {\n const principal = Principal.fromUint8Array(__ic_cdk_id());\n\n // We assume the Principal is always built using the global function and is therefore always valid.\n // In other words, we do not validate it to conserve resources and optimize performance.\n\n return principal;\n};\n", "/**\n * Gets current timestamp, in nanoseconds since the epoch (1970-01-01)\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::time()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.time.html), which returns\n * the system time publicly exposed and verified part of the IC state tree\n *\n * @returns {bigint} The current timestamp.\n */\nexport const time = (): bigint => __ic_cdk_time();\n"],
5
- "mappings": "qIAAA,OAAQ,aAAAA,MAAgB,0BAWjB,IAAMC,EAAK,IACED,EAAU,eAAe,YAAY,CAAC,ECHnD,IAAME,EAAO,IAAc,cAAc",
6
- "names": ["Principal", "id", "time"]
3
+ "sources": ["src/ic-cdk/caller.ic-cdk.ts", "src/ic-cdk/id.ic-cdk.ts", "src/ic-cdk/time.ic-cdk.ts"],
4
+ "sourcesContent": ["import {Principal} from '@icp-sdk/core/principal';\n\n/**\n * Retrieves the caller's Principal ID.\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::api::msg_caller()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.msg_caller.html), which returns\n * the Principal of the caller of the current call.\n *\n * @returns {Principal} The Principal ID of the caller.\n */\nexport const msgCaller = (): Principal => {\n const principal = Principal.fromUint8Array(__ic_cdk_caller());\n\n return principal;\n};\n\n/**\n * @deprecated Use {@link msgCaller} instead.\n */\nexport const caller = (): Principal => msgCaller();\n", "import {Principal} from '@icp-sdk/core/principal';\n\n/**\n * Retrieves the Satellite's Principal ID.\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::api::canister_self()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.canister_self.html), which returns\n * the Principal of the executing canister.\n *\n * @returns {Principal} The Principal ID of the Satellite.\n */\nexport const canisterSelf = (): Principal => {\n const principal = Principal.fromUint8Array(__ic_cdk_id());\n\n // We assume the Principal is always built using the global function and is therefore always valid.\n // In other words, we do not validate it to conserve resources and optimize performance.\n\n return principal;\n};\n\n/**\n * @deprecated Use {@link canisterSelf} instead.\n */\nexport const id = (): Principal => canisterSelf();\n\n/**\n * Retrieves the Satellite's Principal ID.\n *\n * @returns {Principal} The Principal ID of the Satellite.\n */\nexport const satelliteSelf = (): Principal => canisterSelf();\n", "/**\n * Gets current timestamp, in nanoseconds since the epoch (1970-01-01)\n *\n * This function is a JavaScript binding for the Rust function\n * [`ic_cdk::time()`](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.time.html), which returns\n * the system time publicly exposed and verified part of the IC state tree\n *\n * @returns {bigint} The current timestamp.\n */\nexport const time = (): bigint => __ic_cdk_time();\n"],
5
+ "mappings": "0IAAA,OAAQ,aAAAA,MAAgB,0BAWjB,IAAMC,EAAY,IACLD,EAAU,eAAe,gBAAgB,CAAC,EAQjDE,EAAS,IAAiBD,EAAU,ECpBjD,OAAQ,aAAAE,MAAgB,0BAWjB,IAAMC,EAAe,IACRD,EAAU,eAAe,YAAY,CAAC,EAW7CE,EAAK,IAAiBD,EAAa,EAOnCE,EAAgB,IAAiBF,EAAa,ECrBpD,IAAMG,EAAO,IAAc,cAAc",
6
+ "names": ["Principal", "msgCaller", "caller", "Principal", "canisterSelf", "id", "satelliteSelf", "time"]
7
7
  }
package/index.d.ts CHANGED
@@ -1,16 +1,20 @@
1
+ export * from './functions/query';
2
+ export * from './functions/schemas/function';
3
+ export * from './functions/update';
1
4
  export * from './hooks/assertions';
2
5
  export * from './hooks/hooks';
3
6
  export * from './hooks/schemas/collections';
4
7
  export * from './hooks/schemas/context';
5
8
  export * from './hooks/schemas/db/context';
6
9
  export * from './hooks/schemas/db/payload';
7
- export * from './hooks/schemas/satellite.env';
8
10
  export * from './hooks/schemas/storage/context';
9
11
  export * from './hooks/schemas/storage/payload';
10
12
  export * from './schemas/candid';
11
13
  export * from './schemas/db';
12
14
  export * from './schemas/list';
13
15
  export * from './schemas/satellite';
16
+ export * from './schemas/satellite.env';
14
17
  export * from './schemas/storage';
18
+ import './functions/wrappers';
15
19
  import './polyfills/console.polyfill';
16
20
  import './polyfills/random.polyfill';
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{A as Ue,B as Me,C as je,D as ve,a as ie,b as De,c as z,d as Ae,e as F,f as H,g as ye,h as Se,i as n,j as Oe,k as b,l as U,m as de,n as he,o as Ce,p as fe,q as r,r as Te,s as M,t as j,u as ue,v as ke,w as ze,x as Fe,y as He,z as be}from"./chunk-KVADXJMF.js";import{a as xe,b as me,c as le}from"./chunk-7B6WU32N.js";import"./chunk-4C666HHU.js";import*as a from"zod";import*as v from"zod";var c=e=>v.custom(i=>e.implement(i));import*as m from"zod";var A=m.object({collections:m.array(m.string()).readonly()}).strict();import*as o from"zod";var t=e=>o.strictObject({caller:z,data:e}),_=e=>c(o.function({input:o.tuple([e]),output:o.void()})),Z=e=>c(o.function({input:o.tuple([e]),output:o.promise(o.void()).or(o.void())}));import*as l from"zod";import*as y from"zod";var C=y.object({before:n.optional(),after:n}).strict(),R=y.object({current:n.optional(),proposed:b}).strict(),g=y.object({current:n.optional(),proposed:U}).strict();var p=e=>l.strictObject({collection:F,key:H,data:e}),E=t(p(C)),B=t(l.array(p(C))),f=t(p(n.optional())),T=t(l.array(p(n.optional()))),u=t(l.array(p(n.optional()))),w=t(p(R)),I=t(p(g));import*as D from"zod";var S=D.record(D.string(),D.string());import*as k from"zod";import*as K from"zod";var P=K.object({current:r.optional(),batch:M,commit_batch:j}).strict();var J=t(r),N=t(r.optional()),q=t(k.array(r.optional())),G=t(k.array(r.optional())),L=t(P),Q=t(r);var O=e=>A.extend({assert:_(e)}).strict(),V=O(w),W=O(I),X=O(L),Y=O(Q),st=a.union([V,W,X,Y]),$=e=>a.function({input:a.tuple([S]),output:e}),rt=e=>a.union([e,c($(e))]);function ct(e){return e}import*as x from"zod";var s=e=>A.extend({run:Z(e)}).strict(),ee=s(E),te=s(B),At=s(f),yt=s(T),St=s(u),oe=s(J),ne=s(N),se=s(q),re=s(G),Ot=x.union([ee,te,f,T,u,oe,ne,se,re]),ce=e=>x.function({input:x.tuple([S]),output:e}),dt=e=>x.union([e,c(ce(e))]);function ht(e){return e}import{jsonReplacer as pe}from"@dfinity/utils";var d=e=>{let i=e.map(h=>typeof h=="object"?JSON.stringify(h,pe):h).join(" ");globalThis.__ic_cdk_print(i)};globalThis.console={info(...e){d(e)},log(...e){d(e)},warn(...e){d(e)},error(...e){d(e)}};var ae=()=>(__juno_satellite_random()>>>0)/4294967296;globalThis.Math.random=ae;export{Q as AssertDeleteAssetContextSchema,Y as AssertDeleteAssetSchema,I as AssertDeleteDocContextSchema,W as AssertDeleteDocSchema,rt as AssertFnOrObjectSchema,$ as AssertFnSchema,_ as AssertFunctionSchema,st as AssertSchema,w as AssertSetDocContextSchema,V as AssertSetDocSchema,L as AssertUploadAssetContextSchema,X as AssertUploadAssetSchema,ke as AssetAccessTokenSchema,P as AssetAssertUploadSchema,fe as AssetEncodingSchema,Ce as AssetKeySchema,Te as AssetNoContentSchema,r as AssetSchema,M as BatchSchema,he as BlobSchema,F as CollectionSchema,A as CollectionsSchema,j as CommitBatchSchema,U as DelDocSchema,ye as DescriptionSchema,g as DocAssertDeleteSchema,R as DocAssertSetSchema,p as DocContextSchema,n as DocSchema,C as DocUpsertSchema,ue as FullPathSchema,de as HeaderFieldsSchema,t as HookContextSchema,dt as HookFnOrObjectSchema,ce as HookFnSchema,Ot as HookSchema,H as KeySchema,He as ListMatcherSchema,Ue as ListOrderFieldSchema,Me as ListOrderSchema,be as ListPaginateSchema,je as ListParamsSchema,N as OnDeleteAssetContextSchema,ne as OnDeleteAssetSchema,f as OnDeleteDocContextSchema,At as OnDeleteDocSchema,G as OnDeleteFilteredAssetsContextSchema,re as OnDeleteFilteredAssetsSchema,u as OnDeleteFilteredDocsContextSchema,St as OnDeleteFilteredDocsSchema,q as OnDeleteManyAssetsContextSchema,se as OnDeleteManyAssetsSchema,T as OnDeleteManyDocsContextSchema,yt as OnDeleteManyDocsSchema,E as OnSetDocContextSchema,ee as OnSetDocSchema,B as OnSetManyDocsContextSchema,te as OnSetManyDocsSchema,J as OnUploadAssetContextSchema,oe as OnUploadAssetSchema,ze as OptionAssetSchema,Oe as OptionDocSchema,le as PrincipalSchema,Se as RawDataSchema,me as RawPrincipalSchema,z as RawUserIdSchema,Z as RunFunctionSchema,S as SatelliteEnvSchema,b as SetDocSchema,Fe as TimestampMatcherSchema,ie as TimestampSchema,xe as Uint8ArraySchema,Ae as UserIdSchema,De as VersionSchema,ve as createListResultsSchema,ct as defineAssert,ht as defineHook};
1
+ import{A as Xe,B as $e,C as et,D as tt,E as W,F as Q,a as _e,b as ve,c as I,d as Ee,e as J,f as K,g as We,h as Qe,i as u,j as Ne,k as q,l as G,m as Me,n as Pe,o as Be,p as Ye,q as m,r as Ie,s as L,t as V,u as Je,v as Ke,w as qe,x as Ge,y as Le,z as Ve}from"./chunk-HVIYPRXX.js";import{a as je,b as we,c as He}from"./chunk-7JYM2CKB.js";import"./chunk-4C666HHU.js";import*as s from"zod";import*as O from"zod";var d=O.record(O.string(),O.string());import*as X from"zod";var n=e=>X.custom(o=>typeof o=="function"&&e.implement(o));var i={QUERY:"__juno_function_query",UPDATE:"__juno_function_update"};import*as t from"zod";var U=t.strictObject({type:t.enum([i.QUERY,i.UPDATE])}),C=t.strictObject({...U.shape,args:t.instanceof(t.ZodObject),result:t.instanceof(t.ZodObject),handler:n(t.function({input:t.tuple([t.unknown()]),output:t.union([t.unknown(),t.promise(t.unknown())])}))}),R=t.strictObject({...U.shape,args:t.instanceof(t.ZodObject),handler:n(t.function({input:t.tuple([t.unknown()]),output:t.union([t.void(),t.promise(t.void())])}))}),F=t.strictObject({...U.shape,result:t.instanceof(t.ZodObject),handler:n(t.function({input:t.tuple([]),output:t.union([t.unknown(),t.promise(t.unknown())])}))}),g=t.strictObject({...U.shape,handler:n(t.function({input:t.tuple([]),output:t.union([t.void(),t.promise(t.void())])}))}),ct=t.union([C,R,F,g]);var Z=s.strictObject({type:s.literal(i.QUERY)}),k=s.union([s.strictObject({...C.shape,...Z.shape}),s.strictObject({...R.shape,...Z.shape}),s.strictObject({...F.shape,...Z.shape}),s.strictObject({...g.shape,...Z.shape})]),he=e=>s.function({input:s.tuple([d]),output:e}),dt=e=>s.union([e,n(he(e))]);function xt(e){if(typeof e=="function")return a=>{let x={...e(a),type:i.QUERY};return k.parse(x),x};let o={...e,type:i.QUERY};return k.parse(o),o}import*as r from"zod";var b=r.strictObject({type:r.literal(i.UPDATE)}),j=r.union([r.strictObject({...C.shape,...b.shape}),r.strictObject({...R.shape,...b.shape}),r.strictObject({...F.shape,...b.shape}),r.strictObject({...g.shape,...b.shape})]),Te=e=>r.function({input:r.tuple([d]),output:e}),zt=e=>r.union([e,n(Te(e))]);function Dt(e){if(typeof e=="function")return a=>{let x={...e(a),type:i.UPDATE};return j.parse(x),x};let o={...e,type:i.UPDATE};return j.parse(o),o}import*as T from"zod";import*as z from"zod";var w=z.object({collections:z.array(z.string()).readonly()}).strict();import*as c from"zod";var p=e=>c.strictObject({caller:I,data:e}),$=e=>n(c.function({input:c.tuple([e]),output:c.void()})),ee=e=>n(c.function({input:c.tuple([e]),output:c.promise(c.void()).or(c.void())}));import*as D from"zod";import*as H from"zod";var N=H.object({before:u.optional(),after:u}).strict(),te=H.object({current:u.optional(),proposed:q}).strict(),oe=H.object({current:u.optional(),proposed:G}).strict();var h=e=>D.strictObject({collection:J,key:K,data:e}),ne=p(h(N)),se=p(D.array(h(N))),M=p(h(u.optional())),P=p(D.array(h(u.optional()))),B=p(D.array(h(u.optional()))),re=p(h(te)),pe=p(h(oe));import*as Y from"zod";import*as ce from"zod";var ae=ce.object({current:m.optional(),batch:L,commit_batch:V}).strict();var ie=p(m),ue=p(m.optional()),le=p(Y.array(m.optional())),me=p(Y.array(m.optional())),de=p(ae),xe=p(m);var _=e=>w.extend({assert:$(e)}).strict(),ye=_(re),Se=_(pe),ze=_(de),De=_(xe),Jt=T.union([ye,Se,ze,De]),fe=e=>T.function({input:T.tuple([d]),output:e}),Kt=e=>T.union([e,n(fe(e))]);function qt(e){return e}import*as y from"zod";var l=e=>w.extend({run:ee(e)}).strict(),Oe=l(ne),Ce=l(se),oo=l(M),no=l(P),so=l(B),Re=l(ie),Fe=l(ue),ge=l(le),Ue=l(me),ro=y.union([Oe,Ce,M,P,B,Re,Fe,ge,Ue]),Ze=e=>y.function({input:y.tuple([d]),output:e}),po=e=>y.union([e,n(Ze(e))]);function co(e){return e}import{nonNullish as f}from"@dfinity/utils";import*as S from"zod";var Ae=S.union([k,j]);globalThis.__juno_satellite_fn_invoke_sync=(e,o)=>{Ae.parse(e);let a="args"in e&&e.args instanceof S.ZodType?e.args?.parse(f(o)?W(o):void 0):void 0,E=f(a)?e.handler(a):e.handler(),A="result"in e&&e.result instanceof S.ZodType?e.result?.parse(E):void 0;globalThis.jsResult=f(A)?Q(A):A};globalThis.__juno_satellite_fn_invoke_async=async(e,o)=>{Ae.parse(e);let a="args"in e&&e.args instanceof S.ZodType?e.args?.parse(f(o)?W(o):void 0):void 0,E=await(async()=>f(a)?await e.handler(a):await e.handler())(),A="result"in e&&e.result instanceof S.ZodType?e.result?.parse(E):void 0;globalThis.jsResult=f(A)?Q(A):A};import{jsonReplacer as ke}from"@dfinity/utils";var v=e=>{let o=e.map(a=>typeof a=="object"?JSON.stringify(a,ke):a).join(" ");globalThis.__ic_cdk_print(o)};globalThis.console={info(...e){v(e)},log(...e){v(e)},warn(...e){v(e)},error(...e){v(e)}};var be=()=>(__juno_satellite_random()>>>0)/4294967296;globalThis.Math.random=be;export{xe as AssertDeleteAssetContextSchema,De as AssertDeleteAssetSchema,pe as AssertDeleteDocContextSchema,Se as AssertDeleteDocSchema,Kt as AssertFnOrObjectSchema,fe as AssertFnSchema,$ as AssertFunctionSchema,Jt as AssertSchema,re as AssertSetDocContextSchema,ye as AssertSetDocSchema,de as AssertUploadAssetContextSchema,ze as AssertUploadAssetSchema,Ke as AssetAccessTokenSchema,ae as AssetAssertUploadSchema,Ye as AssetEncodingSchema,Be as AssetKeySchema,Ie as AssetNoContentSchema,m as AssetSchema,L as BatchSchema,Pe as BlobSchema,J as CollectionSchema,w as CollectionsSchema,V as CommitBatchSchema,ct as CustomFunctionSchema,C as CustomFunctionWithArgsAndResultSchema,R as CustomFunctionWithArgsSchema,F as CustomFunctionWithResultSchema,g as CustomFunctionWithoutArgsAndResultSchema,G as DelDocSchema,We as DescriptionSchema,oe as DocAssertDeleteSchema,te as DocAssertSetSchema,h as DocContextSchema,u as DocSchema,N as DocUpsertSchema,Je as FullPathSchema,Me as HeaderFieldsSchema,p as HookContextSchema,po as HookFnOrObjectSchema,Ze as HookFnSchema,ro as HookSchema,K as KeySchema,Le as ListMatcherSchema,Xe as ListOrderFieldSchema,$e as ListOrderSchema,Ve as ListPaginateSchema,et as ListParamsSchema,ue as OnDeleteAssetContextSchema,Fe as OnDeleteAssetSchema,M as OnDeleteDocContextSchema,oo as OnDeleteDocSchema,me as OnDeleteFilteredAssetsContextSchema,Ue as OnDeleteFilteredAssetsSchema,B as OnDeleteFilteredDocsContextSchema,so as OnDeleteFilteredDocsSchema,le as OnDeleteManyAssetsContextSchema,ge as OnDeleteManyAssetsSchema,P as OnDeleteManyDocsContextSchema,no as OnDeleteManyDocsSchema,ne as OnSetDocContextSchema,Oe as OnSetDocSchema,se as OnSetManyDocsContextSchema,Ce as OnSetManyDocsSchema,ie as OnUploadAssetContextSchema,Re as OnUploadAssetSchema,qe as OptionAssetSchema,Ne as OptionDocSchema,He as PrincipalSchema,dt as QueryFnOrObjectSchema,he as QueryFnSchema,k as QuerySchema,Qe as RawDataSchema,we as RawPrincipalSchema,I as RawUserIdSchema,ee as RunFunctionSchema,d as SatelliteEnvSchema,q as SetDocSchema,Ge as TimestampMatcherSchema,_e as TimestampSchema,je as Uint8ArraySchema,zt as UpdateFnOrObjectSchema,Te as UpdateFnSchema,j as UpdateSchema,Ee as UserIdSchema,ve as VersionSchema,tt as createListResultsSchema,qt as defineAssert,co as defineHook,xt as defineQuery,Dt as defineUpdate};
2
2
  //# sourceMappingURL=index.js.map