@lushly-dev/violet-afd 0.0.0-stage → 0.3.0-preview.1
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/LICENSE +21 -0
- package/README.md +29 -2
- package/dist/commands/analyze/compare.d.ts +36 -0
- package/dist/commands/analyze/compare.d.ts.map +1 -0
- package/dist/commands/analyze/compare.js +196 -0
- package/dist/commands/analyze/compare.js.map +1 -0
- package/dist/commands/analyze/compliance.d.ts +41 -0
- package/dist/commands/analyze/compliance.d.ts.map +1 -0
- package/dist/commands/analyze/compliance.js +166 -0
- package/dist/commands/analyze/compliance.js.map +1 -0
- package/dist/commands/analyze/deviations.d.ts +30 -0
- package/dist/commands/analyze/deviations.d.ts.map +1 -0
- package/dist/commands/analyze/deviations.js +201 -0
- package/dist/commands/analyze/deviations.js.map +1 -0
- package/dist/commands/analyze/health.d.ts +211 -0
- package/dist/commands/analyze/health.d.ts.map +1 -0
- package/dist/commands/analyze/health.js +697 -0
- package/dist/commands/analyze/health.js.map +1 -0
- package/dist/commands/analyze/index.d.ts +15 -0
- package/dist/commands/analyze/index.d.ts.map +1 -0
- package/dist/commands/analyze/index.js +31 -0
- package/dist/commands/analyze/index.js.map +1 -0
- package/dist/commands/analyze/snapshot.d.ts +64 -0
- package/dist/commands/analyze/snapshot.d.ts.map +1 -0
- package/dist/commands/analyze/snapshot.js +126 -0
- package/dist/commands/analyze/snapshot.js.map +1 -0
- package/dist/commands/analyze/trends.d.ts +82 -0
- package/dist/commands/analyze/trends.d.ts.map +1 -0
- package/dist/commands/analyze/trends.js +312 -0
- package/dist/commands/analyze/trends.js.map +1 -0
- package/dist/commands/analyze/violations.d.ts +84 -0
- package/dist/commands/analyze/violations.d.ts.map +1 -0
- package/dist/commands/analyze/violations.js +158 -0
- package/dist/commands/analyze/violations.js.map +1 -0
- package/dist/commands/apikeys/check.d.ts +39 -0
- package/dist/commands/apikeys/check.d.ts.map +1 -0
- package/dist/commands/apikeys/check.js +61 -0
- package/dist/commands/apikeys/check.js.map +1 -0
- package/dist/commands/apikeys/create.d.ts +36 -0
- package/dist/commands/apikeys/create.d.ts.map +1 -0
- package/dist/commands/apikeys/create.js +116 -0
- package/dist/commands/apikeys/create.js.map +1 -0
- package/dist/commands/apikeys/index.d.ts +15 -0
- package/dist/commands/apikeys/index.d.ts.map +1 -0
- package/dist/commands/apikeys/index.js +21 -0
- package/dist/commands/apikeys/index.js.map +1 -0
- package/dist/commands/apikeys/keys.d.ts +79 -0
- package/dist/commands/apikeys/keys.d.ts.map +1 -0
- package/dist/commands/apikeys/keys.js +239 -0
- package/dist/commands/apikeys/keys.js.map +1 -0
- package/dist/commands/audit/index.d.ts +11 -0
- package/dist/commands/audit/index.d.ts.map +1 -0
- package/dist/commands/audit/index.js +15 -0
- package/dist/commands/audit/index.js.map +1 -0
- package/dist/commands/audit/list.d.ts +101 -0
- package/dist/commands/audit/list.d.ts.map +1 -0
- package/dist/commands/audit/list.js +230 -0
- package/dist/commands/audit/list.js.map +1 -0
- package/dist/commands/changes/impact.d.ts +477 -0
- package/dist/commands/changes/impact.d.ts.map +1 -0
- package/dist/commands/changes/impact.js +541 -0
- package/dist/commands/changes/impact.js.map +1 -0
- package/dist/commands/changes/index.d.ts +11 -0
- package/dist/commands/changes/index.d.ts.map +1 -0
- package/dist/commands/changes/index.js +15 -0
- package/dist/commands/changes/index.js.map +1 -0
- package/dist/commands/constraints/index.d.ts +11 -0
- package/dist/commands/constraints/index.d.ts.map +1 -0
- package/dist/commands/constraints/index.js +19 -0
- package/dist/commands/constraints/index.js.map +1 -0
- package/dist/commands/constraints/list.d.ts +52 -0
- package/dist/commands/constraints/list.d.ts.map +1 -0
- package/dist/commands/constraints/list.js +103 -0
- package/dist/commands/constraints/list.js.map +1 -0
- package/dist/commands/constraints/set.d.ts +50 -0
- package/dist/commands/constraints/set.d.ts.map +1 -0
- package/dist/commands/constraints/set.js +137 -0
- package/dist/commands/constraints/set.js.map +1 -0
- package/dist/commands/constraints/validate.d.ts +38 -0
- package/dist/commands/constraints/validate.d.ts.map +1 -0
- package/dist/commands/constraints/validate.js +164 -0
- package/dist/commands/constraints/validate.js.map +1 -0
- package/dist/commands/docs/generator.d.ts +77 -0
- package/dist/commands/docs/generator.d.ts.map +1 -0
- package/dist/commands/docs/generator.js +256 -0
- package/dist/commands/docs/generator.js.map +1 -0
- package/dist/commands/docs/index.d.ts +6 -0
- package/dist/commands/docs/index.d.ts.map +1 -0
- package/dist/commands/docs/index.js +6 -0
- package/dist/commands/docs/index.js.map +1 -0
- package/dist/commands/export/export.d.ts +64 -0
- package/dist/commands/export/export.d.ts.map +1 -0
- package/dist/commands/export/export.js +193 -0
- package/dist/commands/export/export.js.map +1 -0
- package/dist/commands/export/index.d.ts +9 -0
- package/dist/commands/export/index.d.ts.map +1 -0
- package/dist/commands/export/index.js +13 -0
- package/dist/commands/export/index.js.map +1 -0
- package/dist/commands/import/flatten.d.ts +30 -0
- package/dist/commands/import/flatten.d.ts.map +1 -0
- package/dist/commands/import/flatten.js +121 -0
- package/dist/commands/import/flatten.js.map +1 -0
- package/dist/commands/import/index.d.ts +11 -0
- package/dist/commands/import/index.d.ts.map +1 -0
- package/dist/commands/import/index.js +19 -0
- package/dist/commands/import/index.js.map +1 -0
- package/dist/commands/import/json.d.ts +40 -0
- package/dist/commands/import/json.d.ts.map +1 -0
- package/dist/commands/import/json.js +209 -0
- package/dist/commands/import/json.js.map +1 -0
- package/dist/commands/import/tree.d.ts +39 -0
- package/dist/commands/import/tree.d.ts.map +1 -0
- package/dist/commands/import/tree.js +247 -0
- package/dist/commands/import/tree.js.map +1 -0
- package/dist/commands/import/validate.d.ts +53 -0
- package/dist/commands/import/validate.d.ts.map +1 -0
- package/dist/commands/import/validate.js +201 -0
- package/dist/commands/import/validate.js.map +1 -0
- package/dist/commands/index.d.ts +21 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +21 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/json-schema.d.ts +21 -0
- package/dist/commands/json-schema.d.ts.map +1 -0
- package/dist/commands/json-schema.js +41 -0
- package/dist/commands/json-schema.js.map +1 -0
- package/dist/commands/node/create.d.ts +80 -0
- package/dist/commands/node/create.d.ts.map +1 -0
- package/dist/commands/node/create.js +174 -0
- package/dist/commands/node/create.js.map +1 -0
- package/dist/commands/node/delete.d.ts +28 -0
- package/dist/commands/node/delete.d.ts.map +1 -0
- package/dist/commands/node/delete.js +134 -0
- package/dist/commands/node/delete.js.map +1 -0
- package/dist/commands/node/deprecation.d.ts +23 -0
- package/dist/commands/node/deprecation.d.ts.map +1 -0
- package/dist/commands/node/deprecation.js +59 -0
- package/dist/commands/node/deprecation.js.map +1 -0
- package/dist/commands/node/get.d.ts +79 -0
- package/dist/commands/node/get.d.ts.map +1 -0
- package/dist/commands/node/get.js +106 -0
- package/dist/commands/node/get.js.map +1 -0
- package/dist/commands/node/graph.d.ts +138 -0
- package/dist/commands/node/graph.d.ts.map +1 -0
- package/dist/commands/node/graph.js +285 -0
- package/dist/commands/node/graph.js.map +1 -0
- package/dist/commands/node/index.d.ts +17 -0
- package/dist/commands/node/index.d.ts.map +1 -0
- package/dist/commands/node/index.js +31 -0
- package/dist/commands/node/index.js.map +1 -0
- package/dist/commands/node/list.d.ts +74 -0
- package/dist/commands/node/list.d.ts.map +1 -0
- package/dist/commands/node/list.js +130 -0
- package/dist/commands/node/list.js.map +1 -0
- package/dist/commands/node/operations.d.ts +35 -0
- package/dist/commands/node/operations.d.ts.map +1 -0
- package/dist/commands/node/operations.js +66 -0
- package/dist/commands/node/operations.js.map +1 -0
- package/dist/commands/node/scope.d.ts +14 -0
- package/dist/commands/node/scope.d.ts.map +1 -0
- package/dist/commands/node/scope.js +49 -0
- package/dist/commands/node/scope.js.map +1 -0
- package/dist/commands/node/update.d.ts +84 -0
- package/dist/commands/node/update.d.ts.map +1 -0
- package/dist/commands/node/update.js +229 -0
- package/dist/commands/node/update.js.map +1 -0
- package/dist/commands/registry.d.ts +126 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands/registry.js +141 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/commands/specimen/get.d.ts +47 -0
- package/dist/commands/specimen/get.d.ts.map +1 -0
- package/dist/commands/specimen/get.js +124 -0
- package/dist/commands/specimen/get.js.map +1 -0
- package/dist/commands/specimen/index.d.ts +10 -0
- package/dist/commands/specimen/index.d.ts.map +1 -0
- package/dist/commands/specimen/index.js +16 -0
- package/dist/commands/specimen/index.js.map +1 -0
- package/dist/commands/specimen/set.d.ts +31 -0
- package/dist/commands/specimen/set.d.ts.map +1 -0
- package/dist/commands/specimen/set.js +198 -0
- package/dist/commands/specimen/set.js.map +1 -0
- package/dist/commands/specimen/shared.d.ts +15 -0
- package/dist/commands/specimen/shared.d.ts.map +1 -0
- package/dist/commands/specimen/shared.js +26 -0
- package/dist/commands/specimen/shared.js.map +1 -0
- package/dist/commands/system/doctor.d.ts +48 -0
- package/dist/commands/system/doctor.d.ts.map +1 -0
- package/dist/commands/system/doctor.js +224 -0
- package/dist/commands/system/doctor.js.map +1 -0
- package/dist/commands/system/index.d.ts +12 -0
- package/dist/commands/system/index.d.ts.map +1 -0
- package/dist/commands/system/index.js +17 -0
- package/dist/commands/system/index.js.map +1 -0
- package/dist/commands/system/validate.d.ts +47 -0
- package/dist/commands/system/validate.d.ts.map +1 -0
- package/dist/commands/system/validate.js +245 -0
- package/dist/commands/system/validate.js.map +1 -0
- package/dist/commands/token/add.d.ts +94 -0
- package/dist/commands/token/add.d.ts.map +1 -0
- package/dist/commands/token/add.js +162 -0
- package/dist/commands/token/add.js.map +1 -0
- package/dist/commands/token/catalog.d.ts +69 -0
- package/dist/commands/token/catalog.d.ts.map +1 -0
- package/dist/commands/token/catalog.js +175 -0
- package/dist/commands/token/catalog.js.map +1 -0
- package/dist/commands/token/compare.d.ts +140 -0
- package/dist/commands/token/compare.d.ts.map +1 -0
- package/dist/commands/token/compare.js +207 -0
- package/dist/commands/token/compare.js.map +1 -0
- package/dist/commands/token/copy.d.ts +31 -0
- package/dist/commands/token/copy.d.ts.map +1 -0
- package/dist/commands/token/copy.js +179 -0
- package/dist/commands/token/copy.js.map +1 -0
- package/dist/commands/token/definitions.d.ts +29 -0
- package/dist/commands/token/definitions.d.ts.map +1 -0
- package/dist/commands/token/definitions.js +63 -0
- package/dist/commands/token/definitions.js.map +1 -0
- package/dist/commands/token/index.d.ts +22 -0
- package/dist/commands/token/index.d.ts.map +1 -0
- package/dist/commands/token/index.js +44 -0
- package/dist/commands/token/index.js.map +1 -0
- package/dist/commands/token/lineage.d.ts +43 -0
- package/dist/commands/token/lineage.d.ts.map +1 -0
- package/dist/commands/token/lineage.js +187 -0
- package/dist/commands/token/lineage.js.map +1 -0
- package/dist/commands/token/matrix.d.ts +249 -0
- package/dist/commands/token/matrix.d.ts.map +1 -0
- package/dist/commands/token/matrix.js +658 -0
- package/dist/commands/token/matrix.js.map +1 -0
- package/dist/commands/token/override.d.ts +51 -0
- package/dist/commands/token/override.d.ts.map +1 -0
- package/dist/commands/token/override.js +158 -0
- package/dist/commands/token/override.js.map +1 -0
- package/dist/commands/token/previous-value.d.ts +23 -0
- package/dist/commands/token/previous-value.d.ts.map +1 -0
- package/dist/commands/token/previous-value.js +26 -0
- package/dist/commands/token/previous-value.js.map +1 -0
- package/dist/commands/token/reset.d.ts +29 -0
- package/dist/commands/token/reset.d.ts.map +1 -0
- package/dist/commands/token/reset.js +143 -0
- package/dist/commands/token/reset.js.map +1 -0
- package/dist/commands/token/resolve.d.ts +43 -0
- package/dist/commands/token/resolve.d.ts.map +1 -0
- package/dist/commands/token/resolve.js +136 -0
- package/dist/commands/token/resolve.js.map +1 -0
- package/dist/commands/token/subtract.d.ts +27 -0
- package/dist/commands/token/subtract.d.ts.map +1 -0
- package/dist/commands/token/subtract.js +129 -0
- package/dist/commands/token/subtract.js.map +1 -0
- package/dist/commands/webhooks/delete.d.ts +31 -0
- package/dist/commands/webhooks/delete.d.ts.map +1 -0
- package/dist/commands/webhooks/delete.js +94 -0
- package/dist/commands/webhooks/delete.js.map +1 -0
- package/dist/commands/webhooks/get.d.ts +50 -0
- package/dist/commands/webhooks/get.d.ts.map +1 -0
- package/dist/commands/webhooks/get.js +122 -0
- package/dist/commands/webhooks/get.js.map +1 -0
- package/dist/commands/webhooks/index.d.ts +24 -0
- package/dist/commands/webhooks/index.d.ts.map +1 -0
- package/dist/commands/webhooks/index.js +41 -0
- package/dist/commands/webhooks/index.js.map +1 -0
- package/dist/commands/webhooks/list.d.ts +72 -0
- package/dist/commands/webhooks/list.d.ts.map +1 -0
- package/dist/commands/webhooks/list.js +116 -0
- package/dist/commands/webhooks/list.js.map +1 -0
- package/dist/commands/webhooks/logs.d.ts +65 -0
- package/dist/commands/webhooks/logs.d.ts.map +1 -0
- package/dist/commands/webhooks/logs.js +138 -0
- package/dist/commands/webhooks/logs.js.map +1 -0
- package/dist/commands/webhooks/redact.d.ts +18 -0
- package/dist/commands/webhooks/redact.d.ts.map +1 -0
- package/dist/commands/webhooks/redact.js +24 -0
- package/dist/commands/webhooks/redact.js.map +1 -0
- package/dist/commands/webhooks/register.d.ts +78 -0
- package/dist/commands/webhooks/register.d.ts.map +1 -0
- package/dist/commands/webhooks/register.js +175 -0
- package/dist/commands/webhooks/register.js.map +1 -0
- package/dist/commands/webhooks/test.d.ts +32 -0
- package/dist/commands/webhooks/test.d.ts.map +1 -0
- package/dist/commands/webhooks/test.js +101 -0
- package/dist/commands/webhooks/test.js.map +1 -0
- package/dist/commands/webhooks/update.d.ts +77 -0
- package/dist/commands/webhooks/update.d.ts.map +1 -0
- package/dist/commands/webhooks/update.js +198 -0
- package/dist/commands/webhooks/update.js.map +1 -0
- package/dist/css.d.ts +3 -0
- package/dist/css.d.ts.map +1 -0
- package/dist/css.js +3 -0
- package/dist/css.js.map +1 -0
- package/dist/demo/index.d.ts +8 -0
- package/dist/demo/index.d.ts.map +1 -0
- package/dist/demo/index.js +8 -0
- package/dist/demo/index.js.map +1 -0
- package/dist/demo/realistic-system.d.ts +54 -0
- package/dist/demo/realistic-system.d.ts.map +1 -0
- package/dist/demo/realistic-system.js +919 -0
- package/dist/demo/realistic-system.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/types/command-result.d.ts +10 -0
- package/dist/types/command-result.d.ts.map +1 -0
- package/dist/types/command-result.js +11 -0
- package/dist/types/command-result.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/dist/webhooks/dispatcher.d.ts +147 -0
- package/dist/webhooks/dispatcher.d.ts.map +1 -0
- package/dist/webhooks/dispatcher.js +420 -0
- package/dist/webhooks/dispatcher.js.map +1 -0
- package/dist/webhooks/index.d.ts +9 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/index.js +9 -0
- package/dist/webhooks/index.js.map +1 -0
- package/dist/webhooks/signer.d.ts +119 -0
- package/dist/webhooks/signer.d.ts.map +1 -0
- package/dist/webhooks/signer.js +149 -0
- package/dist/webhooks/signer.js.map +1 -0
- package/dist/webhooks/url-policy.d.ts +73 -0
- package/dist/webhooks/url-policy.d.ts.map +1 -0
- package/dist/webhooks/url-policy.js +250 -0
- package/dist/webhooks/url-policy.js.map +1 -0
- package/dist/worker.d.ts +11 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +31 -0
- package/dist/worker.js.map +1 -0
- package/package.json +84 -3
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CommandDefinition } from '../registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for node.list command
|
|
5
|
+
*/
|
|
6
|
+
declare const InputSchema: z.ZodObject<{
|
|
7
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
view: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
flat: "flat";
|
|
10
|
+
tree: "tree";
|
|
11
|
+
}>>>;
|
|
12
|
+
includeDeleted: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
13
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
type: z.ZodOptional<z.ZodString>;
|
|
15
|
+
status: z.ZodOptional<z.ZodString>;
|
|
16
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/**
|
|
20
|
+
* Output schema for node.list command
|
|
21
|
+
*/
|
|
22
|
+
declare const OutputSchema: z.ZodObject<{
|
|
23
|
+
nodes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
27
|
+
type: z.ZodEnum<{
|
|
28
|
+
custom: "custom";
|
|
29
|
+
device: "device";
|
|
30
|
+
experiment: "experiment";
|
|
31
|
+
locale: "locale";
|
|
32
|
+
platform: "platform";
|
|
33
|
+
product: "product";
|
|
34
|
+
root: "root";
|
|
35
|
+
shared: "shared";
|
|
36
|
+
theme: "theme";
|
|
37
|
+
}>;
|
|
38
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
39
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
40
|
+
active: "active";
|
|
41
|
+
deprecated: "deprecated";
|
|
42
|
+
experimental: "experimental";
|
|
43
|
+
}>>;
|
|
44
|
+
sunsetAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
+
replacedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
includes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
47
|
+
includePolicy: z.ZodDefault<z.ZodEnum<{
|
|
48
|
+
merge: "merge";
|
|
49
|
+
override: "override";
|
|
50
|
+
}>>;
|
|
51
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
52
|
+
createdAt: z.ZodString;
|
|
53
|
+
updatedAt: z.ZodString;
|
|
54
|
+
deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
}, z.core.$strip>>>;
|
|
56
|
+
tree: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
type: z.ZodString;
|
|
60
|
+
status: z.ZodString;
|
|
61
|
+
depth: z.ZodNumber;
|
|
62
|
+
children: z.ZodArray<z.ZodAny>;
|
|
63
|
+
}, z.core.$strip>>>;
|
|
64
|
+
total: z.ZodNumber;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
type Output = z.infer<typeof OutputSchema>;
|
|
67
|
+
/**
|
|
68
|
+
* node.list command
|
|
69
|
+
*
|
|
70
|
+
* List nodes, optionally filtered or as a tree view.
|
|
71
|
+
*/
|
|
72
|
+
export declare const nodeListCommand: CommandDefinition<typeof InputSchema, Output>;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/node/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExE;;GAEG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;iBAWf,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAehB,CAAC;AAEH,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,OAAO,WAAW,EAAE,MAAM,CA8EzE,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { NodeSchema } from '@lushly-dev/violet-core/types';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { success } from '../../types/command-result.js';
|
|
4
|
+
/**
|
|
5
|
+
* Input schema for node.list command
|
|
6
|
+
*/
|
|
7
|
+
const InputSchema = z.object({
|
|
8
|
+
parentId: z.string().nullable().optional(),
|
|
9
|
+
view: z.enum(['flat', 'tree']).optional().default('flat'),
|
|
10
|
+
includeDeleted: z.boolean().optional().default(false),
|
|
11
|
+
filter: z
|
|
12
|
+
.object({
|
|
13
|
+
type: z.string().optional(),
|
|
14
|
+
status: z.string().optional(),
|
|
15
|
+
tags: z.array(z.string()).optional(),
|
|
16
|
+
})
|
|
17
|
+
.optional(),
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Output schema for node.list command
|
|
21
|
+
*/
|
|
22
|
+
const OutputSchema = z.object({
|
|
23
|
+
nodes: z.array(NodeSchema).optional(),
|
|
24
|
+
tree: z
|
|
25
|
+
.array(z.object({
|
|
26
|
+
id: z.string(),
|
|
27
|
+
name: z.string(),
|
|
28
|
+
type: z.string(),
|
|
29
|
+
status: z.string(),
|
|
30
|
+
depth: z.number(),
|
|
31
|
+
children: z.array(z.any()), // Recursive type
|
|
32
|
+
}))
|
|
33
|
+
.optional(),
|
|
34
|
+
total: z.number(),
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* node.list command
|
|
38
|
+
*
|
|
39
|
+
* List nodes, optionally filtered or as a tree view.
|
|
40
|
+
*/
|
|
41
|
+
export const nodeListCommand = {
|
|
42
|
+
name: 'node.list',
|
|
43
|
+
description: 'List nodes in the design system tree',
|
|
44
|
+
category: 'node',
|
|
45
|
+
inputSchema: InputSchema,
|
|
46
|
+
outputSchema: OutputSchema,
|
|
47
|
+
async handler(rawInput, context) {
|
|
48
|
+
const { db } = context;
|
|
49
|
+
// Parse input to apply defaults
|
|
50
|
+
const input = InputSchema.parse(rawInput);
|
|
51
|
+
let nodes = await db.listNodes(input.parentId);
|
|
52
|
+
// Filter out deleted nodes unless requested
|
|
53
|
+
if (!input.includeDeleted) {
|
|
54
|
+
nodes = nodes.filter((n) => !n.deletedAt);
|
|
55
|
+
}
|
|
56
|
+
// Apply filters
|
|
57
|
+
if (input.filter) {
|
|
58
|
+
if (input.filter.type) {
|
|
59
|
+
nodes = nodes.filter((n) => n.type === input.filter?.type);
|
|
60
|
+
}
|
|
61
|
+
if (input.filter.status) {
|
|
62
|
+
nodes = nodes.filter((n) => n.status === input.filter?.status);
|
|
63
|
+
}
|
|
64
|
+
if (input.filter.tags && input.filter.tags.length > 0) {
|
|
65
|
+
nodes = nodes.filter((n) => input.filter?.tags?.some((tag) => n.tags.includes(tag)));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Return appropriate view
|
|
69
|
+
if (input.view === 'tree') {
|
|
70
|
+
const tree = await buildTree(db, nodes);
|
|
71
|
+
return success({ tree, total: nodes.length }, {
|
|
72
|
+
reasoning: `Found ${nodes.length} nodes in tree view`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return success({ nodes, total: nodes.length }, {
|
|
76
|
+
reasoning: `Found ${nodes.length} nodes`,
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
examples: [
|
|
80
|
+
{
|
|
81
|
+
description: 'List all nodes',
|
|
82
|
+
input: {},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
description: 'List children of a specific node',
|
|
86
|
+
input: {
|
|
87
|
+
parentId: 'global-base',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
description: 'List as tree view',
|
|
92
|
+
input: {
|
|
93
|
+
view: 'tree',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
description: 'Filter by type',
|
|
98
|
+
input: {
|
|
99
|
+
filter: {
|
|
100
|
+
type: 'product',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Build tree structure from flat node list
|
|
108
|
+
*/
|
|
109
|
+
async function buildTree(db, _nodes) {
|
|
110
|
+
// Get all nodes for tree building
|
|
111
|
+
const allNodes = await db.listNodes();
|
|
112
|
+
// Find root nodes (no parent or parent is null)
|
|
113
|
+
const rootNodes = allNodes.filter((n) => !n.parentId && !n.deletedAt);
|
|
114
|
+
// Recursive tree builder
|
|
115
|
+
function buildSubtree(node, depth) {
|
|
116
|
+
const children = allNodes
|
|
117
|
+
.filter((n) => n.parentId === node.id && !n.deletedAt)
|
|
118
|
+
.map((child) => buildSubtree(child, depth + 1));
|
|
119
|
+
return {
|
|
120
|
+
id: node.id,
|
|
121
|
+
name: node.name,
|
|
122
|
+
type: node.type,
|
|
123
|
+
status: node.status,
|
|
124
|
+
depth,
|
|
125
|
+
children,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return rootNodes.map((root) => buildSubtree(root, 0));
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/node/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAGxD;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC1C,IAAI,EAAE,CAAC,C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IACzB,SAAS,YAAY,CACpB,IAAkD,EAClD,KAAa;QAEb,MAAM,QAAQ,GAAG,QAAQ;aACvB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;aACrD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;QAEjD,OAAO;YACN,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK;YACL,QAAQ;SACR,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { OperationRecord } from '@lushly-dev/violet-core/types';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* A node's own operation as nodes.graph (`includeOperations`) and node.get
|
|
5
|
+
* (`includeOperations`) list it: the stored record with its value parsed, and
|
|
6
|
+
* whether a later operation on the node replaced it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const GraphOperationSchema: z.ZodObject<{
|
|
9
|
+
sequence: z.ZodNumber;
|
|
10
|
+
type: z.ZodEnum<{
|
|
11
|
+
add: "add";
|
|
12
|
+
copy: "copy";
|
|
13
|
+
override: "override";
|
|
14
|
+
reset: "reset";
|
|
15
|
+
subtract: "subtract";
|
|
16
|
+
}>;
|
|
17
|
+
tokenId: z.ZodString;
|
|
18
|
+
value: z.ZodOptional<z.ZodAny>;
|
|
19
|
+
fromNode: z.ZodOptional<z.ZodString>;
|
|
20
|
+
asTokenId: z.ZodOptional<z.ZodString>;
|
|
21
|
+
toAncestor: z.ZodOptional<z.ZodString>;
|
|
22
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
23
|
+
author: z.ZodOptional<z.ZodString>;
|
|
24
|
+
createdAt: z.ZodString;
|
|
25
|
+
supersededBy: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
tracksSource: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type GraphOperation = z.infer<typeof GraphOperationSchema>;
|
|
29
|
+
/**
|
|
30
|
+
* A node's operations in sequence order, each marked with the later operation
|
|
31
|
+
* that replaced it for the same token, so only the last change per token reads
|
|
32
|
+
* as effective.
|
|
33
|
+
*/
|
|
34
|
+
export declare function toGraphOperations(ops: OperationRecord[]): GraphOperation[];
|
|
35
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/commands/node/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;iBAe/B,CAAC;AAWH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAkBlE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,cAAc,EAAE,CAU1E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { operationTarget } from '../token/definitions.js';
|
|
3
|
+
/**
|
|
4
|
+
* A node's own operation as nodes.graph (`includeOperations`) and node.get
|
|
5
|
+
* (`includeOperations`) list it: the stored record with its value parsed, and
|
|
6
|
+
* whether a later operation on the node replaced it.
|
|
7
|
+
*/
|
|
8
|
+
export const GraphOperationSchema = z.object({
|
|
9
|
+
sequence: z.number(),
|
|
10
|
+
type: z.enum(['add', 'override', 'subtract', 'reset', 'copy']),
|
|
11
|
+
tokenId: z.string(),
|
|
12
|
+
value: z.any().optional(),
|
|
13
|
+
fromNode: z.string().optional(),
|
|
14
|
+
asTokenId: z.string().optional(),
|
|
15
|
+
toAncestor: z.string().optional(),
|
|
16
|
+
reason: z.string().optional(),
|
|
17
|
+
author: z.string().optional(),
|
|
18
|
+
createdAt: z.string(),
|
|
19
|
+
/** Sequence of the later operation on this node that replaced this one for the same token */
|
|
20
|
+
supersededBy: z.number().optional(),
|
|
21
|
+
/** Copies only: true because later changes at `fromNode` show up here (read live) */
|
|
22
|
+
tracksSource: z.boolean().optional(),
|
|
23
|
+
});
|
|
24
|
+
function parseValue(raw) {
|
|
25
|
+
if (raw === null)
|
|
26
|
+
return undefined;
|
|
27
|
+
try {
|
|
28
|
+
return JSON.parse(raw);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return raw;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function toGraphOperation(op) {
|
|
35
|
+
return {
|
|
36
|
+
sequence: op.sequence,
|
|
37
|
+
type: op.type,
|
|
38
|
+
tokenId: op.tokenId,
|
|
39
|
+
value: parseValue(op.value),
|
|
40
|
+
fromNode: op.fromNode ?? undefined,
|
|
41
|
+
asTokenId: op.asTokenId ?? undefined,
|
|
42
|
+
toAncestor: op.toAncestor ?? undefined,
|
|
43
|
+
reason: op.reason ?? undefined,
|
|
44
|
+
author: op.author ?? undefined,
|
|
45
|
+
createdAt: op.createdAt,
|
|
46
|
+
tracksSource: op.type === 'copy' ? true : undefined,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A node's operations in sequence order, each marked with the later operation
|
|
51
|
+
* that replaced it for the same token, so only the last change per token reads
|
|
52
|
+
* as effective.
|
|
53
|
+
*/
|
|
54
|
+
export function toGraphOperations(ops) {
|
|
55
|
+
const result = ops.map(toGraphOperation);
|
|
56
|
+
const latest = new Map();
|
|
57
|
+
for (let i = ops.length - 1; i >= 0; i--) {
|
|
58
|
+
const target = operationTarget(ops[i]);
|
|
59
|
+
const later = latest.get(target);
|
|
60
|
+
if (later)
|
|
61
|
+
result[i].supersededBy = later.sequence;
|
|
62
|
+
latest.set(target, result[i]);
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/commands/node/operations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACzB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB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G,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,KAAK;YAAE,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC;QACnD,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Node } from '@lushly-dev/violet-core/types';
|
|
2
|
+
import type { CommandContext } from '../registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Order nodes depth-first so each subtree is contiguous and parents precede
|
|
5
|
+
* children. Siblings are ordered by name for a stable layout.
|
|
6
|
+
*/
|
|
7
|
+
export declare function orderDepthFirst(nodes: Node[], rootIds: string[]): Node[];
|
|
8
|
+
/**
|
|
9
|
+
* The live (non-deleted) nodes of one subtree, or of every tree when `rootId`
|
|
10
|
+
* is omitted, in depth-first order. Nodes whose parent is missing or deleted
|
|
11
|
+
* count as roots. Returns null when `rootId` names no live node.
|
|
12
|
+
*/
|
|
13
|
+
export declare function selectSubtree(db: CommandContext['db'], rootId?: string): Promise<Node[] | null>;
|
|
14
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/commands/node/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CA0BxE;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAClC,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,EACxB,MAAM,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAYxB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Order nodes depth-first so each subtree is contiguous and parents precede
|
|
3
|
+
* children. Siblings are ordered by name for a stable layout.
|
|
4
|
+
*/
|
|
5
|
+
export function orderDepthFirst(nodes, rootIds) {
|
|
6
|
+
const byParent = new Map();
|
|
7
|
+
for (const node of nodes) {
|
|
8
|
+
const siblings = byParent.get(node.parentId) ?? [];
|
|
9
|
+
siblings.push(node);
|
|
10
|
+
byParent.set(node.parentId, siblings);
|
|
11
|
+
}
|
|
12
|
+
for (const siblings of byParent.values()) {
|
|
13
|
+
siblings.sort((a, b) => a.name.localeCompare(b.name));
|
|
14
|
+
}
|
|
15
|
+
const byId = new Map(nodes.map((node) => [node.id, node]));
|
|
16
|
+
const ordered = [];
|
|
17
|
+
const visit = (node) => {
|
|
18
|
+
ordered.push(node);
|
|
19
|
+
for (const child of byParent.get(node.id) ?? []) {
|
|
20
|
+
visit(child);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
for (const rootId of rootIds) {
|
|
24
|
+
const root = byId.get(rootId);
|
|
25
|
+
if (root) {
|
|
26
|
+
visit(root);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return ordered;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The live (non-deleted) nodes of one subtree, or of every tree when `rootId`
|
|
33
|
+
* is omitted, in depth-first order. Nodes whose parent is missing or deleted
|
|
34
|
+
* count as roots. Returns null when `rootId` names no live node.
|
|
35
|
+
*/
|
|
36
|
+
export async function selectSubtree(db, rootId) {
|
|
37
|
+
const live = (await db.listNodes()).filter((node) => !node.deletedAt);
|
|
38
|
+
if (rootId) {
|
|
39
|
+
const root = live.find((node) => node.id === rootId);
|
|
40
|
+
return root ? orderDepthFirst(live, [root.id]) : null;
|
|
41
|
+
}
|
|
42
|
+
const liveIds = new Set(live.map((node) => node.id));
|
|
43
|
+
const rootIds = live
|
|
44
|
+
.filter((node) => !node.parentId || !liveIds.has(node.parentId))
|
|
45
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
46
|
+
.map((node) => node.id);
|
|
47
|
+
return orderDepthFirst(live, rootIds);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/commands/node/scope.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,OAAiB;IAC/D,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;IAClD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IACD,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1C,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAA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AM,OAAO,GAAG,IAAI;SAClB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC/D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SAC5C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,OAAO,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CommandDefinition } from '../registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for node.update command
|
|
5
|
+
*/
|
|
6
|
+
declare const InputSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
updates: z.ZodObject<{
|
|
9
|
+
name: z.ZodOptional<z.ZodString>;
|
|
10
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
custom: "custom";
|
|
12
|
+
device: "device";
|
|
13
|
+
experiment: "experiment";
|
|
14
|
+
locale: "locale";
|
|
15
|
+
platform: "platform";
|
|
16
|
+
product: "product";
|
|
17
|
+
root: "root";
|
|
18
|
+
shared: "shared";
|
|
19
|
+
theme: "theme";
|
|
20
|
+
}>>;
|
|
21
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
22
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
active: "active";
|
|
24
|
+
deprecated: "deprecated";
|
|
25
|
+
experimental: "experimental";
|
|
26
|
+
}>>;
|
|
27
|
+
sunsetAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
replacedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
|
+
includePolicy: z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
merge: "merge";
|
|
32
|
+
override: "override";
|
|
33
|
+
}>>;
|
|
34
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
/**
|
|
38
|
+
* Output schema for node.update command
|
|
39
|
+
*/
|
|
40
|
+
declare const OutputSchema: z.ZodObject<{
|
|
41
|
+
node: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
45
|
+
type: z.ZodEnum<{
|
|
46
|
+
custom: "custom";
|
|
47
|
+
device: "device";
|
|
48
|
+
experiment: "experiment";
|
|
49
|
+
locale: "locale";
|
|
50
|
+
platform: "platform";
|
|
51
|
+
product: "product";
|
|
52
|
+
root: "root";
|
|
53
|
+
shared: "shared";
|
|
54
|
+
theme: "theme";
|
|
55
|
+
}>;
|
|
56
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
57
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
58
|
+
active: "active";
|
|
59
|
+
deprecated: "deprecated";
|
|
60
|
+
experimental: "experimental";
|
|
61
|
+
}>>;
|
|
62
|
+
sunsetAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
|
+
replacedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
+
includes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
65
|
+
includePolicy: z.ZodDefault<z.ZodEnum<{
|
|
66
|
+
merge: "merge";
|
|
67
|
+
override: "override";
|
|
68
|
+
}>>;
|
|
69
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
70
|
+
createdAt: z.ZodString;
|
|
71
|
+
updatedAt: z.ZodString;
|
|
72
|
+
deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
changedFields: z.ZodArray<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
type Output = z.infer<typeof OutputSchema>;
|
|
77
|
+
/**
|
|
78
|
+
* node.update command
|
|
79
|
+
*
|
|
80
|
+
* Update a node's properties.
|
|
81
|
+
*/
|
|
82
|
+
export declare const nodeUpdateCommand: CommandDefinition<typeof InputSchema, Output>;
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/node/update.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE;;GAEG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGf,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGhB,CAAC;AAEH,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,WAAW,EAAE,MAAM,CA6O3E,CAAC"}
|