Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

#21 Enabling support for contextless endpoints. #22

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ty-ras/server-koa",
"version": "2.2.1",
"version": "2.3.0",
"author": {
"name": "Stanislav Muhametsin",
"email": "346799+stazz@users.noreply.github.com",
Expand Down Expand Up @@ -34,7 +34,7 @@
"koa": "^2.14.2"
},
"dependencies": {
"@ty-ras/server": "^2.2.1"
"@ty-ras/server": "^2.3.0"
},
"devDependencies": {
"@ava/get-port": "2.0.0",
Expand Down
3 changes: 1 addition & 2 deletions server/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file This file contains helper function to create Koa middleware callback.
*/

import type * as ep from "@ty-ras/endpoint";
import * as server from "@ty-ras/server";
import type * as koa from "koa";
import type * as context from "./context.types";
Expand All @@ -16,7 +15,7 @@ import * as internal from "./internal";
* @returns The Koa middleware which will serve the given endpoints.
*/
export const createMiddleware = <TStateInfo, TState>(
endpoints: ReadonlyArray<ep.AppEndpoint<context.ServerContext, TStateInfo>>,
endpoints: server.ServerEndpoints<context.ServerContext, TStateInfo>,
createState?: context.CreateState<TStateInfo>,
events?: server.ServerEventHandler<
server.GetContext<context.ServerContext>,
Expand Down
3 changes: 1 addition & 2 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file This file exposes function to create Node HTTP 1 or 2 server serving giving TyRAS {@link ep.AppEndpoint}s.
*/

import * as ep from "@ty-ras/endpoint";
import * as server from "@ty-ras/server";
import Koa from "koa";

Expand Down Expand Up @@ -37,7 +36,7 @@ export interface ServerCreationOptions<TStateInfo, TState> {
/**
* The TyRAS {@link ep.AppEndpoint}s to server via returned HTTP server.
*/
endpoints: ReadonlyArray<ep.AppEndpoint<ctx.ServerContext, TStateInfo>>;
endpoints: server.ServerEndpoints<ctx.ServerContext, TStateInfo>;

/**
* The callback to create endpoint-specific state objects.
Expand Down
8 changes: 4 additions & 4 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@
dependencies:
"@ty-ras/endpoint" "^2.0.0"

"@ty-ras/server@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@ty-ras/server/-/server-2.2.1.tgz#747995863d54ad828191e2cdb6f528231c24939b"
integrity sha512-Qy22YPpjcqrBP698d2Sm5LqmX39hq3aLuOngTRxKhD0kU2y4GooKgrMDCmaKkfteP/0fqoqZG4c20ukeTtPqcg==
"@ty-ras/server@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@ty-ras/server/-/server-2.3.0.tgz#f168669b29f777130823bf583341f83f0ade8ec0"
integrity sha512-0DhQqHHwyfDP2YJQhbxl+TAs4yDXKaBAVgs53+nCS0lr0M7Surc1MZ9AUeDQtcZJKc8FkWhUhUpt9aOQjZ89EA==
dependencies:
"@ty-ras/endpoint" "^2.0.0"

Expand Down
Loading