@slopus/happy-agent-client 0.0.34 → 0.0.36
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/HappyAgentClient.d.ts +15 -18
- package/dist/HappyAgentClient.d.ts.map +1 -1
- package/dist/HappyAgentClient.js +48 -53
- package/dist/HappyAgentClient.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol/bootstrap.d.ts +40 -42
- package/dist/protocol/bootstrap.d.ts.map +1 -1
- package/dist/protocol/bootstrap.js +3 -4
- package/dist/protocol/bootstrap.js.map +1 -1
- package/dist/protocol/cloud.d.ts +141 -0
- package/dist/protocol/cloud.d.ts.map +1 -1
- package/dist/protocol/cloud.js +39 -0
- package/dist/protocol/cloud.js.map +1 -1
- package/dist/protocol/daemon.d.ts +1 -1
- package/dist/protocol/daemon.js +1 -1
- package/dist/protocol/events.d.ts +7 -7
- package/dist/protocol/events.d.ts.map +1 -1
- package/dist/protocol/events.js +2 -2
- package/dist/protocol/events.js.map +1 -1
- package/package.json +1 -1
- package/dist/protocol/sharing.d.ts +0 -224
- package/dist/protocol/sharing.d.ts.map +0 -1
- package/dist/protocol/sharing.js +0 -91
- package/dist/protocol/sharing.js.map +0 -1
package/dist/protocol/sharing.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/** Sharing: this installation's opt-in contacts and pending relationships. */
|
|
2
|
-
import { Type } from "@sinclair/typebox";
|
|
3
|
-
import { mutationIdSchema, Nullable, resourceVersionSchema, timestampSchema } from "./common.js";
|
|
4
|
-
const base64Url43Options = {
|
|
5
|
-
maxLength: 43,
|
|
6
|
-
minLength: 43,
|
|
7
|
-
pattern: "^[A-Za-z0-9_-]{43}$",
|
|
8
|
-
};
|
|
9
|
-
/** A public installation identity. It is opaque and compared only for equality. */
|
|
10
|
-
export const sharingIdentitySchema = Type.String(base64Url43Options);
|
|
11
|
-
/** A short-lived, single-use invitation capability. Treat this value as sensitive. */
|
|
12
|
-
export const sharingInvitationSchema = Type.String(base64Url43Options);
|
|
13
|
-
/** An opaque incoming-request target, with no ordering or identity semantics. */
|
|
14
|
-
export const sharingRequestIdSchema = Type.String({ maxLength: 256, minLength: 1 });
|
|
15
|
-
/** Runtime connectivity to the managed sharing service. */
|
|
16
|
-
export const sharingConnectionSchema = Type.Union([
|
|
17
|
-
Type.Literal("connecting"),
|
|
18
|
-
Type.Literal("connected"),
|
|
19
|
-
Type.Literal("disconnected"),
|
|
20
|
-
]);
|
|
21
|
-
/** A peer photo's public ThumbHash placeholder. No image bytes endpoint exists for peers. */
|
|
22
|
-
export const sharingPeerPhotoSchema = Type.Object({ thumbhash: Type.String() });
|
|
23
|
-
/**
|
|
24
|
-
* The sanitized public projection of another person's profile.
|
|
25
|
-
*
|
|
26
|
-
* The daemon owns sanitization at the serialization boundary. Like every
|
|
27
|
-
* protocol-22 public schema, this remains open to future additive fields so an
|
|
28
|
-
* older client can consume a response from a newer compatible daemon.
|
|
29
|
-
*/
|
|
30
|
-
export const sharingPeerProfileSchema = Type.Object({
|
|
31
|
-
email: Nullable(Type.String()),
|
|
32
|
-
name: Nullable(Type.String()),
|
|
33
|
-
photo: Nullable(sharingPeerPhotoSchema),
|
|
34
|
-
updatedAt: timestampSchema,
|
|
35
|
-
version: resourceVersionSchema,
|
|
36
|
-
});
|
|
37
|
-
/** A durable mutual contact, possibly still propagating removal to its peer. */
|
|
38
|
-
export const sharingContactSchema = Type.Object({
|
|
39
|
-
identity: sharingIdentitySchema,
|
|
40
|
-
profile: Nullable(sharingPeerProfileSchema),
|
|
41
|
-
status: Type.Union([Type.Literal("active"), Type.Literal("removing")]),
|
|
42
|
-
});
|
|
43
|
-
/** A request received from a peer and waiting for this installation's decision. */
|
|
44
|
-
export const sharingIncomingRequestSchema = Type.Object({
|
|
45
|
-
id: sharingRequestIdSchema,
|
|
46
|
-
identity: sharingIdentitySchema,
|
|
47
|
-
profile: Nullable(sharingPeerProfileSchema),
|
|
48
|
-
});
|
|
49
|
-
/** A request this installation sent by redeeming another person's invitation. */
|
|
50
|
-
export const sharingOutgoingRequestSchema = Type.Object({
|
|
51
|
-
id: Type.String(base64Url43Options),
|
|
52
|
-
identity: sharingIdentitySchema,
|
|
53
|
-
});
|
|
54
|
-
const sharingSnapshotFields = {
|
|
55
|
-
updatedAt: timestampSchema,
|
|
56
|
-
version: resourceVersionSchema,
|
|
57
|
-
};
|
|
58
|
-
/** The stable sharing snapshot before this installation opts in. */
|
|
59
|
-
export const unenrolledSharingSchema = Type.Object({
|
|
60
|
-
...sharingSnapshotFields,
|
|
61
|
-
status: Type.Literal("unenrolled"),
|
|
62
|
-
});
|
|
63
|
-
/** The complete current sharing snapshot after enrollment. */
|
|
64
|
-
export const enrolledSharingSchema = Type.Object({
|
|
65
|
-
...sharingSnapshotFields,
|
|
66
|
-
connection: sharingConnectionSchema,
|
|
67
|
-
contacts: Type.Array(sharingContactSchema, { maxItems: 10_000 }),
|
|
68
|
-
identity: sharingIdentitySchema,
|
|
69
|
-
incomingRequests: Type.Array(sharingIncomingRequestSchema, { maxItems: 1_000 }),
|
|
70
|
-
outgoingRequests: Type.Array(sharingOutgoingRequestSchema, { maxItems: 1_000 }),
|
|
71
|
-
status: Type.Literal("enrolled"),
|
|
72
|
-
});
|
|
73
|
-
/** The installation-wide sharing snapshot, discriminated by enrollment status. */
|
|
74
|
-
export const sharingSchema = Type.Union([unenrolledSharingSchema, enrolledSharingSchema]);
|
|
75
|
-
/** `GET /v0/sharing` and every state-changing sharing mutation return this. */
|
|
76
|
-
export const sharingResponseSchema = Type.Object({ sharing: sharingSchema });
|
|
77
|
-
/** The optional body shared by enrollment, resolution, removal, and reset. */
|
|
78
|
-
export const sharingMutationRequestSchema = Type.Object({
|
|
79
|
-
mutationId: Type.Optional(mutationIdSchema),
|
|
80
|
-
});
|
|
81
|
-
/** `POST /v0/sharing/invitations` returns one sensitive capability exactly once. */
|
|
82
|
-
export const sharingInvitationResponseSchema = Type.Object({
|
|
83
|
-
expiresAt: timestampSchema,
|
|
84
|
-
invitation: sharingInvitationSchema,
|
|
85
|
-
});
|
|
86
|
-
/** `POST /v0/sharing/requests` — redeem another person's invitation. */
|
|
87
|
-
export const sharingRequestSubmissionSchema = Type.Object({
|
|
88
|
-
invitation: sharingInvitationSchema,
|
|
89
|
-
mutationId: Type.Optional(mutationIdSchema),
|
|
90
|
-
});
|
|
91
|
-
//# sourceMappingURL=sharing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sharing.js","sourceRoot":"","sources":["../../sources/protocol/sharing.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAE9E,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEjG,MAAM,kBAAkB,GAAG;IACvB,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,qBAAqB;CACxB,CAAC;AAEX,mFAAmF;AACnF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAGrE,sFAAsF;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAGvE,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AAGpF,2DAA2D;AAC3D,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,KAAK,CAAC;IAC9C,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;IAC1B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACzB,IAAI,CAAC,OAA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