@rest-vir/implement-service 0.20.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -7,5 +7,6 @@ export * from './implementation/post-hook.js';
7
7
  export * from './implementation/service-context-init.js';
8
8
  export * from './util/data.js';
9
9
  export * from './util/handler.error.js';
10
+ export * from './util/reject-request.error.js';
10
11
  export * from './util/service-logger.js';
11
12
  export * from './util/types.js';
package/dist/index.js CHANGED
@@ -7,5 +7,6 @@ export * from './implementation/post-hook.js';
7
7
  export * from './implementation/service-context-init.js';
8
8
  export * from './util/data.js';
9
9
  export * from './util/handler.error.js';
10
+ export * from './util/reject-request.error.js';
10
11
  export * from './util/service-logger.js';
11
12
  export * from './util/types.js';
@@ -0,0 +1,7 @@
1
+ import { type ErrorHttpStatus } from '@augment-vir/common';
2
+ export declare class RejectRequestError extends Error {
3
+ readonly httpStatus: ErrorHttpStatus;
4
+ readonly responseErrorMessage?: string | undefined;
5
+ readonly name = "RejectRequestError";
6
+ constructor(httpStatus: ErrorHttpStatus, responseErrorMessage?: string | undefined);
7
+ }
@@ -0,0 +1,13 @@
1
+ import { assert } from '@augment-vir/assert';
2
+ import { isErrorHttpStatus } from '@augment-vir/common';
3
+ export class RejectRequestError extends Error {
4
+ httpStatus;
5
+ responseErrorMessage;
6
+ name = 'RejectRequestError';
7
+ constructor(httpStatus, responseErrorMessage) {
8
+ assert.isTrue(isErrorHttpStatus(httpStatus), `Not an error http status: ${httpStatus}.`);
9
+ super(`Request rejected with status ${httpStatus}.`);
10
+ this.httpStatus = httpStatus;
11
+ this.responseErrorMessage = responseErrorMessage;
12
+ }
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rest-vir/implement-service",
3
- "version": "0.20.1",
3
+ "version": "0.22.0",
4
4
  "description": "Implement a service defined by @rest-vir/define-service.",
5
5
  "keywords": [
6
6
  "rest",
@@ -39,21 +39,21 @@
39
39
  "test:update": "npm test update"
40
40
  },
41
41
  "dependencies": {
42
- "@augment-vir/assert": "^31.20.0",
43
- "@augment-vir/common": "^31.20.0",
44
- "@rest-vir/define-service": "^0.20.1",
42
+ "@augment-vir/assert": "^31.28.0",
43
+ "@augment-vir/common": "^31.28.0",
44
+ "@rest-vir/define-service": "^0.22.0",
45
45
  "@types/ws": "^8.18.1",
46
- "fastify": "^5.3.3",
46
+ "fastify": "^5.4.0",
47
47
  "path-to-regexp": "^8.2.0",
48
48
  "type-fest": "^4.41.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@augment-vir/test": "^31.20.0",
52
- "@types/node": "^22.15.21",
51
+ "@augment-vir/test": "^31.28.0",
52
+ "@types/node": "^24.1.0",
53
53
  "c8": "^10.1.3",
54
54
  "istanbul-smart-text-reporter": "^1.1.5",
55
55
  "markdown-code-example-inserter": "^3.0.3",
56
- "object-shape-tester": "^5.1.5"
56
+ "object-shape-tester": "^5.3.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "object-shape-tester": ">=5"