@junobuild/functions 0.1.4 → 0.2.1

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/schemas/db.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import * as z from 'zod';
1
+ import * as z from 'zod/v4';
2
2
  import { Uint8ArraySchema } from './candid';
3
3
  import { type Description, type RawUserId, type Timestamp, type Version } from './satellite';
4
4
  /**
5
5
  * @see RawData
6
6
  */
7
- export declare const RawDataSchema: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
7
+ export declare const RawDataSchema: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
8
8
  /**
9
9
  * Represents raw binary data.
10
10
  *
@@ -15,27 +15,13 @@ export type RawData = z.infer<typeof Uint8ArraySchema>;
15
15
  * @see Doc
16
16
  */
17
17
  export declare const DocSchema: z.ZodObject<{
18
- owner: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
19
- data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
18
+ owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
19
+ data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
20
20
  description: z.ZodOptional<z.ZodString>;
21
21
  created_at: z.ZodBigInt;
22
22
  updated_at: z.ZodBigInt;
23
23
  version: z.ZodOptional<z.ZodBigInt>;
24
- }, "strict", z.ZodTypeAny, {
25
- owner: Uint8Array<ArrayBufferLike>;
26
- data: Uint8Array<ArrayBufferLike>;
27
- created_at: bigint;
28
- updated_at: bigint;
29
- description?: string | undefined;
30
- version?: bigint | undefined;
31
- }, {
32
- owner: Uint8Array<ArrayBufferLike>;
33
- data: Uint8Array<ArrayBufferLike>;
34
- created_at: bigint;
35
- updated_at: bigint;
36
- description?: string | undefined;
37
- version?: bigint | undefined;
38
- }>;
24
+ }, z.core.$strict>;
39
25
  /**
40
26
  * Represents a document stored in a collection.
41
27
  */
@@ -70,27 +56,13 @@ export interface Doc {
70
56
  * @see OptionDoc
71
57
  */
72
58
  export declare const OptionDocSchema: z.ZodOptional<z.ZodObject<{
73
- owner: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
74
- data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
59
+ owner: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
60
+ data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
75
61
  description: z.ZodOptional<z.ZodString>;
76
62
  created_at: z.ZodBigInt;
77
63
  updated_at: z.ZodBigInt;
78
64
  version: z.ZodOptional<z.ZodBigInt>;
79
- }, "strict", z.ZodTypeAny, {
80
- owner: Uint8Array<ArrayBufferLike>;
81
- data: Uint8Array<ArrayBufferLike>;
82
- created_at: bigint;
83
- updated_at: bigint;
84
- description?: string | undefined;
85
- version?: bigint | undefined;
86
- }, {
87
- owner: Uint8Array<ArrayBufferLike>;
88
- data: Uint8Array<ArrayBufferLike>;
89
- created_at: bigint;
90
- updated_at: bigint;
91
- description?: string | undefined;
92
- version?: bigint | undefined;
93
- }>>;
65
+ }, z.core.$strict>>;
94
66
  /**
95
67
  * A shorthand for a document that might or not be defined.
96
68
  */
@@ -99,18 +71,10 @@ export type OptionDoc = Doc | undefined;
99
71
  * @see SetDoc
100
72
  */
101
73
  export declare const SetDocSchema: z.ZodObject<{
102
- data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
74
+ data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
103
75
  description: z.ZodOptional<z.ZodString>;
104
76
  version: z.ZodOptional<z.ZodBigInt>;
105
- }, "strict", z.ZodTypeAny, {
106
- data: Uint8Array<ArrayBufferLike>;
107
- description?: string | undefined;
108
- version?: bigint | undefined;
109
- }, {
110
- data: Uint8Array<ArrayBufferLike>;
111
- description?: string | undefined;
112
- version?: bigint | undefined;
113
- }>;
77
+ }, z.core.$strict>;
114
78
  /**
115
79
  * Represents the proposed version of a document to be created or updated.
116
80
  * This can be validated before allowing the operation.
@@ -134,11 +98,7 @@ export interface SetDoc {
134
98
  */
135
99
  export declare const DelDocSchema: z.ZodObject<{
136
100
  version: z.ZodOptional<z.ZodBigInt>;
137
- }, "strict", z.ZodTypeAny, {
138
- version?: bigint | undefined;
139
- }, {
140
- version?: bigint | undefined;
141
- }>;
101
+ }, z.core.$strict>;
142
102
  /**
143
103
  * Represents the proposed version of a document to be deleted.
144
104
  * This can be validated before allowing the operation.
package/schemas/list.d.ts CHANGED
@@ -1,33 +1,17 @@
1
- import * as z from 'zod';
1
+ import * as z from 'zod/v4';
2
2
  import { type Description, type Key, type RawUserId, type Timestamp } from './satellite';
3
3
  /**
4
4
  * @see TimestampMatcher
5
5
  */
6
- export declare const TimestampMatcherSchema: z.ZodUnion<[z.ZodObject<{
6
+ export declare const TimestampMatcherSchema: z.ZodUnion<readonly [z.ZodObject<{
7
7
  equal: z.ZodBigInt;
8
- }, "strip", z.ZodTypeAny, {
9
- equal: bigint;
10
- }, {
11
- equal: bigint;
12
- }>, z.ZodObject<{
8
+ }, z.core.$strip>, z.ZodObject<{
13
9
  greater_than: z.ZodBigInt;
14
- }, "strip", z.ZodTypeAny, {
15
- greater_than: bigint;
16
- }, {
17
- greater_than: bigint;
18
- }>, z.ZodObject<{
10
+ }, z.core.$strip>, z.ZodObject<{
19
11
  less_than: z.ZodBigInt;
20
- }, "strip", z.ZodTypeAny, {
21
- less_than: bigint;
22
- }, {
23
- less_than: bigint;
24
- }>, z.ZodObject<{
12
+ }, z.core.$strip>, z.ZodObject<{
25
13
  between: z.ZodTuple<[z.ZodBigInt, z.ZodBigInt], null>;
26
- }, "strip", z.ZodTypeAny, {
27
- between: [bigint, bigint];
28
- }, {
29
- between: [bigint, bigint];
30
- }>]>;
14
+ }, z.core.$strip>]>;
31
15
  /**
32
16
  * TimestampMatcher matches a timestamp field using a specific strategy.
33
17
  */
@@ -46,99 +30,25 @@ export type TimestampMatcher = {
46
30
  export declare const ListMatcherSchema: z.ZodObject<{
47
31
  key: z.ZodOptional<z.ZodString>;
48
32
  description: z.ZodOptional<z.ZodString>;
49
- created_at: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
33
+ created_at: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
50
34
  equal: z.ZodBigInt;
51
- }, "strip", z.ZodTypeAny, {
52
- equal: bigint;
53
- }, {
54
- equal: bigint;
55
- }>, z.ZodObject<{
35
+ }, z.core.$strip>, z.ZodObject<{
56
36
  greater_than: z.ZodBigInt;
57
- }, "strip", z.ZodTypeAny, {
58
- greater_than: bigint;
59
- }, {
60
- greater_than: bigint;
61
- }>, z.ZodObject<{
37
+ }, z.core.$strip>, z.ZodObject<{
62
38
  less_than: z.ZodBigInt;
63
- }, "strip", z.ZodTypeAny, {
64
- less_than: bigint;
65
- }, {
66
- less_than: bigint;
67
- }>, z.ZodObject<{
39
+ }, z.core.$strip>, z.ZodObject<{
68
40
  between: z.ZodTuple<[z.ZodBigInt, z.ZodBigInt], null>;
69
- }, "strip", z.ZodTypeAny, {
70
- between: [bigint, bigint];
71
- }, {
72
- between: [bigint, bigint];
73
- }>]>>;
74
- updated_at: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
41
+ }, z.core.$strip>]>>;
42
+ updated_at: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
75
43
  equal: z.ZodBigInt;
76
- }, "strip", z.ZodTypeAny, {
77
- equal: bigint;
78
- }, {
79
- equal: bigint;
80
- }>, z.ZodObject<{
44
+ }, z.core.$strip>, z.ZodObject<{
81
45
  greater_than: z.ZodBigInt;
82
- }, "strip", z.ZodTypeAny, {
83
- greater_than: bigint;
84
- }, {
85
- greater_than: bigint;
86
- }>, z.ZodObject<{
46
+ }, z.core.$strip>, z.ZodObject<{
87
47
  less_than: z.ZodBigInt;
88
- }, "strip", z.ZodTypeAny, {
89
- less_than: bigint;
90
- }, {
91
- less_than: bigint;
92
- }>, z.ZodObject<{
48
+ }, z.core.$strip>, z.ZodObject<{
93
49
  between: z.ZodTuple<[z.ZodBigInt, z.ZodBigInt], null>;
94
- }, "strip", z.ZodTypeAny, {
95
- between: [bigint, bigint];
96
- }, {
97
- between: [bigint, bigint];
98
- }>]>>;
99
- }, "strict", z.ZodTypeAny, {
100
- description?: string | undefined;
101
- created_at?: {
102
- equal: bigint;
103
- } | {
104
- greater_than: bigint;
105
- } | {
106
- less_than: bigint;
107
- } | {
108
- between: [bigint, bigint];
109
- } | undefined;
110
- updated_at?: {
111
- equal: bigint;
112
- } | {
113
- greater_than: bigint;
114
- } | {
115
- less_than: bigint;
116
- } | {
117
- between: [bigint, bigint];
118
- } | undefined;
119
- key?: string | undefined;
120
- }, {
121
- description?: string | undefined;
122
- created_at?: {
123
- equal: bigint;
124
- } | {
125
- greater_than: bigint;
126
- } | {
127
- less_than: bigint;
128
- } | {
129
- between: [bigint, bigint];
130
- } | undefined;
131
- updated_at?: {
132
- equal: bigint;
133
- } | {
134
- greater_than: bigint;
135
- } | {
136
- less_than: bigint;
137
- } | {
138
- between: [bigint, bigint];
139
- } | undefined;
140
- key?: string | undefined;
141
- }>;
50
+ }, z.core.$strip>]>>;
51
+ }, z.core.$strict>;
142
52
  /**
143
53
  * Matcher used to filter list results.
144
54
  */
@@ -154,13 +64,7 @@ export interface ListMatcher {
154
64
  export declare const ListPaginateSchema: z.ZodObject<{
155
65
  start_after: z.ZodOptional<z.ZodString>;
156
66
  limit: z.ZodOptional<z.ZodBigInt>;
157
- }, "strict", z.ZodTypeAny, {
158
- start_after?: string | undefined;
159
- limit?: bigint | undefined;
160
- }, {
161
- start_after?: string | undefined;
162
- limit?: bigint | undefined;
163
- }>;
67
+ }, z.core.$strict>;
164
68
  /**
165
69
  * Optional pagination controls for listing.
166
70
  */
@@ -171,7 +75,11 @@ export interface ListPaginate {
171
75
  /**
172
76
  * @see ListOrderField
173
77
  */
174
- export declare const ListOrderFieldSchema: z.ZodEnum<["keys", "created_at", "updated_at"]>;
78
+ export declare const ListOrderFieldSchema: z.ZodEnum<{
79
+ created_at: "created_at";
80
+ updated_at: "updated_at";
81
+ keys: "keys";
82
+ }>;
175
83
  /**
176
84
  * Enum representing possible fields to order by.
177
85
  */
@@ -181,14 +89,12 @@ export type ListOrderField = 'keys' | 'updated_at' | 'created_at';
181
89
  */
182
90
  export declare const ListOrderSchema: z.ZodObject<{
183
91
  desc: z.ZodBoolean;
184
- field: z.ZodEnum<["keys", "created_at", "updated_at"]>;
185
- }, "strict", z.ZodTypeAny, {
186
- desc: boolean;
187
- field: "keys" | "created_at" | "updated_at";
188
- }, {
189
- desc: boolean;
190
- field: "keys" | "created_at" | "updated_at";
191
- }>;
92
+ field: z.ZodEnum<{
93
+ created_at: "created_at";
94
+ updated_at: "updated_at";
95
+ keys: "keys";
96
+ }>;
97
+ }, z.core.$strict>;
192
98
  /**
193
99
  * Ordering strategy for listing documents.
194
100
  */
@@ -203,185 +109,39 @@ export declare const ListParamsSchema: z.ZodObject<{
203
109
  matcher: z.ZodOptional<z.ZodObject<{
204
110
  key: z.ZodOptional<z.ZodString>;
205
111
  description: z.ZodOptional<z.ZodString>;
206
- created_at: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
112
+ created_at: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
207
113
  equal: z.ZodBigInt;
208
- }, "strip", z.ZodTypeAny, {
209
- equal: bigint;
210
- }, {
211
- equal: bigint;
212
- }>, z.ZodObject<{
114
+ }, z.core.$strip>, z.ZodObject<{
213
115
  greater_than: z.ZodBigInt;
214
- }, "strip", z.ZodTypeAny, {
215
- greater_than: bigint;
216
- }, {
217
- greater_than: bigint;
218
- }>, z.ZodObject<{
116
+ }, z.core.$strip>, z.ZodObject<{
219
117
  less_than: z.ZodBigInt;
220
- }, "strip", z.ZodTypeAny, {
221
- less_than: bigint;
222
- }, {
223
- less_than: bigint;
224
- }>, z.ZodObject<{
118
+ }, z.core.$strip>, z.ZodObject<{
225
119
  between: z.ZodTuple<[z.ZodBigInt, z.ZodBigInt], null>;
226
- }, "strip", z.ZodTypeAny, {
227
- between: [bigint, bigint];
228
- }, {
229
- between: [bigint, bigint];
230
- }>]>>;
231
- updated_at: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
120
+ }, z.core.$strip>]>>;
121
+ updated_at: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
232
122
  equal: z.ZodBigInt;
233
- }, "strip", z.ZodTypeAny, {
234
- equal: bigint;
235
- }, {
236
- equal: bigint;
237
- }>, z.ZodObject<{
123
+ }, z.core.$strip>, z.ZodObject<{
238
124
  greater_than: z.ZodBigInt;
239
- }, "strip", z.ZodTypeAny, {
240
- greater_than: bigint;
241
- }, {
242
- greater_than: bigint;
243
- }>, z.ZodObject<{
125
+ }, z.core.$strip>, z.ZodObject<{
244
126
  less_than: z.ZodBigInt;
245
- }, "strip", z.ZodTypeAny, {
246
- less_than: bigint;
247
- }, {
248
- less_than: bigint;
249
- }>, z.ZodObject<{
127
+ }, z.core.$strip>, z.ZodObject<{
250
128
  between: z.ZodTuple<[z.ZodBigInt, z.ZodBigInt], null>;
251
- }, "strip", z.ZodTypeAny, {
252
- between: [bigint, bigint];
253
- }, {
254
- between: [bigint, bigint];
255
- }>]>>;
256
- }, "strict", z.ZodTypeAny, {
257
- description?: string | undefined;
258
- created_at?: {
259
- equal: bigint;
260
- } | {
261
- greater_than: bigint;
262
- } | {
263
- less_than: bigint;
264
- } | {
265
- between: [bigint, bigint];
266
- } | undefined;
267
- updated_at?: {
268
- equal: bigint;
269
- } | {
270
- greater_than: bigint;
271
- } | {
272
- less_than: bigint;
273
- } | {
274
- between: [bigint, bigint];
275
- } | undefined;
276
- key?: string | undefined;
277
- }, {
278
- description?: string | undefined;
279
- created_at?: {
280
- equal: bigint;
281
- } | {
282
- greater_than: bigint;
283
- } | {
284
- less_than: bigint;
285
- } | {
286
- between: [bigint, bigint];
287
- } | undefined;
288
- updated_at?: {
289
- equal: bigint;
290
- } | {
291
- greater_than: bigint;
292
- } | {
293
- less_than: bigint;
294
- } | {
295
- between: [bigint, bigint];
296
- } | undefined;
297
- key?: string | undefined;
298
- }>>;
129
+ }, z.core.$strip>]>>;
130
+ }, z.core.$strict>>;
299
131
  paginate: z.ZodOptional<z.ZodObject<{
300
132
  start_after: z.ZodOptional<z.ZodString>;
301
133
  limit: z.ZodOptional<z.ZodBigInt>;
302
- }, "strict", z.ZodTypeAny, {
303
- start_after?: string | undefined;
304
- limit?: bigint | undefined;
305
- }, {
306
- start_after?: string | undefined;
307
- limit?: bigint | undefined;
308
- }>>;
134
+ }, z.core.$strict>>;
309
135
  order: z.ZodOptional<z.ZodObject<{
310
136
  desc: z.ZodBoolean;
311
- field: z.ZodEnum<["keys", "created_at", "updated_at"]>;
312
- }, "strict", z.ZodTypeAny, {
313
- desc: boolean;
314
- field: "keys" | "created_at" | "updated_at";
315
- }, {
316
- desc: boolean;
317
- field: "keys" | "created_at" | "updated_at";
318
- }>>;
319
- owner: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
320
- }, "strict", z.ZodTypeAny, {
321
- owner?: Uint8Array<ArrayBufferLike> | undefined;
322
- matcher?: {
323
- description?: string | undefined;
324
- created_at?: {
325
- equal: bigint;
326
- } | {
327
- greater_than: bigint;
328
- } | {
329
- less_than: bigint;
330
- } | {
331
- between: [bigint, bigint];
332
- } | undefined;
333
- updated_at?: {
334
- equal: bigint;
335
- } | {
336
- greater_than: bigint;
337
- } | {
338
- less_than: bigint;
339
- } | {
340
- between: [bigint, bigint];
341
- } | undefined;
342
- key?: string | undefined;
343
- } | undefined;
344
- paginate?: {
345
- start_after?: string | undefined;
346
- limit?: bigint | undefined;
347
- } | undefined;
348
- order?: {
349
- desc: boolean;
350
- field: "keys" | "created_at" | "updated_at";
351
- } | undefined;
352
- }, {
353
- owner?: Uint8Array<ArrayBufferLike> | undefined;
354
- matcher?: {
355
- description?: string | undefined;
356
- created_at?: {
357
- equal: bigint;
358
- } | {
359
- greater_than: bigint;
360
- } | {
361
- less_than: bigint;
362
- } | {
363
- between: [bigint, bigint];
364
- } | undefined;
365
- updated_at?: {
366
- equal: bigint;
367
- } | {
368
- greater_than: bigint;
369
- } | {
370
- less_than: bigint;
371
- } | {
372
- between: [bigint, bigint];
373
- } | undefined;
374
- key?: string | undefined;
375
- } | undefined;
376
- paginate?: {
377
- start_after?: string | undefined;
378
- limit?: bigint | undefined;
379
- } | undefined;
380
- order?: {
381
- desc: boolean;
382
- field: "keys" | "created_at" | "updated_at";
383
- } | undefined;
384
- }>;
137
+ field: z.ZodEnum<{
138
+ created_at: "created_at";
139
+ updated_at: "updated_at";
140
+ keys: "keys";
141
+ }>;
142
+ }, z.core.$strict>>;
143
+ owner: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
144
+ }, z.core.$strict>;
385
145
  /**
386
146
  * Full set of listing parameters.
387
147
  */
@@ -398,24 +158,12 @@ export interface ListParams {
398
158
  * @see JsListResults
399
159
  */
400
160
  export declare const createListResultsSchema: <T extends z.ZodTypeAny>(itemData: T) => z.ZodObject<{
401
- items: z.ZodArray<z.ZodTuple<[z.ZodString, T], null>, "many">;
161
+ items: z.ZodArray<z.ZodTuple<[z.ZodString, T], null>>;
402
162
  items_length: z.ZodBigInt;
403
163
  items_page: z.ZodOptional<z.ZodBigInt>;
404
164
  matches_length: z.ZodBigInt;
405
165
  matches_pages: z.ZodOptional<z.ZodBigInt>;
406
- }, "strict", z.ZodTypeAny, {
407
- items: [string, T extends z.ZodType<any, any, any> ? T["_output"] : never][];
408
- items_length: bigint;
409
- matches_length: bigint;
410
- items_page?: bigint | undefined;
411
- matches_pages?: bigint | undefined;
412
- }, {
413
- items: [string, T extends z.ZodType<any, any, any> ? T["_input"] : never][];
414
- items_length: bigint;
415
- matches_length: bigint;
416
- items_page?: bigint | undefined;
417
- matches_pages?: bigint | undefined;
418
- }>;
166
+ }, z.core.$strict>;
419
167
  /**
420
168
  * List results, parameterized by type of returned item.
421
169
  */
@@ -1,4 +1,4 @@
1
- import * as z from 'zod';
1
+ import * as z from 'zod/v4';
2
2
  /**
3
3
  * @see Timestamp
4
4
  */
@@ -22,7 +22,7 @@ export type Version = z.infer<typeof VersionSchema>;
22
22
  /**
23
23
  * @see RawUserId
24
24
  */
25
- export declare const RawUserIdSchema: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
25
+ export declare const RawUserIdSchema: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
26
26
  /**
27
27
  * Represents a raw user identifier.
28
28
  *
@@ -32,7 +32,7 @@ export type RawUserId = z.infer<typeof RawUserIdSchema>;
32
32
  /**
33
33
  * @see UserId
34
34
  */
35
- export declare const UserIdSchema: z.ZodType<import("@dfinity/principal").Principal, z.ZodTypeDef, import("@dfinity/principal").Principal>;
35
+ export declare const UserIdSchema: z.ZodCustom<import("@dfinity/principal").Principal, import("@dfinity/principal").Principal>;
36
36
  /**
37
37
  * Represents a user identifier.
38
38
  *