@volontariapp/errors-nest 0.2.0 → 0.3.0-next.20260408104813

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.
@@ -0,0 +1,13 @@
1
+ import { UnauthorizedError, ForbiddenError, InternalServerError } from '@volontariapp/errors';
2
+ export declare const INVALID_INTERNAL_TOKEN: (details?: string) => UnauthorizedError;
3
+ export declare const MISSING_INTERNAL_TOKEN: () => UnauthorizedError;
4
+ export declare const INVALID_ACCESS_TOKEN: (details?: string) => UnauthorizedError;
5
+ export declare const MISSING_ACCESS_TOKEN: () => UnauthorizedError;
6
+ export declare const INVALID_REFRESH_TOKEN: (details?: string) => UnauthorizedError;
7
+ export declare const MISSING_REFRESH_TOKEN: () => UnauthorizedError;
8
+ export declare const INSUFFICIENT_PERMISSIONS: () => ForbiddenError;
9
+ export declare const MISSING_AUTHENTICATED_USER: () => ForbiddenError;
10
+ export declare const CONFIG_ERROR: (message: string) => InternalServerError;
11
+ export declare const INVALID_TOKEN_PAYLOAD: (type: string) => InternalServerError;
12
+ export declare const VERIFY_TOKEN_FAILED: (type: string, details: string) => InternalServerError;
13
+ //# sourceMappingURL=auth.errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.errors.d.ts","sourceRoot":"","sources":["../../src/errors/auth.errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE9F,eAAO,MAAM,sBAAsB,aAAc,MAAM,sBAKpD,CAAC;AAEJ,eAAO,MAAM,sBAAsB,yBAAwD,CAAC;AAE5F,eAAO,MAAM,oBAAoB,aAAc,MAAM,sBAKlD,CAAC;AAEJ,eAAO,MAAM,oBAAoB,yBAAsD,CAAC;AAExF,eAAO,MAAM,qBAAqB,aAAc,MAAM,sBAKnD,CAAC;AAEJ,eAAO,MAAM,qBAAqB,yBAAuD,CAAC;AAE1F,eAAO,MAAM,wBAAwB,sBACsC,CAAC;AAE5E,eAAO,MAAM,0BAA0B,sBAC2B,CAAC;AAEnE,eAAO,MAAM,YAAY,YAAa,MAAM,wBACW,CAAC;AAExD,eAAO,MAAM,qBAAqB,SAAU,MAAM,wBAC4B,CAAC;AAE/E,eAAO,MAAM,mBAAmB,SAAU,MAAM,WAAW,MAAM,wBAC0B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { UnauthorizedError, ForbiddenError, InternalServerError } from '@volontariapp/errors';
2
+ export const INVALID_INTERNAL_TOKEN = (details) => new UnauthorizedError(details !== undefined && details !== ''
3
+ ? `Invalid internal token: ${details}`
4
+ : 'Invalid internal token');
5
+ export const MISSING_INTERNAL_TOKEN = () => new UnauthorizedError('Missing internal token');
6
+ export const INVALID_ACCESS_TOKEN = (details) => new UnauthorizedError(details !== undefined && details !== ''
7
+ ? `Invalid access token: ${details}`
8
+ : 'Invalid access token');
9
+ export const MISSING_ACCESS_TOKEN = () => new UnauthorizedError('Missing access token');
10
+ export const INVALID_REFRESH_TOKEN = (details) => new UnauthorizedError(details !== undefined && details !== ''
11
+ ? `Invalid refresh token: ${details}`
12
+ : 'Invalid refresh token');
13
+ export const MISSING_REFRESH_TOKEN = () => new UnauthorizedError('Missing refresh token');
14
+ export const INSUFFICIENT_PERMISSIONS = () => new ForbiddenError('You do not have the required role for this resource');
15
+ export const MISSING_AUTHENTICATED_USER = () => new ForbiddenError('No authenticated user found for role check');
16
+ export const CONFIG_ERROR = (message) => new InternalServerError(message, 'AUTH_CONFIG_ERROR');
17
+ export const INVALID_TOKEN_PAYLOAD = (type) => new InternalServerError(`Invalid ${type} token payload`, 'AUTH_TOKEN_ERROR');
18
+ export const VERIFY_TOKEN_FAILED = (type, details) => new InternalServerError(`Failed to verify ${type} token: ${details}`, 'AUTH_TOKEN_ERROR');
19
+ //# sourceMappingURL=auth.errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.errors.js","sourceRoot":"","sources":["../../src/errors/auth.errors.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M,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CAC9C,IAAI,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AAExD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAE,EAAE,CACpD,IAAI,mBAAmB,CAAC,WAAW,IAAI,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE,CACnE,IAAI,mBAAmB,CAAC,oBAAoB,IAAI,WAAW,OAAO,EAAE,EAAE,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { InternalServerError } from '@volontariapp/errors';
2
+ export declare const BRIDGE_CONNECTION_FAILED: (service: string, details: string) => InternalServerError;
3
+ export declare const BRIDGE_DISCONNECTION_FAILED: (service: string, details: string) => InternalServerError;
4
+ export declare const BRIDGE_NOT_INITIALIZED: (service: string) => InternalServerError;
5
+ //# sourceMappingURL=bridge.errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge.errors.d.ts","sourceRoot":"","sources":["../../src/errors/bridge.errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,wBAAwB,YAAa,MAAM,WAAW,MAAM,wBAC0B,CAAC;AAEpG,eAAO,MAAM,2BAA2B,YAAa,MAAM,WAAW,MAAM,wBAIzE,CAAC;AAEJ,eAAO,MAAM,sBAAsB,YAAa,MAAM,wBAInD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { InternalServerError } from '@volontariapp/errors';
2
+ export const BRIDGE_CONNECTION_FAILED = (service, details) => new InternalServerError(`Failed to connect to ${service}: ${details}`, 'BRIDGE_CONNECTION_ERROR');
3
+ export const BRIDGE_DISCONNECTION_FAILED = (service, details) => new InternalServerError(`Failed to disconnect from ${service}: ${details}`, 'BRIDGE_DISCONNECTION_ERROR');
4
+ export const BRIDGE_NOT_INITIALIZED = (service) => new InternalServerError(`${service} driver not initialized. Call connect() first.`, 'BRIDGE_NOT_INITIALIZED');
5
+ //# sourceMappingURL=bridge.errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge.errors.js","sourceRoot":"","sources":["../../src/errors/bridge.errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAe,EAAE,OAAe,EAAE,EAAE,CAC3E,IAAI,mBAAmB,CAAC,wBAAwB,OAAO,KAAK,OAAO,EAAE,EAAE,yBAAyB,CAAC,CAAC;AAEpG,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,OAAe,EAAE,OAAe,EAAE,EAAE,CAC9E,IAAI,mBAAmB,CACrB,6BAA6B,OAAO,KAAK,OAAO,EAAE,EAClD,4BAA4B,CAC7B,CAAC;AAEJ,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAe,EAAE,EAAE,CACxD,IAAI,mBAAmB,CACrB,GAAG,OAAO,gDAAgD,EAC1D,wBAAwB,CACzB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './auth.errors.js';
2
+ export * from './bridge.errors.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './auth.errors.js';
2
+ export * from './bridge.errors.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ import 'reflect-metadata';
2
2
  export * from './filters/global-exception.filter.js';
3
3
  export * from './swagger/error-response.dto.js';
4
4
  export * from './swagger/api-error.decorator.js';
5
+ export * from './errors/index.js';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -2,4 +2,5 @@ import 'reflect-metadata';
2
2
  export * from './filters/global-exception.filter.js';
3
3
  export * from './swagger/error-response.dto.js';
4
4
  export * from './swagger/api-error.decorator.js';
5
+ export * from './errors/index.js';
5
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volontariapp/errors-nest",
3
- "version": "0.2.0",
3
+ "version": "0.3.0-next.20260408104813",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true