@aura-stack/auth 0.1.0-rc.9 → 0.2.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/dist/@types/index.cjs +15 -15
- package/dist/@types/index.d.ts +6 -31
- package/dist/@types/index.js +1 -1
- package/dist/@types/router.d.cjs +1 -1
- package/dist/@types/router.d.d.ts +6 -7
- package/dist/@types/utility.cjs +15 -15
- package/dist/@types/utility.d.ts +4 -8
- package/dist/@types/utility.js +1 -1
- package/dist/actions/callback/access-token.cjs +159 -149
- package/dist/actions/callback/access-token.d.ts +14 -20
- package/dist/actions/callback/access-token.js +9 -4
- package/dist/actions/callback/callback.cjs +371 -484
- package/dist/actions/callback/callback.d.ts +9 -12
- package/dist/actions/callback/callback.js +15 -12
- package/dist/actions/callback/userinfo.cjs +149 -139
- package/dist/actions/callback/userinfo.d.ts +8 -9
- package/dist/actions/callback/userinfo.js +11 -6
- package/dist/actions/csrfToken/csrfToken.cjs +112 -190
- package/dist/actions/csrfToken/csrfToken.d.ts +3 -3
- package/dist/actions/csrfToken/csrfToken.js +12 -8
- package/dist/actions/index.cjs +623 -807
- package/dist/actions/index.d.ts +12 -13
- package/dist/actions/index.js +33 -18
- package/dist/actions/session/session.cjs +86 -176
- package/dist/actions/session/session.d.ts +3 -3
- package/dist/actions/session/session.js +10 -7
- package/dist/actions/signIn/authorization.cjs +248 -257
- package/dist/actions/signIn/authorization.d.ts +11 -18
- package/dist/actions/signIn/authorization.js +16 -6
- package/dist/actions/signIn/signIn.cjs +302 -451
- package/dist/actions/signIn/signIn.d.ts +9 -10
- package/dist/actions/signIn/signIn.js +12 -10
- package/dist/actions/signOut/signOut.cjs +299 -468
- package/dist/actions/signOut/signOut.d.ts +3 -3
- package/dist/actions/signOut/signOut.js +14 -11
- package/dist/assert.cjs +40 -36
- package/dist/assert.d.ts +12 -4
- package/dist/assert.js +12 -2
- package/dist/chunk-2RXNXMCZ.js +55 -0
- package/dist/chunk-42XB3YCW.js +19 -17
- package/dist/chunk-4V4JNXVF.js +55 -0
- package/dist/chunk-6R2YZ4AC.js +22 -0
- package/dist/chunk-7H3OR6UU.js +81 -0
- package/dist/chunk-CXLATHS5.js +143 -0
- package/dist/chunk-E3OXBRYF.js +19 -17
- package/dist/chunk-EIL2FPSS.js +22 -0
- package/dist/chunk-FIPU4MLT.js +18 -16
- package/dist/chunk-FKRDCWBF.js +19 -17
- package/dist/chunk-IKHPGFCW.js +11 -9
- package/dist/chunk-IMICRJ5U.js +197 -0
- package/dist/chunk-IUYZQTJV.js +30 -0
- package/dist/chunk-KRNOMBXQ.js +19 -17
- package/dist/chunk-N2APGLXA.js +71 -0
- package/dist/chunk-NEVKX6K2.js +70 -0
- package/dist/chunk-PTJUYB33.js +33 -0
- package/dist/chunk-QDO2KSRJ.js +35 -0
- package/dist/chunk-QEZL7EYN.js +96 -0
- package/dist/chunk-RRLIF4PQ.js +55 -0
- package/dist/chunk-STHEPPUZ.js +8 -6
- package/dist/chunk-TLE4PXY3.js +39 -0
- package/dist/chunk-UEH3LVON.js +97 -0
- package/dist/chunk-WD7AUHQ5.js +79 -0
- package/dist/chunk-ZLR3LI6X.js +55 -0
- package/dist/cookie.cjs +222 -187
- package/dist/cookie.d.ts +38 -76
- package/dist/cookie.js +27 -34
- package/dist/errors.cjs +85 -0
- package/dist/errors.d.ts +48 -0
- package/dist/errors.js +18 -0
- package/dist/headers.cjs +28 -28
- package/dist/headers.d.ts +2 -2
- package/dist/headers.js +6 -2
- package/dist/{index-DpfbvTZ_.d.ts → index-EqsoyjrF.d.ts} +351 -318
- package/dist/index.cjs +1006 -1001
- package/dist/index.d.ts +9 -31
- package/dist/index.js +82 -51
- package/dist/jose.cjs +74 -66
- package/dist/jose.d.ts +11 -8
- package/dist/jose.js +10 -5
- package/dist/oauth/bitbucket.cjs +38 -38
- package/dist/oauth/bitbucket.d.ts +6 -7
- package/dist/oauth/bitbucket.js +6 -2
- package/dist/oauth/discord.cjs +47 -48
- package/dist/oauth/discord.d.ts +6 -7
- package/dist/oauth/discord.js +6 -2
- package/dist/oauth/figma.cjs +39 -39
- package/dist/oauth/figma.d.ts +6 -7
- package/dist/oauth/figma.js +6 -2
- package/dist/oauth/github.cjs +31 -31
- package/dist/oauth/github.d.ts +6 -7
- package/dist/oauth/github.js +6 -2
- package/dist/oauth/gitlab.cjs +39 -39
- package/dist/oauth/gitlab.d.ts +6 -7
- package/dist/oauth/gitlab.js +6 -2
- package/dist/oauth/index.cjs +306 -180
- package/dist/oauth/index.d.ts +6 -26
- package/dist/oauth/index.js +43 -9
- package/dist/oauth/spotify.cjs +39 -39
- package/dist/oauth/spotify.d.ts +6 -7
- package/dist/oauth/spotify.js +6 -2
- package/dist/oauth/strava.cjs +46 -0
- package/dist/oauth/strava.d.ts +6 -0
- package/dist/oauth/strava.js +6 -0
- package/dist/oauth/x.cjs +39 -39
- package/dist/oauth/x.d.ts +6 -7
- package/dist/oauth/x.js +6 -2
- package/dist/schemas.cjs +97 -91
- package/dist/schemas.d.ts +96 -126
- package/dist/schemas.js +20 -18
- package/dist/secure.cjs +106 -101
- package/dist/secure.d.ts +16 -17
- package/dist/secure.js +19 -4
- package/dist/utils.cjs +197 -135
- package/dist/utils.d.ts +20 -26
- package/dist/utils.js +25 -21
- package/package.json +5 -6
- package/dist/chunk-256KIVJL.js +0 -110
- package/dist/chunk-6SM22VVJ.js +0 -15
- package/dist/chunk-CAKJT3KS.js +0 -77
- package/dist/chunk-EBPE35JT.js +0 -29
- package/dist/chunk-FJUDBLCP.js +0 -52
- package/dist/chunk-GZU3RBTB.js +0 -51
- package/dist/chunk-HGJ4TXY4.js +0 -105
- package/dist/chunk-HMRKN75I.js +0 -74
- package/dist/chunk-JAPMIE6S.js +0 -8
- package/dist/chunk-LLR722CL.js +0 -75
- package/dist/chunk-RLT4RFKV.js +0 -36
- package/dist/chunk-SJPDVKUS.js +0 -93
- package/dist/chunk-SMQO5WD7.js +0 -20
- package/dist/chunk-UJJ7R56J.js +0 -42
- package/dist/chunk-UTDLUEEG.js +0 -25
- package/dist/chunk-VFTYH33W.js +0 -44
- package/dist/chunk-XXJKNKGQ.js +0 -27
- package/dist/chunk-ZV4BH47P.js +0 -156
- package/dist/error.cjs +0 -88
- package/dist/error.d.ts +0 -62
- package/dist/error.js +0 -9
- package/dist/response.cjs +0 -34
- package/dist/response.d.ts +0 -10
- package/dist/response.js +0 -2
package/dist/errors.cjs
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
AuthInternalError: () => AuthInternalError,
|
|
24
|
+
AuthSecurityError: () => AuthSecurityError,
|
|
25
|
+
OAuthProtocolError: () => OAuthProtocolError,
|
|
26
|
+
isAuthInternalError: () => isAuthInternalError,
|
|
27
|
+
isAuthSecurityError: () => isAuthSecurityError,
|
|
28
|
+
isNativeError: () => isNativeError,
|
|
29
|
+
isOAuthProtocolError: () => isOAuthProtocolError
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(errors_exports);
|
|
32
|
+
var OAuthProtocolError = class extends Error {
|
|
33
|
+
type = "OAUTH_PROTOCOL_ERROR";
|
|
34
|
+
error;
|
|
35
|
+
errorURI;
|
|
36
|
+
constructor(error, description, errorURI, options) {
|
|
37
|
+
super(description, options);
|
|
38
|
+
this.error = error;
|
|
39
|
+
this.errorURI = errorURI;
|
|
40
|
+
this.name = new.target.name;
|
|
41
|
+
Error.captureStackTrace(this, new.target);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var AuthInternalError = class extends Error {
|
|
45
|
+
type = "AUTH_INTERNAL_ERROR";
|
|
46
|
+
code;
|
|
47
|
+
constructor(code, message, options) {
|
|
48
|
+
super(message, options);
|
|
49
|
+
this.code = code;
|
|
50
|
+
this.name = new.target.name;
|
|
51
|
+
Error.captureStackTrace(this, new.target);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var AuthSecurityError = class extends Error {
|
|
55
|
+
type = "AUTH_SECURITY_ERROR";
|
|
56
|
+
code;
|
|
57
|
+
constructor(code, message, options) {
|
|
58
|
+
super(message, options);
|
|
59
|
+
this.code = code;
|
|
60
|
+
this.name = new.target.name;
|
|
61
|
+
Error.captureStackTrace(this, new.target);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var isNativeError = (error) => {
|
|
65
|
+
return error instanceof Error;
|
|
66
|
+
};
|
|
67
|
+
var isOAuthProtocolError = (error) => {
|
|
68
|
+
return error instanceof OAuthProtocolError;
|
|
69
|
+
};
|
|
70
|
+
var isAuthInternalError = (error) => {
|
|
71
|
+
return error instanceof AuthInternalError;
|
|
72
|
+
};
|
|
73
|
+
var isAuthSecurityError = (error) => {
|
|
74
|
+
return error instanceof AuthSecurityError;
|
|
75
|
+
};
|
|
76
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
+
0 && (module.exports = {
|
|
78
|
+
AuthInternalError,
|
|
79
|
+
AuthSecurityError,
|
|
80
|
+
OAuthProtocolError,
|
|
81
|
+
isAuthInternalError,
|
|
82
|
+
isAuthSecurityError,
|
|
83
|
+
isNativeError,
|
|
84
|
+
isOAuthProtocolError
|
|
85
|
+
});
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { E as ErrorType, b as AuthInternalErrorCode, c as AuthSecurityErrorCode } from './index-EqsoyjrF.js';
|
|
2
|
+
import { LiteralUnion } from './@types/utility.js';
|
|
3
|
+
import 'zod/v4';
|
|
4
|
+
import './schemas.js';
|
|
5
|
+
import '@aura-stack/router/cookie';
|
|
6
|
+
import '@aura-stack/jose/jose';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The object returned by the class to users its:
|
|
10
|
+
* - type: "OAUTH_PROTOCOL_ERROR" to identify the error type
|
|
11
|
+
* - error: A short error code
|
|
12
|
+
* - description: A human-readable description of the error. The description is obtained from the message property of the Error class
|
|
13
|
+
* - errorURI: A URI with more information about the error
|
|
14
|
+
*/
|
|
15
|
+
declare class OAuthProtocolError extends Error {
|
|
16
|
+
readonly type = "OAUTH_PROTOCOL_ERROR";
|
|
17
|
+
readonly error: string;
|
|
18
|
+
readonly errorURI?: string;
|
|
19
|
+
constructor(error: LiteralUnion<Uppercase<ErrorType>>, description?: string, errorURI?: string, options?: ErrorOptions);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The object returned when an internal error occurs in the Aura Auth library.
|
|
23
|
+
* - type: "AUTH_INTERNAL_ERROR" to identify the error type
|
|
24
|
+
* - message: A human-readable description of the error. The description is obtained from the message property of the Error class
|
|
25
|
+
* - code: An optional error code that can be used to identify the specific error, for example, LIKE "ERR_AUTH_INTERNAL_ERROR"
|
|
26
|
+
*/
|
|
27
|
+
declare class AuthInternalError extends Error {
|
|
28
|
+
readonly type = "AUTH_INTERNAL_ERROR";
|
|
29
|
+
readonly code: string;
|
|
30
|
+
constructor(code: AuthInternalErrorCode, message?: string, options?: ErrorOptions);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The object returned when a security error occurs in the Aura Auth library.
|
|
34
|
+
* - type: "AUTH_SECURITY_ERROR" to identify the error type
|
|
35
|
+
* - message: A human-readable description of the error. The description is obtained from the message property of the Error class
|
|
36
|
+
* - code: An optional error code that can be used to identify the specific error, for example, LIKE "ERR_AUTH_SECURITY_ERROR"
|
|
37
|
+
*/
|
|
38
|
+
declare class AuthSecurityError extends Error {
|
|
39
|
+
readonly type = "AUTH_SECURITY_ERROR";
|
|
40
|
+
readonly code: string;
|
|
41
|
+
constructor(code: AuthSecurityErrorCode, message?: string, options?: ErrorOptions);
|
|
42
|
+
}
|
|
43
|
+
declare const isNativeError: (error: unknown) => error is Error;
|
|
44
|
+
declare const isOAuthProtocolError: (error: unknown) => error is OAuthProtocolError;
|
|
45
|
+
declare const isAuthInternalError: (error: unknown) => error is AuthInternalError;
|
|
46
|
+
declare const isAuthSecurityError: (error: unknown) => error is AuthSecurityError;
|
|
47
|
+
|
|
48
|
+
export { AuthInternalError, AuthSecurityError, OAuthProtocolError, isAuthInternalError, isAuthSecurityError, isNativeError, isOAuthProtocolError };
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthInternalError,
|
|
3
|
+
AuthSecurityError,
|
|
4
|
+
OAuthProtocolError,
|
|
5
|
+
isAuthInternalError,
|
|
6
|
+
isAuthSecurityError,
|
|
7
|
+
isNativeError,
|
|
8
|
+
isOAuthProtocolError
|
|
9
|
+
} from "./chunk-RRLIF4PQ.js";
|
|
10
|
+
export {
|
|
11
|
+
AuthInternalError,
|
|
12
|
+
AuthSecurityError,
|
|
13
|
+
OAuthProtocolError,
|
|
14
|
+
isAuthInternalError,
|
|
15
|
+
isAuthSecurityError,
|
|
16
|
+
isNativeError,
|
|
17
|
+
isOAuthProtocolError
|
|
18
|
+
};
|
package/dist/headers.cjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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/headers.ts
|
|
20
|
-
var headers_exports = {}
|
|
21
|
+
var headers_exports = {};
|
|
21
22
|
__export(headers_exports, {
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
module.exports = __toCommonJS(headers_exports)
|
|
23
|
+
cacheControl: () => cacheControl
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(headers_exports);
|
|
25
26
|
var cacheControl = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
27
|
+
"Cache-Control": "no-store",
|
|
28
|
+
Pragma: "no-cache",
|
|
29
|
+
Expires: "0",
|
|
30
|
+
Vary: "Cookie"
|
|
31
|
+
};
|
|
31
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 &&
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
cacheControl
|
|
35
|
+
});
|
package/dist/headers.d.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Pragma
|
|
5
5
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Vary
|
|
6
6
|
*/
|
|
7
|
-
declare const cacheControl: HeadersInit
|
|
7
|
+
declare const cacheControl: HeadersInit;
|
|
8
8
|
|
|
9
|
-
export { cacheControl }
|
|
9
|
+
export { cacheControl };
|
package/dist/headers.js
CHANGED