@authup/errors 1.0.0-beta.40 → 1.0.0-beta.42
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/built-in/auth-header.d.ts +7 -0
- package/dist/built-in/auth-header.d.ts.map +1 -0
- package/dist/built-in/bad-request.d.ts +7 -0
- package/dist/built-in/bad-request.d.ts.map +1 -0
- package/dist/built-in/bearer-token.d.ts +6 -0
- package/dist/built-in/bearer-token.d.ts.map +1 -0
- package/dist/built-in/check.d.ts +19 -0
- package/dist/built-in/check.d.ts.map +1 -0
- package/dist/built-in/entity-conflict.d.ts +7 -0
- package/dist/built-in/entity-conflict.d.ts.map +1 -0
- package/dist/built-in/entity-credentials-invalid.d.ts +7 -0
- package/dist/built-in/entity-credentials-invalid.d.ts.map +1 -0
- package/dist/built-in/entity-inactive.d.ts +7 -0
- package/dist/built-in/entity-inactive.d.ts.map +1 -0
- package/dist/built-in/entity-not-found.d.ts +7 -0
- package/dist/built-in/entity-not-found.d.ts.map +1 -0
- package/dist/built-in/index.d.ts +10 -1
- package/dist/built-in/index.d.ts.map +1 -1
- package/dist/built-in/internal.d.ts +7 -0
- package/dist/built-in/internal.d.ts.map +1 -0
- package/dist/built-in/unauthorized.d.ts +7 -0
- package/dist/built-in/unauthorized.d.ts.map +1 -0
- package/dist/check.d.ts +24 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/constants.d.ts +11 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.mts +178 -842
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +323 -10
- package/dist/index.mjs.map +1 -1
- package/dist/module.d.ts +14 -4
- package/dist/module.d.ts.map +1 -1
- package/dist/normalize.d.ts +11 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/serialize.d.ts +15 -0
- package/dist/serialize.d.ts.map +1 -0
- package/dist/status.d.ts +32 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/types.d.ts +8 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/built-in/http.d.ts +0 -6
- package/dist/built-in/http.d.ts.map +0 -1
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":["AutocompletePrimitiveBaseType","T","Autocomplete","Record","Autocomplete","IncomingHttpHeaders","Record","HeaderNames","IANARegisteredMimeType","KnownHeaderValues","HeaderRecord","Lowercase","K","Readable","Blob","BodyReadable","default","Promise","Uint8Array","ArrayBuffer","AbortSignal","constructor","resume","this","size","abort","contentType","contentLength","highWaterMark","opts","text","json","blob","bytes","arrayBuffer","formData","bodyUsed","body","dump","limit","signal","Blob","URL","URLSearchParams","ReadableStream","FormData","HeaderRecord","Dispatcher","RequestInfo","Request","fetch","RequestInit","Response","Promise","input","init","BodyInit","ArrayBuffer","Uint8Array","AsyncIterable","Iterable","NodeJS","ArrayBufferView","BodyMixin","body","bodyUsed","arrayBuffer","blob","bytes","formData","json","text","SpecIterator","T","TReturn","TNext","IteratorResult","next","args","SpecIteratorObject","U","S","Iterator","Symbol","toStringTag","iterator","map","value","index","callbackfn","filter","predicate","take","limit","drop","count","flatMap","reduce","previousValue","currentValue","currentIndex","initialValue","toArray","forEach","some","every","find","SpecIterableIterator","SpecIterable","HeadersInit","Headers","constructor","append","name","delete","get","has","set","getSetCookie","key","iterable","thisArg","keys","values","entries","RequestCache","RequestCredentials","RequestDestination","RequestDuplex","RequestMode","RequestRedirect","ReferrerPolicy","AbortSignal","cache","credentials","dispatcher","duplex","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window","destination","url","clone","ResponseInit","status","statusText","ResponseType","ResponseRedirectStatus","ok","type","redirected","error","data","File","SpecIterableIterator","_0","Symbol","toStringTag","sideEffect","FormDataEntryValue","FormData","iterator","append","name","value","fileName","set","get","getAll","has","delete","forEach","key","iterable","callbackfn","thisArg","keys","values","entries","TLSSocket","ConnectionOptions","IpcNetConnectOpts","Socket","TcpNetConnectOpts","buildConnector","default","BuildOptions","connector","options","CallbackArgs","Error","Options","Callback","allowH2","maxCachedSessions","socketPath","timeout","port","keepAlive","keepAliveInitialDelay","typeOfService","hostname","host","protocol","servername","localAddress","httpSocket","args","callback","Client","ClientStats","default","constructor","pool","connected","pending","running","size","URL","Dispatcher","buildConnector","TClientStats","ClientConnectOptions","ConnectOptions","Omit","Client","Options","ConnectData","Promise","Error","constructor","url","options","pipelining","closed","destroyed","stats","connect","err","data","callback","DispatchInterceptor","OptionsInterceptors","BuildOptions","Partial","connector","interceptors","maxHeaderSize","headersTimeout","socketTimeout","requestTimeout","connectTimeout","bodyTimeout","idleTimeout","keepAlive","keepAliveTimeout","maxKeepAliveTimeout","keepAliveMaxTimeout","keepAliveTimeoutThreshold","socketPath","tls","strictContentLength","maxCachedSessions","maxRequestsPerClient","localAddress","maxResponseSize","autoSelectFamily","autoSelectFamilyAttemptTimeout","allowH2","maxConcurrentStreams","initialWindowSize","connectionWindowSize","pingInterval","SocketInfo","localPort","remoteAddress","remotePort","remoteFamily","timeout","bytesWritten","bytesRead","default","IncomingHttpHeaders","Client","Errors","default","Error","UndiciError","Record","SocketInfo","name","code","ConnectTimeoutError","HeadersTimeoutError","HeadersOverflowError","BodyTimeoutError","ResponseError","constructor","message","headers","body","options","statusCode","InvalidArgumentError","InvalidReturnValueError","RequestAbortedError","InformationalError","RequestContentLengthMismatchError","ResponseContentLengthMismatchError","ClientDestroyedError","ClientClosedError","SocketError","socket","NotSupportedError","BalancedPoolMissingUpstreamError","HTTPParserError","ResponseExceededMaxSizeError","RequestRetryError","data","count","SecureProxyConnectionError","cause","MaxOriginsReachedError","Socks5ProxyError","MessageSizeExceededError","URL","Duplex","Readable","Writable","EventEmitter","Blob","IncomingHttpHeaders","BodyReadable","FormData","Errors","Autocomplete","AbortSignal","Dispatcher","default","UndiciHeaders","Record","Iterable","TOpaque","DispatchOptions","DispatchHandler","ConnectOptions","Error","ConnectData","Promise","DispatcherComposeInterceptor","ComposedDispatcher","RequestOptions","ResponseData","PipelineOptions","PipelineHandler","StreamFactory","StreamData","UpgradeOptions","UpgradeData","UndiciError","dispatch","options","handler","connect","err","data","callback","compose","dispatchers","request","pipeline","stream","factory","upgrade","close","destroy","on","eventName","origin","targets","error","once","off","addListener","removeListener","prependListener","prependOnceListener","listeners","rawListeners","emit","Dispatch","HttpMethod","Buffer","Uint8Array","BodyMixin","StreamFactoryData","DispatchController","PipelineHandlerData","ArrayBuffer","path","method","body","headers","query","idempotent","blocking","typeOfService","headersTimeout","bodyTimeout","reset","throwOnError","expectContinue","signal","opaque","responseHeaders","onInfo","statusCode","info","highWaterMark","objectMode","protocol","socket","statusText","trailers","context","aborted","paused","reason","abort","pause","resume","onRequestStart","controller","onRequestUpgrade","onResponseStart","statusMessage","onResponseData","chunk","onResponseEnd","onResponseError","onConnect","onError","onUpgrade","onResponseStarted","onHeaders","onData","onComplete","onBodySent","chunkSize","totalBytesSent","bodyUsed","arrayBuffer","blob","bytes","formData","json","text","DispatchInterceptor","IncomingHttpHeaders","Dispatcher","BodyInit","Headers","MockScope","TData","MockInterceptor","MockDispatch","constructor","mockDispatch","delay","waitInMs","persist","times","repeatTimes","TError","Options","MockReplyOptionsCallback","Buffer","MockResponseDataHandler","MockResponseOptions","Error","Record","options","mockDispatches","reply","replyOptionsCallback","statusCode","data","responseOptions","replyWithError","error","defaultReplyHeaders","headers","defaultReplyTrailers","trailers","replyContentLength","RegExp","MockDispatchData","DispatchOptions","MockResponseCallbackOptions","path","method","body","query","consumed","origin","opts","Interceptable","intercept","cleanMocks","Agent","Dispatcher","Interceptable","MockInterceptor","MockDispatch","MockCallHistory","MockAgent","default","PendingInterceptor","origin","TInterceptable","TMockAgentOptions","Options","RegExp","DispatchOptions","DispatchHandler","Promise","PendingInterceptorsFormatter","constructor","options","get","dispatch","handler","close","deactivate","activate","enableNetConnect","host","disableNetConnect","getCallHistory","clearCallHistory","enableCallHistory","disableCallHistory","pendingInterceptors","assertNoPendingInterceptors","pendingInterceptorsFormatter","format","agent","ignoreTrailingSlash","acceptNonStandardSearchParameters","AuthorizationHeaderType","BEARER","BASIC","X_API_KEY","API_KEY"],"sources":["../src/constants.ts","../../../node_modules/undici/types/utility.d.ts","../../../node_modules/undici/types/header.d.ts","../../../node_modules/undici/types/readable.d.ts","../../../node_modules/undici/types/fetch.d.ts","../../../node_modules/undici/types/formdata.d.ts","../../../node_modules/undici/types/connector.d.ts","../../../node_modules/undici/types/client-stats.d.ts","../../../node_modules/undici/types/client.d.ts","../../../node_modules/undici/types/errors.d.ts","../../../node_modules/undici/types/dispatcher.d.ts","../../../node_modules/undici/types/mock-interceptor.d.ts","../../../node_modules/undici/types/mock-agent.d.ts","../../../node_modules/hapic/dist/header/authorization/constants.d.ts","../src/module.ts","../src/built-in/http.ts","../src/types.ts"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13],"mappings":";;;;;;;;;;;aAOY,SAAA;EAER,iCAAA;EAGA,0BAAA;EACA,eAAA;EACA,gBAAA;EAGA,WAAA;EACA,aAAA;EAGA,WAAA;EACA,YAAA;EACA,WAAA;EAGA,2BAAA;EACA,oBAAA;EACA,mBAAA;EACA,4BAAA;EACA,qBAAA;EACA,+BAAA;EACA,mBAAA;EACA,wBAAA;EAGA,oBAAA;EACA,iBAAA;EACA,4BAAA;EAGA,0BAAA;EACA,gCAAA;EACA,gCAAA;AAAA;;;KC3CCA,6BAAAA,MACHC,CAAAA,2BACEA,CAAAA,2BACEA,CAAAA;AAAAA,KAGMC,YAAAA,MAAkBD,CAAAA,IAAKD,6BAAAA,CAA8BC,CAAAA,IAAKE,MAAAA;;;;;;KCD1DE,mBAAAA,GAAsBC,MAAAA;AAAAA,KAE7BC,WAAAA,GAAcH,YAAAA;AAAAA,KA4FdI,sBAAAA,GAAyBJ,YAAAA;AAAAA,KAoDzBK,iBAAAA;EACH,cAAA,EAAgBD,sBAAAA;AAAAA;AAAAA,KA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AAAA,YAEDD,wBAAAA,mCACV8B,IAAAA,EAAMP,2BAAAA;IACDb,UAAAA;IAAoBC,IAAAA,GAAOvB,KAAAA,GAAQa,MAAAA;IAAiBW,eAAAA,GAAkBT,mBAAAA;EAAAA;AAAAA;;;aE/E3DuE,uBAAAA;EAChBC,MAAAA;EACAC,KAAAA;EACAC,SAAAA;EACAC,OAAAA;AAAAA;;;cCOS,WAAA,SAAoB,eAAA;EAAA,SACb,MAAA,EAAS,KAAA;iBAEV,KAAA,EAAO,KAAA;AAAA;;;cCHb,SAAA,SAAkB,WAAA;EAAA,OACpB,qBAAA,CAAsB,IAAA,KAAS,uBAAA,KAAyB,SAAA;AAAA;;;KCHvD,kBAAA,GAAqB,SAAA;EAC7B,UAAA;AAAA;AAAA,KAGQ,uBAAA,GAA0B,kBAAA,YAEtC,KAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/module.ts","../src/built-in/unauthorized.ts","../src/built-in/auth-header.ts","../src/built-in/bad-request.ts","../src/built-in/bearer-token.ts","../src/built-in/entity-conflict.ts","../src/built-in/entity-credentials-invalid.ts","../src/built-in/entity-inactive.ts","../src/built-in/entity-not-found.ts","../src/built-in/internal.ts","../src/built-in/check.ts","../src/check.ts","../src/constants.ts","../src/normalize.ts","../src/serialize.ts","../src/status.ts"],"mappings":";;;;KASY,kBAAA,GAAqB,YAAA;EAC7B,IAAA,GAAO,MAAM;AAAA;AAAA,KAGL,gBAAA,YAA4B,kBAAkB;AAAA,KAE9C,wBAAA,GAA2B,kBAAkB;EACrD,MAAM;AAAA;AAAA,KAGE,sBAAA,YAAkC,wBAAwB;;;cCRzD,qBAAA;AAAA,cAEA,WAAA,SAAoB,SAAA;EAAA,SACb,MAAA,EAAQ,KAAA;EAAA,SAER,IAAA,GAAO,MAAA;cAEX,KAAA,GAAQ,gBAAA;EAWX,MAAA,CAAA;;;;;;;;;;;cCjBA,2BAAA;AAAA,cAEA,iBAAA,SAA0B,WAAW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AAiB,KAAA,IAAS,aAAa;;;;;;AX3DvE;;;;;;iBYgBgB,OAAA,CAAQ,KAAA,YAAiB,KAAA,IAAS,KAAK;;AZftC;AAGjB;;;;AAA0D;AAE1D;;;;iBYyBgB,aAAA,CAAc,KAAA,YAAiB,KAAA,IAAS,WAAW;;;aCjCvD,SAAA;EAER,WAAA;EACA,cAAA;EAGA,iCAAA;EACA,2BAAA;EAGA,qBAAA;EAGA,0BAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;EACA,uBAAA;EAGA,qBAAA;EACA,0BAAA;EACA,2BAAA;EACA,mBAAA;EAGA,oBAAA;EAGA,WAAA;EACA,aAAA;EAGA,WAAA;EACA,YAAA;EACA,WAAA;EAGA,2BAAA;EACA,oBAAA;EACA,mBAAA;EACA,4BAAA;EACA,qBAAA;EACA,+BAAA;EACA,mBAAA;EACA,wBAAA;EAGA,oBAAA;EACA,iBAAA;EACA,4BAAA;EAGA,0BAAA;EACA,gCAAA;EACA,gCAAA;AAAA;;;;;;;AbrDJ;;;;;iBcSgB,cAAA,CAAe,KAAA,YAAiB,KAAK;;;;;;;AdTrD;;;;;;;;AACiB;iBeYD,cAAA,CAAe,KAAA,EAAO,KAAA,GAAQ,MAAM;;;;;;AfbpD;;;;;;;;AACiB;AAGjB;cgBSa,oBAAA,EAAsB,QAAA,CAAS,OAAA,CAAQ,MAAA,IAAU,SAAA;;;AhBTJ;AAE1D;iBgBqCgB,kBAAA,CAAmB,IAAA,UAAc,QAAc;;;AhBpCrD;AAGV;;;;AAAsE;;;iBgB+CtD,kBAAA,CAAmB,MAAA,WAAiB,SAAS"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { BASE_ERROR_INSTANCE, INSTANCEOF_PROPERTY, hasInstanceof, markInstanceof, } from '@ebec/core';
|
|
2
2
|
export * from './built-in';
|
|
3
|
+
export * from './check';
|
|
4
|
+
export * from './constants';
|
|
3
5
|
export * from './module';
|
|
6
|
+
export * from './normalize';
|
|
7
|
+
export * from './serialize';
|
|
8
|
+
export * from './status';
|
|
4
9
|
export * from './types';
|
|
5
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,cAAc,GACjB,MAAM,YAAY,CAAC;AACpB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BASE_ERROR_INSTANCE, BaseError, INSTANCEOF_PROPERTY, hasInstanceof, hasInstanceof as hasInstanceof$1, isBaseError, isError as isError$1, isObject, markInstanceof, markInstanceof as markInstanceof$1 } from "@ebec/core";
|
|
2
2
|
//#region src/constants.ts
|
|
3
3
|
let ErrorCode = /* @__PURE__ */ function(ErrorCode) {
|
|
4
|
+
ErrorCode["BAD_REQUEST"] = "bad_request";
|
|
5
|
+
ErrorCode["INTERNAL_ERROR"] = "internal_error";
|
|
4
6
|
ErrorCode["HTTP_HEADER_AUTH_TYPE_UNSUPPORTED"] = "unsupported_auth_header_type";
|
|
7
|
+
ErrorCode["HTTP_BEARER_TOKEN_MALFORMED"] = "bearer_token_malformed";
|
|
8
|
+
ErrorCode["IDENTITY_UNAUTHORIZED"] = "identity_unauthorized";
|
|
5
9
|
ErrorCode["ENTITY_CREDENTIALS_INVALID"] = "invalid_credentials";
|
|
6
10
|
ErrorCode["ENTITY_INACTIVE"] = "entity_inactive";
|
|
7
11
|
ErrorCode["ENTITY_NOT_FOUND"] = "entity_not_found";
|
|
12
|
+
ErrorCode["ENTITY_CONFLICT"] = "entity_conflict";
|
|
13
|
+
ErrorCode["ENTITY_RELATION_INVALID"] = "entity_relation_invalid";
|
|
14
|
+
ErrorCode["REGISTRATION_DISABLED"] = "registration_disabled";
|
|
15
|
+
ErrorCode["PASSWORD_RECOVERY_DISABLED"] = "password_recovery_disabled";
|
|
16
|
+
ErrorCode["EMAIL_VERIFICATION_REQUIRED"] = "email_verification_required";
|
|
17
|
+
ErrorCode["RESET_TOKEN_EXPIRED"] = "reset_token_expired";
|
|
18
|
+
ErrorCode["STORAGE_INSUFFICIENT"] = "storage_insufficient";
|
|
8
19
|
ErrorCode["JWK_INVALID"] = "jwk_invalid";
|
|
9
20
|
ErrorCode["JWK_NOT_FOUND"] = "jwk_not_found";
|
|
10
21
|
ErrorCode["JWT_INVALID"] = "invalid_token";
|
|
@@ -28,24 +39,326 @@ let ErrorCode = /* @__PURE__ */ function(ErrorCode) {
|
|
|
28
39
|
}({});
|
|
29
40
|
//#endregion
|
|
30
41
|
//#region src/module.ts
|
|
31
|
-
|
|
42
|
+
const AUTHUP_ERROR_INSTANCE = Symbol.for("@authup/errors/AuthupError");
|
|
43
|
+
var AuthupError = class extends BaseError {
|
|
32
44
|
issues;
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
data;
|
|
46
|
+
constructor(input) {
|
|
47
|
+
super(input);
|
|
48
|
+
markInstanceof$1(this, AUTHUP_ERROR_INSTANCE);
|
|
35
49
|
this.issues = [];
|
|
50
|
+
if (input && typeof input !== "string" && input.data) this.data = input.data;
|
|
51
|
+
}
|
|
52
|
+
toJSON() {
|
|
53
|
+
return {
|
|
54
|
+
...super.toJSON(),
|
|
55
|
+
issues: this.issues,
|
|
56
|
+
...this.data ?? {}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/built-in/unauthorized.ts
|
|
62
|
+
const UNAUTHORIZED_ERROR_INSTANCE = Symbol.for("@authup/errors/UnauthorizedError");
|
|
63
|
+
var UnauthorizedError = class extends AuthupError {
|
|
64
|
+
constructor(input) {
|
|
65
|
+
super({
|
|
66
|
+
code: "identity_unauthorized",
|
|
67
|
+
message: "Authentication required.",
|
|
68
|
+
...typeof input === "string" ? { message: input } : input ?? {}
|
|
69
|
+
});
|
|
70
|
+
markInstanceof$1(this, UNAUTHORIZED_ERROR_INSTANCE);
|
|
36
71
|
}
|
|
37
72
|
};
|
|
38
73
|
//#endregion
|
|
39
|
-
//#region src/built-in/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
74
|
+
//#region src/built-in/auth-header.ts
|
|
75
|
+
const AUTH_HEADER_ERROR_INSTANCE = Symbol.for("@authup/errors/AuthHeaderError");
|
|
76
|
+
var AuthHeaderError = class AuthHeaderError extends UnauthorizedError {
|
|
77
|
+
constructor(message) {
|
|
78
|
+
super({
|
|
43
79
|
code: "unsupported_auth_header_type",
|
|
44
|
-
message
|
|
80
|
+
message
|
|
81
|
+
});
|
|
82
|
+
markInstanceof$1(this, AUTH_HEADER_ERROR_INSTANCE);
|
|
83
|
+
}
|
|
84
|
+
static unsupportedType(type) {
|
|
85
|
+
return new AuthHeaderError(`The authorization header type ${type} is not supported.`);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/built-in/bad-request.ts
|
|
90
|
+
const BAD_REQUEST_ERROR_INSTANCE = Symbol.for("@authup/errors/BadRequestError");
|
|
91
|
+
var BadRequestError = class extends AuthupError {
|
|
92
|
+
constructor(input) {
|
|
93
|
+
super({
|
|
94
|
+
code: "bad_request",
|
|
95
|
+
...typeof input === "string" ? { message: input } : input ?? {}
|
|
96
|
+
});
|
|
97
|
+
markInstanceof$1(this, BAD_REQUEST_ERROR_INSTANCE);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/built-in/bearer-token.ts
|
|
102
|
+
const BEARER_TOKEN_MALFORMED_ERROR_INSTANCE = Symbol.for("@authup/errors/BearerTokenMalformedError");
|
|
103
|
+
var BearerTokenMalformedError = class extends UnauthorizedError {
|
|
104
|
+
constructor(message) {
|
|
105
|
+
super({
|
|
106
|
+
code: "bearer_token_malformed",
|
|
107
|
+
message: message ?? "The Authorization header is malformed."
|
|
108
|
+
});
|
|
109
|
+
markInstanceof$1(this, BEARER_TOKEN_MALFORMED_ERROR_INSTANCE);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/check.ts
|
|
114
|
+
/**
|
|
115
|
+
* Duck-type guard for `Error`.
|
|
116
|
+
*
|
|
117
|
+
* Re-exports `@ebec/core`'s shape-based check: `input` matches when it
|
|
118
|
+
* carries the standard `name` / `message` / `stack` triplet, regardless
|
|
119
|
+
* of which realm or class hierarchy produced it. Use this instead of
|
|
120
|
+
* `instanceof Error` for cross-realm boundaries (worker threads,
|
|
121
|
+
* duplicate-module copies) where `instanceof` can yield false negatives.
|
|
122
|
+
*/
|
|
123
|
+
function isError(input) {
|
|
124
|
+
return isError$1(input);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Duck-type guard for AuthupError.
|
|
128
|
+
*
|
|
129
|
+
* Fast path: input has the AuthupError marker in its `@instanceof` chain.
|
|
130
|
+
* Subclass instances also accumulate this marker, so this guard matches any
|
|
131
|
+
* AuthupError subclass (`OAuth2Error`, `JWTError`, etc.).
|
|
132
|
+
*
|
|
133
|
+
* Slow path: input is shape-compatible with AuthupError (BaseError + has
|
|
134
|
+
* `issues: Issue[]`). Catches cases where the marker is missing — plain
|
|
135
|
+
* objects rehydrated from JSON, older builds without the marker.
|
|
136
|
+
*/
|
|
137
|
+
function isAuthupError(input) {
|
|
138
|
+
if (hasInstanceof$1(input, AUTHUP_ERROR_INSTANCE)) return true;
|
|
139
|
+
if (!isBaseError(input)) return false;
|
|
140
|
+
if (!isObject(input)) return false;
|
|
141
|
+
return Array.isArray(input.issues);
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/built-in/entity-conflict.ts
|
|
145
|
+
const ENTITY_CONFLICT_ERROR_INSTANCE = Symbol.for("@authup/errors/EntityConflictError");
|
|
146
|
+
var EntityConflictError = class extends AuthupError {
|
|
147
|
+
constructor(input) {
|
|
148
|
+
const { entity, ...rest } = typeof input === "string" ? { message: input } : input ?? {};
|
|
149
|
+
super({
|
|
150
|
+
code: "entity_conflict",
|
|
151
|
+
message: entity ? `The ${entity} already exists.` : "Entity already exists.",
|
|
152
|
+
...rest
|
|
153
|
+
});
|
|
154
|
+
markInstanceof$1(this, ENTITY_CONFLICT_ERROR_INSTANCE);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/built-in/entity-credentials-invalid.ts
|
|
159
|
+
const ENTITY_CREDENTIALS_INVALID_ERROR_INSTANCE = Symbol.for("@authup/errors/EntityCredentialsInvalidError");
|
|
160
|
+
var EntityCredentialsInvalidError = class extends AuthupError {
|
|
161
|
+
constructor(input) {
|
|
162
|
+
const { entity, ...rest } = typeof input === "string" ? { message: input } : input ?? {};
|
|
163
|
+
super({
|
|
164
|
+
code: "invalid_credentials",
|
|
165
|
+
message: entity ? `The ${entity} credentials are invalid.` : "Credentials are invalid.",
|
|
166
|
+
...rest
|
|
167
|
+
});
|
|
168
|
+
markInstanceof$1(this, ENTITY_CREDENTIALS_INVALID_ERROR_INSTANCE);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/built-in/entity-inactive.ts
|
|
173
|
+
const ENTITY_INACTIVE_ERROR_INSTANCE = Symbol.for("@authup/errors/EntityInactiveError");
|
|
174
|
+
var EntityInactiveError = class extends AuthupError {
|
|
175
|
+
constructor(input) {
|
|
176
|
+
const { entity, ...rest } = typeof input === "string" ? { message: input } : input ?? {};
|
|
177
|
+
super({
|
|
178
|
+
code: "entity_inactive",
|
|
179
|
+
message: entity ? `The ${entity} is inactive.` : "Entity is inactive.",
|
|
180
|
+
...rest
|
|
45
181
|
});
|
|
182
|
+
markInstanceof$1(this, ENTITY_INACTIVE_ERROR_INSTANCE);
|
|
46
183
|
}
|
|
47
184
|
};
|
|
48
185
|
//#endregion
|
|
49
|
-
|
|
186
|
+
//#region src/built-in/entity-not-found.ts
|
|
187
|
+
const ENTITY_NOT_FOUND_ERROR_INSTANCE = Symbol.for("@authup/errors/EntityNotFoundError");
|
|
188
|
+
var EntityNotFoundError = class extends AuthupError {
|
|
189
|
+
constructor(input) {
|
|
190
|
+
const { entity, ...rest } = typeof input === "string" ? { message: input } : input ?? {};
|
|
191
|
+
super({
|
|
192
|
+
code: "entity_not_found",
|
|
193
|
+
message: entity ? `The ${entity} was not found.` : "Entity not found.",
|
|
194
|
+
...rest
|
|
195
|
+
});
|
|
196
|
+
markInstanceof$1(this, ENTITY_NOT_FOUND_ERROR_INSTANCE);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/built-in/internal.ts
|
|
201
|
+
const INTERNAL_ERROR_INSTANCE = Symbol.for("@authup/errors/InternalError");
|
|
202
|
+
var InternalError = class extends AuthupError {
|
|
203
|
+
constructor(input) {
|
|
204
|
+
super({
|
|
205
|
+
code: "internal_error",
|
|
206
|
+
message: "An internal error occurred.",
|
|
207
|
+
...typeof input === "string" ? { message: input } : input ?? {}
|
|
208
|
+
});
|
|
209
|
+
markInstanceof$1(this, INTERNAL_ERROR_INSTANCE);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/built-in/check.ts
|
|
214
|
+
function isAuthHeaderError(input) {
|
|
215
|
+
if (hasInstanceof$1(input, AUTH_HEADER_ERROR_INSTANCE)) return true;
|
|
216
|
+
if (!isAuthupError(input)) return false;
|
|
217
|
+
return input.code === "unsupported_auth_header_type";
|
|
218
|
+
}
|
|
219
|
+
function isBearerTokenMalformedError(input) {
|
|
220
|
+
if (hasInstanceof$1(input, BEARER_TOKEN_MALFORMED_ERROR_INSTANCE)) return true;
|
|
221
|
+
if (!isAuthupError(input)) return false;
|
|
222
|
+
return input.code === "bearer_token_malformed";
|
|
223
|
+
}
|
|
224
|
+
function isBadRequestError(input) {
|
|
225
|
+
if (hasInstanceof$1(input, BAD_REQUEST_ERROR_INSTANCE)) return true;
|
|
226
|
+
if (!isAuthupError(input)) return false;
|
|
227
|
+
return input.code === "bad_request";
|
|
228
|
+
}
|
|
229
|
+
function isUnauthorizedError(input) {
|
|
230
|
+
if (hasInstanceof$1(input, UNAUTHORIZED_ERROR_INSTANCE)) return true;
|
|
231
|
+
if (!isAuthupError(input)) return false;
|
|
232
|
+
return input.code === "identity_unauthorized";
|
|
233
|
+
}
|
|
234
|
+
function isEntityNotFoundError(input) {
|
|
235
|
+
if (hasInstanceof$1(input, ENTITY_NOT_FOUND_ERROR_INSTANCE)) return true;
|
|
236
|
+
if (!isAuthupError(input)) return false;
|
|
237
|
+
return input.code === "entity_not_found";
|
|
238
|
+
}
|
|
239
|
+
function isEntityConflictError(input) {
|
|
240
|
+
if (hasInstanceof$1(input, ENTITY_CONFLICT_ERROR_INSTANCE)) return true;
|
|
241
|
+
if (!isAuthupError(input)) return false;
|
|
242
|
+
return input.code === "entity_conflict";
|
|
243
|
+
}
|
|
244
|
+
function isEntityInactiveError(input) {
|
|
245
|
+
if (hasInstanceof$1(input, ENTITY_INACTIVE_ERROR_INSTANCE)) return true;
|
|
246
|
+
if (!isAuthupError(input)) return false;
|
|
247
|
+
return input.code === "entity_inactive";
|
|
248
|
+
}
|
|
249
|
+
function isEntityCredentialsInvalidError(input) {
|
|
250
|
+
if (hasInstanceof$1(input, ENTITY_CREDENTIALS_INVALID_ERROR_INSTANCE)) return true;
|
|
251
|
+
if (!isAuthupError(input)) return false;
|
|
252
|
+
return input.code === "invalid_credentials";
|
|
253
|
+
}
|
|
254
|
+
function isInternalError(input) {
|
|
255
|
+
if (hasInstanceof$1(input, INTERNAL_ERROR_INSTANCE)) return true;
|
|
256
|
+
if (!isAuthupError(input)) return false;
|
|
257
|
+
return input.code === "internal_error";
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/normalize.ts
|
|
261
|
+
/**
|
|
262
|
+
* Normalize an arbitrary thrown value into an `Error` instance.
|
|
263
|
+
*
|
|
264
|
+
* Useful at error-pipeline boundaries (catch blocks, error middleware,
|
|
265
|
+
* fallbacks) where TypeScript hands you `unknown` but downstream code
|
|
266
|
+
* wants a real `Error` to inspect or rethrow. Duck-typed: any value
|
|
267
|
+
* passing `isError` is returned as-is. Strings become `new Error(str)`;
|
|
268
|
+
* any other value is stringified.
|
|
269
|
+
*/
|
|
270
|
+
function normalizeError(input) {
|
|
271
|
+
if (isError(input)) return input;
|
|
272
|
+
if (typeof input === "string") return new Error(input);
|
|
273
|
+
return new Error(String(input));
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region ../kit/src/object.ts
|
|
277
|
+
function isObject$1(input) {
|
|
278
|
+
return !!input && typeof input === "object" && !Array.isArray(input);
|
|
279
|
+
}
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/serialize.ts
|
|
282
|
+
/**
|
|
283
|
+
* Convert an `Error` (or any value with a `toJSON()` method) into a
|
|
284
|
+
* plain object suitable for embedding in a JSON response body.
|
|
285
|
+
*
|
|
286
|
+
* Calls `input.toJSON()` if present — preserves every attribute the
|
|
287
|
+
* error chose to surface (`code`, `cause`, `errors`, `issues`, `data`,
|
|
288
|
+
* AuthupError sub-class fields, ...). Falls back to spreading the
|
|
289
|
+
* Error's enumerable own properties alongside the standard
|
|
290
|
+
* `name` / `message` pair, so caller-attached fields survive.
|
|
291
|
+
*
|
|
292
|
+
* Pair with `normalizeError` to handle arbitrary thrown values:
|
|
293
|
+
* `serializeError(normalizeError(e))`.
|
|
294
|
+
*/
|
|
295
|
+
function serializeError(input) {
|
|
296
|
+
if ("toJSON" in input && typeof input.toJSON === "function") {
|
|
297
|
+
const output = input.toJSON();
|
|
298
|
+
if (isObject$1(output)) return output;
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
...input,
|
|
302
|
+
name: input.name,
|
|
303
|
+
message: input.message
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/status.ts
|
|
308
|
+
/**
|
|
309
|
+
* Default mapping from `ErrorCode` to HTTP status. Adapters apply this and
|
|
310
|
+
* may layer their own overrides on top. Codes not listed here fall back
|
|
311
|
+
* to 400 (Bad Request) — which is the right default for "validation /
|
|
312
|
+
* malformed-request" style errors.
|
|
313
|
+
*
|
|
314
|
+
* The mapping mirrors the HTTP statuses produced by the pre-refactor
|
|
315
|
+
* `@ebec/http`-coupled error classes, with one intentional change:
|
|
316
|
+
*
|
|
317
|
+
* - `OAUTH_CLIENT_INVALID`: 400 → **401**, per RFC 6749 §5.2 (`invalid_client`
|
|
318
|
+
* responses should use 401). Surfaces as a behavior change in HTTP-level
|
|
319
|
+
* tests asserting `status: 400, code: OAUTH_CLIENT_INVALID`.
|
|
320
|
+
*/
|
|
321
|
+
const ERROR_CODE_TO_STATUS = {
|
|
322
|
+
["invalid_client"]: 401,
|
|
323
|
+
["bearer_token_malformed"]: 401,
|
|
324
|
+
["unsupported_auth_header_type"]: 401,
|
|
325
|
+
["identity_unauthorized"]: 401,
|
|
326
|
+
["permission_not_found"]: 403,
|
|
327
|
+
["permission_denied"]: 403,
|
|
328
|
+
["permission_evaluation_failed"]: 403,
|
|
329
|
+
["entity_not_found"]: 404,
|
|
330
|
+
["jwk_not_found"]: 404,
|
|
331
|
+
["entity_conflict"]: 409,
|
|
332
|
+
["internal_error"]: 500,
|
|
333
|
+
["storage_insufficient"]: 507
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* Resolve an HTTP status for a given error code. Unknown codes fall back
|
|
337
|
+
* to `fallback` (default 400).
|
|
338
|
+
*/
|
|
339
|
+
function httpStatusFromCode(code, fallback = 400) {
|
|
340
|
+
return ERROR_CODE_TO_STATUS[code] ?? fallback;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Resolve a semantic `ErrorCode` for a foreign HTTP status. Used at the
|
|
344
|
+
* boundary where a non-AuthupError (e.g. `@ebec/http` HTTPError thrown by
|
|
345
|
+
* the framework, or a foreign service response) enters our system and
|
|
346
|
+
* needs to be normalized into an `AuthupError` with an authup-vocabulary
|
|
347
|
+
* code. Status is the only stable handshake across the two vocabularies.
|
|
348
|
+
*
|
|
349
|
+
* Default mapping covers the common HTTP statuses. Anything 5xx
|
|
350
|
+
* collapses to `INTERNAL_ERROR`; unknown 4xx collapses to `BAD_REQUEST`.
|
|
351
|
+
*/
|
|
352
|
+
function codeFromHttpStatus(status) {
|
|
353
|
+
if (status === 404) return "entity_not_found";
|
|
354
|
+
if (status === 409) return "entity_conflict";
|
|
355
|
+
if (status === 401) return "identity_unauthorized";
|
|
356
|
+
if (status === 403) return "permission_denied";
|
|
357
|
+
if (status === 507) return "storage_insufficient";
|
|
358
|
+
if (status >= 500) return "internal_error";
|
|
359
|
+
return "bad_request";
|
|
360
|
+
}
|
|
361
|
+
//#endregion
|
|
362
|
+
export { AUTHUP_ERROR_INSTANCE, AUTH_HEADER_ERROR_INSTANCE, AuthHeaderError, AuthupError, BAD_REQUEST_ERROR_INSTANCE, BASE_ERROR_INSTANCE, BEARER_TOKEN_MALFORMED_ERROR_INSTANCE, BadRequestError, BearerTokenMalformedError, ENTITY_CONFLICT_ERROR_INSTANCE, ENTITY_CREDENTIALS_INVALID_ERROR_INSTANCE, ENTITY_INACTIVE_ERROR_INSTANCE, ENTITY_NOT_FOUND_ERROR_INSTANCE, ERROR_CODE_TO_STATUS, EntityConflictError, EntityCredentialsInvalidError, EntityInactiveError, EntityNotFoundError, ErrorCode, INSTANCEOF_PROPERTY, INTERNAL_ERROR_INSTANCE, InternalError, UNAUTHORIZED_ERROR_INSTANCE, UnauthorizedError, codeFromHttpStatus, hasInstanceof, httpStatusFromCode, isAuthHeaderError, isAuthupError, isBadRequestError, isBearerTokenMalformedError, isEntityConflictError, isEntityCredentialsInvalidError, isEntityInactiveError, isEntityNotFoundError, isError, isInternalError, isUnauthorizedError, markInstanceof, normalizeError, serializeError };
|
|
50
363
|
|
|
51
364
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/constants.ts","../src/module.ts","../src/built-in/http.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum ErrorCode {\n // HTTP Codes\n HTTP_HEADER_AUTH_TYPE_UNSUPPORTED = 'unsupported_auth_header_type',\n\n // Entity Codes\n ENTITY_CREDENTIALS_INVALID = 'invalid_credentials',\n ENTITY_INACTIVE = 'entity_inactive',\n ENTITY_NOT_FOUND = 'entity_not_found',\n\n // JWK Codes\n JWK_INVALID = 'jwk_invalid',\n JWK_NOT_FOUND = 'jwk_not_found',\n\n // JWT Codes\n JWT_INVALID = 'invalid_token',\n JWT_INACTIVE = 'inactive_token',\n JWT_EXPIRED = 'expired_token',\n\n // Oauth2 Codes\n OAUTH_REDIRECT_URI_MISMATCH = 'redirect_uri_mismatch',\n OAUTH_CLIENT_INVALID = 'invalid_client',\n OAUTH_GRANT_INVALID = 'invalid_grant',\n OAUTH_GRANT_TYPE_UNSUPPORTED = 'unsupported_token_grant_type',\n OAUTH_REQUEST_INVALID = 'invalid_request',\n OAUTH_RESPONSE_TYPE_UNSUPPORTED = 'unsupported_response_type',\n OAUTH_SCOPE_INVALID = 'invalid_scope',\n OAUTH_SCOPE_INSUFFICIENT = 'insufficient_scope',\n\n // Permission Codes\n PERMISSION_NOT_FOUND = 'permission_not_found',\n PERMISSION_DENIED = 'permission_denied',\n PERMISSION_EVALUATION_FAILED = 'permission_evaluation_failed',\n\n // Policy Codes\n POLICY_EVALUATOR_NOT_FOUND = 'policy_evaluator_not_found',\n POLICY_EVALUATOR_NOT_PROCESSABLE = 'policy_evaluator_not_processable',\n POLICY_EVALUATOR_CONTEXT_INVALID = 'policy_evaluator_context_invalid',\n}\n","/*\n * Copyright (c) 2024-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Input } from '@ebec/http';\nimport { BadRequestError } from '@ebec/http';\nimport type { Issue } from 'validup';\n\nexport class AuthupError extends BadRequestError {\n public readonly issues : Issue[];\n\n constructor(...input: Input[]) {\n super(...input);\n\n this.issues = [];\n }\n}\n","/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { AuthorizationHeaderType } from 'hapic';\nimport { ErrorCode } from '../constants';\nimport { AuthupError } from '../module';\n\nexport class HTTPError extends AuthupError {\n static unsupportedHeaderType(type: `${AuthorizationHeaderType}`) {\n return new HTTPError({\n code: ErrorCode.HTTP_HEADER_AUTH_TYPE_UNSUPPORTED,\n message: `The authorization header type ${type} is not supported.`,\n });\n }\n}\n"],"mappings":";;AAOA,IAAY,YAAL,yBAAA,WAAA;AAEH,WAAA,uCAAA;AAGA,WAAA,gCAAA;AACA,WAAA,qBAAA;AACA,WAAA,sBAAA;AAGA,WAAA,iBAAA;AACA,WAAA,mBAAA;AAGA,WAAA,iBAAA;AACA,WAAA,kBAAA;AACA,WAAA,iBAAA;AAGA,WAAA,iCAAA;AACA,WAAA,0BAAA;AACA,WAAA,yBAAA;AACA,WAAA,kCAAA;AACA,WAAA,2BAAA;AACA,WAAA,qCAAA;AACA,WAAA,yBAAA;AACA,WAAA,8BAAA;AAGA,WAAA,0BAAA;AACA,WAAA,uBAAA;AACA,WAAA,kCAAA;AAGA,WAAA,gCAAA;AACA,WAAA,sCAAA;AACA,WAAA,sCAAA;;KACH;;;ACjCD,IAAa,cAAb,cAAiC,gBAAgB;CAC7C;CAEA,YAAY,GAAG,OAAgB;AAC3B,QAAM,GAAG,MAAM;AAEf,OAAK,SAAS,EAAE;;;;;ACNxB,IAAa,YAAb,MAAa,kBAAkB,YAAY;CACvC,OAAO,sBAAsB,MAAoC;AAC7D,SAAO,IAAI,UAAU;GACjB,MAAA;GACA,SAAS,iCAAiC,KAAK;GAClD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["isRawError","hasInstanceof","hasInstanceof","isObject","isObject"],"sources":["../src/constants.ts","../src/module.ts","../src/built-in/unauthorized.ts","../src/built-in/auth-header.ts","../src/built-in/bad-request.ts","../src/built-in/bearer-token.ts","../src/check.ts","../src/built-in/entity-conflict.ts","../src/built-in/entity-credentials-invalid.ts","../src/built-in/entity-inactive.ts","../src/built-in/entity-not-found.ts","../src/built-in/internal.ts","../src/built-in/check.ts","../src/normalize.ts","../../kit/src/object.ts","../src/serialize.ts","../src/status.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum ErrorCode {\n // Generic\n BAD_REQUEST = 'bad_request',\n INTERNAL_ERROR = 'internal_error',\n\n // HTTP Codes\n HTTP_HEADER_AUTH_TYPE_UNSUPPORTED = 'unsupported_auth_header_type',\n HTTP_BEARER_TOKEN_MALFORMED = 'bearer_token_malformed',\n\n // Identity Auth\n IDENTITY_UNAUTHORIZED = 'identity_unauthorized',\n\n // Entity Codes\n ENTITY_CREDENTIALS_INVALID = 'invalid_credentials',\n ENTITY_INACTIVE = 'entity_inactive',\n ENTITY_NOT_FOUND = 'entity_not_found',\n ENTITY_CONFLICT = 'entity_conflict',\n ENTITY_RELATION_INVALID = 'entity_relation_invalid',\n\n // Identity Codes\n REGISTRATION_DISABLED = 'registration_disabled',\n PASSWORD_RECOVERY_DISABLED = 'password_recovery_disabled',\n EMAIL_VERIFICATION_REQUIRED = 'email_verification_required',\n RESET_TOKEN_EXPIRED = 'reset_token_expired',\n\n // Storage Codes\n STORAGE_INSUFFICIENT = 'storage_insufficient',\n\n // JWK Codes\n JWK_INVALID = 'jwk_invalid',\n JWK_NOT_FOUND = 'jwk_not_found',\n\n // JWT Codes\n JWT_INVALID = 'invalid_token',\n JWT_INACTIVE = 'inactive_token',\n JWT_EXPIRED = 'expired_token',\n\n // Oauth2 Codes\n OAUTH_REDIRECT_URI_MISMATCH = 'redirect_uri_mismatch',\n OAUTH_CLIENT_INVALID = 'invalid_client',\n OAUTH_GRANT_INVALID = 'invalid_grant',\n OAUTH_GRANT_TYPE_UNSUPPORTED = 'unsupported_token_grant_type',\n OAUTH_REQUEST_INVALID = 'invalid_request',\n OAUTH_RESPONSE_TYPE_UNSUPPORTED = 'unsupported_response_type',\n OAUTH_SCOPE_INVALID = 'invalid_scope',\n OAUTH_SCOPE_INSUFFICIENT = 'insufficient_scope',\n\n // Permission Codes\n PERMISSION_NOT_FOUND = 'permission_not_found',\n PERMISSION_DENIED = 'permission_denied',\n PERMISSION_EVALUATION_FAILED = 'permission_evaluation_failed',\n\n // Policy Codes\n POLICY_EVALUATOR_NOT_FOUND = 'policy_evaluator_not_found',\n POLICY_EVALUATOR_NOT_PROCESSABLE = 'policy_evaluator_not_processable',\n POLICY_EVALUATOR_CONTEXT_INVALID = 'policy_evaluator_context_invalid',\n}\n","/*\n * Copyright (c) 2024-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { AuthupErrorInput } from './types.ts';\nimport { BaseError, markInstanceof } from '@ebec/core';\nimport type { Issue } from 'validup';\n\nexport const AUTHUP_ERROR_INSTANCE = Symbol.for('@authup/errors/AuthupError');\n\nexport class AuthupError extends BaseError {\n public readonly issues: Issue[];\n\n public readonly data?: Record<string, any>;\n\n constructor(input?: AuthupErrorInput) {\n super(input);\n markInstanceof(this, AUTHUP_ERROR_INSTANCE);\n\n this.issues = [];\n\n if (input && typeof input !== 'string' && input.data) {\n this.data = input.data;\n }\n }\n\n override toJSON() {\n return {\n ...super.toJSON(),\n issues: this.issues,\n ...(this.data ?? {}),\n };\n }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { ErrorCode } from '../constants.ts';\nimport { markInstanceof } from '@ebec/core';\nimport { AuthupError } from '../module.ts';\nimport type { AuthupErrorOptions } from '../types.ts';\n\nexport const UNAUTHORIZED_ERROR_INSTANCE = Symbol.for('@authup/errors/UnauthorizedError');\n\nexport class UnauthorizedError extends AuthupError {\n constructor(input?: string | AuthupErrorOptions) {\n const options: AuthupErrorOptions = typeof input === 'string' ? { message: input } : (input ?? {});\n super({\n code: ErrorCode.IDENTITY_UNAUTHORIZED,\n message: 'Authentication required.',\n ...options,\n });\n markInstanceof(this, UNAUTHORIZED_ERROR_INSTANCE);\n }\n}\n","/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { ErrorCode } from '../constants.ts';\nimport { markInstanceof } from '@ebec/core';\nimport { UnauthorizedError } from './unauthorized.ts';\n\nexport const AUTH_HEADER_ERROR_INSTANCE = Symbol.for('@authup/errors/AuthHeaderError');\n\nexport class AuthHeaderError extends UnauthorizedError {\n constructor(message: string) {\n super({\n code: ErrorCode.HTTP_HEADER_AUTH_TYPE_UNSUPPORTED,\n message,\n });\n markInstanceof(this, AUTH_HEADER_ERROR_INSTANCE);\n }\n\n static unsupportedType(type: string) {\n return new AuthHeaderError(`The authorization header type ${type} is not supported.`);\n }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { ErrorCode } from '../constants.ts';\nimport { markInstanceof } from '@ebec/core';\nimport { AuthupError } from '../module.ts';\nimport type { AuthupErrorOptions } from '../types.ts';\n\nexport const BAD_REQUEST_ERROR_INSTANCE = Symbol.for('@authup/errors/BadRequestError');\n\nexport class BadRequestError extends AuthupError {\n constructor(input?: string | AuthupErrorOptions) {\n const options: AuthupErrorOptions = typeof input === 'string' ? { message: input } : (input ?? {});\n super({\n code: ErrorCode.BAD_REQUEST,\n ...options,\n });\n markInstanceof(this, BAD_REQUEST_ERROR_INSTANCE);\n }\n}\n","/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { ErrorCode } from '../constants.ts';\nimport { markInstanceof } from '@ebec/core';\nimport { UnauthorizedError } from './unauthorized.ts';\n\nexport const BEARER_TOKEN_MALFORMED_ERROR_INSTANCE = Symbol.for('@authup/errors/BearerTokenMalformedError');\n\nexport class BearerTokenMalformedError extends UnauthorizedError {\n constructor(message?: string) {\n super({\n code: ErrorCode.HTTP_BEARER_TOKEN_MALFORMED,\n message: message ?? 'The Authorization header is malformed.',\n });\n markInstanceof(this, BEARER_TOKEN_MALFORMED_ERROR_INSTANCE);\n }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n hasInstanceof,\n isBaseError,\n isObject,\n isError as isRawError,\n} from '@ebec/core';\nimport type { AuthupError } from './module.ts';\nimport { AUTHUP_ERROR_INSTANCE } from './module.ts';\n\n/**\n * Duck-type guard for `Error`.\n *\n * Re-exports `@ebec/core`'s shape-based check: `input` matches when it\n * carries the standard `name` / `message` / `stack` triplet, regardless\n * of which realm or class hierarchy produced it. Use this instead of\n * `instanceof Error` for cross-realm boundaries (worker threads,\n * duplicate-module copies) where `instanceof` can yield false negatives.\n */\nexport function isError(input: unknown): input is Error {\n return isRawError(input);\n}\n\n/**\n * Duck-type guard for AuthupError.\n *\n * Fast path: input has the AuthupError marker in its `@instanceof` chain.\n * Subclass instances also accumulate this marker, so this guard matches any\n * AuthupError subclass (`OAuth2Error`, `JWTError`, etc.).\n *\n * Slow path: input is shape-compatible with AuthupError (BaseError + has\n * `issues: Issue[]`). Catches cases where the marker is missing — plain\n * objects rehydrated from JSON, older builds without the marker.\n */\nexport function isAuthupError(input: unknown): input is AuthupError {\n if (hasInstanceof(input, AUTHUP_ERROR_INSTANCE)) {\n return true;\n }\n\n if (!isBaseError(input)) {\n return false;\n }\n\n if (!isObject(input)) {\n return false;\n }\n\n return Array.isArray(input.issues);\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { markInstanceof } from '@ebec/core';\nimport { ErrorCode } from '../constants.ts';\nimport { AuthupError } from '../module.ts';\nimport type { AuthupEntityErrorOptions } from '../types.ts';\n\nexport const ENTITY_CONFLICT_ERROR_INSTANCE = Symbol.for('@authup/errors/EntityConflictError');\n\nexport class EntityConflictError extends AuthupError {\n constructor(input?: string | AuthupEntityErrorOptions) {\n const options: AuthupEntityErrorOptions = typeof input === 'string' ? { message: input } : (input ?? {});\n const { entity, ...rest } = options;\n super({\n code: ErrorCode.ENTITY_CONFLICT,\n message: entity ? `The ${entity} already exists.` : 'Entity already exists.',\n ...rest,\n });\n markInstanceof(this, ENTITY_CONFLICT_ERROR_INSTANCE);\n }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { markInstanceof } from '@ebec/core';\nimport { ErrorCode } from '../constants.ts';\nimport { AuthupError } from '../module.ts';\nimport type { AuthupEntityErrorOptions } from '../types.ts';\n\nexport const ENTITY_CREDENTIALS_INVALID_ERROR_INSTANCE = Symbol.for('@authup/errors/EntityCredentialsInvalidError');\n\nexport class EntityCredentialsInvalidError extends AuthupError {\n constructor(input?: string | AuthupEntityErrorOptions) {\n const options: AuthupEntityErrorOptions = typeof input === 'string' ? { message: input } : (input ?? {});\n const { entity, ...rest } = options;\n super({\n code: ErrorCode.ENTITY_CREDENTIALS_INVALID,\n message: entity ? `The ${entity} credentials are invalid.` : 'Credentials are invalid.',\n ...rest,\n });\n markInstanceof(this, ENTITY_CREDENTIALS_INVALID_ERROR_INSTANCE);\n }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { markInstanceof } from '@ebec/core';\nimport { ErrorCode } from '../constants.ts';\nimport { AuthupError } from '../module.ts';\nimport type { AuthupEntityErrorOptions } from '../types.ts';\n\nexport const ENTITY_INACTIVE_ERROR_INSTANCE = Symbol.for('@authup/errors/EntityInactiveError');\n\nexport class EntityInactiveError extends AuthupError {\n constructor(input?: string | AuthupEntityErrorOptions) {\n const options: AuthupEntityErrorOptions = typeof input === 'string' ? { message: input } : (input ?? {});\n const { entity, ...rest } = options;\n super({\n code: ErrorCode.ENTITY_INACTIVE,\n message: entity ? `The ${entity} is inactive.` : 'Entity is inactive.',\n ...rest,\n });\n markInstanceof(this, ENTITY_INACTIVE_ERROR_INSTANCE);\n }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { markInstanceof } from '@ebec/core';\nimport { ErrorCode } from '../constants.ts';\nimport { AuthupError } from '../module.ts';\nimport type { AuthupEntityErrorOptions } from '../types.ts';\n\nexport const ENTITY_NOT_FOUND_ERROR_INSTANCE = Symbol.for('@authup/errors/EntityNotFoundError');\n\nexport class EntityNotFoundError extends AuthupError {\n constructor(input?: string | AuthupEntityErrorOptions) {\n const options: AuthupEntityErrorOptions = typeof input === 'string' ? { message: input } : (input ?? {});\n const { entity, ...rest } = options;\n super({\n code: ErrorCode.ENTITY_NOT_FOUND,\n message: entity ? `The ${entity} was not found.` : 'Entity not found.',\n ...rest,\n });\n markInstanceof(this, ENTITY_NOT_FOUND_ERROR_INSTANCE);\n }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { ErrorCode } from '../constants.ts';\nimport { markInstanceof } from '@ebec/core';\nimport { AuthupError } from '../module.ts';\nimport type { AuthupErrorOptions } from '../types.ts';\n\nexport const INTERNAL_ERROR_INSTANCE = Symbol.for('@authup/errors/InternalError');\n\nexport class InternalError extends AuthupError {\n constructor(input?: string | AuthupErrorOptions) {\n const options: AuthupErrorOptions = typeof input === 'string' ? { message: input } : (input ?? {});\n super({\n code: ErrorCode.INTERNAL_ERROR,\n message: 'An internal error occurred.',\n ...options,\n });\n markInstanceof(this, INTERNAL_ERROR_INSTANCE);\n }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isAuthupError } from '../check.ts';\nimport { ErrorCode } from '../constants.ts';\nimport { hasInstanceof } from '@ebec/core';\nimport { AUTH_HEADER_ERROR_INSTANCE, type AuthHeaderError } from './auth-header.ts';\nimport { BAD_REQUEST_ERROR_INSTANCE, type BadRequestError } from './bad-request.ts';\nimport { BEARER_TOKEN_MALFORMED_ERROR_INSTANCE, type BearerTokenMalformedError } from './bearer-token.ts';\nimport { ENTITY_CONFLICT_ERROR_INSTANCE, type EntityConflictError } from './entity-conflict.ts';\nimport { ENTITY_CREDENTIALS_INVALID_ERROR_INSTANCE, type EntityCredentialsInvalidError } from './entity-credentials-invalid.ts';\nimport { ENTITY_INACTIVE_ERROR_INSTANCE, type EntityInactiveError } from './entity-inactive.ts';\nimport { ENTITY_NOT_FOUND_ERROR_INSTANCE, type EntityNotFoundError } from './entity-not-found.ts';\nimport { INTERNAL_ERROR_INSTANCE, type InternalError } from './internal.ts';\nimport { UNAUTHORIZED_ERROR_INSTANCE, type UnauthorizedError } from './unauthorized.ts';\n\nexport function isAuthHeaderError(input: unknown): input is AuthHeaderError {\n if (hasInstanceof(input, AUTH_HEADER_ERROR_INSTANCE)) return true;\n if (!isAuthupError(input)) return false;\n return input.code === ErrorCode.HTTP_HEADER_AUTH_TYPE_UNSUPPORTED;\n}\n\nexport function isBearerTokenMalformedError(input: unknown): input is BearerTokenMalformedError {\n if (hasInstanceof(input, BEARER_TOKEN_MALFORMED_ERROR_INSTANCE)) return true;\n if (!isAuthupError(input)) return false;\n return input.code === ErrorCode.HTTP_BEARER_TOKEN_MALFORMED;\n}\n\nexport function isBadRequestError(input: unknown): input is BadRequestError {\n if (hasInstanceof(input, BAD_REQUEST_ERROR_INSTANCE)) return true;\n if (!isAuthupError(input)) return false;\n return input.code === ErrorCode.BAD_REQUEST;\n}\n\nexport function isUnauthorizedError(input: unknown): input is UnauthorizedError {\n if (hasInstanceof(input, UNAUTHORIZED_ERROR_INSTANCE)) return true;\n if (!isAuthupError(input)) return false;\n return input.code === ErrorCode.IDENTITY_UNAUTHORIZED;\n}\n\nexport function isEntityNotFoundError(input: unknown): input is EntityNotFoundError {\n if (hasInstanceof(input, ENTITY_NOT_FOUND_ERROR_INSTANCE)) return true;\n if (!isAuthupError(input)) return false;\n return input.code === ErrorCode.ENTITY_NOT_FOUND;\n}\n\nexport function isEntityConflictError(input: unknown): input is EntityConflictError {\n if (hasInstanceof(input, ENTITY_CONFLICT_ERROR_INSTANCE)) return true;\n if (!isAuthupError(input)) return false;\n return input.code === ErrorCode.ENTITY_CONFLICT;\n}\n\nexport function isEntityInactiveError(input: unknown): input is EntityInactiveError {\n if (hasInstanceof(input, ENTITY_INACTIVE_ERROR_INSTANCE)) return true;\n if (!isAuthupError(input)) return false;\n return input.code === ErrorCode.ENTITY_INACTIVE;\n}\n\nexport function isEntityCredentialsInvalidError(input: unknown): input is EntityCredentialsInvalidError {\n if (hasInstanceof(input, ENTITY_CREDENTIALS_INVALID_ERROR_INSTANCE)) return true;\n if (!isAuthupError(input)) return false;\n return input.code === ErrorCode.ENTITY_CREDENTIALS_INVALID;\n}\n\nexport function isInternalError(input: unknown): input is InternalError {\n if (hasInstanceof(input, INTERNAL_ERROR_INSTANCE)) return true;\n if (!isAuthupError(input)) return false;\n return input.code === ErrorCode.INTERNAL_ERROR;\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isError } from './check.ts';\n\n/**\n * Normalize an arbitrary thrown value into an `Error` instance.\n *\n * Useful at error-pipeline boundaries (catch blocks, error middleware,\n * fallbacks) where TypeScript hands you `unknown` but downstream code\n * wants a real `Error` to inspect or rethrow. Duck-typed: any value\n * passing `isError` is returned as-is. Strings become `new Error(str)`;\n * any other value is stringified.\n */\nexport function normalizeError(input: unknown): Error {\n if (isError(input)) {\n return input;\n }\n\n if (typeof input === 'string') {\n return new Error(input);\n }\n\n return new Error(String(input));\n}\n\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ObjectLiteral } from './types';\n\nexport function isObject(input: unknown) : input is Record<string, any> {\n return !!input &&\n typeof input === 'object' &&\n !Array.isArray(input);\n}\n\nexport function extendObject<T extends Record<string, any>>(\n target: T,\n source: Partial<T>,\n) : T {\n const keys = Object.keys(source);\n for (const key of keys) {\n target[key as keyof T] = source[key] as T[keyof T];\n }\n\n return target;\n}\n\nexport function flattenObject(input: Record<string, any>) : Record<string, any> {\n const output : Record<string, any> = {};\n\n const keys = Object.keys(input);\n for (const key of keys) {\n const value = input[key];\n if (isObject(value)) {\n const childAttributes = flattenObject(value);\n const childAttributeKeys = Object.keys(childAttributes);\n for (const childAttributeKey of childAttributeKeys) {\n output[`${key}.${childAttributeKey}`] = childAttributes[childAttributeKey];\n }\n\n continue;\n }\n\n output[key] = input[key];\n }\n\n return output;\n}\n\nexport function removeObjectProperty<T extends ObjectLiteral>(input: Partial<T>, key: keyof T) {\n delete input[key];\n}\n\nexport function omitObjectProperties<\n T extends ObjectLiteral,\n>(input: Record<string, any>, excludeKeys: (keyof T)[]): T {\n const output : T = {} as T;\n const keys = Object.keys(input);\n\n for (const key of keys) {\n if (excludeKeys.includes(key)) {\n continue;\n }\n\n output[key as keyof T] = input[key] as T[keyof T];\n }\n\n return output;\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isObject } from '@authup/kit';\n\n/**\n * Convert an `Error` (or any value with a `toJSON()` method) into a\n * plain object suitable for embedding in a JSON response body.\n *\n * Calls `input.toJSON()` if present — preserves every attribute the\n * error chose to surface (`code`, `cause`, `errors`, `issues`, `data`,\n * AuthupError sub-class fields, ...). Falls back to spreading the\n * Error's enumerable own properties alongside the standard\n * `name` / `message` pair, so caller-attached fields survive.\n *\n * Pair with `normalizeError` to handle arbitrary thrown values:\n * `serializeError(normalizeError(e))`.\n */\nexport function serializeError(input: Error): Record<string, any> {\n if ('toJSON' in input && typeof input.toJSON === 'function') {\n const output = input.toJSON();\n if (isObject(output)) {\n return output;\n }\n }\n\n return {\n ...input,\n name: input.name,\n message: input.message,\n };\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { ErrorCode } from './constants.ts';\n\n/**\n * Default mapping from `ErrorCode` to HTTP status. Adapters apply this and\n * may layer their own overrides on top. Codes not listed here fall back\n * to 400 (Bad Request) — which is the right default for \"validation /\n * malformed-request\" style errors.\n *\n * The mapping mirrors the HTTP statuses produced by the pre-refactor\n * `@ebec/http`-coupled error classes, with one intentional change:\n *\n * - `OAUTH_CLIENT_INVALID`: 400 → **401**, per RFC 6749 §5.2 (`invalid_client`\n * responses should use 401). Surfaces as a behavior change in HTTP-level\n * tests asserting `status: 400, code: OAUTH_CLIENT_INVALID`.\n */\nexport const ERROR_CODE_TO_STATUS: Readonly<Partial<Record<`${ErrorCode}`, number>>> = {\n // 401\n [ErrorCode.OAUTH_CLIENT_INVALID]: 401,\n [ErrorCode.HTTP_BEARER_TOKEN_MALFORMED]: 401,\n [ErrorCode.HTTP_HEADER_AUTH_TYPE_UNSUPPORTED]: 401,\n [ErrorCode.IDENTITY_UNAUTHORIZED]: 401,\n\n // 403\n [ErrorCode.PERMISSION_NOT_FOUND]: 403,\n [ErrorCode.PERMISSION_DENIED]: 403,\n [ErrorCode.PERMISSION_EVALUATION_FAILED]: 403,\n\n // 404\n [ErrorCode.ENTITY_NOT_FOUND]: 404,\n [ErrorCode.JWK_NOT_FOUND]: 404,\n\n // 409\n [ErrorCode.ENTITY_CONFLICT]: 409,\n\n // 500\n [ErrorCode.INTERNAL_ERROR]: 500,\n\n // 507\n [ErrorCode.STORAGE_INSUFFICIENT]: 507,\n};\n\n/**\n * Resolve an HTTP status for a given error code. Unknown codes fall back\n * to `fallback` (default 400).\n */\nexport function httpStatusFromCode(code: string, fallback = 400): number {\n return ERROR_CODE_TO_STATUS[code as `${ErrorCode}`] ?? fallback;\n}\n\n/**\n * Resolve a semantic `ErrorCode` for a foreign HTTP status. Used at the\n * boundary where a non-AuthupError (e.g. `@ebec/http` HTTPError thrown by\n * the framework, or a foreign service response) enters our system and\n * needs to be normalized into an `AuthupError` with an authup-vocabulary\n * code. Status is the only stable handshake across the two vocabularies.\n *\n * Default mapping covers the common HTTP statuses. Anything 5xx\n * collapses to `INTERNAL_ERROR`; unknown 4xx collapses to `BAD_REQUEST`.\n */\nexport function codeFromHttpStatus(status: number): ErrorCode {\n if (status === 404) return ErrorCode.ENTITY_NOT_FOUND;\n if (status === 409) return ErrorCode.ENTITY_CONFLICT;\n if (status === 401) return ErrorCode.IDENTITY_UNAUTHORIZED;\n if (status === 403) return ErrorCode.PERMISSION_DENIED;\n if (status === 507) return ErrorCode.STORAGE_INSUFFICIENT;\n if (status >= 500) return ErrorCode.INTERNAL_ERROR;\n return ErrorCode.BAD_REQUEST;\n}\n"],"mappings":";;AAOA,IAAY,YAAL,yBAAA,WAAA;CAEH,UAAA,iBAAA;CACA,UAAA,oBAAA;CAGA,UAAA,uCAAA;CACA,UAAA,iCAAA;CAGA,UAAA,2BAAA;CAGA,UAAA,gCAAA;CACA,UAAA,qBAAA;CACA,UAAA,sBAAA;CACA,UAAA,qBAAA;CACA,UAAA,6BAAA;CAGA,UAAA,2BAAA;CACA,UAAA,gCAAA;CACA,UAAA,iCAAA;CACA,UAAA,yBAAA;CAGA,UAAA,0BAAA;CAGA,UAAA,iBAAA;CACA,UAAA,mBAAA;CAGA,UAAA,iBAAA;CACA,UAAA,kBAAA;CACA,UAAA,iBAAA;CAGA,UAAA,iCAAA;CACA,UAAA,0BAAA;CACA,UAAA,yBAAA;CACA,UAAA,kCAAA;CACA,UAAA,2BAAA;CACA,UAAA,qCAAA;CACA,UAAA,yBAAA;CACA,UAAA,8BAAA;CAGA,UAAA,0BAAA;CACA,UAAA,uBAAA;CACA,UAAA,kCAAA;CAGA,UAAA,gCAAA;CACA,UAAA,sCAAA;CACA,UAAA,sCAAA;;AACJ,EAAA,CAAA,CAAA;;;ACpDA,MAAa,wBAAwB,OAAO,IAAI,4BAA4B;AAE5E,IAAa,cAAb,cAAiC,UAAU;CACvC;CAEA;CAEA,YAAY,OAA0B;EAClC,MAAM,KAAK;EACX,iBAAe,MAAM,qBAAqB;EAE1C,KAAK,SAAS,CAAC;EAEf,IAAI,SAAS,OAAO,UAAU,YAAY,MAAM,MAC5C,KAAK,OAAO,MAAM;CAE1B;CAEA,SAAkB;EACd,OAAO;GACH,GAAG,MAAM,OAAO;GAChB,QAAQ,KAAK;GACb,GAAI,KAAK,QAAQ,CAAC;EACtB;CACJ;AACJ;;;ACxBA,MAAa,8BAA8B,OAAO,IAAI,kCA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AAA;CACpB,IAAI,WAAW,KAAK,OAAA;CACpB,IAAI,UAAU,KAAK,OAAA;CACnB,OAAA;AACJ"}
|
package/dist/module.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { AuthupErrorInput } from './types.ts';
|
|
2
|
+
import { BaseError } from '@ebec/core';
|
|
3
3
|
import type { Issue } from 'validup';
|
|
4
|
-
export declare
|
|
4
|
+
export declare const AUTHUP_ERROR_INSTANCE: unique symbol;
|
|
5
|
+
export declare class AuthupError extends BaseError {
|
|
5
6
|
readonly issues: Issue[];
|
|
6
|
-
|
|
7
|
+
readonly data?: Record<string, any>;
|
|
8
|
+
constructor(input?: AuthupErrorInput);
|
|
9
|
+
toJSON(): {
|
|
10
|
+
issues: Issue[];
|
|
11
|
+
name: string;
|
|
12
|
+
message: string;
|
|
13
|
+
code: string;
|
|
14
|
+
cause?: unknown;
|
|
15
|
+
errors?: unknown[];
|
|
16
|
+
};
|
|
7
17
|
}
|
|
8
18
|
//# sourceMappingURL=module.d.ts.map
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,eAAO,MAAM,qBAAqB,eAA2C,CAAC;AAE9E,qBAAa,WAAY,SAAQ,SAAS;IACtC,SAAgB,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhC,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAE/B,KAAK,CAAC,EAAE,gBAAgB;IAW3B,MAAM;;;;;;;;CAOlB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize an arbitrary thrown value into an `Error` instance.
|
|
3
|
+
*
|
|
4
|
+
* Useful at error-pipeline boundaries (catch blocks, error middleware,
|
|
5
|
+
* fallbacks) where TypeScript hands you `unknown` but downstream code
|
|
6
|
+
* wants a real `Error` to inspect or rethrow. Duck-typed: any value
|
|
7
|
+
* passing `isError` is returned as-is. Strings become `new Error(str)`;
|
|
8
|
+
* any other value is stringified.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeError(input: unknown): Error;
|
|
11
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAUpD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert an `Error` (or any value with a `toJSON()` method) into a
|
|
3
|
+
* plain object suitable for embedding in a JSON response body.
|
|
4
|
+
*
|
|
5
|
+
* Calls `input.toJSON()` if present — preserves every attribute the
|
|
6
|
+
* error chose to surface (`code`, `cause`, `errors`, `issues`, `data`,
|
|
7
|
+
* AuthupError sub-class fields, ...). Falls back to spreading the
|
|
8
|
+
* Error's enumerable own properties alongside the standard
|
|
9
|
+
* `name` / `message` pair, so caller-attached fields survive.
|
|
10
|
+
*
|
|
11
|
+
* Pair with `normalizeError` to handle arbitrary thrown values:
|
|
12
|
+
* `serializeError(normalizeError(e))`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function serializeError(input: Error): Record<string, any>;
|
|
15
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../src/serialize.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAahE"}
|