@junobuild/functions 0.0.12 → 0.0.13
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 +994 -213
- package/chunk-6G6FWQ45.js +2 -0
- package/chunk-6G6FWQ45.js.map +7 -0
- package/global.d.ts +11 -6
- package/hooks/assertions.d.ts +7149 -0
- package/hooks/hooks.d.ts +10529 -0
- package/hooks/schemas/collections.d.ts +8 -5
- package/hooks/schemas/context.d.ts +13 -21
- package/hooks/schemas/db/context.d.ts +2119 -247
- package/hooks/schemas/db/payload.d.ts +96 -52
- package/hooks/schemas/storage/context.d.ts +2010 -0
- package/hooks/schemas/storage/payload.d.ts +248 -0
- package/ic-cdk/schemas/call.d.ts +23 -16
- package/ic-cdk.js +1 -1
- package/ic-cdk.js.map +2 -2
- package/index.d.ts +5 -2
- package/index.js +1 -1
- package/index.js.map +4 -4
- package/package.json +1 -1
- package/schemas/db.d.ts +98 -15
- package/schemas/satellite.d.ts +9 -0
- package/schemas/storage.d.ts +307 -0
- package/sdk/db.sdk.d.ts +11 -1
- package/sdk/schemas/db.d.ts +66 -61
- package/sdk.js +1 -1
- package/sdk.js.map +3 -3
- package/src/global.d.ts +11 -6
- package/chunk-LVVTFR6B.js +0 -2
- package/chunk-LVVTFR6B.js.map +0 -7
- package/hooks/db/assertions.d.ts +0 -2127
- package/hooks/db/hooks.d.ts +0 -2577
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
+
import { type DelDoc, type Doc, type SetDoc } from '../../../schemas/db';
|
|
2
3
|
/**
|
|
3
4
|
* @see DocUpsert
|
|
4
5
|
*/
|
|
5
6
|
export declare const DocUpsertSchema: z.ZodObject<{
|
|
6
|
-
/**
|
|
7
|
-
* The previous version of the document before the update.
|
|
8
|
-
* Undefined if this is a new document.
|
|
9
|
-
*/
|
|
10
7
|
before: z.ZodOptional<z.ZodObject<{
|
|
11
8
|
owner: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
12
9
|
data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
@@ -29,9 +26,6 @@ export declare const DocUpsertSchema: z.ZodObject<{
|
|
|
29
26
|
description?: string | undefined;
|
|
30
27
|
version?: bigint | undefined;
|
|
31
28
|
}>>;
|
|
32
|
-
/**
|
|
33
|
-
* The new version of the document after the update.
|
|
34
|
-
*/
|
|
35
29
|
after: z.ZodObject<{
|
|
36
30
|
owner: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
37
31
|
data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
@@ -94,45 +88,21 @@ export declare const DocUpsertSchema: z.ZodObject<{
|
|
|
94
88
|
*
|
|
95
89
|
* This is used in hooks where a document is either being created or updated.
|
|
96
90
|
*/
|
|
97
|
-
export
|
|
98
|
-
/**
|
|
99
|
-
* @see ProposedDoc
|
|
100
|
-
*/
|
|
101
|
-
export declare const ProposedDocSchema: z.ZodObject<{
|
|
102
|
-
/**
|
|
103
|
-
* The raw data of the document.
|
|
104
|
-
*/
|
|
105
|
-
data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
91
|
+
export interface DocUpsert {
|
|
106
92
|
/**
|
|
107
|
-
*
|
|
93
|
+
* The previous version of the document before the update.
|
|
94
|
+
* Undefined if this is a new document.
|
|
108
95
|
*/
|
|
109
|
-
|
|
96
|
+
before?: Doc;
|
|
110
97
|
/**
|
|
111
|
-
* The
|
|
98
|
+
* The new version of the document after the update.
|
|
112
99
|
*/
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
data: Uint8Array<ArrayBufferLike>;
|
|
116
|
-
description?: string | undefined;
|
|
117
|
-
version?: bigint | undefined;
|
|
118
|
-
}, {
|
|
119
|
-
data: Uint8Array<ArrayBufferLike>;
|
|
120
|
-
description?: string | undefined;
|
|
121
|
-
version?: bigint | undefined;
|
|
122
|
-
}>;
|
|
123
|
-
/**
|
|
124
|
-
* Represents the proposed version of a document.
|
|
125
|
-
* This can be validated before allowing the operation.
|
|
126
|
-
*/
|
|
127
|
-
export type ProposedDoc = z.infer<typeof ProposedDocSchema>;
|
|
100
|
+
after: Doc;
|
|
101
|
+
}
|
|
128
102
|
/**
|
|
129
103
|
* @see DocAssertSet
|
|
130
104
|
*/
|
|
131
105
|
export declare const DocAssertSetSchema: z.ZodObject<{
|
|
132
|
-
/**
|
|
133
|
-
* The current version of the document before the operation.
|
|
134
|
-
* Undefined if this is a new document.
|
|
135
|
-
*/
|
|
136
106
|
current: z.ZodOptional<z.ZodObject<{
|
|
137
107
|
owner: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
138
108
|
data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
@@ -155,22 +125,9 @@ export declare const DocAssertSetSchema: z.ZodObject<{
|
|
|
155
125
|
description?: string | undefined;
|
|
156
126
|
version?: bigint | undefined;
|
|
157
127
|
}>>;
|
|
158
|
-
/**
|
|
159
|
-
* The proposed version of the document.
|
|
160
|
-
* This can be validated before allowing the operation.
|
|
161
|
-
*/
|
|
162
128
|
proposed: z.ZodObject<{
|
|
163
|
-
/**
|
|
164
|
-
* The raw data of the document.
|
|
165
|
-
*/
|
|
166
129
|
data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
167
|
-
/**
|
|
168
|
-
* An optional description of the document.
|
|
169
|
-
*/
|
|
170
130
|
description: z.ZodOptional<z.ZodString>;
|
|
171
|
-
/**
|
|
172
|
-
* The expected version number to ensure consistency.
|
|
173
|
-
*/
|
|
174
131
|
version: z.ZodOptional<z.ZodBigInt>;
|
|
175
132
|
}, "strict", z.ZodTypeAny, {
|
|
176
133
|
data: Uint8Array<ArrayBufferLike>;
|
|
@@ -216,4 +173,91 @@ export declare const DocAssertSetSchema: z.ZodObject<{
|
|
|
216
173
|
* The developer can compare the `current` and `proposed` versions and
|
|
217
174
|
* throw an error if their validation fails.
|
|
218
175
|
*/
|
|
219
|
-
export
|
|
176
|
+
export interface DocAssertSet {
|
|
177
|
+
/**
|
|
178
|
+
* The current version of the document before the operation.
|
|
179
|
+
* Undefined if this is a new document.
|
|
180
|
+
*/
|
|
181
|
+
current?: Doc;
|
|
182
|
+
/**
|
|
183
|
+
* The proposed version of the document.
|
|
184
|
+
* This can be validated before allowing the operation.
|
|
185
|
+
*/
|
|
186
|
+
proposed: SetDoc;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* @see DocAssertDelete
|
|
190
|
+
*/
|
|
191
|
+
export declare const DocAssertDeleteSchema: z.ZodObject<{
|
|
192
|
+
current: z.ZodOptional<z.ZodObject<{
|
|
193
|
+
owner: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
194
|
+
data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
195
|
+
description: z.ZodOptional<z.ZodString>;
|
|
196
|
+
created_at: z.ZodBigInt;
|
|
197
|
+
updated_at: z.ZodBigInt;
|
|
198
|
+
version: z.ZodOptional<z.ZodBigInt>;
|
|
199
|
+
}, "strict", z.ZodTypeAny, {
|
|
200
|
+
owner: Uint8Array<ArrayBufferLike>;
|
|
201
|
+
data: Uint8Array<ArrayBufferLike>;
|
|
202
|
+
created_at: bigint;
|
|
203
|
+
updated_at: bigint;
|
|
204
|
+
description?: string | undefined;
|
|
205
|
+
version?: bigint | undefined;
|
|
206
|
+
}, {
|
|
207
|
+
owner: Uint8Array<ArrayBufferLike>;
|
|
208
|
+
data: Uint8Array<ArrayBufferLike>;
|
|
209
|
+
created_at: bigint;
|
|
210
|
+
updated_at: bigint;
|
|
211
|
+
description?: string | undefined;
|
|
212
|
+
version?: bigint | undefined;
|
|
213
|
+
}>>;
|
|
214
|
+
proposed: z.ZodObject<{
|
|
215
|
+
version: z.ZodOptional<z.ZodBigInt>;
|
|
216
|
+
}, "strict", z.ZodTypeAny, {
|
|
217
|
+
version?: bigint | undefined;
|
|
218
|
+
}, {
|
|
219
|
+
version?: bigint | undefined;
|
|
220
|
+
}>;
|
|
221
|
+
}, "strict", z.ZodTypeAny, {
|
|
222
|
+
proposed: {
|
|
223
|
+
version?: bigint | undefined;
|
|
224
|
+
};
|
|
225
|
+
current?: {
|
|
226
|
+
owner: Uint8Array<ArrayBufferLike>;
|
|
227
|
+
data: Uint8Array<ArrayBufferLike>;
|
|
228
|
+
created_at: bigint;
|
|
229
|
+
updated_at: bigint;
|
|
230
|
+
description?: string | undefined;
|
|
231
|
+
version?: bigint | undefined;
|
|
232
|
+
} | undefined;
|
|
233
|
+
}, {
|
|
234
|
+
proposed: {
|
|
235
|
+
version?: bigint | undefined;
|
|
236
|
+
};
|
|
237
|
+
current?: {
|
|
238
|
+
owner: Uint8Array<ArrayBufferLike>;
|
|
239
|
+
data: Uint8Array<ArrayBufferLike>;
|
|
240
|
+
created_at: bigint;
|
|
241
|
+
updated_at: bigint;
|
|
242
|
+
description?: string | undefined;
|
|
243
|
+
version?: bigint | undefined;
|
|
244
|
+
} | undefined;
|
|
245
|
+
}>;
|
|
246
|
+
/**
|
|
247
|
+
* Represents a validation check before deleting a document.
|
|
248
|
+
*
|
|
249
|
+
* The developer can compare the `current` and `proposed` versions and
|
|
250
|
+
* throw an error if their validation fails.
|
|
251
|
+
*/
|
|
252
|
+
export interface DocAssertDelete {
|
|
253
|
+
/**
|
|
254
|
+
* The current version of the document before the operation.
|
|
255
|
+
* Undefined if the document does not exist.
|
|
256
|
+
*/
|
|
257
|
+
current?: Doc;
|
|
258
|
+
/**
|
|
259
|
+
* The proposed version of the document.
|
|
260
|
+
* This can be validated before allowing the operation.
|
|
261
|
+
*/
|
|
262
|
+
proposed: DelDoc;
|
|
263
|
+
}
|