@camstack/types 1.2.533 → 1.2.534
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 +23 -0
- package/dist/addon/base-addon.d.ts +1 -20
- package/dist/addon/notification-targets.d.ts +34 -9
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/addon-settings.cap.d.ts +0 -41
- package/dist/capabilities/capability-definition.d.ts +26 -2
- package/dist/capabilities/integration-instances.cap.d.ts +22 -7
- package/dist/capabilities/integrations.cap.d.ts +13 -0
- package/dist/capabilities/smtp-provider.cap.d.ts +2 -10
- package/dist/client.js +0 -7
- package/dist/client.mjs +0 -7
- package/dist/generated/addon-api.d.ts +2 -17
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/i18n/camstack-error.d.ts +8 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +206 -70
- package/dist/index.mjs +201 -70
- package/dist/interfaces/addon.d.ts +0 -6
- package/dist/{sleep-CS5Xp1iQ.mjs → sleep-CkinsFFb.mjs} +66 -95
- package/dist/{sleep-ComzlWyT.js → sleep-DhZXJtPH.js} +77 -94
- package/package.json +1 -1
- package/dist/addon/integration-instance-ref.d.ts +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -7,11 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.534] - 2026-11-09
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- A user's writes to their own notification targets are audit-logged
|
|
15
|
+
- A user's own notification targets are now integration instances scoped to the signed-in user; capability methods can declare caller-scoped access
|
|
16
|
+
- Integrations: update accepts enabled only for a fixed builtin (the hub's own switch, which works while its addon is down); any other row is switched through setInstanceEnabled, and a row whose addon did not answer is marked switchUnknown
|
|
17
|
+
- SMTP: the duplicate smtp-provider verify call is removed; test a relay from its instance (Test connection)
|
|
18
|
+
- integrations.delete is back: it deletes an integration from the hub side, so an addon that is installed but not running can still be removed.
|
|
19
|
+
- smtp-provider getStatus adds an optional verified flag (true, false, or absent while the relay has not sent).
|
|
20
|
+
- A provider's refusal of a caller (a user touching a target that is not theirs) answers FORBIDDEN instead of a server error.
|
|
21
|
+
|
|
22
|
+
### Removed
|
|
23
|
+
|
|
24
|
+
- addonSettings.getIntegrationFormSchema, BaseAddon.integrationFormSchema and IntegrationInstanceRef are removed; an instance form is integrationInstances.instanceFormSchema
|
|
25
|
+
|
|
10
26
|
## [1.2.533] - 2026-11-09
|
|
11
27
|
|
|
12
28
|
### Changed
|
|
13
29
|
|
|
14
30
|
- Removed the unused claimAction from the account-sign-in config field.
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
15
33
|
|
|
16
34
|
## [1.2.532] - 2026-11-09
|
|
17
35
|
|
|
@@ -19,6 +37,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
37
|
|
|
20
38
|
- A calendar names the integration-instances record that owns it (calendar-source CalendarInfo.instanceId, passed through the calendars listing)
|
|
21
39
|
- Remote: an infrared source may leave its emitter out (the remote's default one is used), the power mode setting is gone, and the colour keys have one set of roles
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Removed
|
|
44
|
+
|
|
22
45
|
|
|
23
46
|
## [1.2.531] - 2026-11-08
|
|
24
47
|
|
|
@@ -5,7 +5,6 @@ import { type AddonMigration, type AddonMigrationRunOptions, type AddonMigration
|
|
|
5
5
|
import type { MigrationApiV1 } from '../migrations/api/migration-api.v1.js';
|
|
6
6
|
import type { DefinedRecordKind } from '../records/record-kind.js';
|
|
7
7
|
import { type DurableState } from './durable-state.js';
|
|
8
|
-
import type { IntegrationInstanceRef } from './integration-instance-ref.js';
|
|
9
8
|
import { type ScopedSettings, type ScopedSettingsDeclaration, type ScopedSettingsScope } from './scoped-settings.js';
|
|
10
9
|
import { type UnresolvedSecret } from './secret-settings-view.js';
|
|
11
10
|
export interface DeclaredSettingsKeys {
|
|
@@ -294,14 +293,6 @@ export declare abstract class BaseAddon<TConfig extends object = Record<string,
|
|
|
294
293
|
protected scopedSettingsCapabilities(): readonly string[];
|
|
295
294
|
/** Override to provide device-level settings UI schema. */
|
|
296
295
|
protected deviceSettingsSchema(): ConfigUISchema | null;
|
|
297
|
-
/**
|
|
298
|
-
* The form schema of ONE integration instance, or `null` to use the scoped form.
|
|
299
|
-
*
|
|
300
|
-
* Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
|
|
301
|
-
* needs its connection fields, the default integration the addon's own sections. It is the
|
|
302
|
-
* SHAPE of the form only — the values live on the instance record.
|
|
303
|
-
*/
|
|
304
|
-
protected integrationFormSchema(_instance: IntegrationInstanceRef): Promise<ConfigUISchema | null>;
|
|
305
296
|
/**
|
|
306
297
|
* D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
|
|
307
298
|
* provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
|
|
@@ -324,8 +315,7 @@ export declare abstract class BaseAddon<TConfig extends object = Record<string,
|
|
|
324
315
|
protected deviceDefaultsSchema(_cap: string): Promise<ConfigUISchema | null>;
|
|
325
316
|
/**
|
|
326
317
|
* The host's read of the scoped declarations: the schema one capability declares for `scope`,
|
|
327
|
-
* or `null`.
|
|
328
|
-
* host asks this method.
|
|
318
|
+
* or `null`. The hook is protected, the host asks this method.
|
|
329
319
|
*/
|
|
330
320
|
getScopedSettingsSchema(scope: ScopedSettingsScope, cap: string): Promise<ConfigUISchema | null>;
|
|
331
321
|
/**
|
|
@@ -387,13 +377,6 @@ export declare abstract class BaseAddon<TConfig extends object = Record<string,
|
|
|
387
377
|
* its value. `null` when the capability declares nothing for the scope.
|
|
388
378
|
*/
|
|
389
379
|
readScopedValues(scope: ScopedSettingsScope, cap: string, nodeId?: string): Promise<Record<string, unknown> | null>;
|
|
390
|
-
/**
|
|
391
|
-
* What the create wizard and the integration edit page render for one instance: the addon's
|
|
392
|
-
* per-instance schema when it declares one, else its global schema (what they always showed).
|
|
393
|
-
*/
|
|
394
|
-
getIntegrationFormSchema(instance: IntegrationInstanceRef, nodeId?: string): Promise<ConfigUISchemaWithValues | null>;
|
|
395
|
-
/** The form of the scoped schemas this addon declared, hydrated from its store. */
|
|
396
|
-
private scopedForm;
|
|
397
380
|
/**
|
|
398
381
|
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
399
382
|
* every `perNode: true` field carries THAT node's scoped value on its bare
|
|
@@ -464,8 +447,6 @@ export declare abstract class BaseAddon<TConfig extends object = Record<string,
|
|
|
464
447
|
* derived from the previous set. Idempotent.
|
|
465
448
|
*/
|
|
466
449
|
private loadScopedSchemas;
|
|
467
|
-
/** The form of an addon's scoped schemas: their sections, each shown once. */
|
|
468
|
-
private scopedFormSchema;
|
|
469
450
|
/** Every loaded scoped schema of `cap`, or of every loaded capability. */
|
|
470
451
|
private loadedScopedSchemas;
|
|
471
452
|
/**
|
|
@@ -49,9 +49,10 @@ export declare function targetBody(target: Pick<Target, 'id' | 'name' | 'enabled
|
|
|
49
49
|
/** The `Target` a record of a kind is; null when the row is not a target. */
|
|
50
50
|
export declare function targetOfRecord(addonId: string, kind: string, id: string, data: InstanceBody): Target | null;
|
|
51
51
|
/**
|
|
52
|
-
* Where a target that could not be moved still lives (its legacy source).
|
|
53
|
-
* as long as the new records do not hold its id, so a row
|
|
54
|
-
* write of that id moves it (the legacy row is dropped last).
|
|
52
|
+
* Where a target that could not be moved still lives (its legacy source). A store handed one serves
|
|
53
|
+
* such a row as long as the new records do not hold its id, so a row a migration skipped never goes
|
|
54
|
+
* dark, and a write of that id moves it (the legacy row is dropped last). A migration also reads and
|
|
55
|
+
* empties it; the store of an addon whose source holds no rows never takes one.
|
|
55
56
|
*/
|
|
56
57
|
export interface LegacyTargets {
|
|
57
58
|
list(): Promise<readonly OldTargetRow[]>;
|
|
@@ -122,8 +123,23 @@ export interface NotificationTargetInstancesSpec {
|
|
|
122
123
|
export declare function probeToTestResult(probed: ProbeTargetConfigResult): IntegrationTestConnectionResult;
|
|
123
124
|
/** The instance kinds of a notification provider, one per target kind: a part a composition can take. */
|
|
124
125
|
export declare function notificationTargetParts(records: Pick<RecordsAccess, 'kind' | 'owner'>, spec: NotificationTargetInstancesSpec): readonly InstanceKindPart[];
|
|
126
|
+
/** The body key that names the user a PERSONAL target belongs to (the open blob, no schema change). */
|
|
127
|
+
export declare const TARGET_OWNER_KEY = "ownerUserId";
|
|
128
|
+
/**
|
|
129
|
+
* The authorisation of a target as the instance door sees it. An admin (and an in-process caller
|
|
130
|
+
* that holds no session) keeps the admin door: every target, any change. A user sees and changes
|
|
131
|
+
* only the targets whose `ownerUserId` is theirs, and a target with no owner (a global target the
|
|
132
|
+
* operator made) is nobody's. Nothing a client sends moves the owner of a user's target: the
|
|
133
|
+
* server stamps it from the caller.
|
|
134
|
+
*/
|
|
135
|
+
export declare function scopeInstancesToCaller(inner: IIntegrationInstancesProvider, logger: IScopedLogger): IIntegrationInstancesProvider;
|
|
125
136
|
/** The `integration-instances` provider of a notification provider: one kind per target kind. */
|
|
126
137
|
export declare function buildNotificationTargetInstances(records: Pick<RecordsAccess, 'kind' | 'owner'>, spec: NotificationTargetInstancesSpec): IIntegrationInstancesProvider;
|
|
138
|
+
/**
|
|
139
|
+
* The same provider, for a notification provider whose targets belong to users (the notifiers
|
|
140
|
+
* addon): `describe().userScoped`, and every row filtered on the caller.
|
|
141
|
+
*/
|
|
142
|
+
export declare function buildUserScopedNotificationTargetInstances(records: Pick<RecordsAccess, 'kind' | 'owner'>, spec: NotificationTargetInstancesSpec, logger: IScopedLogger): IIntegrationInstancesProvider;
|
|
127
143
|
/** One old row: the record of the single `notification-targets` kind, its secrets resolved. */
|
|
128
144
|
export interface OldTargetRow {
|
|
129
145
|
readonly id: string;
|
|
@@ -146,7 +162,7 @@ export interface TargetRowPorts {
|
|
|
146
162
|
dropNew(kind: string, id: string): Promise<void>;
|
|
147
163
|
/** Drop the old row, last. */
|
|
148
164
|
dropOld(id: string): Promise<void>;
|
|
149
|
-
/** A row left
|
|
165
|
+
/** A row left in the retired kind, with the reason; nothing serves it. */
|
|
150
166
|
skipped(row: {
|
|
151
167
|
readonly id: string;
|
|
152
168
|
readonly kind: string;
|
|
@@ -158,11 +174,14 @@ export declare function secretKeysOf(descriptor: TargetKind): readonly string[];
|
|
|
158
174
|
/**
|
|
159
175
|
* Move every old row to the record of its kind under the SAME id: the config flat beside the name and
|
|
160
176
|
* the switch, each secret written to the keychain by the door and READ BACK before the old row goes.
|
|
161
|
-
* One bad row never aborts the others: a row whose write or read-back fails (or disagrees) is undone
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
177
|
+
* One bad row never aborts the others: a row whose write or read-back fails (or disagrees) is undone
|
|
178
|
+
* and its old row stays where it was, still served by the store through its legacy source. A row of a
|
|
179
|
+
* kind this provider does not serve is left alone the same way (`skipped`, nothing to retry).
|
|
180
|
+
* Idempotent: a row the new kind already holds equal is only dropped from the old kind.
|
|
181
|
+
*
|
|
182
|
+
* A row that FAILED makes the run throw, after every other row was tried: the ledger then records
|
|
183
|
+
* `failed`, not `applied`, and the migration runs again on the next boot until each row has moved.
|
|
184
|
+
* Reporting `done` over a row that merely failed once would leave it in the retired kind for good.
|
|
166
185
|
*/
|
|
167
186
|
export declare function moveTargetRows(ports: TargetRowPorts, secretKeysByKind: (kind: string) => readonly string[]): Promise<MigrationProcedureResult>;
|
|
168
187
|
/** The body of a row of the retired single kind (`{ name, kind, addonId, enabled, config }`, no id). */
|
|
@@ -175,6 +194,12 @@ export declare const OldTargetBodySchema: z.ZodObject<{
|
|
|
175
194
|
}, z.core.$strip>;
|
|
176
195
|
/** The legacy source that is the retired single kind: its valid rows, an invalid one named and left. */
|
|
177
196
|
export declare function legacyTargetsOver(oldKind: RecordKindHandle<z.infer<typeof OldTargetBodySchema>>, logger: IScopedLogger): LegacyTargets;
|
|
197
|
+
/**
|
|
198
|
+
* The retired kind as a lazy legacy source: it is declared on the store's first list (or delete),
|
|
199
|
+
* on every boot, not only while the migration runs, so a row the migration could not move stays
|
|
200
|
+
* visible through `legacy` and readable.
|
|
201
|
+
*/
|
|
202
|
+
export declare function retiredTargetsOver(records: Pick<RecordsAccess, 'declare' | 'kind'>, retired: DefinedRecordKind<typeof OldTargetBodySchema>, logger: IScopedLogger): LegacyTargets;
|
|
178
203
|
/** The ports over the records: the retired kind in, the per-kind records out. */
|
|
179
204
|
export declare function targetRowPortsOver(deps: {
|
|
180
205
|
readonly legacy: LegacyTargets;
|
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-DhZXJtPH.js");
|
|
3
3
|
const require_event_category = require("./event-category-BC4RRerT.js");
|
|
4
4
|
const require_device_type = require("./device-type-BaYa0UGS.js");
|
|
5
5
|
//#region src/generated/cap-input-defaults.ts
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as DEVICE_CHILDREN_BATCH_MAX, $r as RECORD_DELETE_BATCH, A as CAP_ADVANCE_FIELDS, Ai as RecordUniqueViolationError, Ar as resolvedValues, Bn as StoredRecordKindDeclarationSchema, Br as REMOVE_LEAF, Ci as InvalidRecordError, Cn as PEER_BYTES_CHUNK_BYTES, Ct as createDebugEmitter, Di as RecordNotFoundError, Dr as SCOPED_SETTINGS_SCOPES, Ei as RECORDS_ERROR_CODES, En as PEER_BYTES_TICKET_TTL_MS, F as withoutCallerStamp, Fi as UnknownRecordKindError, Fn as RecordFieldPathSchema, G as readNodePin, Gn as collectZodSecretPaths, Gr as recordSecretCollection, H as commandOrigin, Hn as declarationsOf, Hr as mapSecretLeaves, I as customAction, Ii as asRecordsError, In as RecordIndexSchema, J as PipelineRunResultBridge, Ji as emitReadiness, Jr as RECORD_BATCH_MAX, Kn as isZodSecret, Kr as recordSecretRef, L as defineCustomActions, Li as recordsErrorFromMessage, Ln as RecordKindDeclarationSchema, Mi as RevConflictError, Mn as defineEntryKind, N as CAP_STATE_LEAVES, Ni as TransactRefusedError, Nn as entryBody, O as HF_REPO, Oi as RecordSecretUnavailableError, On as CALLER_USERNAME_HEADER, Or as nodeIdOfScopedKey, P as CALLER_STAMPED_CAPABILITIES, Pi as UnindexedFilterError, Pn as EntryDescriptorSchema, Q as deviceOpsCapability, Qr as RECORD_DEFAULT_MAX_DATA_BYTES, R as describeCustomActions, Rn as RecordKindNameSchema, Si as ForeignSecretMarkerError, Sn as shortSecretRefHash, T as isCommand, Ti as PlaintextSecretError, Tn as PEER_BYTES_STALL_MS, U as nodePin, Un as defineRecordKinds, Ur as parseSecretPath, Vn as assertValidDeclaration, Vr as collectSecretLeaves, W as readCommandOrigin, Wr as recordArrayItemPath, X as MIGRATION_API_VERSION, Xr as RECORD_CLASSES, Y as PipelineStepInputSchema, Yr as RECORD_BATCH_MAX_BYTES, Zr as RECORD_DATABASES, _n as clearKnownSecrets, _r as normalizeAddonInitResult, aa as classifySecretWrite, ai as RECORD_SECRET_COLLECTION_PREFIX, ba as findMigrationsBlocked, bi as DeclarationRefusedError, bn as registerKnownSecret, c as asString, ca as isSecretMarker, ci as SECRET_REF_SCHEME, d as parseJsonUnknown, da as toSecretFieldView, di as formatSecretScope, dn as createRecordsAccess, dt as ReadinessRegistry, ei as RECORD_ID_MAX_LENGTH, er as expandCapMethods, et as adminUiCapability, f as hfModelUrl, fi as globalSecretScope, fn as assertTransactScope, fr as readErrorI18n, ft as ReadinessTimeoutError, g as createDeviceProxy, gn as MIN_SCRUBBED_LENGTH, h as isDeviceScopedCap, hi as parseSecretRef, hn as createSecretsAccess, ht as scopeKey, ia as SECRET_CLEAR, ii as RECORD_QUERY_MAX, j as CAP_METHOD_TIMEOUTS_MS, ji as RecordsError, jn as DisposerChain, ki as RecordTooLargeError, kn as DATAPLANE_SECRET_HEADER, kr as resolveDeviceSettings, la as isSecretMarkerLike, li as arrayItemFieldPath, ln as CommandOriginClaimSchema, lr as ErrorI18nPayloadSchema, m as DEVICE_SCOPED_CAPS, mi as normalizeSecretOwner, mn as REVALIDATE_AFTER_MS, mr as BaseAddon, ni as RECORD_MAX_INDEXES, nt as addonPagesSourceCapability, o as asJsonObject, oa as isSecretClear, oi as RECORD_SETTINGS_MAX_ROWS, p as BOOT_RECOVERY_BACKOFF_MS, pi as isSecretRef, pn as resolveSecretViewsIn, q as viewerUiCapability, qi as createEvent, qr as secretArrayPrefixes, r as maskUrlCredentials, ri as RECORD_MAX_INDEX_FIELDS, sa as isSecretFieldView, si as RECORD_SWEEP_INTERVAL_MS, t as sleep, ti as RECORD_MAX_DATA_BYTES, ua as makeSecretMarker, ui as buildSecretRef, un as makeInMemoryRecords, ut as MODEL_FORMATS, v as addonSliceHandleApi, vn as forgetKnownSecret, wi as NoCallerError, wn as PEER_BYTES_MAX_OUTSTANDING, xi as FilterRequiredError, xn as scrubKnownSecrets, y as createEventBusSliceSource, ya as AddonMigrationsBlockedError, yi as BatchTooLargeError, yn as knownSecretCount, zn as RecordRetentionSchema, zr as secretViewsOf } from "./sleep-CkinsFFb.mjs";
|
|
2
2
|
import { t as EventCategory } from "./event-category-78tcBemo.mjs";
|
|
3
3
|
import { i as DeviceType, o as errMsg } from "./device-type-CbDhVwFP.mjs";
|
|
4
4
|
//#region src/generated/cap-input-defaults.ts
|
|
@@ -167,47 +167,6 @@ export declare const addonSettingsCapability: {
|
|
|
167
167
|
}>;
|
|
168
168
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
169
169
|
}, z.core.$strip>, z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
170
|
-
readonly getIntegrationFormSchema: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
171
|
-
addonId: z.ZodString;
|
|
172
|
-
nodeId: z.ZodOptional<z.ZodString>;
|
|
173
|
-
instance: z.ZodObject<{
|
|
174
|
-
integrationId: z.ZodNullable<z.ZodString>;
|
|
175
|
-
mode: z.ZodEnum<{
|
|
176
|
-
account: "account";
|
|
177
|
-
broker: "broker";
|
|
178
|
-
standalone: "standalone";
|
|
179
|
-
}>;
|
|
180
|
-
candidateStableId: z.ZodOptional<z.ZodString>;
|
|
181
|
-
}, z.core.$strip>;
|
|
182
|
-
}, z.core.$strip>, z.ZodNullable<z.ZodObject<{
|
|
183
|
-
tabs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
184
|
-
id: z.ZodString;
|
|
185
|
-
label: z.ZodString;
|
|
186
|
-
icon: z.ZodString;
|
|
187
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
188
|
-
}, z.core.$strip>>>;
|
|
189
|
-
sections: z.ZodArray<z.ZodObject<{
|
|
190
|
-
id: z.ZodString;
|
|
191
|
-
title: z.ZodString;
|
|
192
|
-
titleKey: z.ZodOptional<z.ZodString>;
|
|
193
|
-
description: z.ZodOptional<z.ZodString>;
|
|
194
|
-
descriptionKey: z.ZodOptional<z.ZodString>;
|
|
195
|
-
style: z.ZodOptional<z.ZodEnum<{
|
|
196
|
-
accordion: "accordion";
|
|
197
|
-
card: "card";
|
|
198
|
-
}>>;
|
|
199
|
-
defaultCollapsed: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
-
columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>>;
|
|
201
|
-
tab: z.ZodOptional<z.ZodString>;
|
|
202
|
-
location: z.ZodOptional<z.ZodEnum<{
|
|
203
|
-
hero: "hero";
|
|
204
|
-
settings: "settings";
|
|
205
|
-
"top-tab": "top-tab";
|
|
206
|
-
}>>;
|
|
207
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
208
|
-
fields: z.ZodArray<z.ZodAny>;
|
|
209
|
-
}, z.core.$strip>>;
|
|
210
|
-
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
211
170
|
readonly getDeclaredSettingsKeys: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
212
171
|
addonId: z.ZodString;
|
|
213
172
|
nodeId: z.ZodOptional<z.ZodString>;
|
|
@@ -53,8 +53,15 @@ export interface CapCaller {
|
|
|
53
53
|
* methods with an OBJECT input schema (the injected field needs an
|
|
54
54
|
* object to live on); the runtime builder rejects other shapes at
|
|
55
55
|
* router-build time.
|
|
56
|
+
*
|
|
57
|
+
* `'scoped'` — the method is open to ANY authenticated session and the provider decides per
|
|
58
|
+
* caller (a user sees and changes only their own rows; epic #440). The router injects the same
|
|
59
|
+
* {@link CapCaller} (provider input: `caller?: CapCaller`, absent for an in-process caller that
|
|
60
|
+
* holds no session), and it default-denies: a NON-admin caller is admitted only on a call pinned
|
|
61
|
+
* to ONE addon (`addonId`) whose provider declares itself user-scoped
|
|
62
|
+
* (`isUserScopedProvider`). Every other provider keeps the admin-only door it always had.
|
|
56
63
|
*/
|
|
57
|
-
export type CapabilityMethodCaller = 'required';
|
|
64
|
+
export type CapabilityMethodCaller = 'required' | 'scoped';
|
|
58
65
|
/**
|
|
59
66
|
* Optional semantic role used by the admin UI's unified "Integrations"
|
|
60
67
|
* page to group caps by what kind of external system they integrate
|
|
@@ -1049,9 +1056,15 @@ type ProviderMethodInput<M, TIn extends z.ZodType> = M extends {
|
|
|
1049
1056
|
readonly caller: 'required';
|
|
1050
1057
|
} ? z.infer<TIn> & {
|
|
1051
1058
|
readonly caller: CapCaller;
|
|
1059
|
+
} : M extends {
|
|
1060
|
+
readonly caller: 'scoped';
|
|
1061
|
+
} ? z.infer<TIn> & {
|
|
1062
|
+
readonly caller?: CapCaller;
|
|
1052
1063
|
} : z.infer<TIn>;
|
|
1053
1064
|
/** One provider method's callable shape, subscription arm included. */
|
|
1054
|
-
type ProviderMethodFn<M> = M extends CapabilityMethodSchema<infer TIn, infer TOut> ? M['kind'] extends 'subscription' ? (input: z.infer<TIn>, push: (value: z.infer<TOut>) => void) => (() => void) | void :
|
|
1065
|
+
type ProviderMethodFn<M> = M extends CapabilityMethodSchema<infer TIn, infer TOut> ? M['kind'] extends 'subscription' ? (input: z.infer<TIn>, push: (value: z.infer<TOut>) => void) => (() => void) | void : M extends {
|
|
1066
|
+
readonly caller: 'scoped';
|
|
1067
|
+
} ? Record<string, never> extends ProviderMethodInput<M, TIn> ? (input?: ProviderMethodInput<M, TIn>) => Promise<z.infer<TOut>> : (input: ProviderMethodInput<M, TIn>) => Promise<z.infer<TOut>> : (input: ProviderMethodInput<M, TIn>) => Promise<z.infer<TOut>> : never;
|
|
1055
1068
|
export type InferProvider<T extends CapabilityDefinition> = {
|
|
1056
1069
|
readonly [K in keyof T['methods'] as T['methods'][K] extends {
|
|
1057
1070
|
providerOptional: true;
|
|
@@ -1181,6 +1194,11 @@ export declare function method<TIn extends z.ZodType, TOut extends z.ZodType, TK
|
|
|
1181
1194
|
}): CapabilityMethodSchema<TIn, TOut, TKind> & {
|
|
1182
1195
|
readonly caller: 'required';
|
|
1183
1196
|
};
|
|
1197
|
+
export declare function method<TIn extends z.ZodType, TOut extends z.ZodType, TKind extends CapabilityMethodKind = 'query'>(input: TIn, output: TOut, options: CapabilityMethodOptions<TKind> & {
|
|
1198
|
+
readonly caller: 'scoped';
|
|
1199
|
+
}): CapabilityMethodSchema<TIn, TOut, TKind> & {
|
|
1200
|
+
readonly caller: 'scoped';
|
|
1201
|
+
};
|
|
1184
1202
|
export declare function method<TIn extends z.ZodType, TOut extends z.ZodType, TKind extends CapabilityMethodKind = 'query'>(input: TIn, output: TOut, options?: CapabilityMethodOptions<TKind>): CapabilityMethodSchema<TIn, TOut, TKind>;
|
|
1185
1203
|
/**
|
|
1186
1204
|
* A wrapper/system-only method: served exclusively by the cap's system-level
|
|
@@ -1197,6 +1215,12 @@ export declare function systemMethod<TIn extends z.ZodType, TOut extends z.ZodTy
|
|
|
1197
1215
|
* `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
|
|
1198
1216
|
* for when this is the honest answer and when it is a soft stub.
|
|
1199
1217
|
*/
|
|
1218
|
+
export declare function optionalMethod<TIn extends z.ZodType, TOut extends z.ZodType, TKind extends CapabilityMethodKind = 'query'>(input: TIn, output: TOut, options: CapabilityMethodOptions<TKind> & {
|
|
1219
|
+
readonly caller: 'scoped';
|
|
1220
|
+
}): CapabilityMethodSchema<TIn, TOut, TKind> & {
|
|
1221
|
+
readonly providerOptional: true;
|
|
1222
|
+
readonly caller: 'scoped';
|
|
1223
|
+
};
|
|
1200
1224
|
export declare function optionalMethod<TIn extends z.ZodType, TOut extends z.ZodType, TKind extends CapabilityMethodKind = 'query'>(input: TIn, output: TOut, options?: CapabilityMethodOptions<TKind>): CapabilityMethodSchema<TIn, TOut, TKind> & {
|
|
1201
1225
|
readonly providerOptional: true;
|
|
1202
1226
|
};
|
|
@@ -139,6 +139,7 @@ export declare const IntegrationInstanceDescriptionSchema: z.ZodObject<{
|
|
|
139
139
|
kind: z.ZodOptional<z.ZodString>;
|
|
140
140
|
}, z.core.$strip>;
|
|
141
141
|
}, z.core.$strip>>>;
|
|
142
|
+
userScoped: z.ZodOptional<z.ZodBoolean>;
|
|
142
143
|
}, z.core.$strip>;
|
|
143
144
|
export type IntegrationInstanceDescription = z.infer<typeof IntegrationInstanceDescriptionSchema>;
|
|
144
145
|
export declare const IntegrationInstanceStatusSchema: z.ZodObject<{
|
|
@@ -238,6 +239,7 @@ export declare const integrationInstancesCapability: {
|
|
|
238
239
|
kind: z.ZodOptional<z.ZodString>;
|
|
239
240
|
}, z.core.$strip>;
|
|
240
241
|
}, z.core.$strip>>>;
|
|
242
|
+
userScoped: z.ZodOptional<z.ZodBoolean>;
|
|
241
243
|
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
242
244
|
/** The form; `id: null` is the create form. */
|
|
243
245
|
readonly instanceFormSchema: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
@@ -250,7 +252,7 @@ export declare const integrationInstancesCapability: {
|
|
|
250
252
|
}>>;
|
|
251
253
|
candidateStableId: z.ZodOptional<z.ZodString>;
|
|
252
254
|
}, z.core.$strip>, z.ZodCustom<ConfigUISchema, ConfigUISchema>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
253
|
-
readonly listInstances: import("./capability-definition.js").CapabilityMethodSchema<z.
|
|
255
|
+
readonly listInstances: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$loose>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
254
256
|
id: z.ZodString;
|
|
255
257
|
name: z.ZodString;
|
|
256
258
|
configured: z.ZodBoolean;
|
|
@@ -268,7 +270,9 @@ export declare const integrationInstancesCapability: {
|
|
|
268
270
|
label: z.ZodOptional<z.ZodString>;
|
|
269
271
|
}, z.core.$strip>>;
|
|
270
272
|
lastCheckedAt: z.ZodOptional<z.ZodNumber>;
|
|
271
|
-
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind
|
|
273
|
+
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind> & {
|
|
274
|
+
readonly caller: 'scoped';
|
|
275
|
+
};
|
|
272
276
|
readonly getInstance: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
273
277
|
id: z.ZodString;
|
|
274
278
|
}, z.core.$strip>, z.ZodNullable<z.ZodObject<{
|
|
@@ -289,7 +293,9 @@ export declare const integrationInstancesCapability: {
|
|
|
289
293
|
label: z.ZodOptional<z.ZodString>;
|
|
290
294
|
}, z.core.$strip>>;
|
|
291
295
|
lastCheckedAt: z.ZodOptional<z.ZodNumber>;
|
|
292
|
-
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind
|
|
296
|
+
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind> & {
|
|
297
|
+
readonly caller: 'scoped';
|
|
298
|
+
};
|
|
293
299
|
/**
|
|
294
300
|
* Insert the typed record. With `id` it is stored under that id (a duplicate id is refused);
|
|
295
301
|
* without one the PROVIDER mints it and answers it. `kind` picks one of `describe().kinds`.
|
|
@@ -311,14 +317,18 @@ export declare const integrationInstancesCapability: {
|
|
|
311
317
|
}, z.core.$strip>>;
|
|
312
318
|
}, z.core.$strip>, z.ZodObject<{
|
|
313
319
|
id: z.ZodString;
|
|
314
|
-
}, z.core.$strip>, "mutation"
|
|
320
|
+
}, z.core.$strip>, "mutation"> & {
|
|
321
|
+
readonly caller: 'scoped';
|
|
322
|
+
};
|
|
315
323
|
readonly updateInstance: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
316
324
|
id: z.ZodString;
|
|
317
325
|
name: z.ZodOptional<z.ZodString>;
|
|
318
326
|
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
319
327
|
}, z.core.$strip>, z.ZodObject<{
|
|
320
328
|
ok: z.ZodLiteral<true>;
|
|
321
|
-
}, z.core.$strip>, "mutation"
|
|
329
|
+
}, z.core.$strip>, "mutation"> & {
|
|
330
|
+
readonly caller: 'scoped';
|
|
331
|
+
};
|
|
322
332
|
/**
|
|
323
333
|
* Switch ONE instance on or off, for every role; a missing record is created from the addon's
|
|
324
334
|
* initial body. A row control, not a form field: `updateInstance.values` is the
|
|
@@ -329,7 +339,9 @@ export declare const integrationInstancesCapability: {
|
|
|
329
339
|
enabled: z.ZodBoolean;
|
|
330
340
|
}, z.core.$strip>, z.ZodObject<{
|
|
331
341
|
ok: z.ZodLiteral<true>;
|
|
332
|
-
}, z.core.$strip>, "mutation"
|
|
342
|
+
}, z.core.$strip>, "mutation"> & {
|
|
343
|
+
readonly caller: 'scoped';
|
|
344
|
+
};
|
|
333
345
|
/**
|
|
334
346
|
* Delete the record and its keychain refs together. For an instance that brings devices the hub
|
|
335
347
|
* also removes the integration's devices (their tombstones, D865), the registry row, and emits
|
|
@@ -339,7 +351,9 @@ export declare const integrationInstancesCapability: {
|
|
|
339
351
|
id: z.ZodString;
|
|
340
352
|
}, z.core.$strip>, z.ZodObject<{
|
|
341
353
|
ok: z.ZodLiteral<true>;
|
|
342
|
-
}, z.core.$strip>, "mutation"
|
|
354
|
+
}, z.core.$strip>, "mutation"> & {
|
|
355
|
+
readonly caller: 'scoped';
|
|
356
|
+
};
|
|
343
357
|
readonly testInstance: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
344
358
|
id: z.ZodNullable<z.ZodString>;
|
|
345
359
|
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -358,6 +372,7 @@ export declare const integrationInstancesCapability: {
|
|
|
358
372
|
detail: z.ZodOptional<z.ZodString>;
|
|
359
373
|
}, z.core.$strip>, "mutation"> & {
|
|
360
374
|
readonly providerOptional: true;
|
|
375
|
+
readonly caller: 'scoped';
|
|
361
376
|
};
|
|
362
377
|
};
|
|
363
378
|
};
|
|
@@ -21,6 +21,7 @@ declare const IntegrationWithStateSchema: z.ZodObject<{
|
|
|
21
21
|
addonId: z.ZodString;
|
|
22
22
|
name: z.ZodString;
|
|
23
23
|
enabled: z.ZodBoolean;
|
|
24
|
+
switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
|
|
24
25
|
info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
25
26
|
originStableId: z.ZodOptional<z.ZodString>;
|
|
26
27
|
createdAt: z.ZodNumber;
|
|
@@ -32,6 +33,7 @@ declare const IntegrationLiteSchema: z.ZodObject<{
|
|
|
32
33
|
addonId: z.ZodString;
|
|
33
34
|
name: z.ZodString;
|
|
34
35
|
enabled: z.ZodBoolean;
|
|
36
|
+
switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
|
|
35
37
|
info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
38
|
originStableId: z.ZodOptional<z.ZodString>;
|
|
37
39
|
createdAt: z.ZodNumber;
|
|
@@ -121,6 +123,7 @@ export declare const integrationsCapability: {
|
|
|
121
123
|
addonId: z.ZodString;
|
|
122
124
|
name: z.ZodString;
|
|
123
125
|
enabled: z.ZodBoolean;
|
|
126
|
+
switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
|
|
124
127
|
info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
125
128
|
originStableId: z.ZodOptional<z.ZodString>;
|
|
126
129
|
createdAt: z.ZodNumber;
|
|
@@ -134,6 +137,7 @@ export declare const integrationsCapability: {
|
|
|
134
137
|
addonId: z.ZodString;
|
|
135
138
|
name: z.ZodString;
|
|
136
139
|
enabled: z.ZodBoolean;
|
|
140
|
+
switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
|
|
137
141
|
info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
138
142
|
originStableId: z.ZodOptional<z.ZodString>;
|
|
139
143
|
createdAt: z.ZodNumber;
|
|
@@ -147,6 +151,7 @@ export declare const integrationsCapability: {
|
|
|
147
151
|
addonId: z.ZodString;
|
|
148
152
|
name: z.ZodString;
|
|
149
153
|
enabled: z.ZodBoolean;
|
|
154
|
+
switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
|
|
150
155
|
info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
151
156
|
originStableId: z.ZodOptional<z.ZodString>;
|
|
152
157
|
createdAt: z.ZodNumber;
|
|
@@ -162,11 +167,19 @@ export declare const integrationsCapability: {
|
|
|
162
167
|
addonId: z.ZodString;
|
|
163
168
|
name: z.ZodString;
|
|
164
169
|
enabled: z.ZodBoolean;
|
|
170
|
+
switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
|
|
165
171
|
info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
166
172
|
originStableId: z.ZodOptional<z.ZodString>;
|
|
167
173
|
createdAt: z.ZodNumber;
|
|
168
174
|
updatedAt: z.ZodNumber;
|
|
169
175
|
}, z.core.$strip>, "mutation">;
|
|
176
|
+
/**
|
|
177
|
+
* Delete an integration from the hub side: its devices, its registry row and its record, and
|
|
178
|
+
* announce it. It works while the addon that owns the instance is down (installed but
|
|
179
|
+
* crashed), where `integration-instances.deleteInstance` has no provider to route to; with the
|
|
180
|
+
* provider up the record is removed through it as well. A fixed builtin and an instance a link
|
|
181
|
+
* names are refused first.
|
|
182
|
+
*/
|
|
170
183
|
readonly delete: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
171
184
|
id: z.ZodString;
|
|
172
185
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -18,6 +18,7 @@ declare const SendEmailResultSchema: z.ZodObject<{
|
|
|
18
18
|
}, z.core.$strip>;
|
|
19
19
|
declare const SmtpStatusSchema: z.ZodObject<{
|
|
20
20
|
ready: z.ZodBoolean;
|
|
21
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
21
22
|
host: z.ZodString;
|
|
22
23
|
error: z.ZodOptional<z.ZodString>;
|
|
23
24
|
lastVerifiedAt: z.ZodOptional<z.ZodNumber>;
|
|
@@ -44,20 +45,11 @@ export declare const smtpProviderCapability: {
|
|
|
44
45
|
accepted: z.ZodDefault<z.ZodArray<z.ZodEmail>>;
|
|
45
46
|
rejected: z.ZodDefault<z.ZodArray<z.ZodEmail>>;
|
|
46
47
|
}, z.core.$strip>, "mutation">;
|
|
47
|
-
/** Round-trip ping against the SMTP relay (EHLO + AUTH if configured).
|
|
48
|
-
* Used by the operator's "Test connection" button. */
|
|
49
|
-
readonly verify: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
50
|
-
instanceId: z.ZodOptional<z.ZodString>;
|
|
51
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
-
ready: z.ZodBoolean;
|
|
53
|
-
host: z.ZodString;
|
|
54
|
-
error: z.ZodOptional<z.ZodString>;
|
|
55
|
-
lastVerifiedAt: z.ZodOptional<z.ZodNumber>;
|
|
56
|
-
}, z.core.$strip>, "mutation">;
|
|
57
48
|
readonly getStatus: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
58
49
|
instanceId: z.ZodOptional<z.ZodString>;
|
|
59
50
|
}, z.core.$strip>, z.ZodObject<{
|
|
60
51
|
ready: z.ZodBoolean;
|
|
52
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
61
53
|
host: z.ZodString;
|
|
62
54
|
error: z.ZodOptional<z.ZodString>;
|
|
63
55
|
lastVerifiedAt: z.ZodOptional<z.ZodNumber>;
|
package/dist/client.js
CHANGED
|
@@ -947,12 +947,6 @@ function method(input, output, options) {
|
|
|
947
947
|
timeoutMs: options?.timeoutMs
|
|
948
948
|
};
|
|
949
949
|
}
|
|
950
|
-
/**
|
|
951
|
-
* A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
|
|
952
|
-
* on `InferProvider`. The `providerOptional: true` literal is what
|
|
953
|
-
* `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
|
|
954
|
-
* for when this is the honest answer and when it is a soft stub.
|
|
955
|
-
*/
|
|
956
950
|
function optionalMethod(input, output, options) {
|
|
957
951
|
return {
|
|
958
952
|
...method(input, output, options),
|
|
@@ -29575,7 +29569,6 @@ function createSystemProxy(api) {
|
|
|
29575
29569
|
listScopedSettings: (input) => dispatch("addonSettings", "listScopedSettings", "query", input),
|
|
29576
29570
|
updateScopedSettings: (input) => dispatch("addonSettings", "updateScopedSettings", "mutation", input),
|
|
29577
29571
|
readScopedValues: (input) => dispatch("addonSettings", "readScopedValues", "query", input),
|
|
29578
|
-
getIntegrationFormSchema: (input) => dispatch("addonSettings", "getIntegrationFormSchema", "query", input),
|
|
29579
29572
|
getDeclaredSettingsKeys: (input) => dispatch("addonSettings", "getDeclaredSettingsKeys", "query", input),
|
|
29580
29573
|
unsetStoredSettingsKeys: (input) => dispatch("addonSettings", "unsetStoredSettingsKeys", "mutation", input)
|
|
29581
29574
|
},
|
package/dist/client.mjs
CHANGED
|
@@ -946,12 +946,6 @@ function method(input, output, options) {
|
|
|
946
946
|
timeoutMs: options?.timeoutMs
|
|
947
947
|
};
|
|
948
948
|
}
|
|
949
|
-
/**
|
|
950
|
-
* A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
|
|
951
|
-
* on `InferProvider`. The `providerOptional: true` literal is what
|
|
952
|
-
* `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
|
|
953
|
-
* for when this is the honest answer and when it is a soft stub.
|
|
954
|
-
*/
|
|
955
949
|
function optionalMethod(input, output, options) {
|
|
956
950
|
return {
|
|
957
951
|
...method(input, output, options),
|
|
@@ -29574,7 +29568,6 @@ function createSystemProxy(api) {
|
|
|
29574
29568
|
listScopedSettings: (input) => dispatch("addonSettings", "listScopedSettings", "query", input),
|
|
29575
29569
|
updateScopedSettings: (input) => dispatch("addonSettings", "updateScopedSettings", "mutation", input),
|
|
29576
29570
|
readScopedValues: (input) => dispatch("addonSettings", "readScopedValues", "query", input),
|
|
29577
|
-
getIntegrationFormSchema: (input) => dispatch("addonSettings", "getIntegrationFormSchema", "query", input),
|
|
29578
29571
|
getDeclaredSettingsKeys: (input) => dispatch("addonSettings", "getDeclaredSettingsKeys", "query", input),
|
|
29579
29572
|
unsetStoredSettingsKeys: (input) => dispatch("addonSettings", "unsetStoredSettingsKeys", "mutation", input)
|
|
29580
29573
|
},
|
|
@@ -380,13 +380,6 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
380
380
|
output: z.infer<typeof addonSettingsCapability.methods.readScopedValues.output>;
|
|
381
381
|
meta: object;
|
|
382
382
|
}>;
|
|
383
|
-
getIntegrationFormSchema: TRPCQueryProcedure<{
|
|
384
|
-
input: {
|
|
385
|
-
[x: string]: unknown;
|
|
386
|
-
} & z.input<typeof addonSettingsCapability.methods.getIntegrationFormSchema.input>;
|
|
387
|
-
output: z.infer<typeof addonSettingsCapability.methods.getIntegrationFormSchema.output>;
|
|
388
|
-
meta: object;
|
|
389
|
-
}>;
|
|
390
383
|
getDeclaredSettingsKeys: TRPCQueryProcedure<{
|
|
391
384
|
input: {
|
|
392
385
|
[x: string]: unknown;
|
|
@@ -4358,9 +4351,8 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
4358
4351
|
}>;
|
|
4359
4352
|
listInstances: TRPCQueryProcedure<{
|
|
4360
4353
|
input: {
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
} | undefined;
|
|
4354
|
+
[x: string]: unknown;
|
|
4355
|
+
} & z.input<typeof integrationInstancesCapability.methods.listInstances.input>;
|
|
4364
4356
|
output: z.infer<typeof integrationInstancesCapability.methods.listInstances.output>;
|
|
4365
4357
|
meta: object;
|
|
4366
4358
|
}>;
|
|
@@ -9656,13 +9648,6 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
9656
9648
|
output: z.infer<typeof smtpProviderCapability.methods.sendEmail.output>;
|
|
9657
9649
|
meta: object;
|
|
9658
9650
|
}>;
|
|
9659
|
-
verify: TRPCMutationProcedure<{
|
|
9660
|
-
input: {
|
|
9661
|
-
[x: string]: unknown;
|
|
9662
|
-
} & z.input<typeof smtpProviderCapability.methods.verify.input>;
|
|
9663
|
-
output: z.infer<typeof smtpProviderCapability.methods.verify.output>;
|
|
9664
|
-
meta: object;
|
|
9665
|
-
}>;
|
|
9666
9651
|
getStatus: TRPCQueryProcedure<{
|
|
9667
9652
|
input: {
|
|
9668
9653
|
[x: string]: unknown;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* scope+access check inside `protectedProcedure` (see
|
|
7
7
|
* `server/backend/src/api/trpc/trpc.middleware.ts`).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 1470 method paths across 203 capabilities.
|
|
10
10
|
*/
|
|
11
11
|
import type { MethodRole } from '../auth/viewer-access.js';
|
|
12
12
|
import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
|
|
@@ -76,7 +76,7 @@ export interface SystemProxy {
|
|
|
76
76
|
readonly actionSource: Pick<InferProvider<typeof actionSourceCapability>, 'listActions' | 'runAction' | 'stopAction'>;
|
|
77
77
|
readonly addonPages: Pick<InferProvider<typeof addonPagesCapability>, 'listPages'>;
|
|
78
78
|
readonly addons: Pick<InferProvider<typeof addonsCapability>, 'list' | 'getLogs' | 'listPackages' | 'installPackage' | 'uninstallPackage' | 'listInstallations' | 'reloadPackages' | 'searchAvailable' | 'listUpdates' | 'updatePackage' | 'rollbackPackage' | 'forceRefresh' | 'restartServer' | 'getLastRestart' | 'listFrameworkPackages' | 'listCapabilityProviders' | 'setCapabilityProviderEnabled' | 'getVersions' | 'getPackageDocs' | 'restartAddon' | 'retryLoad' | 'getAutoUpdateSettings' | 'setAutoUpdateSettings' | 'getAddonAutoUpdate' | 'setAddonAutoUpdate' | 'applyAutoUpdateToAll' | 'custom' | 'startJob' | 'getJob' | 'listJobs' | 'cancelJob' | 'onAddonLogs'>;
|
|
79
|
-
readonly addonSettings: Pick<InferProvider<typeof addonSettingsCapability>, 'getScopedSettings' | 'listScopedSettings' | 'updateScopedSettings' | 'readScopedValues' | '
|
|
79
|
+
readonly addonSettings: Pick<InferProvider<typeof addonSettingsCapability>, 'getScopedSettings' | 'listScopedSettings' | 'updateScopedSettings' | 'readScopedValues' | 'getDeclaredSettingsKeys' | 'unsetStoredSettingsKeys'>;
|
|
80
80
|
readonly addonWidgets: Pick<InferProvider<typeof addonWidgetsCapability>, 'listWidgets'>;
|
|
81
81
|
readonly alerts: Pick<InferProvider<typeof alertsCapability>, 'emit' | 'update' | 'list' | 'getUnreadCount' | 'markRead' | 'markAllRead' | 'dismiss'>;
|
|
82
82
|
readonly audioAnalyzer: Pick<InferProvider<typeof audioAnalyzerCapability>, 'analyseChunk' | 'classify' | 'attachDevice' | 'isReady' | 'dispose' | 'reprobeAudioEngine'>;
|
|
@@ -29,3 +29,11 @@ export declare function userError(code: string, params: TranslationParams | unde
|
|
|
29
29
|
* the field so it survives a module boundary (self-contained addons).
|
|
30
30
|
*/
|
|
31
31
|
export declare function readErrorI18n(err: unknown): ErrorI18nPayload | null;
|
|
32
|
+
/**
|
|
33
|
+
* A provider that refuses a caller throws an Error whose message starts with this prefix. The
|
|
34
|
+
* class does not survive the UDS hop to a forked addon, the message does, so the hub's tRPC
|
|
35
|
+
* error formatter answers FORBIDDEN (403) for it instead of a 500.
|
|
36
|
+
*/
|
|
37
|
+
export declare const FORBIDDEN_MESSAGE_PREFIX = "forbidden: ";
|
|
38
|
+
/** `throw forbiddenError('target not owned: tg-1')` */
|
|
39
|
+
export declare function forbiddenError(reason: string): Error;
|