@particle-academy/google-calendar-js 0.1.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 CHANGED
@@ -8,6 +8,25 @@ The four packages share one version, because they are generated from one
8
8
  `provider/` definition and a version that meant something different in each
9
9
  would be a version nobody could reason about.
10
10
 
11
+ ## [0.2.0] — 2026-09-30
12
+
13
+ ### Added
14
+
15
+ - **`event_create`**, **`event_update`** and **`event_delete`** — write
16
+ support, the first this connector has had. `event_update` uses PATCH
17
+ (`events.patch`), not PUT (`events.update`): PUT requires resending the
18
+ whole event or Google clears every field left out, which is a trap for
19
+ a caller that only wants to change one thing. No scope change —
20
+ `calendar.events` already covers create/update/delete.
21
+ - Deliberately NOT included: attendees and recurrence. Both need an
22
+ array-of-objects (attendees) or array-of-strings (recurrence) config
23
+ shape nothing in this estate's vocabulary has needed before now; same
24
+ bar as everything in `vocabulary-deferred.md` — a second real need,
25
+ not a first guess. All-day (date-only) events are out of scope for the
26
+ same reason: they need `start.date`/`end.date` instead of
27
+ `start.dateTime`/`end.dateTime`, a variant this config shape cannot
28
+ express yet.
29
+
11
30
  ## [0.1.0] — 2026-09-15
12
31
 
13
32
  ### Added
package/README.md CHANGED
@@ -93,6 +93,38 @@ Open a push-notification channel on a calendar's events. The host's subscription
93
93
  | `token` | yes | The connection's channelToken. The host fills this from the connection -- never type a value here. Google echoes it in X-Goog-Channel-Token, and that echo is how a delivery is verified. |
94
94
  | `ttlSeconds` | yes | How long Google keeps the channel alive. Google's default is 604800 (one week), and the discovery document types it as a STRING inside `params`. |
95
95
 
96
+ #### `event_create` — Create Google Calendar event
97
+
98
+ Create a timed event on a Google Calendar.
99
+
100
+ `POST /calendar/v3/calendars/{calendarId}/events` · **unsafe to replay** — a retried durable run does it TWICE
101
+
102
+ | Input | Required | What it is |
103
+ |---|---|---|
104
+ | `calendarId` | yes | `primary` for the connected account's own calendar, or a calendar's id. |
105
+ | `summary` | yes | Title |
106
+ | `description` | no | Can contain HTML. |
107
+ | `location` | no | Free-form text. |
108
+ | `startDateTime` | yes | RFC 3339, e.g. 2026-10-01T14:00:00Z. Include an offset, or pair with a time zone below. |
109
+ | `startTimeZone` | no | IANA name, e.g. America/New_York. Optional when the start time already carries an offset. |
110
+ | `endDateTime` | yes | RFC 3339. Exclusive -- the event ends at, not through, this instant. |
111
+ | `endTimeZone` | no | End time zone |
112
+ | `status` | no | "cancelled" is not offered here -- that is event_delete's job, not a status this action should be able to set on create. |
113
+ | `visibility` | no | Visibility |
114
+ | `transparency` | no | opaque blocks time on the calendar (Busy); transparent does not (Available). |
115
+ | `colorId` | no | An id from the colors endpoint's event section. Leave blank for the calendar's default. |
116
+
117
+ #### `event_delete` — Delete Google Calendar event
118
+
119
+ Remove an event from a Google Calendar.
120
+
121
+ `DELETE /calendar/v3/calendars/{calendarId}/events/{eventId}` · idempotent — safe to replay
122
+
123
+ | Input | Required | What it is |
124
+ |---|---|---|
125
+ | `calendarId` | yes | Calendar ID |
126
+ | `eventId` | yes | From event_create's data.id, or event_list/event_get. |
127
+
96
128
  #### `event_get` — Google Calendar event
97
129
 
98
130
  Read one event from a Google Calendar.
@@ -120,6 +152,28 @@ List events from a Google Calendar, in full or incrementally with a sync token.
120
152
  | `pageToken` | no | From a previous page's nextPageToken. |
121
153
  | `singleEvents` | no | Return each occurrence of a recurring event as its own item, rather than the series once. |
122
154
 
155
+ #### `event_update` — Update Google Calendar event
156
+
157
+ Change one or more fields of an existing event. Only the fields provided are touched.
158
+
159
+ `PATCH /calendar/v3/calendars/{calendarId}/events/{eventId}` · idempotent — safe to replay
160
+
161
+ | Input | Required | What it is |
162
+ |---|---|---|
163
+ | `calendarId` | yes | Calendar ID |
164
+ | `eventId` | yes | From event_create's data.id, or event_list/event_get. |
165
+ | `summary` | no | Title |
166
+ | `description` | no | Description |
167
+ | `location` | no | Location |
168
+ | `startDateTime` | no | RFC 3339. Leave blank to leave the start time unchanged. |
169
+ | `startTimeZone` | no | Start time zone |
170
+ | `endDateTime` | no | RFC 3339. Leave blank to leave the end time unchanged. |
171
+ | `endTimeZone` | no | End time zone |
172
+ | `status` | no | Setting cancelled here has the same effect as event_delete -- offered because PATCH is also Google's documented way to cancel one instance of a recurring event, which event_delete (which removes the whole resource) cannot target. |
173
+ | `visibility` | no | Visibility |
174
+ | `transparency` | no | Show me as |
175
+ | `colorId` | no | Color ID |
176
+
123
177
  ### Triggers
124
178
 
125
179
  #### `events_changed` — Google Calendar change
@@ -16,6 +16,43 @@ function fakeChannelWatch({ config, fake }) {
16
16
  "expiration": "1789430400000"
17
17
  };
18
18
  }
19
+ function fakeEventCreate({ config, fake }) {
20
+ return {
21
+ "kind": "calendar#event",
22
+ "etag": '"3456789012345679"',
23
+ "id": fake.id("evt"),
24
+ "status": config.status !== void 0 && config.status !== null && config.status !== "" ? String(config.status) : "confirmed",
25
+ "htmlLink": "https://www.google.com/calendar/event?eid=ZmFrZQ",
26
+ "created": "2026-09-30T09:00:00.000Z",
27
+ "updated": "2026-09-30T09:00:00.000Z",
28
+ "summary": config.summary !== void 0 && config.summary !== null && config.summary !== "" ? String(config.summary) : "Design review",
29
+ "description": config.description !== void 0 && config.description !== null && config.description !== "" ? String(config.description) : "",
30
+ "location": config.location !== void 0 && config.location !== null && config.location !== "" ? String(config.location) : "",
31
+ "creator": {
32
+ "email": "ada@example.test"
33
+ },
34
+ "organizer": {
35
+ "email": "ada@example.test"
36
+ },
37
+ "start": {
38
+ "dateTime": config.startDateTime !== void 0 && config.startDateTime !== null && config.startDateTime !== "" ? String(config.startDateTime) : "2026-10-01T14:00:00Z",
39
+ "timeZone": config.startTimeZone !== void 0 && config.startTimeZone !== null && config.startTimeZone !== "" ? String(config.startTimeZone) : "UTC"
40
+ },
41
+ "end": {
42
+ "dateTime": config.endDateTime !== void 0 && config.endDateTime !== null && config.endDateTime !== "" ? String(config.endDateTime) : "2026-10-01T15:00:00Z",
43
+ "timeZone": config.endTimeZone !== void 0 && config.endTimeZone !== null && config.endTimeZone !== "" ? String(config.endTimeZone) : "UTC"
44
+ },
45
+ "iCalUID": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,
46
+ "sequence": 0,
47
+ "reminders": {
48
+ "useDefault": true
49
+ },
50
+ "eventType": "default"
51
+ };
52
+ }
53
+ function fakeEventDelete({ config, fake }) {
54
+ return {};
55
+ }
19
56
  function fakeEventGet({ config, fake }) {
20
57
  const boundEventid = config.eventId !== void 0 && config.eventId !== null && config.eventId !== "" ? String(config.eventId) : fake.id("evt");
21
58
  return {
@@ -110,6 +147,40 @@ function fakeEventList({ config, fake }) {
110
147
  ]
111
148
  };
112
149
  }
150
+ function fakeEventUpdate({ config, fake }) {
151
+ return {
152
+ "kind": "calendar#event",
153
+ "etag": '"3456789012345680"',
154
+ "id": config.eventId !== void 0 && config.eventId !== null && config.eventId !== "" ? String(config.eventId) : fake.id("evt"),
155
+ "status": config.status !== void 0 && config.status !== null && config.status !== "" ? String(config.status) : "confirmed",
156
+ "htmlLink": "https://www.google.com/calendar/event?eid=ZmFrZQ",
157
+ "created": "2026-09-01T09:00:00.000Z",
158
+ "updated": "2026-09-30T09:15:00.000Z",
159
+ "summary": config.summary !== void 0 && config.summary !== null && config.summary !== "" ? String(config.summary) : "Design review",
160
+ "description": config.description !== void 0 && config.description !== null && config.description !== "" ? String(config.description) : "",
161
+ "location": config.location !== void 0 && config.location !== null && config.location !== "" ? String(config.location) : "",
162
+ "creator": {
163
+ "email": "ada@example.test"
164
+ },
165
+ "organizer": {
166
+ "email": "ada@example.test"
167
+ },
168
+ "start": {
169
+ "dateTime": config.startDateTime !== void 0 && config.startDateTime !== null && config.startDateTime !== "" ? String(config.startDateTime) : "2026-10-01T14:00:00Z",
170
+ "timeZone": config.startTimeZone !== void 0 && config.startTimeZone !== null && config.startTimeZone !== "" ? String(config.startTimeZone) : "UTC"
171
+ },
172
+ "end": {
173
+ "dateTime": config.endDateTime !== void 0 && config.endDateTime !== null && config.endDateTime !== "" ? String(config.endDateTime) : "2026-10-01T15:00:00Z",
174
+ "timeZone": config.endTimeZone !== void 0 && config.endTimeZone !== null && config.endTimeZone !== "" ? String(config.endTimeZone) : "UTC"
175
+ },
176
+ "iCalUID": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,
177
+ "sequence": 1,
178
+ "reminders": {
179
+ "useDefault": true
180
+ },
181
+ "eventType": "default"
182
+ };
183
+ }
113
184
  function fakeEventsChanged({ config, fake }) {
114
185
  const boundChannelid = `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`;
115
186
  return {
@@ -127,10 +198,16 @@ var googleCalendarFaker = (operation, request) => {
127
198
  return fakeChannelStop(request);
128
199
  case "channel_watch":
129
200
  return fakeChannelWatch(request);
201
+ case "event_create":
202
+ return fakeEventCreate(request);
203
+ case "event_delete":
204
+ return fakeEventDelete(request);
130
205
  case "event_get":
131
206
  return fakeEventGet(request);
132
207
  case "event_list":
133
208
  return fakeEventList(request);
209
+ case "event_update":
210
+ return fakeEventUpdate(request);
134
211
  case "events_changed":
135
212
  return fakeEventsChanged(request);
136
213
  default:
@@ -246,6 +323,89 @@ function nestFields(flat) {
246
323
  }
247
324
  return out;
248
325
  }
326
+ var EVENT_CREATE_OPERATION = "event_create";
327
+ async function googleCalendarEventCreate(options) {
328
+ const config = options.config ?? {};
329
+ if (config.calendarId === void 0 || config.calendarId === null || config.calendarId === "") {
330
+ throw new Error(`event_create: "calendarId" is required (Calendar ID).`);
331
+ }
332
+ if (config.summary === void 0 || config.summary === null || config.summary === "") {
333
+ throw new Error(`event_create: "summary" is required (Title).`);
334
+ }
335
+ if (config.startDateTime === void 0 || config.startDateTime === null || config.startDateTime === "") {
336
+ throw new Error(`event_create: "startDateTime" is required (Start).`);
337
+ }
338
+ if (config.endDateTime === void 0 || config.endDateTime === null || config.endDateTime === "") {
339
+ throw new Error(`event_create: "endDateTime" is required (End).`);
340
+ }
341
+ return callConnector(GOOGLE_CALENDAR, {
342
+ operation: EVENT_CREATE_OPERATION,
343
+ config,
344
+ input: options.input,
345
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
346
+ ...options.mode === void 0 ? {} : { mode: options.mode },
347
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
348
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
349
+ ...options.transport === void 0 ? {} : { transport: options.transport },
350
+ request: {
351
+ method: "POST",
352
+ path: `/calendar/v3/calendars/${encodeURIComponent(String(config.calendarId))}/events`,
353
+ json: nestFields2({
354
+ "summary": String(config.summary),
355
+ ...config.description !== void 0 && config.description !== null && config.description !== "" ? { "description": String(config.description) } : {},
356
+ ...config.location !== void 0 && config.location !== null && config.location !== "" ? { "location": String(config.location) } : {},
357
+ "start.dateTime": String(config.startDateTime),
358
+ ...config.startTimeZone !== void 0 && config.startTimeZone !== null && config.startTimeZone !== "" ? { "start.timeZone": String(config.startTimeZone) } : {},
359
+ "end.dateTime": String(config.endDateTime),
360
+ ...config.endTimeZone !== void 0 && config.endTimeZone !== null && config.endTimeZone !== "" ? { "end.timeZone": String(config.endTimeZone) } : {},
361
+ ...config.status !== void 0 && config.status !== null && config.status !== "" ? { "status": String(config.status) } : {},
362
+ ...config.visibility !== void 0 && config.visibility !== null && config.visibility !== "" ? { "visibility": String(config.visibility) } : {},
363
+ ...config.transparency !== void 0 && config.transparency !== null && config.transparency !== "" ? { "transparency": String(config.transparency) } : {},
364
+ ...config.colorId !== void 0 && config.colorId !== null && config.colorId !== "" ? { "colorId": String(config.colorId) } : {}
365
+ })
366
+ }
367
+ });
368
+ }
369
+ function nestFields2(flat) {
370
+ const out = {};
371
+ for (const [path, value] of Object.entries(flat)) {
372
+ const parts = path.split(".");
373
+ let node = out;
374
+ while (parts.length > 1) {
375
+ const key = parts.shift();
376
+ const wantsArray = /^\d+$/.test(parts[0] ?? "");
377
+ if (typeof node[key] !== "object" || node[key] === null) node[key] = wantsArray ? [] : {};
378
+ node = node[key];
379
+ }
380
+ node[parts[0]] = value;
381
+ }
382
+ return out;
383
+ }
384
+ var EVENT_DELETE_OPERATION = "event_delete";
385
+ async function googleCalendarEventDelete(options) {
386
+ const config = options.config ?? {};
387
+ if (config.calendarId === void 0 || config.calendarId === null || config.calendarId === "") {
388
+ throw new Error(`event_delete: "calendarId" is required (Calendar ID).`);
389
+ }
390
+ if (config.eventId === void 0 || config.eventId === null || config.eventId === "") {
391
+ throw new Error(`event_delete: "eventId" is required (Event ID).`);
392
+ }
393
+ return callConnector(GOOGLE_CALENDAR, {
394
+ operation: EVENT_DELETE_OPERATION,
395
+ config,
396
+ input: options.input,
397
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
398
+ ...options.mode === void 0 ? {} : { mode: options.mode },
399
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
400
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
401
+ ...options.transport === void 0 ? {} : { transport: options.transport },
402
+ request: {
403
+ method: "DELETE",
404
+ path: `/calendar/v3/calendars/${encodeURIComponent(String(config.calendarId))}/events/${encodeURIComponent(String(config.eventId))}`,
405
+ query: {}
406
+ }
407
+ });
408
+ }
249
409
  var EVENT_GET_OPERATION = "event_get";
250
410
  async function googleCalendarEventGet(options) {
251
411
  const config = options.config ?? {};
@@ -309,6 +469,58 @@ async function googleCalendarEventList(options) {
309
469
  }
310
470
  });
311
471
  }
472
+ var EVENT_UPDATE_OPERATION = "event_update";
473
+ async function googleCalendarEventUpdate(options) {
474
+ const config = options.config ?? {};
475
+ if (config.calendarId === void 0 || config.calendarId === null || config.calendarId === "") {
476
+ throw new Error(`event_update: "calendarId" is required (Calendar ID).`);
477
+ }
478
+ if (config.eventId === void 0 || config.eventId === null || config.eventId === "") {
479
+ throw new Error(`event_update: "eventId" is required (Event ID).`);
480
+ }
481
+ return callConnector(GOOGLE_CALENDAR, {
482
+ operation: EVENT_UPDATE_OPERATION,
483
+ config,
484
+ input: options.input,
485
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
486
+ ...options.mode === void 0 ? {} : { mode: options.mode },
487
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
488
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
489
+ ...options.transport === void 0 ? {} : { transport: options.transport },
490
+ request: {
491
+ method: "PATCH",
492
+ path: `/calendar/v3/calendars/${encodeURIComponent(String(config.calendarId))}/events/${encodeURIComponent(String(config.eventId))}`,
493
+ json: nestFields3({
494
+ ...config.summary !== void 0 && config.summary !== null && config.summary !== "" ? { "summary": String(config.summary) } : {},
495
+ ...config.description !== void 0 && config.description !== null && config.description !== "" ? { "description": String(config.description) } : {},
496
+ ...config.location !== void 0 && config.location !== null && config.location !== "" ? { "location": String(config.location) } : {},
497
+ ...config.startDateTime !== void 0 && config.startDateTime !== null && config.startDateTime !== "" ? { "start.dateTime": String(config.startDateTime) } : {},
498
+ ...config.startTimeZone !== void 0 && config.startTimeZone !== null && config.startTimeZone !== "" ? { "start.timeZone": String(config.startTimeZone) } : {},
499
+ ...config.endDateTime !== void 0 && config.endDateTime !== null && config.endDateTime !== "" ? { "end.dateTime": String(config.endDateTime) } : {},
500
+ ...config.endTimeZone !== void 0 && config.endTimeZone !== null && config.endTimeZone !== "" ? { "end.timeZone": String(config.endTimeZone) } : {},
501
+ ...config.status !== void 0 && config.status !== null && config.status !== "" ? { "status": String(config.status) } : {},
502
+ ...config.visibility !== void 0 && config.visibility !== null && config.visibility !== "" ? { "visibility": String(config.visibility) } : {},
503
+ ...config.transparency !== void 0 && config.transparency !== null && config.transparency !== "" ? { "transparency": String(config.transparency) } : {},
504
+ ...config.colorId !== void 0 && config.colorId !== null && config.colorId !== "" ? { "colorId": String(config.colorId) } : {}
505
+ })
506
+ }
507
+ });
508
+ }
509
+ function nestFields3(flat) {
510
+ const out = {};
511
+ for (const [path, value] of Object.entries(flat)) {
512
+ const parts = path.split(".");
513
+ let node = out;
514
+ while (parts.length > 1) {
515
+ const key = parts.shift();
516
+ const wantsArray = /^\d+$/.test(parts[0] ?? "");
517
+ if (typeof node[key] !== "object" || node[key] === null) node[key] = wantsArray ? [] : {};
518
+ node = node[key];
519
+ }
520
+ node[parts[0]] = value;
521
+ }
522
+ return out;
523
+ }
312
524
  var GOOGLE_CALENDAR_EVENTS_CHANGED_TOKEN_SCHEME = { kind: "shared-token", in: "header", name: "X-Goog-Channel-Token" };
313
525
  var GOOGLE_CALENDAR_EVENTS_CHANGED_LEASE = {
314
526
  expiresAtFrom: "expiration",
@@ -333,6 +545,6 @@ function verifyGoogleCalendarDelivery(delivery, channelToken, now) {
333
545
  return verifyDelivery(GOOGLE_CALENDAR_EVENTS_CHANGED, delivery, channelToken, now);
334
546
  }
335
547
 
336
- export { CHANNEL_STOP_OPERATION, CHANNEL_WATCH_OPERATION, CONNECTOR_API_VERSION, EVENT_GET_OPERATION, EVENT_LIST_OPERATION, GOOGLE_CALENDAR, GOOGLE_CALENDAR_BASE_URLS, GOOGLE_CALENDAR_EVENTS_CHANGED, GOOGLE_CALENDAR_EVENTS_CHANGED_LEASE, GOOGLE_CALENDAR_EVENTS_CHANGED_SUBSCRIPTION, GOOGLE_CALENDAR_EVENTS_CHANGED_TOKEN_SCHEME, GOOGLE_CALENDAR_REQUIRES, googleCalendarAuthorize, googleCalendarChannelStop, googleCalendarChannelWatch, googleCalendarEventGet, googleCalendarEventList, googleCalendarFaker, verifyGoogleCalendarDelivery };
337
- //# sourceMappingURL=chunk-VH6QZLPP.js.map
338
- //# sourceMappingURL=chunk-VH6QZLPP.js.map
548
+ export { CHANNEL_STOP_OPERATION, CHANNEL_WATCH_OPERATION, CONNECTOR_API_VERSION, EVENT_CREATE_OPERATION, EVENT_DELETE_OPERATION, EVENT_GET_OPERATION, EVENT_LIST_OPERATION, EVENT_UPDATE_OPERATION, GOOGLE_CALENDAR, GOOGLE_CALENDAR_BASE_URLS, GOOGLE_CALENDAR_EVENTS_CHANGED, GOOGLE_CALENDAR_EVENTS_CHANGED_LEASE, GOOGLE_CALENDAR_EVENTS_CHANGED_SUBSCRIPTION, GOOGLE_CALENDAR_EVENTS_CHANGED_TOKEN_SCHEME, GOOGLE_CALENDAR_REQUIRES, googleCalendarAuthorize, googleCalendarChannelStop, googleCalendarChannelWatch, googleCalendarEventCreate, googleCalendarEventDelete, googleCalendarEventGet, googleCalendarEventList, googleCalendarEventUpdate, googleCalendarFaker, verifyGoogleCalendarDelivery };
549
+ //# sourceMappingURL=chunk-7CMSUBWQ.js.map
550
+ //# sourceMappingURL=chunk-7CMSUBWQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/channel-stop.ts","../src/actions/channel-watch.ts","../src/actions/event-create.ts","../src/actions/event-delete.ts","../src/actions/event-get.ts","../src/actions/event-list.ts","../src/actions/event-update.ts","../src/triggers/events-changed.ts"],"names":["callConnector","nestFields"],"mappings":";;;AA0BA,SAAS,eAAA,CAAgB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AAC/D,EAAA,OAAO,EAAC;AACV;AAEA,SAAS,gBAAA,CAAiB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AAChE,EAAA,MAAM,iBAAkB,MAAA,CAAO,SAAA,KAAc,MAAA,IAAa,MAAA,CAAO,cAAc,IAAA,IAAQ,MAAA,CAAO,SAAA,KAAc,EAAA,GAAK,OAAO,MAAA,CAAO,SAAS,IAAI,CAAA,EAAG,IAAA,CAAK,IAAI,CAAC,CAAC,CAAA,CAAA,EAAI,IAAA,CAAK,IAAI,CAAC,CAAC,CAAA,CAAA,EAAI,IAAA,CAAK,IAAI,CAAC,CAAC,CAAA,CAAA,EAAI,IAAA,CAAK,IAAI,CAAC,CAAC,IAAI,IAAA,CAAK,GAAA,CAAI,EAAE,CAAC,CAAA,CAAA;AACvN,EAAA,MAAM,aAAc,MAAA,CAAO,KAAA,KAAU,MAAA,IAAa,MAA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AAA,KAAM,YAAY,IAAA,CAAK,GAAG,CAAA,KAAM,IAAA,OAAW,GAAG,CAAA,GAAI,UAAA,GAAa,KAAK,EAAC;AACxF,MAAA,IAAA,GAAO,KAAK,GAAG,CAAA;AAAA,IACjB;AAEA,IAAA,IAAA,CAAK,KAAA,CAAM,CAAC,CAAW,CAAA,GAAI,KAAA;AAAA,EAC7B;AAEA,EAAA,OAAO,GAAA;AACT;ACxFO,IAAM,8CAAiE,EAAE,IAAA,EAAM,gBAAgB,EAAA,EAAI,QAAA,EAAU,MAAM,sBAAA;AASnH,IAAM,oCAAA,GAAyD;AAAA,EACpE,aAAA,EAAe,YAAA;AAAA,EACf,aAAA,EAAe,UAAA;AAAA,EACf,kBAAA,EAAoB,KAAA;AAAA,EACpB,cAAA,EAAgB;AAClB;AAQO,IAAM,8CAA8C,EAAE,MAAA,EAAQ,iBAAiB,KAAA,EAAO,IAAA,EAAM,MAAM,cAAA;AAElG,IAAM,8BAAA,GAAoD;AAAA,EAC/D,OAAA,EAAS,iBAAA;AAAA,EACT,SAAA,EAAW,gBAAA;AAAA,EACX,QAAA,EAAU,cAAA;AAAA,EACV,KAAA,EACE,6sBAAA;AAAA,EACF,eAAA,EAAiB,MAAA;AAAA,EACjB,KAAA,EAAO,oCAAA;AAAA,EACP,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,KAAA,EAAO;AACT;AAYO,SAAS,4BAAA,CACd,QAAA,EACA,YAAA,EACA,GAAA,EAC8B;AAC9B,EAAA,OAAO,cAAA,CAAe,8BAAA,EAAgC,QAAA,EAAU,YAAA,EAAc,GAAG,CAAA;AACnF","file":"chunk-7CMSUBWQ.js","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 -- google_calendar\n */\n\n/**\n * The Google Calendar faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES Google Calendar 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 fakeChannelStop({ config, fake }: FakeRequest): unknown {\n return {};\n}\n\nfunction fakeChannelWatch({ config, fake }: FakeRequest): unknown {\n const boundChannelid = (config.channelId !== undefined && config.channelId !== null && config.channelId !== \"\" ? String(config.channelId) : `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`);\n const boundToken = (config.token !== undefined && config.token !== null && config.token !== \"\" ? String(config.token) : fake.id(\"tok\"));\n\n return {\n \"kind\": \"api#channel\",\n \"id\": boundChannelid,\n \"resourceId\": fake.id(\"o3hgv1538sdjfh\"),\n \"resourceUri\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events?alt=json\",\n \"token\": boundToken,\n \"expiration\": \"1789430400000\",\n };\n}\n\nfunction fakeEventCreate({ config, fake }: FakeRequest): unknown {\n return {\n \"kind\": \"calendar#event\",\n \"etag\": \"\\\"3456789012345679\\\"\",\n \"id\": fake.id(\"evt\"),\n \"status\": (config.status !== undefined && config.status !== null && config.status !== \"\" ? String(config.status) : \"confirmed\"),\n \"htmlLink\": \"https://www.google.com/calendar/event?eid=ZmFrZQ\",\n \"created\": \"2026-09-30T09:00:00.000Z\",\n \"updated\": \"2026-09-30T09:00:00.000Z\",\n \"summary\": (config.summary !== undefined && config.summary !== null && config.summary !== \"\" ? String(config.summary) : \"Design review\"),\n \"description\": (config.description !== undefined && config.description !== null && config.description !== \"\" ? String(config.description) : \"\"),\n \"location\": (config.location !== undefined && config.location !== null && config.location !== \"\" ? String(config.location) : \"\"),\n \"creator\": {\n \"email\": \"ada@example.test\",\n },\n \"organizer\": {\n \"email\": \"ada@example.test\",\n },\n \"start\": {\n \"dateTime\": (config.startDateTime !== undefined && config.startDateTime !== null && config.startDateTime !== \"\" ? String(config.startDateTime) : \"2026-10-01T14:00:00Z\"),\n \"timeZone\": (config.startTimeZone !== undefined && config.startTimeZone !== null && config.startTimeZone !== \"\" ? String(config.startTimeZone) : \"UTC\"),\n },\n \"end\": {\n \"dateTime\": (config.endDateTime !== undefined && config.endDateTime !== null && config.endDateTime !== \"\" ? String(config.endDateTime) : \"2026-10-01T15:00:00Z\"),\n \"timeZone\": (config.endTimeZone !== undefined && config.endTimeZone !== null && config.endTimeZone !== \"\" ? String(config.endTimeZone) : \"UTC\"),\n },\n \"iCalUID\": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,\n \"sequence\": 0,\n \"reminders\": {\n \"useDefault\": true,\n },\n \"eventType\": \"default\",\n };\n}\n\nfunction fakeEventDelete({ config, fake }: FakeRequest): unknown {\n return {};\n}\n\nfunction fakeEventGet({ config, fake }: FakeRequest): unknown {\n const boundEventid = (config.eventId !== undefined && config.eventId !== null && config.eventId !== \"\" ? String(config.eventId) : fake.id(\"evt\"));\n\n return {\n \"kind\": \"calendar#event\",\n \"etag\": \"\\\"3456789012345678\\\"\",\n \"id\": boundEventid,\n \"status\": \"confirmed\",\n \"htmlLink\": \"https://www.google.com/calendar/event?eid=ZmFrZQ\",\n \"created\": \"2026-09-01T09:00:00.000Z\",\n \"updated\": \"2026-09-10T15:30:00.000Z\",\n \"summary\": \"Design review\",\n \"description\": \"Quarterly design review with the platform team.\",\n \"creator\": {\n \"email\": \"ada@example.test\",\n },\n \"organizer\": {\n \"email\": \"ada@example.test\",\n },\n \"start\": {\n \"dateTime\": \"2026-09-22T14:00:00+00:00\",\n \"timeZone\": \"UTC\",\n },\n \"end\": {\n \"dateTime\": \"2026-09-22T15:00:00+00:00\",\n \"timeZone\": \"UTC\",\n },\n \"iCalUID\": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,\n \"sequence\": 0,\n \"attendees\": [\n {\n \"email\": \"ada@example.test\",\n \"organizer\": true,\n \"responseStatus\": \"accepted\",\n },\n {\n \"email\": \"grace@example.test\",\n \"responseStatus\": \"needsAction\",\n },\n ],\n \"reminders\": {\n \"useDefault\": true,\n },\n \"eventType\": \"default\",\n };\n}\n\nfunction fakeEventList({ config, fake }: FakeRequest): unknown {\n return {\n \"kind\": \"calendar#events\",\n \"etag\": \"\\\"p33cd9r3ab8ne20g\\\"\",\n \"summary\": \"ada@example.test\",\n \"updated\": \"2026-09-10T15:30:00.000Z\",\n \"timeZone\": \"UTC\",\n \"accessRole\": \"owner\",\n \"defaultReminders\": [\n {\n \"method\": \"popup\",\n \"minutes\": 10,\n },\n ],\n \"nextSyncToken\": fake.id(\"CPDSyncToken\"),\n \"items\": [\n {\n \"kind\": \"calendar#event\",\n \"etag\": \"\\\"3456789012345678\\\"\",\n \"id\": fake.id(\"evt\"),\n \"status\": \"confirmed\",\n \"htmlLink\": \"https://www.google.com/calendar/event?eid=ZmFrZQ\",\n \"created\": \"2026-09-01T09:00:00.000Z\",\n \"updated\": \"2026-09-10T15:30:00.000Z\",\n \"summary\": \"Design review\",\n \"creator\": {\n \"email\": \"ada@example.test\",\n },\n \"organizer\": {\n \"email\": \"ada@example.test\",\n },\n \"start\": {\n \"dateTime\": \"2026-09-22T14:00:00+00:00\",\n \"timeZone\": \"UTC\",\n },\n \"end\": {\n \"dateTime\": \"2026-09-22T15:00:00+00:00\",\n \"timeZone\": \"UTC\",\n },\n \"iCalUID\": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,\n \"sequence\": 0,\n \"reminders\": {\n \"useDefault\": true,\n },\n \"eventType\": \"default\",\n },\n ],\n };\n}\n\nfunction fakeEventUpdate({ config, fake }: FakeRequest): unknown {\n return {\n \"kind\": \"calendar#event\",\n \"etag\": \"\\\"3456789012345680\\\"\",\n \"id\": (config.eventId !== undefined && config.eventId !== null && config.eventId !== \"\" ? String(config.eventId) : fake.id(\"evt\")),\n \"status\": (config.status !== undefined && config.status !== null && config.status !== \"\" ? String(config.status) : \"confirmed\"),\n \"htmlLink\": \"https://www.google.com/calendar/event?eid=ZmFrZQ\",\n \"created\": \"2026-09-01T09:00:00.000Z\",\n \"updated\": \"2026-09-30T09:15:00.000Z\",\n \"summary\": (config.summary !== undefined && config.summary !== null && config.summary !== \"\" ? String(config.summary) : \"Design review\"),\n \"description\": (config.description !== undefined && config.description !== null && config.description !== \"\" ? String(config.description) : \"\"),\n \"location\": (config.location !== undefined && config.location !== null && config.location !== \"\" ? String(config.location) : \"\"),\n \"creator\": {\n \"email\": \"ada@example.test\",\n },\n \"organizer\": {\n \"email\": \"ada@example.test\",\n },\n \"start\": {\n \"dateTime\": (config.startDateTime !== undefined && config.startDateTime !== null && config.startDateTime !== \"\" ? String(config.startDateTime) : \"2026-10-01T14:00:00Z\"),\n \"timeZone\": (config.startTimeZone !== undefined && config.startTimeZone !== null && config.startTimeZone !== \"\" ? String(config.startTimeZone) : \"UTC\"),\n },\n \"end\": {\n \"dateTime\": (config.endDateTime !== undefined && config.endDateTime !== null && config.endDateTime !== \"\" ? String(config.endDateTime) : \"2026-10-01T15:00:00Z\"),\n \"timeZone\": (config.endTimeZone !== undefined && config.endTimeZone !== null && config.endTimeZone !== \"\" ? String(config.endTimeZone) : \"UTC\"),\n },\n \"iCalUID\": `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`,\n \"sequence\": 1,\n \"reminders\": {\n \"useDefault\": true,\n },\n \"eventType\": \"default\",\n };\n}\n\nfunction fakeEventsChanged({ config, fake }: FakeRequest): unknown {\n const boundChannelid = `${fake.hex(8)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(4)}-${fake.hex(12)}`;\n\n return {\n \"channelId\": boundChannelid,\n \"messageNumber\": \"2\",\n \"resourceId\": fake.id(\"o3hgv1538sdjfh\"),\n \"resourceState\": (config.sample !== undefined && config.sample !== null && config.sample !== \"\" ? String(config.sample) : \"exists\"),\n \"resourceUri\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events?alt=json\",\n \"channelExpiration\": \"Tue, 15 Sep 2026 00:00:00 GMT\",\n };\n}\n\nexport const googleCalendarFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"channel_stop\":\n return fakeChannelStop(request);\n\n case \"channel_watch\":\n return fakeChannelWatch(request);\n\n case \"event_create\":\n return fakeEventCreate(request);\n\n case \"event_delete\":\n return fakeEventDelete(request);\n\n case \"event_get\":\n return fakeEventGet(request);\n\n case \"event_list\":\n return fakeEventList(request);\n\n case \"event_update\":\n return fakeEventUpdate(request);\n\n case \"events_changed\":\n return fakeEventsChanged(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 `google_calendar: 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 -- google_calendar\n */\n\n/**\n * Google Calendar, as one service descriptor shared by every Google Calendar\n * operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of Google Calendar: its base URL, its\n * auth scheme, its idempotency header, and its faker.\n *\n * ## The sandbox trap, written down where it is used\n *\n * Google has no sandbox for Calendar. A test calendar is a real one in a real\n * account, so every watch and every read is real -- point this at a scratch\n * calendar, not a production one. The faker is the only way to develop against\n * it without touching an account.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { googleCalendarFaker } 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 GOOGLE_CALENDAR_BASE_URLS = {\n \"live\": \"https://www.googleapis.com\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const GOOGLE_CALENDAR_REQUIRES = [\n \"accessToken\",\n \"refreshToken\",\n \"clientId\",\n \"clientSecret\"\n] as const;\n\n/**\n * Apply Google Calendar'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 googleCalendarAuthorize(\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 Google Calendar service, for the TypeScript runtime. */\nexport const GOOGLE_CALENDAR: ServiceDescriptor = {\n service: \"google_calendar\",\n title: \"Google Calendar\",\n sandbox: \"none\",\n baseUrls: { ...GOOGLE_CALENDAR_BASE_URLS },\n requires: [...GOOGLE_CALENDAR_REQUIRES],\n authorize: googleCalendarAuthorize,\n faker: googleCalendarFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/channel-stop.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/channel-stop.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_calendar\n */\n\n/**\n * Close a push-notification channel. The host's subscription machinery calls\n * this before re-creating a channel and when a trigger is removed.\n *\n * POST /calendar/v3/channels/stop —\n * https://developers.google.com/workspace/calendar/api/v3/reference/channels/stop\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 Google Calendar or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_CALENDAR } from \"../service.js\";\n\nexport const CHANNEL_STOP_OPERATION = \"channel_stop\";\n\nexport type ChannelStopOptions = {\n /** The node's resolved config. Keys: channelId, resourceId. */\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 googleCalendarChannelStop(options: ChannelStopOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.channelId === undefined || config.channelId === null || config.channelId === \"\") {\n throw new Error(`channel_stop: \"channelId\" is required (Channel ID).`);\n }\n\n if (config.resourceId === undefined || config.resourceId === null || config.resourceId === \"\") {\n throw new Error(`channel_stop: \"resourceId\" is required (Resource ID).`);\n }\n\n return callConnector(GOOGLE_CALENDAR, {\n operation: CHANNEL_STOP_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: \"/calendar/v3/channels/stop\",\n json: {\n \"id\": String(config.channelId),\n \"resourceId\": String(config.resourceId),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/channel-watch.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/channel-watch.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_calendar\n */\n\n/**\n * Open a push-notification channel on a calendar's events. The host's\n * subscription machinery calls this; it is not a node most workflows need.\n *\n * POST /calendar/v3/calendars/{calendarId}/events/watch —\n * https://developers.google.com/workspace/calendar/api/v3/reference/events/watch\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 Google Calendar or calls the\n * 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 { GOOGLE_CALENDAR } from \"../service.js\";\n\nexport const CHANNEL_WATCH_OPERATION = \"channel_watch\";\n\nexport type ChannelWatchOptions = {\n /** The node's resolved config. Keys: calendarId, channelId, address, token, ttlSeconds. */\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 googleCalendarChannelWatch(options: ChannelWatchOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.calendarId === undefined || config.calendarId === null || config.calendarId === \"\") {\n throw new Error(`channel_watch: \"calendarId\" is required (Calendar ID).`);\n }\n\n if (config.channelId === undefined || config.channelId === null || config.channelId === \"\") {\n throw new Error(`channel_watch: \"channelId\" is required (Channel ID).`);\n }\n\n if (config.address === undefined || config.address === null || config.address === \"\") {\n throw new Error(`channel_watch: \"address\" is required (Notification URL).`);\n }\n\n if (config.token === undefined || config.token === null || config.token === \"\") {\n throw new Error(`channel_watch: \"token\" is required (Channel token).`);\n }\n\n if (config.ttlSeconds === undefined || config.ttlSeconds === null || config.ttlSeconds === \"\") {\n throw new Error(`channel_watch: \"ttlSeconds\" is required (Lifetime (seconds)).`);\n }\n\n return callConnector(GOOGLE_CALENDAR, {\n operation: CHANNEL_WATCH_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: `/calendar/v3/calendars/${encodeURIComponent(String(config.calendarId))}/events/watch`,\n json: nestFields({\n \"id\": String(config.channelId),\n \"address\": String(config.address),\n \"token\": String(config.token),\n \"params.ttl\": String(config.ttlSeconds),\n \"type\": \"web_hook\",\n }),\n },\n });\n}\n\n/**\n * `{\"properties.email\": x}` -> `{properties: {email: x}}`.\n *\n * A dotted `as` means NESTING, and only a JSON body can nest. The validator\n * refuses that spelling anywhere else, because in a form body it already means\n * something different — a literal dotted key.\n */\nfunction nestFields(flat: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n\n for (const [path, value] of Object.entries(flat)) {\n const parts = path.split(\".\");\n let node = out;\n\n while (parts.length > 1) {\n const key = parts.shift() as string;\n // A NUMERIC segment is an array index: `dateRanges.0.startDate` has to\n // become `[{startDate}]`, not `{\"0\": {startDate}}`. PHP produced the\n // array by accident (its integer-keyed arrays serialise as JSON lists)\n // and the other two produced an object, which the provider rejects as\n // the wrong type. The parity suite is what caught the disagreement.\n const wantsArray = /^\\d+$/.test(parts[0] ?? \"\");\n\n if (typeof node[key] !== \"object\" || node[key] === null) node[key] = wantsArray ? [] : {};\n node = node[key] as Record<string, unknown>;\n }\n\n node[parts[0] as string] = value;\n }\n\n return out;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/event-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/event-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_calendar\n */\n\n/**\n * Create a timed event on a Google Calendar.\n *\n * POST /calendar/v3/calendars/{calendarId}/events —\n * https://developers.google.com/workspace/calendar/api/v3/reference/events/insert\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 Google Calendar or calls the\n * 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 { GOOGLE_CALENDAR } from \"../service.js\";\n\nexport const EVENT_CREATE_OPERATION = \"event_create\";\n\nexport type EventCreateOptions = {\n /** The node's resolved config. Keys: calendarId, summary, description, location, startDateTime, startTimeZone, endDateTime, endTimeZone, status, visibility, transparency, colorId. */\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 googleCalendarEventCreate(options: EventCreateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.calendarId === undefined || config.calendarId === null || config.calendarId === \"\") {\n throw new Error(`event_create: \"calendarId\" is required (Calendar ID).`);\n }\n\n if (config.summary === undefined || config.summary === null || config.summary === \"\") {\n throw new Error(`event_create: \"summary\" is required (Title).`);\n }\n\n if (config.startDateTime === undefined || config.startDateTime === null || config.startDateTime === \"\") {\n throw new Error(`event_create: \"startDateTime\" is required (Start).`);\n }\n\n if (config.endDateTime === undefined || config.endDateTime === null || config.endDateTime === \"\") {\n throw new Error(`event_create: \"endDateTime\" is required (End).`);\n }\n\n return callConnector(GOOGLE_CALENDAR, {\n operation: EVENT_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: `/calendar/v3/calendars/${encodeURIComponent(String(config.calendarId))}/events`,\n json: nestFields({\n \"summary\": String(config.summary),\n ...(config.description !== undefined && config.description !== null && config.description !== \"\" ? { \"description\": String(config.description) } : {}),\n ...(config.location !== undefined && config.location !== null && config.location !== \"\" ? { \"location\": String(config.location) } : {}),\n \"start.dateTime\": String(config.startDateTime),\n ...(config.startTimeZone !== undefined && config.startTimeZone !== null && config.startTimeZone !== \"\" ? { \"start.timeZone\": String(config.startTimeZone) } : {}),\n \"end.dateTime\": String(config.endDateTime),\n ...(config.endTimeZone !== undefined && config.endTimeZone !== null && config.endTimeZone !== \"\" ? { \"end.timeZone\": String(config.endTimeZone) } : {}),\n ...(config.status !== undefined && config.status !== null && config.status !== \"\" ? { \"status\": String(config.status) } : {}),\n ...(config.visibility !== undefined && config.visibility !== null && config.visibility !== \"\" ? { \"visibility\": String(config.visibility) } : {}),\n ...(config.transparency !== undefined && config.transparency !== null && config.transparency !== \"\" ? { \"transparency\": String(config.transparency) } : {}),\n ...(config.colorId !== undefined && config.colorId !== null && config.colorId !== \"\" ? { \"colorId\": String(config.colorId) } : {}),\n }),\n },\n });\n}\n\n/**\n * `{\"properties.email\": x}` -> `{properties: {email: x}}`.\n *\n * A dotted `as` means NESTING, and only a JSON body can nest. The validator\n * refuses that spelling anywhere else, because in a form body it already means\n * something different — a literal dotted key.\n */\nfunction nestFields(flat: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n\n for (const [path, value] of Object.entries(flat)) {\n const parts = path.split(\".\");\n let node = out;\n\n while (parts.length > 1) {\n const key = parts.shift() as string;\n // A NUMERIC segment is an array index: `dateRanges.0.startDate` has to\n // become `[{startDate}]`, not `{\"0\": {startDate}}`. PHP produced the\n // array by accident (its integer-keyed arrays serialise as JSON lists)\n // and the other two produced an object, which the provider rejects as\n // the wrong type. The parity suite is what caught the disagreement.\n const wantsArray = /^\\d+$/.test(parts[0] ?? \"\");\n\n if (typeof node[key] !== \"object\" || node[key] === null) node[key] = wantsArray ? [] : {};\n node = node[key] as Record<string, unknown>;\n }\n\n node[parts[0] as string] = value;\n }\n\n return out;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/event-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/event-delete.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_calendar\n */\n\n/**\n * Remove an event from a Google Calendar.\n *\n * DELETE /calendar/v3/calendars/{calendarId}/events/{eventId} —\n * https://developers.google.com/workspace/calendar/api/v3/reference/events/delete\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 Google Calendar or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_CALENDAR } from \"../service.js\";\n\nexport const EVENT_DELETE_OPERATION = \"event_delete\";\n\nexport type EventDeleteOptions = {\n /** The node's resolved config. Keys: calendarId, eventId. */\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 googleCalendarEventDelete(options: EventDeleteOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.calendarId === undefined || config.calendarId === null || config.calendarId === \"\") {\n throw new Error(`event_delete: \"calendarId\" is required (Calendar ID).`);\n }\n\n if (config.eventId === undefined || config.eventId === null || config.eventId === \"\") {\n throw new Error(`event_delete: \"eventId\" is required (Event ID).`);\n }\n\n return callConnector(GOOGLE_CALENDAR, {\n operation: EVENT_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: `/calendar/v3/calendars/${encodeURIComponent(String(config.calendarId))}/events/${encodeURIComponent(String(config.eventId))}`,\n query: {},\n },\n });\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 -- google_calendar\n */\n\n/**\n * Read one event from a Google Calendar.\n *\n * GET /calendar/v3/calendars/{calendarId}/events/{eventId} —\n * https://developers.google.com/workspace/calendar/api/v3/reference/events/get\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 Google Calendar or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_CALENDAR } from \"../service.js\";\n\nexport const EVENT_GET_OPERATION = \"event_get\";\n\nexport type EventGetOptions = {\n /** The node's resolved config. Keys: calendarId, eventId. */\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 googleCalendarEventGet(options: EventGetOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.calendarId === undefined || config.calendarId === null || config.calendarId === \"\") {\n throw new Error(`event_get: \"calendarId\" is required (Calendar ID).`);\n }\n\n if (config.eventId === undefined || config.eventId === null || config.eventId === \"\") {\n throw new Error(`event_get: \"eventId\" is required (Event ID).`);\n }\n\n return callConnector(GOOGLE_CALENDAR, {\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: `/calendar/v3/calendars/${encodeURIComponent(String(config.calendarId))}/events/${encodeURIComponent(String(config.eventId))}`,\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 -- google_calendar\n */\n\n/**\n * List events from a Google Calendar, in full or incrementally with a sync\n * token.\n *\n * GET /calendar/v3/calendars/{calendarId}/events —\n * https://developers.google.com/workspace/calendar/api/v3/reference/events/list\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 Google Calendar or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_CALENDAR } from \"../service.js\";\n\nexport const EVENT_LIST_OPERATION = \"event_list\";\n\nexport type EventListOptions = {\n /** The node's resolved config. Keys: calendarId, syncToken, timeMin, timeMax, maxResults, pageToken, singleEvents. */\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 googleCalendarEventList(options: EventListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.calendarId === undefined || config.calendarId === null || config.calendarId === \"\") {\n throw new Error(`event_list: \"calendarId\" is required (Calendar ID).`);\n }\n\n {\n const n = Number(config.maxResults);\n const given = config.maxResults !== undefined && config.maxResults !== null && config.maxResults !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 2500)) {\n throw new Error(\n `event_list: \"maxResults\" must be a integer, got ${JSON.stringify(config.maxResults)}.`,\n );\n }\n }\n\n return callConnector(GOOGLE_CALENDAR, {\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: `/calendar/v3/calendars/${encodeURIComponent(String(config.calendarId))}/events`,\n query: {\n ...(config.syncToken !== undefined && config.syncToken !== null && config.syncToken !== \"\" ? { \"syncToken\": String(config.syncToken) } : {}),\n ...(config.timeMin !== undefined && config.timeMin !== null && config.timeMin !== \"\" ? { \"timeMin\": String(config.timeMin) } : {}),\n ...(config.timeMax !== undefined && config.timeMax !== null && config.timeMax !== \"\" ? { \"timeMax\": String(config.timeMax) } : {}),\n \"maxResults\": config.maxResults !== undefined && config.maxResults !== null && config.maxResults !== \"\" ? Math.trunc(Number(config.maxResults)) : 250,\n ...(config.pageToken !== undefined && config.pageToken !== null && config.pageToken !== \"\" ? { \"pageToken\": String(config.pageToken) } : {}),\n ...(config.singleEvents !== undefined && config.singleEvents !== null && config.singleEvents !== \"\" ? { \"singleEvents\": Boolean(config.singleEvents) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/event-update.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-update.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_calendar\n */\n\n/**\n * Change one or more fields of an existing event. Only the fields provided are\n * touched.\n *\n * PATCH /calendar/v3/calendars/{calendarId}/events/{eventId} —\n * https://developers.google.com/workspace/calendar/api/v3/reference/events/patch\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 Google Calendar or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_CALENDAR } from \"../service.js\";\n\nexport const EVENT_UPDATE_OPERATION = \"event_update\";\n\nexport type EventUpdateOptions = {\n /** The node's resolved config. Keys: calendarId, eventId, summary, description, location, startDateTime, startTimeZone, endDateTime, endTimeZone, status, visibility, transparency, colorId. */\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 googleCalendarEventUpdate(options: EventUpdateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.calendarId === undefined || config.calendarId === null || config.calendarId === \"\") {\n throw new Error(`event_update: \"calendarId\" is required (Calendar ID).`);\n }\n\n if (config.eventId === undefined || config.eventId === null || config.eventId === \"\") {\n throw new Error(`event_update: \"eventId\" is required (Event ID).`);\n }\n\n return callConnector(GOOGLE_CALENDAR, {\n operation: EVENT_UPDATE_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: `/calendar/v3/calendars/${encodeURIComponent(String(config.calendarId))}/events/${encodeURIComponent(String(config.eventId))}`,\n json: nestFields({\n ...(config.summary !== undefined && config.summary !== null && config.summary !== \"\" ? { \"summary\": String(config.summary) } : {}),\n ...(config.description !== undefined && config.description !== null && config.description !== \"\" ? { \"description\": String(config.description) } : {}),\n ...(config.location !== undefined && config.location !== null && config.location !== \"\" ? { \"location\": String(config.location) } : {}),\n ...(config.startDateTime !== undefined && config.startDateTime !== null && config.startDateTime !== \"\" ? { \"start.dateTime\": String(config.startDateTime) } : {}),\n ...(config.startTimeZone !== undefined && config.startTimeZone !== null && config.startTimeZone !== \"\" ? { \"start.timeZone\": String(config.startTimeZone) } : {}),\n ...(config.endDateTime !== undefined && config.endDateTime !== null && config.endDateTime !== \"\" ? { \"end.dateTime\": String(config.endDateTime) } : {}),\n ...(config.endTimeZone !== undefined && config.endTimeZone !== null && config.endTimeZone !== \"\" ? { \"end.timeZone\": String(config.endTimeZone) } : {}),\n ...(config.status !== undefined && config.status !== null && config.status !== \"\" ? { \"status\": String(config.status) } : {}),\n ...(config.visibility !== undefined && config.visibility !== null && config.visibility !== \"\" ? { \"visibility\": String(config.visibility) } : {}),\n ...(config.transparency !== undefined && config.transparency !== null && config.transparency !== \"\" ? { \"transparency\": String(config.transparency) } : {}),\n ...(config.colorId !== undefined && config.colorId !== null && config.colorId !== \"\" ? { \"colorId\": String(config.colorId) } : {}),\n }),\n },\n });\n}\n\n/**\n * `{\"properties.email\": x}` -> `{properties: {email: x}}`.\n *\n * A dotted `as` means NESTING, and only a JSON body can nest. The validator\n * refuses that spelling anywhere else, because in a form body it already means\n * something different — a literal dotted key.\n */\nfunction nestFields(flat: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n\n for (const [path, value] of Object.entries(flat)) {\n const parts = path.split(\".\");\n let node = out;\n\n while (parts.length > 1) {\n const key = parts.shift() as string;\n // A NUMERIC segment is an array index: `dateRanges.0.startDate` has to\n // become `[{startDate}]`, not `{\"0\": {startDate}}`. PHP produced the\n // array by accident (its integer-keyed arrays serialise as JSON lists)\n // and the other two produced an object, which the provider rejects as\n // the wrong type. The parity suite is what caught the disagreement.\n const wantsArray = /^\\d+$/.test(parts[0] ?? \"\");\n\n if (typeof node[key] !== \"object\" || node[key] === null) node[key] = wantsArray ? [] : {};\n node = node[key] as Record<string, unknown>;\n }\n\n node[parts[0] as string] = value;\n }\n\n return out;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/triggers/events-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/events-changed.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_calendar\n */\n\n/**\n * Google Calendar'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 GOOGLE CALENDAR. Two Google\n * Calendar triggers must not be able to disagree about how a delivery is\n * verified.\n *\n * A SUBSCRIPTION: Google Calendar stops delivering unless somebody renews it,\n * 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 { verifyDelivery, type InboundDelivery, type LeaseDeclaration, type SharedTokenScheme, type TriggerDescriptor, type WebhookVerification } from \"@particle-academy/fancy-connector-core\";\nimport { googleCalendarFaker } from \"../faker.js\";\n\n/** Where Google Calendar echoes the token it was given when the subscription was created. */\nexport const GOOGLE_CALENDAR_EVENTS_CHANGED_TOKEN_SCHEME: SharedTokenScheme = { kind: \"shared-token\", in: \"header\", name: \"X-Goog-Channel-Token\" };\n\n/**\n * The lease this subscription carries: where the provider's expiry sits in the\n * `channel_watch` response (`expiration`, epoch-ms), how early the host\n * renews, and what it calls when the lease is due — the create again, because\n * Google Calendar cannot renew. The host builds the value with the core's\n * `leaseFromResponse` and runs one scheduler for every expiring trigger.\n */\nexport const GOOGLE_CALENDAR_EVENTS_CHANGED_LEASE: LeaseDeclaration = {\n expiresAtFrom: \"expiration\",\n expiresAtUnit: \"epoch-ms\",\n renewBeforeSeconds: 86400,\n renewOperation: \"channel_watch\",\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 GOOGLE_CALENDAR_EVENTS_CHANGED_SUBSCRIPTION = { create: \"channel_watch\", renew: null, stop: \"channel_stop\" } as const;\n\nexport const GOOGLE_CALENDAR_EVENTS_CHANGED: TriggerDescriptor = {\n service: \"google_calendar\",\n operation: \"events_changed\",\n delivery: \"subscription\",\n setup:\n \"The host mints a UUID, calls channel_watch with it, its own URL for this trigger and the connection's channelToken, and stores the returned id, resourceId and expiration. Google cannot renew a channel: 86400 seconds before it expires the host calls channel_stop and then channel_watch again. A channel that lapsed is re-listed FIRST (event_list with the stored syncToken; a 410 means list in full) and then re-created, because notifications during the gap are gone. Google delivers with an EMPTY body: the host verifies X-Goog-Channel-Token against the connection's channelToken and injects the X-Goog-* headers as the event, camel-cased as below. The first message on a new channel is `sync` and carries no change.\",\n subscriptionTtl: 604800,\n lease: GOOGLE_CALENDAR_EVENTS_CHANGED_LEASE,\n verification: {\n scheme: GOOGLE_CALENDAR_EVENTS_CHANGED_TOKEN_SCHEME,\n },\n faker: googleCalendarFaker,\n};\n\n/**\n * Verify one inbound Google Calendar 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 `channelToken`.\n */\nexport function verifyGoogleCalendarDelivery(\n delivery: InboundDelivery,\n channelToken: string | undefined,\n now?: number,\n): Promise<WebhookVerification> {\n return verifyDelivery(GOOGLE_CALENDAR_EVENTS_CHANGED, delivery, channelToken, now);\n}\n"]}