@phreshos/client 0.1.14 → 0.1.15
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 +1 -1
- package/dist/domain.js +11 -12
- package/package.json +3 -3
package/dist/domain.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export interface HandleAddress {
|
|
|
6
6
|
}
|
|
7
7
|
export interface EndpointDeclarationRecord {
|
|
8
8
|
start: boolean;
|
|
9
|
-
hasService: boolean;
|
|
10
9
|
}
|
|
11
10
|
export interface ClientDeclarationRecord extends EndpointDeclarationRecord {
|
|
12
11
|
title: string | null;
|
|
@@ -22,6 +21,7 @@ export interface ProgramRecord {
|
|
|
22
21
|
name: string;
|
|
23
22
|
version: string | null;
|
|
24
23
|
description: string | null;
|
|
24
|
+
hasAgent: boolean;
|
|
25
25
|
server: EndpointDeclarationRecord | null;
|
|
26
26
|
client: ClientDeclarationRecord | null;
|
|
27
27
|
}
|
package/dist/domain.js
CHANGED
|
@@ -33,8 +33,9 @@ class ProgramHandle extends ProgramBase {
|
|
|
33
33
|
get name() { return this.record.name; }
|
|
34
34
|
get version() { return this.record.version; }
|
|
35
35
|
get description() { return this.record.description; }
|
|
36
|
+
get hasAgent() { return this.record.hasAgent; }
|
|
36
37
|
get server() {
|
|
37
|
-
return this.record.server ? declaration(
|
|
38
|
+
return this.record.server ? declaration(this.record.server) : null;
|
|
38
39
|
}
|
|
39
40
|
get client() {
|
|
40
41
|
return this.record.client ? clientDeclaration(this.record.client) : null;
|
|
@@ -48,6 +49,12 @@ class ProgramHandle extends ProgramBase {
|
|
|
48
49
|
const answer = await wire.request(["icon", size]);
|
|
49
50
|
return new Blob([Uint8Array.from(answer[0])], { type: "image/png" });
|
|
50
51
|
}
|
|
52
|
+
async agent() {
|
|
53
|
+
if (!this.hasAgent)
|
|
54
|
+
return null;
|
|
55
|
+
const answer = await wire.request(["program-agent"]);
|
|
56
|
+
return answer[0];
|
|
57
|
+
}
|
|
51
58
|
async installed() {
|
|
52
59
|
const answer = await wire.request(["installed"]);
|
|
53
60
|
return answer[0];
|
|
@@ -55,16 +62,14 @@ class ProgramHandle extends ProgramBase {
|
|
|
55
62
|
async uninstall(everything = false) { await wire.request(["uninstall", undefined, everything]); }
|
|
56
63
|
async forget() { await wire.request(["forget"]); }
|
|
57
64
|
}
|
|
58
|
-
function declaration(
|
|
65
|
+
function declaration(record) {
|
|
59
66
|
return Object.freeze({
|
|
60
|
-
start: record.start
|
|
61
|
-
hasService: () => record.hasService,
|
|
62
|
-
docs: () => endpointDocs(endpoint, record.hasService)
|
|
67
|
+
start: record.start
|
|
63
68
|
});
|
|
64
69
|
}
|
|
65
70
|
function clientDeclaration(record) {
|
|
66
71
|
return Object.freeze({
|
|
67
|
-
...declaration(
|
|
72
|
+
...declaration(record),
|
|
68
73
|
title: record.title,
|
|
69
74
|
size: record.size,
|
|
70
75
|
position: record.position,
|
|
@@ -72,12 +77,6 @@ function clientDeclaration(record) {
|
|
|
72
77
|
minimize: record.minimize
|
|
73
78
|
});
|
|
74
79
|
}
|
|
75
|
-
async function endpointDocs(endpoint, declared) {
|
|
76
|
-
if (!declared)
|
|
77
|
-
return null;
|
|
78
|
-
const answer = await wire.request(["endpoint-docs", endpoint]);
|
|
79
|
-
return answer[0];
|
|
80
|
-
}
|
|
81
80
|
class ProgramProcessHandle {
|
|
82
81
|
constructor(program) {
|
|
83
82
|
bindEvents(this, scoped("program-process", program, programProcessEvent));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phreshos/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
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.12"
|
|
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.12",
|
|
57
57
|
"typescript": "^6.0.3"
|
|
58
58
|
}
|
|
59
59
|
}
|