@farcaster/frame-core 0.0.14 → 0.0.16
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/dist/schemas/embeds.d.ts +1 -2
- package/dist/schemas/embeds.js +7 -6
- package/dist/schemas/events.d.ts +1 -1
- package/dist/schemas/manifest.d.ts +17 -1
- package/dist/schemas/manifest.js +4 -6
- package/dist/schemas/notifications.d.ts +1 -1
- package/dist/schemas/shared.d.ts +2 -1
- package/dist/schemas/shared.js +9 -3
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/schemas/embeds.d.ts +177 -0
- package/esm/schemas/embeds.js +22 -0
- package/esm/schemas/events.d.ts +131 -0
- package/esm/schemas/events.js +22 -0
- package/esm/schemas/index.d.ts +5 -0
- package/esm/schemas/index.js +5 -0
- package/esm/schemas/manifest.d.ts +112 -0
- package/esm/schemas/manifest.js +19 -0
- package/esm/schemas/notifications.d.ts +60 -0
- package/esm/schemas/notifications.js +20 -0
- package/esm/schemas/shared.d.ts +33 -0
- package/esm/schemas/shared.js +23 -0
- package/esm/tsconfig.tsbuildinfo +1 -0
- package/esm/types.d.ts +108 -0
- package/esm/types.js +3 -0
- package/package.json +2 -1
- package/src/schemas/embeds.ts +14 -8
- package/src/schemas/events.ts +2 -4
- package/src/schemas/manifest.ts +12 -8
- package/src/schemas/notifications.ts +2 -2
- package/src/schemas/shared.ts +17 -7
- package/src/types.ts +3 -3
package/dist/schemas/embeds.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
export declare const actionLaunchFrameSchema: z.ZodObject<{
|
|
3
3
|
type: z.ZodLiteral<"launch_frame">;
|
|
4
4
|
name: z.ZodString;
|
|
@@ -37,7 +37,6 @@ export declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
|
|
|
37
37
|
splashImageUrl?: string | undefined;
|
|
38
38
|
splashBackgroundColor?: string | undefined;
|
|
39
39
|
}>]>;
|
|
40
|
-
export declare const buttonTitleSchema: z.ZodString;
|
|
41
40
|
export declare const buttonSchema: z.ZodObject<{
|
|
42
41
|
title: z.ZodString;
|
|
43
42
|
action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
package/dist/schemas/embeds.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.safeParseFrameEmbed = exports.frameEmbedNextSchema = exports.buttonSchema = exports.
|
|
3
|
+
exports.safeParseFrameEmbed = exports.frameEmbedNextSchema = exports.buttonSchema = exports.actionSchema = exports.actionLaunchFrameSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const shared_1 = require("./shared");
|
|
6
6
|
exports.actionLaunchFrameSchema = zod_1.z.object({
|
|
7
|
-
type: zod_1.z.literal(
|
|
7
|
+
type: zod_1.z.literal("launch_frame"),
|
|
8
8
|
name: shared_1.frameNameSchema,
|
|
9
9
|
url: shared_1.secureUrlSchema,
|
|
10
10
|
splashImageUrl: shared_1.secureUrlSchema.optional(),
|
|
11
11
|
splashBackgroundColor: shared_1.hexColorSchema.optional(),
|
|
12
12
|
});
|
|
13
|
-
exports.actionSchema = zod_1.z.discriminatedUnion(
|
|
14
|
-
exports.
|
|
13
|
+
exports.actionSchema = zod_1.z.discriminatedUnion("type", [
|
|
14
|
+
exports.actionLaunchFrameSchema,
|
|
15
|
+
]);
|
|
15
16
|
exports.buttonSchema = zod_1.z.object({
|
|
16
|
-
title:
|
|
17
|
+
title: shared_1.buttonTitleSchema,
|
|
17
18
|
action: exports.actionSchema,
|
|
18
19
|
});
|
|
19
20
|
exports.frameEmbedNextSchema = zod_1.z.object({
|
|
20
|
-
version: zod_1.z.literal(
|
|
21
|
+
version: zod_1.z.literal("next"),
|
|
21
22
|
imageUrl: shared_1.secureUrlSchema,
|
|
22
23
|
button: exports.buttonSchema,
|
|
23
24
|
});
|
package/dist/schemas/events.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
export declare const domainFrameConfigSchema: z.ZodObject<{
|
|
3
3
|
version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">]>;
|
|
4
4
|
name: z.ZodString;
|
|
5
5
|
iconUrl: z.ZodString;
|
|
6
6
|
homeUrl: z.ZodString;
|
|
7
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
8
|
+
buttonTitle: z.ZodOptional<z.ZodString>;
|
|
7
9
|
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
8
10
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
9
11
|
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -14,6 +16,8 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
|
|
|
14
16
|
homeUrl: string;
|
|
15
17
|
splashImageUrl?: string | undefined;
|
|
16
18
|
splashBackgroundColor?: string | undefined;
|
|
19
|
+
imageUrl?: string | undefined;
|
|
20
|
+
buttonTitle?: string | undefined;
|
|
17
21
|
webhookUrl?: string | undefined;
|
|
18
22
|
}, {
|
|
19
23
|
name: string;
|
|
@@ -22,6 +26,8 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
|
|
|
22
26
|
homeUrl: string;
|
|
23
27
|
splashImageUrl?: string | undefined;
|
|
24
28
|
splashBackgroundColor?: string | undefined;
|
|
29
|
+
imageUrl?: string | undefined;
|
|
30
|
+
buttonTitle?: string | undefined;
|
|
25
31
|
webhookUrl?: string | undefined;
|
|
26
32
|
}>;
|
|
27
33
|
export declare const domainManifestSchema: z.ZodObject<{
|
|
@@ -43,6 +49,8 @@ export declare const domainManifestSchema: z.ZodObject<{
|
|
|
43
49
|
name: z.ZodString;
|
|
44
50
|
iconUrl: z.ZodString;
|
|
45
51
|
homeUrl: z.ZodString;
|
|
52
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
53
|
+
buttonTitle: z.ZodOptional<z.ZodString>;
|
|
46
54
|
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
47
55
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
48
56
|
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -53,6 +61,8 @@ export declare const domainManifestSchema: z.ZodObject<{
|
|
|
53
61
|
homeUrl: string;
|
|
54
62
|
splashImageUrl?: string | undefined;
|
|
55
63
|
splashBackgroundColor?: string | undefined;
|
|
64
|
+
imageUrl?: string | undefined;
|
|
65
|
+
buttonTitle?: string | undefined;
|
|
56
66
|
webhookUrl?: string | undefined;
|
|
57
67
|
}, {
|
|
58
68
|
name: string;
|
|
@@ -61,6 +71,8 @@ export declare const domainManifestSchema: z.ZodObject<{
|
|
|
61
71
|
homeUrl: string;
|
|
62
72
|
splashImageUrl?: string | undefined;
|
|
63
73
|
splashBackgroundColor?: string | undefined;
|
|
74
|
+
imageUrl?: string | undefined;
|
|
75
|
+
buttonTitle?: string | undefined;
|
|
64
76
|
webhookUrl?: string | undefined;
|
|
65
77
|
}>>;
|
|
66
78
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -76,6 +88,8 @@ export declare const domainManifestSchema: z.ZodObject<{
|
|
|
76
88
|
homeUrl: string;
|
|
77
89
|
splashImageUrl?: string | undefined;
|
|
78
90
|
splashBackgroundColor?: string | undefined;
|
|
91
|
+
imageUrl?: string | undefined;
|
|
92
|
+
buttonTitle?: string | undefined;
|
|
79
93
|
webhookUrl?: string | undefined;
|
|
80
94
|
} | undefined;
|
|
81
95
|
}, {
|
|
@@ -91,6 +105,8 @@ export declare const domainManifestSchema: z.ZodObject<{
|
|
|
91
105
|
homeUrl: string;
|
|
92
106
|
splashImageUrl?: string | undefined;
|
|
93
107
|
splashBackgroundColor?: string | undefined;
|
|
108
|
+
imageUrl?: string | undefined;
|
|
109
|
+
buttonTitle?: string | undefined;
|
|
94
110
|
webhookUrl?: string | undefined;
|
|
95
111
|
} | undefined;
|
|
96
112
|
}>;
|
package/dist/schemas/manifest.js
CHANGED
|
@@ -6,17 +6,15 @@ const shared_1 = require("./shared");
|
|
|
6
6
|
exports.domainFrameConfigSchema = zod_1.z.object({
|
|
7
7
|
// 0.0.0 and 0.0.1 are not technically part of the spec but kept for
|
|
8
8
|
// backwards compatibilty
|
|
9
|
-
version: zod_1.z.union([
|
|
10
|
-
zod_1.z.literal('0.0.0'),
|
|
11
|
-
zod_1.z.literal('0.0.1'),
|
|
12
|
-
zod_1.z.literal('1')
|
|
13
|
-
]),
|
|
9
|
+
version: zod_1.z.union([zod_1.z.literal("0.0.0"), zod_1.z.literal("0.0.1"), zod_1.z.literal("1")]),
|
|
14
10
|
name: shared_1.frameNameSchema,
|
|
15
11
|
iconUrl: shared_1.secureUrlSchema,
|
|
16
12
|
homeUrl: shared_1.secureUrlSchema,
|
|
13
|
+
imageUrl: shared_1.secureUrlSchema.optional(),
|
|
14
|
+
buttonTitle: shared_1.buttonTitleSchema.optional(),
|
|
17
15
|
splashImageUrl: shared_1.secureUrlSchema.optional(),
|
|
18
16
|
splashBackgroundColor: shared_1.hexColorSchema.optional(),
|
|
19
|
-
webhookUrl: shared_1.secureUrlSchema.optional()
|
|
17
|
+
webhookUrl: shared_1.secureUrlSchema.optional(),
|
|
20
18
|
});
|
|
21
19
|
exports.domainManifestSchema = zod_1.z.object({
|
|
22
20
|
accountAssociation: shared_1.encodedJsonFarcasterSignatureSchema,
|
package/dist/schemas/shared.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
export declare const secureUrlSchema: z.ZodString;
|
|
3
3
|
export declare const frameNameSchema: z.ZodString;
|
|
4
|
+
export declare const buttonTitleSchema: z.ZodString;
|
|
4
5
|
export declare const hexColorSchema: z.ZodString;
|
|
5
6
|
export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<{
|
|
6
7
|
header: z.ZodString;
|
package/dist/schemas/shared.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsonFarcasterSignatureHeaderSchema = exports.encodedJsonFarcasterSignatureSchema = exports.hexColorSchema = exports.frameNameSchema = exports.secureUrlSchema = void 0;
|
|
3
|
+
exports.jsonFarcasterSignatureHeaderSchema = exports.encodedJsonFarcasterSignatureSchema = exports.hexColorSchema = exports.buttonTitleSchema = exports.frameNameSchema = exports.secureUrlSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.secureUrlSchema = zod_1.z
|
|
5
|
+
exports.secureUrlSchema = zod_1.z
|
|
6
|
+
.string()
|
|
7
|
+
.url()
|
|
8
|
+
.startsWith("https://", { message: "Must be an https url" })
|
|
9
|
+
.max(512);
|
|
6
10
|
exports.frameNameSchema = zod_1.z.string().max(32);
|
|
7
|
-
exports.
|
|
11
|
+
exports.buttonTitleSchema = zod_1.z.string().max(32);
|
|
12
|
+
exports.hexColorSchema = zod_1.z
|
|
13
|
+
.string()
|
|
8
14
|
.regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i, {
|
|
9
15
|
message: "Invalid hex color code. It should be in the format #RRGGBB or #RGB.",
|
|
10
16
|
});
|
package/esm/index.d.ts
ADDED
package/esm/index.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const actionLaunchFrameSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"launch_frame">;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
url: z.ZodString;
|
|
6
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
7
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
type: "launch_frame";
|
|
10
|
+
name: string;
|
|
11
|
+
url: string;
|
|
12
|
+
splashImageUrl?: string | undefined;
|
|
13
|
+
splashBackgroundColor?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
type: "launch_frame";
|
|
16
|
+
name: string;
|
|
17
|
+
url: string;
|
|
18
|
+
splashImageUrl?: string | undefined;
|
|
19
|
+
splashBackgroundColor?: string | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"launch_frame">;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
url: z.ZodString;
|
|
25
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
26
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
type: "launch_frame";
|
|
29
|
+
name: string;
|
|
30
|
+
url: string;
|
|
31
|
+
splashImageUrl?: string | undefined;
|
|
32
|
+
splashBackgroundColor?: string | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
type: "launch_frame";
|
|
35
|
+
name: string;
|
|
36
|
+
url: string;
|
|
37
|
+
splashImageUrl?: string | undefined;
|
|
38
|
+
splashBackgroundColor?: string | undefined;
|
|
39
|
+
}>]>;
|
|
40
|
+
export declare const buttonSchema: z.ZodObject<{
|
|
41
|
+
title: z.ZodString;
|
|
42
|
+
action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"launch_frame">;
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
url: z.ZodString;
|
|
46
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
47
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
type: "launch_frame";
|
|
50
|
+
name: string;
|
|
51
|
+
url: string;
|
|
52
|
+
splashImageUrl?: string | undefined;
|
|
53
|
+
splashBackgroundColor?: string | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
type: "launch_frame";
|
|
56
|
+
name: string;
|
|
57
|
+
url: string;
|
|
58
|
+
splashImageUrl?: string | undefined;
|
|
59
|
+
splashBackgroundColor?: string | undefined;
|
|
60
|
+
}>]>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
title: string;
|
|
63
|
+
action: {
|
|
64
|
+
type: "launch_frame";
|
|
65
|
+
name: string;
|
|
66
|
+
url: string;
|
|
67
|
+
splashImageUrl?: string | undefined;
|
|
68
|
+
splashBackgroundColor?: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
}, {
|
|
71
|
+
title: string;
|
|
72
|
+
action: {
|
|
73
|
+
type: "launch_frame";
|
|
74
|
+
name: string;
|
|
75
|
+
url: string;
|
|
76
|
+
splashImageUrl?: string | undefined;
|
|
77
|
+
splashBackgroundColor?: string | undefined;
|
|
78
|
+
};
|
|
79
|
+
}>;
|
|
80
|
+
export declare const frameEmbedNextSchema: z.ZodObject<{
|
|
81
|
+
version: z.ZodLiteral<"next">;
|
|
82
|
+
imageUrl: z.ZodString;
|
|
83
|
+
button: z.ZodObject<{
|
|
84
|
+
title: z.ZodString;
|
|
85
|
+
action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
86
|
+
type: z.ZodLiteral<"launch_frame">;
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
url: z.ZodString;
|
|
89
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
90
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
type: "launch_frame";
|
|
93
|
+
name: string;
|
|
94
|
+
url: string;
|
|
95
|
+
splashImageUrl?: string | undefined;
|
|
96
|
+
splashBackgroundColor?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
type: "launch_frame";
|
|
99
|
+
name: string;
|
|
100
|
+
url: string;
|
|
101
|
+
splashImageUrl?: string | undefined;
|
|
102
|
+
splashBackgroundColor?: string | undefined;
|
|
103
|
+
}>]>;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
title: string;
|
|
106
|
+
action: {
|
|
107
|
+
type: "launch_frame";
|
|
108
|
+
name: string;
|
|
109
|
+
url: string;
|
|
110
|
+
splashImageUrl?: string | undefined;
|
|
111
|
+
splashBackgroundColor?: string | undefined;
|
|
112
|
+
};
|
|
113
|
+
}, {
|
|
114
|
+
title: string;
|
|
115
|
+
action: {
|
|
116
|
+
type: "launch_frame";
|
|
117
|
+
name: string;
|
|
118
|
+
url: string;
|
|
119
|
+
splashImageUrl?: string | undefined;
|
|
120
|
+
splashBackgroundColor?: string | undefined;
|
|
121
|
+
};
|
|
122
|
+
}>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
version: "next";
|
|
125
|
+
imageUrl: string;
|
|
126
|
+
button: {
|
|
127
|
+
title: string;
|
|
128
|
+
action: {
|
|
129
|
+
type: "launch_frame";
|
|
130
|
+
name: string;
|
|
131
|
+
url: string;
|
|
132
|
+
splashImageUrl?: string | undefined;
|
|
133
|
+
splashBackgroundColor?: string | undefined;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
}, {
|
|
137
|
+
version: "next";
|
|
138
|
+
imageUrl: string;
|
|
139
|
+
button: {
|
|
140
|
+
title: string;
|
|
141
|
+
action: {
|
|
142
|
+
type: "launch_frame";
|
|
143
|
+
name: string;
|
|
144
|
+
url: string;
|
|
145
|
+
splashImageUrl?: string | undefined;
|
|
146
|
+
splashBackgroundColor?: string | undefined;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
}>;
|
|
150
|
+
export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.SafeParseReturnType<{
|
|
151
|
+
version: "next";
|
|
152
|
+
imageUrl: string;
|
|
153
|
+
button: {
|
|
154
|
+
title: string;
|
|
155
|
+
action: {
|
|
156
|
+
type: "launch_frame";
|
|
157
|
+
name: string;
|
|
158
|
+
url: string;
|
|
159
|
+
splashImageUrl?: string | undefined;
|
|
160
|
+
splashBackgroundColor?: string | undefined;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
}, {
|
|
164
|
+
version: "next";
|
|
165
|
+
imageUrl: string;
|
|
166
|
+
button: {
|
|
167
|
+
title: string;
|
|
168
|
+
action: {
|
|
169
|
+
type: "launch_frame";
|
|
170
|
+
name: string;
|
|
171
|
+
url: string;
|
|
172
|
+
splashImageUrl?: string | undefined;
|
|
173
|
+
splashBackgroundColor?: string | undefined;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}>;
|
|
177
|
+
export type FrameEmbedNext = z.infer<typeof frameEmbedNextSchema>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { hexColorSchema, frameNameSchema, secureUrlSchema, buttonTitleSchema, } from "./shared";
|
|
3
|
+
export const actionLaunchFrameSchema = z.object({
|
|
4
|
+
type: z.literal("launch_frame"),
|
|
5
|
+
name: frameNameSchema,
|
|
6
|
+
url: secureUrlSchema,
|
|
7
|
+
splashImageUrl: secureUrlSchema.optional(),
|
|
8
|
+
splashBackgroundColor: hexColorSchema.optional(),
|
|
9
|
+
});
|
|
10
|
+
export const actionSchema = z.discriminatedUnion("type", [
|
|
11
|
+
actionLaunchFrameSchema,
|
|
12
|
+
]);
|
|
13
|
+
export const buttonSchema = z.object({
|
|
14
|
+
title: buttonTitleSchema,
|
|
15
|
+
action: actionSchema,
|
|
16
|
+
});
|
|
17
|
+
export const frameEmbedNextSchema = z.object({
|
|
18
|
+
version: z.literal("next"),
|
|
19
|
+
imageUrl: secureUrlSchema,
|
|
20
|
+
button: buttonSchema,
|
|
21
|
+
});
|
|
22
|
+
export const safeParseFrameEmbed = (rawResponse) => frameEmbedNextSchema.safeParse(rawResponse);
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const eventFrameAddedPayloadSchema: z.ZodObject<{
|
|
3
|
+
event: z.ZodLiteral<"frame_added">;
|
|
4
|
+
notificationDetails: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
url: z.ZodString;
|
|
6
|
+
token: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
url: string;
|
|
9
|
+
token: string;
|
|
10
|
+
}, {
|
|
11
|
+
url: string;
|
|
12
|
+
token: string;
|
|
13
|
+
}>>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
event: "frame_added";
|
|
16
|
+
notificationDetails?: {
|
|
17
|
+
url: string;
|
|
18
|
+
token: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
event: "frame_added";
|
|
22
|
+
notificationDetails?: {
|
|
23
|
+
url: string;
|
|
24
|
+
token: string;
|
|
25
|
+
} | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type EventFrameAddedPayload = z.infer<typeof eventFrameAddedPayloadSchema>;
|
|
28
|
+
export declare const eventFrameRemovedPayloadSchema: z.ZodObject<{
|
|
29
|
+
event: z.ZodLiteral<"frame_removed">;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
event: "frame_removed";
|
|
32
|
+
}, {
|
|
33
|
+
event: "frame_removed";
|
|
34
|
+
}>;
|
|
35
|
+
export type EventFrameRemovedPayload = z.infer<typeof eventFrameRemovedPayloadSchema>;
|
|
36
|
+
export declare const eventNotificationsEnabledPayloadSchema: z.ZodObject<{
|
|
37
|
+
event: z.ZodLiteral<"notifications_enabled">;
|
|
38
|
+
notificationDetails: z.ZodObject<{
|
|
39
|
+
url: z.ZodString;
|
|
40
|
+
token: z.ZodString;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
url: string;
|
|
43
|
+
token: string;
|
|
44
|
+
}, {
|
|
45
|
+
url: string;
|
|
46
|
+
token: string;
|
|
47
|
+
}>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
event: "notifications_enabled";
|
|
50
|
+
notificationDetails: {
|
|
51
|
+
url: string;
|
|
52
|
+
token: string;
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
event: "notifications_enabled";
|
|
56
|
+
notificationDetails: {
|
|
57
|
+
url: string;
|
|
58
|
+
token: string;
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
61
|
+
export type EventNotificationsEnabledPayload = z.infer<typeof eventNotificationsEnabledPayloadSchema>;
|
|
62
|
+
export declare const notificationsDisabledPayloadSchema: z.ZodObject<{
|
|
63
|
+
event: z.ZodLiteral<"notifications_disabled">;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
event: "notifications_disabled";
|
|
66
|
+
}, {
|
|
67
|
+
event: "notifications_disabled";
|
|
68
|
+
}>;
|
|
69
|
+
export type EventNotificationsDisabledPayload = z.infer<typeof notificationsDisabledPayloadSchema>;
|
|
70
|
+
export declare const eventPayloadSchema: z.ZodDiscriminatedUnion<"event", [z.ZodObject<{
|
|
71
|
+
event: z.ZodLiteral<"frame_added">;
|
|
72
|
+
notificationDetails: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
url: z.ZodString;
|
|
74
|
+
token: z.ZodString;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
url: string;
|
|
77
|
+
token: string;
|
|
78
|
+
}, {
|
|
79
|
+
url: string;
|
|
80
|
+
token: string;
|
|
81
|
+
}>>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
event: "frame_added";
|
|
84
|
+
notificationDetails?: {
|
|
85
|
+
url: string;
|
|
86
|
+
token: string;
|
|
87
|
+
} | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
event: "frame_added";
|
|
90
|
+
notificationDetails?: {
|
|
91
|
+
url: string;
|
|
92
|
+
token: string;
|
|
93
|
+
} | undefined;
|
|
94
|
+
}>, z.ZodObject<{
|
|
95
|
+
event: z.ZodLiteral<"frame_removed">;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
event: "frame_removed";
|
|
98
|
+
}, {
|
|
99
|
+
event: "frame_removed";
|
|
100
|
+
}>, z.ZodObject<{
|
|
101
|
+
event: z.ZodLiteral<"notifications_enabled">;
|
|
102
|
+
notificationDetails: z.ZodObject<{
|
|
103
|
+
url: z.ZodString;
|
|
104
|
+
token: z.ZodString;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
url: string;
|
|
107
|
+
token: string;
|
|
108
|
+
}, {
|
|
109
|
+
url: string;
|
|
110
|
+
token: string;
|
|
111
|
+
}>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
event: "notifications_enabled";
|
|
114
|
+
notificationDetails: {
|
|
115
|
+
url: string;
|
|
116
|
+
token: string;
|
|
117
|
+
};
|
|
118
|
+
}, {
|
|
119
|
+
event: "notifications_enabled";
|
|
120
|
+
notificationDetails: {
|
|
121
|
+
url: string;
|
|
122
|
+
token: string;
|
|
123
|
+
};
|
|
124
|
+
}>, z.ZodObject<{
|
|
125
|
+
event: z.ZodLiteral<"notifications_disabled">;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
event: "notifications_disabled";
|
|
128
|
+
}, {
|
|
129
|
+
event: "notifications_disabled";
|
|
130
|
+
}>]>;
|
|
131
|
+
export type FrameEvent = z.infer<typeof eventPayloadSchema>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { notificationDetailsSchema } from "./notifications";
|
|
3
|
+
export const eventFrameAddedPayloadSchema = z.object({
|
|
4
|
+
event: z.literal("frame_added"),
|
|
5
|
+
notificationDetails: notificationDetailsSchema.optional(),
|
|
6
|
+
});
|
|
7
|
+
export const eventFrameRemovedPayloadSchema = z.object({
|
|
8
|
+
event: z.literal("frame_removed"),
|
|
9
|
+
});
|
|
10
|
+
export const eventNotificationsEnabledPayloadSchema = z.object({
|
|
11
|
+
event: z.literal("notifications_enabled"),
|
|
12
|
+
notificationDetails: notificationDetailsSchema.required(),
|
|
13
|
+
});
|
|
14
|
+
export const notificationsDisabledPayloadSchema = z.object({
|
|
15
|
+
event: z.literal("notifications_disabled"),
|
|
16
|
+
});
|
|
17
|
+
export const eventPayloadSchema = z.discriminatedUnion("event", [
|
|
18
|
+
eventFrameAddedPayloadSchema,
|
|
19
|
+
eventFrameRemovedPayloadSchema,
|
|
20
|
+
eventNotificationsEnabledPayloadSchema,
|
|
21
|
+
notificationsDisabledPayloadSchema,
|
|
22
|
+
]);
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const domainFrameConfigSchema: z.ZodObject<{
|
|
3
|
+
version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">]>;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
iconUrl: z.ZodString;
|
|
6
|
+
homeUrl: z.ZodString;
|
|
7
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
8
|
+
buttonTitle: z.ZodOptional<z.ZodString>;
|
|
9
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
10
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
11
|
+
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
name: string;
|
|
14
|
+
version: "0.0.0" | "0.0.1" | "1";
|
|
15
|
+
iconUrl: string;
|
|
16
|
+
homeUrl: string;
|
|
17
|
+
splashImageUrl?: string | undefined;
|
|
18
|
+
splashBackgroundColor?: string | undefined;
|
|
19
|
+
imageUrl?: string | undefined;
|
|
20
|
+
buttonTitle?: string | undefined;
|
|
21
|
+
webhookUrl?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
name: string;
|
|
24
|
+
version: "0.0.0" | "0.0.1" | "1";
|
|
25
|
+
iconUrl: string;
|
|
26
|
+
homeUrl: string;
|
|
27
|
+
splashImageUrl?: string | undefined;
|
|
28
|
+
splashBackgroundColor?: string | undefined;
|
|
29
|
+
imageUrl?: string | undefined;
|
|
30
|
+
buttonTitle?: string | undefined;
|
|
31
|
+
webhookUrl?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const domainManifestSchema: z.ZodObject<{
|
|
34
|
+
accountAssociation: z.ZodObject<{
|
|
35
|
+
header: z.ZodString;
|
|
36
|
+
payload: z.ZodString;
|
|
37
|
+
signature: z.ZodString;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
header: string;
|
|
40
|
+
payload: string;
|
|
41
|
+
signature: string;
|
|
42
|
+
}, {
|
|
43
|
+
header: string;
|
|
44
|
+
payload: string;
|
|
45
|
+
signature: string;
|
|
46
|
+
}>;
|
|
47
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">]>;
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
iconUrl: z.ZodString;
|
|
51
|
+
homeUrl: z.ZodString;
|
|
52
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
53
|
+
buttonTitle: z.ZodOptional<z.ZodString>;
|
|
54
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
55
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
56
|
+
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
name: string;
|
|
59
|
+
version: "0.0.0" | "0.0.1" | "1";
|
|
60
|
+
iconUrl: string;
|
|
61
|
+
homeUrl: string;
|
|
62
|
+
splashImageUrl?: string | undefined;
|
|
63
|
+
splashBackgroundColor?: string | undefined;
|
|
64
|
+
imageUrl?: string | undefined;
|
|
65
|
+
buttonTitle?: string | undefined;
|
|
66
|
+
webhookUrl?: string | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
name: string;
|
|
69
|
+
version: "0.0.0" | "0.0.1" | "1";
|
|
70
|
+
iconUrl: string;
|
|
71
|
+
homeUrl: string;
|
|
72
|
+
splashImageUrl?: string | undefined;
|
|
73
|
+
splashBackgroundColor?: string | undefined;
|
|
74
|
+
imageUrl?: string | undefined;
|
|
75
|
+
buttonTitle?: string | undefined;
|
|
76
|
+
webhookUrl?: string | undefined;
|
|
77
|
+
}>>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
accountAssociation: {
|
|
80
|
+
header: string;
|
|
81
|
+
payload: string;
|
|
82
|
+
signature: string;
|
|
83
|
+
};
|
|
84
|
+
frame?: {
|
|
85
|
+
name: string;
|
|
86
|
+
version: "0.0.0" | "0.0.1" | "1";
|
|
87
|
+
iconUrl: string;
|
|
88
|
+
homeUrl: string;
|
|
89
|
+
splashImageUrl?: string | undefined;
|
|
90
|
+
splashBackgroundColor?: string | undefined;
|
|
91
|
+
imageUrl?: string | undefined;
|
|
92
|
+
buttonTitle?: string | undefined;
|
|
93
|
+
webhookUrl?: string | undefined;
|
|
94
|
+
} | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
accountAssociation: {
|
|
97
|
+
header: string;
|
|
98
|
+
payload: string;
|
|
99
|
+
signature: string;
|
|
100
|
+
};
|
|
101
|
+
frame?: {
|
|
102
|
+
name: string;
|
|
103
|
+
version: "0.0.0" | "0.0.1" | "1";
|
|
104
|
+
iconUrl: string;
|
|
105
|
+
homeUrl: string;
|
|
106
|
+
splashImageUrl?: string | undefined;
|
|
107
|
+
splashBackgroundColor?: string | undefined;
|
|
108
|
+
imageUrl?: string | undefined;
|
|
109
|
+
buttonTitle?: string | undefined;
|
|
110
|
+
webhookUrl?: string | undefined;
|
|
111
|
+
} | undefined;
|
|
112
|
+
}>;
|