@kya-os/consent 0.5.1 → 0.5.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 +5 -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/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/components/consent-action-bar.js +4 -0
- package/dist/cjs/components/consent-action-bar.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-connector-header.js +1 -0
- package/dist/cjs/components/consent-connector-header.js.map +1 -1
- package/dist/cjs/components/consent-flow.js +392 -10
- package/dist/cjs/components/consent-flow.js.map +1 -1
- package/dist/cjs/components/consent-wallet-orb.js +6 -1
- package/dist/cjs/components/consent-wallet-orb.js.map +1 -1
- package/dist/cjs/components/flow-blocks.js +162 -35
- package/dist/cjs/components/flow-blocks.js.map +1 -1
- package/dist/cjs/flow/copy.js +15 -0
- package/dist/cjs/flow/copy.js.map +1 -1
- package/dist/cjs/flow/index.js +5 -2
- package/dist/cjs/flow/index.js.map +1 -1
- package/dist/cjs/flow/model.js +46 -1
- package/dist/cjs/flow/model.js.map +1 -1
- package/dist/cjs/flow/page.js +282 -0
- package/dist/cjs/flow/page.js.map +1 -0
- package/dist/cjs/flow/presets.js +4 -0
- package/dist/cjs/flow/presets.js.map +1 -1
- package/dist/cjs/flow/schema.js +1 -0
- package/dist/cjs/flow/schema.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 +1 -0
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/styles/brand.js +135 -38
- package/dist/cjs/styles/brand.js.map +1 -1
- package/dist/cjs/styles/theme.js +29 -3
- package/dist/cjs/styles/theme.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts.map +1 -1
- package/dist/components/consent-action-bar.js +4 -0
- package/dist/components/consent-action-bar.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +1 -1
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-connector-header.d.ts.map +1 -1
- package/dist/components/consent-connector-header.js +1 -0
- package/dist/components/consent-connector-header.js.map +1 -1
- package/dist/components/consent-flow.d.ts +56 -2
- package/dist/components/consent-flow.d.ts.map +1 -1
- package/dist/components/consent-flow.js +394 -12
- package/dist/components/consent-flow.js.map +1 -1
- package/dist/components/consent-wallet-orb.d.ts +4 -0
- package/dist/components/consent-wallet-orb.d.ts.map +1 -1
- package/dist/components/consent-wallet-orb.js +6 -1
- package/dist/components/consent-wallet-orb.js.map +1 -1
- package/dist/components/flow-blocks.d.ts +10 -1
- package/dist/components/flow-blocks.d.ts.map +1 -1
- package/dist/components/flow-blocks.js +162 -36
- package/dist/components/flow-blocks.js.map +1 -1
- package/dist/consent.js +853 -270
- package/dist/consent.min.js +634 -397
- package/dist/flow/copy.d.ts +2 -0
- package/dist/flow/copy.d.ts.map +1 -1
- package/dist/flow/copy.js +14 -0
- package/dist/flow/copy.js.map +1 -1
- package/dist/flow/index.d.ts +5 -2
- package/dist/flow/index.d.ts.map +1 -1
- package/dist/flow/index.js +5 -2
- package/dist/flow/index.js.map +1 -1
- package/dist/flow/model.d.ts +53 -2
- package/dist/flow/model.d.ts.map +1 -1
- package/dist/flow/model.js +45 -0
- package/dist/flow/model.js.map +1 -1
- package/dist/flow/page.d.ts +110 -0
- package/dist/flow/page.d.ts.map +1 -0
- package/dist/flow/page.js +276 -0
- package/dist/flow/page.js.map +1 -0
- package/dist/flow/presets.d.ts.map +1 -1
- package/dist/flow/presets.js +4 -0
- package/dist/flow/presets.js.map +1 -1
- package/dist/flow/schema.d.ts +19 -14
- package/dist/flow/schema.d.ts.map +1 -1
- package/dist/flow/schema.js +1 -0
- package/dist/flow/schema.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 +2 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/styles/brand.d.ts +53 -18
- package/dist/styles/brand.d.ts.map +1 -1
- package/dist/styles/brand.js +136 -39
- package/dist/styles/brand.js.map +1 -1
- package/dist/styles/theme.d.ts +10 -1
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +28 -2
- package/dist/styles/theme.js.map +1 -1
- package/package.json +1 -1
package/dist/flow/copy.d.ts
CHANGED
|
@@ -28,4 +28,6 @@ export declare function splitTemplate(template: string): {
|
|
|
28
28
|
export declare function fillTemplate(template: string, values: Record<string, string | undefined>): string;
|
|
29
29
|
/** "Dylan Hobbs" is DH, "Alice" is A; with no name, the identifier's first letter; else "?". */
|
|
30
30
|
export declare function initialsOf(name?: string, identifier?: string): string;
|
|
31
|
+
/** An https URL as written, or undefined: a javascript:, data: or http: link is never drawn. */
|
|
32
|
+
export declare function httpsUrl(value: unknown): string | undefined;
|
|
31
33
|
//# sourceMappingURL=copy.d.ts.map
|
package/dist/flow/copy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../src/flow/copy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../src/flow/copy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,SAAS,EAAE,QAoFvB,CAAC;AAKF,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,GAAG,MAAM,EAAE,CAAC,QAAQ,GAAG,SAAS,CAAC,EAAE,GAAG,QAAQ,CAUtE;AAED,oFAAoF;AACpF,wBAAgB,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAMxE;AAED,wEAAwE;AACxE,wBAAgB,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQzE;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,GACf;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,CAKpC;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACzC,MAAM,CAIR;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,IAAI,SAAK,EAAE,UAAU,SAAK,GAAG,MAAM,CAW7D;AAED,gGAAgG;AAChG,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQ3D"}
|
package/dist/flow/copy.js
CHANGED
|
@@ -67,6 +67,8 @@ export const FLOW_COPY = {
|
|
|
67
67
|
receipt: { until: "Until {When}" },
|
|
68
68
|
goBack: "Go back to {Agent} and tell it to continue. Revoke anytime under Connected agents at {Merchant}.",
|
|
69
69
|
retry: "Try again",
|
|
70
|
+
terms: { agree: "I agree to the {Terms}" },
|
|
71
|
+
legal: { label: "Legal" },
|
|
70
72
|
announce: {
|
|
71
73
|
"sign-in": "Sign in to continue.",
|
|
72
74
|
consent: "Review what {Agent} is asking for.",
|
|
@@ -134,4 +136,16 @@ export function initialsOf(name = "", identifier = "") {
|
|
|
134
136
|
return first(words[0]).toUpperCase();
|
|
135
137
|
return (first(identifier) || "?").toUpperCase();
|
|
136
138
|
}
|
|
139
|
+
/** An https URL as written, or undefined: a javascript:, data: or http: link is never drawn. */
|
|
140
|
+
export function httpsUrl(value) {
|
|
141
|
+
const raw = typeof value === "string" ? value.trim() : "";
|
|
142
|
+
if (!raw)
|
|
143
|
+
return undefined;
|
|
144
|
+
try {
|
|
145
|
+
return new URL(raw).protocol === "https:" ? raw : undefined;
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
137
151
|
//# sourceMappingURL=copy.js.map
|
package/dist/flow/copy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../src/flow/copy.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,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,EAAE,+CAA+C;QACxD,MAAM,EAAE,qDAAqD;QAC7D,KAAK,EAAE,gEAAgE;KACxE;IACD,MAAM,EAAE;QACN,UAAU,EAAE,qBAAqB;QACjC,KAAK,EAAE,0CAA0C;QACjD,SAAS,EACP,qGAAqG;KACxG;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,qBAAqB;QAC5B,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,cAAc;QAC3B,KAAK,EAAE,gBAAgB;QACvB,YAAY,EAAE,q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3B,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/dist/flow/index.d.ts
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A consent flow as data: the model (names, types, the schema version), the
|
|
5
5
|
* schema Checkpoint validates a saved flow with, the presets it offers as
|
|
6
|
-
* templates,
|
|
7
|
-
*
|
|
6
|
+
* templates, the default copy with its helpers, and the one mapping from a
|
|
7
|
+
* project's consent config to the page (`consentPageFromConfig`). The
|
|
8
|
+
* browser bundle carries the model, the presets and the copy, not the schema
|
|
9
|
+
* or the mapping.
|
|
8
10
|
*
|
|
9
11
|
* @module @kya-os/consent/flow
|
|
10
12
|
*/
|
|
@@ -12,4 +14,5 @@ export * from "./model.js";
|
|
|
12
14
|
export * from "./presets.js";
|
|
13
15
|
export * from "./copy.js";
|
|
14
16
|
export * from "./schema.js";
|
|
17
|
+
export * from "./page.js";
|
|
15
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/flow/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/flow/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/flow/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
package/dist/flow/index.js
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A consent flow as data: the model (names, types, the schema version), the
|
|
5
5
|
* schema Checkpoint validates a saved flow with, the presets it offers as
|
|
6
|
-
* templates,
|
|
7
|
-
*
|
|
6
|
+
* templates, the default copy with its helpers, and the one mapping from a
|
|
7
|
+
* project's consent config to the page (`consentPageFromConfig`). The
|
|
8
|
+
* browser bundle carries the model, the presets and the copy, not the schema
|
|
9
|
+
* or the mapping.
|
|
8
10
|
*
|
|
9
11
|
* @module @kya-os/consent/flow
|
|
10
12
|
*/
|
|
@@ -12,4 +14,5 @@ export * from "./model.js";
|
|
|
12
14
|
export * from "./presets.js";
|
|
13
15
|
export * from "./copy.js";
|
|
14
16
|
export * from "./schema.js";
|
|
17
|
+
export * from "./page.js";
|
|
15
18
|
//# sourceMappingURL=index.js.map
|
package/dist/flow/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/flow/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/flow/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
package/dist/flow/model.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { AgentMetadata, ConsentScopeCapability } from "../types/capabilitie
|
|
|
18
18
|
import type { ConsentGrantDetails } from "../types/decision.types.js";
|
|
19
19
|
export declare const FLOW_SCHEMA_VERSION = 1;
|
|
20
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"];
|
|
21
|
+
export declare const FLOW_BLOCKS: readonly ["eyebrow", "headline", "sub", "signIn", "finePrint", "approver", "capability", "details", "infoNote", "countdown", "actions", "status", "notice", "expiredNote", "receipt", "goBack", "retry"];
|
|
22
22
|
export type FlowBlock = (typeof FLOW_BLOCKS)[number];
|
|
23
23
|
/** The steps a flow can have. */
|
|
24
24
|
export declare const FLOW_STEPS: readonly ["sign-in", "consent", "passkey", "granted", "denied", "cancelled", "expired", "error"];
|
|
@@ -74,9 +74,16 @@ export interface ConsentFlowDefinition {
|
|
|
74
74
|
copy: FlowCopy;
|
|
75
75
|
/** Copy overrides for a first-time shopper, who creates a passkey first. */
|
|
76
76
|
copyWhenCreatingPasskey: FlowCopy;
|
|
77
|
+
/**
|
|
78
|
+
* The flow chose its own steps. Without it a saved flow is its choices
|
|
79
|
+
* (approval method, sign-in, motion, connector mark, copy) over today's
|
|
80
|
+
* preset, so a package release reaches every saved flow
|
|
81
|
+
* (`consentFlowFromSaved`).
|
|
82
|
+
*/
|
|
83
|
+
custom?: boolean;
|
|
77
84
|
}
|
|
78
85
|
/** 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"];
|
|
86
|
+
export declare const FLOW_EVENTS: readonly ["sign-in", "approve", "deny", "retry", "expire", "motion", "step", "field"];
|
|
80
87
|
export type FlowEvent = (typeof FLOW_EVENTS)[number];
|
|
81
88
|
/** The agent: the package's agent metadata, with the DID optional (a flow never shows it). */
|
|
82
89
|
export type FlowAgent = Omit<AgentMetadata, "did"> & {
|
|
@@ -162,6 +169,10 @@ export interface FlowApproveDetail extends FlowEventDetail {
|
|
|
162
169
|
/** Their scopes, flattened and deduplicated. */
|
|
163
170
|
scopes: string[];
|
|
164
171
|
approvalMethod: ApprovalMethod;
|
|
172
|
+
/** With terms to accept: always true, since Allow waits for the box. Absent without terms. */
|
|
173
|
+
termsAccepted?: true;
|
|
174
|
+
/** The accepted terms' version, when they have one. */
|
|
175
|
+
termsVersion?: string;
|
|
165
176
|
}
|
|
166
177
|
export interface FlowExpireDetail extends FlowEventDetail {
|
|
167
178
|
/** When the request lapsed, epoch ms. */
|
|
@@ -176,6 +187,10 @@ export interface FlowStepDetail extends FlowEventDetail {
|
|
|
176
187
|
/** The step before; null on the first draw. */
|
|
177
188
|
from: FlowStep | null;
|
|
178
189
|
}
|
|
190
|
+
/** From a preview only: the region the person clicked, for an editor to focus its field. */
|
|
191
|
+
export interface FlowFieldDetail extends FlowEventDetail {
|
|
192
|
+
field: FlowField;
|
|
193
|
+
}
|
|
179
194
|
/** Each flow event's detail, by event name. */
|
|
180
195
|
export interface ConsentFlowEventMap {
|
|
181
196
|
"consent-flow-sign-in": CustomEvent<FlowSignInDetail>;
|
|
@@ -185,7 +200,43 @@ export interface ConsentFlowEventMap {
|
|
|
185
200
|
"consent-flow-expire": CustomEvent<FlowExpireDetail>;
|
|
186
201
|
"consent-flow-motion": CustomEvent<FlowMotionDetail>;
|
|
187
202
|
"consent-flow-step": CustomEvent<FlowStepDetail>;
|
|
203
|
+
"consent-flow-field": CustomEvent<FlowFieldDetail>;
|
|
204
|
+
}
|
|
205
|
+
/** A link under the card: the merchant's Terms or Privacy. */
|
|
206
|
+
export interface FlowLegalLink {
|
|
207
|
+
label: string;
|
|
208
|
+
/** https only; anything else is not drawn. */
|
|
209
|
+
href: string;
|
|
210
|
+
/** `config`: the project linked it; `default`: Checkpoint's own, standing in. */
|
|
211
|
+
source?: "config" | "default";
|
|
212
|
+
}
|
|
213
|
+
/** Terms the person accepts before Allow: drawn as a box to tick, with a link. */
|
|
214
|
+
export interface FlowTerms {
|
|
215
|
+
/** The link's words: "Terms and Conditions". */
|
|
216
|
+
label: string;
|
|
217
|
+
/** https only; without one the label is plain text. */
|
|
218
|
+
href?: string;
|
|
219
|
+
/** Sent back with the approval, for the server to match. */
|
|
220
|
+
version?: string;
|
|
188
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* The regions an editor can point at: every block, and the parts inside
|
|
224
|
+
* them a config field drives. `highlight` outlines one in a preview, and a
|
|
225
|
+
* click in a preview names one (`consent-flow-field`).
|
|
226
|
+
*/
|
|
227
|
+
export declare const FLOW_FIELDS: readonly [...("headline" | "status" | "details" | "notice" | "sub" | "eyebrow" | "approver" | "signIn" | "finePrint" | "capability" | "infoNote" | "countdown" | "expiredNote" | "receipt" | "goBack" | "retry")[], "capabilitiesHeader", "approve", "deny", "terms", "legal", "merchant", "connector"];
|
|
228
|
+
export type FlowField = (typeof FLOW_FIELDS)[number];
|
|
229
|
+
/** Where a config field shows: its region, and the step that draws it. */
|
|
230
|
+
export interface FlowFieldRegion {
|
|
231
|
+
field: FlowField;
|
|
232
|
+
step: FlowStep;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Each consent config field the flow draws, by its path in the config, with
|
|
236
|
+
* the region and step that show it. Fields not listed draw nothing in a flow
|
|
237
|
+
* (`success.continueButtonText`: the granted step has no button).
|
|
238
|
+
*/
|
|
239
|
+
export declare const CONFIG_FIELD_REGIONS: Readonly<Record<string, FlowFieldRegion>>;
|
|
189
240
|
/** The attributes `<consent-flow>` stamps on itself, for a host or preview to read. */
|
|
190
241
|
export declare const FLOW_HOST_ATTRIBUTES: {
|
|
191
242
|
readonly version: "data-consent-version";
|
package/dist/flow/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/flow/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8EAA8E;AAC9E,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,yFAAyF;AACzF,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/flow/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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C,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC/B;AAED,kFAAkF;AAClF,MAAM,WAAW,SAAS;IACxB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,ySASd,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAuBvE,CAAC;AAEL,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"}
|
package/dist/flow/model.js
CHANGED
|
@@ -24,6 +24,7 @@ export const FLOW_BLOCKS = [
|
|
|
24
24
|
"approver",
|
|
25
25
|
"capability",
|
|
26
26
|
"details",
|
|
27
|
+
"infoNote",
|
|
27
28
|
"countdown",
|
|
28
29
|
"actions",
|
|
29
30
|
"status",
|
|
@@ -90,7 +91,51 @@ export const FLOW_EVENTS = [
|
|
|
90
91
|
"expire",
|
|
91
92
|
"motion",
|
|
92
93
|
"step",
|
|
94
|
+
"field",
|
|
93
95
|
];
|
|
96
|
+
/**
|
|
97
|
+
* The regions an editor can point at: every block, and the parts inside
|
|
98
|
+
* them a config field drives. `highlight` outlines one in a preview, and a
|
|
99
|
+
* click in a preview names one (`consent-flow-field`).
|
|
100
|
+
*/
|
|
101
|
+
export const FLOW_FIELDS = [
|
|
102
|
+
...FLOW_BLOCKS.filter((block) => block !== "actions"),
|
|
103
|
+
"capabilitiesHeader",
|
|
104
|
+
"approve",
|
|
105
|
+
"deny",
|
|
106
|
+
"terms",
|
|
107
|
+
"legal",
|
|
108
|
+
"merchant",
|
|
109
|
+
"connector",
|
|
110
|
+
];
|
|
111
|
+
/**
|
|
112
|
+
* Each consent config field the flow draws, by its path in the config, with
|
|
113
|
+
* the region and step that show it. Fields not listed draw nothing in a flow
|
|
114
|
+
* (`success.continueButtonText`: the granted step has no button).
|
|
115
|
+
*/
|
|
116
|
+
export const CONFIG_FIELD_REGIONS = Object.freeze({
|
|
117
|
+
"branding.companyName": { field: "merchant", step: "consent" },
|
|
118
|
+
"branding.logoUrl": { field: "merchant", step: "consent" },
|
|
119
|
+
"branding.primaryColor": { field: "approve", step: "consent" },
|
|
120
|
+
"ui.title": { field: "eyebrow", step: "consent" },
|
|
121
|
+
"ui.headline": { field: "headline", step: "consent" },
|
|
122
|
+
"ui.description": { field: "sub", step: "consent" },
|
|
123
|
+
"ui.expirationText": { field: "infoNote", step: "consent" },
|
|
124
|
+
"ui.permissionsHeader": { field: "capabilitiesHeader", step: "consent" },
|
|
125
|
+
"ui.submitButtonText": { field: "approve", step: "consent" },
|
|
126
|
+
"ui.cancelButtonText": { field: "deny", step: "consent" },
|
|
127
|
+
headlineVerb: { field: "headline", step: "consent" },
|
|
128
|
+
"terms.text": { field: "legal", step: "consent" },
|
|
129
|
+
"terms.url": { field: "legal", step: "consent" },
|
|
130
|
+
"terms.privacyUrl": { field: "legal", step: "consent" },
|
|
131
|
+
"terms.required": { field: "terms", step: "consent" },
|
|
132
|
+
"success.title": { field: "headline", step: "granted" },
|
|
133
|
+
"success.description": { field: "sub", step: "granted" },
|
|
134
|
+
// Both methods have a consent step, where Allow and "Approve with
|
|
135
|
+
// passkey" differ; a consent flow has no passkey step to show.
|
|
136
|
+
"flow.approvalMethod": { field: "approve", step: "consent" },
|
|
137
|
+
"flow.connectorMark": { field: "connector", step: "consent" },
|
|
138
|
+
});
|
|
94
139
|
/** The attributes `<consent-flow>` stamps on itself, for a host or preview to read. */
|
|
95
140
|
export const FLOW_HOST_ATTRIBUTES = {
|
|
96
141
|
version: "data-consent-version",
|
package/dist/flow/model.js.map
CHANGED
|
@@ -1 +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,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E,SAAS,EAAE;IACzD,YAAY,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;IACpD,YAAY,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IACjD,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IAChD,kBAAkB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IACvD,gBAAgB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IACrD,eAAe,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;IACvD,qBAAqB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;IACxD,kEAAkE;IAClE,+DAA+D;IAC/D,qBAAqB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;IAC5D,oBAAoB,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;CAC9D,CAAC,CAAC;AAEL,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,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent page from config
|
|
3
|
+
*
|
|
4
|
+
* One mapping from a project's consent config, as Checkpoint saves it, to
|
|
5
|
+
* what `<consent-flow>` draws: the flow, its copy, the brand, the merchant,
|
|
6
|
+
* the legal links and the terms to accept. Checkpoint's preview and every
|
|
7
|
+
* server that renders the page call this, so the two draw the same page.
|
|
8
|
+
*
|
|
9
|
+
* Server and editor code: it validates the saved flow with the schema, so
|
|
10
|
+
* the browser bundle does not carry it.
|
|
11
|
+
*
|
|
12
|
+
* @module flow/page
|
|
13
|
+
*/
|
|
14
|
+
import { type ConsentBrandColors } from "../styles/brand.js";
|
|
15
|
+
import { type ApprovalMethod, type ConsentFlowDefinition, type FlowCopy, type FlowLegalLink, type FlowTerms } from "./model.js";
|
|
16
|
+
/** What `<consent-flow>` and the page around it take from a project's consent config. */
|
|
17
|
+
export interface ConsentPage {
|
|
18
|
+
/** The flow to draw: the saved choices over today's preset (`consentFlowFromSaved`). */
|
|
19
|
+
flow: ConsentFlowDefinition;
|
|
20
|
+
/** The editor's words as flow copy (`el.copy`), with {Agent}, {Merchant} and {Verb} left for the element. */
|
|
21
|
+
copy: FlowCopy;
|
|
22
|
+
/** `headlineVerb`, for `data.verb`. */
|
|
23
|
+
verb?: string;
|
|
24
|
+
theme: "light" | "dark";
|
|
25
|
+
/** The brand colors (`el.brand`), maybe page colors alone; absent when the project chose none that are usable, or when the package refuses the set. */
|
|
26
|
+
brand?: ConsentBrandColors;
|
|
27
|
+
/**
|
|
28
|
+
* The same brand as declarations for a server page's `<body>`, painting the
|
|
29
|
+
* brand's page background when it chose one (`branding.backgroundColor`),
|
|
30
|
+
* judged for `theme`; "" without a brand.
|
|
31
|
+
*/
|
|
32
|
+
brandStyle: string;
|
|
33
|
+
/** The merchant's name and logo (https only), for `data.merchant`. */
|
|
34
|
+
merchant: {
|
|
35
|
+
name?: string;
|
|
36
|
+
logoUrl?: string;
|
|
37
|
+
};
|
|
38
|
+
/** Terms, then Privacy (`el.legal`): the project's links, else the legal origin's. */
|
|
39
|
+
legal: FlowLegalLink[];
|
|
40
|
+
/** The terms to accept before Allow (`el.terms`); absent when not required. */
|
|
41
|
+
terms?: FlowTerms;
|
|
42
|
+
}
|
|
43
|
+
export interface ConsentPageOptions {
|
|
44
|
+
/** Checkpoint's origin: its /terms and /privacy stand in when the config links none. */
|
|
45
|
+
legalOrigin?: string;
|
|
46
|
+
/** The method when the config saves no usable flow. Default `passkey`. */
|
|
47
|
+
approvalMethod?: ApprovalMethod;
|
|
48
|
+
/** Whether the flow starts by signing the person in; else the saved flow's own choice. */
|
|
49
|
+
signIn?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** The links Checkpoint serves on its own origin, standing in for a project's. */
|
|
52
|
+
export declare const DEFAULT_LEGAL_LINKS: readonly Readonly<{
|
|
53
|
+
label: string;
|
|
54
|
+
path: string;
|
|
55
|
+
}>[];
|
|
56
|
+
/**
|
|
57
|
+
* Values Checkpoint wrote into most projects' saved configs on their first
|
|
58
|
+
* save. Nobody chose them, so they read as unset and the package's own look
|
|
59
|
+
* and words draw. A project that picks one of them on purpose gets the
|
|
60
|
+
* package's own too; that edge is accepted.
|
|
61
|
+
*
|
|
62
|
+
* - `description`: shopping-specific, and under the headline it repeats it.
|
|
63
|
+
* - `expirationText`: the old screen ended it with the duration ("…expire in
|
|
64
|
+
* 30 days"); alone it is half a sentence.
|
|
65
|
+
* - `submitButtonText` and `cancelButtonText`: "Allow access" would hide a
|
|
66
|
+
* passkey flow's "Approve with passkey", and "Deny" is the package's word
|
|
67
|
+
* for the decision.
|
|
68
|
+
* - `primaryColor` with `secondaryColor` (or with no secondary): the stored
|
|
69
|
+
* default brand color. It reads as no primary whatever page colors the
|
|
70
|
+
* project chose beside it, so a project that picks only a page color keeps
|
|
71
|
+
* the package's own action.
|
|
72
|
+
*/
|
|
73
|
+
export declare const CHECKPOINT_STORED_DEFAULTS: Readonly<{
|
|
74
|
+
description: "It looks like you would like to use [AI Agent] to buy items on your behalf. If so, we need a few things from you.";
|
|
75
|
+
expirationText: "This delegation will expire in";
|
|
76
|
+
submitButtonText: "Allow access";
|
|
77
|
+
cancelButtonText: "Cancel";
|
|
78
|
+
primaryColor: "#2563EB";
|
|
79
|
+
secondaryColor: "#DBEAFE";
|
|
80
|
+
}>;
|
|
81
|
+
/** Checkpoint's Terms and Privacy on `origin`, labelled as its own. */
|
|
82
|
+
export declare function defaultLegalLinks(origin: string): FlowLegalLink[];
|
|
83
|
+
/**
|
|
84
|
+
* The flow a saved one draws. A saved flow is its choices (approval method,
|
|
85
|
+
* sign-in, motion, connector mark, copy) laid over today's preset for that
|
|
86
|
+
* method, so every block a release adds reaches it with no migration. Only
|
|
87
|
+
* a flow marked `custom` keeps its own steps.
|
|
88
|
+
*
|
|
89
|
+
* Fails closed: nothing saved, a saved flow with no approval method, or
|
|
90
|
+
* choices the schema refuses all give the `approvalMethod` preset (a passkey
|
|
91
|
+
* by default), never a looser one.
|
|
92
|
+
*
|
|
93
|
+
* @example consentFlowFromSaved({ approvalMethod: "consent", motion: "subtle" }).steps.passkey // undefined
|
|
94
|
+
* @example consentFlowFromSaved(undefined).approvalMethod // "passkey"
|
|
95
|
+
*/
|
|
96
|
+
export declare function consentFlowFromSaved(saved: unknown, options?: Pick<ConsentPageOptions, "approvalMethod" | "signIn">): ConsentFlowDefinition;
|
|
97
|
+
/**
|
|
98
|
+
* A project's consent config as the page draws it. Each field maps once,
|
|
99
|
+
* here: `CONFIG_FIELD_REGIONS` says where each one shows.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* const page = consentPageFromConfig(config, { legalOrigin: "https://kya.vouched.id" });
|
|
103
|
+
* flowEl.flow = page.flow;
|
|
104
|
+
* flowEl.copy = page.copy;
|
|
105
|
+
* flowEl.brand = page.brand;
|
|
106
|
+
* flowEl.legal = page.legal;
|
|
107
|
+
* flowEl.terms = page.terms;
|
|
108
|
+
*/
|
|
109
|
+
export declare function consentPageFromConfig(config: unknown, options?: ConsentPageOptions): ConsentPage;
|
|
110
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/flow/page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAA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