@notionhq/apps 0.0.42 → 0.0.45
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 +3 -1
- package/dist/connections.d.ts +6 -2
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +9 -0
- package/dist/providers.generated.d.ts +2 -6
- package/dist/providers.generated.d.ts.map +1 -1
- package/dist/providers.generated.js +2 -9
- package/dist/slack.generated.d.ts +178 -0
- package/dist/slack.generated.d.ts.map +1 -1
- package/dist/slack.generated.js +12 -0
- package/package.json +41 -1
- package/skills/connections/SKILL.md +2 -1
- package/src/connections.test.ts +100 -6
- package/src/connections.ts +22 -0
- package/src/providers.generated.ts +8 -11
- package/src/slack.generated.ts +205 -0
- package/src/workflow-connections-types.test.ts +4 -2
- package/src/workflow-types.test.ts +9 -5
- package/src/workflow.test.ts +32 -7
- package/dist/outlook.generated.d.ts +0 -224
- package/dist/outlook.generated.d.ts.map +0 -1
- package/dist/outlook.generated.js +0 -24
- package/src/outlook.generated.ts +0 -249
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import type { ConnectionActionInvoker } from "./connection-actions.js";
|
|
2
|
-
/**
|
|
3
|
-
* Script input for the "Load Outlook message" effect (`outlook.loadMessage`),
|
|
4
|
-
* derived from its Tool Core definition's call_function input projection.
|
|
5
|
-
*
|
|
6
|
-
* Load an Outlook message.
|
|
7
|
-
*/
|
|
8
|
-
export type LoadMessageScriptInput = {
|
|
9
|
-
/**
|
|
10
|
-
* Outlook message ID.
|
|
11
|
-
*/
|
|
12
|
-
messageId: string;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Canonical Tool Core output for the "Load Outlook message" effect (`outlook.loadMessage`).
|
|
16
|
-
* This is the definition's output schema; the effect's script surface may
|
|
17
|
-
* re-encode it before returning.
|
|
18
|
-
*/
|
|
19
|
-
export type LoadMessageScriptOutput = {
|
|
20
|
-
type: "outlook";
|
|
21
|
-
threadId: string;
|
|
22
|
-
subject: string;
|
|
23
|
-
messages: Array<{
|
|
24
|
-
user: {
|
|
25
|
-
name: string;
|
|
26
|
-
notionUserId?: string;
|
|
27
|
-
notionUserName?: string;
|
|
28
|
-
};
|
|
29
|
-
text: string;
|
|
30
|
-
subject?: string;
|
|
31
|
-
timestamp: number;
|
|
32
|
-
attachments?: Array<{
|
|
33
|
-
attachmentId?: string;
|
|
34
|
-
filename: string;
|
|
35
|
-
mimeType: string;
|
|
36
|
-
sizeBytes: number;
|
|
37
|
-
inline: boolean;
|
|
38
|
-
}>;
|
|
39
|
-
}>;
|
|
40
|
-
timestamp: number;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Script input for the "Load Outlook thread" effect (`outlook.loadThread`),
|
|
44
|
-
* derived from its Tool Core definition's call_function input projection.
|
|
45
|
-
*
|
|
46
|
-
* Load an Outlook thread.
|
|
47
|
-
*/
|
|
48
|
-
export type LoadThreadScriptInput = {
|
|
49
|
-
/**
|
|
50
|
-
* Outlook conversation (thread) ID.
|
|
51
|
-
*/
|
|
52
|
-
threadId: string;
|
|
53
|
-
/**
|
|
54
|
-
* Maximum number of messages to return (default: 50, max: 200).
|
|
55
|
-
*/
|
|
56
|
-
maxResults?: number;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Canonical Tool Core output for the "Load Outlook thread" effect (`outlook.loadThread`).
|
|
60
|
-
* This is the definition's output schema; the effect's script surface may
|
|
61
|
-
* re-encode it before returning.
|
|
62
|
-
*/
|
|
63
|
-
export type LoadThreadScriptOutput = {
|
|
64
|
-
type: "outlook";
|
|
65
|
-
threadId: string;
|
|
66
|
-
subject: string;
|
|
67
|
-
messages: Array<{
|
|
68
|
-
user: {
|
|
69
|
-
name: string;
|
|
70
|
-
notionUserId?: string;
|
|
71
|
-
notionUserName?: string;
|
|
72
|
-
};
|
|
73
|
-
text: string;
|
|
74
|
-
subject?: string;
|
|
75
|
-
timestamp: number;
|
|
76
|
-
attachments?: Array<{
|
|
77
|
-
attachmentId?: string;
|
|
78
|
-
filename: string;
|
|
79
|
-
mimeType: string;
|
|
80
|
-
sizeBytes: number;
|
|
81
|
-
inline: boolean;
|
|
82
|
-
}>;
|
|
83
|
-
}>;
|
|
84
|
-
timestamp: number;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* Script input for the "Query Outlook" effect (`outlook.query`),
|
|
88
|
-
* derived from its Tool Core definition's call_function input projection.
|
|
89
|
-
*
|
|
90
|
-
* Query Outlook messages.
|
|
91
|
-
*/
|
|
92
|
-
export type QueryScriptInput = {
|
|
93
|
-
/**
|
|
94
|
-
* Outlook search query string. Supports keywords and AQS operators (from:, to:, subject:, received:).
|
|
95
|
-
*/
|
|
96
|
-
q?: string;
|
|
97
|
-
/**
|
|
98
|
-
* Maximum number of messages to return (default: 20, max: 100).
|
|
99
|
-
*/
|
|
100
|
-
maxResults?: number;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Canonical Tool Core output for the "Query Outlook" effect (`outlook.query`).
|
|
104
|
-
* This is the definition's output schema; the effect's script surface may
|
|
105
|
-
* re-encode it before returning.
|
|
106
|
-
*/
|
|
107
|
-
export type QueryScriptOutput = {
|
|
108
|
-
messages: Array<{
|
|
109
|
-
type: "outlook";
|
|
110
|
-
threadId: string;
|
|
111
|
-
subject: string;
|
|
112
|
-
messages: Array<{
|
|
113
|
-
user: {
|
|
114
|
-
name: string;
|
|
115
|
-
notionUserId?: string;
|
|
116
|
-
notionUserName?: string;
|
|
117
|
-
};
|
|
118
|
-
text: string;
|
|
119
|
-
subject?: string;
|
|
120
|
-
timestamp: number;
|
|
121
|
-
attachments?: Array<{
|
|
122
|
-
attachmentId?: string;
|
|
123
|
-
filename: string;
|
|
124
|
-
mimeType: string;
|
|
125
|
-
sizeBytes: number;
|
|
126
|
-
inline: boolean;
|
|
127
|
-
}>;
|
|
128
|
-
}>;
|
|
129
|
-
timestamp: number;
|
|
130
|
-
}>;
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* Script input for the "Read Outlook attachment" effect (`outlook.readAttachment`),
|
|
134
|
-
* derived from its Tool Core definition's call_function input projection.
|
|
135
|
-
*
|
|
136
|
-
* Read an Outlook attachment.
|
|
137
|
-
*/
|
|
138
|
-
export type ReadAttachmentScriptInput = {
|
|
139
|
-
/**
|
|
140
|
-
* Outlook message ID from loadMessage or loadThread.
|
|
141
|
-
*/
|
|
142
|
-
messageId: string;
|
|
143
|
-
/**
|
|
144
|
-
* Optional attachment filename from loadMessage or loadThread. Useful as a fallback when an attachmentId is unavailable.
|
|
145
|
-
*/
|
|
146
|
-
filename?: string;
|
|
147
|
-
/**
|
|
148
|
-
* Optional Outlook attachment ID from loadMessage or loadThread. Use it when present to target a specific attachment.
|
|
149
|
-
*/
|
|
150
|
-
attachmentId?: string;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* Canonical Tool Core output for the "Read Outlook attachment" effect (`outlook.readAttachment`).
|
|
154
|
-
* This is the definition's output schema; the effect's script surface may
|
|
155
|
-
* re-encode it before returning.
|
|
156
|
-
*/
|
|
157
|
-
export type ReadAttachmentScriptOutput = {
|
|
158
|
-
type: "outlook";
|
|
159
|
-
items: Array<{
|
|
160
|
-
attachmentId?: string;
|
|
161
|
-
filename: string;
|
|
162
|
-
mimeType: string;
|
|
163
|
-
sizeBytes: number;
|
|
164
|
-
inline: boolean;
|
|
165
|
-
contentType: "attachment";
|
|
166
|
-
message: string;
|
|
167
|
-
} | {
|
|
168
|
-
attachmentId?: string;
|
|
169
|
-
filename: string;
|
|
170
|
-
mimeType: string;
|
|
171
|
-
sizeBytes: number;
|
|
172
|
-
inline: boolean;
|
|
173
|
-
contentType: "text";
|
|
174
|
-
text: string;
|
|
175
|
-
} | {
|
|
176
|
-
attachmentId?: string;
|
|
177
|
-
filename: string;
|
|
178
|
-
mimeType: string;
|
|
179
|
-
sizeBytes: number;
|
|
180
|
-
inline: boolean;
|
|
181
|
-
contentType: "unsupported";
|
|
182
|
-
message: string;
|
|
183
|
-
}>;
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* Script input for the "Search Outlook" effect (`outlook.search`),
|
|
187
|
-
* derived from its Tool Core definition's call_function input projection.
|
|
188
|
-
*
|
|
189
|
-
* Search Outlook via the configured connector.
|
|
190
|
-
*/
|
|
191
|
-
export type SearchScriptInput = {
|
|
192
|
-
/**
|
|
193
|
-
* Search query for Outlook.
|
|
194
|
-
*/
|
|
195
|
-
query: string;
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* Canonical Tool Core output for the "Search Outlook" effect (`outlook.search`).
|
|
199
|
-
* This is the definition's output schema; the effect's script surface may
|
|
200
|
-
* re-encode it before returning.
|
|
201
|
-
*/
|
|
202
|
-
export type SearchScriptOutput = {
|
|
203
|
-
results: Array<{
|
|
204
|
-
id: string;
|
|
205
|
-
title: string;
|
|
206
|
-
path: string;
|
|
207
|
-
text: string;
|
|
208
|
-
lastEdited: string;
|
|
209
|
-
isPrivate: boolean;
|
|
210
|
-
pageId: string;
|
|
211
|
-
emailAddress: string;
|
|
212
|
-
url: string;
|
|
213
|
-
}>;
|
|
214
|
-
};
|
|
215
|
-
export declare class OutlookConnectionClient {
|
|
216
|
-
private readonly invoke;
|
|
217
|
-
constructor(invoke: ConnectionActionInvoker);
|
|
218
|
-
loadMessage(args: LoadMessageScriptInput): Promise<LoadMessageScriptOutput>;
|
|
219
|
-
loadThread(args: LoadThreadScriptInput): Promise<LoadThreadScriptOutput>;
|
|
220
|
-
query(args: QueryScriptInput): Promise<QueryScriptOutput>;
|
|
221
|
-
readAttachment(args: ReadAttachmentScriptInput): Promise<ReadAttachmentScriptOutput>;
|
|
222
|
-
search(args: SearchScriptInput): Promise<SearchScriptOutput>;
|
|
223
|
-
}
|
|
224
|
-
//# sourceMappingURL=outlook.generated.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outlook.generated.d.ts","sourceRoot":"","sources":["../src/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AAK,CAAC;QACd,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,UAAU,EAAE,MAAM,CAAA;QAClB,SAAS,EAAE,OAAO,CAAA;QAClB,MAAM,EAAE,MAAM,CAAA;QACd,YAAY,EAAE,MAAM,CAAA;QACpB,GAAG,EAAE,MAAM,CAAA;KACX,CAAC,CAAA;CACF,CAAA;AAED,qBAAa,uBAAuB;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,uBAAuB;IAC5D,WAAW,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAG3E,UAAU,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAGxE,KAAK,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAGzD,cAAc,CACb,IAAI,EAAE,yBAAyB,GAC7B,OAAO,CAAC,0BAA0B,CAAC;IAGtC,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAG5D"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
class OutlookConnectionClient {
|
|
2
|
-
constructor(invoke) {
|
|
3
|
-
this.invoke = invoke;
|
|
4
|
-
}
|
|
5
|
-
invoke;
|
|
6
|
-
loadMessage(args) {
|
|
7
|
-
return this.invoke("loadMessage", args);
|
|
8
|
-
}
|
|
9
|
-
loadThread(args) {
|
|
10
|
-
return this.invoke("loadThread", args);
|
|
11
|
-
}
|
|
12
|
-
query(args) {
|
|
13
|
-
return this.invoke("query", args);
|
|
14
|
-
}
|
|
15
|
-
readAttachment(args) {
|
|
16
|
-
return this.invoke("readAttachment", args);
|
|
17
|
-
}
|
|
18
|
-
search(args) {
|
|
19
|
-
return this.invoke("search", args);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
OutlookConnectionClient
|
|
24
|
-
};
|
package/src/outlook.generated.ts
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
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
|
-
}
|