@camstack/types 1.2.326 → 1.2.327
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.d.ts +1 -0
- package/dist/addon.js +3 -1
- package/dist/addon.mjs +2 -2
- package/dist/capabilities/addon-routes.cap.d.ts +2 -2
- package/dist/capabilities/device-manager.cap.d.ts +7 -0
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/local-network.cap.d.ts +2 -2
- package/dist/capabilities/login-method.cap.d.ts +3 -0
- package/dist/capabilities/mesh-network.cap.d.ts +3 -3
- package/dist/capabilities/network-access.cap.d.ts +7 -7
- package/dist/capabilities/pipeline-analytics.cap.d.ts +145 -0
- package/dist/capabilities/sso-bridge.cap.d.ts +6 -0
- package/dist/capabilities/system.cap.d.ts +5 -5
- package/dist/capabilities/user-management.cap.d.ts +53 -1
- package/dist/client.js +6 -0
- package/dist/client.mjs +6 -0
- package/dist/device/display-icon-vocabulary.d.ts +7 -0
- package/dist/device/index.d.ts +1 -0
- package/dist/device/zod-secret.d.ts +35 -0
- package/dist/generated/addon-api.d.ts +122 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +237 -12
- package/dist/index.mjs +228 -13
- package/dist/interfaces/config-ui.d.ts +31 -2
- package/dist/{sleep-BNeXenvr.mjs → sleep-B0JG7-_F.mjs} +91 -1
- package/dist/{sleep-DPar9AHl.js → sleep-az1qiFzK.js} +108 -0
- package/package.json +1 -1
|
@@ -80,7 +80,7 @@ export interface ConfigSection {
|
|
|
80
80
|
readonly immediate?: boolean;
|
|
81
81
|
readonly fields: readonly ConfigField[];
|
|
82
82
|
}
|
|
83
|
-
export type ConfigField = ConfigTextField | ConfigNumberField | ConfigBooleanField | ConfigSelectField | ConfigMultiSelectField | ConfigTimezoneField | ConfigDateTimeField | ConfigColorField | ConfigPasswordField | ConfigTextAreaField | ConfigSliderField | ConfigTagsField | ConfigScheduleField | ConfigGroupField | ConfigSubTabsField | ConfigSeparatorField | ConfigInfoField | ConfigQrCodeField | ConfigObjectArrayField | ConfigEditableArrayField | ConfigModelSelectorField | ConfigStorageLocationField | ConfigProbeField | ConfigButtonField | ConfigNodeSelectField | ConfigNodeMultiSelectField | ConfigDeviceSelectField | ConfigDeviceMultiSelectField | ConfigNotificationTargetSelectField | ConfigNotificationTargetMultiSelectField | ConfigWidgetField | ConfigAddonActionSelectField | ConfigAddonActionButtonField | ConfigDeviceActionButtonField;
|
|
83
|
+
export type ConfigField = ConfigTextField | ConfigNumberField | ConfigBooleanField | ConfigSelectField | ConfigMultiSelectField | ConfigTimezoneField | ConfigDateTimeField | ConfigColorField | ConfigIconField | ConfigPasswordField | ConfigTextAreaField | ConfigSliderField | ConfigTagsField | ConfigScheduleField | ConfigGroupField | ConfigSubTabsField | ConfigSeparatorField | ConfigInfoField | ConfigQrCodeField | ConfigObjectArrayField | ConfigEditableArrayField | ConfigModelSelectorField | ConfigStorageLocationField | ConfigProbeField | ConfigButtonField | ConfigNodeSelectField | ConfigNodeMultiSelectField | ConfigDeviceSelectField | ConfigDeviceMultiSelectField | ConfigNotificationTargetSelectField | ConfigNotificationTargetMultiSelectField | ConfigWidgetField | ConfigAddonActionSelectField | ConfigAddonActionButtonField | ConfigDeviceActionButtonField;
|
|
84
84
|
/**
|
|
85
85
|
* Per-MODEL applicability of a pipeline-step setting (D214).
|
|
86
86
|
*
|
|
@@ -389,6 +389,22 @@ export interface ConfigColorField extends ConfigFieldBase {
|
|
|
389
389
|
type: 'color';
|
|
390
390
|
presets?: string[];
|
|
391
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
* An icon chosen from the shared display-icon vocabulary (D780) —
|
|
394
|
+
* `DISPLAY_ICON_VOCABULARY` in `device/display-icon-vocabulary.ts`, the same
|
|
395
|
+
* keys the device and room pickers store. The form renders the shared
|
|
396
|
+
* `<IconPicker>`; the stored value is a vocabulary KEY, never a free-text
|
|
397
|
+
* lucide name. `default` must itself be a vocabulary key: clearing the picker
|
|
398
|
+
* writes it back, and a stored value outside the vocabulary (a pre-D780
|
|
399
|
+
* free-text name) is drawn as the default — readers resolve it with
|
|
400
|
+
* `resolveDisplayIconKey(value, default)`.
|
|
401
|
+
*
|
|
402
|
+
* COMPILE-TIME ONLY on the wire (`z.custom<ConfigField>()`): a form that
|
|
403
|
+
* predates this type renders it through its default branch.
|
|
404
|
+
*/
|
|
405
|
+
export interface ConfigIconField extends ConfigFieldBase {
|
|
406
|
+
readonly type: 'icon';
|
|
407
|
+
}
|
|
392
408
|
/** Select a single cluster node from the live topology. Options are
|
|
393
409
|
* populated dynamically by the UI via useClusterNodes — no server-side
|
|
394
410
|
* option list needed. */
|
|
@@ -700,7 +716,7 @@ export interface ConfigOption {
|
|
|
700
716
|
*
|
|
701
717
|
* Constraints inside `itemFields`:
|
|
702
718
|
* - Only scalar field types are supported (text/number/select/
|
|
703
|
-
* multiselect/password/boolean/textarea/color/tags/slider). Nested
|
|
719
|
+
* multiselect/password/boolean/textarea/color/icon/tags/slider). Nested
|
|
704
720
|
* groups, sub-tabs, probes, button actions, and other arrays are
|
|
705
721
|
* intentionally rejected — they conflate row-state with section-
|
|
706
722
|
* state and the FormBuilder's flat onChange contract can't carry
|
|
@@ -876,6 +892,17 @@ export interface ConfigAddonActionButtonField extends ConfigFieldBase {
|
|
|
876
892
|
* No-op on a form with no device.
|
|
877
893
|
*/
|
|
878
894
|
includeDeviceId?: boolean;
|
|
895
|
+
/**
|
|
896
|
+
* Ask the operator for one value when the button is pressed and send it as
|
|
897
|
+
* `input[param]`. For a one-shot argument that must not live in the saved
|
|
898
|
+
* settings (ids to delete, a code to send). Cancelling runs nothing.
|
|
899
|
+
*/
|
|
900
|
+
prompt?: {
|
|
901
|
+
readonly param: string;
|
|
902
|
+
readonly title?: string;
|
|
903
|
+
readonly message?: string;
|
|
904
|
+
readonly placeholder?: string;
|
|
905
|
+
};
|
|
879
906
|
/** Toast/inline success message template. `{key}` placeholders are
|
|
880
907
|
* resolved against the action result. */
|
|
881
908
|
successMessage?: string;
|
|
@@ -943,6 +970,8 @@ export type ConfigFieldWithValue = (ConfigTextField & {
|
|
|
943
970
|
readonly value: unknown;
|
|
944
971
|
}) | (ConfigColorField & {
|
|
945
972
|
readonly value: unknown;
|
|
973
|
+
}) | (ConfigIconField & {
|
|
974
|
+
readonly value: unknown;
|
|
946
975
|
}) | (ConfigPasswordField & {
|
|
947
976
|
readonly value: unknown;
|
|
948
977
|
}) | (ConfigTextAreaField & {
|
|
@@ -3415,6 +3415,8 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3415
3415
|
completeRetrainTrack: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "completeRetrainTrack", "mutation", input),
|
|
3416
3416
|
restageRetrainTrack: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "restageRetrainTrack", "mutation", input),
|
|
3417
3417
|
getRetrainExportUrl: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getRetrainExportUrl", "query", input),
|
|
3418
|
+
setRetrainFrameComplete: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "setRetrainFrameComplete", "mutation", input),
|
|
3419
|
+
writeRetrainArchive: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "writeRetrainArchive", "mutation", input),
|
|
3418
3420
|
getEventMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventMedia", "query", input),
|
|
3419
3421
|
getTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getTrackMedia", "query", input),
|
|
3420
3422
|
listTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listTrackMedia", "query", input),
|
|
@@ -3921,6 +3923,94 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3921
3923
|
};
|
|
3922
3924
|
}
|
|
3923
3925
|
//#endregion
|
|
3926
|
+
//#region src/device/zod-secret.ts
|
|
3927
|
+
/**
|
|
3928
|
+
* Secret declaration on a Zod config schema (D783).
|
|
3929
|
+
*
|
|
3930
|
+
* A field is a secret because its schema SAYS so — `.meta({ secret: true })`,
|
|
3931
|
+
* spelled {@link SECRET_META} — never because its key looks like a credential.
|
|
3932
|
+
* It is the Zod twin of `secret: true` / `type: 'password'` on a config-UI
|
|
3933
|
+
* field (`isSecretConfigField`), and every consumer that treats secrets
|
|
3934
|
+
* specially reads it: the settings form (`zodEntriesToConfigUI`), the paths a
|
|
3935
|
+
* device advertises at `registerDevice` (`secretConfigPaths`, which the
|
|
3936
|
+
* non-admin redaction withholds at any depth), and the keychain later.
|
|
3937
|
+
*
|
|
3938
|
+
* Zod keeps `.meta()` in `z.globalRegistry`, which lives on `globalThis`, so a
|
|
3939
|
+
* declaration made by an addon's own copy of zod is visible here.
|
|
3940
|
+
*/
|
|
3941
|
+
/**
|
|
3942
|
+
* `{ secret: true }` — the one spelling of "this field holds a credential".
|
|
3943
|
+
*
|
|
3944
|
+
* Addons write the LITERAL `.meta({ secret: true })` rather than importing
|
|
3945
|
+
* this constant: an addon running against an older `@camstack/types` would
|
|
3946
|
+
* otherwise call `.meta(undefined)`, which in zod v4 is the metadata GETTER
|
|
3947
|
+
* and returns no schema at all.
|
|
3948
|
+
*/
|
|
3949
|
+
var SECRET_META = { secret: true };
|
|
3950
|
+
function defOf(schema) {
|
|
3951
|
+
return schema._zod?.def ?? {};
|
|
3952
|
+
}
|
|
3953
|
+
function declaredHere(schema) {
|
|
3954
|
+
return z.globalRegistry.get(schema)?.secret === true;
|
|
3955
|
+
}
|
|
3956
|
+
/** Wrapper kinds whose `innerType` is the field itself. */
|
|
3957
|
+
var WRAPPERS = new Set([
|
|
3958
|
+
"optional",
|
|
3959
|
+
"nullable",
|
|
3960
|
+
"default",
|
|
3961
|
+
"prefault",
|
|
3962
|
+
"catch",
|
|
3963
|
+
"readonly",
|
|
3964
|
+
"nonoptional"
|
|
3965
|
+
]);
|
|
3966
|
+
/**
|
|
3967
|
+
* The schema layers that make up ONE field: the schema itself and every
|
|
3968
|
+
* wrapper below it (optional / default / nullable / readonly / catch), plus
|
|
3969
|
+
* both sides of a pipe (`z.preprocess` puts the real schema on `out`,
|
|
3970
|
+
* `.transform` on `in`).
|
|
3971
|
+
*/
|
|
3972
|
+
function layersOf(schema) {
|
|
3973
|
+
const out = [];
|
|
3974
|
+
const queue = [schema];
|
|
3975
|
+
while (queue.length > 0) {
|
|
3976
|
+
const s = queue.shift();
|
|
3977
|
+
if (!s || out.includes(s)) continue;
|
|
3978
|
+
out.push(s);
|
|
3979
|
+
const def = defOf(s);
|
|
3980
|
+
if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
|
|
3981
|
+
if (def.type === "pipe") {
|
|
3982
|
+
if (def.in) queue.push(def.in);
|
|
3983
|
+
if (def.out) queue.push(def.out);
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
return out;
|
|
3987
|
+
}
|
|
3988
|
+
/** True when any layer of this field declares `.meta({ secret: true })`. */
|
|
3989
|
+
function isZodSecret(schema) {
|
|
3990
|
+
return layersOf(schema).some(declaredHere);
|
|
3991
|
+
}
|
|
3992
|
+
/**
|
|
3993
|
+
* Every declared secret path in a config schema: dotted keys, `[]` for "each
|
|
3994
|
+
* element of this array" (`connection.password`, `rows[].token`). A declared
|
|
3995
|
+
* object or array is reported as one path and not descended into — everything
|
|
3996
|
+
* under it is secret.
|
|
3997
|
+
*/
|
|
3998
|
+
function collectZodSecretPaths(schema, prefix = "") {
|
|
3999
|
+
if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
|
|
4000
|
+
const paths = [];
|
|
4001
|
+
for (const layer of layersOf(schema)) {
|
|
4002
|
+
const def = defOf(layer);
|
|
4003
|
+
if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
|
|
4004
|
+
else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
|
|
4005
|
+
else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
|
|
4006
|
+
else if (def.type === "intersection") {
|
|
4007
|
+
if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
|
|
4008
|
+
if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
|
|
4009
|
+
}
|
|
4010
|
+
}
|
|
4011
|
+
return [...new Set(paths)];
|
|
4012
|
+
}
|
|
4013
|
+
//#endregion
|
|
3924
4014
|
//#region src/generated/device-scoped-caps.ts
|
|
3925
4015
|
/**
|
|
3926
4016
|
* AUTO-GENERATED by scripts/generate-device-scoped-caps.ts — DO NOT EDIT.
|
|
@@ -4183,4 +4273,4 @@ function sleepCancellable(ms, signal) {
|
|
|
4183
4273
|
});
|
|
4184
4274
|
}
|
|
4185
4275
|
//#endregion
|
|
4186
|
-
export {
|
|
4276
|
+
export { BrokerStatsSchema as $, adminUiCapability as A, createDurableState as At, resolveCapMount as B, AUDIO_CHUNK_FORMATS as Bt, deviceOpsCapability as C, PeerBytesTicketSchema as Ct, defineCustomActions as D, BaseAddon as Dt, customAction as E, DisposerChain as Et, event as F, WELL_KNOWN_TAB_MAP as Ft, toNodeId as G, CAP_NODE_PIN_CONTEXT_KEY as H, expandAudioChunkToF32le as Ht, expandCapMethods as I, collectHydratedFieldEntries as It, emitDownForOwnedCaps as J, ReadinessRegistry as K, isDeviceConfigCap as L, collectHydratedFieldValues as Lt, DEVICE_SETTINGS_CONTRIBUTION_METHODS as M, emitReadiness as Mt, DEVICE_STATUS_METHOD as N, isEvent as Nt, describeCustomActions as O, normalizeAddonInitResult as Ot, PROVIDER_PIN_FIELD as P, WELL_KNOWN_TABS as Pt, AudioStreamPickSchema as Q, method as R, hydrateSchema as Rt, RawStateResultSchema as S, PEER_BYTES_TICKET_TTL_MS as St, DEVICE_CHILDREN_BATCH_MAX as T, SHARE_VIEW_KINDS as Tt, nodePin as U, isAudioChunkFormat as Ut, systemMethod as V, audioChunkBytesPerSample as Vt, readNodePin as W, scopeKey as X, readinessKey as Y, AudioChunkFormatSchema as Z, createDeviceProxy as _, parseProfileBrokerId as _t, asJsonObject as a, CameraStreamSchema as at, createMirrorSource as b, PEER_BYTES_MAX_OUTSTANDING as bt, parseJsonArray as c, ProfileRtspEntrySchema as ct, BOOT_RECOVERY_BACKOFF_MS as d, StreamSourceEntrySchema$1 as dt, BrokerStatusSchema as et, DEVICE_SCOPED_CAPS as f, StreamSourceSchema as ft, isZodSecret as g, makeSourceBrokerId as gt, collectZodSecretPaths as h, makeProfileBrokerId as ht, asJsonArray as i, CamStreamResolutionSchema as it, DEFAULT_RUNTIME_STATE_DURABILITY as j, createEvent as jt, deviceCustomAction as k, normalizeNodeId as kt, parseJsonObject as l, ProfileSlotSchema as lt, SECRET_META as m, SubscribeAudioChunksResultSchema as mt, sleepCancellable as n, CamProfileSchema as nt, asNumber as o, DecodedAudioChunkSchema as ot, isDeviceScopedCap as p, SubscribeAudioChunksInputSchema as pt, ReadinessTimeoutError as q, asBoolean as r, CamStreamKindSchema as rt, asString as s, FrameHandleSchema as st, sleep as t, CAM_PROFILE_ORDER as tt, parseJsonUnknown as u, ProfileSlotStatusSchema as ut, createEventBusSliceSource as v, selectAssignedProfileSlots as vt, viewerUiCapability as w, DATAPLANE_SECRET_HEADER as wt, createSliceHandle as x, PEER_BYTES_STALL_MS as xt, createLazyTrpcSource as y, PEER_BYTES_CHUNK_BYTES as yt, optionalMethod as z, resolveHydratedFieldValue as zt };
|
|
@@ -3415,6 +3415,8 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3415
3415
|
completeRetrainTrack: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "completeRetrainTrack", "mutation", input),
|
|
3416
3416
|
restageRetrainTrack: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "restageRetrainTrack", "mutation", input),
|
|
3417
3417
|
getRetrainExportUrl: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getRetrainExportUrl", "query", input),
|
|
3418
|
+
setRetrainFrameComplete: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "setRetrainFrameComplete", "mutation", input),
|
|
3419
|
+
writeRetrainArchive: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "writeRetrainArchive", "mutation", input),
|
|
3418
3420
|
getEventMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventMedia", "query", input),
|
|
3419
3421
|
getTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getTrackMedia", "query", input),
|
|
3420
3422
|
listTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listTrackMedia", "query", input),
|
|
@@ -3921,6 +3923,94 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3921
3923
|
};
|
|
3922
3924
|
}
|
|
3923
3925
|
//#endregion
|
|
3926
|
+
//#region src/device/zod-secret.ts
|
|
3927
|
+
/**
|
|
3928
|
+
* Secret declaration on a Zod config schema (D783).
|
|
3929
|
+
*
|
|
3930
|
+
* A field is a secret because its schema SAYS so — `.meta({ secret: true })`,
|
|
3931
|
+
* spelled {@link SECRET_META} — never because its key looks like a credential.
|
|
3932
|
+
* It is the Zod twin of `secret: true` / `type: 'password'` on a config-UI
|
|
3933
|
+
* field (`isSecretConfigField`), and every consumer that treats secrets
|
|
3934
|
+
* specially reads it: the settings form (`zodEntriesToConfigUI`), the paths a
|
|
3935
|
+
* device advertises at `registerDevice` (`secretConfigPaths`, which the
|
|
3936
|
+
* non-admin redaction withholds at any depth), and the keychain later.
|
|
3937
|
+
*
|
|
3938
|
+
* Zod keeps `.meta()` in `z.globalRegistry`, which lives on `globalThis`, so a
|
|
3939
|
+
* declaration made by an addon's own copy of zod is visible here.
|
|
3940
|
+
*/
|
|
3941
|
+
/**
|
|
3942
|
+
* `{ secret: true }` — the one spelling of "this field holds a credential".
|
|
3943
|
+
*
|
|
3944
|
+
* Addons write the LITERAL `.meta({ secret: true })` rather than importing
|
|
3945
|
+
* this constant: an addon running against an older `@camstack/types` would
|
|
3946
|
+
* otherwise call `.meta(undefined)`, which in zod v4 is the metadata GETTER
|
|
3947
|
+
* and returns no schema at all.
|
|
3948
|
+
*/
|
|
3949
|
+
var SECRET_META = { secret: true };
|
|
3950
|
+
function defOf(schema) {
|
|
3951
|
+
return schema._zod?.def ?? {};
|
|
3952
|
+
}
|
|
3953
|
+
function declaredHere(schema) {
|
|
3954
|
+
return zod.z.globalRegistry.get(schema)?.secret === true;
|
|
3955
|
+
}
|
|
3956
|
+
/** Wrapper kinds whose `innerType` is the field itself. */
|
|
3957
|
+
var WRAPPERS = new Set([
|
|
3958
|
+
"optional",
|
|
3959
|
+
"nullable",
|
|
3960
|
+
"default",
|
|
3961
|
+
"prefault",
|
|
3962
|
+
"catch",
|
|
3963
|
+
"readonly",
|
|
3964
|
+
"nonoptional"
|
|
3965
|
+
]);
|
|
3966
|
+
/**
|
|
3967
|
+
* The schema layers that make up ONE field: the schema itself and every
|
|
3968
|
+
* wrapper below it (optional / default / nullable / readonly / catch), plus
|
|
3969
|
+
* both sides of a pipe (`z.preprocess` puts the real schema on `out`,
|
|
3970
|
+
* `.transform` on `in`).
|
|
3971
|
+
*/
|
|
3972
|
+
function layersOf(schema) {
|
|
3973
|
+
const out = [];
|
|
3974
|
+
const queue = [schema];
|
|
3975
|
+
while (queue.length > 0) {
|
|
3976
|
+
const s = queue.shift();
|
|
3977
|
+
if (!s || out.includes(s)) continue;
|
|
3978
|
+
out.push(s);
|
|
3979
|
+
const def = defOf(s);
|
|
3980
|
+
if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
|
|
3981
|
+
if (def.type === "pipe") {
|
|
3982
|
+
if (def.in) queue.push(def.in);
|
|
3983
|
+
if (def.out) queue.push(def.out);
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
return out;
|
|
3987
|
+
}
|
|
3988
|
+
/** True when any layer of this field declares `.meta({ secret: true })`. */
|
|
3989
|
+
function isZodSecret(schema) {
|
|
3990
|
+
return layersOf(schema).some(declaredHere);
|
|
3991
|
+
}
|
|
3992
|
+
/**
|
|
3993
|
+
* Every declared secret path in a config schema: dotted keys, `[]` for "each
|
|
3994
|
+
* element of this array" (`connection.password`, `rows[].token`). A declared
|
|
3995
|
+
* object or array is reported as one path and not descended into — everything
|
|
3996
|
+
* under it is secret.
|
|
3997
|
+
*/
|
|
3998
|
+
function collectZodSecretPaths(schema, prefix = "") {
|
|
3999
|
+
if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
|
|
4000
|
+
const paths = [];
|
|
4001
|
+
for (const layer of layersOf(schema)) {
|
|
4002
|
+
const def = defOf(layer);
|
|
4003
|
+
if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
|
|
4004
|
+
else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
|
|
4005
|
+
else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
|
|
4006
|
+
else if (def.type === "intersection") {
|
|
4007
|
+
if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
|
|
4008
|
+
if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
|
|
4009
|
+
}
|
|
4010
|
+
}
|
|
4011
|
+
return [...new Set(paths)];
|
|
4012
|
+
}
|
|
4013
|
+
//#endregion
|
|
3924
4014
|
//#region src/generated/device-scoped-caps.ts
|
|
3925
4015
|
/**
|
|
3926
4016
|
* AUTO-GENERATED by scripts/generate-device-scoped-caps.ts — DO NOT EDIT.
|
|
@@ -4387,6 +4477,12 @@ Object.defineProperty(exports, "ReadinessTimeoutError", {
|
|
|
4387
4477
|
return ReadinessTimeoutError;
|
|
4388
4478
|
}
|
|
4389
4479
|
});
|
|
4480
|
+
Object.defineProperty(exports, "SECRET_META", {
|
|
4481
|
+
enumerable: true,
|
|
4482
|
+
get: function() {
|
|
4483
|
+
return SECRET_META;
|
|
4484
|
+
}
|
|
4485
|
+
});
|
|
4390
4486
|
Object.defineProperty(exports, "SHARE_VIEW_KINDS", {
|
|
4391
4487
|
enumerable: true,
|
|
4392
4488
|
get: function() {
|
|
@@ -4483,6 +4579,12 @@ Object.defineProperty(exports, "collectHydratedFieldValues", {
|
|
|
4483
4579
|
return collectHydratedFieldValues;
|
|
4484
4580
|
}
|
|
4485
4581
|
});
|
|
4582
|
+
Object.defineProperty(exports, "collectZodSecretPaths", {
|
|
4583
|
+
enumerable: true,
|
|
4584
|
+
get: function() {
|
|
4585
|
+
return collectZodSecretPaths;
|
|
4586
|
+
}
|
|
4587
|
+
});
|
|
4486
4588
|
Object.defineProperty(exports, "createDeviceProxy", {
|
|
4487
4589
|
enumerable: true,
|
|
4488
4590
|
get: function() {
|
|
@@ -4615,6 +4717,12 @@ Object.defineProperty(exports, "isEvent", {
|
|
|
4615
4717
|
return isEvent;
|
|
4616
4718
|
}
|
|
4617
4719
|
});
|
|
4720
|
+
Object.defineProperty(exports, "isZodSecret", {
|
|
4721
|
+
enumerable: true,
|
|
4722
|
+
get: function() {
|
|
4723
|
+
return isZodSecret;
|
|
4724
|
+
}
|
|
4725
|
+
});
|
|
4618
4726
|
Object.defineProperty(exports, "makeProfileBrokerId", {
|
|
4619
4727
|
enumerable: true,
|
|
4620
4728
|
get: function() {
|