@capgo/capacitor-permissions 0.0.0-stage → 8.2.2

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.
@@ -0,0 +1,219 @@
1
+ /**
2
+ * Normalized permission status returned by every platform implementation.
3
+ *
4
+ * - `granted`: the user allowed full access.
5
+ * - `denied`: the user has not granted access yet, or Android can show a rationale.
6
+ * - `blocked`: the user denied access and the app cannot prompt again without settings.
7
+ * - `limited`: partial access (for example iOS limited photo library or reduced location accuracy).
8
+ * - `unavailable`: the permission is not supported on this platform or not declared in the app manifest.
9
+ *
10
+ * @since 8.0.0
11
+ */
12
+ export type AppPermissionState = 'granted' | 'denied' | 'blocked' | 'limited' | 'unavailable';
13
+ /**
14
+ * Logical permission identifiers shared across iOS, Android, and web.
15
+ *
16
+ * Android-only names include `activityRecognition`, `phone`, `sms`, `mediaAudio`, `mediaImages`, and `mediaVideo`.
17
+ * iOS-only names include `reminders` and `appTrackingTransparency`.
18
+ * Web supports a subset via browser APIs (`camera`, `microphone`, `notifications`, `locationWhenInUse`).
19
+ * On web, `locationAlways` is an alias of foreground geolocation only; browsers do not expose background location permission.
20
+ *
21
+ * @since 8.0.0
22
+ */
23
+ export type PermissionName = 'camera' | 'microphone' | 'photoLibrary' | 'photoLibraryAddOnly' | 'contacts' | 'calendar' | 'reminders' | 'locationWhenInUse' | 'locationAlways' | 'bluetooth' | 'motion' | 'notifications' | 'speechRecognition' | 'appTrackingTransparency' | 'activityRecognition' | 'phone' | 'sms' | 'mediaAudio' | 'mediaImages' | 'mediaVideo';
24
+ /**
25
+ * Options for checking or requesting a single permission.
26
+ *
27
+ * @since 8.0.0
28
+ */
29
+ export interface PermissionOptions {
30
+ /**
31
+ * Logical permission to evaluate or request.
32
+ *
33
+ * @since 8.0.0
34
+ */
35
+ permission: PermissionName;
36
+ }
37
+ /**
38
+ * Result for a single permission status.
39
+ *
40
+ * @since 8.0.0
41
+ */
42
+ export interface PermissionStatusResult {
43
+ /**
44
+ * Current status for the requested permission.
45
+ *
46
+ * @since 8.0.0
47
+ */
48
+ status: AppPermissionState;
49
+ }
50
+ /**
51
+ * Options for checking or requesting several permissions.
52
+ *
53
+ * @since 8.0.0
54
+ */
55
+ export interface MultiplePermissionOptions {
56
+ /**
57
+ * Permissions to evaluate in order. On `requestMultiple`, each permission is requested one after another.
58
+ *
59
+ * @since 8.0.0
60
+ */
61
+ permissions: PermissionName[];
62
+ }
63
+ /**
64
+ * Result for several permission statuses.
65
+ *
66
+ * @since 8.0.0
67
+ */
68
+ export interface MultiplePermissionStatusResult {
69
+ /**
70
+ * Map of permission name to status. Keys match the names passed in `permissions`.
71
+ *
72
+ * @since 8.0.0
73
+ */
74
+ statuses: Record<string, AppPermissionState>;
75
+ }
76
+ /**
77
+ * Result for Android rationale checks.
78
+ *
79
+ * @since 8.0.0
80
+ */
81
+ export interface ShouldShowRationaleResult {
82
+ /**
83
+ * True only when Android would show a rationale dialog before requesting again.
84
+ * Always false on iOS and web.
85
+ *
86
+ * @since 8.0.0
87
+ */
88
+ shouldShow: boolean;
89
+ }
90
+ /**
91
+ * Settings screen type for `openSettings`.
92
+ *
93
+ * @since 8.0.0
94
+ */
95
+ export type SettingsType = 'application' | 'notifications';
96
+ /**
97
+ * Options for opening system settings.
98
+ *
99
+ * @since 8.0.0
100
+ */
101
+ export interface OpenSettingsOptions {
102
+ /**
103
+ * Which settings screen to open.
104
+ *
105
+ * @default 'application'
106
+ * @since 8.0.0
107
+ */
108
+ type?: SettingsType;
109
+ }
110
+ /**
111
+ * Plugin version payload.
112
+ *
113
+ * @since 8.0.0
114
+ */
115
+ export interface PluginVersionResult {
116
+ /**
117
+ * Version identifier returned by the platform implementation (`native` on mobile, `web` in browsers).
118
+ *
119
+ * @since 8.0.0
120
+ */
121
+ version: string;
122
+ }
123
+ /**
124
+ * Cross-platform permissions API for Capacitor apps.
125
+ *
126
+ * @since 8.0.0
127
+ */
128
+ export interface PermissionsPlugin {
129
+ /**
130
+ * Check the current status of one permission without prompting the user.
131
+ *
132
+ * @param options.permission Logical permission to inspect.
133
+ * @since 8.0.0
134
+ * @example
135
+ * ```typescript
136
+ * const { status } = await Permissions.check({ permission: 'camera' });
137
+ * ```
138
+ */
139
+ check(options: PermissionOptions): Promise<PermissionStatusResult>;
140
+ /**
141
+ * Request one permission from the user. On Android, shows the system dialog when needed.
142
+ * On iOS, triggers the platform authorization flow for the mapped capability.
143
+ *
144
+ * @param options.permission Logical permission to request.
145
+ * @since 8.0.0
146
+ * @example
147
+ * ```typescript
148
+ * const { status } = await Permissions.request({ permission: 'notifications' });
149
+ * ```
150
+ */
151
+ request(options: PermissionOptions): Promise<PermissionStatusResult>;
152
+ /**
153
+ * Check several permissions without prompting.
154
+ *
155
+ * @param options.permissions List of permissions to inspect.
156
+ * @since 8.0.0
157
+ * @example
158
+ * ```typescript
159
+ * const { statuses } = await Permissions.checkMultiple({
160
+ * permissions: ['camera', 'microphone'],
161
+ * });
162
+ * ```
163
+ */
164
+ checkMultiple(options: MultiplePermissionOptions): Promise<MultiplePermissionStatusResult>;
165
+ /**
166
+ * Request several permissions sequentially so dialogs are not shown on top of each other.
167
+ *
168
+ * @param options.permissions List of permissions to request.
169
+ * @since 8.0.0
170
+ */
171
+ requestMultiple(options: MultiplePermissionOptions): Promise<MultiplePermissionStatusResult>;
172
+ /**
173
+ * Whether Android should show a rationale before requesting again.
174
+ * Returns `{ shouldShow: false }` on iOS and web.
175
+ *
176
+ * @param options.permission Logical permission to inspect.
177
+ * @since 8.0.0
178
+ * @example
179
+ * ```typescript
180
+ * const { shouldShow } = await Permissions.shouldShowRationale({ permission: 'camera' });
181
+ * if (shouldShow) {
182
+ * await showWhyWeNeedCamera();
183
+ * await Permissions.request({ permission: 'camera' });
184
+ * }
185
+ * ```
186
+ */
187
+ shouldShowRationale(options: PermissionOptions): Promise<ShouldShowRationaleResult>;
188
+ /**
189
+ * Open the application or notification settings screen.
190
+ * Rejects on web with `UNIMPLEMENTED`.
191
+ *
192
+ * @param options.type Settings destination. Defaults to `application`.
193
+ * @since 8.0.0
194
+ * @example
195
+ * ```typescript
196
+ * await Permissions.openSettings({ type: 'notifications' });
197
+ * ```
198
+ */
199
+ openSettings(options?: OpenSettingsOptions): Promise<void>;
200
+ /**
201
+ * Ask for precise location.
202
+ * On iOS, requests temporary full accuracy when already authorized when-in-use.
203
+ * On Android, requests `ACCESS_FINE_LOCATION`.
204
+ * On web, returns the geolocation permission status after prompting when possible.
205
+ *
206
+ * @since 8.0.0
207
+ * @example
208
+ * ```typescript
209
+ * const { status } = await Permissions.requestPreciseLocation();
210
+ * ```
211
+ */
212
+ requestPreciseLocation(): Promise<PermissionStatusResult>;
213
+ /**
214
+ * Returns the platform implementation version marker.
215
+ *
216
+ * @since 8.0.0
217
+ */
218
+ getPluginVersion(): Promise<PluginVersionResult>;
219
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Normalized permission status returned by every platform implementation.\n *\n * - `granted`: the user allowed full access.\n * - `denied`: the user has not granted access yet, or Android can show a rationale.\n * - `blocked`: the user denied access and the app cannot prompt again without settings.\n * - `limited`: partial access (for example iOS limited photo library or reduced location accuracy).\n * - `unavailable`: the permission is not supported on this platform or not declared in the app manifest.\n *\n * @since 8.0.0\n */\nexport type AppPermissionState = 'granted' | 'denied' | 'blocked' | 'limited' | 'unavailable';\n\n/**\n * Logical permission identifiers shared across iOS, Android, and web.\n *\n * Android-only names include `activityRecognition`, `phone`, `sms`, `mediaAudio`, `mediaImages`, and `mediaVideo`.\n * iOS-only names include `reminders` and `appTrackingTransparency`.\n * Web supports a subset via browser APIs (`camera`, `microphone`, `notifications`, `locationWhenInUse`).\n * On web, `locationAlways` is an alias of foreground geolocation only; browsers do not expose background location permission.\n *\n * @since 8.0.0\n */\nexport type PermissionName =\n | 'camera'\n | 'microphone'\n | 'photoLibrary'\n | 'photoLibraryAddOnly'\n | 'contacts'\n | 'calendar'\n | 'reminders'\n | 'locationWhenInUse'\n | 'locationAlways'\n | 'bluetooth'\n | 'motion'\n | 'notifications'\n | 'speechRecognition'\n | 'appTrackingTransparency'\n | 'activityRecognition'\n | 'phone'\n | 'sms'\n | 'mediaAudio'\n | 'mediaImages'\n | 'mediaVideo';\n\n/**\n * Options for checking or requesting a single permission.\n *\n * @since 8.0.0\n */\nexport interface PermissionOptions {\n /**\n * Logical permission to evaluate or request.\n *\n * @since 8.0.0\n */\n permission: PermissionName;\n}\n\n/**\n * Result for a single permission status.\n *\n * @since 8.0.0\n */\nexport interface PermissionStatusResult {\n /**\n * Current status for the requested permission.\n *\n * @since 8.0.0\n */\n status: AppPermissionState;\n}\n\n/**\n * Options for checking or requesting several permissions.\n *\n * @since 8.0.0\n */\nexport interface MultiplePermissionOptions {\n /**\n * Permissions to evaluate in order. On `requestMultiple`, each permission is requested one after another.\n *\n * @since 8.0.0\n */\n permissions: PermissionName[];\n}\n\n/**\n * Result for several permission statuses.\n *\n * @since 8.0.0\n */\nexport interface MultiplePermissionStatusResult {\n /**\n * Map of permission name to status. Keys match the names passed in `permissions`.\n *\n * @since 8.0.0\n */\n statuses: Record<string, AppPermissionState>;\n}\n\n/**\n * Result for Android rationale checks.\n *\n * @since 8.0.0\n */\nexport interface ShouldShowRationaleResult {\n /**\n * True only when Android would show a rationale dialog before requesting again.\n * Always false on iOS and web.\n *\n * @since 8.0.0\n */\n shouldShow: boolean;\n}\n\n/**\n * Settings screen type for `openSettings`.\n *\n * @since 8.0.0\n */\nexport type SettingsType = 'application' | 'notifications';\n\n/**\n * Options for opening system settings.\n *\n * @since 8.0.0\n */\nexport interface OpenSettingsOptions {\n /**\n * Which settings screen to open.\n *\n * @default 'application'\n * @since 8.0.0\n */\n type?: SettingsType;\n}\n\n/**\n * Plugin version payload.\n *\n * @since 8.0.0\n */\nexport interface PluginVersionResult {\n /**\n * Version identifier returned by the platform implementation (`native` on mobile, `web` in browsers).\n *\n * @since 8.0.0\n */\n version: string;\n}\n\n/**\n * Cross-platform permissions API for Capacitor apps.\n *\n * @since 8.0.0\n */\nexport interface PermissionsPlugin {\n /**\n * Check the current status of one permission without prompting the user.\n *\n * @param options.permission Logical permission to inspect.\n * @since 8.0.0\n * @example\n * ```typescript\n * const { status } = await Permissions.check({ permission: 'camera' });\n * ```\n */\n check(options: PermissionOptions): Promise<PermissionStatusResult>;\n\n /**\n * Request one permission from the user. On Android, shows the system dialog when needed.\n * On iOS, triggers the platform authorization flow for the mapped capability.\n *\n * @param options.permission Logical permission to request.\n * @since 8.0.0\n * @example\n * ```typescript\n * const { status } = await Permissions.request({ permission: 'notifications' });\n * ```\n */\n request(options: PermissionOptions): Promise<PermissionStatusResult>;\n\n /**\n * Check several permissions without prompting.\n *\n * @param options.permissions List of permissions to inspect.\n * @since 8.0.0\n * @example\n * ```typescript\n * const { statuses } = await Permissions.checkMultiple({\n * permissions: ['camera', 'microphone'],\n * });\n * ```\n */\n checkMultiple(options: MultiplePermissionOptions): Promise<MultiplePermissionStatusResult>;\n\n /**\n * Request several permissions sequentially so dialogs are not shown on top of each other.\n *\n * @param options.permissions List of permissions to request.\n * @since 8.0.0\n */\n requestMultiple(options: MultiplePermissionOptions): Promise<MultiplePermissionStatusResult>;\n\n /**\n * Whether Android should show a rationale before requesting again.\n * Returns `{ shouldShow: false }` on iOS and web.\n *\n * @param options.permission Logical permission to inspect.\n * @since 8.0.0\n * @example\n * ```typescript\n * const { shouldShow } = await Permissions.shouldShowRationale({ permission: 'camera' });\n * if (shouldShow) {\n * await showWhyWeNeedCamera();\n * await Permissions.request({ permission: 'camera' });\n * }\n * ```\n */\n shouldShowRationale(options: PermissionOptions): Promise<ShouldShowRationaleResult>;\n\n /**\n * Open the application or notification settings screen.\n * Rejects on web with `UNIMPLEMENTED`.\n *\n * @param options.type Settings destination. Defaults to `application`.\n * @since 8.0.0\n * @example\n * ```typescript\n * await Permissions.openSettings({ type: 'notifications' });\n * ```\n */\n openSettings(options?: OpenSettingsOptions): Promise<void>;\n\n /**\n * Ask for precise location.\n * On iOS, requests temporary full accuracy when already authorized when-in-use.\n * On Android, requests `ACCESS_FINE_LOCATION`.\n * On web, returns the geolocation permission status after prompting when possible.\n *\n * @since 8.0.0\n * @example\n * ```typescript\n * const { status } = await Permissions.requestPreciseLocation();\n * ```\n */\n requestPreciseLocation(): Promise<PermissionStatusResult>;\n\n /**\n * Returns the platform implementation version marker.\n *\n * @since 8.0.0\n */\n getPluginVersion(): Promise<PluginVersionResult>;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { PermissionsPlugin } from './definitions';
2
+ declare const Permissions: PermissionsPlugin;
3
+ export * from './definitions';
4
+ export type { AppPermissionState as PermissionState } from './definitions';
5
+ export { Permissions };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const Permissions = registerPlugin('Permissions', {
3
+ web: () => import('./web').then((m) => new m.PermissionsWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { Permissions };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,WAAW,GAAG,cAAc,CAAoB,aAAa,EAAE;IACnE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;CAC/D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { PermissionsPlugin } from './definitions';\n\nconst Permissions = registerPlugin<PermissionsPlugin>('Permissions', {\n web: () => import('./web').then((m) => new m.PermissionsWeb()),\n});\n\nexport * from './definitions';\nexport type { AppPermissionState as PermissionState } from './definitions';\nexport { Permissions };\n"]}
@@ -0,0 +1,27 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { MultiplePermissionOptions, MultiplePermissionStatusResult, PermissionOptions, PermissionStatusResult, PermissionsPlugin, PluginVersionResult, ShouldShowRationaleResult } from './definitions';
3
+ /**
4
+ * Web implementation of the permissions plugin.
5
+ */
6
+ export declare class PermissionsWeb extends WebPlugin implements PermissionsPlugin {
7
+ /** @inheritdoc */
8
+ check(options: PermissionOptions): Promise<PermissionStatusResult>;
9
+ /** @inheritdoc */
10
+ request(options: PermissionOptions): Promise<PermissionStatusResult>;
11
+ /** @inheritdoc */
12
+ checkMultiple(options: MultiplePermissionOptions): Promise<MultiplePermissionStatusResult>;
13
+ /** @inheritdoc */
14
+ requestMultiple(options: MultiplePermissionOptions): Promise<MultiplePermissionStatusResult>;
15
+ /** @inheritdoc */
16
+ shouldShowRationale(): Promise<ShouldShowRationaleResult>;
17
+ /** @inheritdoc */
18
+ openSettings(): Promise<void>;
19
+ /** @inheritdoc */
20
+ requestPreciseLocation(): Promise<PermissionStatusResult>;
21
+ /** @inheritdoc */
22
+ getPluginVersion(): Promise<PluginVersionResult>;
23
+ /**
24
+ * Reads the current browser permission state when the Permissions API supports it.
25
+ */
26
+ private readStatus;
27
+ }
@@ -0,0 +1,113 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ const QUERY_NAME = {
3
+ camera: 'camera',
4
+ microphone: 'microphone',
5
+ locationWhenInUse: 'geolocation',
6
+ locationAlways: 'geolocation',
7
+ notifications: 'notifications',
8
+ };
9
+ /**
10
+ * Maps browser permission query states to plugin status values.
11
+ */
12
+ function mapPermissionStatus(state) {
13
+ if (state === 'granted') {
14
+ return 'granted';
15
+ }
16
+ if (state === 'denied') {
17
+ return 'blocked';
18
+ }
19
+ if (state === 'prompt' || state === 'prompt-with-rationale') {
20
+ return 'denied';
21
+ }
22
+ return 'unavailable';
23
+ }
24
+ /**
25
+ * Web implementation of the permissions plugin.
26
+ */
27
+ export class PermissionsWeb extends WebPlugin {
28
+ /** @inheritdoc */
29
+ async check(options) {
30
+ return { status: await this.readStatus(options.permission) };
31
+ }
32
+ /** @inheritdoc */
33
+ async request(options) {
34
+ var _a;
35
+ const { permission } = options;
36
+ try {
37
+ if (permission === 'notifications' && typeof Notification !== 'undefined') {
38
+ const result = await Notification.requestPermission();
39
+ return { status: result === 'granted' ? 'granted' : result === 'denied' ? 'blocked' : 'denied' };
40
+ }
41
+ if ((permission === 'camera' || permission === 'microphone') && ((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {
42
+ const stream = await navigator.mediaDevices.getUserMedia({
43
+ video: permission === 'camera',
44
+ audio: permission === 'microphone',
45
+ });
46
+ stream.getTracks().forEach((track) => track.stop());
47
+ return { status: 'granted' };
48
+ }
49
+ if ((permission === 'locationWhenInUse' || permission === 'locationAlways') && navigator.geolocation) {
50
+ await new Promise((resolve, reject) => {
51
+ navigator.geolocation.getCurrentPosition(() => resolve(), (err) => reject(err), { maximumAge: 0, timeout: 10000 });
52
+ });
53
+ return { status: 'granted' };
54
+ }
55
+ }
56
+ catch (_b) {
57
+ return { status: await this.readStatus(permission) };
58
+ }
59
+ return { status: await this.readStatus(permission) };
60
+ }
61
+ /** @inheritdoc */
62
+ async checkMultiple(options) {
63
+ const statuses = {};
64
+ for (const permission of options.permissions) {
65
+ statuses[permission] = await this.readStatus(permission);
66
+ }
67
+ return { statuses };
68
+ }
69
+ /** @inheritdoc */
70
+ async requestMultiple(options) {
71
+ const statuses = {};
72
+ for (const permission of options.permissions) {
73
+ statuses[permission] = (await this.request({ permission })).status;
74
+ }
75
+ return { statuses };
76
+ }
77
+ /** @inheritdoc */
78
+ async shouldShowRationale() {
79
+ return { shouldShow: false };
80
+ }
81
+ /** @inheritdoc */
82
+ async openSettings() {
83
+ throw this.unimplemented('openSettings is not available on web');
84
+ }
85
+ /** @inheritdoc */
86
+ async requestPreciseLocation() {
87
+ return this.request({ permission: 'locationWhenInUse' });
88
+ }
89
+ /** @inheritdoc */
90
+ async getPluginVersion() {
91
+ return { version: 'web' };
92
+ }
93
+ /**
94
+ * Reads the current browser permission state when the Permissions API supports it.
95
+ */
96
+ async readStatus(permission) {
97
+ var _a;
98
+ const queryName = QUERY_NAME[permission];
99
+ if (!queryName || !((_a = navigator.permissions) === null || _a === void 0 ? void 0 : _a.query)) {
100
+ return 'unavailable';
101
+ }
102
+ try {
103
+ const result = await navigator.permissions.query({
104
+ name: queryName,
105
+ });
106
+ return mapPermissionStatus(result.state);
107
+ }
108
+ catch (_b) {
109
+ return 'unavailable';
110
+ }
111
+ }
112
+ }
113
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAc5C,MAAM,UAAU,GAA6D;IAC3E,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,iBAAiB,EAAE,aAAa;IAChC,cAAc,EAAE,aAAa;IAC7B,aAAa,EAAE,eAAe;CAC/B,CAAC;AAEF;;GAEG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,uBAAuB,EAAE,CAAC;QAC5D,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,SAAS;IAC3C,kBAAkB;IAClB,KAAK,CAAC,KAAK,CAAC,OAA0B;QACpC,OAAO,E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MAAM,IAAI,CAAC,aAAa,CAAC,sCAAsC,CAAC,CAAC;IACnE,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,sBAAsB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,UAAU,CAAC,UAA0B;;QACjD,MAAM,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAA,MAAA,SAAS,CAAC,WAAW,0CAAE,KAAK,CAAA,EAAE,CAAC;YAChD,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;gBAC/C,IAAI,EAAE,SAA2B;aACV,CAAC,CAAC;YAC3B,OAAO,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,aAAa,CAAC;QACvB,CAAC;IACH,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n AppPermissionState,\n MultiplePermissionOptions,\n MultiplePermissionStatusResult,\n PermissionName,\n PermissionOptions,\n PermissionStatusResult,\n PermissionsPlugin,\n PluginVersionResult,\n ShouldShowRationaleResult,\n} from './definitions';\n\nconst QUERY_NAME: Partial<Record<PermissionName, PermissionName | string>> = {\n camera: 'camera',\n microphone: 'microphone',\n locationWhenInUse: 'geolocation',\n locationAlways: 'geolocation',\n notifications: 'notifications',\n};\n\n/**\n * Maps browser permission query states to plugin status values.\n */\nfunction mapPermissionStatus(state: string): AppPermissionState {\n if (state === 'granted') {\n return 'granted';\n }\n if (state === 'denied') {\n return 'blocked';\n }\n if (state === 'prompt' || state === 'prompt-with-rationale') {\n return 'denied';\n }\n return 'unavailable';\n}\n\n/**\n * Web implementation of the permissions plugin.\n */\nexport class PermissionsWeb extends WebPlugin implements PermissionsPlugin {\n /** @inheritdoc */\n async check(options: PermissionOptions): Promise<PermissionStatusResult> {\n return { status: await this.readStatus(options.permission) };\n }\n\n /** @inheritdoc */\n async request(options: PermissionOptions): Promise<PermissionStatusResult> {\n const { permission } = options;\n try {\n if (permission === 'notifications' && typeof Notification !== 'undefined') {\n const result = await Notification.requestPermission();\n return { status: result === 'granted' ? 'granted' : result === 'denied' ? 'blocked' : 'denied' };\n }\n if ((permission === 'camera' || permission === 'microphone') && navigator.mediaDevices?.getUserMedia) {\n const stream = await navigator.mediaDevices.getUserMedia({\n video: permission === 'camera',\n audio: permission === 'microphone',\n });\n stream.getTracks().forEach((track) => track.stop());\n return { status: 'granted' };\n }\n if ((permission === 'locationWhenInUse' || permission === 'locationAlways') && navigator.geolocation) {\n await new Promise<void>((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n () => resolve(),\n (err) => reject(err),\n { maximumAge: 0, timeout: 10000 },\n );\n });\n return { status: 'granted' };\n }\n } catch {\n return { status: await this.readStatus(permission) };\n }\n return { status: await this.readStatus(permission) };\n }\n\n /** @inheritdoc */\n async checkMultiple(options: MultiplePermissionOptions): Promise<MultiplePermissionStatusResult> {\n const statuses: Record<string, AppPermissionState> = {};\n for (const permission of options.permissions) {\n statuses[permission] = await this.readStatus(permission);\n }\n return { statuses };\n }\n\n /** @inheritdoc */\n async requestMultiple(options: MultiplePermissionOptions): Promise<MultiplePermissionStatusResult> {\n const statuses: Record<string, AppPermissionState> = {};\n for (const permission of options.permissions) {\n statuses[permission] = (await this.request({ permission })).status;\n }\n return { statuses };\n }\n\n /** @inheritdoc */\n async shouldShowRationale(): Promise<ShouldShowRationaleResult> {\n return { shouldShow: false };\n }\n\n /** @inheritdoc */\n async openSettings(): Promise<void> {\n throw this.unimplemented('openSettings is not available on web');\n }\n\n /** @inheritdoc */\n async requestPreciseLocation(): Promise<PermissionStatusResult> {\n return this.request({ permission: 'locationWhenInUse' });\n }\n\n /** @inheritdoc */\n async getPluginVersion(): Promise<PluginVersionResult> {\n return { version: 'web' };\n }\n\n /**\n * Reads the current browser permission state when the Permissions API supports it.\n */\n private async readStatus(permission: PermissionName): Promise<AppPermissionState> {\n const queryName = QUERY_NAME[permission];\n if (!queryName || !navigator.permissions?.query) {\n return 'unavailable';\n }\n try {\n const result = await navigator.permissions.query({\n name: queryName as PermissionName,\n } as PermissionDescriptor);\n return mapPermissionStatus(result.state);\n } catch {\n return 'unavailable';\n }\n }\n}\n"]}
@@ -0,0 +1,127 @@
1
+ 'use strict';
2
+
3
+ var core = require('@capacitor/core');
4
+
5
+ const Permissions = core.registerPlugin('Permissions', {
6
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.PermissionsWeb()),
7
+ });
8
+
9
+ const QUERY_NAME = {
10
+ camera: 'camera',
11
+ microphone: 'microphone',
12
+ locationWhenInUse: 'geolocation',
13
+ locationAlways: 'geolocation',
14
+ notifications: 'notifications',
15
+ };
16
+ /**
17
+ * Maps browser permission query states to plugin status values.
18
+ */
19
+ function mapPermissionStatus(state) {
20
+ if (state === 'granted') {
21
+ return 'granted';
22
+ }
23
+ if (state === 'denied') {
24
+ return 'blocked';
25
+ }
26
+ if (state === 'prompt' || state === 'prompt-with-rationale') {
27
+ return 'denied';
28
+ }
29
+ return 'unavailable';
30
+ }
31
+ /**
32
+ * Web implementation of the permissions plugin.
33
+ */
34
+ class PermissionsWeb extends core.WebPlugin {
35
+ /** @inheritdoc */
36
+ async check(options) {
37
+ return { status: await this.readStatus(options.permission) };
38
+ }
39
+ /** @inheritdoc */
40
+ async request(options) {
41
+ var _a;
42
+ const { permission } = options;
43
+ try {
44
+ if (permission === 'notifications' && typeof Notification !== 'undefined') {
45
+ const result = await Notification.requestPermission();
46
+ return { status: result === 'granted' ? 'granted' : result === 'denied' ? 'blocked' : 'denied' };
47
+ }
48
+ if ((permission === 'camera' || permission === 'microphone') && ((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {
49
+ const stream = await navigator.mediaDevices.getUserMedia({
50
+ video: permission === 'camera',
51
+ audio: permission === 'microphone',
52
+ });
53
+ stream.getTracks().forEach((track) => track.stop());
54
+ return { status: 'granted' };
55
+ }
56
+ if ((permission === 'locationWhenInUse' || permission === 'locationAlways') && navigator.geolocation) {
57
+ await new Promise((resolve, reject) => {
58
+ navigator.geolocation.getCurrentPosition(() => resolve(), (err) => reject(err), { maximumAge: 0, timeout: 10000 });
59
+ });
60
+ return { status: 'granted' };
61
+ }
62
+ }
63
+ catch (_b) {
64
+ return { status: await this.readStatus(permission) };
65
+ }
66
+ return { status: await this.readStatus(permission) };
67
+ }
68
+ /** @inheritdoc */
69
+ async checkMultiple(options) {
70
+ const statuses = {};
71
+ for (const permission of options.permissions) {
72
+ statuses[permission] = await this.readStatus(permission);
73
+ }
74
+ return { statuses };
75
+ }
76
+ /** @inheritdoc */
77
+ async requestMultiple(options) {
78
+ const statuses = {};
79
+ for (const permission of options.permissions) {
80
+ statuses[permission] = (await this.request({ permission })).status;
81
+ }
82
+ return { statuses };
83
+ }
84
+ /** @inheritdoc */
85
+ async shouldShowRationale() {
86
+ return { shouldShow: false };
87
+ }
88
+ /** @inheritdoc */
89
+ async openSettings() {
90
+ throw this.unimplemented('openSettings is not available on web');
91
+ }
92
+ /** @inheritdoc */
93
+ async requestPreciseLocation() {
94
+ return this.request({ permission: 'locationWhenInUse' });
95
+ }
96
+ /** @inheritdoc */
97
+ async getPluginVersion() {
98
+ return { version: 'web' };
99
+ }
100
+ /**
101
+ * Reads the current browser permission state when the Permissions API supports it.
102
+ */
103
+ async readStatus(permission) {
104
+ var _a;
105
+ const queryName = QUERY_NAME[permission];
106
+ if (!queryName || !((_a = navigator.permissions) === null || _a === void 0 ? void 0 : _a.query)) {
107
+ return 'unavailable';
108
+ }
109
+ try {
110
+ const result = await navigator.permissions.query({
111
+ name: queryName,
112
+ });
113
+ return mapPermissionStatus(result.state);
114
+ }
115
+ catch (_b) {
116
+ return 'unavailable';
117
+ }
118
+ }
119
+ }
120
+
121
+ var web = /*#__PURE__*/Object.freeze({
122
+ __proto__: null,
123
+ PermissionsWeb: PermissionsWeb
124
+ });
125
+
126
+ exports.Permissions = Permissions;
127
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Permissions = registerPlugin('Permissions', {\n web: () => import('./web').then((m) => new m.PermissionsWeb()),\n});\nexport * from './definitions';\nexport { Permissions };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nconst QUERY_NAME = {\n camera: 'camera',\n microphone: 'microphone',\n locationWhenInUse: 'geolocation',\n locationAlways: 'geolocation',\n notifications: 'notifications',\n};\n/**\n * Maps browser permission query states to plugin status values.\n */\nfunction mapPermissionStatus(state) {\n if (state === 'granted') {\n return 'granted';\n }\n if (state === 'denied') {\n return 'blocked';\n }\n if (state === 'prompt' || state === 'prompt-with-rationale') {\n return 'denied';\n }\n return 'unavailable';\n}\n/**\n * Web implementation of the permissions plugin.\n */\nexport class PermissionsWeb extends WebPlugin {\n /** @inheritdoc */\n async check(options) {\n return { status: await this.readStatus(options.permission) };\n }\n /** @inheritdoc */\n async request(options) {\n var _a;\n const { permission } = options;\n try {\n if (permission === 'notifications' && typeof Notification !== 'undefined') {\n const result = await Notification.requestPermission();\n return { status: result === 'granted' ? 'granted' : result === 'denied' ? 'blocked' : 'denied' };\n }\n if ((permission === 'camera' || permission === 'microphone') && ((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {\n const stream = await navigator.mediaDevices.getUserMedia({\n video: permission === 'camera',\n audio: permission === 'microphone',\n });\n stream.getTracks().forEach((track) => track.stop());\n return { status: 'granted' };\n }\n if ((permission === 'locationWhenInUse' || permission === 'locationAlways') && navigator.geolocation) {\n await new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(() => resolve(), (err) => reject(err), { maximumAge: 0, timeout: 10000 });\n });\n return { status: 'granted' };\n }\n }\n catch (_b) {\n return { status: await this.readStatus(permission) };\n }\n return { status: await this.readStatus(permission) };\n }\n /** @inheritdoc */\n async checkMultiple(options) {\n const statuses = {};\n for (const permission of options.permissions) {\n statuses[permission] = await this.readStatus(permission);\n }\n return { statuses };\n }\n /** @inheritdoc */\n async requestMultiple(options) {\n const statuses = {};\n for (const permission of options.permissions) {\n statuses[permission] = (await this.request({ permission })).status;\n }\n return { statuses };\n }\n /** @inheritdoc */\n async shouldShowRationale() {\n return { shouldShow: false };\n }\n /** @inheritdoc */\n async openSettings() {\n throw this.unimplemented('openSettings is not available on web');\n }\n /** @inheritdoc */\n async requestPreciseLocation() {\n return this.request({ permission: 'locationWhenInUse' });\n }\n /** @inheritdoc */\n async getPluginVersion() {\n return { version: 'web' };\n }\n /**\n * Reads the current browser permission state when the Permissions API supports it.\n */\n async readStatus(permission) {\n var _a;\n const queryName = QUERY_NAME[permission];\n if (!queryName || !((_a = navigator.permissions) === null || _a === void 0 ? void 0 : _a.query)) {\n return 'unavailable';\n }\n try {\n const result = await navigator.permissions.query({\n name: queryName,\n });\n return mapPermissionStatus(result.state);\n }\n catch (_b) {\n return 'unavailable';\n }\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,WAAW,GAAGA,mBAAc,CAAC,aAAa,EAAE;AAClD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;AAClE,CAAC;;ACFD,MAAM,UAAU,GAAG;AACnB,IAAI,MAAM,EAAE,QAAQ;AACpB,IAAI,UAAU,EAAE,YAAY;AAC5B,IAAI,iBAAiB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