@strivacity/sdk-core 1.0.1 → 2.0.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +9 -7
- package/dist/flows/BaseFlow.cjs +1 -1
- package/dist/flows/BaseFlow.cjs.map +1 -1
- package/dist/flows/BaseFlow.d.ts +42 -55
- package/dist/flows/BaseFlow.mjs +1 -1
- package/dist/flows/BaseFlow.mjs.map +1 -1
- package/dist/flows/NativeFlow.cjs +2 -0
- package/dist/flows/NativeFlow.cjs.map +1 -0
- package/dist/flows/NativeFlow.d.ts +24 -0
- package/dist/flows/NativeFlow.mjs +2 -0
- package/dist/flows/NativeFlow.mjs.map +1 -0
- package/dist/flows/PopupFlow.cjs +1 -1
- package/dist/flows/PopupFlow.cjs.map +1 -1
- package/dist/flows/PopupFlow.d.ts +7 -14
- package/dist/flows/PopupFlow.mjs +1 -1
- package/dist/flows/PopupFlow.mjs.map +1 -1
- package/dist/flows/RedirectFlow.cjs +1 -1
- package/dist/flows/RedirectFlow.cjs.map +1 -1
- package/dist/flows/RedirectFlow.d.ts +6 -12
- package/dist/flows/RedirectFlow.mjs +1 -1
- package/dist/flows/RedirectFlow.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/storages/LocalStorage.cjs +1 -1
- package/dist/storages/LocalStorage.cjs.map +1 -1
- package/dist/storages/LocalStorage.d.ts +3 -3
- package/dist/storages/LocalStorage.mjs +1 -1
- package/dist/storages/LocalStorage.mjs.map +1 -1
- package/dist/storages/SessionStorage.cjs +1 -1
- package/dist/storages/SessionStorage.cjs.map +1 -1
- package/dist/storages/SessionStorage.d.ts +3 -3
- package/dist/storages/SessionStorage.mjs +1 -1
- package/dist/storages/SessionStorage.mjs.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +257 -25
- package/dist/types.mjs +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/HttpClient.cjs +2 -0
- package/dist/utils/HttpClient.cjs.map +1 -0
- package/dist/utils/HttpClient.d.ts +4 -0
- package/dist/utils/HttpClient.mjs +2 -0
- package/dist/utils/HttpClient.mjs.map +1 -0
- package/dist/utils/Metadata.cjs +2 -0
- package/dist/utils/Metadata.cjs.map +1 -0
- package/dist/{Metadata.d.ts → utils/Metadata.d.ts} +26 -2
- package/dist/utils/Metadata.mjs +2 -0
- package/dist/utils/Metadata.mjs.map +1 -0
- package/dist/utils/NativeFlowHandler.cjs +2 -0
- package/dist/utils/NativeFlowHandler.cjs.map +1 -0
- package/dist/utils/NativeFlowHandler.d.ts +54 -0
- package/dist/utils/NativeFlowHandler.mjs +2 -0
- package/dist/utils/NativeFlowHandler.mjs.map +1 -0
- package/dist/utils/Session.cjs +2 -0
- package/dist/utils/Session.cjs.map +1 -0
- package/dist/{Session.d.ts → utils/Session.d.ts} +1 -1
- package/dist/utils/Session.mjs +2 -0
- package/dist/utils/Session.mjs.map +1 -0
- package/dist/utils/State.cjs +2 -0
- package/dist/utils/State.cjs.map +1 -0
- package/dist/utils/State.mjs +2 -0
- package/dist/utils/State.mjs.map +1 -0
- package/dist/utils/base64Url.cjs.map +1 -1
- package/dist/utils/base64Url.mjs.map +1 -1
- package/dist/utils/crypto.cjs.map +1 -1
- package/dist/utils/crypto.mjs.map +1 -1
- package/dist/utils/date.cjs.map +1 -1
- package/dist/utils/date.mjs.map +1 -1
- package/dist/utils/errors.cjs +2 -0
- package/dist/utils/errors.cjs.map +1 -0
- package/dist/utils/errors.d.ts +4 -0
- package/dist/utils/errors.mjs +2 -0
- package/dist/utils/errors.mjs.map +1 -0
- package/dist/utils/handlers.cjs +1 -1
- package/dist/utils/handlers.cjs.map +1 -1
- package/dist/utils/handlers.d.ts +11 -11
- package/dist/utils/handlers.mjs +1 -1
- package/dist/utils/handlers.mjs.map +1 -1
- package/dist/utils/jwt.cjs +1 -1
- package/dist/utils/jwt.cjs.map +1 -1
- package/dist/utils/jwt.mjs +1 -1
- package/dist/utils/jwt.mjs.map +1 -1
- package/dist/utils/object.cjs +2 -0
- package/dist/utils/object.cjs.map +1 -0
- package/dist/utils/object.d.ts +1 -0
- package/dist/utils/object.mjs +2 -0
- package/dist/utils/object.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/Metadata.cjs +0 -2
- package/dist/Metadata.cjs.map +0 -1
- package/dist/Metadata.mjs +0 -2
- package/dist/Metadata.mjs.map +0 -1
- package/dist/Session.cjs +0 -2
- package/dist/Session.cjs.map +0 -1
- package/dist/Session.mjs +0 -2
- package/dist/Session.mjs.map +0 -1
- package/dist/State.cjs +0 -2
- package/dist/State.cjs.map +0 -1
- package/dist/State.mjs +0 -2
- package/dist/State.mjs.map +0 -1
- package/dist/utils/constants.cjs +0 -2
- package/dist/utils/constants.cjs.map +0 -1
- package/dist/utils/constants.d.ts +0 -6
- package/dist/utils/constants.mjs +0 -2
- package/dist/utils/constants.mjs.map +0 -1
- package/dist/utils/fetch.cjs +0 -2
- package/dist/utils/fetch.cjs.map +0 -1
- package/dist/utils/fetch.d.ts +0 -2
- package/dist/utils/fetch.mjs +0 -2
- package/dist/utils/fetch.mjs.map +0 -1
- /package/dist/{State.d.ts → utils/State.d.ts} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{redirectUrlHandler as a,redirectCallbackHandler as i}from"../utils/handlers.mjs";import{NativeFlowHandler as l}from"../utils/NativeFlowHandler.mjs";import{BaseFlow as o}from"./BaseFlow.mjs";import"../utils/State.mjs";import"../utils/crypto.mjs";import"../utils/base64Url.mjs";import"../utils/date.mjs";import"../utils/errors.mjs";import"../utils/jwt.mjs";import"../utils/Metadata.mjs";import"../utils/Session.mjs";class g extends o{constructor(r,e,t){r.urlHandler||(r.urlHandler=a),r.callbackHandler||(r.callbackHandler=i),super(r,e,t)}login(r={}){return this.dispatchEvent("loginInitiated",[]),new l(this,r)}register(r={}){return r.prompt="create",this.login(r)}async handleCallback(r){var e;if(typeof this.options.callbackHandler!="function")throw new Error("Callback handler is not defined. Please provide a valid callback handler function in the SDK options.");r||(r=(e=globalThis.window)==null?void 0:e.location.href),await this.tokenExchange(await this.options.callbackHandler(r,this.options.responseMode||"fragment"))}}export{g as NativeFlow};
|
|
2
|
+
//# sourceMappingURL=NativeFlow.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeFlow.mjs","sources":["../../src/flows/NativeFlow.ts"],"sourcesContent":["import type { SDKOptions, NativeParams, SDKStorage, SDKHttpClient } from '../types';\nimport { redirectUrlHandler, redirectCallbackHandler } from '../utils/handlers';\nimport { NativeFlowHandler } from '../utils/NativeFlowHandler';\nimport { BaseFlow } from './BaseFlow';\n\nexport class NativeFlow extends BaseFlow<SDKOptions, NativeParams> {\n\tconstructor(options: SDKOptions, storage: SDKStorage, httpClient: SDKHttpClient) {\n\t\tif (!options.urlHandler) {\n\t\t\toptions.urlHandler = redirectUrlHandler;\n\t\t}\n\t\tif (!options.callbackHandler) {\n\t\t\toptions.callbackHandler = redirectCallbackHandler;\n\t\t}\n\n\t\tsuper(options, storage, httpClient);\n\t}\n\n\t/**\n\t * Initiates the login process via native UI.\n\t * @param {NativeParams} [params={}] Optional parameters for native configuration.\n\t * @returns {NativeFlowHandler} Returns with a native login handler.\n\t */\n\tlogin(params: NativeParams = {}): NativeFlowHandler {\n\t\tthis.dispatchEvent('loginInitiated', []);\n\n\t\treturn new NativeFlowHandler(this, params);\n\t}\n\n\t/**\n\t * Initiates the registration process via native UI.\n\t * @param {NativeParams} [params={}] Optional parameters for native configuration.\n\t * @returns {NativeFlowHandler} Returns with a native login handler.\n\t */\n\tregister(params: NativeParams = {}): NativeFlowHandler {\n\t\tparams.prompt = 'create';\n\n\t\treturn this.login(params);\n\t}\n\n\t/**\n\t * Handles the callback after login or registration via a redirect.\n\t * @param {string} [url] The URL to handle the callback from. Defaults to the current window location.\n\t * @returns {Promise<void>} A promise that resolves when the callback is handled.\n\t */\n\tasync handleCallback(url?: string): Promise<void> {\n\t\tif (typeof this.options.callbackHandler !== 'function') {\n\t\t\tthrow new Error('Callback handler is not defined. Please provide a valid callback handler function in the SDK options.');\n\t\t}\n\n\t\tif (!url) {\n\t\t\turl = globalThis.window?.location.href;\n\t\t}\n\n\t\tawait this.tokenExchange((await this.options.callbackHandler(url, this.options.responseMode || 'fragment')) as Record<string, string>);\n\t}\n}\n"],"names":["NativeFlow","BaseFlow","options","storage","httpClient","redirectUrlHandler","redirectCallbackHandler","params","NativeFlowHandler","url","_a"],"mappings":"qaAKO,MAAMA,UAAmBC,CAAmC,CAClE,YAAYC,EAAqBC,EAAqBC,EAA2B,CAC3EF,EAAQ,aACZA,EAAQ,WAAaG,GAEjBH,EAAQ,kBACZA,EAAQ,gBAAkBI,GAG3B,MAAMJ,EAASC,EAASC,CAAU,CAAA,CAQnC,MAAMG,EAAuB,GAAuB,CACnD,YAAK,cAAc,iBAAkB,EAAE,EAEhC,IAAIC,EAAkB,KAAMD,CAAM,CAAA,CAQ1C,SAASA,EAAuB,GAAuB,CACtD,OAAAA,EAAO,OAAS,SAET,KAAK,MAAMA,CAAM,CAAA,CAQzB,MAAM,eAAeE,EAA6B,OACjD,GAAI,OAAO,KAAK,QAAQ,iBAAoB,WAC3C,MAAM,IAAI,MAAM,uGAAuG,EAGnHA,IACJA,GAAMC,EAAA,WAAW,SAAX,YAAAA,EAAmB,SAAS,MAGnC,MAAM,KAAK,cAAe,MAAM,KAAK,QAAQ,gBAAgBD,EAAK,KAAK,QAAQ,cAAgB,UAAU,CAA4B,CAAA,CAEvI"}
|
package/dist/flows/PopupFlow.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../utils/handlers.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../utils/handlers.cjs"),i=require("../utils/State.cjs"),l=require("./BaseFlow.cjs");require("../utils/crypto.cjs");require("../utils/base64Url.cjs");require("../utils/date.cjs");require("../utils/jwt.cjs");require("../utils/Metadata.cjs");require("../utils/Session.cjs");class o extends l.BaseFlow{constructor(e,a,t){e.urlHandler||(e.urlHandler=r.popupUrlHandler),e.callbackHandler||(e.callbackHandler=r.popupCallbackHandler),super(e,a,t)}async login(e={}){if(typeof this.options.urlHandler!="function")throw new Error("URL handler is not defined. Please provide a valid URL handler function in the SDK options.");const a=await i.State.create(),t=await this.getAuthorizationUrl(e);t.searchParams.append("state",a.id),t.searchParams.append("code_challenge",a.codeChallenge),t.searchParams.append("nonce",a.nonce),t.searchParams.append("display","popup"),await this.storage.set(`sty.${a.id}`,JSON.stringify(a)),this.dispatchEvent("loginInitiated",[]);const n=await this.options.urlHandler(t.toString(),e);await this.tokenExchange(n)}async register(e={}){e.prompt="create",await this.login(e)}async handleCallback(){if(typeof this.options.callbackHandler!="function")throw new Error("Callback handler is not defined. Please provide a valid callback handler function in the SDK options.");await this.options.callbackHandler(this.options.responseMode||"fragment")}}exports.PopupFlow=o;
|
|
2
2
|
//# sourceMappingURL=PopupFlow.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupFlow.cjs","sources":["../../src/flows/PopupFlow.ts"],"sourcesContent":["import type { SDKOptions,
|
|
1
|
+
{"version":3,"file":"PopupFlow.cjs","sources":["../../src/flows/PopupFlow.ts"],"sourcesContent":["import type { SDKOptions, PopupParams, SDKStorage, SDKHttpClient } from '../types';\nimport { popupCallbackHandler, popupUrlHandler } from '../utils/handlers';\nimport { State } from '../utils/State';\nimport { BaseFlow } from './BaseFlow';\n\n/**\n * Implements the Popup flow for authentication using a popup window.\n */\nexport class PopupFlow extends BaseFlow<SDKOptions, PopupParams> {\n\tconstructor(options: SDKOptions, storage: SDKStorage, httpClient: SDKHttpClient) {\n\t\tif (!options.urlHandler) {\n\t\t\toptions.urlHandler = popupUrlHandler;\n\t\t}\n\t\tif (!options.callbackHandler) {\n\t\t\toptions.callbackHandler = popupCallbackHandler;\n\t\t}\n\n\t\tsuper(options, storage, httpClient);\n\t}\n\n\t/**\n\t * Initiates the login process via a popup window.\n\t * @param {PopupParams} [params={}] Optional parameters for popup window configuration.\n\t * @returns {Promise<void>} A promise that resolves when the login process completes.\n\t */\n\tasync login(params: PopupParams = {}): Promise<void> {\n\t\tif (typeof this.options.urlHandler !== 'function') {\n\t\t\tthrow new Error('URL handler is not defined. Please provide a valid URL handler function in the SDK options.');\n\t\t}\n\n\t\tconst state = await State.create();\n\t\tconst url = await this.getAuthorizationUrl(params);\n\n\t\turl.searchParams.append('state', state.id);\n\t\turl.searchParams.append('code_challenge', state.codeChallenge);\n\t\turl.searchParams.append('nonce', state.nonce);\n\t\turl.searchParams.append('display', 'popup');\n\n\t\tawait this.storage.set(`sty.${state.id}`, JSON.stringify(state));\n\n\t\tthis.dispatchEvent('loginInitiated', []);\n\n\t\tconst data = (await this.options.urlHandler(url.toString(), params)) as Record<string, string>;\n\n\t\tawait this.tokenExchange(data);\n\t}\n\n\t/**\n\t * Initiates the registration process via a popup window.\n\t * @param {PopupParams} [params={}] Optional parameters for popup window configuration.\n\t * @returns {Promise<void>} A promise that resolves when the registration process completes.\n\t */\n\tasync register(params: PopupParams = {}): Promise<void> {\n\t\tparams.prompt = 'create';\n\n\t\tawait this.login(params);\n\t}\n\n\t/**\n\t * Handles the callback after login or registration via a popup window.\n\t */\n\tasync handleCallback(): Promise<void> {\n\t\tif (typeof this.options.callbackHandler !== 'function') {\n\t\t\tthrow new Error('Callback handler is not defined. Please provide a valid callback handler function in the SDK options.');\n\t\t}\n\n\t\tawait this.options.callbackHandler(this.options.responseMode || 'fragment');\n\t}\n}\n"],"names":["PopupFlow","BaseFlow","options","storage","httpClient","popupUrlHandler","popupCallbackHandler","params","state","State","url","data"],"mappings":"gXAQO,MAAMA,UAAkBC,EAAAA,QAAkC,CAChE,YAAYC,EAAqBC,EAAqBC,EAA2B,CAC3EF,EAAQ,aACZA,EAAQ,WAAaG,EAAAA,iBAEjBH,EAAQ,kBACZA,EAAQ,gBAAkBI,EAAAA,sBAG3B,MAAMJ,EAASC,EAASC,CAAU,CAAA,CAQnC,MAAM,MAAMG,EAAsB,GAAmB,CACpD,GAAI,OAAO,KAAK,QAAQ,YAAe,WACtC,MAAM,IAAI,MAAM,6FAA6F,EAG9G,MAAMC,EAAQ,MAAMC,EAAAA,MAAM,OAAA,EACpBC,EAAM,MAAM,KAAK,oBAAoBH,CAAM,EAEjDG,EAAI,aAAa,OAAO,QAASF,EAAM,EAAE,EACzCE,EAAI,aAAa,OAAO,iBAAkBF,EAAM,aAAa,EAC7DE,EAAI,aAAa,OAAO,QAASF,EAAM,KAAK,EAC5CE,EAAI,aAAa,OAAO,UAAW,OAAO,EAE1C,MAAM,KAAK,QAAQ,IAAI,OAAOF,EAAM,EAAE,GAAI,KAAK,UAAUA,CAAK,CAAC,EAE/D,KAAK,cAAc,iBAAkB,EAAE,EAEvC,MAAMG,EAAQ,MAAM,KAAK,QAAQ,WAAWD,EAAI,SAAA,EAAYH,CAAM,EAElE,MAAM,KAAK,cAAcI,CAAI,CAAA,CAQ9B,MAAM,SAASJ,EAAsB,GAAmB,CACvDA,EAAO,OAAS,SAEhB,MAAM,KAAK,MAAMA,CAAM,CAAA,CAMxB,MAAM,gBAAgC,CACrC,GAAI,OAAO,KAAK,QAAQ,iBAAoB,WAC3C,MAAM,IAAI,MAAM,uGAAuG,EAGxH,MAAM,KAAK,QAAQ,gBAAgB,KAAK,QAAQ,cAAgB,UAAU,CAAA,CAE5E"}
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
import { SDKOptions,
|
|
1
|
+
import { SDKOptions, PopupParams, SDKStorage, SDKHttpClient } from '../types';
|
|
2
2
|
import { BaseFlow } from './BaseFlow';
|
|
3
3
|
/**
|
|
4
4
|
* Implements the Popup flow for authentication using a popup window.
|
|
5
5
|
*/
|
|
6
|
-
export declare class PopupFlow extends BaseFlow<SDKOptions,
|
|
6
|
+
export declare class PopupFlow extends BaseFlow<SDKOptions, PopupParams> {
|
|
7
|
+
constructor(options: SDKOptions, storage: SDKStorage, httpClient: SDKHttpClient);
|
|
7
8
|
/**
|
|
8
9
|
* Initiates the login process via a popup window.
|
|
9
|
-
* @param {
|
|
10
|
+
* @param {PopupParams} [params={}] Optional parameters for popup window configuration.
|
|
10
11
|
* @returns {Promise<void>} A promise that resolves when the login process completes.
|
|
11
12
|
*/
|
|
12
|
-
login(
|
|
13
|
+
login(params?: PopupParams): Promise<void>;
|
|
13
14
|
/**
|
|
14
15
|
* Initiates the registration process via a popup window.
|
|
15
|
-
* @param {
|
|
16
|
+
* @param {PopupParams} [params={}] Optional parameters for popup window configuration.
|
|
16
17
|
* @returns {Promise<void>} A promise that resolves when the registration process completes.
|
|
17
18
|
*/
|
|
18
|
-
register(
|
|
19
|
+
register(params?: PopupParams): Promise<void>;
|
|
19
20
|
/**
|
|
20
21
|
* Handles the callback after login or registration via a popup window.
|
|
21
|
-
* @returns {Promise<void>} A promise that resolves when the callback is handled.
|
|
22
22
|
*/
|
|
23
23
|
handleCallback(): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Handles the URL redirection to a popup window.
|
|
26
|
-
* @param {URL} url The URL to handle.
|
|
27
|
-
* @param {PopupWindowParams} [options] Optional parameters for popup window configuration.
|
|
28
|
-
* @returns {Promise<Record<string, string>>} A promise that resolves to the data returned from the popup window.
|
|
29
|
-
*/
|
|
30
|
-
urlHandler(url: URL, options?: PopupWindowParams): Promise<Record<string, string>>;
|
|
31
24
|
}
|
package/dist/flows/PopupFlow.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{popupUrlHandler as r,popupCallbackHandler as i}from"../utils/handlers.mjs";import{State as o}from"../utils/State.mjs";import{BaseFlow as l}from"./BaseFlow.mjs";import"../utils/crypto.mjs";import"../utils/base64Url.mjs";import"../utils/date.mjs";import"../utils/jwt.mjs";import"../utils/Metadata.mjs";import"../utils/Session.mjs";class H extends l{constructor(a,t,e){a.urlHandler||(a.urlHandler=r),a.callbackHandler||(a.callbackHandler=i),super(a,t,e)}async login(a={}){if(typeof this.options.urlHandler!="function")throw new Error("URL handler is not defined. Please provide a valid URL handler function in the SDK options.");const t=await o.create(),e=await this.getAuthorizationUrl(a);e.searchParams.append("state",t.id),e.searchParams.append("code_challenge",t.codeChallenge),e.searchParams.append("nonce",t.nonce),e.searchParams.append("display","popup"),await this.storage.set(`sty.${t.id}`,JSON.stringify(t)),this.dispatchEvent("loginInitiated",[]);const n=await this.options.urlHandler(e.toString(),a);await this.tokenExchange(n)}async register(a={}){a.prompt="create",await this.login(a)}async handleCallback(){if(typeof this.options.callbackHandler!="function")throw new Error("Callback handler is not defined. Please provide a valid callback handler function in the SDK options.");await this.options.callbackHandler(this.options.responseMode||"fragment")}}export{H as PopupFlow};
|
|
2
2
|
//# sourceMappingURL=PopupFlow.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupFlow.mjs","sources":["../../src/flows/PopupFlow.ts"],"sourcesContent":["import type { SDKOptions,
|
|
1
|
+
{"version":3,"file":"PopupFlow.mjs","sources":["../../src/flows/PopupFlow.ts"],"sourcesContent":["import type { SDKOptions, PopupParams, SDKStorage, SDKHttpClient } from '../types';\nimport { popupCallbackHandler, popupUrlHandler } from '../utils/handlers';\nimport { State } from '../utils/State';\nimport { BaseFlow } from './BaseFlow';\n\n/**\n * Implements the Popup flow for authentication using a popup window.\n */\nexport class PopupFlow extends BaseFlow<SDKOptions, PopupParams> {\n\tconstructor(options: SDKOptions, storage: SDKStorage, httpClient: SDKHttpClient) {\n\t\tif (!options.urlHandler) {\n\t\t\toptions.urlHandler = popupUrlHandler;\n\t\t}\n\t\tif (!options.callbackHandler) {\n\t\t\toptions.callbackHandler = popupCallbackHandler;\n\t\t}\n\n\t\tsuper(options, storage, httpClient);\n\t}\n\n\t/**\n\t * Initiates the login process via a popup window.\n\t * @param {PopupParams} [params={}] Optional parameters for popup window configuration.\n\t * @returns {Promise<void>} A promise that resolves when the login process completes.\n\t */\n\tasync login(params: PopupParams = {}): Promise<void> {\n\t\tif (typeof this.options.urlHandler !== 'function') {\n\t\t\tthrow new Error('URL handler is not defined. Please provide a valid URL handler function in the SDK options.');\n\t\t}\n\n\t\tconst state = await State.create();\n\t\tconst url = await this.getAuthorizationUrl(params);\n\n\t\turl.searchParams.append('state', state.id);\n\t\turl.searchParams.append('code_challenge', state.codeChallenge);\n\t\turl.searchParams.append('nonce', state.nonce);\n\t\turl.searchParams.append('display', 'popup');\n\n\t\tawait this.storage.set(`sty.${state.id}`, JSON.stringify(state));\n\n\t\tthis.dispatchEvent('loginInitiated', []);\n\n\t\tconst data = (await this.options.urlHandler(url.toString(), params)) as Record<string, string>;\n\n\t\tawait this.tokenExchange(data);\n\t}\n\n\t/**\n\t * Initiates the registration process via a popup window.\n\t * @param {PopupParams} [params={}] Optional parameters for popup window configuration.\n\t * @returns {Promise<void>} A promise that resolves when the registration process completes.\n\t */\n\tasync register(params: PopupParams = {}): Promise<void> {\n\t\tparams.prompt = 'create';\n\n\t\tawait this.login(params);\n\t}\n\n\t/**\n\t * Handles the callback after login or registration via a popup window.\n\t */\n\tasync handleCallback(): Promise<void> {\n\t\tif (typeof this.options.callbackHandler !== 'function') {\n\t\t\tthrow new Error('Callback handler is not defined. Please provide a valid callback handler function in the SDK options.');\n\t\t}\n\n\t\tawait this.options.callbackHandler(this.options.responseMode || 'fragment');\n\t}\n}\n"],"names":["PopupFlow","BaseFlow","options","storage","httpClient","popupUrlHandler","popupCallbackHandler","params","state","State","url","data"],"mappings":"gVAQO,MAAMA,UAAkBC,CAAkC,CAChE,YAAYC,EAAqBC,EAAqBC,EAA2B,CAC3EF,EAAQ,aACZA,EAAQ,WAAaG,GAEjBH,EAAQ,kBACZA,EAAQ,gBAAkBI,GAG3B,MAAMJ,EAASC,EAASC,CAAU,CAAA,CAQnC,MAAM,MAAMG,EAAsB,GAAmB,CACpD,GAAI,OAAO,KAAK,QAAQ,YAAe,WACtC,MAAM,IAAI,MAAM,6FAA6F,EAG9G,MAAMC,EAAQ,MAAMC,EAAM,OAAA,EACpBC,EAAM,MAAM,KAAK,oBAAoBH,CAAM,EAEjDG,EAAI,aAAa,OAAO,QAASF,EAAM,EAAE,EACzCE,EAAI,aAAa,OAAO,iBAAkBF,EAAM,aAAa,EAC7DE,EAAI,aAAa,OAAO,QAASF,EAAM,KAAK,EAC5CE,EAAI,aAAa,OAAO,UAAW,OAAO,EAE1C,MAAM,KAAK,QAAQ,IAAI,OAAOF,EAAM,EAAE,GAAI,KAAK,UAAUA,CAAK,CAAC,EAE/D,KAAK,cAAc,iBAAkB,EAAE,EAEvC,MAAMG,EAAQ,MAAM,KAAK,QAAQ,WAAWD,EAAI,SAAA,EAAYH,CAAM,EAElE,MAAM,KAAK,cAAcI,CAAI,CAAA,CAQ9B,MAAM,SAASJ,EAAsB,GAAmB,CACvDA,EAAO,OAAS,SAEhB,MAAM,KAAK,MAAMA,CAAM,CAAA,CAMxB,MAAM,gBAAgC,CACrC,GAAI,OAAO,KAAK,QAAQ,iBAAoB,WAC3C,MAAM,IAAI,MAAM,uGAAuG,EAGxH,MAAM,KAAK,QAAQ,gBAAgB,KAAK,QAAQ,cAAgB,UAAU,CAAA,CAE5E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../utils/handlers.cjs"),i=require("../utils/State.cjs"),n=require("./BaseFlow.cjs");require("../utils/crypto.cjs");require("../utils/base64Url.cjs");require("../utils/date.cjs");require("../utils/jwt.cjs");require("../utils/Metadata.cjs");require("../utils/Session.cjs");class l extends n.BaseFlow{constructor(e,a,t){e.urlHandler||(e.urlHandler=r.redirectUrlHandler),e.callbackHandler||(e.callbackHandler=r.redirectCallbackHandler),super(e,a,t)}async login(e={}){if(typeof this.options.urlHandler!="function")throw new Error("URL handler is not defined. Please provide a valid URL handler function in the SDK options.");const a=await i.State.create(),t=await this.getAuthorizationUrl(e);t.searchParams.append("state",a.id),t.searchParams.append("code_challenge",a.codeChallenge),t.searchParams.append("nonce",a.nonce),await this.storage.set(`sty.${a.id}`,JSON.stringify(a)),this.dispatchEvent("loginInitiated",[]),await this.options.urlHandler(t.toString(),e)}async register(e={}){e.prompt="create",await this.login(e)}async handleCallback(e){var a;if(typeof this.options.callbackHandler!="function")throw new Error("Callback handler is not defined. Please provide a valid callback handler function in the SDK options.");e||(e=(a=globalThis.window)==null?void 0:a.location.href),await this.tokenExchange(await this.options.callbackHandler(e,this.options.responseMode||"fragment"))}}exports.RedirectFlow=l;
|
|
2
2
|
//# sourceMappingURL=RedirectFlow.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectFlow.cjs","sources":["../../src/flows/RedirectFlow.ts"],"sourcesContent":["import type { SDKOptions, RedirectParams } from '../types';\nimport { redirectUrlHandler, redirectCallbackHandler } from '../utils/handlers';\nimport {
|
|
1
|
+
{"version":3,"file":"RedirectFlow.cjs","sources":["../../src/flows/RedirectFlow.ts"],"sourcesContent":["import type { SDKOptions, RedirectParams, SDKStorage, SDKHttpClient } from '../types';\nimport { redirectUrlHandler, redirectCallbackHandler } from '../utils/handlers';\nimport { State } from '../utils/State';\nimport { BaseFlow } from './BaseFlow';\n\n/**\n * Implements the Redirect flow for authentication using a full-page redirect.\n */\nexport class RedirectFlow extends BaseFlow<SDKOptions, RedirectParams> {\n\tconstructor(options: SDKOptions, storage: SDKStorage, httpClient: SDKHttpClient) {\n\t\tif (!options.urlHandler) {\n\t\t\toptions.urlHandler = redirectUrlHandler;\n\t\t}\n\t\tif (!options.callbackHandler) {\n\t\t\toptions.callbackHandler = redirectCallbackHandler;\n\t\t}\n\n\t\tsuper(options, storage, httpClient);\n\t}\n\n\t/**\n\t * Initiates the login process via a redirect.\n\t * @param {RedirectParams} [params={}] Optional parameters for redirect configuration.\n\t * @returns {Promise<void>} A promise that resolves when the login process completes.\n\t */\n\tasync login(params: RedirectParams = {}): Promise<void> {\n\t\tif (typeof this.options.urlHandler !== 'function') {\n\t\t\tthrow new Error('URL handler is not defined. Please provide a valid URL handler function in the SDK options.');\n\t\t}\n\n\t\tconst state = await State.create();\n\t\tconst url = await this.getAuthorizationUrl(params);\n\n\t\turl.searchParams.append('state', state.id);\n\t\turl.searchParams.append('code_challenge', state.codeChallenge);\n\t\turl.searchParams.append('nonce', state.nonce);\n\n\t\tawait this.storage.set(`sty.${state.id}`, JSON.stringify(state));\n\n\t\tthis.dispatchEvent('loginInitiated', []);\n\n\t\tawait this.options.urlHandler(url.toString(), params);\n\t}\n\n\t/**\n\t * Initiates the registration process via a redirect.\n\t * @param {RedirectParams} [params={}] Optional parameters for redirect configuration.\n\t * @returns {Promise<void>} A promise that resolves when the registration process completes.\n\t */\n\tasync register(params: RedirectParams = {}): Promise<void> {\n\t\tparams.prompt = 'create';\n\n\t\tawait this.login(params);\n\t}\n\n\t/**\n\t * Handles the callback after login or registration via a redirect.\n\t * @param {string} [url] The URL to handle the callback from. Defaults to the current window location.\n\t * @returns {Promise<void>} A promise that resolves when the callback is handled.\n\t */\n\tasync handleCallback(url?: string): Promise<void> {\n\t\tif (typeof this.options.callbackHandler !== 'function') {\n\t\t\tthrow new Error('Callback handler is not defined. Please provide a valid callback handler function in the SDK options.');\n\t\t}\n\n\t\tif (!url) {\n\t\t\turl = globalThis.window?.location.href;\n\t\t}\n\n\t\tawait this.tokenExchange((await this.options.callbackHandler(url, this.options.responseMode || 'fragment')) as Record<string, string>);\n\t}\n}\n"],"names":["RedirectFlow","BaseFlow","options","storage","httpClient","redirectUrlHandler","redirectCallbackHandler","params","state","State","url","_a"],"mappings":"gXAQO,MAAMA,UAAqBC,EAAAA,QAAqC,CACtE,YAAYC,EAAqBC,EAAqBC,EAA2B,CAC3EF,EAAQ,aACZA,EAAQ,WAAaG,EAAAA,oBAEjBH,EAAQ,kBACZA,EAAQ,gBAAkBI,EAAAA,yBAG3B,MAAMJ,EAASC,EAASC,CAAU,CAAA,CAQnC,MAAM,MAAMG,EAAyB,GAAmB,CACvD,GAAI,OAAO,KAAK,QAAQ,YAAe,WACtC,MAAM,IAAI,MAAM,6FAA6F,EAG9G,MAAMC,EAAQ,MAAMC,EAAAA,MAAM,OAAA,EACpBC,EAAM,MAAM,KAAK,oBAAoBH,CAAM,EAEjDG,EAAI,aAAa,OAAO,QAASF,EAAM,EAAE,EACzCE,EAAI,aAAa,OAAO,iBAAkBF,EAAM,aAAa,EAC7DE,EAAI,aAAa,OAAO,QAASF,EAAM,KAAK,EAE5C,MAAM,KAAK,QAAQ,IAAI,OAAOA,EAAM,EAAE,GAAI,KAAK,UAAUA,CAAK,CAAC,EAE/D,KAAK,cAAc,iBAAkB,EAAE,EAEvC,MAAM,KAAK,QAAQ,WAAWE,EAAI,SAAA,EAAYH,CAAM,CAAA,CAQrD,MAAM,SAASA,EAAyB,GAAmB,CAC1DA,EAAO,OAAS,SAEhB,MAAM,KAAK,MAAMA,CAAM,CAAA,CAQxB,MAAM,eAAeG,EAA6B,OACjD,GAAI,OAAO,KAAK,QAAQ,iBAAoB,WAC3C,MAAM,IAAI,MAAM,uGAAuG,EAGnHA,IACJA,GAAMC,EAAA,WAAW,SAAX,YAAAA,EAAmB,SAAS,MAGnC,MAAM,KAAK,cAAe,MAAM,KAAK,QAAQ,gBAAgBD,EAAK,KAAK,QAAQ,cAAgB,UAAU,CAA4B,CAAA,CAEvI"}
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
import { SDKOptions, RedirectParams } from '../types';
|
|
1
|
+
import { SDKOptions, RedirectParams, SDKStorage, SDKHttpClient } from '../types';
|
|
2
2
|
import { BaseFlow } from './BaseFlow';
|
|
3
3
|
/**
|
|
4
4
|
* Implements the Redirect flow for authentication using a full-page redirect.
|
|
5
5
|
*/
|
|
6
6
|
export declare class RedirectFlow extends BaseFlow<SDKOptions, RedirectParams> {
|
|
7
|
+
constructor(options: SDKOptions, storage: SDKStorage, httpClient: SDKHttpClient);
|
|
7
8
|
/**
|
|
8
9
|
* Initiates the login process via a redirect.
|
|
9
|
-
* @param {RedirectParams} [
|
|
10
|
+
* @param {RedirectParams} [params={}] Optional parameters for redirect configuration.
|
|
10
11
|
* @returns {Promise<void>} A promise that resolves when the login process completes.
|
|
11
12
|
*/
|
|
12
|
-
login(
|
|
13
|
+
login(params?: RedirectParams): Promise<void>;
|
|
13
14
|
/**
|
|
14
15
|
* Initiates the registration process via a redirect.
|
|
15
|
-
* @param {RedirectParams} [
|
|
16
|
+
* @param {RedirectParams} [params={}] Optional parameters for redirect configuration.
|
|
16
17
|
* @returns {Promise<void>} A promise that resolves when the registration process completes.
|
|
17
18
|
*/
|
|
18
|
-
register(
|
|
19
|
+
register(params?: RedirectParams): Promise<void>;
|
|
19
20
|
/**
|
|
20
21
|
* Handles the callback after login or registration via a redirect.
|
|
21
22
|
* @param {string} [url] The URL to handle the callback from. Defaults to the current window location.
|
|
22
23
|
* @returns {Promise<void>} A promise that resolves when the callback is handled.
|
|
23
24
|
*/
|
|
24
25
|
handleCallback(url?: string): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Handles the URL redirection to the specified target.
|
|
27
|
-
* @param {URL} url The URL to handle.
|
|
28
|
-
* @param {RedirectParams} [options] Optional parameters for redirection.
|
|
29
|
-
* @returns {Promise<void>} A promise that resolves when the redirection is handled.
|
|
30
|
-
*/
|
|
31
|
-
urlHandler(url: URL, options?: RedirectParams): Promise<void>;
|
|
32
26
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{redirectUrlHandler as i,redirectCallbackHandler as r}from"../utils/handlers.mjs";import{State as n}from"../utils/State.mjs";import{BaseFlow as o}from"./BaseFlow.mjs";import"../utils/crypto.mjs";import"../utils/base64Url.mjs";import"../utils/date.mjs";import"../utils/jwt.mjs";import"../utils/Metadata.mjs";import"../utils/Session.mjs";class u extends o{constructor(a,e,t){a.urlHandler||(a.urlHandler=i),a.callbackHandler||(a.callbackHandler=r),super(a,e,t)}async login(a={}){if(typeof this.options.urlHandler!="function")throw new Error("URL handler is not defined. Please provide a valid URL handler function in the SDK options.");const e=await n.create(),t=await this.getAuthorizationUrl(a);t.searchParams.append("state",e.id),t.searchParams.append("code_challenge",e.codeChallenge),t.searchParams.append("nonce",e.nonce),await this.storage.set(`sty.${e.id}`,JSON.stringify(e)),this.dispatchEvent("loginInitiated",[]),await this.options.urlHandler(t.toString(),a)}async register(a={}){a.prompt="create",await this.login(a)}async handleCallback(a){var e;if(typeof this.options.callbackHandler!="function")throw new Error("Callback handler is not defined. Please provide a valid callback handler function in the SDK options.");a||(a=(e=globalThis.window)==null?void 0:e.location.href),await this.tokenExchange(await this.options.callbackHandler(a,this.options.responseMode||"fragment"))}}export{u as RedirectFlow};
|
|
2
2
|
//# sourceMappingURL=RedirectFlow.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectFlow.mjs","sources":["../../src/flows/RedirectFlow.ts"],"sourcesContent":["import type { SDKOptions, RedirectParams } from '../types';\nimport { redirectUrlHandler, redirectCallbackHandler } from '../utils/handlers';\nimport {
|
|
1
|
+
{"version":3,"file":"RedirectFlow.mjs","sources":["../../src/flows/RedirectFlow.ts"],"sourcesContent":["import type { SDKOptions, RedirectParams, SDKStorage, SDKHttpClient } from '../types';\nimport { redirectUrlHandler, redirectCallbackHandler } from '../utils/handlers';\nimport { State } from '../utils/State';\nimport { BaseFlow } from './BaseFlow';\n\n/**\n * Implements the Redirect flow for authentication using a full-page redirect.\n */\nexport class RedirectFlow extends BaseFlow<SDKOptions, RedirectParams> {\n\tconstructor(options: SDKOptions, storage: SDKStorage, httpClient: SDKHttpClient) {\n\t\tif (!options.urlHandler) {\n\t\t\toptions.urlHandler = redirectUrlHandler;\n\t\t}\n\t\tif (!options.callbackHandler) {\n\t\t\toptions.callbackHandler = redirectCallbackHandler;\n\t\t}\n\n\t\tsuper(options, storage, httpClient);\n\t}\n\n\t/**\n\t * Initiates the login process via a redirect.\n\t * @param {RedirectParams} [params={}] Optional parameters for redirect configuration.\n\t * @returns {Promise<void>} A promise that resolves when the login process completes.\n\t */\n\tasync login(params: RedirectParams = {}): Promise<void> {\n\t\tif (typeof this.options.urlHandler !== 'function') {\n\t\t\tthrow new Error('URL handler is not defined. Please provide a valid URL handler function in the SDK options.');\n\t\t}\n\n\t\tconst state = await State.create();\n\t\tconst url = await this.getAuthorizationUrl(params);\n\n\t\turl.searchParams.append('state', state.id);\n\t\turl.searchParams.append('code_challenge', state.codeChallenge);\n\t\turl.searchParams.append('nonce', state.nonce);\n\n\t\tawait this.storage.set(`sty.${state.id}`, JSON.stringify(state));\n\n\t\tthis.dispatchEvent('loginInitiated', []);\n\n\t\tawait this.options.urlHandler(url.toString(), params);\n\t}\n\n\t/**\n\t * Initiates the registration process via a redirect.\n\t * @param {RedirectParams} [params={}] Optional parameters for redirect configuration.\n\t * @returns {Promise<void>} A promise that resolves when the registration process completes.\n\t */\n\tasync register(params: RedirectParams = {}): Promise<void> {\n\t\tparams.prompt = 'create';\n\n\t\tawait this.login(params);\n\t}\n\n\t/**\n\t * Handles the callback after login or registration via a redirect.\n\t * @param {string} [url] The URL to handle the callback from. Defaults to the current window location.\n\t * @returns {Promise<void>} A promise that resolves when the callback is handled.\n\t */\n\tasync handleCallback(url?: string): Promise<void> {\n\t\tif (typeof this.options.callbackHandler !== 'function') {\n\t\t\tthrow new Error('Callback handler is not defined. Please provide a valid callback handler function in the SDK options.');\n\t\t}\n\n\t\tif (!url) {\n\t\t\turl = globalThis.window?.location.href;\n\t\t}\n\n\t\tawait this.tokenExchange((await this.options.callbackHandler(url, this.options.responseMode || 'fragment')) as Record<string, string>);\n\t}\n}\n"],"names":["RedirectFlow","BaseFlow","options","storage","httpClient","redirectUrlHandler","redirectCallbackHandler","params","state","State","url","_a"],"mappings":"sVAQO,MAAMA,UAAqBC,CAAqC,CACtE,YAAYC,EAAqBC,EAAqBC,EAA2B,CAC3EF,EAAQ,aACZA,EAAQ,WAAaG,GAEjBH,EAAQ,kBACZA,EAAQ,gBAAkBI,GAG3B,MAAMJ,EAASC,EAASC,CAAU,CAAA,CAQnC,MAAM,MAAMG,EAAyB,GAAmB,CACvD,GAAI,OAAO,KAAK,QAAQ,YAAe,WACtC,MAAM,IAAI,MAAM,6FAA6F,EAG9G,MAAMC,EAAQ,MAAMC,EAAM,OAAA,EACpBC,EAAM,MAAM,KAAK,oBAAoBH,CAAM,EAEjDG,EAAI,aAAa,OAAO,QAASF,EAAM,EAAE,EACzCE,EAAI,aAAa,OAAO,iBAAkBF,EAAM,aAAa,EAC7DE,EAAI,aAAa,OAAO,QAASF,EAAM,KAAK,EAE5C,MAAM,KAAK,QAAQ,IAAI,OAAOA,EAAM,EAAE,GAAI,KAAK,UAAUA,CAAK,CAAC,EAE/D,KAAK,cAAc,iBAAkB,EAAE,EAEvC,MAAM,KAAK,QAAQ,WAAWE,EAAI,SAAA,EAAYH,CAAM,CAAA,CAQrD,MAAM,SAASA,EAAyB,GAAmB,CAC1DA,EAAO,OAAS,SAEhB,MAAM,KAAK,MAAMA,CAAM,CAAA,CAQxB,MAAM,eAAeG,EAA6B,OACjD,GAAI,OAAO,KAAK,QAAQ,iBAAoB,WAC3C,MAAM,IAAI,MAAM,uGAAuG,EAGnHA,IACJA,GAAMC,EAAA,WAAW,SAAX,YAAAA,EAAmB,SAAS,MAGnC,MAAM,KAAK,cAAe,MAAM,KAAK,QAAQ,gBAAgBD,EAAK,KAAK,QAAQ,cAAgB,UAAU,CAA4B,CAAA,CAEvI"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./flows/RedirectFlow.cjs"),o=require("./flows/PopupFlow.cjs"),u=require("./flows/NativeFlow.cjs"),n=require("./storages/LocalStorage.cjs"),s=require("./utils/HttpClient.cjs"),a=require("./utils/errors.cjs"),i=require("./types.cjs");require("./utils/handlers.cjs");require("./utils/State.cjs");require("./utils/crypto.cjs");require("./utils/base64Url.cjs");require("./utils/date.cjs");require("./flows/BaseFlow.cjs");require("./utils/jwt.cjs");require("./utils/Metadata.cjs");require("./utils/Session.cjs");require("./utils/NativeFlowHandler.cjs");function w(e){const r=e.storage||n.LocalStorage,t=e.httpClient||s.HttpClient;return e.mode==="popup"?new o.PopupFlow(e,new r,new t):e.mode==="native"?new u.NativeFlow(e,new r,new t):new l.RedirectFlow(e,new r,new t)}exports.FallbackError=a.FallbackError;exports.SDKHttpClient=i.SDKHttpClient;exports.SDKStorage=i.SDKStorage;exports.initFlow=w;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { SDKOptions } from './types';\nimport { RedirectFlow } from './flows/RedirectFlow';\nimport { PopupFlow } from './flows/PopupFlow';\nimport { LocalStorage } from './storages/LocalStorage';\n\nexport type * from './types';\n\n/**\n * Initializes an authentication flow based on the specified mode.\n *\n * @param {SDKOptions & { mode?: 'popup' | 'redirect' }} options - The SDK options, including an optional mode. The default storage class is `LocalStorage`.\n * @returns {PopupFlow | RedirectFlow} A new instance of either PopupFlow or
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { SDKOptions } from './types';\nimport { RedirectFlow } from './flows/RedirectFlow';\nimport { PopupFlow } from './flows/PopupFlow';\nimport { NativeFlow } from './flows/NativeFlow';\nimport { LocalStorage } from './storages/LocalStorage';\nimport { HttpClient } from './utils/HttpClient';\n\nexport * from './utils/errors';\nexport type * from './types';\nexport { SDKStorage, SDKHttpClient } from './types';\n\n/**\n * Initializes an authentication flow based on the specified mode.\n *\n * @param {SDKOptions & { mode?: 'popup' | 'redirect' | 'native' }} options - The SDK options, including an optional mode. The default storage class is `LocalStorage`.\n * @returns {PopupFlow | RedirectFlow | NativeFlow} A new instance of either PopupFlow, RedirectFlow, or NativeFlow based on the mode.\n */\nexport function initFlow(options: SDKOptions & { mode: 'popup' }): PopupFlow;\nexport function initFlow(options: SDKOptions & { mode: 'redirect' }): RedirectFlow;\nexport function initFlow(options: SDKOptions & { mode: 'native' }): NativeFlow;\nexport function initFlow(options: SDKOptions & { mode?: 'popup' | 'redirect' | 'native' }): PopupFlow | RedirectFlow | NativeFlow;\nexport function initFlow(options: SDKOptions & { mode?: 'popup' | 'redirect' | 'native' }): PopupFlow | RedirectFlow | NativeFlow {\n\tconst StorageClass = options.storage || LocalStorage;\n\tconst HttpClientClass = options.httpClient || HttpClient;\n\n\tif (options.mode === 'popup') {\n\t\treturn new PopupFlow(options, new StorageClass(), new HttpClientClass());\n\t} else if (options.mode === 'native') {\n\t\treturn new NativeFlow(options, new StorageClass(), new HttpClientClass());\n\t} else {\n\t\treturn new RedirectFlow(options, new StorageClass(), new HttpClientClass());\n\t}\n}\n"],"names":["initFlow","options","StorageClass","LocalStorage","HttpClientClass","HttpClient","PopupFlow","NativeFlow","RedirectFlow"],"mappings":"ooBAqBO,SAASA,EAASC,EAAyG,CACjI,MAAMC,EAAeD,EAAQ,SAAWE,EAAAA,aAClCC,EAAkBH,EAAQ,YAAcI,EAAAA,WAE9C,OAAIJ,EAAQ,OAAS,QACb,IAAIK,EAAAA,UAAUL,EAAS,IAAIC,EAAgB,IAAIE,CAAiB,EAC7DH,EAAQ,OAAS,SACpB,IAAIM,EAAAA,WAAWN,EAAS,IAAIC,EAAgB,IAAIE,CAAiB,EAEjE,IAAII,EAAAA,aAAaP,EAAS,IAAIC,EAAgB,IAAIE,CAAiB,CAE5E"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { SDKOptions } from './types';
|
|
2
2
|
import { RedirectFlow } from './flows/RedirectFlow';
|
|
3
3
|
import { PopupFlow } from './flows/PopupFlow';
|
|
4
|
+
import { NativeFlow } from './flows/NativeFlow';
|
|
5
|
+
export * from './utils/errors';
|
|
4
6
|
export type * from './types';
|
|
7
|
+
export { SDKStorage, SDKHttpClient } from './types';
|
|
5
8
|
/**
|
|
6
9
|
* Initializes an authentication flow based on the specified mode.
|
|
7
10
|
*
|
|
8
|
-
* @param {SDKOptions & { mode?: 'popup' | 'redirect' }} options - The SDK options, including an optional mode. The default storage class is `LocalStorage`.
|
|
9
|
-
* @returns {PopupFlow | RedirectFlow} A new instance of either PopupFlow or
|
|
11
|
+
* @param {SDKOptions & { mode?: 'popup' | 'redirect' | 'native' }} options - The SDK options, including an optional mode. The default storage class is `LocalStorage`.
|
|
12
|
+
* @returns {PopupFlow | RedirectFlow | NativeFlow} A new instance of either PopupFlow, RedirectFlow, or NativeFlow based on the mode.
|
|
10
13
|
*/
|
|
11
14
|
export declare function initFlow(options: SDKOptions & {
|
|
12
15
|
mode: 'popup';
|
|
@@ -15,5 +18,8 @@ export declare function initFlow(options: SDKOptions & {
|
|
|
15
18
|
mode: 'redirect';
|
|
16
19
|
}): RedirectFlow;
|
|
17
20
|
export declare function initFlow(options: SDKOptions & {
|
|
18
|
-
mode
|
|
19
|
-
}):
|
|
21
|
+
mode: 'native';
|
|
22
|
+
}): NativeFlow;
|
|
23
|
+
export declare function initFlow(options: SDKOptions & {
|
|
24
|
+
mode?: 'popup' | 'redirect' | 'native';
|
|
25
|
+
}): PopupFlow | RedirectFlow | NativeFlow;
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{RedirectFlow as
|
|
1
|
+
import{RedirectFlow as o}from"./flows/RedirectFlow.mjs";import{PopupFlow as m}from"./flows/PopupFlow.mjs";import{NativeFlow as i}from"./flows/NativeFlow.mjs";import{LocalStorage as p}from"./storages/LocalStorage.mjs";import{HttpClient as n}from"./utils/HttpClient.mjs";import{FallbackError as h}from"./utils/errors.mjs";import{SDKHttpClient as E,SDKStorage as L}from"./types.mjs";import"./utils/handlers.mjs";import"./utils/State.mjs";import"./utils/crypto.mjs";import"./utils/base64Url.mjs";import"./utils/date.mjs";import"./flows/BaseFlow.mjs";import"./utils/jwt.mjs";import"./utils/Metadata.mjs";import"./utils/Session.mjs";import"./utils/NativeFlowHandler.mjs";function D(r){const t=r.storage||p,e=r.httpClient||n;return r.mode==="popup"?new m(r,new t,new e):r.mode==="native"?new i(r,new t,new e):new o(r,new t,new e)}export{h as FallbackError,E as SDKHttpClient,L as SDKStorage,D as initFlow};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { SDKOptions } from './types';\nimport { RedirectFlow } from './flows/RedirectFlow';\nimport { PopupFlow } from './flows/PopupFlow';\nimport { LocalStorage } from './storages/LocalStorage';\n\nexport type * from './types';\n\n/**\n * Initializes an authentication flow based on the specified mode.\n *\n * @param {SDKOptions & { mode?: 'popup' | 'redirect' }} options - The SDK options, including an optional mode. The default storage class is `LocalStorage`.\n * @returns {PopupFlow | RedirectFlow} A new instance of either PopupFlow or
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { SDKOptions } from './types';\nimport { RedirectFlow } from './flows/RedirectFlow';\nimport { PopupFlow } from './flows/PopupFlow';\nimport { NativeFlow } from './flows/NativeFlow';\nimport { LocalStorage } from './storages/LocalStorage';\nimport { HttpClient } from './utils/HttpClient';\n\nexport * from './utils/errors';\nexport type * from './types';\nexport { SDKStorage, SDKHttpClient } from './types';\n\n/**\n * Initializes an authentication flow based on the specified mode.\n *\n * @param {SDKOptions & { mode?: 'popup' | 'redirect' | 'native' }} options - The SDK options, including an optional mode. The default storage class is `LocalStorage`.\n * @returns {PopupFlow | RedirectFlow | NativeFlow} A new instance of either PopupFlow, RedirectFlow, or NativeFlow based on the mode.\n */\nexport function initFlow(options: SDKOptions & { mode: 'popup' }): PopupFlow;\nexport function initFlow(options: SDKOptions & { mode: 'redirect' }): RedirectFlow;\nexport function initFlow(options: SDKOptions & { mode: 'native' }): NativeFlow;\nexport function initFlow(options: SDKOptions & { mode?: 'popup' | 'redirect' | 'native' }): PopupFlow | RedirectFlow | NativeFlow;\nexport function initFlow(options: SDKOptions & { mode?: 'popup' | 'redirect' | 'native' }): PopupFlow | RedirectFlow | NativeFlow {\n\tconst StorageClass = options.storage || LocalStorage;\n\tconst HttpClientClass = options.httpClient || HttpClient;\n\n\tif (options.mode === 'popup') {\n\t\treturn new PopupFlow(options, new StorageClass(), new HttpClientClass());\n\t} else if (options.mode === 'native') {\n\t\treturn new NativeFlow(options, new StorageClass(), new HttpClientClass());\n\t} else {\n\t\treturn new RedirectFlow(options, new StorageClass(), new HttpClientClass());\n\t}\n}\n"],"names":["initFlow","options","StorageClass","LocalStorage","HttpClientClass","HttpClient","PopupFlow","NativeFlow","RedirectFlow"],"mappings":"ypBAqBO,SAASA,EAASC,EAAyG,CACjI,MAAMC,EAAeD,EAAQ,SAAWE,EAClCC,EAAkBH,EAAQ,YAAcI,EAE9C,OAAIJ,EAAQ,OAAS,QACb,IAAIK,EAAUL,EAAS,IAAIC,EAAgB,IAAIE,CAAiB,EAC7DH,EAAQ,OAAS,SACpB,IAAIM,EAAWN,EAAS,IAAIC,EAAgB,IAAIE,CAAiB,EAEjE,IAAII,EAAaP,EAAS,IAAIC,EAAgB,IAAIE,CAAiB,CAE5E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t{async get(o){var e,a;return await Promise.resolve((a=(e=globalThis==null?void 0:globalThis.window)==null?void 0:e.localStorage)==null?void 0:a.getItem(o))}async delete(o){var e;await Promise.resolve((e=globalThis==null?void 0:globalThis.window)==null?void 0:e.localStorage.removeItem(o))}async set(o,e){var a;await Promise.resolve((a=globalThis==null?void 0:globalThis.window)==null?void 0:a.localStorage.setItem(o,e))}}exports.LocalStorage=t;
|
|
2
2
|
//# sourceMappingURL=LocalStorage.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalStorage.cjs","sources":["../../src/storages/LocalStorage.ts"],"sourcesContent":["import type { SDKStorage } from '../types';\n\n/**\n * Implements local storage operations using the browser's `localStorage`.\n */\nexport class LocalStorage implements SDKStorage {\n\t/**\n\t * Retrieves a value from local storage by key.\n\t * @param {string} key The key to retrieve the value for.\n\t * @returns {string | null} The value associated with the key, or null if not found.\n\t */\n\
|
|
1
|
+
{"version":3,"file":"LocalStorage.cjs","sources":["../../src/storages/LocalStorage.ts"],"sourcesContent":["import type { SDKStorage } from '../types';\n\n/**\n * Implements local storage operations using the browser's `localStorage`.\n */\nexport class LocalStorage implements SDKStorage {\n\t/**\n\t * Retrieves a value from local storage by key.\n\t * @param {string} key The key to retrieve the value for.\n\t * @returns {string | null} The value associated with the key, or null if not found.\n\t */\n\tasync get(key: string): Promise<string | null> {\n\t\treturn await Promise.resolve(globalThis?.window?.localStorage?.getItem(key));\n\t}\n\n\t/**\n\t * Deletes a key-value pair from local storage.\n\t * @param {string} key The key to delete.\n\t */\n\tasync delete(key: string): Promise<void> {\n\t\tawait Promise.resolve(globalThis?.window?.localStorage.removeItem(key));\n\t}\n\n\t/**\n\t * Sets a key-value pair in local storage.\n\t * @param {string} key The key to set.\n\t * @param {string} value The value to associate with the key.\n\t */\n\tasync set(key: string, value: string): Promise<void> {\n\t\tawait Promise.resolve(globalThis?.window?.localStorage.setItem(key, value));\n\t}\n}\n"],"names":["LocalStorage","key","_b","_a","value"],"mappings":"gFAKO,MAAMA,CAAmC,CAM/C,MAAM,IAAIC,EAAqC,SAC9C,OAAO,MAAM,QAAQ,SAAQC,GAAAC,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,eAApB,YAAAD,EAAkC,QAAQD,EAAI,CAAA,CAO5E,MAAM,OAAOA,EAA4B,OACxC,MAAM,QAAQ,SAAQE,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,aAAa,WAAWF,EAAI,CAAA,CAQvE,MAAM,IAAIA,EAAaG,EAA8B,OACpD,MAAM,QAAQ,SAAQD,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,aAAa,QAAQF,EAAKG,EAAM,CAAA,CAE5E"}
|
|
@@ -8,16 +8,16 @@ export declare class LocalStorage implements SDKStorage {
|
|
|
8
8
|
* @param {string} key The key to retrieve the value for.
|
|
9
9
|
* @returns {string | null} The value associated with the key, or null if not found.
|
|
10
10
|
*/
|
|
11
|
-
get(key: string): string | null
|
|
11
|
+
get(key: string): Promise<string | null>;
|
|
12
12
|
/**
|
|
13
13
|
* Deletes a key-value pair from local storage.
|
|
14
14
|
* @param {string} key The key to delete.
|
|
15
15
|
*/
|
|
16
|
-
delete(key: string): void
|
|
16
|
+
delete(key: string): Promise<void>;
|
|
17
17
|
/**
|
|
18
18
|
* Sets a key-value pair in local storage.
|
|
19
19
|
* @param {string} key The key to set.
|
|
20
20
|
* @param {string} value The value to associate with the key.
|
|
21
21
|
*/
|
|
22
|
-
set(key: string, value: string): void
|
|
22
|
+
set(key: string, value: string): Promise<void>;
|
|
23
23
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
class
|
|
1
|
+
class t{async get(o){var e,a;return await Promise.resolve((a=(e=globalThis==null?void 0:globalThis.window)==null?void 0:e.localStorage)==null?void 0:a.getItem(o))}async delete(o){var e;await Promise.resolve((e=globalThis==null?void 0:globalThis.window)==null?void 0:e.localStorage.removeItem(o))}async set(o,e){var a;await Promise.resolve((a=globalThis==null?void 0:globalThis.window)==null?void 0:a.localStorage.setItem(o,e))}}export{t as LocalStorage};
|
|
2
2
|
//# sourceMappingURL=LocalStorage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalStorage.mjs","sources":["../../src/storages/LocalStorage.ts"],"sourcesContent":["import type { SDKStorage } from '../types';\n\n/**\n * Implements local storage operations using the browser's `localStorage`.\n */\nexport class LocalStorage implements SDKStorage {\n\t/**\n\t * Retrieves a value from local storage by key.\n\t * @param {string} key The key to retrieve the value for.\n\t * @returns {string | null} The value associated with the key, or null if not found.\n\t */\n\
|
|
1
|
+
{"version":3,"file":"LocalStorage.mjs","sources":["../../src/storages/LocalStorage.ts"],"sourcesContent":["import type { SDKStorage } from '../types';\n\n/**\n * Implements local storage operations using the browser's `localStorage`.\n */\nexport class LocalStorage implements SDKStorage {\n\t/**\n\t * Retrieves a value from local storage by key.\n\t * @param {string} key The key to retrieve the value for.\n\t * @returns {string | null} The value associated with the key, or null if not found.\n\t */\n\tasync get(key: string): Promise<string | null> {\n\t\treturn await Promise.resolve(globalThis?.window?.localStorage?.getItem(key));\n\t}\n\n\t/**\n\t * Deletes a key-value pair from local storage.\n\t * @param {string} key The key to delete.\n\t */\n\tasync delete(key: string): Promise<void> {\n\t\tawait Promise.resolve(globalThis?.window?.localStorage.removeItem(key));\n\t}\n\n\t/**\n\t * Sets a key-value pair in local storage.\n\t * @param {string} key The key to set.\n\t * @param {string} value The value to associate with the key.\n\t */\n\tasync set(key: string, value: string): Promise<void> {\n\t\tawait Promise.resolve(globalThis?.window?.localStorage.setItem(key, value));\n\t}\n}\n"],"names":["LocalStorage","key","_a","_b","value"],"mappings":"AAKO,MAAMA,CAAmC,CAM/C,MAAM,IAAIC,EAAqC,CANzC,IAAAC,EAAAC,EAOL,OAAO,MAAM,QAAQ,SAAQA,GAAAD,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,eAApB,YAAAC,EAAkC,QAAQF,EAAI,CAAA,CAO5E,MAAM,OAAOA,EAA4B,CAdnC,IAAAC,EAeL,MAAM,QAAQ,SAAQA,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,aAAa,WAAWD,EAAI,CAAA,CAQvE,MAAM,IAAIA,EAAaG,EAA8B,CAvB/C,IAAAF,EAwBL,MAAM,QAAQ,SAAQA,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,aAAa,QAAQD,EAAKG,EAAM,CAAA,CAE5E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t{get(s){var e,o;return(o=(e=globalThis==null?void 0:globalThis.window)==null?void 0:e.sessionStorage)==null?void 0:o.getItem(s)}delete(s){var e;(e=globalThis==null?void 0:globalThis.window)==null
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t{async get(s){var e,o;return Promise.resolve((o=(e=globalThis==null?void 0:globalThis.window)==null?void 0:e.sessionStorage)==null?void 0:o.getItem(s))}async delete(s){var e;await Promise.resolve((e=globalThis==null?void 0:globalThis.window)==null?void 0:e.sessionStorage.removeItem(s))}async set(s,e){var o;await Promise.resolve((o=globalThis==null?void 0:globalThis.window)==null?void 0:o.sessionStorage.setItem(s,e))}}exports.SessionStorage=t;
|
|
2
2
|
//# sourceMappingURL=SessionStorage.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionStorage.cjs","sources":["../../src/storages/SessionStorage.ts"],"sourcesContent":["import type { SDKStorage } from '../types';\n\n/**\n * Implements session storage operations using the browser's `sessionStorage`.\n */\nexport class SessionStorage implements SDKStorage {\n\t/**\n\t * Retrieves a value from session storage by key.\n\t * @param {string} key The key to retrieve the value for.\n\t * @returns {string | null} The value associated with the key, or null if not found.\n\t */\n\
|
|
1
|
+
{"version":3,"file":"SessionStorage.cjs","sources":["../../src/storages/SessionStorage.ts"],"sourcesContent":["import type { SDKStorage } from '../types';\n\n/**\n * Implements session storage operations using the browser's `sessionStorage`.\n */\nexport class SessionStorage implements SDKStorage {\n\t/**\n\t * Retrieves a value from session storage by key.\n\t * @param {string} key The key to retrieve the value for.\n\t * @returns {string | null} The value associated with the key, or null if not found.\n\t */\n\tasync get(key: string): Promise<string | null> {\n\t\treturn Promise.resolve(globalThis?.window?.sessionStorage?.getItem(key));\n\t}\n\n\t/**\n\t * Deletes a key-value pair from session storage.\n\t * @param {string} key The key to delete.\n\t */\n\tasync delete(key: string): Promise<void> {\n\t\tawait Promise.resolve(globalThis?.window?.sessionStorage.removeItem(key));\n\t}\n\n\t/**\n\t * Sets a key-value pair in session storage.\n\t * @param {string} key The key to set.\n\t * @param {string} value The value to associate with the key.\n\t */\n\tasync set(key: string, value: string): Promise<void> {\n\t\tawait Promise.resolve(globalThis?.window?.sessionStorage.setItem(key, value));\n\t}\n}\n"],"names":["SessionStorage","key","_b","_a","value"],"mappings":"gFAKO,MAAMA,CAAqC,CAMjD,MAAM,IAAIC,EAAqC,SAC9C,OAAO,QAAQ,SAAQC,GAAAC,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,iBAApB,YAAAD,EAAoC,QAAQD,EAAI,CAAA,CAOxE,MAAM,OAAOA,EAA4B,OACxC,MAAM,QAAQ,SAAQE,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,eAAe,WAAWF,EAAI,CAAA,CAQzE,MAAM,IAAIA,EAAaG,EAA8B,OACpD,MAAM,QAAQ,SAAQD,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,eAAe,QAAQF,EAAKG,EAAM,CAAA,CAE9E"}
|
|
@@ -8,16 +8,16 @@ export declare class SessionStorage implements SDKStorage {
|
|
|
8
8
|
* @param {string} key The key to retrieve the value for.
|
|
9
9
|
* @returns {string | null} The value associated with the key, or null if not found.
|
|
10
10
|
*/
|
|
11
|
-
get(key: string): string | null
|
|
11
|
+
get(key: string): Promise<string | null>;
|
|
12
12
|
/**
|
|
13
13
|
* Deletes a key-value pair from session storage.
|
|
14
14
|
* @param {string} key The key to delete.
|
|
15
15
|
*/
|
|
16
|
-
delete(key: string): void
|
|
16
|
+
delete(key: string): Promise<void>;
|
|
17
17
|
/**
|
|
18
18
|
* Sets a key-value pair in session storage.
|
|
19
19
|
* @param {string} key The key to set.
|
|
20
20
|
* @param {string} value The value to associate with the key.
|
|
21
21
|
*/
|
|
22
|
-
set(key: string, value: string): void
|
|
22
|
+
set(key: string, value: string): Promise<void>;
|
|
23
23
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
class
|
|
1
|
+
class a{async get(s){var e,o;return Promise.resolve((o=(e=globalThis==null?void 0:globalThis.window)==null?void 0:e.sessionStorage)==null?void 0:o.getItem(s))}async delete(s){var e;await Promise.resolve((e=globalThis==null?void 0:globalThis.window)==null?void 0:e.sessionStorage.removeItem(s))}async set(s,e){var o;await Promise.resolve((o=globalThis==null?void 0:globalThis.window)==null?void 0:o.sessionStorage.setItem(s,e))}}export{a as SessionStorage};
|
|
2
2
|
//# sourceMappingURL=SessionStorage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionStorage.mjs","sources":["../../src/storages/SessionStorage.ts"],"sourcesContent":["import type { SDKStorage } from '../types';\n\n/**\n * Implements session storage operations using the browser's `sessionStorage`.\n */\nexport class SessionStorage implements SDKStorage {\n\t/**\n\t * Retrieves a value from session storage by key.\n\t * @param {string} key The key to retrieve the value for.\n\t * @returns {string | null} The value associated with the key, or null if not found.\n\t */\n\
|
|
1
|
+
{"version":3,"file":"SessionStorage.mjs","sources":["../../src/storages/SessionStorage.ts"],"sourcesContent":["import type { SDKStorage } from '../types';\n\n/**\n * Implements session storage operations using the browser's `sessionStorage`.\n */\nexport class SessionStorage implements SDKStorage {\n\t/**\n\t * Retrieves a value from session storage by key.\n\t * @param {string} key The key to retrieve the value for.\n\t * @returns {string | null} The value associated with the key, or null if not found.\n\t */\n\tasync get(key: string): Promise<string | null> {\n\t\treturn Promise.resolve(globalThis?.window?.sessionStorage?.getItem(key));\n\t}\n\n\t/**\n\t * Deletes a key-value pair from session storage.\n\t * @param {string} key The key to delete.\n\t */\n\tasync delete(key: string): Promise<void> {\n\t\tawait Promise.resolve(globalThis?.window?.sessionStorage.removeItem(key));\n\t}\n\n\t/**\n\t * Sets a key-value pair in session storage.\n\t * @param {string} key The key to set.\n\t * @param {string} value The value to associate with the key.\n\t */\n\tasync set(key: string, value: string): Promise<void> {\n\t\tawait Promise.resolve(globalThis?.window?.sessionStorage.setItem(key, value));\n\t}\n}\n"],"names":["SessionStorage","key","_a","_b","value"],"mappings":"AAKO,MAAMA,CAAqC,CAMjD,MAAM,IAAIC,EAAqC,CANzC,IAAAC,EAAAC,EAOL,OAAO,QAAQ,SAAQA,GAAAD,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,iBAApB,YAAAC,EAAoC,QAAQF,EAAI,CAAA,CAOxE,MAAM,OAAOA,EAA4B,CAdnC,IAAAC,EAeL,MAAM,QAAQ,SAAQA,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,eAAe,WAAWD,EAAI,CAAA,CAQzE,MAAM,IAAIA,EAAaG,EAA8B,CAvB/C,IAAAF,EAwBL,MAAM,QAAQ,SAAQA,EAAA,mCAAY,SAAZ,YAAAA,EAAoB,eAAe,QAAQD,EAAKG,EAAM,CAAA,CAE9E"}
|
package/dist/types.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["code","id_token"],o=["query","fragment"],s=["none"],n=["authorization_code","refresh_token"],i=["RS256"],p=["public"],c=["none","login","create"],r=["redirect","popup"];class a{}class L{}exports.AlgorithmTypeList=i;exports.FallbackModeTypeList=r;exports.GrantTypeList=n;exports.PromptTypeList=c;exports.ResponseModeList=o;exports.ResponseTypeList=e;exports.SDKHttpClient=L;exports.SDKStorage=a;exports.SubjectTypeList=p;exports.TokenEndpointAuthMethodList=s;
|
|
2
2
|
//# sourceMappingURL=types.cjs.map
|