@phreshos/core 0.1.3 → 0.1.4
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/channel.d.ts +3 -2
- package/dist/config.d.ts +0 -5
- package/dist/main.d.ts +1 -1
- package/dist/program.d.ts +0 -5
- package/dist/service.d.ts +12 -0
- package/package.json +1 -1
package/dist/channel.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Endpoint } from "./endpoint.js";
|
|
2
2
|
import type { Publishable } from "./publishable.js";
|
|
3
|
+
import type { ServiceDefinition } from "./service.js";
|
|
3
4
|
import type { Captures, Subscribable } from "./subscribable.js";
|
|
4
5
|
/** One application value arriving through the current Endpoint's Channel. */
|
|
5
6
|
export type ChannelMessage<Payload = unknown, From = Endpoint> = Readonly<{
|
|
@@ -16,9 +17,9 @@ type ChannelFallback<Events extends object, From> = keyof Events extends never ?
|
|
|
16
17
|
/** Every application event observable through a Channel. */
|
|
17
18
|
export type ChannelCapture<Events extends object = {}, From = Endpoint> = Captures<ChannelEvents<Events, From>, ChannelFallback<Events, From>>;
|
|
18
19
|
/** Addressed input and destinationless output for the executing Endpoint. */
|
|
19
|
-
export interface Channel<Events extends object = {}, From = Endpoint> extends Subscribable<ChannelEvents<Events, From>, ChannelFallback<Events, From>>, Publishable {
|
|
20
|
+
export interface Channel<Events extends object = {}, From = Endpoint, Definition extends ServiceDefinition = ServiceDefinition> extends Subscribable<ChannelEvents<Events, From>, ChannelFallback<Events, From>>, Publishable {
|
|
20
21
|
/** Exposes this executing Channel under one public service name. */
|
|
21
|
-
enableService(
|
|
22
|
+
enableService(definition: Definition): Promise<void>;
|
|
22
23
|
/** Stops exposing this executing Channel as a service. */
|
|
23
24
|
disableService(): Promise<void>;
|
|
24
25
|
}
|
package/dist/config.d.ts
CHANGED
|
@@ -52,11 +52,6 @@ type Description = Readonly<{
|
|
|
52
52
|
version?: string;
|
|
53
53
|
/** Short human-readable explanation of what the Program does. */
|
|
54
54
|
description?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Markdown file describing only the Program-owned API contract.
|
|
57
|
-
* System access, Endpoint, and event mechanics belong to system documentation.
|
|
58
|
-
*/
|
|
59
|
-
apiDocs?: string;
|
|
60
55
|
/** PNG source between 128 and 2,048 pixels per side and no larger than 5 MiB. */
|
|
61
56
|
icon?: string;
|
|
62
57
|
/** Command run before production start, installation, and packaging. */
|
package/dist/main.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { type Message, type Cleanup, type Capture, type Captures, type EventMess
|
|
|
2
2
|
export { type Publishable } from "./publishable.js";
|
|
3
3
|
export { type Timeoutable } from "./timeout.js";
|
|
4
4
|
export { type Askable, type TimedAskable } from "./askable.js";
|
|
5
|
-
export { ClientServiceHandler, ServerServiceHandler, ServiceHandler, isServiceKey, type ClientServiceChannel, type ServerServiceChannel, type ServiceChannel, type ServiceKey, type ServiceLifecycleEvents } from "./service.js";
|
|
5
|
+
export { ClientServiceHandler, ServerServiceHandler, ServiceHandler, isServiceKey, type ClientServiceChannel, type ServerServiceChannel, type ServerServiceDefinition, type ServiceChannel, type ServiceDefinition, type ServiceKey, type ServiceLifecycleEvents } from "./service.js";
|
|
6
6
|
export { isPermissionName, permissionNames, type PermissionDecision, type PermissionDecisions, type PermissionName, type Permissions, type ProgramPermissions, type TimedPermissions } from "./permissions.js";
|
|
7
7
|
export { type Outcome } from "./outcome.js";
|
|
8
8
|
export { type ServedFile } from "./served-file.js";
|
package/dist/program.d.ts
CHANGED
|
@@ -83,11 +83,6 @@ export interface Program<Events extends object = {}> extends Subscribable<Progra
|
|
|
83
83
|
getProcess(identityOrName: string): Promise<Process | null>;
|
|
84
84
|
/** Creates one Process of this Program. */
|
|
85
85
|
createProcess(launch?: Launch): Promise<Process>;
|
|
86
|
-
/**
|
|
87
|
-
* Returns the Program-authored API entry point, or `null`.
|
|
88
|
-
* The document describes the Program's contract, not system mechanics.
|
|
89
|
-
*/
|
|
90
|
-
apiDocs(): Promise<string | null>;
|
|
91
86
|
/**
|
|
92
87
|
* Returns one standard PNG representation of this Program's icon.
|
|
93
88
|
* Programs without an authored icon receive the system default.
|
package/dist/service.d.ts
CHANGED
|
@@ -9,6 +9,16 @@ export type ServiceKey = Readonly<{
|
|
|
9
9
|
/** Program-authored service identity. */
|
|
10
10
|
name: string;
|
|
11
11
|
}>;
|
|
12
|
+
/** Runtime declaration of one service exposed by an Endpoint Channel. */
|
|
13
|
+
export type ServiceDefinition = Readonly<{
|
|
14
|
+
/** Program-authored service identity. */
|
|
15
|
+
name: string;
|
|
16
|
+
}>;
|
|
17
|
+
/** Runtime declaration of one Server service and its optional API document. */
|
|
18
|
+
export type ServerServiceDefinition = ServiceDefinition & Readonly<{
|
|
19
|
+
/** Complete API documentation owned by this service. */
|
|
20
|
+
docs?: string;
|
|
21
|
+
}>;
|
|
12
22
|
/** Lifecycle transitions of one exact service identity. */
|
|
13
23
|
export type ServiceLifecycleEvents = {
|
|
14
24
|
/** A live Endpoint began providing this service. */
|
|
@@ -48,6 +58,8 @@ export declare class ServerServiceHandler<Events extends object = {}> extends Se
|
|
|
48
58
|
export interface ServerServiceHandler<Events extends object = {}> {
|
|
49
59
|
readonly endpoint: "server";
|
|
50
60
|
readonly channel: ServerServiceChannel<Events>;
|
|
61
|
+
/** Explicitly reads this live Server service's documentation, or `null`. */
|
|
62
|
+
docs(): Promise<string | null>;
|
|
51
63
|
}
|
|
52
64
|
/** Stable handle for one Client-provided service. */
|
|
53
65
|
export declare class ClientServiceHandler<Events extends object = {}> extends ServiceHandler<ClientServiceChannel<Events>> {
|