@vunexa/lixa 0.0.1-alpha.6 → 0.0.1-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lixa.d.ts +10 -6
- package/dist/lixa.d.ts.map +1 -1
- package/dist/lixa.js +5 -5
- package/dist/lixa.js.map +1 -1
- package/index.d.ts +11 -6
- package/package.json +1 -1
package/dist/lixa.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type LixaConfig, type Session } from "./types";
|
|
2
2
|
import { IProvider } from "./providers";
|
|
3
|
+
/**
|
|
4
|
+
* Type representing the keys of configured providers
|
|
5
|
+
*/
|
|
6
|
+
type ConfiguredProviderKey<T extends LixaConfig> = keyof T['providers'];
|
|
3
7
|
/**
|
|
4
8
|
* A flexible, provider-agnostic OAuth 2.0 and OpenID Connect (OIDC) client library.
|
|
5
9
|
*
|
|
@@ -22,7 +26,7 @@ import { IProvider } from "./providers";
|
|
|
22
26
|
*
|
|
23
27
|
* @public
|
|
24
28
|
*/
|
|
25
|
-
declare class Lixa {
|
|
29
|
+
declare class Lixa<TConfig extends LixaConfig = LixaConfig> {
|
|
26
30
|
private static CONFIGURED_PROVIDERS;
|
|
27
31
|
private static LOCAL_STATE_CACHE;
|
|
28
32
|
private config;
|
|
@@ -32,7 +36,7 @@ declare class Lixa {
|
|
|
32
36
|
*
|
|
33
37
|
* @param config - The configuration object containing provider settings and optional session strategy
|
|
34
38
|
*/
|
|
35
|
-
constructor(config:
|
|
39
|
+
constructor(config: TConfig);
|
|
36
40
|
/**
|
|
37
41
|
* Checks if a provider is registered and available for use.
|
|
38
42
|
*
|
|
@@ -88,7 +92,7 @@ declare class Lixa {
|
|
|
88
92
|
/**
|
|
89
93
|
* Generates the authorization URL for the specified provider.
|
|
90
94
|
*
|
|
91
|
-
* @param provider - The provider name (
|
|
95
|
+
* @param provider - The provider name (must be a configured provider key)
|
|
92
96
|
* @param state - The state parameter for CSRF protection
|
|
93
97
|
* @returns The complete authorization URL to redirect users to
|
|
94
98
|
*
|
|
@@ -101,11 +105,11 @@ declare class Lixa {
|
|
|
101
105
|
* res.redirect(authUrl);
|
|
102
106
|
* ```
|
|
103
107
|
*/
|
|
104
|
-
getAuthUrl(provider:
|
|
108
|
+
getAuthUrl(provider: ConfiguredProviderKey<TConfig>, state: string): string;
|
|
105
109
|
/**
|
|
106
110
|
* Handles the OAuth callback and creates a user session.
|
|
107
111
|
*
|
|
108
|
-
* @param provider - The provider name
|
|
112
|
+
* @param provider - The provider name (must be a configured provider key)
|
|
109
113
|
* @param code - The authorization code from the provider
|
|
110
114
|
* @param state - The state parameter for validation
|
|
111
115
|
* @returns A Promise that resolves to a Session object
|
|
@@ -122,7 +126,7 @@ declare class Lixa {
|
|
|
122
126
|
* ```
|
|
123
127
|
*/
|
|
124
128
|
handleCallback({ provider, code, state, }: {
|
|
125
|
-
provider:
|
|
129
|
+
provider: ConfiguredProviderKey<TConfig>;
|
|
126
130
|
code: string;
|
|
127
131
|
state?: string;
|
|
128
132
|
}): Promise<Session>;
|
package/dist/lixa.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lixa.d.ts","sourceRoot":"","sources":["../src/lixa.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAuB,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAkC,MAAM,aAAa,CAAC;AAMxE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,cAAM,IAAI;
|
|
1
|
+
{"version":3,"file":"lixa.d.ts","sourceRoot":"","sources":["../src/lixa.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAuB,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAkC,MAAM,aAAa,CAAC;AAMxE;;GAEG;AACH,KAAK,qBAAqB,CAAC,CAAC,SAAS,UAAU,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the specified provider.
|
|
119
119
|
*
|
|
120
|
-
* @param provider - The provider name (
|
|
120
|
+
* @param provider - The provider name (must be a configured provider key)
|
|
121
121
|
* @param state - The state parameter for CSRF protection
|
|
122
122
|
* @returns The complete authorization URL to redirect users to
|
|
123
123
|
*
|
|
@@ -131,7 +131,7 @@ class Lixa {
|
|
|
131
131
|
* ```
|
|
132
132
|
*/
|
|
133
133
|
getAuthUrl(provider, state) {
|
|
134
|
-
const providerType = provider.toLowerCase();
|
|
134
|
+
const providerType = String(provider).toLowerCase();
|
|
135
135
|
const providerConfig = this.findProviderByType(providerType);
|
|
136
136
|
const providerImpl = Lixa.CONFIGURED_PROVIDERS.get(providerType);
|
|
137
137
|
if (!providerConfig || !providerImpl) {
|
|
@@ -162,7 +162,7 @@ class Lixa {
|
|
|
162
162
|
/**
|
|
163
163
|
* Handles the OAuth callback and creates a user session.
|
|
164
164
|
*
|
|
165
|
-
* @param provider - The provider name
|
|
165
|
+
* @param provider - The provider name (must be a configured provider key)
|
|
166
166
|
* @param code - The authorization code from the provider
|
|
167
167
|
* @param state - The state parameter for validation
|
|
168
168
|
* @returns A Promise that resolves to a Session object
|
|
@@ -194,11 +194,11 @@ class Lixa {
|
|
|
194
194
|
await this.stateDao.deleteState(state);
|
|
195
195
|
//Get code verifier from cached state
|
|
196
196
|
const codeVerifier = cachedState.codeVerifier;
|
|
197
|
-
const providerType = provider.toLowerCase();
|
|
197
|
+
const providerType = String(provider).toLowerCase();
|
|
198
198
|
const providerConfig = this.findProviderByType(providerType);
|
|
199
199
|
const providerImpl = Lixa.CONFIGURED_PROVIDERS.get(providerType);
|
|
200
200
|
if (!providerConfig || !providerImpl) {
|
|
201
|
-
throw new Error(`Provider ${provider} not configured`);
|
|
201
|
+
throw new Error(`Provider ${String(provider)} not configured`);
|
|
202
202
|
}
|
|
203
203
|
// Exchange code for tokens and fetch user info here.
|
|
204
204
|
const tokens = await this.exchangeCodeForToken(code, providerConfig, providerImpl, codeVerifier);
|
package/dist/lixa.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lixa.js","sourceRoot":"","sources":["../src/lixa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"lixa.js","sourceRoot":"","sources":["../src/lixa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAO5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,IAAI;IACA,MAAM,CAAC,oBAAoB,GAA2B,IAAI,GAAG,EAAE,CAAC;IAChE,MAAM,CAAC,iBAAiB,GAAG,IAAI,eAAe,EAAE,CAAC;IACjD,MAAM,CAAU;IAChB,QAAQ,CAAW;IAE3B;;;;OAIG;IACH,YAAY,MAAe;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,iBAAiB,CAAC;QAC1D,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,cAAc,EAAE,CAAC,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AC7C,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Type representing the keys of configured providers
|
|
12
|
+
*/
|
|
13
|
+
declare type ConfiguredProviderKey<T extends LixaConfig> = keyof T['providers'];
|
|
14
|
+
|
|
10
15
|
/**
|
|
11
16
|
* Interface for OAuth provider implementations.
|
|
12
17
|
*
|
|
@@ -46,7 +51,7 @@ export declare interface IProvider {
|
|
|
46
51
|
*
|
|
47
52
|
* @public
|
|
48
53
|
*/
|
|
49
|
-
export declare class Lixa {
|
|
54
|
+
export declare class Lixa<TConfig extends LixaConfig = LixaConfig> {
|
|
50
55
|
private static CONFIGURED_PROVIDERS;
|
|
51
56
|
private static LOCAL_STATE_CACHE;
|
|
52
57
|
private config;
|
|
@@ -56,7 +61,7 @@ export declare class Lixa {
|
|
|
56
61
|
*
|
|
57
62
|
* @param config - The configuration object containing provider settings and optional session strategy
|
|
58
63
|
*/
|
|
59
|
-
constructor(config:
|
|
64
|
+
constructor(config: TConfig);
|
|
60
65
|
/**
|
|
61
66
|
* Checks if a provider is registered and available for use.
|
|
62
67
|
*
|
|
@@ -112,7 +117,7 @@ export declare class Lixa {
|
|
|
112
117
|
/**
|
|
113
118
|
* Generates the authorization URL for the specified provider.
|
|
114
119
|
*
|
|
115
|
-
* @param provider - The provider name (
|
|
120
|
+
* @param provider - The provider name (must be a configured provider key)
|
|
116
121
|
* @param state - The state parameter for CSRF protection
|
|
117
122
|
* @returns The complete authorization URL to redirect users to
|
|
118
123
|
*
|
|
@@ -125,11 +130,11 @@ export declare class Lixa {
|
|
|
125
130
|
* res.redirect(authUrl);
|
|
126
131
|
* ```
|
|
127
132
|
*/
|
|
128
|
-
getAuthUrl(provider:
|
|
133
|
+
getAuthUrl(provider: ConfiguredProviderKey<TConfig>, state: string): string;
|
|
129
134
|
/**
|
|
130
135
|
* Handles the OAuth callback and creates a user session.
|
|
131
136
|
*
|
|
132
|
-
* @param provider - The provider name
|
|
137
|
+
* @param provider - The provider name (must be a configured provider key)
|
|
133
138
|
* @param code - The authorization code from the provider
|
|
134
139
|
* @param state - The state parameter for validation
|
|
135
140
|
* @returns A Promise that resolves to a Session object
|
|
@@ -146,7 +151,7 @@ export declare class Lixa {
|
|
|
146
151
|
* ```
|
|
147
152
|
*/
|
|
148
153
|
handleCallback({ provider, code, state, }: {
|
|
149
|
-
provider:
|
|
154
|
+
provider: ConfiguredProviderKey<TConfig>;
|
|
150
155
|
code: string;
|
|
151
156
|
state?: string;
|
|
152
157
|
}): Promise<Session>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vunexa/lixa",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.8",
|
|
4
4
|
"description": "Lixa is a flexible, provider-agnostic OAuth and OpenID Connect (OIDC) client library that simplifies multi-provider authentication flows. It supports seamless integration with providers like Google and GitHub, offers extensible session management, and enables dynamic provider resolution based on callback URLs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oauth",
|