@particle-academy/microsoft-outlook-js 0.0.0 → 0.2.0
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/CHANGELOG.md +47 -0
- package/LICENSE +21 -0
- package/README.md +162 -2
- package/art/fancified.svg +26 -0
- package/dist/chunk-VMFOMB6N.js +360 -0
- package/dist/chunk-VMFOMB6N.js.map +1 -0
- package/dist/flow.cjs +457 -0
- package/dist/flow.cjs.map +1 -0
- package/dist/flow.d.cts +31 -0
- package/dist/flow.d.ts +31 -0
- package/dist/flow.js +100 -0
- package/dist/flow.js.map +1 -0
- package/dist/index.cjs +384 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +342 -0
- package/dist/index.d.ts +342 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +78 -6
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var fancyConnectorCore = require('@particle-academy/fancy-connector-core');
|
|
4
|
+
|
|
5
|
+
// src/faker.ts
|
|
6
|
+
function fakeEventGet({ config, fake }) {
|
|
7
|
+
const boundId = config.id !== void 0 && config.id !== null && config.id !== "" ? String(config.id) : fake.id("AAMkAGI2");
|
|
8
|
+
return {
|
|
9
|
+
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('ada%40example.test')/events/$entity",
|
|
10
|
+
"@odata.etag": 'W/"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ=="',
|
|
11
|
+
"id": boundId,
|
|
12
|
+
"createdDateTime": "2026-09-01T09:00:00.0000000Z",
|
|
13
|
+
"lastModifiedDateTime": "2026-09-10T15:30:00.0000000Z",
|
|
14
|
+
"subject": "Design review",
|
|
15
|
+
"bodyPreview": "Quarterly design review with the platform team.",
|
|
16
|
+
"isCancelled": false,
|
|
17
|
+
"isAllDay": false,
|
|
18
|
+
"showAs": "busy",
|
|
19
|
+
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkAGI2&exvsurl=1&path=/calendar/item",
|
|
20
|
+
"start": {
|
|
21
|
+
"dateTime": "2026-09-22T14:00:00.0000000",
|
|
22
|
+
"timeZone": "UTC"
|
|
23
|
+
},
|
|
24
|
+
"end": {
|
|
25
|
+
"dateTime": "2026-09-22T15:00:00.0000000",
|
|
26
|
+
"timeZone": "UTC"
|
|
27
|
+
},
|
|
28
|
+
"location": {
|
|
29
|
+
"displayName": "Room 4"
|
|
30
|
+
},
|
|
31
|
+
"organizer": {
|
|
32
|
+
"emailAddress": {
|
|
33
|
+
"name": "Ada Example",
|
|
34
|
+
"address": "ada@example.test"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"attendees": [
|
|
38
|
+
{
|
|
39
|
+
"type": "required",
|
|
40
|
+
"status": {
|
|
41
|
+
"response": "accepted",
|
|
42
|
+
"time": "2026-09-02T10:00:00.0000000Z"
|
|
43
|
+
},
|
|
44
|
+
"emailAddress": {
|
|
45
|
+
"name": "Grace Example",
|
|
46
|
+
"address": "grace@example.test"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function fakeEventList({ config, fake }) {
|
|
53
|
+
return {
|
|
54
|
+
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('ada%40example.test')/events",
|
|
55
|
+
"value": [
|
|
56
|
+
{
|
|
57
|
+
"@odata.etag": 'W/"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ=="',
|
|
58
|
+
"id": fake.id("AAMkAGI2"),
|
|
59
|
+
"createdDateTime": "2026-09-01T09:00:00.0000000Z",
|
|
60
|
+
"lastModifiedDateTime": "2026-09-10T15:30:00.0000000Z",
|
|
61
|
+
"subject": "Design review",
|
|
62
|
+
"bodyPreview": "Quarterly design review with the platform team.",
|
|
63
|
+
"isCancelled": false,
|
|
64
|
+
"isAllDay": false,
|
|
65
|
+
"showAs": "busy",
|
|
66
|
+
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkAGI2&exvsurl=1&path=/calendar/item",
|
|
67
|
+
"start": {
|
|
68
|
+
"dateTime": "2026-09-22T14:00:00.0000000",
|
|
69
|
+
"timeZone": "UTC"
|
|
70
|
+
},
|
|
71
|
+
"end": {
|
|
72
|
+
"dateTime": "2026-09-22T15:00:00.0000000",
|
|
73
|
+
"timeZone": "UTC"
|
|
74
|
+
},
|
|
75
|
+
"organizer": {
|
|
76
|
+
"emailAddress": {
|
|
77
|
+
"name": "Ada Example",
|
|
78
|
+
"address": "ada@example.test"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function fakeSubscriptionCreate({ config, fake }) {
|
|
86
|
+
const boundResource = config.resource !== void 0 && config.resource !== null && config.resource !== "" ? String(config.resource) : "me/events";
|
|
87
|
+
const boundChangetype = config.changeType !== void 0 && config.changeType !== null && config.changeType !== "" ? String(config.changeType) : "created,updated,deleted";
|
|
88
|
+
const boundNotificationurl = config.notificationUrl !== void 0 && config.notificationUrl !== null && config.notificationUrl !== "" ? String(config.notificationUrl) : "https://host.example.test/hooks/microsoft-outlook";
|
|
89
|
+
const boundClientstate = config.clientState !== void 0 && config.clientState !== null && config.clientState !== "" ? String(config.clientState) : fake.id("cs");
|
|
90
|
+
return {
|
|
91
|
+
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity",
|
|
92
|
+
"id": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,
|
|
93
|
+
"resource": boundResource,
|
|
94
|
+
"applicationId": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,
|
|
95
|
+
"changeType": boundChangetype,
|
|
96
|
+
"clientState": boundClientstate,
|
|
97
|
+
"notificationUrl": boundNotificationurl,
|
|
98
|
+
"expirationDateTime": "2026-09-22T18:23:45.9356913Z",
|
|
99
|
+
"creatorId": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,
|
|
100
|
+
"latestSupportedTlsVersion": "v1_2",
|
|
101
|
+
"notificationContentType": "application/json"
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function fakeSubscriptionDelete({ config, fake }) {
|
|
105
|
+
return {};
|
|
106
|
+
}
|
|
107
|
+
function fakeSubscriptionRenew({ config, fake }) {
|
|
108
|
+
const boundId = config.id !== void 0 && config.id !== null && config.id !== "" ? String(config.id) : `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`;
|
|
109
|
+
const boundExpirationdatetime = config.expirationDateTime !== void 0 && config.expirationDateTime !== null && config.expirationDateTime !== "" ? String(config.expirationDateTime) : "2026-09-29T18:23:45.9356913Z";
|
|
110
|
+
return {
|
|
111
|
+
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity",
|
|
112
|
+
"id": boundId,
|
|
113
|
+
"resource": "me/events",
|
|
114
|
+
"applicationId": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,
|
|
115
|
+
"changeType": "created,updated,deleted",
|
|
116
|
+
"notificationUrl": "https://host.example.test/hooks/microsoft-outlook",
|
|
117
|
+
"expirationDateTime": boundExpirationdatetime,
|
|
118
|
+
"latestSupportedTlsVersion": "v1_2",
|
|
119
|
+
"notificationContentType": "application/json"
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function fakeCalendarChanged({ config, fake }) {
|
|
123
|
+
const boundSubscriptionid = `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`;
|
|
124
|
+
const boundEventid = fake.id("AAMkAGI2");
|
|
125
|
+
return {
|
|
126
|
+
"value": [
|
|
127
|
+
{
|
|
128
|
+
"subscriptionId": boundSubscriptionid,
|
|
129
|
+
"subscriptionExpirationDateTime": "2026-09-22T18:23:45.9356913Z",
|
|
130
|
+
"changeType": config.sample !== void 0 && config.sample !== null && config.sample !== "" ? String(config.sample) : "updated",
|
|
131
|
+
"resource": "Users/ada%40example.test/Events/AAMkAGI2",
|
|
132
|
+
"tenantId": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,
|
|
133
|
+
"clientState": "verified-before-injection",
|
|
134
|
+
"resourceData": {
|
|
135
|
+
"@odata.type": "#Microsoft.Graph.Event",
|
|
136
|
+
"@odata.id": "Users/ada%40example.test/Events/AAMkAGI2",
|
|
137
|
+
"@odata.etag": 'W/"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ=="',
|
|
138
|
+
"id": boundEventid
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
var microsoftOutlookFaker = (operation, request) => {
|
|
145
|
+
switch (operation) {
|
|
146
|
+
case "event_get":
|
|
147
|
+
return fakeEventGet(request);
|
|
148
|
+
case "event_list":
|
|
149
|
+
return fakeEventList(request);
|
|
150
|
+
case "subscription_create":
|
|
151
|
+
return fakeSubscriptionCreate(request);
|
|
152
|
+
case "subscription_delete":
|
|
153
|
+
return fakeSubscriptionDelete(request);
|
|
154
|
+
case "subscription_renew":
|
|
155
|
+
return fakeSubscriptionRenew(request);
|
|
156
|
+
case "calendar_changed":
|
|
157
|
+
return fakeCalendarChanged(request);
|
|
158
|
+
default:
|
|
159
|
+
throw new Error(
|
|
160
|
+
`microsoft_outlook: no fake response is defined for "${operation}". Add a fixture under provider/fixtures/ and regenerate \u2014 a connector without a faker cannot be developed against, tested, or demonstrated.`
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// src/service.ts
|
|
166
|
+
var CONNECTOR_API_VERSION = 1;
|
|
167
|
+
var MICROSOFT_OUTLOOK_BASE_URLS = {
|
|
168
|
+
"live": "https://graph.microsoft.com",
|
|
169
|
+
"sandbox": "https://graph.microsoft.com"
|
|
170
|
+
};
|
|
171
|
+
var MICROSOFT_OUTLOOK_REQUIRES = [
|
|
172
|
+
"accessToken",
|
|
173
|
+
"refreshToken",
|
|
174
|
+
"clientId",
|
|
175
|
+
"clientSecret"
|
|
176
|
+
];
|
|
177
|
+
function microsoftOutlookAuthorize(credentials, request, _mode) {
|
|
178
|
+
request.headers.Authorization = `Bearer ${credentials.accessToken ?? ""}`;
|
|
179
|
+
}
|
|
180
|
+
var MICROSOFT_OUTLOOK = {
|
|
181
|
+
service: "microsoft_outlook",
|
|
182
|
+
title: "Microsoft Outlook",
|
|
183
|
+
sandbox: "separate-account",
|
|
184
|
+
baseUrls: { ...MICROSOFT_OUTLOOK_BASE_URLS },
|
|
185
|
+
requires: [...MICROSOFT_OUTLOOK_REQUIRES],
|
|
186
|
+
authorize: microsoftOutlookAuthorize,
|
|
187
|
+
faker: microsoftOutlookFaker
|
|
188
|
+
};
|
|
189
|
+
var EVENT_GET_OPERATION = "event_get";
|
|
190
|
+
async function microsoftOutlookEventGet(options) {
|
|
191
|
+
const config = options.config ?? {};
|
|
192
|
+
if (config.id === void 0 || config.id === null || config.id === "") {
|
|
193
|
+
throw new Error(`event_get: "id" is required (Event ID).`);
|
|
194
|
+
}
|
|
195
|
+
return fancyConnectorCore.callConnector(MICROSOFT_OUTLOOK, {
|
|
196
|
+
operation: EVENT_GET_OPERATION,
|
|
197
|
+
config,
|
|
198
|
+
input: options.input,
|
|
199
|
+
...options.credentials === void 0 ? {} : { credentials: options.credentials },
|
|
200
|
+
...options.mode === void 0 ? {} : { mode: options.mode },
|
|
201
|
+
...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
|
|
202
|
+
...options.attempts === void 0 ? {} : { attempts: options.attempts },
|
|
203
|
+
...options.transport === void 0 ? {} : { transport: options.transport },
|
|
204
|
+
request: {
|
|
205
|
+
method: "GET",
|
|
206
|
+
path: `/v1.0/me/events/${encodeURIComponent(String(config.id))}`,
|
|
207
|
+
query: {}
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
var EVENT_LIST_OPERATION = "event_list";
|
|
212
|
+
async function microsoftOutlookEventList(options) {
|
|
213
|
+
const config = options.config ?? {};
|
|
214
|
+
{
|
|
215
|
+
const n = Number(config.top);
|
|
216
|
+
const given = config.top !== void 0 && config.top !== null && config.top !== "";
|
|
217
|
+
if (given && !(Number.isInteger(n) && n >= 1 && n <= 999)) {
|
|
218
|
+
throw new Error(
|
|
219
|
+
`event_list: "top" must be a integer, got ${JSON.stringify(config.top)}.`
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return fancyConnectorCore.callConnector(MICROSOFT_OUTLOOK, {
|
|
224
|
+
operation: EVENT_LIST_OPERATION,
|
|
225
|
+
config,
|
|
226
|
+
input: options.input,
|
|
227
|
+
...options.credentials === void 0 ? {} : { credentials: options.credentials },
|
|
228
|
+
...options.mode === void 0 ? {} : { mode: options.mode },
|
|
229
|
+
...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
|
|
230
|
+
...options.attempts === void 0 ? {} : { attempts: options.attempts },
|
|
231
|
+
...options.transport === void 0 ? {} : { transport: options.transport },
|
|
232
|
+
request: {
|
|
233
|
+
method: "GET",
|
|
234
|
+
path: "/v1.0/me/events",
|
|
235
|
+
query: {
|
|
236
|
+
"$top": config.top !== void 0 && config.top !== null && config.top !== "" ? Math.trunc(Number(config.top)) : 50,
|
|
237
|
+
...config.filter !== void 0 && config.filter !== null && config.filter !== "" ? { "$filter": String(config.filter) } : {},
|
|
238
|
+
...config.orderby !== void 0 && config.orderby !== null && config.orderby !== "" ? { "$orderby": String(config.orderby) } : {},
|
|
239
|
+
...config.select !== void 0 && config.select !== null && config.select !== "" ? { "$select": String(config.select) } : {}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
var SUBSCRIPTION_CREATE_OPERATION = "subscription_create";
|
|
245
|
+
async function microsoftOutlookSubscriptionCreate(options) {
|
|
246
|
+
const config = options.config ?? {};
|
|
247
|
+
if (config.resource === void 0 || config.resource === null || config.resource === "") {
|
|
248
|
+
throw new Error(`subscription_create: "resource" is required (Resource).`);
|
|
249
|
+
}
|
|
250
|
+
if (config.notificationUrl === void 0 || config.notificationUrl === null || config.notificationUrl === "") {
|
|
251
|
+
throw new Error(`subscription_create: "notificationUrl" is required (Notification URL).`);
|
|
252
|
+
}
|
|
253
|
+
if (config.expirationDateTime === void 0 || config.expirationDateTime === null || config.expirationDateTime === "") {
|
|
254
|
+
throw new Error(`subscription_create: "expirationDateTime" is required (Expires at).`);
|
|
255
|
+
}
|
|
256
|
+
if (config.clientState === void 0 || config.clientState === null || config.clientState === "") {
|
|
257
|
+
throw new Error(`subscription_create: "clientState" is required (Client state).`);
|
|
258
|
+
}
|
|
259
|
+
return fancyConnectorCore.callConnector(MICROSOFT_OUTLOOK, {
|
|
260
|
+
operation: SUBSCRIPTION_CREATE_OPERATION,
|
|
261
|
+
config,
|
|
262
|
+
input: options.input,
|
|
263
|
+
...options.credentials === void 0 ? {} : { credentials: options.credentials },
|
|
264
|
+
...options.mode === void 0 ? {} : { mode: options.mode },
|
|
265
|
+
...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
|
|
266
|
+
...options.attempts === void 0 ? {} : { attempts: options.attempts },
|
|
267
|
+
...options.transport === void 0 ? {} : { transport: options.transport },
|
|
268
|
+
request: {
|
|
269
|
+
method: "POST",
|
|
270
|
+
path: "/v1.0/subscriptions",
|
|
271
|
+
json: {
|
|
272
|
+
...config.changeType !== void 0 && config.changeType !== null && config.changeType !== "" ? { "changeType": String(config.changeType) } : {},
|
|
273
|
+
"resource": String(config.resource),
|
|
274
|
+
"notificationUrl": String(config.notificationUrl),
|
|
275
|
+
...config.lifecycleNotificationUrl !== void 0 && config.lifecycleNotificationUrl !== null && config.lifecycleNotificationUrl !== "" ? { "lifecycleNotificationUrl": String(config.lifecycleNotificationUrl) } : {},
|
|
276
|
+
"expirationDateTime": String(config.expirationDateTime),
|
|
277
|
+
"clientState": String(config.clientState)
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
var SUBSCRIPTION_DELETE_OPERATION = "subscription_delete";
|
|
283
|
+
async function microsoftOutlookSubscriptionDelete(options) {
|
|
284
|
+
const config = options.config ?? {};
|
|
285
|
+
if (config.id === void 0 || config.id === null || config.id === "") {
|
|
286
|
+
throw new Error(`subscription_delete: "id" is required (Subscription ID).`);
|
|
287
|
+
}
|
|
288
|
+
return fancyConnectorCore.callConnector(MICROSOFT_OUTLOOK, {
|
|
289
|
+
operation: SUBSCRIPTION_DELETE_OPERATION,
|
|
290
|
+
config,
|
|
291
|
+
input: options.input,
|
|
292
|
+
...options.credentials === void 0 ? {} : { credentials: options.credentials },
|
|
293
|
+
...options.mode === void 0 ? {} : { mode: options.mode },
|
|
294
|
+
...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
|
|
295
|
+
...options.attempts === void 0 ? {} : { attempts: options.attempts },
|
|
296
|
+
...options.transport === void 0 ? {} : { transport: options.transport },
|
|
297
|
+
request: {
|
|
298
|
+
method: "DELETE",
|
|
299
|
+
path: `/v1.0/subscriptions/${encodeURIComponent(String(config.id))}`,
|
|
300
|
+
query: {}
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
var SUBSCRIPTION_RENEW_OPERATION = "subscription_renew";
|
|
305
|
+
async function microsoftOutlookSubscriptionRenew(options) {
|
|
306
|
+
const config = options.config ?? {};
|
|
307
|
+
if (config.id === void 0 || config.id === null || config.id === "") {
|
|
308
|
+
throw new Error(`subscription_renew: "id" is required (Subscription ID).`);
|
|
309
|
+
}
|
|
310
|
+
if (config.expirationDateTime === void 0 || config.expirationDateTime === null || config.expirationDateTime === "") {
|
|
311
|
+
throw new Error(`subscription_renew: "expirationDateTime" is required (Expires at).`);
|
|
312
|
+
}
|
|
313
|
+
return fancyConnectorCore.callConnector(MICROSOFT_OUTLOOK, {
|
|
314
|
+
operation: SUBSCRIPTION_RENEW_OPERATION,
|
|
315
|
+
config,
|
|
316
|
+
input: options.input,
|
|
317
|
+
...options.credentials === void 0 ? {} : { credentials: options.credentials },
|
|
318
|
+
...options.mode === void 0 ? {} : { mode: options.mode },
|
|
319
|
+
...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
|
|
320
|
+
...options.attempts === void 0 ? {} : { attempts: options.attempts },
|
|
321
|
+
...options.transport === void 0 ? {} : { transport: options.transport },
|
|
322
|
+
request: {
|
|
323
|
+
method: "PATCH",
|
|
324
|
+
path: `/v1.0/subscriptions/${encodeURIComponent(String(config.id))}`,
|
|
325
|
+
json: {
|
|
326
|
+
"expirationDateTime": String(config.expirationDateTime)
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
var MICROSOFT_OUTLOOK_CALENDAR_CHANGED_TOKEN_SCHEME = { kind: "shared-token", in: "body", path: "value[].clientState" };
|
|
332
|
+
var MICROSOFT_OUTLOOK_CALENDAR_CHANGED_HANDSHAKE = { kind: "echo-query", param: "validationToken" };
|
|
333
|
+
var MICROSOFT_OUTLOOK_CALENDAR_CHANGED_LEASE = {
|
|
334
|
+
expiresAtFrom: "expirationDateTime",
|
|
335
|
+
expiresAtUnit: "rfc3339",
|
|
336
|
+
renewBeforeSeconds: 3600,
|
|
337
|
+
renewOperation: "subscription_renew"
|
|
338
|
+
};
|
|
339
|
+
var MICROSOFT_OUTLOOK_CALENDAR_CHANGED_SUBSCRIPTION = { create: "subscription_create", renew: "subscription_renew", stop: "subscription_delete" };
|
|
340
|
+
var MICROSOFT_OUTLOOK_CALENDAR_CHANGED = {
|
|
341
|
+
service: "microsoft_outlook",
|
|
342
|
+
operation: "calendar_changed",
|
|
343
|
+
delivery: "subscription",
|
|
344
|
+
setup: "The host calls subscription_create with its own URL for this trigger, an expiry of now plus this lifetime, and the connection's clientState, and must answer Graph's validationToken challenge on that URL as plain text within 10 seconds or the subscription is refused. It stores the returned id and expirationDateTime. 3600 seconds before expiry it calls subscription_renew; a 404 there means the subscription is gone and it re-lists (event_list) and creates again, because notifications during the gap are gone. Every notification is a batch: the host compares each item's clientState with the connection's clientState, answers 202, and then processes the items. A `missed` lifecycle event means re-list; `reauthorizationRequired` means renew; `subscriptionRemoved` means create again and re-list.",
|
|
345
|
+
subscriptionTtl: 604800,
|
|
346
|
+
lease: MICROSOFT_OUTLOOK_CALENDAR_CHANGED_LEASE,
|
|
347
|
+
verification: {
|
|
348
|
+
scheme: MICROSOFT_OUTLOOK_CALENDAR_CHANGED_TOKEN_SCHEME,
|
|
349
|
+
handshake: MICROSOFT_OUTLOOK_CALENDAR_CHANGED_HANDSHAKE
|
|
350
|
+
},
|
|
351
|
+
faker: microsoftOutlookFaker
|
|
352
|
+
};
|
|
353
|
+
function verifyMicrosoftOutlookDelivery(delivery, clientState, now) {
|
|
354
|
+
return fancyConnectorCore.verifyDelivery(MICROSOFT_OUTLOOK_CALENDAR_CHANGED, delivery, clientState, now);
|
|
355
|
+
}
|
|
356
|
+
function answerMicrosoftOutlookHandshake(query) {
|
|
357
|
+
return fancyConnectorCore.handshakeResponse(MICROSOFT_OUTLOOK_CALENDAR_CHANGED_HANDSHAKE, query);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
exports.CONNECTOR_API_VERSION = CONNECTOR_API_VERSION;
|
|
361
|
+
exports.EVENT_GET_OPERATION = EVENT_GET_OPERATION;
|
|
362
|
+
exports.EVENT_LIST_OPERATION = EVENT_LIST_OPERATION;
|
|
363
|
+
exports.MICROSOFT_OUTLOOK = MICROSOFT_OUTLOOK;
|
|
364
|
+
exports.MICROSOFT_OUTLOOK_BASE_URLS = MICROSOFT_OUTLOOK_BASE_URLS;
|
|
365
|
+
exports.MICROSOFT_OUTLOOK_CALENDAR_CHANGED = MICROSOFT_OUTLOOK_CALENDAR_CHANGED;
|
|
366
|
+
exports.MICROSOFT_OUTLOOK_CALENDAR_CHANGED_HANDSHAKE = MICROSOFT_OUTLOOK_CALENDAR_CHANGED_HANDSHAKE;
|
|
367
|
+
exports.MICROSOFT_OUTLOOK_CALENDAR_CHANGED_LEASE = MICROSOFT_OUTLOOK_CALENDAR_CHANGED_LEASE;
|
|
368
|
+
exports.MICROSOFT_OUTLOOK_CALENDAR_CHANGED_SUBSCRIPTION = MICROSOFT_OUTLOOK_CALENDAR_CHANGED_SUBSCRIPTION;
|
|
369
|
+
exports.MICROSOFT_OUTLOOK_CALENDAR_CHANGED_TOKEN_SCHEME = MICROSOFT_OUTLOOK_CALENDAR_CHANGED_TOKEN_SCHEME;
|
|
370
|
+
exports.MICROSOFT_OUTLOOK_REQUIRES = MICROSOFT_OUTLOOK_REQUIRES;
|
|
371
|
+
exports.SUBSCRIPTION_CREATE_OPERATION = SUBSCRIPTION_CREATE_OPERATION;
|
|
372
|
+
exports.SUBSCRIPTION_DELETE_OPERATION = SUBSCRIPTION_DELETE_OPERATION;
|
|
373
|
+
exports.SUBSCRIPTION_RENEW_OPERATION = SUBSCRIPTION_RENEW_OPERATION;
|
|
374
|
+
exports.answerMicrosoftOutlookHandshake = answerMicrosoftOutlookHandshake;
|
|
375
|
+
exports.microsoftOutlookAuthorize = microsoftOutlookAuthorize;
|
|
376
|
+
exports.microsoftOutlookEventGet = microsoftOutlookEventGet;
|
|
377
|
+
exports.microsoftOutlookEventList = microsoftOutlookEventList;
|
|
378
|
+
exports.microsoftOutlookFaker = microsoftOutlookFaker;
|
|
379
|
+
exports.microsoftOutlookSubscriptionCreate = microsoftOutlookSubscriptionCreate;
|
|
380
|
+
exports.microsoftOutlookSubscriptionDelete = microsoftOutlookSubscriptionDelete;
|
|
381
|
+
exports.microsoftOutlookSubscriptionRenew = microsoftOutlookSubscriptionRenew;
|
|
382
|
+
exports.verifyMicrosoftOutlookDelivery = verifyMicrosoftOutlookDelivery;
|
|
383
|
+
//# sourceMappingURL=index.cjs.map
|
|
384
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/event-get.ts","../src/actions/event-list.ts","../src/actions/subscription-create.ts","../src/actions/subscription-delete.ts","../src/actions/subscription-renew.ts","../src/triggers/calendar-changed.ts"],"names":["callConnector","verifyDelivery","handshakeResponse"],"mappings":";;;;;AA0BA,SAAS,YAAA,CAAa,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AAC5D,EAAA,MAAM,UAAW,MAAA,CAAO,EAAA,KAAO,MAAA,IAAa,MAAA,CAAO,OAAO,IAAA,IAAQ,MAAA,CAAO,EAAA,KAAO,EAAA,GAAK,OAAO,MAAA,CAAO,EAAE,CAAA,GAAI,IAAA,CAAK,GAAG,UAAU,CAAA;AAE3H,EAAA,OAAO;AAAA,IACL,gBAAA,EAAkB,uFAAA;AAAA,IAClB,aAAA,EAAe,sCAAA;AAAA,IACf,IAAA,EAAM,OAAA;AAAA,IACN,iBAAA,EAAmB,8BAAA;AAAA,IACnB,sBAAA,EAAwB,8BAAA;AAAA,IACxB,SAAA,EAAW,eAAA;AAAA,IACX,aAAA,EAAe,iDAAA;AAAA,IACf,aAAA,EAAe,KAAA;AAAA,IACf,UAAA,EAAY,KAAA;AAAA,IACZ,QAAA,EAAU,MAAA;AAAA,IACV,SAAA,EAAW,kFAAA;AAAA,IACX,OAAA,EAAS;AAAA,MACP,UAAA,EAAY,6BAAA;AAAA,MACZ,UAAA,EAAY;AAAA,KACd;AAAA,IACA,KAAA,EAAO;AAAA,MACL,UAAA,EAAY,6BAAA;AAAA,MACZ,UAAA,EAAY;AAAA,KACd;AAAA,IACA,UAAA,EAAY;AAAA,MACV,aAAA,EAAe;AAAA,KACjB;AAAA,IACA,WAAA,EAAa;AAAA,MACX,cAAA,EAAgB;AAAA,QACd,MAAA,EAAQ,aAAA;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AAA;AAC9E","file":"index.cjs","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/fixtures/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/fixtures/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- microsoft_outlook\n */\n\n/**\n * The Microsoft Outlook faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES Microsoft Outlook actually publishes, so an author can wire {{\n * $json.data.id }} against a fake and have it keep working against the real\n * thing.\n *\n * Deterministic — same inputs, same output. A faker returning a fresh uuid\n * every call cannot be asserted on, so its fixtures degrade to \"it did not\n * throw\", which is the assertion that catches nothing.\n */\n\nimport type { ConnectorFaker, FakeRequest } from \"@particle-academy/fancy-connector-core\";\n\nfunction fakeEventGet({ config, fake }: FakeRequest): unknown {\n const boundId = (config.id !== undefined && config.id !== null && config.id !== \"\" ? String(config.id) : fake.id(\"AAMkAGI2\"));\n\n return {\n \"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#users('ada%40example.test')/events/$entity\",\n \"@odata.etag\": \"W/\\\"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ==\\\"\",\n \"id\": boundId,\n \"createdDateTime\": \"2026-09-01T09:00:00.0000000Z\",\n \"lastModifiedDateTime\": \"2026-09-10T15:30:00.0000000Z\",\n \"subject\": \"Design review\",\n \"bodyPreview\": \"Quarterly design review with the platform team.\",\n \"isCancelled\": false,\n \"isAllDay\": false,\n \"showAs\": \"busy\",\n \"webLink\": \"https://outlook.office365.com/owa/?itemid=AAMkAGI2&exvsurl=1&path=/calendar/item\",\n \"start\": {\n \"dateTime\": \"2026-09-22T14:00:00.0000000\",\n \"timeZone\": \"UTC\",\n },\n \"end\": {\n \"dateTime\": \"2026-09-22T15:00:00.0000000\",\n \"timeZone\": \"UTC\",\n },\n \"location\": {\n \"displayName\": \"Room 4\",\n },\n \"organizer\": {\n \"emailAddress\": {\n \"name\": \"Ada Example\",\n \"address\": \"ada@example.test\",\n },\n },\n \"attendees\": [\n {\n \"type\": \"required\",\n \"status\": {\n \"response\": \"accepted\",\n \"time\": \"2026-09-02T10:00:00.0000000Z\",\n },\n \"emailAddress\": {\n \"name\": \"Grace Example\",\n \"address\": \"grace@example.test\",\n },\n },\n ],\n };\n}\n\nfunction fakeEventList({ config, fake }: FakeRequest): unknown {\n return {\n \"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#users('ada%40example.test')/events\",\n \"value\": [\n {\n \"@odata.etag\": \"W/\\\"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ==\\\"\",\n \"id\": fake.id(\"AAMkAGI2\"),\n \"createdDateTime\": \"2026-09-01T09:00:00.0000000Z\",\n \"lastModifiedDateTime\": \"2026-09-10T15:30:00.0000000Z\",\n \"subject\": \"Design review\",\n \"bodyPreview\": \"Quarterly design review with the platform team.\",\n \"isCancelled\": false,\n \"isAllDay\": false,\n \"showAs\": \"busy\",\n \"webLink\": \"https://outlook.office365.com/owa/?itemid=AAMkAGI2&exvsurl=1&path=/calendar/item\",\n \"start\": {\n \"dateTime\": \"2026-09-22T14:00:00.0000000\",\n \"timeZone\": \"UTC\",\n },\n \"end\": {\n \"dateTime\": \"2026-09-22T15:00:00.0000000\",\n \"timeZone\": \"UTC\",\n },\n \"organizer\": {\n \"emailAddress\": {\n \"name\": \"Ada Example\",\n \"address\": \"ada@example.test\",\n },\n },\n },\n ],\n };\n}\n\nfunction fakeSubscriptionCreate({ config, fake }: FakeRequest): unknown {\n const boundResource = (config.resource !== undefined && config.resource !== null && config.resource !== \"\" ? String(config.resource) : \"me/events\");\n const boundChangetype = (config.changeType !== undefined && config.changeType !== null && config.changeType !== \"\" ? String(config.changeType) : \"created,updated,deleted\");\n const boundNotificationurl = (config.notificationUrl !== undefined && config.notificationUrl !== null && config.notificationUrl !== \"\" ? String(config.notificationUrl) : \"https://host.example.test/hooks/microsoft-outlook\");\n const boundClientstate = (config.clientState !== undefined && config.clientState !== null && config.clientState !== \"\" ? String(config.clientState) : fake.id(\"cs\"));\n\n return {\n \"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity\",\n \"id\": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,\n \"resource\": boundResource,\n \"applicationId\": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,\n \"changeType\": boundChangetype,\n \"clientState\": boundClientstate,\n \"notificationUrl\": boundNotificationurl,\n \"expirationDateTime\": \"2026-09-22T18:23:45.9356913Z\",\n \"creatorId\": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,\n \"latestSupportedTlsVersion\": \"v1_2\",\n \"notificationContentType\": \"application/json\",\n };\n}\n\nfunction fakeSubscriptionDelete({ config, fake }: FakeRequest): unknown {\n return {};\n}\n\nfunction fakeSubscriptionRenew({ config, fake }: FakeRequest): unknown {\n const boundId = (config.id !== undefined && config.id !== null && config.id !== \"\" ? String(config.id) : `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`);\n const boundExpirationdatetime = (config.expirationDateTime !== undefined && config.expirationDateTime !== null && config.expirationDateTime !== \"\" ? String(config.expirationDateTime) : \"2026-09-29T18:23:45.9356913Z\");\n\n return {\n \"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity\",\n \"id\": boundId,\n \"resource\": \"me/events\",\n \"applicationId\": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,\n \"changeType\": \"created,updated,deleted\",\n \"notificationUrl\": \"https://host.example.test/hooks/microsoft-outlook\",\n \"expirationDateTime\": boundExpirationdatetime,\n \"latestSupportedTlsVersion\": \"v1_2\",\n \"notificationContentType\": \"application/json\",\n };\n}\n\nfunction fakeCalendarChanged({ config, fake }: FakeRequest): unknown {\n const boundSubscriptionid = `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`;\n const boundEventid = fake.id(\"AAMkAGI2\");\n\n return {\n \"value\": [\n {\n \"subscriptionId\": boundSubscriptionid,\n \"subscriptionExpirationDateTime\": \"2026-09-22T18:23:45.9356913Z\",\n \"changeType\": (config.sample !== undefined && config.sample !== null && config.sample !== \"\" ? String(config.sample) : \"updated\"),\n \"resource\": \"Users/ada%40example.test/Events/AAMkAGI2\",\n \"tenantId\": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,\n \"clientState\": \"verified-before-injection\",\n \"resourceData\": {\n \"@odata.type\": \"#Microsoft.Graph.Event\",\n \"@odata.id\": \"Users/ada%40example.test/Events/AAMkAGI2\",\n \"@odata.etag\": \"W/\\\"ZlnW4RIAV06KYYwlrfNZvQAALfZeRQ==\\\"\",\n \"id\": boundEventid,\n },\n },\n ],\n };\n}\n\nexport const microsoftOutlookFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"event_get\":\n return fakeEventGet(request);\n\n case \"event_list\":\n return fakeEventList(request);\n\n case \"subscription_create\":\n return fakeSubscriptionCreate(request);\n\n case \"subscription_delete\":\n return fakeSubscriptionDelete(request);\n\n case \"subscription_renew\":\n return fakeSubscriptionRenew(request);\n\n case \"calendar_changed\":\n return fakeCalendarChanged(request);\n\n default:\n // A faker asked for an operation it has no shape for must SAY so. Making\n // something up would produce a green run whose output silently has none\n // of the fields the author is about to reference.\n throw new Error(\n `microsoft_outlook: no fake response is defined for \"${operation}\". ` +\n \"Add a fixture under provider/fixtures/ and regenerate — a connector without a faker \" +\n \"cannot be developed against, tested, or demonstrated.\",\n );\n }\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- microsoft_outlook\n */\n\n/**\n * Microsoft Outlook, as one service descriptor shared by every Microsoft\n * Outlook operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of Microsoft Outlook: its base URL,\n * its auth scheme, its idempotency header, and its faker.\n *\n * ## The sandbox trap, written down where it is used\n *\n * Microsoft's test estate is a Microsoft 365 Developer Program sandbox: a\n * separate E5 tenant with its own users, its own calendars and its own OAuth\n * consent, on the SAME host. Eligibility is limited -- Visual Studio\n * Professional or Enterprise subscribers, ISV Success / Microsoft AI Cloud\n * Partner Program members, or Premier/Unified Support customers -- and the\n * tenant expires after 90 days of no development activity. Without one, every\n * call reaches a real mailbox.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { microsoftOutlookFaker } from \"./faker.js\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported. An imported constant lets an upgrade rewrite the\n * very claim it exists to detect, after which the copy agrees with itself\n * forever.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\nexport const MICROSOFT_OUTLOOK_BASE_URLS = {\n \"live\": \"https://graph.microsoft.com\",\n \"sandbox\": \"https://graph.microsoft.com\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const MICROSOFT_OUTLOOK_REQUIRES = [\n \"accessToken\",\n \"refreshToken\",\n \"clientId\",\n \"clientSecret\"\n] as const;\n\n/**\n * Apply Microsoft Outlook's auth scheme to an outgoing request.\n *\n *\n *\n * The mode is passed in because for some providers auth and estate are the\n * same decision expressed in the URL; here it is unused, and saying so is\n * cheaper than wondering later whether it was forgotten.\n */\nexport function microsoftOutlookAuthorize(\n credentials: Record<string, string | undefined>,\n request: PreparedRequest,\n _mode: ConnectorMode,\n): void {\n request.headers.Authorization = `Bearer ${credentials.accessToken ?? \"\"}`;\n}\n\n/** The Microsoft Outlook service, for the TypeScript runtime. */\nexport const MICROSOFT_OUTLOOK: ServiceDescriptor = {\n service: \"microsoft_outlook\",\n title: \"Microsoft Outlook\",\n sandbox: \"separate-account\",\n baseUrls: { ...MICROSOFT_OUTLOOK_BASE_URLS },\n requires: [...MICROSOFT_OUTLOOK_REQUIRES],\n authorize: microsoftOutlookAuthorize,\n faker: microsoftOutlookFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/event-get.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/event-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- microsoft_outlook\n */\n\n/**\n * Read one event from the connected account's Outlook calendar.\n *\n * GET /v1.0/me/events/{id} —\n * https://learn.microsoft.com/en-us/graph/api/event-get?view=graph-rest-1.0\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Microsoft Outlook or calls\n * the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { MICROSOFT_OUTLOOK } from \"../service.js\";\n\nexport const EVENT_GET_OPERATION = \"event_get\";\n\nexport type EventGetOptions = {\n /** The node's resolved config. Keys: id. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function microsoftOutlookEventGet(options: EventGetOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.id === undefined || config.id === null || config.id === \"\") {\n throw new Error(`event_get: \"id\" is required (Event ID).`);\n }\n\n return callConnector(MICROSOFT_OUTLOOK, {\n operation: EVENT_GET_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/v1.0/me/events/${encodeURIComponent(String(config.id))}`,\n query: {},\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/event-list.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/event-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- microsoft_outlook\n */\n\n/**\n * List events from the connected account's Outlook calendar.\n *\n * GET /v1.0/me/events —\n * https://learn.microsoft.com/en-us/graph/api/user-list-events?view=graph-rest-1.0\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Microsoft Outlook or calls\n * the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { MICROSOFT_OUTLOOK } from \"../service.js\";\n\nexport const EVENT_LIST_OPERATION = \"event_list\";\n\nexport type EventListOptions = {\n /** The node's resolved config. Keys: top, filter, orderby, select. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function microsoftOutlookEventList(options: EventListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n {\n const n = Number(config.top);\n const given = config.top !== undefined && config.top !== null && config.top !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 999)) {\n throw new Error(\n `event_list: \"top\" must be a integer, got ${JSON.stringify(config.top)}.`,\n );\n }\n }\n\n return callConnector(MICROSOFT_OUTLOOK, {\n operation: EVENT_LIST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: \"/v1.0/me/events\",\n query: {\n \"$top\": config.top !== undefined && config.top !== null && config.top !== \"\" ? Math.trunc(Number(config.top)) : 50,\n ...(config.filter !== undefined && config.filter !== null && config.filter !== \"\" ? { \"$filter\": String(config.filter) } : {}),\n ...(config.orderby !== undefined && config.orderby !== null && config.orderby !== \"\" ? { \"$orderby\": String(config.orderby) } : {}),\n ...(config.select !== undefined && config.select !== null && config.select !== \"\" ? { \"$select\": String(config.select) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/subscription-create.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/subscription-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- microsoft_outlook\n */\n\n/**\n * Subscribe to change notifications on the connected account's calendar\n * events. The host's subscription machinery calls this; it is not a node most\n * workflows need.\n *\n * POST /v1.0/subscriptions —\n * https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Microsoft Outlook or calls\n * the faker.\n *\n * sideEffects: unsafe-to-replay.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { MICROSOFT_OUTLOOK } from \"../service.js\";\n\nexport const SUBSCRIPTION_CREATE_OPERATION = \"subscription_create\";\n\nexport type SubscriptionCreateOptions = {\n /** The node's resolved config. Keys: changeType, resource, notificationUrl, lifecycleNotificationUrl, expirationDateTime, clientState. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function microsoftOutlookSubscriptionCreate(options: SubscriptionCreateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.resource === undefined || config.resource === null || config.resource === \"\") {\n throw new Error(`subscription_create: \"resource\" is required (Resource).`);\n }\n\n if (config.notificationUrl === undefined || config.notificationUrl === null || config.notificationUrl === \"\") {\n throw new Error(`subscription_create: \"notificationUrl\" is required (Notification URL).`);\n }\n\n if (config.expirationDateTime === undefined || config.expirationDateTime === null || config.expirationDateTime === \"\") {\n throw new Error(`subscription_create: \"expirationDateTime\" is required (Expires at).`);\n }\n\n if (config.clientState === undefined || config.clientState === null || config.clientState === \"\") {\n throw new Error(`subscription_create: \"clientState\" is required (Client state).`);\n }\n\n return callConnector(MICROSOFT_OUTLOOK, {\n operation: SUBSCRIPTION_CREATE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/v1.0/subscriptions\",\n json: {\n ...(config.changeType !== undefined && config.changeType !== null && config.changeType !== \"\" ? { \"changeType\": String(config.changeType) } : {}),\n \"resource\": String(config.resource),\n \"notificationUrl\": String(config.notificationUrl),\n ...(config.lifecycleNotificationUrl !== undefined && config.lifecycleNotificationUrl !== null && config.lifecycleNotificationUrl !== \"\" ? { \"lifecycleNotificationUrl\": String(config.lifecycleNotificationUrl) } : {}),\n \"expirationDateTime\": String(config.expirationDateTime),\n \"clientState\": String(config.clientState),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/subscription-delete.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/subscription-delete.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- microsoft_outlook\n */\n\n/**\n * Delete a change-notification subscription. The host's subscription machinery\n * calls this when a trigger is removed.\n *\n * DELETE /v1.0/subscriptions/{id} —\n * https://learn.microsoft.com/en-us/graph/api/subscription-delete?view=graph-rest-1.0\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Microsoft Outlook or calls\n * the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { MICROSOFT_OUTLOOK } from \"../service.js\";\n\nexport const SUBSCRIPTION_DELETE_OPERATION = \"subscription_delete\";\n\nexport type SubscriptionDeleteOptions = {\n /** The node's resolved config. Keys: id. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function microsoftOutlookSubscriptionDelete(options: SubscriptionDeleteOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.id === undefined || config.id === null || config.id === \"\") {\n throw new Error(`subscription_delete: \"id\" is required (Subscription ID).`);\n }\n\n return callConnector(MICROSOFT_OUTLOOK, {\n operation: SUBSCRIPTION_DELETE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"DELETE\",\n path: `/v1.0/subscriptions/${encodeURIComponent(String(config.id))}`,\n query: {},\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/subscription-renew.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/subscription-renew.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- microsoft_outlook\n */\n\n/**\n * Extend a change-notification subscription before it expires. The host's\n * subscription machinery calls this when the lease is due.\n *\n * PATCH /v1.0/subscriptions/{id} —\n * https://learn.microsoft.com/en-us/graph/api/subscription-update?view=graph-rest-1.0\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Microsoft Outlook or calls\n * the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { MICROSOFT_OUTLOOK } from \"../service.js\";\n\nexport const SUBSCRIPTION_RENEW_OPERATION = \"subscription_renew\";\n\nexport type SubscriptionRenewOptions = {\n /** The node's resolved config. Keys: id, expirationDateTime. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function microsoftOutlookSubscriptionRenew(options: SubscriptionRenewOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.id === undefined || config.id === null || config.id === \"\") {\n throw new Error(`subscription_renew: \"id\" is required (Subscription ID).`);\n }\n\n if (config.expirationDateTime === undefined || config.expirationDateTime === null || config.expirationDateTime === \"\") {\n throw new Error(`subscription_renew: \"expirationDateTime\" is required (Expires at).`);\n }\n\n return callConnector(MICROSOFT_OUTLOOK, {\n operation: SUBSCRIPTION_RENEW_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"PATCH\",\n path: `/v1.0/subscriptions/${encodeURIComponent(String(config.id))}`,\n json: {\n \"expirationDateTime\": String(config.expirationDateTime),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/triggers/calendar-changed.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/triggers/calendar-changed.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- microsoft_outlook\n */\n\n/**\n * Microsoft Outlook's subscription trigger — the delivery contract.\n *\n * Kept beside the service descriptor rather than inside a node, because the\n * way a delivery is verified is a fact about MICROSOFT OUTLOOK. Two Microsoft\n * Outlook triggers must not be able to disagree about how a delivery is\n * verified.\n *\n * A SUBSCRIPTION: Microsoft Outlook stops delivering unless somebody renews\n * it, forever, and if nobody does the workflow stops firing with no error\n * anywhere. The lease below says where the expiry is read from and how early\n * to renew; the host runs ONE renewal scheduler for every expiring trigger.\n */\n\nimport { handshakeResponse, verifyDelivery, type ChallengeHandshake, type InboundDelivery, type LeaseDeclaration, type SharedTokenScheme, type TriggerDescriptor, type WebhookVerification } from \"@particle-academy/fancy-connector-core\";\nimport { microsoftOutlookFaker } from \"../faker.js\";\n\n/** Where Microsoft Outlook echoes the token it was given when the subscription was created. */\nexport const MICROSOFT_OUTLOOK_CALENDAR_CHANGED_TOKEN_SCHEME: SharedTokenScheme = { kind: \"shared-token\", in: \"body\", path: \"value[].clientState\" };\n\n/**\n * Microsoft Outlook's challenge before it delivers anything: a request\n * carrying `?validationToken=…` must be answered with that value as plain\n * text, or the subscription is never created.\n * `answerMicrosoftOutlookHandshake` is the pure half; the host's routing layer\n * asks it before mounting the route.\n */\nexport const MICROSOFT_OUTLOOK_CALENDAR_CHANGED_HANDSHAKE: ChallengeHandshake = { kind: \"echo-query\", param: \"validationToken\" };\n\n/**\n * The lease this subscription carries: where the provider's expiry sits in the\n * `subscription_create` response (`expirationDateTime`, rfc3339), how early\n * the host renews, and what it calls when the lease is due. The host builds\n * the value with the core's `leaseFromResponse` and runs one scheduler for\n * every expiring trigger.\n */\nexport const MICROSOFT_OUTLOOK_CALENDAR_CHANGED_LEASE: LeaseDeclaration = {\n expiresAtFrom: \"expirationDateTime\",\n expiresAtUnit: \"rfc3339\",\n renewBeforeSeconds: 3600,\n renewOperation: \"subscription_renew\",\n};\n\n/**\n * Which of this package's actions create, renew and stop the subscription.\n * `renew` is null where the provider cannot renew and the host calls create\n * again — after stopping the old one, and after re-listing, because\n * notifications during the gap are gone.\n */\nexport const MICROSOFT_OUTLOOK_CALENDAR_CHANGED_SUBSCRIPTION = { create: \"subscription_create\", renew: \"subscription_renew\", stop: \"subscription_delete\" } as const;\n\nexport const MICROSOFT_OUTLOOK_CALENDAR_CHANGED: TriggerDescriptor = {\n service: \"microsoft_outlook\",\n operation: \"calendar_changed\",\n delivery: \"subscription\",\n setup:\n \"The host calls subscription_create with its own URL for this trigger, an expiry of now plus this lifetime, and the connection's clientState, and must answer Graph's validationToken challenge on that URL as plain text within 10 seconds or the subscription is refused. It stores the returned id and expirationDateTime. 3600 seconds before expiry it calls subscription_renew; a 404 there means the subscription is gone and it re-lists (event_list) and creates again, because notifications during the gap are gone. Every notification is a batch: the host compares each item's clientState with the connection's clientState, answers 202, and then processes the items. A `missed` lifecycle event means re-list; `reauthorizationRequired` means renew; `subscriptionRemoved` means create again and re-list.\",\n subscriptionTtl: 604800,\n lease: MICROSOFT_OUTLOOK_CALENDAR_CHANGED_LEASE,\n verification: {\n scheme: MICROSOFT_OUTLOOK_CALENDAR_CHANGED_TOKEN_SCHEME,\n handshake: MICROSOFT_OUTLOOK_CALENDAR_CHANGED_HANDSHAKE,\n },\n faker: microsoftOutlookFaker,\n};\n\n/**\n * Verify one inbound Microsoft Outlook delivery.\n *\n * The host calls this BEFORE starting a run, with the body exactly as\n * received. Re-serialised JSON changes key order and whitespace, and produces\n * a mismatch that looks precisely like a wrong secret — hours of debugging the\n * wrong thing.\n *\n * The secret is the connection's `clientState`.\n */\nexport function verifyMicrosoftOutlookDelivery(\n delivery: InboundDelivery,\n clientState: string | undefined,\n now?: number,\n): Promise<WebhookVerification> {\n return verifyDelivery(MICROSOFT_OUTLOOK_CALENDAR_CHANGED, delivery, clientState, now);\n}\n\n/**\n * Answer Microsoft Outlook's challenge — what to send back (200, text/plain,\n * the decoded `validationToken`), or undefined when the request is not a\n * challenge at all.\n */\nexport function answerMicrosoftOutlookHandshake(\n query: Record<string, string | string[] | undefined>,\n): ReturnType<typeof handshakeResponse> {\n return handshakeResponse(MICROSOFT_OUTLOOK_CALENDAR_CHANGED_HANDSHAKE, query);\n}\n"]}
|