@peers-app/peers-sdk 0.25.14 → 0.25.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/context/user-context-identity.test.d.ts +1 -0
- package/dist/context/user-context-identity.test.js +220 -0
- package/dist/context/user-context.d.ts +5 -1
- package/dist/context/user-context.js +63 -8
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/system/identity-contract.d.ts +156 -0
- package/dist/contracts/system/identity-contract.js +172 -0
- package/dist/contracts/system/index.d.ts +1 -1
- package/dist/data/assistants.d.ts +4 -4
- package/dist/data/devices.d.ts +70 -4
- package/dist/data/devices.js +3 -0
- package/dist/data/group-members.d.ts +2 -2
- package/dist/data/groups.d.ts +2 -2
- package/dist/data/invites.d.ts +93 -25
- package/dist/data/persistent-vars.d.ts +8 -0
- package/dist/data/persistent-vars.js +16 -0
- package/dist/data/tool-access-approvals.d.ts +2 -2
- package/dist/data/user-permissions.d.ts +10 -2
- package/dist/data/user-permissions.js +35 -4
- package/dist/data/user-permissions.test.js +26 -0
- package/dist/data/users.d.ts +48 -4
- package/dist/data/users.js +61 -5
- package/dist/data/workflows.d.ts +1 -1
- package/dist/device/connection.d.ts +7 -1
- package/dist/device/connection.js +38 -6
- package/dist/device/connection.test.js +33 -4
- package/dist/device/device.d.ts +2 -2
- package/dist/device/device.js +4 -2
- package/dist/device/get-trust-level-fn.d.ts +1 -0
- package/dist/device/get-trust-level-fn.js +28 -4
- package/dist/device/get-trust-level-fn.test.js +95 -0
- package/dist/device-pairing/types.d.ts +26 -26
- package/dist/host-credentials.d.ts +78 -0
- package/dist/host-credentials.js +128 -0
- package/dist/host-credentials.test.d.ts +1 -0
- package/dist/host-credentials.test.js +88 -0
- package/dist/identity/account-email.d.ts +59 -0
- package/dist/identity/account-email.js +87 -0
- package/dist/identity/account-email.test.d.ts +1 -0
- package/dist/identity/account-email.test.js +59 -0
- package/dist/identity/anchor-document.d.ts +205 -0
- package/dist/identity/anchor-document.js +119 -0
- package/dist/identity/anchor-document.test.d.ts +1 -0
- package/dist/identity/anchor-document.test.js +16 -0
- package/dist/identity/anchor-resolution.d.ts +61 -0
- package/dist/identity/anchor-resolution.js +117 -0
- package/dist/identity/anchor-resolution.test.d.ts +1 -0
- package/dist/identity/anchor-resolution.test.js +130 -0
- package/dist/identity/key-change.d.ts +142 -0
- package/dist/identity/key-change.js +472 -0
- package/dist/identity/key-change.test.d.ts +1 -0
- package/dist/identity/key-change.test.js +811 -0
- package/dist/identity/key-contest.d.ts +91 -0
- package/dist/identity/key-contest.js +55 -0
- package/dist/identity/key-resolutions.d.ts +55 -0
- package/dist/identity/key-resolutions.js +42 -0
- package/dist/identity/passkey.d.ts +22 -0
- package/dist/identity/passkey.js +33 -0
- package/dist/identity/user-row-change.d.ts +45 -0
- package/dist/identity/user-row-change.js +81 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/invites/invite-messages.d.ts +512 -116
- package/dist/invites/invite-token.d.ts +114 -24
- package/dist/invites/invite-token.js +6 -0
- package/dist/keys.d.ts +7 -0
- package/dist/keys.js +20 -0
- package/dist/system-ids.d.ts +16 -0
- package/dist/system-ids.js +16 -0
- package/dist/types/workflow.d.ts +2 -2
- package/dist/utils.d.ts +10 -0
- package/dist/utils.js +43 -0
- package/dist/utils.test.js +23 -0
- package/package.json +1 -1
|
@@ -112,6 +112,178 @@ function getIdentityContractDefinition() {
|
|
|
112
112
|
inputFields: [],
|
|
113
113
|
outputFields: [field("token", field_type_1.FieldType.string, "peers-services JWT.")],
|
|
114
114
|
},
|
|
115
|
+
{
|
|
116
|
+
name: "getKeyInfo",
|
|
117
|
+
usageDescription: "Return the signed-in user's current signing key, previous keys, on-record anchors, and registry status.",
|
|
118
|
+
inputFields: [],
|
|
119
|
+
outputFields: [
|
|
120
|
+
field("userId", field_type_1.FieldType.id, "Signed-in user id."),
|
|
121
|
+
field("publicKey", field_type_1.FieldType.string, "Current Ed25519 public key."),
|
|
122
|
+
field("publicBoxKey", field_type_1.FieldType.string, "Current X25519 box public key."),
|
|
123
|
+
field("previousPublicKeys", field_type_1.FieldType.object, "Keys retired on this host.", {
|
|
124
|
+
isArray: true,
|
|
125
|
+
}),
|
|
126
|
+
field("canRotate", field_type_1.FieldType.boolean, "Whether this host can rotate the key."),
|
|
127
|
+
field("anchors", field_type_1.FieldType.object, "On-record anchors and what each one currently lists.", {
|
|
128
|
+
optional: true,
|
|
129
|
+
}),
|
|
130
|
+
field("registry", field_type_1.FieldType.object, "Key registry view of this user's keys.", {
|
|
131
|
+
optional: true,
|
|
132
|
+
}),
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "rotateKey",
|
|
137
|
+
usageDescription: "Replace the signed-in user's signing key once every on-record anchor lists the new key. When an anchor must be updated by hand the call returns the document with committed false; call again with confirm true to wait for the anchors. The host restarts after a committed rotation.",
|
|
138
|
+
inputFields: [
|
|
139
|
+
field("reason", field_type_1.FieldType.string, "rotation (default) retires the old key; compromised or lost revokes it.", { optional: true }),
|
|
140
|
+
field("publish", field_type_1.FieldType.string, "anchors (default) writes through installed writers and polls the other on-record anchors. manual writes nowhere and polls every anchor.", { optional: true }),
|
|
141
|
+
field("confirm", field_type_1.FieldType.boolean, "When an anchor needs the document by hand, false returns it; true waits for every anchor and then rotates.", { optional: true }),
|
|
142
|
+
],
|
|
143
|
+
outputFields: [
|
|
144
|
+
field("oldPublicKey", field_type_1.FieldType.string, "The key this device holds, or the retired key."),
|
|
145
|
+
field("newPublicKey", field_type_1.FieldType.string, "The new key."),
|
|
146
|
+
field("reason", field_type_1.FieldType.string, "Reason recorded with the new key."),
|
|
147
|
+
field("committed", field_type_1.FieldType.boolean, "True once the local key has changed."),
|
|
148
|
+
field("restartRequired", field_type_1.FieldType.boolean, "True when the host will restart."),
|
|
149
|
+
field("rewrappedSecrets", field_type_1.FieldType.number, "Personal secrets re-encrypted."),
|
|
150
|
+
field("anchors", field_type_1.FieldType.object, "Per-anchor publish results.", { isArray: true }),
|
|
151
|
+
field("manualDocument", field_type_1.FieldType.object, "Document to place at an anchor.", {
|
|
152
|
+
optional: true,
|
|
153
|
+
}),
|
|
154
|
+
field("warnings", field_type_1.FieldType.string, "Non-fatal problems.", { isArray: true }),
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "getRecoveryEmail",
|
|
159
|
+
usageDescription: "Return the recovery email bound for this user, if any.",
|
|
160
|
+
inputFields: [],
|
|
161
|
+
outputFields: [
|
|
162
|
+
field("email", field_type_1.FieldType.string, "Verified recovery email.", { optional: true }),
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "bindEmailStart",
|
|
167
|
+
usageDescription: "Mail a code to bind a recovery email. The current key signs the request.",
|
|
168
|
+
inputFields: [field("email", field_type_1.FieldType.string, "Mailbox to bind.")],
|
|
169
|
+
outputFields: [field("status", field_type_1.FieldType.string, "sent when the code was mailed.")],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "bindEmailVerify",
|
|
173
|
+
usageDescription: "Confirm the mailed code and store the recovery email.",
|
|
174
|
+
inputFields: [
|
|
175
|
+
field("email", field_type_1.FieldType.string, "Mailbox the code was sent to."),
|
|
176
|
+
field("code", field_type_1.FieldType.string, "Code from the mailbox."),
|
|
177
|
+
],
|
|
178
|
+
outputFields: [field("email", field_type_1.FieldType.string, "Verified recovery email.")],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "unbindEmail",
|
|
182
|
+
usageDescription: "Remove the recovery email. peers-services will not accept a new key until another is bound.",
|
|
183
|
+
inputFields: [],
|
|
184
|
+
outputFields: [field("status", field_type_1.FieldType.string, "unbound.")],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "startAnchorSession",
|
|
188
|
+
usageDescription: "Mail a code to the recovery email. The signing key is not required. Pass userId when signed out.",
|
|
189
|
+
inputFields: [
|
|
190
|
+
field("userId", field_type_1.FieldType.id, "User to recover when no one is signed in.", {
|
|
191
|
+
optional: true,
|
|
192
|
+
}),
|
|
193
|
+
],
|
|
194
|
+
outputFields: [field("status", field_type_1.FieldType.string, "sent when the code was mailed.")],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "confirmAnchorSession",
|
|
198
|
+
usageDescription: "Exchange the mailed code for a short-lived session that can publish a key to peers-services.",
|
|
199
|
+
inputFields: [
|
|
200
|
+
field("code", field_type_1.FieldType.string, "Code from the recovery mailbox."),
|
|
201
|
+
field("userId", field_type_1.FieldType.id, "User to recover when no one is signed in.", {
|
|
202
|
+
optional: true,
|
|
203
|
+
}),
|
|
204
|
+
],
|
|
205
|
+
outputFields: [
|
|
206
|
+
field("expiresIn", field_type_1.FieldType.number, "Seconds the session can publish a key."),
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: "contestRecovery",
|
|
211
|
+
usageDescription: "Object to a recovery with the key on record. Peers hold the new key until someone accepts it.",
|
|
212
|
+
inputFields: [field("pendingKey", field_type_1.FieldType.string, "Public key being recovered.")],
|
|
213
|
+
outputFields: [field("status", field_type_1.FieldType.string, "contested.")],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "acceptRecovery",
|
|
217
|
+
usageDescription: "Adopt a recovered key that the anchors confirmed, before or after a contest.",
|
|
218
|
+
inputFields: [
|
|
219
|
+
field("userId", field_type_1.FieldType.id, "User whose key is being recovered."),
|
|
220
|
+
field("pendingKey", field_type_1.FieldType.string, "Public key to adopt."),
|
|
221
|
+
],
|
|
222
|
+
outputFields: [field("status", field_type_1.FieldType.string, "accepted.")],
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "recoverKey",
|
|
226
|
+
usageDescription: "On a signed-out host, publish a new key without the old key's signature and sign in. Groups need a new invite. Secrets wrapped under the lost key stay unreadable.",
|
|
227
|
+
inputFields: [
|
|
228
|
+
field("userId", field_type_1.FieldType.id, "User to recover."),
|
|
229
|
+
field("publish", field_type_1.FieldType.string, "anchors uses an open recovery-email session. manual stages a document.", { optional: true }),
|
|
230
|
+
field("confirm", field_type_1.FieldType.boolean, "With manual, false returns the document. true waits and then signs in.", { optional: true }),
|
|
231
|
+
],
|
|
232
|
+
outputFields: [
|
|
233
|
+
field("publicKey", field_type_1.FieldType.string, "The new public key."),
|
|
234
|
+
field("committed", field_type_1.FieldType.boolean, "True once this host signed in with the new key."),
|
|
235
|
+
field("manualDocument", field_type_1.FieldType.object, "Document to place at an anchor.", {
|
|
236
|
+
optional: true,
|
|
237
|
+
}),
|
|
238
|
+
field("warnings", field_type_1.FieldType.string, "What a recovery cannot restore.", { isArray: true }),
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "setAnchors",
|
|
243
|
+
usageDescription: "Publish a new anchor list at the anchors already on record, then store it on this profile.",
|
|
244
|
+
inputFields: [
|
|
245
|
+
field("anchors", field_type_1.FieldType.object, "The full list to publish.", { isArray: true }),
|
|
246
|
+
],
|
|
247
|
+
outputFields: [
|
|
248
|
+
field("anchors", field_type_1.FieldType.object, "The list now on record.", { isArray: true }),
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: "passkeyRegisterStart",
|
|
253
|
+
usageDescription: "Start binding a passkey. The current key must sign. Returns WebAuthn options.",
|
|
254
|
+
inputFields: [field("origin", field_type_1.FieldType.string, "Page origin the passkey is created on.")],
|
|
255
|
+
outputFields: [field("options", field_type_1.FieldType.object, "navigator.credentials.create options.")],
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: "passkeyRegisterFinish",
|
|
259
|
+
usageDescription: "Store a passkey after the browser creates it.",
|
|
260
|
+
inputFields: [field("response", field_type_1.FieldType.object, "The browser's registration response.")],
|
|
261
|
+
outputFields: [field("status", field_type_1.FieldType.string, "registered.")],
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "passkeyAuthStart",
|
|
265
|
+
usageDescription: "Start a passkey sign-in that can publish a key. Pass userId when signed out.",
|
|
266
|
+
inputFields: [
|
|
267
|
+
field("origin", field_type_1.FieldType.string, "Page origin the passkey is used on."),
|
|
268
|
+
field("userId", field_type_1.FieldType.id, "User to recover when no one is signed in.", {
|
|
269
|
+
optional: true,
|
|
270
|
+
}),
|
|
271
|
+
],
|
|
272
|
+
outputFields: [field("options", field_type_1.FieldType.object, "navigator.credentials.get options.")],
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: "passkeyAuthFinish",
|
|
276
|
+
usageDescription: "Open an anchor-write session after the browser returns a passkey assertion.",
|
|
277
|
+
inputFields: [
|
|
278
|
+
field("response", field_type_1.FieldType.object, "The browser's authentication response."),
|
|
279
|
+
field("userId", field_type_1.FieldType.id, "User to recover when no one is signed in.", {
|
|
280
|
+
optional: true,
|
|
281
|
+
}),
|
|
282
|
+
],
|
|
283
|
+
outputFields: [
|
|
284
|
+
field("expiresIn", field_type_1.FieldType.number, "Seconds the session can publish a key."),
|
|
285
|
+
],
|
|
286
|
+
},
|
|
115
287
|
],
|
|
116
288
|
observables: [
|
|
117
289
|
{
|
|
@@ -9,7 +9,7 @@ import "./logs-contract";
|
|
|
9
9
|
import "./network-contracts";
|
|
10
10
|
import "./tool-access-control-contract";
|
|
11
11
|
export { DEVICE_OPERATIONS_CONTRACT_VERSION, DEVICE_OPERATIONS_MAX_QUERY_LENGTH, DEVICE_OPERATIONS_MAX_RESULT_BYTES, DEVICE_OPERATIONS_MAX_ROWS, DEVICE_OPERATIONS_MAX_TOOLS, type DeviceOperationCapability, deviceOperationsProviderPackageId, deviceOperationsToolIds, getDeviceOperationsContractDefinition, type IDeviceDatabaseQueryInput, type IDeviceDatabaseQueryResult, type IDeviceOperationStatus, type IDeviceToolListInput, type IDeviceToolLookupInput, type IDeviceToolLookupResult, type IDeviceToolRunInput, } from "./device-operations-contract";
|
|
12
|
-
export { getIdentityContractDefinition, IDENTITY_CONTRACT_VERSION, type IIdentityConsumer, type IIdentitySessionInfo, } from "./identity-contract";
|
|
12
|
+
export { getIdentityContractDefinition, IDENTITY_CONTRACT_VERSION, type IIdentityConsumer, type IIdentityKeyInfo, type IIdentityRegistryKey, type IIdentityRotateKeyInput, type IIdentityRotateKeyResult, type IIdentitySessionInfo, } from "./identity-contract";
|
|
13
13
|
export { getInvitesContractDefinition, type IAcceptInviteResult, type ICreatedInvite, type IInvitePreview, type IInvitesConsumer, INVITES_CONTRACT_VERSION, } from "./invites-contract";
|
|
14
14
|
export { getLogsContractDefinition, type ILogsConsumer, LOGS_CONTRACT_VERSION, resolveLogsContract, } from "./logs-contract";
|
|
15
15
|
export * from "./network-contracts";
|
|
@@ -31,16 +31,16 @@ export declare const assistantSchema: z.ZodObject<{
|
|
|
31
31
|
toolsToInclude: string;
|
|
32
32
|
toolInclusionStrategy: ToolInclusionStrategy;
|
|
33
33
|
description?: string | undefined;
|
|
34
|
-
packageId?: string | undefined;
|
|
35
34
|
updatedAt?: Date | undefined;
|
|
35
|
+
packageId?: string | undefined;
|
|
36
36
|
}, {
|
|
37
37
|
name: string;
|
|
38
38
|
assistantId: string;
|
|
39
39
|
description?: string | undefined;
|
|
40
|
+
updatedAt?: Date | undefined;
|
|
40
41
|
packageId?: string | undefined;
|
|
41
42
|
accessLevel?: number | undefined;
|
|
42
43
|
createdAt?: Date | undefined;
|
|
43
|
-
updatedAt?: Date | undefined;
|
|
44
44
|
assistantRunnerToolId?: string | undefined;
|
|
45
45
|
assistantRunnerConfig?: z.objectInputType<{}, z.ZodAny, "strip"> | undefined;
|
|
46
46
|
toolsToInclude?: string | undefined;
|
|
@@ -65,8 +65,8 @@ export declare function Assistants(dataContext?: DataContext): import("..").Tabl
|
|
|
65
65
|
toolsToInclude: string;
|
|
66
66
|
toolInclusionStrategy: ToolInclusionStrategy;
|
|
67
67
|
description?: string | undefined;
|
|
68
|
-
packageId?: string | undefined;
|
|
69
68
|
updatedAt?: Date | undefined;
|
|
69
|
+
packageId?: string | undefined;
|
|
70
70
|
}>;
|
|
71
71
|
/**
|
|
72
72
|
* Per-user primary assistant preference for the current group.
|
|
@@ -96,8 +96,8 @@ export declare const getPrimaryAssistant: (dataContext?: DataContext) => Promise
|
|
|
96
96
|
toolsToInclude: string;
|
|
97
97
|
toolInclusionStrategy: ToolInclusionStrategy;
|
|
98
98
|
description?: string | undefined;
|
|
99
|
-
packageId?: string | undefined;
|
|
100
99
|
updatedAt?: Date | undefined;
|
|
100
|
+
packageId?: string | undefined;
|
|
101
101
|
}>;
|
|
102
102
|
/**
|
|
103
103
|
* Return Assistant ids mentioned in markdown (`<@assistant:name:id>`).
|
package/dist/data/devices.d.ts
CHANGED
|
@@ -46,16 +46,16 @@ export declare const deviceInfoSchema: z.ZodObject<{
|
|
|
46
46
|
deviceName: z.ZodOptional<z.ZodString>;
|
|
47
47
|
}, "strip", z.ZodTypeAny, {
|
|
48
48
|
publicKey: string;
|
|
49
|
-
publicBoxKey: string;
|
|
50
49
|
userId: string;
|
|
51
50
|
deviceId: string;
|
|
51
|
+
publicBoxKey: string;
|
|
52
52
|
userName?: string | undefined;
|
|
53
53
|
deviceName?: string | undefined;
|
|
54
54
|
}, {
|
|
55
55
|
publicKey: string;
|
|
56
|
-
publicBoxKey: string;
|
|
57
56
|
userId: string;
|
|
58
57
|
deviceId: string;
|
|
58
|
+
publicBoxKey: string;
|
|
59
59
|
userName?: string | undefined;
|
|
60
60
|
deviceName?: string | undefined;
|
|
61
61
|
}>;
|
|
@@ -107,13 +107,57 @@ export declare const deviceHandshakeSchema: z.ZodObject<{
|
|
|
107
107
|
version: 1;
|
|
108
108
|
ephemeralBoxKey: string;
|
|
109
109
|
}>>;
|
|
110
|
+
/** Present when this device, holding the key on record, objects to a recovery. */
|
|
111
|
+
keyContest: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
contents: z.ZodObject<{
|
|
113
|
+
purpose: z.ZodLiteral<"peers-key-contest">;
|
|
114
|
+
userId: z.ZodEffects<z.ZodString, string, string>;
|
|
115
|
+
publicKey: z.ZodString;
|
|
116
|
+
pendingKey: z.ZodString;
|
|
117
|
+
at: z.ZodString;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
at: string;
|
|
120
|
+
publicKey: string;
|
|
121
|
+
purpose: "peers-key-contest";
|
|
122
|
+
userId: string;
|
|
123
|
+
pendingKey: string;
|
|
124
|
+
}, {
|
|
125
|
+
at: string;
|
|
126
|
+
publicKey: string;
|
|
127
|
+
purpose: "peers-key-contest";
|
|
128
|
+
userId: string;
|
|
129
|
+
pendingKey: string;
|
|
130
|
+
}>;
|
|
131
|
+
signature: z.ZodString;
|
|
132
|
+
publicKey: z.ZodString;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
publicKey: string;
|
|
135
|
+
signature: string;
|
|
136
|
+
contents: {
|
|
137
|
+
at: string;
|
|
138
|
+
publicKey: string;
|
|
139
|
+
purpose: "peers-key-contest";
|
|
140
|
+
userId: string;
|
|
141
|
+
pendingKey: string;
|
|
142
|
+
};
|
|
143
|
+
}, {
|
|
144
|
+
publicKey: string;
|
|
145
|
+
signature: string;
|
|
146
|
+
contents: {
|
|
147
|
+
at: string;
|
|
148
|
+
publicKey: string;
|
|
149
|
+
purpose: "peers-key-contest";
|
|
150
|
+
userId: string;
|
|
151
|
+
pendingKey: string;
|
|
152
|
+
};
|
|
153
|
+
}>>;
|
|
110
154
|
}, "strip", z.ZodTypeAny, {
|
|
111
155
|
timestamp: number;
|
|
112
156
|
publicKey: string;
|
|
113
|
-
publicBoxKey: string;
|
|
114
157
|
userId: string;
|
|
115
158
|
connectionId: string;
|
|
116
159
|
deviceId: string;
|
|
160
|
+
publicBoxKey: string;
|
|
117
161
|
serverAddress: string;
|
|
118
162
|
userName?: string | undefined;
|
|
119
163
|
deviceName?: string | undefined;
|
|
@@ -121,13 +165,24 @@ export declare const deviceHandshakeSchema: z.ZodObject<{
|
|
|
121
165
|
version: 1;
|
|
122
166
|
ephemeralBoxKey: string;
|
|
123
167
|
} | undefined;
|
|
168
|
+
keyContest?: {
|
|
169
|
+
publicKey: string;
|
|
170
|
+
signature: string;
|
|
171
|
+
contents: {
|
|
172
|
+
at: string;
|
|
173
|
+
publicKey: string;
|
|
174
|
+
purpose: "peers-key-contest";
|
|
175
|
+
userId: string;
|
|
176
|
+
pendingKey: string;
|
|
177
|
+
};
|
|
178
|
+
} | undefined;
|
|
124
179
|
}, {
|
|
125
180
|
timestamp: number;
|
|
126
181
|
publicKey: string;
|
|
127
|
-
publicBoxKey: string;
|
|
128
182
|
userId: string;
|
|
129
183
|
connectionId: string;
|
|
130
184
|
deviceId: string;
|
|
185
|
+
publicBoxKey: string;
|
|
131
186
|
serverAddress: string;
|
|
132
187
|
userName?: string | undefined;
|
|
133
188
|
deviceName?: string | undefined;
|
|
@@ -135,6 +190,17 @@ export declare const deviceHandshakeSchema: z.ZodObject<{
|
|
|
135
190
|
version: 1;
|
|
136
191
|
ephemeralBoxKey: string;
|
|
137
192
|
} | undefined;
|
|
193
|
+
keyContest?: {
|
|
194
|
+
publicKey: string;
|
|
195
|
+
signature: string;
|
|
196
|
+
contents: {
|
|
197
|
+
at: string;
|
|
198
|
+
publicKey: string;
|
|
199
|
+
purpose: "peers-key-contest";
|
|
200
|
+
userId: string;
|
|
201
|
+
pendingKey: string;
|
|
202
|
+
};
|
|
203
|
+
} | undefined;
|
|
138
204
|
}>;
|
|
139
205
|
/** Signed device information bound to one connection handshake. */
|
|
140
206
|
export type IDeviceHandshake = z.infer<typeof deviceHandshakeSchema>;
|
package/dist/data/devices.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.Devices = Devices;
|
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const user_context_singleton_1 = require("../context/user-context-singleton");
|
|
7
7
|
const socket_type_1 = require("../device/socket.type");
|
|
8
|
+
const key_contest_1 = require("../identity/key-contest");
|
|
8
9
|
const zod_types_1 = require("../types/zod-types");
|
|
9
10
|
const table_definitions_system_1 = require("./orm/table-definitions.system");
|
|
10
11
|
const types_1 = require("./orm/types");
|
|
@@ -53,6 +54,8 @@ exports.deviceHandshakeSchema = exports.deviceInfoSchema.extend({
|
|
|
53
54
|
serverAddress: zod_1.z.string(),
|
|
54
55
|
timestamp: zod_1.z.number(),
|
|
55
56
|
frameCrypto: exports.handshakeFrameCryptoSchema.optional(),
|
|
57
|
+
/** Present when this device, holding the key on record, objects to a recovery. */
|
|
58
|
+
keyContest: key_contest_1.keyContestSignedSchema.optional(),
|
|
56
59
|
});
|
|
57
60
|
const metaData = {
|
|
58
61
|
name: "Devices",
|
|
@@ -13,15 +13,15 @@ export declare const groupMemberSchema: z.ZodObject<{
|
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
14
|
role: GroupMemberRole;
|
|
15
15
|
signature: string;
|
|
16
|
-
groupId: string;
|
|
17
16
|
userId: string;
|
|
17
|
+
groupId: string;
|
|
18
18
|
groupMemberId: string;
|
|
19
19
|
deleted?: boolean | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
role: GroupMemberRole;
|
|
22
22
|
signature: string;
|
|
23
|
-
groupId: string;
|
|
24
23
|
userId: string;
|
|
24
|
+
groupId: string;
|
|
25
25
|
groupMemberId: string;
|
|
26
26
|
deleted?: boolean | undefined;
|
|
27
27
|
}>;
|
package/dist/data/groups.d.ts
CHANGED
|
@@ -19,9 +19,9 @@ export declare const groupSchema: z.ZodObject<{
|
|
|
19
19
|
description: string;
|
|
20
20
|
publicKey: string;
|
|
21
21
|
signature: string;
|
|
22
|
+
publicBoxKey: string;
|
|
22
23
|
groupId: string;
|
|
23
24
|
founderUserId: string;
|
|
24
|
-
publicBoxKey: string;
|
|
25
25
|
disabled?: boolean | undefined;
|
|
26
26
|
iconClassName?: string | undefined;
|
|
27
27
|
publicRole?: GroupMemberRole | undefined;
|
|
@@ -30,9 +30,9 @@ export declare const groupSchema: z.ZodObject<{
|
|
|
30
30
|
description: string;
|
|
31
31
|
publicKey: string;
|
|
32
32
|
signature: string;
|
|
33
|
+
publicBoxKey: string;
|
|
33
34
|
groupId: string;
|
|
34
35
|
founderUserId: string;
|
|
35
|
-
publicBoxKey: string;
|
|
36
36
|
disabled?: boolean | undefined;
|
|
37
37
|
iconClassName?: string | undefined;
|
|
38
38
|
publicRole?: GroupMemberRole | undefined;
|