@particle-academy/google-calendar-js 0.0.0 → 0.1.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.
@@ -0,0 +1,287 @@
1
+ import { ServiceDescriptor, PreparedRequest, ConnectorMode, ConnectorFaker, RequestedMode, Transport, ConnectorResult, TriggerDescriptor, LeaseDeclaration, SharedTokenScheme, InboundDelivery, WebhookVerification } from '@particle-academy/fancy-connector-core';
2
+
3
+ /**
4
+ * GENERATED FILE — do not edit.
5
+ *
6
+ * Emitted from provider/manifest.json by weaver's generator.
7
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
8
+ * being rejected, because it works until it silently does not. Fix
9
+ * provider/manifest.json (or weaver's template/) and regenerate:
10
+ *
11
+ * npm run provider -- google_calendar
12
+ */
13
+ /**
14
+ * Google Calendar, as one service descriptor shared by every Google Calendar
15
+ * operation.
16
+ *
17
+ * @particle-academy/fancy-connector-core carries what is true of ALL
18
+ * connectors. This carries what is true of Google Calendar: its base URL, its
19
+ * auth scheme, its idempotency header, and its faker.
20
+ *
21
+ * ## The sandbox trap, written down where it is used
22
+ *
23
+ * Google has no sandbox for Calendar. A test calendar is a real one in a real
24
+ * account, so every watch and every read is real -- point this at a scratch
25
+ * calendar, not a production one. The faker is the only way to develop against
26
+ * it without touching an account.
27
+ */
28
+
29
+ /**
30
+ * The connector API version this package was GENERATED against.
31
+ *
32
+ * A literal, never imported. An imported constant lets an upgrade rewrite the
33
+ * very claim it exists to detect, after which the copy agrees with itself
34
+ * forever.
35
+ */
36
+ declare const CONNECTOR_API_VERSION = 1;
37
+ declare const GOOGLE_CALENDAR_BASE_URLS: {
38
+ readonly live: "https://www.googleapis.com";
39
+ };
40
+ /** Credential keys a remote call cannot proceed without. */
41
+ declare const GOOGLE_CALENDAR_REQUIRES: readonly ["accessToken", "refreshToken", "clientId", "clientSecret"];
42
+ /**
43
+ * Apply Google Calendar's auth scheme to an outgoing request.
44
+ *
45
+ *
46
+ *
47
+ * The mode is passed in because for some providers auth and estate are the
48
+ * same decision expressed in the URL; here it is unused, and saying so is
49
+ * cheaper than wondering later whether it was forgotten.
50
+ */
51
+ declare function googleCalendarAuthorize(credentials: Record<string, string | undefined>, request: PreparedRequest, _mode: ConnectorMode): void;
52
+ /** The Google Calendar service, for the TypeScript runtime. */
53
+ declare const GOOGLE_CALENDAR: ServiceDescriptor;
54
+
55
+ /**
56
+ * GENERATED FILE — do not edit.
57
+ *
58
+ * Emitted from provider/fixtures/ by weaver's generator.
59
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
60
+ * being rejected, because it works until it silently does not. Fix
61
+ * provider/fixtures/ (or weaver's template/) and regenerate:
62
+ *
63
+ * npm run provider -- google_calendar
64
+ */
65
+ /**
66
+ * The Google Calendar faker.
67
+ *
68
+ * Shapes, not behaviour: the goal is that a downstream node sees the field
69
+ * NAMES Google Calendar actually publishes, so an author can wire {{
70
+ * $json.data.id }} against a fake and have it keep working against the real
71
+ * thing.
72
+ *
73
+ * Deterministic — same inputs, same output. A faker returning a fresh uuid
74
+ * every call cannot be asserted on, so its fixtures degrade to "it did not
75
+ * throw", which is the assertion that catches nothing.
76
+ */
77
+
78
+ declare const googleCalendarFaker: ConnectorFaker;
79
+
80
+ /**
81
+ * GENERATED FILE — do not edit.
82
+ *
83
+ * Emitted from provider/actions/channel-stop.json by weaver's generator.
84
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
85
+ * being rejected, because it works until it silently does not. Fix
86
+ * provider/actions/channel-stop.json (or weaver's template/) and regenerate:
87
+ *
88
+ * npm run provider -- google_calendar
89
+ */
90
+ /**
91
+ * Close a push-notification channel. The host's subscription machinery calls
92
+ * this before re-creating a channel and when a trigger is removed.
93
+ *
94
+ * POST /calendar/v3/channels/stop —
95
+ * https://developers.google.com/workspace/calendar/api/v3/reference/channels/stop
96
+ *
97
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
98
+ * no fake/real branch. This describes the request; callConnector resolves the
99
+ * connection, picks the estate, and either calls Google Calendar or calls the
100
+ * faker.
101
+ */
102
+
103
+ declare const CHANNEL_STOP_OPERATION = "channel_stop";
104
+ type ChannelStopOptions = {
105
+ /** The node's resolved config. Keys: channelId, resourceId. */
106
+ config: Record<string, unknown>;
107
+ credentials?: Record<string, string | undefined>;
108
+ mode?: RequestedMode;
109
+ connectionId?: string | null;
110
+ input?: unknown;
111
+ attempts?: number;
112
+ /** Override the transport. The only way to exercise this without a network. */
113
+ transport?: Transport;
114
+ };
115
+ declare function googleCalendarChannelStop(options: ChannelStopOptions): Promise<ConnectorResult>;
116
+
117
+ /**
118
+ * GENERATED FILE — do not edit.
119
+ *
120
+ * Emitted from provider/actions/channel-watch.json by weaver's generator.
121
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
122
+ * being rejected, because it works until it silently does not. Fix
123
+ * provider/actions/channel-watch.json (or weaver's template/) and regenerate:
124
+ *
125
+ * npm run provider -- google_calendar
126
+ */
127
+ /**
128
+ * Open a push-notification channel on a calendar's events. The host's
129
+ * subscription machinery calls this; it is not a node most workflows need.
130
+ *
131
+ * POST /calendar/v3/calendars/{calendarId}/events/watch —
132
+ * https://developers.google.com/workspace/calendar/api/v3/reference/events/watch
133
+ *
134
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
135
+ * no fake/real branch. This describes the request; callConnector resolves the
136
+ * connection, picks the estate, and either calls Google Calendar or calls the
137
+ * faker.
138
+ *
139
+ * sideEffects: unsafe-to-replay.
140
+ */
141
+
142
+ declare const CHANNEL_WATCH_OPERATION = "channel_watch";
143
+ type ChannelWatchOptions = {
144
+ /** The node's resolved config. Keys: calendarId, channelId, address, token, ttlSeconds. */
145
+ config: Record<string, unknown>;
146
+ credentials?: Record<string, string | undefined>;
147
+ mode?: RequestedMode;
148
+ connectionId?: string | null;
149
+ input?: unknown;
150
+ attempts?: number;
151
+ /** Override the transport. The only way to exercise this without a network. */
152
+ transport?: Transport;
153
+ };
154
+ declare function googleCalendarChannelWatch(options: ChannelWatchOptions): Promise<ConnectorResult>;
155
+
156
+ /**
157
+ * GENERATED FILE — do not edit.
158
+ *
159
+ * Emitted from provider/actions/event-get.json by weaver's generator.
160
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
161
+ * being rejected, because it works until it silently does not. Fix
162
+ * provider/actions/event-get.json (or weaver's template/) and regenerate:
163
+ *
164
+ * npm run provider -- google_calendar
165
+ */
166
+ /**
167
+ * Read one event from a Google Calendar.
168
+ *
169
+ * GET /calendar/v3/calendars/{calendarId}/events/{eventId} —
170
+ * https://developers.google.com/workspace/calendar/api/v3/reference/events/get
171
+ *
172
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
173
+ * no fake/real branch. This describes the request; callConnector resolves the
174
+ * connection, picks the estate, and either calls Google Calendar or calls the
175
+ * faker.
176
+ */
177
+
178
+ declare const EVENT_GET_OPERATION = "event_get";
179
+ type EventGetOptions = {
180
+ /** The node's resolved config. Keys: calendarId, eventId. */
181
+ config: Record<string, unknown>;
182
+ credentials?: Record<string, string | undefined>;
183
+ mode?: RequestedMode;
184
+ connectionId?: string | null;
185
+ input?: unknown;
186
+ attempts?: number;
187
+ /** Override the transport. The only way to exercise this without a network. */
188
+ transport?: Transport;
189
+ };
190
+ declare function googleCalendarEventGet(options: EventGetOptions): Promise<ConnectorResult>;
191
+
192
+ /**
193
+ * GENERATED FILE — do not edit.
194
+ *
195
+ * Emitted from provider/actions/event-list.json by weaver's generator.
196
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
197
+ * being rejected, because it works until it silently does not. Fix
198
+ * provider/actions/event-list.json (or weaver's template/) and regenerate:
199
+ *
200
+ * npm run provider -- google_calendar
201
+ */
202
+ /**
203
+ * List events from a Google Calendar, in full or incrementally with a sync
204
+ * token.
205
+ *
206
+ * GET /calendar/v3/calendars/{calendarId}/events —
207
+ * https://developers.google.com/workspace/calendar/api/v3/reference/events/list
208
+ *
209
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
210
+ * no fake/real branch. This describes the request; callConnector resolves the
211
+ * connection, picks the estate, and either calls Google Calendar or calls the
212
+ * faker.
213
+ */
214
+
215
+ declare const EVENT_LIST_OPERATION = "event_list";
216
+ type EventListOptions = {
217
+ /** The node's resolved config. Keys: calendarId, syncToken, timeMin, timeMax, maxResults, pageToken, singleEvents. */
218
+ config: Record<string, unknown>;
219
+ credentials?: Record<string, string | undefined>;
220
+ mode?: RequestedMode;
221
+ connectionId?: string | null;
222
+ input?: unknown;
223
+ attempts?: number;
224
+ /** Override the transport. The only way to exercise this without a network. */
225
+ transport?: Transport;
226
+ };
227
+ declare function googleCalendarEventList(options: EventListOptions): Promise<ConnectorResult>;
228
+
229
+ /**
230
+ * GENERATED FILE — do not edit.
231
+ *
232
+ * Emitted from provider/triggers/events-changed.json by weaver's generator.
233
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
234
+ * being rejected, because it works until it silently does not. Fix
235
+ * provider/triggers/events-changed.json (or weaver's template/) and regenerate:
236
+ *
237
+ * npm run provider -- google_calendar
238
+ */
239
+ /**
240
+ * Google Calendar's subscription trigger — the delivery contract.
241
+ *
242
+ * Kept beside the service descriptor rather than inside a node, because the
243
+ * way a delivery is verified is a fact about GOOGLE CALENDAR. Two Google
244
+ * Calendar triggers must not be able to disagree about how a delivery is
245
+ * verified.
246
+ *
247
+ * A SUBSCRIPTION: Google Calendar stops delivering unless somebody renews it,
248
+ * forever, and if nobody does the workflow stops firing with no error
249
+ * anywhere. The lease below says where the expiry is read from and how early
250
+ * to renew; the host runs ONE renewal scheduler for every expiring trigger.
251
+ */
252
+
253
+ /** Where Google Calendar echoes the token it was given when the subscription was created. */
254
+ declare const GOOGLE_CALENDAR_EVENTS_CHANGED_TOKEN_SCHEME: SharedTokenScheme;
255
+ /**
256
+ * The lease this subscription carries: where the provider's expiry sits in the
257
+ * `channel_watch` response (`expiration`, epoch-ms), how early the host
258
+ * renews, and what it calls when the lease is due — the create again, because
259
+ * Google Calendar cannot renew. The host builds the value with the core's
260
+ * `leaseFromResponse` and runs one scheduler for every expiring trigger.
261
+ */
262
+ declare const GOOGLE_CALENDAR_EVENTS_CHANGED_LEASE: LeaseDeclaration;
263
+ /**
264
+ * Which of this package's actions create, renew and stop the subscription.
265
+ * `renew` is null where the provider cannot renew and the host calls create
266
+ * again — after stopping the old one, and after re-listing, because
267
+ * notifications during the gap are gone.
268
+ */
269
+ declare const GOOGLE_CALENDAR_EVENTS_CHANGED_SUBSCRIPTION: {
270
+ readonly create: "channel_watch";
271
+ readonly renew: null;
272
+ readonly stop: "channel_stop";
273
+ };
274
+ declare const GOOGLE_CALENDAR_EVENTS_CHANGED: TriggerDescriptor;
275
+ /**
276
+ * Verify one inbound Google Calendar delivery.
277
+ *
278
+ * The host calls this BEFORE starting a run, with the body exactly as
279
+ * received. Re-serialised JSON changes key order and whitespace, and produces
280
+ * a mismatch that looks precisely like a wrong secret — hours of debugging the
281
+ * wrong thing.
282
+ *
283
+ * The secret is the connection's `channelToken`.
284
+ */
285
+ declare function verifyGoogleCalendarDelivery(delivery: InboundDelivery, channelToken: string | undefined, now?: number): Promise<WebhookVerification>;
286
+
287
+ export { CHANNEL_STOP_OPERATION, CHANNEL_WATCH_OPERATION, CONNECTOR_API_VERSION, type ChannelStopOptions, type ChannelWatchOptions, EVENT_GET_OPERATION, EVENT_LIST_OPERATION, type EventGetOptions, type EventListOptions, 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 };
@@ -0,0 +1,287 @@
1
+ import { ServiceDescriptor, PreparedRequest, ConnectorMode, ConnectorFaker, RequestedMode, Transport, ConnectorResult, TriggerDescriptor, LeaseDeclaration, SharedTokenScheme, InboundDelivery, WebhookVerification } from '@particle-academy/fancy-connector-core';
2
+
3
+ /**
4
+ * GENERATED FILE — do not edit.
5
+ *
6
+ * Emitted from provider/manifest.json by weaver's generator.
7
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
8
+ * being rejected, because it works until it silently does not. Fix
9
+ * provider/manifest.json (or weaver's template/) and regenerate:
10
+ *
11
+ * npm run provider -- google_calendar
12
+ */
13
+ /**
14
+ * Google Calendar, as one service descriptor shared by every Google Calendar
15
+ * operation.
16
+ *
17
+ * @particle-academy/fancy-connector-core carries what is true of ALL
18
+ * connectors. This carries what is true of Google Calendar: its base URL, its
19
+ * auth scheme, its idempotency header, and its faker.
20
+ *
21
+ * ## The sandbox trap, written down where it is used
22
+ *
23
+ * Google has no sandbox for Calendar. A test calendar is a real one in a real
24
+ * account, so every watch and every read is real -- point this at a scratch
25
+ * calendar, not a production one. The faker is the only way to develop against
26
+ * it without touching an account.
27
+ */
28
+
29
+ /**
30
+ * The connector API version this package was GENERATED against.
31
+ *
32
+ * A literal, never imported. An imported constant lets an upgrade rewrite the
33
+ * very claim it exists to detect, after which the copy agrees with itself
34
+ * forever.
35
+ */
36
+ declare const CONNECTOR_API_VERSION = 1;
37
+ declare const GOOGLE_CALENDAR_BASE_URLS: {
38
+ readonly live: "https://www.googleapis.com";
39
+ };
40
+ /** Credential keys a remote call cannot proceed without. */
41
+ declare const GOOGLE_CALENDAR_REQUIRES: readonly ["accessToken", "refreshToken", "clientId", "clientSecret"];
42
+ /**
43
+ * Apply Google Calendar's auth scheme to an outgoing request.
44
+ *
45
+ *
46
+ *
47
+ * The mode is passed in because for some providers auth and estate are the
48
+ * same decision expressed in the URL; here it is unused, and saying so is
49
+ * cheaper than wondering later whether it was forgotten.
50
+ */
51
+ declare function googleCalendarAuthorize(credentials: Record<string, string | undefined>, request: PreparedRequest, _mode: ConnectorMode): void;
52
+ /** The Google Calendar service, for the TypeScript runtime. */
53
+ declare const GOOGLE_CALENDAR: ServiceDescriptor;
54
+
55
+ /**
56
+ * GENERATED FILE — do not edit.
57
+ *
58
+ * Emitted from provider/fixtures/ by weaver's generator.
59
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
60
+ * being rejected, because it works until it silently does not. Fix
61
+ * provider/fixtures/ (or weaver's template/) and regenerate:
62
+ *
63
+ * npm run provider -- google_calendar
64
+ */
65
+ /**
66
+ * The Google Calendar faker.
67
+ *
68
+ * Shapes, not behaviour: the goal is that a downstream node sees the field
69
+ * NAMES Google Calendar actually publishes, so an author can wire {{
70
+ * $json.data.id }} against a fake and have it keep working against the real
71
+ * thing.
72
+ *
73
+ * Deterministic — same inputs, same output. A faker returning a fresh uuid
74
+ * every call cannot be asserted on, so its fixtures degrade to "it did not
75
+ * throw", which is the assertion that catches nothing.
76
+ */
77
+
78
+ declare const googleCalendarFaker: ConnectorFaker;
79
+
80
+ /**
81
+ * GENERATED FILE — do not edit.
82
+ *
83
+ * Emitted from provider/actions/channel-stop.json by weaver's generator.
84
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
85
+ * being rejected, because it works until it silently does not. Fix
86
+ * provider/actions/channel-stop.json (or weaver's template/) and regenerate:
87
+ *
88
+ * npm run provider -- google_calendar
89
+ */
90
+ /**
91
+ * Close a push-notification channel. The host's subscription machinery calls
92
+ * this before re-creating a channel and when a trigger is removed.
93
+ *
94
+ * POST /calendar/v3/channels/stop —
95
+ * https://developers.google.com/workspace/calendar/api/v3/reference/channels/stop
96
+ *
97
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
98
+ * no fake/real branch. This describes the request; callConnector resolves the
99
+ * connection, picks the estate, and either calls Google Calendar or calls the
100
+ * faker.
101
+ */
102
+
103
+ declare const CHANNEL_STOP_OPERATION = "channel_stop";
104
+ type ChannelStopOptions = {
105
+ /** The node's resolved config. Keys: channelId, resourceId. */
106
+ config: Record<string, unknown>;
107
+ credentials?: Record<string, string | undefined>;
108
+ mode?: RequestedMode;
109
+ connectionId?: string | null;
110
+ input?: unknown;
111
+ attempts?: number;
112
+ /** Override the transport. The only way to exercise this without a network. */
113
+ transport?: Transport;
114
+ };
115
+ declare function googleCalendarChannelStop(options: ChannelStopOptions): Promise<ConnectorResult>;
116
+
117
+ /**
118
+ * GENERATED FILE — do not edit.
119
+ *
120
+ * Emitted from provider/actions/channel-watch.json by weaver's generator.
121
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
122
+ * being rejected, because it works until it silently does not. Fix
123
+ * provider/actions/channel-watch.json (or weaver's template/) and regenerate:
124
+ *
125
+ * npm run provider -- google_calendar
126
+ */
127
+ /**
128
+ * Open a push-notification channel on a calendar's events. The host's
129
+ * subscription machinery calls this; it is not a node most workflows need.
130
+ *
131
+ * POST /calendar/v3/calendars/{calendarId}/events/watch —
132
+ * https://developers.google.com/workspace/calendar/api/v3/reference/events/watch
133
+ *
134
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
135
+ * no fake/real branch. This describes the request; callConnector resolves the
136
+ * connection, picks the estate, and either calls Google Calendar or calls the
137
+ * faker.
138
+ *
139
+ * sideEffects: unsafe-to-replay.
140
+ */
141
+
142
+ declare const CHANNEL_WATCH_OPERATION = "channel_watch";
143
+ type ChannelWatchOptions = {
144
+ /** The node's resolved config. Keys: calendarId, channelId, address, token, ttlSeconds. */
145
+ config: Record<string, unknown>;
146
+ credentials?: Record<string, string | undefined>;
147
+ mode?: RequestedMode;
148
+ connectionId?: string | null;
149
+ input?: unknown;
150
+ attempts?: number;
151
+ /** Override the transport. The only way to exercise this without a network. */
152
+ transport?: Transport;
153
+ };
154
+ declare function googleCalendarChannelWatch(options: ChannelWatchOptions): Promise<ConnectorResult>;
155
+
156
+ /**
157
+ * GENERATED FILE — do not edit.
158
+ *
159
+ * Emitted from provider/actions/event-get.json by weaver's generator.
160
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
161
+ * being rejected, because it works until it silently does not. Fix
162
+ * provider/actions/event-get.json (or weaver's template/) and regenerate:
163
+ *
164
+ * npm run provider -- google_calendar
165
+ */
166
+ /**
167
+ * Read one event from a Google Calendar.
168
+ *
169
+ * GET /calendar/v3/calendars/{calendarId}/events/{eventId} —
170
+ * https://developers.google.com/workspace/calendar/api/v3/reference/events/get
171
+ *
172
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
173
+ * no fake/real branch. This describes the request; callConnector resolves the
174
+ * connection, picks the estate, and either calls Google Calendar or calls the
175
+ * faker.
176
+ */
177
+
178
+ declare const EVENT_GET_OPERATION = "event_get";
179
+ type EventGetOptions = {
180
+ /** The node's resolved config. Keys: calendarId, eventId. */
181
+ config: Record<string, unknown>;
182
+ credentials?: Record<string, string | undefined>;
183
+ mode?: RequestedMode;
184
+ connectionId?: string | null;
185
+ input?: unknown;
186
+ attempts?: number;
187
+ /** Override the transport. The only way to exercise this without a network. */
188
+ transport?: Transport;
189
+ };
190
+ declare function googleCalendarEventGet(options: EventGetOptions): Promise<ConnectorResult>;
191
+
192
+ /**
193
+ * GENERATED FILE — do not edit.
194
+ *
195
+ * Emitted from provider/actions/event-list.json by weaver's generator.
196
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
197
+ * being rejected, because it works until it silently does not. Fix
198
+ * provider/actions/event-list.json (or weaver's template/) and regenerate:
199
+ *
200
+ * npm run provider -- google_calendar
201
+ */
202
+ /**
203
+ * List events from a Google Calendar, in full or incrementally with a sync
204
+ * token.
205
+ *
206
+ * GET /calendar/v3/calendars/{calendarId}/events —
207
+ * https://developers.google.com/workspace/calendar/api/v3/reference/events/list
208
+ *
209
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
210
+ * no fake/real branch. This describes the request; callConnector resolves the
211
+ * connection, picks the estate, and either calls Google Calendar or calls the
212
+ * faker.
213
+ */
214
+
215
+ declare const EVENT_LIST_OPERATION = "event_list";
216
+ type EventListOptions = {
217
+ /** The node's resolved config. Keys: calendarId, syncToken, timeMin, timeMax, maxResults, pageToken, singleEvents. */
218
+ config: Record<string, unknown>;
219
+ credentials?: Record<string, string | undefined>;
220
+ mode?: RequestedMode;
221
+ connectionId?: string | null;
222
+ input?: unknown;
223
+ attempts?: number;
224
+ /** Override the transport. The only way to exercise this without a network. */
225
+ transport?: Transport;
226
+ };
227
+ declare function googleCalendarEventList(options: EventListOptions): Promise<ConnectorResult>;
228
+
229
+ /**
230
+ * GENERATED FILE — do not edit.
231
+ *
232
+ * Emitted from provider/triggers/events-changed.json by weaver's generator.
233
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
234
+ * being rejected, because it works until it silently does not. Fix
235
+ * provider/triggers/events-changed.json (or weaver's template/) and regenerate:
236
+ *
237
+ * npm run provider -- google_calendar
238
+ */
239
+ /**
240
+ * Google Calendar's subscription trigger — the delivery contract.
241
+ *
242
+ * Kept beside the service descriptor rather than inside a node, because the
243
+ * way a delivery is verified is a fact about GOOGLE CALENDAR. Two Google
244
+ * Calendar triggers must not be able to disagree about how a delivery is
245
+ * verified.
246
+ *
247
+ * A SUBSCRIPTION: Google Calendar stops delivering unless somebody renews it,
248
+ * forever, and if nobody does the workflow stops firing with no error
249
+ * anywhere. The lease below says where the expiry is read from and how early
250
+ * to renew; the host runs ONE renewal scheduler for every expiring trigger.
251
+ */
252
+
253
+ /** Where Google Calendar echoes the token it was given when the subscription was created. */
254
+ declare const GOOGLE_CALENDAR_EVENTS_CHANGED_TOKEN_SCHEME: SharedTokenScheme;
255
+ /**
256
+ * The lease this subscription carries: where the provider's expiry sits in the
257
+ * `channel_watch` response (`expiration`, epoch-ms), how early the host
258
+ * renews, and what it calls when the lease is due — the create again, because
259
+ * Google Calendar cannot renew. The host builds the value with the core's
260
+ * `leaseFromResponse` and runs one scheduler for every expiring trigger.
261
+ */
262
+ declare const GOOGLE_CALENDAR_EVENTS_CHANGED_LEASE: LeaseDeclaration;
263
+ /**
264
+ * Which of this package's actions create, renew and stop the subscription.
265
+ * `renew` is null where the provider cannot renew and the host calls create
266
+ * again — after stopping the old one, and after re-listing, because
267
+ * notifications during the gap are gone.
268
+ */
269
+ declare const GOOGLE_CALENDAR_EVENTS_CHANGED_SUBSCRIPTION: {
270
+ readonly create: "channel_watch";
271
+ readonly renew: null;
272
+ readonly stop: "channel_stop";
273
+ };
274
+ declare const GOOGLE_CALENDAR_EVENTS_CHANGED: TriggerDescriptor;
275
+ /**
276
+ * Verify one inbound Google Calendar delivery.
277
+ *
278
+ * The host calls this BEFORE starting a run, with the body exactly as
279
+ * received. Re-serialised JSON changes key order and whitespace, and produces
280
+ * a mismatch that looks precisely like a wrong secret — hours of debugging the
281
+ * wrong thing.
282
+ *
283
+ * The secret is the connection's `channelToken`.
284
+ */
285
+ declare function verifyGoogleCalendarDelivery(delivery: InboundDelivery, channelToken: string | undefined, now?: number): Promise<WebhookVerification>;
286
+
287
+ export { CHANNEL_STOP_OPERATION, CHANNEL_WATCH_OPERATION, CONNECTOR_API_VERSION, type ChannelStopOptions, type ChannelWatchOptions, EVENT_GET_OPERATION, EVENT_LIST_OPERATION, type EventGetOptions, type EventListOptions, 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 };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ 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 } from './chunk-VH6QZLPP.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json CHANGED
@@ -1,18 +1,90 @@
1
1
  {
2
2
  "name": "@particle-academy/google-calendar-js",
3
- "version": "0.0.0",
4
- "description": "A placeholder that claims the name @particle-academy/google-calendar-js; the real release follows through Fancy-Friends/google-calendar's publish.yml with provenance. Do not install this version.",
5
- "license": "MIT",
3
+ "version": "0.1.0",
4
+ "description": "Google Calendar for Node — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP on @particle-academy/fancy-connector-core; no vendor SDK.",
6
5
  "repository": {
7
6
  "type": "git",
8
7
  "url": "git+https://github.com/Fancy-Friends/google-calendar.git",
9
8
  "directory": "packages/js"
10
9
  },
11
10
  "homepage": "https://github.com/Fancy-Friends/google-calendar#readme",
11
+ "bugs": "https://github.com/Fancy-Friends/google-calendar/issues",
12
+ "type": "module",
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": {
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/index.js"
21
+ },
22
+ "require": {
23
+ "types": "./dist/index.d.cts",
24
+ "default": "./dist/index.cjs"
25
+ }
26
+ },
27
+ "./flow": {
28
+ "import": {
29
+ "types": "./dist/flow.d.ts",
30
+ "default": "./dist/flow.js"
31
+ },
32
+ "require": {
33
+ "types": "./dist/flow.d.cts",
34
+ "default": "./dist/flow.cjs"
35
+ }
36
+ },
37
+ "./package.json": "./package.json"
38
+ },
39
+ "files": [
40
+ "dist",
41
+ "art",
42
+ "README.md",
43
+ "CHANGELOG.md",
44
+ "LICENSE"
45
+ ],
46
+ "scripts": {
47
+ "build": "tsup",
48
+ "lint": "tsc --noEmit",
49
+ "test": "node --import tsx --test tests/*.test.ts",
50
+ "prepublishOnly": "tsup"
51
+ },
52
+ "dependencies": {
53
+ "@particle-academy/fancy-connector-core": ">=0.8.0 <2.0"
54
+ },
55
+ "peerDependencies": {
56
+ "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
57
+ "@particle-academy/google-calendar-ui": ">=0.1.0 <0.2.0"
58
+ },
59
+ "peerDependenciesMeta": {
60
+ "@particle-academy/fancy-flow": {
61
+ "optional": true
62
+ },
63
+ "@particle-academy/google-calendar-ui": {
64
+ "optional": true
65
+ }
66
+ },
67
+ "devDependencies": {
68
+ "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
69
+ "@types/node": "^26.2.0",
70
+ "tsup": "^8.5.0",
71
+ "tsx": "^4.19.0",
72
+ "typescript": "^5.8.0"
73
+ },
12
74
  "publishConfig": {
13
75
  "access": "public"
14
76
  },
15
- "files": [
16
- "README.md"
17
- ]
77
+ "keywords": [
78
+ "google_calendar",
79
+ "calendar",
80
+ "connector",
81
+ "api",
82
+ "fancy-ui",
83
+ "particle-academy"
84
+ ],
85
+ "license": "MIT",
86
+ "sideEffects": false,
87
+ "engines": {
88
+ "node": ">=22"
89
+ }
18
90
  }