@edium/halifax 1.0.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/CHANGELOG.md +31 -0
- package/LICENSE +21 -0
- package/README.md +148 -0
- package/README_AUTH.md +172 -0
- package/README_AUTOCRUD.md +253 -0
- package/README_CACHE.md +164 -0
- package/README_HTTP_ADAPTERS.md +309 -0
- package/README_MULTITENANCY.md +162 -0
- package/README_QUERYBUILDER.md +219 -0
- package/README_REPO_ADAPTERS.md +266 -0
- package/dist/adapters/http/ExpressAdapter.d.ts +40 -0
- package/dist/adapters/http/ExpressAdapter.d.ts.map +1 -0
- package/dist/adapters/http/ExpressAdapter.js +109 -0
- package/dist/adapters/http/ExpressAdapter.js.map +1 -0
- package/dist/adapters/orm/prisma/PrismaAdapter.d.ts +143 -0
- package/dist/adapters/orm/prisma/PrismaAdapter.d.ts.map +1 -0
- package/dist/adapters/orm/prisma/PrismaAdapter.js +277 -0
- package/dist/adapters/orm/prisma/PrismaAdapter.js.map +1 -0
- package/dist/adapters/orm/prisma/createPrismaResources.d.ts +15 -0
- package/dist/adapters/orm/prisma/createPrismaResources.d.ts.map +1 -0
- package/dist/adapters/orm/prisma/createPrismaResources.js +51 -0
- package/dist/adapters/orm/prisma/createPrismaResources.js.map +1 -0
- package/dist/adapters/orm/prisma/helpers.d.ts +27 -0
- package/dist/adapters/orm/prisma/helpers.d.ts.map +1 -0
- package/dist/adapters/orm/prisma/helpers.js +45 -0
- package/dist/adapters/orm/prisma/helpers.js.map +1 -0
- package/dist/adapters/orm/prisma/index.d.ts +4 -0
- package/dist/adapters/orm/prisma/index.d.ts.map +1 -0
- package/dist/adapters/orm/prisma/index.js +3 -0
- package/dist/adapters/orm/prisma/index.js.map +1 -0
- package/dist/adapters/orm/prisma/types.d.ts +49 -0
- package/dist/adapters/orm/prisma/types.d.ts.map +1 -0
- package/dist/adapters/orm/prisma/types.js +2 -0
- package/dist/adapters/orm/prisma/types.js.map +1 -0
- package/dist/auth/AuthStrategy.d.ts +198 -0
- package/dist/auth/AuthStrategy.d.ts.map +1 -0
- package/dist/auth/AuthStrategy.js +227 -0
- package/dist/auth/AuthStrategy.js.map +1 -0
- package/dist/classes/QueryBuilder.d.ts +33 -0
- package/dist/classes/QueryBuilder.d.ts.map +1 -0
- package/dist/classes/QueryBuilder.js +262 -0
- package/dist/classes/QueryBuilder.js.map +1 -0
- package/dist/core/crudRouter.d.ts +36 -0
- package/dist/core/crudRouter.d.ts.map +1 -0
- package/dist/core/crudRouter.js +391 -0
- package/dist/core/crudRouter.js.map +1 -0
- package/dist/core/queryString.d.ts +13 -0
- package/dist/core/queryString.d.ts.map +1 -0
- package/dist/core/queryString.js +89 -0
- package/dist/core/queryString.js.map +1 -0
- package/dist/core/types.d.ts +293 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +13 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/validation.d.ts +75 -0
- package/dist/core/validation.d.ts.map +1 -0
- package/dist/core/validation.js +206 -0
- package/dist/core/validation.js.map +1 -0
- package/dist/enums/SqlComparison.d.ts +18 -0
- package/dist/enums/SqlComparison.d.ts.map +1 -0
- package/dist/enums/SqlComparison.js +19 -0
- package/dist/enums/SqlComparison.js.map +1 -0
- package/dist/enums/SqlOperator.d.ts +6 -0
- package/dist/enums/SqlOperator.d.ts.map +1 -0
- package/dist/enums/SqlOperator.js +7 -0
- package/dist/enums/SqlOperator.js.map +1 -0
- package/dist/enums/SqlOrder.d.ts +6 -0
- package/dist/enums/SqlOrder.d.ts.map +1 -0
- package/dist/enums/SqlOrder.js +7 -0
- package/dist/enums/SqlOrder.js.map +1 -0
- package/dist/errors/AuthenticationError.d.ts +10 -0
- package/dist/errors/AuthenticationError.d.ts.map +1 -0
- package/dist/errors/AuthenticationError.js +13 -0
- package/dist/errors/AuthenticationError.js.map +1 -0
- package/dist/errors/AuthorizationError.d.ts +10 -0
- package/dist/errors/AuthorizationError.d.ts.map +1 -0
- package/dist/errors/AuthorizationError.js +13 -0
- package/dist/errors/AuthorizationError.js.map +1 -0
- package/dist/errors/BadRequestError.d.ts +10 -0
- package/dist/errors/BadRequestError.d.ts.map +1 -0
- package/dist/errors/BadRequestError.js +13 -0
- package/dist/errors/BadRequestError.js.map +1 -0
- package/dist/errors/HttpError.d.ts +12 -0
- package/dist/errors/HttpError.d.ts.map +1 -0
- package/dist/errors/HttpError.js +17 -0
- package/dist/errors/HttpError.js.map +1 -0
- package/dist/errors/MethodNotAllowedError.d.ts +10 -0
- package/dist/errors/MethodNotAllowedError.d.ts.map +1 -0
- package/dist/errors/MethodNotAllowedError.js +13 -0
- package/dist/errors/MethodNotAllowedError.js.map +1 -0
- package/dist/errors/NotAcceptableError.d.ts +10 -0
- package/dist/errors/NotAcceptableError.d.ts.map +1 -0
- package/dist/errors/NotAcceptableError.js +13 -0
- package/dist/errors/NotAcceptableError.js.map +1 -0
- package/dist/errors/NotFoundError.d.ts +10 -0
- package/dist/errors/NotFoundError.d.ts.map +1 -0
- package/dist/errors/NotFoundError.js +13 -0
- package/dist/errors/NotFoundError.js.map +1 -0
- package/dist/errors/NotImplementedError.d.ts +10 -0
- package/dist/errors/NotImplementedError.d.ts.map +1 -0
- package/dist/errors/NotImplementedError.js +13 -0
- package/dist/errors/NotImplementedError.js.map +1 -0
- package/dist/errors/ServerError.d.ts +10 -0
- package/dist/errors/ServerError.d.ts.map +1 -0
- package/dist/errors/ServerError.js +13 -0
- package/dist/errors/ServerError.js.map +1 -0
- package/dist/errors/UnprocessableEntityError.d.ts +10 -0
- package/dist/errors/UnprocessableEntityError.d.ts.map +1 -0
- package/dist/errors/UnprocessableEntityError.js +13 -0
- package/dist/errors/UnprocessableEntityError.js.map +1 -0
- package/dist/errors/UnsupportedMediaTypeError.d.ts +10 -0
- package/dist/errors/UnsupportedMediaTypeError.d.ts.map +1 -0
- package/dist/errors/UnsupportedMediaTypeError.js +13 -0
- package/dist/errors/UnsupportedMediaTypeError.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/IParamQuery.d.ts +8 -0
- package/dist/interfaces/IParamQuery.d.ts.map +1 -0
- package/dist/interfaces/IParamQuery.js +2 -0
- package/dist/interfaces/IParamQuery.js.map +1 -0
- package/dist/interfaces/IQueryFilter.d.ts +18 -0
- package/dist/interfaces/IQueryFilter.d.ts.map +1 -0
- package/dist/interfaces/IQueryFilter.js +2 -0
- package/dist/interfaces/IQueryFilter.js.map +1 -0
- package/dist/interfaces/IQueryOptions.d.ts +20 -0
- package/dist/interfaces/IQueryOptions.d.ts.map +1 -0
- package/dist/interfaces/IQueryOptions.js +2 -0
- package/dist/interfaces/IQueryOptions.js.map +1 -0
- package/dist/interfaces/ISort.d.ts +9 -0
- package/dist/interfaces/ISort.d.ts.map +1 -0
- package/dist/interfaces/ISort.js +2 -0
- package/dist/interfaces/ISort.js.map +1 -0
- package/package.json +169 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** SQL comparison operators used in query-builder WHERE clauses. */
|
|
2
|
+
export var SqlComparison;
|
|
3
|
+
(function (SqlComparison) {
|
|
4
|
+
SqlComparison["Between"] = "BETWEEN";
|
|
5
|
+
SqlComparison["Equal"] = "=";
|
|
6
|
+
SqlComparison["GreaterThan"] = ">";
|
|
7
|
+
SqlComparison["GreaterThanOrEqual"] = ">=";
|
|
8
|
+
SqlComparison["In"] = "IN";
|
|
9
|
+
SqlComparison["IsNotNull"] = "IS NOT NULL";
|
|
10
|
+
SqlComparison["IsNull"] = "IS NULL";
|
|
11
|
+
SqlComparison["LessThan"] = "<";
|
|
12
|
+
SqlComparison["LessThanOrEqual"] = "<=";
|
|
13
|
+
SqlComparison["Like"] = "LIKE";
|
|
14
|
+
SqlComparison["NotBetween"] = "NOT BETWEEN";
|
|
15
|
+
SqlComparison["NotEqual"] = "<>";
|
|
16
|
+
SqlComparison["NotIn"] = "NOT IN";
|
|
17
|
+
SqlComparison["NotLike"] = "NOT LIKE";
|
|
18
|
+
})(SqlComparison || (SqlComparison = {}));
|
|
19
|
+
//# sourceMappingURL=SqlComparison.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqlComparison.js","sourceRoot":"","sources":["../../src/enums/SqlComparison.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,CAAN,IAAY,aAeX;AAfD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,4BAAW,CAAA;IACX,kCAAiB,CAAA;IACjB,0CAAyB,CAAA;IACzB,0BAAS,CAAA;IACT,0CAAyB,CAAA;IACzB,mCAAkB,CAAA;IAClB,+BAAc,CAAA;IACd,uCAAsB,CAAA;IACtB,8BAAa,CAAA;IACb,2CAA0B,CAAA;IAC1B,gCAAe,CAAA;IACf,iCAAgB,CAAA;IAChB,qCAAoB,CAAA;AACtB,CAAC,EAfW,aAAa,KAAb,aAAa,QAexB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqlOperator.d.ts","sourceRoot":"","sources":["../../src/enums/SqlOperator.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,EAAE,OAAO;CACV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqlOperator.js","sourceRoot":"","sources":["../../src/enums/SqlOperator.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,0BAAW,CAAA;IACX,wBAAS,CAAA;AACX,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqlOrder.d.ts","sourceRoot":"","sources":["../../src/enums/SqlOrder.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,oBAAY,QAAQ;IAClB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqlOrder.js","sourceRoot":"","sources":["../../src/enums/SqlOrder.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,yBAAa,CAAA;AACf,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when a request cannot be authenticated (HTTP 401). */
|
|
3
|
+
export declare class AuthenticationError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Unauthorized'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=AuthenticationError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationError.d.ts","sourceRoot":"","sources":["../../src/errors/AuthenticationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,gEAAgE;AAChE,qBAAa,mBAAoB,SAAQ,SAAS;IAChD;;;OAGG;gBACgB,OAAO,SAAiB,EAAE,OAAO,CAAC,EAAE,OAAO;CAI/D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when a request cannot be authenticated (HTTP 401). */
|
|
3
|
+
export class AuthenticationError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Unauthorized'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Unauthorized', details) {
|
|
9
|
+
super(message, 401, details);
|
|
10
|
+
this.name = 'AuthenticationError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=AuthenticationError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationError.js","sourceRoot":"","sources":["../../src/errors/AuthenticationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,gEAAgE;AAChE,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAChD;;;OAGG;IACH,YAAmB,OAAO,GAAG,cAAc,EAAE,OAAiB;QAC5D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAA;IACnC,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when an authenticated user lacks permission for an action (HTTP 403). */
|
|
3
|
+
export declare class AuthorizationError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Forbidden'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=AuthorizationError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorizationError.d.ts","sourceRoot":"","sources":["../../src/errors/AuthorizationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,mFAAmF;AACnF,qBAAa,kBAAmB,SAAQ,SAAS;IAC/C;;;OAGG;gBACgB,OAAO,SAAc,EAAE,OAAO,CAAC,EAAE,OAAO;CAI5D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when an authenticated user lacks permission for an action (HTTP 403). */
|
|
3
|
+
export class AuthorizationError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Forbidden'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Forbidden', details) {
|
|
9
|
+
super(message, 403, details);
|
|
10
|
+
this.name = 'AuthorizationError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=AuthorizationError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorizationError.js","sourceRoot":"","sources":["../../src/errors/AuthorizationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,mFAAmF;AACnF,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C;;;OAGG;IACH,YAAmB,OAAO,GAAG,WAAW,EAAE,OAAiB;QACzD,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAA;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when the request is malformed or contains invalid input (HTTP 400). */
|
|
3
|
+
export declare class BadRequestError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Bad Request'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=BadRequestError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadRequestError.d.ts","sourceRoot":"","sources":["../../src/errors/BadRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,iFAAiF;AACjF,qBAAa,eAAgB,SAAQ,SAAS;IAC5C;;;OAGG;gBACgB,OAAO,SAAgB,EAAE,OAAO,CAAC,EAAE,OAAO;CAI9D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when the request is malformed or contains invalid input (HTTP 400). */
|
|
3
|
+
export class BadRequestError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Bad Request'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Bad Request', details) {
|
|
9
|
+
super(message, 400, details);
|
|
10
|
+
this.name = 'BadRequestError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=BadRequestError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadRequestError.js","sourceRoot":"","sources":["../../src/errors/BadRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,iFAAiF;AACjF,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C;;;OAGG;IACH,YAAmB,OAAO,GAAG,aAAa,EAAE,OAAiB;QAC3D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAA;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Base class for all HTTP errors. Carries a status code and optional structured details. */
|
|
2
|
+
export declare abstract class HttpError extends Error {
|
|
3
|
+
readonly status: number;
|
|
4
|
+
readonly details?: unknown;
|
|
5
|
+
/**
|
|
6
|
+
* @param message - Human-readable error description included in the response body.
|
|
7
|
+
* @param status - HTTP status code sent to the client.
|
|
8
|
+
* @param details - Optional structured details attached to the response body.
|
|
9
|
+
*/
|
|
10
|
+
constructor(message: string, status: number, details?: unknown);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=HttpError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpError.d.ts","sourceRoot":"","sources":["../../src/errors/HttpError.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,8BAAsB,SAAU,SAAQ,KAAK;IAC3C,SAAgB,MAAM,EAAE,MAAM,CAAA;IAC9B,SAAgB,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjC;;;;OAIG;gBACgB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;CAMtE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Base class for all HTTP errors. Carries a status code and optional structured details. */
|
|
2
|
+
export class HttpError extends Error {
|
|
3
|
+
status;
|
|
4
|
+
details;
|
|
5
|
+
/**
|
|
6
|
+
* @param message - Human-readable error description included in the response body.
|
|
7
|
+
* @param status - HTTP status code sent to the client.
|
|
8
|
+
* @param details - Optional structured details attached to the response body.
|
|
9
|
+
*/
|
|
10
|
+
constructor(message, status, details) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'HttpError';
|
|
13
|
+
this.status = status;
|
|
14
|
+
this.details = details;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=HttpError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../src/errors/HttpError.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,MAAM,OAAgB,SAAU,SAAQ,KAAK;IAC3B,MAAM,CAAQ;IACd,OAAO,CAAU;IAEjC;;;;OAIG;IACH,YAAmB,OAAe,EAAE,MAAc,EAAE,OAAiB;QACnE,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,WAAW,CAAA;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when the HTTP method is not permitted on this route (HTTP 405). */
|
|
3
|
+
export declare class MethodNotAllowedError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Method Not Allowed'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=MethodNotAllowedError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MethodNotAllowedError.d.ts","sourceRoot":"","sources":["../../src/errors/MethodNotAllowedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,6EAA6E;AAC7E,qBAAa,qBAAsB,SAAQ,SAAS;IAClD;;;OAGG;gBACgB,OAAO,SAAuB,EAAE,OAAO,CAAC,EAAE,OAAO;CAIrE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when the HTTP method is not permitted on this route (HTTP 405). */
|
|
3
|
+
export class MethodNotAllowedError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Method Not Allowed'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Method Not Allowed', details) {
|
|
9
|
+
super(message, 405, details);
|
|
10
|
+
this.name = 'MethodNotAllowedError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=MethodNotAllowedError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MethodNotAllowedError.js","sourceRoot":"","sources":["../../src/errors/MethodNotAllowedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,6EAA6E;AAC7E,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAClD;;;OAGG;IACH,YAAmB,OAAO,GAAG,oBAAoB,EAAE,OAAiB;QAClE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAA;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when the client's Accept header cannot be satisfied (HTTP 406). */
|
|
3
|
+
export declare class NotAcceptableError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Not Acceptable'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=NotAcceptableError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotAcceptableError.d.ts","sourceRoot":"","sources":["../../src/errors/NotAcceptableError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,6EAA6E;AAC7E,qBAAa,kBAAmB,SAAQ,SAAS;IAC/C;;;OAGG;gBACgB,OAAO,SAAmB,EAAE,OAAO,CAAC,EAAE,OAAO;CAIjE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when the client's Accept header cannot be satisfied (HTTP 406). */
|
|
3
|
+
export class NotAcceptableError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Not Acceptable'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Not Acceptable', details) {
|
|
9
|
+
super(message, 406, details);
|
|
10
|
+
this.name = 'NotAcceptableError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=NotAcceptableError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotAcceptableError.js","sourceRoot":"","sources":["../../src/errors/NotAcceptableError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,6EAA6E;AAC7E,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C;;;OAGG;IACH,YAAmB,OAAO,GAAG,gBAAgB,EAAE,OAAiB;QAC9D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAA;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when a requested resource does not exist (HTTP 404). */
|
|
3
|
+
export declare class NotFoundError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Not Found'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=NotFoundError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotFoundError.d.ts","sourceRoot":"","sources":["../../src/errors/NotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,kEAAkE;AAClE,qBAAa,aAAc,SAAQ,SAAS;IAC1C;;;OAGG;gBACgB,OAAO,SAAc,EAAE,OAAO,CAAC,EAAE,OAAO;CAI5D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when a requested resource does not exist (HTTP 404). */
|
|
3
|
+
export class NotFoundError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Not Found'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Not Found', details) {
|
|
9
|
+
super(message, 404, details);
|
|
10
|
+
this.name = 'NotFoundError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=NotFoundError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotFoundError.js","sourceRoot":"","sources":["../../src/errors/NotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,kEAAkE;AAClE,MAAM,OAAO,aAAc,SAAQ,SAAS;IAC1C;;;OAGG;IACH,YAAmB,OAAO,GAAG,WAAW,EAAE,OAAiB;QACzD,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when a repository method or feature is not supported by the current adapter (HTTP 501). */
|
|
3
|
+
export declare class NotImplementedError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Not Implemented'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=NotImplementedError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotImplementedError.d.ts","sourceRoot":"","sources":["../../src/errors/NotImplementedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,qGAAqG;AACrG,qBAAa,mBAAoB,SAAQ,SAAS;IAChD;;;OAGG;gBACgB,OAAO,SAAoB,EAAE,OAAO,CAAC,EAAE,OAAO;CAIlE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when a repository method or feature is not supported by the current adapter (HTTP 501). */
|
|
3
|
+
export class NotImplementedError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Not Implemented'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Not Implemented', details) {
|
|
9
|
+
super(message, 501, details);
|
|
10
|
+
this.name = 'NotImplementedError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=NotImplementedError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotImplementedError.js","sourceRoot":"","sources":["../../src/errors/NotImplementedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,qGAAqG;AACrG,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAChD;;;OAGG;IACH,YAAmB,OAAO,GAAG,iBAAiB,EAAE,OAAiB;QAC/D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAA;IACnC,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown for unexpected internal failures (HTTP 500). */
|
|
3
|
+
export declare class ServerError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Server error'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ServerError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerError.d.ts","sourceRoot":"","sources":["../../src/errors/ServerError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,0DAA0D;AAC1D,qBAAa,WAAY,SAAQ,SAAS;IACxC;;;OAGG;gBACgB,OAAO,SAAiB,EAAE,OAAO,CAAC,EAAE,OAAO;CAI/D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown for unexpected internal failures (HTTP 500). */
|
|
3
|
+
export class ServerError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Server error'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Server error', details) {
|
|
9
|
+
super(message, 500, details);
|
|
10
|
+
this.name = 'ServerError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ServerError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerError.js","sourceRoot":"","sources":["../../src/errors/ServerError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,0DAA0D;AAC1D,MAAM,OAAO,WAAY,SAAQ,SAAS;IACxC;;;OAGG;IACH,YAAmB,OAAO,GAAG,cAAc,EAAE,OAAiB;QAC5D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when request syntax is valid but the content fails business validation (HTTP 422). */
|
|
3
|
+
export declare class UnprocessableEntityError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Unprocessable Entity'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=UnprocessableEntityError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnprocessableEntityError.d.ts","sourceRoot":"","sources":["../../src/errors/UnprocessableEntityError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,gGAAgG;AAChG,qBAAa,wBAAyB,SAAQ,SAAS;IACrD;;;OAGG;gBACgB,OAAO,SAAyB,EAAE,OAAO,CAAC,EAAE,OAAO;CAIvE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when request syntax is valid but the content fails business validation (HTTP 422). */
|
|
3
|
+
export class UnprocessableEntityError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Unprocessable Entity'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Unprocessable Entity', details) {
|
|
9
|
+
super(message, 422, details);
|
|
10
|
+
this.name = 'UnprocessableEntityError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=UnprocessableEntityError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnprocessableEntityError.js","sourceRoot":"","sources":["../../src/errors/UnprocessableEntityError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,gGAAgG;AAChG,MAAM,OAAO,wBAAyB,SAAQ,SAAS;IACrD;;;OAGG;IACH,YAAmB,OAAO,GAAG,sBAAsB,EAAE,OAAiB;QACpE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAA;IACxC,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when the request body Content-Type is not application/json (HTTP 415). */
|
|
3
|
+
export declare class UnsupportedMediaTypeError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Unsupported Media Type'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message?: string, details?: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=UnsupportedMediaTypeError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedMediaTypeError.d.ts","sourceRoot":"","sources":["../../src/errors/UnsupportedMediaTypeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,oFAAoF;AACpF,qBAAa,yBAA0B,SAAQ,SAAS;IACtD;;;OAGG;gBACgB,OAAO,SAA2B,EAAE,OAAO,CAAC,EAAE,OAAO;CAIzE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpError } from './HttpError.js';
|
|
2
|
+
/** Thrown when the request body Content-Type is not application/json (HTTP 415). */
|
|
3
|
+
export class UnsupportedMediaTypeError extends HttpError {
|
|
4
|
+
/**
|
|
5
|
+
* @param message - Human-readable error description (default: `'Unsupported Media Type'`).
|
|
6
|
+
* @param details - Optional structured details attached to the response body.
|
|
7
|
+
*/
|
|
8
|
+
constructor(message = 'Unsupported Media Type', details) {
|
|
9
|
+
super(message, 415, details);
|
|
10
|
+
this.name = 'UnsupportedMediaTypeError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=UnsupportedMediaTypeError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedMediaTypeError.js","sourceRoot":"","sources":["../../src/errors/UnsupportedMediaTypeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,oFAAoF;AACpF,MAAM,OAAO,yBAA0B,SAAQ,SAAS;IACtD;;;OAGG;IACH,YAAmB,OAAO,GAAG,wBAAwB,EAAE,OAAiB;QACtE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAA;IACzC,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './adapters/http/ExpressAdapter.js';
|
|
2
|
+
export * from './adapters/orm/prisma/index.js';
|
|
3
|
+
export * from './auth/AuthStrategy.js';
|
|
4
|
+
export * from './core/crudRouter.js';
|
|
5
|
+
export * from './core/queryString.js';
|
|
6
|
+
export * from './core/types.js';
|
|
7
|
+
export * from './core/validation.js';
|
|
8
|
+
export * from './classes/QueryBuilder.js';
|
|
9
|
+
export * from './enums/SqlComparison.js';
|
|
10
|
+
export * from './enums/SqlOperator.js';
|
|
11
|
+
export * from './enums/SqlOrder.js';
|
|
12
|
+
export * from './errors/AuthenticationError.js';
|
|
13
|
+
export * from './errors/AuthorizationError.js';
|
|
14
|
+
export * from './errors/BadRequestError.js';
|
|
15
|
+
export * from './errors/HttpError.js';
|
|
16
|
+
export * from './errors/MethodNotAllowedError.js';
|
|
17
|
+
export * from './errors/NotAcceptableError.js';
|
|
18
|
+
export * from './errors/NotFoundError.js';
|
|
19
|
+
export * from './errors/NotImplementedError.js';
|
|
20
|
+
export * from './errors/ServerError.js';
|
|
21
|
+
export * from './errors/UnprocessableEntityError.js';
|
|
22
|
+
export * from './errors/UnsupportedMediaTypeError.js';
|
|
23
|
+
export * from './interfaces/IParamQuery.js';
|
|
24
|
+
export * from './interfaces/IQueryFilter.js';
|
|
25
|
+
export * from './interfaces/IQueryOptions.js';
|
|
26
|
+
export * from './interfaces/ISort.js';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,2BAA2B,CAAA;AACzC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yBAAyB,CAAA;AACvC,cAAc,sCAAsC,CAAA;AACpD,cAAc,uCAAuC,CAAA;AACrD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './adapters/http/ExpressAdapter.js';
|
|
2
|
+
export * from './adapters/orm/prisma/index.js';
|
|
3
|
+
export * from './auth/AuthStrategy.js';
|
|
4
|
+
export * from './core/crudRouter.js';
|
|
5
|
+
export * from './core/queryString.js';
|
|
6
|
+
export * from './core/types.js';
|
|
7
|
+
export * from './core/validation.js';
|
|
8
|
+
export * from './classes/QueryBuilder.js';
|
|
9
|
+
export * from './enums/SqlComparison.js';
|
|
10
|
+
export * from './enums/SqlOperator.js';
|
|
11
|
+
export * from './enums/SqlOrder.js';
|
|
12
|
+
export * from './errors/AuthenticationError.js';
|
|
13
|
+
export * from './errors/AuthorizationError.js';
|
|
14
|
+
export * from './errors/BadRequestError.js';
|
|
15
|
+
export * from './errors/HttpError.js';
|
|
16
|
+
export * from './errors/MethodNotAllowedError.js';
|
|
17
|
+
export * from './errors/NotAcceptableError.js';
|
|
18
|
+
export * from './errors/NotFoundError.js';
|
|
19
|
+
export * from './errors/NotImplementedError.js';
|
|
20
|
+
export * from './errors/ServerError.js';
|
|
21
|
+
export * from './errors/UnprocessableEntityError.js';
|
|
22
|
+
export * from './errors/UnsupportedMediaTypeError.js';
|
|
23
|
+
export * from './interfaces/IParamQuery.js';
|
|
24
|
+
export * from './interfaces/IQueryFilter.js';
|
|
25
|
+
export * from './interfaces/IQueryOptions.js';
|
|
26
|
+
export * from './interfaces/ISort.js';
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,2BAA2B,CAAA;AACzC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yBAAyB,CAAA;AACvC,cAAc,sCAAsC,CAAA;AACpD,cAAc,uCAAuC,CAAA;AACrD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** A compiled SQL statement with its positional parameters. */
|
|
2
|
+
export interface IParamQuery {
|
|
3
|
+
/** The SQL string with `$1`, `$2`, … placeholders. */
|
|
4
|
+
statement: string;
|
|
5
|
+
/** Values bound to each placeholder in order. */
|
|
6
|
+
parameters: unknown[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=IParamQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IParamQuery.d.ts","sourceRoot":"","sources":["../../src/interfaces/IParamQuery.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAA;IACjB,iDAAiD;IACjD,UAAU,EAAE,OAAO,EAAE,CAAA;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IParamQuery.js","sourceRoot":"","sources":["../../src/interfaces/IParamQuery.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Scalar types accepted as filter values. */
|
|
2
|
+
export type QueryScalar = string | number | boolean | null;
|
|
3
|
+
/** A single condition in a WHERE clause, optionally containing nested child conditions. */
|
|
4
|
+
export interface IQueryFilter {
|
|
5
|
+
/** The {@link SqlComparison} operator (e.g. `'='`, `'LIKE'`). */
|
|
6
|
+
comparison: string;
|
|
7
|
+
/** Column name to filter on. */
|
|
8
|
+
field: string;
|
|
9
|
+
/** {@link SqlOperator} joining this condition to the next sibling (`'AND'` | `'OR'`). */
|
|
10
|
+
operator?: string;
|
|
11
|
+
/** Primary value (or array of values for `IN` / `NOT IN`). */
|
|
12
|
+
value1?: QueryScalar | QueryScalar[];
|
|
13
|
+
/** Secondary value for range comparisons (`BETWEEN`, `NOT BETWEEN`). */
|
|
14
|
+
value2?: QueryScalar | QueryScalar[];
|
|
15
|
+
/** Nested sub-conditions grouped in parentheses. */
|
|
16
|
+
children?: IQueryFilter[];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=IQueryFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IQueryFilter.d.ts","sourceRoot":"","sources":["../../src/interfaces/IQueryFilter.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAE1D,2FAA2F;AAC3F,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAA;IACpC,wEAAwE;IACxE,MAAM,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAA;IACpC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IQueryFilter.js","sourceRoot":"","sources":["../../src/interfaces/IQueryFilter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IQueryFilter } from '../interfaces/IQueryFilter.js';
|
|
2
|
+
import type { ISort } from '../interfaces/ISort.js';
|
|
3
|
+
/** Options passed to the query builder to construct a SELECT, UPDATE, or DELETE statement. */
|
|
4
|
+
export interface IQueryOptions {
|
|
5
|
+
/** When true, adds DISTINCT to the SELECT clause. */
|
|
6
|
+
isDistinct?: boolean;
|
|
7
|
+
/** Maximum number of rows to return (FETCH NEXT n ROWS ONLY). */
|
|
8
|
+
limit?: number;
|
|
9
|
+
/** Number of rows to skip (OFFSET n ROWS). */
|
|
10
|
+
offset?: number;
|
|
11
|
+
/** Columns to include in the SELECT clause; omit for `*`. */
|
|
12
|
+
fields?: string[];
|
|
13
|
+
/** Target table name. Required unless set on the adapter. */
|
|
14
|
+
tableName?: string;
|
|
15
|
+
/** WHERE conditions. */
|
|
16
|
+
where?: IQueryFilter[];
|
|
17
|
+
/** ORDER BY expressions. */
|
|
18
|
+
orderBy?: ISort[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=IQueryOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IQueryOptions.d.ts","sourceRoot":"","sources":["../../src/interfaces/IQueryOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAElD,8FAA8F;AAC9F,MAAM,WAAW,aAAa;IAC5B,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wBAAwB;IACxB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAA;IACtB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,KAAK,EAAE,CAAA;CAClB"}
|