@notionhq/apps 0.0.13 → 0.0.15
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/README.md +110 -49
- package/dist/box.generated.d.ts +164 -0
- package/dist/box.generated.d.ts.map +1 -0
- package/dist/box.generated.js +24 -0
- package/dist/calendar.generated.d.ts +1036 -0
- package/dist/calendar.generated.d.ts.map +1 -0
- package/dist/calendar.generated.js +42 -0
- package/dist/cli/build.js +7 -6
- package/dist/cli/emit-manifest.d.ts.map +1 -1
- package/dist/cli/emit-manifest.js +1 -4
- package/dist/confluence.generated.d.ts +98 -0
- package/dist/confluence.generated.d.ts.map +1 -0
- package/dist/confluence.generated.js +18 -0
- package/dist/connection-actions.d.ts +2 -0
- package/dist/connection-actions.d.ts.map +1 -0
- package/dist/connection-actions.js +0 -0
- package/dist/connection-trigger-definitions.generated.d.ts +34 -0
- package/dist/connection-trigger-definitions.generated.d.ts.map +1 -0
- package/dist/connection-trigger-definitions.generated.js +45 -0
- package/dist/connections.d.ts +15 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +79 -0
- package/dist/connections.test.d.ts +2 -0
- package/dist/connections.test.d.ts.map +1 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -0
- package/dist/context.test.d.ts +2 -0
- package/dist/context.test.d.ts.map +1 -0
- package/dist/cursor.generated.d.ts +154 -0
- package/dist/cursor.generated.d.ts.map +1 -0
- package/dist/cursor.generated.js +18 -0
- package/dist/custom-block.d.ts +1 -1
- package/dist/custom-block.d.ts.map +1 -1
- package/dist/custom-block.js +3 -3
- package/dist/discord.generated.d.ts +279 -0
- package/dist/discord.generated.d.ts.map +1 -0
- package/dist/discord.generated.js +33 -0
- package/dist/gmail.generated.d.ts +184 -0
- package/dist/gmail.generated.d.ts.map +1 -0
- package/dist/gmail.generated.js +21 -0
- package/dist/googleCalendar.generated.d.ts +83 -0
- package/dist/googleCalendar.generated.d.ts.map +1 -0
- package/dist/googleCalendar.generated.js +15 -0
- package/dist/googleDrive.generated.d.ts +210 -0
- package/dist/googleDrive.generated.d.ts.map +1 -0
- package/dist/googleDrive.generated.js +27 -0
- package/dist/googleDriveOauth.generated.d.ts +851 -0
- package/dist/googleDriveOauth.generated.d.ts.map +1 -0
- package/dist/googleDriveOauth.generated.js +84 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/outlook.generated.d.ts +224 -0
- package/dist/outlook.generated.d.ts.map +1 -0
- package/dist/outlook.generated.js +24 -0
- package/dist/providers.generated.d.ts +117 -0
- package/dist/providers.generated.d.ts.map +1 -0
- package/dist/providers.generated.js +108 -0
- package/dist/salesforce.generated.d.ts +151 -0
- package/dist/salesforce.generated.d.ts.map +1 -0
- package/dist/salesforce.generated.js +24 -0
- package/dist/slack.generated.d.ts +290 -0
- package/dist/slack.generated.d.ts.map +1 -0
- package/dist/slack.generated.js +30 -0
- package/dist/sync.d.ts +2 -2
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +3 -3
- package/dist/triggers.generated.d.ts +107 -32
- package/dist/triggers.generated.d.ts.map +1 -1
- package/dist/triggers.generated.js +36 -24
- package/dist/workflow-connections-types.test.d.ts +2 -0
- package/dist/workflow-connections-types.test.d.ts.map +1 -0
- package/dist/workflow-types.test.d.ts +2 -0
- package/dist/workflow-types.test.d.ts.map +1 -0
- package/dist/workflow.d.ts +24 -20
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +16 -19
- package/docs/BUILD.md +83 -14
- package/docs/CONNECTIONS.md +130 -0
- package/package.json +5 -1
- package/src/box.generated.ts +187 -0
- package/src/calendar.generated.ts +1117 -0
- package/src/cli/build.test.ts +35 -4
- package/src/cli/build.ts +6 -5
- package/src/cli/emit-manifest.ts +1 -5
- package/src/confluence.generated.ts +109 -0
- package/src/connection-actions.ts +2 -0
- package/src/connection-trigger-definitions.generated.ts +48 -0
- package/src/connections.test.ts +157 -0
- package/src/connections.ts +126 -0
- package/src/context.test.ts +26 -0
- package/src/context.ts +8 -0
- package/src/cursor.generated.ts +167 -0
- package/src/custom-block.test.ts +4 -4
- package/src/custom-block.ts +2 -2
- package/src/discord.generated.ts +318 -0
- package/src/gmail.generated.ts +205 -0
- package/src/googleCalendar.generated.ts +95 -0
- package/src/googleDrive.generated.ts +235 -0
- package/src/googleDriveOauth.generated.ts +980 -0
- package/src/index.ts +7 -0
- package/src/outlook.generated.ts +249 -0
- package/src/providers.generated.ts +207 -0
- package/src/salesforce.generated.ts +170 -0
- package/src/slack.generated.ts +330 -0
- package/src/sync.ts +2 -2
- package/src/triggers.generated.ts +112 -32
- package/src/workflow-connections-types.test.ts +59 -0
- package/src/workflow-types.test.ts +144 -0
- package/src/workflow.test.ts +135 -25
- package/src/workflow.ts +63 -34
package/src/index.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { customBlock } from "./custom-block.js";
|
|
2
|
+
export { customAgent } from "./notion-as-code/custom-agent.js";
|
|
3
|
+
export { database } from "./notion-as-code/database.js";
|
|
4
|
+
export { page } from "./notion-as-code/page.js";
|
|
5
|
+
export { teamspace } from "./notion-as-code/teamspace.js";
|
|
6
|
+
export { sync } from "./sync.js";
|
|
7
|
+
export { workflow } from "./workflow.js";
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
// Generated by notion tool-core codegen-script-types --connections. Do not edit.
|
|
2
|
+
import type { ConnectionActionInvoker } from "./connection-actions.js"
|
|
3
|
+
/**
|
|
4
|
+
* Script input for the "Load Outlook message" effect (`outlook.loadMessage`),
|
|
5
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
6
|
+
*
|
|
7
|
+
* Load an Outlook message.
|
|
8
|
+
*/
|
|
9
|
+
export type LoadMessageScriptInput = {
|
|
10
|
+
/**
|
|
11
|
+
* Outlook message ID.
|
|
12
|
+
*/
|
|
13
|
+
messageId: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Canonical Tool Core output for the "Load Outlook message" effect (`outlook.loadMessage`).
|
|
18
|
+
* This is the definition's output schema; the effect's script surface may
|
|
19
|
+
* re-encode it before returning.
|
|
20
|
+
*/
|
|
21
|
+
export type LoadMessageScriptOutput = {
|
|
22
|
+
type: "outlook"
|
|
23
|
+
threadId: string
|
|
24
|
+
subject: string
|
|
25
|
+
messages: Array<{
|
|
26
|
+
user: {
|
|
27
|
+
name: string
|
|
28
|
+
notionUserId?: string
|
|
29
|
+
notionUserName?: string
|
|
30
|
+
}
|
|
31
|
+
text: string
|
|
32
|
+
subject?: string
|
|
33
|
+
timestamp: number
|
|
34
|
+
attachments?: Array<{
|
|
35
|
+
attachmentId?: string
|
|
36
|
+
filename: string
|
|
37
|
+
mimeType: string
|
|
38
|
+
sizeBytes: number
|
|
39
|
+
inline: boolean
|
|
40
|
+
}>
|
|
41
|
+
}>
|
|
42
|
+
timestamp: number
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Script input for the "Load Outlook thread" effect (`outlook.loadThread`),
|
|
47
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
48
|
+
*
|
|
49
|
+
* Load an Outlook thread.
|
|
50
|
+
*/
|
|
51
|
+
export type LoadThreadScriptInput = {
|
|
52
|
+
/**
|
|
53
|
+
* Outlook conversation (thread) ID.
|
|
54
|
+
*/
|
|
55
|
+
threadId: string
|
|
56
|
+
/**
|
|
57
|
+
* Maximum number of messages to return (default: 50, max: 200).
|
|
58
|
+
*/
|
|
59
|
+
maxResults?: number
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Canonical Tool Core output for the "Load Outlook thread" effect (`outlook.loadThread`).
|
|
64
|
+
* This is the definition's output schema; the effect's script surface may
|
|
65
|
+
* re-encode it before returning.
|
|
66
|
+
*/
|
|
67
|
+
export type LoadThreadScriptOutput = {
|
|
68
|
+
type: "outlook"
|
|
69
|
+
threadId: string
|
|
70
|
+
subject: string
|
|
71
|
+
messages: Array<{
|
|
72
|
+
user: {
|
|
73
|
+
name: string
|
|
74
|
+
notionUserId?: string
|
|
75
|
+
notionUserName?: string
|
|
76
|
+
}
|
|
77
|
+
text: string
|
|
78
|
+
subject?: string
|
|
79
|
+
timestamp: number
|
|
80
|
+
attachments?: Array<{
|
|
81
|
+
attachmentId?: string
|
|
82
|
+
filename: string
|
|
83
|
+
mimeType: string
|
|
84
|
+
sizeBytes: number
|
|
85
|
+
inline: boolean
|
|
86
|
+
}>
|
|
87
|
+
}>
|
|
88
|
+
timestamp: number
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Script input for the "Query Outlook" effect (`outlook.query`),
|
|
93
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
94
|
+
*
|
|
95
|
+
* Query Outlook messages.
|
|
96
|
+
*/
|
|
97
|
+
export type QueryScriptInput = {
|
|
98
|
+
/**
|
|
99
|
+
* Outlook search query string. Supports keywords and AQS operators (from:, to:, subject:, received:).
|
|
100
|
+
*/
|
|
101
|
+
q?: string
|
|
102
|
+
/**
|
|
103
|
+
* Maximum number of messages to return (default: 20, max: 100).
|
|
104
|
+
*/
|
|
105
|
+
maxResults?: number
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Canonical Tool Core output for the "Query Outlook" effect (`outlook.query`).
|
|
110
|
+
* This is the definition's output schema; the effect's script surface may
|
|
111
|
+
* re-encode it before returning.
|
|
112
|
+
*/
|
|
113
|
+
export type QueryScriptOutput = {
|
|
114
|
+
messages: Array<{
|
|
115
|
+
type: "outlook"
|
|
116
|
+
threadId: string
|
|
117
|
+
subject: string
|
|
118
|
+
messages: Array<{
|
|
119
|
+
user: {
|
|
120
|
+
name: string
|
|
121
|
+
notionUserId?: string
|
|
122
|
+
notionUserName?: string
|
|
123
|
+
}
|
|
124
|
+
text: string
|
|
125
|
+
subject?: string
|
|
126
|
+
timestamp: number
|
|
127
|
+
attachments?: Array<{
|
|
128
|
+
attachmentId?: string
|
|
129
|
+
filename: string
|
|
130
|
+
mimeType: string
|
|
131
|
+
sizeBytes: number
|
|
132
|
+
inline: boolean
|
|
133
|
+
}>
|
|
134
|
+
}>
|
|
135
|
+
timestamp: number
|
|
136
|
+
}>
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Script input for the "Read Outlook attachment" effect (`outlook.readAttachment`),
|
|
141
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
142
|
+
*
|
|
143
|
+
* Read an Outlook attachment.
|
|
144
|
+
*/
|
|
145
|
+
export type ReadAttachmentScriptInput = {
|
|
146
|
+
/**
|
|
147
|
+
* Outlook message ID from loadMessage or loadThread.
|
|
148
|
+
*/
|
|
149
|
+
messageId: string
|
|
150
|
+
/**
|
|
151
|
+
* Optional attachment filename from loadMessage or loadThread. Useful as a fallback when an attachmentId is unavailable.
|
|
152
|
+
*/
|
|
153
|
+
filename?: string
|
|
154
|
+
/**
|
|
155
|
+
* Optional Outlook attachment ID from loadMessage or loadThread. Use it when present to target a specific attachment.
|
|
156
|
+
*/
|
|
157
|
+
attachmentId?: string
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Canonical Tool Core output for the "Read Outlook attachment" effect (`outlook.readAttachment`).
|
|
162
|
+
* This is the definition's output schema; the effect's script surface may
|
|
163
|
+
* re-encode it before returning.
|
|
164
|
+
*/
|
|
165
|
+
export type ReadAttachmentScriptOutput = {
|
|
166
|
+
type: "outlook"
|
|
167
|
+
items: Array<
|
|
168
|
+
| {
|
|
169
|
+
attachmentId?: string
|
|
170
|
+
filename: string
|
|
171
|
+
mimeType: string
|
|
172
|
+
sizeBytes: number
|
|
173
|
+
inline: boolean
|
|
174
|
+
contentType: "attachment"
|
|
175
|
+
message: string
|
|
176
|
+
}
|
|
177
|
+
| {
|
|
178
|
+
attachmentId?: string
|
|
179
|
+
filename: string
|
|
180
|
+
mimeType: string
|
|
181
|
+
sizeBytes: number
|
|
182
|
+
inline: boolean
|
|
183
|
+
contentType: "text"
|
|
184
|
+
text: string
|
|
185
|
+
}
|
|
186
|
+
| {
|
|
187
|
+
attachmentId?: string
|
|
188
|
+
filename: string
|
|
189
|
+
mimeType: string
|
|
190
|
+
sizeBytes: number
|
|
191
|
+
inline: boolean
|
|
192
|
+
contentType: "unsupported"
|
|
193
|
+
message: string
|
|
194
|
+
}
|
|
195
|
+
>
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Script input for the "Search Outlook" effect (`outlook.search`),
|
|
200
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
201
|
+
*
|
|
202
|
+
* Search Outlook via the configured connector.
|
|
203
|
+
*/
|
|
204
|
+
export type SearchScriptInput = {
|
|
205
|
+
/**
|
|
206
|
+
* Search query for Outlook.
|
|
207
|
+
*/
|
|
208
|
+
query: string
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Canonical Tool Core output for the "Search Outlook" effect (`outlook.search`).
|
|
213
|
+
* This is the definition's output schema; the effect's script surface may
|
|
214
|
+
* re-encode it before returning.
|
|
215
|
+
*/
|
|
216
|
+
export type SearchScriptOutput = {
|
|
217
|
+
results: Array<{
|
|
218
|
+
id: string
|
|
219
|
+
title: string
|
|
220
|
+
path: string
|
|
221
|
+
text: string
|
|
222
|
+
lastEdited: string
|
|
223
|
+
isPrivate: boolean
|
|
224
|
+
pageId: string
|
|
225
|
+
emailAddress: string
|
|
226
|
+
url: string
|
|
227
|
+
}>
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export class OutlookConnectionClient {
|
|
231
|
+
constructor(private readonly invoke: ConnectionActionInvoker) {}
|
|
232
|
+
loadMessage(args: LoadMessageScriptInput): Promise<LoadMessageScriptOutput> {
|
|
233
|
+
return this.invoke<LoadMessageScriptOutput>("loadMessage", args)
|
|
234
|
+
}
|
|
235
|
+
loadThread(args: LoadThreadScriptInput): Promise<LoadThreadScriptOutput> {
|
|
236
|
+
return this.invoke<LoadThreadScriptOutput>("loadThread", args)
|
|
237
|
+
}
|
|
238
|
+
query(args: QueryScriptInput): Promise<QueryScriptOutput> {
|
|
239
|
+
return this.invoke<QueryScriptOutput>("query", args)
|
|
240
|
+
}
|
|
241
|
+
readAttachment(
|
|
242
|
+
args: ReadAttachmentScriptInput,
|
|
243
|
+
): Promise<ReadAttachmentScriptOutput> {
|
|
244
|
+
return this.invoke<ReadAttachmentScriptOutput>("readAttachment", args)
|
|
245
|
+
}
|
|
246
|
+
search(args: SearchScriptInput): Promise<SearchScriptOutput> {
|
|
247
|
+
return this.invoke<SearchScriptOutput>("search", args)
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// Generated by notion tool-core codegen-script-types --connections. Do not edit.
|
|
2
|
+
import type { ConnectionActionInvoker } from "./connection-actions.js"
|
|
3
|
+
import type { WorkflowConnection } from "./connections.js"
|
|
4
|
+
import { CalendarConnectionClient } from "./calendar.generated.js"
|
|
5
|
+
import { SlackConnectionClient } from "./slack.generated.js"
|
|
6
|
+
import { GoogleDriveOauthConnectionClient } from "./googleDriveOauth.generated.js"
|
|
7
|
+
import { DiscordConnectionClient } from "./discord.generated.js"
|
|
8
|
+
import { CursorConnectionClient } from "./cursor.generated.js"
|
|
9
|
+
import { BoxConnectionClient } from "./box.generated.js"
|
|
10
|
+
import { ConfluenceConnectionClient } from "./confluence.generated.js"
|
|
11
|
+
import { GmailConnectionClient } from "./gmail.generated.js"
|
|
12
|
+
import { GoogleCalendarConnectionClient } from "./googleCalendar.generated.js"
|
|
13
|
+
import { GoogleDriveConnectionClient } from "./googleDrive.generated.js"
|
|
14
|
+
import { OutlookConnectionClient } from "./outlook.generated.js"
|
|
15
|
+
import { SalesforceConnectionClient } from "./salesforce.generated.js"
|
|
16
|
+
export const connections = {
|
|
17
|
+
calendar,
|
|
18
|
+
slack,
|
|
19
|
+
googleDriveOauth,
|
|
20
|
+
discord,
|
|
21
|
+
cursor,
|
|
22
|
+
box,
|
|
23
|
+
confluence,
|
|
24
|
+
gmail,
|
|
25
|
+
googleCalendar,
|
|
26
|
+
googleDrive,
|
|
27
|
+
outlook,
|
|
28
|
+
salesforce,
|
|
29
|
+
}
|
|
30
|
+
export type ConnectionProviders = {
|
|
31
|
+
calendar(key?: string): CalendarConnectionClient
|
|
32
|
+
slack(key?: string): SlackConnectionClient
|
|
33
|
+
googleDriveOauth(key?: string): GoogleDriveOauthConnectionClient
|
|
34
|
+
discord(key?: string): DiscordConnectionClient
|
|
35
|
+
cursor(key?: string): CursorConnectionClient
|
|
36
|
+
box(key?: string): BoxConnectionClient
|
|
37
|
+
confluence(key?: string): ConfluenceConnectionClient
|
|
38
|
+
gmail(key?: string): GmailConnectionClient
|
|
39
|
+
googleCalendar(key?: string): GoogleCalendarConnectionClient
|
|
40
|
+
googleDrive(key?: string): GoogleDriveConnectionClient
|
|
41
|
+
outlook(key?: string): OutlookConnectionClient
|
|
42
|
+
salesforce(key?: string): SalesforceConnectionClient
|
|
43
|
+
}
|
|
44
|
+
export function createConnectionProviders(
|
|
45
|
+
invoker: (provider: string, key: string) => ConnectionActionInvoker,
|
|
46
|
+
): ConnectionProviders {
|
|
47
|
+
return {
|
|
48
|
+
calendar(key = "calendar"): CalendarConnectionClient {
|
|
49
|
+
return new CalendarConnectionClient(invoker("calendar", key))
|
|
50
|
+
},
|
|
51
|
+
slack(key = "slack"): SlackConnectionClient {
|
|
52
|
+
return new SlackConnectionClient(invoker("slack", key))
|
|
53
|
+
},
|
|
54
|
+
googleDriveOauth(
|
|
55
|
+
key = "googleDriveOauth",
|
|
56
|
+
): GoogleDriveOauthConnectionClient {
|
|
57
|
+
return new GoogleDriveOauthConnectionClient(
|
|
58
|
+
invoker("googleDriveOauth", key),
|
|
59
|
+
)
|
|
60
|
+
},
|
|
61
|
+
discord(key = "discord"): DiscordConnectionClient {
|
|
62
|
+
return new DiscordConnectionClient(invoker("discord", key))
|
|
63
|
+
},
|
|
64
|
+
cursor(key = "cursor"): CursorConnectionClient {
|
|
65
|
+
return new CursorConnectionClient(invoker("cursor", key))
|
|
66
|
+
},
|
|
67
|
+
box(key = "box"): BoxConnectionClient {
|
|
68
|
+
return new BoxConnectionClient(invoker("box", key))
|
|
69
|
+
},
|
|
70
|
+
confluence(key = "confluence"): ConfluenceConnectionClient {
|
|
71
|
+
return new ConfluenceConnectionClient(invoker("confluence", key))
|
|
72
|
+
},
|
|
73
|
+
gmail(key = "gmail"): GmailConnectionClient {
|
|
74
|
+
return new GmailConnectionClient(invoker("gmail", key))
|
|
75
|
+
},
|
|
76
|
+
googleCalendar(key = "googleCalendar"): GoogleCalendarConnectionClient {
|
|
77
|
+
return new GoogleCalendarConnectionClient(invoker("googleCalendar", key))
|
|
78
|
+
},
|
|
79
|
+
googleDrive(key = "googleDrive"): GoogleDriveConnectionClient {
|
|
80
|
+
return new GoogleDriveConnectionClient(invoker("googleDrive", key))
|
|
81
|
+
},
|
|
82
|
+
outlook(key = "outlook"): OutlookConnectionClient {
|
|
83
|
+
return new OutlookConnectionClient(invoker("outlook", key))
|
|
84
|
+
},
|
|
85
|
+
salesforce(key = "salesforce"): SalesforceConnectionClient {
|
|
86
|
+
return new SalesforceConnectionClient(invoker("salesforce", key))
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function calendar(options?: {
|
|
91
|
+
key?: never
|
|
92
|
+
}): WorkflowConnection<"calendar", "calendar">
|
|
93
|
+
function calendar<const TKey extends string>(options: {
|
|
94
|
+
key: TKey
|
|
95
|
+
}): WorkflowConnection<"calendar", TKey>
|
|
96
|
+
function calendar(
|
|
97
|
+
options: { key?: string } = {},
|
|
98
|
+
): WorkflowConnection<"calendar"> {
|
|
99
|
+
return { type: "calendar", ...options }
|
|
100
|
+
}
|
|
101
|
+
function slack(options?: { key?: never }): WorkflowConnection<"slack", "slack">
|
|
102
|
+
function slack<const TKey extends string>(options: {
|
|
103
|
+
key: TKey
|
|
104
|
+
}): WorkflowConnection<"slack", TKey>
|
|
105
|
+
function slack(options: { key?: string } = {}): WorkflowConnection<"slack"> {
|
|
106
|
+
return { type: "slack", ...options }
|
|
107
|
+
}
|
|
108
|
+
function googleDriveOauth(options?: {
|
|
109
|
+
key?: never
|
|
110
|
+
}): WorkflowConnection<"googleDriveOauth", "googleDriveOauth">
|
|
111
|
+
function googleDriveOauth<const TKey extends string>(options: {
|
|
112
|
+
key: TKey
|
|
113
|
+
}): WorkflowConnection<"googleDriveOauth", TKey>
|
|
114
|
+
function googleDriveOauth(
|
|
115
|
+
options: { key?: string } = {},
|
|
116
|
+
): WorkflowConnection<"googleDriveOauth"> {
|
|
117
|
+
return { type: "googleDriveOauth", ...options }
|
|
118
|
+
}
|
|
119
|
+
function discord(options?: {
|
|
120
|
+
key?: never
|
|
121
|
+
}): WorkflowConnection<"discord", "discord">
|
|
122
|
+
function discord<const TKey extends string>(options: {
|
|
123
|
+
key: TKey
|
|
124
|
+
}): WorkflowConnection<"discord", TKey>
|
|
125
|
+
function discord(
|
|
126
|
+
options: { key?: string } = {},
|
|
127
|
+
): WorkflowConnection<"discord"> {
|
|
128
|
+
return { type: "discord", ...options }
|
|
129
|
+
}
|
|
130
|
+
function cursor(options?: {
|
|
131
|
+
key?: never
|
|
132
|
+
}): WorkflowConnection<"cursor", "cursor">
|
|
133
|
+
function cursor<const TKey extends string>(options: {
|
|
134
|
+
key: TKey
|
|
135
|
+
}): WorkflowConnection<"cursor", TKey>
|
|
136
|
+
function cursor(options: { key?: string } = {}): WorkflowConnection<"cursor"> {
|
|
137
|
+
return { type: "cursor", ...options }
|
|
138
|
+
}
|
|
139
|
+
function box(options?: { key?: never }): WorkflowConnection<"box", "box">
|
|
140
|
+
function box<const TKey extends string>(options: {
|
|
141
|
+
key: TKey
|
|
142
|
+
}): WorkflowConnection<"box", TKey>
|
|
143
|
+
function box(options: { key?: string } = {}): WorkflowConnection<"box"> {
|
|
144
|
+
return { type: "box", ...options }
|
|
145
|
+
}
|
|
146
|
+
function confluence(options?: {
|
|
147
|
+
key?: never
|
|
148
|
+
}): WorkflowConnection<"confluence", "confluence">
|
|
149
|
+
function confluence<const TKey extends string>(options: {
|
|
150
|
+
key: TKey
|
|
151
|
+
}): WorkflowConnection<"confluence", TKey>
|
|
152
|
+
function confluence(
|
|
153
|
+
options: { key?: string } = {},
|
|
154
|
+
): WorkflowConnection<"confluence"> {
|
|
155
|
+
return { type: "confluence", ...options }
|
|
156
|
+
}
|
|
157
|
+
function gmail(options?: { key?: never }): WorkflowConnection<"gmail", "gmail">
|
|
158
|
+
function gmail<const TKey extends string>(options: {
|
|
159
|
+
key: TKey
|
|
160
|
+
}): WorkflowConnection<"gmail", TKey>
|
|
161
|
+
function gmail(options: { key?: string } = {}): WorkflowConnection<"gmail"> {
|
|
162
|
+
return { type: "gmail", ...options }
|
|
163
|
+
}
|
|
164
|
+
function googleCalendar(options?: {
|
|
165
|
+
key?: never
|
|
166
|
+
}): WorkflowConnection<"googleCalendar", "googleCalendar">
|
|
167
|
+
function googleCalendar<const TKey extends string>(options: {
|
|
168
|
+
key: TKey
|
|
169
|
+
}): WorkflowConnection<"googleCalendar", TKey>
|
|
170
|
+
function googleCalendar(
|
|
171
|
+
options: { key?: string } = {},
|
|
172
|
+
): WorkflowConnection<"googleCalendar"> {
|
|
173
|
+
return { type: "googleCalendar", ...options }
|
|
174
|
+
}
|
|
175
|
+
function googleDrive(options?: {
|
|
176
|
+
key?: never
|
|
177
|
+
}): WorkflowConnection<"googleDrive", "googleDrive">
|
|
178
|
+
function googleDrive<const TKey extends string>(options: {
|
|
179
|
+
key: TKey
|
|
180
|
+
}): WorkflowConnection<"googleDrive", TKey>
|
|
181
|
+
function googleDrive(
|
|
182
|
+
options: { key?: string } = {},
|
|
183
|
+
): WorkflowConnection<"googleDrive"> {
|
|
184
|
+
return { type: "googleDrive", ...options }
|
|
185
|
+
}
|
|
186
|
+
function outlook(options?: {
|
|
187
|
+
key?: never
|
|
188
|
+
}): WorkflowConnection<"outlook", "outlook">
|
|
189
|
+
function outlook<const TKey extends string>(options: {
|
|
190
|
+
key: TKey
|
|
191
|
+
}): WorkflowConnection<"outlook", TKey>
|
|
192
|
+
function outlook(
|
|
193
|
+
options: { key?: string } = {},
|
|
194
|
+
): WorkflowConnection<"outlook"> {
|
|
195
|
+
return { type: "outlook", ...options }
|
|
196
|
+
}
|
|
197
|
+
function salesforce(options?: {
|
|
198
|
+
key?: never
|
|
199
|
+
}): WorkflowConnection<"salesforce", "salesforce">
|
|
200
|
+
function salesforce<const TKey extends string>(options: {
|
|
201
|
+
key: TKey
|
|
202
|
+
}): WorkflowConnection<"salesforce", TKey>
|
|
203
|
+
function salesforce(
|
|
204
|
+
options: { key?: string } = {},
|
|
205
|
+
): WorkflowConnection<"salesforce"> {
|
|
206
|
+
return { type: "salesforce", ...options }
|
|
207
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Generated by notion tool-core codegen-script-types --connections. Do not edit.
|
|
2
|
+
import type { ConnectionActionInvoker } from "./connection-actions.js"
|
|
3
|
+
/**
|
|
4
|
+
* Script input for the "Find Salesforce user IDs" effect (`salesforce.findUserIds`),
|
|
5
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
6
|
+
*
|
|
7
|
+
* Find matching Salesforce users and their IDs.
|
|
8
|
+
*/
|
|
9
|
+
export type FindUserIdsScriptInput = {
|
|
10
|
+
/**
|
|
11
|
+
* Partial name or email to match Salesforce users.
|
|
12
|
+
*/
|
|
13
|
+
nameOrEmail: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Canonical Tool Core output for the "Find Salesforce user IDs" effect (`salesforce.findUserIds`).
|
|
18
|
+
* This is the definition's output schema; the effect's script surface may
|
|
19
|
+
* re-encode it before returning.
|
|
20
|
+
*/
|
|
21
|
+
export type FindUserIdsScriptOutput = {
|
|
22
|
+
users?: Array<{
|
|
23
|
+
id: string
|
|
24
|
+
name: string
|
|
25
|
+
email: string
|
|
26
|
+
}>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Script input for the "Get Salesforce sample" effect (`salesforce.getSample`),
|
|
31
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
32
|
+
*
|
|
33
|
+
* Get accessible Salesforce objects and sample records.
|
|
34
|
+
*/
|
|
35
|
+
export type GetSampleScriptInput = {
|
|
36
|
+
/**
|
|
37
|
+
* Object API name to fetch sample records for.
|
|
38
|
+
*/
|
|
39
|
+
targetObject?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Canonical Tool Core output for the "Get Salesforce sample" effect (`salesforce.getSample`).
|
|
44
|
+
* This is the definition's output schema; the effect's script surface may
|
|
45
|
+
* re-encode it before returning.
|
|
46
|
+
*/
|
|
47
|
+
export type GetSampleScriptOutput = {
|
|
48
|
+
objects: Array<string>
|
|
49
|
+
sample?: {
|
|
50
|
+
object: string
|
|
51
|
+
sampleRecords?: Array<{
|
|
52
|
+
Id?: string
|
|
53
|
+
name?: string
|
|
54
|
+
attributes?: Record<string, unknown>
|
|
55
|
+
}>
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Script input for the "Load Salesforce record" effect (`salesforce.loadRecord`),
|
|
61
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
62
|
+
*
|
|
63
|
+
* Load a Salesforce record.
|
|
64
|
+
*/
|
|
65
|
+
export type LoadRecordScriptInput = {
|
|
66
|
+
/**
|
|
67
|
+
* Salesforce record ID (for example, 001xx000003DGbY).
|
|
68
|
+
*/
|
|
69
|
+
recordId: string
|
|
70
|
+
/**
|
|
71
|
+
* Salesforce object type for the record (for example, Account or Opportunity).
|
|
72
|
+
*/
|
|
73
|
+
objectType: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Canonical Tool Core output for the "Load Salesforce record" effect (`salesforce.loadRecord`).
|
|
78
|
+
* This is the definition's output schema; the effect's script surface may
|
|
79
|
+
* re-encode it before returning.
|
|
80
|
+
*/
|
|
81
|
+
export type LoadRecordScriptOutput = {
|
|
82
|
+
type: "salesforce-record"
|
|
83
|
+
title: string
|
|
84
|
+
blocks: Array<string>
|
|
85
|
+
recordId: string
|
|
86
|
+
objectType: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Script input for the "Search Salesforce" effect (`salesforce.search`),
|
|
91
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
92
|
+
*
|
|
93
|
+
* Search Salesforce via the configured connector.
|
|
94
|
+
*/
|
|
95
|
+
export type SearchScriptInput = {
|
|
96
|
+
/**
|
|
97
|
+
* What to search for.
|
|
98
|
+
*/
|
|
99
|
+
question: string
|
|
100
|
+
/**
|
|
101
|
+
* Keywords to use instead of the question.
|
|
102
|
+
*/
|
|
103
|
+
keywords?: string
|
|
104
|
+
/**
|
|
105
|
+
* Optional time window. Use only "default", "all_time", a duration matching /^\d+[dwmy]$/ (for example, "7d", "2w", "3m", or "1y"), or a date in "YYYY-MM-DD" format. Do not use natural-language durations or combine units.
|
|
106
|
+
*/
|
|
107
|
+
lookback?: string
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Canonical Tool Core output for the "Search Salesforce" effect (`salesforce.search`).
|
|
112
|
+
* This is the definition's output schema; the effect's script surface may
|
|
113
|
+
* re-encode it before returning.
|
|
114
|
+
*/
|
|
115
|
+
export type SearchScriptOutput = {
|
|
116
|
+
results: Array<{
|
|
117
|
+
id: string
|
|
118
|
+
title: string
|
|
119
|
+
path: string
|
|
120
|
+
text: string
|
|
121
|
+
lastEdited: string
|
|
122
|
+
isPrivate: boolean
|
|
123
|
+
pageId: string
|
|
124
|
+
objectType: string
|
|
125
|
+
}>
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Script input for the "Query Salesforce" effect (`salesforce.soqlQuery`),
|
|
130
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
131
|
+
*
|
|
132
|
+
* Run a SOQL query and return rows.
|
|
133
|
+
*/
|
|
134
|
+
export type SoqlQueryScriptInput = {
|
|
135
|
+
/**
|
|
136
|
+
* SOQL query string. Only read-only SELECT queries are supported.
|
|
137
|
+
*/
|
|
138
|
+
query: string
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Canonical Tool Core output for the "Query Salesforce" effect (`salesforce.soqlQuery`).
|
|
143
|
+
* This is the definition's output schema; the effect's script surface may
|
|
144
|
+
* re-encode it before returning.
|
|
145
|
+
*/
|
|
146
|
+
export type SoqlQueryScriptOutput = {
|
|
147
|
+
results: Array<string>
|
|
148
|
+
content: string
|
|
149
|
+
query: string
|
|
150
|
+
domain: string
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export class SalesforceConnectionClient {
|
|
154
|
+
constructor(private readonly invoke: ConnectionActionInvoker) {}
|
|
155
|
+
findUserIds(args: FindUserIdsScriptInput): Promise<FindUserIdsScriptOutput> {
|
|
156
|
+
return this.invoke<FindUserIdsScriptOutput>("findUserIds", args)
|
|
157
|
+
}
|
|
158
|
+
getSample(args: GetSampleScriptInput): Promise<GetSampleScriptOutput> {
|
|
159
|
+
return this.invoke<GetSampleScriptOutput>("getSample", args)
|
|
160
|
+
}
|
|
161
|
+
loadRecord(args: LoadRecordScriptInput): Promise<LoadRecordScriptOutput> {
|
|
162
|
+
return this.invoke<LoadRecordScriptOutput>("loadRecord", args)
|
|
163
|
+
}
|
|
164
|
+
search(args: SearchScriptInput): Promise<SearchScriptOutput> {
|
|
165
|
+
return this.invoke<SearchScriptOutput>("search", args)
|
|
166
|
+
}
|
|
167
|
+
soqlQuery(args: SoqlQueryScriptInput): Promise<SoqlQueryScriptOutput> {
|
|
168
|
+
return this.invoke<SoqlQueryScriptOutput>("soqlQuery", args)
|
|
169
|
+
}
|
|
170
|
+
}
|