@bymax-one/nest-auth 1.4.3 → 1.4.5

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.
@@ -91,6 +91,46 @@ var AUTH_ERROR_CODES = {
91
91
  */
92
92
  INTERNAL: "auth.internal"
93
93
  };
94
+ var AUTH_ERROR_STATUS = {
95
+ "auth.invalid_credentials": 401,
96
+ "auth.account_locked": 429,
97
+ "auth.account_inactive": 403,
98
+ "auth.account_suspended": 403,
99
+ "auth.account_banned": 403,
100
+ "auth.pending_approval": 403,
101
+ "auth.token_expired": 401,
102
+ "auth.token_revoked": 401,
103
+ "auth.token_invalid": 401,
104
+ "auth.token_missing": 401,
105
+ "auth.refresh_token_invalid": 401,
106
+ "auth.session_not_found": 404,
107
+ "auth.email_already_exists": 409,
108
+ "auth.email_not_verified": 403,
109
+ "auth.email_change_token_invalid": 400,
110
+ "auth.mfa_required": 403,
111
+ "auth.mfa_invalid_code": 401,
112
+ "auth.mfa_already_enabled": 409,
113
+ "auth.mfa_not_enabled": 400,
114
+ "auth.mfa_setup_required": 400,
115
+ "auth.mfa_temp_token_invalid": 401,
116
+ "auth.mfa_state_conflict": 409,
117
+ "auth.password_compromised": 400,
118
+ "auth.password_reset_token_invalid": 400,
119
+ "auth.otp_invalid": 401,
120
+ "auth.otp_expired": 401,
121
+ "auth.otp_max_attempts": 401,
122
+ "auth.insufficient_role": 403,
123
+ "auth.forbidden": 403,
124
+ "auth.validation": 400,
125
+ "auth.too_many_requests": 429,
126
+ "auth.untrusted_origin": 403,
127
+ "auth.reauthentication_required": 403,
128
+ "auth.invalid_invitation_token": 400,
129
+ "auth.oauth_failed": 401,
130
+ "auth.oauth_email_mismatch": 409,
131
+ "auth.platform_auth_required": 401,
132
+ "auth.internal": 500
133
+ };
94
134
 
95
135
  // src/shared/constants/routes.ts
96
136
  var AUTH_DASHBOARD_ROUTES = {
@@ -326,6 +366,7 @@ exports.AUTH_ACCESS_COOKIE_NAME = AUTH_ACCESS_COOKIE_NAME;
326
366
  exports.AUTH_DASHBOARD_ROUTES = AUTH_DASHBOARD_ROUTES;
327
367
  exports.AUTH_EMAIL_CHANGE_ROUTES = AUTH_EMAIL_CHANGE_ROUTES;
328
368
  exports.AUTH_ERROR_CODES = AUTH_ERROR_CODES;
369
+ exports.AUTH_ERROR_STATUS = AUTH_ERROR_STATUS;
329
370
  exports.AUTH_HAS_SESSION_COOKIE_NAME = AUTH_HAS_SESSION_COOKIE_NAME;
330
371
  exports.AUTH_INVITATION_ROUTES = AUTH_INVITATION_ROUTES;
331
372
  exports.AUTH_MFA_ROUTES = AUTH_MFA_ROUTES;
@@ -147,6 +147,22 @@ declare const AUTH_ERROR_CODES: {
147
147
  * compile time.
148
148
  */
149
149
  type AuthErrorCode = (typeof AUTH_ERROR_CODES)[keyof typeof AUTH_ERROR_CODES];
150
+ /**
151
+ * HTTP status each error code answers with, mirrored from the server declaration.
152
+ *
153
+ * Duplicated rather than imported for the same reason {@link AUTH_ERROR_CODES} is: this subpath
154
+ * must compile in a browser, and the server entry carries the NestJS peer dependencies. The
155
+ * drift-guard spec beside this file is the only place the two declarations meet.
156
+ *
157
+ * It lives here because the three uses the README invites — a typed client, an API document, a
158
+ * test asserting against the mapping — are exactly the ones that must not pull the server entry.
159
+ * It shipped only from there, next to a paragraph correctly saying `AUTH_ERROR_CODES` comes from
160
+ * `/shared`, so the adjacency invited the assumption that this did too.
161
+ *
162
+ * These are WIRE statuses: an internal-only code carries the status of the public code it
163
+ * collapses onto, not one of its own.
164
+ */
165
+ declare const AUTH_ERROR_STATUS: Readonly<Record<AuthErrorCode, number>>;
150
166
 
151
167
  /**
152
168
  * HTTP route paths exposed by the @bymax-one/nest-auth server controllers.
@@ -956,4 +972,4 @@ type AuthContextKind = 'dashboard' | 'platform';
956
972
  */
957
973
  type TokenDeliveryMode = 'cookie' | 'bearer';
958
974
 
959
- export { AUTH_ACCESS_COOKIE_NAME, AUTH_DASHBOARD_ROUTES, AUTH_EMAIL_CHANGE_ROUTES, AUTH_ERROR_CODES, AUTH_HAS_SESSION_COOKIE_NAME, AUTH_INVITATION_ROUTES, AUTH_MFA_ROUTES, AUTH_OAUTH_ROUTES, AUTH_PASSWORD_ROUTES, AUTH_PLATFORM_MFA_ROUTES, AUTH_PLATFORM_ROUTES, AUTH_PROXY_ROUTES, AUTH_REFRESH_COOKIE_NAME, AUTH_REFRESH_COOKIE_PATH, AUTH_REFRESH_SKIP_PATH_SUFFIXES, AUTH_ROUTES, AUTH_SESSION_ROUTES, AuthClientError, type AuthContextKind, type AuthCookieNames, type AuthErrorCode, type AuthErrorResponse, type AuthJwtPayload, type AuthPlatformUserClient, type AuthResponseCode, type AuthResult, type AuthUserClient, type DashboardJwtPayload, type LoginResult, type MfaChallengeResult, type MfaTempPayload, type PlatformAuthResult, type PlatformJwtPayload, type PlatformLoginResult, type TokenDeliveryMode, buildAuthRefreshSkipSuffixes };
975
+ export { AUTH_ACCESS_COOKIE_NAME, AUTH_DASHBOARD_ROUTES, AUTH_EMAIL_CHANGE_ROUTES, AUTH_ERROR_CODES, AUTH_ERROR_STATUS, AUTH_HAS_SESSION_COOKIE_NAME, AUTH_INVITATION_ROUTES, AUTH_MFA_ROUTES, AUTH_OAUTH_ROUTES, AUTH_PASSWORD_ROUTES, AUTH_PLATFORM_MFA_ROUTES, AUTH_PLATFORM_ROUTES, AUTH_PROXY_ROUTES, AUTH_REFRESH_COOKIE_NAME, AUTH_REFRESH_COOKIE_PATH, AUTH_REFRESH_SKIP_PATH_SUFFIXES, AUTH_ROUTES, AUTH_SESSION_ROUTES, AuthClientError, type AuthContextKind, type AuthCookieNames, type AuthErrorCode, type AuthErrorResponse, type AuthJwtPayload, type AuthPlatformUserClient, type AuthResponseCode, type AuthResult, type AuthUserClient, type DashboardJwtPayload, type LoginResult, type MfaChallengeResult, type MfaTempPayload, type PlatformAuthResult, type PlatformJwtPayload, type PlatformLoginResult, type TokenDeliveryMode, buildAuthRefreshSkipSuffixes };
@@ -147,6 +147,22 @@ declare const AUTH_ERROR_CODES: {
147
147
  * compile time.
148
148
  */
149
149
  type AuthErrorCode = (typeof AUTH_ERROR_CODES)[keyof typeof AUTH_ERROR_CODES];
150
+ /**
151
+ * HTTP status each error code answers with, mirrored from the server declaration.
152
+ *
153
+ * Duplicated rather than imported for the same reason {@link AUTH_ERROR_CODES} is: this subpath
154
+ * must compile in a browser, and the server entry carries the NestJS peer dependencies. The
155
+ * drift-guard spec beside this file is the only place the two declarations meet.
156
+ *
157
+ * It lives here because the three uses the README invites — a typed client, an API document, a
158
+ * test asserting against the mapping — are exactly the ones that must not pull the server entry.
159
+ * It shipped only from there, next to a paragraph correctly saying `AUTH_ERROR_CODES` comes from
160
+ * `/shared`, so the adjacency invited the assumption that this did too.
161
+ *
162
+ * These are WIRE statuses: an internal-only code carries the status of the public code it
163
+ * collapses onto, not one of its own.
164
+ */
165
+ declare const AUTH_ERROR_STATUS: Readonly<Record<AuthErrorCode, number>>;
150
166
 
151
167
  /**
152
168
  * HTTP route paths exposed by the @bymax-one/nest-auth server controllers.
@@ -956,4 +972,4 @@ type AuthContextKind = 'dashboard' | 'platform';
956
972
  */
957
973
  type TokenDeliveryMode = 'cookie' | 'bearer';
958
974
 
959
- export { AUTH_ACCESS_COOKIE_NAME, AUTH_DASHBOARD_ROUTES, AUTH_EMAIL_CHANGE_ROUTES, AUTH_ERROR_CODES, AUTH_HAS_SESSION_COOKIE_NAME, AUTH_INVITATION_ROUTES, AUTH_MFA_ROUTES, AUTH_OAUTH_ROUTES, AUTH_PASSWORD_ROUTES, AUTH_PLATFORM_MFA_ROUTES, AUTH_PLATFORM_ROUTES, AUTH_PROXY_ROUTES, AUTH_REFRESH_COOKIE_NAME, AUTH_REFRESH_COOKIE_PATH, AUTH_REFRESH_SKIP_PATH_SUFFIXES, AUTH_ROUTES, AUTH_SESSION_ROUTES, AuthClientError, type AuthContextKind, type AuthCookieNames, type AuthErrorCode, type AuthErrorResponse, type AuthJwtPayload, type AuthPlatformUserClient, type AuthResponseCode, type AuthResult, type AuthUserClient, type DashboardJwtPayload, type LoginResult, type MfaChallengeResult, type MfaTempPayload, type PlatformAuthResult, type PlatformJwtPayload, type PlatformLoginResult, type TokenDeliveryMode, buildAuthRefreshSkipSuffixes };
975
+ export { AUTH_ACCESS_COOKIE_NAME, AUTH_DASHBOARD_ROUTES, AUTH_EMAIL_CHANGE_ROUTES, AUTH_ERROR_CODES, AUTH_ERROR_STATUS, AUTH_HAS_SESSION_COOKIE_NAME, AUTH_INVITATION_ROUTES, AUTH_MFA_ROUTES, AUTH_OAUTH_ROUTES, AUTH_PASSWORD_ROUTES, AUTH_PLATFORM_MFA_ROUTES, AUTH_PLATFORM_ROUTES, AUTH_PROXY_ROUTES, AUTH_REFRESH_COOKIE_NAME, AUTH_REFRESH_COOKIE_PATH, AUTH_REFRESH_SKIP_PATH_SUFFIXES, AUTH_ROUTES, AUTH_SESSION_ROUTES, AuthClientError, type AuthContextKind, type AuthCookieNames, type AuthErrorCode, type AuthErrorResponse, type AuthJwtPayload, type AuthPlatformUserClient, type AuthResponseCode, type AuthResult, type AuthUserClient, type DashboardJwtPayload, type LoginResult, type MfaChallengeResult, type MfaTempPayload, type PlatformAuthResult, type PlatformJwtPayload, type PlatformLoginResult, type TokenDeliveryMode, buildAuthRefreshSkipSuffixes };
@@ -89,6 +89,46 @@ var AUTH_ERROR_CODES = {
89
89
  */
90
90
  INTERNAL: "auth.internal"
91
91
  };
92
+ var AUTH_ERROR_STATUS = {
93
+ "auth.invalid_credentials": 401,
94
+ "auth.account_locked": 429,
95
+ "auth.account_inactive": 403,
96
+ "auth.account_suspended": 403,
97
+ "auth.account_banned": 403,
98
+ "auth.pending_approval": 403,
99
+ "auth.token_expired": 401,
100
+ "auth.token_revoked": 401,
101
+ "auth.token_invalid": 401,
102
+ "auth.token_missing": 401,
103
+ "auth.refresh_token_invalid": 401,
104
+ "auth.session_not_found": 404,
105
+ "auth.email_already_exists": 409,
106
+ "auth.email_not_verified": 403,
107
+ "auth.email_change_token_invalid": 400,
108
+ "auth.mfa_required": 403,
109
+ "auth.mfa_invalid_code": 401,
110
+ "auth.mfa_already_enabled": 409,
111
+ "auth.mfa_not_enabled": 400,
112
+ "auth.mfa_setup_required": 400,
113
+ "auth.mfa_temp_token_invalid": 401,
114
+ "auth.mfa_state_conflict": 409,
115
+ "auth.password_compromised": 400,
116
+ "auth.password_reset_token_invalid": 400,
117
+ "auth.otp_invalid": 401,
118
+ "auth.otp_expired": 401,
119
+ "auth.otp_max_attempts": 401,
120
+ "auth.insufficient_role": 403,
121
+ "auth.forbidden": 403,
122
+ "auth.validation": 400,
123
+ "auth.too_many_requests": 429,
124
+ "auth.untrusted_origin": 403,
125
+ "auth.reauthentication_required": 403,
126
+ "auth.invalid_invitation_token": 400,
127
+ "auth.oauth_failed": 401,
128
+ "auth.oauth_email_mismatch": 409,
129
+ "auth.platform_auth_required": 401,
130
+ "auth.internal": 500
131
+ };
92
132
 
93
133
  // src/shared/constants/routes.ts
94
134
  var AUTH_DASHBOARD_ROUTES = {
@@ -320,4 +360,4 @@ var AuthClientError = class extends Error {
320
360
  }
321
361
  };
322
362
 
323
- export { AUTH_ACCESS_COOKIE_NAME, AUTH_DASHBOARD_ROUTES, AUTH_EMAIL_CHANGE_ROUTES, AUTH_ERROR_CODES, AUTH_HAS_SESSION_COOKIE_NAME, AUTH_INVITATION_ROUTES, AUTH_MFA_ROUTES, AUTH_OAUTH_ROUTES, AUTH_PASSWORD_ROUTES, AUTH_PLATFORM_MFA_ROUTES, AUTH_PLATFORM_ROUTES, AUTH_PROXY_ROUTES, AUTH_REFRESH_COOKIE_NAME, AUTH_REFRESH_COOKIE_PATH, AUTH_REFRESH_SKIP_PATH_SUFFIXES, AUTH_ROUTES, AUTH_SESSION_ROUTES, AuthClientError, buildAuthRefreshSkipSuffixes };
363
+ export { AUTH_ACCESS_COOKIE_NAME, AUTH_DASHBOARD_ROUTES, AUTH_EMAIL_CHANGE_ROUTES, AUTH_ERROR_CODES, AUTH_ERROR_STATUS, AUTH_HAS_SESSION_COOKIE_NAME, AUTH_INVITATION_ROUTES, AUTH_MFA_ROUTES, AUTH_OAUTH_ROUTES, AUTH_PASSWORD_ROUTES, AUTH_PLATFORM_MFA_ROUTES, AUTH_PLATFORM_ROUTES, AUTH_PROXY_ROUTES, AUTH_REFRESH_COOKIE_NAME, AUTH_REFRESH_COOKIE_PATH, AUTH_REFRESH_SKIP_PATH_SUFFIXES, AUTH_ROUTES, AUTH_SESSION_ROUTES, AuthClientError, buildAuthRefreshSkipSuffixes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bymax-one/nest-auth",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "Full-stack authentication and authorization package for NestJS, React and Next.js — JWT, MFA, OAuth, sessions, multi-tenant SaaS ready",
5
5
  "author": "Bymax One <support@bymax.one>",
6
6
  "license": "MIT",
@@ -182,10 +182,10 @@
182
182
  "@nestjs/testing": "^11.1.20",
183
183
  "@nestjs/throttler": "^6.5.0",
184
184
  "@nestjs/websockets": "^11.1.20",
185
- "@stryker-mutator/core": "^9",
186
- "@stryker-mutator/jest-runner": "^9",
187
- "@stryker-mutator/typescript-checker": "^9",
188
- "@swc/core": "1.15.47",
185
+ "@stryker-mutator/core": "^10.0.0",
186
+ "@stryker-mutator/jest-runner": "^10.0.0",
187
+ "@stryker-mutator/typescript-checker": "^10.0.0",
188
+ "@swc/core": "1.16.1",
189
189
  "@testing-library/react": "^16.3.2",
190
190
  "@types/express": "^5.0.6",
191
191
  "@types/jest": "^30.0.0",