@rest-vir/run-service 0.14.0 → 0.15.1
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/handle-request/endpoint-handler.d.ts +3 -3
- package/dist/handle-request/handle-cors.d.ts +2 -2
- package/dist/handle-request/handle-endpoint.d.ts +2 -2
- package/dist/handle-request/handle-request-method.d.ts +2 -2
- package/dist/handle-request/handle-route.d.ts +2 -2
- package/dist/handle-request/handle-search-params.d.ts +1 -1
- package/dist/handle-request/handle-web-socket.d.ts +1 -1
- package/dist/handle-request/pre-handler.d.ts +1 -1
- package/dist/start-service/attach-service.d.ts +4 -4
- package/dist/start-service/start-service.d.ts +2 -2
- package/dist/test/test-endpoint.d.ts +1 -1
- package/dist/test/test-service.d.ts +5 -5
- package/package.json +10 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HttpStatus, type MaybePromise, type PartialWithUndefined } from '@augment-vir/common';
|
|
2
|
-
import {
|
|
3
|
-
import type
|
|
4
|
-
import { OutgoingHttpHeaders } from 'node:http';
|
|
2
|
+
import { type ImplementedEndpoint, type ImplementedWebSocket, type ServerRequest, type ServerResponse } from '@rest-vir/implement-service';
|
|
3
|
+
import { type FastifyReply } from 'fastify';
|
|
4
|
+
import { type OutgoingHttpHeaders } from 'node:http';
|
|
5
5
|
/**
|
|
6
6
|
* Options for `handleRoute`.
|
|
7
7
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SelectFrom } from '@augment-vir/common';
|
|
2
|
-
import { EndpointHandlerParams, HandledOutput } from './endpoint-handler.js';
|
|
1
|
+
import { type SelectFrom } from '@augment-vir/common';
|
|
2
|
+
import { type EndpointHandlerParams, type HandledOutput } from './endpoint-handler.js';
|
|
3
3
|
/**
|
|
4
4
|
* Determines the required origin for the endpoint and compares it with the given request.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ImplementedEndpoint, type RunningServerInfo } from '@rest-vir/implement-service';
|
|
2
|
-
import { EndpointHandlerParams, type HandledOutput } from './endpoint-handler.js';
|
|
1
|
+
import { type ImplementedEndpoint, type RunningServerInfo } from '@rest-vir/implement-service';
|
|
2
|
+
import { type EndpointHandlerParams, type HandledOutput } from './endpoint-handler.js';
|
|
3
3
|
/**
|
|
4
4
|
* Handles an endpoint's implementation execution.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SelectFrom } from '@augment-vir/common';
|
|
2
|
-
import {
|
|
1
|
+
import { type SelectFrom } from '@augment-vir/common';
|
|
2
|
+
import { type EndpointHandlerParams, type HandledOutput } from './endpoint-handler.js';
|
|
3
3
|
/**
|
|
4
4
|
* Verifies that a request's method matches the given endpoint's expectations. If it does not, an
|
|
5
5
|
* error response is sent.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ImplementedEndpoint, ImplementedWebSocket, RunningServerInfo, ServerRequest, ServerResponse } from '@rest-vir/implement-service';
|
|
1
|
+
import { type ImplementedEndpoint, type ImplementedWebSocket, type RunningServerInfo, type ServerRequest, type ServerResponse } from '@rest-vir/implement-service';
|
|
2
2
|
import { type WebSocket as WsWebSocket } from 'ws';
|
|
3
|
-
import { HandleRouteOptions } from './endpoint-handler.js';
|
|
3
|
+
import { type HandleRouteOptions } from './endpoint-handler.js';
|
|
4
4
|
/**
|
|
5
5
|
* Handles a WebSocket or Endpoint request.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ErrorHttpStatusCategories, type HttpStatusByCategory, type SelectFrom } from '@augment-vir/common';
|
|
2
|
-
import type
|
|
2
|
+
import { type BaseSearchParams } from '@rest-vir/define-service';
|
|
3
3
|
import { type ImplementedEndpoint, type ImplementedWebSocket, type ServerRequest } from '@rest-vir/implement-service';
|
|
4
4
|
/**
|
|
5
5
|
* Handles a request's search params and compares it against the route's required search params
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImplementedWebSocket,
|
|
1
|
+
import { type ImplementedWebSocket, type RunningServerInfo, type ServerRequest } from '@rest-vir/implement-service';
|
|
2
2
|
import { type WebSocket as WsWebSocket } from 'ws';
|
|
3
3
|
/**
|
|
4
4
|
* Handles a WebSocket request.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SelectFrom } from '@augment-vir/common';
|
|
2
|
-
import { GenericServiceImplementation, RunningServerInfo, ServerRequest, ServerResponse } from '@rest-vir/implement-service';
|
|
2
|
+
import { type GenericServiceImplementation, type RunningServerInfo, type ServerRequest, type ServerResponse } from '@rest-vir/implement-service';
|
|
3
3
|
import { type FastifyReply } from 'fastify';
|
|
4
4
|
/**
|
|
5
5
|
* Handles a request before it gets to the actual route handlers.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SelectFrom } from '@augment-vir/common';
|
|
2
|
-
import type
|
|
3
|
-
import { GenericServiceImplementation, type RunningServerInfo } from '@rest-vir/implement-service';
|
|
1
|
+
import { type SelectFrom } from '@augment-vir/common';
|
|
2
|
+
import { type BaseSearchParams, type MinimalService } from '@rest-vir/define-service';
|
|
3
|
+
import { type GenericServiceImplementation, type RunningServerInfo } from '@rest-vir/implement-service';
|
|
4
4
|
import { type FastifyInstance } from 'fastify';
|
|
5
|
-
import { HandleRouteOptions } from '../handle-request/endpoint-handler.js';
|
|
5
|
+
import { type HandleRouteOptions } from '../handle-request/endpoint-handler.js';
|
|
6
6
|
declare module 'fastify' {
|
|
7
7
|
interface FastifyRequest {
|
|
8
8
|
restVirContext: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type SelectFrom } from '@augment-vir/common';
|
|
2
|
-
import { GenericServiceImplementation } from '@rest-vir/implement-service';
|
|
2
|
+
import { type GenericServiceImplementation } from '@rest-vir/implement-service';
|
|
3
3
|
import { ClusterManager, type WorkerRunner } from 'cluster-vir';
|
|
4
4
|
import { type FastifyInstance, type FastifyPluginCallback } from 'fastify';
|
|
5
|
-
import { StartServiceUserOptions } from './start-service-options.js';
|
|
5
|
+
import { type StartServiceUserOptions } from './start-service-options.js';
|
|
6
6
|
/**
|
|
7
7
|
* Output of {@link startService}.
|
|
8
8
|
*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Overwrite, type PartialWithUndefined, type SelectFrom } from '@augment-vir/common';
|
|
2
|
-
import { ClientWebSocket, CollapsedConnectWebSocketParams, CollapsedFetchEndpointParams, EndpointDefinition, WebSocketDefinition } from '@rest-vir/define-service';
|
|
3
|
-
import { GenericServiceImplementation } from '@rest-vir/implement-service';
|
|
4
|
-
import { FastifyInstance } from 'fastify';
|
|
5
|
-
import { HandleRouteOptions } from '../handle-request/endpoint-handler.js';
|
|
6
|
-
import { StartServiceOptions, type StartServiceUserOptions } from '../start-service/start-service-options.js';
|
|
2
|
+
import { type ClientWebSocket, type CollapsedConnectWebSocketParams, type CollapsedFetchEndpointParams, type EndpointDefinition, type WebSocketDefinition } from '@rest-vir/define-service';
|
|
3
|
+
import { type GenericServiceImplementation } from '@rest-vir/implement-service';
|
|
4
|
+
import { type FastifyInstance } from 'fastify';
|
|
5
|
+
import { type HandleRouteOptions } from '../handle-request/endpoint-handler.js';
|
|
6
|
+
import { type StartServiceOptions, type StartServiceUserOptions } from '../start-service/start-service-options.js';
|
|
7
7
|
/**
|
|
8
8
|
* Options for {@link condenseResponse}.
|
|
9
9
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rest-vir/run-service",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Run a service defined by @rest-vir/define-service and implemented by @rest-vir/implement-service.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rest",
|
|
@@ -39,25 +39,25 @@
|
|
|
39
39
|
"test:update": "npm test update"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@augment-vir/assert": "^31.
|
|
43
|
-
"@augment-vir/common": "^31.
|
|
44
|
-
"@augment-vir/node": "^31.
|
|
42
|
+
"@augment-vir/assert": "^31.16.0",
|
|
43
|
+
"@augment-vir/common": "^31.16.0",
|
|
44
|
+
"@augment-vir/node": "^31.16.0",
|
|
45
45
|
"@fastify/websocket": "^11.0.2",
|
|
46
|
-
"@rest-vir/define-service": "^0.
|
|
47
|
-
"@rest-vir/implement-service": "^0.
|
|
46
|
+
"@rest-vir/define-service": "^0.15.1",
|
|
47
|
+
"@rest-vir/implement-service": "^0.15.1",
|
|
48
48
|
"cluster-vir": "^0.1.0",
|
|
49
49
|
"date-vir": "^7.3.1",
|
|
50
50
|
"fastify": "^5.3.2",
|
|
51
51
|
"light-my-request": "^6.6.0",
|
|
52
|
-
"portfinder": "^1.0.
|
|
53
|
-
"type-fest": "^4.40.
|
|
52
|
+
"portfinder": "^1.0.37",
|
|
53
|
+
"type-fest": "^4.40.1",
|
|
54
54
|
"url-vir": "^2.1.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@augment-vir/test": "^31.
|
|
57
|
+
"@augment-vir/test": "^31.16.0",
|
|
58
58
|
"@fastify/multipart": "^9.0.3",
|
|
59
59
|
"@types/connect": "^3.4.38",
|
|
60
|
-
"@types/node": "^22.
|
|
60
|
+
"@types/node": "^22.15.3",
|
|
61
61
|
"@types/ws": "^8.18.1",
|
|
62
62
|
"c8": "^10.1.3",
|
|
63
63
|
"istanbul-smart-text-reporter": "^1.1.5",
|