slotlock 0.6.1 → 0.6.3
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 +34 -0
- package/README.md +13 -6
- package/SECURITY.md +15 -4
- package/agent-server.js +1 -5
- package/agent-store-backend.d.ts +5 -6
- package/agent-store-backend.js +41 -67
- package/api-keys.js +1 -1
- package/application-api.d.ts +3 -3
- package/application-api.js +16 -24
- package/assistant.d.ts +18 -27
- package/assistant.js +36 -53
- package/booking-rules.d.ts +30 -41
- package/booking-rules.js +17 -25
- package/change-watch.d.ts +1 -0
- package/change-watch.js +1 -1
- package/cli.js +3 -4
- package/config.d.ts +17 -2
- package/config.js +44 -6
- package/dashboard.js +14 -1
- package/ddl.d.ts +20 -27
- package/ddl.js +166 -108
- package/engine.d.ts +6 -9
- package/engine.js +5 -9
- package/event-feed.d.ts +23 -31
- package/event-feed.js +30 -45
- package/event-schema.js +6 -9
- package/hooks.d.ts +2 -4
- package/hooks.js +2 -4
- package/ical-worker-thread.js +3 -4
- package/ical-worker.d.ts +8 -10
- package/ical-worker.js +7 -9
- package/interop.js +1 -4
- package/maintenance.d.ts +14 -10
- package/maintenance.js +43 -26
- package/mcp-app.d.ts +7 -9
- package/mcp-app.js +7 -9
- package/mcp-modern.d.ts +14 -16
- package/mcp-modern.js +23 -27
- package/metrics.js +0 -1
- package/node-server.d.ts +9 -9
- package/node-server.js +25 -34
- package/package-version.js +2 -4
- package/package.json +1 -1
- package/rate-limit.d.ts +6 -1
- package/rate-limit.js +24 -8
- package/rest-api.d.ts +13 -14
- package/rest-api.js +11 -12
- package/rules.d.ts +6 -7
- package/rules.js +30 -42
- package/self-host.d.ts +16 -2
- package/self-host.js +42 -21
- package/slotlock.manifest.json +1 -1
- package/store.d.ts +109 -161
- package/store.js +253 -371
- package/sync.d.ts +44 -59
- package/sync.js +325 -469
- package/timezone.d.ts +25 -33
- package/timezone.js +37 -52
- package/types.d.ts +35 -56
- package/webhooks.d.ts +22 -25
- package/webhooks.js +35 -40
- package/weekly-hours.d.ts +3 -0
- package/weekly-hours.js +1 -1
package/sync.d.ts
CHANGED
|
@@ -35,20 +35,17 @@ export interface ICalendarExpansionWindow {
|
|
|
35
35
|
/** The most text one feed may be, in UTF-8 bytes. */
|
|
36
36
|
export declare const MAX_ICAL_INPUT_BYTES = 2000000;
|
|
37
37
|
/**
|
|
38
|
-
* The ical.js release
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* to the installed package: upgrading ical.js means checking the state these cursors keep again.
|
|
38
|
+
* The ical.js release whose RecurIterator/RecurExpansion state a series cursor holds; only that
|
|
39
|
+
* release is known to continue it exactly, so a cursor another release wrote is ignored. A test
|
|
40
|
+
* pins this to the installed package: upgrading ical.js means rechecking cursor state.
|
|
42
41
|
*/
|
|
43
42
|
export declare const ICAL_JS_VERSION = "2.2.1";
|
|
44
|
-
/** The shape of the cursor this code writes and reads. */
|
|
45
43
|
declare const SERIES_CURSOR_FORMAT = 1;
|
|
46
44
|
/** A time's fields as ical.js holds them: year, month, day, hour, minute, second, a date or not. */
|
|
47
45
|
type CursorTime = [number, number, number, number, number, number, boolean];
|
|
48
46
|
/**
|
|
49
|
-
* Where one expansion of a stored series stopped, as plain JSON
|
|
50
|
-
* iterator state just before the first occurrence the next window may need
|
|
51
|
-
* continues there rather than searching again from the series' start.
|
|
47
|
+
* Where one expansion of a stored series stopped, as plain JSON stored beside it: ical.js's
|
|
48
|
+
* iterator state just before the first occurrence the next window may need.
|
|
52
49
|
*/
|
|
53
50
|
export interface CalendarSeriesCursor {
|
|
54
51
|
readonly v: typeof SERIES_CURSOR_FORMAT;
|
|
@@ -82,8 +79,7 @@ export declare class CalendarContractError extends Error {
|
|
|
82
79
|
constructor(code: 'invalid_external_identity' | 'invalid_external_interval' | 'invalid_icalendar');
|
|
83
80
|
}
|
|
84
81
|
/**
|
|
85
|
-
* A calendar that needs more work than Slotlock does to read or expand it
|
|
86
|
-
* span longer than a century, or more occurrences, exceptions or dates than it keeps. Still
|
|
82
|
+
* A calendar that needs more work than Slotlock does to read or expand it. Still
|
|
87
83
|
* `invalid_icalendar` to callers; the horizon roll counts these and skips the series.
|
|
88
84
|
*/
|
|
89
85
|
export declare class CalendarExpansionLimitError extends CalendarContractError {
|
|
@@ -95,33 +91,28 @@ export declare class CalendarExpansionLimitError extends CalendarContractError {
|
|
|
95
91
|
*/
|
|
96
92
|
export declare function recurrenceRuleProblem(rule: string): string | null;
|
|
97
93
|
/**
|
|
98
|
-
* A recurrence rule
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* or MONTHLY, BYMONTHDAY with WEEKLY, a numbered BYDAY but MONTHLY or YEARLY) are refused. The
|
|
104
|
-
* numeric BY lists come back in ascending order (sortRuleParts).
|
|
94
|
+
* A recurrence rule in ical.js's canonical spelling, or `null`. ical.js is too lenient (it drops
|
|
95
|
+
* unknown parts, lets a repeated part win, reads `COUNT=3X` as 3 and `COUNT=0` as none), so every
|
|
96
|
+
* part must be RFC 5545's, appear once and match its grammar, with FREQ present, never UNTIL with
|
|
97
|
+
* COUNT, and no part RFC 5545 forbids for the frequency. Numeric BY lists come back sorted
|
|
98
|
+
* (sortRuleParts).
|
|
105
99
|
*/
|
|
106
100
|
export declare function canonicalRecurrenceRule(rule: string): string | null;
|
|
107
101
|
/**
|
|
108
|
-
* A rule Slotlock books from an agent: valid
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* sub-daily one that rarely does, holds the process forever.
|
|
102
|
+
* A rule Slotlock books from an agent: valid, daily or less often, and able to occur. ical.js
|
|
103
|
+
* searches sub-daily rules step by step with no limit, so one that never occurs
|
|
104
|
+
* (`BYMONTH=2;BYMONTHDAY=30`) would hold the process forever.
|
|
112
105
|
*/
|
|
113
106
|
export declare function isBookableRecurrenceRule(rule: string): boolean;
|
|
114
107
|
/** Validate, clone and bound trusted event content before persistence or serialization. */
|
|
115
108
|
export declare function normalizeCalendarEventContent(input: CalendarEventContent): CalendarEventContent;
|
|
116
109
|
export declare function normalizeExternalCalendarChange(input: ExternalCalendarChangeInput): ExternalCalendarChange;
|
|
117
110
|
/**
|
|
118
|
-
* Each line of `input` as ical.js 2.2.1's parser takes it, with the parameters it reads there
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* that move; boundPropertyHeads refuses a feed with a VCARD instead. With `limits`, a line's count
|
|
124
|
-
* stops once it is past them. Exported for the tests, which hold it to ical.js's own reading.
|
|
111
|
+
* Each line of `input` as ical.js 2.2.1's parser takes it, with the parameters it reads there
|
|
112
|
+
* (parse._eachLine, with the design set picked at the first BEGIN), and for a BEGIN line the
|
|
113
|
+
* component. Stops before the first BEGIN, where ical.js throws. Does not follow a VCARD's switch
|
|
114
|
+
* to vCard 3 (boundPropertyHeads refuses those). With `limits`, a line's count stops once past
|
|
115
|
+
* them. Exported for the tests.
|
|
125
116
|
*/
|
|
126
117
|
export declare function icalendarPropertyHeads(input: string, limits?: HeadLimits): Generator<{
|
|
127
118
|
line: string;
|
|
@@ -135,12 +126,11 @@ interface HeadLimits {
|
|
|
135
126
|
end: number;
|
|
136
127
|
}
|
|
137
128
|
/**
|
|
138
|
-
* How many parameters ical.js 2.2.1 reads on one unfolded line and where it stops
|
|
139
|
-
* (parse._handleContentLine, then
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* Exported for the tests, which hold it to ical.js's own count.
|
|
129
|
+
* How many parameters ical.js 2.2.1 reads on one unfolded line and where it stops
|
|
130
|
+
* (parse._handleContentLine, then _parseParameters, step for step): a `"` opens a quoted value only
|
|
131
|
+
* right after `=`, a multi-valued parameter (MEMBER, DELEGATED-TO) continues past `","`, and `:`
|
|
132
|
+
* ends the parameters only where ical.js looks for one. Stops early where ical.js throws, and past
|
|
133
|
+
* `limits` if given. Exported for the tests.
|
|
144
134
|
*/
|
|
145
135
|
export declare function icalendarPropertyHead(line: string, params: Record<string, {
|
|
146
136
|
multiValue?: string;
|
|
@@ -150,9 +140,9 @@ export declare function icalendarPropertyHead(line: string, params: Record<strin
|
|
|
150
140
|
};
|
|
151
141
|
/**
|
|
152
142
|
* Parse VEVENTs with the standards library; event content is deliberately discarded. All or
|
|
153
|
-
* nothing: a series Slotlock cannot read refuses the whole calendar, so a caller
|
|
154
|
-
*
|
|
155
|
-
*
|
|
143
|
+
* nothing: a series Slotlock cannot read refuses the whole calendar, so a caller reading the result
|
|
144
|
+
* as busy time never takes its time as free. parseICalendarFeed keeps the rest of the calendar
|
|
145
|
+
* instead.
|
|
156
146
|
*/
|
|
157
147
|
export declare function parseICalendarChanges(input: string, calendarTimezone?: string, expansionWindow?: ICalendarExpansionWindow): ExternalCalendarChange[];
|
|
158
148
|
/** A series a feed holds that Slotlock refused to read, by its UID. */
|
|
@@ -169,11 +159,10 @@ export interface ICalendarFeedRead {
|
|
|
169
159
|
refused: ICalendarSeriesRefusal[];
|
|
170
160
|
}
|
|
171
161
|
/**
|
|
172
|
-
* parseICalendarChanges, refusing one series at a time: a series Slotlock cannot read (a
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* past 367 days) is still refused whole, with CalendarContractError.
|
|
162
|
+
* parseICalendarChanges, refusing one series at a time: a series Slotlock cannot read (a
|
|
163
|
+
* misexpanded rule shape, an end the clocks move before its start, DTEND with DURATION, or over
|
|
164
|
+
* budget) is named in `refused` and the rest is read. A calendar that is not one (size, time zones,
|
|
165
|
+
* a missing UID, a window over 367 days) is still refused whole, with CalendarContractError.
|
|
177
166
|
*/
|
|
178
167
|
export declare function parseICalendarFeed(input: string, calendarTimezone?: string, expansionWindow?: ICalendarExpansionWindow): ICalendarFeedRead;
|
|
179
168
|
/** Deterministic RFC 5545 + iTIP payload, validated by the installed ical.js implementation. */
|
|
@@ -181,10 +170,9 @@ export declare function emitITipCalendar(input: ICalendarEvent, method: ITipMeth
|
|
|
181
170
|
/** Backwards-compatible feed helper. Cancellation maps to iTIP CANCEL. */
|
|
182
171
|
export declare function emitICalendar(input: ICalendarEvent): string;
|
|
183
172
|
/**
|
|
184
|
-
* Parse full, trusted event content
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* `calendarTimezone` argument, else the feed's X-WR-TIMEZONE; with neither they are refused.
|
|
173
|
+
* Parse full, trusted event content: deliberately a different API from parseICalendarChanges, whose
|
|
174
|
+
* result can never carry summaries, participants or notes. All-day events become local-midnight
|
|
175
|
+
* bounds in `calendarTimezone`, else X-WR-TIMEZONE; with neither they are refused.
|
|
188
176
|
*/
|
|
189
177
|
export declare function parseTrustedICalendarEvents(input: string, calendarTimezone?: string): TrustedICalendarEvent[];
|
|
190
178
|
/**
|
|
@@ -193,16 +181,16 @@ export declare function parseTrustedICalendarEvents(input: string, calendarTimez
|
|
|
193
181
|
*/
|
|
194
182
|
export declare function expandCalendarEventOccurrences(input: CalendarEventContent, window: ICalendarExpansionWindow): CalendarEventOccurrence[];
|
|
195
183
|
/**
|
|
196
|
-
* The same expansion for a stored series as maintenance rolls it, within FEED_LIMITS
|
|
197
|
-
*
|
|
184
|
+
* The same expansion for a stored series as maintenance rolls it, within FEED_LIMITS (more than a
|
|
185
|
+
* write gets), so a series accepted once keeps rolling as its search grows.
|
|
198
186
|
*/
|
|
199
187
|
export declare function expandStoredCalendarEventOccurrences(input: CalendarEventContent, window: ICalendarExpansionWindow): CalendarEventOccurrence[];
|
|
200
188
|
/**
|
|
201
|
-
* Expand a stored series, resuming from
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
189
|
+
* Expand a stored series, resuming from its last cursor when that cursor can vouch for everything
|
|
190
|
+
* it skips, and leave a cursor for the next. Within FEED_LIMITS when maintenance rolls it
|
|
191
|
+
* (`stored`), else EVENT_LIMITS. Anything a cursor cannot serve (other rule, start, zone or
|
|
192
|
+
* ical.js; a window before it; something that could reach the window from before it; malformed) is
|
|
193
|
+
* searched from the start.
|
|
206
194
|
*/
|
|
207
195
|
export declare function expandCalendarEventSeries(input: CalendarEventContent, window: ICalendarExpansionWindow, options: {
|
|
208
196
|
cursor: unknown;
|
|
@@ -211,12 +199,9 @@ export declare function expandCalendarEventSeries(input: CalendarEventContent, w
|
|
|
211
199
|
resumeOnly?: boolean;
|
|
212
200
|
}): CalendarSeriesExpansion;
|
|
213
201
|
/**
|
|
214
|
-
* Why this Slotlock refuses an event an earlier one stored,
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* rule it no longer stores at all, or exceptions that name no occurrence (searched from the series'
|
|
218
|
-
* start to the last of them, within a roll's budget). It writes nothing, so it can be run over
|
|
219
|
-
* stored events before an upgrade.
|
|
202
|
+
* Why this Slotlock refuses an event an earlier one stored, or null. Maintenance counts such a
|
|
203
|
+
* series as refused on every roll and leaves its old coverage. Writes nothing, so it can be run
|
|
204
|
+
* over stored events before an upgrade.
|
|
220
205
|
*/
|
|
221
206
|
export declare function storedCalendarEventProblem(event: CalendarEventContent): string | null;
|
|
222
207
|
export {};
|