@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 { Collection } from '../../schemas/satellite';
|
|
2
3
|
/**
|
|
3
4
|
* @see Collections
|
|
4
5
|
*/
|
|
5
6
|
export declare const CollectionsSchema: z.ZodObject<{
|
|
6
|
-
/**
|
|
7
|
-
* An array of collection names where the hook or assertion will run.
|
|
8
|
-
* If empty, no hooks or assertions are triggered.
|
|
9
|
-
*/
|
|
10
7
|
collections: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
|
|
11
8
|
}, "strict", z.ZodTypeAny, {
|
|
12
9
|
collections: readonly string[];
|
|
@@ -16,4 +13,10 @@ export declare const CollectionsSchema: z.ZodObject<{
|
|
|
16
13
|
/**
|
|
17
14
|
* Defines the collections where a hook or assertion should run.
|
|
18
15
|
*/
|
|
19
|
-
export
|
|
16
|
+
export interface Collections {
|
|
17
|
+
/**
|
|
18
|
+
* An array of collection names where the hook or assertion will run.
|
|
19
|
+
* If empty, no hooks or assertions are triggered.
|
|
20
|
+
*/
|
|
21
|
+
collections: readonly Collection[];
|
|
22
|
+
}
|
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
import type { baseObjectInputType, baseObjectOutputType, ZodObject, ZodTypeAny } from 'zod';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
+
import { type RawUserId } from '../../schemas/satellite';
|
|
3
4
|
/**
|
|
4
5
|
* @see HookContext
|
|
5
6
|
*/
|
|
6
7
|
export declare const HookContextSchema: <T extends z.ZodTypeAny>(dataSchema: T) => ZodObject<{
|
|
7
|
-
/**
|
|
8
|
-
* The user who originally triggered the function that in turn triggered the hook.
|
|
9
|
-
*/
|
|
10
8
|
caller: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
11
|
-
/**
|
|
12
|
-
* The data associated with the hook execution.
|
|
13
|
-
*/
|
|
14
9
|
data: T;
|
|
15
10
|
}, "strict", ZodTypeAny, baseObjectOutputType<{
|
|
16
|
-
/**
|
|
17
|
-
* The user who originally triggered the function that in turn triggered the hook.
|
|
18
|
-
*/
|
|
19
11
|
caller: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
20
|
-
/**
|
|
21
|
-
* The data associated with the hook execution.
|
|
22
|
-
*/
|
|
23
12
|
data: T;
|
|
24
13
|
}>, baseObjectInputType<{
|
|
25
|
-
/**
|
|
26
|
-
* The user who originally triggered the function that in turn triggered the hook.
|
|
27
|
-
*/
|
|
28
14
|
caller: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
|
|
29
|
-
/**
|
|
30
|
-
* The data associated with the hook execution.
|
|
31
|
-
*/
|
|
32
15
|
data: T;
|
|
33
16
|
}>>;
|
|
34
17
|
/**
|
|
@@ -36,7 +19,16 @@ export declare const HookContextSchema: <T extends z.ZodTypeAny>(dataSchema: T)
|
|
|
36
19
|
*
|
|
37
20
|
* @template T - The type of data associated with the hook.
|
|
38
21
|
*/
|
|
39
|
-
export
|
|
22
|
+
export interface HookContext<T> {
|
|
23
|
+
/**
|
|
24
|
+
* The user who originally triggered the function that in turn triggered the hook.
|
|
25
|
+
*/
|
|
26
|
+
caller: RawUserId;
|
|
27
|
+
/**
|
|
28
|
+
* The data associated with the hook execution.
|
|
29
|
+
*/
|
|
30
|
+
data: T;
|
|
31
|
+
}
|
|
40
32
|
/**
|
|
41
33
|
* @see AssertFunction
|
|
42
34
|
*/
|
|
@@ -48,7 +40,7 @@ export declare const AssertFunctionSchema: <T extends z.ZodTypeAny>(contextSchem
|
|
|
48
40
|
*
|
|
49
41
|
* @template T - The type of context passed to the function.
|
|
50
42
|
*/
|
|
51
|
-
export type AssertFunction<T> =
|
|
43
|
+
export type AssertFunction<T> = (context: T) => void;
|
|
52
44
|
/**
|
|
53
45
|
* @see RunFunction
|
|
54
46
|
*/
|
|
@@ -60,4 +52,4 @@ export declare const RunFunctionSchema: <T extends z.ZodTypeAny>(contextSchema:
|
|
|
60
52
|
*
|
|
61
53
|
* @template T - The type of context passed to the function.
|
|
62
54
|
*/
|
|
63
|
-
export type RunFunction<T> =
|
|
55
|
+
export type RunFunction<T> = (context: T) => void | Promise<void>;
|