@farcaster/frame-core 0.0.23 → 0.0.24
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/actions/ViewProfile.d.ts +4 -0
- package/dist/actions/ViewProfile.js +2 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +2 -1
- package/dist/types.d.ts +3 -1
- package/esm/actions/AddFrame.d.ts +23 -27
- package/esm/actions/AddFrame.js +9 -9
- package/esm/actions/SignIn.d.ts +33 -35
- package/esm/actions/SignIn.js +5 -5
- package/esm/actions/ViewProfile.d.ts +4 -0
- package/esm/actions/ViewProfile.js +1 -0
- package/esm/actions/index.d.ts +3 -2
- package/esm/actions/index.js +3 -2
- package/esm/context.d.ts +61 -65
- package/esm/context.js +1 -1
- package/esm/errors.d.ts +7 -9
- package/esm/errors.js +6 -6
- package/esm/index.d.ts +4 -4
- package/esm/index.js +4 -4
- package/esm/internal/types.d.ts +7 -18
- package/esm/internal/types.js +1 -1
- package/esm/schemas/embeds.d.ts +169 -231
- package/esm/schemas/embeds.js +18 -24
- package/esm/schemas/events.d.ts +129 -225
- package/esm/schemas/events.js +17 -17
- package/esm/schemas/index.d.ts +5 -5
- package/esm/schemas/index.js +5 -5
- package/esm/schemas/manifest.d.ts +110 -154
- package/esm/schemas/manifest.js +23 -29
- package/esm/schemas/notifications.d.ts +58 -86
- package/esm/schemas/notifications.js +17 -17
- package/esm/schemas/shared.d.ts +33 -49
- package/esm/schemas/shared.js +19 -20
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +102 -125
- package/esm/types.js +2 -2
- package/package.json +1 -1
- package/src/actions/ViewProfile.ts +5 -0
- package/src/actions/index.ts +1 -0
- package/src/types.ts +3 -1
package/esm/schemas/embeds.d.ts
CHANGED
|
@@ -1,239 +1,177 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const actionLaunchFrameSchema: z.ZodObject<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
z.ZodObject<
|
|
64
|
-
{
|
|
65
|
-
type: z.ZodLiteral<'launch_frame'>
|
|
66
|
-
name: z.ZodString
|
|
67
|
-
url: z.ZodString
|
|
68
|
-
splashImageUrl: z.ZodOptional<z.ZodString>
|
|
69
|
-
splashBackgroundColor: z.ZodOptional<z.ZodString>
|
|
70
|
-
},
|
|
71
|
-
'strip',
|
|
72
|
-
z.ZodTypeAny,
|
|
73
|
-
{
|
|
74
|
-
type: 'launch_frame'
|
|
75
|
-
name: string
|
|
76
|
-
url: string
|
|
77
|
-
splashImageUrl?: string | undefined
|
|
78
|
-
splashBackgroundColor?: string | undefined
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
type: 'launch_frame'
|
|
82
|
-
name: string
|
|
83
|
-
url: string
|
|
84
|
-
splashImageUrl?: string | undefined
|
|
85
|
-
splashBackgroundColor?: string | undefined
|
|
86
|
-
}
|
|
87
|
-
>,
|
|
88
|
-
]
|
|
89
|
-
>
|
|
90
|
-
},
|
|
91
|
-
'strip',
|
|
92
|
-
z.ZodTypeAny,
|
|
93
|
-
{
|
|
94
|
-
title: string
|
|
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;
|
|
95
63
|
action: {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
title: string
|
|
64
|
+
type: "launch_frame";
|
|
65
|
+
name: string;
|
|
66
|
+
url: string;
|
|
67
|
+
splashImageUrl?: string | undefined;
|
|
68
|
+
splashBackgroundColor?: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
}, {
|
|
71
|
+
title: string;
|
|
105
72
|
action: {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
splashBackgroundColor?: string | undefined
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
type: 'launch_frame'
|
|
143
|
-
name: string
|
|
144
|
-
url: string
|
|
145
|
-
splashImageUrl?: string | undefined
|
|
146
|
-
splashBackgroundColor?: string | undefined
|
|
147
|
-
}
|
|
148
|
-
>,
|
|
149
|
-
]
|
|
150
|
-
>
|
|
151
|
-
},
|
|
152
|
-
'strip',
|
|
153
|
-
z.ZodTypeAny,
|
|
154
|
-
{
|
|
155
|
-
title: string
|
|
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;
|
|
156
106
|
action: {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
title: string
|
|
107
|
+
type: "launch_frame";
|
|
108
|
+
name: string;
|
|
109
|
+
url: string;
|
|
110
|
+
splashImageUrl?: string | undefined;
|
|
111
|
+
splashBackgroundColor?: string | undefined;
|
|
112
|
+
};
|
|
113
|
+
}, {
|
|
114
|
+
title: string;
|
|
166
115
|
action: {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
z.ZodTypeAny,
|
|
178
|
-
{
|
|
179
|
-
version: 'next'
|
|
180
|
-
imageUrl: string
|
|
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;
|
|
181
126
|
button: {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
imageUrl: string
|
|
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;
|
|
195
139
|
button: {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
) => z.SafeParseReturnType<
|
|
210
|
-
{
|
|
211
|
-
version: 'next'
|
|
212
|
-
imageUrl: string
|
|
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;
|
|
213
153
|
button: {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
imageUrl: string
|
|
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;
|
|
227
166
|
button: {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
export type FrameEmbedNext = z.infer<typeof frameEmbedNextSchema>
|
|
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>;
|
package/esm/schemas/embeds.js
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import {
|
|
3
|
-
buttonTitleSchema,
|
|
4
|
-
frameNameSchema,
|
|
5
|
-
hexColorSchema,
|
|
6
|
-
secureUrlSchema,
|
|
7
|
-
} from './shared'
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { buttonTitleSchema, frameNameSchema, hexColorSchema, secureUrlSchema, } from './shared';
|
|
8
3
|
export const actionLaunchFrameSchema = z.object({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
4
|
+
type: z.literal('launch_frame'),
|
|
5
|
+
name: frameNameSchema,
|
|
6
|
+
url: secureUrlSchema,
|
|
7
|
+
splashImageUrl: secureUrlSchema.optional(),
|
|
8
|
+
splashBackgroundColor: hexColorSchema.optional(),
|
|
9
|
+
});
|
|
15
10
|
export const actionSchema = z.discriminatedUnion('type', [
|
|
16
|
-
|
|
17
|
-
])
|
|
11
|
+
actionLaunchFrameSchema,
|
|
12
|
+
]);
|
|
18
13
|
export const buttonSchema = z.object({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
14
|
+
title: buttonTitleSchema,
|
|
15
|
+
action: actionSchema,
|
|
16
|
+
});
|
|
22
17
|
export const frameEmbedNextSchema = z.object({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
})
|
|
27
|
-
export const safeParseFrameEmbed = (rawResponse) =>
|
|
28
|
-
frameEmbedNextSchema.safeParse(rawResponse)
|
|
18
|
+
version: z.literal('next'),
|
|
19
|
+
imageUrl: secureUrlSchema,
|
|
20
|
+
button: buttonSchema,
|
|
21
|
+
});
|
|
22
|
+
export const safeParseFrameEmbed = (rawResponse) => frameEmbedNextSchema.safeParse(rawResponse);
|