@farcaster/frame-core 0.0.31 → 0.0.33

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.
@@ -2,19 +2,19 @@ import { z } from 'zod';
2
2
  export declare const actionLaunchFrameSchema: z.ZodObject<{
3
3
  type: z.ZodLiteral<"launch_frame">;
4
4
  name: z.ZodString;
5
- url: z.ZodString;
5
+ url: z.ZodOptional<z.ZodString>;
6
6
  splashImageUrl: z.ZodOptional<z.ZodString>;
7
7
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
8
8
  }, "strip", z.ZodTypeAny, {
9
9
  type: "launch_frame";
10
10
  name: string;
11
- url: string;
11
+ url?: string | undefined;
12
12
  splashImageUrl?: string | undefined;
13
13
  splashBackgroundColor?: string | undefined;
14
14
  }, {
15
15
  type: "launch_frame";
16
16
  name: string;
17
- url: string;
17
+ url?: string | undefined;
18
18
  splashImageUrl?: string | undefined;
19
19
  splashBackgroundColor?: string | undefined;
20
20
  }>;
@@ -31,19 +31,19 @@ export declare const actionViewTokenSchema: z.ZodObject<{
31
31
  export declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
32
32
  type: z.ZodLiteral<"launch_frame">;
33
33
  name: z.ZodString;
34
- url: z.ZodString;
34
+ url: z.ZodOptional<z.ZodString>;
35
35
  splashImageUrl: z.ZodOptional<z.ZodString>;
36
36
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
37
37
  }, "strip", z.ZodTypeAny, {
38
38
  type: "launch_frame";
39
39
  name: string;
40
- url: string;
40
+ url?: string | undefined;
41
41
  splashImageUrl?: string | undefined;
42
42
  splashBackgroundColor?: string | undefined;
43
43
  }, {
44
44
  type: "launch_frame";
45
45
  name: string;
46
- url: string;
46
+ url?: string | undefined;
47
47
  splashImageUrl?: string | undefined;
48
48
  splashBackgroundColor?: string | undefined;
49
49
  }>, z.ZodObject<{
@@ -61,19 +61,19 @@ export declare const buttonSchema: z.ZodObject<{
61
61
  action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
62
62
  type: z.ZodLiteral<"launch_frame">;
63
63
  name: z.ZodString;
64
- url: z.ZodString;
64
+ url: z.ZodOptional<z.ZodString>;
65
65
  splashImageUrl: z.ZodOptional<z.ZodString>;
66
66
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
67
67
  }, "strip", z.ZodTypeAny, {
68
68
  type: "launch_frame";
69
69
  name: string;
70
- url: string;
70
+ url?: string | undefined;
71
71
  splashImageUrl?: string | undefined;
72
72
  splashBackgroundColor?: string | undefined;
73
73
  }, {
74
74
  type: "launch_frame";
75
75
  name: string;
76
- url: string;
76
+ url?: string | undefined;
77
77
  splashImageUrl?: string | undefined;
78
78
  splashBackgroundColor?: string | undefined;
79
79
  }>, z.ZodObject<{
@@ -91,7 +91,7 @@ export declare const buttonSchema: z.ZodObject<{
91
91
  action: {
92
92
  type: "launch_frame";
93
93
  name: string;
94
- url: string;
94
+ url?: string | undefined;
95
95
  splashImageUrl?: string | undefined;
96
96
  splashBackgroundColor?: string | undefined;
97
97
  } | {
@@ -103,7 +103,7 @@ export declare const buttonSchema: z.ZodObject<{
103
103
  action: {
104
104
  type: "launch_frame";
105
105
  name: string;
106
- url: string;
106
+ url?: string | undefined;
107
107
  splashImageUrl?: string | undefined;
108
108
  splashBackgroundColor?: string | undefined;
109
109
  } | {
@@ -120,19 +120,19 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
120
120
  action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
121
121
  type: z.ZodLiteral<"launch_frame">;
122
122
  name: z.ZodString;
123
- url: z.ZodString;
123
+ url: z.ZodOptional<z.ZodString>;
124
124
  splashImageUrl: z.ZodOptional<z.ZodString>;
125
125
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
126
126
  }, "strip", z.ZodTypeAny, {
127
127
  type: "launch_frame";
128
128
  name: string;
129
- url: string;
129
+ url?: string | undefined;
130
130
  splashImageUrl?: string | undefined;
131
131
  splashBackgroundColor?: string | undefined;
132
132
  }, {
133
133
  type: "launch_frame";
134
134
  name: string;
135
- url: string;
135
+ url?: string | undefined;
136
136
  splashImageUrl?: string | undefined;
137
137
  splashBackgroundColor?: string | undefined;
138
138
  }>, z.ZodObject<{
@@ -150,7 +150,7 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
150
150
  action: {
151
151
  type: "launch_frame";
152
152
  name: string;
153
- url: string;
153
+ url?: string | undefined;
154
154
  splashImageUrl?: string | undefined;
155
155
  splashBackgroundColor?: string | undefined;
156
156
  } | {
@@ -162,7 +162,7 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
162
162
  action: {
163
163
  type: "launch_frame";
164
164
  name: string;
165
- url: string;
165
+ url?: string | undefined;
166
166
  splashImageUrl?: string | undefined;
167
167
  splashBackgroundColor?: string | undefined;
168
168
  } | {
@@ -178,7 +178,7 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
178
178
  action: {
179
179
  type: "launch_frame";
180
180
  name: string;
181
- url: string;
181
+ url?: string | undefined;
182
182
  splashImageUrl?: string | undefined;
183
183
  splashBackgroundColor?: string | undefined;
184
184
  } | {
@@ -195,7 +195,7 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
195
195
  action: {
196
196
  type: "launch_frame";
197
197
  name: string;
198
- url: string;
198
+ url?: string | undefined;
199
199
  splashImageUrl?: string | undefined;
200
200
  splashBackgroundColor?: string | undefined;
201
201
  } | {
@@ -213,7 +213,7 @@ export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.SafeParseR
213
213
  action: {
214
214
  type: "launch_frame";
215
215
  name: string;
216
- url: string;
216
+ url?: string | undefined;
217
217
  splashImageUrl?: string | undefined;
218
218
  splashBackgroundColor?: string | undefined;
219
219
  } | {
@@ -230,7 +230,7 @@ export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.SafeParseR
230
230
  action: {
231
231
  type: "launch_frame";
232
232
  name: string;
233
- url: string;
233
+ url?: string | undefined;
234
234
  splashImageUrl?: string | undefined;
235
235
  splashBackgroundColor?: string | undefined;
236
236
  } | {
@@ -6,7 +6,7 @@ const shared_1 = require("./shared");
6
6
  exports.actionLaunchFrameSchema = zod_1.z.object({
7
7
  type: zod_1.z.literal('launch_frame'),
8
8
  name: shared_1.frameNameSchema,
9
- url: shared_1.secureUrlSchema,
9
+ url: shared_1.secureUrlSchema.optional(),
10
10
  splashImageUrl: shared_1.secureUrlSchema.optional(),
11
11
  splashBackgroundColor: shared_1.hexColorSchema.optional(),
12
12
  });
@@ -4,14 +4,29 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
4
4
  name: z.ZodString;
5
5
  iconUrl: z.ZodString;
6
6
  homeUrl: z.ZodString;
7
+ /** deprecated, set ogImageUrl instead */
7
8
  imageUrl: z.ZodOptional<z.ZodString>;
9
+ /** deprecated, will rely on fc:frame meta tag */
8
10
  buttonTitle: z.ZodOptional<z.ZodString>;
9
11
  splashImageUrl: z.ZodOptional<z.ZodString>;
10
12
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
11
13
  webhookUrl: z.ZodOptional<z.ZodString>;
14
+ /** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
15
+ subtitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
16
+ description: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
17
+ screenshotUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
+ primaryCategory: z.ZodOptional<z.ZodEnum<["games", "social", "finance", "utility", "productivity", "health-fitness", "news-media", "music", "shopping", "education", "developer-tools", "entertainment", "art-creativity"]>>;
19
+ tags: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, "many">>;
20
+ heroImageUrl: z.ZodOptional<z.ZodString>;
21
+ tagline: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
22
+ ogTitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
23
+ ogDescription: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
24
+ ogImageUrl: z.ZodOptional<z.ZodString>;
25
+ /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
26
+ noindex: z.ZodOptional<z.ZodBoolean>;
12
27
  }, "strip", z.ZodTypeAny, {
13
28
  name: string;
14
- version: "next" | "0.0.0" | "0.0.1" | "1";
29
+ version: "next" | "1" | "0.0.0" | "0.0.1";
15
30
  iconUrl: string;
16
31
  homeUrl: string;
17
32
  splashImageUrl?: string | undefined;
@@ -19,9 +34,20 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
19
34
  imageUrl?: string | undefined;
20
35
  buttonTitle?: string | undefined;
21
36
  webhookUrl?: string | undefined;
37
+ subtitle?: string | undefined;
38
+ description?: string | undefined;
39
+ screenshotUrls?: string[] | undefined;
40
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
41
+ tags?: string[] | undefined;
42
+ heroImageUrl?: string | undefined;
43
+ tagline?: string | undefined;
44
+ ogTitle?: string | undefined;
45
+ ogDescription?: string | undefined;
46
+ ogImageUrl?: string | undefined;
47
+ noindex?: boolean | undefined;
22
48
  }, {
23
49
  name: string;
24
- version: "next" | "0.0.0" | "0.0.1" | "1";
50
+ version: "next" | "1" | "0.0.0" | "0.0.1";
25
51
  iconUrl: string;
26
52
  homeUrl: string;
27
53
  splashImageUrl?: string | undefined;
@@ -29,6 +55,17 @@ export declare const domainFrameConfigSchema: z.ZodObject<{
29
55
  imageUrl?: string | undefined;
30
56
  buttonTitle?: string | undefined;
31
57
  webhookUrl?: string | undefined;
58
+ subtitle?: string | undefined;
59
+ description?: string | undefined;
60
+ screenshotUrls?: string[] | undefined;
61
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
62
+ tags?: string[] | undefined;
63
+ heroImageUrl?: string | undefined;
64
+ tagline?: string | undefined;
65
+ ogTitle?: string | undefined;
66
+ ogDescription?: string | undefined;
67
+ ogImageUrl?: string | undefined;
68
+ noindex?: boolean | undefined;
32
69
  }>;
33
70
  export declare const domainManifestSchema: z.ZodObject<{
34
71
  accountAssociation: z.ZodObject<{
@@ -49,14 +86,29 @@ export declare const domainManifestSchema: z.ZodObject<{
49
86
  name: z.ZodString;
50
87
  iconUrl: z.ZodString;
51
88
  homeUrl: z.ZodString;
89
+ /** deprecated, set ogImageUrl instead */
52
90
  imageUrl: z.ZodOptional<z.ZodString>;
91
+ /** deprecated, will rely on fc:frame meta tag */
53
92
  buttonTitle: z.ZodOptional<z.ZodString>;
54
93
  splashImageUrl: z.ZodOptional<z.ZodString>;
55
94
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
56
95
  webhookUrl: z.ZodOptional<z.ZodString>;
96
+ /** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
97
+ subtitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
98
+ description: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
99
+ screenshotUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
100
+ primaryCategory: z.ZodOptional<z.ZodEnum<["games", "social", "finance", "utility", "productivity", "health-fitness", "news-media", "music", "shopping", "education", "developer-tools", "entertainment", "art-creativity"]>>;
101
+ tags: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, "many">>;
102
+ heroImageUrl: z.ZodOptional<z.ZodString>;
103
+ tagline: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
104
+ ogTitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
105
+ ogDescription: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
106
+ ogImageUrl: z.ZodOptional<z.ZodString>;
107
+ /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
108
+ noindex: z.ZodOptional<z.ZodBoolean>;
57
109
  }, "strip", z.ZodTypeAny, {
58
110
  name: string;
59
- version: "next" | "0.0.0" | "0.0.1" | "1";
111
+ version: "next" | "1" | "0.0.0" | "0.0.1";
60
112
  iconUrl: string;
61
113
  homeUrl: string;
62
114
  splashImageUrl?: string | undefined;
@@ -64,9 +116,20 @@ export declare const domainManifestSchema: z.ZodObject<{
64
116
  imageUrl?: string | undefined;
65
117
  buttonTitle?: string | undefined;
66
118
  webhookUrl?: string | undefined;
119
+ subtitle?: string | undefined;
120
+ description?: string | undefined;
121
+ screenshotUrls?: string[] | undefined;
122
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
123
+ tags?: string[] | undefined;
124
+ heroImageUrl?: string | undefined;
125
+ tagline?: string | undefined;
126
+ ogTitle?: string | undefined;
127
+ ogDescription?: string | undefined;
128
+ ogImageUrl?: string | undefined;
129
+ noindex?: boolean | undefined;
67
130
  }, {
68
131
  name: string;
69
- version: "next" | "0.0.0" | "0.0.1" | "1";
132
+ version: "next" | "1" | "0.0.0" | "0.0.1";
70
133
  iconUrl: string;
71
134
  homeUrl: string;
72
135
  splashImageUrl?: string | undefined;
@@ -74,6 +137,17 @@ export declare const domainManifestSchema: z.ZodObject<{
74
137
  imageUrl?: string | undefined;
75
138
  buttonTitle?: string | undefined;
76
139
  webhookUrl?: string | undefined;
140
+ subtitle?: string | undefined;
141
+ description?: string | undefined;
142
+ screenshotUrls?: string[] | undefined;
143
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
144
+ tags?: string[] | undefined;
145
+ heroImageUrl?: string | undefined;
146
+ tagline?: string | undefined;
147
+ ogTitle?: string | undefined;
148
+ ogDescription?: string | undefined;
149
+ ogImageUrl?: string | undefined;
150
+ noindex?: boolean | undefined;
77
151
  }>>;
78
152
  }, "strip", z.ZodTypeAny, {
79
153
  accountAssociation: {
@@ -83,7 +157,7 @@ export declare const domainManifestSchema: z.ZodObject<{
83
157
  };
84
158
  frame?: {
85
159
  name: string;
86
- version: "next" | "0.0.0" | "0.0.1" | "1";
160
+ version: "next" | "1" | "0.0.0" | "0.0.1";
87
161
  iconUrl: string;
88
162
  homeUrl: string;
89
163
  splashImageUrl?: string | undefined;
@@ -91,6 +165,17 @@ export declare const domainManifestSchema: z.ZodObject<{
91
165
  imageUrl?: string | undefined;
92
166
  buttonTitle?: string | undefined;
93
167
  webhookUrl?: string | undefined;
168
+ subtitle?: string | undefined;
169
+ description?: string | undefined;
170
+ screenshotUrls?: string[] | undefined;
171
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
172
+ tags?: string[] | undefined;
173
+ heroImageUrl?: string | undefined;
174
+ tagline?: string | undefined;
175
+ ogTitle?: string | undefined;
176
+ ogDescription?: string | undefined;
177
+ ogImageUrl?: string | undefined;
178
+ noindex?: boolean | undefined;
94
179
  } | undefined;
95
180
  }, {
96
181
  accountAssociation: {
@@ -100,7 +185,7 @@ export declare const domainManifestSchema: z.ZodObject<{
100
185
  };
101
186
  frame?: {
102
187
  name: string;
103
- version: "next" | "0.0.0" | "0.0.1" | "1";
188
+ version: "next" | "1" | "0.0.0" | "0.0.1";
104
189
  iconUrl: string;
105
190
  homeUrl: string;
106
191
  splashImageUrl?: string | undefined;
@@ -108,5 +193,16 @@ export declare const domainManifestSchema: z.ZodObject<{
108
193
  imageUrl?: string | undefined;
109
194
  buttonTitle?: string | undefined;
110
195
  webhookUrl?: string | undefined;
196
+ subtitle?: string | undefined;
197
+ description?: string | undefined;
198
+ screenshotUrls?: string[] | undefined;
199
+ primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
200
+ tags?: string[] | undefined;
201
+ heroImageUrl?: string | undefined;
202
+ tagline?: string | undefined;
203
+ ogTitle?: string | undefined;
204
+ ogDescription?: string | undefined;
205
+ ogImageUrl?: string | undefined;
206
+ noindex?: boolean | undefined;
111
207
  } | undefined;
112
208
  }>;
@@ -3,6 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.domainManifestSchema = exports.domainFrameConfigSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const shared_1 = require("./shared");
6
+ const primaryCategorySchema = zod_1.z.enum([
7
+ 'games',
8
+ 'social',
9
+ 'finance',
10
+ 'utility',
11
+ 'productivity',
12
+ 'health-fitness',
13
+ 'news-media',
14
+ 'music',
15
+ 'shopping',
16
+ 'education',
17
+ 'developer-tools',
18
+ 'entertainment',
19
+ 'art-creativity',
20
+ ]);
6
21
  exports.domainFrameConfigSchema = zod_1.z.object({
7
22
  // 0.0.0 and 0.0.1 are not technically part of the spec but kept for
8
23
  // backwards compatibilty. next should always resolve to the most recent
@@ -16,11 +31,29 @@ exports.domainFrameConfigSchema = zod_1.z.object({
16
31
  name: shared_1.frameNameSchema,
17
32
  iconUrl: shared_1.secureUrlSchema,
18
33
  homeUrl: shared_1.secureUrlSchema,
34
+ /** deprecated, set ogImageUrl instead */
19
35
  imageUrl: shared_1.secureUrlSchema.optional(),
36
+ /** deprecated, will rely on fc:frame meta tag */
20
37
  buttonTitle: shared_1.buttonTitleSchema.optional(),
21
38
  splashImageUrl: shared_1.secureUrlSchema.optional(),
22
39
  splashBackgroundColor: shared_1.hexColorSchema.optional(),
23
40
  webhookUrl: shared_1.secureUrlSchema.optional(),
41
+ /** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
42
+ subtitle: (0, shared_1.createSimpleStringSchema)({ max: 30 }).optional(),
43
+ description: (0, shared_1.createSimpleStringSchema)({ max: 170 }).optional(),
44
+ screenshotUrls: zod_1.z.array(shared_1.secureUrlSchema).max(3).optional(),
45
+ primaryCategory: primaryCategorySchema.optional(),
46
+ tags: zod_1.z
47
+ .array((0, shared_1.createSimpleStringSchema)({ max: 20, noSpaces: true }))
48
+ .max(5)
49
+ .optional(),
50
+ heroImageUrl: shared_1.secureUrlSchema.optional(),
51
+ tagline: (0, shared_1.createSimpleStringSchema)({ max: 30 }).optional(),
52
+ ogTitle: (0, shared_1.createSimpleStringSchema)({ max: 30 }).optional(),
53
+ ogDescription: (0, shared_1.createSimpleStringSchema)({ max: 100 }).optional(),
54
+ ogImageUrl: shared_1.secureUrlSchema.optional(),
55
+ /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
56
+ noindex: zod_1.z.boolean().optional(),
24
57
  });
25
58
  exports.domainManifestSchema = zod_1.z.object({
26
59
  accountAssociation: shared_1.encodedJsonFarcasterSignatureSchema,
@@ -1,4 +1,8 @@
1
1
  import { z } from 'zod';
2
+ export declare const createSimpleStringSchema: ({ max, noSpaces, }?: {
3
+ max?: number;
4
+ noSpaces?: boolean;
5
+ }) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
2
6
  export declare const secureUrlSchema: z.ZodString;
3
7
  export declare const frameNameSchema: z.ZodString;
4
8
  export declare const buttonTitleSchema: z.ZodString;
@@ -1,7 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonFarcasterSignatureHeaderSchema = exports.encodedJsonFarcasterSignatureSchema = exports.aspectRatioSchema = exports.hexColorSchema = exports.caip19TokenSchema = exports.buttonTitleSchema = exports.frameNameSchema = exports.secureUrlSchema = void 0;
3
+ exports.jsonFarcasterSignatureHeaderSchema = exports.encodedJsonFarcasterSignatureSchema = exports.aspectRatioSchema = exports.hexColorSchema = exports.caip19TokenSchema = exports.buttonTitleSchema = exports.frameNameSchema = exports.secureUrlSchema = exports.createSimpleStringSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const SPECIAL_CHARS_PATTERN = /[@#$%^&*+=\/\\|~«»]/;
6
+ const REPEATED_PUNCTUATION_PATTERN = /(!{2,}|\?{2,}|-{2,})/;
7
+ // Unicode ranges for emoji detection:
8
+ // \u{1F300}-\u{1F9FF} - Miscellaneous Symbols, Pictographs, Emoticons, Transport, Map, and Supplemental
9
+ // \u{2702}-\u{27B0} - Dingbats
10
+ // \u{2600}-\u{26FF} - Miscellaneous Symbols
11
+ // \u{2B00}-\u{2BFF} - Miscellaneous Symbols and Arrows
12
+ const EMOJI_PATTERN = /[\u{1F300}-\u{1F9FF}]|[\u{2702}-\u{27B0}]|[\u{2600}-\u{26FF}]|[\u{2B00}-\u{2BFF}]/u;
13
+ const createSimpleStringSchema = ({ max, noSpaces, } = {}) => {
14
+ const stringValidations = noSpaces
15
+ ? zod_1.z
16
+ .string()
17
+ .max(max ?? Number.POSITIVE_INFINITY)
18
+ .regex(/^\S*$/, 'Spaces are not allowed')
19
+ : zod_1.z.string().max(max ?? Number.POSITIVE_INFINITY);
20
+ return stringValidations
21
+ .refine((value) => !EMOJI_PATTERN.test(value), {
22
+ message: 'Emojis and symbols are not allowed',
23
+ })
24
+ .refine((value) => !SPECIAL_CHARS_PATTERN.test(value), {
25
+ message: 'Special characters (@, #, $, %, ^, &, *, +, =, /, \\, |, ~, «, ») are not allowed',
26
+ })
27
+ .refine((value) => !REPEATED_PUNCTUATION_PATTERN.test(value), {
28
+ message: 'Repeated punctuations (!!, ??, --) are not allowed',
29
+ });
30
+ };
31
+ exports.createSimpleStringSchema = createSimpleStringSchema;
5
32
  exports.secureUrlSchema = zod_1.z
6
33
  .string()
7
34
  .url()
@@ -1,4 +1,8 @@
1
- import type { Address, Provider, RpcRequest, RpcResponse, RpcSchema } from 'ox';
1
+ import type * as Address from 'ox/Address';
2
+ import type * as Provider from 'ox/Provider';
3
+ import type * as RpcRequest from 'ox/RpcRequest';
4
+ import type * as RpcResponse from 'ox/RpcResponse';
5
+ import type * as RpcSchema from 'ox/RpcSchema';
2
6
  export type EthProvideRequest<schema extends RpcSchema.Generic = RpcSchema.Default> = Provider.RequestFn<schema>;
3
7
  export type FrameEthProviderEventData = {
4
8
  type: 'frame_eth_provider_event';
@@ -2,19 +2,19 @@ import { z } from 'zod';
2
2
  export declare const actionLaunchFrameSchema: z.ZodObject<{
3
3
  type: z.ZodLiteral<"launch_frame">;
4
4
  name: z.ZodString;
5
- url: z.ZodString;
5
+ url: z.ZodOptional<z.ZodString>;
6
6
  splashImageUrl: z.ZodOptional<z.ZodString>;
7
7
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
8
8
  }, "strip", z.ZodTypeAny, {
9
9
  type: "launch_frame";
10
10
  name: string;
11
- url: string;
11
+ url?: string | undefined;
12
12
  splashImageUrl?: string | undefined;
13
13
  splashBackgroundColor?: string | undefined;
14
14
  }, {
15
15
  type: "launch_frame";
16
16
  name: string;
17
- url: string;
17
+ url?: string | undefined;
18
18
  splashImageUrl?: string | undefined;
19
19
  splashBackgroundColor?: string | undefined;
20
20
  }>;
@@ -31,19 +31,19 @@ export declare const actionViewTokenSchema: z.ZodObject<{
31
31
  export declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
32
32
  type: z.ZodLiteral<"launch_frame">;
33
33
  name: z.ZodString;
34
- url: z.ZodString;
34
+ url: z.ZodOptional<z.ZodString>;
35
35
  splashImageUrl: z.ZodOptional<z.ZodString>;
36
36
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
37
37
  }, "strip", z.ZodTypeAny, {
38
38
  type: "launch_frame";
39
39
  name: string;
40
- url: string;
40
+ url?: string | undefined;
41
41
  splashImageUrl?: string | undefined;
42
42
  splashBackgroundColor?: string | undefined;
43
43
  }, {
44
44
  type: "launch_frame";
45
45
  name: string;
46
- url: string;
46
+ url?: string | undefined;
47
47
  splashImageUrl?: string | undefined;
48
48
  splashBackgroundColor?: string | undefined;
49
49
  }>, z.ZodObject<{
@@ -61,19 +61,19 @@ export declare const buttonSchema: z.ZodObject<{
61
61
  action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
62
62
  type: z.ZodLiteral<"launch_frame">;
63
63
  name: z.ZodString;
64
- url: z.ZodString;
64
+ url: z.ZodOptional<z.ZodString>;
65
65
  splashImageUrl: z.ZodOptional<z.ZodString>;
66
66
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
67
67
  }, "strip", z.ZodTypeAny, {
68
68
  type: "launch_frame";
69
69
  name: string;
70
- url: string;
70
+ url?: string | undefined;
71
71
  splashImageUrl?: string | undefined;
72
72
  splashBackgroundColor?: string | undefined;
73
73
  }, {
74
74
  type: "launch_frame";
75
75
  name: string;
76
- url: string;
76
+ url?: string | undefined;
77
77
  splashImageUrl?: string | undefined;
78
78
  splashBackgroundColor?: string | undefined;
79
79
  }>, z.ZodObject<{
@@ -91,7 +91,7 @@ export declare const buttonSchema: z.ZodObject<{
91
91
  action: {
92
92
  type: "launch_frame";
93
93
  name: string;
94
- url: string;
94
+ url?: string | undefined;
95
95
  splashImageUrl?: string | undefined;
96
96
  splashBackgroundColor?: string | undefined;
97
97
  } | {
@@ -103,7 +103,7 @@ export declare const buttonSchema: z.ZodObject<{
103
103
  action: {
104
104
  type: "launch_frame";
105
105
  name: string;
106
- url: string;
106
+ url?: string | undefined;
107
107
  splashImageUrl?: string | undefined;
108
108
  splashBackgroundColor?: string | undefined;
109
109
  } | {
@@ -120,19 +120,19 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
120
120
  action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
121
121
  type: z.ZodLiteral<"launch_frame">;
122
122
  name: z.ZodString;
123
- url: z.ZodString;
123
+ url: z.ZodOptional<z.ZodString>;
124
124
  splashImageUrl: z.ZodOptional<z.ZodString>;
125
125
  splashBackgroundColor: z.ZodOptional<z.ZodString>;
126
126
  }, "strip", z.ZodTypeAny, {
127
127
  type: "launch_frame";
128
128
  name: string;
129
- url: string;
129
+ url?: string | undefined;
130
130
  splashImageUrl?: string | undefined;
131
131
  splashBackgroundColor?: string | undefined;
132
132
  }, {
133
133
  type: "launch_frame";
134
134
  name: string;
135
- url: string;
135
+ url?: string | undefined;
136
136
  splashImageUrl?: string | undefined;
137
137
  splashBackgroundColor?: string | undefined;
138
138
  }>, z.ZodObject<{
@@ -150,7 +150,7 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
150
150
  action: {
151
151
  type: "launch_frame";
152
152
  name: string;
153
- url: string;
153
+ url?: string | undefined;
154
154
  splashImageUrl?: string | undefined;
155
155
  splashBackgroundColor?: string | undefined;
156
156
  } | {
@@ -162,7 +162,7 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
162
162
  action: {
163
163
  type: "launch_frame";
164
164
  name: string;
165
- url: string;
165
+ url?: string | undefined;
166
166
  splashImageUrl?: string | undefined;
167
167
  splashBackgroundColor?: string | undefined;
168
168
  } | {
@@ -178,7 +178,7 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
178
178
  action: {
179
179
  type: "launch_frame";
180
180
  name: string;
181
- url: string;
181
+ url?: string | undefined;
182
182
  splashImageUrl?: string | undefined;
183
183
  splashBackgroundColor?: string | undefined;
184
184
  } | {
@@ -195,7 +195,7 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
195
195
  action: {
196
196
  type: "launch_frame";
197
197
  name: string;
198
- url: string;
198
+ url?: string | undefined;
199
199
  splashImageUrl?: string | undefined;
200
200
  splashBackgroundColor?: string | undefined;
201
201
  } | {
@@ -213,7 +213,7 @@ export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.SafeParseR
213
213
  action: {
214
214
  type: "launch_frame";
215
215
  name: string;
216
- url: string;
216
+ url?: string | undefined;
217
217
  splashImageUrl?: string | undefined;
218
218
  splashBackgroundColor?: string | undefined;
219
219
  } | {
@@ -230,7 +230,7 @@ export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.SafeParseR
230
230
  action: {
231
231
  type: "launch_frame";
232
232
  name: string;
233
- url: string;
233
+ url?: string | undefined;
234
234
  splashImageUrl?: string | undefined;
235
235
  splashBackgroundColor?: string | undefined;
236
236
  } | {
@@ -3,7 +3,7 @@ import { aspectRatioSchema, buttonTitleSchema, caip19TokenSchema, frameNameSchem
3
3
  export const actionLaunchFrameSchema = z.object({
4
4
  type: z.literal('launch_frame'),
5
5
  name: frameNameSchema,
6
- url: secureUrlSchema,
6
+ url: secureUrlSchema.optional(),
7
7
  splashImageUrl: secureUrlSchema.optional(),
8
8
  splashBackgroundColor: hexColorSchema.optional(),
9
9
  });