@voxendar/shared 0.4.1 → 0.5.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/dist/calendar/group.d.ts +22 -0
- package/dist/calendar/group.d.ts.map +1 -0
- package/dist/calendar/group.js +29 -0
- package/dist/calendar/group.js.map +1 -0
- package/dist/calendar/window.d.ts +54 -0
- package/dist/calendar/window.d.ts.map +1 -0
- package/dist/calendar/window.js +104 -0
- package/dist/calendar/window.js.map +1 -0
- package/dist/i18n/copy/ar-SA.d.ts +14 -0
- package/dist/i18n/copy/ar-SA.d.ts.map +1 -1
- package/dist/i18n/copy/ar-SA.js +15 -0
- package/dist/i18n/copy/ar-SA.js.map +1 -1
- package/dist/i18n/copy/de-DE.d.ts +14 -0
- package/dist/i18n/copy/de-DE.d.ts.map +1 -1
- package/dist/i18n/copy/de-DE.js +15 -0
- package/dist/i18n/copy/de-DE.js.map +1 -1
- package/dist/i18n/copy/en-US.d.ts +14 -0
- package/dist/i18n/copy/en-US.d.ts.map +1 -1
- package/dist/i18n/copy/en-US.js +15 -0
- package/dist/i18n/copy/en-US.js.map +1 -1
- package/dist/i18n/copy/es-MX.d.ts +14 -0
- package/dist/i18n/copy/es-MX.d.ts.map +1 -1
- package/dist/i18n/copy/es-MX.js +15 -0
- package/dist/i18n/copy/es-MX.js.map +1 -1
- package/dist/i18n/copy/fr-FR.d.ts +14 -0
- package/dist/i18n/copy/fr-FR.d.ts.map +1 -1
- package/dist/i18n/copy/fr-FR.js +15 -0
- package/dist/i18n/copy/fr-FR.js.map +1 -1
- package/dist/i18n/copy/he-IL.d.ts +14 -0
- package/dist/i18n/copy/he-IL.d.ts.map +1 -1
- package/dist/i18n/copy/he-IL.js +15 -0
- package/dist/i18n/copy/he-IL.js.map +1 -1
- package/dist/i18n/copy/hi-IN.d.ts +14 -0
- package/dist/i18n/copy/hi-IN.d.ts.map +1 -1
- package/dist/i18n/copy/hi-IN.js +15 -0
- package/dist/i18n/copy/hi-IN.js.map +1 -1
- package/dist/i18n/copy/ja-JP.d.ts +14 -0
- package/dist/i18n/copy/ja-JP.d.ts.map +1 -1
- package/dist/i18n/copy/ja-JP.js +15 -0
- package/dist/i18n/copy/ja-JP.js.map +1 -1
- package/dist/i18n/copy/ko-KR.d.ts +14 -0
- package/dist/i18n/copy/ko-KR.d.ts.map +1 -1
- package/dist/i18n/copy/ko-KR.js +15 -0
- package/dist/i18n/copy/ko-KR.js.map +1 -1
- package/dist/i18n/copy/pt-BR.d.ts +14 -0
- package/dist/i18n/copy/pt-BR.d.ts.map +1 -1
- package/dist/i18n/copy/pt-BR.js +15 -0
- package/dist/i18n/copy/pt-BR.js.map +1 -1
- package/dist/i18n/copy/ru-RU.d.ts +14 -0
- package/dist/i18n/copy/ru-RU.d.ts.map +1 -1
- package/dist/i18n/copy/ru-RU.js +15 -0
- package/dist/i18n/copy/ru-RU.js.map +1 -1
- package/dist/i18n/copy/zh-CN.d.ts +14 -0
- package/dist/i18n/copy/zh-CN.d.ts.map +1 -1
- package/dist/i18n/copy/zh-CN.js +15 -0
- package/dist/i18n/copy/zh-CN.js.map +1 -1
- package/dist/i18n/copy/zh-TW.d.ts +14 -0
- package/dist/i18n/copy/zh-TW.d.ts.map +1 -1
- package/dist/i18n/copy/zh-TW.js +15 -0
- package/dist/i18n/copy/zh-TW.js.map +1 -1
- package/dist/i18n/server-messages.d.ts.map +1 -1
- package/dist/i18n/server-messages.js +6 -0
- package/dist/i18n/server-messages.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/calendar-event.d.ts +103 -0
- package/dist/schemas/calendar-event.d.ts.map +1 -0
- package/dist/schemas/calendar-event.js +52 -0
- package/dist/schemas/calendar-event.js.map +1 -0
- package/dist/schemas/member.d.ts +4 -4
- package/dist/schemas/primitives.d.ts +9 -0
- package/dist/schemas/primitives.d.ts.map +1 -1
- package/dist/schemas/primitives.js +10 -1
- package/dist/schemas/primitives.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-messages.d.ts","sourceRoot":"","sources":["../../src/i18n/server-messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAa,KAAK,QAAQ,EAAc,KAAK,QAAQ,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"server-messages.d.ts","sourceRoot":"","sources":["../../src/i18n/server-messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAa,KAAK,QAAQ,EAAc,KAAK,QAAQ,EAAE,MAAM,MAAM,CAAC;AAoG3E,MAAM,WAAW,sBAAsB;IACrC,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,MAAM,EAAE,OAAO,CAAC;CACjB;AAgBD,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wDAAwD;AACxD,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAC9C,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,QAAQ,GAChB,sBAAsB,CAQxB;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAElD,CAAC"}
|
|
@@ -84,6 +84,7 @@ const SERVER_MESSAGES = {
|
|
|
84
84
|
"Your member profile could not be read": "error.profileMissing",
|
|
85
85
|
"Finish setting up your calendar before capturing an event": "error.profileMissing",
|
|
86
86
|
"Finish setting up your calendar before confirming an event": "error.profileMissing",
|
|
87
|
+
"Finish setting up your calendar before opening it": "error.profileMissing",
|
|
87
88
|
"No setup on file — finish setting up before editing settings": "error.profileMissing",
|
|
88
89
|
"Sign in with Firebase first (native Google Sign-In → idToken → signInWithCredential)": "error.signIn",
|
|
89
90
|
"No Google authorization on file — the client must complete exchangeGoogleCode first": "error.signIn",
|
|
@@ -98,7 +99,12 @@ const SERVER_MESSAGES = {
|
|
|
98
99
|
"Sign in before confirming an event": "error.signIn",
|
|
99
100
|
"Sign in before hearing a voice": "error.signIn",
|
|
100
101
|
"Sign in before joining a group": "error.signIn",
|
|
102
|
+
"Sign in before reading the calendar": "error.signIn",
|
|
101
103
|
// ── Internal: a member can do nothing with these, and they name internals ──
|
|
104
|
+
// Both of these describe a *client* bug: the view asked for an impossible window. A member
|
|
105
|
+
// cannot act on that, and the numbers in it are ours, so `error.generic` is the right face.
|
|
106
|
+
"The range must end after it starts": null,
|
|
107
|
+
"That range is too wide to read in one call": null,
|
|
102
108
|
"Calendar API returned no calendar id": null,
|
|
103
109
|
"Invalid event draft": null,
|
|
104
110
|
"Invalid join payload": null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-messages.js","sourceRoot":"","sources":["../../src/i18n/server-messages.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"server-messages.js","sourceRoot":"","sources":["../../src/i18n/server-messages.ts"],"names":[],"mappings":";;;AA4JA,0CAEC;AAGD,sDAYC;AAGD,sDAEC;AAlLD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,6BAA2E;AAE3E,uFAAuF;AACvF,MAAM,eAAe,GAAiC;IACpD,6EAA6E;IAC7E,yCAAyC,EAAE,kBAAkB;IAC7D,iDAAiD,EAAE,kBAAkB;IACrE,sCAAsC,EAAE,kBAAkB;IAC1D,2CAA2C,EAAE,kBAAkB;IAC/D,oCAAoC,EAAE,kBAAkB;IACxD,2FAA2F,EAAE,IAAI;IACjG,sFAAsF,EAAE,IAAI;IAC5F,oFAAoF,EAAE,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,OAAO,EAAE,IAAI,EAAE,IAAA,cAAS,EAAC,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC/E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAA,cAAS,EAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAClE,CAAC;AAED,iFAAiF;AACjF,SAAgB,qBAAqB,CAAC,OAAe;IACnD,OAAO,OAAO,eAAe,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK,QAAQ,CAAC;AACvE,CAAC;AAED;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAsB,MAAM,CAAC,MAAM,CACnE,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,CACpC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,14 @@ export * from "./schemas/enums";
|
|
|
3
3
|
export * from "./schemas/primitives";
|
|
4
4
|
export * from "./schemas/error";
|
|
5
5
|
export * from "./schemas/event";
|
|
6
|
+
export * from "./schemas/calendar-event";
|
|
6
7
|
export * from "./schemas/circle";
|
|
7
8
|
export * from "./schemas/member";
|
|
8
9
|
export * from "./schemas/capture";
|
|
9
10
|
export * from "./capture/fields";
|
|
10
11
|
export * from "./capture/audio";
|
|
12
|
+
export * from "./calendar/window";
|
|
13
|
+
export * from "./calendar/group";
|
|
11
14
|
export * from "./schemas/reminder";
|
|
12
15
|
export * from "./reminders/math";
|
|
13
16
|
export * from "./i18n/templates";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,11 +19,14 @@ __exportStar(require("./schemas/enums"), exports);
|
|
|
19
19
|
__exportStar(require("./schemas/primitives"), exports);
|
|
20
20
|
__exportStar(require("./schemas/error"), exports);
|
|
21
21
|
__exportStar(require("./schemas/event"), exports);
|
|
22
|
+
__exportStar(require("./schemas/calendar-event"), exports);
|
|
22
23
|
__exportStar(require("./schemas/circle"), exports);
|
|
23
24
|
__exportStar(require("./schemas/member"), exports);
|
|
24
25
|
__exportStar(require("./schemas/capture"), exports);
|
|
25
26
|
__exportStar(require("./capture/fields"), exports);
|
|
26
27
|
__exportStar(require("./capture/audio"), exports);
|
|
28
|
+
__exportStar(require("./calendar/window"), exports);
|
|
29
|
+
__exportStar(require("./calendar/group"), exports);
|
|
27
30
|
__exportStar(require("./schemas/reminder"), exports);
|
|
28
31
|
__exportStar(require("./reminders/math"), exports);
|
|
29
32
|
__exportStar(require("./i18n/templates"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,kDAAgC;AAChC,uDAAqC;AACrC,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,mDAAiC;AACjC,oDAAkC;AAClC,mDAAiC;AACjC,kDAAgC;AAChC,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC;AACjC,4CAA0B;AAC1B,6CAA2B;AAC3B,yDAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,kDAAgC;AAChC,uDAAqC;AACrC,kDAAgC;AAChC,kDAAgC;AAChC,2DAAyC;AACzC,mDAAiC;AACjC,mDAAiC;AACjC,oDAAkC;AAClC,mDAAiC;AACjC,kDAAgC;AAChC,oDAAkC;AAClC,mDAAiC;AACjC,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC;AACjC,4CAA0B;AAC1B,6CAA2B;AAC3B,yDAAuC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* One event as the app **reads it back** from the circle's Google Calendar (M1.7).
|
|
4
|
+
*
|
|
5
|
+
* Deliberately not `EventDraft` (`schemas/event.ts`). A draft is what a member *said* and
|
|
6
|
+
* what we write — it always has an owner, a title, a confirmation. A calendar row is what
|
|
7
|
+
* *Google has*, which includes events created in the Calendar app, by other people, or by a
|
|
8
|
+
* bot years ago. Reusing the draft schema here would force us to invent the fields it
|
|
9
|
+
* requires (`confidence`, `spokenConfirmation`, `ambiguities`) for events nobody asked us
|
|
10
|
+
* about. So the two shapes are separate, and `memberId` is nullable because "we do not know
|
|
11
|
+
* who added this" is a real answer that must not be guessed.
|
|
12
|
+
*
|
|
13
|
+
* **Timed and all-day events keep their two shapes.** `start`/`end` are instants for a timed
|
|
14
|
+
* event and `null` for an all-day one; `startDate`/`endDate` are `YYYY-MM-DD` for an all-day
|
|
15
|
+
* event and `null` otherwise, with `endDate` **exclusive** — exactly as Google's API defines
|
|
16
|
+
* it, so a one-day event has `startDate = endDate - 1 day`. Flattening this into a single
|
|
17
|
+
* instant pair would require converting a calendar date to "midnight in some zone", which is
|
|
18
|
+
* both lossy (whose midnight?) and the arithmetic that breaks at DST edges.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CalendarEventSchema: z.ZodEffects<z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
/** `summary`, or `""` when the event has none — the client decides what an empty title looks like. */
|
|
23
|
+
title: z.ZodString;
|
|
24
|
+
allDay: z.ZodBoolean;
|
|
25
|
+
start: z.ZodNullable<z.ZodString>;
|
|
26
|
+
end: z.ZodNullable<z.ZodString>;
|
|
27
|
+
/** `YYYY-MM-DD`; `null` unless `allDay`. */
|
|
28
|
+
startDate: z.ZodNullable<z.ZodString>;
|
|
29
|
+
/** `YYYY-MM-DD`, **exclusive**; `null` unless `allDay`. */
|
|
30
|
+
endDate: z.ZodNullable<z.ZodString>;
|
|
31
|
+
/** The zone the timed instants are expressed in; for an all-day event, the member's own. */
|
|
32
|
+
timeZone: z.ZodString;
|
|
33
|
+
location: z.ZodNullable<z.ZodString>;
|
|
34
|
+
/** Google's colour id ("1"–"11") — the member's colour for anything this app wrote. */
|
|
35
|
+
colorId: z.ZodNullable<z.ZodString>;
|
|
36
|
+
/**
|
|
37
|
+
* Which member the event belongs to, per D4: `extendedProperties` first (written by us),
|
|
38
|
+
* then the colour→member map (covers events typed into Google by hand). `null` when
|
|
39
|
+
* neither says, and the UI shows it as unattributed rather than picking a member.
|
|
40
|
+
*/
|
|
41
|
+
memberId: z.ZodNullable<z.ZodString>;
|
|
42
|
+
/** A recurring master or instance — v1 shows these and refuses to edit them (D5). */
|
|
43
|
+
recurring: z.ZodBoolean;
|
|
44
|
+
htmlLink: z.ZodNullable<z.ZodString>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
title: string;
|
|
47
|
+
start: string | null;
|
|
48
|
+
end: string | null;
|
|
49
|
+
timeZone: string;
|
|
50
|
+
allDay: boolean;
|
|
51
|
+
location: string | null;
|
|
52
|
+
id: string;
|
|
53
|
+
startDate: string | null;
|
|
54
|
+
endDate: string | null;
|
|
55
|
+
colorId: string | null;
|
|
56
|
+
memberId: string | null;
|
|
57
|
+
recurring: boolean;
|
|
58
|
+
htmlLink: string | null;
|
|
59
|
+
}, {
|
|
60
|
+
title: string;
|
|
61
|
+
start: string | null;
|
|
62
|
+
end: string | null;
|
|
63
|
+
timeZone: string;
|
|
64
|
+
allDay: boolean;
|
|
65
|
+
location: string | null;
|
|
66
|
+
id: string;
|
|
67
|
+
startDate: string | null;
|
|
68
|
+
endDate: string | null;
|
|
69
|
+
colorId: string | null;
|
|
70
|
+
memberId: string | null;
|
|
71
|
+
recurring: boolean;
|
|
72
|
+
htmlLink: string | null;
|
|
73
|
+
}>, {
|
|
74
|
+
title: string;
|
|
75
|
+
start: string | null;
|
|
76
|
+
end: string | null;
|
|
77
|
+
timeZone: string;
|
|
78
|
+
allDay: boolean;
|
|
79
|
+
location: string | null;
|
|
80
|
+
id: string;
|
|
81
|
+
startDate: string | null;
|
|
82
|
+
endDate: string | null;
|
|
83
|
+
colorId: string | null;
|
|
84
|
+
memberId: string | null;
|
|
85
|
+
recurring: boolean;
|
|
86
|
+
htmlLink: string | null;
|
|
87
|
+
}, {
|
|
88
|
+
title: string;
|
|
89
|
+
start: string | null;
|
|
90
|
+
end: string | null;
|
|
91
|
+
timeZone: string;
|
|
92
|
+
allDay: boolean;
|
|
93
|
+
location: string | null;
|
|
94
|
+
id: string;
|
|
95
|
+
startDate: string | null;
|
|
96
|
+
endDate: string | null;
|
|
97
|
+
colorId: string | null;
|
|
98
|
+
memberId: string | null;
|
|
99
|
+
recurring: boolean;
|
|
100
|
+
htmlLink: string | null;
|
|
101
|
+
}>;
|
|
102
|
+
export type CalendarEvent = z.infer<typeof CalendarEventSchema>;
|
|
103
|
+
//# sourceMappingURL=calendar-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-event.d.ts","sourceRoot":"","sources":["../../src/schemas/calendar-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB;;IAG5B,sGAAsG;;;;;IAKtG,4CAA4C;;IAE5C,2DAA2D;;IAE3D,4FAA4F;;;IAG5F,uFAAuF;;IAEvF;;;;OAIG;;IAEH,qFAAqF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOtF,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalendarEventSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const primitives_1 = require("./primitives");
|
|
6
|
+
/**
|
|
7
|
+
* One event as the app **reads it back** from the circle's Google Calendar (M1.7).
|
|
8
|
+
*
|
|
9
|
+
* Deliberately not `EventDraft` (`schemas/event.ts`). A draft is what a member *said* and
|
|
10
|
+
* what we write — it always has an owner, a title, a confirmation. A calendar row is what
|
|
11
|
+
* *Google has*, which includes events created in the Calendar app, by other people, or by a
|
|
12
|
+
* bot years ago. Reusing the draft schema here would force us to invent the fields it
|
|
13
|
+
* requires (`confidence`, `spokenConfirmation`, `ambiguities`) for events nobody asked us
|
|
14
|
+
* about. So the two shapes are separate, and `memberId` is nullable because "we do not know
|
|
15
|
+
* who added this" is a real answer that must not be guessed.
|
|
16
|
+
*
|
|
17
|
+
* **Timed and all-day events keep their two shapes.** `start`/`end` are instants for a timed
|
|
18
|
+
* event and `null` for an all-day one; `startDate`/`endDate` are `YYYY-MM-DD` for an all-day
|
|
19
|
+
* event and `null` otherwise, with `endDate` **exclusive** — exactly as Google's API defines
|
|
20
|
+
* it, so a one-day event has `startDate = endDate - 1 day`. Flattening this into a single
|
|
21
|
+
* instant pair would require converting a calendar date to "midnight in some zone", which is
|
|
22
|
+
* both lossy (whose midnight?) and the arithmetic that breaks at DST edges.
|
|
23
|
+
*/
|
|
24
|
+
exports.CalendarEventSchema = zod_1.z
|
|
25
|
+
.object({
|
|
26
|
+
id: zod_1.z.string().min(1),
|
|
27
|
+
/** `summary`, or `""` when the event has none — the client decides what an empty title looks like. */
|
|
28
|
+
title: zod_1.z.string().max(500),
|
|
29
|
+
allDay: zod_1.z.boolean(),
|
|
30
|
+
start: primitives_1.rfc3339.nullable(),
|
|
31
|
+
end: primitives_1.rfc3339.nullable(),
|
|
32
|
+
/** `YYYY-MM-DD`; `null` unless `allDay`. */
|
|
33
|
+
startDate: primitives_1.localDate.nullable(),
|
|
34
|
+
/** `YYYY-MM-DD`, **exclusive**; `null` unless `allDay`. */
|
|
35
|
+
endDate: primitives_1.localDate.nullable(),
|
|
36
|
+
/** The zone the timed instants are expressed in; for an all-day event, the member's own. */
|
|
37
|
+
timeZone: primitives_1.ianaTimeZone,
|
|
38
|
+
location: zod_1.z.string().nullable(),
|
|
39
|
+
/** Google's colour id ("1"–"11") — the member's colour for anything this app wrote. */
|
|
40
|
+
colorId: zod_1.z.string().nullable(),
|
|
41
|
+
/**
|
|
42
|
+
* Which member the event belongs to, per D4: `extendedProperties` first (written by us),
|
|
43
|
+
* then the colour→member map (covers events typed into Google by hand). `null` when
|
|
44
|
+
* neither says, and the UI shows it as unattributed rather than picking a member.
|
|
45
|
+
*/
|
|
46
|
+
memberId: zod_1.z.string().nullable(),
|
|
47
|
+
/** A recurring master or instance — v1 shows these and refuses to edit them (D5). */
|
|
48
|
+
recurring: zod_1.z.boolean(),
|
|
49
|
+
htmlLink: zod_1.z.string().nullable(),
|
|
50
|
+
})
|
|
51
|
+
.refine((event) => (event.allDay ? event.startDate !== null : event.start !== null), "an all-day event carries startDate; a timed event carries start");
|
|
52
|
+
//# sourceMappingURL=calendar-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-event.js","sourceRoot":"","sources":["../../src/schemas/calendar-event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6CAAgE;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,mBAAmB,GAAG,OAAC;KACjC,MAAM,CAAC;IACN,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,sGAAsG;IACtG,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;IAC1B,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE;IACnB,KAAK,EAAE,oBAAO,CAAC,QAAQ,EAAE;IACzB,GAAG,EAAE,oBAAO,CAAC,QAAQ,EAAE;IACvB,4CAA4C;IAC5C,SAAS,EAAE,sBAAS,CAAC,QAAQ,EAAE;IAC/B,2DAA2D;IAC3D,OAAO,EAAE,sBAAS,CAAC,QAAQ,EAAE;IAC7B,4FAA4F;IAC5F,QAAQ,EAAE,yBAAY;IACtB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,uFAAuF;IACvF,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B;;;;OAIG;IACH,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,qFAAqF;IACrF,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE;IACtB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,EAC3E,iEAAiE,CAClE,CAAC"}
|
package/dist/schemas/member.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export declare const MemberProfileSchema: z.ZodObject<{
|
|
|
27
27
|
telegramChatId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
29
|
timeZone: string;
|
|
30
|
-
displayName: string;
|
|
31
30
|
colorId: string;
|
|
31
|
+
displayName: string;
|
|
32
32
|
avatarId: string;
|
|
33
33
|
authType: "google" | "profile";
|
|
34
34
|
language: string;
|
|
@@ -43,8 +43,8 @@ export declare const MemberProfileSchema: z.ZodObject<{
|
|
|
43
43
|
telegramChatId?: string | null | undefined;
|
|
44
44
|
}, {
|
|
45
45
|
timeZone: string;
|
|
46
|
-
displayName: string;
|
|
47
46
|
colorId: string;
|
|
47
|
+
displayName: string;
|
|
48
48
|
avatarId: string;
|
|
49
49
|
authType: "google" | "profile";
|
|
50
50
|
language: string;
|
|
@@ -65,14 +65,14 @@ export declare const UserProfileSchema: z.ZodObject<{
|
|
|
65
65
|
authType: z.ZodEnum<["google", "profile"]>;
|
|
66
66
|
createdAt: z.ZodAny;
|
|
67
67
|
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
memberId: string;
|
|
68
69
|
authType: "google" | "profile";
|
|
69
70
|
familyId: string;
|
|
70
|
-
memberId: string;
|
|
71
71
|
createdAt?: any;
|
|
72
72
|
}, {
|
|
73
|
+
memberId: string;
|
|
73
74
|
authType: "google" | "profile";
|
|
74
75
|
familyId: string;
|
|
75
|
-
memberId: string;
|
|
76
76
|
createdAt?: any;
|
|
77
77
|
}>;
|
|
78
78
|
export type MemberProfile = z.infer<typeof MemberProfileSchema>;
|
|
@@ -5,6 +5,15 @@ export declare const rfc3339: z.ZodString;
|
|
|
5
5
|
export declare const ianaTimeZone: z.ZodString;
|
|
6
6
|
/** Loose BCP-47 language tag, e.g. en-US, zh-CN, es-MX. */
|
|
7
7
|
export declare const bcp47Language: z.ZodString;
|
|
8
|
+
/**
|
|
9
|
+
* A calendar date with no time and no zone — `2026-10-23`.
|
|
10
|
+
*
|
|
11
|
+
* All-day events are the reason this exists (M1.7). Google models them as `start.date`, not
|
|
12
|
+
* `start.dateTime`, and flattening that into an instant would mean computing "local midnight
|
|
13
|
+
* in the member's zone", i.e. the inverse of what `Intl` can do — the arithmetic that quietly
|
|
14
|
+
* breaks on the two days a year a zone skips or repeats an hour. The date travels as a date.
|
|
15
|
+
*/
|
|
16
|
+
export declare const localDate: z.ZodString;
|
|
8
17
|
/** E.164 phone number, e.g. +14155552671. */
|
|
9
18
|
export declare const e164Phone: z.ZodString;
|
|
10
19
|
/** Google Calendar color id "1"–"11". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/schemas/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gFAAgF;AAChF,eAAO,MAAM,OAAO,aAAwC,CAAC;AAE7D,+DAA+D;AAC/D,eAAO,MAAM,YAAY,aAA0D,CAAC;AAEpF,2DAA2D;AAC3D,eAAO,MAAM,aAAa,aAA0D,CAAC;AAErF,6CAA6C;AAC7C,eAAO,MAAM,SAAS,aAAwC,CAAC;AAE/D,yCAAyC;AACzC,eAAO,MAAM,eAAe,aAAsC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/schemas/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gFAAgF;AAChF,eAAO,MAAM,OAAO,aAAwC,CAAC;AAE7D,+DAA+D;AAC/D,eAAO,MAAM,YAAY,aAA0D,CAAC;AAEpF,2DAA2D;AAC3D,eAAO,MAAM,aAAa,aAA0D,CAAC;AAErF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,aAAoE,CAAC;AAE3F,6CAA6C;AAC7C,eAAO,MAAM,SAAS,aAAwC,CAAC;AAE/D,yCAAyC;AACzC,eAAO,MAAM,eAAe,aAAsC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAAU,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.firestoreTimestamp = exports.calendarColorId = exports.e164Phone = exports.bcp47Language = exports.ianaTimeZone = exports.rfc3339 = void 0;
|
|
3
|
+
exports.firestoreTimestamp = exports.calendarColorId = exports.e164Phone = exports.localDate = exports.bcp47Language = exports.ianaTimeZone = exports.rfc3339 = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
/** RFC3339 timestamp with timezone offset, e.g. "2026-09-08T15:00:00+08:00". */
|
|
6
6
|
exports.rfc3339 = zod_1.z.string().datetime({ offset: true });
|
|
@@ -8,6 +8,15 @@ exports.rfc3339 = zod_1.z.string().datetime({ offset: true });
|
|
|
8
8
|
exports.ianaTimeZone = zod_1.z.string().regex(/^[A-Za-z]{2,}(\/[A-Za-z0-9_+\-]+)+$/);
|
|
9
9
|
/** Loose BCP-47 language tag, e.g. en-US, zh-CN, es-MX. */
|
|
10
10
|
exports.bcp47Language = zod_1.z.string().regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/i);
|
|
11
|
+
/**
|
|
12
|
+
* A calendar date with no time and no zone — `2026-10-23`.
|
|
13
|
+
*
|
|
14
|
+
* All-day events are the reason this exists (M1.7). Google models them as `start.date`, not
|
|
15
|
+
* `start.dateTime`, and flattening that into an instant would mean computing "local midnight
|
|
16
|
+
* in the member's zone", i.e. the inverse of what `Intl` can do — the arithmetic that quietly
|
|
17
|
+
* breaks on the two days a year a zone skips or repeats an hour. The date travels as a date.
|
|
18
|
+
*/
|
|
19
|
+
exports.localDate = zod_1.z.string().regex(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/);
|
|
11
20
|
/** E.164 phone number, e.g. +14155552671. */
|
|
12
21
|
exports.e164Phone = zod_1.z.string().regex(/^\+[1-9]\d{1,14}$/);
|
|
13
22
|
/** Google Calendar color id "1"–"11". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/schemas/primitives.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,gFAAgF;AACnE,QAAA,OAAO,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAE7D,+DAA+D;AAClD,QAAA,YAAY,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;AAEpF,2DAA2D;AAC9C,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;AAErF,6CAA6C;AAChC,QAAA,SAAS,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAE/D,yCAAyC;AAC5B,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC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