@camstack/types 1.2.161 → 1.2.162

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.
@@ -30,8 +30,11 @@ export type StorageLocationType = z.infer<typeof StorageLocationTypeSchema>;
30
30
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
31
31
  *
32
32
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
33
- * The default location for a type uses `id === <type>:default` by
34
- * convention (the bare type ref like `'backups'` resolves to it).
33
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
34
+ * There is no default location any more (D383): `enabled` is the whole write
35
+ * model, and a bare type ref resolves to the sole location of the type, or —
36
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
37
+ * slug is `default`.
35
38
  *
36
39
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
37
40
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -45,7 +48,6 @@ export declare const StorageLocationSchema: z.ZodObject<{
45
48
  providerId: z.ZodString;
46
49
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
47
50
  nodeId: z.ZodOptional<z.ZodString>;
48
- isDefault: z.ZodDefault<z.ZodBoolean>;
49
51
  isSystem: z.ZodDefault<z.ZodBoolean>;
50
52
  enabled: z.ZodOptional<z.ZodBoolean>;
51
53
  capacity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -56,10 +58,35 @@ export declare const StorageLocationSchema: z.ZodObject<{
56
58
  updatedAt: z.ZodNumber;
57
59
  }, z.core.$strip>;
58
60
  export type StorageLocation = z.infer<typeof StorageLocationSchema>;
61
+ /**
62
+ * The retired `isDefault` key, DECLARED rather than dropped.
63
+ *
64
+ * A key removed from a non-strict `z.object` is stripped in silence (D380,
65
+ * D381): a reader that still needs the old value gets `undefined` and cannot
66
+ * tell "absent" from "never sent". The one reader that legitimately needs it —
67
+ * the location store's boot migration, which turns the old default flag into
68
+ * the `enabled` write set — parses THIS schema against the raw row instead, so
69
+ * the migration is explicit and the live schema stays clean. Nothing else in
70
+ * the repo may read it; `scripts/check-no-storage-default.ts` enforces that.
71
+ */
72
+ export declare const LegacyStorageLocationDefaultSchema: z.ZodObject<{
73
+ isDefault: z.ZodOptional<z.ZodBoolean>;
74
+ }, z.core.$strip>;
75
+ export type LegacyStorageLocationDefault = z.infer<typeof LegacyStorageLocationDefaultSchema>;
76
+ /**
77
+ * Is this location a write target? THE one place that decides what an absent
78
+ * `enabled` means on a persisted row — legacy rows predate the flag and were
79
+ * active, so absence is enabled. Every consumer asks here rather than spelling
80
+ * `enabled !== false` again, so the tri-state has exactly one interpretation.
81
+ */
82
+ export declare function isLocationEnabled(location: {
83
+ readonly enabled?: boolean;
84
+ }): boolean;
59
85
  /**
60
86
  * Reference accepted by consumer-facing `api.storage.*` calls.
61
87
  * Either:
62
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
88
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
89
+ * (transitionally, the `<type>:default`-slugged row when several exist)
63
90
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
64
91
  *
65
92
  * The orchestrator's `resolveRef(ref)` handles both cases.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.161",
3
+ "version": "1.2.162",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",