@peers-app/peers-sdk 0.25.2 → 0.25.3
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/contracts/__tests__/contract-resolvers.test.js +35 -2
- package/dist/contracts/__tests__/host-contract-consumer.test.d.ts +1 -0
- package/dist/contracts/__tests__/host-contract-consumer.test.js +163 -0
- package/dist/contracts/__tests__/system-contracts.test.js +14 -0
- package/dist/contracts/contract-resolvers.d.ts +14 -2
- package/dist/contracts/contract-resolvers.js +69 -6
- package/dist/contracts/host-contract-consumer.d.ts +40 -0
- package/dist/contracts/host-contract-consumer.js +105 -0
- package/dist/contracts/index.d.ts +2 -0
- package/dist/contracts/index.js +7 -2
- package/dist/contracts/system/identity-contract.d.ts +43 -0
- package/dist/contracts/system/identity-contract.js +133 -0
- package/dist/contracts/system/index.d.ts +2 -0
- package/dist/contracts/system/index.js +5 -1
- package/dist/contracts/types.d.ts +6 -0
- package/dist/data/devices.d.ts +4 -4
- package/dist/data/group-share.js +0 -38
- package/dist/data/index.d.ts +1 -0
- package/dist/data/index.js +1 -0
- package/dist/data/invites.d.ts +40 -40
- package/dist/data/invites.js +4 -2
- package/dist/data/peers-services-registration.pvar.d.ts +37 -0
- package/dist/data/peers-services-registration.pvar.js +57 -0
- package/dist/data/tool-access-approvals.d.ts +3 -3
- package/dist/device/connection.d.ts +1 -1
- package/dist/device/device.d.ts +1 -1
- package/dist/device-pairing/constants.d.ts +0 -2
- package/dist/device-pairing/constants.js +1 -3
- package/dist/device-pairing/types.d.ts +80 -80
- package/dist/invites/invite-messages.d.ts +12 -12
- package/dist/rpc-types.d.ts +0 -14
- package/dist/rpc-types.js +0 -13
- package/dist/system-ids.d.ts +17 -0
- package/dist/system-ids.js +18 -1
- package/package.json +1 -1
|
@@ -344,15 +344,15 @@ export declare const groupApprovalSchema: z.ZodObject<{
|
|
|
344
344
|
publicBoxKey: string;
|
|
345
345
|
userId: string;
|
|
346
346
|
deviceId: string;
|
|
347
|
-
deviceName?: string | undefined;
|
|
348
347
|
userName?: string | undefined;
|
|
348
|
+
deviceName?: string | undefined;
|
|
349
349
|
}, {
|
|
350
350
|
publicKey: string;
|
|
351
351
|
publicBoxKey: string;
|
|
352
352
|
userId: string;
|
|
353
353
|
deviceId: string;
|
|
354
|
-
deviceName?: string | undefined;
|
|
355
354
|
userName?: string | undefined;
|
|
355
|
+
deviceName?: string | undefined;
|
|
356
356
|
}>>, "many">;
|
|
357
357
|
}, "strict", z.ZodTypeAny, {
|
|
358
358
|
users: {
|
|
@@ -367,8 +367,8 @@ export declare const groupApprovalSchema: z.ZodObject<{
|
|
|
367
367
|
publicBoxKey: string;
|
|
368
368
|
userId: string;
|
|
369
369
|
deviceId: string;
|
|
370
|
-
deviceName?: string | undefined;
|
|
371
370
|
userName?: string | undefined;
|
|
371
|
+
deviceName?: string | undefined;
|
|
372
372
|
}[];
|
|
373
373
|
groupMembers: {
|
|
374
374
|
role: import("../data").GroupMemberRole;
|
|
@@ -391,8 +391,8 @@ export declare const groupApprovalSchema: z.ZodObject<{
|
|
|
391
391
|
publicBoxKey: string;
|
|
392
392
|
userId: string;
|
|
393
393
|
deviceId: string;
|
|
394
|
-
deviceName?: string | undefined;
|
|
395
394
|
userName?: string | undefined;
|
|
395
|
+
deviceName?: string | undefined;
|
|
396
396
|
}[];
|
|
397
397
|
groupMembers: {
|
|
398
398
|
role: import("../data").GroupMemberRole;
|
|
@@ -469,8 +469,8 @@ export declare const groupApprovalSchema: z.ZodObject<{
|
|
|
469
469
|
publicBoxKey: string;
|
|
470
470
|
userId: string;
|
|
471
471
|
deviceId: string;
|
|
472
|
-
deviceName?: string | undefined;
|
|
473
472
|
userName?: string | undefined;
|
|
473
|
+
deviceName?: string | undefined;
|
|
474
474
|
}[];
|
|
475
475
|
groupMembers: {
|
|
476
476
|
role: import("../data").GroupMemberRole;
|
|
@@ -529,8 +529,8 @@ export declare const groupApprovalSchema: z.ZodObject<{
|
|
|
529
529
|
publicBoxKey: string;
|
|
530
530
|
userId: string;
|
|
531
531
|
deviceId: string;
|
|
532
|
-
deviceName?: string | undefined;
|
|
533
532
|
userName?: string | undefined;
|
|
533
|
+
deviceName?: string | undefined;
|
|
534
534
|
}[];
|
|
535
535
|
groupMembers: {
|
|
536
536
|
role: import("../data").GroupMemberRole;
|
|
@@ -987,15 +987,15 @@ export declare const inviteMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
987
987
|
publicBoxKey: string;
|
|
988
988
|
userId: string;
|
|
989
989
|
deviceId: string;
|
|
990
|
-
deviceName?: string | undefined;
|
|
991
990
|
userName?: string | undefined;
|
|
991
|
+
deviceName?: string | undefined;
|
|
992
992
|
}, {
|
|
993
993
|
publicKey: string;
|
|
994
994
|
publicBoxKey: string;
|
|
995
995
|
userId: string;
|
|
996
996
|
deviceId: string;
|
|
997
|
-
deviceName?: string | undefined;
|
|
998
997
|
userName?: string | undefined;
|
|
998
|
+
deviceName?: string | undefined;
|
|
999
999
|
}>>, "many">;
|
|
1000
1000
|
}, "strict", z.ZodTypeAny, {
|
|
1001
1001
|
users: {
|
|
@@ -1010,8 +1010,8 @@ export declare const inviteMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1010
1010
|
publicBoxKey: string;
|
|
1011
1011
|
userId: string;
|
|
1012
1012
|
deviceId: string;
|
|
1013
|
-
deviceName?: string | undefined;
|
|
1014
1013
|
userName?: string | undefined;
|
|
1014
|
+
deviceName?: string | undefined;
|
|
1015
1015
|
}[];
|
|
1016
1016
|
groupMembers: {
|
|
1017
1017
|
role: import("../data").GroupMemberRole;
|
|
@@ -1034,8 +1034,8 @@ export declare const inviteMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1034
1034
|
publicBoxKey: string;
|
|
1035
1035
|
userId: string;
|
|
1036
1036
|
deviceId: string;
|
|
1037
|
-
deviceName?: string | undefined;
|
|
1038
1037
|
userName?: string | undefined;
|
|
1038
|
+
deviceName?: string | undefined;
|
|
1039
1039
|
}[];
|
|
1040
1040
|
groupMembers: {
|
|
1041
1041
|
role: import("../data").GroupMemberRole;
|
|
@@ -1112,8 +1112,8 @@ export declare const inviteMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1112
1112
|
publicBoxKey: string;
|
|
1113
1113
|
userId: string;
|
|
1114
1114
|
deviceId: string;
|
|
1115
|
-
deviceName?: string | undefined;
|
|
1116
1115
|
userName?: string | undefined;
|
|
1116
|
+
deviceName?: string | undefined;
|
|
1117
1117
|
}[];
|
|
1118
1118
|
groupMembers: {
|
|
1119
1119
|
role: import("../data").GroupMemberRole;
|
|
@@ -1172,8 +1172,8 @@ export declare const inviteMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1172
1172
|
publicBoxKey: string;
|
|
1173
1173
|
userId: string;
|
|
1174
1174
|
deviceId: string;
|
|
1175
|
-
deviceName?: string | undefined;
|
|
1176
1175
|
userName?: string | undefined;
|
|
1176
|
+
deviceName?: string | undefined;
|
|
1177
1177
|
}[];
|
|
1178
1178
|
groupMembers: {
|
|
1179
1179
|
role: import("../data").GroupMemberRole;
|
package/dist/rpc-types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IDeviceDatabaseQueryResult, IDeviceOperationStatus, IDeviceToolRunInput } from "./contracts/system/device-operations-contract";
|
|
2
2
|
import type { ITool } from "./data/tools";
|
|
3
|
-
import type { DevicePairingCeremonyAction, DevicePairingStartDestinationInput, DevicePairingStartSourceInput, DevicePairingState } from "./device-pairing";
|
|
4
3
|
import type { IConsoleLog } from "./logging/console-logs.table";
|
|
5
4
|
import type { IAddOrUpdatePackageResult } from "./package-installer/types";
|
|
6
5
|
import type { IAppNav } from "./types/app-nav";
|
|
@@ -64,16 +63,6 @@ export declare const rpcServerCalls: {
|
|
|
64
63
|
linkRemote?: boolean;
|
|
65
64
|
}) => Promise<string | IAddOrUpdatePackageResult>;
|
|
66
65
|
seedBundledPeersCore: (dataContextId?: string) => Promise<boolean>;
|
|
67
|
-
setUserIdAndSecretKey: (userId: string, secretKey: string) => Promise<void>;
|
|
68
|
-
getUserId: () => Promise<string | undefined>;
|
|
69
|
-
/** Signed-in side: joins the room named by a typed or scanned pairing code. */
|
|
70
|
-
devicePairingStartSource: (input: DevicePairingStartSourceInput) => Promise<DevicePairingState>;
|
|
71
|
-
/** Signed-out side: creates a room and returns state whose `code` the UI shows as text and QR. */
|
|
72
|
-
devicePairingStartDestination: (input?: DevicePairingStartDestinationInput) => Promise<DevicePairingState>;
|
|
73
|
-
devicePairingApprove: (input: DevicePairingCeremonyAction) => Promise<DevicePairingState>;
|
|
74
|
-
devicePairingReject: (input: DevicePairingCeremonyAction) => Promise<DevicePairingState>;
|
|
75
|
-
devicePairingCancel: (input: DevicePairingCeremonyAction) => Promise<DevicePairingState>;
|
|
76
|
-
devicePairingGetState: () => Promise<DevicePairingState>;
|
|
77
66
|
encryptData: (value: string, groupId?: string) => Promise<string>;
|
|
78
67
|
/**
|
|
79
68
|
* Decrypt (if secret) and copy a persistent variable's value to the system clipboard
|
|
@@ -85,7 +74,6 @@ export declare const rpcServerCalls: {
|
|
|
85
74
|
success: boolean;
|
|
86
75
|
error?: string;
|
|
87
76
|
}>;
|
|
88
|
-
logout: () => Promise<void>;
|
|
89
77
|
tableMethodCall: (dataContextId: string, tableName: string, methodName: string, ...args: any[]) => Promise<any>;
|
|
90
78
|
getFileContents: (fileId: string, encoding?: BufferEncoding) => Promise<string>;
|
|
91
79
|
getFileContentsBase64: (fileId: string) => Promise<string>;
|
|
@@ -114,7 +102,6 @@ export declare const rpcServerCalls: {
|
|
|
114
102
|
} | null>;
|
|
115
103
|
/** Deletes the pre-migration data directory after the user confirms. */
|
|
116
104
|
cleanupOldDataDir: () => Promise<void>;
|
|
117
|
-
importGroupShare: (groupShareJson: string) => Promise<string>;
|
|
118
105
|
/**
|
|
119
106
|
* Sign a package version with the package author's key (server-side only — key never leaves the server).
|
|
120
107
|
* Returns the base64url detached signature, or undefined if the signing key isn't available.
|
|
@@ -133,7 +120,6 @@ export declare const rpcServerCalls: {
|
|
|
133
120
|
createdBy?: string;
|
|
134
121
|
createdAt?: string;
|
|
135
122
|
}) => Promise<string | undefined>;
|
|
136
|
-
registerWithPeersServices: () => Promise<string>;
|
|
137
123
|
appQuit: () => Promise<void>;
|
|
138
124
|
appRestart: () => Promise<void>;
|
|
139
125
|
dbQuery: (query: string, dataContextId?: string) => Promise<{
|
package/dist/rpc-types.js
CHANGED
|
@@ -19,16 +19,6 @@ exports.rpcServerCalls = {
|
|
|
19
19
|
openPackage: rpcStub("OpenPackage"),
|
|
20
20
|
addOrUpdatePackage: rpcStub("addOrUpdatePackage"),
|
|
21
21
|
seedBundledPeersCore: rpcStub("seedBundledPeersCore"),
|
|
22
|
-
setUserIdAndSecretKey: rpcStub("setUserIdAndSecretKey"),
|
|
23
|
-
getUserId: rpcStub("getUserId"),
|
|
24
|
-
/** Signed-in side: joins the room named by a typed or scanned pairing code. */
|
|
25
|
-
devicePairingStartSource: rpcStub("devicePairingStartSource"),
|
|
26
|
-
/** Signed-out side: creates a room and returns state whose `code` the UI shows as text and QR. */
|
|
27
|
-
devicePairingStartDestination: rpcStub("devicePairingStartDestination"),
|
|
28
|
-
devicePairingApprove: rpcStub("devicePairingApprove"),
|
|
29
|
-
devicePairingReject: rpcStub("devicePairingReject"),
|
|
30
|
-
devicePairingCancel: rpcStub("devicePairingCancel"),
|
|
31
|
-
devicePairingGetState: rpcStub("devicePairingGetState"),
|
|
32
22
|
encryptData: rpcStub("encryptData"),
|
|
33
23
|
/**
|
|
34
24
|
* Decrypt (if secret) and copy a persistent variable's value to the system clipboard
|
|
@@ -37,7 +27,6 @@ exports.rpcServerCalls = {
|
|
|
37
27
|
* automatically cleared from the clipboard after a short delay.
|
|
38
28
|
*/
|
|
39
29
|
copyPvarValueToClipboard: rpcStub("copyPvarValueToClipboard"),
|
|
40
|
-
logout: rpcStub("logout"),
|
|
41
30
|
tableMethodCall: rpcStub("tableMethodCall"),
|
|
42
31
|
// TODO lock this down so not all code can get any file contents
|
|
43
32
|
getFileContents: rpcStub("getFileContents"),
|
|
@@ -55,7 +44,6 @@ exports.rpcServerCalls = {
|
|
|
55
44
|
getOldDataDirInfo: rpcStub("getOldDataDirInfo"),
|
|
56
45
|
/** Deletes the pre-migration data directory after the user confirms. */
|
|
57
46
|
cleanupOldDataDir: rpcStub("cleanupOldDataDir"),
|
|
58
|
-
importGroupShare: rpcStub("importGroupShare"),
|
|
59
47
|
/**
|
|
60
48
|
* Sign a package version with the package author's key (server-side only — key never leaves the server).
|
|
61
49
|
* Returns the base64url detached signature, or undefined if the signing key isn't available.
|
|
@@ -63,7 +51,6 @@ exports.rpcServerCalls = {
|
|
|
63
51
|
* propagation verification of the full record succeeds.
|
|
64
52
|
*/
|
|
65
53
|
signPackageAuthorVersion: rpcStub("signPackageAuthorVersion"),
|
|
66
|
-
registerWithPeersServices: rpcStub("registerWithPeersServices"),
|
|
67
54
|
// App lifecycle commands (for CLI control)
|
|
68
55
|
appQuit: rpcStub("appQuit"),
|
|
69
56
|
appRestart: rpcStub("appRestart"),
|
package/dist/system-ids.d.ts
CHANGED
|
@@ -76,3 +76,20 @@ export declare const invitesToolIds: {
|
|
|
76
76
|
readonly syncMailbox: "00mu8uuzvq4xlaiqrn5notj1j";
|
|
77
77
|
readonly listInvites: "00mu8uuzvqfego6lyjjkgr4s7";
|
|
78
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* Contract id for the local-only identity surface (System Identity).
|
|
81
|
+
* Resolves before sign-in. Not available over device-to-device connections.
|
|
82
|
+
*/
|
|
83
|
+
export declare const identityContractId = "00muc9mlzv32qg00zz7cyixu9";
|
|
84
|
+
/** Stable IDs for tools in System Identity v1. */
|
|
85
|
+
export declare const identityToolIds: {
|
|
86
|
+
readonly startSource: "00muc9mlzx4hqsfm132w4bzfm";
|
|
87
|
+
readonly startDestination: "00muc9mlzxnfqylatvsyl41fc";
|
|
88
|
+
readonly approve: "00muc9mlzx1vpfyfexbd1yjbc";
|
|
89
|
+
readonly reject: "00muc9mlzxij1praa2scg4v5r";
|
|
90
|
+
readonly cancel: "00muc9mlzxtq87urc75qc4r5v";
|
|
91
|
+
readonly getSession: "00muc9mlzx3t5evd57bns5z5n";
|
|
92
|
+
readonly signIn: "00muc9mlzx456ecfmzp1xn0db";
|
|
93
|
+
readonly signOut: "00muc9mlzxwdm2yj5p5wkjvz7";
|
|
94
|
+
readonly registerWithPeersServices: "00muc9mlzx07q98l3f9x49o10";
|
|
95
|
+
};
|
package/dist/system-ids.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invitesToolIds = exports.invitesContractId = exports.toolAccessControlToolIds = exports.toolAccessControlContractId = exports.networkControlContractId = exports.networkDiagnosticsContractId = exports.deviceOperationsContractId = exports.logsContractId = exports.peersSystemPackageId = exports.peersCorePublishPublicKey = exports.peersCorePackageRepoUrl = exports.peersCorePackageId = exports.createGroupToolId = exports.queryDatabaseToolId = exports.runWorkflowToolId = exports.defaultSendMessageToolId = exports.defaultAssistantRunnerToolId = exports.adminAssistantId = exports.openCodeAssistantId = exports.defaultAssistantId = exports.peersRootUserId = void 0;
|
|
3
|
+
exports.identityToolIds = exports.identityContractId = exports.invitesToolIds = exports.invitesContractId = exports.toolAccessControlToolIds = exports.toolAccessControlContractId = exports.networkControlContractId = exports.networkDiagnosticsContractId = exports.deviceOperationsContractId = exports.logsContractId = exports.peersSystemPackageId = exports.peersCorePublishPublicKey = exports.peersCorePackageRepoUrl = exports.peersCorePackageId = exports.createGroupToolId = exports.queryDatabaseToolId = exports.runWorkflowToolId = exports.defaultSendMessageToolId = exports.defaultAssistantRunnerToolId = exports.adminAssistantId = exports.openCodeAssistantId = exports.defaultAssistantId = exports.peersRootUserId = void 0;
|
|
4
4
|
/** Stable user ID that owns built-in Peers system records. */
|
|
5
5
|
exports.peersRootUserId = "000peers0user000000000001";
|
|
6
6
|
/** Default assistant used when no user-selected assistant is available. */
|
|
@@ -80,3 +80,20 @@ exports.invitesToolIds = {
|
|
|
80
80
|
syncMailbox: "00mu8uuzvq4xlaiqrn5notj1j",
|
|
81
81
|
listInvites: "00mu8uuzvqfego6lyjjkgr4s7",
|
|
82
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Contract id for the local-only identity surface (System Identity).
|
|
85
|
+
* Resolves before sign-in. Not available over device-to-device connections.
|
|
86
|
+
*/
|
|
87
|
+
exports.identityContractId = "00muc9mlzv32qg00zz7cyixu9";
|
|
88
|
+
/** Stable IDs for tools in System Identity v1. */
|
|
89
|
+
exports.identityToolIds = {
|
|
90
|
+
startSource: "00muc9mlzx4hqsfm132w4bzfm",
|
|
91
|
+
startDestination: "00muc9mlzxnfqylatvsyl41fc",
|
|
92
|
+
approve: "00muc9mlzx1vpfyfexbd1yjbc",
|
|
93
|
+
reject: "00muc9mlzxij1praa2scg4v5r",
|
|
94
|
+
cancel: "00muc9mlzxtq87urc75qc4r5v",
|
|
95
|
+
getSession: "00muc9mlzx3t5evd57bns5z5n",
|
|
96
|
+
signIn: "00muc9mlzx456ecfmzp1xn0db",
|
|
97
|
+
signOut: "00muc9mlzxwdm2yj5p5wkjvz7",
|
|
98
|
+
registerWithPeersServices: "00muc9mlzx07q98l3f9x49o10",
|
|
99
|
+
};
|