@vunexa/lixa 0.0.1-alpha.20 → 0.0.1-alpha.22

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.
Files changed (40) hide show
  1. package/README.md +562 -79
  2. package/dist/dao/session-cache.d.ts +2 -2
  3. package/dist/dao/session-cache.d.ts.map +1 -1
  4. package/dist/dao/state-cache.d.ts +3 -3
  5. package/dist/dao/state-cache.d.ts.map +1 -1
  6. package/dist/dao/types.d.ts +246 -5
  7. package/dist/dao/types.d.ts.map +1 -1
  8. package/dist/export-types/index.d.ts +852 -49
  9. package/dist/index.cjs +282 -46
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +853 -46
  12. package/dist/index.d.ts +11 -3
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +282 -46
  15. package/dist/index.js.map +1 -1
  16. package/dist/lixa.d.ts +187 -18
  17. package/dist/lixa.d.ts.map +1 -1
  18. package/dist/models/session.d.ts +163 -7
  19. package/dist/models/session.d.ts.map +1 -1
  20. package/dist/providers/IProvider.d.ts +121 -4
  21. package/dist/providers/IProvider.d.ts.map +1 -1
  22. package/dist/providers/index.d.ts +0 -2
  23. package/dist/providers/index.d.ts.map +1 -1
  24. package/dist/types.d.ts +131 -15
  25. package/dist/types.d.ts.map +1 -1
  26. package/package.json +2 -16
  27. package/dist/IProvider-2tDwRAnH.d.cts +0 -18
  28. package/dist/IProvider-2tDwRAnH.d.ts +0 -18
  29. package/dist/export-types/providers.d.ts +0 -61
  30. package/dist/providers/github.d.ts +0 -13
  31. package/dist/providers/github.d.ts.map +0 -1
  32. package/dist/providers/google.d.ts +0 -13
  33. package/dist/providers/google.d.ts.map +0 -1
  34. package/dist/providers-entry.cjs +0 -48
  35. package/dist/providers-entry.cjs.map +0 -1
  36. package/dist/providers-entry.d.cts +0 -25
  37. package/dist/providers-entry.d.ts +0 -22
  38. package/dist/providers-entry.d.ts.map +0 -1
  39. package/dist/providers-entry.js +0 -20
  40. package/dist/providers-entry.js.map +0 -1
@@ -1,17 +1,134 @@
1
1
  /**
2
- * Interface for OAuth provider implementations.
2
+ * Interface for OAuth 2.0 and OpenID Connect provider implementations.
3
3
  *
4
4
  * @remarks
5
5
  * Implement this interface to add support for custom OAuth providers.
6
+ * Each provider defines the three core endpoints required for the OAuth 2.0
7
+ * authorization code flow with PKCE.
8
+ *
9
+ * Built-in providers (Google, GitHub) are available in the \@vunexa/lixa-providers package.
10
+ *
11
+ * All implementations must comply with:
12
+ * - RFC 6749 (OAuth 2.0)
13
+ * - RFC 7636 (PKCE)
14
+ * - OpenID Connect Core 1.0 (for OIDC providers)
15
+ *
16
+ * @example
17
+ * Custom provider implementation:
18
+ * ```typescript
19
+ * import { IProvider } from '@vunexa/lixa';
20
+ *
21
+ * class CustomProvider implements IProvider {
22
+ * authorizationEndpoint = 'https://auth.example.com/oauth/authorize';
23
+ * tokenEndpoint = 'https://auth.example.com/oauth/token';
24
+ * userInfoEndpoint = 'https://api.example.com/user';
25
+ * }
26
+ *
27
+ * // Use in configuration
28
+ * const lixa = new Lixa({
29
+ * providers: {
30
+ * custom: {
31
+ * provider: new CustomProvider(),
32
+ * clientId: 'your-client-id',
33
+ * clientSecret: 'your-client-secret',
34
+ * redirectUri: 'https://app.com/callback',
35
+ * scopes: ['read:user']
36
+ * }
37
+ * }
38
+ * });
39
+ * ```
40
+ *
41
+ * @example
42
+ * Object literal provider:
43
+ * ```typescript
44
+ * const customProvider: IProvider = {
45
+ * authorizationEndpoint: 'https://auth.example.com/oauth/authorize',
46
+ * tokenEndpoint: 'https://auth.example.com/oauth/token',
47
+ * userInfoEndpoint: 'https://api.example.com/user'
48
+ * };
49
+ * ```
6
50
  *
7
51
  * @public
8
52
  */
9
53
  interface IProvider {
10
- /** The OAuth authorization endpoint URL */
54
+ /**
55
+ * The OAuth 2.0 authorization endpoint URL.
56
+ *
57
+ * @remarks
58
+ * This is the URL where users are redirected to authenticate and authorize your application.
59
+ * The endpoint must support the OAuth 2.0 authorization code flow with PKCE.
60
+ *
61
+ * Standard query parameters sent to this endpoint:
62
+ * - client_id: Your application's client ID
63
+ * - redirect_uri: Where to redirect after authorization
64
+ * - response_type: Always "code" for authorization code flow
65
+ * - scope: Space-separated list of requested scopes
66
+ * - state: Random string for CSRF protection
67
+ * - code_challenge: PKCE code challenge (SHA-256 hash)
68
+ * - code_challenge_method: Always "S256" for SHA-256
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * authorizationEndpoint = 'https://accounts.google.com/o/oauth2/v2/auth'
73
+ * ```
74
+ */
11
75
  authorizationEndpoint: string;
12
- /** The OAuth token exchange endpoint URL */
76
+ /**
77
+ * The OAuth 2.0 token endpoint URL.
78
+ *
79
+ * @remarks
80
+ * This is the URL where authorization codes are exchanged for access tokens.
81
+ * The endpoint must support the OAuth 2.0 token exchange with PKCE.
82
+ *
83
+ * Standard parameters sent to this endpoint (POST request):
84
+ * - grant_type: Always "authorization_code"
85
+ * - code: The authorization code from the callback
86
+ * - redirect_uri: Must match the authorization request
87
+ * - client_id: Your application's client ID
88
+ * - client_secret: Your application's client secret
89
+ * - code_verifier: PKCE code verifier (original random string)
90
+ *
91
+ * Expected response:
92
+ * - access_token: OAuth access token
93
+ * - token_type: Token type (usually "Bearer")
94
+ * - expires_in: Token expiration time in seconds
95
+ * - refresh_token: Refresh token (optional)
96
+ * - id_token: OpenID Connect ID token (for OIDC providers)
97
+ * - scope: Granted scopes
98
+ *
99
+ * @example
100
+ * ```typescript
101
+ * tokenEndpoint = 'https://oauth2.googleapis.com/token'
102
+ * ```
103
+ */
13
104
  tokenEndpoint: string;
14
- /** The user information endpoint URL */
105
+ /**
106
+ * The user information endpoint URL.
107
+ *
108
+ * @remarks
109
+ * This is the URL where user profile information can be retrieved using the access token.
110
+ * For OpenID Connect providers, this is the UserInfo endpoint.
111
+ *
112
+ * The endpoint is called with the access token in the Authorization header:
113
+ * ```
114
+ * Authorization: Bearer <access_token>
115
+ * ```
116
+ *
117
+ * Common response fields:
118
+ * - sub: Subject identifier (user ID)
119
+ * - email: User's email address
120
+ * - name: User's full name
121
+ * - picture: User's profile picture URL
122
+ * - email_verified: Whether email is verified
123
+ *
124
+ * Note: This endpoint is not called automatically by Lixa. Your SessionStrategy
125
+ * can call it if needed to fetch user profile information.
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * userInfoEndpoint = 'https://www.googleapis.com/oauth2/v2/userinfo'
130
+ * ```
131
+ */
15
132
  userInfoEndpoint: string;
16
133
  }
17
134
  export { IProvider };
@@ -1 +1 @@
1
- {"version":3,"file":"IProvider.d.ts","sourceRoot":"","sources":["../../src/providers/IProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,UAAU,SAAS;IACjB,2CAA2C;IAC3C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,4CAA4C;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB,wCAAwC;IACxC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"IProvider.d.ts","sourceRoot":"","sources":["../../src/providers/IProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,UAAU,SAAS;IACjB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,4 +1,2 @@
1
1
  export { IProvider } from "./IProvider";
2
- export { GithubProvider } from "./github";
3
- export { GoogleProvider } from "./google";
4
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,12 +1,50 @@
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 { OAuthTokenResponse } from "./models/session";
7
+ export { IProvider };
8
+ export { StateDao };
9
+ export { SessionDao };
10
+ export { StateData };
4
11
  /**
5
- * Configuration for an OAuth provider.
12
+ * Configuration for an OAuth provider instance.
13
+ *
14
+ * @remarks
15
+ * For built-in providers (google, github), just provide credentials.
16
+ * For custom providers, include the provider implementation.
17
+ *
18
+ * The provider field uses a discriminated union to ensure type safety:
19
+ * - When omitted or undefined: assumes a built-in provider
20
+ * - When provided: must be a valid IProvider implementation
21
+ *
22
+ * @example
23
+ * Built-in provider configuration:
24
+ * ```typescript
25
+ * {
26
+ * clientId: 'your-client-id',
27
+ * clientSecret: 'your-client-secret',
28
+ * redirectUri: 'https://app.com/callback',
29
+ * scopes: ['openid', 'email']
30
+ * }
31
+ * ```
32
+ *
33
+ * @example
34
+ * Custom provider configuration:
35
+ * ```typescript
36
+ * {
37
+ * provider: new CustomProvider(),
38
+ * clientId: 'your-client-id',
39
+ * clientSecret: 'your-client-secret',
40
+ * redirectUri: 'https://app.com/callback',
41
+ * scopes: ['read:user']
42
+ * }
43
+ * ```
6
44
  *
7
45
  * @public
8
46
  */
9
- export interface ProviderConfig {
47
+ export type ProviderConfig = {
10
48
  /** The OAuth client ID provided by the provider */
11
49
  clientId: string;
12
50
  /** The OAuth client secret provided by the provider */
@@ -16,33 +54,111 @@ export interface ProviderConfig {
16
54
  /** Array of OAuth scopes to request */
17
55
  scopes: string[];
18
56
  /** Additional provider-specific configuration parameters */
19
- extraConfig?: Record<string, any>;
20
- }
57
+ extraConfig?: Record<string, string>;
58
+ } & ({
59
+ provider?: never;
60
+ } | {
61
+ provider: IProvider;
62
+ });
21
63
  /**
22
64
  * Main configuration object for Lixa.
23
- * Only allows providers that have been registered through registerProvider.
65
+ * Provides type-safe provider name inference.
66
+ *
67
+ * @remarks
68
+ * The generic type parameter TProviders enables TypeScript to infer provider names
69
+ * from the configuration object, providing autocomplete and type checking for
70
+ * provider names in methods like getAuthUrl() and handleCallback().
71
+ *
72
+ * @typeParam TProviders - The provider configuration map type, defaults to a generic record
73
+ *
74
+ * @example
75
+ * Basic configuration with built-in providers:
76
+ * ```typescript
77
+ * import { Lixa } from '@vunexa/lixa';
78
+ * import { GoogleProvider } from '@vunexa/lixa-providers';
79
+ *
80
+ * const lixa = new Lixa({
81
+ * providers: {
82
+ * google: {
83
+ * provider: new GoogleProvider(),
84
+ * clientId: process.env.GOOGLE_CLIENT_ID!,
85
+ * clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
86
+ * redirectUri: 'https://app.com/auth/google/callback',
87
+ * scopes: ['openid', 'email', 'profile']
88
+ * }
89
+ * }
90
+ * });
91
+ * ```
92
+ *
93
+ * @example
94
+ * Configuration with custom session and state storage:
95
+ * ```typescript
96
+ * const lixa = new Lixa({
97
+ * providers: {
98
+ * google: {
99
+ * provider: new GoogleProvider(),
100
+ * clientId: process.env.GOOGLE_CLIENT_ID!,
101
+ * clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
102
+ * redirectUri: 'https://app.com/auth/google/callback',
103
+ * scopes: ['openid', 'email', 'profile']
104
+ * }
105
+ * },
106
+ * sessionStrategy: new CustomSessionStrategy(),
107
+ * stateDao: new RedisStateDao(),
108
+ * sessionDao: new DatabaseSessionDao(),
109
+ * debug: true
110
+ * });
111
+ * ```
24
112
  *
25
113
  * @public
26
114
  */
27
- export interface LixaConfig<TRegisteredProviders extends string = string> {
28
- /** Map of registered provider names to their configurations */
29
- providers: Record<TRegisteredProviders, ProviderConfig>;
30
- /** Optional custom session creation strategy */
115
+ export interface LixaConfig<TProviders extends Record<string, ProviderConfig> = Record<string, ProviderConfig>> {
116
+ /**
117
+ * Map of provider names to their configurations.
118
+ * Provider names will be available for autocomplete in getAuthUrl() and handleCallback().
119
+ */
120
+ providers: TProviders;
121
+ /**
122
+ * Optional custom session creation strategy.
123
+ * Defines how OAuth tokens are converted into application sessions.
124
+ * Defaults to DefaultSessionStrategy if not provided.
125
+ *
126
+ * @see {@link SessionStrategy}
127
+ */
31
128
  sessionStrategy?: SessionStrategy;
32
- /** Optional custom state storage implementation */
129
+ /**
130
+ * Optional custom state storage implementation.
131
+ * Used for CSRF protection and PKCE code verifier storage during OAuth flow.
132
+ * Defaults to in-memory cache if not provided (not suitable for production).
133
+ *
134
+ * @see {@link StateDao}
135
+ */
33
136
  stateDao?: StateDao;
34
- /** Optiona: custom session storage implementation */
137
+ /**
138
+ * Optional custom session storage implementation.
139
+ * Used for persistent user session storage after authentication.
140
+ * Defaults to in-memory cache if not provided (not suitable for production).
141
+ *
142
+ * @see {@link SessionDao}
143
+ */
35
144
  sessionDao?: SessionDao;
36
- /** Enable debug logging */
145
+ /**
146
+ * Enable debug logging.
147
+ * When enabled, outputs structured logs for initialization, auth flow, and errors.
148
+ * Format: [Lixa] [timestamp] [level] [context] message
149
+ */
37
150
  debug?: boolean;
38
151
  }
39
152
  /**
40
153
  * Helper type to create a configuration with only registered providers.
41
154
  * Use this with Lixa.createConfig() for type safety.
42
155
  *
156
+ * @deprecated This type is maintained for backward compatibility.
157
+ * The new inline provider configuration pattern makes this unnecessary.
158
+ *
43
159
  * @public
44
160
  */
45
- export type SafeLixaConfig<TProviders extends Record<string, ProviderConfig>> = LixaConfig<keyof TProviders & string> & {
161
+ export type SafeLixaConfig<TProviders extends Record<string, ProviderConfig>> = LixaConfig<TProviders> & {
46
162
  providers: TProviders;
47
163
  };
48
164
  //# sourceMappingURL=types.d.ts.map
@@ -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;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU,CAAC,oBAAoB,SAAS,MAAM,GAAG,MAAM;IACtE,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;IACxD,gDAAgD;IAChD,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,qDAAqD;IACrD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,CAAC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,UAAU,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG;IACtH,SAAS,EAAE,UAAU,CAAC;CACvB,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,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,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,MAAM,CAAC,CAAC;CACtC,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.20",
3
+ "version": "0.0.1-alpha.22",
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 && api-extractor run --local --config api-extractor-providers.json",
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"}
@@ -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"}
@@ -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":[]}