@wirecat/cli-core 0.475.0 → 0.477.0
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/CHANGELOG.md +40 -1
- package/dist/calendar/mcp/index.d.ts +12 -12
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/messenger/account-command.js +10 -8
- package/dist/cli/messenger/catch-up-answers.d.ts +14 -0
- package/dist/cli/messenger/chat-answers.d.ts +8 -2
- package/dist/cli/messenger/chat-answers.js +43 -0
- package/dist/cli/messenger/contacts-command.js +20 -25
- package/dist/cli/messenger/context.d.ts +2 -0
- package/dist/cli/messenger/conversation-answers.d.ts +21 -0
- package/dist/cli/messenger/message-answers.d.ts +21 -0
- package/dist/cli/messenger/message-items.js +8 -0
- package/dist/cli/messenger/message-writes.d.ts +42 -0
- package/dist/cli/messenger/people-queries.d.ts +2 -0
- package/dist/cli/messenger/people-queries.js +7 -1
- package/dist/cli/messenger/reactions-command.js +38 -2
- package/dist/cli/messenger/serve-relay.d.ts +1 -0
- package/dist/domain/models.d.ts +22 -3
- package/dist/entities/attachment.d.ts +8 -0
- package/dist/entities/attachment.js +9 -1
- package/dist/entities/contact-context.d.ts +42 -0
- package/dist/entities/contact-read.d.ts +15 -25
- package/dist/entities/contact-read.js +4 -15
- package/dist/entities/contact.d.ts +103 -134
- package/dist/entities/contact.js +13 -2
- package/dist/entities/conversation-results.d.ts +42 -0
- package/dist/entities/evidence.d.ts +168 -0
- package/dist/entities/index.d.ts +511 -201
- package/dist/entities/index.js +4 -3
- package/dist/entities/listener.d.ts +84 -0
- package/dist/entities/message-context.d.ts +63 -0
- package/dist/entities/message-write.d.ts +84 -0
- package/dist/entities/message.d.ts +21 -0
- package/dist/entities/reaction.d.ts +12 -0
- package/dist/entities/reaction.js +9 -0
- package/dist/entities/store-records.d.ts +21 -0
- package/dist/errors/reasons.js +2 -0
- package/dist/meetings/mcp/index.d.ts +15 -15
- package/dist/oauth/storage.js +14 -9
- package/dist/ports/messenger.d.ts +13 -2
- package/dist/render/markdown.js +4 -0
- package/dist/render/messages.js +7 -2
- package/dist/services/account.d.ts +1 -1
- package/dist/services/account.js +1 -2
- package/dist/services/people.d.ts +8 -5
- package/dist/services/people.js +6 -3
- package/dist/services/person-profile.d.ts +4 -3
- package/dist/services/person-profile.js +14 -3
- package/dist/store/sqlite/manifest.js +1 -0
- package/dist/store/sqlite/messages.js +5 -1
- package/dist/store/sqlite/migrations.generated.js +6 -0
- package/dist/store/sqlite/reads.js +1 -0
- package/dist/store/sqlite/schema.d.ts +16 -0
- package/dist/store/sqlite/schema.js +1 -0
- package/package.json +1 -1
- package/parity.json +20 -10
|
@@ -1,6 +1,100 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
/** Somebody in a messenger's contact list. */
|
|
3
3
|
export declare const contact: v.StrictObjectSchema<{
|
|
4
|
+
readonly usernames: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5
|
+
readonly birthday: v.OptionalSchema<v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
|
|
6
|
+
readonly phone: v.OptionalSchema<v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
|
|
7
|
+
readonly flags: v.OptionalSchema<Omit<v.StrictObjectSchema<{
|
|
8
|
+
readonly bot: v.BooleanSchema<undefined>;
|
|
9
|
+
readonly verified: v.BooleanSchema<undefined>;
|
|
10
|
+
readonly premium: v.BooleanSchema<undefined>;
|
|
11
|
+
readonly scam: v.BooleanSchema<undefined>;
|
|
12
|
+
readonly fake: v.BooleanSchema<undefined>;
|
|
13
|
+
readonly restricted: v.BooleanSchema<undefined>;
|
|
14
|
+
readonly deleted: v.BooleanSchema<undefined>;
|
|
15
|
+
readonly support: v.BooleanSchema<undefined>;
|
|
16
|
+
}, undefined>, "entries" | "~run" | "~standard" | "~types"> & {
|
|
17
|
+
readonly entries: {
|
|
18
|
+
readonly bot: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
19
|
+
readonly verified: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
20
|
+
readonly premium: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
21
|
+
readonly scam: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
22
|
+
readonly fake: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
23
|
+
readonly restricted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
24
|
+
readonly deleted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
25
|
+
readonly support: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
26
|
+
};
|
|
27
|
+
readonly "~standard": v.StandardProps<{
|
|
28
|
+
bot?: boolean | undefined;
|
|
29
|
+
verified?: boolean | undefined;
|
|
30
|
+
premium?: boolean | undefined;
|
|
31
|
+
scam?: boolean | undefined;
|
|
32
|
+
fake?: boolean | undefined;
|
|
33
|
+
restricted?: boolean | undefined;
|
|
34
|
+
deleted?: boolean | undefined;
|
|
35
|
+
support?: boolean | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
bot?: boolean | undefined;
|
|
38
|
+
verified?: boolean | undefined;
|
|
39
|
+
premium?: boolean | undefined;
|
|
40
|
+
scam?: boolean | undefined;
|
|
41
|
+
fake?: boolean | undefined;
|
|
42
|
+
restricted?: boolean | undefined;
|
|
43
|
+
deleted?: boolean | undefined;
|
|
44
|
+
support?: boolean | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
47
|
+
bot?: boolean | undefined;
|
|
48
|
+
verified?: boolean | undefined;
|
|
49
|
+
premium?: boolean | undefined;
|
|
50
|
+
scam?: boolean | undefined;
|
|
51
|
+
fake?: boolean | undefined;
|
|
52
|
+
restricted?: boolean | undefined;
|
|
53
|
+
deleted?: boolean | undefined;
|
|
54
|
+
support?: boolean | undefined;
|
|
55
|
+
}, v.BooleanIssue | v.StrictObjectIssue>;
|
|
56
|
+
readonly "~types"?: {
|
|
57
|
+
readonly input: {
|
|
58
|
+
bot?: boolean | undefined;
|
|
59
|
+
verified?: boolean | undefined;
|
|
60
|
+
premium?: boolean | undefined;
|
|
61
|
+
scam?: boolean | undefined;
|
|
62
|
+
fake?: boolean | undefined;
|
|
63
|
+
restricted?: boolean | undefined;
|
|
64
|
+
deleted?: boolean | undefined;
|
|
65
|
+
support?: boolean | undefined;
|
|
66
|
+
};
|
|
67
|
+
readonly output: {
|
|
68
|
+
bot?: boolean | undefined;
|
|
69
|
+
verified?: boolean | undefined;
|
|
70
|
+
premium?: boolean | undefined;
|
|
71
|
+
scam?: boolean | undefined;
|
|
72
|
+
fake?: boolean | undefined;
|
|
73
|
+
restricted?: boolean | undefined;
|
|
74
|
+
deleted?: boolean | undefined;
|
|
75
|
+
support?: boolean | undefined;
|
|
76
|
+
};
|
|
77
|
+
readonly issue: v.BooleanIssue | v.StrictObjectIssue;
|
|
78
|
+
} | undefined;
|
|
79
|
+
}, undefined>;
|
|
80
|
+
readonly seen: v.OptionalSchema<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
81
|
+
readonly contact: v.OptionalSchema<v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
82
|
+
readonly mutual_contact: v.OptionalSchema<v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
83
|
+
readonly common_chats_count: v.OptionalSchema<v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>, undefined>;
|
|
84
|
+
readonly registered: v.OptionalSchema<v.OptionalSchema<v.NullableSchema<v.StrictObjectSchema<{
|
|
85
|
+
readonly at: v.StringSchema<undefined>;
|
|
86
|
+
readonly source: v.PicklistSchema<["telegram", "max", "estimate"], undefined>;
|
|
87
|
+
readonly precision: v.PicklistSchema<["day", "month"], undefined>;
|
|
88
|
+
}, undefined>, undefined>, undefined>, undefined>;
|
|
89
|
+
readonly has_photo: v.OptionalSchema<v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
90
|
+
readonly aliases: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
91
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
92
|
+
readonly username: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
93
|
+
readonly link: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
94
|
+
readonly first_seen_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
95
|
+
readonly last_seen_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
96
|
+
readonly source: v.PicklistSchema<["profile", "messages"], undefined>;
|
|
97
|
+
}, undefined>, undefined>, undefined>;
|
|
4
98
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
5
99
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
6
100
|
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -17,145 +111,20 @@ export declare const contact: v.StrictObjectSchema<{
|
|
|
17
111
|
readonly number: v.StringSchema<undefined>;
|
|
18
112
|
readonly label: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
19
113
|
}, undefined>, undefined>, undefined>;
|
|
20
|
-
/** `contacts show`: the chats shared with them. */
|
|
21
|
-
readonly chats: v.OptionalSchema<v.ArraySchema<
|
|
114
|
+
/** `contacts show`: the chats shared with them, and what the store holds of their messages in each. */
|
|
115
|
+
readonly chats: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
22
116
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
23
117
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
24
|
-
readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
25
|
-
readonly account: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
26
118
|
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
27
119
|
readonly kind: v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>;
|
|
28
|
-
readonly unread_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
29
|
-
readonly unread_mentions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
30
120
|
readonly last_message_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
31
|
-
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
|
|
36
|
-
readonly
|
|
37
|
-
|
|
38
|
-
readonly scope: v.OptionalSchema<v.PicklistSchema<["personal", "work"], undefined>, undefined>;
|
|
39
|
-
readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
40
|
-
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
41
|
-
readonly invite_link: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
42
|
-
readonly settings: v.OptionalSchema<v.StrictObjectSchema<{
|
|
43
|
-
readonly all_can_pin: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
44
|
-
readonly only_admins_add: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
45
|
-
readonly only_admins_call: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
46
|
-
readonly only_owner_edits_info: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
47
|
-
readonly members_see_link: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
48
|
-
readonly join_approval: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
49
|
-
readonly only_admins_send: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
50
|
-
readonly only_admins_edit_info: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
51
|
-
readonly disappearing_seconds: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
52
|
-
}, undefined>, undefined>;
|
|
53
|
-
readonly members: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
54
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
55
|
-
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
56
|
-
readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
57
|
-
readonly role: v.OptionalSchema<v.PicklistSchema<["owner", "admin", "member"], undefined>, undefined>;
|
|
58
|
-
readonly last_seen_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>, undefined>;
|
|
59
|
-
readonly registered_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>, undefined>;
|
|
60
|
-
readonly joined_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>, undefined>;
|
|
61
|
-
readonly invited_by: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
|
|
62
|
-
readonly is_bot: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
63
|
-
readonly deleted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
64
|
-
readonly flagged: v.OptionalSchema<v.PicklistSchema<["scam", "fake"], undefined>, undefined>;
|
|
65
|
-
readonly has_photo: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
66
|
-
readonly score: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
67
|
-
readonly reasons: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
68
|
-
readonly check: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
69
|
-
}, undefined>, undefined>, undefined>;
|
|
70
|
-
}, undefined>, "entries" | "~run" | "~standard" | "~types"> & {
|
|
71
|
-
readonly entries: Pick<{
|
|
72
|
-
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
73
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
74
|
-
readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
75
|
-
readonly account: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
76
|
-
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
77
|
-
readonly kind: v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>;
|
|
78
|
-
readonly unread_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
79
|
-
readonly unread_mentions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
80
|
-
readonly last_message_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
81
|
-
readonly participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
82
|
-
readonly muted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
83
|
-
readonly muted_until: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
84
|
-
readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
85
|
-
readonly marked_unread: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
86
|
-
readonly membership_state: v.OptionalSchema<v.PicklistSchema<["joined", "left", "public", "imported", "archived", "external"], undefined>, undefined>;
|
|
87
|
-
readonly parent_chat_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
88
|
-
readonly scope: v.OptionalSchema<v.PicklistSchema<["personal", "work"], undefined>, undefined>;
|
|
89
|
-
readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
90
|
-
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
91
|
-
readonly invite_link: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
92
|
-
readonly settings: v.OptionalSchema<v.StrictObjectSchema<{
|
|
93
|
-
readonly all_can_pin: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
94
|
-
readonly only_admins_add: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
95
|
-
readonly only_admins_call: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
96
|
-
readonly only_owner_edits_info: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
97
|
-
readonly members_see_link: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
98
|
-
readonly join_approval: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
99
|
-
readonly only_admins_send: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
100
|
-
readonly only_admins_edit_info: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
|
|
101
|
-
readonly disappearing_seconds: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
102
|
-
}, undefined>, undefined>;
|
|
103
|
-
readonly members: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
104
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
105
|
-
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
106
|
-
readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
107
|
-
readonly role: v.OptionalSchema<v.PicklistSchema<["owner", "admin", "member"], undefined>, undefined>;
|
|
108
|
-
readonly last_seen_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>, undefined>;
|
|
109
|
-
readonly registered_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>, undefined>;
|
|
110
|
-
readonly joined_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>, undefined>;
|
|
111
|
-
readonly invited_by: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
|
|
112
|
-
readonly is_bot: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
113
|
-
readonly deleted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
114
|
-
readonly flagged: v.OptionalSchema<v.PicklistSchema<["scam", "fake"], undefined>, undefined>;
|
|
115
|
-
readonly has_photo: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
116
|
-
readonly score: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
117
|
-
readonly reasons: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
118
|
-
readonly check: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
119
|
-
}, undefined>, undefined>, undefined>;
|
|
120
|
-
}, "id" | "kind" | "last_message_at" | "ref" | "title">;
|
|
121
|
-
readonly "~standard": v.StandardProps<{
|
|
122
|
-
ref: string;
|
|
123
|
-
id: string;
|
|
124
|
-
title: string | null;
|
|
125
|
-
kind: "channel" | "dialog" | "group" | "saved" | "unknown";
|
|
126
|
-
last_message_at: string | null;
|
|
127
|
-
}, {
|
|
128
|
-
ref: string;
|
|
129
|
-
id: string;
|
|
130
|
-
title: string | null;
|
|
131
|
-
kind: "channel" | "dialog" | "group" | "saved" | "unknown";
|
|
132
|
-
last_message_at: string | null;
|
|
133
|
-
}>;
|
|
134
|
-
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
135
|
-
ref: string;
|
|
136
|
-
id: string;
|
|
137
|
-
title: string | null;
|
|
138
|
-
kind: "channel" | "dialog" | "group" | "saved" | "unknown";
|
|
139
|
-
last_message_at: string | null;
|
|
140
|
-
}, v.EndsWithIssue<string, "Z"> | v.IsoTimestampIssue<string> | v.MinLengthIssue<string, 1> | v.PicklistIssue | v.RegexIssue<string> | v.StrictObjectIssue | v.StringIssue>;
|
|
141
|
-
readonly "~types"?: {
|
|
142
|
-
readonly input: {
|
|
143
|
-
ref: string;
|
|
144
|
-
id: string;
|
|
145
|
-
title: string | null;
|
|
146
|
-
kind: "channel" | "dialog" | "group" | "saved" | "unknown";
|
|
147
|
-
last_message_at: string | null;
|
|
148
|
-
};
|
|
149
|
-
readonly output: {
|
|
150
|
-
ref: string;
|
|
151
|
-
id: string;
|
|
152
|
-
title: string | null;
|
|
153
|
-
kind: "channel" | "dialog" | "group" | "saved" | "unknown";
|
|
154
|
-
last_message_at: string | null;
|
|
155
|
-
};
|
|
156
|
-
readonly issue: v.EndsWithIssue<string, "Z"> | v.IsoTimestampIssue<string> | v.MinLengthIssue<string, 1> | v.PicklistIssue | v.RegexIssue<string> | v.StrictObjectIssue | v.StringIssue;
|
|
157
|
-
} | undefined;
|
|
158
|
-
}, undefined>, undefined>;
|
|
121
|
+
/** Their messages stored; a floor unless `complete`. */
|
|
122
|
+
readonly their_messages: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
123
|
+
readonly first_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>, undefined>;
|
|
124
|
+
readonly last_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>, undefined>;
|
|
125
|
+
/** The store holds the whole chat, so the count is the real one. */
|
|
126
|
+
readonly complete: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
127
|
+
}, undefined>, undefined>, undefined>;
|
|
159
128
|
/** `contacts show --with-notes`: the owner's private notes about them. */
|
|
160
129
|
readonly notes: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
161
130
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
package/dist/entities/contact.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { chat } from "./chat.js";
|
|
3
|
+
import { profileFields } from "./contact-read.js";
|
|
3
4
|
import { count, id, reference, text, time } from "./fields.js";
|
|
4
5
|
/** Somebody in a messenger's contact list. */
|
|
5
6
|
export const contact = v.strictObject({
|
|
@@ -16,8 +17,18 @@ export const contact = v.strictObject({
|
|
|
16
17
|
/** For a source that knows it, such as a Zoom contact. */
|
|
17
18
|
email: v.optional(v.nullable(text)),
|
|
18
19
|
phones: v.optional(v.array(v.strictObject({ number: text, label: v.nullable(text) }))),
|
|
19
|
-
/** `contacts show`: the chats shared with them. */
|
|
20
|
-
chats: v.optional(v.array(v.
|
|
20
|
+
/** `contacts show`: the chats shared with them, and what the store holds of their messages in each. */
|
|
21
|
+
chats: v.optional(v.array(v.strictObject({
|
|
22
|
+
...v.pick(chat, ["ref", "id", "title", "kind", "last_message_at"]).entries,
|
|
23
|
+
/** Their messages stored; a floor unless `complete`. */
|
|
24
|
+
their_messages: v.optional(count),
|
|
25
|
+
first_at: v.optional(v.nullable(time)),
|
|
26
|
+
last_at: v.optional(v.nullable(time)),
|
|
27
|
+
/** The store holds the whole chat, so the count is the real one. */
|
|
28
|
+
complete: v.optional(v.boolean()),
|
|
29
|
+
}))),
|
|
30
|
+
/** `contacts show`: what the messenger says about them, or with `--offline` what the store saw of them. */
|
|
31
|
+
...v.partial(v.strictObject(profileFields)).entries,
|
|
21
32
|
/** `contacts show --with-notes`: the owner's private notes about them. */
|
|
22
33
|
notes: v.optional(v.array(v.strictObject({ id, text, revision: count, created_at: time, updated_at: time }))),
|
|
23
34
|
});
|
|
@@ -72,6 +72,13 @@ export declare const conversationDetails: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
72
72
|
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
73
73
|
}, undefined>, undefined>;
|
|
74
74
|
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
75
|
+
readonly contact: v.OptionalSchema<v.StrictObjectSchema<{
|
|
76
|
+
readonly name: v.StringSchema<undefined>;
|
|
77
|
+
readonly first_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
78
|
+
readonly last_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
79
|
+
readonly phone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
80
|
+
readonly user_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
81
|
+
}, undefined>, undefined>;
|
|
75
82
|
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
76
83
|
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
77
84
|
readonly text: v.StringSchema<undefined>;
|
|
@@ -104,6 +111,13 @@ export declare const conversationDetails: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
104
111
|
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
105
112
|
}, undefined>, undefined>;
|
|
106
113
|
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
114
|
+
readonly contact: v.OptionalSchema<v.StrictObjectSchema<{
|
|
115
|
+
readonly name: v.StringSchema<undefined>;
|
|
116
|
+
readonly first_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
117
|
+
readonly last_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
118
|
+
readonly phone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
119
|
+
readonly user_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
120
|
+
}, undefined>, undefined>;
|
|
107
121
|
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
108
122
|
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
109
123
|
readonly text: v.StringSchema<undefined>;
|
|
@@ -139,6 +153,13 @@ export declare const conversationDetails: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
139
153
|
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
140
154
|
}, undefined>, undefined>;
|
|
141
155
|
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
156
|
+
readonly contact: v.OptionalSchema<v.StrictObjectSchema<{
|
|
157
|
+
readonly name: v.StringSchema<undefined>;
|
|
158
|
+
readonly first_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
159
|
+
readonly last_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
160
|
+
readonly phone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
161
|
+
readonly user_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
162
|
+
}, undefined>, undefined>;
|
|
142
163
|
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
143
164
|
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
144
165
|
readonly text: v.StringSchema<undefined>;
|
|
@@ -261,6 +282,13 @@ export declare const conversationDetails: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
261
282
|
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
262
283
|
}, undefined>, undefined>;
|
|
263
284
|
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
285
|
+
readonly contact: v.OptionalSchema<v.StrictObjectSchema<{
|
|
286
|
+
readonly name: v.StringSchema<undefined>;
|
|
287
|
+
readonly first_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
288
|
+
readonly last_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
289
|
+
readonly phone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
290
|
+
readonly user_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
291
|
+
}, undefined>, undefined>;
|
|
264
292
|
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
265
293
|
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
266
294
|
readonly text: v.StringSchema<undefined>;
|
|
@@ -293,6 +321,13 @@ export declare const conversationDetails: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
293
321
|
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
294
322
|
}, undefined>, undefined>;
|
|
295
323
|
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
324
|
+
readonly contact: v.OptionalSchema<v.StrictObjectSchema<{
|
|
325
|
+
readonly name: v.StringSchema<undefined>;
|
|
326
|
+
readonly first_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
327
|
+
readonly last_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
328
|
+
readonly phone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
329
|
+
readonly user_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
330
|
+
}, undefined>, undefined>;
|
|
296
331
|
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
297
332
|
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
298
333
|
readonly text: v.StringSchema<undefined>;
|
|
@@ -328,6 +363,13 @@ export declare const conversationDetails: v.UnionSchema<[v.StrictObjectSchema<{
|
|
|
328
363
|
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
329
364
|
}, undefined>, undefined>;
|
|
330
365
|
readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
366
|
+
readonly contact: v.OptionalSchema<v.StrictObjectSchema<{
|
|
367
|
+
readonly name: v.StringSchema<undefined>;
|
|
368
|
+
readonly first_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
369
|
+
readonly last_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
370
|
+
readonly phone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
371
|
+
readonly user_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
372
|
+
}, undefined>, undefined>;
|
|
331
373
|
readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
332
374
|
readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
|
|
333
375
|
readonly text: v.StringSchema<undefined>;
|