@phreshos/server 0.1.23 → 0.1.25
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/domain.d.ts +3 -3
- package/dist/main.d.ts +3 -3
- package/dist/main.js +2 -2
- package/dist/service.d.ts +9 -9
- package/dist/service.js +5 -5
- package/package.json +3 -3
package/dist/domain.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Client as CoreClient, Endpoint as CoreEndpoint, Process as CoreProcess,
|
|
|
2
2
|
import Events from "./events.js";
|
|
3
3
|
import { type Storage } from "./storage.js";
|
|
4
4
|
import { type ProgramStartup } from "./startup.js";
|
|
5
|
-
import { type
|
|
5
|
+
import { type ClientService, type ServerService } from "./service.js";
|
|
6
6
|
export interface HandleAddress {
|
|
7
7
|
identity: string;
|
|
8
8
|
reference: string;
|
|
@@ -115,7 +115,7 @@ export interface Server<Events extends object = {}> extends CoreServer<Events> {
|
|
|
115
115
|
/** Returns the Process that owns this Server. */
|
|
116
116
|
process(): Promise<Process>;
|
|
117
117
|
/** Returns the Service currently exposed by this Server Endpoint. */
|
|
118
|
-
service<ServiceEvents extends object = {}>(): Promise<
|
|
118
|
+
service<ServiceEvents extends object = {}>(): Promise<ServerService<ServiceEvents> | null>;
|
|
119
119
|
}
|
|
120
120
|
/** Server-visible Client handle. */
|
|
121
121
|
export interface Client<Events extends object = {}> extends CoreClient<Events> {
|
|
@@ -124,7 +124,7 @@ export interface Client<Events extends object = {}> extends CoreClient<Events> {
|
|
|
124
124
|
/** Returns the Process that owns this Client. */
|
|
125
125
|
process(): Promise<Process>;
|
|
126
126
|
/** Returns the Service currently exposed by this Client Endpoint. */
|
|
127
|
-
service<ServiceEvents extends object = {}>(): Promise<
|
|
127
|
+
service<ServiceEvents extends object = {}>(): Promise<ClientService<ServiceEvents> | null>;
|
|
128
128
|
}
|
|
129
129
|
/** Server-visible Client-owned Window capability. */
|
|
130
130
|
export type Window = CoreWindow;
|
package/dist/main.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { current, type Current, type CurrentClient } from "./current.js";
|
|
|
3
3
|
export { type Answerer, type Channel, type ChannelCapture, type ChannelEvents, type ChannelMessage } from "./channel.js";
|
|
4
4
|
export { type ProgramStartup } from "./startup.js";
|
|
5
5
|
export { type Storage } from "./storage.js";
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
6
|
+
export { ClientService, ServerService } from "./service.js";
|
|
7
|
+
export { Service, type ClientServiceChannel, type ServerServiceChannel, type ServiceChannel, type ServiceKey, type ServiceLifecycleEvents } from "@phreshos/core";
|
|
8
8
|
export { Client, Endpoint, Process, Program, Server, type Window, type ProgramProcess, type ProgramProcessRunEvent, type ProgramProcessRunOptions } from "./domain.js";
|
|
9
|
-
export type { AnswerCapture, AnswerMessage, AnswerObserver, Askable, AskCapture, AskMessage, AskObserver, Capture, Captures, ClientTraffic, ClientDeclaration, Cleanup, DirectoryStat, EndpointDeclaration, EndpointTraffic, EntryStat, EventMessage, EventName, EventObserver, EventOptions, EventSubscriber, Exit, FileStat, Launch, LaunchClient, Layer, LogKind, LogRecord, LogSource, Message, OtherStat, Outcome, Position, ProgramEvents, ProgramPermission, ProgramProcessEvents, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, SystemUploads, Upload, ServerTraffic, System, SystemProcess, SystemProcessEntity, SystemProcessEntityEvents, SystemProgram, SystemProgramEntity, SystemProgramProcess, SystemProgramProcessEvents, SystemEndpointEntity, SystemServerEntity, SystemClientEntity,
|
|
9
|
+
export type { AnswerCapture, AnswerMessage, AnswerObserver, Askable, AskCapture, AskMessage, AskObserver, Capture, Captures, ClientTraffic, ClientDeclaration, Cleanup, DirectoryStat, EndpointDeclaration, EndpointTraffic, EntryStat, EventMessage, EventName, EventObserver, EventOptions, EventSubscriber, Exit, FileStat, Launch, LaunchClient, Layer, LogKind, LogRecord, LogSource, Message, OtherStat, Outcome, Position, ProgramEvents, ProgramPermission, ProgramProcessEvents, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, SystemUploads, Upload, ServerTraffic, System, SystemProcess, SystemProcessEntity, SystemProcessEntityEvents, SystemProgram, SystemProgramEntity, SystemProgramProcess, SystemProgramProcessEvents, SystemEndpointEntity, SystemServerEntity, SystemClientEntity, ClientDefinition, SystemProcessEvents, SystemProcessExit, SystemProgramEvents, SystemProgramUninstall, ProgramDefinition, ServerDefinition, Size, Subscribable, SubscribableEvents, SubscribableFallback, TimedAskable, TrafficCapture, TrafficEvents, TrafficMessage, Value, Appearance, AppearanceEvents, AppearanceSource, AppearanceSurface, ThemedValue, WritableAppearance, WindowEvents, WindowGeometry, WindowLayer, WindowState } from "@phreshos/core";
|
package/dist/main.js
CHANGED
|
@@ -3,6 +3,6 @@ export { current } from "./current.js";
|
|
|
3
3
|
export {} from "./channel.js";
|
|
4
4
|
export {} from "./startup.js";
|
|
5
5
|
export {} from "./storage.js";
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
6
|
+
export { ClientService, ServerService } from "./service.js";
|
|
7
|
+
export { Service } from "@phreshos/core";
|
|
8
8
|
export { Client, Endpoint, Process, Program, Server } from "./domain.js";
|
package/dist/service.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClientService as CoreClientService, ServerService as CoreServerService, type Service, type ServiceKey } from "@phreshos/core";
|
|
2
2
|
import type { HandleAddress } from "./domain.js";
|
|
3
3
|
/** Server-SDK handle for a Service provided by a Server Endpoint. */
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class ServerService<Events extends object = {}> extends CoreServerService<Events> {
|
|
5
5
|
protected constructor();
|
|
6
6
|
}
|
|
7
7
|
/** Server-SDK handle for a Service provided by a Client Endpoint. */
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class ClientService<Events extends object = {}> extends CoreClientService<Events> {
|
|
9
9
|
protected constructor();
|
|
10
10
|
}
|
|
11
11
|
export declare function prepareService<EventsMap extends object = {}>(key: ServiceKey & {
|
|
12
12
|
endpoint: "server";
|
|
13
|
-
}):
|
|
13
|
+
}): ServerService<EventsMap>;
|
|
14
14
|
export declare function prepareService<EventsMap extends object = {}>(key: ServiceKey & {
|
|
15
15
|
endpoint: "client";
|
|
16
|
-
}):
|
|
17
|
-
export declare function prepareService(key: ServiceKey):
|
|
16
|
+
}): ClientService<EventsMap>;
|
|
17
|
+
export declare function prepareService(key: ServiceKey): Service;
|
|
18
18
|
export declare function enableCurrentService(name: string): Promise<void>;
|
|
19
19
|
export declare function disableCurrentService(): Promise<void>;
|
|
20
|
-
export declare function endpointService<EventsMap extends object = {}>(target: HandleAddress | null, endpoint: "server"): Promise<
|
|
21
|
-
export declare function endpointService<EventsMap extends object = {}>(target: HandleAddress | null, endpoint: "client"): Promise<
|
|
22
|
-
export declare function endpointService(target: HandleAddress | null, endpoint: "server" | "client"): Promise<
|
|
20
|
+
export declare function endpointService<EventsMap extends object = {}>(target: HandleAddress | null, endpoint: "server"): Promise<ServerService<EventsMap> | null>;
|
|
21
|
+
export declare function endpointService<EventsMap extends object = {}>(target: HandleAddress | null, endpoint: "client"): Promise<ClientService<EventsMap> | null>;
|
|
22
|
+
export declare function endpointService(target: HandleAddress | null, endpoint: "server" | "client"): Promise<Service | null>;
|
package/dist/service.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClientService as CoreClientService, ServerService as CoreServerService, isServiceKey } from "@phreshos/core";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import Deadline from "./deadline.js";
|
|
4
4
|
import Events from "./events.js";
|
|
@@ -6,11 +6,11 @@ import HandleRegistry from "./handle-registry.js";
|
|
|
6
6
|
import wire from "./wire.js";
|
|
7
7
|
const handles = new HandleRegistry();
|
|
8
8
|
/** Server-SDK handle for a Service provided by a Server Endpoint. */
|
|
9
|
-
export class
|
|
9
|
+
export class ServerService extends CoreServerService {
|
|
10
10
|
constructor() { super(); }
|
|
11
11
|
}
|
|
12
12
|
/** Server-SDK handle for a Service provided by a Client Endpoint. */
|
|
13
|
-
export class
|
|
13
|
+
export class ClientService extends CoreClientService {
|
|
14
14
|
constructor() { super(); }
|
|
15
15
|
}
|
|
16
16
|
class ServerChannelHandle extends Events {
|
|
@@ -51,7 +51,7 @@ class ClientChannelHandle extends Events {
|
|
|
51
51
|
super(...serviceEvents(key, "channel"));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
class ServerHandler extends
|
|
54
|
+
class ServerHandler extends ServerService {
|
|
55
55
|
key;
|
|
56
56
|
name;
|
|
57
57
|
channel;
|
|
@@ -70,7 +70,7 @@ class ServerHandler extends ServerServiceHandler {
|
|
|
70
70
|
await wire.request(["service-wait-ready", this.key, timeout], timeout);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
class ClientHandler extends
|
|
73
|
+
class ClientHandler extends ClientService {
|
|
74
74
|
key;
|
|
75
75
|
name;
|
|
76
76
|
channel;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phreshos/server",
|
|
3
|
-
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "The SDK used by a Program's server endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"prepack": "node --run build"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@phreshos/core": "^0.1.
|
|
50
|
+
"@phreshos/core": "^0.1.24"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@msgpack/msgpack": "^3.1.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
|
|
56
|
+
"@phreshos/core": "^0.1.24",
|
|
57
57
|
"@types/node": "^26.2.0",
|
|
58
58
|
"typescript": "^6.0.3"
|
|
59
59
|
}
|