@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
|
@@ -1,156 +1,112 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const domainFrameConfigSchema: z.ZodObject<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
splashImageUrl
|
|
18
|
-
splashBackgroundColor
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
iconUrl: z.ZodString
|
|
80
|
-
homeUrl: z.ZodString
|
|
81
|
-
imageUrl: z.ZodOptional<z.ZodString>
|
|
82
|
-
buttonTitle: z.ZodOptional<z.ZodString>
|
|
83
|
-
splashImageUrl: z.ZodOptional<z.ZodString>
|
|
84
|
-
splashBackgroundColor: z.ZodOptional<z.ZodString>
|
|
85
|
-
webhookUrl: z.ZodOptional<z.ZodString>
|
|
86
|
-
},
|
|
87
|
-
'strip',
|
|
88
|
-
z.ZodTypeAny,
|
|
89
|
-
{
|
|
90
|
-
name: string
|
|
91
|
-
version: 'next' | '0.0.0' | '0.0.1' | '1'
|
|
92
|
-
iconUrl: string
|
|
93
|
-
homeUrl: string
|
|
94
|
-
splashImageUrl?: string | undefined
|
|
95
|
-
splashBackgroundColor?: string | undefined
|
|
96
|
-
imageUrl?: string | undefined
|
|
97
|
-
buttonTitle?: string | undefined
|
|
98
|
-
webhookUrl?: string | undefined
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: string
|
|
102
|
-
version: 'next' | '0.0.0' | '0.0.1' | '1'
|
|
103
|
-
iconUrl: string
|
|
104
|
-
homeUrl: string
|
|
105
|
-
splashImageUrl?: string | undefined
|
|
106
|
-
splashBackgroundColor?: string | undefined
|
|
107
|
-
imageUrl?: string | undefined
|
|
108
|
-
buttonTitle?: string | undefined
|
|
109
|
-
webhookUrl?: string | undefined
|
|
110
|
-
}
|
|
111
|
-
>
|
|
112
|
-
>
|
|
113
|
-
},
|
|
114
|
-
'strip',
|
|
115
|
-
z.ZodTypeAny,
|
|
116
|
-
{
|
|
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">, z.ZodLiteral<"next">]>;
|
|
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: "next" | "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: "next" | "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">, z.ZodLiteral<"next">]>;
|
|
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: "next" | "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: "next" | "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, {
|
|
117
79
|
accountAssociation: {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
frame?:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
| undefined
|
|
135
|
-
},
|
|
136
|
-
{
|
|
80
|
+
header: string;
|
|
81
|
+
payload: string;
|
|
82
|
+
signature: string;
|
|
83
|
+
};
|
|
84
|
+
frame?: {
|
|
85
|
+
name: string;
|
|
86
|
+
version: "next" | "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
|
+
}, {
|
|
137
96
|
accountAssociation: {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
frame?:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
| undefined
|
|
155
|
-
}
|
|
156
|
-
>
|
|
97
|
+
header: string;
|
|
98
|
+
payload: string;
|
|
99
|
+
signature: string;
|
|
100
|
+
};
|
|
101
|
+
frame?: {
|
|
102
|
+
name: string;
|
|
103
|
+
version: "next" | "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
|
+
}>;
|
package/esm/schemas/manifest.js
CHANGED
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import {
|
|
3
|
-
buttonTitleSchema,
|
|
4
|
-
encodedJsonFarcasterSignatureSchema,
|
|
5
|
-
frameNameSchema,
|
|
6
|
-
hexColorSchema,
|
|
7
|
-
secureUrlSchema,
|
|
8
|
-
} from './shared'
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { buttonTitleSchema, encodedJsonFarcasterSignatureSchema, frameNameSchema, hexColorSchema, secureUrlSchema, } from './shared';
|
|
9
3
|
export const domainFrameConfigSchema = z.object({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
4
|
+
// 0.0.0 and 0.0.1 are not technically part of the spec but kept for
|
|
5
|
+
// backwards compatibilty. next should always resolve to the most recent
|
|
6
|
+
// schema version.
|
|
7
|
+
version: z.union([
|
|
8
|
+
z.literal('0.0.0'),
|
|
9
|
+
z.literal('0.0.1'),
|
|
10
|
+
z.literal('1'),
|
|
11
|
+
z.literal('next'),
|
|
12
|
+
]),
|
|
13
|
+
name: frameNameSchema,
|
|
14
|
+
iconUrl: secureUrlSchema,
|
|
15
|
+
homeUrl: secureUrlSchema,
|
|
16
|
+
imageUrl: secureUrlSchema.optional(),
|
|
17
|
+
buttonTitle: buttonTitleSchema.optional(),
|
|
18
|
+
splashImageUrl: secureUrlSchema.optional(),
|
|
19
|
+
splashBackgroundColor: hexColorSchema.optional(),
|
|
20
|
+
webhookUrl: secureUrlSchema.optional(),
|
|
21
|
+
});
|
|
28
22
|
export const domainManifestSchema = z.object({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
23
|
+
accountAssociation: encodedJsonFarcasterSignatureSchema,
|
|
24
|
+
frame: domainFrameConfigSchema.optional(),
|
|
25
|
+
});
|
|
@@ -1,88 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const notificationDetailsSchema: z.ZodObject<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
notificationId:
|
|
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
|
-
result: z.ZodObject<
|
|
50
|
-
{
|
|
51
|
-
successfulTokens: z.ZodArray<z.ZodString, 'many'>
|
|
52
|
-
invalidTokens: z.ZodArray<z.ZodString, 'many'>
|
|
53
|
-
rateLimitedTokens: z.ZodArray<z.ZodString, 'many'>
|
|
54
|
-
},
|
|
55
|
-
'strip',
|
|
56
|
-
z.ZodTypeAny,
|
|
57
|
-
{
|
|
58
|
-
successfulTokens: string[]
|
|
59
|
-
invalidTokens: string[]
|
|
60
|
-
rateLimitedTokens: string[]
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
successfulTokens: string[]
|
|
64
|
-
invalidTokens: string[]
|
|
65
|
-
rateLimitedTokens: string[]
|
|
66
|
-
}
|
|
67
|
-
>
|
|
68
|
-
},
|
|
69
|
-
'strip',
|
|
70
|
-
z.ZodTypeAny,
|
|
71
|
-
{
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const notificationDetailsSchema: z.ZodObject<{
|
|
3
|
+
url: z.ZodString;
|
|
4
|
+
token: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
url: string;
|
|
7
|
+
token: string;
|
|
8
|
+
}, {
|
|
9
|
+
url: string;
|
|
10
|
+
token: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type FrameNotificationDetails = z.infer<typeof notificationDetailsSchema>;
|
|
13
|
+
export declare const sendNotificationRequestSchema: z.ZodObject<{
|
|
14
|
+
notificationId: z.ZodString;
|
|
15
|
+
title: z.ZodString;
|
|
16
|
+
body: z.ZodString;
|
|
17
|
+
targetUrl: z.ZodString;
|
|
18
|
+
tokens: z.ZodArray<z.ZodString, "many">;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
title: string;
|
|
21
|
+
notificationId: string;
|
|
22
|
+
body: string;
|
|
23
|
+
targetUrl: string;
|
|
24
|
+
tokens: string[];
|
|
25
|
+
}, {
|
|
26
|
+
title: string;
|
|
27
|
+
notificationId: string;
|
|
28
|
+
body: string;
|
|
29
|
+
targetUrl: string;
|
|
30
|
+
tokens: string[];
|
|
31
|
+
}>;
|
|
32
|
+
export type SendNotificationRequest = z.infer<typeof sendNotificationRequestSchema>;
|
|
33
|
+
export declare const sendNotificationResponseSchema: z.ZodObject<{
|
|
34
|
+
result: z.ZodObject<{
|
|
35
|
+
successfulTokens: z.ZodArray<z.ZodString, "many">;
|
|
36
|
+
invalidTokens: z.ZodArray<z.ZodString, "many">;
|
|
37
|
+
rateLimitedTokens: z.ZodArray<z.ZodString, "many">;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
successfulTokens: string[];
|
|
40
|
+
invalidTokens: string[];
|
|
41
|
+
rateLimitedTokens: string[];
|
|
42
|
+
}, {
|
|
43
|
+
successfulTokens: string[];
|
|
44
|
+
invalidTokens: string[];
|
|
45
|
+
rateLimitedTokens: string[];
|
|
46
|
+
}>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
48
|
result: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
{
|
|
49
|
+
successfulTokens: string[];
|
|
50
|
+
invalidTokens: string[];
|
|
51
|
+
rateLimitedTokens: string[];
|
|
52
|
+
};
|
|
53
|
+
}, {
|
|
79
54
|
result: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
export type SendNotificationResponse = z.infer<
|
|
87
|
-
typeof sendNotificationResponseSchema
|
|
88
|
-
>
|
|
55
|
+
successfulTokens: string[];
|
|
56
|
+
invalidTokens: string[];
|
|
57
|
+
rateLimitedTokens: string[];
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
60
|
+
export type SendNotificationResponse = z.infer<typeof sendNotificationResponseSchema>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import { secureUrlSchema } from './shared'
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { secureUrlSchema } from './shared';
|
|
3
3
|
export const notificationDetailsSchema = z.object({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})
|
|
4
|
+
url: z.string(),
|
|
5
|
+
token: z.string(),
|
|
6
|
+
});
|
|
7
7
|
export const sendNotificationRequestSchema = z.object({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
8
|
+
notificationId: z.string().max(128),
|
|
9
|
+
title: z.string().max(32),
|
|
10
|
+
body: z.string().max(128),
|
|
11
|
+
targetUrl: secureUrlSchema,
|
|
12
|
+
tokens: z.string().array().max(100),
|
|
13
|
+
});
|
|
14
14
|
export const sendNotificationResponseSchema = z.object({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
15
|
+
result: z.object({
|
|
16
|
+
successfulTokens: z.array(z.string()),
|
|
17
|
+
invalidTokens: z.array(z.string()),
|
|
18
|
+
rateLimitedTokens: z.array(z.string()),
|
|
19
|
+
}),
|
|
20
|
+
});
|
package/esm/schemas/shared.d.ts
CHANGED
|
@@ -1,49 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const secureUrlSchema: z.ZodString
|
|
3
|
-
export declare const frameNameSchema: z.ZodString
|
|
4
|
-
export declare const buttonTitleSchema: z.ZodString
|
|
5
|
-
export declare const hexColorSchema: z.ZodString
|
|
6
|
-
export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
header: string
|
|
16
|
-
payload: string
|
|
17
|
-
signature: string
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
fid:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'strip',
|
|
35
|
-
z.ZodTypeAny,
|
|
36
|
-
{
|
|
37
|
-
type: 'app_key'
|
|
38
|
-
fid: number
|
|
39
|
-
key: string
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
type: 'app_key'
|
|
43
|
-
fid: number
|
|
44
|
-
key: string
|
|
45
|
-
}
|
|
46
|
-
>
|
|
47
|
-
export type JsonFarcasterSignatureHeaderSchema = z.infer<
|
|
48
|
-
typeof jsonFarcasterSignatureHeaderSchema
|
|
49
|
-
>
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const secureUrlSchema: z.ZodString;
|
|
3
|
+
export declare const frameNameSchema: z.ZodString;
|
|
4
|
+
export declare const buttonTitleSchema: z.ZodString;
|
|
5
|
+
export declare const hexColorSchema: z.ZodString;
|
|
6
|
+
export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<{
|
|
7
|
+
header: z.ZodString;
|
|
8
|
+
payload: z.ZodString;
|
|
9
|
+
signature: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
header: string;
|
|
12
|
+
payload: string;
|
|
13
|
+
signature: string;
|
|
14
|
+
}, {
|
|
15
|
+
header: string;
|
|
16
|
+
payload: string;
|
|
17
|
+
signature: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type EncodedJsonFarcasterSignatureSchema = z.infer<typeof encodedJsonFarcasterSignatureSchema>;
|
|
20
|
+
export declare const jsonFarcasterSignatureHeaderSchema: z.ZodObject<{
|
|
21
|
+
fid: z.ZodNumber;
|
|
22
|
+
type: z.ZodLiteral<"app_key">;
|
|
23
|
+
key: z.ZodString;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
type: "app_key";
|
|
26
|
+
fid: number;
|
|
27
|
+
key: string;
|
|
28
|
+
}, {
|
|
29
|
+
type: "app_key";
|
|
30
|
+
fid: number;
|
|
31
|
+
key: string;
|
|
32
|
+
}>;
|
|
33
|
+
export type JsonFarcasterSignatureHeaderSchema = z.infer<typeof jsonFarcasterSignatureHeaderSchema>;
|
package/esm/schemas/shared.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export const secureUrlSchema = z
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export const frameNameSchema = z.string().max(32)
|
|
8
|
-
export const buttonTitleSchema = z.string().max(32)
|
|
3
|
+
.string()
|
|
4
|
+
.url()
|
|
5
|
+
.startsWith('https://', { message: 'Must be an https url' })
|
|
6
|
+
.max(512);
|
|
7
|
+
export const frameNameSchema = z.string().max(32);
|
|
8
|
+
export const buttonTitleSchema = z.string().max(32);
|
|
9
9
|
export const hexColorSchema = z
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
message:
|
|
13
|
-
|
|
14
|
-
})
|
|
10
|
+
.string()
|
|
11
|
+
.regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i, {
|
|
12
|
+
message: 'Invalid hex color code. It should be in the format #RRGGBB or #RGB.',
|
|
13
|
+
});
|
|
15
14
|
export const encodedJsonFarcasterSignatureSchema = z.object({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
15
|
+
header: z.string(),
|
|
16
|
+
payload: z.string(),
|
|
17
|
+
signature: z.string(),
|
|
18
|
+
});
|
|
20
19
|
export const jsonFarcasterSignatureHeaderSchema = z.object({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
20
|
+
fid: z.number(),
|
|
21
|
+
type: z.literal('app_key'),
|
|
22
|
+
key: z.string().startsWith('0x'),
|
|
23
|
+
});
|