@kya-os/consent 0.1.9 → 0.1.12
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/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +2 -2
- package/dist/bundle/inline.js.map +1 -1
- package/dist/bundle/shell.d.ts +6 -0
- package/dist/bundle/shell.d.ts.map +1 -1
- package/dist/bundle/shell.js +4 -1
- package/dist/bundle/shell.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +37 -18
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +210 -135
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +99 -27
- package/dist/consent.min.js +26 -25
- package/dist/schemas/api.schemas.d.ts +4 -4
- package/dist/templates/registry.d.ts +6 -0
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +11 -13
- package/dist/templates/registry.js.map +1 -1
- package/dist/types/modes.types.d.ts +53 -0
- package/dist/types/modes.types.d.ts.map +1 -1
- package/dist/types/modes.types.js +67 -0
- package/dist/types/modes.types.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module components/mcp-consent
|
|
8
8
|
*/
|
|
9
|
-
import { LitElement, TemplateResult } from
|
|
10
|
-
import type { ConsentConfig } from
|
|
11
|
-
import type { AuthMode } from
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
9
|
+
import { LitElement, TemplateResult } from "lit";
|
|
10
|
+
import type { ConsentConfig } from "../types/config.types.js";
|
|
11
|
+
import type { AuthMode } from "../types/modes.types.js";
|
|
12
|
+
import "./consent-shell.js";
|
|
13
|
+
import "./consent-button.js";
|
|
14
|
+
import "./consent-checkbox.js";
|
|
15
|
+
import "./consent-input.js";
|
|
16
|
+
import "./consent-permissions.js";
|
|
17
|
+
import "./consent-terms.js";
|
|
18
|
+
import "./consent-oauth-button.js";
|
|
19
|
+
import "./consent-otp-input.js";
|
|
20
20
|
/**
|
|
21
21
|
* OAuth Identity from callback
|
|
22
22
|
* NOTE: Must match OAuthIdentitySchema in api.schemas.ts
|
|
@@ -36,7 +36,10 @@ export interface OAuthIdentity {
|
|
|
36
36
|
*/
|
|
37
37
|
export interface ConsentApproveDetail {
|
|
38
38
|
success: boolean;
|
|
39
|
+
/** Redirect URL for multi-step flows (e.g., credential auth → clickwrap) */
|
|
39
40
|
redirectUrl?: string;
|
|
41
|
+
/** Delegation ID when consent is approved and VC is created */
|
|
42
|
+
delegationId?: string;
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
45
|
* Consent error event detail
|
|
@@ -107,6 +110,22 @@ export declare class McpConsent extends LitElement {
|
|
|
107
110
|
* Required for credential auth and OAuth flows to identify the provider
|
|
108
111
|
*/
|
|
109
112
|
provider: string;
|
|
113
|
+
/**
|
|
114
|
+
* CSRF token for form security
|
|
115
|
+
* Required for credential auth flows to prevent CSRF attacks
|
|
116
|
+
*/
|
|
117
|
+
csrfToken: string;
|
|
118
|
+
/**
|
|
119
|
+
* Credential provider type from prior auth step
|
|
120
|
+
* Set when redirecting from credential auth → clickwrap page
|
|
121
|
+
* Used to ensure delegation is created with correct authorization type ('password')
|
|
122
|
+
*/
|
|
123
|
+
credentialProviderType: string;
|
|
124
|
+
/**
|
|
125
|
+
* Credential provider name from prior auth step
|
|
126
|
+
* Set when redirecting from credential auth → clickwrap page
|
|
127
|
+
*/
|
|
128
|
+
credentialProvider: string;
|
|
110
129
|
/**
|
|
111
130
|
* OAuth identity from callback
|
|
112
131
|
*/
|
|
@@ -132,12 +151,12 @@ export declare class McpConsent extends LitElement {
|
|
|
132
151
|
/**
|
|
133
152
|
* Get the provider_type based on the current auth mode.
|
|
134
153
|
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* -
|
|
154
|
+
* Uses the centralized AUTH_MODE_TO_PROVIDER_TYPE mapping from modes.types.ts
|
|
155
|
+
* to ensure type-safety and DRY principle compliance.
|
|
156
|
+
*
|
|
157
|
+
* For OAuth mode, returns the specific provider from oauthIdentity if available.
|
|
158
|
+
*
|
|
159
|
+
* @see getProviderTypeForAuthMode - The canonical mapping function
|
|
141
160
|
*/
|
|
142
161
|
private getProviderType;
|
|
143
162
|
/**
|
|
@@ -181,7 +200,7 @@ export declare class McpConsent extends LitElement {
|
|
|
181
200
|
}
|
|
182
201
|
declare global {
|
|
183
202
|
interface HTMLElementTagNameMap {
|
|
184
|
-
|
|
203
|
+
"mcp-consent": McpConsent;
|
|
185
204
|
}
|
|
186
205
|
}
|
|
187
206
|
//# sourceMappingURL=mcp-consent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-consent.d.ts","sourceRoot":"","sources":["../../src/components/mcp-consent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAW,MAAM,KAAK,CAAC;AAErE,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"mcp-consent.d.ts","sourceRoot":"","sources":["../../src/components/mcp-consent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAW,MAAM,KAAK,CAAC;AAErE,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,QAAQ,EAAgB,MAAM,yBAAyB,CAAC;AAWtE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0BAA0B,CAAC;AAClC,OAA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