slotlock 0.6.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +511 -0
- package/CONTRIBUTING.md +12 -5
- package/README.md +50 -1551
- package/SECURITY.md +5 -2
- package/SPEC.md +1 -1
- package/agent-server.d.ts +160 -8
- package/agent-server.js +559 -44
- package/agent-store-backend.d.ts +34 -1
- package/agent-store-backend.js +1399 -38
- package/api-keys.d.ts +69 -3
- package/api-keys.js +217 -28
- package/application-api.d.ts +56 -3
- package/application-api.js +826 -15
- package/approvals.d.ts +88 -0
- package/approvals.js +293 -0
- package/assistant.d.ts +70 -1
- package/assistant.js +478 -50
- package/billing.d.ts +114 -0
- package/billing.js +258 -0
- package/config.d.ts +25 -4
- package/config.js +72 -3
- package/dashboard-assistant-ui.d.ts +21 -0
- package/dashboard-assistant-ui.js +438 -0
- package/dashboard-icon.d.ts +1 -0
- package/dashboard-icon.js +5 -0
- package/dashboard-markdown.d.ts +2 -0
- package/dashboard-markdown.js +157 -0
- package/dashboard-settings-ui.d.ts +1 -0
- package/dashboard-settings-ui.js +78 -0
- package/dashboard.d.ts +227 -7
- package/dashboard.js +2313 -247
- package/ddl.d.ts +51 -12
- package/ddl.js +2566 -54
- package/event-feed.d.ts +30 -4
- package/event-feed.js +171 -19
- package/index.d.ts +15 -4
- package/index.js +8 -2
- package/maintenance.d.ts +10 -0
- package/maintenance.js +16 -2
- package/metrics.d.ts +41 -0
- package/metrics.js +22 -0
- package/openapi.json +14675 -5957
- package/otel.d.ts +86 -0
- package/otel.js +273 -0
- package/overage.d.ts +33 -0
- package/overage.js +115 -0
- package/package.json +1 -1
- package/partner-billing.d.ts +81 -0
- package/partner-billing.js +333 -0
- package/partner-names.d.ts +8 -0
- package/partner-names.js +10 -0
- package/partners.d.ts +147 -0
- package/partners.js +375 -0
- package/plans.d.ts +92 -0
- package/plans.js +115 -0
- package/quotas.d.ts +108 -0
- package/quotas.js +258 -0
- package/rate-limit.d.ts +21 -1
- package/rate-limit.js +82 -15
- package/resource-profile.d.ts +135 -0
- package/resource-profile.js +263 -0
- package/rest-api.d.ts +2 -0
- package/rest-api.js +68 -3
- package/sandbox.d.ts +70 -0
- package/sandbox.js +295 -0
- package/self-host.d.ts +33 -5
- package/self-host.js +950 -22
- package/slotlock.manifest.json +1 -1
- package/store.d.ts +373 -4
- package/store.js +1212 -118
- package/teams.d.ts +25 -0
- package/teams.js +63 -0
- package/timezone.js +13 -1
- package/types.d.ts +95 -1
- package/usage.d.ts +106 -0
- package/usage.js +238 -0
package/agent-store-backend.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Sql } from 'postgres';
|
|
2
2
|
import type { SlotlockAgentChangeSource } from './change-watch.js';
|
|
3
|
+
import { type SlotlockChangeOrigin } from './event-feed.js';
|
|
3
4
|
import { type SlotlockAgentCalendarBackend, type SlotlockAgentInvocationContext } from './agent-server.js';
|
|
4
5
|
import type { SlotlockApplicationBackend } from './application-api.js';
|
|
5
6
|
import { type SlotlockStore } from './store.js';
|
|
6
|
-
import type { SlotlockCalendarEvent, SlotlockResource, WeeklyAvailabilityRule } from './types.js';
|
|
7
|
+
import type { SlotlockApproval, SlotlockCalendarEvent, SlotlockResource, WeeklyAvailabilityRule } from './types.js';
|
|
8
|
+
import { type SlotlockPartnerStore } from './partners.js';
|
|
7
9
|
export interface SlotlockStoreAgentBackendOptions {
|
|
8
10
|
/**
|
|
9
11
|
* The default bookable hours, for resources without hours of their own
|
|
@@ -13,6 +15,12 @@ export interface SlotlockStoreAgentBackendOptions {
|
|
|
13
15
|
/** Provider sources that must prove complete coverage before availability is called certain. */
|
|
14
16
|
requiredCoverageSources?(context: SlotlockAgentInvocationContext, resource: SlotlockResource): Promise<readonly string[]>;
|
|
15
17
|
coverageMaxAgeMs?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The longest an approval policy may hold a write for a person (RFC 0004 A4), in minutes: each
|
|
20
|
+
* policy sets its own wait, bounded by the booking's start less its lead time and by this. 1 to
|
|
21
|
+
* 43,200 (30 days, the default).
|
|
22
|
+
*/
|
|
23
|
+
maxApprovalMinutes?: number;
|
|
16
24
|
}
|
|
17
25
|
/**
|
|
18
26
|
* A stored calendar event in the shape the event tools return. Exported for an application that
|
|
@@ -47,7 +55,32 @@ export interface SlotlockStoreApplicationBackendOptions {
|
|
|
47
55
|
* undone, and an operator may owe a tenant's data a retention or review first.
|
|
48
56
|
*/
|
|
49
57
|
tenantErasure?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The partner API (RFC 0003 P3): the partner store (partners.ts) its operations run through, for
|
|
60
|
+
* the partner a partner key names. Unset: they answer 404 partner_api_not_served.
|
|
61
|
+
*/
|
|
62
|
+
partners?: SlotlockPartnerStore;
|
|
63
|
+
/**
|
|
64
|
+
* The agent backend (`createSlotlockStoreAgentBackend`) a granted approval's booking is made
|
|
65
|
+
* through (RFC 0004 A4), as the agent that asked. Unset: a grant answers 409
|
|
66
|
+
* approvals_unavailable; declining still works.
|
|
67
|
+
*/
|
|
68
|
+
agentBackend?: SlotlockAgentCalendarBackend;
|
|
50
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Run a granted approval's write as the agent that asked for it, in one transaction with the grant:
|
|
72
|
+
* its holds give way, the write is made, and the approval is marked granted.
|
|
73
|
+
*/
|
|
74
|
+
export declare function runSlotlockApprovalGrant(agentBackend: SlotlockAgentCalendarBackend, approval: SlotlockApproval & {
|
|
75
|
+
requester: Record<string, unknown>;
|
|
76
|
+
}, grant: {
|
|
77
|
+
tenantRef: string;
|
|
78
|
+
decidedBy: string;
|
|
79
|
+
signal: AbortSignal;
|
|
80
|
+
origin?: SlotlockChangeOrigin;
|
|
81
|
+
/** Make the booking and the grant, then roll both back (RFC 0004 A3). */
|
|
82
|
+
dryRun?: boolean;
|
|
83
|
+
}): Promise<Record<string, unknown>>;
|
|
51
84
|
/**
|
|
52
85
|
* Serve the application API (application-api.ts) from the store in the principal's tenant. Every
|
|
53
86
|
* resource named must be the tenant's, or it is not found; holds are under the tenant's RLS, so
|