@wirecat/cli-core 0.398.0 → 0.400.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 +106 -0
- package/dist/analysis/consents.d.ts +11 -6
- package/dist/analysis/consents.js +5 -2
- package/dist/cli/analysis-choice.d.ts +1 -0
- package/dist/cli/analysis-choice.js +3 -0
- package/dist/cli/bot/admins.js +14 -4
- package/dist/cli/bot/command.js +38 -16
- package/dist/cli/bot/examples.d.ts +3 -0
- package/dist/cli/bot/examples.js +2 -0
- package/dist/cli/bot/mcp.js +6 -2
- package/dist/cli/bot/messages.js +17 -6
- package/dist/cli/bot/moderation.js +16 -4
- package/dist/cli/bot/people.js +16 -4
- package/dist/cli/bot/setup.js +27 -8
- package/dist/cli/bot/watch.js +7 -1
- package/dist/cli/config-command.js +20 -1
- package/dist/cli/context.d.ts +2 -0
- package/dist/cli/context.js +1 -1
- package/dist/cli/effects.d.ts +4 -1
- package/dist/cli/effects.js +10 -2
- package/dist/cli/embedding-choice.d.ts +2 -1
- package/dist/cli/embedding-choice.js +4 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/json-fields.js +12 -1
- package/dist/cli/messenger/account-command.js +15 -6
- package/dist/cli/messenger/account-profile-query.d.ts +2 -0
- package/dist/cli/messenger/account-profile-query.js +13 -0
- package/dist/cli/messenger/account-sessions-command.js +1 -0
- package/dist/cli/messenger/admin-commands.js +30 -21
- package/dist/cli/messenger/admin-contacts-command.js +6 -3
- package/dist/cli/messenger/admin-folders-command.js +5 -5
- package/dist/cli/messenger/admin-moderation-command.js +4 -4
- package/dist/cli/messenger/admin-statistics-command.js +6 -14
- package/dist/cli/messenger/analysis-consents-query.d.ts +5 -0
- package/dist/cli/messenger/analysis-consents-query.js +20 -0
- package/dist/cli/messenger/archive-commands.js +3 -3
- package/dist/cli/messenger/attachments-command.js +3 -0
- package/dist/cli/messenger/backfill-command.js +5 -4
- package/dist/cli/messenger/catch-up-answers.d.ts +2 -1
- package/dist/cli/messenger/catch-up-answers.js +6 -2
- package/dist/cli/messenger/chat-queries.d.ts +1 -0
- package/dist/cli/messenger/chat-queries.js +12 -2
- package/dist/cli/messenger/chats-command.js +2 -2
- package/dist/cli/messenger/chats-documents-command.js +7 -5
- package/dist/cli/messenger/chats-members-command.js +7 -3
- package/dist/cli/messenger/chats-read-command.js +1 -1
- package/dist/cli/messenger/chats-stats-command.js +1 -1
- package/dist/cli/messenger/chats-tracking-command.js +14 -6
- package/dist/cli/messenger/contacts-command.js +11 -7
- package/dist/cli/messenger/context.d.ts +2 -0
- package/dist/cli/messenger/conversations-command.js +47 -29
- package/dist/cli/messenger/doctor-command.js +5 -1
- package/dist/cli/messenger/document-links-query.d.ts +2 -0
- package/dist/cli/messenger/document-links-query.js +9 -0
- package/dist/cli/messenger/download-command.js +1 -0
- package/dist/cli/messenger/flood-command.d.ts +2 -2
- package/dist/cli/messenger/flood-command.js +3 -3
- package/dist/cli/messenger/gaps-command.js +2 -2
- package/dist/cli/messenger/guard-commands.js +35 -13
- package/dist/cli/messenger/hearing-command.d.ts +1 -1
- package/dist/cli/messenger/hearing-command.js +1 -1
- package/dist/cli/messenger/images-command.js +1 -0
- package/dist/cli/messenger/inbox.js +6 -4
- package/dist/cli/messenger/media-archive-command.js +2 -0
- package/dist/cli/messenger/media-archive-move-command.js +1 -0
- package/dist/cli/messenger/media-archive-timer-command.js +1 -1
- package/dist/cli/messenger/mentions-command.js +15 -2
- package/dist/cli/messenger/messages-command.js +2 -0
- package/dist/cli/messenger/messages-delete-command.js +1 -0
- package/dist/cli/messenger/messages-edit-command.js +1 -0
- package/dist/cli/messenger/messages-evidence-command.js +3 -1
- package/dist/cli/messenger/messages-forward-command.js +1 -0
- package/dist/cli/messenger/messages-pin-command.js +3 -0
- package/dist/cli/messenger/messages-send-command.js +1 -0
- package/dist/cli/messenger/messages-stats-command.js +1 -1
- package/dist/cli/messenger/metadata-command.js +7 -2
- package/dist/cli/messenger/models-command.js +10 -2
- package/dist/cli/messenger/polls-command.js +4 -0
- package/dist/cli/messenger/private-people-command.js +8 -6
- package/dist/cli/messenger/rankings-command.js +6 -11
- package/dist/cli/messenger/reactions-command.js +2 -0
- package/dist/cli/messenger/recipients-query.d.ts +5 -0
- package/dist/cli/messenger/recipients-query.js +18 -0
- package/dist/cli/messenger/records-command.js +13 -6
- package/dist/cli/messenger/replies-edit-command.d.ts +1 -1
- package/dist/cli/messenger/replies-edit-command.js +13 -5
- package/dist/cli/messenger/retention-command.js +1 -1
- package/dist/cli/messenger/review.js +6 -4
- package/dist/cli/messenger/search-command.js +3 -1
- package/dist/cli/messenger/searches-command.js +6 -2
- package/dist/cli/messenger/sends-query.d.ts +5 -0
- package/dist/cli/messenger/sends-query.js +33 -0
- package/dist/cli/messenger/serve-command.js +1 -0
- package/dist/cli/messenger/serve-relay.d.ts +1 -0
- package/dist/cli/messenger/statistics-query.d.ts +14 -0
- package/dist/cli/messenger/statistics-query.js +143 -0
- package/dist/cli/messenger/stats-command.js +6 -6
- package/dist/cli/messenger/store-maintenance-command.d.ts +1 -1
- package/dist/cli/messenger/store-maintenance-command.js +10 -10
- package/dist/cli/messenger/tags-command.js +18 -6
- package/dist/cli/messenger/tasks-command.js +47 -8
- package/dist/cli/messenger/transcribe-command.js +2 -1
- package/dist/cli/messenger/watch-answers.d.ts +6 -0
- package/dist/cli/messenger/watch-answers.js +69 -0
- package/dist/cli/messenger/watch-command.d.ts +1 -1
- package/dist/cli/messenger/watch-command.js +56 -7
- package/dist/cli/program.js +5 -1
- package/dist/cli/runs/command.js +25 -38
- package/dist/cli/runs/query.d.ts +5 -0
- package/dist/cli/runs/query.js +32 -0
- package/dist/cli/runs/search-command.d.ts +4 -0
- package/dist/cli/runs/search-command.js +27 -0
- package/dist/cli/runs/search-query.d.ts +4 -0
- package/dist/cli/runs/search-query.js +50 -0
- package/dist/cli/runs/search.d.ts +2 -1
- package/dist/cli/runs/search.js +6 -6
- package/dist/domain/attachments.js +9 -1
- package/dist/domain/rankings-options.js +3 -3
- package/dist/entities/account-change.d.ts +89 -0
- package/dist/entities/account-change.js +20 -0
- package/dist/entities/account-profile.d.ts +7 -0
- package/dist/entities/account-profile.js +8 -0
- package/dist/entities/analysis-consent.d.ts +9 -0
- package/dist/entities/analysis-consent.js +4 -0
- package/dist/entities/attachment-results.d.ts +96 -0
- package/dist/entities/attachment-results.js +31 -0
- package/dist/entities/batch-result.d.ts +27 -0
- package/dist/entities/batch-result.js +18 -0
- package/dist/entities/chat-admin.d.ts +234 -0
- package/dist/entities/chat-admin.js +84 -0
- package/dist/entities/chat-change.d.ts +25 -0
- package/dist/entities/chat-change.js +11 -0
- package/dist/entities/chat-metadata.d.ts +34 -0
- package/dist/entities/chat-metadata.js +15 -0
- package/dist/entities/chat-moderation.d.ts +44 -0
- package/dist/entities/chat-moderation.js +37 -0
- package/dist/entities/chat-tracking.d.ts +26 -0
- package/dist/entities/chat-tracking.js +23 -0
- package/dist/entities/contact-activity.d.ts +52 -0
- package/dist/entities/contact-activity.js +42 -0
- package/dist/entities/contact-context.d.ts +1568 -0
- package/dist/entities/contact-context.js +191 -0
- package/dist/entities/contact-write.d.ts +22 -0
- package/dist/entities/contact-write.js +6 -0
- package/dist/entities/conversation-preparation.d.ts +63 -0
- package/dist/entities/conversation-preparation.js +23 -0
- package/dist/entities/conversation-results.d.ts +567 -0
- package/dist/entities/conversation-results.js +94 -0
- package/dist/entities/document-link.d.ts +13 -0
- package/dist/entities/document-link.js +11 -0
- package/dist/entities/extraction-report.d.ts +95 -0
- package/dist/entities/extraction-report.js +34 -0
- package/dist/entities/image-embedding.d.ts +9 -0
- package/dist/entities/image-embedding.js +10 -0
- package/dist/entities/index.d.ts +8006 -1928
- package/dist/entities/index.js +174 -3
- package/dist/entities/listener.d.ts +2150 -0
- package/dist/entities/listener.js +46 -0
- package/dist/entities/media-archive.d.ts +43 -0
- package/dist/entities/media-archive.js +32 -0
- package/dist/entities/meeting-task-proposal.d.ts +14 -0
- package/dist/entities/meeting-task-proposal.js +19 -0
- package/dist/entities/meeting.d.ts +1 -1
- package/dist/entities/meeting.js +1 -1
- package/dist/entities/mention.d.ts +63 -0
- package/dist/entities/mention.js +44 -0
- package/dist/entities/message-change.d.ts +19 -0
- package/dist/entities/message-change.js +6 -0
- package/dist/entities/message-context.d.ts +617 -0
- package/dist/entities/message-context.js +20 -0
- package/dist/entities/message-read.d.ts +73 -0
- package/dist/entities/message-read.js +58 -0
- package/dist/entities/message-transfer.d.ts +379 -0
- package/dist/entities/message-transfer.js +83 -0
- package/dist/entities/message-write.d.ts +191 -0
- package/dist/entities/message-write.js +8 -0
- package/dist/entities/model-key.d.ts +14 -0
- package/dist/entities/model-key.js +10 -0
- package/dist/entities/poll.d.ts +40 -0
- package/dist/entities/poll.js +16 -0
- package/dist/entities/private-contact.d.ts +10 -0
- package/dist/entities/private-contact.js +4 -0
- package/dist/entities/reaction-change.d.ts +7 -0
- package/dist/entities/reaction-change.js +8 -0
- package/dist/entities/recipient.d.ts +29 -0
- package/dist/entities/recipient.js +11 -0
- package/dist/entities/recorded-run.d.ts +103 -0
- package/dist/entities/recorded-run.js +44 -0
- package/dist/entities/saved-search.d.ts +4 -0
- package/dist/entities/saved-search.js +2 -0
- package/dist/entities/send-attempt.d.ts +31 -0
- package/dist/entities/send-attempt.js +29 -0
- package/dist/entities/store-maintenance.d.ts +319 -0
- package/dist/entities/store-maintenance.js +145 -0
- package/dist/entities/store-records.d.ts +442 -0
- package/dist/entities/store-records.js +99 -0
- package/dist/entities/tag-change.d.ts +74 -0
- package/dist/entities/tag-change.js +31 -0
- package/dist/entities/task-pair.d.ts +31 -0
- package/dist/entities/task-pair.js +23 -0
- package/dist/entities/task-results.d.ts +524 -0
- package/dist/entities/task-results.js +142 -0
- package/dist/errors/reasons.js +1 -0
- package/dist/mcp/agent.d.ts +3 -1
- package/dist/mcp/agent.js +9 -6
- package/dist/mcp/bot/server.d.ts +2 -0
- package/dist/mcp/bot/server.js +1 -0
- package/dist/mcp/prompts.js +8 -2
- package/dist/mcp/server.js +3 -1
- package/dist/mcp/tools/attachments.js +1 -0
- package/dist/meetings/cli/index.js +1 -1
- package/dist/meetings/cli/passage.js +1 -0
- package/dist/meetings/index.d.ts +2 -1
- package/dist/meetings/index.js +1 -0
- package/dist/meetings/links.d.ts +16 -0
- package/dist/meetings/mcp/index.d.ts +15 -15
- package/dist/meetings/read-answers.d.ts +167 -0
- package/dist/meetings/read-answers.js +183 -0
- package/dist/runs/run.d.ts +10 -2
- package/dist/runs/run.js +11 -3
- package/dist/sends/journal.d.ts +8 -1
- package/dist/sends/journal.js +9 -2
- package/dist/sends/permissions.d.ts +5 -1
- package/dist/sends/permissions.js +11 -1
- package/dist/sends/recipients.d.ts +8 -0
- package/dist/sends/recipients.js +9 -0
- package/dist/services/admin-statistics.js +3 -3
- package/dist/services/chat-documents.d.ts +1 -0
- package/dist/services/chat-documents.js +9 -3
- package/dist/services/chats.d.ts +1 -1
- package/dist/services/chats.js +5 -2
- package/dist/services/meeting-links.d.ts +2 -17
- package/dist/store/exports.d.ts +1 -1
- package/dist/store/exports.js +1 -1
- package/dist/store/messages.d.ts +3 -1
- package/dist/store/messages.js +2 -2
- package/dist/store/roster.d.ts +4 -1
- package/dist/store/roster.js +2 -2
- package/dist/store/sqlite/chats.d.ts +12 -0
- package/dist/store/sqlite/chats.js +1 -0
- package/dist/store/sqlite/document-links.d.ts +1 -1
- package/dist/store/sqlite/document-links.js +5 -5
- package/dist/store/sqlite/involvements.js +2 -1
- package/dist/store/sqlite/roster.d.ts +2 -1
- package/dist/store/sqlite/roster.js +3 -2
- package/package.json +3 -3
- package/parity.json +76 -108
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
export declare const chatRules: v.StrictObjectSchema<{
|
|
3
|
+
readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
4
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5
|
+
readonly file: v.StringSchema<undefined>;
|
|
6
|
+
readonly saved: v.BooleanSchema<undefined>;
|
|
7
|
+
readonly rules: v.StrictObjectSchema<{
|
|
8
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
9
|
+
readonly trusted: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
10
|
+
readonly blocked: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
11
|
+
readonly blocked_names: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
12
|
+
readonly links: v.PicklistSchema<["report", "delete", "remove"], undefined>;
|
|
13
|
+
readonly invites: v.PicklistSchema<["report", "delete", "remove"], undefined>;
|
|
14
|
+
readonly forwards: v.PicklistSchema<["report", "delete", "remove"], undefined>;
|
|
15
|
+
readonly blocked_people: v.PicklistSchema<["report", "delete", "remove"], undefined>;
|
|
16
|
+
readonly flood: v.StrictObjectSchema<{
|
|
17
|
+
readonly messages: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
18
|
+
readonly minutes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
19
|
+
readonly action: v.PicklistSchema<["report", "delete", "remove"], undefined>;
|
|
20
|
+
}, undefined>;
|
|
21
|
+
readonly new_account: v.StrictObjectSchema<{
|
|
22
|
+
readonly days: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
23
|
+
readonly action: v.PicklistSchema<["report", "remove"], undefined>;
|
|
24
|
+
}, undefined>;
|
|
25
|
+
readonly consent: v.StrictObjectSchema<{
|
|
26
|
+
readonly delete: v.PicklistSchema<["deny", "readonly", "ask", "allow"], undefined>;
|
|
27
|
+
readonly remove: v.PicklistSchema<["deny", "readonly", "ask", "allow"], undefined>;
|
|
28
|
+
}, undefined>;
|
|
29
|
+
}, undefined>;
|
|
30
|
+
}, undefined>;
|
|
31
|
+
export declare const chatModeration: v.StrictObjectSchema<{
|
|
32
|
+
readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
33
|
+
readonly rows: v.ArraySchema<v.StrictObjectSchema<{
|
|
34
|
+
readonly kind: v.PicklistSchema<["message", "member"], undefined>;
|
|
35
|
+
readonly rule: v.PicklistSchema<["blocked", "invites", "links", "forwards", "flood", "newAccount"], undefined>;
|
|
36
|
+
readonly person_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
37
|
+
readonly person_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
38
|
+
readonly message_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
39
|
+
readonly action: v.PicklistSchema<["report", "delete", "remove"], undefined>;
|
|
40
|
+
readonly outcome: v.PicklistSchema<["reported", "done", "planned", "forbidden", "declined", "refused", "failed", "skipped"], undefined>;
|
|
41
|
+
readonly reason: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
42
|
+
readonly command: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
43
|
+
}, undefined>, undefined>;
|
|
44
|
+
}, undefined>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { count, id, text } from "./fields.js";
|
|
3
|
+
const action = v.picklist(["report", "delete", "remove"]);
|
|
4
|
+
const level = v.picklist(["deny", "readonly", "ask", "allow"]);
|
|
5
|
+
export const chatRules = v.strictObject({
|
|
6
|
+
chat_id: id,
|
|
7
|
+
title: v.nullable(text),
|
|
8
|
+
file: text,
|
|
9
|
+
saved: v.boolean(),
|
|
10
|
+
rules: v.strictObject({
|
|
11
|
+
title: v.nullable(text),
|
|
12
|
+
trusted: v.array(id),
|
|
13
|
+
blocked: v.array(id),
|
|
14
|
+
blocked_names: v.array(text),
|
|
15
|
+
links: action,
|
|
16
|
+
invites: action,
|
|
17
|
+
forwards: action,
|
|
18
|
+
blocked_people: action,
|
|
19
|
+
flood: v.strictObject({ messages: count, minutes: count, action }),
|
|
20
|
+
new_account: v.strictObject({ days: count, action: v.picklist(["report", "remove"]) }),
|
|
21
|
+
consent: v.strictObject({ delete: level, remove: level }),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
export const chatModeration = v.strictObject({
|
|
25
|
+
chat_id: id,
|
|
26
|
+
rows: v.array(v.strictObject({
|
|
27
|
+
kind: v.picklist(["message", "member"]),
|
|
28
|
+
rule: v.picklist(["blocked", "invites", "links", "forwards", "flood", "newAccount"]),
|
|
29
|
+
person_id: id,
|
|
30
|
+
person_name: v.nullable(text),
|
|
31
|
+
message_id: v.optional(id),
|
|
32
|
+
action,
|
|
33
|
+
outcome: v.picklist(["reported", "done", "planned", "forbidden", "declined", "refused", "failed", "skipped"]),
|
|
34
|
+
reason: v.optional(text),
|
|
35
|
+
command: v.optional(text),
|
|
36
|
+
})),
|
|
37
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
export declare const trackedChat: v.StrictObjectSchema<{
|
|
3
|
+
readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
4
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5
|
+
readonly tracked_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`">]>;
|
|
6
|
+
readonly last_count: v.NullableSchema<v.StrictObjectSchema<{
|
|
7
|
+
readonly day: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoDateAction<string, undefined>]>;
|
|
8
|
+
readonly participants: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
9
|
+
readonly listed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
10
|
+
readonly complete: v.BooleanSchema<undefined>;
|
|
11
|
+
}, undefined>, undefined>;
|
|
12
|
+
}, undefined>;
|
|
13
|
+
export declare const trackedChatHistory: v.StrictObjectSchema<{
|
|
14
|
+
readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
15
|
+
readonly tracked_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>;
|
|
16
|
+
readonly counts: v.ArraySchema<v.StrictObjectSchema<{
|
|
17
|
+
readonly day: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoDateAction<string, undefined>]>;
|
|
18
|
+
readonly participants: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
19
|
+
readonly listed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
20
|
+
readonly complete: v.BooleanSchema<undefined>;
|
|
21
|
+
}, undefined>, undefined>;
|
|
22
|
+
}, undefined>;
|
|
23
|
+
export declare const chatTracking: v.StrictObjectSchema<{
|
|
24
|
+
readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
25
|
+
readonly tracked: v.BooleanSchema<undefined>;
|
|
26
|
+
}, undefined>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { count, id, text, time } from "./fields.js";
|
|
3
|
+
const memberCount = v.strictObject({
|
|
4
|
+
day: v.pipe(text, v.isoDate()),
|
|
5
|
+
participants: v.nullable(count),
|
|
6
|
+
listed: count,
|
|
7
|
+
complete: v.boolean(),
|
|
8
|
+
});
|
|
9
|
+
export const trackedChat = v.strictObject({
|
|
10
|
+
chat_id: id,
|
|
11
|
+
title: v.nullable(text),
|
|
12
|
+
tracked_at: time,
|
|
13
|
+
last_count: v.nullable(memberCount),
|
|
14
|
+
});
|
|
15
|
+
export const trackedChatHistory = v.strictObject({
|
|
16
|
+
chat_id: id,
|
|
17
|
+
tracked_at: v.nullable(time),
|
|
18
|
+
counts: v.array(memberCount),
|
|
19
|
+
});
|
|
20
|
+
export const chatTracking = v.strictObject({
|
|
21
|
+
chat_id: id,
|
|
22
|
+
tracked: v.boolean(),
|
|
23
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
export declare const linkedPerson: v.StrictObjectSchema<{
|
|
3
|
+
readonly uid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
4
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5
|
+
readonly identities: v.ArraySchema<v.StrictObjectSchema<{
|
|
6
|
+
readonly provider: v.StringSchema<undefined>;
|
|
7
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
8
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
9
|
+
readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
10
|
+
readonly is_bot: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
11
|
+
readonly accounts: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
12
|
+
readonly method: v.StringSchema<undefined>;
|
|
13
|
+
readonly linked_by: v.StringSchema<undefined>;
|
|
14
|
+
readonly linked_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`">]>;
|
|
15
|
+
}, undefined>, undefined>;
|
|
16
|
+
}, undefined>;
|
|
17
|
+
export declare const contactActivity: v.StrictObjectSchema<{
|
|
18
|
+
readonly 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`">]>;
|
|
19
|
+
readonly subject: v.StringSchema<undefined>;
|
|
20
|
+
readonly subject_id: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
21
|
+
readonly role: v.StringSchema<undefined>;
|
|
22
|
+
readonly scope: v.StringSchema<undefined>;
|
|
23
|
+
readonly provider: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
24
|
+
readonly account: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
25
|
+
readonly chat_id: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
26
|
+
readonly locator: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
27
|
+
readonly project_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
28
|
+
}, undefined>;
|
|
29
|
+
export declare const contactCheck: v.StrictObjectSchema<{
|
|
30
|
+
readonly person: v.StrictObjectSchema<{
|
|
31
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
32
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
33
|
+
readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
34
|
+
readonly provider: v.StringSchema<undefined>;
|
|
35
|
+
}, undefined>;
|
|
36
|
+
readonly score: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
37
|
+
readonly reasons: v.ArraySchema<v.StrictObjectSchema<{
|
|
38
|
+
readonly reason: v.PicklistSchema<import("../botcheck/reasons.js").BotReason[], undefined>;
|
|
39
|
+
readonly weight: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
40
|
+
readonly source: v.StringSchema<undefined>;
|
|
41
|
+
readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
42
|
+
}, undefined>, undefined>;
|
|
43
|
+
readonly registries: v.ArraySchema<v.StrictObjectSchema<{
|
|
44
|
+
readonly name: v.PicklistSchema<["cas", "lols"], undefined>;
|
|
45
|
+
readonly answer: v.PicklistSchema<["listed", "clean", "unknown"], undefined>;
|
|
46
|
+
readonly checked_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`">]>;
|
|
47
|
+
readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
48
|
+
readonly reasons: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["cas_banned", "lols_banned", "lols_scammer"], undefined>, undefined>, undefined>;
|
|
49
|
+
}, undefined>, undefined>;
|
|
50
|
+
readonly unknown: v.ArraySchema<v.PicklistSchema<import("../botcheck/reasons.js").BotReason[], undefined>, undefined>;
|
|
51
|
+
readonly checked_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`">]>;
|
|
52
|
+
}, undefined>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { WEIGHTS } from "../botcheck/reasons.js";
|
|
3
|
+
import { count, id, text, time } from "./fields.js";
|
|
4
|
+
const linkedIdentity = v.strictObject({
|
|
5
|
+
provider: text,
|
|
6
|
+
id,
|
|
7
|
+
name: v.nullable(text),
|
|
8
|
+
username: v.nullable(text),
|
|
9
|
+
is_bot: v.nullable(v.boolean()),
|
|
10
|
+
accounts: v.array(id),
|
|
11
|
+
method: text,
|
|
12
|
+
linked_by: text,
|
|
13
|
+
linked_at: time,
|
|
14
|
+
});
|
|
15
|
+
export const linkedPerson = v.strictObject({ uid: id, name: v.nullable(text), identities: v.array(linkedIdentity) });
|
|
16
|
+
export const contactActivity = v.strictObject({
|
|
17
|
+
at: time,
|
|
18
|
+
subject: text,
|
|
19
|
+
subject_id: count,
|
|
20
|
+
role: text,
|
|
21
|
+
scope: text,
|
|
22
|
+
provider: v.nullable(text),
|
|
23
|
+
account: v.nullable(text),
|
|
24
|
+
chat_id: v.nullable(text),
|
|
25
|
+
locator: v.nullable(text),
|
|
26
|
+
project_id: v.nullable(count),
|
|
27
|
+
});
|
|
28
|
+
const botReason = v.picklist(Object.keys(WEIGHTS));
|
|
29
|
+
export const contactCheck = v.strictObject({
|
|
30
|
+
person: v.strictObject({ id, name: v.nullable(text), username: v.nullable(text), provider: text }),
|
|
31
|
+
score: count,
|
|
32
|
+
reasons: v.array(v.strictObject({ reason: botReason, weight: count, source: text, detail: v.optional(text) })),
|
|
33
|
+
registries: v.array(v.strictObject({
|
|
34
|
+
name: v.picklist(["cas", "lols"]),
|
|
35
|
+
answer: v.picklist(["listed", "clean", "unknown"]),
|
|
36
|
+
checked_at: time,
|
|
37
|
+
detail: v.optional(text),
|
|
38
|
+
reasons: v.optional(v.array(v.picklist(["cas_banned", "lols_banned", "lols_scammer"]))),
|
|
39
|
+
})),
|
|
40
|
+
unknown: v.array(botReason),
|
|
41
|
+
checked_at: time,
|
|
42
|
+
});
|