@bobfrankston/mailx-service 0.1.47
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/ai-usage.d.ts +32 -0
- package/ai-usage.d.ts.map +1 -0
- package/ai-usage.js +98 -0
- package/ai-usage.js.map +1 -0
- package/charset.d.ts +15 -0
- package/charset.d.ts.map +1 -0
- package/charset.js +61 -0
- package/charset.js.map +1 -0
- package/db-worker-client.d.ts +32 -0
- package/db-worker-client.d.ts.map +1 -0
- package/db-worker-client.js +66 -0
- package/db-worker-client.js.map +1 -0
- package/db-worker.d.ts +39 -0
- package/db-worker.d.ts.map +1 -0
- package/db-worker.js +115 -0
- package/db-worker.js.map +1 -0
- package/google-sync.d.ts +151 -0
- package/google-sync.d.ts.map +1 -0
- package/google-sync.js +259 -0
- package/google-sync.js.map +1 -0
- package/html-to-docx.d.ts +1 -0
- package/index.d.ts +1102 -0
- package/index.d.ts.map +1 -0
- package/index.js +5476 -0
- package/index.js.map +1 -0
- package/jsonrpc.d.ts +29 -0
- package/jsonrpc.d.ts.map +1 -0
- package/jsonrpc.js +481 -0
- package/jsonrpc.js.map +1 -0
- package/local-store.d.ts +10 -0
- package/local-store.d.ts.map +1 -0
- package/local-store.js +9 -0
- package/local-store.js.map +1 -0
- package/package.json +53 -0
- package/reconciler.d.ts +90 -0
- package/reconciler.d.ts.map +1 -0
- package/reconciler.js +277 -0
- package/reconciler.js.map +1 -0
- package/sync-queue.d.ts +127 -0
- package/sync-queue.d.ts.map +1 -0
- package/sync-queue.js +271 -0
- package/sync-queue.js.map +1 -0
- package/sync-worker-client.d.ts +33 -0
- package/sync-worker-client.d.ts.map +1 -0
- package/sync-worker-client.js +89 -0
- package/sync-worker-client.js.map +1 -0
- package/sync-worker.d.ts +33 -0
- package/sync-worker.d.ts.map +1 -0
- package/sync-worker.js +143 -0
- package/sync-worker.js.map +1 -0
- package/word-html.d.ts +41 -0
- package/word-html.d.ts.map +1 -0
- package/word-html.js +122 -0
- package/word-html.js.map +1 -0
package/google-sync.d.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Calendar / Tasks / People (Contacts) two-way sync helpers.
|
|
3
|
+
*
|
|
4
|
+
* Used by MailxService to push local edits to Google and pull server
|
|
5
|
+
* changes into the local cache. All functions take a `getToken` function
|
|
6
|
+
* and a fetch implementation so they stay platform-agnostic (Node uses
|
|
7
|
+
* global `fetch` on Node 18+; browsers use window.fetch).
|
|
8
|
+
*
|
|
9
|
+
* Error handling: throws on network / HTTP errors. Caller catches and
|
|
10
|
+
* either retries via the store_sync drainer or surfaces to the UI.
|
|
11
|
+
*/
|
|
12
|
+
type TokenProvider = () => Promise<string>;
|
|
13
|
+
export declare class GoogleHttpError extends Error {
|
|
14
|
+
status: number;
|
|
15
|
+
statusText: string;
|
|
16
|
+
body: string;
|
|
17
|
+
constructor(status: number, statusText: string, body: string);
|
|
18
|
+
}
|
|
19
|
+
export interface GCalEvent {
|
|
20
|
+
id: string;
|
|
21
|
+
summary: string;
|
|
22
|
+
start: {
|
|
23
|
+
dateTime?: string;
|
|
24
|
+
date?: string;
|
|
25
|
+
};
|
|
26
|
+
end: {
|
|
27
|
+
dateTime?: string;
|
|
28
|
+
date?: string;
|
|
29
|
+
};
|
|
30
|
+
location?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
etag?: string;
|
|
33
|
+
/** Set on instances expanded from a recurring series (singleEvents=true).
|
|
34
|
+
* Absent for singletons. Lets the UI filter out recurring expansions. */
|
|
35
|
+
recurringEventId?: string;
|
|
36
|
+
/** Link to open the event in Google Calendar web. */
|
|
37
|
+
htmlLink?: string;
|
|
38
|
+
/** Per-event reminder configuration. `useDefault: true` means apply
|
|
39
|
+
* the calendar's `defaultReminders` (carried separately on the
|
|
40
|
+
* calendarList entry); when false, `overrides` lists each popup /
|
|
41
|
+
* email reminder offset for this specific event. */
|
|
42
|
+
reminders?: {
|
|
43
|
+
useDefault?: boolean;
|
|
44
|
+
overrides?: Array<{
|
|
45
|
+
method: string;
|
|
46
|
+
minutes: number;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export declare function listCalendarEvents(tokenProvider: TokenProvider, fromMs: number, toMs: number, calendarId?: string): Promise<GCalEvent[]>;
|
|
51
|
+
/** Enumerate the user's Google Calendars (everything in their
|
|
52
|
+
* `calendarList` — owned, shared, subscribed). Used so refreshCalendarEvents
|
|
53
|
+
* doesn't hard-code `primary` and miss events on secondary calendars
|
|
54
|
+
* (Bob 2026-05-12: recurring Statin event showed in Thunderbird but not
|
|
55
|
+
* rmfmail because it's on a secondary calendar, not primary).
|
|
56
|
+
*
|
|
57
|
+
* Returns each entry's id (use as `calendarId` in subsequent fetches),
|
|
58
|
+
* summary (display name), and `selected` flag (matches the "show in
|
|
59
|
+
* Google web UI" toggle — a sensible default filter for "which calendars
|
|
60
|
+
* should mailx show"). Hidden / explicitly-unselected calendars are
|
|
61
|
+
* filtered out by the caller; we still return them so a future UI can
|
|
62
|
+
* expose the full list. */
|
|
63
|
+
export interface GCalendarListEntry {
|
|
64
|
+
id: string;
|
|
65
|
+
summary: string;
|
|
66
|
+
selected: boolean;
|
|
67
|
+
primary: boolean;
|
|
68
|
+
/** Hex color Google assigns the calendar (`backgroundColor`). Used to
|
|
69
|
+
* tint the per-calendar icon/monogram badge in the sidebar. */
|
|
70
|
+
backgroundColor: string;
|
|
71
|
+
/** Calendar-wide default reminder offsets, applied to events whose
|
|
72
|
+
* `reminders.useDefault === true`. Each entry is `{ method, minutes }`;
|
|
73
|
+
* client carries only the minutes for popup reminders. */
|
|
74
|
+
defaultReminderMinutes: number[];
|
|
75
|
+
/** Google's accessRole: "owner" | "writer" | "reader" | "freeBusyReader".
|
|
76
|
+
* Only the first two can take a new event — the New event dialog
|
|
77
|
+
* offers those (Bob 2026-09-10: "when creating an event I should be
|
|
78
|
+
* able to specify which calendar"). */
|
|
79
|
+
accessRole: string;
|
|
80
|
+
}
|
|
81
|
+
export declare function listCalendars(tokenProvider: TokenProvider): Promise<GCalendarListEntry[]>;
|
|
82
|
+
export declare function createCalendarEvent(tokenProvider: TokenProvider, event: any, calendarId?: string): Promise<GCalEvent>;
|
|
83
|
+
export declare function updateCalendarEvent(tokenProvider: TokenProvider, eventId: string, event: any, calendarId?: string): Promise<GCalEvent>;
|
|
84
|
+
export declare function deleteCalendarEvent(tokenProvider: TokenProvider, eventId: string, calendarId?: string): Promise<void>;
|
|
85
|
+
export interface GTask {
|
|
86
|
+
id: string;
|
|
87
|
+
title: string;
|
|
88
|
+
notes?: string;
|
|
89
|
+
due?: string;
|
|
90
|
+
completed?: string;
|
|
91
|
+
status?: "needsAction" | "completed";
|
|
92
|
+
etag?: string;
|
|
93
|
+
}
|
|
94
|
+
/** Enumerate all of the user's Google task lists. Mirrors `listCalendars`
|
|
95
|
+
* — Google "Reminders" are stored as TASKS as of late 2023, and a user
|
|
96
|
+
* can have many task lists, each potentially holding reminders. Without
|
|
97
|
+
* this enumeration mailx only ever sees the `@default` list and misses
|
|
98
|
+
* every reminder filed elsewhere. Bob 2026-05-12. */
|
|
99
|
+
export interface GTaskListEntry {
|
|
100
|
+
id: string;
|
|
101
|
+
title: string;
|
|
102
|
+
}
|
|
103
|
+
export declare function listTaskLists(tokenProvider: TokenProvider): Promise<GTaskListEntry[]>;
|
|
104
|
+
export declare function listTasks(tokenProvider: TokenProvider, listId?: string, showCompleted?: boolean): Promise<GTask[]>;
|
|
105
|
+
export declare function createTask(tokenProvider: TokenProvider, task: any, listId?: string): Promise<GTask>;
|
|
106
|
+
export declare function updateTask(tokenProvider: TokenProvider, taskId: string, task: any, listId?: string): Promise<GTask>;
|
|
107
|
+
export declare function deleteTask(tokenProvider: TokenProvider, taskId: string, listId?: string): Promise<void>;
|
|
108
|
+
export declare function createContact(tokenProvider: TokenProvider, person: any): Promise<any>;
|
|
109
|
+
export declare function updateContact(tokenProvider: TokenProvider, resourceName: string, updatePersonFields: string, person: any): Promise<any>;
|
|
110
|
+
export declare function deleteContact(tokenProvider: TokenProvider, resourceName: string): Promise<void>;
|
|
111
|
+
export declare function calendarEventToLocal(ev: GCalEvent, accountId: string, calendarDefaultReminderMinutes?: number[]): {
|
|
112
|
+
providerId: string;
|
|
113
|
+
accountId: string;
|
|
114
|
+
title: string;
|
|
115
|
+
startMs: number;
|
|
116
|
+
endMs: number;
|
|
117
|
+
allDay: boolean;
|
|
118
|
+
location: string;
|
|
119
|
+
notes: string;
|
|
120
|
+
etag: string;
|
|
121
|
+
recurringEventId: string | undefined;
|
|
122
|
+
htmlLink: string | undefined;
|
|
123
|
+
reminderMinutes: number[];
|
|
124
|
+
};
|
|
125
|
+
export declare function localToCalendarEvent(local: {
|
|
126
|
+
title: string;
|
|
127
|
+
startMs: number;
|
|
128
|
+
endMs: number;
|
|
129
|
+
allDay?: boolean;
|
|
130
|
+
location?: string;
|
|
131
|
+
notes?: string;
|
|
132
|
+
birthday?: boolean;
|
|
133
|
+
free?: boolean;
|
|
134
|
+
}): any;
|
|
135
|
+
export declare function taskToLocal(t: GTask, accountId: string): {
|
|
136
|
+
providerId: string;
|
|
137
|
+
accountId: string;
|
|
138
|
+
title: string;
|
|
139
|
+
notes: string;
|
|
140
|
+
dueMs: number | undefined;
|
|
141
|
+
completedMs: number | undefined;
|
|
142
|
+
etag: string;
|
|
143
|
+
};
|
|
144
|
+
export declare function localToTask(local: {
|
|
145
|
+
title: string;
|
|
146
|
+
notes?: string;
|
|
147
|
+
dueMs?: number;
|
|
148
|
+
completedMs?: number;
|
|
149
|
+
}): any;
|
|
150
|
+
export {};
|
|
151
|
+
//# sourceMappingURL=google-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-sync.d.ts","sourceRoot":"","sources":["google-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,KAAK,aAAa,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;AAE3C,qBAAa,eAA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,CAAC;IAC7B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC7B,CAiCA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IACxC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACtC,GAAG,GAAG,CAqCN;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG;IACtD,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IACpE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAC5E,CAaA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAC/B,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CACvE,GAAG,GAAG,CAYN"}
|
package/google-sync.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Calendar / Tasks / People (Contacts) two-way sync helpers.
|
|
3
|
+
*
|
|
4
|
+
* Used by MailxService to push local edits to Google and pull server
|
|
5
|
+
* changes into the local cache. All functions take a `getToken` function
|
|
6
|
+
* and a fetch implementation so they stay platform-agnostic (Node uses
|
|
7
|
+
* global `fetch` on Node 18+; browsers use window.fetch).
|
|
8
|
+
*
|
|
9
|
+
* Error handling: throws on network / HTTP errors. Caller catches and
|
|
10
|
+
* either retries via the store_sync drainer or surfaces to the UI.
|
|
11
|
+
*/
|
|
12
|
+
export class GoogleHttpError extends Error {
|
|
13
|
+
status;
|
|
14
|
+
statusText;
|
|
15
|
+
body;
|
|
16
|
+
constructor(status, statusText, body) {
|
|
17
|
+
super(`Google API ${status} ${statusText}: ${body.slice(0, 300)}`);
|
|
18
|
+
this.status = status;
|
|
19
|
+
this.statusText = statusText;
|
|
20
|
+
this.body = body;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function googleFetch(tokenProvider, url, init = {}) {
|
|
24
|
+
const token = await tokenProvider();
|
|
25
|
+
const headers = new Headers(init.headers || {});
|
|
26
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
27
|
+
if (init.body && !headers.has("Content-Type"))
|
|
28
|
+
headers.set("Content-Type", "application/json");
|
|
29
|
+
const res = await fetch(url, { ...init, headers });
|
|
30
|
+
if (!res.ok) {
|
|
31
|
+
const body = await res.text().catch(() => "");
|
|
32
|
+
throw new GoogleHttpError(res.status, res.statusText, body);
|
|
33
|
+
}
|
|
34
|
+
return res;
|
|
35
|
+
}
|
|
36
|
+
export async function listCalendarEvents(tokenProvider, fromMs, toMs, calendarId = "primary") {
|
|
37
|
+
const from = new Date(fromMs).toISOString();
|
|
38
|
+
const to = new Date(toMs).toISOString();
|
|
39
|
+
const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events`
|
|
40
|
+
+ `?timeMin=${encodeURIComponent(from)}&timeMax=${encodeURIComponent(to)}`
|
|
41
|
+
+ `&singleEvents=true&orderBy=startTime&maxResults=250`;
|
|
42
|
+
const all = [];
|
|
43
|
+
let pageToken;
|
|
44
|
+
do {
|
|
45
|
+
const pagedUrl = pageToken ? `${url}&pageToken=${encodeURIComponent(pageToken)}` : url;
|
|
46
|
+
const res = await googleFetch(tokenProvider, pagedUrl);
|
|
47
|
+
const data = await res.json();
|
|
48
|
+
for (const ev of (data.items || []))
|
|
49
|
+
all.push(ev);
|
|
50
|
+
pageToken = data.nextPageToken;
|
|
51
|
+
} while (pageToken);
|
|
52
|
+
return all;
|
|
53
|
+
}
|
|
54
|
+
export async function listCalendars(tokenProvider) {
|
|
55
|
+
const url = "https://www.googleapis.com/calendar/v3/users/me/calendarList?minAccessRole=reader&maxResults=250";
|
|
56
|
+
const out = [];
|
|
57
|
+
let pageToken;
|
|
58
|
+
do {
|
|
59
|
+
const pagedUrl = pageToken ? `${url}&pageToken=${encodeURIComponent(pageToken)}` : url;
|
|
60
|
+
const res = await googleFetch(tokenProvider, pagedUrl);
|
|
61
|
+
const data = await res.json();
|
|
62
|
+
for (const item of (data.items || [])) {
|
|
63
|
+
const dr = Array.isArray(item.defaultReminders)
|
|
64
|
+
? item.defaultReminders
|
|
65
|
+
.filter((r) => (r.method === "popup" || !r.method) && Number.isFinite(r.minutes))
|
|
66
|
+
.map((r) => r.minutes)
|
|
67
|
+
: [];
|
|
68
|
+
out.push({
|
|
69
|
+
id: item.id,
|
|
70
|
+
summary: item.summary || item.id,
|
|
71
|
+
selected: !!item.selected,
|
|
72
|
+
primary: !!item.primary,
|
|
73
|
+
accessRole: item.accessRole || "reader",
|
|
74
|
+
backgroundColor: item.backgroundColor || "",
|
|
75
|
+
defaultReminderMinutes: dr,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
pageToken = data.nextPageToken;
|
|
79
|
+
} while (pageToken);
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
export async function createCalendarEvent(tokenProvider, event, calendarId = "primary") {
|
|
83
|
+
const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events`;
|
|
84
|
+
const res = await googleFetch(tokenProvider, url, { method: "POST", body: JSON.stringify(event) });
|
|
85
|
+
return res.json();
|
|
86
|
+
}
|
|
87
|
+
export async function updateCalendarEvent(tokenProvider, eventId, event, calendarId = "primary") {
|
|
88
|
+
const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events/${encodeURIComponent(eventId)}`;
|
|
89
|
+
const res = await googleFetch(tokenProvider, url, { method: "PATCH", body: JSON.stringify(event) });
|
|
90
|
+
return res.json();
|
|
91
|
+
}
|
|
92
|
+
export async function deleteCalendarEvent(tokenProvider, eventId, calendarId = "primary") {
|
|
93
|
+
const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events/${encodeURIComponent(eventId)}`;
|
|
94
|
+
await googleFetch(tokenProvider, url, { method: "DELETE" });
|
|
95
|
+
}
|
|
96
|
+
export async function listTaskLists(tokenProvider) {
|
|
97
|
+
const url = "https://tasks.googleapis.com/tasks/v1/users/@me/lists?maxResults=100";
|
|
98
|
+
const res = await googleFetch(tokenProvider, url);
|
|
99
|
+
const data = await res.json();
|
|
100
|
+
return (data.items || []).map((it) => ({ id: it.id, title: it.title || it.id }));
|
|
101
|
+
}
|
|
102
|
+
export async function listTasks(tokenProvider, listId = "@default", showCompleted = false) {
|
|
103
|
+
const url = `https://tasks.googleapis.com/tasks/v1/lists/${encodeURIComponent(listId)}/tasks`
|
|
104
|
+
+ `?showCompleted=${showCompleted}&maxResults=100`;
|
|
105
|
+
const res = await googleFetch(tokenProvider, url);
|
|
106
|
+
const data = await res.json();
|
|
107
|
+
return data.items || [];
|
|
108
|
+
}
|
|
109
|
+
export async function createTask(tokenProvider, task, listId = "@default") {
|
|
110
|
+
const url = `https://tasks.googleapis.com/tasks/v1/lists/${encodeURIComponent(listId)}/tasks`;
|
|
111
|
+
const res = await googleFetch(tokenProvider, url, { method: "POST", body: JSON.stringify(task) });
|
|
112
|
+
return res.json();
|
|
113
|
+
}
|
|
114
|
+
export async function updateTask(tokenProvider, taskId, task, listId = "@default") {
|
|
115
|
+
const url = `https://tasks.googleapis.com/tasks/v1/lists/${encodeURIComponent(listId)}/tasks/${encodeURIComponent(taskId)}`;
|
|
116
|
+
const res = await googleFetch(tokenProvider, url, { method: "PATCH", body: JSON.stringify(task) });
|
|
117
|
+
return res.json();
|
|
118
|
+
}
|
|
119
|
+
export async function deleteTask(tokenProvider, taskId, listId = "@default") {
|
|
120
|
+
const url = `https://tasks.googleapis.com/tasks/v1/lists/${encodeURIComponent(listId)}/tasks/${encodeURIComponent(taskId)}`;
|
|
121
|
+
await googleFetch(tokenProvider, url, { method: "DELETE" });
|
|
122
|
+
}
|
|
123
|
+
// ── Contacts (People API) ──
|
|
124
|
+
export async function createContact(tokenProvider, person) {
|
|
125
|
+
const url = `https://people.googleapis.com/v1/people:createContact`;
|
|
126
|
+
const res = await googleFetch(tokenProvider, url, { method: "POST", body: JSON.stringify(person) });
|
|
127
|
+
return res.json();
|
|
128
|
+
}
|
|
129
|
+
export async function updateContact(tokenProvider, resourceName, updatePersonFields, person) {
|
|
130
|
+
const url = `https://people.googleapis.com/v1/${resourceName}:updateContact`
|
|
131
|
+
+ `?updatePersonFields=${encodeURIComponent(updatePersonFields)}`;
|
|
132
|
+
const res = await googleFetch(tokenProvider, url, { method: "PATCH", body: JSON.stringify(person) });
|
|
133
|
+
return res.json();
|
|
134
|
+
}
|
|
135
|
+
export async function deleteContact(tokenProvider, resourceName) {
|
|
136
|
+
const url = `https://people.googleapis.com/v1/${resourceName}:deleteContact`;
|
|
137
|
+
await googleFetch(tokenProvider, url, { method: "DELETE" });
|
|
138
|
+
}
|
|
139
|
+
// ── Conversion helpers ──
|
|
140
|
+
/** Parse a Google all-day `date` ("YYYY-MM-DD") as LOCAL midnight.
|
|
141
|
+
* `Date.parse` treats a date-only string as UTC, so an all-day event
|
|
142
|
+
* renders a day early for any user west of UTC — a June 14 birthday
|
|
143
|
+
* showed as June 13 in US Eastern (Bob 2026-05-16). Build the Date from
|
|
144
|
+
* explicit Y/M/D components so midnight is local. */
|
|
145
|
+
function dateOnlyToLocalMs(d) {
|
|
146
|
+
const m = d.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
147
|
+
if (!m)
|
|
148
|
+
return Date.parse(d);
|
|
149
|
+
return new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3])).getTime();
|
|
150
|
+
}
|
|
151
|
+
/** Format a local-midnight ms as its LOCAL "YYYY-MM-DD". The inverse of
|
|
152
|
+
* dateOnlyToLocalMs. `toISOString().slice(0, 10)` is the UTC date — for a
|
|
153
|
+
* user east of UTC, local midnight is still the *previous* UTC day, so an
|
|
154
|
+
* all-day event or date-only task written that way lands a day early. */
|
|
155
|
+
function localMsToDateOnly(ms) {
|
|
156
|
+
const d = new Date(ms);
|
|
157
|
+
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
|
|
158
|
+
}
|
|
159
|
+
export function calendarEventToLocal(ev, accountId, calendarDefaultReminderMinutes = []) {
|
|
160
|
+
const allDay = !!ev.start.date && !ev.start.dateTime;
|
|
161
|
+
const startMs = allDay
|
|
162
|
+
? dateOnlyToLocalMs(ev.start.date)
|
|
163
|
+
: Date.parse(ev.start.dateTime);
|
|
164
|
+
const endMs = allDay
|
|
165
|
+
? dateOnlyToLocalMs(ev.end.date)
|
|
166
|
+
: Date.parse(ev.end.dateTime);
|
|
167
|
+
// Per-event reminder offsets. Google sends `useDefault: true` to mean
|
|
168
|
+
// "apply the calendar's defaultReminders" (which we passed in from the
|
|
169
|
+
// calendarList entry). When `useDefault: false`, the event's own
|
|
170
|
+
// `overrides` array wins. We only fire `popup` reminders client-side
|
|
171
|
+
// — email reminders are Google's job, sending a duplicate from mailx
|
|
172
|
+
// would be redundant. Bob 2026-05-12: "use the reminder times in the
|
|
173
|
+
// event (there can be multiple)".
|
|
174
|
+
let reminderMinutes = [];
|
|
175
|
+
if (ev.reminders?.useDefault) {
|
|
176
|
+
reminderMinutes = calendarDefaultReminderMinutes.slice();
|
|
177
|
+
}
|
|
178
|
+
else if (Array.isArray(ev.reminders?.overrides)) {
|
|
179
|
+
reminderMinutes = ev.reminders.overrides
|
|
180
|
+
.filter(r => (r.method === "popup" || !r.method) && Number.isFinite(r.minutes))
|
|
181
|
+
.map(r => r.minutes);
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
providerId: ev.id, accountId,
|
|
185
|
+
title: ev.summary || "(no title)",
|
|
186
|
+
startMs, endMs, allDay,
|
|
187
|
+
location: ev.location || "", notes: ev.description || "",
|
|
188
|
+
etag: ev.etag || "",
|
|
189
|
+
recurringEventId: ev.recurringEventId,
|
|
190
|
+
htmlLink: ev.htmlLink,
|
|
191
|
+
reminderMinutes,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
export function localToCalendarEvent(local) {
|
|
195
|
+
const toIso = (ms) => new Date(ms).toISOString();
|
|
196
|
+
const toDate = localMsToDateOnly;
|
|
197
|
+
// 2026-09-21 — Claude Code (Fable 5.1), at Bob's direction: a birthday
|
|
198
|
+
// becomes a Google birthday event, the same payload gcal's
|
|
199
|
+
// makeBirthdayEvent builds (Y:/dev/utils/cardx/gcal/gcal.ts). The API's
|
|
200
|
+
// rules for eventType "birthday": all-day spanning exactly one day,
|
|
201
|
+
// RRULE:FREQ=YEARLY (Feb 29 needs BYMONTH=2;BYMONTHDAY=-1), visibility
|
|
202
|
+
// private, transparency transparent, birthdayProperties.type "birthday",
|
|
203
|
+
// and no other properties except colorId, summary and reminders — so
|
|
204
|
+
// location/description are deliberately left off.
|
|
205
|
+
if (local.birthday) {
|
|
206
|
+
const startD = new Date(local.startMs);
|
|
207
|
+
startD.setHours(0, 0, 0, 0);
|
|
208
|
+
const endD = new Date(startD);
|
|
209
|
+
endD.setDate(endD.getDate() + 1); // end.date is exclusive
|
|
210
|
+
const isLeapDay = startD.getMonth() === 1 && startD.getDate() === 29;
|
|
211
|
+
return {
|
|
212
|
+
summary: local.title,
|
|
213
|
+
eventType: "birthday",
|
|
214
|
+
birthdayProperties: { type: "birthday" },
|
|
215
|
+
start: { date: toDate(startD.getTime()) },
|
|
216
|
+
end: { date: toDate(endD.getTime()) },
|
|
217
|
+
recurrence: [isLeapDay ? "RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=-1" : "RRULE:FREQ=YEARLY"],
|
|
218
|
+
visibility: "private",
|
|
219
|
+
transparency: "transparent",
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
summary: local.title,
|
|
224
|
+
start: local.allDay ? { date: toDate(local.startMs) } : { dateTime: toIso(local.startMs) },
|
|
225
|
+
end: local.allDay ? { date: toDate(local.endMs) } : { dateTime: toIso(local.endMs) },
|
|
226
|
+
location: local.location || undefined,
|
|
227
|
+
description: local.notes || undefined,
|
|
228
|
+
// "free" (tentative / FYI / hold) shows as not busy; absent = Google's default (busy).
|
|
229
|
+
transparency: local.free ? "transparent" : undefined,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
export function taskToLocal(t, accountId) {
|
|
233
|
+
return {
|
|
234
|
+
providerId: t.id, accountId, title: t.title || "",
|
|
235
|
+
notes: t.notes || "",
|
|
236
|
+
// `due` is a date-ONLY field (Google Tasks discards the time part)
|
|
237
|
+
// transmitted as UTC midnight. Raw Date.parse made it "yesterday
|
|
238
|
+
// 20:00" in US Eastern — the task displayed a day early and went
|
|
239
|
+
// overdue the evening before its due date. Parse as local midnight,
|
|
240
|
+
// same as all-day calendar events.
|
|
241
|
+
dueMs: t.due ? dateOnlyToLocalMs(t.due) : undefined,
|
|
242
|
+
completedMs: t.completed ? Date.parse(t.completed) : undefined,
|
|
243
|
+
etag: t.etag || "",
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
export function localToTask(local) {
|
|
247
|
+
return {
|
|
248
|
+
title: local.title,
|
|
249
|
+
notes: local.notes || undefined,
|
|
250
|
+
// Date-only semantics both ways: write the LOCAL calendar date at
|
|
251
|
+
// UTC midnight (the shape Google itself sends back). Raw
|
|
252
|
+
// toISOString() of a local-midnight ms shifts the date a day for
|
|
253
|
+
// any user east of UTC.
|
|
254
|
+
due: local.dueMs ? `${localMsToDateOnly(local.dueMs)}T00:00:00.000Z` : undefined,
|
|
255
|
+
completed: local.completedMs ? new Date(local.completedMs).toISOString() : undefined,
|
|
256
|
+
status: local.completedMs ? "completed" : "needsAction",
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=google-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-sync.js","sourceRoot":"","sources":["google-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACtC,MAAM,CAAS;IACf,UAAU,CAAS;IACnB,IAAI,CAAS;IACb,YAAY,MAAc,EAAE,UAAkB,EAAE,IAAY;QACxD,KAAK,CAAC,cAAc,MAAM,IAAI,UAAU,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACnE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CACJ;AAED,KAAK,UAAU,WAAW,CACtB,aAA4B,EAAE,GAAW,EAAE,OAAoB,EAAE;IAEjE,MAAM,KAAK,GAAG,MAAM,aAAa,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;IAChD,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;IAC/F,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;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