@canton-network/wallet-gateway-remote 0.14.0 → 0.14.1
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/config/Config.d.ts +2 -0
- package/dist/config/Config.d.ts.map +1 -1
- package/dist/config/Config.js +3 -0
- package/dist/example-config.d.ts +1 -0
- package/dist/example-config.d.ts.map +1 -1
- package/dist/example-config.js +1 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +1 -0
- package/dist/web/frontend/404/index.html +2 -2
- package/dist/web/frontend/approve/index.html +3 -3
- package/dist/web/frontend/assets/{404-CEh-3dY6.js → 404-BYvTjgHP.js} +1 -1
- package/dist/web/frontend/assets/{approve--NuXcJ99.js → approve-Ditbq8rq.js} +57 -15
- package/dist/web/frontend/assets/{callback-ndmFyMKj.js → callback-C38OaDfH.js} +1 -1
- package/dist/web/frontend/assets/index-H77fdwQ1.js +1084 -0
- package/dist/web/frontend/assets/{login-DVLQad-p.js → login-CoJRjTTy.js} +1 -1
- package/dist/web/frontend/assets/{settings-Ckt3-4No.js → settings-BqpnHIxB.js} +1 -1
- package/dist/web/frontend/assets/{state-rLl_1YqS.js → state-BWqwgvuZ.js} +1 -1
- package/dist/web/frontend/assets/{transactions--x1IsjM5.js → transactions-BRdwpvmw.js} +1 -1
- package/dist/web/frontend/assets/{wallets-BhRCCHdz.js → wallets-Cw4zUA7F.js} +1 -1
- package/dist/web/frontend/callback/index.html +2 -2
- package/dist/web/frontend/index.html +1 -1
- package/dist/web/frontend/login/index.html +3 -3
- package/dist/web/frontend/settings/index.html +3 -3
- package/dist/web/frontend/transactions/index.html +3 -3
- package/dist/web/frontend/wallets/index.html +3 -3
- package/package.json +5 -5
- package/dist/web/frontend/assets/index-BP37qEsG.js +0 -1084
package/dist/config/Config.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const serverConfigSchema: z.ZodObject<{
|
|
|
11
11
|
allowedOrigins: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
|
|
12
12
|
host: z.ZodOptional<z.ZodString>;
|
|
13
13
|
tls: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
requestSizeLimit: z.ZodDefault<z.ZodString>;
|
|
14
15
|
}, z.core.$strip>;
|
|
15
16
|
export declare const configSchema: z.ZodObject<{
|
|
16
17
|
kernel: z.ZodObject<{
|
|
@@ -25,6 +26,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
25
26
|
allowedOrigins: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
|
|
26
27
|
host: z.ZodOptional<z.ZodString>;
|
|
27
28
|
tls: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
requestSizeLimit: z.ZodDefault<z.ZodString>;
|
|
28
30
|
}, z.core.$strip>>;
|
|
29
31
|
store: z.ZodObject<{
|
|
30
32
|
connection: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/config/Config.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,gBAAgB;;;;iBAY3B,CAAA;AAEF,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/config/Config.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,gBAAgB;;;;iBAY3B,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;iBAkC7B,CAAA;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKvB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
package/dist/config/Config.js
CHANGED
|
@@ -41,6 +41,9 @@ export const serverConfigSchema = z.object({
|
|
|
41
41
|
deprecated: true,
|
|
42
42
|
description: 'Deprecated, this option no longer has any effect. Will be removed in a future release.',
|
|
43
43
|
}),
|
|
44
|
+
requestSizeLimit: z.string().default('1mb').meta({
|
|
45
|
+
description: 'The maximum size of incoming requests. Defaults to 1mb.',
|
|
46
|
+
}),
|
|
44
47
|
});
|
|
45
48
|
export const configSchema = z.object({
|
|
46
49
|
kernel: kernelInfoSchema,
|
package/dist/example-config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example-config.d.ts","sourceRoot":"","sources":["../src/example-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"example-config.d.ts","sourceRoot":"","sources":["../src/example-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAyFkB"}
|
package/dist/example-config.js
CHANGED
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAqB7B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAmFvC,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAqB7B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAmFvC,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBA+HhE"}
|
package/dist/init.js
CHANGED
|
@@ -79,6 +79,7 @@ export async function initialize(opts, logger) {
|
|
|
79
79
|
const server = app.listen(port, () => {
|
|
80
80
|
logger.info(`Remote Wallet Gateway starting on ${serviceUrl})`);
|
|
81
81
|
});
|
|
82
|
+
app.use(express.json({ limit: config.server.requestSizeLimit }));
|
|
82
83
|
app.use('/healthz', rpcRateLimit, (_req, res) => res.status(200).send('OK'));
|
|
83
84
|
app.use('/readyz', rpcRateLimit, (_req, res) => {
|
|
84
85
|
if (isReady) {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<title>Wallet Kernel - Not found</title>
|
|
6
|
-
<script type="module" crossorigin src="/assets/404-
|
|
7
|
-
<link rel="modulepreload" crossorigin href="/assets/index-
|
|
6
|
+
<script type="module" crossorigin src="/assets/404-BYvTjgHP.js"></script>
|
|
7
|
+
<link rel="modulepreload" crossorigin href="/assets/index-H77fdwQ1.js">
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-CgbJtyud.css">
|
|
9
9
|
</head>
|
|
10
10
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<title>Wallet Kernel - Approve Write Request</title>
|
|
6
|
-
<script type="module" crossorigin src="/assets/approve
|
|
7
|
-
<link rel="modulepreload" crossorigin href="/assets/index-
|
|
8
|
-
<link rel="modulepreload" crossorigin href="/assets/state-
|
|
6
|
+
<script type="module" crossorigin src="/assets/approve-Ditbq8rq.js"></script>
|
|
7
|
+
<link rel="modulepreload" crossorigin href="/assets/index-H77fdwQ1.js">
|
|
8
|
+
<link rel="modulepreload" crossorigin href="/assets/state-BWqwgvuZ.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/decode-CLJkuAIr.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-CgbJtyud.css">
|
|
11
11
|
</head>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as k,a as z,x as O,t as P}from"./index-
|
|
1
|
+
import{i as k,a as z,x as O,t as P}from"./index-H77fdwQ1.js";var C=Object.create,s=Object.defineProperty,E=Object.getOwnPropertyDescriptor,x=(r,e)=>(e=Symbol[r])?e:Symbol.for("Symbol."+r),h=r=>{throw TypeError(r)},I=(r,e,a)=>e in r?s(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,j=(r,e)=>s(r,"name",{value:e,configurable:!0}),A=r=>[,,,C(r?.[x("metadata")]??null)],D=["class","method","getter","setter","accessor","field","value","get","set"],w=r=>r!==void 0&&typeof r!="function"?h("Function expected"):r,F=(r,e,a,n,t)=>({kind:D[r],name:e,metadata:n,addInitializer:o=>a._?h("Already initialized"):t.push(w(o||null))}),M=(r,e)=>I(e,x("metadata"),r[3]),N=(r,e,a,n)=>{for(var t=0,o=r[e>>1],i=o&&o.length;t<i;t++)o[t].call(a);return n},T=(r,e,a,n,t,o)=>{var i,u,f,l=e&7,b=!1,m=0,g=r[m]||(r[m]=[]),c=l&&(t=t.prototype,l<5&&(l>3||!b)&&E(t,a));j(t,a);for(var _=n.length-1;_>=0;_--)f=F(l,a,u={},r[3],g),i=(0,n[_])(t,f),u._=1,w(i)&&(t=i);return M(r,t),c&&s(t,a,c),b?l^4?o:c:t},y,v,S;y=[P("user-ui-404")];const p=class p extends(S=k){connectedCallback(){super.connectedCallback()}render(){return O`
|
|
2
2
|
<div class="wrapper">
|
|
3
3
|
<not-found href="/"></not-found>
|
|
4
4
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as j,s as J,b as ge,E as y,x as b,a as ue,i as me,t as _e}from"./index-H77fdwQ1.js";import{r as g}from"./state-BWqwgvuZ.js";import{p as be}from"./decode-CLJkuAIr.js";var ve=Object.create,C=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,X=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),x=t=>{throw TypeError(t)},fe=(t,e,a)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,K=(t,e)=>C(t,"name",{value:e,configurable:!0}),we=t=>[,,,ve(t?.[X("metadata")]??null)],Y=["class","method","getter","setter","accessor","field","value","get","set"],w=t=>t!==void 0&&typeof t!="function"?x("Function expected"):t,ye=(t,e,a,n,o)=>({kind:Y[t],name:e,metadata:n,addInitializer:d=>a._?x("Already initialized"):o.push(w(d||null))}),ke=(t,e)=>fe(e,X("metadata"),t[3]),i=(t,e,a,n)=>{for(var o=0,d=t[e>>1],v=d&&d.length;o<v;o++)e&1?d[o].call(a):n=d[o].call(a,n);return n},l=(t,e,a,n,o,d)=>{var v,p,F,f,k,s=e&7,A=!!(e&8),_=!!(e&16),T=s>3?t.length+1:s?A?1:2:0,G=Y[s+5],L=s>3&&(t[T-1]=[]),pe=t[T]||(t[T]=[]),m=s&&(!_&&!A&&(o=o.prototype),s<5&&(s>3||!_)&&xe(s<4?o:{get[a](){return Q(this,d)},set[a](h){return V(this,d,h)}},a));s?_&&s<4&&K(d,(s>2?"set ":s>1?"get ":"")+a):K(o,a);for(var $=n.length-1;$>=0;$--)f=ye(s,a,F={},t[3],pe),s&&(f.static=A,f.private=_,k=f.access={has:_?h=>Ae(o,h):h=>a in h},s^3&&(k.get=_?h=>(s^1?Q:Te)(h,o,s^4?d:m.get):h=>h[a]),s>2&&(k.set=_?(h,I)=>V(h,o,I,s^4?d:m.set):(h,I)=>h[a]=I)),p=(0,n[$])(s?s<4?_?d:m[G]:s>4?void 0:{get:m.get,set:m.set}:o,f),F._=1,s^4||p===void 0?w(p)&&(s>4?L.unshift(p):s?_?d=p:m[G]=p:o=p):typeof p!="object"||p===null?x("Object expected"):(w(v=p.get)&&(m.get=v),w(v=p.set)&&(m.set=v),w(v=p.init)&&L.unshift(v));return s||ke(t,o),m&&C(o,a,m),_?s^4?d:m:o},z=(t,e,a)=>e.has(t)||x("Cannot "+a),Ae=(t,e)=>Object(e)!==e?x('Cannot use the "in" operator on this value'):t.has(e),Q=(t,e,a)=>(z(t,e,"read from private field"),a?a.call(t):e.get(t)),u=(t,e,a)=>e.has(t)?x("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),V=(t,e,a,n)=>(z(t,e,"write to private field"),n?n.call(t,a):e.set(t,a),a),Te=(t,e,a)=>(z(t,e,"access private method"),a),Z,ee,te,ae,re,se,ie,oe,ne,de,ce,he,P,le,r,S,M,W,N,E,H,O,q,U,D,R,B;le=[_e("user-ui-approve")];class c extends(P=me,he=[g()],ce=[g()],de=[g()],ne=[g()],oe=[g()],ie=[g()],se=[g()],re=[g()],ae=[g()],te=[g()],ee=[g()],Z=[g()],P){constructor(){super(...arguments),u(this,S,i(r,8,this,!1)),i(r,11,this),u(this,M,i(r,12,this,"")),i(r,15,this),u(this,W,i(r,16,this,"")),i(r,19,this),u(this,N,i(r,20,this,"")),i(r,23,this),u(this,E,i(r,24,this,"")),i(r,27,this),u(this,H,i(r,28,this,null)),i(r,31,this),u(this,O,i(r,32,this,"")),i(r,35,this),u(this,q,i(r,36,this,null)),i(r,39,this),u(this,U,i(r,40,this,null)),i(r,43,this),u(this,D,i(r,44,this,null)),i(r,47,this),u(this,R,i(r,48,this,null)),i(r,51,this),u(this,B,i(r,52,this,null)),i(r,55,this)}connectedCallback(){super.connectedCallback();const e=new URL(window.location.href);this.commandId=e.searchParams.get("commandId")||"",this.updateState()}async updateState(){const e=await j(J.accessToken.get());e.request("getTransaction",{commandId:this.commandId}).then(a=>{this.txHash=a.preparedTransactionHash,this.tx=a.preparedTransaction,this.status=a.status,this.createdAt=a.createdAt||null,this.signedAt=a.signedAt||null,this.origin=a.origin||null;try{this.txParsed=be(this.tx)}catch(n){console.error("Error parsing prepared transaction:",n),this.txParsed=null}}),e.request("listWallets",[]).then(a=>{this.partyId=a.find(n=>n.primary===!0)?.partyId||""})}async handleExecute(){this.loading=!0,this.message="Executing transaction...",this.messageType="info";try{const e={commandId:this.commandId,partyId:this.partyId,preparedTransactionHash:this.txHash,preparedTransaction:this.tx},a=await j(J.accessToken.get()),{signature:n,signedBy:o}=await a.request("sign",e),d={signature:n,signedBy:o,commandId:this.commandId,partyId:this.partyId};await a.request("execute",d),this.message="Transaction executed successfully ✅",this.messageType="info",window.opener&&setTimeout(()=>window.close(),1e3)}catch(e){console.error(e),this.message=null,this.messageType=null,ge(e,{message:"Error executing transaction"})}finally{this.loading=!1}}render(){return b`
|
|
2
2
|
<div class="card">
|
|
3
3
|
<h1>Pending Transaction Request</h1>
|
|
4
4
|
|
|
@@ -10,12 +10,12 @@ import{c as J,s as K,b as ge,E as k,x as v,a as me,i as ue,t as _e}from"./index-
|
|
|
10
10
|
<h3>Status</h3>
|
|
11
11
|
<p>${this.status}</p>
|
|
12
12
|
|
|
13
|
-
${this.createdAt?
|
|
14
|
-
<p>${this.createdAt}</p>`:
|
|
15
|
-
${this.signedAt?
|
|
16
|
-
<p>${this.signedAt}</p>`:
|
|
17
|
-
${this.origin?
|
|
18
|
-
<p>${this.origin}</p>`:
|
|
13
|
+
${this.createdAt?b`<h3>Created At</h3>
|
|
14
|
+
<p>${this.createdAt}</p>`:y}
|
|
15
|
+
${this.signedAt?b`<h3>Signed At</h3>
|
|
16
|
+
<p>${this.signedAt}</p>`:y}
|
|
17
|
+
${this.origin?b`<h3>Origin</h3>
|
|
18
|
+
<p>${this.origin}</p>`:y}
|
|
19
19
|
|
|
20
20
|
<h3>Template</h3>
|
|
21
21
|
<p>
|
|
@@ -24,24 +24,42 @@ import{c as J,s as K,b as ge,E as k,x as v,a as me,i as ue,t as _e}from"./index-
|
|
|
24
24
|
|
|
25
25
|
<h3>Signatories</h3>
|
|
26
26
|
<ul>
|
|
27
|
-
${this.txParsed?.signatories?.map(e=>
|
|
27
|
+
${this.txParsed?.signatories?.map(e=>b`<li>${e}</li>`)||b`<li>N/A</li>`}
|
|
28
28
|
</ul>
|
|
29
29
|
|
|
30
30
|
<h3>Stakeholders</h3>
|
|
31
31
|
<ul>
|
|
32
|
-
${this.txParsed?.stakeholders?.map(e=>
|
|
32
|
+
${this.txParsed?.stakeholders?.map(e=>b`<li>${e}</li>`)||b`<li>N/A</li>`}
|
|
33
33
|
</ul>
|
|
34
34
|
|
|
35
35
|
<h3>Transaction Hash</h3>
|
|
36
36
|
<p>${this.txHash}</p>
|
|
37
37
|
|
|
38
|
-
<
|
|
38
|
+
<div class="section-header">
|
|
39
|
+
<h3>Base64 Transaction</h3>
|
|
40
|
+
<button
|
|
41
|
+
class="copy-btn"
|
|
42
|
+
@click=${()=>this._copyToClipboard(this.tx)}
|
|
43
|
+
title="Copy to clipboard"
|
|
44
|
+
>
|
|
45
|
+
📋 Copy
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
39
48
|
<div class="tx-box">${this.tx}</div>
|
|
40
49
|
|
|
41
|
-
<
|
|
50
|
+
<div class="section-header">
|
|
51
|
+
<h3>Decoded Transaction</h3>
|
|
52
|
+
<button
|
|
53
|
+
class="copy-btn"
|
|
54
|
+
@click=${()=>this._copyToClipboard(this.txParsed?.jsonString||"")}
|
|
55
|
+
title="Copy to clipboard"
|
|
56
|
+
>
|
|
57
|
+
📋 Copy
|
|
58
|
+
</button>
|
|
59
|
+
</div>
|
|
42
60
|
<div class="tx-box">${this.txParsed?.jsonString||"N/A"}</div>
|
|
43
61
|
|
|
44
|
-
${this.status==="executed"?
|
|
62
|
+
${this.status==="executed"?y:b`
|
|
45
63
|
<button
|
|
46
64
|
?disabled=${this.loading}
|
|
47
65
|
@click=${this.handleExecute}
|
|
@@ -49,11 +67,11 @@ import{c as J,s as K,b as ge,E as k,x as v,a as me,i as ue,t as _e}from"./index-
|
|
|
49
67
|
${this.loading?"Processing...":"Approve"}
|
|
50
68
|
</button>
|
|
51
69
|
`}
|
|
52
|
-
${this.message?
|
|
70
|
+
${this.message?b`<div class="message ${this.messageType}">
|
|
53
71
|
${this.message}
|
|
54
72
|
</div>`:null}
|
|
55
73
|
</div>
|
|
56
|
-
`}}
|
|
74
|
+
`}_copyToClipboard(e){navigator.clipboard.writeText(e)}}r=we(P);S=new WeakMap;M=new WeakMap;W=new WeakMap;N=new WeakMap;E=new WeakMap;H=new WeakMap;O=new WeakMap;q=new WeakMap;U=new WeakMap;D=new WeakMap;R=new WeakMap;B=new WeakMap;l(r,4,"loading",he,c,S);l(r,4,"commandId",ce,c,M);l(r,4,"partyId",de,c,W);l(r,4,"txHash",ne,c,N);l(r,4,"tx",oe,c,E);l(r,4,"txParsed",ie,c,H);l(r,4,"status",se,c,O);l(r,4,"message",re,c,q);l(r,4,"messageType",ae,c,U);l(r,4,"createdAt",te,c,D);l(r,4,"signedAt",ee,c,R);l(r,4,"origin",Z,c,B);c=l(r,0,"ApproveUi",le,c);c.styles=ue`
|
|
57
75
|
:host {
|
|
58
76
|
display: block;
|
|
59
77
|
box-sizing: border-box;
|
|
@@ -132,6 +150,30 @@ import{c as J,s as K,b as ge,E as k,x as v,a as me,i as ue,t as _e}from"./index-
|
|
|
132
150
|
word-break: break-word;
|
|
133
151
|
}
|
|
134
152
|
|
|
153
|
+
.section-header {
|
|
154
|
+
display: flex;
|
|
155
|
+
justify-content: space-between;
|
|
156
|
+
align-items: center;
|
|
157
|
+
gap: 0.5rem;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.copy-btn {
|
|
161
|
+
background: transparent;
|
|
162
|
+
border: 1px solid var(--border-color);
|
|
163
|
+
padding: 0.25rem 0.5rem;
|
|
164
|
+
font-size: 0.75rem;
|
|
165
|
+
color: var(--text-color);
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
border-radius: 4px;
|
|
168
|
+
transition: all 0.2s ease;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.copy-btn:hover {
|
|
172
|
+
background: var(--button-bg);
|
|
173
|
+
border-color: var(--button-bg);
|
|
174
|
+
color: white;
|
|
175
|
+
}
|
|
176
|
+
|
|
135
177
|
button {
|
|
136
178
|
padding: 0.75rem;
|
|
137
179
|
border-radius: 8px;
|
|
@@ -182,4 +224,4 @@ import{c as J,s as K,b as ge,E as k,x as v,a as me,i as ue,t as _e}from"./index-
|
|
|
182
224
|
font-size: 0.95rem;
|
|
183
225
|
}
|
|
184
226
|
}
|
|
185
|
-
`;i(
|
|
227
|
+
`;i(r,1,c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as y,s as u,d as O,r as C,x as P,t as I}from"./index-
|
|
1
|
+
import{i as y,s as u,d as O,r as C,x as P,t as I}from"./index-H77fdwQ1.js";var L=Object.create,h=Object.defineProperty,z=Object.getOwnPropertyDescriptor,w=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),b=e=>{throw TypeError(e)},D=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R=(e,t)=>h(e,"name",{value:t,configurable:!0}),T=e=>[,,,L(e?.[w("metadata")]??null)],j=["class","method","getter","setter","accessor","field","value","get","set"],k=e=>e!==void 0&&typeof e!="function"?b("Function expected"):e,E=(e,t,r,o,a)=>({kind:j[e],name:t,metadata:o,addInitializer:c=>r._?b("Already initialized"):a.push(k(c||null))}),U=(e,t)=>D(t,w("metadata"),e[3]),N=(e,t,r,o)=>{for(var a=0,c=e[t>>1],i=c&&c.length;a<i;a++)c[a].call(r);return o},F=(e,t,r,o,a,c)=>{var i,s,l,n=t&7,d=!1,g=0,x=e[g]||(e[g]=[]),_=n&&(a=a.prototype,n<5&&(n>3||!d)&&z(a,r));R(a,r);for(var p=o.length-1;p>=0;p--)l=E(n,r,s={},e[3],x),i=(0,o[p])(a,l),s._=1,k(i)&&(a=i);return U(e,a),_&&h(a,r,_),d?n^4?c:_:a},m,v,S;m=[I("login-callback")];class f extends(S=y){connectedCallback(){super.connectedCallback(),this.handleRedirect()}async handleRedirect(){const t=new URL(window.location.href),r=t.searchParams.get("code"),o=t.searchParams.get("state");if(!r&&!o){console.error("missing state and code");return}if(r&&o){const a=JSON.parse(atob(o)),s=(await(await fetch(a.configUrl)).json()).token_endpoint,n=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:r,redirect_uri:window.location.origin+"/callback/",client_id:a.clientId,audience:a.audience})})).json();if(n.access_token){const d=JSON.parse(atob(n.access_token.split(".")[1]));u.expirationDate.set(new Date(d.exp*1e3).toISOString()),u.accessToken.set(n.access_token),O(n.access_token,u.networkId.get()||"").then(()=>{C()})}}}render(){return P`<h2>Logged in!</h2>`}}v=T(S);f=F(v,0,"LoginCallback",m,f);N(v,1,f);
|