@aura-stack/auth 0.5.0 → 0.7.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.
- package/README.md +36 -1
- package/dist/@types/index.cjs +0 -18
- package/dist/@types/index.d.ts +2 -12
- package/dist/@types/index.js +0 -1
- package/dist/assert-_fBNnaOk.js +3 -0
- package/dist/assert-hDwQ_SPO.cjs +3 -0
- package/dist/client/index.cjs +1 -135
- package/dist/client/index.d.ts +11 -14
- package/dist/client/index.js +1 -10
- package/dist/crypto-D6_SoGMH.cjs +1 -0
- package/dist/crypto-DyrRzBSQ.js +1 -0
- package/dist/env-7as-tgzO.cjs +1 -0
- package/dist/env-CJtSi1eX.js +1 -0
- package/dist/errors-Czt_w1t_.js +1 -0
- package/dist/errors-DcK2ELlk.cjs +1 -0
- package/dist/identity-b8FCr0Oa.cjs +1 -0
- package/dist/index-C9U6ICDT.d.ts +2796 -0
- package/dist/index.cjs +1 -2427
- package/dist/index.d.ts +2 -14
- package/dist/index.js +1 -59
- package/dist/logger-DjXkgSn5.js +1 -0
- package/dist/logger-G5PinyEc.cjs +1 -0
- package/dist/oauth/atlassian.cjs +1 -57
- package/dist/oauth/atlassian.d.ts +2 -12
- package/dist/oauth/atlassian.js +1 -6
- package/dist/oauth/bitbucket.cjs +1 -49
- package/dist/oauth/bitbucket.d.ts +2 -12
- package/dist/oauth/bitbucket.js +1 -6
- package/dist/oauth/click-up.cjs +1 -0
- package/dist/oauth/click-up.d.ts +2 -0
- package/dist/oauth/click-up.js +1 -0
- package/dist/oauth/discord.cjs +1 -57
- package/dist/oauth/discord.d.ts +2 -12
- package/dist/oauth/discord.js +1 -6
- package/dist/oauth/dribbble.cjs +1 -0
- package/dist/oauth/dribbble.d.ts +2 -0
- package/dist/oauth/dribbble.js +1 -0
- package/dist/oauth/dropbox.cjs +1 -53
- package/dist/oauth/dropbox.d.ts +2 -12
- package/dist/oauth/dropbox.js +1 -6
- package/dist/oauth/figma.cjs +1 -49
- package/dist/oauth/figma.d.ts +2 -12
- package/dist/oauth/figma.js +1 -6
- package/dist/oauth/github.cjs +1 -49
- package/dist/oauth/github.d.ts +2 -12
- package/dist/oauth/github.js +1 -6
- package/dist/oauth/gitlab.cjs +1 -49
- package/dist/oauth/gitlab.d.ts +2 -12
- package/dist/oauth/gitlab.js +1 -6
- package/dist/oauth/index.cjs +1 -673
- package/dist/oauth/index.d.ts +2 -12
- package/dist/oauth/index.js +1 -68
- package/dist/oauth/mailchimp.cjs +1 -49
- package/dist/oauth/mailchimp.d.ts +2 -12
- package/dist/oauth/mailchimp.js +1 -6
- package/dist/oauth/notion.cjs +1 -131
- package/dist/oauth/notion.d.ts +2 -12
- package/dist/oauth/notion.js +1 -9
- package/dist/oauth/pinterest.cjs +1 -49
- package/dist/oauth/pinterest.d.ts +2 -12
- package/dist/oauth/pinterest.js +1 -6
- package/dist/oauth/spotify.cjs +1 -49
- package/dist/oauth/spotify.d.ts +2 -12
- package/dist/oauth/spotify.js +1 -6
- package/dist/oauth/strava.cjs +1 -49
- package/dist/oauth/strava.d.ts +2 -12
- package/dist/oauth/strava.js +1 -6
- package/dist/oauth/twitch.cjs +1 -95
- package/dist/oauth/twitch.d.ts +2 -12
- package/dist/oauth/twitch.js +1 -7
- package/dist/oauth/x.cjs +1 -49
- package/dist/oauth/x.d.ts +2 -12
- package/dist/oauth/x.js +1 -6
- package/dist/oauth-D3_mnBOx.js +1 -0
- package/dist/oauth-gPiWxjBd.cjs +1 -0
- package/dist/shared/crypto.cjs +1 -0
- package/dist/shared/crypto.d.ts +71 -0
- package/dist/shared/crypto.js +1 -0
- package/dist/shared/identity.cjs +1 -0
- package/dist/shared/identity.d.ts +2 -0
- package/dist/shared/identity.js +1 -0
- package/dist/shared/index.cjs +1 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.js +1 -0
- package/package.json +37 -11
- package/dist/@types/router.d.cjs +0 -1
- package/dist/@types/router.d.d.ts +0 -16
- package/dist/@types/router.d.js +0 -0
- package/dist/@types/utility.cjs +0 -18
- package/dist/@types/utility.d.ts +0 -6
- package/dist/@types/utility.js +0 -1
- package/dist/actions/callback/access-token.cjs +0 -250
- package/dist/actions/callback/access-token.d.ts +0 -33
- package/dist/actions/callback/access-token.js +0 -9
- package/dist/actions/callback/callback.cjs +0 -715
- package/dist/actions/callback/callback.d.ts +0 -42
- package/dist/actions/callback/callback.js +0 -18
- package/dist/actions/callback/userinfo.cjs +0 -283
- package/dist/actions/callback/userinfo.d.ts +0 -25
- package/dist/actions/callback/userinfo.js +0 -13
- package/dist/actions/csrfToken/csrfToken.cjs +0 -189
- package/dist/actions/csrfToken/csrfToken.d.ts +0 -7
- package/dist/actions/csrfToken/csrfToken.js +0 -13
- package/dist/actions/index.cjs +0 -1161
- package/dist/actions/index.d.ts +0 -17
- package/dist/actions/index.js +0 -39
- package/dist/actions/session/session.cjs +0 -188
- package/dist/actions/session/session.d.ts +0 -7
- package/dist/actions/session/session.js +0 -12
- package/dist/actions/signIn/authorization-url.cjs +0 -288
- package/dist/actions/signIn/authorization-url.d.ts +0 -31
- package/dist/actions/signIn/authorization-url.js +0 -16
- package/dist/actions/signIn/authorization.cjs +0 -281
- package/dist/actions/signIn/authorization.d.ts +0 -54
- package/dist/actions/signIn/authorization.js +0 -19
- package/dist/actions/signIn/signIn.cjs +0 -595
- package/dist/actions/signIn/signIn.d.ts +0 -42
- package/dist/actions/signIn/signIn.js +0 -16
- package/dist/actions/signOut/signOut.cjs +0 -492
- package/dist/actions/signOut/signOut.d.ts +0 -16
- package/dist/actions/signOut/signOut.js +0 -15
- package/dist/api/createApi.cjs +0 -750
- package/dist/api/createApi.d.ts +0 -12
- package/dist/api/createApi.js +0 -19
- package/dist/api/getSession.cjs +0 -141
- package/dist/api/getSession.d.ts +0 -16
- package/dist/api/getSession.js +0 -10
- package/dist/api/signIn.cjs +0 -549
- package/dist/api/signIn.d.ts +0 -26
- package/dist/api/signIn.js +0 -15
- package/dist/api/signOut.cjs +0 -279
- package/dist/api/signOut.d.ts +0 -16
- package/dist/api/signOut.js +0 -13
- package/dist/assert.cjs +0 -194
- package/dist/assert.d.ts +0 -37
- package/dist/assert.js +0 -26
- package/dist/chunk-2A5B7GWR.js +0 -125
- package/dist/chunk-2GQLSIJ2.js +0 -40
- package/dist/chunk-2IR674WX.js +0 -44
- package/dist/chunk-3J5TUH2I.js +0 -50
- package/dist/chunk-4RWSYUKX.js +0 -98
- package/dist/chunk-4YHJ4IEQ.js +0 -25
- package/dist/chunk-54CZPKR4.js +0 -25
- package/dist/chunk-5LZ7TOM3.js +0 -25
- package/dist/chunk-5X7JZMEF.js +0 -0
- package/dist/chunk-7BE46WWS.js +0 -88
- package/dist/chunk-7YYXFKLR.js +0 -35
- package/dist/chunk-C3A37LQC.js +0 -33
- package/dist/chunk-CITNGXDA.js +0 -31
- package/dist/chunk-CWX724AG.js +0 -78
- package/dist/chunk-D2CSIUKP.js +0 -74
- package/dist/chunk-E6G5YCI6.js +0 -25
- package/dist/chunk-EBAMFRB7.js +0 -34
- package/dist/chunk-EEE7UM5T.js +0 -25
- package/dist/chunk-FPCVZUVG.js +0 -37
- package/dist/chunk-FW4W3REU.js +0 -25
- package/dist/chunk-GNNBM2WJ.js +0 -83
- package/dist/chunk-IPKO6UQN.js +0 -25
- package/dist/chunk-ITQ7352M.js +0 -0
- package/dist/chunk-JOCGX3RP.js +0 -59
- package/dist/chunk-KBXWTD6E.js +0 -94
- package/dist/chunk-KMMAZFSJ.js +0 -25
- package/dist/chunk-LATR3NIV.js +0 -117
- package/dist/chunk-LAYPUDQF.js +0 -39
- package/dist/chunk-LDU7A2JE.js +0 -25
- package/dist/chunk-LX3TJ2TJ.js +0 -294
- package/dist/chunk-NHZBQNRR.js +0 -143
- package/dist/chunk-OVHNRULD.js +0 -33
- package/dist/chunk-PDP3PHB3.js +0 -127
- package/dist/chunk-PG7UYFG5.js +0 -0
- package/dist/chunk-PHYNROD4.js +0 -47
- package/dist/chunk-QQEKY4XP.js +0 -29
- package/dist/chunk-U4RK4LKJ.js +0 -348
- package/dist/chunk-U5663F2U.js +0 -70
- package/dist/chunk-UN7X6SU5.js +0 -53
- package/dist/chunk-UZQJJD6A.js +0 -100
- package/dist/chunk-V6LLEAR4.js +0 -80
- package/dist/chunk-WHNDRO3N.js +0 -50
- package/dist/chunk-XY5R3EHH.js +0 -204
- package/dist/chunk-ZNCZVF6U.js +0 -14
- package/dist/client/client.cjs +0 -135
- package/dist/client/client.d.ts +0 -85
- package/dist/client/client.js +0 -9
- package/dist/context.cjs +0 -1237
- package/dist/context.d.ts +0 -16
- package/dist/context.js +0 -28
- package/dist/cookie.cjs +0 -277
- package/dist/cookie.d.ts +0 -89
- package/dist/cookie.js +0 -30
- package/dist/createAuth.cjs +0 -2320
- package/dist/createAuth.d.ts +0 -12
- package/dist/createAuth.js +0 -48
- package/dist/env.cjs +0 -78
- package/dist/env.d.ts +0 -10
- package/dist/env.js +0 -12
- package/dist/errors.cjs +0 -102
- package/dist/errors.d.ts +0 -60
- package/dist/errors.js +0 -22
- package/dist/headers.cjs +0 -61
- package/dist/headers.d.ts +0 -33
- package/dist/headers.js +0 -12
- package/dist/index-_aXtxb_s.d.ts +0 -1377
- package/dist/jose.cjs +0 -166
- package/dist/jose.d.ts +0 -12
- package/dist/jose.js +0 -20
- package/dist/logger.cjs +0 -424
- package/dist/logger.d.ts +0 -12
- package/dist/logger.js +0 -17
- package/dist/request.cjs +0 -38
- package/dist/request.d.ts +0 -13
- package/dist/request.js +0 -6
- package/dist/schemas.cjs +0 -158
- package/dist/schemas.d.ts +0 -229
- package/dist/schemas.js +0 -24
- package/dist/secure.cjs +0 -170
- package/dist/secure.d.ts +0 -41
- package/dist/secure.js +0 -20
- package/dist/utils.cjs +0 -329
- package/dist/utils.d.ts +0 -35
- package/dist/utils.js +0 -36
package/dist/createAuth.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import 'jose';
|
|
2
|
-
export { w as createAuth, ay as createAuthInstance } from './index-_aXtxb_s.js';
|
|
3
|
-
import '@aura-stack/jose';
|
|
4
|
-
import '@aura-stack/router';
|
|
5
|
-
import 'zod/v4/core';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import './@types/utility.js';
|
|
8
|
-
import './schemas.js';
|
|
9
|
-
import 'zod/v4';
|
|
10
|
-
import '@aura-stack/jose/jose';
|
|
11
|
-
import '@aura-stack/jose/crypto';
|
|
12
|
-
import '@aura-stack/router/cookie';
|
package/dist/createAuth.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAuth,
|
|
3
|
-
createAuthInstance
|
|
4
|
-
} from "./chunk-CWX724AG.js";
|
|
5
|
-
import "./chunk-ITQ7352M.js";
|
|
6
|
-
import "./chunk-NHZBQNRR.js";
|
|
7
|
-
import "./chunk-GNNBM2WJ.js";
|
|
8
|
-
import "./chunk-FPCVZUVG.js";
|
|
9
|
-
import "./chunk-UN7X6SU5.js";
|
|
10
|
-
import "./chunk-7YYXFKLR.js";
|
|
11
|
-
import "./chunk-3J5TUH2I.js";
|
|
12
|
-
import "./chunk-7BE46WWS.js";
|
|
13
|
-
import "./chunk-LAYPUDQF.js";
|
|
14
|
-
import "./chunk-CITNGXDA.js";
|
|
15
|
-
import "./chunk-JOCGX3RP.js";
|
|
16
|
-
import "./chunk-D2CSIUKP.js";
|
|
17
|
-
import "./chunk-LATR3NIV.js";
|
|
18
|
-
import "./chunk-KBXWTD6E.js";
|
|
19
|
-
import "./chunk-ZNCZVF6U.js";
|
|
20
|
-
import "./chunk-V6LLEAR4.js";
|
|
21
|
-
import "./chunk-2IR674WX.js";
|
|
22
|
-
import "./chunk-PDP3PHB3.js";
|
|
23
|
-
import "./chunk-LDU7A2JE.js";
|
|
24
|
-
import "./chunk-PHYNROD4.js";
|
|
25
|
-
import "./chunk-E6G5YCI6.js";
|
|
26
|
-
import "./chunk-IPKO6UQN.js";
|
|
27
|
-
import "./chunk-54CZPKR4.js";
|
|
28
|
-
import "./chunk-2GQLSIJ2.js";
|
|
29
|
-
import "./chunk-EEE7UM5T.js";
|
|
30
|
-
import "./chunk-C3A37LQC.js";
|
|
31
|
-
import "./chunk-4YHJ4IEQ.js";
|
|
32
|
-
import "./chunk-OVHNRULD.js";
|
|
33
|
-
import "./chunk-QQEKY4XP.js";
|
|
34
|
-
import "./chunk-KMMAZFSJ.js";
|
|
35
|
-
import "./chunk-FW4W3REU.js";
|
|
36
|
-
import "./chunk-5LZ7TOM3.js";
|
|
37
|
-
import "./chunk-U4RK4LKJ.js";
|
|
38
|
-
import "./chunk-2A5B7GWR.js";
|
|
39
|
-
import "./chunk-UZQJJD6A.js";
|
|
40
|
-
import "./chunk-LX3TJ2TJ.js";
|
|
41
|
-
import "./chunk-XY5R3EHH.js";
|
|
42
|
-
import "./chunk-WHNDRO3N.js";
|
|
43
|
-
import "./chunk-U5663F2U.js";
|
|
44
|
-
import "./chunk-EBAMFRB7.js";
|
|
45
|
-
export {
|
|
46
|
-
createAuth,
|
|
47
|
-
createAuthInstance
|
|
48
|
-
};
|
package/dist/env.cjs
DELETED
|
@@ -1,78 +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/env.ts
|
|
21
|
-
var env_exports = {};
|
|
22
|
-
__export(env_exports, {
|
|
23
|
-
env: () => env,
|
|
24
|
-
getEnv: () => getEnv,
|
|
25
|
-
getEnvArray: () => getEnvArray,
|
|
26
|
-
getEnvBoolean: () => getEnvBoolean
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(env_exports);
|
|
29
|
-
var import_meta = {};
|
|
30
|
-
var env = new Proxy({}, {
|
|
31
|
-
get(_, prop) {
|
|
32
|
-
if (typeof prop !== "string") return void 0;
|
|
33
|
-
const hasProperty = (process2) => {
|
|
34
|
-
return process2 && Object.prototype.hasOwnProperty.call(process2, prop);
|
|
35
|
-
};
|
|
36
|
-
try {
|
|
37
|
-
if (typeof process !== "undefined" && hasProperty(process.env)) {
|
|
38
|
-
return process.env[prop];
|
|
39
|
-
}
|
|
40
|
-
if (typeof import_meta !== "undefined" && hasProperty(import_meta.env)) {
|
|
41
|
-
return import_meta.env[prop];
|
|
42
|
-
}
|
|
43
|
-
if (typeof Deno !== "undefined" && Deno.env?.get) {
|
|
44
|
-
return Deno.env.get(prop);
|
|
45
|
-
}
|
|
46
|
-
if (typeof Bun !== "undefined" && hasProperty(Bun.env)) {
|
|
47
|
-
return Bun.env[prop];
|
|
48
|
-
}
|
|
49
|
-
const globalValue = globalThis[prop];
|
|
50
|
-
return typeof globalValue === "string" ? globalValue : void 0;
|
|
51
|
-
} catch {
|
|
52
|
-
return void 0;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
var getEnv = (key) => {
|
|
57
|
-
const keys = [`AURA_AUTH_${key.toUpperCase()}`, `AURA_${key.toUpperCase()}`, `AUTH_${key.toUpperCase()}`, key.toUpperCase()];
|
|
58
|
-
return env[keys.find((k) => env[k]) ?? ""];
|
|
59
|
-
};
|
|
60
|
-
var getEnvBoolean = (key) => {
|
|
61
|
-
const value = getEnv(key);
|
|
62
|
-
if (value === void 0) return false;
|
|
63
|
-
const normalized = value.trim().toLowerCase();
|
|
64
|
-
if (["1", "true", "yes", "on", "debug"].includes(normalized)) return true;
|
|
65
|
-
return false;
|
|
66
|
-
};
|
|
67
|
-
var getEnvArray = (key, defaultValue = []) => {
|
|
68
|
-
const value = getEnv(key);
|
|
69
|
-
if (!value) return defaultValue;
|
|
70
|
-
return value.split(/[,;\n]+/).map((v) => v.trim()).filter(Boolean);
|
|
71
|
-
};
|
|
72
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
-
0 && (module.exports = {
|
|
74
|
-
env,
|
|
75
|
-
getEnv,
|
|
76
|
-
getEnvArray,
|
|
77
|
-
getEnvBoolean
|
|
78
|
-
});
|
package/dist/env.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A runtime-agnostic environment variable proxy.
|
|
3
|
-
* Checks multiple sources to ensure compatibility with Node, Bun, Deno, Vite, and Edge platforms.
|
|
4
|
-
*/
|
|
5
|
-
declare const env: Record<string, string | undefined>;
|
|
6
|
-
declare const getEnv: (key: string) => string | undefined;
|
|
7
|
-
declare const getEnvBoolean: (key: string) => boolean;
|
|
8
|
-
declare const getEnvArray: (key: string, defaultValue?: string[]) => string[];
|
|
9
|
-
|
|
10
|
-
export { env, getEnv, getEnvArray, getEnvBoolean };
|
package/dist/env.js
DELETED
package/dist/errors.cjs
DELETED
|
@@ -1,102 +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/errors.ts
|
|
21
|
-
var errors_exports = {};
|
|
22
|
-
__export(errors_exports, {
|
|
23
|
-
AuthClientError: () => AuthClientError,
|
|
24
|
-
AuthInternalError: () => AuthInternalError,
|
|
25
|
-
AuthSecurityError: () => AuthSecurityError,
|
|
26
|
-
OAuthProtocolError: () => OAuthProtocolError,
|
|
27
|
-
isAuthClientError: () => isAuthClientError,
|
|
28
|
-
isAuthInternalError: () => isAuthInternalError,
|
|
29
|
-
isAuthSecurityError: () => isAuthSecurityError,
|
|
30
|
-
isNativeError: () => isNativeError,
|
|
31
|
-
isOAuthProtocolError: () => isOAuthProtocolError
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(errors_exports);
|
|
34
|
-
var OAuthProtocolError = class extends Error {
|
|
35
|
-
type = "OAUTH_PROTOCOL_ERROR";
|
|
36
|
-
error;
|
|
37
|
-
errorURI;
|
|
38
|
-
constructor(error, description, errorURI, options) {
|
|
39
|
-
super(description, options);
|
|
40
|
-
this.error = error;
|
|
41
|
-
this.errorURI = errorURI;
|
|
42
|
-
this.name = new.target.name;
|
|
43
|
-
Error.captureStackTrace(this, new.target);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
var AuthInternalError = class extends Error {
|
|
47
|
-
type = "AUTH_INTERNAL_ERROR";
|
|
48
|
-
code;
|
|
49
|
-
constructor(code, message, options) {
|
|
50
|
-
super(message, options);
|
|
51
|
-
this.code = code;
|
|
52
|
-
this.name = new.target.name;
|
|
53
|
-
Error.captureStackTrace(this, new.target);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
var AuthSecurityError = class extends Error {
|
|
57
|
-
type = "AUTH_SECURITY_ERROR";
|
|
58
|
-
code;
|
|
59
|
-
constructor(code, message, options) {
|
|
60
|
-
super(message, options);
|
|
61
|
-
this.code = code;
|
|
62
|
-
this.name = new.target.name;
|
|
63
|
-
Error.captureStackTrace(this, new.target);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var AuthClientError = class extends Error {
|
|
67
|
-
type = "AUTH_CLIENT_ERROR";
|
|
68
|
-
code;
|
|
69
|
-
constructor(code, message, options) {
|
|
70
|
-
super(message, options);
|
|
71
|
-
this.code = code;
|
|
72
|
-
this.name = new.target.name;
|
|
73
|
-
Error.captureStackTrace(this, new.target);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
var isNativeError = (error) => {
|
|
77
|
-
return error instanceof Error;
|
|
78
|
-
};
|
|
79
|
-
var isOAuthProtocolError = (error) => {
|
|
80
|
-
return error instanceof OAuthProtocolError;
|
|
81
|
-
};
|
|
82
|
-
var isAuthInternalError = (error) => {
|
|
83
|
-
return error instanceof AuthInternalError;
|
|
84
|
-
};
|
|
85
|
-
var isAuthSecurityError = (error) => {
|
|
86
|
-
return error instanceof AuthSecurityError;
|
|
87
|
-
};
|
|
88
|
-
var isAuthClientError = (error) => {
|
|
89
|
-
return error instanceof AuthClientError;
|
|
90
|
-
};
|
|
91
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
92
|
-
0 && (module.exports = {
|
|
93
|
-
AuthClientError,
|
|
94
|
-
AuthInternalError,
|
|
95
|
-
AuthSecurityError,
|
|
96
|
-
OAuthProtocolError,
|
|
97
|
-
isAuthClientError,
|
|
98
|
-
isAuthInternalError,
|
|
99
|
-
isAuthSecurityError,
|
|
100
|
-
isNativeError,
|
|
101
|
-
isOAuthProtocolError
|
|
102
|
-
});
|
package/dist/errors.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { d as AuthInternalErrorCode, e as AuthSecurityErrorCode, E as ErrorType } from './index-_aXtxb_s.js';
|
|
2
|
-
import { LiteralUnion } from './@types/utility.js';
|
|
3
|
-
import 'zod';
|
|
4
|
-
import './schemas.js';
|
|
5
|
-
import 'zod/v4';
|
|
6
|
-
import '@aura-stack/jose';
|
|
7
|
-
import '@aura-stack/jose/jose';
|
|
8
|
-
import '@aura-stack/jose/crypto';
|
|
9
|
-
import '@aura-stack/router/cookie';
|
|
10
|
-
import 'jose';
|
|
11
|
-
import '@aura-stack/router';
|
|
12
|
-
import 'zod/v4/core';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The object returned by the class to users its:
|
|
16
|
-
* - type: "OAUTH_PROTOCOL_ERROR" to identify the error type
|
|
17
|
-
* - error: A short error code
|
|
18
|
-
* - description: A human-readable description of the error. The description is obtained from the message property of the Error class
|
|
19
|
-
* - errorURI: A URI with more information about the error
|
|
20
|
-
*/
|
|
21
|
-
declare class OAuthProtocolError extends Error {
|
|
22
|
-
readonly type = "OAUTH_PROTOCOL_ERROR";
|
|
23
|
-
readonly error: string;
|
|
24
|
-
readonly errorURI?: string;
|
|
25
|
-
constructor(error: LiteralUnion<Uppercase<ErrorType>>, description?: string, errorURI?: string, options?: ErrorOptions);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* The object returned when an internal error occurs in the Aura Auth library.
|
|
29
|
-
* - type: "AUTH_INTERNAL_ERROR" to identify the error type
|
|
30
|
-
* - message: A human-readable description of the error. The description is obtained from the message property of the Error class
|
|
31
|
-
* - code: An optional error code that can be used to identify the specific error, for example, LIKE "ERR_AUTH_INTERNAL_ERROR"
|
|
32
|
-
*/
|
|
33
|
-
declare class AuthInternalError extends Error {
|
|
34
|
-
readonly type = "AUTH_INTERNAL_ERROR";
|
|
35
|
-
readonly code: string;
|
|
36
|
-
constructor(code: AuthInternalErrorCode, message?: string, options?: ErrorOptions);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The object returned when a security error occurs in the Aura Auth library.
|
|
40
|
-
* - type: "AUTH_SECURITY_ERROR" to identify the error type
|
|
41
|
-
* - message: A human-readable description of the error. The description is obtained from the message property of the Error class
|
|
42
|
-
* - code: An optional error code that can be used to identify the specific error, for example, LIKE "ERR_AUTH_SECURITY_ERROR"
|
|
43
|
-
*/
|
|
44
|
-
declare class AuthSecurityError extends Error {
|
|
45
|
-
readonly type = "AUTH_SECURITY_ERROR";
|
|
46
|
-
readonly code: string;
|
|
47
|
-
constructor(code: LiteralUnion<AuthSecurityErrorCode>, message?: string, options?: ErrorOptions);
|
|
48
|
-
}
|
|
49
|
-
declare class AuthClientError extends Error {
|
|
50
|
-
readonly type = "AUTH_CLIENT_ERROR";
|
|
51
|
-
readonly code: string;
|
|
52
|
-
constructor(code: string, message?: string, options?: ErrorOptions);
|
|
53
|
-
}
|
|
54
|
-
declare const isNativeError: (error: unknown) => error is Error;
|
|
55
|
-
declare const isOAuthProtocolError: (error: unknown) => error is OAuthProtocolError;
|
|
56
|
-
declare const isAuthInternalError: (error: unknown) => error is AuthInternalError;
|
|
57
|
-
declare const isAuthSecurityError: (error: unknown) => error is AuthSecurityError;
|
|
58
|
-
declare const isAuthClientError: (error: unknown) => error is AuthClientError;
|
|
59
|
-
|
|
60
|
-
export { AuthClientError, AuthInternalError, AuthSecurityError, OAuthProtocolError, isAuthClientError, isAuthInternalError, isAuthSecurityError, isNativeError, isOAuthProtocolError };
|
package/dist/errors.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AuthClientError,
|
|
3
|
-
AuthInternalError,
|
|
4
|
-
AuthSecurityError,
|
|
5
|
-
OAuthProtocolError,
|
|
6
|
-
isAuthClientError,
|
|
7
|
-
isAuthInternalError,
|
|
8
|
-
isAuthSecurityError,
|
|
9
|
-
isNativeError,
|
|
10
|
-
isOAuthProtocolError
|
|
11
|
-
} from "./chunk-U5663F2U.js";
|
|
12
|
-
export {
|
|
13
|
-
AuthClientError,
|
|
14
|
-
AuthInternalError,
|
|
15
|
-
AuthSecurityError,
|
|
16
|
-
OAuthProtocolError,
|
|
17
|
-
isAuthClientError,
|
|
18
|
-
isAuthInternalError,
|
|
19
|
-
isAuthSecurityError,
|
|
20
|
-
isNativeError,
|
|
21
|
-
isOAuthProtocolError
|
|
22
|
-
};
|
package/dist/headers.cjs
DELETED
|
@@ -1,61 +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/headers.ts
|
|
21
|
-
var headers_exports = {};
|
|
22
|
-
__export(headers_exports, {
|
|
23
|
-
cacheControl: () => cacheControl,
|
|
24
|
-
contentSecurityPolicy: () => contentSecurityPolicy,
|
|
25
|
-
secureApiHeaders: () => secureApiHeaders,
|
|
26
|
-
secureHeaders: () => secureHeaders
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(headers_exports);
|
|
29
|
-
var cacheControl = {
|
|
30
|
-
"Cache-Control": "no-store",
|
|
31
|
-
Pragma: "no-cache",
|
|
32
|
-
Expires: "0",
|
|
33
|
-
Vary: "Cookie"
|
|
34
|
-
};
|
|
35
|
-
var contentSecurityPolicy = {
|
|
36
|
-
"Content-Security-Policy": [
|
|
37
|
-
"default-src 'none'",
|
|
38
|
-
"script-src 'self'",
|
|
39
|
-
"frame-src 'none'",
|
|
40
|
-
"object-src 'none'",
|
|
41
|
-
"frame-ancestors 'none'",
|
|
42
|
-
"base-uri 'none'"
|
|
43
|
-
].join("; ")
|
|
44
|
-
};
|
|
45
|
-
var secureHeaders = {
|
|
46
|
-
"X-Content-Type-Options": "nosniff",
|
|
47
|
-
"X-Frame-Options": "DENY",
|
|
48
|
-
"Referrer-Policy": "strict-origin-when-cross-origin"
|
|
49
|
-
};
|
|
50
|
-
var secureApiHeaders = {
|
|
51
|
-
...cacheControl,
|
|
52
|
-
...contentSecurityPolicy,
|
|
53
|
-
...secureHeaders
|
|
54
|
-
};
|
|
55
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
-
0 && (module.exports = {
|
|
57
|
-
cacheControl,
|
|
58
|
-
contentSecurityPolicy,
|
|
59
|
-
secureApiHeaders,
|
|
60
|
-
secureHeaders
|
|
61
|
-
});
|
package/dist/headers.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Headers to prevent caching of responses. It includes Pragma header for HTTP/1.0 compatibility.
|
|
3
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control
|
|
4
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Pragma
|
|
5
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Vary
|
|
6
|
-
*/
|
|
7
|
-
declare const cacheControl: HeadersInit;
|
|
8
|
-
/**
|
|
9
|
-
* Content Security Policy headers optimized for JSON API endpoints.
|
|
10
|
-
* Provides protection against XSS, clickjacking, and code injection attacks.
|
|
11
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
|
|
12
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy
|
|
13
|
-
*/
|
|
14
|
-
declare const contentSecurityPolicy: HeadersInit;
|
|
15
|
-
/**
|
|
16
|
-
* X-Frame-Options is overridden by the frame-ancestors directive in CSP.
|
|
17
|
-
* However, it's included here for compatibility with older browsers that do not support CSP.
|
|
18
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Content-Type-Options
|
|
19
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Frame-Options
|
|
20
|
-
* @see https://developer.mozilla.org/es/docs/Web/HTTP/Reference/Headers/Referrer-Policy
|
|
21
|
-
*/
|
|
22
|
-
declare const secureHeaders: {
|
|
23
|
-
"X-Content-Type-Options": string;
|
|
24
|
-
"X-Frame-Options": string;
|
|
25
|
-
"Referrer-Policy": string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Combined security headers for JSON API responses.
|
|
29
|
-
* Includes cache control, CSP, and other security headers.
|
|
30
|
-
*/
|
|
31
|
-
declare const secureApiHeaders: HeadersInit;
|
|
32
|
-
|
|
33
|
-
export { cacheControl, contentSecurityPolicy, secureApiHeaders, secureHeaders };
|