FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

21
node_modules/@clerk/clerk-js/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Clerk, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

69
node_modules/@clerk/clerk-js/README.md generated vendored Normal file
View File

@@ -0,0 +1,69 @@
<p align="center">
<a href="https://clerk.com?utm_source=github&utm_medium=clerk_js" target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://images.clerk.com/static/logo-dark-mode-400x400.png">
<img src="https://images.clerk.com/static/logo-light-mode-400x400.png" height="64">
</picture>
</a>
<br />
<h1 align="center">@clerk/clerk-js</h1>
</p>
<div align="center">
[![Chat on Discord](https://img.shields.io/discord/856971667393609759.svg?logo=discord)](https://clerk.com/discord)
[![Clerk documentation](https://img.shields.io/badge/documentation-clerk-green.svg)](https://clerk.com/docs?utm_source=github&utm_medium=clerk_js)
[![Follow on Twitter](https://img.shields.io/twitter/follow/Clerk?style=social)](https://twitter.com/intent/follow?screen_name=Clerk)
[Changelog](https://github.com/clerk/javascript/blob/main/packages/clerk-js/CHANGELOG.md)
·
[Report a Bug](https://github.com/clerk/javascript/issues/new?assignees=&labels=needs-triage&projects=&template=BUG_REPORT.yml)
·
[Request a Feature](https://feedback.clerk.com/roadmap)
·
[Get help](https://clerk.com/contact/support?utm_source=github&utm_medium=clerk_js)
</div>
## Getting Started
[Clerk](https://clerk.com/?utm_source=github&utm_medium=clerk_js) is the easiest way to add authentication and user management to your JavaScript application. Add sign up, sign in, and profile management to your application in minutes.
### Prerequisites
- An existing Clerk application. [Create your account for free](https://dashboard.clerk.com/sign-up?utm_source=github&utm_medium=clerk_js).
### Installation
The fastest way to get started with Clerk is by following the [JavaScript Quickstart](https://clerk.com/docs/quickstarts/javascript?utm_source=github&utm_medium=clerk_js).
You'll learn how to add the ClerkJS SDK to your application (either through `<script>` tag or NPM module) and use Clerk's prebuilt components.
## Usage
For further information, guides, and examples visit the [ClerkJS reference documentation](https://clerk.com/docs/references/javascript/overview?utm_source=github&utm_medium=clerk_js).
## Support
You can get in touch with us in any of the following ways:
- Join our official community [Discord server](https://clerk.com/discord)
- On [our support page](https://clerk.com/contact/support?utm_source=github&utm_medium=clerk_js)
## Contributing
We're open to all community contributions! If you'd like to contribute in any way, please read [our contribution guidelines](https://github.com/clerk/javascript/blob/main/docs/CONTRIBUTING.md) and [code of conduct](https://github.com/clerk/javascript/blob/main/docs/CODE_OF_CONDUCT.md).
## Security
`@clerk/clerk-js` follows good practices of security, but 100% security cannot be assured.
`@clerk/clerk-js` is provided **"as is"** without any **warranty**. Use at your own risk.
_For more information and to report security issues, please refer to our [security documentation](https://github.com/clerk/javascript/blob/main/docs/SECURITY.md)._
## License
This project is licensed under the **MIT license**.
See [LICENSE](https://github.com/clerk/javascript/blob/main/packages/clerk-js/LICENSE) for more information.

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["10"],{1753(e,l,k){k.d(l,{QueryClient:()=>c.E});var c=k(5949)}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["10"],{1753(e,l,k){k.d(l,{QueryClient:()=>c.E});var c=k(5949)}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["647"],{7410(e,t,r){let a,o;r.d(t,{getWallets:()=>d});var n,i=function(e,t,r,a){if("a"===r&&!a)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)},l=function(e,t,r,a,o){if("m"===a)throw TypeError("Private method is not writable");if("a"===a&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?o.call(e,r):o?o.value=r:t.set(e,r),r};let c=new Set,s={};function d(){if(o||(o=Object.freeze({register:u,get:p,on:f}),"u"<typeof window))return o;let e=Object.freeze({register:u});try{window.addEventListener("wallet-standard:register-wallet",({detail:t})=>t(e))}catch(e){console.error("wallet-standard:register-wallet event listener could not be added\n",e)}try{window.dispatchEvent(new w(e))}catch(e){console.error("wallet-standard:app-ready event could not be dispatched\n",e)}return o}function u(...e){return(e=e.filter(e=>!c.has(e))).length?(e.forEach(e=>{a=void 0,c.add(e)}),s.register?.forEach(t=>h(()=>t(...e))),function(){e.forEach(e=>{a=void 0,c.delete(e)}),s.unregister?.forEach(t=>h(()=>t(...e)))}):()=>{}}function p(){return a||(a=[...c]),a}function f(e,t){return s[e]?.push(t)||(s[e]=[t]),function(){s[e]=s[e]?.filter(e=>t!==e)}}function h(e){try{e()}catch(e){console.error(e)}}var w=class extends Event{get detail(){return i(this,n,"f")}get type(){return"wallet-standard:app-ready"}constructor(e){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),n.set(this,void 0),l(this,n,e,"f")}preventDefault(){throw Error("preventDefault cannot be called")}stopImmediatePropagation(){throw Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw Error("stopPropagation cannot be called")}};n=new WeakMap}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["647"],{7410(e,r,t){let a,o;t.d(r,{getWallets:()=>d}),t(5254),t(7548),t(954),t(8803),t(9162),t(5385),t(9342),t(9152),t(6395),t(2949),t(8723),t(4086),t(4104);var n,l=function(e,r,t,a){if("a"===t&&!a)throw TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!a:!r.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?a:"a"===t?a.call(e):a?a.value:r.get(e)},i=function(e,r,t,a,o){if("m"===a)throw TypeError("Private method is not writable");if("a"===a&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof r?e!==r||!o:!r.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?o.call(e,t):o?o.value=t:r.set(e,t),t};let c=new Set,s={};function d(){if(o||(o=Object.freeze({register:u,get:f,on:h}),"u"<typeof window))return o;let e=Object.freeze({register:u});try{window.addEventListener("wallet-standard:register-wallet",r=>{let{detail:t}=r;return t(e)})}catch(e){console.error("wallet-standard:register-wallet event listener could not be added\n",e)}try{window.dispatchEvent(new w(e))}catch(e){console.error("wallet-standard:app-ready event could not be dispatched\n",e)}return o}function u(){for(var e,r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];return(t=t.filter(e=>!c.has(e))).length?(t.forEach(e=>{a=void 0,c.add(e)}),null==(e=s.register)||e.forEach(e=>p(()=>e(...t))),function(){var e;t.forEach(e=>{a=void 0,c.delete(e)}),null==(e=s.unregister)||e.forEach(e=>p(()=>e(...t)))}):()=>{}}function f(){return a||(a=[...c]),a}function h(e,r){var t;return(null==(t=s[e])?void 0:t.push(r))||(s[e]=[r]),function(){var t;s[e]=null==(t=s[e])?void 0:t.filter(e=>r!==e)}}function p(e){try{e()}catch(e){console.error(e)}}var w=class extends Event{get detail(){return l(this,n,"f")}get type(){return"wallet-standard:app-ready"}preventDefault(){throw Error("preventDefault cannot be called")}stopImmediatePropagation(){throw Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw Error("stopPropagation cannot be called")}constructor(e){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),n.set(this,void 0),i(this,n,e,"f")}};n=new WeakMap}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["647"],{7410(e,t,r){let a,o;r.d(t,{getWallets:()=>d});var n,i=function(e,t,r,a){if("a"===r&&!a)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)},l=function(e,t,r,a,o){if("m"===a)throw TypeError("Private method is not writable");if("a"===a&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?o.call(e,r):o?o.value=r:t.set(e,r),r};let c=new Set,s={};function d(){if(o||(o=Object.freeze({register:u,get:p,on:f}),"u"<typeof window))return o;let e=Object.freeze({register:u});try{window.addEventListener("wallet-standard:register-wallet",({detail:t})=>t(e))}catch(e){console.error("wallet-standard:register-wallet event listener could not be added\n",e)}try{window.dispatchEvent(new w(e))}catch(e){console.error("wallet-standard:app-ready event could not be dispatched\n",e)}return o}function u(...e){return(e=e.filter(e=>!c.has(e))).length?(e.forEach(e=>{a=void 0,c.add(e)}),s.register?.forEach(t=>h(()=>t(...e))),function(){e.forEach(e=>{a=void 0,c.delete(e)}),s.unregister?.forEach(t=>h(()=>t(...e)))}):()=>{}}function p(){return a||(a=[...c]),a}function f(e,t){return s[e]?.push(t)||(s[e]=[t]),function(){s[e]=s[e]?.filter(e=>t!==e)}}function h(e){try{e()}catch(e){console.error(e)}}var w=class extends Event{get detail(){return i(this,n,"f")}get type(){return"wallet-standard:app-ready"}constructor(e){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),n.set(this,void 0),l(this,n,e,"f")}preventDefault(){throw Error("preventDefault cannot be called")}stopImmediatePropagation(){throw Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw Error("stopPropagation cannot be called")}};n=new WeakMap}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["698"],{1521(e,t,i){i.d(t,{getDebugLogger:()=>a}),i(7009);class r{logLevel;transport;constructor(e,t){this.transport=e,this.logLevel=t??"debug"}debug(e,t,i){this.log("debug",e,t,i)}error(e,t,i){this.log("error",e,t,i)}info(e,t,i){this.log("info",e,t,i)}warn(e,t,i){this.log("warn",e,t,i)}log(e,t,i,r){if(!this.shouldLogLevel(e))return;let s={timestamp:Date.now(),level:e,message:t,context:i,source:r};this.transport.send(s).catch(e=>{console.error("Failed to send log entry:",e)})}shouldLogLevel(e){let t=["error","warn","info","debug"],i=t.indexOf(this.logLevel);return t.indexOf(e)<=i}}class s{transports;constructor(e){this.transports=e}async send(e){let t=this.transports.map(t=>t.send(e).catch(e=>{console.error("Failed to send to transport:",e)}));await Promise.allSettled(t)}}class o{send(e){let t=new Date(e.timestamp).toISOString(),i=e.level.toUpperCase(),r=e.source?`[${e.source}]`:"",s=e.context?` ${JSON.stringify(e.context)}`:"",o=`[Clerk Debug] ${t} ${i}${r}: ${e.message}${s}`;switch(e.level){case"error":console.error(o);break;case"warn":console.warn(o);break;case"info":console.info(o);break;case"debug":console.debug(o);break;default:console.log(o)}return Promise.resolve()}}class n{collector;constructor(e){this.collector=e}async send(e){this.collector&&await Promise.resolve(this.collector.recordLog({context:e.context,level:e.level,message:e.message,organizationId:e.organizationId,sessionId:e.sessionId,source:e.source,timestamp:e.timestamp,userId:e.userId}))}}class l{static instance;initialized=!1;logger=null;initializationPromise=null;static getInstance(){return l.instance||(l.instance=new l),l.instance}async initialize(e={}){return this.initialized?this.logger:(this.initializationPromise||(this.initializationPromise=this.performInitialization(e)),this.initializationPromise)}async performInitialization(e){try{if(e.logLevel&&"string"!=typeof e.logLevel)throw Error("logLevel must be a string");let{logLevel:t,telemetryCollector:i}=e,l=[{transport:new o},...i?[{transport:new n(i)}]:[]].map(e=>e.transport),a=new s(l),c=new r(a,t??"info");return this.logger=c,this.initialized=!0,this.logger}catch(e){return console.error("Failed to initialize debug module:",e),this.initializationPromise=null,null}}getLogger(){return this.logger}isInitialized(){return this.initialized}reset(){this.initialized=!1,this.logger=null,this.initializationPromise=null}}async function a(e={}){return l.getInstance().initialize(e)}}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["698"],{1521(e,t,i){i.d(t,{getDebugLogger:()=>c});var o=i(7213);i(5254),i(3560),i(6395),i(2949),i(7891),i(7009);class s{debug(e,t,i){this.log("debug",e,t,i)}error(e,t,i){this.log("error",e,t,i)}info(e,t,i){this.log("info",e,t,i)}warn(e,t,i){this.log("warn",e,t,i)}log(e,t,i,o){if(!this.shouldLogLevel(e))return;let s={timestamp:Date.now(),level:e,message:t,context:i,source:o};this.transport.send(s).catch(e=>{console.error("Failed to send log entry:",e)})}shouldLogLevel(e){let t=["error","warn","info","debug"],i=t.indexOf(this.logLevel);return t.indexOf(e)<=i}constructor(e,t){(0,o._)(this,"logLevel",void 0),(0,o._)(this,"transport",void 0),this.transport=e,this.logLevel=null!=t?t:"debug"}}i(1045);class r{async send(e){let t=this.transports.map(t=>t.send(e).catch(e=>{console.error("Failed to send to transport:",e)}));await Promise.allSettled(t)}constructor(e){(0,o._)(this,"transports",void 0),this.transports=e}}class n{send(e){let t=new Date(e.timestamp).toISOString(),i=e.level.toUpperCase(),o=e.source?"[".concat(e.source,"]"):"",s=e.context?" ".concat(JSON.stringify(e.context)):"",r="[Clerk Debug] ".concat(t," ").concat(i).concat(o,": ").concat(e.message).concat(s);switch(e.level){case"error":console.error(r);break;case"warn":console.warn(r);break;case"info":console.info(r);break;case"debug":console.debug(r);break;default:console.log(r)}return Promise.resolve()}}class l{async send(e){this.collector&&await Promise.resolve(this.collector.recordLog({context:e.context,level:e.level,message:e.message,organizationId:e.organizationId,sessionId:e.sessionId,source:e.source,timestamp:e.timestamp,userId:e.userId}))}constructor(e){(0,o._)(this,"collector",void 0),this.collector=e}}class a{static getInstance(){return a.instance||(a.instance=new a),a.instance}async initialize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.initialized?this.logger:(this.initializationPromise||(this.initializationPromise=this.performInitialization(e)),this.initializationPromise)}async performInitialization(e){try{if(e.logLevel&&"string"!=typeof e.logLevel)throw Error("logLevel must be a string");let{logLevel:t,telemetryCollector:i}=e,o=[{transport:new n},...i?[{transport:new l(i)}]:[]].map(e=>e.transport),a=new r(o),c=new s(a,null!=t?t:"info");return this.logger=c,this.initialized=!0,this.logger}catch(e){return console.error("Failed to initialize debug module:",e),this.initializationPromise=null,null}}getLogger(){return this.logger}isInitialized(){return this.initialized}reset(){this.initialized=!1,this.logger=null,this.initializationPromise=null}constructor(){(0,o._)(this,"initialized",!1),(0,o._)(this,"logger",null),(0,o._)(this,"initializationPromise",null)}}async function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a.getInstance().initialize(e)}(0,o._)(a,"instance",void 0)}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["698"],{1521(e,t,i){i.d(t,{getDebugLogger:()=>a}),i(7009);class r{logLevel;transport;constructor(e,t){this.transport=e,this.logLevel=t??"debug"}debug(e,t,i){this.log("debug",e,t,i)}error(e,t,i){this.log("error",e,t,i)}info(e,t,i){this.log("info",e,t,i)}warn(e,t,i){this.log("warn",e,t,i)}log(e,t,i,r){if(!this.shouldLogLevel(e))return;let s={timestamp:Date.now(),level:e,message:t,context:i,source:r};this.transport.send(s).catch(e=>{console.error("Failed to send log entry:",e)})}shouldLogLevel(e){let t=["error","warn","info","debug"],i=t.indexOf(this.logLevel);return t.indexOf(e)<=i}}class s{transports;constructor(e){this.transports=e}async send(e){let t=this.transports.map(t=>t.send(e).catch(e=>{console.error("Failed to send to transport:",e)}));await Promise.allSettled(t)}}class o{send(e){let t=new Date(e.timestamp).toISOString(),i=e.level.toUpperCase(),r=e.source?`[${e.source}]`:"",s=e.context?` ${JSON.stringify(e.context)}`:"",o=`[Clerk Debug] ${t} ${i}${r}: ${e.message}${s}`;switch(e.level){case"error":console.error(o);break;case"warn":console.warn(o);break;case"info":console.info(o);break;case"debug":console.debug(o);break;default:console.log(o)}return Promise.resolve()}}class n{collector;constructor(e){this.collector=e}async send(e){this.collector&&await Promise.resolve(this.collector.recordLog({context:e.context,level:e.level,message:e.message,organizationId:e.organizationId,sessionId:e.sessionId,source:e.source,timestamp:e.timestamp,userId:e.userId}))}}class l{static instance;initialized=!1;logger=null;initializationPromise=null;static getInstance(){return l.instance||(l.instance=new l),l.instance}async initialize(e={}){return this.initialized?this.logger:(this.initializationPromise||(this.initializationPromise=this.performInitialization(e)),this.initializationPromise)}async performInitialization(e){try{if(e.logLevel&&"string"!=typeof e.logLevel)throw Error("logLevel must be a string");let{logLevel:t,telemetryCollector:i}=e,l=[{transport:new o},...i?[{transport:new n(i)}]:[]].map(e=>e.transport),a=new s(l),c=new r(a,t??"info");return this.logger=c,this.initialized=!0,this.logger}catch(e){return console.error("Failed to initialize debug module:",e),this.initializationPromise=null,null}}getLogger(){return this.logger}isInitialized(){return this.initialized}reset(){this.initialized=!1,this.logger=null,this.initializationPromise=null}}async function a(e={}){return l.getInstance().initialize(e)}}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["818"],{8369(e,a,t){t.d(a,{offchainLookupSignature:()=>m,offchainLookup:()=>g});var s=t(18),r=t(385),n=t(5103),o=t(4441);class c extends n.C{constructor({callbackSelector:e,cause:a,data:t,extraData:s,sender:r,urls:n}){super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],a.metaMessages?.length?"":[],"Offchain Gateway Call:",n&&[" Gateway URL(s):",...n.map(e=>` ${(0,o.I)(e)}`)],` Sender: ${r}`,` Data: ${t}`,` Callback selector: ${e}`,` Extra data: ${s}`].flat(),name:"OffchainLookupError"})}}class i extends n.C{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,o.I)(a)}`,`Response: ${(0,r.A)(e)}`],name:"OffchainLookupResponseMalformedError"})}}class d extends n.C{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}var l=t(1181),u=t(8092),p=t(5581),f=t(1591),h=t(2845),y=t(8828),w=t(9398);let m="0x556f1830",k={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function g(e,{blockNumber:a,blockTag:t,data:r,to:n}){let{args:o}=(0,u.W)({data:r,abi:[k]}),[i,l,y,m,C]=o,{ccipRead:O}=e,x=O&&"function"==typeof O?.request?O.request:b;try{if(!(0,f.h)(n,i))throw new d({sender:i,to:n});let r=l.includes(w.J)?await (0,w.X)({data:y,ccipRequest:x}):await x({data:y,sender:i,urls:l}),{data:o}=await (0,s.T)(e,{blockNumber:a,blockTag:t,data:(0,h.xW)([m,(0,p.h)([{type:"bytes"},{type:"bytes"}],[r,C])]),to:n});return o}catch(e){throw new c({callbackSelector:m,cause:e,data:r,extraData:C,sender:i,urls:l})}}async function b({data:e,sender:a,urls:t}){let s=Error("An unknown error occurred.");for(let n=0;n<t.length;n++){let o=t[n],c=o.includes("{data}")?"GET":"POST",d="POST"===c?{data:e,sender:a}:void 0,u="POST"===c?{"Content-Type":"application/json"}:{};try{let t,n=await fetch(o.replace("{sender}",a.toLowerCase()).replace("{data}",e),{body:JSON.stringify(d),headers:u,method:c});if(t=n.headers.get("Content-Type")?.startsWith("application/json")?(await n.json()).data:await n.text(),!n.ok){s=new l.Ci({body:d,details:t?.error?(0,r.A)(t.error):n.statusText,headers:n.headers,status:n.status,url:o});continue}if(!(0,y.q)(t)){s=new i({result:t,url:o});continue}return t}catch(e){s=new l.Ci({body:d,details:e.message,url:o})}}throw s}}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["832"],{8755(r,e,n){n.r(e),n.d(e,{loadStripe:()=>h});var t,o="https://js.stripe.com/v3",i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,l=function(){for(var r=document.querySelectorAll('script[src^="'.concat(o,'"]')),e=0;e<r.length;e++){var n=r[e];if(i.test(n.src))return n}return null},u=function(r){var e=r&&!r.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(o).concat(e);var t=document.head||document.body;if(!t)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return t.appendChild(n),n},c=function(r,e){r&&r._registerWrapper&&r._registerWrapper({name:"stripe-js",version:"5.6.0",startTime:e})},a=null,s=null,d=null,p=function(r,e,n){if(null===r)return null;var t=r.apply(void 0,e);return c(t,n),t},v=!1,f=function(){return t||(t=(null!==a?a:(a=new Promise(function(r,e){if("u"<typeof window||"u"<typeof document)return void r(null);if(window.Stripe,window.Stripe)return void r(window.Stripe);try{var n,t=l();t?t&&null!==d&&null!==s&&(t.removeEventListener("load",d),t.removeEventListener("error",s),null==(n=t.parentNode)||n.removeChild(t),t=u(null)):t=u(null),d=function(){window.Stripe?r(window.Stripe):e(Error("Stripe.js not available"))},s=function(){e(Error("Failed to load Stripe.js"))},t.addEventListener("load",d),t.addEventListener("error",s)}catch(r){e(r);return}})).catch(function(r){return a=null,Promise.reject(r)})).catch(function(r){return t=null,Promise.reject(r)}))};Promise.resolve().then(function(){return f()}).catch(function(r){v||console.warn(r)});var h=function(){for(var r=arguments.length,e=Array(r),n=0;n<r;n++)e[n]=arguments[n];v=!0;var t=Date.now();return f().then(function(r){return p(r,e,t)})}}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

18
node_modules/@clerk/clerk-js/dist/clerk.browser.js generated vendored Normal file

File diff suppressed because one or more lines are too long

62
node_modules/@clerk/clerk-js/dist/clerk.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

62
node_modules/@clerk/clerk-js/dist/clerk.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

18
node_modules/@clerk/clerk-js/dist/clerk.native.js generated vendored Normal file

File diff suppressed because one or more lines are too long

19
node_modules/@clerk/clerk-js/dist/clerk.no-rhc.js generated vendored Normal file

File diff suppressed because one or more lines are too long

19
node_modules/@clerk/clerk-js/dist/clerk.no-rhc.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["811"],{8488(){}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["811"],{8488(){}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["279"],{8755(r,e,n){n.r(e),n.d(e,{loadStripe:()=>h});var t,o="https://js.stripe.com/v3",i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,l=function(){for(var r=document.querySelectorAll('script[src^="'.concat(o,'"]')),e=0;e<r.length;e++){var n=r[e];if(i.test(n.src))return n}return null},u=function(r){var e=r&&!r.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(o).concat(e);var t=document.head||document.body;if(!t)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return t.appendChild(n),n},c=function(r,e){r&&r._registerWrapper&&r._registerWrapper({name:"stripe-js",version:"5.6.0",startTime:e})},a=null,s=null,d=null,p=function(r,e,n){if(null===r)return null;var t=r.apply(void 0,e);return c(t,n),t},v=!1,f=function(){return t||(t=(null!==a?a:(a=new Promise(function(r,e){if("u"<typeof window||"u"<typeof document)return void r(null);if(window.Stripe,window.Stripe)return void r(window.Stripe);try{var n,t=l();t?t&&null!==d&&null!==s&&(t.removeEventListener("load",d),t.removeEventListener("error",s),null==(n=t.parentNode)||n.removeChild(t),t=u(null)):t=u(null),d=function(){window.Stripe?r(window.Stripe):e(Error("Stripe.js not available"))},s=function(){e(Error("Failed to load Stripe.js"))},t.addEventListener("load",d),t.addEventListener("error",s)}catch(r){e(r);return}})).catch(function(r){return a=null,Promise.reject(r)})).catch(function(r){return t=null,Promise.reject(r)}))};Promise.resolve().then(function(){return f()}).catch(function(r){v||console.warn(r)});var h=function(){for(var r=arguments.length,e=Array(r),n=0;n<r;n++)e[n]=arguments[n];v=!0;var t=Date.now();return f().then(function(r){return p(r,e,t)})}}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["279"],{8755(r,e,n){n.r(e),n.d(e,{loadStripe:()=>h}),n(5281),n(5254),n(3560);var t,o="https://js.stripe.com/v3",i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,l=function(){for(var r=document.querySelectorAll('script[src^="'.concat(o,'"]')),e=0;e<r.length;e++){var n=r[e];if(i.test(n.src))return n}return null},u=function(r){var e=r&&!r.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(o).concat(e);var t=document.head||document.body;if(!t)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return t.appendChild(n),n},c=function(r,e){r&&r._registerWrapper&&r._registerWrapper({name:"stripe-js",version:"5.6.0",startTime:e})},a=null,s=null,d=null,p=function(r,e,n){if(null===r)return null;var t=r.apply(void 0,e);return c(t,n),t},v=!1,f=function(){return t||(t=(null!==a?a:(a=new Promise(function(r,e){if("u"<typeof window||"u"<typeof document)return void r(null);if(window.Stripe,window.Stripe)return void r(window.Stripe);try{var n,t=l();t?t&&null!==d&&null!==s&&(t.removeEventListener("load",d),t.removeEventListener("error",s),null==(n=t.parentNode)||n.removeChild(t),t=u(null)):t=u(null),d=function(){window.Stripe?r(window.Stripe):e(Error("Stripe.js not available"))},s=function(){e(Error("Failed to load Stripe.js"))},t.addEventListener("load",d),t.addEventListener("error",s)}catch(r){e(r);return}})).catch(function(r){return a=null,Promise.reject(r)})).catch(function(r){return t=null,Promise.reject(r)}))};Promise.resolve().then(function(){return f()}).catch(function(r){v||console.warn(r)});var h=function(){for(var r=arguments.length,e=Array(r),n=0;n<r;n++)e[n]=arguments[n];v=!0;var t=Date.now();return f().then(function(r){return p(r,e,t)})}}}]);

View File

@@ -0,0 +1,54 @@
import type { createClerkEventBus } from '@clerk/shared/clerkEventBus';
import type { Clerk, InstanceType } from '@clerk/shared/types';
import type { FapiClient } from '../fapiClient';
/**
* The AuthCookieService class is a service responsible to handle
* all operations and helpers required in a standard browser context
* based on the cookies to remove the dependency between cookies
* and auth from the Clerk instance.
* This service is responsible to:
* - refresh the session cookie using a poller
* - refresh the session cookie on tab visibility change
* - update the related cookies listening to the `token:update` event
* - initialize auth related cookies for development instances (eg __client_uat, __clerk_db_jwt)
* - cookie setup for production / development instances
* It also provides the following helpers:
* - isSignedOut(): check if the current user is signed-out using cookies
* - decorateUrlWithDevBrowserToken(): decorates url with auth related info (eg dev browser)
* - handleUnauthenticatedDevBrowser(): resets dev browser in case of invalid dev browser
*/
export declare class AuthCookieService {
private clerk;
private instanceType;
private clerkEventBus;
private poller;
private clientUat;
private sessionCookie;
private activeCookie;
private devBrowser;
static create(clerk: Clerk, fapiClient: FapiClient, instanceType: InstanceType, clerkEventBus: ReturnType<typeof createClerkEventBus>): Promise<AuthCookieService>;
private constructor();
setup(): Promise<void>;
isSignedOut(): boolean;
handleUnauthenticatedDevBrowser(): Promise<void>;
decorateUrlWithDevBrowserToken(url: URL): URL;
private setupDevelopment;
private setupProduction;
startPollingForToken(): void;
stopPollingForToken(): void;
private refreshTokenOnFocus;
private refreshSessionToken;
private updateSessionCookie;
setClientUatCookieForDevelopmentInstances(): void;
private inCustomDevelopmentDomain;
private handleGetTokenError;
private handleSignOut;
/**
* The below methods handle active context tracking (session and organization) to ensure
* only tabs with matching context can update the session cookie.
* The format of the cookie value is "<session id>:<org id>" where either part can be empty.
*/
setActiveContextInStorage(): void;
private isCurrentContextActive;
getSessionCookie(): string | undefined;
}

View File

@@ -0,0 +1,19 @@
import { CaptchaChallenge } from '../../utils/captcha/CaptchaChallenge';
import type { Clerk } from '../resources/internal';
export declare class CaptchaHeartbeat {
private clerk;
private captchaChallenge;
private timers;
constructor(clerk: Clerk, captchaChallenge?: CaptchaChallenge, timers?: {
setTimeout: (cb: () => void, ms: number) => number;
setInterval: (cb: () => void, ms: number) => number;
clearTimeout: (id: number) => void;
clearInterval: (id: number) => void;
cleanup: (..._args: any[]) => void;
});
start(): Promise<void>;
private challengeAndSend;
private isEnabled;
private clientBypass;
private intervalInMs;
}

View File

@@ -0,0 +1,9 @@
export declare const POLLER_INTERVAL_IN_MS: number;
export declare class SessionCookiePoller {
private lock;
private workerTimers;
private timerId;
private initiated;
startPollingForSessionToken(cb: () => Promise<unknown>): void;
stopPollingForSessionToken(): void;
}

View File

@@ -0,0 +1 @@
export declare function getCookieSuffix(publishableKey: string): Promise<any>;

View File

@@ -0,0 +1,5 @@
export declare const createActiveContextCookie: () => {
set: (value: string) => void;
get: () => string | undefined;
remove: () => void;
};

View File

@@ -0,0 +1,15 @@
import type { ClientResource } from '@clerk/shared/types';
export type ClientUatCookieHandler = {
set: (client: ClientResource | undefined) => void;
get: () => number;
};
export type ClientUatCookieOptions = {
usePartitionedCookies: () => boolean;
};
/**
* Create a long-lived JS cookie to store the client last updated_at timestamp
* for development instances (for production instance is set by FAPI).
* The cookie is used as hint from the Clerk Backend packages to identify
* if the user is authenticated or not.
*/
export declare const createClientUatCookie: (cookieSuffix: string, options: ClientUatCookieOptions) => ClientUatCookieHandler;

View File

@@ -0,0 +1,15 @@
export type DevBrowserCookieHandler = {
set: (devBrowser: string) => void;
get: () => string | undefined;
remove: () => void;
};
export type DevBrowserCookieOptions = {
usePartitionedCookies: () => boolean;
};
/**
* Create a long-lived JS cookie to store the dev browser token
* ONLY for development instances.
* The cookie is used to authenticate FAPI requests and pass
* authentication from AP to the app.
*/
export declare const createDevBrowserCookie: (cookieSuffix: string, options: DevBrowserCookieOptions) => DevBrowserCookieHandler;

View File

@@ -0,0 +1 @@
export { isThirdPartyCookieDomain as requiresSameSiteNone } from '@clerk/shared/internal/clerk-js/thirdPartyDomains';

View File

@@ -0,0 +1,14 @@
export type SessionCookieHandler = {
set: (token: string) => void;
remove: () => void;
get: () => string | undefined;
};
export type SessionCookieOptions = {
usePartitionedCookies: () => boolean;
};
/**
* Create a short-lived JS cookie to store the current user JWT.
* The cookie is used by the Clerk backend SDKs to identify
* the authenticated user.
*/
export declare const createSessionCookie: (cookieSuffix: string, options: SessionCookieOptions) => SessionCookieHandler;

View File

@@ -0,0 +1,17 @@
import type { FapiClient } from '../fapiClient';
import type { DevBrowserCookieOptions } from './cookies/devBrowser';
export interface DevBrowser {
clear(): void;
setup(): Promise<void>;
getDevBrowser(): string | undefined;
setDevBrowser(devBrowser: string): void;
removeDevBrowser(): void;
refreshCookies(): void;
}
export type CreateDevBrowserOptions = {
frontendApi: string;
cookieSuffix: string;
fapiClient: FapiClient;
cookieOptions: DevBrowserCookieOptions;
};
export declare function createDevBrowser({ cookieSuffix, frontendApi, fapiClient, cookieOptions, }: CreateDevBrowserOptions): DevBrowser;

View File

@@ -0,0 +1,16 @@
/**
* @param hostname - The hostname to determine the eTLD+1 for.
* @param cookieHandler - The cookie handler to use for the eTLD+1 probe.
* @param cookieAttributes - Optional cookie attributes (sameSite, secure) to use
* during the eTLD+1 probe. These should match the attributes that will be used
* when setting the actual cookie, so the probe accurately reflects whether a
* domain-scoped cookie can be set in the current context.
*/
export declare function getCookieDomain(hostname?: string, cookieHandler?: {
get(): string | undefined;
set(newValue: string, options?: Cookies.CookieAttributes): void;
remove(cookieAttributes?: Cookies.CookieAttributes): void;
}, cookieAttributes?: {
sameSite?: string;
secure?: boolean;
}): string;

View File

@@ -0,0 +1,3 @@
type SameSiteAttributeType = 'None' | 'Lax' | 'Strict';
export declare const getSecureAttribute: (sameSite: SameSiteAttributeType) => boolean;
export {};

View File

@@ -0,0 +1,3 @@
export declare function SafeLock(key: string): {
acquireLockAndRun: (cb: () => Promise<unknown>) => Promise<any>;
};

221
node_modules/@clerk/clerk-js/dist/types/core/clerk.d.ts generated vendored Normal file
View File

@@ -0,0 +1,221 @@
import { TelemetryCollector } from '@clerk/shared/telemetry';
import type { __experimental_CheckoutOptions, __internal_AttemptToEnableEnvironmentSettingParams, __internal_AttemptToEnableEnvironmentSettingResult, __internal_CheckoutProps, __internal_EnableOrganizationsPromptProps, __internal_OAuthConsentProps, __internal_PlanDetailsProps, __internal_SubscriptionDetailsProps, __internal_UserVerificationModalProps, APIKeysNamespace, APIKeysProps, AuthenticateWithBaseParams, AuthenticateWithCoinbaseWalletParams, AuthenticateWithGoogleOneTapParams, AuthenticateWithMetamaskParams, AuthenticateWithOKXWalletParams, AuthenticateWithSolanaParams, BillingNamespace, CheckoutSignalValue, Clerk as ClerkInterface, ClerkAPIError, ClerkAuthenticateWithWeb3Params, ClerkOptions, ClientJSONSnapshot, ClientResource, CreateOrganizationParams, CreateOrganizationProps, CredentialReturn, DomainOrProxyUrl, EnvironmentJSON, EnvironmentJSONSnapshot, EnvironmentResource, GoogleOneTapProps, HandleEmailLinkVerificationParams, HandleOAuthCallbackParams, InstanceType, JoinWaitlistParams, ListenerCallback, ListenerOptions, NavigateOptions, OAuthApplicationNamespace, OrganizationListProps, OrganizationProfileProps, OrganizationResource, OrganizationSwitcherProps, PricingTableProps, PublicKeyCredentialCreationOptionsWithoutExtensions, PublicKeyCredentialRequestOptionsWithoutExtensions, PublicKeyCredentialWithAuthenticatorAssertionResponse, PublicKeyCredentialWithAuthenticatorAttestationResponse, Resources, SDKMetadata, SetActiveParams, SignedInSessionResource, SignInProps, SignInRedirectOptions, SignInResource, SignOut, SignUpProps, SignUpRedirectOptions, SignUpResource, TaskChooseOrganizationProps, TaskResetPasswordProps, TaskSetupMFAProps, TasksRedirectOptions, UnsubscribeCallback, UserAvatarProps, UserButtonProps, UserProfileProps, UserResource, WaitlistProps, WaitlistResource } from '@clerk/shared/types';
import type { ClerkUI } from '@clerk/shared/ui';
import type { QueryClient } from '@tanstack/query-core';
import type { FapiClient, FapiRequestCallback } from './fapiClient';
import { State } from './state';
declare global {
interface Window {
Clerk?: Clerk;
__clerk_publishable_key?: string;
__clerk_proxy_url?: ClerkInterface['proxyUrl'];
__clerk_domain?: ClerkInterface['domain'];
}
}
export declare class Clerk implements ClerkInterface {
#private;
static version: string;
static sdkMetadata: SDKMetadata;
private static _billing;
private static _apiKeys;
private static _oauthApplication;
private _checkout;
client: ClientResource | undefined;
session: SignedInSessionResource | null | undefined;
organization: OrganizationResource | null | undefined;
user: UserResource | null | undefined;
__internal_country?: string | null;
telemetry: TelemetryCollector | undefined;
readonly __internal_state: State;
protected internal_last_error: ClerkAPIError | null;
protected environment?: EnvironmentResource | null;
get __internal_queryClient(): {
__tag: 'clerk-rq-client';
client: QueryClient;
} | undefined;
__internal_getCachedResources: (() => Promise<{
client: ClientJSONSnapshot | null;
environment: EnvironmentJSONSnapshot | null;
}>) | undefined;
__internal_createPublicCredentials: ((publicKey: PublicKeyCredentialCreationOptionsWithoutExtensions) => Promise<CredentialReturn<PublicKeyCredentialWithAuthenticatorAttestationResponse>>) | undefined;
__internal_getPublicCredentials: (({ publicKeyOptions, }: {
publicKeyOptions: PublicKeyCredentialRequestOptionsWithoutExtensions;
}) => Promise<CredentialReturn<PublicKeyCredentialWithAuthenticatorAssertionResponse>>) | undefined;
__internal_isWebAuthnSupported: (() => boolean) | undefined;
__internal_isWebAuthnAutofillSupported: (() => Promise<boolean>) | undefined;
__internal_isWebAuthnPlatformAuthenticatorSupported: (() => Promise<boolean>) | undefined;
__internal_setActiveInProgress: boolean;
get publishableKey(): string;
get version(): string;
set sdkMetadata(metadata: SDKMetadata);
get sdkMetadata(): SDKMetadata;
get loaded(): boolean;
get status(): ClerkInterface['status'];
get isSatellite(): boolean;
get domain(): string;
get proxyUrl(): string;
get frontendApi(): string;
get instanceType(): InstanceType | undefined;
get isStandardBrowser(): boolean;
get billing(): BillingNamespace;
get apiKeys(): APIKeysNamespace;
get oauthApplication(): OAuthApplicationNamespace;
__experimental_checkout(options: __experimental_CheckoutOptions): CheckoutSignalValue;
__internal_getOption<K extends keyof ClerkOptions>(key: K): ClerkOptions[K];
get isSignedIn(): boolean;
constructor(key: string, options?: DomainOrProxyUrl);
getFapiClient: () => FapiClient;
load: (options?: ClerkOptions) => Promise<void>;
signOut: SignOut;
openGoogleOneTap: (props?: GoogleOneTapProps) => void;
closeGoogleOneTap: () => void;
openSignIn: (props?: SignInProps) => void;
closeSignIn: () => void;
__internal_openCheckout: (props?: __internal_CheckoutProps) => void;
__internal_closeCheckout: () => void;
__internal_openPlanDetails: (props: __internal_PlanDetailsProps) => void;
__internal_closePlanDetails: () => void;
__internal_openSubscriptionDetails: (props?: __internal_SubscriptionDetailsProps) => void;
__internal_closeSubscriptionDetails: () => void;
__internal_openReverification: (props?: __internal_UserVerificationModalProps) => void;
__internal_closeReverification: () => void;
__internal_attemptToEnableEnvironmentSetting: (params: __internal_AttemptToEnableEnvironmentSettingParams) => __internal_AttemptToEnableEnvironmentSettingResult;
__internal_openEnableOrganizationsPrompt: (props: __internal_EnableOrganizationsPromptProps) => void;
__internal_closeEnableOrganizationsPrompt: () => void;
__internal_openBlankCaptchaModal: () => Promise<unknown>;
__internal_closeBlankCaptchaModal: () => Promise<unknown>;
__internal_loadStripeJs: () => Promise<((publishableKey: string, options?: import("@stripe/stripe-js").StripeConstructorOptions | undefined) => Promise<import("@stripe/stripe-js").Stripe | null>) | {
loadStripe: () => Promise<null>;
}>;
openSignUp: (props?: SignUpProps) => void;
closeSignUp: () => void;
openUserProfile: (props?: UserProfileProps) => void;
closeUserProfile: () => void;
openOrganizationProfile: (props?: OrganizationProfileProps) => void;
closeOrganizationProfile: () => void;
openCreateOrganization: (props?: CreateOrganizationProps) => void;
closeCreateOrganization: () => void;
openWaitlist: (props?: WaitlistProps) => void;
closeWaitlist: () => void;
mountSignIn: (node: HTMLDivElement, props?: SignInProps) => void;
unmountSignIn: (node: HTMLDivElement) => void;
mountUserAvatar: (node: HTMLDivElement, props?: UserAvatarProps) => void;
unmountUserAvatar: (node: HTMLDivElement) => void;
mountSignUp: (node: HTMLDivElement, props?: SignUpProps) => void;
unmountSignUp: (node: HTMLDivElement) => void;
mountUserProfile: (node: HTMLDivElement, props?: UserProfileProps) => void;
unmountUserProfile: (node: HTMLDivElement) => void;
mountOrganizationProfile: (node: HTMLDivElement, props?: OrganizationProfileProps) => void;
unmountOrganizationProfile: (node: HTMLDivElement) => void;
mountCreateOrganization: (node: HTMLDivElement, props?: CreateOrganizationProps) => void;
unmountCreateOrganization: (node: HTMLDivElement) => void;
mountOrganizationSwitcher: (node: HTMLDivElement, props?: OrganizationSwitcherProps) => void;
unmountOrganizationSwitcher: (node: HTMLDivElement) => void;
__experimental_prefetchOrganizationSwitcher: () => void;
mountOrganizationList: (node: HTMLDivElement, props?: OrganizationListProps) => void;
unmountOrganizationList: (node: HTMLDivElement) => void;
mountUserButton: (node: HTMLDivElement, props?: UserButtonProps) => void;
unmountUserButton: (node: HTMLDivElement) => void;
mountWaitlist: (node: HTMLDivElement, props?: WaitlistProps) => void;
unmountWaitlist: (node: HTMLDivElement) => void;
mountPricingTable: (node: HTMLDivElement, props?: PricingTableProps) => void;
unmountPricingTable: (node: HTMLDivElement) => void;
__internal_mountOAuthConsent: (node: HTMLDivElement, props?: __internal_OAuthConsentProps) => void;
__internal_unmountOAuthConsent: (node: HTMLDivElement) => void;
/**
* Mount an API keys component at the target element.
* @param targetNode Target to mount the APIKeys component.
* @param props Configuration parameters.
*/
mountAPIKeys: (node: HTMLDivElement, props?: APIKeysProps) => void;
/**
* Unmount an API keys component from the target element.
* If there is no component mounted at the target node, results in a noop.
*
* @param targetNode Target node to unmount the APIKeys component from.
*/
unmountAPIKeys: (node: HTMLDivElement) => void;
mountTaskChooseOrganization: (node: HTMLDivElement, props?: TaskChooseOrganizationProps) => void;
unmountTaskChooseOrganization: (node: HTMLDivElement) => void;
mountTaskResetPassword: (node: HTMLDivElement, props?: TaskResetPasswordProps) => void;
unmountTaskResetPassword: (node: HTMLDivElement) => void;
mountTaskSetupMFA: (node: HTMLDivElement, props?: TaskSetupMFAProps) => void;
unmountTaskSetupMFA: (node: HTMLDivElement) => void;
/**
* `setActive` can be used to set the active session and/or organization.
*/
setActive: (params: SetActiveParams) => Promise<void>;
addListener: (listener: ListenerCallback, options?: ListenerOptions) => UnsubscribeCallback;
on: ClerkInterface['on'];
off: ClerkInterface['off'];
__internal_addNavigationListener: (listener: () => void) => UnsubscribeCallback;
navigate: (to: string | undefined, options?: NavigateOptions) => Promise<unknown>;
buildUrlWithAuth(to: string): string;
buildSignInUrl(options?: SignInRedirectOptions): string;
buildSignUpUrl(options?: SignUpRedirectOptions): string;
buildUserProfileUrl(): string;
buildHomeUrl(): string;
buildAfterSignInUrl({ params }?: {
params?: URLSearchParams;
}): string;
buildAfterSignUpUrl({ params }?: {
params?: URLSearchParams;
}): string;
buildAfterSignOutUrl(): string;
buildNewSubscriptionRedirectUrl(): string;
buildWaitlistUrl(options?: {
initialValues?: Record<string, string>;
}): string;
buildAfterMultiSessionSingleSignOutUrl(): string;
buildCreateOrganizationUrl(): string;
buildOrganizationProfileUrl(): string;
buildTasksUrl(options?: TasksRedirectOptions): string;
redirectWithAuth: (to: string) => Promise<unknown>;
redirectToSignIn: (options?: SignInRedirectOptions) => Promise<unknown>;
redirectToSignUp: (options?: SignUpRedirectOptions) => Promise<unknown>;
redirectToUserProfile: () => Promise<unknown>;
redirectToCreateOrganization: () => Promise<unknown>;
redirectToOrganizationProfile: () => Promise<unknown>;
redirectToAfterSignIn: () => Promise<unknown>;
redirectToAfterSignUp: () => Promise<unknown>;
redirectToAfterSignOut: () => Promise<unknown>;
redirectToWaitlist: () => Promise<unknown>;
redirectToTasks: (options?: TasksRedirectOptions) => Promise<unknown>;
handleEmailLinkVerification: (params: HandleEmailLinkVerificationParams, customNavigate?: (to: string) => Promise<unknown>) => Promise<unknown>;
handleGoogleOneTapCallback: (signInOrUp: SignInResource | SignUpResource, params: HandleOAuthCallbackParams, customNavigate?: (to: string) => Promise<unknown>) => Promise<unknown>;
private _handleRedirectCallback;
handleRedirectCallback: (params?: HandleOAuthCallbackParams, customNavigate?: (to: string) => Promise<unknown>) => Promise<unknown>;
handleUnauthenticated: (opts?: {
broadcast: boolean;
}) => Promise<unknown>;
__internal_handleUnauthenticatedDevBrowser: () => Promise<void>;
authenticateWithGoogleOneTap: (params: AuthenticateWithGoogleOneTapParams) => Promise<SignInResource | SignUpResource>;
authenticateWithMetamask: (props?: AuthenticateWithMetamaskParams) => Promise<void>;
authenticateWithCoinbaseWallet: (props?: AuthenticateWithCoinbaseWalletParams) => Promise<void>;
authenticateWithBase: (props?: AuthenticateWithBaseParams) => Promise<void>;
authenticateWithOKXWallet: (props?: AuthenticateWithOKXWalletParams) => Promise<void>;
authenticateWithSolana: (props: AuthenticateWithSolanaParams) => Promise<void>;
authenticateWithWeb3: ({ redirectUrl, signUpContinueUrl, customNavigate, unsafeMetadata, strategy, legalAccepted, secondFactorUrl, walletName, }: ClerkAuthenticateWithWeb3Params) => Promise<void>;
createOrganization: ({ name, slug }: CreateOrganizationParams) => Promise<OrganizationResource>;
getOrganization: (organizationId: string) => Promise<OrganizationResource>;
joinWaitlist: ({ emailAddress }: JoinWaitlistParams) => Promise<WaitlistResource>;
updateEnvironment(environment: EnvironmentResource): asserts this is {
environment: EnvironmentResource;
};
__internal_setCountry: (country: string | null) => void;
get __internal_last_error(): ClerkAPIError | null;
set __internal_last_error(value: ClerkAPIError | null);
updateClient: (newClient: ClientResource, options?: {
__internal_dangerouslySkipEmit?: boolean;
}) => void;
get __internal_environment(): EnvironmentResource | null | undefined;
__internal_setEnvironment: (env: EnvironmentJSON) => Promise<void>;
__internal_onBeforeRequest: (callback: FapiRequestCallback<any>) => void;
__internal_onAfterResponse: (callback: FapiRequestCallback<any>) => void;
__internal_updateProps: (_props: any) => Promise<void> | undefined;
__internal_navigateWithError(to: string, err: ClerkAPIError): Promise<unknown>;
private shouldFallbackToCachedResources;
__internal_reloadInitialResources: () => Promise<void>;
__internal_lastEmittedResources: Resources | undefined;
assertComponentsReady(val: unknown): asserts val is ClerkUI;
}

View File

@@ -0,0 +1,6 @@
/**
* Re-exporting constants from @clerk/shared to avoid refactoring all imports.
* The constants have been moved to @clerk/shared/internal/clerk-js/constants
* to make them available across all Clerk packages.
*/
export * from '@clerk/shared/internal/clerk-js/constants';

View File

@@ -0,0 +1 @@
export * from '@clerk/shared/internal/clerk-js/errors';

View File

@@ -0,0 +1,48 @@
import type { ClerkError } from '@clerk/shared/error';
import type { TokenResource } from '@clerk/shared/types';
import type { BaseResource } from './resources/Base';
export declare const events: {
readonly TokenUpdate: "token:update";
readonly UserSignOut: "user:signOut";
readonly EnvironmentUpdate: "environment:update";
readonly SessionTokenResolved: "session:tokenResolved";
readonly ResourceUpdate: "resource:update";
readonly ResourceError: "resource:error";
readonly ResourceFetch: "resource:fetch";
};
type TokenUpdatePayload = {
token: TokenResource | null;
};
export type ResourceUpdatePayload = {
resource: BaseResource;
};
export type ResourceErrorPayload = {
resource: BaseResource;
error: ClerkError | null;
};
export type ResourceFetchPayload = {
resource: BaseResource;
status: 'idle' | 'fetching';
};
type InternalEvents = {
[events.TokenUpdate]: TokenUpdatePayload;
[events.UserSignOut]: null;
[events.EnvironmentUpdate]: null;
[events.SessionTokenResolved]: null;
[events.ResourceUpdate]: ResourceUpdatePayload;
[events.ResourceError]: ResourceErrorPayload;
[events.ResourceFetch]: ResourceFetchPayload;
};
export declare const eventBus: {
on: <Event extends keyof InternalEvents>(event: Event, handler: (payload: InternalEvents[Event]) => void, opts?: {
notify?: boolean;
}) => void;
prioritizedOn: <Event extends keyof InternalEvents>(event: Event, handler: (payload: InternalEvents[Event]) => void) => void;
emit: <Event extends keyof InternalEvents>(event: Event, payload: InternalEvents[Event]) => void;
off: <Event extends keyof InternalEvents>(event: Event, handler?: ((payload: InternalEvents[Event]) => void) | undefined) => void;
prioritizedOff: <Event extends keyof InternalEvents>(event: Event, handler?: ((payload: InternalEvents[Event]) => void) | undefined) => void;
internal: {
retrieveListeners: <Event extends keyof InternalEvents>(event: Event) => Array<(...args: any[]) => void>;
};
};
export {};

View File

@@ -0,0 +1,43 @@
import type { ClerkAPIErrorJSON, ClientJSON, InstanceType } from '@clerk/shared/types';
export type HTTPMethod = 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
export type FapiRequestInit = RequestInit & {
path?: string;
search?: ConstructorParameters<typeof URLSearchParams>[0];
sessionId?: string;
rotatingTokenNonce?: string;
pathPrefix?: string;
url?: URL;
};
type FapiRequestOptions = {
fetchMaxTries?: number;
};
export type FapiResponse<T> = Response & {
payload: FapiResponseJSON<T> | null;
};
export type FapiRequestCallback<T> = (request: FapiRequestInit, response?: FapiResponse<T>) => unknown;
export interface FapiResponseJSON<T> {
response: T;
client?: ClientJSON;
errors?: ClerkAPIErrorJSON[];
meta?: {
client?: ClientJSON;
session_id?: string;
};
}
export interface FapiClient {
buildUrl(requestInit: FapiRequestInit): URL;
buildEmailAddress(localPart: string): string;
onAfterResponse(callback: FapiRequestCallback<unknown>): void;
onBeforeRequest(callback: FapiRequestCallback<unknown>): void;
request<T>(requestInit: FapiRequestInit, options?: FapiRequestOptions): Promise<FapiResponse<T>>;
}
type FapiClientOptions = {
frontendApi: string;
domain?: string;
proxyUrl?: string;
instanceType: InstanceType;
getSessionId: () => string | undefined;
isSatellite?: boolean;
};
export declare function createFapiClient(options: FapiClientOptions): FapiClient;
export {};

View File

@@ -0,0 +1,19 @@
import type { Clerk } from './resources/internal';
export declare class FraudProtection {
private client;
private CaptchaChallengeImpl;
private static instance;
private inflightException;
private captchaRetryCount;
private readonly MAX_RETRY_ATTEMPTS;
static getInstance(): FraudProtection;
private constructor();
execute<T extends () => Promise<any>, R = Awaited<ReturnType<T>>>(clerk: Clerk, cb: T): Promise<R>;
managedChallenge(clerk: Clerk): Promise<{
captchaError?: string;
captchaAction?: string;
captchaToken?: string;
captchaWidgetType?: import("@clerk/shared/types").CaptchaWidgetType;
} | undefined>;
private captchaAttemptsExceeded;
}

View File

@@ -0,0 +1,6 @@
import { Client } from './resources/Client';
/**
* Create a new client instance from a jwt.
* The caller is responsible for reading the jwt from the `__session` cookie.
*/
export declare function createClientFromJwt(jwt: string | undefined | null): Client;

View File

@@ -0,0 +1,15 @@
import type { APIKeyResource, APIKeysNamespace, ClerkPaginatedResponse, CreateAPIKeyParams, GetAPIKeysParams, RevokeAPIKeyParams } from '@clerk/shared/types';
export declare class APIKeys implements APIKeysNamespace {
#private;
/**
* Retrieves a paginated list of API keys.
*
* The subject (owner) is resolved in the following order:
* 1. Explicit `subject` param (user or organization ID)
* 2. Active organization ID
* 3. Current user ID
*/
getAll(params?: GetAPIKeysParams): Promise<ClerkPaginatedResponse<APIKeyResource>>;
create(params: CreateAPIKeyParams): Promise<APIKeyResource>;
revoke(params: RevokeAPIKeyParams): Promise<APIKeyResource>;
}

View File

@@ -0,0 +1,2 @@
export * from './namespace';
export * from './payment-source-methods';

View File

@@ -0,0 +1,24 @@
import type { BillingNamespace, BillingPaymentResource, BillingPlanResource, BillingStatementResource, BillingSubscriptionResource, ClerkPaginatedResponse, CreateCheckoutParams, GetPaymentAttemptsParams, GetPlansParams, GetStatementsParams, GetSubscriptionParams } from '@clerk/shared/types';
import { BillingCheckout } from '../../resources/internal';
export declare class Billing implements BillingNamespace {
#private;
static path(subPath: string, param?: {
orgId?: string | null;
}): string;
getPlans: (params?: GetPlansParams) => Promise<ClerkPaginatedResponse<BillingPlanResource>>;
getPlan: (params: {
id: string;
}) => Promise<BillingPlanResource>;
getSubscription: (params: GetSubscriptionParams) => Promise<BillingSubscriptionResource>;
getStatements: (params: GetStatementsParams) => Promise<ClerkPaginatedResponse<BillingStatementResource>>;
getStatement: (params: {
id: string;
orgId?: string;
}) => Promise<BillingStatementResource>;
getPaymentAttempts: (params: GetPaymentAttemptsParams) => Promise<ClerkPaginatedResponse<BillingPaymentResource>>;
getPaymentAttempt: (params: {
id: string;
orgId?: string;
}) => Promise<BillingPaymentResource>;
startCheckout: (params: CreateCheckoutParams) => Promise<BillingCheckout>;
}

View File

@@ -0,0 +1,12 @@
import type { AddPaymentMethodParams, GetPaymentMethodsParams, InitializePaymentMethodParams } from '@clerk/shared/types';
import { BillingInitializedPaymentMethod, BillingPaymentMethod } from '../../resources/internal';
type WithOptionalOrgType<T> = T & {
orgId?: string;
};
export declare const initializePaymentMethod: (params: WithOptionalOrgType<InitializePaymentMethodParams>) => Promise<BillingInitializedPaymentMethod>;
export declare const addPaymentMethod: (params: WithOptionalOrgType<AddPaymentMethodParams>) => Promise<BillingPaymentMethod>;
export declare const getPaymentMethods: (params?: WithOptionalOrgType<GetPaymentMethodsParams>) => Promise<{
total_count: number;
data: BillingPaymentMethod[];
}>;
export {};

View File

@@ -0,0 +1,7 @@
import type { __experimental_CheckoutOptions, CheckoutSignalValue } from '@clerk/shared/types';
import type { Clerk } from '../../clerk';
/**
* Create a checkout instance with the given options
*/
declare function createCheckoutInstance(clerk: Clerk, options: __experimental_CheckoutOptions): CheckoutSignalValue;
export { createCheckoutInstance };

View File

@@ -0,0 +1,7 @@
import type { GetOAuthConsentInfoParams, OAuthApplicationNamespace, OAuthConsentInfo } from '@clerk/shared/types';
export declare class OAuthApplication implements OAuthApplicationNamespace {
getConsentInfo(params: GetOAuthConsentInfoParams): Promise<OAuthConsentInfo>;
buildConsentActionUrl({ clientId }: {
clientId: string;
}): string;
}

View File

@@ -0,0 +1,7 @@
import type { ProtectLoader } from '@clerk/shared/types';
import type { Environment } from './resources';
export declare class Protect {
#private;
load(env: Environment): void;
applyLoader(loader: ProtectLoader): void;
}

View File

@@ -0,0 +1,2 @@
import { QueryClient } from '@tanstack/query-core';
export { QueryClient };

View File

@@ -0,0 +1,24 @@
import type { ApiKeyJSON, APIKeyResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class APIKey extends BaseResource implements APIKeyResource {
pathRoot: string;
id: string;
type: string;
name: string;
subject: string;
scopes: string[];
claims: Record<string, any> | null;
revoked: boolean;
revocationReason: string | null;
expired: boolean;
expiration: Date | null;
createdBy: string | null;
description: string | null;
secret?: string;
lastUsedAt: Date | null;
createdAt: Date;
updatedAt: Date;
constructor(data: ApiKeyJSON);
protected fromJSON(data: ApiKeyJSON | null): this;
__internal_toSnapshot(): ApiKeyJSON;
}

View File

@@ -0,0 +1,12 @@
import type { APIKeysSettingsJSON, APIKeysSettingsJSONSnapshot, APIKeysSettingsResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
/**
* @internal
*/
export declare class APIKeySettings extends BaseResource implements APIKeysSettingsResource {
user_api_keys_enabled: boolean;
orgs_api_keys_enabled: boolean;
constructor(data?: APIKeysSettingsJSON | APIKeysSettingsJSONSnapshot | null);
protected fromJSON(data: APIKeysSettingsJSON | APIKeysSettingsJSONSnapshot | null): this;
__internal_toSnapshot(): APIKeysSettingsJSONSnapshot;
}

View File

@@ -0,0 +1,12 @@
import type { AuthConfigJSON, AuthConfigJSONSnapshot, AuthConfigResource, PhoneCodeChannel } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class AuthConfig extends BaseResource implements AuthConfigResource {
claimedAt: Date | null;
reverification: boolean;
singleSessionMode: boolean;
preferredChannels: Record<string, PhoneCodeChannel> | null;
sessionMinter: boolean;
constructor(data?: Partial<AuthConfigJSON> | null);
protected fromJSON(data: Partial<AuthConfigJSON> | null): this;
__internal_toSnapshot(): AuthConfigJSONSnapshot;
}

View File

@@ -0,0 +1,11 @@
import type { BackupCodeJSON, BackupCodeResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class BackupCode extends BaseResource implements BackupCodeResource {
pathRoot: string;
id: string;
codes: string[];
updatedAt: Date | null;
createdAt: Date | null;
constructor(data: BackupCodeJSON);
protected fromJSON(data: BackupCodeJSON | null): this;
}

View File

@@ -0,0 +1,45 @@
import type { ClerkResourceJSON, ClerkResourceReloadParams, DeletedObjectJSON } from '@clerk/shared/types';
import type { FapiClient, FapiRequestInit, FapiResponseJSON, HTTPMethod } from '../fapiClient';
import { type Clerk } from './internal';
export type BaseFetchOptions = ClerkResourceReloadParams & {
forceUpdateClient?: boolean;
skipUpdateClient?: boolean;
fetchMaxTries?: number;
};
export type BaseMutateParams = {
action?: string;
body?: any;
method?: HTTPMethod;
path?: string;
};
export declare abstract class BaseResource {
static clerk: Clerk;
id?: string;
pathRoot: string;
static get fapiClient(): FapiClient;
reload(params?: ClerkResourceReloadParams): Promise<this>;
isNew(): boolean;
static _fetch<J extends ClerkResourceJSON | DeletedObjectJSON | null>(requestInit: FapiRequestInit, opts?: BaseFetchOptions): Promise<FapiResponseJSON<J> | null>;
protected static _baseFetch<J extends ClerkResourceJSON | DeletedObjectJSON | null>(requestInit: FapiRequestInit, opts?: BaseFetchOptions): Promise<FapiResponseJSON<J> | null>;
protected static _updateClient<J>(responseJSON: FapiResponseJSON<J> | null): void;
protected path(action?: string): string;
protected abstract fromJSON(data: ClerkResourceJSON | null): this;
/**
* Returns the provided value if it is not `undefined` or `null`, otherwise returns the default value.
*
* @template T - The type of the value.
* @param value - The value to check.
* @param defaultValue - The default value to return if the provided value is `undefined` or `null`.
* @returns The provided value if it is not `undefined` or `null`, otherwise the default value.
*/
protected withDefault<T>(value: T | undefined | null, defaultValue: T): T;
protected _baseGet<J extends ClerkResourceJSON | null>(opts?: BaseFetchOptions): Promise<this>;
protected _baseMutate<J extends ClerkResourceJSON | null>(params: BaseMutateParams): Promise<this>;
protected _baseMutateBypass<J extends ClerkResourceJSON | null>(params: BaseMutateParams): Promise<this>;
protected _basePost<J extends ClerkResourceJSON | null>(params?: BaseMutateParams): Promise<this>;
protected _basePostBypass<J extends ClerkResourceJSON>(params?: BaseMutateParams): Promise<this>;
protected _basePut<J extends ClerkResourceJSON | null>(params?: BaseMutateParams): Promise<this>;
protected _basePatch<J extends ClerkResourceJSON>(params?: BaseMutateParams): Promise<this>;
protected _baseDelete<J extends ClerkResourceJSON | null>(params?: BaseMutateParams): Promise<void>;
private static shouldRethrowOfflineNetworkErrors;
}

View File

@@ -0,0 +1,79 @@
import type { ClerkError } from '@clerk/shared/error';
import type { BillingCheckoutJSON, BillingCheckoutResource, BillingCheckoutTotals, BillingPayerResource, BillingPaymentMethodResource, BillingSubscriptionPlanPeriod, CheckoutFlowFinalizeParams, CheckoutFlowResource, CheckoutFlowResourceNonStrict, CheckoutSignalValue, ConfirmCheckoutParams, CreateCheckoutParams } from '@clerk/shared/types';
import { BaseResource, BillingPlan } from './internal';
export declare class BillingCheckout extends BaseResource implements BillingCheckoutResource {
id: string;
externalClientSecret: string;
externalGatewayId: string;
paymentMethod?: BillingPaymentMethodResource;
plan: BillingPlan;
planPeriod: BillingSubscriptionPlanPeriod;
planPeriodStart: number | undefined;
status: 'needs_confirmation' | 'completed';
totals: BillingCheckoutTotals;
isImmediatePlanChange: boolean;
freeTrialEndsAt?: Date;
payer: BillingPayerResource;
needsPaymentMethod: boolean;
constructor(data?: BillingCheckoutJSON | null);
protected fromJSON(data: BillingCheckoutJSON | null): this;
confirm: (params: ConfirmCheckoutParams) => Promise<this>;
}
export declare const createSignals: () => {
resourceSignal: {
(): {
resource: CheckoutFlow | null;
};
(value: {
resource: CheckoutFlow | null;
}): void;
};
errorSignal: {
(): {
error: ClerkError | null;
};
(value: {
error: ClerkError | null;
}): void;
};
fetchSignal: {
(): {
status: "idle" | "fetching";
};
(value: {
status: "idle" | "fetching";
}): void;
};
computedSignal: () => Omit<CheckoutSignalValue, "checkout"> & {
checkout: CheckoutFlowResource | null;
};
};
export declare class CheckoutFlow implements CheckoutFlowResourceNonStrict {
private resource;
private readonly config;
private readonly signals;
private readonly pendingOperations;
constructor(signals: ReturnType<typeof createSignals>, config: CreateCheckoutParams);
get status(): "needs_confirmation" | "completed";
get externalClientSecret(): string;
get externalGatewayId(): string;
get plan(): BillingPlan;
get planPeriod(): BillingSubscriptionPlanPeriod;
get totals(): BillingCheckoutTotals;
get isImmediatePlanChange(): boolean;
get freeTrialEndsAt(): Date | undefined;
get payer(): BillingPayerResource;
get paymentMethod(): BillingPaymentMethodResource | null;
get planPeriodStart(): number | undefined;
get needsPaymentMethod(): boolean;
start(): Promise<{
error: ClerkError | null;
}>;
confirm(params: ConfirmCheckoutParams): Promise<{
error: ClerkError | null;
}>;
finalize(params?: CheckoutFlowFinalizeParams): Promise<{
error: ClerkError | null;
}>;
private runAsyncCheckoutTask;
}

View File

@@ -0,0 +1,16 @@
import type { BillingPayerJSON, BillingPayerResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class BillingPayer extends BaseResource implements BillingPayerResource {
id: string;
createdAt?: Date;
updatedAt?: Date;
imageUrl?: string;
userId: string | null;
email?: string | null;
firstName?: string | null;
lastName?: string | null;
organizationId: string | null;
organizationName?: string | null;
constructor(data: BillingPayerJSON);
protected fromJSON(data: BillingPayerJSON | null): this;
}

View File

@@ -0,0 +1,15 @@
import type { BillingMoneyAmount, BillingPaymentChargeType, BillingPaymentJSON, BillingPaymentMethodResource, BillingPaymentResource, BillingPaymentStatus, BillingSubscriptionItemResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class BillingPayment extends BaseResource implements BillingPaymentResource {
id: string;
amount: BillingMoneyAmount;
failedAt: Date | null;
paidAt: Date | null;
updatedAt: Date;
paymentMethod: BillingPaymentMethodResource | null;
subscriptionItem: BillingSubscriptionItemResource;
chargeType: BillingPaymentChargeType;
status: BillingPaymentStatus;
constructor(data: BillingPaymentJSON);
protected fromJSON(data: BillingPaymentJSON | null): this;
}

View File

@@ -0,0 +1,27 @@
import type { BillingInitializedPaymentMethodJSON, BillingInitializedPaymentMethodResource, BillingPaymentMethodJSON, BillingPaymentMethodResource, BillingPaymentMethodStatus, MakeDefaultPaymentMethodParams, RemovePaymentMethodParams } from '@clerk/shared/types';
import { BaseResource, DeletedObject } from './internal';
export declare class BillingPaymentMethod extends BaseResource implements BillingPaymentMethodResource {
id: string;
last4: string | null;
paymentType?: 'card';
cardType: string | null;
isDefault?: boolean;
isRemovable?: boolean;
status: BillingPaymentMethodStatus;
walletType?: string | null;
expiryYear?: number | null;
expiryMonth?: number | null;
createdAt?: Date | null;
updatedAt?: Date | null;
constructor(data: BillingPaymentMethodJSON);
protected fromJSON(data: BillingPaymentMethodJSON | null): this;
remove(params?: RemovePaymentMethodParams): Promise<DeletedObject>;
makeDefault(params?: MakeDefaultPaymentMethodParams): Promise<null>;
}
export declare class BillingInitializedPaymentMethod extends BaseResource implements BillingInitializedPaymentMethodResource {
externalClientSecret: string;
externalGatewayId: string;
paymentMethodOrder: string[];
constructor(data: BillingInitializedPaymentMethodJSON);
protected fromJSON(data: BillingInitializedPaymentMethodJSON | null): this;
}

View File

@@ -0,0 +1,23 @@
import type { BillingMoneyAmount, BillingPayerResourceType, BillingPlanJSON, BillingPlanResource, BillingPlanUnitPrice } from '@clerk/shared/types';
import { BaseResource, Feature } from './internal';
export declare class BillingPlan extends BaseResource implements BillingPlanResource {
id: string;
name: string;
fee: BillingMoneyAmount | null;
annualFee: BillingMoneyAmount | null;
annualMonthlyFee: BillingMoneyAmount | null;
description: string | null;
isDefault: boolean;
isRecurring: boolean;
hasBaseFee: boolean;
forPayerType: BillingPayerResourceType;
publiclyVisible: boolean;
slug: string;
avatarUrl: string | null;
features: Feature[];
unitPrices?: BillingPlanUnitPrice[];
freeTrialDays: number | null;
freeTrialEnabled: boolean;
constructor(data: BillingPlanJSON);
protected fromJSON(data: BillingPlanJSON | null): this;
}

View File

@@ -0,0 +1,18 @@
import type { BillingStatementGroupJSON, BillingStatementJSON, BillingStatementResource, BillingStatementStatus, BillingStatementTotals } from '@clerk/shared/types';
import { BaseResource, BillingPayment } from './internal';
export declare class BillingStatement extends BaseResource implements BillingStatementResource {
id: string;
status: BillingStatementStatus;
timestamp: Date;
totals: BillingStatementTotals;
groups: BillingStatementGroup[];
constructor(data: BillingStatementJSON);
protected fromJSON(data: BillingStatementJSON | null): this;
}
export declare class BillingStatementGroup {
id: string;
timestamp: Date;
items: BillingPayment[];
constructor(data: BillingStatementGroupJSON);
protected fromJSON(data: BillingStatementGroupJSON | null): this;
}

View File

@@ -0,0 +1,39 @@
import type { BillingCredits, BillingMoneyAmount, BillingSubscriptionItemJSON, BillingSubscriptionItemResource, BillingSubscriptionItemSeats, BillingSubscriptionJSON, BillingSubscriptionPlanPeriod, BillingSubscriptionResource, BillingSubscriptionStatus, CancelSubscriptionParams } from '@clerk/shared/types';
import { BaseResource, BillingPlan, DeletedObject } from './internal';
export declare class BillingSubscription extends BaseResource implements BillingSubscriptionResource {
id: string;
status: Extract<BillingSubscriptionStatus, 'active' | 'past_due'>;
activeAt: Date;
createdAt: Date;
pastDueAt: Date | null;
updatedAt: Date | null;
nextPayment?: {
amount: BillingMoneyAmount;
date: Date;
};
subscriptionItems: BillingSubscriptionItemResource[];
eligibleForFreeTrial: boolean;
constructor(data: BillingSubscriptionJSON);
protected fromJSON(data: BillingSubscriptionJSON | null): this;
}
export declare class BillingSubscriptionItem extends BaseResource implements BillingSubscriptionItemResource {
id: string;
plan: BillingPlan;
planPeriod: BillingSubscriptionPlanPeriod;
status: BillingSubscriptionStatus;
createdAt: Date;
periodStart: Date;
periodEnd: Date | null;
canceledAt: Date | null;
pastDueAt: Date | null;
amount?: BillingMoneyAmount;
credit?: {
amount: BillingMoneyAmount;
};
seats?: BillingSubscriptionItemSeats;
credits?: BillingCredits;
isFreeTrial: boolean;
constructor(data: BillingSubscriptionItemJSON);
protected fromJSON(data: BillingSubscriptionItemJSON | null): this;
cancel(params: CancelSubscriptionParams): Promise<DeletedObject>;
}

View File

@@ -0,0 +1,42 @@
import type { ClientJSON, ClientJSONSnapshot, ClientResource, LastAuthenticationStrategy, SignedInSessionResource, SignInResource, SignUpResource } from '@clerk/shared/types';
import type { FapiResponseJSON } from '../fapiClient';
import { BaseResource, Session } from './internal';
export declare function getClientResourceFromPayload<J>(responseJSON: FapiResponseJSON<J> | null): ClientResource | undefined;
export declare class Client extends BaseResource implements ClientResource {
private static instance;
pathRoot: string;
sessions: Session[];
signUp: SignUpResource;
signIn: SignInResource;
lastActiveSessionId: string | null;
captchaBypass: boolean;
cookieExpiresAt: Date | null;
/** Last authentication strategy used by this client; `null` when unknown/disabled. */
lastAuthenticationStrategy: LastAuthenticationStrategy | null;
createdAt: Date | null;
updatedAt: Date | null;
static getOrCreateInstance(data?: ClientJSON | ClientJSONSnapshot | null): Client;
static clearInstance(): void;
static isClientResource(resource: unknown): resource is Client;
private constructor();
get signUpAttempt(): SignUpResource;
get signInAttempt(): SignInResource;
get signedInSessions(): SignedInSessionResource[];
create(): Promise<this>;
fetch({ fetchMaxTries }?: {
fetchMaxTries?: number;
}): Promise<this>;
destroy(): Promise<void>;
removeSessions(): Promise<ClientResource>;
resetSignIn(): void;
resetSignUp(): void;
clearCache(): void;
isEligibleForTouch(): boolean;
buildTouchUrl({ redirectUrl }: {
redirectUrl: URL;
}): string;
__internal_sendCaptchaToken(params: unknown): Promise<ClientResource>;
fromJSON(data: ClientJSON | ClientJSONSnapshot | null): this;
__internal_toSnapshot(): ClientJSONSnapshot;
protected path(): string;
}

View File

@@ -0,0 +1,11 @@
import type { CommerceSettingsJSON, CommerceSettingsJSONSnapshot, CommerceSettingsResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
/**
* @internal
*/
export declare class CommerceSettings extends BaseResource implements CommerceSettingsResource {
billing: CommerceSettingsResource['billing'];
constructor(data?: CommerceSettingsJSON | CommerceSettingsJSONSnapshot | null);
protected fromJSON(data: CommerceSettingsJSON | CommerceSettingsJSONSnapshot | null): this;
__internal_toSnapshot(): CommerceSettingsJSONSnapshot;
}

View File

@@ -0,0 +1,9 @@
import type { DeletedObjectJSON, DeletedObjectResource } from '@clerk/shared/types';
export declare class DeletedObject implements DeletedObjectResource {
object: string;
id?: string;
slug?: string;
deleted: boolean;
constructor(data: DeletedObjectJSON);
protected fromJSON(data: DeletedObjectJSON | null): this;
}

View File

@@ -0,0 +1,45 @@
import type { CaptchaProvider, CaptchaWidgetType, DisplayConfigJSON, DisplayConfigJSONSnapshot, DisplayConfigResource, DisplayThemeJSON, OAuthStrategy, PreferredSignInStrategy } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class DisplayConfig extends BaseResource implements DisplayConfigResource {
afterCreateOrganizationUrl: string;
afterJoinWaitlistUrl: string;
afterLeaveOrganizationUrl: string;
afterSignInUrl: string;
afterSignOutAllUrl: string;
afterSignOutOneUrl: string;
afterSignOutUrl: string;
afterSignUpUrl: string;
afterSwitchSessionUrl: string;
applicationName: string;
backendHost: string;
branded: boolean;
captchaHeartbeat: boolean;
captchaHeartbeatIntervalMs?: number;
captchaOauthBypass: OAuthStrategy[];
captchaProvider: CaptchaProvider;
captchaPublicKey: string | null;
captchaPublicKeyInvisible: string | null;
captchaWidgetType: CaptchaWidgetType;
clerkJSVersion?: string;
createOrganizationUrl: string;
faviconImageUrl: string;
googleOneTapClientId?: string;
homeUrl: string;
id: string;
instanceEnvironmentType: string;
logoImageUrl: string;
organizationProfileUrl: string;
preferredSignInStrategy: PreferredSignInStrategy;
privacyPolicyUrl: string;
showDevModeWarning: boolean;
signInUrl: string;
signUpUrl: string;
supportEmail: string;
termsUrl: string;
theme: DisplayThemeJSON;
userProfileUrl: string;
waitlistUrl: string;
constructor(data?: DisplayConfigJSON | DisplayConfigJSONSnapshot | null);
protected fromJSON(data: DisplayConfigJSON | DisplayConfigJSONSnapshot | null): this;
__internal_toSnapshot(): DisplayConfigJSONSnapshot;
}

View File

@@ -0,0 +1,19 @@
import type { AttemptEmailAddressVerificationParams, CreateEmailLinkFlowReturn, CreateEnterpriseSSOLinkFlowReturn, EmailAddressJSON, EmailAddressJSONSnapshot, EmailAddressResource, IdentificationLinkResource, PrepareEmailAddressVerificationParams, StartEmailLinkFlowParams, StartEnterpriseSSOLinkFlowParams, VerificationResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class EmailAddress extends BaseResource implements EmailAddressResource {
id: string;
emailAddress: string;
matchesSsoConnection: boolean;
linkedTo: IdentificationLinkResource[];
verification: VerificationResource;
constructor(data: Partial<EmailAddressJSON | EmailAddressJSONSnapshot>, pathRoot: string);
create(): Promise<this>;
prepareVerification: (params: PrepareEmailAddressVerificationParams) => Promise<this>;
attemptVerification: (params: AttemptEmailAddressVerificationParams) => Promise<this>;
createEmailLinkFlow: () => CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, EmailAddressResource>;
createEnterpriseSSOLinkFlow: () => CreateEnterpriseSSOLinkFlowReturn<StartEnterpriseSSOLinkFlowParams, EmailAddressResource>;
destroy: () => Promise<void>;
toString: () => string;
protected fromJSON(data: EmailAddressJSON | EmailAddressJSONSnapshot | null): this;
__internal_toSnapshot(): EmailAddressJSONSnapshot;
}

View File

@@ -0,0 +1,41 @@
import type { EnterpriseAccountConnectionJSON, EnterpriseAccountConnectionJSONSnapshot, EnterpriseAccountConnectionResource, EnterpriseAccountJSON, EnterpriseAccountJSONSnapshot, EnterpriseAccountResource, VerificationResource } from '@clerk/shared/types';
import { BaseResource } from './Base';
export declare class EnterpriseAccount extends BaseResource implements EnterpriseAccountResource {
id: string;
protocol: EnterpriseAccountResource['protocol'];
provider: EnterpriseAccountResource['provider'];
providerUserId: string | null;
active: boolean;
emailAddress: string;
firstName: string | null;
lastName: string | null;
publicMetadata: {};
verification: VerificationResource | null;
enterpriseConnection: EnterpriseAccountConnectionResource | null;
lastAuthenticatedAt: Date | null;
enterpriseConnectionId: string | null;
constructor(data: Partial<EnterpriseAccountJSON | EnterpriseAccountJSONSnapshot>, pathRoot: string);
protected fromJSON(data: EnterpriseAccountJSON | EnterpriseAccountJSONSnapshot | null): this;
destroy: () => Promise<void>;
__internal_toSnapshot(): EnterpriseAccountJSONSnapshot;
}
export declare class EnterpriseAccountConnection extends BaseResource implements EnterpriseAccountConnectionResource {
id: string;
active: boolean;
allowIdpInitiated: boolean;
allowSubdomains: boolean;
disableAdditionalIdentifications: boolean;
domain: string;
logoPublicUrl: string | null;
name: string;
protocol: EnterpriseAccountResource['protocol'];
provider: EnterpriseAccountResource['provider'];
syncUserAttributes: boolean;
allowOrganizationAccountLinking: boolean;
createdAt: Date;
updatedAt: Date;
enterpriseConnectionId: string | null;
constructor(data: EnterpriseAccountConnectionJSON | EnterpriseAccountConnectionJSONSnapshot | null);
protected fromJSON(data: EnterpriseAccountConnectionJSON | EnterpriseAccountConnectionJSONSnapshot | null): this;
__internal_toSnapshot(): EnterpriseAccountConnectionJSONSnapshot;
}

View File

@@ -0,0 +1,22 @@
import type { EnterpriseConnectionJSON, EnterpriseConnectionJSONSnapshot, EnterpriseConnectionResource, EnterpriseOAuthConfigResource, EnterpriseSamlConnectionNestedResource } from '@clerk/shared/types';
import { BaseResource } from './Base';
export declare class EnterpriseConnection extends BaseResource implements EnterpriseConnectionResource {
id: string;
name: string;
active: boolean;
provider: string;
logoPublicUrl: string | null;
domains: string[];
organizationId: string | null;
syncUserAttributes: boolean;
disableAdditionalIdentifications: boolean;
allowOrganizationAccountLinking: boolean;
customAttributes: unknown[];
oauthConfig: EnterpriseOAuthConfigResource | null;
samlConnection: EnterpriseSamlConnectionNestedResource | null;
createdAt: Date | null;
updatedAt: Date | null;
constructor(data: EnterpriseConnectionJSON | EnterpriseConnectionJSONSnapshot | null);
protected fromJSON(data: EnterpriseConnectionJSON | EnterpriseConnectionJSONSnapshot | null): this;
__internal_toSnapshot(): EnterpriseConnectionJSONSnapshot;
}

View File

@@ -0,0 +1,30 @@
import type { AuthConfigResource, CommerceSettingsResource, DisplayConfigResource, EnableEnvironmentSettingParams, EnvironmentJSON, EnvironmentJSONSnapshot, EnvironmentResource, OrganizationSettingsResource, ProtectConfigResource, UserSettingsResource } from '@clerk/shared/types';
import { APIKeySettings } from './APIKeySettings';
import { BaseResource } from './internal';
export declare class Environment extends BaseResource implements EnvironmentResource {
private static instance;
authConfig: AuthConfigResource;
displayConfig: DisplayConfigResource;
maintenanceMode: boolean;
clientDebugMode: boolean;
partitionedCookies: boolean;
pathRoot: string;
userSettings: UserSettingsResource;
organizationSettings: OrganizationSettingsResource;
commerceSettings: CommerceSettingsResource;
apiKeysSettings: APIKeySettings;
protectConfig: ProtectConfigResource;
static getInstance(): Environment;
constructor(data?: EnvironmentJSON | EnvironmentJSONSnapshot | null);
protected fromJSON(data: EnvironmentJSONSnapshot | EnvironmentJSON | null): this;
fetch({ touch, fetchMaxTries }?: {
touch: boolean;
fetchMaxTries?: number;
}): Promise<Environment>;
isDevelopmentOrStaging: () => boolean;
isProduction: () => boolean;
isSingleSession: () => boolean;
onWindowLocationHost: () => boolean;
__internal_toSnapshot(): EnvironmentJSONSnapshot;
__internal_enableEnvironmentSetting(params: EnableEnvironmentSettingParams): Promise<void>;
}

View File

@@ -0,0 +1,26 @@
import type { ExternalAccountJSON, ExternalAccountJSONSnapshot, ExternalAccountResource, OAuthProvider, ReauthorizeExternalAccountParams, VerificationResource } from '@clerk/shared/types';
import { BaseResource } from './Base';
export declare class ExternalAccount extends BaseResource implements ExternalAccountResource {
id: string;
identificationId: string;
provider: OAuthProvider;
providerUserId: string;
emailAddress: string;
approvedScopes: string;
firstName: string;
lastName: string;
imageUrl: string;
username: string;
phoneNumber: string;
publicMetadata: {};
label: string;
verification: VerificationResource | null;
constructor(data: Partial<ExternalAccountJSON | ExternalAccountJSONSnapshot>, pathRoot: string);
reauthorize: (params: ReauthorizeExternalAccountParams) => Promise<ExternalAccountResource>;
destroy: () => Promise<void>;
protected fromJSON(data: ExternalAccountJSON | ExternalAccountJSONSnapshot | null): this;
__internal_toSnapshot(): ExternalAccountJSONSnapshot;
providerSlug(): OAuthProvider;
providerTitle(): string;
accountIdentifier(): string;
}

View File

@@ -0,0 +1,11 @@
import type { FeatureJSON, FeatureResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class Feature extends BaseResource implements FeatureResource {
id: string;
name: string;
description: string | null;
slug: string;
avatarUrl: string | null;
constructor(data: FeatureJSON);
protected fromJSON(data: FeatureJSON | null): this;
}

View File

@@ -0,0 +1,9 @@
import type { IdentificationLinkJSON, IdentificationLinkJSONSnapshot, IdentificationLinkResource } from '@clerk/shared/types';
import { BaseResource } from './Base';
export declare class IdentificationLink extends BaseResource implements IdentificationLinkResource {
id: string;
type: string;
constructor(data: IdentificationLinkJSON | IdentificationLinkJSONSnapshot);
protected fromJSON(data: IdentificationLinkJSON | IdentificationLinkJSONSnapshot | null): this;
__internal_toSnapshot(): IdentificationLinkJSONSnapshot;
}

View File

@@ -0,0 +1,11 @@
import type { ImageJSON, ImageResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class Image extends BaseResource implements ImageResource {
id?: string;
name: string | null;
publicUrl: string | null;
static create(path: string, body?: any): Promise<ImageResource>;
static delete(path: string): Promise<ImageResource>;
constructor(data: ImageJSON);
protected fromJSON(data: ImageJSON | null): this;
}

View File

@@ -0,0 +1,49 @@
import type { AddMemberParams, ClerkPaginatedResponse, ClerkResourceReloadParams, CreateOrganizationParams, GetDomainsParams, GetInvitationsParams, GetMembershipRequestParams, GetMemberships, GetRolesParams, InviteMemberParams, InviteMembersParams, OrganizationDomainResource, OrganizationInvitationResource, OrganizationJSON, OrganizationJSONSnapshot, OrganizationMembershipRequestResource, OrganizationResource, SetOrganizationLogoParams, UpdateMembershipParams, UpdateOrganizationParams } from '@clerk/shared/types';
import { addPaymentMethod, getPaymentMethods, initializePaymentMethod } from '../modules/billing';
import { BaseResource, OrganizationMembership } from './internal';
import { Role } from './Role';
export declare class Organization extends BaseResource implements OrganizationResource {
pathRoot: string;
id: string;
name: string;
slug: string;
imageUrl: string;
hasImage: boolean;
publicMetadata: OrganizationPublicMetadata;
adminDeleteEnabled: boolean;
createdAt: Date;
updatedAt: Date;
membersCount: number;
pendingInvitationsCount: number;
maxAllowedMemberships: number;
constructor(data: OrganizationJSON | OrganizationJSONSnapshot);
static create(params: CreateOrganizationParams): Promise<OrganizationResource>;
static get(organizationId: string): Promise<OrganizationResource>;
update: (params: UpdateOrganizationParams) => Promise<OrganizationResource>;
getRoles: (getRolesParams?: GetRolesParams) => Promise<{
data: Role[];
total_count: number;
has_role_set_migration: boolean | undefined;
}>;
getDomains: (getDomainParams?: GetDomainsParams) => Promise<ClerkPaginatedResponse<OrganizationDomainResource>>;
getDomain: ({ domainId }: {
domainId: string;
}) => Promise<OrganizationDomainResource>;
getMembershipRequests: (getRequestParam?: GetMembershipRequestParams) => Promise<ClerkPaginatedResponse<OrganizationMembershipRequestResource>>;
createDomain: (name: string) => Promise<OrganizationDomainResource>;
getMemberships: GetMemberships;
getInvitations: (getInvitationsParams?: GetInvitationsParams) => Promise<ClerkPaginatedResponse<OrganizationInvitationResource>>;
addMember: ({ userId, role }: AddMemberParams) => Promise<OrganizationMembership>;
inviteMember: (params: InviteMemberParams) => Promise<OrganizationInvitationResource>;
inviteMembers: (params: InviteMembersParams) => Promise<OrganizationInvitationResource[]>;
updateMember: ({ userId, role }: UpdateMembershipParams) => Promise<OrganizationMembership>;
removeMember: (userId: string) => Promise<OrganizationMembership>;
destroy: () => Promise<void>;
setLogo: ({ file }: SetOrganizationLogoParams) => Promise<OrganizationResource>;
initializePaymentMethod: typeof initializePaymentMethod;
addPaymentMethod: typeof addPaymentMethod;
getPaymentMethods: typeof getPaymentMethods;
protected fromJSON(data: OrganizationJSON | OrganizationJSONSnapshot | null): this;
__internal_toSnapshot(): OrganizationJSONSnapshot;
reload(params?: ClerkResourceReloadParams): Promise<this>;
}

View File

@@ -0,0 +1,19 @@
import type { OrganizationCreationAdvisorySeverity, OrganizationCreationAdvisoryType, OrganizationCreationDefaultsJSON, OrganizationCreationDefaultsJSONSnapshot, OrganizationCreationDefaultsResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class OrganizationCreationDefaults extends BaseResource implements OrganizationCreationDefaultsResource {
advisory: {
code: OrganizationCreationAdvisoryType;
severity: OrganizationCreationAdvisorySeverity;
meta: Record<string, string>;
} | null;
form: {
name: string;
slug: string;
logo: string | null;
blurHash: string | null;
};
constructor(data?: OrganizationCreationDefaultsJSON | OrganizationCreationDefaultsJSONSnapshot | null);
protected fromJSON(data: OrganizationCreationDefaultsJSON | OrganizationCreationDefaultsJSONSnapshot | null): this;
static retrieve(): Promise<OrganizationCreationDefaultsResource>;
__internal_toSnapshot(): OrganizationCreationDefaultsJSONSnapshot;
}

View File

@@ -0,0 +1,23 @@
import type { AttemptAffiliationVerificationParams, OrganizationDomainJSON, OrganizationDomainResource, OrganizationDomainVerification, OrganizationEnrollmentMode, PrepareAffiliationVerificationParams, UpdateEnrollmentModeParams } from '@clerk/shared/types';
import { BaseResource } from './Base';
export declare class OrganizationDomain extends BaseResource implements OrganizationDomainResource {
id: string;
name: string;
organizationId: string;
enrollmentMode: OrganizationEnrollmentMode;
verification: OrganizationDomainVerification | null;
affiliationEmailAddress: string | null;
createdAt: Date;
updatedAt: Date;
totalPendingInvitations: number;
totalPendingSuggestions: number;
constructor(data: OrganizationDomainJSON);
static create(organizationId: string, { name }: {
name: string;
}): Promise<OrganizationDomainResource>;
prepareAffiliationVerification: (params: PrepareAffiliationVerificationParams) => Promise<OrganizationDomainResource>;
attemptAffiliationVerification: (params: AttemptAffiliationVerificationParams) => Promise<OrganizationDomainResource>;
updateEnrollmentMode: (params: UpdateEnrollmentModeParams) => Promise<OrganizationDomainResource>;
delete: () => Promise<void>;
protected fromJSON(data: OrganizationDomainJSON | null): this;
}

View File

@@ -0,0 +1,18 @@
import type { CreateBulkOrganizationInvitationParams, CreateOrganizationInvitationParams, OrganizationCustomRoleKey, OrganizationInvitationJSON, OrganizationInvitationResource, OrganizationInvitationStatus } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class OrganizationInvitation extends BaseResource implements OrganizationInvitationResource {
id: string;
emailAddress: string;
organizationId: string;
publicMetadata: OrganizationInvitationPublicMetadata;
status: OrganizationInvitationStatus;
role: OrganizationCustomRoleKey;
roleName: string;
createdAt: Date;
updatedAt: Date;
static create(organizationId: string, { emailAddress, role }: CreateOrganizationInvitationParams): Promise<OrganizationInvitationResource>;
static createBulk(organizationId: string, params: CreateBulkOrganizationInvitationParams): Promise<OrganizationInvitationResource[]>;
constructor(data: OrganizationInvitationJSON);
revoke: () => Promise<OrganizationInvitation>;
protected fromJSON(data: OrganizationInvitationJSON | null): this;
}

View File

@@ -0,0 +1,24 @@
import type { ClerkPaginatedResponse, ClerkResourceReloadParams, GetUserOrganizationMembershipParams, OrganizationCustomRoleKey, OrganizationMembershipJSON, OrganizationMembershipJSONSnapshot, OrganizationMembershipResource, OrganizationPermissionKey } from '@clerk/shared/types';
import { BaseResource, Organization, PublicUserData } from './internal';
export declare class OrganizationMembership extends BaseResource implements OrganizationMembershipResource {
id: string;
publicMetadata: OrganizationMembershipPublicMetadata;
publicUserData?: PublicUserData;
organization: Organization;
permissions: OrganizationPermissionKey[];
role: OrganizationCustomRoleKey;
roleName: string;
createdAt: Date;
updatedAt: Date;
constructor(data: OrganizationMembershipJSON | OrganizationMembershipJSONSnapshot);
static retrieve: GetOrganizationMembershipsClass;
destroy: () => Promise<OrganizationMembership>;
update: ({ role }: UpdateOrganizationMembershipParams) => Promise<OrganizationMembership>;
protected fromJSON(data: OrganizationMembershipJSON | OrganizationMembershipJSONSnapshot | null): this;
__internal_toSnapshot(): OrganizationMembershipJSONSnapshot;
reload(_?: ClerkResourceReloadParams): Promise<this>;
}
export type UpdateOrganizationMembershipParams = {
role: OrganizationCustomRoleKey;
};
export type GetOrganizationMembershipsClass = (params?: GetUserOrganizationMembershipParams) => Promise<ClerkPaginatedResponse<OrganizationMembership>>;

View File

@@ -0,0 +1,14 @@
import type { OrganizationInvitationStatus, OrganizationMembershipRequestJSON, OrganizationMembershipRequestResource } from '@clerk/shared/types';
import { BaseResource, PublicUserData } from './internal';
export declare class OrganizationMembershipRequest extends BaseResource implements OrganizationMembershipRequestResource {
id: string;
organizationId: string;
status: OrganizationInvitationStatus;
publicUserData: PublicUserData;
createdAt: Date;
updatedAt: Date;
constructor(data: OrganizationMembershipRequestJSON);
accept: () => Promise<OrganizationMembershipRequestResource>;
reject: () => Promise<OrganizationMembershipRequestResource>;
protected fromJSON(data: OrganizationMembershipRequestJSON | null): this;
}

View File

@@ -0,0 +1,24 @@
import type { OrganizationEnrollmentMode, OrganizationSettingsJSON, OrganizationSettingsJSONSnapshot, OrganizationSettingsResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class OrganizationSettings extends BaseResource implements OrganizationSettingsResource {
actions: {
adminDelete: boolean;
};
domains: {
enabled: boolean;
enrollmentModes: OrganizationEnrollmentMode[];
defaultRole: string | null;
};
slug: {
disabled: boolean;
};
organizationCreationDefaults: {
enabled: boolean;
};
enabled: boolean;
maxAllowedMemberships: number;
forceOrganizationSelection: boolean;
constructor(data?: OrganizationSettingsJSON | OrganizationSettingsJSONSnapshot | null);
protected fromJSON(data: OrganizationSettingsJSON | OrganizationSettingsJSONSnapshot | null): this;
__internal_toSnapshot(): OrganizationSettingsJSONSnapshot;
}

View File

@@ -0,0 +1,13 @@
import type { ClerkPaginatedResponse, GetUserOrganizationSuggestionsParams, OrganizationSuggestionJSON, OrganizationSuggestionResource, OrganizationSuggestionStatus, UserOrganizationInvitationResource } from '@clerk/shared/types';
import { BaseResource } from './Base';
export declare class OrganizationSuggestion extends BaseResource implements OrganizationSuggestionResource {
id: string;
publicOrganizationData: UserOrganizationInvitationResource['publicOrganizationData'];
status: OrganizationSuggestionStatus;
createdAt: Date;
updatedAt: Date;
constructor(data: OrganizationSuggestionJSON);
static retrieve(params?: GetUserOrganizationSuggestionsParams): Promise<ClerkPaginatedResponse<OrganizationSuggestion>>;
accept: () => Promise<OrganizationSuggestionResource>;
protected fromJSON(data: OrganizationSuggestionJSON | null): this;
}

View File

@@ -0,0 +1,28 @@
import type { DeletedObjectResource, PasskeyJSON, PasskeyJSONSnapshot, PasskeyResource, PasskeyVerificationResource, UpdatePasskeyParams } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class Passkey extends BaseResource implements PasskeyResource {
id: string;
pathRoot: string;
verification: PasskeyVerificationResource | null;
name: string | null;
lastUsedAt: Date | null;
createdAt: Date;
updatedAt: Date;
constructor(data: PasskeyJSON | PasskeyJSONSnapshot);
private static create;
private static attemptVerification;
/**
* Developers should not be able to create a new Passkeys from an already instanced object
*/
static registerPasskey(): Promise<Passkey>;
/**
* PATCH /v1/me/passkeys/{passkeyIdentificationID}
*/
update: (params: UpdatePasskeyParams) => Promise<PasskeyResource>;
/**
* DELETE /v1/me/passkeys/{passkeyIdentificationID}
*/
delete: () => Promise<DeletedObjectResource>;
protected fromJSON(data: PasskeyJSON | PasskeyJSONSnapshot | null): this;
__internal_toSnapshot(): PasskeyJSONSnapshot;
}

View File

@@ -0,0 +1,13 @@
import type { PermissionJSON, PermissionResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class Permission extends BaseResource implements PermissionResource {
id: string;
key: string;
name: string;
description: string;
type: 'system' | 'user';
createdAt: Date;
updatedAt: Date;
constructor(data: PermissionJSON);
protected fromJSON(data: PermissionJSON | null): this;
}

View File

@@ -0,0 +1,21 @@
import type { AttemptPhoneNumberVerificationParams, IdentificationLinkResource, PhoneNumberJSON, PhoneNumberJSONSnapshot, PhoneNumberResource, SetReservedForSecondFactorParams, VerificationResource } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class PhoneNumber extends BaseResource implements PhoneNumberResource {
id: string;
phoneNumber: string;
reservedForSecondFactor: boolean;
defaultSecondFactor: boolean;
linkedTo: IdentificationLinkResource[];
verification: VerificationResource;
backupCodes?: string[];
constructor(data: Partial<PhoneNumberJSON | PhoneNumberJSONSnapshot>, pathRoot: string);
create: () => Promise<this>;
prepareVerification: () => Promise<PhoneNumberResource>;
attemptVerification: (params: AttemptPhoneNumberVerificationParams) => Promise<PhoneNumberResource>;
setReservedForSecondFactor: (params: SetReservedForSecondFactorParams) => Promise<PhoneNumberResource>;
makeDefaultSecondFactor: () => Promise<PhoneNumberResource>;
destroy: () => Promise<void>;
toString: () => string;
protected fromJSON(data: PhoneNumberJSON | PhoneNumberJSONSnapshot | null): this;
__internal_toSnapshot(): PhoneNumberJSONSnapshot;
}

View File

@@ -0,0 +1,10 @@
import type { ProtectConfigJSON, ProtectConfigJSONSnapshot, ProtectConfigResource, ProtectLoader } from '@clerk/shared/types';
import { BaseResource } from './internal';
export declare class ProtectConfig extends BaseResource implements ProtectConfigResource {
id: string;
loaders?: ProtectLoader[];
rollout?: number;
constructor(data?: ProtectConfigJSON | ProtectConfigJSONSnapshot | null);
protected fromJSON(data: ProtectConfigJSON | ProtectConfigJSONSnapshot | null): this;
__internal_toSnapshot(): ProtectConfigJSONSnapshot;
}

View File

@@ -0,0 +1,14 @@
import type { PublicUserData as IPublicUserData, PublicUserDataJSON, PublicUserDataJSONSnapshot } from '@clerk/shared/types';
export declare class PublicUserData implements IPublicUserData {
firstName: string | null;
lastName: string | null;
imageUrl: string;
hasImage: boolean;
identifier: string;
userId?: string;
username?: string;
banned?: boolean;
constructor(data: PublicUserDataJSON | PublicUserDataJSONSnapshot);
protected fromJSON(data: PublicUserDataJSON | PublicUserDataJSONSnapshot | null): this;
__internal_toSnapshot(): PublicUserDataJSONSnapshot;
}

Some files were not shown because too many files have changed in this diff Show More