@kya-os/consent 0.4.1 → 0.4.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.
- package/README.md +8 -4
- package/dist/bundle/index.d.ts +5 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +7 -0
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +4 -4
- package/dist/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/index.js +21 -0
- package/dist/cjs/bundle/index.js.map +1 -1
- package/dist/cjs/bundle/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +168 -215
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-capability-card.js +30 -7
- package/dist/cjs/components/consent-capability-card.js.map +1 -1
- package/dist/cjs/components/consent-connector-header.js +69 -15
- package/dist/cjs/components/consent-connector-header.js.map +1 -1
- package/dist/cjs/components/consent-flow-timeline.js +177 -0
- package/dist/cjs/components/consent-flow-timeline.js.map +1 -0
- package/dist/cjs/components/consent-flow.js +540 -0
- package/dist/cjs/components/consent-flow.js.map +1 -0
- package/dist/cjs/components/consent-footer.js +9 -2
- package/dist/cjs/components/consent-footer.js.map +1 -1
- package/dist/cjs/components/consent-headline.js +30 -76
- package/dist/cjs/components/consent-headline.js.map +1 -1
- package/dist/cjs/components/consent-oauth-button.js +10 -89
- package/dist/cjs/components/consent-oauth-button.js.map +1 -1
- package/dist/cjs/components/consent-revocation-notice.js +25 -16
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
- package/dist/cjs/components/consent-wallet-check.js +25 -1
- package/dist/cjs/components/consent-wallet-check.js.map +1 -1
- package/dist/cjs/components/decision-icons.js +6 -2
- package/dist/cjs/components/decision-icons.js.map +1 -1
- package/dist/cjs/components/flow-blocks.js +762 -0
- package/dist/cjs/components/flow-blocks.js.map +1 -0
- package/dist/cjs/components/flow-motion.js +177 -0
- package/dist/cjs/components/flow-motion.js.map +1 -0
- package/dist/cjs/components/grant-details.js +143 -0
- package/dist/cjs/components/grant-details.js.map +1 -0
- package/dist/cjs/components/index.js +10 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +12 -0
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/components/provider-icons.js +92 -0
- package/dist/cjs/components/provider-icons.js.map +1 -0
- package/dist/cjs/constants/capabilities.js +6 -1
- package/dist/cjs/constants/capabilities.js.map +1 -1
- package/dist/cjs/copy/tokens.js +9 -5
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/flow/copy.js +146 -0
- package/dist/cjs/flow/copy.js.map +1 -0
- package/dist/cjs/flow/index.js +31 -0
- package/dist/cjs/flow/index.js.map +1 -0
- package/dist/cjs/flow/model.js +107 -0
- package/dist/cjs/flow/model.js.map +1 -0
- package/dist/cjs/flow/presets.js +157 -0
- package/dist/cjs/flow/presets.js.map +1 -0
- package/dist/cjs/flow/schema.js +76 -0
- package/dist/cjs/flow/schema.js.map +1 -0
- package/dist/cjs/mcp-app/inline.js +2 -2
- package/dist/cjs/mcp-app/inline.js.map +1 -1
- package/dist/cjs/react/index.js +30 -1
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/styles/theme.js +8 -6
- package/dist/cjs/styles/theme.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +22 -6
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +169 -216
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-capability-card.d.ts +10 -1
- package/dist/components/consent-capability-card.d.ts.map +1 -1
- package/dist/components/consent-capability-card.js +30 -7
- package/dist/components/consent-capability-card.js.map +1 -1
- package/dist/components/consent-connector-header.d.ts +14 -1
- package/dist/components/consent-connector-header.d.ts.map +1 -1
- package/dist/components/consent-connector-header.js +69 -15
- package/dist/components/consent-connector-header.js.map +1 -1
- package/dist/components/consent-flow-timeline.d.ts +49 -0
- package/dist/components/consent-flow-timeline.d.ts.map +1 -0
- package/dist/components/consent-flow-timeline.js +174 -0
- package/dist/components/consent-flow-timeline.js.map +1 -0
- package/dist/components/consent-flow.d.ts +101 -0
- package/dist/components/consent-flow.d.ts.map +1 -0
- package/dist/components/consent-flow.js +504 -0
- package/dist/components/consent-flow.js.map +1 -0
- package/dist/components/consent-footer.d.ts.map +1 -1
- package/dist/components/consent-footer.js +9 -2
- package/dist/components/consent-footer.js.map +1 -1
- package/dist/components/consent-headline.d.ts +12 -5
- package/dist/components/consent-headline.d.ts.map +1 -1
- package/dist/components/consent-headline.js +30 -76
- package/dist/components/consent-headline.js.map +1 -1
- package/dist/components/consent-oauth-button.d.ts +3 -4
- package/dist/components/consent-oauth-button.d.ts.map +1 -1
- package/dist/components/consent-oauth-button.js +10 -89
- package/dist/components/consent-oauth-button.js.map +1 -1
- package/dist/components/consent-revocation-notice.d.ts.map +1 -1
- package/dist/components/consent-revocation-notice.js +25 -16
- package/dist/components/consent-revocation-notice.js.map +1 -1
- package/dist/components/consent-wallet-check.d.ts +8 -0
- package/dist/components/consent-wallet-check.d.ts.map +1 -1
- package/dist/components/consent-wallet-check.js +26 -2
- package/dist/components/consent-wallet-check.js.map +1 -1
- package/dist/components/decision-icons.d.ts +6 -2
- package/dist/components/decision-icons.d.ts.map +1 -1
- package/dist/components/decision-icons.js +6 -2
- package/dist/components/decision-icons.js.map +1 -1
- package/dist/components/flow-blocks.d.ts +45 -0
- package/dist/components/flow-blocks.d.ts.map +1 -0
- package/dist/components/flow-blocks.js +755 -0
- package/dist/components/flow-blocks.js.map +1 -0
- package/dist/components/flow-motion.d.ts +41 -0
- package/dist/components/flow-motion.d.ts.map +1 -0
- package/dist/components/flow-motion.js +164 -0
- package/dist/components/flow-motion.js.map +1 -0
- package/dist/components/grant-details.d.ts +28 -0
- package/dist/components/grant-details.d.ts.map +1 -0
- package/dist/components/grant-details.js +138 -0
- package/dist/components/grant-details.js.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +4 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +12 -0
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/components/provider-icons.d.ts +16 -0
- package/dist/components/provider-icons.d.ts.map +1 -0
- package/dist/components/provider-icons.js +88 -0
- package/dist/components/provider-icons.js.map +1 -0
- package/dist/consent.js +3066 -1084
- package/dist/consent.min.js +1419 -658
- package/dist/constants/capabilities.d.ts +6 -2
- package/dist/constants/capabilities.d.ts.map +1 -1
- package/dist/constants/capabilities.js +6 -1
- package/dist/constants/capabilities.js.map +1 -1
- package/dist/copy/tokens.d.ts +9 -5
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +9 -5
- package/dist/copy/tokens.js.map +1 -1
- package/dist/flow/copy.d.ts +31 -0
- package/dist/flow/copy.d.ts.map +1 -0
- package/dist/flow/copy.js +137 -0
- package/dist/flow/copy.js.map +1 -0
- package/dist/flow/index.d.ts +15 -0
- package/dist/flow/index.d.ts.map +1 -0
- package/dist/flow/index.js +15 -0
- package/dist/flow/index.js.map +1 -0
- package/dist/flow/model.d.ts +209 -0
- package/dist/flow/model.d.ts.map +1 -0
- package/dist/flow/model.js +103 -0
- package/dist/flow/model.js.map +1 -0
- package/dist/flow/presets.d.ts +29 -0
- package/dist/flow/presets.d.ts.map +1 -0
- package/dist/flow/presets.js +153 -0
- package/dist/flow/presets.js.map +1 -0
- package/dist/flow/schema.d.ts +127 -0
- package/dist/flow/schema.d.ts.map +1 -0
- package/dist/flow/schema.js +72 -0
- package/dist/flow/schema.js.map +1 -0
- package/dist/mcp-app/inline.d.ts.map +1 -1
- package/dist/mcp-app/inline.js +2 -2
- package/dist/mcp-app/inline.js.map +1 -1
- package/dist/react/index.d.ts +21 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +29 -0
- package/dist/react/index.js.map +1 -1
- package/dist/styles/theme.d.ts +11 -8
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +8 -6
- package/dist/styles/theme.js.map +1 -1
- package/package.json +9 -4
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROVIDER_NAMES = void 0;
|
|
4
|
+
exports.providerIcon = providerIcon;
|
|
5
|
+
/**
|
|
6
|
+
* Sign-in provider marks
|
|
7
|
+
*
|
|
8
|
+
* Each built-in sign-in provider's mark, as the OAuth button and a consent
|
|
9
|
+
* flow's sign-in chip draw it. `custom` has none: its host passes its own.
|
|
10
|
+
*
|
|
11
|
+
* @module components/provider-icons
|
|
12
|
+
*/
|
|
13
|
+
const lit_1 = require("lit");
|
|
14
|
+
const MARKS = {
|
|
15
|
+
google: (0, lit_1.html) `
|
|
16
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
17
|
+
<path
|
|
18
|
+
fill="#4285F4"
|
|
19
|
+
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
fill="#34A853"
|
|
23
|
+
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
|
|
24
|
+
/>
|
|
25
|
+
<path
|
|
26
|
+
fill="#FBBC05"
|
|
27
|
+
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
|
|
28
|
+
/>
|
|
29
|
+
<path
|
|
30
|
+
fill="#EA4335"
|
|
31
|
+
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
|
|
32
|
+
/>
|
|
33
|
+
</svg>
|
|
34
|
+
`,
|
|
35
|
+
microsoft: (0, lit_1.html) `
|
|
36
|
+
<svg viewBox="0 0 21 21" xmlns="http://www.w3.org/2000/svg">
|
|
37
|
+
<rect x="1" y="1" width="9" height="9" fill="#f25022" />
|
|
38
|
+
<rect x="1" y="11" width="9" height="9" fill="#00a4ef" />
|
|
39
|
+
<rect x="11" y="1" width="9" height="9" fill="#7fba00" />
|
|
40
|
+
<rect x="11" y="11" width="9" height="9" fill="#ffb900" />
|
|
41
|
+
</svg>
|
|
42
|
+
`,
|
|
43
|
+
apple: (0, lit_1.html) `
|
|
44
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
45
|
+
<path
|
|
46
|
+
fill="currentColor"
|
|
47
|
+
d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"
|
|
48
|
+
/>
|
|
49
|
+
</svg>
|
|
50
|
+
`,
|
|
51
|
+
github: (0, lit_1.html) `
|
|
52
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
53
|
+
<path
|
|
54
|
+
fill="currentColor"
|
|
55
|
+
d="M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.17 6.839 9.49.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.167 22 16.418 22 12c0-5.523-4.477-10-10-10z"
|
|
56
|
+
/>
|
|
57
|
+
</svg>
|
|
58
|
+
`,
|
|
59
|
+
twitter: (0, lit_1.html) `
|
|
60
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
61
|
+
<path
|
|
62
|
+
fill="currentColor"
|
|
63
|
+
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
|
|
64
|
+
/>
|
|
65
|
+
</svg>
|
|
66
|
+
`,
|
|
67
|
+
facebook: (0, lit_1.html) `
|
|
68
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
69
|
+
<path
|
|
70
|
+
fill="currentColor"
|
|
71
|
+
d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
|
|
72
|
+
/>
|
|
73
|
+
</svg>
|
|
74
|
+
`,
|
|
75
|
+
};
|
|
76
|
+
/** Each built-in provider's name, as copy names it ("Signed in with Google"). */
|
|
77
|
+
exports.PROVIDER_NAMES = {
|
|
78
|
+
google: "Google",
|
|
79
|
+
microsoft: "Microsoft",
|
|
80
|
+
apple: "Apple",
|
|
81
|
+
github: "GitHub",
|
|
82
|
+
twitter: "Twitter",
|
|
83
|
+
facebook: "Facebook",
|
|
84
|
+
custom: "Sign in",
|
|
85
|
+
};
|
|
86
|
+
/** A provider's mark, or nothing for `custom` or a name the package doesn't know. */
|
|
87
|
+
function providerIcon(provider) {
|
|
88
|
+
return Object.prototype.hasOwnProperty.call(MARKS, provider)
|
|
89
|
+
? MARKS[provider]
|
|
90
|
+
: lit_1.nothing;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=provider-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-icons.js","sourceRoot":"","sources":["../../../src/components/provider-icons.ts"],"names":[],"mappings":";;;AA+FA,oCAMC;AArGD;;;;;;;GAOG;AACH,6BAAyD;AAYzD,MAAM,KAAK,GAA6D;IACtE,MAAM,EAAE,IAAA,UAAI,EAAA;;;;;;;;;;;;;;;;;;;GAmBX;IACD,SAAS,EAAE,IAAA,UAAI,EAAA;;;;;;;GAOd;IACD,KAAK,EAAE,IAAA,UAAI,EAAA;;;;;;;GAOV;IACD,MAAM,EAAE,IAAA,UAAI,EAAA;;;;;;;GAOX;IACD,OAAO,EAAE,IAAA,UAAI,EAAA;;;;;;;GAOZ;IACD,QAAQ,EAAE,IAAA,UAAI,EAAA;;;;;;;GAOb;CACF,CAAC;AAEF,iFAAiF;AACpE,QAAA,cAAc,GAA4C;IACrE,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,SAAS;CAClB,CAAC;AAEF,qFAAqF;AACrF,SAAgB,YAAY,CAC1B,QAAgB;IAEhB,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC;QAC1D,CAAC,CAAC,KAAK,CAAC,QAA8B,CAAC;QACvC,CAAC,CAAC,aAAO,CAAC;AACd,CAAC"}
|
|
@@ -12,8 +12,12 @@ exports.CONSENT_CAPABILITIES_FEATURES = Object.freeze({
|
|
|
12
12
|
* details, an unverified agent is flagged, `approver` and `grantDetails`
|
|
13
13
|
* draw their boxes, rows have no icon unless `show-icons`, and the `footer`
|
|
14
14
|
* slot sits under the card beside the new `legal` slot.
|
|
15
|
+
* 5 adds the `connector-mark` slot, which takes the shield's place, and
|
|
16
|
+
* `hide-risk` and `hide-scopes`, which leave out the HIGHER RISK chips and
|
|
17
|
+
* the scope badges, and drops the host
|
|
18
|
+
* chip after a domain-bound agent's name.
|
|
15
19
|
*/
|
|
16
|
-
version:
|
|
20
|
+
version: 5,
|
|
17
21
|
scopesOnly: true,
|
|
18
22
|
slots: Object.freeze([
|
|
19
23
|
"identity",
|
|
@@ -22,6 +26,7 @@ exports.CONSENT_CAPABILITIES_FEATURES = Object.freeze({
|
|
|
22
26
|
"footer",
|
|
23
27
|
"legal",
|
|
24
28
|
"headline",
|
|
29
|
+
"connector-mark",
|
|
25
30
|
]),
|
|
26
31
|
/** A row's slot is this prefix and the capability's id. */
|
|
27
32
|
capabilitySlotPrefix: "capability-",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/constants/capabilities.ts"],"names":[],"mappings":";;;AAAA,iFAAiF;AACpE,QAAA,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/constants/capabilities.ts"],"names":[],"mappings":";;;AAAA,iFAAiF;AACpE,QAAA,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD;;;;;;;;;;;;;OAaG;IACH,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QACnB,UAAU;QACV,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,UAAU;QACV,gBAAgB;KACR,CAAC;IACX,2DAA2D;IAC3D,oBAAoB,EAAE,aAAa;CACpC,CAAC,CAAC"}
|
package/dist/cjs/copy/tokens.js
CHANGED
|
@@ -43,7 +43,6 @@ exports.CONSENT_COPY_TOKENS = {
|
|
|
43
43
|
identity: "Identity",
|
|
44
44
|
identifiedBy: "Identified by {Host}",
|
|
45
45
|
/** Read before the host in the headline's chip. */
|
|
46
|
-
identifiedByPrefix: "identified by ",
|
|
47
46
|
identifiedExplanation: "Its details are published at {Host}, and it can only send you back to an address listed there.",
|
|
48
47
|
verified: "Verified",
|
|
49
48
|
verifiedExplanation: "Its Entity Card was checked and verified.",
|
|
@@ -80,18 +79,22 @@ exports.CONSENT_COPY_TOKENS = {
|
|
|
80
79
|
madeBy: "Made by {Vendor}",
|
|
81
80
|
/** `{Surface}` → surface label, e.g. "Mac". */
|
|
82
81
|
askingFrom: "Asking from your {Surface}",
|
|
83
|
-
metaSeparator: "
|
|
82
|
+
metaSeparator: ". ",
|
|
84
83
|
/**
|
|
85
84
|
* @deprecated The header no longer uses this: it can't leave out an
|
|
86
85
|
* unknown vendor or surface. Use `madeBy`, `askingFrom` and
|
|
87
86
|
* `metaSeparator`.
|
|
88
87
|
*/
|
|
89
|
-
metaTemplate: "Made by {Vendor}
|
|
88
|
+
metaTemplate: "Made by {Vendor}. Asking from your {Surface}. {Connected}",
|
|
90
89
|
connectedJustNow: "Connected just now",
|
|
91
90
|
/** `{Minutes}` → minutes since connection. */
|
|
92
91
|
connectedMinutesAgo: "Connected {Minutes} min ago",
|
|
93
92
|
},
|
|
94
93
|
section: {
|
|
94
|
+
/** Above the rows; `{Agent}` → the agent's name. Drawn uppercase by CSS. */
|
|
95
|
+
capabilitiesHeader: "What {Agent} can do for you",
|
|
96
|
+
/** Beside it, while the rows can be ticked. */
|
|
97
|
+
tapToToggle: "Tap to toggle",
|
|
95
98
|
/** Used in the dark gateway theme. */
|
|
96
99
|
permissionsRequested: "PERMISSIONS REQUESTED",
|
|
97
100
|
},
|
|
@@ -138,8 +141,8 @@ exports.CONSENT_COPY_TOKENS = {
|
|
|
138
141
|
grant: {
|
|
139
142
|
/** The button that opens the terms. */
|
|
140
143
|
customize: "Customize",
|
|
141
|
-
/** Between the parts of the closed summary: "8 hours
|
|
142
|
-
summarySeparator: "
|
|
144
|
+
/** Between the parts of the closed summary: "8 hours, Every folder". */
|
|
145
|
+
summarySeparator: ", ",
|
|
143
146
|
durationLabel: "Valid for",
|
|
144
147
|
durationHint: "The grant ends on its own after this. The agent has to ask again.",
|
|
145
148
|
folderLabel: "Limit to a folder (optional)",
|
|
@@ -180,6 +183,7 @@ exports.CONSENT_COPY_TOKENS = {
|
|
|
180
183
|
wallet: {
|
|
181
184
|
/** The caption under the wallet check, one per status. */
|
|
182
185
|
check: {
|
|
186
|
+
idle: "Waiting for you",
|
|
183
187
|
checking: "Checking wallet identity…",
|
|
184
188
|
syncing: "Syncing this device's wallet to your account…",
|
|
185
189
|
ready: "Wallet verified",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/copy/tokens.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/copy/tokens.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AA4SH,kCAQC;AAlTY,QAAA,mBAAmB,GAAG;IACj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AAC,CAAC;QAC1B,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FLOW_COPY = void 0;
|
|
4
|
+
exports.flowCopy = flowCopy;
|
|
5
|
+
exports.token = token;
|
|
6
|
+
exports.group = group;
|
|
7
|
+
exports.splitTemplate = splitTemplate;
|
|
8
|
+
exports.fillTemplate = fillTemplate;
|
|
9
|
+
exports.initialsOf = initialsOf;
|
|
10
|
+
exports.FLOW_COPY = {
|
|
11
|
+
eyebrow: {
|
|
12
|
+
default: "Permission request",
|
|
13
|
+
granted: "Permission granted",
|
|
14
|
+
denied: "Permission declined",
|
|
15
|
+
},
|
|
16
|
+
headline: {
|
|
17
|
+
"sign-in": "Sign in to let {Agent} {Verb} at {Merchant}.",
|
|
18
|
+
default: "{Agent} would like to {Verb} at {Merchant} on your behalf",
|
|
19
|
+
granted: "Access granted",
|
|
20
|
+
denied: "No access given",
|
|
21
|
+
error: "Something went wrong",
|
|
22
|
+
},
|
|
23
|
+
sub: {
|
|
24
|
+
granted: "{Agent} can now {Verb} at {Merchant} for you.",
|
|
25
|
+
denied: "{Agent} can't {Verb} for you. Nothing was approved.",
|
|
26
|
+
error: "Nothing was approved. Try again, or ask {Agent} to start over.",
|
|
27
|
+
},
|
|
28
|
+
signIn: {
|
|
29
|
+
continueAs: "Continue as {First}",
|
|
30
|
+
other: "Not you? Use another {Provider} account.",
|
|
31
|
+
finePrint: "{Provider} confirms you control this account. {Merchant} does not get your mail, contacts or files.",
|
|
32
|
+
},
|
|
33
|
+
approver: {
|
|
34
|
+
label: "You are authorizing",
|
|
35
|
+
labelGranted: "You authorized",
|
|
36
|
+
labelDenied: "You declined",
|
|
37
|
+
party: "To act for you",
|
|
38
|
+
partyGranted: "Can now act for you",
|
|
39
|
+
partyDenied: "Asked to act for you",
|
|
40
|
+
confirmed: "Confirmed with passkey",
|
|
41
|
+
signedInWith: "Signed in with {Provider}",
|
|
42
|
+
declined: "Declined",
|
|
43
|
+
unverified: "Unverified",
|
|
44
|
+
unverifiedInfo: "It registered itself, so the name it gives is not checked. Allow only if you asked it to.",
|
|
45
|
+
identifiedBy: "Identified by {Domain}",
|
|
46
|
+
},
|
|
47
|
+
capabilitiesHeader: "What {Agent} can do for you",
|
|
48
|
+
tapToToggle: "Tap to toggle",
|
|
49
|
+
seal: {
|
|
50
|
+
"sign-in": "Sign in to continue",
|
|
51
|
+
consent: "Waiting for your passkey",
|
|
52
|
+
passkey: "Confirming with your passkey",
|
|
53
|
+
cancelled: "Passkey not confirmed",
|
|
54
|
+
granted: "Signed with your passkey",
|
|
55
|
+
denied: "Nothing was signed",
|
|
56
|
+
expired: "Request expired",
|
|
57
|
+
error: "Something went wrong",
|
|
58
|
+
},
|
|
59
|
+
details: {
|
|
60
|
+
title: "Permission details",
|
|
61
|
+
connectsTo: "Connects to",
|
|
62
|
+
duration: "Duration",
|
|
63
|
+
budget: "Budget",
|
|
64
|
+
amountLimits: "Amount limits",
|
|
65
|
+
folders: "Folders",
|
|
66
|
+
alreadyGranted: "Already granted",
|
|
67
|
+
},
|
|
68
|
+
actions: {
|
|
69
|
+
approve: "Approve with passkey",
|
|
70
|
+
deny: "Deny",
|
|
71
|
+
confirming: "Confirming…",
|
|
72
|
+
},
|
|
73
|
+
status: "Waiting for your passkey…",
|
|
74
|
+
notice: "Passkey not confirmed. Nothing was approved.",
|
|
75
|
+
expired: "This request expired. Ask {Agent} to try again.",
|
|
76
|
+
receipt: { until: "Until {When}" },
|
|
77
|
+
goBack: "Go back to {Agent} and tell it to continue. Revoke anytime under Connected agents at {Merchant}.",
|
|
78
|
+
retry: "Try again",
|
|
79
|
+
announce: {
|
|
80
|
+
"sign-in": "Sign in to continue.",
|
|
81
|
+
consent: "Review what {Agent} is asking for.",
|
|
82
|
+
passkey: "Waiting for your passkey.",
|
|
83
|
+
granted: "Access granted.",
|
|
84
|
+
denied: "No access given.",
|
|
85
|
+
cancelled: "Passkey not confirmed. Nothing was approved.",
|
|
86
|
+
expired: "This request expired.",
|
|
87
|
+
error: "Something went wrong. Nothing was approved.",
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
const isGroup = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
91
|
+
/** The defaults with each layer of overrides over them, merged a level deep. */
|
|
92
|
+
function flowCopy(...layers) {
|
|
93
|
+
const out = { ...exports.FLOW_COPY };
|
|
94
|
+
for (const layer of layers) {
|
|
95
|
+
for (const [key, value] of Object.entries(layer ?? {})) {
|
|
96
|
+
const base = out[key];
|
|
97
|
+
out[key] =
|
|
98
|
+
isGroup(value) && isGroup(base) ? { ...base, ...value } : value;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return out;
|
|
102
|
+
}
|
|
103
|
+
/** A token's words: the token itself, or its entry for `step`, or its `default`. */
|
|
104
|
+
function token(copy, key, step) {
|
|
105
|
+
const value = copy[key];
|
|
106
|
+
if (typeof value === "string")
|
|
107
|
+
return value;
|
|
108
|
+
if (!isGroup(value))
|
|
109
|
+
return "";
|
|
110
|
+
const entry = (step && value[step]) ?? value.default;
|
|
111
|
+
return typeof entry === "string" ? entry : "";
|
|
112
|
+
}
|
|
113
|
+
/** A token in a group: `group(copy, "actions").approve`, as strings. */
|
|
114
|
+
function group(copy, key) {
|
|
115
|
+
const value = copy[key];
|
|
116
|
+
if (!isGroup(value))
|
|
117
|
+
return {};
|
|
118
|
+
return Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[1] === "string"));
|
|
119
|
+
}
|
|
120
|
+
/** A template split into its words and its placeholders, for a renderer to fill. */
|
|
121
|
+
function splitTemplate(template) {
|
|
122
|
+
return template
|
|
123
|
+
.split(/\{(\w+)\}/)
|
|
124
|
+
.map((part, i) => (i % 2 ? { name: part } : { text: part }))
|
|
125
|
+
.filter((part) => part.name || part.text);
|
|
126
|
+
}
|
|
127
|
+
/** A template with its placeholders filled, as plain text. */
|
|
128
|
+
function fillTemplate(template, values) {
|
|
129
|
+
return splitTemplate(template)
|
|
130
|
+
.map((part) => (part.name ? (values[part.name] ?? "") : part.text))
|
|
131
|
+
.join("");
|
|
132
|
+
}
|
|
133
|
+
/** "Dylan Hobbs" is DH, "Alice" is A; with no name, the identifier's first letter; else "?". */
|
|
134
|
+
function initialsOf(name = "", identifier = "") {
|
|
135
|
+
const first = (word) => Array.from(word.replace(/^[^\p{L}\p{N}]+/u, ""))[0] ?? "";
|
|
136
|
+
const words = name
|
|
137
|
+
.trim()
|
|
138
|
+
.split(/\s+/)
|
|
139
|
+
.filter((word) => /[\p{L}\p{N}]/u.test(word));
|
|
140
|
+
if (words.length >= 2)
|
|
141
|
+
return (first(words[0]) + first(words[words.length - 1])).toUpperCase();
|
|
142
|
+
if (words.length === 1)
|
|
143
|
+
return first(words[0]).toUpperCase();
|
|
144
|
+
return (first(identifier) || "?").toUpperCase();
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../src/flow/copy.ts"],"names":[],"mappings":";;;AAuGA,4BAUC;AAGD,sBAMC;AAGD,sBAQC;AAGD,sCAOC;AAGD,oCAOC;AAGD,gCAWC;AAxJY,QAAA,SAAS,GAAa;IACjC,OAAO,EAAE;QACP,OAAO,EAAE,oBAAoB;QAC7B,OAAO,EAAE,oBAAoB;QAC7B,MAAM,EAAE,qBAAqB;KAC9B;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,8CAA8C;QACzD,OAAO,EAAE,2DAA2D;QACpE,OAAO,EAAE,gBAAgB;QACzB,MAAM,EAAE,iBAAiB;QACzB,KAAK,EAAE,sBAAsB;KAC9B;IACD,GAAG,EAAE;QACH,OAAO,E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AAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED,gGAAgG;AAChG,SAAgB,UAAU,CAAC,IAAI,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE;IACnD,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAC7B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI;SACf,IAAI,EAAE;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Consent flows
|
|
19
|
+
*
|
|
20
|
+
* A consent flow as data: the model (names, types, the schema version), the
|
|
21
|
+
* schema Checkpoint validates a saved flow with, the presets it offers as
|
|
22
|
+
* templates, and the default copy with its helpers. The browser bundle carries the model and the presets, not the
|
|
23
|
+
* schema.
|
|
24
|
+
*
|
|
25
|
+
* @module @kya-os/consent/flow
|
|
26
|
+
*/
|
|
27
|
+
__exportStar(require("./model.js"), exports);
|
|
28
|
+
__exportStar(require("./presets.js"), exports);
|
|
29
|
+
__exportStar(require("./copy.js"), exports);
|
|
30
|
+
__exportStar(require("./schema.js"), exports);
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/flow/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;GASG;AACH,6CAA2B;AAC3B,+CAA6B;AAC7B,4CAA0B;AAC1B,8CAA4B"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Consent flow model
|
|
4
|
+
*
|
|
5
|
+
* A consent flow is data: which blocks each step draws, in order, the
|
|
6
|
+
* connector's state in that step, and where focus lands, plus copy overrides.
|
|
7
|
+
* It is plain JSON (no functions), so Checkpoint can store a project's flow in
|
|
8
|
+
* its consent config, validate it (`flowSchema`), diff it against a preset,
|
|
9
|
+
* and have every server render exactly what was saved.
|
|
10
|
+
*
|
|
11
|
+
* This file holds the names and types only. It imports nothing but the
|
|
12
|
+
* package's own types, so the presets and the browser bundle carry no
|
|
13
|
+
* validator.
|
|
14
|
+
*
|
|
15
|
+
* @module flow/model
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.FLOW_HOST_ATTRIBUTES = exports.FLOW_EVENTS = exports.MOTION_PRIMITIVES = exports.CONNECTOR_MARKS = exports.MOTION_PRESETS = exports.APPROVAL_METHODS = exports.FLOW_CONNECTOR_STATES = exports.FLOW_STEPS = exports.FLOW_BLOCKS = exports.FLOW_SCHEMA_VERSION = void 0;
|
|
19
|
+
exports.consentFlowRenders = consentFlowRenders;
|
|
20
|
+
exports.FLOW_SCHEMA_VERSION = 1;
|
|
21
|
+
/** The blocks a step can draw. A block name may carry a variant: "capability:locked". */
|
|
22
|
+
exports.FLOW_BLOCKS = [
|
|
23
|
+
"eyebrow",
|
|
24
|
+
"headline",
|
|
25
|
+
"sub",
|
|
26
|
+
"signIn",
|
|
27
|
+
"finePrint",
|
|
28
|
+
"approver",
|
|
29
|
+
"capability",
|
|
30
|
+
"details",
|
|
31
|
+
"countdown",
|
|
32
|
+
"actions",
|
|
33
|
+
"status",
|
|
34
|
+
"notice",
|
|
35
|
+
"expiredNote",
|
|
36
|
+
"receipt",
|
|
37
|
+
"goBack",
|
|
38
|
+
"retry",
|
|
39
|
+
];
|
|
40
|
+
/** The steps a flow can have. */
|
|
41
|
+
exports.FLOW_STEPS = [
|
|
42
|
+
"sign-in",
|
|
43
|
+
"consent",
|
|
44
|
+
"passkey",
|
|
45
|
+
"granted",
|
|
46
|
+
"denied",
|
|
47
|
+
"cancelled",
|
|
48
|
+
"expired",
|
|
49
|
+
"error",
|
|
50
|
+
];
|
|
51
|
+
/**
|
|
52
|
+
* The connector's states; a step names the one it shows. With the wallet
|
|
53
|
+
* check in the connector: resting until the person acts (sign-in, consent),
|
|
54
|
+
* turning while the passkey is open, closed on its check once granted, open
|
|
55
|
+
* at the top when the passkey was dismissed (cancelled), and its error once
|
|
56
|
+
* nothing was granted (denied, expired, error).
|
|
57
|
+
*/
|
|
58
|
+
exports.FLOW_CONNECTOR_STATES = [
|
|
59
|
+
"sign-in",
|
|
60
|
+
"consent",
|
|
61
|
+
"passkey",
|
|
62
|
+
"cancelled",
|
|
63
|
+
"granted",
|
|
64
|
+
"denied",
|
|
65
|
+
"expired",
|
|
66
|
+
"error",
|
|
67
|
+
];
|
|
68
|
+
/**
|
|
69
|
+
* How the person approves: `consent` submits on Allow, with no passkey step;
|
|
70
|
+
* `passkey` confirms with a passkey (created first by a first-time shopper).
|
|
71
|
+
*/
|
|
72
|
+
exports.APPROVAL_METHODS = ["consent", "passkey"];
|
|
73
|
+
/**
|
|
74
|
+
* How much the flow moves between steps: `default`, `subtle` (shorter and
|
|
75
|
+
* smaller), or `none` (cross-fades only: the reduced-motion path).
|
|
76
|
+
*/
|
|
77
|
+
exports.MOTION_PRESETS = ["default", "subtle", "none"];
|
|
78
|
+
/** What sits in the connector's middle: the wallet check, or nothing (its shield). */
|
|
79
|
+
exports.CONNECTOR_MARKS = ["wallet-check", "none"];
|
|
80
|
+
/** The motion primitives a flow plays, as its `consent-flow-motion` events name them. */
|
|
81
|
+
exports.MOTION_PRIMITIVES = [
|
|
82
|
+
"leave",
|
|
83
|
+
"arrive",
|
|
84
|
+
"move",
|
|
85
|
+
"cross-fade",
|
|
86
|
+
"resize",
|
|
87
|
+
];
|
|
88
|
+
/** The events a flow sends, each as `consent-flow-<name>`, bubbling and composed. */
|
|
89
|
+
exports.FLOW_EVENTS = [
|
|
90
|
+
"sign-in",
|
|
91
|
+
"approve",
|
|
92
|
+
"deny",
|
|
93
|
+
"retry",
|
|
94
|
+
"expire",
|
|
95
|
+
"motion",
|
|
96
|
+
"step",
|
|
97
|
+
];
|
|
98
|
+
/** The attributes `<consent-flow>` stamps on itself, for a host or preview to read. */
|
|
99
|
+
exports.FLOW_HOST_ATTRIBUTES = {
|
|
100
|
+
version: "data-consent-version",
|
|
101
|
+
approvalMethod: "data-approval-method",
|
|
102
|
+
};
|
|
103
|
+
/** `{ flow, approvalMethod }`, to spread into a declaration's `renders`. */
|
|
104
|
+
function consentFlowRenders() {
|
|
105
|
+
return { flow: exports.FLOW_SCHEMA_VERSION, approvalMethod: true };
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/flow/model.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA2QH,gDAEC;AApQY,QAAA,mBAAmB,GAAG,CAAC,CAAC;AAErC,yFAAyF;AAC5E,QAAA,WAAW,GAAG;IACzB,SAAS;IACT,UAAU;IACV,KAAK;IACL,QAAQ;IACR,WAAW;IACX,UAAU;IACV,YAAY;IACZ,SAAS;IACT,WAAW;IACX,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,aAAa;IACb,SAAS;IACT,QAAQ;IACR,OAAO;CACC,CAAC;AAGX,iCAAiC;AACpB,QAAA,UAAU,GAAG;IACxB,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,QAAQ;IACR,WAAW;IACX,SAAS;IACT,OAAO;CACC,CAAC;AAGX;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAG;IACnC,SAAS;IACT,SAAS;IACT,SAAS;IACT,WAAW;IACX,SAAS;IACT,QAAQ;IACR,SAAS;IACT,OAAO;CACC,CAAC;AAGX;;;GAGG;AACU,QAAA,gBAAgB,GAAG,CAAC,SAAS,EAAE,SAAS,CAAU,CAAC;AAGhE;;;GAGG;AACU,QAAA,cAAc,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAGrE,sFAAsF;AACzE,QAAA,eAAe,GAAG,CAAC,cAAc,EAAE,MAAM,CAAU,CAAC;AAGjE,yFAAyF;AAC5E,QAAA,iBAAiB,GAAG;IAC/B,OAAO;IACP,QAAQ;IACR,MAAM;IACN,YAAY;IACZ,QAAQ;CACA,CAAC;AA6BX,qFAAqF;AACxE,QAAA,WAAW,GAAG;IACzB,SAAS;IACT,SAAS;IACT,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,MAAM;CACE,CAAC;AAuHX,uFAAuF;AAC1E,QAAA,oBAAoB,GAAG;IAClC,OAAO,EAAE,sBAAsB;IAC/B,cAAc,EAAE,sBAAsB;CAC9B,CAAC;AAgBX,4EAA4E;AAC5E,SAAgB,kBAAkB;IAChC,OAAO,EAAE,IAAI,EAAE,2BAAmB,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FLOW_PRESETS = exports.DECISION_CONSENT_FLOW = exports.SIGN_IN_CONSENT_FLOW = exports.DECISION_FLOW = exports.SIGN_IN_FLOW = void 0;
|
|
4
|
+
exports.flowPreset = flowPreset;
|
|
5
|
+
/**
|
|
6
|
+
* Consent flow presets
|
|
7
|
+
*
|
|
8
|
+
* The flows Checkpoint offers as templates, as plain JSON. A project's saved
|
|
9
|
+
* flow is one of these, or one of these with its edits; Checkpoint diffs the
|
|
10
|
+
* two. The editor's Approval method switch picks between the `passkey` and
|
|
11
|
+
* `consent` presets (`flowPreset`).
|
|
12
|
+
*
|
|
13
|
+
* @module flow/presets
|
|
14
|
+
*/
|
|
15
|
+
const model_js_1 = require("./model.js");
|
|
16
|
+
const CONSENT_BLOCKS = [
|
|
17
|
+
"eyebrow",
|
|
18
|
+
"headline",
|
|
19
|
+
"approver",
|
|
20
|
+
"capability",
|
|
21
|
+
"details",
|
|
22
|
+
"countdown",
|
|
23
|
+
"actions",
|
|
24
|
+
];
|
|
25
|
+
const SIGN_IN_STEP = {
|
|
26
|
+
connector: "sign-in",
|
|
27
|
+
blocks: ["eyebrow", "headline", "signIn", "finePrint"],
|
|
28
|
+
focus: "headline",
|
|
29
|
+
};
|
|
30
|
+
/** The steps both approval methods share. */
|
|
31
|
+
const OUTCOMES = {
|
|
32
|
+
granted: {
|
|
33
|
+
connector: "granted",
|
|
34
|
+
blocks: [
|
|
35
|
+
"eyebrow",
|
|
36
|
+
"headline",
|
|
37
|
+
"approver:granted",
|
|
38
|
+
"sub",
|
|
39
|
+
"receipt",
|
|
40
|
+
"goBack",
|
|
41
|
+
],
|
|
42
|
+
focus: "headline",
|
|
43
|
+
},
|
|
44
|
+
denied: {
|
|
45
|
+
connector: "denied",
|
|
46
|
+
blocks: ["eyebrow", "headline", "sub", "approver:denied"],
|
|
47
|
+
focus: "headline",
|
|
48
|
+
},
|
|
49
|
+
expired: {
|
|
50
|
+
connector: "expired",
|
|
51
|
+
blocks: [
|
|
52
|
+
"eyebrow",
|
|
53
|
+
"headline",
|
|
54
|
+
"approver",
|
|
55
|
+
"capability:dim",
|
|
56
|
+
"expiredNote",
|
|
57
|
+
],
|
|
58
|
+
focus: "headline",
|
|
59
|
+
},
|
|
60
|
+
error: {
|
|
61
|
+
connector: "error",
|
|
62
|
+
blocks: ["eyebrow", "headline", "sub", "approver", "retry"],
|
|
63
|
+
focus: "headline",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
/** Approve opens the passkey; dismissing it comes back to consent with a notice. */
|
|
67
|
+
const PASSKEY_STEPS = {
|
|
68
|
+
consent: { connector: "consent", blocks: CONSENT_BLOCKS, focus: "headline" },
|
|
69
|
+
passkey: {
|
|
70
|
+
connector: "passkey",
|
|
71
|
+
blocks: [
|
|
72
|
+
"eyebrow",
|
|
73
|
+
"headline",
|
|
74
|
+
"approver",
|
|
75
|
+
"capability:locked",
|
|
76
|
+
"details",
|
|
77
|
+
"countdown",
|
|
78
|
+
"actions:loading",
|
|
79
|
+
"status",
|
|
80
|
+
],
|
|
81
|
+
focus: "status",
|
|
82
|
+
},
|
|
83
|
+
cancelled: {
|
|
84
|
+
connector: "cancelled",
|
|
85
|
+
blocks: [...CONSENT_BLOCKS, "notice"],
|
|
86
|
+
focus: "notice",
|
|
87
|
+
},
|
|
88
|
+
...OUTCOMES,
|
|
89
|
+
};
|
|
90
|
+
/** Allow submits: no passkey step, so nothing to cancel. */
|
|
91
|
+
const CONSENT_STEPS = {
|
|
92
|
+
consent: { connector: "consent", blocks: CONSENT_BLOCKS, focus: "headline" },
|
|
93
|
+
...OUTCOMES,
|
|
94
|
+
};
|
|
95
|
+
/** A first-time shopper creates a passkey rather than using one. */
|
|
96
|
+
const CREATE_PASSKEY_COPY = {
|
|
97
|
+
actions: { approve: "Create a passkey and approve" },
|
|
98
|
+
status: "Create your passkey…",
|
|
99
|
+
seal: {
|
|
100
|
+
consent: "Ready to create a passkey",
|
|
101
|
+
passkey: "Creating your passkey",
|
|
102
|
+
},
|
|
103
|
+
approver: { confirmed: "Confirmed with your new passkey" },
|
|
104
|
+
announce: { passkey: "Create your passkey." },
|
|
105
|
+
};
|
|
106
|
+
const CONSENT_COPY = {
|
|
107
|
+
actions: { approve: "Allow" },
|
|
108
|
+
approver: { confirmed: "Approved" },
|
|
109
|
+
seal: { consent: "Waiting for your approval", granted: "Approved" },
|
|
110
|
+
};
|
|
111
|
+
/** A frozen copy, so no preset shares or changes another's tables. */
|
|
112
|
+
function frozen(value) {
|
|
113
|
+
const copy = JSON.parse(JSON.stringify(value));
|
|
114
|
+
const freeze = (node) => {
|
|
115
|
+
if (node && typeof node === "object") {
|
|
116
|
+
Object.freeze(node);
|
|
117
|
+
Object.values(node).forEach(freeze);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
freeze(copy);
|
|
121
|
+
return copy;
|
|
122
|
+
}
|
|
123
|
+
function flow(name, approvalMethod, signIn) {
|
|
124
|
+
const passkey = approvalMethod === "passkey";
|
|
125
|
+
return frozen({
|
|
126
|
+
version: model_js_1.FLOW_SCHEMA_VERSION,
|
|
127
|
+
name,
|
|
128
|
+
approvalMethod,
|
|
129
|
+
initial: signIn ? "sign-in" : "consent",
|
|
130
|
+
motion: "default",
|
|
131
|
+
connectorMark: "wallet-check",
|
|
132
|
+
steps: {
|
|
133
|
+
...(signIn ? { "sign-in": SIGN_IN_STEP } : {}),
|
|
134
|
+
...(passkey ? PASSKEY_STEPS : CONSENT_STEPS),
|
|
135
|
+
},
|
|
136
|
+
copy: passkey ? {} : CONSENT_COPY,
|
|
137
|
+
copyWhenCreatingPasskey: passkey ? CREATE_PASSKEY_COPY : {},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/** Sign in with the merchant's provider, then approve with a passkey (kya-os-mcp, Liminal). */
|
|
141
|
+
exports.SIGN_IN_FLOW = flow("Sign in, consent, passkey", "passkey", true);
|
|
142
|
+
/** Already signed in; approve with a passkey (Hobbsidian's /c). */
|
|
143
|
+
exports.DECISION_FLOW = flow("Consent, passkey", "passkey", false);
|
|
144
|
+
/** Sign in, then Allow submits. */
|
|
145
|
+
exports.SIGN_IN_CONSENT_FLOW = flow("Sign in, consent", "consent", true);
|
|
146
|
+
/** Already signed in; Allow submits. */
|
|
147
|
+
exports.DECISION_CONSENT_FLOW = flow("Consent", "consent", false);
|
|
148
|
+
/** Every preset, by approval method and whether the flow signs the person in. */
|
|
149
|
+
exports.FLOW_PRESETS = {
|
|
150
|
+
passkey: { signIn: exports.SIGN_IN_FLOW, decision: exports.DECISION_FLOW },
|
|
151
|
+
consent: { signIn: exports.SIGN_IN_CONSENT_FLOW, decision: exports.DECISION_CONSENT_FLOW },
|
|
152
|
+
};
|
|
153
|
+
/** The preset for an approval method: what the editor's Approval method switch picks. */
|
|
154
|
+
function flowPreset(approvalMethod, { signIn = false } = {}) {
|
|
155
|
+
return exports.FLOW_PRESETS[approvalMethod][signIn ? "signIn" : "decision"];
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=presets.js.map
|