@kya-os/consent 0.1.0 → 0.1.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/dist/bundle/index.d.ts +44 -0
- package/dist/bundle/index.d.ts.map +1 -0
- package/dist/bundle/index.js +45 -0
- package/dist/bundle/index.js.map +1 -0
- package/dist/bundle/inline.d.ts +18 -0
- package/dist/bundle/inline.d.ts.map +1 -0
- package/dist/bundle/inline.js +18 -0
- package/dist/bundle/inline.js.map +1 -0
- package/dist/bundle/shell.d.ts +91 -0
- package/dist/bundle/shell.d.ts.map +1 -0
- package/dist/bundle/shell.js +282 -0
- package/dist/bundle/shell.js.map +1 -0
- package/dist/components/consent-button.d.ts +61 -0
- package/dist/components/consent-button.d.ts.map +1 -0
- package/dist/components/consent-button.js +177 -0
- package/dist/components/consent-button.js.map +1 -0
- package/dist/components/consent-checkbox.d.ts +61 -0
- package/dist/components/consent-checkbox.d.ts.map +1 -0
- package/dist/components/consent-checkbox.js +220 -0
- package/dist/components/consent-checkbox.js.map +1 -0
- package/dist/components/consent-input.d.ts +91 -0
- package/dist/components/consent-input.d.ts.map +1 -0
- package/dist/components/consent-input.js +332 -0
- package/dist/components/consent-input.js.map +1 -0
- package/dist/components/consent-oauth-button.d.ts +87 -0
- package/dist/components/consent-oauth-button.d.ts.map +1 -0
- package/dist/components/consent-oauth-button.js +389 -0
- package/dist/components/consent-oauth-button.js.map +1 -0
- package/dist/components/consent-otp-input.d.ts +92 -0
- package/dist/components/consent-otp-input.d.ts.map +1 -0
- package/dist/components/consent-otp-input.js +385 -0
- package/dist/components/consent-otp-input.js.map +1 -0
- package/dist/components/consent-permissions.d.ts +104 -0
- package/dist/components/consent-permissions.d.ts.map +1 -0
- package/dist/components/consent-permissions.js +430 -0
- package/dist/components/consent-permissions.js.map +1 -0
- package/dist/components/consent-shell.d.ts +72 -0
- package/dist/components/consent-shell.d.ts.map +1 -0
- package/dist/components/consent-shell.js +231 -0
- package/dist/components/consent-shell.js.map +1 -0
- package/dist/components/consent-terms.d.ts +89 -0
- package/dist/components/consent-terms.d.ts.map +1 -0
- package/dist/components/consent-terms.js +284 -0
- package/dist/components/consent-terms.js.map +1 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +23 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/mcp-consent.d.ts +152 -0
- package/dist/components/mcp-consent.d.ts.map +1 -0
- package/dist/components/mcp-consent.js +874 -0
- package/dist/components/mcp-consent.js.map +1 -0
- package/dist/consent.js +3744 -0
- package/dist/consent.min.js +1564 -0
- package/dist/constants/auth-modes.d.ts +7 -2
- package/dist/constants/auth-modes.d.ts.map +1 -1
- package/dist/constants/auth-modes.js +28 -36
- package/dist/constants/auth-modes.js.map +1 -1
- package/dist/constants/colors.js +1 -4
- package/dist/constants/colors.js.map +1 -1
- package/dist/constants/defaults.d.ts +1 -1
- package/dist/constants/defaults.d.ts.map +1 -1
- package/dist/constants/defaults.js +16 -19
- package/dist/constants/defaults.js.map +1 -1
- package/dist/constants/index.d.ts +3 -3
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +3 -26
- package/dist/constants/index.js.map +1 -1
- package/dist/index.d.ts +10 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -23
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +123 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +154 -0
- package/dist/react/index.js.map +1 -0
- package/dist/resolution/index.d.ts +3 -3
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +3 -19
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/resolve-branding.d.ts +1 -1
- package/dist/resolution/resolve-branding.d.ts.map +1 -1
- package/dist/resolution/resolve-branding.js +14 -24
- package/dist/resolution/resolve-branding.js.map +1 -1
- package/dist/resolution/resolve-config.d.ts +2 -2
- package/dist/resolution/resolve-config.d.ts.map +1 -1
- package/dist/resolution/resolve-config.js +57 -53
- package/dist/resolution/resolve-config.js.map +1 -1
- package/dist/resolution/resolve-copy.d.ts +2 -2
- package/dist/resolution/resolve-copy.d.ts.map +1 -1
- package/dist/resolution/resolve-copy.js +35 -43
- package/dist/resolution/resolve-copy.js.map +1 -1
- package/dist/schemas/api.schemas.d.ts +7 -4
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/api.schemas.js +70 -74
- package/dist/schemas/api.schemas.js.map +1 -1
- package/dist/schemas/branding.schemas.js +17 -20
- package/dist/schemas/branding.schemas.js.map +1 -1
- package/dist/schemas/config.schemas.d.ts +1 -1
- package/dist/schemas/config.schemas.d.ts.map +1 -1
- package/dist/schemas/config.schemas.js +64 -70
- package/dist/schemas/config.schemas.js.map +1 -1
- package/dist/schemas/index.d.ts +4 -4
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +4 -20
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/modes.schemas.js +60 -63
- package/dist/schemas/modes.schemas.js.map +1 -1
- package/dist/security/escape.d.ts.map +1 -1
- package/dist/security/escape.js +12 -17
- package/dist/security/escape.js.map +1 -1
- package/dist/security/index.d.ts +2 -2
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +2 -18
- package/dist/security/index.js.map +1 -1
- package/dist/security/validators.js +9 -20
- package/dist/security/validators.js.map +1 -1
- package/dist/styles/css-variables.d.ts +1 -1
- package/dist/styles/css-variables.d.ts.map +1 -1
- package/dist/styles/css-variables.js +18 -27
- package/dist/styles/css-variables.js.map +1 -1
- package/dist/styles/index.d.ts +3 -3
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +3 -19
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/stylesheet.d.ts +1 -1
- package/dist/styles/stylesheet.d.ts.map +1 -1
- package/dist/styles/stylesheet.js +20 -27
- package/dist/styles/stylesheet.js.map +1 -1
- package/dist/styles/tokens.js +1 -4
- package/dist/styles/tokens.js.map +1 -1
- package/dist/templates/base/base-template.d.ts +3 -3
- package/dist/templates/base/base-template.d.ts.map +1 -1
- package/dist/templates/base/base-template.js +31 -35
- package/dist/templates/base/base-template.js.map +1 -1
- package/dist/templates/base/components.js +49 -65
- package/dist/templates/base/components.js.map +1 -1
- package/dist/templates/base/index.d.ts +2 -2
- package/dist/templates/base/index.d.ts.map +1 -1
- package/dist/templates/base/index.js +2 -20
- package/dist/templates/base/index.js.map +1 -1
- package/dist/templates/index.d.ts +9 -9
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +9 -25
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/modes/consent-only.template.d.ts +2 -2
- package/dist/templates/modes/consent-only.template.d.ts.map +1 -1
- package/dist/templates/modes/consent-only.template.js +11 -15
- package/dist/templates/modes/consent-only.template.js.map +1 -1
- package/dist/templates/modes/credentials.template.d.ts +4 -4
- package/dist/templates/modes/credentials.template.d.ts.map +1 -1
- package/dist/templates/modes/credentials.template.js +20 -24
- package/dist/templates/modes/credentials.template.js.map +1 -1
- package/dist/templates/modes/index.d.ts +6 -6
- package/dist/templates/modes/index.d.ts.map +1 -1
- package/dist/templates/modes/index.js +6 -16
- package/dist/templates/modes/index.js.map +1 -1
- package/dist/templates/modes/magic-link.template.d.ts +2 -2
- package/dist/templates/modes/magic-link.template.d.ts.map +1 -1
- package/dist/templates/modes/magic-link.template.js +14 -18
- package/dist/templates/modes/magic-link.template.js.map +1 -1
- package/dist/templates/modes/oauth.template.d.ts +2 -2
- package/dist/templates/modes/oauth.template.d.ts.map +1 -1
- package/dist/templates/modes/oauth.template.js +21 -25
- package/dist/templates/modes/oauth.template.js.map +1 -1
- package/dist/templates/modes/otp.template.d.ts +2 -2
- package/dist/templates/modes/otp.template.d.ts.map +1 -1
- package/dist/templates/modes/otp.template.js +17 -21
- package/dist/templates/modes/otp.template.js.map +1 -1
- package/dist/templates/modes/success.template.d.ts +2 -2
- package/dist/templates/modes/success.template.d.ts.map +1 -1
- package/dist/templates/modes/success.template.js +24 -29
- package/dist/templates/modes/success.template.js.map +1 -1
- package/dist/templates/registry.d.ts +4 -4
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +30 -38
- package/dist/templates/registry.js.map +1 -1
- package/dist/types/api.types.d.ts +6 -5
- package/dist/types/api.types.d.ts.map +1 -1
- package/dist/types/api.types.js +1 -2
- package/dist/types/api.types.js.map +1 -1
- package/dist/types/branding.types.js +1 -2
- package/dist/types/branding.types.js.map +1 -1
- package/dist/types/config.types.d.ts +5 -5
- package/dist/types/config.types.d.ts.map +1 -1
- package/dist/types/config.types.js +1 -2
- package/dist/types/config.types.js.map +1 -1
- package/dist/types/copy.types.js +1 -2
- package/dist/types/copy.types.js.map +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +6 -22
- package/dist/types/index.js.map +1 -1
- package/dist/types/modes.types.js +1 -4
- package/dist/types/modes.types.js.map +1 -1
- package/dist/types/page.types.d.ts +6 -6
- package/dist/types/page.types.d.ts.map +1 -1
- package/dist/types/page.types.js +1 -2
- package/dist/types/page.types.js.map +1 -1
- package/package.json +41 -4
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Reusable HTML Components
|
|
4
3
|
*
|
|
@@ -11,24 +10,9 @@
|
|
|
11
10
|
*
|
|
12
11
|
* @module @kya-os/consent/templates/base/components
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
exports.renderAgentInfo = renderAgentInfo;
|
|
18
|
-
exports.renderHeader = renderHeader;
|
|
19
|
-
exports.renderButton = renderButton;
|
|
20
|
-
exports.renderButtonGroup = renderButtonGroup;
|
|
21
|
-
exports.renderFullWidthButton = renderFullWidthButton;
|
|
22
|
-
exports.renderCheckbox = renderCheckbox;
|
|
23
|
-
exports.renderInput = renderInput;
|
|
24
|
-
exports.renderExpirationNotice = renderExpirationNotice;
|
|
25
|
-
exports.renderErrorContainer = renderErrorContainer;
|
|
26
|
-
exports.renderCheckIcon = renderCheckIcon;
|
|
27
|
-
exports.renderClockIcon = renderClockIcon;
|
|
28
|
-
exports.renderSuccessIcon = renderSuccessIcon;
|
|
29
|
-
const tokens_1 = require("../../styles/tokens");
|
|
30
|
-
const escape_1 = require("../../security/escape");
|
|
31
|
-
const validators_1 = require("../../security/validators");
|
|
13
|
+
import { CONSENT_CLASSES } from "../../styles/tokens.js";
|
|
14
|
+
import { escapeHtml, escapeAttr } from "../../security/escape.js";
|
|
15
|
+
import { validateUrl } from "../../security/validators.js";
|
|
32
16
|
// ============================================================================
|
|
33
17
|
// Logo & Agent Info
|
|
34
18
|
// ============================================================================
|
|
@@ -36,7 +20,7 @@ const validators_1 = require("../../security/validators");
|
|
|
36
20
|
* Render a default agent icon SVG.
|
|
37
21
|
* Used when no logo is provided.
|
|
38
22
|
*/
|
|
39
|
-
function renderDefaultAgentIcon() {
|
|
23
|
+
export function renderDefaultAgentIcon() {
|
|
40
24
|
return `
|
|
41
25
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" class="text-gray-400">
|
|
42
26
|
<rect x="3" y="3" width="18" height="18" rx="2" stroke="currentColor" stroke-width="2" />
|
|
@@ -53,15 +37,15 @@ function renderDefaultAgentIcon() {
|
|
|
53
37
|
* @param alt - Alt text for accessibility
|
|
54
38
|
* @returns HTML string
|
|
55
39
|
*/
|
|
56
|
-
function renderLogo(logoUrl, alt) {
|
|
40
|
+
export function renderLogo(logoUrl, alt) {
|
|
57
41
|
if (!logoUrl) {
|
|
58
42
|
return renderDefaultAgentIcon();
|
|
59
43
|
}
|
|
60
|
-
const validUrl =
|
|
44
|
+
const validUrl = validateUrl(logoUrl);
|
|
61
45
|
if (!validUrl) {
|
|
62
46
|
return renderDefaultAgentIcon();
|
|
63
47
|
}
|
|
64
|
-
return `<img src="${
|
|
48
|
+
return `<img src="${escapeAttr(validUrl)}" alt="${escapeAttr(alt || "Agent")}" class="w-full h-full object-contain" />`;
|
|
65
49
|
}
|
|
66
50
|
/**
|
|
67
51
|
* Render agent info section with logo and description.
|
|
@@ -70,13 +54,13 @@ function renderLogo(logoUrl, alt) {
|
|
|
70
54
|
* @param logoUrl - Optional logo URL
|
|
71
55
|
* @returns HTML string
|
|
72
56
|
*/
|
|
73
|
-
function renderAgentInfo(description, logoUrl) {
|
|
57
|
+
export function renderAgentInfo(description, logoUrl) {
|
|
74
58
|
return `
|
|
75
|
-
<div class="${
|
|
76
|
-
<div class="${
|
|
59
|
+
<div class="${CONSENT_CLASSES.agentWrapper}">
|
|
60
|
+
<div class="${CONSENT_CLASSES.agentIcon}">
|
|
77
61
|
${renderLogo(logoUrl)}
|
|
78
62
|
</div>
|
|
79
|
-
<p class="${
|
|
63
|
+
<p class="${CONSENT_CLASSES.agentDescription}">${escapeHtml(description)}</p>
|
|
80
64
|
</div>
|
|
81
65
|
`;
|
|
82
66
|
}
|
|
@@ -92,25 +76,25 @@ function renderAgentInfo(description, logoUrl) {
|
|
|
92
76
|
* @param companyName - Optional company name
|
|
93
77
|
* @returns HTML string
|
|
94
78
|
*/
|
|
95
|
-
function renderHeader(title, subtitle, logoUrl, companyName) {
|
|
79
|
+
export function renderHeader(title, subtitle, logoUrl, companyName) {
|
|
96
80
|
let logoHtml = "";
|
|
97
81
|
if (logoUrl) {
|
|
98
|
-
const validUrl =
|
|
82
|
+
const validUrl = validateUrl(logoUrl);
|
|
99
83
|
if (validUrl) {
|
|
100
|
-
logoHtml = `<img src="${
|
|
84
|
+
logoHtml = `<img src="${escapeAttr(validUrl)}" alt="${escapeAttr(companyName || "Logo")}" class="h-12 w-auto mb-4 mx-auto" />`;
|
|
101
85
|
}
|
|
102
86
|
}
|
|
103
87
|
const companyHtml = companyName
|
|
104
|
-
? `<p class="text-sm text-gray-600 mb-2">${
|
|
88
|
+
? `<p class="text-sm text-gray-600 mb-2">${escapeHtml(companyName)}</p>`
|
|
105
89
|
: "";
|
|
106
90
|
const subtitleHtml = subtitle
|
|
107
|
-
? `<p class="${
|
|
91
|
+
? `<p class="${CONSENT_CLASSES.subtitle}">${escapeHtml(subtitle)}</p>`
|
|
108
92
|
: "";
|
|
109
93
|
return `
|
|
110
|
-
<div class="${
|
|
94
|
+
<div class="${CONSENT_CLASSES.headerCenter}">
|
|
111
95
|
${logoHtml}
|
|
112
96
|
${companyHtml}
|
|
113
|
-
<h1 class="${
|
|
97
|
+
<h1 class="${CONSENT_CLASSES.title}">${escapeHtml(title)}</h1>
|
|
114
98
|
${subtitleHtml}
|
|
115
99
|
</div>
|
|
116
100
|
`;
|
|
@@ -127,14 +111,14 @@ function renderHeader(title, subtitle, logoUrl, companyName) {
|
|
|
127
111
|
* @param attributes - Additional HTML attributes
|
|
128
112
|
* @returns HTML string
|
|
129
113
|
*/
|
|
130
|
-
function renderButton(text, variant, type = "button", attributes = {}) {
|
|
114
|
+
export function renderButton(text, variant, type = "button", attributes = {}) {
|
|
131
115
|
const baseClass = variant === "primary"
|
|
132
|
-
? `${
|
|
133
|
-
:
|
|
116
|
+
? `${CONSENT_CLASSES.buttonPrimary} btn-primary`
|
|
117
|
+
: CONSENT_CLASSES.buttonSecondary;
|
|
134
118
|
const attrs = Object.entries(attributes)
|
|
135
|
-
.map(([k, v]) => `${k}="${
|
|
119
|
+
.map(([k, v]) => `${k}="${escapeAttr(v)}"`)
|
|
136
120
|
.join(" ");
|
|
137
|
-
return `<button type="${type}" class="${baseClass}" ${attrs}>${
|
|
121
|
+
return `<button type="${type}" class="${baseClass}" ${attrs}>${escapeHtml(text)}</button>`;
|
|
138
122
|
}
|
|
139
123
|
/**
|
|
140
124
|
* Render button group with cancel and submit buttons.
|
|
@@ -143,9 +127,9 @@ function renderButton(text, variant, type = "button", attributes = {}) {
|
|
|
143
127
|
* @param submitText - Submit button text
|
|
144
128
|
* @returns HTML string
|
|
145
129
|
*/
|
|
146
|
-
function renderButtonGroup(cancelText, submitText) {
|
|
130
|
+
export function renderButtonGroup(cancelText, submitText) {
|
|
147
131
|
return `
|
|
148
|
-
<div class="${
|
|
132
|
+
<div class="${CONSENT_CLASSES.buttonGroup}">
|
|
149
133
|
${renderButton(cancelText, "secondary", "button", { onclick: "window.close()" })}
|
|
150
134
|
${renderButton(submitText, "primary", "submit")}
|
|
151
135
|
</div>
|
|
@@ -158,8 +142,8 @@ function renderButtonGroup(cancelText, submitText) {
|
|
|
158
142
|
* @param type - 'submit' | 'button'
|
|
159
143
|
* @returns HTML string
|
|
160
144
|
*/
|
|
161
|
-
function renderFullWidthButton(text, type = "submit") {
|
|
162
|
-
return `<button type="${type}" class="${
|
|
145
|
+
export function renderFullWidthButton(text, type = "submit") {
|
|
146
|
+
return `<button type="${type}" class="${CONSENT_CLASSES.buttonFull} btn-primary">${escapeHtml(text)}</button>`;
|
|
163
147
|
}
|
|
164
148
|
// ============================================================================
|
|
165
149
|
// Form Elements
|
|
@@ -174,16 +158,16 @@ function renderFullWidthButton(text, type = "submit") {
|
|
|
174
158
|
* @param disabled - Whether disabled
|
|
175
159
|
* @returns HTML string
|
|
176
160
|
*/
|
|
177
|
-
function renderCheckbox(name, label, required = false, checked = false, disabled = false) {
|
|
161
|
+
export function renderCheckbox(name, label, required = false, checked = false, disabled = false) {
|
|
178
162
|
const requiredAttr = required ? "required" : "";
|
|
179
163
|
const checkedAttr = checked ? "checked" : "";
|
|
180
164
|
const disabledAttr = disabled ? "disabled" : "";
|
|
181
165
|
return `
|
|
182
|
-
<label class="${
|
|
183
|
-
<input type="checkbox" name="${
|
|
184
|
-
class="${
|
|
166
|
+
<label class="${CONSENT_CLASSES.checkboxLabel}">
|
|
167
|
+
<input type="checkbox" name="${escapeAttr(name)}"
|
|
168
|
+
class="${CONSENT_CLASSES.checkbox}"
|
|
185
169
|
${requiredAttr} ${checkedAttr} ${disabledAttr} />
|
|
186
|
-
<span class="${
|
|
170
|
+
<span class="${CONSENT_CLASSES.checkboxText}">${label}</span>
|
|
187
171
|
</label>
|
|
188
172
|
`;
|
|
189
173
|
}
|
|
@@ -198,27 +182,27 @@ function renderCheckbox(name, label, required = false, checked = false, disabled
|
|
|
198
182
|
* @param autocomplete - Autocomplete value
|
|
199
183
|
* @returns HTML string
|
|
200
184
|
*/
|
|
201
|
-
function renderInput(type, name, label, placeholder, required = false, autocomplete) {
|
|
185
|
+
export function renderInput(type, name, label, placeholder, required = false, autocomplete) {
|
|
202
186
|
const placeholderAttr = placeholder
|
|
203
|
-
? `placeholder="${
|
|
187
|
+
? `placeholder="${escapeAttr(placeholder)}"`
|
|
204
188
|
: "";
|
|
205
189
|
const requiredAttr = required ? "required" : "";
|
|
206
190
|
const autocompleteAttr = autocomplete
|
|
207
|
-
? `autocomplete="${
|
|
191
|
+
? `autocomplete="${escapeAttr(autocomplete)}"`
|
|
208
192
|
: "";
|
|
209
193
|
return `
|
|
210
194
|
<div class="space-y-2">
|
|
211
|
-
<label for="${
|
|
212
|
-
${
|
|
195
|
+
<label for="${escapeAttr(name)}" class="block text-sm font-medium text-gray-700">
|
|
196
|
+
${escapeHtml(label)}
|
|
213
197
|
</label>
|
|
214
198
|
<input
|
|
215
199
|
type="${type}"
|
|
216
|
-
id="${
|
|
217
|
-
name="${
|
|
200
|
+
id="${escapeAttr(name)}"
|
|
201
|
+
name="${escapeAttr(name)}"
|
|
218
202
|
${placeholderAttr}
|
|
219
203
|
${requiredAttr}
|
|
220
204
|
${autocompleteAttr}
|
|
221
|
-
class="${
|
|
205
|
+
class="${CONSENT_CLASSES.input} ${CONSENT_CLASSES.inputFocus}"
|
|
222
206
|
/>
|
|
223
207
|
</div>
|
|
224
208
|
`;
|
|
@@ -233,15 +217,15 @@ function renderInput(type, name, label, placeholder, required = false, autocompl
|
|
|
233
217
|
* @param days - Number of days (optional)
|
|
234
218
|
* @returns HTML string
|
|
235
219
|
*/
|
|
236
|
-
function renderExpirationNotice(text, days) {
|
|
220
|
+
export function renderExpirationNotice(text, days) {
|
|
237
221
|
const fullText = days ? `${text} ${days} days` : text;
|
|
238
222
|
return `
|
|
239
|
-
<div class="${
|
|
223
|
+
<div class="${CONSENT_CLASSES.expirationWrapper} bg-secondary-50">
|
|
240
224
|
<svg class="w-4 h-4 text-primary flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
241
225
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
242
226
|
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
243
227
|
</svg>
|
|
244
|
-
<span class="text-sm text-gray-600">${
|
|
228
|
+
<span class="text-sm text-gray-600">${escapeHtml(fullText)}</span>
|
|
245
229
|
</div>
|
|
246
230
|
`;
|
|
247
231
|
}
|
|
@@ -251,10 +235,10 @@ function renderExpirationNotice(text, days) {
|
|
|
251
235
|
* @param id - Container ID for JavaScript access
|
|
252
236
|
* @returns HTML string
|
|
253
237
|
*/
|
|
254
|
-
function renderErrorContainer(id = "error-container") {
|
|
238
|
+
export function renderErrorContainer(id = "error-container") {
|
|
255
239
|
return `
|
|
256
|
-
<div id="${
|
|
257
|
-
<div class="${
|
|
240
|
+
<div id="${escapeAttr(id)}" class="hidden">
|
|
241
|
+
<div class="${CONSENT_CLASSES.errorContainer}"></div>
|
|
258
242
|
</div>
|
|
259
243
|
`;
|
|
260
244
|
}
|
|
@@ -264,7 +248,7 @@ function renderErrorContainer(id = "error-container") {
|
|
|
264
248
|
/**
|
|
265
249
|
* Render a checkmark icon.
|
|
266
250
|
*/
|
|
267
|
-
function renderCheckIcon() {
|
|
251
|
+
export function renderCheckIcon() {
|
|
268
252
|
return `
|
|
269
253
|
<svg class="w-5 h-5 text-green-500 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
270
254
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
|
|
@@ -274,7 +258,7 @@ function renderCheckIcon() {
|
|
|
274
258
|
/**
|
|
275
259
|
* Render a clock icon.
|
|
276
260
|
*/
|
|
277
|
-
function renderClockIcon() {
|
|
261
|
+
export function renderClockIcon() {
|
|
278
262
|
return `
|
|
279
263
|
<svg class="w-4 h-4 text-primary flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
280
264
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
@@ -285,7 +269,7 @@ function renderClockIcon() {
|
|
|
285
269
|
/**
|
|
286
270
|
* Render a success checkmark icon (large, green).
|
|
287
271
|
*/
|
|
288
|
-
function renderSuccessIcon() {
|
|
272
|
+
export function renderSuccessIcon() {
|
|
289
273
|
return `
|
|
290
274
|
<svg class="mx-auto h-12 w-12 text-green-500 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
291
275
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../src/templates/base/components.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../src/templates/base/components.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO;;;;;;;GAON,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,GAAY;IACvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,sBAAsB,EAAE,CAAC;IAClC,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACtC,IAAI,CAAC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AA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAY,EAAE,IAAa;IAChE,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IAEtD,OAAO;kBACS,eAAe,CAAC,iBAAiB;;;;;4CAKP,UAAU,CAAC,QAAQ,CAAC;;GAE7D,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAE,GAAG,iBAAiB;IACzD,OAAO;eACM,UAAU,CAAC,EAAE,CAAC;oBACT,eAAe,CAAC,cAAc;;GAE/C,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,QAAQ;AACR,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO;;;;GAIN,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO;;;;;GAKN,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO;;;;GAIN,CAAC;AACJ,CAAC"}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module @kya-os/consent/templates/base
|
|
5
5
|
*/
|
|
6
|
-
export { BaseConsentTemplate } from "./base-template";
|
|
7
|
-
export { renderDefaultAgentIcon, renderLogo, renderAgentInfo, renderHeader, renderButton, renderButtonGroup, renderFullWidthButton, renderCheckbox, renderInput, renderExpirationNotice, renderErrorContainer, renderCheckIcon, renderClockIcon, renderSuccessIcon, } from "./components";
|
|
6
|
+
export { BaseConsentTemplate } from "./base-template.js";
|
|
7
|
+
export { renderDefaultAgentIcon, renderLogo, renderAgentInfo, renderHeader, renderButton, renderButtonGroup, renderFullWidthButton, renderCheckbox, renderInput, renderExpirationNotice, renderErrorContainer, renderCheckIcon, renderClockIcon, renderSuccessIcon, } from "./components.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/base/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/base/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Base Template Exports
|
|
4
3
|
*
|
|
5
4
|
* @module @kya-os/consent/templates/base
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var base_template_1 = require("./base-template");
|
|
10
|
-
Object.defineProperty(exports, "BaseConsentTemplate", { enumerable: true, get: function () { return base_template_1.BaseConsentTemplate; } });
|
|
11
|
-
var components_1 = require("./components");
|
|
12
|
-
Object.defineProperty(exports, "renderDefaultAgentIcon", { enumerable: true, get: function () { return components_1.renderDefaultAgentIcon; } });
|
|
13
|
-
Object.defineProperty(exports, "renderLogo", { enumerable: true, get: function () { return components_1.renderLogo; } });
|
|
14
|
-
Object.defineProperty(exports, "renderAgentInfo", { enumerable: true, get: function () { return components_1.renderAgentInfo; } });
|
|
15
|
-
Object.defineProperty(exports, "renderHeader", { enumerable: true, get: function () { return components_1.renderHeader; } });
|
|
16
|
-
Object.defineProperty(exports, "renderButton", { enumerable: true, get: function () { return components_1.renderButton; } });
|
|
17
|
-
Object.defineProperty(exports, "renderButtonGroup", { enumerable: true, get: function () { return components_1.renderButtonGroup; } });
|
|
18
|
-
Object.defineProperty(exports, "renderFullWidthButton", { enumerable: true, get: function () { return components_1.renderFullWidthButton; } });
|
|
19
|
-
Object.defineProperty(exports, "renderCheckbox", { enumerable: true, get: function () { return components_1.renderCheckbox; } });
|
|
20
|
-
Object.defineProperty(exports, "renderInput", { enumerable: true, get: function () { return components_1.renderInput; } });
|
|
21
|
-
Object.defineProperty(exports, "renderExpirationNotice", { enumerable: true, get: function () { return components_1.renderExpirationNotice; } });
|
|
22
|
-
Object.defineProperty(exports, "renderErrorContainer", { enumerable: true, get: function () { return components_1.renderErrorContainer; } });
|
|
23
|
-
Object.defineProperty(exports, "renderCheckIcon", { enumerable: true, get: function () { return components_1.renderCheckIcon; } });
|
|
24
|
-
Object.defineProperty(exports, "renderClockIcon", { enumerable: true, get: function () { return components_1.renderClockIcon; } });
|
|
25
|
-
Object.defineProperty(exports, "renderSuccessIcon", { enumerable: true, get: function () { return components_1.renderSuccessIcon; } });
|
|
6
|
+
export { BaseConsentTemplate } from "./base-template.js";
|
|
7
|
+
export { renderDefaultAgentIcon, renderLogo, renderAgentInfo, renderHeader, renderButton, renderButtonGroup, renderFullWidthButton, renderCheckbox, renderInput, renderExpirationNotice, renderErrorContainer, renderCheckIcon, renderClockIcon, renderSuccessIcon, } from "./components.js";
|
|
26
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/base/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/base/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module @kya-os/consent/templates
|
|
8
8
|
*/
|
|
9
|
-
export * from "./base/base-template";
|
|
10
|
-
export * from "./base/components";
|
|
11
|
-
export * from "./modes/consent-only.template";
|
|
12
|
-
export * from "./modes/credentials.template";
|
|
13
|
-
export * from "./modes/oauth.template";
|
|
14
|
-
export * from "./modes/magic-link.template";
|
|
15
|
-
export * from "./modes/otp.template";
|
|
16
|
-
export * from "./modes/success.template";
|
|
17
|
-
export * from "./registry";
|
|
9
|
+
export * from "./base/base-template.js";
|
|
10
|
+
export * from "./base/components.js";
|
|
11
|
+
export * from "./modes/consent-only.template.js";
|
|
12
|
+
export * from "./modes/credentials.template.js";
|
|
13
|
+
export * from "./modes/oauth.template.js";
|
|
14
|
+
export * from "./modes/magic-link.template.js";
|
|
15
|
+
export * from "./modes/otp.template.js";
|
|
16
|
+
export * from "./modes/success.template.js";
|
|
17
|
+
export * from "./registry.js";
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC"}
|
package/dist/templates/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Consent Templates
|
|
4
3
|
*
|
|
@@ -7,28 +6,13 @@
|
|
|
7
6
|
*
|
|
8
7
|
* @module @kya-os/consent/templates
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
o[k2] = m[k];
|
|
20
|
-
}));
|
|
21
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
__exportStar(require("./base/base-template"), exports);
|
|
26
|
-
__exportStar(require("./base/components"), exports);
|
|
27
|
-
__exportStar(require("./modes/consent-only.template"), exports);
|
|
28
|
-
__exportStar(require("./modes/credentials.template"), exports);
|
|
29
|
-
__exportStar(require("./modes/oauth.template"), exports);
|
|
30
|
-
__exportStar(require("./modes/magic-link.template"), exports);
|
|
31
|
-
__exportStar(require("./modes/otp.template"), exports);
|
|
32
|
-
__exportStar(require("./modes/success.template"), exports);
|
|
33
|
-
__exportStar(require("./registry"), exports);
|
|
9
|
+
export * from "./base/base-template.js";
|
|
10
|
+
export * from "./base/components.js";
|
|
11
|
+
export * from "./modes/consent-only.template.js";
|
|
12
|
+
export * from "./modes/credentials.template.js";
|
|
13
|
+
export * from "./modes/oauth.template.js";
|
|
14
|
+
export * from "./modes/magic-link.template.js";
|
|
15
|
+
export * from "./modes/otp.template.js";
|
|
16
|
+
export * from "./modes/success.template.js";
|
|
17
|
+
export * from "./registry.js";
|
|
34
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module @kya-os/consent/templates/modes/consent-only
|
|
8
8
|
*/
|
|
9
|
-
import { BaseConsentTemplate } from "../base/base-template";
|
|
10
|
-
import type { AuthMode } from "../../types/modes.types";
|
|
9
|
+
import { BaseConsentTemplate } from "../base/base-template.js";
|
|
10
|
+
import type { AuthMode } from "../../types/modes.types.js";
|
|
11
11
|
/**
|
|
12
12
|
* Consent-Only Template
|
|
13
13
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-only.template.d.ts","sourceRoot":"","sources":["../../../src/templates/modes/consent-only.template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"consent-only.template.d.ts","sourceRoot":"","sources":["../../../src/templates/modes/consent-only.template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;;;;;;GAQG;AACH,qBAAa,mBAAoB,SAAQ,mBAAmB;IAC1D,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAEQ,iBAAiB,IAAI,MAAM;IAOpC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAsB7B;;OAEG;IACH,OAAO,CAAC,eAAe;IAWvB;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAK/B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Consent-Only Template
|
|
4
3
|
*
|
|
@@ -7,13 +6,11 @@
|
|
|
7
6
|
*
|
|
8
7
|
* @module @kya-os/consent/templates/modes/consent-only
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const escape_1 = require("../../security/escape");
|
|
16
|
-
const modes_types_1 = require("../../types/modes.types");
|
|
9
|
+
import { BaseConsentTemplate } from "../base/base-template.js";
|
|
10
|
+
import { renderCheckbox, renderExpirationNotice } from "../base/components.js";
|
|
11
|
+
import { CONSENT_CLASSES } from "../../styles/tokens.js";
|
|
12
|
+
import { escapeHtml } from "../../security/escape.js";
|
|
13
|
+
import { AUTH_MODES } from "../../types/modes.types.js";
|
|
17
14
|
/**
|
|
18
15
|
* Consent-Only Template
|
|
19
16
|
*
|
|
@@ -23,9 +20,9 @@ const modes_types_1 = require("../../types/modes.types");
|
|
|
23
20
|
* - Terms acceptance checkbox
|
|
24
21
|
* - Cancel/Allow buttons
|
|
25
22
|
*/
|
|
26
|
-
class ConsentOnlyTemplate extends
|
|
23
|
+
export class ConsentOnlyTemplate extends BaseConsentTemplate {
|
|
27
24
|
get authMode() {
|
|
28
|
-
return
|
|
25
|
+
return AUTH_MODES.CONSENT_ONLY;
|
|
29
26
|
}
|
|
30
27
|
renderAuthContent() {
|
|
31
28
|
return `
|
|
@@ -47,8 +44,8 @@ class ConsentOnlyTemplate extends base_template_1.BaseConsentTemplate {
|
|
|
47
44
|
.join("");
|
|
48
45
|
return `
|
|
49
46
|
<div class="space-y-5">
|
|
50
|
-
<p class="${
|
|
51
|
-
<div class="${
|
|
47
|
+
<p class="${CONSENT_CLASSES.permissionsHeader}">${escapeHtml(copy.permissionsHeader)}</p>
|
|
48
|
+
<div class="${CONSENT_CLASSES.permissionsList}">
|
|
52
49
|
${scopeItems}
|
|
53
50
|
</div>
|
|
54
51
|
</div>
|
|
@@ -59,7 +56,7 @@ class ConsentOnlyTemplate extends base_template_1.BaseConsentTemplate {
|
|
|
59
56
|
*/
|
|
60
57
|
renderScopeItem(scope) {
|
|
61
58
|
// Scopes are pre-checked and disabled (informational only)
|
|
62
|
-
return
|
|
59
|
+
return renderCheckbox(`scope_${scope}`, escapeHtml(scope), false, true, true);
|
|
63
60
|
}
|
|
64
61
|
/**
|
|
65
62
|
* Render the expiration notice.
|
|
@@ -67,8 +64,7 @@ class ConsentOnlyTemplate extends base_template_1.BaseConsentTemplate {
|
|
|
67
64
|
renderExpirationNotice() {
|
|
68
65
|
const { copy } = this.resolved;
|
|
69
66
|
const expirationDays = this.resolved.expirationDays || 30;
|
|
70
|
-
return
|
|
67
|
+
return renderExpirationNotice(copy.expirationText, expirationDays);
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
|
-
exports.ConsentOnlyTemplate = ConsentOnlyTemplate;
|
|
74
70
|
//# sourceMappingURL=consent-only.template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-only.template.js","sourceRoot":"","sources":["../../../src/templates/modes/consent-only.template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consent-only.template.js","sourceRoot":"","sources":["../../../src/templates/modes/consent-only.template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,U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,CAAC;IACrE,CAAC;CACF"}
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module @kya-os/consent/templates/modes/credentials
|
|
11
11
|
*/
|
|
12
|
-
import { BaseConsentTemplate } from "../base/base-template";
|
|
13
|
-
import type { AuthMode, CredentialsConfig } from "../../types/modes.types";
|
|
14
|
-
import type { ResolvedConsentConfig } from "../../types/config.types";
|
|
15
|
-
import type { ExtendedConsentPageConfig } from "../../types/page.types";
|
|
12
|
+
import { BaseConsentTemplate } from "../base/base-template.js";
|
|
13
|
+
import type { AuthMode, CredentialsConfig } from "../../types/modes.types.js";
|
|
14
|
+
import type { ResolvedConsentConfig } from "../../types/config.types.js";
|
|
15
|
+
import type { ExtendedConsentPageConfig } from "../../types/page.types.js";
|
|
16
16
|
/**
|
|
17
17
|
* Credentials Template
|
|
18
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.template.d.ts","sourceRoot":"","sources":["../../../src/templates/modes/credentials.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"credentials.template.d.ts","sourceRoot":"","sources":["../../../src/templates/modes/credentials.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAG3E;;;;;;;;;;;;;GAaG;AACH,qBAAa,mBAAoB,SAAQ,mBAAmB;IAC1D,OAAO,CAAC,uBAAuB,CAAC,CAAoB;gBAGlD,MAAM,EAAE,yBAAyB,EACjC,QAAQ,EAAE,qBAAqB,EAC/B,iBAAiB,CAAC,EAAE,iBAAiB;IAMvC,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,OAAO,KAAK,iBAAiB,GAoB5B;IAED;;;OAGG;IACM,MAAM,IAAI,MAAM;IAyHzB;;OAEG;cACgB,UAAU,IAAI,MAAM;IAcvC;;OAEG;IACH,OAAO,CAAC,eAAe;IAcvB;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAiD/B;;;OAGG;IACM,iBAAiB,IAAI,MAAM;cAIjB,mBAAmB,IAAI,MAAM;cAI7B,kBAAkB,IAAI,MAAM;IAI/C;;OAEG;cACgB,gBAAgB,IAAI,MAAM;CA2I9C"}
|