@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.
@@ -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
  }>;
@@ -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,29 @@ 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(),
52
+ /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
53
+ noindex: z.boolean().optional(),
21
54
  });
22
55
  export const domainManifestSchema = z.object({
23
56
  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()