@kya-os/consent 0.4.0 → 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 +186 -22
- package/dist/bundle/index.d.ts +9 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +13 -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 +36 -1
- 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-action-bar.js +97 -25
- package/dist/cjs/components/consent-action-bar.js.map +1 -1
- package/dist/cjs/components/consent-agent-header.js +7 -105
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-button.js +6 -1
- package/dist/cjs/components/consent-button.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +456 -117
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-capability-card.js +159 -32
- package/dist/cjs/components/consent-capability-card.js.map +1 -1
- package/dist/cjs/components/consent-checkbox.js +7 -0
- package/dist/cjs/components/consent-checkbox.js.map +1 -1
- package/dist/cjs/components/consent-connector-header.js +262 -45
- package/dist/cjs/components/consent-connector-header.js.map +1 -1
- package/dist/cjs/components/consent-duration.js +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 +22 -14
- package/dist/cjs/components/consent-footer.js.map +1 -1
- package/dist/cjs/components/consent-headline.js +353 -33
- package/dist/cjs/components/consent-headline.js.map +1 -1
- package/dist/cjs/components/consent-oauth-button.js +68 -138
- package/dist/cjs/components/consent-oauth-button.js.map +1 -1
- package/dist/cjs/components/consent-otp-input.js +5 -0
- package/dist/cjs/components/consent-otp-input.js.map +1 -1
- package/dist/cjs/components/consent-phone-handoff.js +3 -3
- package/dist/cjs/components/consent-request-expiry.js +1 -1
- package/dist/cjs/components/consent-revocation-notice.js +29 -18
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
- package/dist/cjs/components/consent-revoke.js +9 -4
- package/dist/cjs/components/consent-revoke.js.map +1 -1
- package/dist/cjs/components/consent-secured-by.js +106 -0
- package/dist/cjs/components/consent-secured-by.js.map +1 -0
- package/dist/cjs/components/consent-shell.js +1 -1
- package/dist/cjs/components/consent-terms.js +7 -0
- package/dist/cjs/components/consent-terms.js.map +1 -1
- package/dist/cjs/components/consent-wallet-check.js +26 -2
- package/dist/cjs/components/consent-wallet-check.js.map +1 -1
- package/dist/cjs/components/consent-wallet-notice.js +1 -1
- package/dist/cjs/components/consent-wallet-orb.js +1 -1
- package/dist/cjs/components/consent-wallet-signature.js +1 -1
- package/dist/cjs/components/decision-icons.js +37 -0
- package/dist/cjs/components/decision-icons.js.map +1 -0
- package/dist/cjs/components/edit-region.js +309 -0
- package/dist/cjs/components/edit-region.js.map +1 -0
- 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/grant-field-styles.js +2 -2
- package/dist/cjs/components/index.js +13 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +93 -36
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/components/preview.js +67 -0
- package/dist/cjs/components/preview.js.map +1 -0
- 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 +17 -2
- package/dist/cjs/constants/capabilities.js.map +1 -1
- package/dist/cjs/copy/tokens.js +67 -24
- 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/identity/agent-identity.js +3 -2
- package/dist/cjs/identity/agent-identity.js.map +1 -1
- 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 +40 -2
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/styles/brand.js +385 -0
- package/dist/cjs/styles/brand.js.map +1 -0
- package/dist/cjs/styles/index.js +1 -0
- package/dist/cjs/styles/index.js.map +1 -1
- package/dist/cjs/styles/theme.js +102 -30
- package/dist/cjs/styles/theme.js.map +1 -1
- package/dist/cjs/types/capabilities.types.js +1 -2
- package/dist/cjs/types/capabilities.types.js.map +1 -1
- package/dist/cjs/types/decision.types.js +13 -0
- package/dist/cjs/types/decision.types.js.map +1 -0
- package/dist/cjs/types/edit.types.js +80 -0
- package/dist/cjs/types/edit.types.js.map +1 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts +20 -1
- package/dist/components/consent-action-bar.d.ts.map +1 -1
- package/dist/components/consent-action-bar.js +97 -25
- package/dist/components/consent-action-bar.js.map +1 -1
- package/dist/components/consent-agent-header.d.ts +4 -17
- package/dist/components/consent-agent-header.d.ts.map +1 -1
- package/dist/components/consent-agent-header.js +7 -105
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-button.d.ts +2 -0
- package/dist/components/consent-button.d.ts.map +1 -1
- package/dist/components/consent-button.js +6 -1
- package/dist/components/consent-button.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +101 -17
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +457 -118
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-capability-card.d.ts +32 -3
- package/dist/components/consent-capability-card.d.ts.map +1 -1
- package/dist/components/consent-capability-card.js +159 -32
- package/dist/components/consent-capability-card.js.map +1 -1
- package/dist/components/consent-checkbox.d.ts +2 -0
- package/dist/components/consent-checkbox.d.ts.map +1 -1
- package/dist/components/consent-checkbox.js +7 -0
- package/dist/components/consent-checkbox.js.map +1 -1
- package/dist/components/consent-connector-header.d.ts +52 -7
- package/dist/components/consent-connector-header.d.ts.map +1 -1
- package/dist/components/consent-connector-header.js +262 -45
- package/dist/components/consent-connector-header.js.map +1 -1
- package/dist/components/consent-duration.js +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 +6 -4
- package/dist/components/consent-footer.d.ts.map +1 -1
- package/dist/components/consent-footer.js +22 -14
- package/dist/components/consent-footer.js.map +1 -1
- package/dist/components/consent-headline.d.ts +62 -16
- package/dist/components/consent-headline.d.ts.map +1 -1
- package/dist/components/consent-headline.js +352 -34
- package/dist/components/consent-headline.js.map +1 -1
- package/dist/components/consent-oauth-button.d.ts +9 -6
- package/dist/components/consent-oauth-button.d.ts.map +1 -1
- package/dist/components/consent-oauth-button.js +71 -141
- package/dist/components/consent-oauth-button.js.map +1 -1
- package/dist/components/consent-otp-input.d.ts.map +1 -1
- package/dist/components/consent-otp-input.js +5 -0
- package/dist/components/consent-otp-input.js.map +1 -1
- package/dist/components/consent-passkey.d.ts +6 -0
- package/dist/components/consent-passkey.d.ts.map +1 -1
- package/dist/components/consent-passkey.js +67 -9
- package/dist/components/consent-passkey.js.map +1 -1
- package/dist/components/consent-phone-handoff.js +3 -3
- package/dist/components/consent-request-expiry.js +1 -1
- package/dist/components/consent-revocation-notice.d.ts.map +1 -1
- package/dist/components/consent-revocation-notice.js +29 -18
- package/dist/components/consent-revocation-notice.js.map +1 -1
- package/dist/components/consent-revoke.d.ts +2 -0
- package/dist/components/consent-revoke.d.ts.map +1 -1
- package/dist/components/consent-revoke.js +9 -4
- package/dist/components/consent-revoke.js.map +1 -1
- package/dist/components/consent-secured-by.d.ts +25 -0
- package/dist/components/consent-secured-by.d.ts.map +1 -0
- package/dist/components/consent-secured-by.js +103 -0
- package/dist/components/consent-secured-by.js.map +1 -0
- package/dist/components/consent-shell.js +1 -1
- package/dist/components/consent-terms.d.ts +2 -0
- package/dist/components/consent-terms.d.ts.map +1 -1
- package/dist/components/consent-terms.js +7 -0
- package/dist/components/consent-terms.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 +27 -3
- package/dist/components/consent-wallet-check.js.map +1 -1
- package/dist/components/consent-wallet-notice.js +1 -1
- package/dist/components/consent-wallet-orb.js +1 -1
- package/dist/components/consent-wallet-signature.js +1 -1
- package/dist/components/decision-icons.d.ts +26 -0
- package/dist/components/decision-icons.d.ts.map +1 -0
- package/dist/components/decision-icons.js +34 -0
- package/dist/components/decision-icons.js.map +1 -0
- package/dist/components/edit-region.d.ts +50 -0
- package/dist/components/edit-region.d.ts.map +1 -0
- package/dist/components/edit-region.js +305 -0
- package/dist/components/edit-region.js.map +1 -0
- 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/grant-field-styles.js +2 -2
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +19 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +93 -36
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/components/preview.d.ts +38 -0
- package/dist/components/preview.d.ts.map +1 -0
- package/dist/components/preview.js +61 -0
- package/dist/components/preview.js.map +1 -0
- 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 +4875 -1178
- package/dist/consent.min.js +2367 -814
- package/dist/constants/capabilities.d.ts +16 -3
- package/dist/constants/capabilities.d.ts.map +1 -1
- package/dist/constants/capabilities.js +17 -2
- package/dist/constants/capabilities.js.map +1 -1
- package/dist/copy/tokens.d.ts +67 -24
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +67 -24
- 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/identity/agent-identity.d.ts +3 -2
- package/dist/identity/agent-identity.d.ts.map +1 -1
- package/dist/identity/agent-identity.js +3 -2
- package/dist/identity/agent-identity.js.map +1 -1
- 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 +27 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +39 -1
- package/dist/react/index.js.map +1 -1
- package/dist/styles/brand.d.ts +184 -0
- package/dist/styles/brand.d.ts.map +1 -0
- package/dist/styles/brand.js +372 -0
- package/dist/styles/brand.js.map +1 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +1 -0
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/theme.d.ts +76 -13
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +98 -29
- package/dist/styles/theme.js.map +1 -1
- package/dist/types/capabilities.types.d.ts +12 -14
- package/dist/types/capabilities.types.d.ts.map +1 -1
- package/dist/types/capabilities.types.js +1 -2
- package/dist/types/capabilities.types.js.map +1 -1
- package/dist/types/decision.types.d.ts +57 -0
- package/dist/types/decision.types.d.ts.map +1 -0
- package/dist/types/decision.types.js +12 -0
- package/dist/types/decision.types.js.map +1 -0
- package/dist/types/edit.types.d.ts +73 -0
- package/dist/types/edit.types.d.ts.map +1 -0
- package/dist/types/edit.types.js +76 -0
- package/dist/types/edit.types.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +10 -5
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent flow model
|
|
3
|
+
*
|
|
4
|
+
* A consent flow is data: which blocks each step draws, in order, the
|
|
5
|
+
* connector's state in that step, and where focus lands, plus copy overrides.
|
|
6
|
+
* It is plain JSON (no functions), so Checkpoint can store a project's flow in
|
|
7
|
+
* its consent config, validate it (`flowSchema`), diff it against a preset,
|
|
8
|
+
* and have every server render exactly what was saved.
|
|
9
|
+
*
|
|
10
|
+
* This file holds the names and types only. It imports nothing but the
|
|
11
|
+
* package's own types, so the presets and the browser bundle carry no
|
|
12
|
+
* validator.
|
|
13
|
+
*
|
|
14
|
+
* @module flow/model
|
|
15
|
+
*/
|
|
16
|
+
/** The flow schema's version. A server declares which versions it renders. */
|
|
17
|
+
import type { AgentMetadata, ConsentScopeCapability } from "../types/capabilities.types.js";
|
|
18
|
+
import type { ConsentGrantDetails } from "../types/decision.types.js";
|
|
19
|
+
export declare const FLOW_SCHEMA_VERSION = 1;
|
|
20
|
+
/** The blocks a step can draw. A block name may carry a variant: "capability:locked". */
|
|
21
|
+
export declare const FLOW_BLOCKS: readonly ["eyebrow", "headline", "sub", "signIn", "finePrint", "approver", "capability", "details", "countdown", "actions", "status", "notice", "expiredNote", "receipt", "goBack", "retry"];
|
|
22
|
+
export type FlowBlock = (typeof FLOW_BLOCKS)[number];
|
|
23
|
+
/** The steps a flow can have. */
|
|
24
|
+
export declare const FLOW_STEPS: readonly ["sign-in", "consent", "passkey", "granted", "denied", "cancelled", "expired", "error"];
|
|
25
|
+
export type FlowStep = (typeof FLOW_STEPS)[number];
|
|
26
|
+
/**
|
|
27
|
+
* The connector's states; a step names the one it shows. With the wallet
|
|
28
|
+
* check in the connector: resting until the person acts (sign-in, consent),
|
|
29
|
+
* turning while the passkey is open, closed on its check once granted, open
|
|
30
|
+
* at the top when the passkey was dismissed (cancelled), and its error once
|
|
31
|
+
* nothing was granted (denied, expired, error).
|
|
32
|
+
*/
|
|
33
|
+
export declare const FLOW_CONNECTOR_STATES: readonly ["sign-in", "consent", "passkey", "cancelled", "granted", "denied", "expired", "error"];
|
|
34
|
+
export type FlowConnectorState = (typeof FLOW_CONNECTOR_STATES)[number];
|
|
35
|
+
/**
|
|
36
|
+
* How the person approves: `consent` submits on Allow, with no passkey step;
|
|
37
|
+
* `passkey` confirms with a passkey (created first by a first-time shopper).
|
|
38
|
+
*/
|
|
39
|
+
export declare const APPROVAL_METHODS: readonly ["consent", "passkey"];
|
|
40
|
+
export type ApprovalMethod = (typeof APPROVAL_METHODS)[number];
|
|
41
|
+
/**
|
|
42
|
+
* How much the flow moves between steps: `default`, `subtle` (shorter and
|
|
43
|
+
* smaller), or `none` (cross-fades only: the reduced-motion path).
|
|
44
|
+
*/
|
|
45
|
+
export declare const MOTION_PRESETS: readonly ["default", "subtle", "none"];
|
|
46
|
+
export type MotionPreset = (typeof MOTION_PRESETS)[number];
|
|
47
|
+
/** What sits in the connector's middle: the wallet check, or nothing (its shield). */
|
|
48
|
+
export declare const CONNECTOR_MARKS: readonly ["wallet-check", "none"];
|
|
49
|
+
export type ConnectorMark = (typeof CONNECTOR_MARKS)[number];
|
|
50
|
+
/** The motion primitives a flow plays, as its `consent-flow-motion` events name them. */
|
|
51
|
+
export declare const MOTION_PRIMITIVES: readonly ["leave", "arrive", "move", "cross-fade", "resize"];
|
|
52
|
+
export type MotionPrimitive = (typeof MOTION_PRIMITIVES)[number];
|
|
53
|
+
/** A copy override: a token's words, or a group of them. */
|
|
54
|
+
export type FlowCopy = {
|
|
55
|
+
[token: string]: string | FlowCopy;
|
|
56
|
+
};
|
|
57
|
+
export interface FlowStepDefinition {
|
|
58
|
+
/** The connector's state in this step. */
|
|
59
|
+
connector: FlowConnectorState;
|
|
60
|
+
/** The blocks, in order: a block name, or "name:variant". */
|
|
61
|
+
blocks: string[];
|
|
62
|
+
/** The block that takes focus when the person's own action lands here. */
|
|
63
|
+
focus?: FlowBlock;
|
|
64
|
+
}
|
|
65
|
+
export interface ConsentFlowDefinition {
|
|
66
|
+
version: typeof FLOW_SCHEMA_VERSION;
|
|
67
|
+
name: string;
|
|
68
|
+
approvalMethod: ApprovalMethod;
|
|
69
|
+
initial: FlowStep;
|
|
70
|
+
motion: MotionPreset;
|
|
71
|
+
connectorMark: ConnectorMark;
|
|
72
|
+
steps: Partial<Record<FlowStep, FlowStepDefinition>>;
|
|
73
|
+
/** Copy overrides for every request. */
|
|
74
|
+
copy: FlowCopy;
|
|
75
|
+
/** Copy overrides for a first-time shopper, who creates a passkey first. */
|
|
76
|
+
copyWhenCreatingPasskey: FlowCopy;
|
|
77
|
+
}
|
|
78
|
+
/** The events a flow sends, each as `consent-flow-<name>`, bubbling and composed. */
|
|
79
|
+
export declare const FLOW_EVENTS: readonly ["sign-in", "approve", "deny", "retry", "expire", "motion", "step"];
|
|
80
|
+
export type FlowEvent = (typeof FLOW_EVENTS)[number];
|
|
81
|
+
/** The agent: the package's agent metadata, with the DID optional (a flow never shows it). */
|
|
82
|
+
export type FlowAgent = Omit<AgentMetadata, "did"> & {
|
|
83
|
+
did?: string;
|
|
84
|
+
};
|
|
85
|
+
/** The merchant (the org the agent acts at): its name and, for "Connects to" and its tile, domain and logo. */
|
|
86
|
+
export interface FlowMerchant {
|
|
87
|
+
name: string;
|
|
88
|
+
domain?: string;
|
|
89
|
+
logoUrl?: string;
|
|
90
|
+
}
|
|
91
|
+
/** The person who approves, as their sign-in provider knows them. */
|
|
92
|
+
export interface FlowApprover {
|
|
93
|
+
/** Their name; initials stand in for a picture. */
|
|
94
|
+
name: string;
|
|
95
|
+
/** Their account, as the provider names it: an email or a handle. */
|
|
96
|
+
identifier?: string;
|
|
97
|
+
/** The provider's picture. Initials when absent or when it fails to load. */
|
|
98
|
+
avatarUrl?: string;
|
|
99
|
+
/** The sign-in provider: a built-in one (google, microsoft, apple, github, twitter, facebook) or `custom`. */
|
|
100
|
+
provider?: string;
|
|
101
|
+
/** The provider's name in the copy; a built-in provider's own name when left out. */
|
|
102
|
+
providerName?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* One thing the agent asks to do: the screen's capability, so one list feeds
|
|
106
|
+
* both. `defaultOn` decides the starting ticks; `receipt` is its line once
|
|
107
|
+
* granted ("Margherita, 2 a week").
|
|
108
|
+
*/
|
|
109
|
+
export type FlowCapability = ConsentScopeCapability & {
|
|
110
|
+
receipt?: string;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* The request a flow draws: who asks, for whom, at which merchant, for what.
|
|
114
|
+
* Host data, per request. The flow itself (steps, copy, motion) is the
|
|
115
|
+
* project's, saved in Checkpoint.
|
|
116
|
+
*
|
|
117
|
+
* Required in every step: `agent.name`, `merchant.name`, `verb`,
|
|
118
|
+
* `approver.name`, `capabilities`. The rest fills what a step draws when
|
|
119
|
+
* given and is left out when not: `approver.provider` (sign-in), the grant
|
|
120
|
+
* details (consent, passkey, cancelled), `requestExpiresAt` (the countdown),
|
|
121
|
+
* `grant` (granted).
|
|
122
|
+
*/
|
|
123
|
+
export interface ConsentFlowData {
|
|
124
|
+
agent: FlowAgent;
|
|
125
|
+
merchant: FlowMerchant;
|
|
126
|
+
/** What the agent wants to do there, as "{Agent} would like to {Verb} at {Merchant}": "order". */
|
|
127
|
+
verb: string;
|
|
128
|
+
approver: FlowApprover;
|
|
129
|
+
/** `create` for a first-time shopper, who makes a passkey (the flow's `copyWhenCreatingPasskey`). */
|
|
130
|
+
passkey?: "use" | "create";
|
|
131
|
+
capabilities: FlowCapability[];
|
|
132
|
+
/** The screen's "Permission details" rows. "Connects to" shows `merchant.name` over `resource`. */
|
|
133
|
+
grantDetails?: ConsentGrantDetails;
|
|
134
|
+
/** When the request lapses: epoch ms or ISO. Drives the countdown and the `expire` event. */
|
|
135
|
+
requestExpiresAt?: number | string;
|
|
136
|
+
/** What the server granted, for the granted step's receipt. */
|
|
137
|
+
grant?: {
|
|
138
|
+
/** The capability ids granted; the ones ticked at approve when left out. */
|
|
139
|
+
capabilities?: string[];
|
|
140
|
+
/** When it ends: epoch ms or ISO. Each receipt line reads "Until …" in the viewer's own time. */
|
|
141
|
+
endsAt?: number | string;
|
|
142
|
+
};
|
|
143
|
+
/** The editor's switches, as on the screen. */
|
|
144
|
+
hideRisk?: boolean;
|
|
145
|
+
hideScopes?: boolean;
|
|
146
|
+
}
|
|
147
|
+
/** What every flow event carries. */
|
|
148
|
+
export interface FlowEventDetail {
|
|
149
|
+
/** The step the flow was on. */
|
|
150
|
+
step: FlowStep;
|
|
151
|
+
/** True from a `preview` flow, which an editor draws: nothing real happens. */
|
|
152
|
+
preview: boolean;
|
|
153
|
+
}
|
|
154
|
+
export interface FlowSignInDetail extends FlowEventDetail {
|
|
155
|
+
provider: string;
|
|
156
|
+
/** `remembered`: "Continue as …"; `other`: "Use another account". */
|
|
157
|
+
account: "remembered" | "other";
|
|
158
|
+
}
|
|
159
|
+
export interface FlowApproveDetail extends FlowEventDetail {
|
|
160
|
+
/** The ids of the capabilities ticked. */
|
|
161
|
+
capabilities: string[];
|
|
162
|
+
/** Their scopes, flattened and deduplicated. */
|
|
163
|
+
scopes: string[];
|
|
164
|
+
approvalMethod: ApprovalMethod;
|
|
165
|
+
}
|
|
166
|
+
export interface FlowExpireDetail extends FlowEventDetail {
|
|
167
|
+
/** When the request lapsed, epoch ms. */
|
|
168
|
+
expiresAt: number;
|
|
169
|
+
}
|
|
170
|
+
export interface FlowMotionDetail extends FlowEventDetail {
|
|
171
|
+
primitive: MotionPrimitive;
|
|
172
|
+
/** The block that moved, or `card` for its resize. */
|
|
173
|
+
block: FlowBlock | "card";
|
|
174
|
+
}
|
|
175
|
+
export interface FlowStepDetail extends FlowEventDetail {
|
|
176
|
+
/** The step before; null on the first draw. */
|
|
177
|
+
from: FlowStep | null;
|
|
178
|
+
}
|
|
179
|
+
/** Each flow event's detail, by event name. */
|
|
180
|
+
export interface ConsentFlowEventMap {
|
|
181
|
+
"consent-flow-sign-in": CustomEvent<FlowSignInDetail>;
|
|
182
|
+
"consent-flow-approve": CustomEvent<FlowApproveDetail>;
|
|
183
|
+
"consent-flow-deny": CustomEvent<FlowEventDetail>;
|
|
184
|
+
"consent-flow-retry": CustomEvent<FlowEventDetail>;
|
|
185
|
+
"consent-flow-expire": CustomEvent<FlowExpireDetail>;
|
|
186
|
+
"consent-flow-motion": CustomEvent<FlowMotionDetail>;
|
|
187
|
+
"consent-flow-step": CustomEvent<FlowStepDetail>;
|
|
188
|
+
}
|
|
189
|
+
/** The attributes `<consent-flow>` stamps on itself, for a host or preview to read. */
|
|
190
|
+
export declare const FLOW_HOST_ATTRIBUTES: {
|
|
191
|
+
readonly version: "data-consent-version";
|
|
192
|
+
readonly approvalMethod: "data-approval-method";
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* The fields a page that renders these flows adds to the `renders` object of
|
|
196
|
+
* its /.well-known/kya-consent-page declaration. The declaration itself (its
|
|
197
|
+
* consentUrl, signIn, approve, element and the rest) is Checkpoint's schema;
|
|
198
|
+
* this package only says what it renders, so a server declares the version it
|
|
199
|
+
* actually ships rather than a hard-coded one.
|
|
200
|
+
*/
|
|
201
|
+
export interface ConsentFlowRenders {
|
|
202
|
+
/** The flow schema version the page renders. */
|
|
203
|
+
flow: number;
|
|
204
|
+
/** Whether the page honors the saved flow's approval method. */
|
|
205
|
+
approvalMethod: boolean;
|
|
206
|
+
}
|
|
207
|
+
/** `{ flow, approvalMethod }`, to spread into a declaration's `renders`. */
|
|
208
|
+
export declare function consentFlowRenders(): ConsentFlowRenders;
|
|
209
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/flow/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8EAA8E;AAC9E,OAAO,KAAK,E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cAAc,CAAC;CAChC;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,SAAS,EAAE,eAAe,CAAC;IAC3B,sDAAsD;IACtD,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,+CAA+C;IAC/C,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB;AAED,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC,sBAAsB,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACtD,sBAAsB,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACvD,mBAAmB,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IAClD,oBAAoB,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IACnD,qBAAqB,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACrD,qBAAqB,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACrD,mBAAmB,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,uFAAuF;AACvF,eAAO,MAAM,oBAAoB;;;CAGvB,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,IAAI,kBAAkB,CAEvD"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent flow model
|
|
3
|
+
*
|
|
4
|
+
* A consent flow is data: which blocks each step draws, in order, the
|
|
5
|
+
* connector's state in that step, and where focus lands, plus copy overrides.
|
|
6
|
+
* It is plain JSON (no functions), so Checkpoint can store a project's flow in
|
|
7
|
+
* its consent config, validate it (`flowSchema`), diff it against a preset,
|
|
8
|
+
* and have every server render exactly what was saved.
|
|
9
|
+
*
|
|
10
|
+
* This file holds the names and types only. It imports nothing but the
|
|
11
|
+
* package's own types, so the presets and the browser bundle carry no
|
|
12
|
+
* validator.
|
|
13
|
+
*
|
|
14
|
+
* @module flow/model
|
|
15
|
+
*/
|
|
16
|
+
export const FLOW_SCHEMA_VERSION = 1;
|
|
17
|
+
/** The blocks a step can draw. A block name may carry a variant: "capability:locked". */
|
|
18
|
+
export const FLOW_BLOCKS = [
|
|
19
|
+
"eyebrow",
|
|
20
|
+
"headline",
|
|
21
|
+
"sub",
|
|
22
|
+
"signIn",
|
|
23
|
+
"finePrint",
|
|
24
|
+
"approver",
|
|
25
|
+
"capability",
|
|
26
|
+
"details",
|
|
27
|
+
"countdown",
|
|
28
|
+
"actions",
|
|
29
|
+
"status",
|
|
30
|
+
"notice",
|
|
31
|
+
"expiredNote",
|
|
32
|
+
"receipt",
|
|
33
|
+
"goBack",
|
|
34
|
+
"retry",
|
|
35
|
+
];
|
|
36
|
+
/** The steps a flow can have. */
|
|
37
|
+
export const FLOW_STEPS = [
|
|
38
|
+
"sign-in",
|
|
39
|
+
"consent",
|
|
40
|
+
"passkey",
|
|
41
|
+
"granted",
|
|
42
|
+
"denied",
|
|
43
|
+
"cancelled",
|
|
44
|
+
"expired",
|
|
45
|
+
"error",
|
|
46
|
+
];
|
|
47
|
+
/**
|
|
48
|
+
* The connector's states; a step names the one it shows. With the wallet
|
|
49
|
+
* check in the connector: resting until the person acts (sign-in, consent),
|
|
50
|
+
* turning while the passkey is open, closed on its check once granted, open
|
|
51
|
+
* at the top when the passkey was dismissed (cancelled), and its error once
|
|
52
|
+
* nothing was granted (denied, expired, error).
|
|
53
|
+
*/
|
|
54
|
+
export const FLOW_CONNECTOR_STATES = [
|
|
55
|
+
"sign-in",
|
|
56
|
+
"consent",
|
|
57
|
+
"passkey",
|
|
58
|
+
"cancelled",
|
|
59
|
+
"granted",
|
|
60
|
+
"denied",
|
|
61
|
+
"expired",
|
|
62
|
+
"error",
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* How the person approves: `consent` submits on Allow, with no passkey step;
|
|
66
|
+
* `passkey` confirms with a passkey (created first by a first-time shopper).
|
|
67
|
+
*/
|
|
68
|
+
export const APPROVAL_METHODS = ["consent", "passkey"];
|
|
69
|
+
/**
|
|
70
|
+
* How much the flow moves between steps: `default`, `subtle` (shorter and
|
|
71
|
+
* smaller), or `none` (cross-fades only: the reduced-motion path).
|
|
72
|
+
*/
|
|
73
|
+
export const MOTION_PRESETS = ["default", "subtle", "none"];
|
|
74
|
+
/** What sits in the connector's middle: the wallet check, or nothing (its shield). */
|
|
75
|
+
export const CONNECTOR_MARKS = ["wallet-check", "none"];
|
|
76
|
+
/** The motion primitives a flow plays, as its `consent-flow-motion` events name them. */
|
|
77
|
+
export const MOTION_PRIMITIVES = [
|
|
78
|
+
"leave",
|
|
79
|
+
"arrive",
|
|
80
|
+
"move",
|
|
81
|
+
"cross-fade",
|
|
82
|
+
"resize",
|
|
83
|
+
];
|
|
84
|
+
/** The events a flow sends, each as `consent-flow-<name>`, bubbling and composed. */
|
|
85
|
+
export const FLOW_EVENTS = [
|
|
86
|
+
"sign-in",
|
|
87
|
+
"approve",
|
|
88
|
+
"deny",
|
|
89
|
+
"retry",
|
|
90
|
+
"expire",
|
|
91
|
+
"motion",
|
|
92
|
+
"step",
|
|
93
|
+
];
|
|
94
|
+
/** The attributes `<consent-flow>` stamps on itself, for a host or preview to read. */
|
|
95
|
+
export const FLOW_HOST_ATTRIBUTES = {
|
|
96
|
+
version: "data-consent-version",
|
|
97
|
+
approvalMethod: "data-approval-method",
|
|
98
|
+
};
|
|
99
|
+
/** `{ flow, approvalMethod }`, to spread into a declaration's `renders`. */
|
|
100
|
+
export function consentFlowRenders() {
|
|
101
|
+
return { flow: FLOW_SCHEMA_VERSION, approvalMethod: true };
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/flow/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,yFAAyF;AACzF,MAAM,CAAC,MAAM,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;AACjC,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,QAAQ;IACR,WAAW;IACX,SAAS;IACT,OAAO;CACC,CAAC;AAGX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS;IACT,SAAS;IACT,SAAS;IACT,WAAW;IACX,SAAS;IACT,QAAQ;IACR,SAAS;IACT,OAAO;CACC,CAAC;AAGX;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,SAAS,CAAU,CAAC;AAGhE;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAGrE,sFAAsF;AACtF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,cAAc,EAAE,MAAM,CAAU,CAAC;AAGjE,yFAAyF;AACzF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO;IACP,QAAQ;IACR,MAAM;IACN,YAAY;IACZ,QAAQ;CACA,CAAC;AA6BX,qFAAqF;AACrF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,SAAS;IACT,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,MAAM;CACE,CAAC;AAuHX,uFAAuF;AACvF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE,sBAAsB;IAC/B,cAAc,EAAE,sBAAsB;CAC9B,CAAC;AAgBX,4EAA4E;AAC5E,MAAM,UAAU,kBAAkB;IAChC,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent flow presets
|
|
3
|
+
*
|
|
4
|
+
* The flows Checkpoint offers as templates, as plain JSON. A project's saved
|
|
5
|
+
* flow is one of these, or one of these with its edits; Checkpoint diffs the
|
|
6
|
+
* two. The editor's Approval method switch picks between the `passkey` and
|
|
7
|
+
* `consent` presets (`flowPreset`).
|
|
8
|
+
*
|
|
9
|
+
* @module flow/presets
|
|
10
|
+
*/
|
|
11
|
+
import { type ApprovalMethod, type ConsentFlowDefinition } from "./model.js";
|
|
12
|
+
/** Sign in with the merchant's provider, then approve with a passkey (kya-os-mcp, Liminal). */
|
|
13
|
+
export declare const SIGN_IN_FLOW: ConsentFlowDefinition;
|
|
14
|
+
/** Already signed in; approve with a passkey (Hobbsidian's /c). */
|
|
15
|
+
export declare const DECISION_FLOW: ConsentFlowDefinition;
|
|
16
|
+
/** Sign in, then Allow submits. */
|
|
17
|
+
export declare const SIGN_IN_CONSENT_FLOW: ConsentFlowDefinition;
|
|
18
|
+
/** Already signed in; Allow submits. */
|
|
19
|
+
export declare const DECISION_CONSENT_FLOW: ConsentFlowDefinition;
|
|
20
|
+
/** Every preset, by approval method and whether the flow signs the person in. */
|
|
21
|
+
export declare const FLOW_PRESETS: Record<ApprovalMethod, {
|
|
22
|
+
signIn: ConsentFlowDefinition;
|
|
23
|
+
decision: ConsentFlowDefinition;
|
|
24
|
+
}>;
|
|
25
|
+
/** The preset for an approval method: what the editor's Approval method switch picks. */
|
|
26
|
+
export declare function flowPreset(approvalMethod: ApprovalMethod, { signIn }?: {
|
|
27
|
+
signIn?: boolean;
|
|
28
|
+
}): ConsentFlowDefinition;
|
|
29
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/flow/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAG3B,MAAM,YAAY,CAAC;AA2IpB,+FAA+F;AAC/F,eAAO,MAAM,YAAY,uBAAqD,CAAC;AAC/E,mEAAmE;AACnE,eAAO,MAAM,aAAa,uBAA6C,CAAC;AACxE,mCAAmC;AACnC,eAAO,MAAM,oBAAoB,uBAA4C,CAAC;AAC9E,wCAAwC;AACxC,eAAO,MAAM,qBAAqB,uBAAoC,CAAC;AAEvE,iFAAiF;AACjF,eAAO,MAAM,YAAY,EAAE,MAAM,CAC/B,cAAc,EACd;IAAE,MAAM,EAAE,qBAAqB,CAAC;IAAC,QAAQ,EAAE,qBAAqB,CAAA;CAAE,CAInE,CAAC;AAEF,yFAAyF;AACzF,wBAAgB,UAAU,CACxB,cAAc,EAAE,cAAc,EAC9B,EAAE,MAAc,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,qBAAqB,CAEvB"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent flow presets
|
|
3
|
+
*
|
|
4
|
+
* The flows Checkpoint offers as templates, as plain JSON. A project's saved
|
|
5
|
+
* flow is one of these, or one of these with its edits; Checkpoint diffs the
|
|
6
|
+
* two. The editor's Approval method switch picks between the `passkey` and
|
|
7
|
+
* `consent` presets (`flowPreset`).
|
|
8
|
+
*
|
|
9
|
+
* @module flow/presets
|
|
10
|
+
*/
|
|
11
|
+
import { FLOW_SCHEMA_VERSION, } from "./model.js";
|
|
12
|
+
const CONSENT_BLOCKS = [
|
|
13
|
+
"eyebrow",
|
|
14
|
+
"headline",
|
|
15
|
+
"approver",
|
|
16
|
+
"capability",
|
|
17
|
+
"details",
|
|
18
|
+
"countdown",
|
|
19
|
+
"actions",
|
|
20
|
+
];
|
|
21
|
+
const SIGN_IN_STEP = {
|
|
22
|
+
connector: "sign-in",
|
|
23
|
+
blocks: ["eyebrow", "headline", "signIn", "finePrint"],
|
|
24
|
+
focus: "headline",
|
|
25
|
+
};
|
|
26
|
+
/** The steps both approval methods share. */
|
|
27
|
+
const OUTCOMES = {
|
|
28
|
+
granted: {
|
|
29
|
+
connector: "granted",
|
|
30
|
+
blocks: [
|
|
31
|
+
"eyebrow",
|
|
32
|
+
"headline",
|
|
33
|
+
"approver:granted",
|
|
34
|
+
"sub",
|
|
35
|
+
"receipt",
|
|
36
|
+
"goBack",
|
|
37
|
+
],
|
|
38
|
+
focus: "headline",
|
|
39
|
+
},
|
|
40
|
+
denied: {
|
|
41
|
+
connector: "denied",
|
|
42
|
+
blocks: ["eyebrow", "headline", "sub", "approver:denied"],
|
|
43
|
+
focus: "headline",
|
|
44
|
+
},
|
|
45
|
+
expired: {
|
|
46
|
+
connector: "expired",
|
|
47
|
+
blocks: [
|
|
48
|
+
"eyebrow",
|
|
49
|
+
"headline",
|
|
50
|
+
"approver",
|
|
51
|
+
"capability:dim",
|
|
52
|
+
"expiredNote",
|
|
53
|
+
],
|
|
54
|
+
focus: "headline",
|
|
55
|
+
},
|
|
56
|
+
error: {
|
|
57
|
+
connector: "error",
|
|
58
|
+
blocks: ["eyebrow", "headline", "sub", "approver", "retry"],
|
|
59
|
+
focus: "headline",
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
/** Approve opens the passkey; dismissing it comes back to consent with a notice. */
|
|
63
|
+
const PASSKEY_STEPS = {
|
|
64
|
+
consent: { connector: "consent", blocks: CONSENT_BLOCKS, focus: "headline" },
|
|
65
|
+
passkey: {
|
|
66
|
+
connector: "passkey",
|
|
67
|
+
blocks: [
|
|
68
|
+
"eyebrow",
|
|
69
|
+
"headline",
|
|
70
|
+
"approver",
|
|
71
|
+
"capability:locked",
|
|
72
|
+
"details",
|
|
73
|
+
"countdown",
|
|
74
|
+
"actions:loading",
|
|
75
|
+
"status",
|
|
76
|
+
],
|
|
77
|
+
focus: "status",
|
|
78
|
+
},
|
|
79
|
+
cancelled: {
|
|
80
|
+
connector: "cancelled",
|
|
81
|
+
blocks: [...CONSENT_BLOCKS, "notice"],
|
|
82
|
+
focus: "notice",
|
|
83
|
+
},
|
|
84
|
+
...OUTCOMES,
|
|
85
|
+
};
|
|
86
|
+
/** Allow submits: no passkey step, so nothing to cancel. */
|
|
87
|
+
const CONSENT_STEPS = {
|
|
88
|
+
consent: { connector: "consent", blocks: CONSENT_BLOCKS, focus: "headline" },
|
|
89
|
+
...OUTCOMES,
|
|
90
|
+
};
|
|
91
|
+
/** A first-time shopper creates a passkey rather than using one. */
|
|
92
|
+
const CREATE_PASSKEY_COPY = {
|
|
93
|
+
actions: { approve: "Create a passkey and approve" },
|
|
94
|
+
status: "Create your passkey…",
|
|
95
|
+
seal: {
|
|
96
|
+
consent: "Ready to create a passkey",
|
|
97
|
+
passkey: "Creating your passkey",
|
|
98
|
+
},
|
|
99
|
+
approver: { confirmed: "Confirmed with your new passkey" },
|
|
100
|
+
announce: { passkey: "Create your passkey." },
|
|
101
|
+
};
|
|
102
|
+
const CONSENT_COPY = {
|
|
103
|
+
actions: { approve: "Allow" },
|
|
104
|
+
approver: { confirmed: "Approved" },
|
|
105
|
+
seal: { consent: "Waiting for your approval", granted: "Approved" },
|
|
106
|
+
};
|
|
107
|
+
/** A frozen copy, so no preset shares or changes another's tables. */
|
|
108
|
+
function frozen(value) {
|
|
109
|
+
const copy = JSON.parse(JSON.stringify(value));
|
|
110
|
+
const freeze = (node) => {
|
|
111
|
+
if (node && typeof node === "object") {
|
|
112
|
+
Object.freeze(node);
|
|
113
|
+
Object.values(node).forEach(freeze);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
freeze(copy);
|
|
117
|
+
return copy;
|
|
118
|
+
}
|
|
119
|
+
function flow(name, approvalMethod, signIn) {
|
|
120
|
+
const passkey = approvalMethod === "passkey";
|
|
121
|
+
return frozen({
|
|
122
|
+
version: FLOW_SCHEMA_VERSION,
|
|
123
|
+
name,
|
|
124
|
+
approvalMethod,
|
|
125
|
+
initial: signIn ? "sign-in" : "consent",
|
|
126
|
+
motion: "default",
|
|
127
|
+
connectorMark: "wallet-check",
|
|
128
|
+
steps: {
|
|
129
|
+
...(signIn ? { "sign-in": SIGN_IN_STEP } : {}),
|
|
130
|
+
...(passkey ? PASSKEY_STEPS : CONSENT_STEPS),
|
|
131
|
+
},
|
|
132
|
+
copy: passkey ? {} : CONSENT_COPY,
|
|
133
|
+
copyWhenCreatingPasskey: passkey ? CREATE_PASSKEY_COPY : {},
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/** Sign in with the merchant's provider, then approve with a passkey (kya-os-mcp, Liminal). */
|
|
137
|
+
export const SIGN_IN_FLOW = flow("Sign in, consent, passkey", "passkey", true);
|
|
138
|
+
/** Already signed in; approve with a passkey (Hobbsidian's /c). */
|
|
139
|
+
export const DECISION_FLOW = flow("Consent, passkey", "passkey", false);
|
|
140
|
+
/** Sign in, then Allow submits. */
|
|
141
|
+
export const SIGN_IN_CONSENT_FLOW = flow("Sign in, consent", "consent", true);
|
|
142
|
+
/** Already signed in; Allow submits. */
|
|
143
|
+
export const DECISION_CONSENT_FLOW = flow("Consent", "consent", false);
|
|
144
|
+
/** Every preset, by approval method and whether the flow signs the person in. */
|
|
145
|
+
export const FLOW_PRESETS = {
|
|
146
|
+
passkey: { signIn: SIGN_IN_FLOW, decision: DECISION_FLOW },
|
|
147
|
+
consent: { signIn: SIGN_IN_CONSENT_FLOW, decision: DECISION_CONSENT_FLOW },
|
|
148
|
+
};
|
|
149
|
+
/** The preset for an approval method: what the editor's Approval method switch picks. */
|
|
150
|
+
export function flowPreset(approvalMethod, { signIn = false } = {}) {
|
|
151
|
+
return FLOW_PRESETS[approvalMethod][signIn ? "signIn" : "decision"];
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/flow/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,mBAAmB,GAKpB,MAAM,YAAY,CAAC;AAEpB,MAAM,cAAc,GAAG;IACrB,SAAS;IACT,UAAU;IACV,UAAU;IACV,YAAY;IACZ,SAAS;IACT,WAAW;IACX,SAAS;CACV,CAAC;AAEF,MAAM,YAAY,GAAuB;IACvC,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAC;IACtD,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,6CAA6C;AAC7C,MAAM,QAAQ,GAAkD;IAC9D,OAAO,EAAE;QACP,SAAS,EAAE,SAAS;QACpB,MAAM,EAAE;YACN,SAAS;YACT,UAAU;YACV,kBAAkB;YAClB,KAAK;YACL,SAAS;YACT,QAAQ;SACT;QACD,KAAK,EAAE,UAAU;KAClB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,iBAAiB,CAAC;QACzD,KAAK,EAAE,UAAU;KAClB;IACD,OAAO,EAAE;QACP,SAAS,EAAE,SAAS;QACpB,MAAM,EAAE;YACN,SAAS;YACT,UAAU;YACV,UAAU;YACV,gBAAgB;YAChB,aAAa;SACd;QACD,KAAK,EAAE,UAAU;KAClB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,OAAO;QAClB,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC;QAC3D,KAAK,EAAE,UAAU;KAClB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AAmE;AACnE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AACxE,mCAAmC;AACnC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAC9E,wCAAwC;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AAEvE,iFAAiF;AACjF,MAAM,CAAC,MAAM,YAAY,GAGrB;IACF,OAAO,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE;IAC1D,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,QAAQ,EAAE,qBAAqB,EAAE;CAC3E,CAAC;AAEF,yFAAyF;AACzF,MAAM,UAAU,UAAU,CACxB,cAA8B,EAC9B,EAAE,MAAM,GAAG,KAAK,KAA2B,EAAE;IAE7C,OAAO,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent flow schema
|
|
3
|
+
*
|
|
4
|
+
* What Checkpoint validates a project's saved flow with before it stores it,
|
|
5
|
+
* and what a server checks before it renders one. Strict: an unknown key, an
|
|
6
|
+
* unknown block or step, a focus on a block the step doesn't draw, or a step
|
|
7
|
+
* the approval method has no use for is an error, so what was saved is what
|
|
8
|
+
* every server renders.
|
|
9
|
+
*
|
|
10
|
+
* @module flow/schema
|
|
11
|
+
*/
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import { type ConsentFlowDefinition, type FlowCopy } from "./model.js";
|
|
14
|
+
/** "name" or "name:variant", with a known block name. */
|
|
15
|
+
export declare const flowBlockRefSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
16
|
+
export declare const flowCopySchema: z.ZodType<FlowCopy>;
|
|
17
|
+
export declare const flowStepSchema: z.ZodEffects<z.ZodObject<{
|
|
18
|
+
connector: z.ZodEnum<["sign-in", "consent", "passkey", "cancelled", "granted", "denied", "expired", "error"]>;
|
|
19
|
+
blocks: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
20
|
+
focus: z.ZodOptional<z.ZodEnum<["eyebrow", "headline", "sub", "signIn", "finePrint", "approver", "capability", "details", "countdown", "actions", "status", "notice", "expiredNote", "receipt", "goBack", "retry"]>>;
|
|
21
|
+
}, "strict", z.ZodTypeAny, {
|
|
22
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
23
|
+
blocks: string[];
|
|
24
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
27
|
+
blocks: string[];
|
|
28
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
31
|
+
blocks: string[];
|
|
32
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
35
|
+
blocks: string[];
|
|
36
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const flowSchema: z.ZodEffects<z.ZodObject<{
|
|
39
|
+
version: z.ZodLiteral<1>;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
approvalMethod: z.ZodEnum<["consent", "passkey"]>;
|
|
42
|
+
initial: z.ZodEnum<["sign-in", "consent", "passkey", "granted", "denied", "cancelled", "expired", "error"]>;
|
|
43
|
+
motion: z.ZodDefault<z.ZodEnum<["default", "subtle", "none"]>>;
|
|
44
|
+
connectorMark: z.ZodDefault<z.ZodEnum<["wallet-check", "none"]>>;
|
|
45
|
+
steps: z.ZodRecord<z.ZodEnum<["sign-in", "consent", "passkey", "granted", "denied", "cancelled", "expired", "error"]>, z.ZodEffects<z.ZodObject<{
|
|
46
|
+
connector: z.ZodEnum<["sign-in", "consent", "passkey", "cancelled", "granted", "denied", "expired", "error"]>;
|
|
47
|
+
blocks: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
48
|
+
focus: z.ZodOptional<z.ZodEnum<["eyebrow", "headline", "sub", "signIn", "finePrint", "approver", "capability", "details", "countdown", "actions", "status", "notice", "expiredNote", "receipt", "goBack", "retry"]>>;
|
|
49
|
+
}, "strict", z.ZodTypeAny, {
|
|
50
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
51
|
+
blocks: string[];
|
|
52
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
55
|
+
blocks: string[];
|
|
56
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
57
|
+
}>, {
|
|
58
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
59
|
+
blocks: string[];
|
|
60
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
63
|
+
blocks: string[];
|
|
64
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
65
|
+
}>>;
|
|
66
|
+
copy: z.ZodDefault<z.ZodType<FlowCopy, z.ZodTypeDef, FlowCopy>>;
|
|
67
|
+
copyWhenCreatingPasskey: z.ZodDefault<z.ZodType<FlowCopy, z.ZodTypeDef, FlowCopy>>;
|
|
68
|
+
}, "strict", z.ZodTypeAny, {
|
|
69
|
+
name: string;
|
|
70
|
+
version: 1;
|
|
71
|
+
copy: FlowCopy;
|
|
72
|
+
motion: "none" | "default" | "subtle";
|
|
73
|
+
steps: Partial<Record<"passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired", {
|
|
74
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
75
|
+
blocks: string[];
|
|
76
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
77
|
+
}>>;
|
|
78
|
+
approvalMethod: "passkey" | "consent";
|
|
79
|
+
initial: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
80
|
+
connectorMark: "none" | "wallet-check";
|
|
81
|
+
copyWhenCreatingPasskey: FlowCopy;
|
|
82
|
+
}, {
|
|
83
|
+
name: string;
|
|
84
|
+
version: 1;
|
|
85
|
+
steps: Partial<Record<"passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired", {
|
|
86
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
87
|
+
blocks: string[];
|
|
88
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
89
|
+
}>>;
|
|
90
|
+
approvalMethod: "passkey" | "consent";
|
|
91
|
+
initial: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
92
|
+
copy?: FlowCopy | undefined;
|
|
93
|
+
motion?: "none" | "default" | "subtle" | undefined;
|
|
94
|
+
connectorMark?: "none" | "wallet-check" | undefined;
|
|
95
|
+
copyWhenCreatingPasskey?: FlowCopy | undefined;
|
|
96
|
+
}>, {
|
|
97
|
+
name: string;
|
|
98
|
+
version: 1;
|
|
99
|
+
copy: FlowCopy;
|
|
100
|
+
motion: "none" | "default" | "subtle";
|
|
101
|
+
steps: Partial<Record<"passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired", {
|
|
102
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
103
|
+
blocks: string[];
|
|
104
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
105
|
+
}>>;
|
|
106
|
+
approvalMethod: "passkey" | "consent";
|
|
107
|
+
initial: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
108
|
+
connectorMark: "none" | "wallet-check";
|
|
109
|
+
copyWhenCreatingPasskey: FlowCopy;
|
|
110
|
+
}, {
|
|
111
|
+
name: string;
|
|
112
|
+
version: 1;
|
|
113
|
+
steps: Partial<Record<"passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired", {
|
|
114
|
+
connector: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
115
|
+
blocks: string[];
|
|
116
|
+
focus?: "headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "countdown" | "actions" | "expiredNote" | "receipt" | "goBack" | "retry" | undefined;
|
|
117
|
+
}>>;
|
|
118
|
+
approvalMethod: "passkey" | "consent";
|
|
119
|
+
initial: "passkey" | "error" | "sign-in" | "consent" | "granted" | "denied" | "cancelled" | "expired";
|
|
120
|
+
copy?: FlowCopy | undefined;
|
|
121
|
+
motion?: "none" | "default" | "subtle" | undefined;
|
|
122
|
+
connectorMark?: "none" | "wallet-check" | undefined;
|
|
123
|
+
copyWhenCreatingPasskey?: FlowCopy | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
/** A saved flow, checked; throws with every problem found. Defaults filled in. */
|
|
126
|
+
export declare function parseConsentFlow(input: unknown): ConsentFlowDefinition;
|
|
127
|
+
//# sourceMappingURL=schema.d.ts.map
|