@aura-stack/auth 0.1.0-rc.9 → 0.1.0

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 (116) hide show
  1. package/dist/@types/index.cjs +15 -15
  2. package/dist/@types/index.d.ts +7 -31
  3. package/dist/@types/index.js +1 -1
  4. package/dist/@types/router.d.cjs +1 -1
  5. package/dist/@types/router.d.d.ts +7 -7
  6. package/dist/@types/utility.cjs +15 -15
  7. package/dist/@types/utility.d.ts +6 -6
  8. package/dist/@types/utility.js +1 -1
  9. package/dist/actions/callback/access-token.cjs +143 -143
  10. package/dist/actions/callback/access-token.d.ts +15 -20
  11. package/dist/actions/callback/access-token.js +8 -4
  12. package/dist/actions/callback/callback.cjs +437 -455
  13. package/dist/actions/callback/callback.d.ts +10 -12
  14. package/dist/actions/callback/callback.js +16 -12
  15. package/dist/actions/callback/userinfo.cjs +131 -134
  16. package/dist/actions/callback/userinfo.d.ts +9 -9
  17. package/dist/actions/callback/userinfo.js +10 -6
  18. package/dist/actions/csrfToken/csrfToken.cjs +162 -171
  19. package/dist/actions/csrfToken/csrfToken.d.ts +3 -3
  20. package/dist/actions/csrfToken/csrfToken.js +12 -8
  21. package/dist/actions/index.cjs +746 -773
  22. package/dist/actions/index.d.ts +13 -13
  23. package/dist/actions/index.js +34 -18
  24. package/dist/actions/session/session.cjs +149 -155
  25. package/dist/actions/session/session.d.ts +3 -3
  26. package/dist/actions/session/session.js +11 -7
  27. package/dist/actions/signIn/authorization.cjs +231 -249
  28. package/dist/actions/signIn/authorization.d.ts +12 -18
  29. package/dist/actions/signIn/authorization.js +16 -6
  30. package/dist/actions/signIn/signIn.cjs +396 -423
  31. package/dist/actions/signIn/signIn.d.ts +10 -10
  32. package/dist/actions/signIn/signIn.js +14 -10
  33. package/dist/actions/signOut/signOut.cjs +417 -440
  34. package/dist/actions/signOut/signOut.d.ts +3 -3
  35. package/dist/actions/signOut/signOut.js +15 -11
  36. package/dist/assert.cjs +35 -36
  37. package/dist/assert.d.ts +4 -4
  38. package/dist/assert.js +10 -2
  39. package/dist/chunk-256KIVJL.js +85 -96
  40. package/dist/chunk-42XB3YCW.js +19 -17
  41. package/dist/chunk-6SM22VVJ.js +13 -10
  42. package/dist/chunk-CAKJT3KS.js +84 -69
  43. package/dist/chunk-E3OXBRYF.js +19 -17
  44. package/dist/chunk-EBPE35JT.js +28 -26
  45. package/dist/chunk-FIPU4MLT.js +18 -16
  46. package/dist/chunk-FJUDBLCP.js +50 -43
  47. package/dist/chunk-FKRDCWBF.js +19 -17
  48. package/dist/chunk-GZU3RBTB.js +51 -40
  49. package/dist/chunk-HGJ4TXY4.js +132 -100
  50. package/dist/chunk-HMRKN75I.js +63 -63
  51. package/dist/chunk-IKHPGFCW.js +11 -9
  52. package/dist/chunk-JAPMIE6S.js +7 -5
  53. package/dist/chunk-KRNOMBXQ.js +19 -17
  54. package/dist/chunk-LLR722CL.js +91 -70
  55. package/dist/chunk-RLT4RFKV.js +39 -30
  56. package/dist/chunk-SJPDVKUS.js +107 -88
  57. package/dist/chunk-SMQO5WD7.js +26 -16
  58. package/dist/chunk-STHEPPUZ.js +8 -6
  59. package/dist/chunk-UJJ7R56J.js +47 -37
  60. package/dist/chunk-UTDLUEEG.js +27 -21
  61. package/dist/chunk-VFTYH33W.js +54 -37
  62. package/dist/chunk-XXJKNKGQ.js +33 -23
  63. package/dist/chunk-ZV4BH47P.js +132 -134
  64. package/dist/cookie.cjs +169 -175
  65. package/dist/cookie.d.ts +23 -51
  66. package/dist/cookie.js +34 -34
  67. package/dist/error.cjs +75 -75
  68. package/dist/error.d.ts +30 -30
  69. package/dist/error.js +15 -8
  70. package/dist/headers.cjs +28 -28
  71. package/dist/headers.d.ts +2 -2
  72. package/dist/headers.js +6 -2
  73. package/dist/index-DpfbvTZ_.d.ts +249 -298
  74. package/dist/index.cjs +936 -969
  75. package/dist/index.d.ts +10 -31
  76. package/dist/index.js +70 -50
  77. package/dist/jose.cjs +61 -64
  78. package/dist/jose.d.ts +8 -8
  79. package/dist/jose.js +9 -5
  80. package/dist/oauth/bitbucket.cjs +38 -38
  81. package/dist/oauth/bitbucket.d.ts +7 -7
  82. package/dist/oauth/bitbucket.js +6 -2
  83. package/dist/oauth/discord.cjs +48 -48
  84. package/dist/oauth/discord.d.ts +7 -7
  85. package/dist/oauth/discord.js +6 -2
  86. package/dist/oauth/figma.cjs +39 -39
  87. package/dist/oauth/figma.d.ts +7 -7
  88. package/dist/oauth/figma.js +6 -2
  89. package/dist/oauth/github.cjs +31 -31
  90. package/dist/oauth/github.d.ts +7 -7
  91. package/dist/oauth/github.js +6 -2
  92. package/dist/oauth/gitlab.cjs +39 -39
  93. package/dist/oauth/gitlab.d.ts +7 -7
  94. package/dist/oauth/gitlab.js +6 -2
  95. package/dist/oauth/index.cjs +180 -180
  96. package/dist/oauth/index.d.ts +7 -26
  97. package/dist/oauth/index.js +36 -9
  98. package/dist/oauth/spotify.cjs +39 -39
  99. package/dist/oauth/spotify.d.ts +7 -7
  100. package/dist/oauth/spotify.js +6 -2
  101. package/dist/oauth/x.cjs +39 -39
  102. package/dist/oauth/x.d.ts +7 -7
  103. package/dist/oauth/x.js +6 -2
  104. package/dist/response.cjs +27 -27
  105. package/dist/response.d.ts +2 -2
  106. package/dist/response.js +6 -2
  107. package/dist/schemas.cjs +91 -91
  108. package/dist/schemas.d.ts +93 -126
  109. package/dist/schemas.js +18 -18
  110. package/dist/secure.cjs +95 -98
  111. package/dist/secure.d.ts +17 -17
  112. package/dist/secure.js +18 -4
  113. package/dist/utils.cjs +119 -132
  114. package/dist/utils.d.ts +11 -26
  115. package/dist/utils.js +21 -21
  116. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -1,21 +1,11 @@
1
- import { c as AuthConfig, J as JoseInstance } from "./index-DpfbvTZ_.js"
2
- export {
3
- d as AuthInstance,
4
- C as CookieConfig,
5
- E as ErrorType,
6
- O as OAuthProvider,
7
- e as OAuthProviderConfig,
8
- f as OAuthProviderCredentials,
9
- S as Session,
10
- U as User,
11
- } from "./index-DpfbvTZ_.js"
12
- import * as _aura_stack_router from "@aura-stack/router"
13
- import "zod/v4"
14
- import "@aura-stack/jose/jose"
15
- import "./schemas.js"
16
- import "zod/v4/core"
17
- import "cookie"
18
- import "./@types/utility.js"
1
+ import { c as AuthConfig, d as AuthInstance } from './index-DpfbvTZ_.js';
2
+ export { C as CookieConfig, E as ErrorType, J as JoseInstance, O as OAuthProvider, e as OAuthProviderConfig, f as OAuthProviderCredentials, S as Session, U as User } from './index-DpfbvTZ_.js';
3
+ import 'zod/v4';
4
+ import '@aura-stack/jose/jose';
5
+ import './schemas.js';
6
+ import 'zod/v4/core';
7
+ import 'cookie';
8
+ import './@types/utility.js';
19
9
 
20
10
  /**
21
11
  * Creates the authentication instance with the configuration provided for OAuth provider.
@@ -39,17 +29,6 @@ import "./@types/utility.js"
39
29
  * }]
40
30
  * })
41
31
  */
42
- declare const createAuth: (authConfig: AuthConfig) => {
43
- handlers: _aura_stack_router.GetHttpHandlers<
44
- [
45
- _aura_stack_router.RouteEndpoint<"GET", "/signIn/:oauth", {}>,
46
- _aura_stack_router.RouteEndpoint<"GET", "/callback/:oauth", {}>,
47
- _aura_stack_router.RouteEndpoint<"GET", "/session", {}>,
48
- _aura_stack_router.RouteEndpoint<"POST", "/signOut", {}>,
49
- _aura_stack_router.RouteEndpoint<"GET", "/csrfToken", {}>,
50
- ]
51
- >
52
- jose: JoseInstance
53
- }
32
+ declare const createAuth: (authConfig: AuthConfig) => AuthInstance;
54
33
 
55
- export { AuthConfig, JoseInstance, createAuth }
34
+ export { AuthConfig, AuthInstance, createAuth };
package/dist/index.js CHANGED
@@ -1,55 +1,75 @@
1
- import { createBuiltInOAuthProviders } from "./chunk-VFTYH33W.js"
2
- import "./chunk-FKRDCWBF.js"
3
- import "./chunk-IKHPGFCW.js"
4
- import "./chunk-KRNOMBXQ.js"
5
- import "./chunk-E3OXBRYF.js"
6
- import "./chunk-42XB3YCW.js"
7
- import "./chunk-ITQ7352M.js"
8
- import { csrfTokenAction } from "./chunk-SMQO5WD7.js"
9
- import { sessionAction } from "./chunk-XXJKNKGQ.js"
10
- import { signInAction } from "./chunk-LLR722CL.js"
11
- import { signOutAction } from "./chunk-SJPDVKUS.js"
12
- import "./chunk-CAKJT3KS.js"
13
- import { callbackAction } from "./chunk-HGJ4TXY4.js"
14
- import "./chunk-RLT4RFKV.js"
15
- import "./chunk-UJJ7R56J.js"
16
- import "./chunk-FIPU4MLT.js"
17
- import "./chunk-EBPE35JT.js"
18
- import { defaultCookieConfig } from "./chunk-ZV4BH47P.js"
19
- import "./chunk-6SM22VVJ.js"
20
- import "./chunk-STHEPPUZ.js"
21
- import { createJoseInstance } from "./chunk-UTDLUEEG.js"
22
- import "./chunk-GZU3RBTB.js"
23
- import { onErrorHandler } from "./chunk-256KIVJL.js"
24
- import "./chunk-FJUDBLCP.js"
25
- import "./chunk-JAPMIE6S.js"
26
- import "./chunk-HMRKN75I.js"
1
+ import {
2
+ createBuiltInOAuthProviders
3
+ } from "./chunk-VFTYH33W.js";
4
+ import "./chunk-FKRDCWBF.js";
5
+ import "./chunk-IKHPGFCW.js";
6
+ import "./chunk-KRNOMBXQ.js";
7
+ import "./chunk-E3OXBRYF.js";
8
+ import "./chunk-42XB3YCW.js";
9
+ import "./chunk-ITQ7352M.js";
10
+ import {
11
+ csrfTokenAction
12
+ } from "./chunk-SMQO5WD7.js";
13
+ import {
14
+ sessionAction
15
+ } from "./chunk-XXJKNKGQ.js";
16
+ import {
17
+ signInAction
18
+ } from "./chunk-LLR722CL.js";
19
+ import {
20
+ signOutAction
21
+ } from "./chunk-SJPDVKUS.js";
22
+ import "./chunk-CAKJT3KS.js";
23
+ import {
24
+ callbackAction
25
+ } from "./chunk-HGJ4TXY4.js";
26
+ import "./chunk-RLT4RFKV.js";
27
+ import "./chunk-UJJ7R56J.js";
28
+ import "./chunk-FIPU4MLT.js";
29
+ import "./chunk-EBPE35JT.js";
30
+ import {
31
+ defaultCookieConfig
32
+ } from "./chunk-ZV4BH47P.js";
33
+ import "./chunk-6SM22VVJ.js";
34
+ import "./chunk-STHEPPUZ.js";
35
+ import {
36
+ createJoseInstance
37
+ } from "./chunk-UTDLUEEG.js";
38
+ import "./chunk-GZU3RBTB.js";
39
+ import {
40
+ onErrorHandler
41
+ } from "./chunk-256KIVJL.js";
42
+ import "./chunk-FJUDBLCP.js";
43
+ import "./chunk-JAPMIE6S.js";
44
+ import "./chunk-HMRKN75I.js";
27
45
 
28
46
  // src/index.ts
29
- import "dotenv/config"
30
- import { createRouter } from "@aura-stack/router"
47
+ import "dotenv/config";
48
+ import { createRouter } from "@aura-stack/router";
31
49
  var createInternalConfig = (authConfig) => {
32
- return {
33
- basePath: authConfig?.basePath ?? "/auth",
34
- onError: onErrorHandler,
35
- context: {
36
- oauth: createBuiltInOAuthProviders(authConfig?.oauth),
37
- cookies: authConfig?.cookies ?? defaultCookieConfig,
38
- jose: createJoseInstance(authConfig?.secret),
39
- basePath: authConfig?.basePath ?? "/auth",
40
- trustedProxyHeaders: !!authConfig?.trustedProxyHeaders,
41
- },
50
+ return {
51
+ basePath: authConfig?.basePath ?? "/auth",
52
+ onError: onErrorHandler,
53
+ context: {
54
+ oauth: createBuiltInOAuthProviders(authConfig?.oauth),
55
+ cookies: authConfig?.cookies ?? defaultCookieConfig,
56
+ jose: createJoseInstance(authConfig?.secret),
57
+ basePath: authConfig?.basePath ?? "/auth",
58
+ trustedProxyHeaders: !!authConfig?.trustedProxyHeaders
42
59
  }
43
- }
60
+ };
61
+ };
44
62
  var createAuth = (authConfig) => {
45
- const config = createInternalConfig(authConfig)
46
- const router = createRouter(
47
- [signInAction(config.context.oauth), callbackAction(config.context.oauth), sessionAction, signOutAction, csrfTokenAction],
48
- config
49
- )
50
- return {
51
- handlers: router,
52
- jose: config.context.jose,
53
- }
54
- }
55
- export { createAuth }
63
+ const config = createInternalConfig(authConfig);
64
+ const router = createRouter(
65
+ [signInAction(config.context.oauth), callbackAction(config.context.oauth), sessionAction, signOutAction, csrfTokenAction],
66
+ config
67
+ );
68
+ return {
69
+ handlers: router,
70
+ jose: config.context.jose
71
+ };
72
+ };
73
+ export {
74
+ createAuth
75
+ };
package/dist/jose.cjs CHANGED
@@ -1,83 +1,80 @@
1
- "use strict"
2
- var __create = Object.create
3
- var __defProp = Object.defineProperty
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor
5
- var __getOwnPropNames = Object.getOwnPropertyNames
6
- var __getProtoOf = Object.getPrototypeOf
7
- var __hasOwnProp = Object.prototype.hasOwnProperty
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __export = (target, all) => {
9
- for (var name in all) __defProp(target, name, { get: all[name], enumerable: true })
10
- }
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
11
12
  var __copyProps = (to, from, except, desc) => {
12
- if ((from && typeof from === "object") || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable })
16
- }
17
- return to
18
- }
19
- var __toESM = (mod, isNodeMode, target) => (
20
- (target = mod != null ? __create(__getProtoOf(mod)) : {}),
21
- __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- )
29
- )
30
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
29
 
32
30
  // src/jose.ts
33
- var jose_exports = {}
31
+ var jose_exports = {};
34
32
  __export(jose_exports, {
35
- createJoseInstance: () => createJoseInstance,
36
- })
37
- module.exports = __toCommonJS(jose_exports)
38
- var import_config = require("dotenv/config")
39
- var import_jose = require("@aura-stack/jose")
33
+ createJoseInstance: () => createJoseInstance
34
+ });
35
+ module.exports = __toCommonJS(jose_exports);
36
+ var import_config = require("dotenv/config");
37
+ var import_jose = require("@aura-stack/jose");
40
38
 
41
39
  // src/secure.ts
42
- var import_node_crypto = __toESM(require("crypto"), 1)
40
+ var import_node_crypto = __toESM(require("crypto"), 1);
43
41
 
44
42
  // src/utils.ts
45
- var import_router = require("@aura-stack/router")
43
+ var import_router = require("@aura-stack/router");
46
44
 
47
45
  // src/error.ts
48
46
  var AuthError = class extends Error {
49
- constructor(type, message) {
50
- super(message)
51
- this.type = type
52
- this.name = "AuthError"
53
- }
54
- }
47
+ constructor(type, message) {
48
+ super(message);
49
+ this.type = type;
50
+ this.name = "AuthError";
51
+ }
52
+ };
55
53
 
56
54
  // src/secure.ts
57
55
  var createDerivedSalt = (secret) => {
58
- return import_node_crypto.default.createHash("sha256").update(secret).update("aura-auth-salt").digest("hex")
59
- }
56
+ return import_node_crypto.default.createHash("sha256").update(secret).update("aura-auth-salt").digest("hex");
57
+ };
60
58
 
61
59
  // src/jose.ts
62
60
  var createJoseInstance = (secret) => {
63
- secret ?? (secret = process.env.AURA_AUTH_SECRET)
64
- if (!secret) {
65
- throw new AuthError("JOSE_INIT_ERROR", "AURA_AUTH_SECRET environment variable is not set and no secret was provided.")
66
- }
67
- const salt = process.env.AURA_AUTH_SALT ?? createDerivedSalt(secret)
68
- const { derivedKey: derivedSessionKey } = (0, import_jose.createDeriveKey)(secret, salt, "session")
69
- const { derivedKey: derivedCsrfTokenKey } = (0, import_jose.createDeriveKey)(secret, salt, "csrfToken")
70
- const { decodeJWT, encodeJWT } = (0, import_jose.createJWT)(derivedSessionKey)
71
- const { signJWS, verifyJWS } = (0, import_jose.createJWS)(derivedCsrfTokenKey)
72
- return {
73
- decodeJWT,
74
- encodeJWT,
75
- signJWS,
76
- verifyJWS,
77
- }
78
- }
61
+ secret ?? (secret = process.env.AURA_AUTH_SECRET);
62
+ if (!secret) {
63
+ throw new AuthError("JOSE_INIT_ERROR", "AURA_AUTH_SECRET environment variable is not set and no secret was provided.");
64
+ }
65
+ const salt = process.env.AURA_AUTH_SALT ?? createDerivedSalt(secret);
66
+ const { derivedKey: derivedSessionKey } = (0, import_jose.createDeriveKey)(secret, salt, "session");
67
+ const { derivedKey: derivedCsrfTokenKey } = (0, import_jose.createDeriveKey)(secret, salt, "csrfToken");
68
+ const { decodeJWT, encodeJWT } = (0, import_jose.createJWT)(derivedSessionKey);
69
+ const { signJWS, verifyJWS } = (0, import_jose.createJWS)(derivedCsrfTokenKey);
70
+ return {
71
+ decodeJWT,
72
+ encodeJWT,
73
+ signJWS,
74
+ verifyJWS
75
+ };
76
+ };
79
77
  // Annotate the CommonJS export names for ESM import in node:
80
- 0 &&
81
- (module.exports = {
82
- createJoseInstance,
83
- })
78
+ 0 && (module.exports = {
79
+ createJoseInstance
80
+ });
package/dist/jose.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as _aura_stack_jose_jose from "@aura-stack/jose/jose"
2
- export { JWTPayload } from "@aura-stack/jose/jose"
1
+ import * as _aura_stack_jose_jose from '@aura-stack/jose/jose';
2
+ export { JWTPayload } from '@aura-stack/jose/jose';
3
3
 
4
4
  /**
5
5
  * Creates the JOSE instance used for signing and verifying tokens. It derives keys
@@ -11,10 +11,10 @@ export { JWTPayload } from "@aura-stack/jose/jose"
11
11
  * @returns jose instance with methods for encoding/decoding JWTs and signing/verifying JWSs
12
12
  */
13
13
  declare const createJoseInstance: (secret?: string) => {
14
- decodeJWT: (token: string) => Promise<_aura_stack_jose_jose.JWTPayload>
15
- encodeJWT: (payload: _aura_stack_jose_jose.JWTPayload) => Promise<string>
16
- signJWS: (payload: _aura_stack_jose_jose.JWTPayload) => Promise<string>
17
- verifyJWS: (payload: string) => Promise<_aura_stack_jose_jose.JWTPayload>
18
- }
14
+ decodeJWT: (token: string) => Promise<_aura_stack_jose_jose.JWTPayload>;
15
+ encodeJWT: (payload: _aura_stack_jose_jose.JWTPayload) => Promise<string>;
16
+ signJWS: (payload: _aura_stack_jose_jose.JWTPayload) => Promise<string>;
17
+ verifyJWS: (payload: string) => Promise<_aura_stack_jose_jose.JWTPayload>;
18
+ };
19
19
 
20
- export { createJoseInstance }
20
+ export { createJoseInstance };
package/dist/jose.js CHANGED
@@ -1,5 +1,9 @@
1
- import { createJoseInstance } from "./chunk-UTDLUEEG.js"
2
- import "./chunk-GZU3RBTB.js"
3
- import "./chunk-256KIVJL.js"
4
- import "./chunk-FJUDBLCP.js"
5
- export { createJoseInstance }
1
+ import {
2
+ createJoseInstance
3
+ } from "./chunk-UTDLUEEG.js";
4
+ import "./chunk-GZU3RBTB.js";
5
+ import "./chunk-256KIVJL.js";
6
+ import "./chunk-FJUDBLCP.js";
7
+ export {
8
+ createJoseInstance
9
+ };
@@ -1,45 +1,45 @@
1
- "use strict"
2
- var __defProp = Object.defineProperty
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor
4
- var __getOwnPropNames = Object.getOwnPropertyNames
5
- var __hasOwnProp = Object.prototype.hasOwnProperty
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
6
  var __export = (target, all) => {
7
- for (var name in all) __defProp(target, name, { get: all[name], enumerable: true })
8
- }
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
9
10
  var __copyProps = (to, from, except, desc) => {
10
- if ((from && typeof from === "object") || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable })
14
- }
15
- return to
16
- }
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
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);
18
19
 
19
20
  // src/oauth/bitbucket.ts
20
- var bitbucket_exports = {}
21
+ var bitbucket_exports = {};
21
22
  __export(bitbucket_exports, {
22
- bitbucket: () => bitbucket,
23
- })
24
- module.exports = __toCommonJS(bitbucket_exports)
23
+ bitbucket: () => bitbucket
24
+ });
25
+ module.exports = __toCommonJS(bitbucket_exports);
25
26
  var bitbucket = {
26
- id: "bitbucket",
27
- name: "Bitbucket",
28
- authorizeURL: "https://bitbucket.org/site/oauth2/authorize",
29
- accessToken: "https://bitbucket.org/site/oauth2/access_token",
30
- userInfo: "https://api.bitbucket.org/2.0/user",
31
- scope: "account email",
32
- responseType: "code",
33
- profile(profile) {
34
- return {
35
- sub: profile.uuid ?? profile.account_id,
36
- name: profile.display_name ?? profile.nickname,
37
- image: profile.links.avatar.href,
38
- }
39
- },
40
- }
27
+ id: "bitbucket",
28
+ name: "Bitbucket",
29
+ authorizeURL: "https://bitbucket.org/site/oauth2/authorize",
30
+ accessToken: "https://bitbucket.org/site/oauth2/access_token",
31
+ userInfo: "https://api.bitbucket.org/2.0/user",
32
+ scope: "account email",
33
+ responseType: "code",
34
+ profile(profile) {
35
+ return {
36
+ sub: profile.uuid ?? profile.account_id,
37
+ name: profile.display_name ?? profile.nickname,
38
+ image: profile.links.avatar.href
39
+ };
40
+ }
41
+ };
41
42
  // Annotate the CommonJS export names for ESM import in node:
42
- 0 &&
43
- (module.exports = {
44
- bitbucket,
45
- })
43
+ 0 && (module.exports = {
44
+ bitbucket
45
+ });
@@ -1,7 +1,7 @@
1
- export { B as BitbucketProfile, k as bitbucket } from "../index-DpfbvTZ_.js"
2
- import "../@types/utility.js"
3
- import "zod/v4"
4
- import "@aura-stack/jose/jose"
5
- import "../schemas.js"
6
- import "zod/v4/core"
7
- import "cookie"
1
+ export { B as BitbucketProfile, k as bitbucket } from '../index-DpfbvTZ_.js';
2
+ import '../@types/utility.js';
3
+ import 'zod/v4';
4
+ import '@aura-stack/jose/jose';
5
+ import '../schemas.js';
6
+ import 'zod/v4/core';
7
+ import 'cookie';
@@ -1,2 +1,6 @@
1
- import { bitbucket } from "../chunk-FIPU4MLT.js"
2
- export { bitbucket }
1
+ import {
2
+ bitbucket
3
+ } from "../chunk-FIPU4MLT.js";
4
+ export {
5
+ bitbucket
6
+ };
@@ -1,55 +1,55 @@
1
- "use strict"
2
- var __defProp = Object.defineProperty
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor
4
- var __getOwnPropNames = Object.getOwnPropertyNames
5
- var __hasOwnProp = Object.prototype.hasOwnProperty
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
6
  var __export = (target, all) => {
7
- for (var name in all) __defProp(target, name, { get: all[name], enumerable: true })
8
- }
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
9
10
  var __copyProps = (to, from, except, desc) => {
10
- if ((from && typeof from === "object") || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable })
14
- }
15
- return to
16
- }
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
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);
18
19
 
19
20
  // src/oauth/discord.ts
20
- var discord_exports = {}
21
+ var discord_exports = {};
21
22
  __export(discord_exports, {
22
- discord: () => discord,
23
- })
24
- module.exports = __toCommonJS(discord_exports)
23
+ discord: () => discord
24
+ });
25
+ module.exports = __toCommonJS(discord_exports);
25
26
  var discord = {
26
- id: "discord",
27
- name: "Discord",
28
- authorizeURL: "https://discord.com/oauth2/authorize",
29
- accessToken: "https://discord.com/api/oauth2/token",
30
- userInfo: "https://discord.com/api/users/@me",
31
- scope: "identify email",
32
- responseType: "code",
33
- profile(profile) {
34
- let image = ""
35
- if (profile.avatar === null) {
36
- const index = profile.discriminator === "0" ? (BigInt(profile.id) >> 22n) % 6n : Number(profile.discriminator) % 5
37
- image = `https://cdn.discordapp.com/embed/avatars/${index}.png`
38
- } else {
39
- const format = profile.avatar.startsWith("a_") ? "gif" : "png"
40
- image = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.${format}`
41
- }
42
- return {
43
- sub: profile.id,
44
- // https://discord.com/developers/docs/change-log#display-names
45
- name: profile.global_name ?? profile.username,
46
- email: profile.email ?? "",
47
- image,
48
- }
49
- },
50
- }
27
+ id: "discord",
28
+ name: "Discord",
29
+ authorizeURL: "https://discord.com/oauth2/authorize",
30
+ accessToken: "https://discord.com/api/oauth2/token",
31
+ userInfo: "https://discord.com/api/users/@me",
32
+ scope: "identify email",
33
+ responseType: "code",
34
+ profile(profile) {
35
+ let image = "";
36
+ if (profile.avatar === null) {
37
+ const index = profile.discriminator === "0" ? (BigInt(profile.id) >> 22n) % 6n : Number(profile.discriminator) % 5;
38
+ image = `https://cdn.discordapp.com/embed/avatars/${index}.png`;
39
+ } else {
40
+ const format = profile.avatar.startsWith("a_") ? "gif" : "png";
41
+ image = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.${format}`;
42
+ }
43
+ return {
44
+ sub: profile.id,
45
+ // https://discord.com/developers/docs/change-log#display-names
46
+ name: profile.global_name ?? profile.username,
47
+ email: profile.email ?? "",
48
+ image
49
+ };
50
+ }
51
+ };
51
52
  // Annotate the CommonJS export names for ESM import in node:
52
- 0 &&
53
- (module.exports = {
54
- discord,
55
- })
53
+ 0 && (module.exports = {
54
+ discord
55
+ });
@@ -1,7 +1,7 @@
1
- export { D as DiscordProfile, N as Nameplate, i as discord } from "../index-DpfbvTZ_.js"
2
- import "zod/v4"
3
- import "@aura-stack/jose/jose"
4
- import "../schemas.js"
5
- import "zod/v4/core"
6
- import "cookie"
7
- import "../@types/utility.js"
1
+ export { D as DiscordProfile, N as Nameplate, i as discord } from '../index-DpfbvTZ_.js';
2
+ import 'zod/v4';
3
+ import '@aura-stack/jose/jose';
4
+ import '../schemas.js';
5
+ import 'zod/v4/core';
6
+ import 'cookie';
7
+ import '../@types/utility.js';
@@ -1,2 +1,6 @@
1
- import { discord } from "../chunk-EBPE35JT.js"
2
- export { discord }
1
+ import {
2
+ discord
3
+ } from "../chunk-EBPE35JT.js";
4
+ export {
5
+ discord
6
+ };