@farcaster/frame-core 0.0.31 → 0.0.32

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