@camstack/types 1.2.32 → 1.2.33

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.
@@ -96,6 +96,7 @@ export type BrokerProviderInfo = z.infer<typeof BrokerProviderInfoSchema>;
96
96
  declare const AddInputSchema: z.ZodObject<{
97
97
  kind: z.ZodString;
98
98
  name: z.ZodString;
99
+ id: z.ZodOptional<z.ZodString>;
99
100
  settings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
100
101
  }, z.core.$strip>;
101
102
  declare const TestConnectionResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -204,6 +205,7 @@ export declare const brokerCapability: {
204
205
  readonly add: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
205
206
  kind: z.ZodString;
206
207
  name: z.ZodString;
208
+ id: z.ZodOptional<z.ZodString>;
207
209
  settings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
208
210
  }, z.core.$strip>, z.ZodObject<{
209
211
  id: z.ZodString;
package/dist/index.js CHANGED
@@ -17621,6 +17621,20 @@ var GetInputSchema = zod.z.object({ id: zod.z.string() });
17621
17621
  var AddInputSchema = zod.z.object({
17622
17622
  kind: zod.z.string().min(1),
17623
17623
  name: zod.z.string().min(1),
17624
+ /**
17625
+ * ADOPT an existing id instead of minting a new one.
17626
+ *
17627
+ * Written the day this cost an outage. A broker's id is not a detail: HA
17628
+ * devices carry it inside their `stableId` (`ha:ha_004:dev:…`), so a broker
17629
+ * lost from config and re-added as `ha_001` leaves every one of its devices
17630
+ * bound to a broker that no longer exists. Re-entering the password under the
17631
+ * ORIGINAL id turns a multi-step device migration back into re-entering a
17632
+ * password.
17633
+ *
17634
+ * A provider MUST refuse an id that is already in use — adopting a live
17635
+ * broker's id would silently take it over.
17636
+ */
17637
+ id: zod.z.string().min(1).optional(),
17624
17638
  /** Kind-specific settings (e.g. MQTT `{url,username,password}` or HA
17625
17639
  * `{baseUrl,accessToken}`). Validated by the kind-specific provider
17626
17640
  * branch on receipt — invalid shape rejects the add. */
package/dist/index.mjs CHANGED
@@ -17620,6 +17620,20 @@ var GetInputSchema = z.object({ id: z.string() });
17620
17620
  var AddInputSchema = z.object({
17621
17621
  kind: z.string().min(1),
17622
17622
  name: z.string().min(1),
17623
+ /**
17624
+ * ADOPT an existing id instead of minting a new one.
17625
+ *
17626
+ * Written the day this cost an outage. A broker's id is not a detail: HA
17627
+ * devices carry it inside their `stableId` (`ha:ha_004:dev:…`), so a broker
17628
+ * lost from config and re-added as `ha_001` leaves every one of its devices
17629
+ * bound to a broker that no longer exists. Re-entering the password under the
17630
+ * ORIGINAL id turns a multi-step device migration back into re-entering a
17631
+ * password.
17632
+ *
17633
+ * A provider MUST refuse an id that is already in use — adopting a live
17634
+ * broker's id would silently take it over.
17635
+ */
17636
+ id: z.string().min(1).optional(),
17623
17637
  /** Kind-specific settings (e.g. MQTT `{url,username,password}` or HA
17624
17638
  * `{baseUrl,accessToken}`). Validated by the kind-specific provider
17625
17639
  * branch on receipt — invalid shape rejects the add. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.32",
3
+ "version": "1.2.33",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",