@vunexa/lixa 0.0.1-alpha.19 → 0.0.1-alpha.21
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/README.md +717 -29
- package/dist/dao/types.d.ts +239 -5
- package/dist/dao/types.d.ts.map +1 -1
- package/dist/export-types/index.d.ts +785 -43
- package/dist/index.cjs +277 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +787 -40
- package/dist/index.d.ts +11 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +277 -41
- package/dist/index.js.map +1 -1
- package/dist/lixa.d.ts +185 -16
- package/dist/lixa.d.ts.map +1 -1
- package/dist/models/session.d.ts +107 -4
- package/dist/models/session.d.ts.map +1 -1
- package/dist/providers/IProvider.d.ts +121 -4
- package/dist/providers/IProvider.d.ts.map +1 -1
- package/dist/providers/index.d.ts +0 -2
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/types.d.ts +129 -14
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -16
- package/dist/IProvider-2tDwRAnH.d.cts +0 -18
- package/dist/IProvider-2tDwRAnH.d.ts +0 -18
- package/dist/export-types/providers.d.ts +0 -61
- package/dist/providers/github.d.ts +0 -13
- package/dist/providers/github.d.ts.map +0 -1
- package/dist/providers/google.d.ts +0 -13
- package/dist/providers/google.d.ts.map +0 -1
- package/dist/providers-entry.cjs +0 -48
- package/dist/providers-entry.cjs.map +0 -1
- package/dist/providers-entry.d.cts +0 -25
- package/dist/providers-entry.d.ts +0 -22
- package/dist/providers-entry.d.ts.map +0 -1
- package/dist/providers-entry.js +0 -20
- package/dist/providers-entry.js.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,12 +1,49 @@
|
|
|
1
|
-
import { SessionDao, StateDao } from "./dao/types";
|
|
2
|
-
import { SessionStrategy } from "./models/session";
|
|
1
|
+
import { SessionDao, StateDao, StateData } from "./dao/types";
|
|
2
|
+
import { SessionStrategy, Session } from "./models/session";
|
|
3
|
+
import { IProvider } from "./providers/IProvider";
|
|
3
4
|
export { SessionStrategy };
|
|
5
|
+
export { Session };
|
|
6
|
+
export { IProvider };
|
|
7
|
+
export { StateDao };
|
|
8
|
+
export { SessionDao };
|
|
9
|
+
export { StateData };
|
|
4
10
|
/**
|
|
5
|
-
* Configuration for an OAuth provider.
|
|
11
|
+
* Configuration for an OAuth provider instance.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* For built-in providers (google, github), just provide credentials.
|
|
15
|
+
* For custom providers, include the provider implementation.
|
|
16
|
+
*
|
|
17
|
+
* The provider field uses a discriminated union to ensure type safety:
|
|
18
|
+
* - When omitted or undefined: assumes a built-in provider
|
|
19
|
+
* - When provided: must be a valid IProvider implementation
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* Built-in provider configuration:
|
|
23
|
+
* ```typescript
|
|
24
|
+
* {
|
|
25
|
+
* clientId: 'your-client-id',
|
|
26
|
+
* clientSecret: 'your-client-secret',
|
|
27
|
+
* redirectUri: 'https://app.com/callback',
|
|
28
|
+
* scopes: ['openid', 'email']
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* Custom provider configuration:
|
|
34
|
+
* ```typescript
|
|
35
|
+
* {
|
|
36
|
+
* provider: new CustomProvider(),
|
|
37
|
+
* clientId: 'your-client-id',
|
|
38
|
+
* clientSecret: 'your-client-secret',
|
|
39
|
+
* redirectUri: 'https://app.com/callback',
|
|
40
|
+
* scopes: ['read:user']
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
6
43
|
*
|
|
7
44
|
* @public
|
|
8
45
|
*/
|
|
9
|
-
export
|
|
46
|
+
export type ProviderConfig = {
|
|
10
47
|
/** The OAuth client ID provided by the provider */
|
|
11
48
|
clientId: string;
|
|
12
49
|
/** The OAuth client secret provided by the provider */
|
|
@@ -17,32 +54,110 @@ export interface ProviderConfig {
|
|
|
17
54
|
scopes: string[];
|
|
18
55
|
/** Additional provider-specific configuration parameters */
|
|
19
56
|
extraConfig?: Record<string, any>;
|
|
20
|
-
}
|
|
57
|
+
} & ({
|
|
58
|
+
provider?: never;
|
|
59
|
+
} | {
|
|
60
|
+
provider: IProvider;
|
|
61
|
+
});
|
|
21
62
|
/**
|
|
22
63
|
* Main configuration object for Lixa.
|
|
23
|
-
*
|
|
64
|
+
* Provides type-safe provider name inference.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* The generic type parameter TProviders enables TypeScript to infer provider names
|
|
68
|
+
* from the configuration object, providing autocomplete and type checking for
|
|
69
|
+
* provider names in methods like getAuthUrl() and handleCallback().
|
|
70
|
+
*
|
|
71
|
+
* @typeParam TProviders - The provider configuration map type, defaults to a generic record
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* Basic configuration with built-in providers:
|
|
75
|
+
* ```typescript
|
|
76
|
+
* import { Lixa } from '@vunexa/lixa';
|
|
77
|
+
* import { GoogleProvider } from '@vunexa/lixa-providers';
|
|
78
|
+
*
|
|
79
|
+
* const lixa = new Lixa({
|
|
80
|
+
* providers: {
|
|
81
|
+
* google: {
|
|
82
|
+
* provider: new GoogleProvider(),
|
|
83
|
+
* clientId: process.env.GOOGLE_CLIENT_ID!,
|
|
84
|
+
* clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
|
85
|
+
* redirectUri: 'https://app.com/auth/google/callback',
|
|
86
|
+
* scopes: ['openid', 'email', 'profile']
|
|
87
|
+
* }
|
|
88
|
+
* }
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* Configuration with custom session and state storage:
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const lixa = new Lixa({
|
|
96
|
+
* providers: {
|
|
97
|
+
* google: {
|
|
98
|
+
* provider: new GoogleProvider(),
|
|
99
|
+
* clientId: process.env.GOOGLE_CLIENT_ID!,
|
|
100
|
+
* clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
|
101
|
+
* redirectUri: 'https://app.com/auth/google/callback',
|
|
102
|
+
* scopes: ['openid', 'email', 'profile']
|
|
103
|
+
* }
|
|
104
|
+
* },
|
|
105
|
+
* sessionStrategy: new CustomSessionStrategy(),
|
|
106
|
+
* stateDao: new RedisStateDao(),
|
|
107
|
+
* sessionDao: new DatabaseSessionDao(),
|
|
108
|
+
* debug: true
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
24
111
|
*
|
|
25
112
|
* @public
|
|
26
113
|
*/
|
|
27
|
-
export interface LixaConfig<
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
114
|
+
export interface LixaConfig<TProviders extends Record<string, ProviderConfig> = Record<string, ProviderConfig>> {
|
|
115
|
+
/**
|
|
116
|
+
* Map of provider names to their configurations.
|
|
117
|
+
* Provider names will be available for autocomplete in getAuthUrl() and handleCallback().
|
|
118
|
+
*/
|
|
119
|
+
providers: TProviders;
|
|
120
|
+
/**
|
|
121
|
+
* Optional custom session creation strategy.
|
|
122
|
+
* Defines how OAuth tokens are converted into application sessions.
|
|
123
|
+
* Defaults to DefaultSessionStrategy if not provided.
|
|
124
|
+
*
|
|
125
|
+
* @see {@link SessionStrategy}
|
|
126
|
+
*/
|
|
31
127
|
sessionStrategy?: SessionStrategy;
|
|
32
|
-
/**
|
|
128
|
+
/**
|
|
129
|
+
* Optional custom state storage implementation.
|
|
130
|
+
* Used for CSRF protection and PKCE code verifier storage during OAuth flow.
|
|
131
|
+
* Defaults to in-memory cache if not provided (not suitable for production).
|
|
132
|
+
*
|
|
133
|
+
* @see {@link StateDao}
|
|
134
|
+
*/
|
|
33
135
|
stateDao?: StateDao;
|
|
34
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* Optional custom session storage implementation.
|
|
138
|
+
* Used for persistent user session storage after authentication.
|
|
139
|
+
* Defaults to in-memory cache if not provided (not suitable for production).
|
|
140
|
+
*
|
|
141
|
+
* @see {@link SessionDao}
|
|
142
|
+
*/
|
|
35
143
|
sessionDao?: SessionDao;
|
|
36
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* Enable debug logging.
|
|
146
|
+
* When enabled, outputs structured logs for initialization, auth flow, and errors.
|
|
147
|
+
* Format: [Lixa] [timestamp] [level] [context] message
|
|
148
|
+
*/
|
|
37
149
|
debug?: boolean;
|
|
38
150
|
}
|
|
39
151
|
/**
|
|
40
152
|
* Helper type to create a configuration with only registered providers.
|
|
41
153
|
* Use this with Lixa.createConfig() for type safety.
|
|
42
154
|
*
|
|
155
|
+
* @deprecated This type is maintained for backward compatibility.
|
|
156
|
+
* The new inline provider configuration pattern makes this unnecessary.
|
|
157
|
+
*
|
|
43
158
|
* @public
|
|
44
159
|
*/
|
|
45
|
-
export type SafeLixaConfig<TProviders extends Record<string, ProviderConfig>> = LixaConfig<
|
|
160
|
+
export type SafeLixaConfig<TProviders extends Record<string, ProviderConfig>> = LixaConfig<TProviders> & {
|
|
46
161
|
providers: TProviders;
|
|
47
162
|
};
|
|
48
163
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IAEjB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IAErB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IAEpB,uCAAuC;IACvC,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,GAAG,CACA;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GACpB;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,WAAW,UAAU,CAAC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC;IAC5G;;;OAGG;IACH,SAAS,EAAE,UAAU,CAAC;IAEtB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,CAAC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG;IACvG,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC"}
|
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.21",
|
|
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",
|
|
@@ -17,23 +17,11 @@
|
|
|
17
17
|
"types": "./dist/export-types/index.d.ts",
|
|
18
18
|
"import": "./dist/index.js",
|
|
19
19
|
"require": "./dist/index.cjs"
|
|
20
|
-
},
|
|
21
|
-
"./providers": {
|
|
22
|
-
"types": "./dist/export-types/providers.d.ts",
|
|
23
|
-
"import": "./dist/providers-entry.js",
|
|
24
|
-
"require": "./dist/providers-entry.cjs"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"typesVersions": {
|
|
28
|
-
"*": {
|
|
29
|
-
"providers": [
|
|
30
|
-
"./dist/export-types/providers.d.ts"
|
|
31
|
-
]
|
|
32
20
|
}
|
|
33
21
|
},
|
|
34
22
|
"scripts": {
|
|
35
23
|
"build": "tsup && npm run test && npm run build:api-docs",
|
|
36
|
-
"build:api-docs": "tsc --emitDeclarationOnly && api-extractor run --local
|
|
24
|
+
"build:api-docs": "tsc --emitDeclarationOnly && api-extractor run --local",
|
|
37
25
|
"clean": "rm -rf dist",
|
|
38
26
|
"prepublishOnly": "npm run clean && npm run build",
|
|
39
27
|
"lint": "eslint src/**/*.ts",
|
|
@@ -51,8 +39,6 @@
|
|
|
51
39
|
},
|
|
52
40
|
"files": [
|
|
53
41
|
"dist",
|
|
54
|
-
"index.d.ts",
|
|
55
|
-
"providers.d.ts",
|
|
56
42
|
"README.md",
|
|
57
43
|
"LICENSE"
|
|
58
44
|
],
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface for OAuth provider implementations.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Implement this interface to add support for custom OAuth providers.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
interface IProvider {
|
|
10
|
-
/** The OAuth authorization endpoint URL */
|
|
11
|
-
authorizationEndpoint: string;
|
|
12
|
-
/** The OAuth token exchange endpoint URL */
|
|
13
|
-
tokenEndpoint: string;
|
|
14
|
-
/** The user information endpoint URL */
|
|
15
|
-
userInfoEndpoint: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type { IProvider as I };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface for OAuth provider implementations.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Implement this interface to add support for custom OAuth providers.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
interface IProvider {
|
|
10
|
-
/** The OAuth authorization endpoint URL */
|
|
11
|
-
authorizationEndpoint: string;
|
|
12
|
-
/** The OAuth token exchange endpoint URL */
|
|
13
|
-
tokenEndpoint: string;
|
|
14
|
-
/** The user information endpoint URL */
|
|
15
|
-
userInfoEndpoint: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type { IProvider as I };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Built-in OAuth providers for Lixa
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Import and register these providers before using them in your Lixa configuration.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { Lixa } from '@vunexa/lixa';
|
|
10
|
-
* import { GoogleProvider, GithubProvider } from '@vunexa/lixa/providers';
|
|
11
|
-
*
|
|
12
|
-
* // Register the providers you want to use
|
|
13
|
-
* Lixa.registerProvider({
|
|
14
|
-
* google: new GoogleProvider(),
|
|
15
|
-
* github: new GithubProvider(),
|
|
16
|
-
* });
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @packageDocumentation
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* GitHub OAuth provider implementation
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export declare class GithubProvider implements IProvider {
|
|
27
|
-
providerType: string;
|
|
28
|
-
authorizationEndpoint: string;
|
|
29
|
-
tokenEndpoint: string;
|
|
30
|
-
userInfoEndpoint: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Google OAuth provider implementation
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export declare class GoogleProvider implements IProvider {
|
|
38
|
-
providerType: string;
|
|
39
|
-
authorizationEndpoint: string;
|
|
40
|
-
tokenEndpoint: string;
|
|
41
|
-
userInfoEndpoint: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Interface for OAuth provider implementations.
|
|
46
|
-
*
|
|
47
|
-
* @remarks
|
|
48
|
-
* Implement this interface to add support for custom OAuth providers.
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
export declare interface IProvider {
|
|
53
|
-
/** The OAuth authorization endpoint URL */
|
|
54
|
-
authorizationEndpoint: string;
|
|
55
|
-
/** The OAuth token exchange endpoint URL */
|
|
56
|
-
tokenEndpoint: string;
|
|
57
|
-
/** The user information endpoint URL */
|
|
58
|
-
userInfoEndpoint: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { }
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IProvider } from "./IProvider";
|
|
2
|
-
/**
|
|
3
|
-
* GitHub OAuth provider implementation
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
declare class GithubProvider implements IProvider {
|
|
7
|
-
providerType: string;
|
|
8
|
-
authorizationEndpoint: string;
|
|
9
|
-
tokenEndpoint: string;
|
|
10
|
-
userInfoEndpoint: string;
|
|
11
|
-
}
|
|
12
|
-
export { GithubProvider };
|
|
13
|
-
//# sourceMappingURL=github.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/providers/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;GAGG;AACH,cAAM,cAAe,YAAW,SAAS;IACvC,YAAY,SAAY;IACxB,qBAAqB,SAA8C;IACnE,aAAa,SAAiD;IAC9D,gBAAgB,SAAiC;CAClD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IProvider } from "./IProvider";
|
|
2
|
-
/**
|
|
3
|
-
* Google OAuth provider implementation
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
declare class GoogleProvider implements IProvider {
|
|
7
|
-
providerType: string;
|
|
8
|
-
authorizationEndpoint: string;
|
|
9
|
-
tokenEndpoint: string;
|
|
10
|
-
userInfoEndpoint: string;
|
|
11
|
-
}
|
|
12
|
-
export { GoogleProvider };
|
|
13
|
-
//# sourceMappingURL=google.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../src/providers/google.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;GAGG;AACH,cAAM,cAAe,YAAW,SAAS;IACvC,YAAY,SAAY;IACxB,qBAAqB,SAAkD;IACvE,aAAa,SAAyC;IACtD,gBAAgB,SAAmD;CACpE;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/providers-entry.cjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/providers-entry.ts
|
|
21
|
-
var providers_entry_exports = {};
|
|
22
|
-
__export(providers_entry_exports, {
|
|
23
|
-
GithubProvider: () => GithubProvider,
|
|
24
|
-
GoogleProvider: () => GoogleProvider
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(providers_entry_exports);
|
|
27
|
-
|
|
28
|
-
// src/providers/github.ts
|
|
29
|
-
var GithubProvider = class {
|
|
30
|
-
providerType = "GITHUB";
|
|
31
|
-
authorizationEndpoint = "https://github.com/login/oauth/authorize";
|
|
32
|
-
tokenEndpoint = "https://github.com/login/oauth/access_token";
|
|
33
|
-
userInfoEndpoint = "https://api.github.com/user";
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// src/providers/google.ts
|
|
37
|
-
var GoogleProvider = class {
|
|
38
|
-
providerType = "GOOGLE";
|
|
39
|
-
authorizationEndpoint = "https://accounts.google.com/o/oauth2/v2/auth";
|
|
40
|
-
tokenEndpoint = "https://oauth2.googleapis.com/token";
|
|
41
|
-
userInfoEndpoint = "https://www.googleapis.com/oauth2/v2/userinfo";
|
|
42
|
-
};
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
GithubProvider,
|
|
46
|
-
GoogleProvider
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=providers-entry.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers-entry.ts","../src/providers/github.ts","../src/providers/google.ts"],"sourcesContent":["/**\n * Built-in OAuth providers for Lixa\n * \n * @remarks\n * Import and register these providers before using them in your Lixa configuration.\n * \n * @example\n * ```typescript\n * import { Lixa } from '@vunexa/lixa';\n * import { GoogleProvider, GithubProvider } from '@vunexa/lixa/providers';\n * \n * // Register the providers you want to use\n * Lixa.registerProvider({\n * google: new GoogleProvider(),\n * github: new GithubProvider(),\n * });\n * ```\n * \n * @packageDocumentation\n */\n\nexport { GoogleProvider, GithubProvider, type IProvider } from \"./providers\";","import { IProvider } from \"./IProvider\";\n\n/**\n * GitHub OAuth provider implementation\n * @public\n */\nclass GithubProvider implements IProvider {\n providerType = \"GITHUB\";\n authorizationEndpoint = \"https://github.com/login/oauth/authorize\";\n tokenEndpoint = \"https://github.com/login/oauth/access_token\";\n userInfoEndpoint = \"https://api.github.com/user\";\n}\n\nexport { GithubProvider };\n","import { IProvider } from \"./IProvider\";\n\n/**\n * Google OAuth provider implementation\n * @public\n */\nclass GoogleProvider implements IProvider {\n providerType = \"GOOGLE\";\n authorizationEndpoint = \"https://accounts.google.com/o/oauth2/v2/auth\";\n tokenEndpoint = \"https://oauth2.googleapis.com/token\";\n userInfoEndpoint = \"https://www.googleapis.com/oauth2/v2/userinfo\";\n}\n\nexport { GoogleProvider };"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,IAAM,iBAAN,MAA0C;AAAA,EACxC,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,mBAAmB;AACrB;;;ACLA,IAAM,iBAAN,MAA0C;AAAA,EACxC,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,mBAAmB;AACrB;","names":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { I as IProvider } from './IProvider-2tDwRAnH.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* GitHub OAuth provider implementation
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
declare class GithubProvider implements IProvider {
|
|
8
|
-
providerType: string;
|
|
9
|
-
authorizationEndpoint: string;
|
|
10
|
-
tokenEndpoint: string;
|
|
11
|
-
userInfoEndpoint: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Google OAuth provider implementation
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
declare class GoogleProvider implements IProvider {
|
|
19
|
-
providerType: string;
|
|
20
|
-
authorizationEndpoint: string;
|
|
21
|
-
tokenEndpoint: string;
|
|
22
|
-
userInfoEndpoint: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { GithubProvider, GoogleProvider, IProvider };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Built-in OAuth providers for Lixa
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Import and register these providers before using them in your Lixa configuration.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { Lixa } from '@vunexa/lixa';
|
|
10
|
-
* import { GoogleProvider, GithubProvider } from '@vunexa/lixa/providers';
|
|
11
|
-
*
|
|
12
|
-
* // Register the providers you want to use
|
|
13
|
-
* Lixa.registerProvider({
|
|
14
|
-
* google: new GoogleProvider(),
|
|
15
|
-
* github: new GithubProvider(),
|
|
16
|
-
* });
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @packageDocumentation
|
|
20
|
-
*/
|
|
21
|
-
export { GoogleProvider, GithubProvider, type IProvider } from "./providers";
|
|
22
|
-
//# sourceMappingURL=providers-entry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"providers-entry.d.ts","sourceRoot":"","sources":["../src/providers-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/providers-entry.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// src/providers/github.ts
|
|
2
|
-
var GithubProvider = class {
|
|
3
|
-
providerType = "GITHUB";
|
|
4
|
-
authorizationEndpoint = "https://github.com/login/oauth/authorize";
|
|
5
|
-
tokenEndpoint = "https://github.com/login/oauth/access_token";
|
|
6
|
-
userInfoEndpoint = "https://api.github.com/user";
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
// src/providers/google.ts
|
|
10
|
-
var GoogleProvider = class {
|
|
11
|
-
providerType = "GOOGLE";
|
|
12
|
-
authorizationEndpoint = "https://accounts.google.com/o/oauth2/v2/auth";
|
|
13
|
-
tokenEndpoint = "https://oauth2.googleapis.com/token";
|
|
14
|
-
userInfoEndpoint = "https://www.googleapis.com/oauth2/v2/userinfo";
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
GithubProvider,
|
|
18
|
-
GoogleProvider
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=providers-entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/github.ts","../src/providers/google.ts"],"sourcesContent":["import { IProvider } from \"./IProvider\";\n\n/**\n * GitHub OAuth provider implementation\n * @public\n */\nclass GithubProvider implements IProvider {\n providerType = \"GITHUB\";\n authorizationEndpoint = \"https://github.com/login/oauth/authorize\";\n tokenEndpoint = \"https://github.com/login/oauth/access_token\";\n userInfoEndpoint = \"https://api.github.com/user\";\n}\n\nexport { GithubProvider };\n","import { IProvider } from \"./IProvider\";\n\n/**\n * Google OAuth provider implementation\n * @public\n */\nclass GoogleProvider implements IProvider {\n providerType = \"GOOGLE\";\n authorizationEndpoint = \"https://accounts.google.com/o/oauth2/v2/auth\";\n tokenEndpoint = \"https://oauth2.googleapis.com/token\";\n userInfoEndpoint = \"https://www.googleapis.com/oauth2/v2/userinfo\";\n}\n\nexport { GoogleProvider };"],"mappings":";AAMA,IAAM,iBAAN,MAA0C;AAAA,EACxC,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,mBAAmB;AACrB;;;ACLA,IAAM,iBAAN,MAA0C;AAAA,EACxC,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,mBAAmB;AACrB;","names":[]}
|