@camstack/types 1.2.52 → 1.2.54
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/capabilities/connection-test.cap.d.ts +103 -0
- package/dist/capabilities/device-manager.cap.d.ts +67 -0
- package/dist/capabilities/index.d.ts +4 -2
- package/dist/capabilities/integrations.cap.d.ts +48 -1
- package/dist/capabilities/oauth-integration.cap.d.ts +59 -0
- package/dist/generated/addon-api.d.ts +44 -0
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +377 -1
- package/dist/index.mjs +368 -2
- package/dist/interfaces/adoption-job.d.ts +113 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -585,6 +585,106 @@ function resolveAddonPlacement(decl) {
|
|
|
585
585
|
return resolveAddonExecution(decl).placement;
|
|
586
586
|
}
|
|
587
587
|
//#endregion
|
|
588
|
+
//#region src/interfaces/adoption-job.ts
|
|
589
|
+
/**
|
|
590
|
+
* Adoption job — the background form of `device-adoption.adopt`.
|
|
591
|
+
*
|
|
592
|
+
* ## Why this exists
|
|
593
|
+
*
|
|
594
|
+
* `adopt({childNativeIds: [...]})` materialises one CamStack device per
|
|
595
|
+
* candidate PLUS every accessory child, and the whole array shares ONE UDS
|
|
596
|
+
* request deadline (60s). Measured on the live hub against Home Assistant:
|
|
597
|
+
* each device the kernel creates costs ~450 ms — `devices.create` pre-seeds
|
|
598
|
+
* meta with up to eleven SEQUENTIAL round trips (`setName`, `setType`,
|
|
599
|
+
* `setRole`, … `persistConfig`) before the class is constructed — and an
|
|
600
|
+
* accessory child costs the same as its parent. So the real unit of work is
|
|
601
|
+
* the CHILD, not the candidate:
|
|
602
|
+
*
|
|
603
|
+
* - 25 candidates averaging 6 children → ~150 devices → **>60s, times out**
|
|
604
|
+
* - ONE candidate with 217 children → ~217 devices → **>60s, times out**
|
|
605
|
+
*
|
|
606
|
+
* That second line is why this is a job and not a smaller batch. No chunking,
|
|
607
|
+
* no bounded concurrency over candidates and no per-call tuning can fix a
|
|
608
|
+
* shape where **N=1 already exceeds the deadline** — the count that blows the
|
|
609
|
+
* budget is the source system's accessory fan-out, which the operator does not
|
|
610
|
+
* choose and cannot see. A design that only works below some N is the same bug
|
|
611
|
+
* deferred.
|
|
612
|
+
*
|
|
613
|
+
* ## What the timeout did NOT do
|
|
614
|
+
*
|
|
615
|
+
* It did not stop the work. The UDS deadline ends the CALLER's wait; the
|
|
616
|
+
* provider's loop runs to completion. Measured: a 25-candidate adopt that
|
|
617
|
+
* "failed" at 60s had adopted 17 by 87s and all 25 by ~130s. The operator saw
|
|
618
|
+
* an error and had no way to learn that. Every field below exists so that
|
|
619
|
+
* question has an answer.
|
|
620
|
+
*
|
|
621
|
+
* ## Idempotency
|
|
622
|
+
*
|
|
623
|
+
* Jobs are in-RAM; a restart forgets them. That is safe here because adoption
|
|
624
|
+
* is keyed by a stable id (`ha:<broker>:dev:<nativeId>` and equivalents), so
|
|
625
|
+
* re-running a job re-adopts nothing: an already-adopted candidate is SKIPPED
|
|
626
|
+
* by the engine before any provider call and lands in `alreadyAdopted`. It is
|
|
627
|
+
* never a duplicate device, and never an error the operator has to interpret.
|
|
628
|
+
*/
|
|
629
|
+
var AdoptionJobStateSchema = zod.z.enum([
|
|
630
|
+
"running",
|
|
631
|
+
"done",
|
|
632
|
+
"failed",
|
|
633
|
+
"cancelled"
|
|
634
|
+
]);
|
|
635
|
+
/**
|
|
636
|
+
* Per-candidate result. Every candidate the job was asked to adopt ends in
|
|
637
|
+
* exactly one of these buckets — there is no silent drop, and the operator can
|
|
638
|
+
* always answer "which of my 25 landed?".
|
|
639
|
+
*
|
|
640
|
+
* - `adopted` — created now by this job.
|
|
641
|
+
* - `already-adopted` — a device for this candidate existed before the job
|
|
642
|
+
* reached it (a re-run, or a retry after a timeout). Not an error.
|
|
643
|
+
* - `failed` — the provider threw; `error` carries the message.
|
|
644
|
+
* - `cancelled` — the operator cancelled before this candidate was reached.
|
|
645
|
+
*/
|
|
646
|
+
var AdoptionOutcomeSchema = zod.z.enum([
|
|
647
|
+
"adopted",
|
|
648
|
+
"already-adopted",
|
|
649
|
+
"failed",
|
|
650
|
+
"cancelled"
|
|
651
|
+
]);
|
|
652
|
+
var AdoptionCandidateResultSchema = zod.z.object({
|
|
653
|
+
childNativeId: zod.z.string(),
|
|
654
|
+
outcome: AdoptionOutcomeSchema,
|
|
655
|
+
/** The materialised parent device id — null for `failed` / `cancelled`. */
|
|
656
|
+
parentDeviceId: zod.z.number().int().nonnegative().nullable(),
|
|
657
|
+
/** Accessory children created for this candidate. */
|
|
658
|
+
accessoryCount: zod.z.number().int().nonnegative(),
|
|
659
|
+
/** Failure message; null unless `outcome === 'failed'`. */
|
|
660
|
+
error: zod.z.string().nullable()
|
|
661
|
+
});
|
|
662
|
+
var AdoptionJobSchema = zod.z.object({
|
|
663
|
+
jobId: zod.z.string(),
|
|
664
|
+
/** The integration provider this job adopts through (the `addonId` pin). */
|
|
665
|
+
addonId: zod.z.string(),
|
|
666
|
+
integrationId: zod.z.string(),
|
|
667
|
+
state: AdoptionJobStateSchema,
|
|
668
|
+
/** Candidates the job was asked to adopt. Known up front, so never null. */
|
|
669
|
+
total: zod.z.number().int().nonnegative(),
|
|
670
|
+
/** Candidates that have reached a terminal bucket. */
|
|
671
|
+
processed: zod.z.number().int().nonnegative(),
|
|
672
|
+
adopted: zod.z.number().int().nonnegative(),
|
|
673
|
+
alreadyAdopted: zod.z.number().int().nonnegative(),
|
|
674
|
+
failed: zod.z.number().int().nonnegative(),
|
|
675
|
+
/** Accessory child devices created across every candidate — the real unit
|
|
676
|
+
* of work, surfaced so a slow job is legible rather than mysterious. */
|
|
677
|
+
accessoriesCreated: zod.z.number().int().nonnegative(),
|
|
678
|
+
/** The candidate currently being adopted; null when idle or finished. */
|
|
679
|
+
currentChildNativeId: zod.z.string().nullable(),
|
|
680
|
+
/** One entry per candidate, in the order they were processed. */
|
|
681
|
+
results: zod.z.array(AdoptionCandidateResultSchema).readonly(),
|
|
682
|
+
startedAt: zod.z.number(),
|
|
683
|
+
finishedAt: zod.z.number().nullable(),
|
|
684
|
+
/** Set only when the job itself broke (not a per-candidate failure). */
|
|
685
|
+
error: zod.z.string().nullable()
|
|
686
|
+
});
|
|
687
|
+
//#endregion
|
|
588
688
|
//#region src/interfaces/analysis-persistence.ts
|
|
589
689
|
var DEFAULT_RETENTION = {
|
|
590
690
|
cleanupIntervalMs: 3600 * 1e3,
|
|
@@ -8706,6 +8806,31 @@ var deviceManagerCapability = {
|
|
|
8706
8806
|
auth: "admin"
|
|
8707
8807
|
}),
|
|
8708
8808
|
/**
|
|
8809
|
+
* Start a background adoption and return its `jobId` immediately. The job
|
|
8810
|
+
* adopts ONE candidate per provider call, so no single request can exceed
|
|
8811
|
+
* the transport deadline, and it skips candidates that are already adopted
|
|
8812
|
+
* — which makes re-submitting a batch after a timeout safe and silent
|
|
8813
|
+
* rather than a wall of duplicate-stableId errors.
|
|
8814
|
+
*/
|
|
8815
|
+
adoptionStartJob: require_sleep.method(AdoptInputSchema.extend({ addonId: zod.z.string() }), zod.z.object({ jobId: zod.z.string() }), {
|
|
8816
|
+
kind: "mutation",
|
|
8817
|
+
auth: "admin"
|
|
8818
|
+
}),
|
|
8819
|
+
/**
|
|
8820
|
+
* Adoption jobs for an integration, newest first. This is the answer to
|
|
8821
|
+
* "which of my 25 landed?" — `results` carries one entry per candidate,
|
|
8822
|
+
* every one of them in a named bucket.
|
|
8823
|
+
*/
|
|
8824
|
+
adoptionListJobs: require_sleep.method(zod.z.object({
|
|
8825
|
+
addonId: zod.z.string(),
|
|
8826
|
+
integrationId: zod.z.string().optional()
|
|
8827
|
+
}), zod.z.array(AdoptionJobSchema).readonly(), { auth: "admin" }),
|
|
8828
|
+
/** Cooperative cancel: the in-flight candidate finishes, the rest never start. */
|
|
8829
|
+
adoptionCancelJob: require_sleep.method(zod.z.object({ jobId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
|
|
8830
|
+
kind: "mutation",
|
|
8831
|
+
auth: "admin"
|
|
8832
|
+
}),
|
|
8833
|
+
/**
|
|
8709
8834
|
* Re-sync a device with its source via the device-adoption provider of the
|
|
8710
8835
|
* device's OWNING addon (resolved from `camDeviceId`). Unlike the singleton
|
|
8711
8836
|
* `device-adoption.resync`, this routes to the correct integration so a
|
|
@@ -12887,6 +13012,65 @@ var ScopedTokenSchema = zod.z.object({
|
|
|
12887
13012
|
* Each provider returns a static descriptor; the core enumerates them
|
|
12888
13013
|
* to validate the `integration=` query param and resolve the consent
|
|
12889
13014
|
* label + the scopes baked into the issued token.
|
|
13015
|
+
*
|
|
13016
|
+
* ## Declaring one
|
|
13017
|
+
*
|
|
13018
|
+
* An OAuth client is integration-specific knowledge — who the client is, what
|
|
13019
|
+
* it may ask for, where it may be sent — so it is declared by the ADDON that
|
|
13020
|
+
* owns the integration, never by the kernel and never as a branch inside
|
|
13021
|
+
* `oauth2-routes.ts` ([D101](../../../../docs/decisions/adr-0101.md)). Three
|
|
13022
|
+
* steps, no others:
|
|
13023
|
+
*
|
|
13024
|
+
* 1. Add `{ "name": "oauth-integration" }` to the addon's `camstack.addons[]`
|
|
13025
|
+
* manifest entry. This is also what tells the hub, at addon-LOAD time, that
|
|
13026
|
+
* a descriptor is owed — see "the boot window" below.
|
|
13027
|
+
* 2. Return a provider from `onInitialize()`:
|
|
13028
|
+
*
|
|
13029
|
+
* ```ts
|
|
13030
|
+
* const provider: IOauthIntegrationProvider = {
|
|
13031
|
+
* getDescriptor: async () => ({
|
|
13032
|
+
* integrationId: 'my-thing', // the `integration=` query param
|
|
13033
|
+
* displayName: 'My Thing',
|
|
13034
|
+
* requestedScopes: [ … ], // see below
|
|
13035
|
+
* allowedRedirectPrefixes: ['https://callback.example/'],
|
|
13036
|
+
* }),
|
|
13037
|
+
* }
|
|
13038
|
+
* return [{ capability: oauthIntegrationCapability, provider }]
|
|
13039
|
+
* ```
|
|
13040
|
+
*
|
|
13041
|
+
* The descriptor must be **static** — it is read on the authorize path, so
|
|
13042
|
+
* never put an await on network or disk behind it, and never register it
|
|
13043
|
+
* behind one either (a provider is registered only once `onInitialize`
|
|
13044
|
+
* RETURNS, so anything awaited before the return delays linking).
|
|
13045
|
+
* 3. Nothing else. There is no allow-list to join, no id to register with the
|
|
13046
|
+
* core, and no per-integration branch anywhere: `/api/oauth2/authorize` and
|
|
13047
|
+
* `/api/oauth2/integrations` are built from this collection alone.
|
|
13048
|
+
*
|
|
13049
|
+
* **Scopes.** `requestedScopes` is baked into every token this integration is
|
|
13050
|
+
* ever issued and the operator consents to it once. Derive it from the tRPC
|
|
13051
|
+
* paths the client calls **with that token**, against `METHOD_ACCESS_MAP`, and
|
|
13052
|
+
* prefer a narrow `capability:` scope to a `category:` one unless the client
|
|
13053
|
+
* genuinely needs a whole family. A category scope grants every future member
|
|
13054
|
+
* of that category too. `category:system [create]` has been rejected once and
|
|
13055
|
+
* should stay rejected: it hands `addons.installPackage` to an integration.
|
|
13056
|
+
*
|
|
13057
|
+
* What it does NOT cover: calls the ADDON makes over `ctx.api`, which run as
|
|
13058
|
+
* the addon and are not scope-checked. Alexa's descriptor is narrower than
|
|
13059
|
+
* Home Assistant's for exactly that reason — its Lambda posts directives and
|
|
13060
|
+
* the addon does the work, while the Home Assistant component calls tRPC
|
|
13061
|
+
* directly with the token. So `requestedScopes` describes the blast radius of
|
|
13062
|
+
* the GRANT, not the reach of the integration; do not widen one to describe the
|
|
13063
|
+
* other.
|
|
13064
|
+
*
|
|
13065
|
+
* **The boot window.** An addon registers its provider after its runner forks
|
|
13066
|
+
* and initialises, so between hub start and that moment this collection is
|
|
13067
|
+
* incomplete and an `integrationId` can be legitimately absent. The core does
|
|
13068
|
+
* not wait, poll or cache around this ([D3](../../../../docs/decisions/adr-0003.md)):
|
|
13069
|
+
* it compares the manifest declarers against the registered providers and
|
|
13070
|
+
* answers `503 temporarily_unavailable` (with `Retry-After` and the pending
|
|
13071
|
+
* addon ids) instead of `400 unknown integration`, and reports
|
|
13072
|
+
* `complete: false` on `GET /api/oauth2/integrations`. A client should retry
|
|
13073
|
+
* while the list is incomplete rather than conclude the hub cannot do OAuth.
|
|
12890
13074
|
*/
|
|
12891
13075
|
var OauthIntegrationDescriptorSchema = zod.z.object({
|
|
12892
13076
|
/** Stable id used as the `integration=` query param, e.g. 'export-alexa'. */
|
|
@@ -20044,6 +20228,101 @@ onColorChanged: { data: zod.z.object({
|
|
|
20044
20228
|
runtimeState: ColorStatusSchema
|
|
20045
20229
|
};
|
|
20046
20230
|
//#endregion
|
|
20231
|
+
//#region src/capabilities/connection-test.cap.ts
|
|
20232
|
+
/**
|
|
20233
|
+
* `connection-test` — pre-creation validation of an integration's settings,
|
|
20234
|
+
* system-scoped collection (one provider per integration addon).
|
|
20235
|
+
*
|
|
20236
|
+
* ── Why this cap exists ─────────────────────────────────────────────────────
|
|
20237
|
+
*
|
|
20238
|
+
* Before it, `integrations.testConnection` had exactly two behaviours: a broker
|
|
20239
|
+
* branch (`settings.brokerId` → `broker.testConnection`) and a DEFAULT branch
|
|
20240
|
+
* that probed `settings.main_stream_url ?? settings.url` with ffprobe. Every
|
|
20241
|
+
* account-based integration — Dreo, Dreame, Tuya, Petkit, Wyze — fell into that
|
|
20242
|
+
* default and was told `{"success":false,"error":"No stream URL provided"}`.
|
|
20243
|
+
* That answer neither validated nor refused anything, so:
|
|
20244
|
+
*
|
|
20245
|
+
* - the Test button had NEVER worked for an account integration, and
|
|
20246
|
+
* - `integrations.create` had nothing to gate on, so an integration with a
|
|
20247
|
+
* wrong password was created happily and failed later, silently, at
|
|
20248
|
+
* reconcile time.
|
|
20249
|
+
*
|
|
20250
|
+
* The structural gap was that at CREATE time the integration does not exist
|
|
20251
|
+
* yet: there is no `integrationId`, no `brokerId`, no live client — and every
|
|
20252
|
+
* existing provider surface (`device-provider`, `device-adoption`) is keyed by
|
|
20253
|
+
* one of those. There was no way to ask "are these settings valid?" before the
|
|
20254
|
+
* row existed.
|
|
20255
|
+
*
|
|
20256
|
+
* ── The contract ────────────────────────────────────────────────────────────
|
|
20257
|
+
*
|
|
20258
|
+
* The provider knows how to validate its OWN settings. The framework does not
|
|
20259
|
+
* guess from the shape of the settings — a stream-URL probe is one provider's
|
|
20260
|
+
* implementation of this cap, not the universal fallback. A provider that does
|
|
20261
|
+
* not register this cap is a KNOWN "cannot validate", never a silent pass.
|
|
20262
|
+
*
|
|
20263
|
+
* `testSettings` takes the candidate settings blob exactly as the wizard's
|
|
20264
|
+
* config step collected it (the same blob that would be handed to
|
|
20265
|
+
* `integrations.create`), and MUST NOT persist anything, mint an integration,
|
|
20266
|
+
* or mutate live state. It opens a throwaway session, asks, and closes it.
|
|
20267
|
+
*
|
|
20268
|
+
* ── The three outcomes are NOT interchangeable ──────────────────────────────
|
|
20269
|
+
*
|
|
20270
|
+
* This is the whole point of the discriminated union: a `null` from a timeout
|
|
20271
|
+
* must never look like a `null` from a refusal.
|
|
20272
|
+
*
|
|
20273
|
+
* - `validated` — the remote ACCEPTED these credentials. Observed.
|
|
20274
|
+
* - `rejected` — the remote REFUSED these credentials. Observed.
|
|
20275
|
+
* This is the ONLY outcome that blocks creation.
|
|
20276
|
+
* - `inconclusive` — the check could not complete (DNS, timeout, 5xx, an
|
|
20277
|
+
* unexpected shape). NOTHING was observed about the
|
|
20278
|
+
* credentials. Never rendered, or counted, as a failure.
|
|
20279
|
+
*
|
|
20280
|
+
* A provider that cannot tell a refusal from a transport fault must return
|
|
20281
|
+
* `inconclusive`. Guessing `rejected` would block creation on a flaky network;
|
|
20282
|
+
* guessing `validated` would wave a wrong password through.
|
|
20283
|
+
*/
|
|
20284
|
+
/** Ceiling on how long a pre-creation probe may hold the wizard. */
|
|
20285
|
+
var CONNECTION_TEST_TIMEOUT_MS = 2e4;
|
|
20286
|
+
var ConnectionTestOutcomeSchema = zod.z.discriminatedUnion("outcome", [
|
|
20287
|
+
zod.z.object({
|
|
20288
|
+
outcome: zod.z.literal("validated"),
|
|
20289
|
+
/** Round-trip of the sign-in, when the provider measured it. */
|
|
20290
|
+
latencyMs: zod.z.number().nonnegative().optional(),
|
|
20291
|
+
/** Optional human detail worth showing next to the tick
|
|
20292
|
+
* ("3 devices visible on this account"). */
|
|
20293
|
+
detail: zod.z.string().optional()
|
|
20294
|
+
}).strict(),
|
|
20295
|
+
zod.z.object({
|
|
20296
|
+
outcome: zod.z.literal("rejected"),
|
|
20297
|
+
error: zod.z.string()
|
|
20298
|
+
}).strict(),
|
|
20299
|
+
zod.z.object({
|
|
20300
|
+
outcome: zod.z.literal("inconclusive"),
|
|
20301
|
+
error: zod.z.string()
|
|
20302
|
+
}).strict()
|
|
20303
|
+
]);
|
|
20304
|
+
var ConnectionTestInputSchema = zod.z.object({
|
|
20305
|
+
/** Candidate integration settings, exactly as the create form collected them. */
|
|
20306
|
+
settings: zod.z.record(zod.z.string(), zod.z.unknown()) });
|
|
20307
|
+
/**
|
|
20308
|
+
* What the provider's test actually DOES, so the UI can say it in words before
|
|
20309
|
+
* the operator presses the button ("Signs in to the Dreo cloud"). Purely
|
|
20310
|
+
* descriptive — it never changes routing.
|
|
20311
|
+
*/
|
|
20312
|
+
var ConnectionTestDescriptorSchema = zod.z.object({ label: zod.z.string() });
|
|
20313
|
+
var connectionTestCapability = {
|
|
20314
|
+
name: "connection-test",
|
|
20315
|
+
scope: "system",
|
|
20316
|
+
mode: "collection",
|
|
20317
|
+
methods: {
|
|
20318
|
+
testSettings: require_sleep.method(ConnectionTestInputSchema, ConnectionTestOutcomeSchema, {
|
|
20319
|
+
kind: "mutation",
|
|
20320
|
+
auth: "admin"
|
|
20321
|
+
}),
|
|
20322
|
+
describeTest: require_sleep.method(zod.z.void(), ConnectionTestDescriptorSchema, { auth: "admin" })
|
|
20323
|
+
}
|
|
20324
|
+
};
|
|
20325
|
+
//#endregion
|
|
20047
20326
|
//#region src/capabilities/connectivity.cap.ts
|
|
20048
20327
|
/**
|
|
20049
20328
|
* Upstream-system connectivity sensor — distinct from `device-status`,
|
|
@@ -21528,15 +21807,57 @@ var AvailableIntegrationTypeSchema = zod.z.object({
|
|
|
21528
21807
|
* flow can import (e.g. HA areas). Drives the adopt modal's "import
|
|
21529
21808
|
* locations" checkbox. Provider-declared in the addon manifest. */
|
|
21530
21809
|
supportsLocationImport: zod.z.boolean(),
|
|
21810
|
+
/**
|
|
21811
|
+
* True when this integration DECLARES a pre-creation test (the
|
|
21812
|
+
* `connection-test` cap, or a broker whose settings it stores). Drives the
|
|
21813
|
+
* Test button: an integration that cannot be tested must say so up front
|
|
21814
|
+
* rather than offering a button that always answers the same nonsense.
|
|
21815
|
+
*/
|
|
21816
|
+
canTest: zod.z.boolean(),
|
|
21531
21817
|
existingInstances: zod.z.array(zod.z.object({
|
|
21532
21818
|
id: zod.z.string(),
|
|
21533
21819
|
name: zod.z.string()
|
|
21534
21820
|
})),
|
|
21535
21821
|
canAdd: zod.z.boolean()
|
|
21536
21822
|
});
|
|
21823
|
+
/**
|
|
21824
|
+
* Why a test could not be answered as a plain boolean.
|
|
21825
|
+
*
|
|
21826
|
+
* `success` alone collapsed four different situations into one red box, and the
|
|
21827
|
+
* one that mattered most — "nobody ever asked the remote anything" — looked
|
|
21828
|
+
* exactly like "the remote said no". The status is the discriminator:
|
|
21829
|
+
*
|
|
21830
|
+
* - `validated` — a provider-declared test ran and the remote ACCEPTED.
|
|
21831
|
+
* - `rejected` — a provider-declared test ran and the remote REFUSED.
|
|
21832
|
+
* The only status that blocks `integrations.create`.
|
|
21833
|
+
* - `inconclusive` — a test IS declared but could not complete (timeout,
|
|
21834
|
+
* DNS, 5xx). Nothing was observed; not a failure.
|
|
21835
|
+
* - `unsupported` — this integration declares NO test. Nothing was
|
|
21836
|
+
* observed either; not a failure, and not a pass.
|
|
21837
|
+
*
|
|
21838
|
+
* `unsupported` and `inconclusive` both carry `success: false` so an older
|
|
21839
|
+
* client can never read them as a green tick, and both carry an `error` string
|
|
21840
|
+
* that SAYS the test did not run rather than inventing a failure.
|
|
21841
|
+
*/
|
|
21842
|
+
var TestConnectionStatusEnum = zod.z.enum([
|
|
21843
|
+
"validated",
|
|
21844
|
+
"rejected",
|
|
21845
|
+
"inconclusive",
|
|
21846
|
+
"unsupported"
|
|
21847
|
+
]);
|
|
21537
21848
|
var TestConnectionResultSchema$1 = zod.z.object({
|
|
21849
|
+
/** True ONLY for `validated`. Never true for a test that did not run. */
|
|
21538
21850
|
success: zod.z.boolean(),
|
|
21539
|
-
error: zod.z.string().optional()
|
|
21851
|
+
error: zod.z.string().optional(),
|
|
21852
|
+
/** Optional for wire back-compat with clients built before the tri-state;
|
|
21853
|
+
* the server always sets it. */
|
|
21854
|
+
status: TestConnectionStatusEnum.optional(),
|
|
21855
|
+
/** Addon id whose declared test answered — `null` when none did. Lets the UI
|
|
21856
|
+
* attribute a result instead of blaming "the integration". */
|
|
21857
|
+
testedBy: zod.z.string().nullable().optional(),
|
|
21858
|
+
latencyMs: zod.z.number().nonnegative().optional(),
|
|
21859
|
+
/** Human detail from a `validated` result ("3 devices on this account"). */
|
|
21860
|
+
detail: zod.z.string().optional()
|
|
21540
21861
|
});
|
|
21541
21862
|
var CreateIntegrationInputSchema = zod.z.object({
|
|
21542
21863
|
addonId: zod.z.string(),
|
|
@@ -29851,6 +30172,7 @@ var CAPABILITY_NAMES = {
|
|
|
29851
30172
|
carbonMonoxide: "carbon-monoxide",
|
|
29852
30173
|
climateControl: "climate-control",
|
|
29853
30174
|
color: "color",
|
|
30175
|
+
connectionTest: "connection-test",
|
|
29854
30176
|
connectivity: "connectivity",
|
|
29855
30177
|
consumables: "consumables",
|
|
29856
30178
|
contact: "contact",
|
|
@@ -30094,6 +30416,10 @@ var CAPABILITY_ROUTER_KEYS = [
|
|
|
30094
30416
|
key: "color",
|
|
30095
30417
|
name: "color"
|
|
30096
30418
|
},
|
|
30419
|
+
{
|
|
30420
|
+
key: "connectionTest",
|
|
30421
|
+
name: "connection-test"
|
|
30422
|
+
},
|
|
30097
30423
|
{
|
|
30098
30424
|
key: "connectivity",
|
|
30099
30425
|
name: "connectivity"
|
|
@@ -30600,6 +30926,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
30600
30926
|
carbonMonoxideCapability,
|
|
30601
30927
|
climateControlCapability,
|
|
30602
30928
|
colorCapability,
|
|
30929
|
+
connectionTestCapability,
|
|
30603
30930
|
connectivityCapability,
|
|
30604
30931
|
consumablesCapability,
|
|
30605
30932
|
contactCapability,
|
|
@@ -31494,6 +31821,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
31494
31821
|
addonId: null,
|
|
31495
31822
|
access: "create"
|
|
31496
31823
|
},
|
|
31824
|
+
"connectionTest.describeTest": {
|
|
31825
|
+
capName: "connection-test",
|
|
31826
|
+
capScope: "system",
|
|
31827
|
+
addonId: null,
|
|
31828
|
+
access: "view"
|
|
31829
|
+
},
|
|
31830
|
+
"connectionTest.testSettings": {
|
|
31831
|
+
capName: "connection-test",
|
|
31832
|
+
capScope: "system",
|
|
31833
|
+
addonId: null,
|
|
31834
|
+
access: "create"
|
|
31835
|
+
},
|
|
31497
31836
|
"consumables.reset": {
|
|
31498
31837
|
capName: "consumables",
|
|
31499
31838
|
capScope: "device",
|
|
@@ -31884,6 +32223,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
31884
32223
|
addonId: null,
|
|
31885
32224
|
access: "create"
|
|
31886
32225
|
},
|
|
32226
|
+
"deviceManager.adoptionCancelJob": {
|
|
32227
|
+
capName: "device-manager",
|
|
32228
|
+
capScope: "system",
|
|
32229
|
+
addonId: null,
|
|
32230
|
+
access: "create"
|
|
32231
|
+
},
|
|
31887
32232
|
"deviceManager.adoptionListCandidateFilters": {
|
|
31888
32233
|
capName: "device-manager",
|
|
31889
32234
|
capScope: "system",
|
|
@@ -31896,6 +32241,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
31896
32241
|
addonId: null,
|
|
31897
32242
|
access: "view"
|
|
31898
32243
|
},
|
|
32244
|
+
"deviceManager.adoptionListJobs": {
|
|
32245
|
+
capName: "device-manager",
|
|
32246
|
+
capScope: "system",
|
|
32247
|
+
addonId: null,
|
|
32248
|
+
access: "view"
|
|
32249
|
+
},
|
|
31899
32250
|
"deviceManager.adoptionRefresh": {
|
|
31900
32251
|
capName: "device-manager",
|
|
31901
32252
|
capScope: "system",
|
|
@@ -31914,6 +32265,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
31914
32265
|
addonId: null,
|
|
31915
32266
|
access: "create"
|
|
31916
32267
|
},
|
|
32268
|
+
"deviceManager.adoptionStartJob": {
|
|
32269
|
+
capName: "device-manager",
|
|
32270
|
+
capScope: "system",
|
|
32271
|
+
addonId: null,
|
|
32272
|
+
access: "create"
|
|
32273
|
+
},
|
|
31917
32274
|
"deviceManager.allocateDeviceId": {
|
|
31918
32275
|
capName: "device-manager",
|
|
31919
32276
|
capScope: "system",
|
|
@@ -36155,6 +36512,7 @@ var KNOWN_CAP_NAMES = [
|
|
|
36155
36512
|
"camera-streams",
|
|
36156
36513
|
"climate-control",
|
|
36157
36514
|
"color",
|
|
36515
|
+
"connection-test",
|
|
36158
36516
|
"consumables",
|
|
36159
36517
|
"control",
|
|
36160
36518
|
"core-blocks",
|
|
@@ -36324,6 +36682,7 @@ var SYSTEM_CAP_NAMES = [
|
|
|
36324
36682
|
"auth-provider",
|
|
36325
36683
|
"backup",
|
|
36326
36684
|
"broker",
|
|
36685
|
+
"connection-test",
|
|
36327
36686
|
"core-blocks",
|
|
36328
36687
|
"custom-model-registry",
|
|
36329
36688
|
"data-store-provider",
|
|
@@ -36595,6 +36954,10 @@ function createSystemProxy(api) {
|
|
|
36595
36954
|
getState: (input) => dispatch("broker", "getState", "query", input),
|
|
36596
36955
|
getStatus: (input) => dispatch("broker", "getStatus", "query", input)
|
|
36597
36956
|
},
|
|
36957
|
+
connectionTest: {
|
|
36958
|
+
testSettings: (input) => dispatch("connectionTest", "testSettings", "mutation", input),
|
|
36959
|
+
describeTest: (input) => dispatch("connectionTest", "describeTest", "query", input)
|
|
36960
|
+
},
|
|
36598
36961
|
coreBlocks: {
|
|
36599
36962
|
list: (input) => dispatch("coreBlocks", "list", "query", input),
|
|
36600
36963
|
get: (input) => dispatch("coreBlocks", "get", "query", input),
|
|
@@ -36664,6 +37027,9 @@ function createSystemProxy(api) {
|
|
|
36664
37027
|
adoptionRefresh: (input) => dispatch("deviceManager", "adoptionRefresh", "mutation", input),
|
|
36665
37028
|
adoptionAdopt: (input) => dispatch("deviceManager", "adoptionAdopt", "mutation", input),
|
|
36666
37029
|
adoptionRelease: (input) => dispatch("deviceManager", "adoptionRelease", "mutation", input),
|
|
37030
|
+
adoptionStartJob: (input) => dispatch("deviceManager", "adoptionStartJob", "mutation", input),
|
|
37031
|
+
adoptionListJobs: (input) => dispatch("deviceManager", "adoptionListJobs", "query", input),
|
|
37032
|
+
adoptionCancelJob: (input) => dispatch("deviceManager", "adoptionCancelJob", "mutation", input),
|
|
36667
37033
|
adoptionResync: (input) => dispatch("deviceManager", "adoptionResync", "mutation", input),
|
|
36668
37034
|
discoveryProviders: (input) => dispatch("deviceManager", "discoveryProviders", "query", input),
|
|
36669
37035
|
discoverAllProviders: (input) => dispatch("deviceManager", "discoverAllProviders", "mutation", input),
|
|
@@ -39288,10 +39654,14 @@ exports.AddonPageDeclarationSchema = AddonPageDeclarationSchema;
|
|
|
39288
39654
|
exports.AddonPageInfoSchema = AddonPageInfoSchema;
|
|
39289
39655
|
exports.AdoptionAdoptInputSchema = AdoptInputSchema;
|
|
39290
39656
|
exports.AdoptionAdoptResultSchema = AdoptResultSchema;
|
|
39657
|
+
exports.AdoptionCandidateResultSchema = AdoptionCandidateResultSchema;
|
|
39291
39658
|
exports.AdoptionFilterSchema = AdoptionFilterSchema;
|
|
39292
39659
|
exports.AdoptionGetCandidateInputSchema = GetCandidateInputSchema;
|
|
39660
|
+
exports.AdoptionJobSchema = AdoptionJobSchema;
|
|
39661
|
+
exports.AdoptionJobStateSchema = AdoptionJobStateSchema;
|
|
39293
39662
|
exports.AdoptionListCandidatesInputSchema = ListCandidatesInputSchema;
|
|
39294
39663
|
exports.AdoptionListCandidatesOutputSchema = ListCandidatesOutputSchema;
|
|
39664
|
+
exports.AdoptionOutcomeSchema = AdoptionOutcomeSchema;
|
|
39295
39665
|
exports.AdoptionReleaseInputSchema = ReleaseInputSchema;
|
|
39296
39666
|
exports.AdoptionStatusSchema = AdoptionStatusSchema;
|
|
39297
39667
|
exports.AgentLoadSummarySchema = AgentLoadSummarySchema;
|
|
@@ -39380,6 +39750,7 @@ exports.CAP_NODE_PIN_CONTEXT_KEY = require_sleep.CAP_NODE_PIN_CONTEXT_KEY;
|
|
|
39380
39750
|
exports.CAP_PROVIDER_KIND_MAP = CAP_PROVIDER_KIND_MAP;
|
|
39381
39751
|
exports.COCO_80_LABELS = COCO_80_LABELS;
|
|
39382
39752
|
exports.COCO_TO_MACRO = COCO_TO_MACRO;
|
|
39753
|
+
exports.CONNECTION_TEST_TIMEOUT_MS = CONNECTION_TEST_TIMEOUT_MS;
|
|
39383
39754
|
exports.CORE_BLOCKS_ADDON_ID = CORE_BLOCKS_ADDON_ID;
|
|
39384
39755
|
exports.CORE_BLOCK_ADDON_PREFIX = CORE_BLOCK_ADDON_PREFIX;
|
|
39385
39756
|
exports.CamProfileSchema = require_sleep.CamProfileSchema;
|
|
@@ -39432,6 +39803,9 @@ exports.ColorStatusSchema = ColorStatusSchema;
|
|
|
39432
39803
|
exports.ConfigEntrySchema = ConfigEntrySchema;
|
|
39433
39804
|
exports.ConfigSectionWithValuesSchema = ConfigSectionWithValuesSchema;
|
|
39434
39805
|
exports.ConfigTabDeclarationSchema = ConfigTabDeclarationSchema;
|
|
39806
|
+
exports.ConnectionTestDescriptorSchema = ConnectionTestDescriptorSchema;
|
|
39807
|
+
exports.ConnectionTestInputSchema = ConnectionTestInputSchema;
|
|
39808
|
+
exports.ConnectionTestOutcomeSchema = ConnectionTestOutcomeSchema;
|
|
39435
39809
|
exports.ConnectivityStatusSchema = ConnectivityStatusSchema;
|
|
39436
39810
|
exports.ConsumableItemSchema = ConsumableItemSchema;
|
|
39437
39811
|
exports.ConsumablesStatusSchema = ConsumablesStatusSchema;
|
|
@@ -39997,6 +40371,7 @@ exports.TemperatureSensorStatusSchema = TemperatureSensorStatusSchema;
|
|
|
39997
40371
|
exports.TerminalProfileInfoSchema = TerminalProfileInfoSchema;
|
|
39998
40372
|
exports.TerminalSessionInfoSchema = TerminalSessionInfoSchema;
|
|
39999
40373
|
exports.TestConnectionResultSchema = TestConnectionResultSchema$1;
|
|
40374
|
+
exports.TestConnectionStatusEnum = TestConnectionStatusEnum;
|
|
40000
40375
|
exports.TestResultSchema = TestResultSchema;
|
|
40001
40376
|
exports.TimelapseRuleInputSchema = TimelapseRuleInputSchema;
|
|
40002
40377
|
exports.TimelapseRulePatchSchema = TimelapseRulePatchSchema;
|
|
@@ -40136,6 +40511,7 @@ exports.colorForKind = colorForKind;
|
|
|
40136
40511
|
exports.compileExpression = compileExpression;
|
|
40137
40512
|
exports.compileExpressionSafe = compileExpressionSafe;
|
|
40138
40513
|
exports.conditionDepth = conditionDepth;
|
|
40514
|
+
exports.connectionTestCapability = connectionTestCapability;
|
|
40139
40515
|
exports.connectivityCapability = connectivityCapability;
|
|
40140
40516
|
exports.consumablesCapability = consumablesCapability;
|
|
40141
40517
|
exports.contactCapability = contactCapability;
|