@substrat-run/adapter-cloudflare 0.159.0 → 0.160.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/control-plane-do.d.ts +91 -24
- package/dist/control-plane-do.d.ts.map +1 -1
- package/dist/control-plane-do.js +223 -87
- package/dist/control-plane-do.js.map +1 -1
- package/dist/host.d.ts +818 -6
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +336 -103
- package/dist/host.js.map +1 -1
- package/dist/platform-sweeper-do.d.ts +3 -2
- package/dist/platform-sweeper-do.d.ts.map +1 -1
- package/dist/platform-sweeper-do.js +3 -2
- package/dist/platform-sweeper-do.js.map +1 -1
- package/dist/r2.d.ts +7 -1
- package/dist/r2.d.ts.map +1 -1
- package/dist/r2.js +20 -2
- package/dist/r2.js.map +1 -1
- package/dist/scope-do.d.ts.map +1 -1
- package/dist/scope-do.js +130 -40
- package/dist/scope-do.js.map +1 -1
- package/dist/scope-sweeper-do.d.ts +4 -2
- package/dist/scope-sweeper-do.d.ts.map +1 -1
- package/dist/scope-sweeper-do.js +7 -1
- package/dist/scope-sweeper-do.js.map +1 -1
- package/package.json +9 -9
package/dist/host.d.ts
CHANGED
|
@@ -1,12 +1,734 @@
|
|
|
1
1
|
import type { EntityGrantShape } from '@substrat-run/contracts';
|
|
2
|
-
import
|
|
3
|
-
import { type
|
|
2
|
+
import type { TenantVerdict } from './scope-do.js';
|
|
3
|
+
import { type SystemDoorMoved } from './system-door.js';
|
|
4
|
+
import { type WireFailure, type ExportedBatch, type ExportReadInput, type ImportBatch, type ImportResult, type ImportState, type ManifestImports, type ManifestConnectionLandings, type ImportCursorMoveAt, type ImportCursorMoved, type AttachmentRecord, type UploadLinkView, type BlobStoreHandle, type ImpersonationSession, type ImpersonationSessionId, type ConnectionId, type ModuleId, type SystemSwitchOutcome, type SystemScheduleEntry, type PeerGrantsEntry, type EntityHistoryInput, type EventCauseInput, type EventEffectsInput, type EffectsTree, type InvocationEventsInput, type InvocationEvents, type DeadLettersInput, type DeadLetter, type LifecycleFlowInput, type LifecycleFlowResult, type OperationSeriesInput, type OperationSeriesResult, type CauseChain, type EventFacetInput, type EventFacetResult, type HistoryEntry, type Page, type SweepRunsPayload, type DomainEvent, type EntitlementGrant, type EntityRef, type ProjectedConnectionGrant, type ProjectedConnectionKey, type ProjectedIdentityLink, type PermissionKey, type PlatformActorId, type OnBehalfOf, type BecomeCapabilityInput, type BoundedBecomeMint, type BoundedBecomeRevoke, type BoundedUnbind, type BecomeLinkState, type PrincipalBecomeCapabilityInput, type CapabilityExchange, type CapabilityId, type CapabilityFilter, type CapabilityPage, type CapabilityRecord, type MintedCapability, type PrincipalId, type ResolvedIdentity, type QueryScopeInput, type ReadScopeTableInput, type RoleDefinition, type ScopeDumpInput, type ScopeDumpTable, type ScopeDumpPage, type ScopeLineage, type ScopeId, type PlatformRequestEntry, type PlatformRequestFilter, type PlatformRequestId, type ScopeTable, type DenialFilter, type DenialSummary, type PermissionDenial, type RefusalFilter, type RefusalRecord, type ScopeQueryResult, type ScopeTablePage, type TenantId, type TenantStoreHandle, type Coverage, type PeerCoverage, type PeerSwitchOutcome, type VerticalCaller, type LifecycleDelivery, type ScopeLifecycle, type StoredScopeLifecycle } from '@substrat-run/contracts';
|
|
5
|
+
import { type RedeemedUploadLink, type UploadLinkInspection, type UploadLinkRedeemInput, type CarriedAway, type KeptCopy, type LoadMarker, type AppliedMigration, type BlobStoreProvisionInput, type ScopeAttachments, type AttachmentUploadInput, type OpenedAttachment, type ExecutorDeadLetter, type ExecutorDrainReport, type ExecutorHandler, type ExecutorRetryPolicy, type MigrateScopeOutcome, type MigrationFrontier, type ConnectorHandler, type ConnectorOptions, type FetchLike, type SecretBox, type HostAdmin, type ModuleRegistration, type OperationHandler, type PermissionChecker, type ProvisionScopeInput, type ScheduleRegistration, type ScheduleRunReport, type ScheduleTick, type ScheduleStateKind, type ScopeHost, type ScopeStub, type ScopeStubOptions, type InvokeOptions, type TenantRelationalStore, type TenantStoreProvisionInput, type FreshnessRegistration, type FreshnessReport, type AttachmentExtractor, type AttachmentTextBackfillBatch, type AttachmentTextBounds, type ExtractionOutcome, type JobDriveReport, type JobDueKey, type JobHandler, type JobRun, type JobRunClaim, type JobRunFilter, type JobRunPatch, type JobRunRow, type JobStepRow, type StartJobRunInput, type LiveReadSurface, type SubjectRedactionCounts, type LegacySubjectRedactionCounts, type PlatformRequestRawRow, type UndrainedEvents, type UndrainedRead, type SwitchOutcome, type SwitchedOff, type RecordedOffCarry, type SwitchCarryWire, type SystemScheduleState, type PeerGrantsRow, type SystemGrantsEntry, type ConnectorCallRecorder, type ScopeRoleHolder, type DumpTable, type RoleState, type DeclaredPermissions, type PurgePass } from '@substrat-run/kernel';
|
|
4
6
|
import { type OrphanSweepReport, type OrphanSweepRequest } from '@substrat-run/kernel';
|
|
5
7
|
import { type CopyRestoreFence } from '@substrat-run/kernel';
|
|
6
8
|
import { type ScopeStoreHostOptions, type ScopeStoreStubOptions, type StoreErasureReplay, type StoreStub } from '@substrat-run/kernel';
|
|
7
|
-
import type { PlatformRequestSettle } from '@substrat-run/kernel';
|
|
9
|
+
import type { PlatformRequestSettle, ShapeCursor } from '@substrat-run/kernel';
|
|
8
10
|
import { type D1TenantStores } from './d1.js';
|
|
9
11
|
import { type R2BlobStores } from './r2.js';
|
|
12
|
+
import { type DoReply } from './do-reply.js';
|
|
13
|
+
interface ScopeStubRpc {
|
|
14
|
+
/** The applied-migration count if this call applied any, else null (nothing changed). */
|
|
15
|
+
migrate(): Promise<number | null>;
|
|
16
|
+
/**
|
|
17
|
+
* A FRESH attempt of whatever is pending — clears the DO's memoised migration
|
|
18
|
+
* promise first, so a warm instance's cached rejection is defeated (#49).
|
|
19
|
+
* Same return contract as `migrate()`.
|
|
20
|
+
*/
|
|
21
|
+
retryMigrations(): Promise<number | null>;
|
|
22
|
+
/** Whether the scope is classified a copy (#2005, #2009): what a CP-less coordinator reads for primacy. */
|
|
23
|
+
isCopy(): Promise<boolean>;
|
|
24
|
+
/** Mark the scope a copy (#2005); whether this call stamped it. */
|
|
25
|
+
markCopy(): Promise<boolean>;
|
|
26
|
+
/** The lifecycle the platform last delivered to this scope (#1713), or null for none. */
|
|
27
|
+
lifecycle(): Promise<StoredScopeLifecycle | null>;
|
|
28
|
+
/** #2016: how `tenantId` reads against the scope's record, and its lifecycle — one door's read. */
|
|
29
|
+
admission(tenantId: TenantId): Promise<{
|
|
30
|
+
verdict: TenantVerdict;
|
|
31
|
+
lifecycle: StoredScopeLifecycle | null;
|
|
32
|
+
}>;
|
|
33
|
+
/** Store a delivered lifecycle unless a newer one is held (#1713, `writeLifecycle`); #2016: a
|
|
34
|
+
* scope `tenantId` is foreign to refuses it, a legacy one records its receipt. */
|
|
35
|
+
setLifecycle(next: ScopeLifecycle, tenantId?: TenantId): Promise<LifecycleDelivery | {
|
|
36
|
+
refused: 'tenant';
|
|
37
|
+
message: string;
|
|
38
|
+
}>;
|
|
39
|
+
/** Clear a mistaken copy classification (#2005); a load's copied-events mark is kept (#2009). */
|
|
40
|
+
clearCopyMark(expect?: LoadMarker): Promise<'cleared' | 'absent' | 'changed'>;
|
|
41
|
+
/**
|
|
42
|
+
* The executor's due events, decoded per row (#1636): a row that will not decode is in
|
|
43
|
+
* `undecodable`, for the coordinator to dead-letter, and never in `events`.
|
|
44
|
+
*/
|
|
45
|
+
pendingExecutorDeliveries(deliveryId: string, eventType: string): Promise<{
|
|
46
|
+
events: DomainEvent[];
|
|
47
|
+
undecodable: {
|
|
48
|
+
eventId: string;
|
|
49
|
+
error: string;
|
|
50
|
+
}[];
|
|
51
|
+
}>;
|
|
52
|
+
recordExecutorAttempt(eventId: string, deliveryId: string, error: string | null, nextAttemptAt: string | null,
|
|
53
|
+
/**
|
|
54
|
+
* #1525: the call THIS attempt ran in, or null. LAST, like every argument added
|
|
55
|
+
* to an RPC on this interface (see `recordScheduleRun` below for what a leading
|
|
56
|
+
* one costs). Defaulted in the DO, so an old coordinator that sends none records
|
|
57
|
+
* null — the honest value, since that coordinator knew of no call.
|
|
58
|
+
*/
|
|
59
|
+
invocationId?: string | null): Promise<number>;
|
|
60
|
+
executorAttempts(eventId: string, deliveryId: string): Promise<number>;
|
|
61
|
+
executorDeadLetters(): Promise<ExecutorDeadLetter[]>;
|
|
62
|
+
pendingPlatformRequests(): Promise<PlatformRequestRawRow[]>;
|
|
63
|
+
/** #618: the intent JOURNAL (every status, newest first), where the read above is pending-only. */
|
|
64
|
+
platformRequestHistory(filter?: PlatformRequestFilter): Promise<PlatformRequestRawRow[]>;
|
|
65
|
+
settlePlatformRequest(id: string, status: 'pending' | 'done' | 'failed', result: string | null, lastError: string | null,
|
|
66
|
+
/** #841 attribution, JSON-encoded. Defaulted in the DO so an older stub still binds. */
|
|
67
|
+
lastFailure?: string | null): Promise<void>;
|
|
68
|
+
/** #2102: a settle that writes an outcome event, in the settle's transaction. */
|
|
69
|
+
settlePlatformRequestWithEvent(tenantId: TenantId, scopeId: ScopeId, id: PlatformRequestId, outcome: PlatformRequestSettle): Promise<void>;
|
|
70
|
+
/** #574 phase 3: enqueue a `connector:<provider>` intent + journal the delivery, atomically. */
|
|
71
|
+
routeExecutorEventToPlatform(eventId: string, deliveryId: string, kind: string, payload: string, requestedBy: string,
|
|
72
|
+
/** #1525: the call this routing ran in, or null. LAST and defaulted, as above. */
|
|
73
|
+
invocationId?: string | null): Promise<PlatformRequestId>;
|
|
74
|
+
/** #1232: a CP-less pass's schedule outcomes as one batched intent. Null = dropped (backpressure). */
|
|
75
|
+
enqueueSweepRuns(payload: string, requestedBy: string): Promise<PlatformRequestId | null>;
|
|
76
|
+
/** The migration that failed on this instance, read on `migrate()`'s reject path. */
|
|
77
|
+
migrationFailure(): Promise<{
|
|
78
|
+
version: string;
|
|
79
|
+
error: string;
|
|
80
|
+
applied: number;
|
|
81
|
+
} | null>;
|
|
82
|
+
invoke(operation: string, input: unknown, principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, connectionId?: string,
|
|
83
|
+
/** The SKU the operation requires (#304) — enforced DO-side for a scope-local scope. */
|
|
84
|
+
requiredEntitlement?: string,
|
|
85
|
+
/** Set when the caller is a MODULE's system principal on a timer (#383). */
|
|
86
|
+
systemModuleId?: string,
|
|
87
|
+
/**
|
|
88
|
+
* #113 phase 3: ask for failures as a value rather than a throw. A ScopeDO still
|
|
89
|
+
* running older code ignores the argument and throws, which the caller handles —
|
|
90
|
+
* so this is safe to deploy in either direction (see `scope-do.ts`).
|
|
91
|
+
*/
|
|
92
|
+
failureEnvelope?: boolean,
|
|
93
|
+
/**
|
|
94
|
+
* #129, #116: the request preconditions to evaluate INSIDE the operation's
|
|
95
|
+
* transaction. A ScopeDO running older code ignores the argument — which is
|
|
96
|
+
* why the reply must say whether it honoured one; see `concurrency` and
|
|
97
|
+
* `idempotency` below.
|
|
98
|
+
*/
|
|
99
|
+
options?: InvokeOptions,
|
|
100
|
+
/**
|
|
101
|
+
* K-42 (#868): the impersonation session, resolved by the coordinator against
|
|
102
|
+
* the directory and passed WHOLE. The DO cannot read the directory, and the
|
|
103
|
+
* alternative — sending an id and having the DO trust it — would make a
|
|
104
|
+
* session forgeable by anyone who can call the RPC. An older DO ignores the
|
|
105
|
+
* argument, which is the SAFE direction here: it would run the operation as
|
|
106
|
+
* the impersonated principal with no stamp, and the coordinator refuses that
|
|
107
|
+
* outcome rather than accepting an unrecorded one (see `getImpersonatedScope`).
|
|
108
|
+
*/
|
|
109
|
+
impersonation?: ImpersonationSession,
|
|
110
|
+
/**
|
|
111
|
+
* #1672: the HASH of a capability session token (the plaintext never crosses). The DO
|
|
112
|
+
* resolves it to its capability inside its queue on every call. An older DO ignores the
|
|
113
|
+
* argument and runs the call as the fresh placeholder principal the coordinator sent,
|
|
114
|
+
* who holds nothing — and the coordinator refuses any success without `capability`.
|
|
115
|
+
*/
|
|
116
|
+
capabilitySession?: string,
|
|
117
|
+
/**
|
|
118
|
+
* #1706: the calling PEER vertical, as the platform named it. The DO admits it inside its
|
|
119
|
+
* queue on every call (`admitPeer`). An older DO ignores the argument and runs the call as
|
|
120
|
+
* the fresh placeholder principal the coordinator sent, who holds nothing — and the
|
|
121
|
+
* coordinator refuses any success without `vertical`.
|
|
122
|
+
*/
|
|
123
|
+
verticalCaller?: VerticalCaller,
|
|
124
|
+
/**
|
|
125
|
+
* #1834: the instance the system door's gate read. The DO refuses the call on any other
|
|
126
|
+
* instance (`SYSTEM_DOOR_MOVED`), and acknowledges with `systemDoor`.
|
|
127
|
+
*/
|
|
128
|
+
systemDoorInstance?: string): Promise<{
|
|
129
|
+
result: unknown;
|
|
130
|
+
/** #458: platform intents this invoke enqueued — the coordinator's drain-hint feed. */
|
|
131
|
+
platformRequests: number;
|
|
132
|
+
/** Present iff the operation failed and the DO understood `failureEnvelope`. */
|
|
133
|
+
failure?: WireFailure;
|
|
134
|
+
/**
|
|
135
|
+
* K-42: present iff the DO understood `impersonation` — the acknowledgement the
|
|
136
|
+
* coordinator refuses a success without. Unlike every other argument on this
|
|
137
|
+
* RPC, one an old DO silently drops fails OPEN: the operation would run as the
|
|
138
|
+
* impersonated principal with nothing stamped and no read-only bound.
|
|
139
|
+
*/
|
|
140
|
+
impersonation?: {
|
|
141
|
+
honoured: boolean;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Present iff the DO understood `preconditions` and the operation declares
|
|
145
|
+
* `concurrency` (#129).
|
|
146
|
+
*
|
|
147
|
+
* **Its absence is what makes version skew safe.** Every other argument added
|
|
148
|
+
* to this RPC has been safe to ignore: an old DO that drops `failureEnvelope`
|
|
149
|
+
* throws instead of returning a value, and the coordinator handles a throw. An
|
|
150
|
+
* old DO that drops `ifMatch` would COMMIT THE WRITE and return 200 — the
|
|
151
|
+
* caller's precondition silently unenforced, which is the exact lost update
|
|
152
|
+
* the header was sent to prevent, now with a success telling the client it
|
|
153
|
+
* did not happen.
|
|
154
|
+
*
|
|
155
|
+
* So the DO acknowledges rather than the coordinator assuming, and a
|
|
156
|
+
* coordinator that sent `ifMatch` and got no acknowledgement refuses instead
|
|
157
|
+
* of returning. Fail closed, in the one direction that would otherwise fail
|
|
158
|
+
* open silently.
|
|
159
|
+
*/
|
|
160
|
+
concurrency?: {
|
|
161
|
+
version: string | null;
|
|
162
|
+
ifMatchChecked: boolean;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Present iff the DO understood `idempotencyKey` (#116).
|
|
166
|
+
*
|
|
167
|
+
* Absent for the same reason and with a sharper consequence than
|
|
168
|
+
* `concurrency` above: an old DO that drops the key does not skip a
|
|
169
|
+
* comparison, it RUNS THE OPERATION — a second work order, on the retry the
|
|
170
|
+
* header was sent to make free. So the acknowledgement is what the
|
|
171
|
+
* coordinator refuses on, not something it infers.
|
|
172
|
+
*/
|
|
173
|
+
idempotency?: {
|
|
174
|
+
keyHonoured: boolean;
|
|
175
|
+
replayed: boolean;
|
|
176
|
+
};
|
|
177
|
+
/** #1672: present iff the DO understood `capabilitySession`, on `impersonation`'s reasoning. */
|
|
178
|
+
capability?: {
|
|
179
|
+
honoured: boolean;
|
|
180
|
+
};
|
|
181
|
+
/** #1706: present iff the DO understood `verticalCaller`, on the same reasoning. */
|
|
182
|
+
vertical?: {
|
|
183
|
+
honoured: boolean;
|
|
184
|
+
};
|
|
185
|
+
/** #1834: present iff the DO understood `systemDoorInstance`, on the same reasoning. */
|
|
186
|
+
systemDoor?: {
|
|
187
|
+
honoured: boolean;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* #1834: the pin missed — this instance is not the one the door's gate read — so nothing ran.
|
|
191
|
+
* Set only by the DO's pin check, never from an operation's failure: a handler cannot reach it.
|
|
192
|
+
*/
|
|
193
|
+
systemDoorMoved?: true;
|
|
194
|
+
/** #1705 PR 2: exported-type rows the commit added; absent means none (or an older DO). */
|
|
195
|
+
exported?: number;
|
|
196
|
+
/**
|
|
197
|
+
* #1746: the events the call itself emitted, when `onEmitted` asked. Advisory, so an
|
|
198
|
+
* older DO that drops it is safe: the invocation line reads "not recorded".
|
|
199
|
+
*/
|
|
200
|
+
emitted?: {
|
|
201
|
+
events: {
|
|
202
|
+
type: string;
|
|
203
|
+
entity: string;
|
|
204
|
+
}[];
|
|
205
|
+
total: number;
|
|
206
|
+
};
|
|
207
|
+
}>;
|
|
208
|
+
/** Trade a capability secret for a session or a principal (#1672) — the kernel's
|
|
209
|
+
* `exchangeCapability`, run in this scope's own storage. */
|
|
210
|
+
exchangeCapability(secret: string, tenantId: TenantId, scopeId: ScopeId, mode?: 'act' | 'become'): Promise<CapabilityExchange | null>;
|
|
211
|
+
/** The platform's `become` mint (#1672), serialized in this scope's own storage. */
|
|
212
|
+
mintBecomeCapability(input: BecomeCapabilityInput, actor: PlatformActorId): Promise<MintedCapability>;
|
|
213
|
+
/** The platform's revoke (#1672) — the record as it stood before, or null. */
|
|
214
|
+
revokeCapabilityAsPlatform(id: string, actor: PlatformActorId): Promise<CapabilityRecord | null>;
|
|
215
|
+
/** A principal's bounded `become` mint (#1686) — a member invite's link. */
|
|
216
|
+
mintBecomeCapabilityBoundedFor(tenantId: TenantId, scopeId: ScopeId, caller: PrincipalId, input: PrincipalBecomeCapabilityInput): Promise<BoundedBecomeMint>;
|
|
217
|
+
/** Revoke a `become` a principal minted (#1686); false for any other capability. */
|
|
218
|
+
revokeBecomeCapabilityFor(tenantId: TenantId, scopeId: ScopeId, id: string, by: PrincipalId): Promise<BoundedBecomeRevoke>;
|
|
219
|
+
/** A principal's bounded unbind of a binding shape's record (#1686). */
|
|
220
|
+
unbindEntityHolderBoundedFor(tenantId: TenantId, scopeId: ScopeId, caller: PrincipalId, entity: EntityRef): Promise<BoundedUnbind>;
|
|
221
|
+
/** Where each named `become` link stands (#1686). */
|
|
222
|
+
becomeLinkStatesFor(tenantId: TenantId, scopeId: ScopeId, ids: string[]): Promise<BecomeLinkState[]>;
|
|
223
|
+
/** The operator's read of this scope's capabilities (#1686) — records, never a hash. */
|
|
224
|
+
listCapabilities(filter?: CapabilityFilter): Promise<CapabilityPage>;
|
|
225
|
+
/** #1834: the system door's state read — where a module's schedules stand on this scope
|
|
226
|
+
* (#383, #1666), the kernel's `systemScheduleState` — and the instance that answered it. */
|
|
227
|
+
systemDoorState(moduleId: string): Promise<{
|
|
228
|
+
state: SystemScheduleState;
|
|
229
|
+
instance: string;
|
|
230
|
+
}>;
|
|
231
|
+
/** #2029: the peer door's state read — where one peer stands on this scope (`subjectGrantState`
|
|
232
|
+
* over `vertical:<slug>`, `admitPeer`'s predicate) — and the instance that answered it. */
|
|
233
|
+
peerDoorState(vertical: string): Promise<{
|
|
234
|
+
state: SystemScheduleState;
|
|
235
|
+
instance: string;
|
|
236
|
+
}>;
|
|
237
|
+
/** Move a module's schedule switch on this scope (#1666) — the kernel's
|
|
238
|
+
* `switchSystemSchedules`, as one serialized unit. */
|
|
239
|
+
switchSystemSchedules(moduleId: string, scopeId: string, to: 'on' | 'off', at: string,
|
|
240
|
+
/** #1823: the directory holds a live tenant-level grant for the module. */
|
|
241
|
+
tenantHeld?: boolean,
|
|
242
|
+
/** #2045: the switch call's fence — a move older than the one the scope applied is refused. */
|
|
243
|
+
fence?: string): Promise<SwitchOutcome & {
|
|
244
|
+
instance: string;
|
|
245
|
+
}>;
|
|
246
|
+
/** Move one peer's kill switch on this scope (#1706) — the kernel's `switchPeer`. The
|
|
247
|
+
* instance that applied it rides along (#2029), for the rewind hold's release, as for
|
|
248
|
+
* `switchSystemSchedules`. The host and this object ship in one bundle. */
|
|
249
|
+
switchPeer(vertical: string, scopeId: string, to: 'on' | 'off', at: string,
|
|
250
|
+
/** #2030: the directory holds a live tenant-level grant for the peer. */
|
|
251
|
+
tenantHeld?: boolean,
|
|
252
|
+
/** #2045: as on `switchSystemSchedules`. */
|
|
253
|
+
fence?: string): Promise<SwitchOutcome & {
|
|
254
|
+
instance: string;
|
|
255
|
+
}>;
|
|
256
|
+
/** Does a peer hold each key here now (#1706) — the checker's own `covers`. #2029: pinned to
|
|
257
|
+
* the instance the peer door's gate read; on any other the answer is `SystemDoorMoved`. */
|
|
258
|
+
peerCovers(tenantId: TenantId, scopeId: ScopeId, vertical: string, permissions: PermissionKey[], doorInstance: string): Promise<PeerCoverage[] | SystemDoorMoved>;
|
|
259
|
+
/** `ctx.canAssign`'s bound for a named principal (#1931); `null` for a role the tenant lacks. */
|
|
260
|
+
canAssignFor(tenantId: TenantId, scopeId: ScopeId, principal: PrincipalId, roleKey: string, atTenant?: boolean): Promise<Coverage | null>;
|
|
261
|
+
assignScopeRoleBoundedFor(tenantId: TenantId, scopeId: ScopeId, caller: PrincipalId, assignee: PrincipalId, roleKey: string): Promise<Coverage | null | {
|
|
262
|
+
refused: string;
|
|
263
|
+
}>;
|
|
264
|
+
/** #1150: the scope's role roster, and the two bounded writes over it — see `scope-do.ts`. */
|
|
265
|
+
scopeRoleHoldersFor(scopeId: ScopeId, principal?: PrincipalId): Promise<ScopeRoleHolder[]>;
|
|
266
|
+
changeScopeRoleBoundedFor(tenantId: TenantId, scopeId: ScopeId, caller: PrincipalId, principal: PrincipalId, from: string, to: string): Promise<Coverage | 'not-held' | 'unknown-to' | {
|
|
267
|
+
refused: string;
|
|
268
|
+
}>;
|
|
269
|
+
/** #2430: why a role may not be conferred through a door here, or null — see `scope-do.ts`. */
|
|
270
|
+
reservedRoleRefusalFor(tenantId: TenantId, roleKey: string, door: 'person' | 'platform'): Promise<string | null>;
|
|
271
|
+
/** #2430: the same for `assignScopeRole`, which names no tenant — see `scope-do.ts`. */
|
|
272
|
+
reservedRoleRefusalHere(roleKey: string, door: 'person' | 'platform'): Promise<string | null>;
|
|
273
|
+
/** #2430: why a raw grant of these keys is refused against the scope class's reservations, or null. */
|
|
274
|
+
reservedGrantRefusalFor(permissions: string[]): Promise<string | null>;
|
|
275
|
+
/** #2430: why a reconcile of these declared shapes is refused against the scope class's reservations, or null. */
|
|
276
|
+
reservedShapeRefusalFor(shapes: {
|
|
277
|
+
entityType: string;
|
|
278
|
+
permissions: string[];
|
|
279
|
+
}[]): Promise<string | null>;
|
|
280
|
+
/** #2430: which of these keys the scope class's modules reserve to a system principal. */
|
|
281
|
+
reservedAmong(permissions: string[]): Promise<string[]>;
|
|
282
|
+
/** #2447: what the scope class's modules reserve and declare. */
|
|
283
|
+
reservationHere(): Promise<{
|
|
284
|
+
reserved: string[];
|
|
285
|
+
declared: string[];
|
|
286
|
+
}>;
|
|
287
|
+
/** #2447: the tenant's roles as the scope stores them, and the keys of those seated there. */
|
|
288
|
+
roleStateHere(tenantId: TenantId): Promise<{
|
|
289
|
+
roles: {
|
|
290
|
+
key: string;
|
|
291
|
+
permissions: string[];
|
|
292
|
+
holder?: 'person' | 'system';
|
|
293
|
+
}[];
|
|
294
|
+
seated: string[];
|
|
295
|
+
}>;
|
|
296
|
+
revokeScopeRolesBoundedFor(tenantId: TenantId, scopeId: ScopeId, caller: PrincipalId, principal: PrincipalId): Promise<{
|
|
297
|
+
coverage: Coverage;
|
|
298
|
+
revoked: string[];
|
|
299
|
+
}>;
|
|
300
|
+
/** Every module this scope holds or has held system authority for, and where each
|
|
301
|
+
* stands (#1674) — the kernel's `systemGrantsStatus`, run in the scope's own storage. */
|
|
302
|
+
systemGrantsStatus(): Promise<SystemGrantsEntry[]>;
|
|
303
|
+
/** #1819: the rewind hold, on the `SWITCH_HOLDS_NAME` object only — see `scope-do.ts`. */
|
|
304
|
+
switchHoldToken(): Promise<number>;
|
|
305
|
+
switchHoldClaim(scopeId: string, moduleIds: string[], claimId: string, token: number): Promise<void>;
|
|
306
|
+
switchHoldOn(scopeId: string, moduleId: string, claimIds: string[]): Promise<void>;
|
|
307
|
+
switchHoldJoin(scopeId: string, moduleId: string, claimIds: string[]): Promise<void>;
|
|
308
|
+
switchHoldYoungestMs(scopeId: string, claimId: string): Promise<number | null>;
|
|
309
|
+
switchHoldArm(scopeId: string, claimId: string, doomed: string | null): Promise<void>;
|
|
310
|
+
switchHoldDrop(scopeId: string, claimId: string): Promise<void>;
|
|
311
|
+
switchHoldsAll(): Promise<{
|
|
312
|
+
scopeId: string;
|
|
313
|
+
moduleId: string;
|
|
314
|
+
}[]>;
|
|
315
|
+
switchHoldClaims(scopeId: string): Promise<SwitchHoldClaim[]>;
|
|
316
|
+
switchHoldRelease(scopeId: string, moduleId: string | null, claimIds: string[] | null): Promise<void>;
|
|
317
|
+
/** #1819: which instance is serving this scope, and whether it armed a rewind. */
|
|
318
|
+
rewindProbe(): Promise<{
|
|
319
|
+
instance: string;
|
|
320
|
+
armed: boolean;
|
|
321
|
+
}>;
|
|
322
|
+
/** Where every peer this scope holds or has held grants for stands (#1706) — the kernel's
|
|
323
|
+
* `peerGrantsStatus`, run in the scope's own storage. */
|
|
324
|
+
peerGrantsStatus(): Promise<PeerGrantsRow[]>;
|
|
325
|
+
/** `grantToSystem`'s scope-level write (#1666): `false`, and nothing written, while the
|
|
326
|
+
* module's schedule kill switch is off on this scope. */
|
|
327
|
+
writeSystemGrant(moduleId: string, relation: string, object: string, expiresAt: string | null): Promise<boolean>;
|
|
328
|
+
/** The last time a schedule's operation ran on this scope (#383), or null if never. */
|
|
329
|
+
scheduleLastRun(operation: string): Promise<string | null>;
|
|
330
|
+
/**
|
|
331
|
+
* #119: one pass of a purge schedule — the DO picks what is due by its own clock and the declared
|
|
332
|
+
* horizon, and purges it as the module's system principal. See the DO.
|
|
333
|
+
*/
|
|
334
|
+
runPurgeSweep(operation: string, tenantId: TenantId, scopeId: ScopeId, systemDoorInstance: string,
|
|
335
|
+
/** #2192: the schedule run's id, which every purge in the pass runs under. */
|
|
336
|
+
runInvocationId?: string,
|
|
337
|
+
/**
|
|
338
|
+
* #2517: the platform requests the purge runs before this one in the tick enqueued. LAST and
|
|
339
|
+
* optional for the positional-RPC reason above; a scope without it fails a refused head.
|
|
340
|
+
*/
|
|
341
|
+
earlierPurgeRequests?: number): Promise<PurgePass | SystemDoorMoved>;
|
|
342
|
+
/** #1232: the freshness evaluator's one-round-trip read — evidence + evaluator state per type. */
|
|
343
|
+
freshnessProbe(types: string[]): Promise<Record<string, {
|
|
344
|
+
observedAt: string | null;
|
|
345
|
+
stateAt: string | null;
|
|
346
|
+
stateOutcome: string | null;
|
|
347
|
+
}>>;
|
|
348
|
+
/** Write one `_substrat_schedule_state` row (#383) — `unit` is either a schedule
|
|
349
|
+
* operation (`module/verb`: when it ran, how it ended) or a freshness key
|
|
350
|
+
* (`freshness:<eventType>`: when the verdict was recorded, and what it was).
|
|
351
|
+
* `kind` says which, and is passed rather than read off the key's shape (#1288):
|
|
352
|
+
* an operation may legally be spelled `freshness:…`, and only the caller knows.
|
|
353
|
+
*
|
|
354
|
+
* **LAST, like every argument added to an RPC on this interface**, and for the
|
|
355
|
+
* reason `invoke`'s `concurrency` acknowledgement spells out above: an old DO
|
|
356
|
+
* drops a trailing argument it does not know, but binds a LEADING one positionally
|
|
357
|
+
* — `kind` would land in `unit`, `unit` in `at`, `at` in `status`, and the row
|
|
358
|
+
* written would be three values in the wrong columns with no error anywhere. The
|
|
359
|
+
* schedule's real key is then never written, so its cadence gate finds nothing and
|
|
360
|
+
* the operation runs again on every pass. Appended, an old DO simply records what
|
|
361
|
+
* it always recorded. The reverse skew — a new DO, an old coordinator sending no
|
|
362
|
+
* kind — hits `kind TEXT NOT NULL` and throws, which is the loud half and is left
|
|
363
|
+
* loud deliberately: a default here would be the derived-from-the-key guess #1288
|
|
364
|
+
* exists to remove.
|
|
365
|
+
*
|
|
366
|
+
* `invocationId` (#1525) is appended for the same positional reason and defaulted
|
|
367
|
+
* in the DO, so an old coordinator that sends none records null — honestly, since
|
|
368
|
+
* that coordinator minted no id to send. The coordinator passes one only for a
|
|
369
|
+
* fired or failed schedule; a freshness verdict invokes nothing, so it has none. */
|
|
370
|
+
recordScheduleRun(unit: string, at: string, status: 'ok' | 'failed' | 'skipped', kind: ScheduleStateKind, invocationId?: string | null): Promise<void>;
|
|
371
|
+
jobRunStartOrJoin(moduleId: string, job: string, instance: string, row: JobRunRow): Promise<JobRunRow>;
|
|
372
|
+
jobRunInsert(row: JobRunRow): Promise<void>;
|
|
373
|
+
jobRunsDueKeys(now: string, max: number): Promise<JobDueKey[]>;
|
|
374
|
+
jobRunList(filter: JobRunFilter): Promise<JobRunRow[]>;
|
|
375
|
+
jobRunClaim(id: string, owner: string, leaseMs: number): Promise<JobRunClaim | null>;
|
|
376
|
+
jobRunBegin(id: string, owner: string, marginMs: number): Promise<boolean>;
|
|
377
|
+
jobRunMiss(id: string, owner: string, note: string): Promise<{
|
|
378
|
+
misses: number;
|
|
379
|
+
failed: boolean;
|
|
380
|
+
} | null>;
|
|
381
|
+
jobRunPatch(id: string, patch: JobRunPatch, owner?: string): Promise<boolean>;
|
|
382
|
+
jobCommitPass(id: string, patch: JobRunPatch, owner?: string): Promise<boolean>;
|
|
383
|
+
jobStepBegin(runId: string, step: string, owner: string, leaseMs: number): Promise<{
|
|
384
|
+
held: boolean;
|
|
385
|
+
row: JobStepRow | null;
|
|
386
|
+
}>;
|
|
387
|
+
jobStepRecord(runId: string, step: string, result: string | null, attempts: number, lastError: string | null, at: string, owner?: string, leaseMs?: number): Promise<boolean>;
|
|
388
|
+
/** This scope's live `connection:<id>` grant tuples (#726 gap 1) — the read-back.
|
|
389
|
+
* Unions the scope's own tuples with the projected tenant-level ones, because a
|
|
390
|
+
* scope check consults both (rule 2 inheritance). */
|
|
391
|
+
listConnectionGrants(now: string): Promise<{
|
|
392
|
+
subject: string;
|
|
393
|
+
relation: string;
|
|
394
|
+
expires_at: string | null;
|
|
395
|
+
}[]>;
|
|
396
|
+
/** A declared entity-grant shape's grant: marker plus keys, one unit (#2071). */
|
|
397
|
+
grantEntityShape(principal: PrincipalId, entity: EntityRef, permissions: readonly string[]): Promise<void>;
|
|
398
|
+
/**
|
|
399
|
+
* One bounded pass of the shape reconcile with its events (#2071, retirements #2082), resuming
|
|
400
|
+
* at `after` (#2083). A DO from before the cursor ignores `after`, answers `done` and no `next`.
|
|
401
|
+
*/
|
|
402
|
+
topUpEntityGrantShapes(tenantId: string, scopeId: string, shapes: readonly EntityGrantShape[], limit: number, after: ShapeCursor | null): Promise<{
|
|
403
|
+
toppedUp: number;
|
|
404
|
+
retired: number;
|
|
405
|
+
retirementsLeftOpen?: number;
|
|
406
|
+
next?: ShapeCursor | null;
|
|
407
|
+
done: boolean;
|
|
408
|
+
boundEver?: string[];
|
|
409
|
+
}>;
|
|
410
|
+
/** The EXPLICIT grant: `INSERT OR REPLACE`, so it clears a tombstone. */
|
|
411
|
+
writeTuple(subject: string, relation: string, object: string, expiresAt: string | null): Promise<DoReply<null>>;
|
|
412
|
+
/** Provisioning's write (#1659): creates a missing tuple, never un-revokes one. */
|
|
413
|
+
seatTuple(subject: string, relation: string, object: string, expiresAt: string | null): Promise<void>;
|
|
414
|
+
/** Provisioning's seat as one unit, then the recorded-off modules switched off in it (#1742). */
|
|
415
|
+
seatTuples(tuples: {
|
|
416
|
+
subject: string;
|
|
417
|
+
relation: string;
|
|
418
|
+
object: string;
|
|
419
|
+
expires_at: string | null;
|
|
420
|
+
}[], switchOff?: RecordedOffCarry & {
|
|
421
|
+
scopeId: string;
|
|
422
|
+
at: string;
|
|
423
|
+
}): Promise<SwitchedOff[]>;
|
|
424
|
+
/** Tombstone a scope tuple by exact (subject, relation, object). Idempotent. */
|
|
425
|
+
revokeTuple(subject: string, relation: string, object: string, at: string): Promise<boolean>;
|
|
426
|
+
hasEffectiveRoleGrantFor(tenantId: string, subject: string): Promise<boolean>;
|
|
427
|
+
/** Attachment surface, metadata half (#473) — see the ScopeDO methods of the same names.
|
|
428
|
+
* `connectionId` (#476) gates as a connection instead of `principal` when set. Each answers
|
|
429
|
+
* its refusal as data (#113), so its code survives the hop. */
|
|
430
|
+
attachmentAddReply(record: AttachmentRecord, principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, connectionId?: string): Promise<DoReply<AttachmentRecord>>;
|
|
431
|
+
/** The add's write gate alone (#2516): asked before a streamed body is read, so a refusal costs no
|
|
432
|
+
* object. Writes nothing; a refusal is recorded as the upload's own would be. */
|
|
433
|
+
attachmentCheckWriteReply(entity: EntityRef, principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, connectionId?: string): Promise<DoReply<null>>;
|
|
434
|
+
/** An upload-link redemption's metadata half: the add above, with the link spent in the same
|
|
435
|
+
* transaction. Its own verb so a DO that predates links refuses rather than ignores the secret. */
|
|
436
|
+
attachmentRedeemUploadLinkReply(record: AttachmentRecord, secret: string, tenantId: TenantId, scopeId: ScopeId,
|
|
437
|
+
/** #2315: recorded (as its hash) beside the spend, so a retry carrying it is a replay. */
|
|
438
|
+
idempotencyKey?: string): Promise<DoReply<AttachmentRecord>>;
|
|
439
|
+
/** #2314: the scope side of an orphan-sweep pass — condemn (or, dry, only read) the rowless ids. */
|
|
440
|
+
orphanAttachmentsReply(ids: string[], now: string, tenantId: TenantId, condemn: boolean, vouched?: boolean, expectedVersionId?: string): Promise<DoReply<string[]>>;
|
|
441
|
+
/** #2350: the licence half of a pass — record what a dry run listed, read it, or take ids out of it. */
|
|
442
|
+
orphanSweepLicenceReply(op: 'record' | 'read' | 'consume', ids: string[], now: string, tenantId: TenantId, vouched?: boolean, expectedVersionId?: string): Promise<DoReply<string[]>>;
|
|
443
|
+
/** #2314: the receipt's tenant (or null) and whether any attachment row is held; read without migrating. */
|
|
444
|
+
sweepFenceFacts(): Promise<{
|
|
445
|
+
tenant: string | null;
|
|
446
|
+
holdsAttachments: boolean;
|
|
447
|
+
}>;
|
|
448
|
+
/**
|
|
449
|
+
* Look an upload link up without spending it; `target` is judged before its state. With
|
|
450
|
+
* `idempotencyKey`, a link spent by a redemption that carried it answers `replay` (#2315).
|
|
451
|
+
*/
|
|
452
|
+
uploadLinkInspectReply(secret: string, tenantId: TenantId, scopeId: ScopeId, target?: EntityRef, idempotencyKey?: string): Promise<DoReply<UploadLinkInspection>>;
|
|
453
|
+
attachmentListReply(entity: EntityRef, principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, connectionId?: string): Promise<DoReply<AttachmentRecord[]>>;
|
|
454
|
+
attachmentAuthorizeReply(attachmentId: string, mode: 'read' | 'write', principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, connectionId?: string,
|
|
455
|
+
/** #726 remedy B: admit by ownership of THIS delivery's entity, resolved here. */
|
|
456
|
+
forEventId?: string): Promise<DoReply<AttachmentRecord | null>>;
|
|
457
|
+
/** Read-only attachment gate for a registered module's system principal. */
|
|
458
|
+
systemAttachmentAuthorizeReply(attachmentId: string, moduleId: ModuleId, tenantId: TenantId, scopeId: ScopeId,
|
|
459
|
+
/** #1834: the instance the system door's gate read; on any other it answers `SystemDoorMoved`. */
|
|
460
|
+
systemDoorInstance?: string): Promise<DoReply<AttachmentRecord | null | SystemDoorMoved>>;
|
|
461
|
+
attachmentRemoveReply(attachmentId: string, principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, connectionId?: string): Promise<DoReply<AttachmentRecord | null>>;
|
|
462
|
+
/**
|
|
463
|
+
* #1686: the capability session's reads — `sessionHash` resolved inside the DO's queue.
|
|
464
|
+
* Each answers an envelope whose failure is DATA (`invoke`'s discipline): a throw across
|
|
465
|
+
* this boundary would keep its message and lose its code.
|
|
466
|
+
*/
|
|
467
|
+
capabilityAttachmentList(entity: EntityRef, sessionHash: string, tenantId: TenantId, scopeId: ScopeId): Promise<DoReply<AttachmentRecord[]>>;
|
|
468
|
+
capabilityAttachmentOpen(attachmentId: string, sessionHash: string, tenantId: TenantId, scopeId: ScopeId): Promise<DoReply<AttachmentRecord | null>>;
|
|
469
|
+
/** #1686: always a failure — the refusal of a write through a capability, recorded (K-35). */
|
|
470
|
+
capabilityAttachmentRefuseWrite(sessionHash: string, tenantId: TenantId, scopeId: ScopeId, operation: 'attachments.upload' | 'attachments.remove', target: {
|
|
471
|
+
entityType: string;
|
|
472
|
+
} | {
|
|
473
|
+
attachmentId: string;
|
|
474
|
+
}): Promise<DoReply<never>>;
|
|
475
|
+
/** #1575: extracted-text search as `principal` (or the connection), its failure as data. */
|
|
476
|
+
attachmentSearch(term: string, limit: number, principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, connectionId?: string): Promise<DoReply<AttachmentRecord[]>>;
|
|
477
|
+
/** #1575: the same search through a capability session, as an envelope. */
|
|
478
|
+
capabilityAttachmentSearch(term: string, limit: number, sessionHash: string, tenantId: TenantId, scopeId: ScopeId): Promise<DoReply<AttachmentRecord[]>>;
|
|
479
|
+
/** #1575: the extraction job's record read — no gate, the kernel's own derivation. */
|
|
480
|
+
attachmentTextSource(attachmentId: string): Promise<AttachmentRecord | null>;
|
|
481
|
+
/** #1575: write an extraction outcome; false when the attachment was removed meanwhile. */
|
|
482
|
+
attachmentTextRecord(attachmentId: string, outcome: ExtractionOutcome): Promise<boolean>;
|
|
483
|
+
/** #1575: start the one-shot backfill unless the scope is marked or holds no attachments. */
|
|
484
|
+
attachmentTextBackfillStart(): Promise<void>;
|
|
485
|
+
/** #1575: one backfill batch after `after`, in one transaction. */
|
|
486
|
+
attachmentTextBackfillBatch(after: string | null): Promise<AttachmentTextBackfillBatch>;
|
|
487
|
+
/** Scope-local projection (scope-local-permissions.md): replace the tenant's roles + tuples and flip to local.
|
|
488
|
+
* `entitlements` (#304) rides the same snapshot — preserve-on-undefined, so a role-only re-projection
|
|
489
|
+
* leaves projected entitlements untouched. */
|
|
490
|
+
applyProjection(tenantId: string, roles: {
|
|
491
|
+
role_key: string;
|
|
492
|
+
permissions: string;
|
|
493
|
+
source: string;
|
|
494
|
+
holder?: 'person' | 'system' | null;
|
|
495
|
+
}[], tuples: {
|
|
496
|
+
subject: string;
|
|
497
|
+
relation: string;
|
|
498
|
+
object: string;
|
|
499
|
+
expires_at: string | null;
|
|
500
|
+
revoked_at: string | null;
|
|
501
|
+
}[], entitlements?: {
|
|
502
|
+
entitlement_key: string;
|
|
503
|
+
expires_at: string | null;
|
|
504
|
+
quota: number | null;
|
|
505
|
+
plan: string | null;
|
|
506
|
+
}[],
|
|
507
|
+
/** Scope-level tuples (e.g. the owner grant) seated in the same unit as the flip (#332) —
|
|
508
|
+
* never un-revoked, except a `lockout_reseat` one on a scope with no effective role grant (#1659). */
|
|
509
|
+
scopeTuples?: {
|
|
510
|
+
subject: string;
|
|
511
|
+
relation: string;
|
|
512
|
+
object: string;
|
|
513
|
+
expires_at: string | null;
|
|
514
|
+
lockout_reseat?: boolean;
|
|
515
|
+
}[],
|
|
516
|
+
/** The tenant's identity links (#406) — same preserve-on-undefined convention as entitlements. */
|
|
517
|
+
identities?: {
|
|
518
|
+
provider: string;
|
|
519
|
+
external_id: string;
|
|
520
|
+
principal_id: string;
|
|
521
|
+
scope_id: string | null;
|
|
522
|
+
}[],
|
|
523
|
+
/** Live connections' PUBLIC sealing keys (#687) — same preserve-on-undefined convention. */
|
|
524
|
+
connectionKeys?: {
|
|
525
|
+
connection_id: string;
|
|
526
|
+
provider: string;
|
|
527
|
+
key_id: string;
|
|
528
|
+
public_key: string;
|
|
529
|
+
}[],
|
|
530
|
+
/** The recorded-off modules switched off after the seat, in the same unit (#1742). */
|
|
531
|
+
switchOff?: RecordedOffCarry & {
|
|
532
|
+
scopeId: string;
|
|
533
|
+
at: string;
|
|
534
|
+
}, serviceSubjects?: readonly string[]): Promise<SwitchedOff[]>;
|
|
535
|
+
/** #113: `applyProjection`, its refusal answered as data. */
|
|
536
|
+
applyProjectionReply(...args: Parameters<ScopeStubRpc['applyProjection']>): Promise<DoReply<SwitchedOff[]>>;
|
|
537
|
+
/** Resolve an external identity from this scope's projected links (#406) — the CP-less auth read. */
|
|
538
|
+
resolveProjectedIdentity(tenantId: string, provider: string, externalId: string): Promise<{
|
|
539
|
+
principal: string;
|
|
540
|
+
scopeId: string | null;
|
|
541
|
+
} | undefined>;
|
|
542
|
+
/** Read-only introspection of this scope's DB (§5.4 admin-query RPC). */
|
|
543
|
+
introspectTables(): Promise<ScopeTable[]>;
|
|
544
|
+
introspectTable(table: string, limit: number, offset: number): Promise<ScopeTablePage>;
|
|
545
|
+
/** #113: `introspectTable`, its refusal answered as data. */
|
|
546
|
+
introspectTableReply(table: string, limit: number, offset: number): Promise<DoReply<ScopeTablePage>>;
|
|
547
|
+
/** One read-only SQL statement, gated + rolled back inside the DO (#219). */
|
|
548
|
+
introspectQuery(sql: string): Promise<ScopeQueryResult>;
|
|
549
|
+
/** #113: `introspectQuery`, its refusal answered as data. */
|
|
550
|
+
introspectQueryReply(sql: string): Promise<DoReply<ScopeQueryResult>>;
|
|
551
|
+
/** The K-35 denial log, read back (#867) — raw rows and the bucketed view. */
|
|
552
|
+
listDenials(filter?: DenialFilter): Promise<PermissionDenial[]>;
|
|
553
|
+
summarizeDenials(filter?: DenialFilter): Promise<DenialSummary>;
|
|
554
|
+
/** #1745: the refusal log, read back — refused lifecycle moves, newest first. */
|
|
555
|
+
listRefusals(filter?: RefusalFilter): Promise<RefusalRecord[]>;
|
|
556
|
+
/** Complete logical dump of this scope's DB (preview-and-snapshots.md §3). */
|
|
557
|
+
exportDump(): Promise<ScopeDumpTable[]>;
|
|
558
|
+
/**
|
|
559
|
+
* Load a dump into this (freshly-provisioned) scope — the fork write side.
|
|
560
|
+
* `destScopeId` re-points the dump's scope-level grants at the destination.
|
|
561
|
+
*/
|
|
562
|
+
importDump(tables: ScopeDumpTable[], destScopeId?: ScopeId, opts?: {
|
|
563
|
+
/** The recorded-off modules switched off on `destScopeId` after the replay, in its event (#1742). */
|
|
564
|
+
switchOff?: RecordedOffCarry & {
|
|
565
|
+
at: string;
|
|
566
|
+
};
|
|
567
|
+
/** The scope the dump was captured from (#1869): only its node grants are re-pointed. */
|
|
568
|
+
sourceScopeId?: ScopeId;
|
|
569
|
+
/** The platform exported the dump itself: no fallback (`RepointSource.exact`). */
|
|
570
|
+
exact?: boolean;
|
|
571
|
+
/** #1722: the stamp this load leaves; without one it leaves none. */
|
|
572
|
+
loadStamp?: string;
|
|
573
|
+
/** #2005: the directory says the scope is not primary — mark it a copy. */
|
|
574
|
+
markCopy?: boolean;
|
|
575
|
+
/** #2016: the tenant the platform says the scope belongs to, recorded as its receipt. */
|
|
576
|
+
provisionedFor?: TenantId;
|
|
577
|
+
}): Promise<SwitchedOff[]>;
|
|
578
|
+
/** #1722: what a carry's restore into this store expects to find unchanged. */
|
|
579
|
+
loadMarker(): Promise<LoadMarker>;
|
|
580
|
+
/** #1722: `importDump` with its refusals (`changed` under `expect`, `kept`) answered as values. */
|
|
581
|
+
importDumpChecked(tables: ScopeDumpTable[], destScopeId: ScopeId, opts: {
|
|
582
|
+
switchOff?: RecordedOffCarry & {
|
|
583
|
+
at: string;
|
|
584
|
+
};
|
|
585
|
+
sourceScopeId?: ScopeId;
|
|
586
|
+
exact?: boolean;
|
|
587
|
+
loadStamp?: string;
|
|
588
|
+
expect?: LoadMarker;
|
|
589
|
+
markCopy?: boolean;
|
|
590
|
+
provisionedFor?: TenantId;
|
|
591
|
+
/** #1722: the copy move's lease; `lapsed` once `notAfter` has passed. */
|
|
592
|
+
fence?: CopyRestoreFence;
|
|
593
|
+
}): Promise<{
|
|
594
|
+
refused: 'changed' | 'kept' | 'lapsed';
|
|
595
|
+
} | {
|
|
596
|
+
refused: 'tenant';
|
|
597
|
+
message: string;
|
|
598
|
+
} | {
|
|
599
|
+
refused: false;
|
|
600
|
+
switchedOff: SwitchedOff[];
|
|
601
|
+
}>;
|
|
602
|
+
/** #1722: the kept-copy marker, or null. */
|
|
603
|
+
keptCopy(): Promise<KeptCopy | null>;
|
|
604
|
+
/** #1722: discard a kept copy at the revision the operator acted on. */
|
|
605
|
+
discardKeptCopy(scopeId: ScopeId, revision: string | null, carriedAway: CarriedAway, markCopy?: boolean, loadStamp?: string | null): Promise<{
|
|
606
|
+
discarded: true;
|
|
607
|
+
} | {
|
|
608
|
+
refused: 'changed' | 'not-kept';
|
|
609
|
+
}>;
|
|
610
|
+
/** #1722: `exportDump` and the store's load stamp, read in one call. */
|
|
611
|
+
exportDumpStamped(): Promise<{
|
|
612
|
+
tables: ScopeDumpTable[];
|
|
613
|
+
loadStamp: string | null;
|
|
614
|
+
revision: string | null;
|
|
615
|
+
}>;
|
|
616
|
+
/** #2450: one page of `exportDumpStamped`; the first (`cursor` null) mints the load stamp. */
|
|
617
|
+
exportDumpPage(cursor: string | null, opts?: {
|
|
618
|
+
stamp?: boolean;
|
|
619
|
+
maxBytes?: number;
|
|
620
|
+
}): Promise<DoReply<ScopeDumpPage>>;
|
|
621
|
+
/** #2450: stage one page for `commitStagedDumpChecked`; page 0 starts (and replaces) a stage. */
|
|
622
|
+
stageDumpPage(stageId: string, seq: number, tables: ScopeDumpTable[]): Promise<DoReply<{
|
|
623
|
+
staged: boolean;
|
|
624
|
+
}>>;
|
|
625
|
+
/** #2450: `importDumpChecked`, the rows read from the stage named. */
|
|
626
|
+
commitStagedDumpChecked(stageId: string, destScopeId: ScopeId, opts: Parameters<ScopeStubRpc['importDumpChecked']>[2]): Promise<Awaited<ReturnType<ScopeStubRpc['importDumpChecked']>> & {
|
|
627
|
+
tables?: number;
|
|
628
|
+
}>;
|
|
629
|
+
/** #2450: drop the stage, if it is still this one. */
|
|
630
|
+
discardStagedDump(stageId: string): Promise<{
|
|
631
|
+
discarded: boolean;
|
|
632
|
+
}>;
|
|
633
|
+
/** #1722: wipe a carried copy if nothing was loaded since `expectLoadStamp`; false when refused. */
|
|
634
|
+
wipeCarried(scopeId: ScopeId, expectLoadStamp: string | null, carriedAway: CarriedAway, opts?: {
|
|
635
|
+
expectRevision?: string | null;
|
|
636
|
+
protectIfChanged?: boolean;
|
|
637
|
+
markCopy?: boolean;
|
|
638
|
+
}): Promise<boolean>;
|
|
639
|
+
/** #1722: clear a kept copy's marker where it is the live store, at the revision read. */
|
|
640
|
+
releaseKeptCopy(revision: string | null, markCopy?: boolean, loadStamp?: string | null): Promise<{
|
|
641
|
+
released: true;
|
|
642
|
+
} | {
|
|
643
|
+
refused: 'changed' | 'not-kept';
|
|
644
|
+
}>;
|
|
645
|
+
/** Wipe this scope's storage — the reap half of deleteSnapshot (§9). */
|
|
646
|
+
destroyStorage(): Promise<void>;
|
|
647
|
+
/**
|
|
648
|
+
* Redact the spine payloads keyed to one data subject (#37); returns how many moved,
|
|
649
|
+
* per table. Both spine copies of an event go in this one RPC (#1600) — the outbox row
|
|
650
|
+
* and any platform intent this CP-less host routed the event into.
|
|
651
|
+
*
|
|
652
|
+
* **The `number` arm is version skew, not an alternative contract.** This RPC answered
|
|
653
|
+
* with a bare outbox count until #1600, and an old DO on the other end of a new
|
|
654
|
+
* coordinator still does — the skew this interface's own `recordScheduleRun` note
|
|
655
|
+
* spells out, in the direction a RETURN type can carry it. The caller MUST fail on it
|
|
656
|
+
* rather than read it as a count: an old DO redacts the outbox and leaves the intent
|
|
657
|
+
* journal, which is precisely the defect #1600 exists to close, so treating its reply
|
|
658
|
+
* as `{ events, intents: 0 }` would mint a receipt claiming an erasure that did not
|
|
659
|
+
* happen. Typed as a union rather than cast at the call site so the skew has to be
|
|
660
|
+
* handled to compile.
|
|
661
|
+
*
|
|
662
|
+
* **The `LegacySubjectRedactionCounts` arm is the same skew, one release later
|
|
663
|
+
* (#1632).** A DO from after #1600 answers `{ events, intents }` and never looked at
|
|
664
|
+
* the job-run tables, so it is refused the same way rather than read as `jobRuns: 0`.
|
|
665
|
+
* And one from before the free-text half answers the job-run count without
|
|
666
|
+
* `idempotencyResults` or `intentIds`, and is refused for the same reason.
|
|
667
|
+
*/
|
|
668
|
+
redactSubject(subjectId: string): Promise<SubjectRedactionCounts | LegacySubjectRedactionCounts | number | {
|
|
669
|
+
failure: WireFailure;
|
|
670
|
+
}>;
|
|
671
|
+
/** PITR bookmarks recorded before migration passes (#286), newest first. */
|
|
672
|
+
migrationBookmarks(limit?: number): Promise<{
|
|
673
|
+
bookmark: string;
|
|
674
|
+
takenAt: string;
|
|
675
|
+
pending: string[];
|
|
676
|
+
}[]>;
|
|
677
|
+
appliedMigrations(): Promise<AppliedMigration[]>;
|
|
678
|
+
/** `SqlStorage.databaseSize` of this scope (#1524). */
|
|
679
|
+
databaseSize(): Promise<number>;
|
|
680
|
+
/** What this scope's attachment rows sum to (#2501). */
|
|
681
|
+
attachmentBytes(): Promise<number>;
|
|
682
|
+
entityHistory(input: {
|
|
683
|
+
entityType: string;
|
|
684
|
+
entityId: string;
|
|
685
|
+
limit?: number;
|
|
686
|
+
cursor?: string;
|
|
687
|
+
}): Promise<Page<HistoryEntry>>;
|
|
688
|
+
/** The Tier-2 read, and what it stepped over (#1636) — an object, because it crosses the RPC. */
|
|
689
|
+
undrainedEventsRead(limit: number): Promise<UndrainedRead>;
|
|
690
|
+
markEventsDrained(eventIds: readonly string[], at: string): Promise<number>;
|
|
691
|
+
/** #1705: the producer's release, decided by the DO's own registered exports. */
|
|
692
|
+
/** #2029: `door`, the consumer peer's door — pinned to its gate's instance, or held off. */
|
|
693
|
+
exportedEventsRead(input: ExportReadInput, tenantId: TenantId, scopeId: ScopeId, door: {
|
|
694
|
+
instance: string;
|
|
695
|
+
} | {
|
|
696
|
+
held: true;
|
|
697
|
+
}): Promise<ExportedBatch | SystemDoorMoved>;
|
|
698
|
+
/** #1705: what the DO's modules import, and its watermark per producer. */
|
|
699
|
+
importStateRead(): Promise<ImportState>;
|
|
700
|
+
/** #1705: apply a batch another vertical exported, under the watermark's compare-and-set.
|
|
701
|
+
* #2029: `doorInstance`, the instance the peer door's gate read; on any other the answer is
|
|
702
|
+
* `SystemDoorMoved` and nothing is applied. */
|
|
703
|
+
importApply(batch: ImportBatch, tenantId: TenantId, scopeId: ScopeId, doorInstance: string): Promise<ImportResult | SystemDoorMoved>;
|
|
704
|
+
/** #1705 PR 2: was this scope provisioned here for this tenant — read without migrating. */
|
|
705
|
+
servesTenant(tenantId: TenantId): Promise<boolean>;
|
|
706
|
+
/** #2541: the size, or null when this deployment does not hold the scope — held check and read in one call. */
|
|
707
|
+
databaseSizeIfHeld(): Promise<number | null>;
|
|
708
|
+
/** #2541: the attachment bytes, or null when this deployment does not hold the scope — one call, as the size is. */
|
|
709
|
+
attachmentBytesIfHeld(): Promise<number | null>;
|
|
710
|
+
/** #1705 PR 3: the replay lever, on the scope's queue, in one transaction. */
|
|
711
|
+
importCursorMove(input: ImportCursorMoveAt & {
|
|
712
|
+
now: number;
|
|
713
|
+
}): Promise<ImportCursorMoved>;
|
|
714
|
+
redrainEvents(drainedBefore: string): Promise<number>;
|
|
715
|
+
/** How many rows that reopen WOULD touch, touching none of them (#1545). */
|
|
716
|
+
redrainCount(drainedBefore: string): Promise<number>;
|
|
717
|
+
facetEvents(input: EventFacetInput): Promise<EventFacetResult>;
|
|
718
|
+
eventCause(input: EventCauseInput): Promise<CauseChain>;
|
|
719
|
+
eventEffects(input: EventEffectsInput): Promise<EffectsTree>;
|
|
720
|
+
invocationEvents(input: InvocationEventsInput): Promise<InvocationEvents>;
|
|
721
|
+
deadLetters(input: DeadLettersInput): Promise<Page<DeadLetter>>;
|
|
722
|
+
lifecycleFlow(input: LifecycleFlowInput): Promise<LifecycleFlowResult>;
|
|
723
|
+
operationSeries(input: OperationSeriesInput): Promise<OperationSeriesResult>;
|
|
724
|
+
/** Rewind storage to a bookmark (#286's backout) — completes on the DO's restart. */
|
|
725
|
+
rewindToBookmark(bookmark: string, opts?: {
|
|
726
|
+
force?: boolean;
|
|
727
|
+
}): Promise<{
|
|
728
|
+
rewindingTo: string;
|
|
729
|
+
instance?: string;
|
|
730
|
+
}>;
|
|
731
|
+
}
|
|
10
732
|
/**
|
|
11
733
|
* Where a connector's scope-side effects land when the scope is served by ANOTHER
|
|
12
734
|
* deployment (#574). Set only on the shared control plane's host — its own SCOPE
|
|
@@ -361,6 +1083,12 @@ export interface CloudflareScopeHostOptions {
|
|
|
361
1083
|
* provider can be stood up in memory for tests and dev.
|
|
362
1084
|
*/
|
|
363
1085
|
fetch?: FetchLike;
|
|
1086
|
+
/**
|
|
1087
|
+
* How long a streamed connector response body may go without a byte before it errors (#2518).
|
|
1088
|
+
* Defaults to `STREAM_IDLE_TIMEOUT_MS`. A buffered read stays under the connector's `timeoutMs`.
|
|
1089
|
+
* Here so a test can use a short window.
|
|
1090
|
+
*/
|
|
1091
|
+
streamIdleTimeoutMs?: number;
|
|
364
1092
|
/**
|
|
365
1093
|
* #1691: where each connector call's data point goes, beside the health line
|
|
366
1094
|
* `recordConnectionUse` settles — on the platform, the control plane's Analytics
|
|
@@ -557,6 +1285,12 @@ export declare const SWITCH_HOLD_EXTRA_WAITS = 3;
|
|
|
557
1285
|
* clock, against the releasing host's clock: minutes, not seconds.
|
|
558
1286
|
*/
|
|
559
1287
|
export declare const SWITCH_HOLD_PENDING_MAX_MS: number;
|
|
1288
|
+
/**
|
|
1289
|
+
* Ask the scope's write gate before a streamed body is read (#2516). A scope DO from before the
|
|
1290
|
+
* verb exists cannot answer it, and a missing answer is never a pass: the call fails closed with a
|
|
1291
|
+
* retryable `unavailable` that says to redeploy, rather than skipping the gate and reading the body.
|
|
1292
|
+
*/
|
|
1293
|
+
export declare function askAttachmentWriteGate(stub: Pick<ScopeStubRpc, 'attachmentCheckWriteReply'>, entity: EntityRef, principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, connectionId?: string): Promise<void>;
|
|
560
1294
|
/** #1819: one rewind's claim on one held module, as the hold object stores it. */
|
|
561
1295
|
export interface SwitchHoldClaim {
|
|
562
1296
|
claimId: string;
|
|
@@ -584,6 +1318,8 @@ export declare class CloudflareScopeHost implements ScopeHost {
|
|
|
584
1318
|
private readonly moduleIds;
|
|
585
1319
|
/** #2430: what a registered module declares `holder: 'system'` — `assignRole`'s refusal reads it. */
|
|
586
1320
|
private readonly reservedKeys;
|
|
1321
|
+
/** #2447: every key a registered or listed module declares, marked or not — a role definition reads it. */
|
|
1322
|
+
private readonly declaredKeys;
|
|
587
1323
|
/** #2430: the declared permission surface `registerModule` holds each module to, when given. */
|
|
588
1324
|
private readonly permissions;
|
|
589
1325
|
/**
|
|
@@ -608,6 +1344,7 @@ export declare class CloudflareScopeHost implements ScopeHost {
|
|
|
608
1344
|
/** Executor id → {eventType, handler} (K-22 §4.2). Coordinator-side, not in the DO. */
|
|
609
1345
|
private readonly secretBox;
|
|
610
1346
|
private readonly fetchImpl;
|
|
1347
|
+
private readonly streamIdleMs;
|
|
611
1348
|
private readonly connectorCalls;
|
|
612
1349
|
/** The live D1 client for per-tenant stores (#301); undefined ⇒ refuse loudly. */
|
|
613
1350
|
private readonly tenantStores?;
|
|
@@ -1033,8 +1770,13 @@ export declare class CloudflareScopeHost implements ScopeHost {
|
|
|
1033
1770
|
entityHistoryLocal(scopeId: ScopeId, input: EntityHistoryInput): Promise<Page<HistoryEntry>>;
|
|
1034
1771
|
/** When this host's own scope applied each migration (#1236) — the vertical-host read. */
|
|
1035
1772
|
appliedMigrationsLocal(scopeId: ScopeId): Promise<AppliedMigration[]>;
|
|
1036
|
-
/**
|
|
1773
|
+
/**
|
|
1774
|
+
* This host's own scope's database size in bytes (#1524), the vertical-host read. A scope this
|
|
1775
|
+
* deployment does not hold is refused (#2541), not read as 0.
|
|
1776
|
+
*/
|
|
1037
1777
|
databaseSizeLocal(scopeId: ScopeId): Promise<number>;
|
|
1778
|
+
/** This host's own scope's attachment bytes (#2501), the vertical-host read; refused as the size is. */
|
|
1779
|
+
attachmentSizeLocal(scopeId: ScopeId): Promise<number>;
|
|
1038
1780
|
/**
|
|
1039
1781
|
* Each scope store's size in this deployment (#2207). The control plane already
|
|
1040
1782
|
* audited the ask; this end does not write the access log again.
|
|
@@ -1537,7 +2279,9 @@ export declare class CloudflareScopeHost implements ScopeHost {
|
|
|
1537
2279
|
* grant — see the kernel interface doc.
|
|
1538
2280
|
*/
|
|
1539
2281
|
checkFreshness(moduleId: ModuleId, tenantId: TenantId, scopeId: ScopeId): Promise<FreshnessReport>;
|
|
1540
|
-
runDueSchedules(moduleId: ModuleId, tenantId: TenantId, scopeId: ScopeId
|
|
2282
|
+
runDueSchedules(moduleId: ModuleId, tenantId: TenantId, scopeId: ScopeId,
|
|
2283
|
+
/** #2517: what the sweep tick's earlier calls did to this scope (`ScopeHost.runDueSchedules`). */
|
|
2284
|
+
tick?: ScheduleTick): Promise<ScheduleRunReport>;
|
|
1541
2285
|
/** The stub body, shared by the principal, connection, system and impersonation doors. */
|
|
1542
2286
|
private buildStub;
|
|
1543
2287
|
close(): Promise<void>;
|
|
@@ -1908,6 +2652,65 @@ export declare class CloudflareScopeHost implements ScopeHost {
|
|
|
1908
2652
|
/** #2430: delivered connection grants not seated because they name a reserved key; absent when none. */
|
|
1909
2653
|
skippedConnectionGrants?: SkippedConnectionGrant[];
|
|
1910
2654
|
}>;
|
|
2655
|
+
/**
|
|
2656
|
+
* #2447: what a tenant's role definition is judged with, beyond the stored roles the ControlPlaneDO
|
|
2657
|
+
* reads in its own unit:
|
|
2658
|
+
* - the reservations of this host's modules, joined with the scope class's. Every scope on this
|
|
2659
|
+
* binding is one class, so one of the tenant's scopes answers for all, and the fan-out after
|
|
2660
|
+
* the write projects into exactly those scopes. A tenant with no scope yet is judged by this
|
|
2661
|
+
* host's modules alone (a stated residual: its first scope's projection is not judged again);
|
|
2662
|
+
* - for a `holder: 'system'` definition of a key with no system-held definition stored (none at
|
|
2663
|
+
* all included: a seat can outlive its role's row), whether anyone but a system principal holds a
|
|
2664
|
+
* live scope-level seat in it in one of those scopes (the ControlPlaneDO reads the tenant-level
|
|
2665
|
+
* seats). No scope is asked for seats otherwise.
|
|
2666
|
+
*
|
|
2667
|
+
* Every scope that is not reaped is read, a scope archived straight from `provisioning` included:
|
|
2668
|
+
* the platform's door seats into a provisioning scope, and unarchive brings the seat back. A DO
|
|
2669
|
+
* cannot be asked anything without waking it, and waking one that never ran would create storage it
|
|
2670
|
+
* never had (#1524), so such a scope is read only when its directory row records a migration
|
|
2671
|
+
* (`schema_version` past `'0'`). That is not a mark of instantiation: it counts the module
|
|
2672
|
+
* migrations applied, and is written only when a pass applied one, so a scope of a class with no
|
|
2673
|
+
* module migrations reads `'0'` though it holds a seat. One that records none is not read, and the
|
|
2674
|
+
* definition fails closed where that scope could decide it: `unreadable` names it, and the caller
|
|
2675
|
+
* refuses a definition its seats, or its class's reservations when no other scope gives them, would
|
|
2676
|
+
* decide. So while such a scope is the tenant's only one, every definition is refused until it is
|
|
2677
|
+
* unarchived or reaped. No product path reaches this today: the dashboard is the one Cloudflare
|
|
2678
|
+
* caller of `defineRole`, and its class has migrations.
|
|
2679
|
+
*
|
|
2680
|
+
* A stated residual: this half is read before the ControlPlaneDO's unit, not in it, so a scope-level
|
|
2681
|
+
* seat made in between is not seen. The tenant-level seats and the stored roles are read in the unit.
|
|
2682
|
+
*/
|
|
2683
|
+
private definitionContext;
|
|
2684
|
+
/**
|
|
2685
|
+
* #2447: why `roles` may not be defined on `scopeId`, judged as a set against this host's
|
|
2686
|
+
* reservations joined with the scope class's, or null. A restore asks it before it imports a dump,
|
|
2687
|
+
* which replaces whatever the scope stores now, so what the set is judged against is the DUMP's
|
|
2688
|
+
* roles and seats for `dump.tenantId` (`dumpRoleState`), when the caller has the dump in hand. A
|
|
2689
|
+
* staged restore has not (its pages are already in the scope), so it is judged as a set alone
|
|
2690
|
+
* here, and `projectRolesLocal` judges again after the import, against what the dump brought.
|
|
2691
|
+
*/
|
|
2692
|
+
roleSetRefusalLocal(scopeId: ScopeId, roles: RoleDefinition[], dump?: {
|
|
2693
|
+
tenantId: TenantId;
|
|
2694
|
+
tables: readonly DumpTable[];
|
|
2695
|
+
}): Promise<string | null>;
|
|
2696
|
+
/**
|
|
2697
|
+
* #2446: the roles `scopeId` stores for `tenantId` and the role keys anyone but a system principal
|
|
2698
|
+
* holds a live seat in there: what `refuseReservedRoleSet` judges a reconcile's role set against
|
|
2699
|
+
* (`roleStateHere`), read for a promote to judge the incoming version's set with
|
|
2700
|
+
* (`releaseRoleSetRefusal`) before it moves the scope. Read-only, and names no principal.
|
|
2701
|
+
*/
|
|
2702
|
+
roleStateLocal(tenantId: TenantId, scopeId: ScopeId): Promise<RoleState>;
|
|
2703
|
+
/**
|
|
2704
|
+
* #2447: refuse a role set a CP-less provision or restore defines on `scopeId` for `tenantId`
|
|
2705
|
+
* (`reservedRoleSetRefusal`), against this host's reservations joined with the scope class's,
|
|
2706
|
+
* and the roles the scope stores for the tenant now with their seats there. Answers the reserved
|
|
2707
|
+
* keys it judged with, for the seats the same call makes.
|
|
2708
|
+
*
|
|
2709
|
+
* A stated residual: the scope state is read in one RPC (`roleStateHere`) and written in another
|
|
2710
|
+
* (`applyProjectionReply`), so a seat made between the two is not seen. The window is one call
|
|
2711
|
+
* wide, and a reconcile runs again every pass.
|
|
2712
|
+
*/
|
|
2713
|
+
private refuseReservedRoleSet;
|
|
1911
2714
|
/**
|
|
1912
2715
|
* #2430: the delivered connection grants a provision or reconcile may seat, and those it skips. A
|
|
1913
2716
|
* connection acts for the external provider holding its token, so a grant naming a key reserved
|
|
@@ -1968,7 +2771,15 @@ export declare class CloudflareScopeHost implements ScopeHost {
|
|
|
1968
2771
|
* storage. Idempotent (writeTuple is INSERT OR REPLACE). `roleKey` must be one the scope
|
|
1969
2772
|
* already projected (via `provisionScopeLocal`), or the local checker expands it to nothing.
|
|
1970
2773
|
*/
|
|
1971
|
-
assignScopeRole(scopeId: ScopeId, principal: PrincipalId, roleKey: string
|
|
2774
|
+
assignScopeRole(scopeId: ScopeId, principal: PrincipalId, roleKey: string,
|
|
2775
|
+
/** #2447: `person` when the caller knows it seats a person (the owner hand-over); the platform's door otherwise. */
|
|
2776
|
+
door?: 'person' | 'platform'): Promise<void>;
|
|
2777
|
+
/**
|
|
2778
|
+
* #2447: why `roleKey` may not be seated at scope level through `door`, or null — the question
|
|
2779
|
+
* `assignScopeRole` asks before it writes, for a caller (the owner hand-over) that must ask it
|
|
2780
|
+
* before anything else moves.
|
|
2781
|
+
*/
|
|
2782
|
+
scopeRoleRefusal(scopeId: ScopeId, roleKey: string, door: 'person' | 'platform'): Promise<string | null>;
|
|
1972
2783
|
/**
|
|
1973
2784
|
* Take a scope-level role back — the counterpart `assignScopeRole` went without (#1161).
|
|
1974
2785
|
* A tombstone, exactly as `HostAdmin.unassignRole` writes for a scope-level assignment:
|
|
@@ -2215,4 +3026,5 @@ export declare class CloudflareScopeHost implements ScopeHost {
|
|
|
2215
3026
|
*/
|
|
2216
3027
|
versionConnectionLandings(verticalSlug: string, versionId: string): Promise<ManifestConnectionLandings>;
|
|
2217
3028
|
}
|
|
3029
|
+
export {};
|
|
2218
3030
|
//# sourceMappingURL=host.d.ts.map
|