@farcaster/frame-core 0.0.23 → 0.0.25
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/schemas/embeds.d.ts +61 -0
- package/dist/schemas/embeds.js +6 -1
- package/dist/schemas/shared.d.ts +1 -0
- package/dist/schemas/shared.js +5 -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 +230 -231
- package/esm/schemas/embeds.js +23 -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 +34 -49
- package/esm/schemas/shared.js +23 -20
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +102 -125
- package/esm/types.js +2 -2
- package/package.json +7 -2
- package/src/actions/ViewProfile.ts +5 -0
- package/src/actions/index.ts +1 -0
- package/src/schemas/embeds.ts +7 -0
- package/src/schemas/shared.ts +7 -0
- package/src/types.ts +3 -1
package/dist/actions/index.d.ts
CHANGED
package/dist/actions/index.js
CHANGED
|
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.SignIn = exports.AddFrame = void 0;
|
|
36
|
+
exports.SignIn = exports.ViewProfile = exports.AddFrame = void 0;
|
|
37
37
|
exports.AddFrame = __importStar(require("./AddFrame"));
|
|
38
|
+
exports.ViewProfile = __importStar(require("./ViewProfile"));
|
|
38
39
|
exports.SignIn = __importStar(require("./SignIn"));
|
package/dist/schemas/embeds.d.ts
CHANGED
|
@@ -18,6 +18,16 @@ export declare const actionLaunchFrameSchema: z.ZodObject<{
|
|
|
18
18
|
splashImageUrl?: string | undefined;
|
|
19
19
|
splashBackgroundColor?: string | undefined;
|
|
20
20
|
}>;
|
|
21
|
+
export declare const actionViewTokenSchema: z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"view_token">;
|
|
23
|
+
token: z.ZodString;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
type: "view_token";
|
|
26
|
+
token: string;
|
|
27
|
+
}, {
|
|
28
|
+
type: "view_token";
|
|
29
|
+
token: string;
|
|
30
|
+
}>;
|
|
21
31
|
export declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
22
32
|
type: z.ZodLiteral<"launch_frame">;
|
|
23
33
|
name: z.ZodString;
|
|
@@ -36,6 +46,15 @@ export declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
|
|
|
36
46
|
url: string;
|
|
37
47
|
splashImageUrl?: string | undefined;
|
|
38
48
|
splashBackgroundColor?: string | undefined;
|
|
49
|
+
}>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"view_token">;
|
|
51
|
+
token: z.ZodString;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
type: "view_token";
|
|
54
|
+
token: string;
|
|
55
|
+
}, {
|
|
56
|
+
type: "view_token";
|
|
57
|
+
token: string;
|
|
39
58
|
}>]>;
|
|
40
59
|
export declare const buttonSchema: z.ZodObject<{
|
|
41
60
|
title: z.ZodString;
|
|
@@ -57,6 +76,15 @@ export declare const buttonSchema: z.ZodObject<{
|
|
|
57
76
|
url: string;
|
|
58
77
|
splashImageUrl?: string | undefined;
|
|
59
78
|
splashBackgroundColor?: string | undefined;
|
|
79
|
+
}>, z.ZodObject<{
|
|
80
|
+
type: z.ZodLiteral<"view_token">;
|
|
81
|
+
token: z.ZodString;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
type: "view_token";
|
|
84
|
+
token: string;
|
|
85
|
+
}, {
|
|
86
|
+
type: "view_token";
|
|
87
|
+
token: string;
|
|
60
88
|
}>]>;
|
|
61
89
|
}, "strip", z.ZodTypeAny, {
|
|
62
90
|
title: string;
|
|
@@ -66,6 +94,9 @@ export declare const buttonSchema: z.ZodObject<{
|
|
|
66
94
|
url: string;
|
|
67
95
|
splashImageUrl?: string | undefined;
|
|
68
96
|
splashBackgroundColor?: string | undefined;
|
|
97
|
+
} | {
|
|
98
|
+
type: "view_token";
|
|
99
|
+
token: string;
|
|
69
100
|
};
|
|
70
101
|
}, {
|
|
71
102
|
title: string;
|
|
@@ -75,6 +106,9 @@ export declare const buttonSchema: z.ZodObject<{
|
|
|
75
106
|
url: string;
|
|
76
107
|
splashImageUrl?: string | undefined;
|
|
77
108
|
splashBackgroundColor?: string | undefined;
|
|
109
|
+
} | {
|
|
110
|
+
type: "view_token";
|
|
111
|
+
token: string;
|
|
78
112
|
};
|
|
79
113
|
}>;
|
|
80
114
|
export declare const frameEmbedNextSchema: z.ZodObject<{
|
|
@@ -100,6 +134,15 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
|
|
|
100
134
|
url: string;
|
|
101
135
|
splashImageUrl?: string | undefined;
|
|
102
136
|
splashBackgroundColor?: string | undefined;
|
|
137
|
+
}>, z.ZodObject<{
|
|
138
|
+
type: z.ZodLiteral<"view_token">;
|
|
139
|
+
token: z.ZodString;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
type: "view_token";
|
|
142
|
+
token: string;
|
|
143
|
+
}, {
|
|
144
|
+
type: "view_token";
|
|
145
|
+
token: string;
|
|
103
146
|
}>]>;
|
|
104
147
|
}, "strip", z.ZodTypeAny, {
|
|
105
148
|
title: string;
|
|
@@ -109,6 +152,9 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
|
|
|
109
152
|
url: string;
|
|
110
153
|
splashImageUrl?: string | undefined;
|
|
111
154
|
splashBackgroundColor?: string | undefined;
|
|
155
|
+
} | {
|
|
156
|
+
type: "view_token";
|
|
157
|
+
token: string;
|
|
112
158
|
};
|
|
113
159
|
}, {
|
|
114
160
|
title: string;
|
|
@@ -118,6 +164,9 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
|
|
|
118
164
|
url: string;
|
|
119
165
|
splashImageUrl?: string | undefined;
|
|
120
166
|
splashBackgroundColor?: string | undefined;
|
|
167
|
+
} | {
|
|
168
|
+
type: "view_token";
|
|
169
|
+
token: string;
|
|
121
170
|
};
|
|
122
171
|
}>;
|
|
123
172
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -131,6 +180,9 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
|
|
|
131
180
|
url: string;
|
|
132
181
|
splashImageUrl?: string | undefined;
|
|
133
182
|
splashBackgroundColor?: string | undefined;
|
|
183
|
+
} | {
|
|
184
|
+
type: "view_token";
|
|
185
|
+
token: string;
|
|
134
186
|
};
|
|
135
187
|
};
|
|
136
188
|
}, {
|
|
@@ -144,6 +196,9 @@ export declare const frameEmbedNextSchema: z.ZodObject<{
|
|
|
144
196
|
url: string;
|
|
145
197
|
splashImageUrl?: string | undefined;
|
|
146
198
|
splashBackgroundColor?: string | undefined;
|
|
199
|
+
} | {
|
|
200
|
+
type: "view_token";
|
|
201
|
+
token: string;
|
|
147
202
|
};
|
|
148
203
|
};
|
|
149
204
|
}>;
|
|
@@ -158,6 +213,9 @@ export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.SafeParseR
|
|
|
158
213
|
url: string;
|
|
159
214
|
splashImageUrl?: string | undefined;
|
|
160
215
|
splashBackgroundColor?: string | undefined;
|
|
216
|
+
} | {
|
|
217
|
+
type: "view_token";
|
|
218
|
+
token: string;
|
|
161
219
|
};
|
|
162
220
|
};
|
|
163
221
|
}, {
|
|
@@ -171,6 +229,9 @@ export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.SafeParseR
|
|
|
171
229
|
url: string;
|
|
172
230
|
splashImageUrl?: string | undefined;
|
|
173
231
|
splashBackgroundColor?: string | undefined;
|
|
232
|
+
} | {
|
|
233
|
+
type: "view_token";
|
|
234
|
+
token: string;
|
|
174
235
|
};
|
|
175
236
|
};
|
|
176
237
|
}>;
|
package/dist/schemas/embeds.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.safeParseFrameEmbed = exports.frameEmbedNextSchema = exports.buttonSchema = exports.actionSchema = exports.actionLaunchFrameSchema = void 0;
|
|
3
|
+
exports.safeParseFrameEmbed = exports.frameEmbedNextSchema = exports.buttonSchema = exports.actionSchema = exports.actionViewTokenSchema = exports.actionLaunchFrameSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const shared_1 = require("./shared");
|
|
6
6
|
exports.actionLaunchFrameSchema = zod_1.z.object({
|
|
@@ -10,8 +10,13 @@ exports.actionLaunchFrameSchema = zod_1.z.object({
|
|
|
10
10
|
splashImageUrl: shared_1.secureUrlSchema.optional(),
|
|
11
11
|
splashBackgroundColor: shared_1.hexColorSchema.optional(),
|
|
12
12
|
});
|
|
13
|
+
exports.actionViewTokenSchema = zod_1.z.object({
|
|
14
|
+
type: zod_1.z.literal('view_token'),
|
|
15
|
+
token: shared_1.caip19TokenSchema,
|
|
16
|
+
});
|
|
13
17
|
exports.actionSchema = zod_1.z.discriminatedUnion('type', [
|
|
14
18
|
exports.actionLaunchFrameSchema,
|
|
19
|
+
exports.actionViewTokenSchema,
|
|
15
20
|
]);
|
|
16
21
|
exports.buttonSchema = zod_1.z.object({
|
|
17
22
|
title: shared_1.buttonTitleSchema,
|
package/dist/schemas/shared.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const secureUrlSchema: z.ZodString;
|
|
3
3
|
export declare const frameNameSchema: z.ZodString;
|
|
4
4
|
export declare const buttonTitleSchema: z.ZodString;
|
|
5
|
+
export declare const caip19TokenSchema: z.ZodString;
|
|
5
6
|
export declare const hexColorSchema: z.ZodString;
|
|
6
7
|
export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<{
|
|
7
8
|
header: z.ZodString;
|
package/dist/schemas/shared.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsonFarcasterSignatureHeaderSchema = exports.encodedJsonFarcasterSignatureSchema = exports.hexColorSchema = exports.buttonTitleSchema = exports.frameNameSchema = exports.secureUrlSchema = void 0;
|
|
3
|
+
exports.jsonFarcasterSignatureHeaderSchema = exports.encodedJsonFarcasterSignatureSchema = exports.hexColorSchema = exports.caip19TokenSchema = exports.buttonTitleSchema = exports.frameNameSchema = exports.secureUrlSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.secureUrlSchema = zod_1.z
|
|
6
6
|
.string()
|
|
@@ -9,6 +9,10 @@ exports.secureUrlSchema = zod_1.z
|
|
|
9
9
|
.max(512);
|
|
10
10
|
exports.frameNameSchema = zod_1.z.string().max(32);
|
|
11
11
|
exports.buttonTitleSchema = zod_1.z.string().max(32);
|
|
12
|
+
const CAIP_19_REGEX = /^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/(?:[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}(?:\/[-.%a-zA-Z0-9]{1,78})?|native)$/;
|
|
13
|
+
exports.caip19TokenSchema = zod_1.z
|
|
14
|
+
.string()
|
|
15
|
+
.regex(CAIP_19_REGEX, { message: 'Invalid CAIP-19 asset ID' });
|
|
12
16
|
exports.hexColorSchema = zod_1.z
|
|
13
17
|
.string()
|
|
14
18
|
.regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i, {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Address, Provider, RpcRequest, RpcResponse, RpcSchema } from 'ox';
|
|
2
|
-
import type { AddFrame, SignIn } from './actions';
|
|
2
|
+
import type { AddFrame, SignIn, ViewProfile } from './actions';
|
|
3
3
|
import type { FrameContext } from './context';
|
|
4
4
|
import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas';
|
|
5
5
|
export type SetPrimaryButtonOptions = {
|
|
@@ -47,6 +47,7 @@ export type WireFrameHost = {
|
|
|
47
47
|
ethProviderRequestV2: RpcTransport;
|
|
48
48
|
eip6963RequestProvider: () => void;
|
|
49
49
|
addFrame: AddFrame.WireAddFrame;
|
|
50
|
+
viewProfile: ViewProfile.ViewProfile;
|
|
50
51
|
};
|
|
51
52
|
export type FrameHost = {
|
|
52
53
|
context: FrameContext;
|
|
@@ -63,6 +64,7 @@ export type FrameHost = {
|
|
|
63
64
|
*/
|
|
64
65
|
eip6963RequestProvider: () => void;
|
|
65
66
|
addFrame: AddFrame.AddFrame;
|
|
67
|
+
viewProfile: ViewProfile.ViewProfile;
|
|
66
68
|
};
|
|
67
69
|
export type FrameEthProviderEventData = {
|
|
68
70
|
type: 'frame_eth_provider_event';
|
|
@@ -1,40 +1,36 @@
|
|
|
1
|
-
import * as Errors from '../errors'
|
|
2
|
-
import type { OneOf } from '../internal/types'
|
|
3
|
-
import type { FrameNotificationDetails } from '../schemas'
|
|
1
|
+
import * as Errors from '../errors';
|
|
2
|
+
import type { OneOf } from '../internal/types';
|
|
3
|
+
import type { FrameNotificationDetails } from '../schemas';
|
|
4
4
|
export type AddFrameResult = {
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export type AddFrame = () => Promise<AddFrameResult
|
|
5
|
+
notificationDetails?: FrameNotificationDetails;
|
|
6
|
+
};
|
|
7
|
+
export type AddFrame = () => Promise<AddFrameResult>;
|
|
8
8
|
type InvalidDomainManifestJsonError = {
|
|
9
|
-
|
|
10
|
-
}
|
|
9
|
+
type: 'invalid_domain_manifest';
|
|
10
|
+
};
|
|
11
11
|
type RejectedByUserJsonError = {
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
export type AddFrameJsonError =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| {
|
|
23
|
-
error: AddFrameJsonError
|
|
24
|
-
}
|
|
25
|
-
>
|
|
26
|
-
export type WireAddFrame = () => Promise<AddFrameJsonResult>
|
|
12
|
+
type: 'rejected_by_user';
|
|
13
|
+
};
|
|
14
|
+
export type AddFrameJsonError = InvalidDomainManifestJsonError | RejectedByUserJsonError;
|
|
15
|
+
export type AddFrameRejectedReason = AddFrameJsonError['type'];
|
|
16
|
+
export type AddFrameJsonResult = OneOf<{
|
|
17
|
+
result: AddFrameResult;
|
|
18
|
+
} | {
|
|
19
|
+
error: AddFrameJsonError;
|
|
20
|
+
}>;
|
|
21
|
+
export type WireAddFrame = () => Promise<AddFrameJsonResult>;
|
|
27
22
|
/**
|
|
28
23
|
* Thrown when the frame does not have a valid domain manifest.
|
|
29
24
|
*/
|
|
30
25
|
export declare class InvalidDomainManifest extends Errors.BaseError {
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
readonly name = "AddFrame.InvalidDomainManifest";
|
|
27
|
+
constructor();
|
|
33
28
|
}
|
|
34
29
|
/**
|
|
35
30
|
* Thrown when add frame action was rejected by the user.
|
|
36
31
|
*/
|
|
37
32
|
export declare class RejectedByUser extends Errors.BaseError {
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
readonly name = "AddFrame.RejectedByUser";
|
|
34
|
+
constructor();
|
|
40
35
|
}
|
|
36
|
+
export {};
|
package/esm/actions/AddFrame.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import * as Errors from '../errors'
|
|
1
|
+
import * as Errors from '../errors';
|
|
2
2
|
/**
|
|
3
3
|
* Thrown when the frame does not have a valid domain manifest.
|
|
4
4
|
*/
|
|
5
5
|
export class InvalidDomainManifest extends Errors.BaseError {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
name = 'AddFrame.InvalidDomainManifest';
|
|
7
|
+
constructor() {
|
|
8
|
+
super('Invalid domain manifest');
|
|
9
|
+
}
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Thrown when add frame action was rejected by the user.
|
|
13
13
|
*/
|
|
14
14
|
export class RejectedByUser extends Errors.BaseError {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
name = 'AddFrame.RejectedByUser';
|
|
16
|
+
constructor() {
|
|
17
|
+
super('Add frame rejected by user');
|
|
18
|
+
}
|
|
19
19
|
}
|
package/esm/actions/SignIn.d.ts
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
import * as Errors from '../errors'
|
|
2
|
-
import type { OneOf } from '../internal/types'
|
|
1
|
+
import * as Errors from '../errors';
|
|
2
|
+
import type { OneOf } from '../internal/types';
|
|
3
3
|
export type SignInOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
4
|
+
/**
|
|
5
|
+
* A random string used to prevent replay attacks.
|
|
6
|
+
*/
|
|
7
|
+
nonce: string;
|
|
8
|
+
/**
|
|
9
|
+
* Start time at which the signature becomes valid.
|
|
10
|
+
* ISO 8601 datetime.
|
|
11
|
+
*/
|
|
12
|
+
notBefore?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Expiration time at which the signature is no longer valid.
|
|
15
|
+
* ISO 8601 datetime.
|
|
16
|
+
*/
|
|
17
|
+
expirationTime?: string;
|
|
18
|
+
};
|
|
19
19
|
export type SignInResult = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
export type SignIn = (options: SignInOptions) => Promise<SignInResult
|
|
20
|
+
signature: string;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
export type SignIn = (options: SignInOptions) => Promise<SignInResult>;
|
|
24
24
|
type RejectedByUserJsonError = {
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
export type SignInJsonError = RejectedByUserJsonError
|
|
28
|
-
export type SignInJsonResult = OneOf<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
>
|
|
36
|
-
export type WireSignIn = (options: SignInOptions) => Promise<SignInJsonResult>
|
|
25
|
+
type: 'rejected_by_user';
|
|
26
|
+
};
|
|
27
|
+
export type SignInJsonError = RejectedByUserJsonError;
|
|
28
|
+
export type SignInJsonResult = OneOf<{
|
|
29
|
+
result: SignInResult;
|
|
30
|
+
} | {
|
|
31
|
+
error: SignInJsonError;
|
|
32
|
+
}>;
|
|
33
|
+
export type WireSignIn = (options: SignInOptions) => Promise<SignInJsonResult>;
|
|
37
34
|
/**
|
|
38
35
|
* Thrown when a sign in action was rejected.
|
|
39
36
|
*/
|
|
40
37
|
export declare class RejectedByUser extends Errors.BaseError {
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
readonly name = "SignIn.RejectedByUser";
|
|
39
|
+
constructor();
|
|
43
40
|
}
|
|
41
|
+
export {};
|
package/esm/actions/SignIn.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as Errors from '../errors'
|
|
1
|
+
import * as Errors from '../errors';
|
|
2
2
|
/**
|
|
3
3
|
* Thrown when a sign in action was rejected.
|
|
4
4
|
*/
|
|
5
5
|
export class RejectedByUser extends Errors.BaseError {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
name = 'SignIn.RejectedByUser';
|
|
7
|
+
constructor() {
|
|
8
|
+
super('Sign in rejected by user');
|
|
9
|
+
}
|
|
10
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/actions/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * as AddFrame from './AddFrame'
|
|
2
|
-
export * as
|
|
1
|
+
export * as AddFrame from './AddFrame';
|
|
2
|
+
export * as ViewProfile from './ViewProfile';
|
|
3
|
+
export * as SignIn from './SignIn';
|
package/esm/actions/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * as AddFrame from './AddFrame'
|
|
2
|
-
export * as
|
|
1
|
+
export * as AddFrame from './AddFrame';
|
|
2
|
+
export * as ViewProfile from './ViewProfile';
|
|
3
|
+
export * as SignIn from './SignIn';
|
package/esm/context.d.ts
CHANGED
|
@@ -1,76 +1,72 @@
|
|
|
1
|
-
import type { FrameNotificationDetails } from './schemas'
|
|
1
|
+
import type { FrameNotificationDetails } from './schemas';
|
|
2
2
|
export type CastEmbedLocationContext = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
3
|
+
type: 'cast_embed';
|
|
4
|
+
embed: string;
|
|
5
|
+
cast: {
|
|
6
|
+
fid: number;
|
|
7
|
+
hash: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
10
|
export type NotificationLocationContext = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
11
|
+
type: 'notification';
|
|
12
|
+
notification: {
|
|
13
|
+
notificationId: string;
|
|
14
|
+
title: string;
|
|
15
|
+
body: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
18
|
export type LauncherLocationContext = {
|
|
19
|
-
|
|
20
|
-
}
|
|
19
|
+
type: 'launcher';
|
|
20
|
+
};
|
|
21
21
|
export type ChannelLocationContext = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
type: 'channel';
|
|
23
|
+
channel: {
|
|
24
|
+
/**
|
|
25
|
+
* Channel key identifier
|
|
26
|
+
*/
|
|
27
|
+
key: string;
|
|
28
|
+
/**
|
|
29
|
+
* Channel name
|
|
30
|
+
*/
|
|
31
|
+
name: string;
|
|
32
|
+
/**
|
|
33
|
+
* Channel profile image URL
|
|
34
|
+
*/
|
|
35
|
+
imageUrl?: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type LocationContext = CastEmbedLocationContext | NotificationLocationContext | LauncherLocationContext | ChannelLocationContext;
|
|
39
|
+
export type AccountLocation = {
|
|
40
|
+
placeId: string;
|
|
28
41
|
/**
|
|
29
|
-
*
|
|
42
|
+
* Human-readable string describing the location
|
|
30
43
|
*/
|
|
31
|
-
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
export type UserContext = {
|
|
47
|
+
fid: number;
|
|
48
|
+
username?: string;
|
|
49
|
+
displayName?: string;
|
|
32
50
|
/**
|
|
33
|
-
*
|
|
51
|
+
* Profile image URL
|
|
34
52
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
export type LocationContext =
|
|
39
|
-
| CastEmbedLocationContext
|
|
40
|
-
| NotificationLocationContext
|
|
41
|
-
| LauncherLocationContext
|
|
42
|
-
| ChannelLocationContext
|
|
43
|
-
export type AccountLocation = {
|
|
44
|
-
placeId: string
|
|
45
|
-
/**
|
|
46
|
-
* Human-readable string describing the location
|
|
47
|
-
*/
|
|
48
|
-
description: string
|
|
49
|
-
}
|
|
50
|
-
export type UserContext = {
|
|
51
|
-
fid: number
|
|
52
|
-
username?: string
|
|
53
|
-
displayName?: string
|
|
54
|
-
/**
|
|
55
|
-
* Profile image URL
|
|
56
|
-
*/
|
|
57
|
-
pfpUrl?: string
|
|
58
|
-
location?: AccountLocation
|
|
59
|
-
}
|
|
53
|
+
pfpUrl?: string;
|
|
54
|
+
location?: AccountLocation;
|
|
55
|
+
};
|
|
60
56
|
export type SafeAreaInsets = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
57
|
+
top: number;
|
|
58
|
+
bottom: number;
|
|
59
|
+
left: number;
|
|
60
|
+
right: number;
|
|
61
|
+
};
|
|
66
62
|
export type ClientContext = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
63
|
+
clientFid: number;
|
|
64
|
+
added: boolean;
|
|
65
|
+
notificationDetails?: FrameNotificationDetails;
|
|
66
|
+
safeAreaInsets?: SafeAreaInsets;
|
|
67
|
+
};
|
|
72
68
|
export type FrameContext = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
69
|
+
client: ClientContext;
|
|
70
|
+
user: UserContext;
|
|
71
|
+
location?: LocationContext;
|
|
72
|
+
};
|
package/esm/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
package/esm/errors.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
export declare class BaseError<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
cause: cause
|
|
6
|
-
constructor(message: string, options?: BaseError.Options<cause>)
|
|
1
|
+
export declare class BaseError<cause extends Error | undefined = undefined> extends Error {
|
|
2
|
+
name: string;
|
|
3
|
+
cause: cause;
|
|
4
|
+
constructor(message: string, options?: BaseError.Options<cause>);
|
|
7
5
|
}
|
|
8
6
|
export declare namespace BaseError {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
type Options<cause extends Error | undefined = Error | undefined> = {
|
|
8
|
+
cause?: cause | undefined;
|
|
9
|
+
};
|
|
12
10
|
}
|
package/esm/errors.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export class BaseError extends Error {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
name = 'BaseError';
|
|
3
|
+
cause;
|
|
4
|
+
constructor(message, options = {}) {
|
|
5
|
+
super(message, options.cause ? { cause: options.cause } : undefined);
|
|
6
|
+
this.cause = options.cause;
|
|
7
|
+
}
|
|
8
8
|
}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './actions'
|
|
2
|
-
export * as Context from './context'
|
|
3
|
-
export * from './types'
|
|
4
|
-
export * from './schemas'
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * as Context from './context';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './schemas';
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './actions'
|
|
2
|
-
export * as Context from './context'
|
|
3
|
-
export * from './types'
|
|
4
|
-
export * from './schemas'
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * as Context from './context';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './schemas';
|