@farcaster/miniapp-core 0.0.0-canary-20250713234517 → 0.0.0-canary-20250816182708
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/RequestCameraAndMicrophoneAccess.d.ts +19 -0
- package/dist/actions/RequestCameraAndMicrophoneAccess.js +2 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +2 -1
- package/dist/context.d.ts +1 -0
- package/dist/schemas/events.d.ts +0 -64
- package/dist/schemas/events.js +1 -11
- package/dist/schemas/manifest.d.ts +28 -28
- package/dist/types.d.ts +6 -8
- package/dist/types.js +1 -0
- package/esm/actions/RequestCameraAndMicrophoneAccess.d.ts +19 -0
- package/esm/actions/RequestCameraAndMicrophoneAccess.js +1 -0
- package/esm/actions/index.d.ts +1 -0
- package/esm/actions/index.js +1 -0
- package/esm/context.d.ts +1 -0
- package/esm/schemas/events.d.ts +0 -64
- package/esm/schemas/events.js +0 -10
- package/esm/schemas/manifest.d.ts +28 -28
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +6 -8
- package/esm/types.js +1 -0
- package/package.json +1 -1
- package/src/actions/RequestCameraAndMicrophoneAccess.ts +19 -0
- package/src/actions/index.ts +1 -0
- package/src/context.ts +1 -0
- package/src/schemas/events.ts +0 -16
- package/src/types.ts +4 -10
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requests permission to access the camera and microphone.
|
|
3
|
+
* This method will trigger a permission dialog in the host app.
|
|
4
|
+
*
|
|
5
|
+
* The promise will resolve if the user grants permission, and reject if denied.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* try {
|
|
10
|
+
* await sdk.actions.requestCameraAndMicrophoneAccess()
|
|
11
|
+
* console.log('Camera and microphone access granted')
|
|
12
|
+
* } catch (error) {
|
|
13
|
+
* console.log('Camera and microphone access denied')
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @see {@link https://miniapps.farcaster.xyz/docs/sdk/actions/request-camera-and-microphone-access | Request Camera and Microphone Access Documentation}
|
|
18
|
+
*/
|
|
19
|
+
export type RequestCameraAndMicrophoneAccess = () => Promise<void>
|
package/src/actions/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * as ComposeCast from './ComposeCast.ts'
|
|
|
3
3
|
export * as Haptics from './Haptics.ts'
|
|
4
4
|
export * as OpenMiniApp from './OpenMiniApp.ts'
|
|
5
5
|
export * as Ready from './Ready.ts'
|
|
6
|
+
export * as RequestCameraAndMicrophoneAccess from './RequestCameraAndMicrophoneAccess.ts'
|
|
6
7
|
export * as SendToken from './SendToken.ts'
|
|
7
8
|
export * as SignIn from './SignIn.ts'
|
|
8
9
|
export * as SwapToken from './SwapToken.ts'
|
package/src/context.ts
CHANGED
package/src/schemas/events.ts
CHANGED
|
@@ -8,25 +8,12 @@ export const eventMiniAppAddedSchema = z.object({
|
|
|
8
8
|
|
|
9
9
|
export type EventMiniAppAdded = z.infer<typeof eventMiniAppAddedSchema>
|
|
10
10
|
|
|
11
|
-
export const eventFrameAddedSchema = z.object({
|
|
12
|
-
event: z.literal('frame_added'),
|
|
13
|
-
notificationDetails: notificationDetailsSchema.optional(),
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
export type EventFrameAdded = z.infer<typeof eventFrameAddedSchema>
|
|
17
|
-
|
|
18
11
|
export const eventMiniAppRemovedSchema = z.object({
|
|
19
12
|
event: z.literal('miniapp_removed'),
|
|
20
13
|
})
|
|
21
14
|
|
|
22
15
|
export type EventMiniAppRemoved = z.infer<typeof eventMiniAppRemovedSchema>
|
|
23
16
|
|
|
24
|
-
export const eventFrameRemovedSchema = z.object({
|
|
25
|
-
event: z.literal('frame_removed'),
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
export type EventFrameRemoved = z.infer<typeof eventFrameRemovedSchema>
|
|
29
|
-
|
|
30
17
|
export const eventNotificationsEnabledSchema = z.object({
|
|
31
18
|
event: z.literal('notifications_enabled'),
|
|
32
19
|
notificationDetails: notificationDetailsSchema.required(),
|
|
@@ -49,9 +36,6 @@ export const serverEventSchema = z.discriminatedUnion('event', [
|
|
|
49
36
|
eventMiniAppRemovedSchema,
|
|
50
37
|
eventNotificationsEnabledSchema,
|
|
51
38
|
notificationsDisabledSchema,
|
|
52
|
-
// Remove after compatibility period
|
|
53
|
-
eventFrameAddedSchema,
|
|
54
|
-
eventFrameRemovedSchema,
|
|
55
39
|
])
|
|
56
40
|
|
|
57
41
|
export type MiniAppServerEvent = z.infer<typeof serverEventSchema>
|
package/src/types.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
ComposeCast,
|
|
9
9
|
OpenMiniApp,
|
|
10
10
|
Ready,
|
|
11
|
+
RequestCameraAndMicrophoneAccess,
|
|
11
12
|
SendToken,
|
|
12
13
|
SignIn,
|
|
13
14
|
SwapToken,
|
|
@@ -18,8 +19,6 @@ import type {
|
|
|
18
19
|
import type { UpdateBackState } from './back.ts'
|
|
19
20
|
import type { MiniAppContext } from './context.ts'
|
|
20
21
|
import type {
|
|
21
|
-
EventFrameAdded,
|
|
22
|
-
EventFrameRemoved,
|
|
23
22
|
EventMiniAppAdded,
|
|
24
23
|
EventMiniAppRemoved,
|
|
25
24
|
EventNotificationsDisabled,
|
|
@@ -62,6 +61,7 @@ export const miniAppHostCapabilityList = [
|
|
|
62
61
|
'actions.sendToken',
|
|
63
62
|
'actions.swapToken',
|
|
64
63
|
'actions.openMiniApp',
|
|
64
|
+
'actions.requestCameraAndMicrophoneAccess',
|
|
65
65
|
'haptics.impactOccurred',
|
|
66
66
|
'haptics.notificationOccurred',
|
|
67
67
|
'haptics.selectionChanged',
|
|
@@ -97,6 +97,7 @@ export type WireMiniAppHost = {
|
|
|
97
97
|
composeCast: <close extends boolean | undefined = undefined>(
|
|
98
98
|
options: ComposeCast.Options<close>,
|
|
99
99
|
) => Promise<ComposeCast.Result<close>>
|
|
100
|
+
requestCameraAndMicrophoneAccess: RequestCameraAndMicrophoneAccess.RequestCameraAndMicrophoneAccess
|
|
100
101
|
impactOccurred: ImpactOccurred
|
|
101
102
|
notificationOccurred: NotificationOccurred
|
|
102
103
|
selectionChanged: SelectionChanged
|
|
@@ -131,6 +132,7 @@ export type MiniAppHost = {
|
|
|
131
132
|
composeCast: <close extends boolean | undefined = undefined>(
|
|
132
133
|
options: ComposeCast.Options<close>,
|
|
133
134
|
) => Promise<ComposeCast.Result<close>>
|
|
135
|
+
requestCameraAndMicrophoneAccess: RequestCameraAndMicrophoneAccess.RequestCameraAndMicrophoneAccess
|
|
134
136
|
impactOccurred: ImpactOccurred
|
|
135
137
|
notificationOccurred: NotificationOccurred
|
|
136
138
|
selectionChanged: SelectionChanged
|
|
@@ -139,11 +141,6 @@ export type MiniAppHost = {
|
|
|
139
141
|
updateBackState: UpdateBackState
|
|
140
142
|
}
|
|
141
143
|
|
|
142
|
-
export type EventFrameAddRejected = {
|
|
143
|
-
event: 'frame_add_rejected'
|
|
144
|
-
reason: AddMiniApp.AddMiniAppRejectedReason
|
|
145
|
-
}
|
|
146
|
-
|
|
147
144
|
export type EventMiniAppAddRejected = {
|
|
148
145
|
event: 'miniapp_add_rejected'
|
|
149
146
|
reason: AddMiniApp.AddMiniAppRejectedReason
|
|
@@ -166,6 +163,3 @@ export type MiniAppClientEvent =
|
|
|
166
163
|
| EventPrimaryButtonClicked
|
|
167
164
|
| EventBackNavigationTriggered
|
|
168
165
|
| Ethereum.EventEip6963AnnounceProvider
|
|
169
|
-
| EventFrameAdded
|
|
170
|
-
| EventFrameAddRejected
|
|
171
|
-
| EventFrameRemoved
|