@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.
- package/dist/addon.js +10 -40
- package/dist/addon.mjs +10 -40
- package/dist/capabilities/storage-provider.cap.d.ts +0 -11
- package/dist/capabilities/storage.cap.d.ts +0 -22
- package/dist/generated/addon-api.d.ts +0 -7
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/index.js +717 -699
- package/dist/index.mjs +716 -700
- package/dist/interfaces/storage-location.d.ts +31 -4
- package/package.json +1 -1
|
@@ -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
|
|
34
|
-
*
|
|
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'`) →
|
|
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.
|