@phreshos/client 0.1.26 → 0.1.27
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 +2 -2
- package/dist/domain.js +1 -13
- package/package.json +3 -3
package/dist/domain.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface EndpointReference {
|
|
|
41
41
|
}
|
|
42
42
|
export type WindowRecord = WindowState;
|
|
43
43
|
/** Program handle visible inside a structurally isolated Client. */
|
|
44
|
-
export type Program
|
|
44
|
+
export type Program = Omit<CoreProgram, "process"> & {
|
|
45
45
|
/** Effective permission decisions owned by this Program. */
|
|
46
46
|
readonly permission: Permission;
|
|
47
47
|
/** Operations and lifecycle observation for this Program's Processes. */
|
|
@@ -65,7 +65,7 @@ export type ProgramProcess = Omit<CoreProgramProcess, "list" | "first" | "last"
|
|
|
65
65
|
}>): Promise<Process>;
|
|
66
66
|
};
|
|
67
67
|
/** Process handle visible inside a structurally isolated Client. */
|
|
68
|
-
export type Process
|
|
68
|
+
export type Process = Omit<CoreProcess, "server" | "client" | "program" | "parent"> & {
|
|
69
69
|
/** Permanent handle to this Process's Server. */
|
|
70
70
|
readonly server: Server;
|
|
71
71
|
/** Permanent handle to this Process's Client. */
|
package/dist/domain.js
CHANGED
|
@@ -421,8 +421,6 @@ function unscoped(subject, values) {
|
|
|
421
421
|
return values[0] === subject ? values.slice(1) : null;
|
|
422
422
|
}
|
|
423
423
|
function programProcessEvent(event, values) {
|
|
424
|
-
if (event === "endpointStart" || event === "endpointStop")
|
|
425
|
-
return lifecycleEndpoint(values[0], values[1]);
|
|
426
424
|
if (event === "create")
|
|
427
425
|
return process(values[0]);
|
|
428
426
|
if (event === "exit")
|
|
@@ -431,24 +429,14 @@ function programProcessEvent(event, values) {
|
|
|
431
429
|
}
|
|
432
430
|
function programEvent(event, values) {
|
|
433
431
|
if (event === "uninstall")
|
|
434
|
-
return
|
|
432
|
+
return values[0] === true;
|
|
435
433
|
return undefined;
|
|
436
434
|
}
|
|
437
435
|
function processEvent(event, values) {
|
|
438
|
-
if (event === "endpointStart" || event === "endpointStop")
|
|
439
|
-
return lifecycleEndpoint(values[0], values[1]);
|
|
440
436
|
if (event === "exit")
|
|
441
437
|
return exit(values[0], values[1]);
|
|
442
438
|
return undefined;
|
|
443
439
|
}
|
|
444
|
-
function lifecycleEndpoint(record, kind) {
|
|
445
|
-
const owner = process(record);
|
|
446
|
-
if (kind === "server")
|
|
447
|
-
return owner.server;
|
|
448
|
-
if (kind === "client")
|
|
449
|
-
return owner.client;
|
|
450
|
-
throw new Error("The system returned an invalid Endpoint lifecycle event");
|
|
451
|
-
}
|
|
452
440
|
export function exit(code, signal) {
|
|
453
441
|
const namedSignal = stringOrNull(signal);
|
|
454
442
|
return { status: namedSignal === null ? "exited" : "signaled", code: numberOrNull(code), signal: namedSignal };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phreshos/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "The SDK used by a Program's client 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.27"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@msgpack/msgpack": "^3.1.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@phreshos/core": "^0.1.
|
|
56
|
+
"@phreshos/core": "^0.1.27",
|
|
57
57
|
"typescript": "^6.0.3"
|
|
58
58
|
}
|
|
59
59
|
}
|