@notionhq/apps 0.0.27 → 0.0.29
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/AGENTS.md +106 -9
- package/dist/calendar.generated.d.ts +1908 -680
- package/dist/calendar.generated.d.ts.map +1 -1
- package/dist/calendar.generated.js +27 -0
- package/dist/connection-trigger-definitions.generated.d.ts +12 -0
- package/dist/connection-trigger-definitions.generated.d.ts.map +1 -1
- package/dist/connection-trigger-definitions.generated.js +15 -0
- package/dist/connections.d.ts +1 -0
- package/dist/connections.d.ts.map +1 -1
- package/dist/mail.generated.d.ts +4590 -0
- package/dist/mail.generated.d.ts.map +1 -0
- package/dist/mail.generated.js +252 -0
- package/dist/providers.generated.d.ts +4 -0
- package/dist/providers.generated.d.ts.map +1 -1
- package/dist/providers.generated.js +7 -0
- package/dist/triggers.generated.d.ts +34 -16
- package/dist/triggers.generated.d.ts.map +1 -1
- package/dist/triggers.generated.js +12 -9
- package/docs/CONNECTIONS.md +38 -3
- package/package.json +1 -1
- package/skills/connections/SKILL.md +3 -0
- package/src/calendar.generated.ts +2033 -737
- package/src/connection-trigger-definitions.generated.ts +18 -0
- package/src/connections.test.ts +35 -0
- package/src/mail.generated.ts +5095 -0
- package/src/providers.generated.ts +8 -0
- package/src/triggers.generated.ts +27 -18
- package/src/workflow-connections-types.test.ts +16 -0
|
@@ -15,6 +15,24 @@ export const connectionTriggerDefinitions = [
|
|
|
15
15
|
provider: "calendar",
|
|
16
16
|
description: "Triggers immediately when a calendar event is canceled",
|
|
17
17
|
},
|
|
18
|
+
{
|
|
19
|
+
type: "mail.email.received",
|
|
20
|
+
provider: "mail",
|
|
21
|
+
description:
|
|
22
|
+
"Triggers immediately when a new email is received in Notion Mail",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: "mail.email.sent",
|
|
26
|
+
provider: "mail",
|
|
27
|
+
description:
|
|
28
|
+
"Triggers immediately when a new email is sent from Notion Mail",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: "mail.label.applied",
|
|
32
|
+
provider: "mail",
|
|
33
|
+
description:
|
|
34
|
+
"Triggers immediately when a label is applied to an email in Notion Mail",
|
|
35
|
+
},
|
|
18
36
|
{
|
|
19
37
|
type: "slack.message",
|
|
20
38
|
provider: "slack",
|
package/src/connections.test.ts
CHANGED
|
@@ -57,6 +57,41 @@ describe("connection requirements", () => {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
describe("workflow connection runtime", () => {
|
|
60
|
+
it("uses the configured Mail binding and preserves pagination and tool results", async () => {
|
|
61
|
+
vi.stubEnv(
|
|
62
|
+
"NOTION_CONNECTION_BINDINGS",
|
|
63
|
+
JSON.stringify([{ key: "inbox", type: "mail", id: "mail-id" }]),
|
|
64
|
+
);
|
|
65
|
+
const notion = new Client({ auth: "test" });
|
|
66
|
+
const result = {
|
|
67
|
+
name: "search_emails",
|
|
68
|
+
content: [{ type: "text", text: "Mailbox search results" }],
|
|
69
|
+
structuredContent: { threads: [], nextPageToken: "next" },
|
|
70
|
+
};
|
|
71
|
+
const request = vi.spyOn(notion, "request").mockResolvedValue({ result });
|
|
72
|
+
const runtime = createWorkflowConnections(notion, { inbox: connections.mail() });
|
|
73
|
+
expect(
|
|
74
|
+
await runtime.inbox.searchEmails({
|
|
75
|
+
userEmailAddress: "mail@example.com",
|
|
76
|
+
query: "is:unread",
|
|
77
|
+
pageToken: "previous",
|
|
78
|
+
}),
|
|
79
|
+
).toEqual(result);
|
|
80
|
+
expect(request).toHaveBeenCalledWith({
|
|
81
|
+
path: "tools/run/internal",
|
|
82
|
+
method: "post",
|
|
83
|
+
body: {
|
|
84
|
+
connection: "mail-id",
|
|
85
|
+
action: "searchEmails",
|
|
86
|
+
args: {
|
|
87
|
+
userEmailAddress: "mail@example.com",
|
|
88
|
+
query: "is:unread",
|
|
89
|
+
pageToken: "previous",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
60
95
|
it("invokes separate bindings for multiple keys of the same provider", async () => {
|
|
61
96
|
vi.stubEnv(
|
|
62
97
|
"NOTION_CONNECTION_BINDINGS",
|