@farcaster/frame-core 0.0.21 → 0.0.22

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