@soft-boy/agentschema 0.5.1 → 0.5.2
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/lib/channels.js +7 -2
- package/package.json +1 -1
package/dist/lib/channels.js
CHANGED
|
@@ -36,6 +36,8 @@ const listOf = (check) => (value) => {
|
|
|
36
36
|
};
|
|
37
37
|
const PHONE = /^\+[1-9]\d{6,14}$/;
|
|
38
38
|
const DISCORD_ID = /^\d{17,20}$/;
|
|
39
|
+
const SLACK_MEMBER = /^[UW][A-Z0-9]{2,}$/;
|
|
40
|
+
const SLACK_CHANNEL = /^[CG][A-Z0-9]{2,}$/;
|
|
39
41
|
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
40
42
|
const EMAIL_ALLOW = matches(/^(\*|[^\s@]+)@[^\s@]+\.[^\s@]+$/, "an email address, or *@ and a domain");
|
|
41
43
|
// What differs between channels. Each `secrets` entry is something the host asks for and keeps: never
|
|
@@ -102,9 +104,12 @@ export const CHANNEL_TYPES = {
|
|
|
102
104
|
scopes: ["thread", "sender", "room"],
|
|
103
105
|
approvals: ["deny", "sender"],
|
|
104
106
|
hasGroups: true,
|
|
105
|
-
allow: matches(
|
|
107
|
+
allow: matches(SLACK_MEMBER, "a member ID like U012AB3CD"),
|
|
108
|
+
// A bot can post in a channel, or message a member directly, anywhere in its own workspace.
|
|
109
|
+
sendTo: { place: matches(/^[CGUW][A-Z0-9]{2,}$/, "a channel ID like C012AB3CD, or a member ID like U012AB3CD"), contacts: false, anyone: false },
|
|
106
110
|
fields: {
|
|
107
|
-
channels: { check: listOf(matches(
|
|
111
|
+
channels: { check: listOf(matches(SLACK_CHANNEL, "a channel ID like C012AB3CD")) },
|
|
112
|
+
dedicated_channels: { check: listOf(matches(SLACK_CHANNEL, "a channel ID like C012AB3CD")) },
|
|
108
113
|
},
|
|
109
114
|
},
|
|
110
115
|
discord: {
|