@atlasauth/capacitor 0.2.0 → 0.3.0
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/CHANGELOG.md +8 -0
- package/README.md +17 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/policies.d.ts +83 -0
- package/dist/policies.js +159 -0
- package/dist/policies.js.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlasauth/capacitor changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 — 2026-10-24
|
|
4
|
+
Requires `@atlasauth/js` with policy acceptance.
|
|
5
|
+
- **Policy acceptance** (terms of service, privacy, any policy the app defines). The system-browser sign-in runs on Atlas's
|
|
6
|
+
hosted pages, which collect and hold for the policies themselves. For the app's own WebView screens, the handle gains
|
|
7
|
+
`policies()` (a `PolicyAcceptanceController` for a sign-up form), `pendingPolicies(attempt)`, `policyGate()` (in-app
|
|
8
|
+
re-acceptance with the session's bearer token) and `fapi`; new `locale` option. `mountPolicyGate(host, gate)` draws the
|
|
9
|
+
signed-in banner, and the DOM pieces (`mountPolicyConsent`, `mountPolicyClickwrap`, `mountPolicyAcceptStep`) are re-exported.
|
|
10
|
+
|
|
3
11
|
## 0.2.0
|
|
4
12
|
|
|
5
13
|
### Changed
|
package/README.md
CHANGED
|
@@ -109,6 +109,23 @@ const secureStore: TokenStore = {
|
|
|
109
109
|
const atlas = await createAtlasCapacitor({ /* … */ storage: secureStore });
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
## Policy acceptance (terms of service, privacy)
|
|
113
|
+
|
|
114
|
+
The system-browser sign-in (`atlas.signIn()`) happens on Atlas's hosted pages, which already collect the acceptances at sign-up
|
|
115
|
+
and hold a sign-in until a newer version is accepted. For screens in your own WebView:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
// A custom sign-up form
|
|
119
|
+
const policies = await atlas.policies();
|
|
120
|
+
mountPolicyConsent(consentHost, policies, { t: policyText() });
|
|
121
|
+
// on submit: send policies.build() as policy_acceptances
|
|
122
|
+
|
|
123
|
+
// A signed-in user whose policies changed
|
|
124
|
+
mountPolicyGate(gateHost, atlas.policyGate(), { onAccepted: () => refresh() });
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Pass `locale` to `createAtlasCapacitor` to get translated policy versions.
|
|
128
|
+
|
|
112
129
|
## Driving the pieces yourself
|
|
113
130
|
|
|
114
131
|
The flow is also exposed à la carte: `createPkcePair`, `buildAuthorizeUrl`,
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { NativeSessionManager, type NativeSession, type SignOutOptions, type Sig
|
|
|
20
20
|
import { type CapacitorPlugins } from './plugins';
|
|
21
21
|
import { type SignInOutcome } from './sign-in';
|
|
22
22
|
import { type TokenStore } from './token-store';
|
|
23
|
+
import { type PolicyApi } from './policies';
|
|
23
24
|
export interface CreateAtlasCapacitorConfig {
|
|
24
25
|
/** The instance publishable key (`pk_…`). */
|
|
25
26
|
publishableKey: string;
|
|
@@ -57,6 +58,11 @@ export interface CreateAtlasCapacitorConfig {
|
|
|
57
58
|
plugins?: CapacitorPlugins;
|
|
58
59
|
/** Injectable for tests; defaults to the platform `fetch`. */
|
|
59
60
|
fetchImpl?: typeof fetch;
|
|
61
|
+
/**
|
|
62
|
+
* The app's UI language (`"es"`), sent as `Accept-Language` on the policy calls
|
|
63
|
+
* so the server picks a translated policy version. @default none
|
|
64
|
+
*/
|
|
65
|
+
locale?: string;
|
|
60
66
|
/** Injectable clock, epoch ms. Defaults to `Date.now`. */
|
|
61
67
|
now?: () => number;
|
|
62
68
|
/** Navigate the page on the web redirect path. @default `window.location.assign` */
|
|
@@ -74,7 +80,7 @@ export interface SignInOptions {
|
|
|
74
80
|
* the manager, {@link getToken} hands out a live (auto-refreshing) JWT, and
|
|
75
81
|
* {@link onChange} fires on every session change.
|
|
76
82
|
*/
|
|
77
|
-
export interface AtlasCapacitor {
|
|
83
|
+
export interface AtlasCapacitor extends PolicyApi {
|
|
78
84
|
/**
|
|
79
85
|
* Run the native-session sign-in: open the system browser, catch the deep-link
|
|
80
86
|
* callback, complete PKCE, exchange for a session, and store it. On the web
|
|
@@ -138,3 +144,4 @@ export * from './pkce';
|
|
|
138
144
|
export * from './token-store';
|
|
139
145
|
export * from './sign-in';
|
|
140
146
|
export { createNativeSessionManager, clearNativeSession, NativeSessionManager, exchangeForSession, refreshNativeSession, type NativeSession, type NativeSessionConfig, } from './native-session';
|
|
147
|
+
export * from './policies';
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ const plugins_1 = require("./plugins");
|
|
|
39
39
|
const sign_in_1 = require("./sign-in");
|
|
40
40
|
const token_store_1 = require("./token-store");
|
|
41
41
|
const native_session_1 = require("./native-session");
|
|
42
|
+
const policies_1 = require("./policies");
|
|
42
43
|
/**
|
|
43
44
|
* Create the Atlas handle for a Capacitor app.
|
|
44
45
|
*
|
|
@@ -144,8 +145,20 @@ async function createAtlasCapacitor(config) {
|
|
|
144
145
|
throw new Error(`Atlas: \`${name}\` is required to sign in.`);
|
|
145
146
|
return value;
|
|
146
147
|
};
|
|
148
|
+
// Policy acceptance (terms, privacy, any policy) over the same bearer session.
|
|
149
|
+
const policyApi = (0, policies_1.createPolicyApi)({
|
|
150
|
+
publishableKey: config.publishableKey,
|
|
151
|
+
frontendApi,
|
|
152
|
+
authHeaders: async () => {
|
|
153
|
+
const token = await getToken();
|
|
154
|
+
return token ? { Authorization: `Bearer ${token}` } : {};
|
|
155
|
+
},
|
|
156
|
+
fetchImpl: config.fetchImpl,
|
|
157
|
+
locale: config.locale,
|
|
158
|
+
});
|
|
147
159
|
return {
|
|
148
160
|
manager,
|
|
161
|
+
...policyApi,
|
|
149
162
|
async signIn(options = {}) {
|
|
150
163
|
const clientId = requireString(options.clientId ?? config.clientId, 'clientId');
|
|
151
164
|
const redirectUri = requireString(options.redirectUri ?? config.redirectUri, 'redirectUri');
|
|
@@ -237,4 +250,6 @@ Object.defineProperty(exports, "clearNativeSession", { enumerable: true, get: fu
|
|
|
237
250
|
Object.defineProperty(exports, "NativeSessionManager", { enumerable: true, get: function () { return native_session_2.NativeSessionManager; } });
|
|
238
251
|
Object.defineProperty(exports, "exchangeForSession", { enumerable: true, get: function () { return native_session_2.exchangeForSession; } });
|
|
239
252
|
Object.defineProperty(exports, "refreshNativeSession", { enumerable: true, get: function () { return native_session_2.refreshNativeSession; } });
|
|
253
|
+
// Policy acceptance: the DOM pieces for a WebView screen, the gate banner, and the API builder.
|
|
254
|
+
__exportStar(require("./policies"), exports);
|
|
240
255
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;AAwJH,oDAkMC;AAxVD,sCASuB;AACvB,uCAImB;AACnB,uCAKmB;AACnB,+CAMuB;AACvB,qDAAkF;AAClF,yCAA6D;AAqG7D;;;;;;;;;;;;;;;;;;;GAmBG;AACI,KAAK,UAAU,oBAAoB,CACxC,MAAkC;IAElC,yEAAyE;IACzE,4EAA4E;IAC5E,4EAA4E;IAC5E,6CAA6C;IAC7C,MAAM,WAAW,GAAG,IAAA,uBAAkB,EAAC,MAAM,CAAC,WAAW,EAAE;QACzD,SAAS,EAAE,wBAAwB;QACnC,eAAe,EAAE,KAAK;KACvB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,IAAA,8BAAoB,GAAE,CAAC,CAAC;IAEjE,MAAM,OAAO,GACX,MAAM,CAA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E,CAAC;YAC/B,OAAO,KAAK;gBACV,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,CAAC,cAAc,EAAE;gBAClF,CAAC,CAAC,EAAE,mBAAmB,EAAE,MAAM,CAAC,cAAc,EAAE,CAAC;QACrD,CAAC;QAED,UAAU;YACR,OAAO,OAAO,CAAC,OAAO,CAAC;QACzB,CAAC;QAED,QAAQ,CAAC,QAAQ;YACf,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE;gBAClC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC;oBAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,oCAKuB;AAJrB,kGAAA,YAAY,OAAA;AAKd,4CAA0B;AAC1B,yCAAuB;AACvB,gDAA8B;AAC9B,4CAA0B;AAC1B,mDAQ0B;AAPxB,4HAAA,0BAA0B,OAAA;AAC1B,oHAAA,kBAAkB,OAAA;AAClB,sHAAA,oBAAoB,OAAA;AACpB,oHAAA,kBAAkB,OAAA;AAClB,sHAAA,oBAAoB,OAAA;AAKtB,gGAAgG;AAChG,6CAA2B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy acceptance (terms of service, privacy, any policy) for Capacitor.
|
|
3
|
+
*
|
|
4
|
+
* The native-session sign-in runs in the SYSTEM browser on Atlas's hosted pages,
|
|
5
|
+
* which already collect the acceptances (sign-up) and hold a sign-in until a
|
|
6
|
+
* newer version is accepted, so {@link AtlasCapacitor.signIn} needs nothing more.
|
|
7
|
+
* What the app's own WebView layer needs is:
|
|
8
|
+
*
|
|
9
|
+
* - the policies for its own screens (a custom sign-up form): `policies()`
|
|
10
|
+
* returns a `PolicyAcceptanceController`, and the DOM pieces re-exported below
|
|
11
|
+
* (`mountPolicyConsent`, `mountPolicyClickwrap`, `mountPolicyAcceptStep`) draw
|
|
12
|
+
* it;
|
|
13
|
+
* - in-app re-acceptance for the signed-in user: `policyGate()` and
|
|
14
|
+
* {@link mountPolicyGate}'s banner, which post `/v1/client/me/policies/accept`
|
|
15
|
+
* with the session's bearer token.
|
|
16
|
+
*
|
|
17
|
+
* Everything is `@atlasauth/js`; this file only supplies a bearer-authenticated
|
|
18
|
+
* client (a Capacitor app has no cookie against the FAPI origin).
|
|
19
|
+
*/
|
|
20
|
+
import { FapiClient, PolicyAcceptanceController, PolicyGateController, type PolicyClasses, type PolicyT } from '@atlasauth/js';
|
|
21
|
+
export interface PolicyApiConfig {
|
|
22
|
+
publishableKey: string;
|
|
23
|
+
frontendApi: string;
|
|
24
|
+
/** The headers an authenticated `/v1/client/me/*` call needs (bearer + pk); empty-bearer when signed out. */
|
|
25
|
+
authHeaders: () => Promise<Record<string, string>>;
|
|
26
|
+
fetchImpl?: typeof fetch;
|
|
27
|
+
/** The UI language, sent as `Accept-Language` and used to pick a translation. */
|
|
28
|
+
locale?: string;
|
|
29
|
+
}
|
|
30
|
+
/** What the Atlas handle exposes for policy acceptance. */
|
|
31
|
+
export interface PolicyApi {
|
|
32
|
+
/** The bearer-authenticated Frontend API client (for `@atlasauth/js` helpers). */
|
|
33
|
+
readonly fapi: FapiClient;
|
|
34
|
+
/**
|
|
35
|
+
* Load the instance's policies (`GET /v1/client/policies`) into a controller
|
|
36
|
+
* for a sign-up form of your own. `signIn` keeps only the policies that also
|
|
37
|
+
* apply at sign-in.
|
|
38
|
+
*/
|
|
39
|
+
policies(options?: {
|
|
40
|
+
combined?: boolean;
|
|
41
|
+
signIn?: boolean;
|
|
42
|
+
locale?: string;
|
|
43
|
+
}): Promise<PolicyAcceptanceController>;
|
|
44
|
+
/**
|
|
45
|
+
* The controller for an attempt the server holds at `needs_policy_acceptance`
|
|
46
|
+
* (an attempt view with `pending_policies`), with the content filled in.
|
|
47
|
+
*/
|
|
48
|
+
pendingPolicies(attempt: {
|
|
49
|
+
pending_policies?: unknown;
|
|
50
|
+
} | null | undefined, options?: {
|
|
51
|
+
combined?: boolean;
|
|
52
|
+
locale?: string;
|
|
53
|
+
}): Promise<PolicyAcceptanceController>;
|
|
54
|
+
/**
|
|
55
|
+
* In-app re-acceptance for the signed-in user: `load()` the standing,
|
|
56
|
+
* `begin()` a controller for what needs accepting, `accept(controller)` to send it.
|
|
57
|
+
*/
|
|
58
|
+
policyGate(locale?: string): PolicyGateController;
|
|
59
|
+
}
|
|
60
|
+
/** Build the policy API over a bearer-authenticated client. */
|
|
61
|
+
export declare function createPolicyApi(config: PolicyApiConfig): PolicyApi;
|
|
62
|
+
/** The English policy strings, with any `policy.*` overrides on top. */
|
|
63
|
+
export declare function policyText(strings?: Record<string, string>): PolicyT;
|
|
64
|
+
export interface MountPolicyGateOptions {
|
|
65
|
+
/** Override any `policy.*` string. */
|
|
66
|
+
strings?: Record<string, string>;
|
|
67
|
+
/** Extra class names per element. */
|
|
68
|
+
classes?: PolicyClasses;
|
|
69
|
+
/** Called after the user accepted and the server confirmed. */
|
|
70
|
+
onAccepted?(): void;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Mount the signed-in re-acceptance banner into `host`: it loads the user's
|
|
74
|
+
* standing from `gate`, shows a banner when a policy needs accepting (with the
|
|
75
|
+
* end of any grace window), and "Review and accept" opens the acceptance step
|
|
76
|
+
* and posts the result. Draws nothing when there is nothing to accept. Call it
|
|
77
|
+
* only for a signed-in user; `ready` resolves once the standing has loaded.
|
|
78
|
+
*/
|
|
79
|
+
export declare function mountPolicyGate(host: HTMLElement, gate: PolicyGateController, options?: MountPolicyGateOptions): {
|
|
80
|
+
destroy(): void;
|
|
81
|
+
ready: Promise<void>;
|
|
82
|
+
};
|
|
83
|
+
export { PolicyAcceptanceController, PolicyGateController, buildPolicyAcceptances, injectPolicyStyles, isPolicyAcceptanceRequired, mountPolicyAcceptStep, mountPolicyClickwrap, mountPolicyConsent, runScrollPolicies, type Policy, type PolicyAcceptancePayload, } from '@atlasauth/js';
|
package/dist/policies.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Policy acceptance (terms of service, privacy, any policy) for Capacitor.
|
|
4
|
+
*
|
|
5
|
+
* The native-session sign-in runs in the SYSTEM browser on Atlas's hosted pages,
|
|
6
|
+
* which already collect the acceptances (sign-up) and hold a sign-in until a
|
|
7
|
+
* newer version is accepted, so {@link AtlasCapacitor.signIn} needs nothing more.
|
|
8
|
+
* What the app's own WebView layer needs is:
|
|
9
|
+
*
|
|
10
|
+
* - the policies for its own screens (a custom sign-up form): `policies()`
|
|
11
|
+
* returns a `PolicyAcceptanceController`, and the DOM pieces re-exported below
|
|
12
|
+
* (`mountPolicyConsent`, `mountPolicyClickwrap`, `mountPolicyAcceptStep`) draw
|
|
13
|
+
* it;
|
|
14
|
+
* - in-app re-acceptance for the signed-in user: `policyGate()` and
|
|
15
|
+
* {@link mountPolicyGate}'s banner, which post `/v1/client/me/policies/accept`
|
|
16
|
+
* with the session's bearer token.
|
|
17
|
+
*
|
|
18
|
+
* Everything is `@atlasauth/js`; this file only supplies a bearer-authenticated
|
|
19
|
+
* client (a Capacitor app has no cookie against the FAPI origin).
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.runScrollPolicies = exports.mountPolicyConsent = exports.mountPolicyClickwrap = exports.mountPolicyAcceptStep = exports.isPolicyAcceptanceRequired = exports.injectPolicyStyles = exports.buildPolicyAcceptances = exports.PolicyGateController = exports.PolicyAcceptanceController = void 0;
|
|
23
|
+
exports.createPolicyApi = createPolicyApi;
|
|
24
|
+
exports.policyText = policyText;
|
|
25
|
+
exports.mountPolicyGate = mountPolicyGate;
|
|
26
|
+
const js_1 = require("@atlasauth/js");
|
|
27
|
+
/** Build the policy API over a bearer-authenticated client. */
|
|
28
|
+
function createPolicyApi(config) {
|
|
29
|
+
const doFetch = config.fetchImpl ?? ((input, init) => fetch(input, init));
|
|
30
|
+
const fapi = new js_1.FapiClient({
|
|
31
|
+
publishableKey: config.publishableKey,
|
|
32
|
+
baseUrl: config.frontendApi,
|
|
33
|
+
locale: config.locale,
|
|
34
|
+
fetchImpl: async (input, init) => {
|
|
35
|
+
const headers = new Headers(init?.headers);
|
|
36
|
+
for (const [k, v] of Object.entries(await config.authHeaders()))
|
|
37
|
+
if (!headers.has(k))
|
|
38
|
+
headers.set(k, v);
|
|
39
|
+
return doFetch(input, { ...init, headers });
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
fapi,
|
|
44
|
+
async policies(options = {}) {
|
|
45
|
+
const controller = new js_1.PolicyAcceptanceController([], { combined: options.combined });
|
|
46
|
+
controller.setPolicies(await (0, js_1.loadPolicies)(fapi, { locale: options.locale ?? config.locale, signIn: options.signIn }));
|
|
47
|
+
return controller;
|
|
48
|
+
},
|
|
49
|
+
pendingPolicies: (attempt, options = {}) => (0, js_1.controllerForPending)(fapi, attempt, { combined: options.combined, locale: options.locale ?? config.locale }),
|
|
50
|
+
policyGate: (locale) => new js_1.PolicyGateController(fapi, locale ?? config.locale),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** The English policy strings, with any `policy.*` overrides on top. */
|
|
54
|
+
function policyText(strings) {
|
|
55
|
+
return (0, js_1.policyTranslator)((key, vars) => {
|
|
56
|
+
const template = strings?.[key];
|
|
57
|
+
return template ? template.replace(/\{(\w+)\}/g, (m, n) => vars?.[n] ?? m) : '';
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Mount the signed-in re-acceptance banner into `host`: it loads the user's
|
|
62
|
+
* standing from `gate`, shows a banner when a policy needs accepting (with the
|
|
63
|
+
* end of any grace window), and "Review and accept" opens the acceptance step
|
|
64
|
+
* and posts the result. Draws nothing when there is nothing to accept. Call it
|
|
65
|
+
* only for a signed-in user; `ready` resolves once the standing has loaded.
|
|
66
|
+
*/
|
|
67
|
+
function mountPolicyGate(host, gate, options = {}) {
|
|
68
|
+
const doc = host.ownerDocument;
|
|
69
|
+
const t = policyText(options.strings);
|
|
70
|
+
let step = null;
|
|
71
|
+
let open = false;
|
|
72
|
+
let alive = true;
|
|
73
|
+
(0, js_1.injectPolicyStyles)(doc);
|
|
74
|
+
const showError = (message) => {
|
|
75
|
+
const p = doc.createElement('p');
|
|
76
|
+
p.setAttribute('role', 'alert');
|
|
77
|
+
p.textContent = message;
|
|
78
|
+
host.append(p);
|
|
79
|
+
};
|
|
80
|
+
const draw = () => {
|
|
81
|
+
if (!alive || open)
|
|
82
|
+
return;
|
|
83
|
+
host.textContent = '';
|
|
84
|
+
host.setAttribute('data-atlas-policy-gate', '');
|
|
85
|
+
if (gate.pending.length === 0)
|
|
86
|
+
return;
|
|
87
|
+
const banner = doc.createElement('div');
|
|
88
|
+
banner.className = 'atlas-policy-banner';
|
|
89
|
+
banner.setAttribute('role', 'status');
|
|
90
|
+
banner.setAttribute('data-atlas-policy-banner', '');
|
|
91
|
+
const text = doc.createElement('span');
|
|
92
|
+
const strong = doc.createElement('strong');
|
|
93
|
+
strong.textContent = `${t('policy.bannerTitle')}. `;
|
|
94
|
+
text.append(strong, t('policy.bannerBody', { policies: (0, js_1.joinTitles)(gate.pending.map((p) => p.title), t('policy.and')) }));
|
|
95
|
+
if (gate.graceEndsAt)
|
|
96
|
+
text.append(` ${t('policy.bannerGrace', { date: (0, js_1.formatPolicyDate)(gate.graceEndsAt) })}`);
|
|
97
|
+
const button = doc.createElement('button');
|
|
98
|
+
button.type = 'button';
|
|
99
|
+
button.className = ['atlas-policy-link', options.classes?.link].filter(Boolean).join(' ');
|
|
100
|
+
button.textContent = t('policy.bannerReview');
|
|
101
|
+
button.addEventListener('click', () => void begin());
|
|
102
|
+
banner.append(text, button);
|
|
103
|
+
host.append(banner);
|
|
104
|
+
};
|
|
105
|
+
const close = () => {
|
|
106
|
+
step?.destroy();
|
|
107
|
+
step = null;
|
|
108
|
+
open = false;
|
|
109
|
+
draw();
|
|
110
|
+
};
|
|
111
|
+
const begin = async () => {
|
|
112
|
+
const controller = await gate.begin();
|
|
113
|
+
if (!alive)
|
|
114
|
+
return;
|
|
115
|
+
open = true;
|
|
116
|
+
host.textContent = '';
|
|
117
|
+
const stepHost = doc.createElement('div');
|
|
118
|
+
host.append(stepHost);
|
|
119
|
+
step = (0, js_1.mountPolicyAcceptStep)(stepHost, controller, {
|
|
120
|
+
t,
|
|
121
|
+
classes: options.classes,
|
|
122
|
+
onSubmit: async () => {
|
|
123
|
+
step?.setBusy(true);
|
|
124
|
+
const res = await gate.accept(controller);
|
|
125
|
+
step?.setBusy(false);
|
|
126
|
+
if (!res.ok) {
|
|
127
|
+
showError(res.errors[0]?.message ?? t('policy.requiredGeneric'));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
close();
|
|
131
|
+
options.onAccepted?.();
|
|
132
|
+
},
|
|
133
|
+
onDecline: close,
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
const off = gate.subscribe(draw);
|
|
137
|
+
const ready = gate.load().then(draw, draw);
|
|
138
|
+
return {
|
|
139
|
+
ready,
|
|
140
|
+
destroy() {
|
|
141
|
+
alive = false;
|
|
142
|
+
off();
|
|
143
|
+
step?.destroy();
|
|
144
|
+
host.textContent = '';
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
// The DOM pieces and helpers a WebView screen draws with (all from `@atlasauth/js`).
|
|
149
|
+
var js_2 = require("@atlasauth/js");
|
|
150
|
+
Object.defineProperty(exports, "PolicyAcceptanceController", { enumerable: true, get: function () { return js_2.PolicyAcceptanceController; } });
|
|
151
|
+
Object.defineProperty(exports, "PolicyGateController", { enumerable: true, get: function () { return js_2.PolicyGateController; } });
|
|
152
|
+
Object.defineProperty(exports, "buildPolicyAcceptances", { enumerable: true, get: function () { return js_2.buildPolicyAcceptances; } });
|
|
153
|
+
Object.defineProperty(exports, "injectPolicyStyles", { enumerable: true, get: function () { return js_2.injectPolicyStyles; } });
|
|
154
|
+
Object.defineProperty(exports, "isPolicyAcceptanceRequired", { enumerable: true, get: function () { return js_2.isPolicyAcceptanceRequired; } });
|
|
155
|
+
Object.defineProperty(exports, "mountPolicyAcceptStep", { enumerable: true, get: function () { return js_2.mountPolicyAcceptStep; } });
|
|
156
|
+
Object.defineProperty(exports, "mountPolicyClickwrap", { enumerable: true, get: function () { return js_2.mountPolicyClickwrap; } });
|
|
157
|
+
Object.defineProperty(exports, "mountPolicyConsent", { enumerable: true, get: function () { return js_2.mountPolicyConsent; } });
|
|
158
|
+
Object.defineProperty(exports, "runScrollPolicies", { enumerable: true, get: function () { return js_2.runScrollPolicies; } });
|
|
159
|
+
//# sourceMappingURL=policies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../src/policies.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAqDH,0CAuBC;AAGD,gCAKC;AAkBD,0CAqFC;AAzLD,sCAauB;AAqCvB,+DAA+D;AAC/D,SAAgB,eAAe,CAAC,MAAuB;IACrD,MAAM,OAAO,GAAiB,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACxF,MAAM,IAAI,GAAG,IAAI,eAAU,CAAC;QAC1B,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,OAAO,EAAE,MAAM,CAAC,WAAW;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YAC/B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC3C,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAA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CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,OAAO;QACL,KAAK;QACL,OAAO;YACL,KAAK,GAAG,KAAK,CAAC;YACd,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,OAAO,EAAE,CAAC;YAChB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACxB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,oCAYuB;AAXrB,gHAAA,0BAA0B,OAAA;AAC1B,0GAAA,oBAAoB,OAAA;AACpB,4GAAA,sBAAsB,OAAA;AACtB,wGAAA,kBAAkB,OAAA;AAClB,gHAAA,0BAA0B,OAAA;AAC1B,2GAAA,qBAAqB,OAAA;AACrB,0GAAA,oBAAoB,OAAA;AACpB,wGAAA,kBAAkB,OAAA;AAClB,uGAAA,iBAAiB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/capacitor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./package.json": "./package.json"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@atlasauth/js": "0.
|
|
14
|
+
"@atlasauth/js": "0.19.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@capacitor/core": ">=6",
|