Skip to content

Commit 9bf6e59

Browse files
authored
feat: support WebEx and Amazon Chime (#40)
1 parent 4b2e593 commit 9bf6e59

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

src/config.test.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,40 @@ describe("Config", () => {
3636
})
3737
).toMatchObject({ rule: { provider: "Microsoft Teams" } });
3838
});
39+
it("returns Amazon Chime rather than Google Meet", async () => {
40+
const config = await loadConfig();
41+
expect(
42+
config.extractValidUrl({
43+
hangoutLink: "https://meet.google.com/xxx",
44+
description: "https://chime.aws/0000000000",
45+
})
46+
).toMatchObject({ rule: { provider: "Amazon Chime" } });
47+
expect(
48+
config.extractValidUrl({
49+
description: [
50+
"https://meet.google.com/xxx",
51+
"https://chime.aws/0000000000",
52+
].join("\n"),
53+
})
54+
).toMatchObject({ rule: { provider: "Amazon Chime" } });
55+
});
56+
it("returns WebEx rather than Google Meet", async () => {
57+
const config = await loadConfig();
58+
expect(
59+
config.extractValidUrl({
60+
hangoutLink: "https://meet.google.com/xxx",
61+
description: "https://00000.webex.com/00000/j.php?MTID=xxx",
62+
})
63+
).toMatchObject({ rule: { provider: "WebEx" } });
64+
expect(
65+
config.extractValidUrl({
66+
description: [
67+
"https://meet.google.com/xxx",
68+
"https://00000.webex.com/00000/j.php?MTID=xxx",
69+
].join("\n"),
70+
})
71+
).toMatchObject({ rule: { provider: "WebEx" } });
72+
});
3973
it("can extract Google Meet URL from hangoutLink", async () => {
4074
const config = await loadConfig();
4175
expect(
@@ -105,6 +139,24 @@ describe("Config", () => {
105139
});
106140
}
107141
);
142+
it.each(["https://chime.aws/0000000000"])(
143+
"can extract Amazon Chime from description: %s",
144+
async (url) => {
145+
const config = await loadConfig();
146+
expect(config.extractValidUrl({ description: url })).toMatchObject({
147+
rule: { provider: "Amazon Chime" },
148+
});
149+
}
150+
);
151+
it.each(["https://00000.webex.com/00000/j.php?MTID=xxx"])(
152+
"can extract WebEx from description: %s",
153+
async (url) => {
154+
const config = await loadConfig();
155+
expect(config.extractValidUrl({ description: url })).toMatchObject({
156+
rule: { provider: "WebEx" },
157+
});
158+
}
159+
);
108160
it.each(["https://meet.google.com/xxx-xxxx-xxx"])(
109161
"can extract Google Meet from description: %s",
110162
async (url) => {

src/config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@ const urlRules = [
1717
provider: "Zoom Meetings",
1818
},
1919
{
20-
test: /https:\/\/teams\.microsoft\.com\/l\/meetup-join\//,
20+
test: /^https:\/\/teams\.microsoft\.com\/l\/meetup-join\//,
2121
provider: "Microsoft Teams",
2222
},
23+
{
24+
test: /^https:\/\/\d+.webex.com\/\d+\/j.php/,
25+
provider: "WebEx",
26+
},
27+
{
28+
test: /^https:\/\/chime.aws\//,
29+
provider: "Amazon Chime",
30+
},
2331
{
2432
test: /^https:\/\/meet\.google\.com\//,
2533
provider: "Google Meet",

0 commit comments

Comments
 (0)