@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,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CommandDefinition } from '../registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for node.create command
|
|
5
|
+
*/
|
|
6
|
+
declare const InputSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
parentId: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
10
|
+
type: z.ZodDefault<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.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
active: "active";
|
|
24
|
+
deprecated: "deprecated";
|
|
25
|
+
experimental: "experimental";
|
|
26
|
+
}>>>;
|
|
27
|
+
sunsetAt: z.ZodOptional<z.ZodString>;
|
|
28
|
+
replacedBy: z.ZodOptional<z.ZodString>;
|
|
29
|
+
includes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
30
|
+
includePolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
merge: "merge";
|
|
32
|
+
override: "override";
|
|
33
|
+
}>>>;
|
|
34
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
/**
|
|
37
|
+
* Output schema for node.create command
|
|
38
|
+
*/
|
|
39
|
+
declare const OutputSchema: z.ZodObject<{
|
|
40
|
+
node: z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
44
|
+
type: z.ZodEnum<{
|
|
45
|
+
custom: "custom";
|
|
46
|
+
device: "device";
|
|
47
|
+
experiment: "experiment";
|
|
48
|
+
locale: "locale";
|
|
49
|
+
platform: "platform";
|
|
50
|
+
product: "product";
|
|
51
|
+
root: "root";
|
|
52
|
+
shared: "shared";
|
|
53
|
+
theme: "theme";
|
|
54
|
+
}>;
|
|
55
|
+
status: z.ZodEnum<{
|
|
56
|
+
active: "active";
|
|
57
|
+
deprecated: "deprecated";
|
|
58
|
+
experimental: "experimental";
|
|
59
|
+
}>;
|
|
60
|
+
sunsetAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
replacedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
|
+
includes: z.ZodArray<z.ZodString>;
|
|
63
|
+
includePolicy: z.ZodEnum<{
|
|
64
|
+
merge: "merge";
|
|
65
|
+
override: "override";
|
|
66
|
+
}>;
|
|
67
|
+
tags: z.ZodArray<z.ZodString>;
|
|
68
|
+
createdAt: z.ZodString;
|
|
69
|
+
updatedAt: z.ZodString;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
type Output = z.infer<typeof OutputSchema>;
|
|
73
|
+
/**
|
|
74
|
+
* node.create command
|
|
75
|
+
*
|
|
76
|
+
* Creates a new node in the design system tree.
|
|
77
|
+
*/
|
|
78
|
+
export declare const nodeCreateCommand: CommandDefinition<typeof InputSchema, Output>;
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/node/create.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE;;GAEG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAwB,CAAC;AAE1C;;GAEG;AACH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAehB,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,CAmJ3E,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { CreateNodeInputSchema, IncludePolicySchema, NodeStatusSchema, NodeTypeSchema, } from '@lushly-dev/violet-core/types';
|
|
2
|
+
import { nanoid } from 'nanoid';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { ErrorCodes, failure, success } from '../../types/command-result.js';
|
|
5
|
+
import { checkDeprecationPlan } from './deprecation.js';
|
|
6
|
+
/**
|
|
7
|
+
* Input schema for node.create command
|
|
8
|
+
*/
|
|
9
|
+
const InputSchema = CreateNodeInputSchema;
|
|
10
|
+
/**
|
|
11
|
+
* Output schema for node.create command
|
|
12
|
+
*/
|
|
13
|
+
const OutputSchema = z.object({
|
|
14
|
+
node: z.object({
|
|
15
|
+
id: z.string(),
|
|
16
|
+
name: z.string(),
|
|
17
|
+
parentId: z.string().nullable(),
|
|
18
|
+
type: NodeTypeSchema,
|
|
19
|
+
status: NodeStatusSchema,
|
|
20
|
+
sunsetAt: z.string().nullable().optional(),
|
|
21
|
+
replacedBy: z.string().nullable().optional(),
|
|
22
|
+
includes: z.array(z.string()),
|
|
23
|
+
includePolicy: IncludePolicySchema,
|
|
24
|
+
tags: z.array(z.string()),
|
|
25
|
+
createdAt: z.string(),
|
|
26
|
+
updatedAt: z.string(),
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* node.create command
|
|
31
|
+
*
|
|
32
|
+
* Creates a new node in the design system tree.
|
|
33
|
+
*/
|
|
34
|
+
export const nodeCreateCommand = {
|
|
35
|
+
name: 'node.create',
|
|
36
|
+
description: 'Create a new node in the design system tree',
|
|
37
|
+
category: 'node',
|
|
38
|
+
inputSchema: InputSchema,
|
|
39
|
+
outputSchema: OutputSchema,
|
|
40
|
+
async handler(rawInput, context) {
|
|
41
|
+
const { db, actor } = context;
|
|
42
|
+
// Parse input to apply defaults
|
|
43
|
+
const input = InputSchema.parse(rawInput);
|
|
44
|
+
// Generate ID if not provided
|
|
45
|
+
const nodeId = input.id || generateNodeId(input.name);
|
|
46
|
+
// Check if node already exists
|
|
47
|
+
const existing = await db.getNode(nodeId);
|
|
48
|
+
if (existing) {
|
|
49
|
+
return failure({
|
|
50
|
+
code: ErrorCodes.NODE_ALREADY_EXISTS,
|
|
51
|
+
message: `Node '${nodeId}' already exists`,
|
|
52
|
+
suggestion: `Use 'node.update' to modify an existing node, or choose a different ID`,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// Validate parent exists (if provided)
|
|
56
|
+
if (input.parentId) {
|
|
57
|
+
const parent = await db.getNode(input.parentId);
|
|
58
|
+
if (!parent) {
|
|
59
|
+
return failure({
|
|
60
|
+
code: ErrorCodes.INVALID_PARENT,
|
|
61
|
+
message: `Parent node '${input.parentId}' not found`,
|
|
62
|
+
suggestion: 'Create the parent node first, or use null for a root node',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Check for circular reference (shouldn't happen on create, but be safe)
|
|
66
|
+
const ancestry = await db.getAncestryChain(input.parentId);
|
|
67
|
+
if (ancestry.includes(nodeId)) {
|
|
68
|
+
return failure({
|
|
69
|
+
code: ErrorCodes.CIRCULAR_REFERENCE,
|
|
70
|
+
message: 'Creating this node would create a circular reference',
|
|
71
|
+
suggestion: 'Check the node hierarchy',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Validate includes exist
|
|
76
|
+
for (const includeId of input.includes || []) {
|
|
77
|
+
const includeNode = await db.getNode(includeId);
|
|
78
|
+
if (!includeNode) {
|
|
79
|
+
return failure({
|
|
80
|
+
code: ErrorCodes.NODE_NOT_FOUND,
|
|
81
|
+
message: `Include node '${includeId}' not found`,
|
|
82
|
+
suggestion: 'Make sure all include nodes exist before creating this node',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const plan = await checkDeprecationPlan(db, nodeId, input);
|
|
87
|
+
if ('error' in plan)
|
|
88
|
+
return failure(plan.error);
|
|
89
|
+
// Create the node
|
|
90
|
+
const now = new Date().toISOString();
|
|
91
|
+
const node = {
|
|
92
|
+
id: nodeId,
|
|
93
|
+
name: input.name,
|
|
94
|
+
parentId: input.parentId ?? null,
|
|
95
|
+
type: input.type ?? 'custom',
|
|
96
|
+
owner: input.owner,
|
|
97
|
+
status: input.status ?? 'active',
|
|
98
|
+
...(input.sunsetAt ? { sunsetAt: input.sunsetAt } : {}),
|
|
99
|
+
...(input.replacedBy ? { replacedBy: input.replacedBy } : {}),
|
|
100
|
+
includes: input.includes ?? [],
|
|
101
|
+
includePolicy: input.includePolicy ?? 'merge',
|
|
102
|
+
tags: input.tags ?? [],
|
|
103
|
+
createdAt: now,
|
|
104
|
+
updatedAt: now,
|
|
105
|
+
deletedAt: null,
|
|
106
|
+
};
|
|
107
|
+
await db.createNode(node);
|
|
108
|
+
// Log audit event
|
|
109
|
+
await db.addAuditEvent({
|
|
110
|
+
id: nanoid(),
|
|
111
|
+
timestamp: now,
|
|
112
|
+
eventType: 'node_created',
|
|
113
|
+
actor: actor || 'system',
|
|
114
|
+
targetNode: nodeId,
|
|
115
|
+
targetToken: null,
|
|
116
|
+
oldValue: null,
|
|
117
|
+
newValue: JSON.stringify(node),
|
|
118
|
+
metadata: null,
|
|
119
|
+
});
|
|
120
|
+
return success({ node }, {
|
|
121
|
+
reasoning: `Created node '${nodeId}' ${input.parentId ? `as child of '${input.parentId}'` : 'as root node'}`,
|
|
122
|
+
sources: [{ type: 'node', id: nodeId, title: node.name }],
|
|
123
|
+
...(plan.warnings.length > 0 ? { warnings: plan.warnings } : {}),
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
examples: [
|
|
127
|
+
{
|
|
128
|
+
description: 'Create a root node',
|
|
129
|
+
input: {
|
|
130
|
+
name: 'global-base',
|
|
131
|
+
type: 'root',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
description: 'Create a product node',
|
|
136
|
+
input: {
|
|
137
|
+
name: 'xbox',
|
|
138
|
+
parentId: 'global-base',
|
|
139
|
+
type: 'product',
|
|
140
|
+
owner: 'xbox-design@company.com',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
description: 'Create a node with includes',
|
|
145
|
+
input: {
|
|
146
|
+
name: 'my-app',
|
|
147
|
+
parentId: 'global-base',
|
|
148
|
+
type: 'product',
|
|
149
|
+
includes: ['accessibility-enhanced', 'motion-reduced'],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
description: 'Create a deprecated node with a sunset date and its replacement',
|
|
154
|
+
input: {
|
|
155
|
+
name: 'legacy-theme',
|
|
156
|
+
parentId: 'global-base',
|
|
157
|
+
type: 'theme',
|
|
158
|
+
status: 'deprecated',
|
|
159
|
+
sunsetAt: '2027-03-31',
|
|
160
|
+
replacedBy: 'modern-theme',
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Generate a URL-safe node ID from name
|
|
167
|
+
*/
|
|
168
|
+
function generateNodeId(name) {
|
|
169
|
+
return name
|
|
170
|
+
.toLowerCase()
|
|
171
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
172
|
+
.replace(/^-|-$/g, '');
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/node/create.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,mBAAmB,EAEnB,gBAAgB,EAChB,cAAc,GACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAA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aAAa;gBACvB,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,yBAAyB;aAChC;SACD;QACD;YACC,WAAW,EAAE,6BAA6B;YAC1C,KAAK,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,aAAa;gBACvB,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,CAAC,wBAAwB,EAAE,gBAAgB,CAAC;aACtD;SACD;QACD;YACC,WAAW,EAAE,iEAAiE;YAC9E,KAAK,EAAE;gBACN,IAAI,EAAE,cAAc;gBACpB,QAAQ,EAAE,aAAa;gBACvB,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,YAAY;gBACpB,QAAQ,EAAE,YAAY;gBACtB,UAAU,EAAE,cAAc;aAC1B;SACD;KACD;CACD,CAAC;AAEF;;GAEG;AACH,SAAS,cAAc,CAAC,IAAY;IACnC,OAAO,IAAI;SACT,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CommandDefinition } from '../registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for node.delete command
|
|
5
|
+
*/
|
|
6
|
+
declare const InputSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
9
|
+
force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
/**
|
|
12
|
+
* Output schema for node.delete command
|
|
13
|
+
*/
|
|
14
|
+
declare const OutputSchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
deletedAt: z.ZodString;
|
|
17
|
+
cascade: z.ZodBoolean;
|
|
18
|
+
affectedNodes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
type Output = z.infer<typeof OutputSchema>;
|
|
21
|
+
/**
|
|
22
|
+
* node.delete command
|
|
23
|
+
*
|
|
24
|
+
* Soft-delete a node (marks as deleted, doesn't remove from database).
|
|
25
|
+
*/
|
|
26
|
+
export declare const nodeDeleteCommand: CommandDefinition<typeof InputSchema, Output>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/node/delete.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;;;;iBAIf,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,YAAY;;;;;iBAKhB,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,CAgI3E,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { nanoid } from 'nanoid';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ErrorCodes, failure, success } from '../../types/command-result.js';
|
|
4
|
+
/**
|
|
5
|
+
* Input schema for node.delete command
|
|
6
|
+
*/
|
|
7
|
+
const InputSchema = z.object({
|
|
8
|
+
id: z.string().min(1),
|
|
9
|
+
reason: z.string().optional(),
|
|
10
|
+
force: z.boolean().optional().default(false), // Force delete even if has children
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Output schema for node.delete command
|
|
14
|
+
*/
|
|
15
|
+
const OutputSchema = z.object({
|
|
16
|
+
id: z.string(),
|
|
17
|
+
deletedAt: z.string(),
|
|
18
|
+
cascade: z.boolean(),
|
|
19
|
+
affectedNodes: z.array(z.string()).optional(),
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* node.delete command
|
|
23
|
+
*
|
|
24
|
+
* Soft-delete a node (marks as deleted, doesn't remove from database).
|
|
25
|
+
*/
|
|
26
|
+
export const nodeDeleteCommand = {
|
|
27
|
+
name: 'node.delete',
|
|
28
|
+
description: 'Delete a node from the design system tree (soft delete)',
|
|
29
|
+
category: 'node',
|
|
30
|
+
inputSchema: InputSchema,
|
|
31
|
+
outputSchema: OutputSchema,
|
|
32
|
+
async handler(rawInput, context) {
|
|
33
|
+
const { db, actor } = context;
|
|
34
|
+
// Parse input to apply defaults
|
|
35
|
+
const input = InputSchema.parse(rawInput);
|
|
36
|
+
const node = await db.getNode(input.id);
|
|
37
|
+
if (!node) {
|
|
38
|
+
return failure({
|
|
39
|
+
code: ErrorCodes.NODE_NOT_FOUND,
|
|
40
|
+
message: `Node '${input.id}' not found`,
|
|
41
|
+
suggestion: `Use 'node.list' to see available nodes`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (node.deletedAt) {
|
|
45
|
+
return failure({
|
|
46
|
+
code: ErrorCodes.NODE_NOT_FOUND,
|
|
47
|
+
message: `Node '${input.id}' is already deleted`,
|
|
48
|
+
suggestion: `The node was deleted at ${node.deletedAt}`,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// Check for children
|
|
52
|
+
const descendants = await db.getDescendants(input.id);
|
|
53
|
+
const activeDescendants = descendants.filter((d) => !d.deletedAt);
|
|
54
|
+
if (activeDescendants.length > 0 && !input.force) {
|
|
55
|
+
return failure({
|
|
56
|
+
code: ErrorCodes.NODE_HAS_CHILDREN,
|
|
57
|
+
message: `Node '${input.id}' has ${activeDescendants.length} child node(s)`,
|
|
58
|
+
suggestion: 'Delete child nodes first, or use --force to cascade delete',
|
|
59
|
+
}, {
|
|
60
|
+
warnings: [
|
|
61
|
+
{
|
|
62
|
+
code: 'HAS_CHILDREN',
|
|
63
|
+
message: `Child nodes: ${activeDescendants.map((d) => d.id).join(', ')}`,
|
|
64
|
+
severity: 'warning',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const now = new Date().toISOString();
|
|
70
|
+
const affectedNodes = [input.id];
|
|
71
|
+
// Soft delete the node
|
|
72
|
+
await db.updateNode(input.id, { deletedAt: now });
|
|
73
|
+
// Cascade delete if forced
|
|
74
|
+
if (input.force && activeDescendants.length > 0) {
|
|
75
|
+
for (const descendant of activeDescendants) {
|
|
76
|
+
await db.updateNode(descendant.id, { deletedAt: now });
|
|
77
|
+
affectedNodes.push(descendant.id);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Log audit event
|
|
81
|
+
await db.addAuditEvent({
|
|
82
|
+
id: nanoid(),
|
|
83
|
+
timestamp: now,
|
|
84
|
+
eventType: 'node_deleted',
|
|
85
|
+
actor: actor || 'system',
|
|
86
|
+
targetNode: input.id,
|
|
87
|
+
targetToken: null,
|
|
88
|
+
oldValue: JSON.stringify(node),
|
|
89
|
+
newValue: null,
|
|
90
|
+
metadata: JSON.stringify({
|
|
91
|
+
reason: input.reason,
|
|
92
|
+
cascade: input.force,
|
|
93
|
+
affectedNodes,
|
|
94
|
+
}),
|
|
95
|
+
});
|
|
96
|
+
return success({
|
|
97
|
+
id: input.id,
|
|
98
|
+
deletedAt: now,
|
|
99
|
+
cascade: input.force && activeDescendants.length > 0,
|
|
100
|
+
affectedNodes: affectedNodes.length > 1 ? affectedNodes : undefined,
|
|
101
|
+
}, {
|
|
102
|
+
reasoning: affectedNodes.length > 1
|
|
103
|
+
? `Deleted '${input.id}' and ${affectedNodes.length - 1} descendant(s)`
|
|
104
|
+
: `Deleted '${input.id}'`,
|
|
105
|
+
warnings: affectedNodes.length > 1
|
|
106
|
+
? [
|
|
107
|
+
{
|
|
108
|
+
code: 'CASCADE_DELETE',
|
|
109
|
+
message: `${affectedNodes.length - 1} descendant(s) were also deleted`,
|
|
110
|
+
severity: 'warning',
|
|
111
|
+
},
|
|
112
|
+
]
|
|
113
|
+
: undefined,
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
examples: [
|
|
117
|
+
{
|
|
118
|
+
description: 'Delete a node',
|
|
119
|
+
input: {
|
|
120
|
+
id: 'old-product',
|
|
121
|
+
reason: 'No longer maintained',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
description: 'Force delete with children',
|
|
126
|
+
input: {
|
|
127
|
+
id: 'deprecated-product',
|
|
128
|
+
reason: 'Removing entire product line',
|
|
129
|
+
force: true,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/node/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAG7E;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,oCAAoC;CAClF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,SAAS,EAAE,CAAC,CAAC,M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4BAA4B;YACzC,KAAK,EAAE;gBACN,EAAE,EAAE,oBAAoB;gBACxB,MAAM,EAAE,8BAA8B;gBACtC,KAAK,EAAE,IAAI;aACX;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CommandError, Warning } from '../../types/command-result.js';
|
|
2
|
+
import type { Database } from '../registry.js';
|
|
3
|
+
/** A node's deprecation plan: the day it goes away and the node that replaces it */
|
|
4
|
+
export interface DeprecationPlan {
|
|
5
|
+
sunsetAt?: string | null;
|
|
6
|
+
replacedBy?: string | null;
|
|
7
|
+
}
|
|
8
|
+
/** An unusable plan stops the write; a doubtful one is stored with warnings */
|
|
9
|
+
export type PlanCheck = {
|
|
10
|
+
error: CommandError;
|
|
11
|
+
} | {
|
|
12
|
+
warnings: Warning[];
|
|
13
|
+
};
|
|
14
|
+
/** Whole days from today (UTC) to a `YYYY-MM-DD` date; negative once it has passed */
|
|
15
|
+
export declare function daysUntil(date: string, now?: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Check the plan a node will have after a write (#117). The replacement must
|
|
18
|
+
* be another node that exists. A sunset date with no replacement, and a
|
|
19
|
+
* replacement that is itself deprecated, are allowed but warned about: the
|
|
20
|
+
* same cases `analyze.health` flags.
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkDeprecationPlan(db: Database, nodeId: string, plan: DeprecationPlan): Promise<PlanCheck>;
|
|
23
|
+
//# sourceMappingURL=deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../src/commands/node/deprecation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,+EAA+E;AAC/E,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC;AAI1E,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG,MAAM,CAGhE;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACzC,EAAE,EAAE,QAAQ,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,eAAe,GACnB,OAAO,CAAC,SAAS,CAAC,CA4CpB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ErrorCodes } from '../../types/command-result.js';
|
|
2
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
3
|
+
/** Whole days from today (UTC) to a `YYYY-MM-DD` date; negative once it has passed */
|
|
4
|
+
export function daysUntil(date, now = Date.now()) {
|
|
5
|
+
const today = Date.parse(new Date(now).toISOString().slice(0, 10));
|
|
6
|
+
return Math.round((Date.parse(date) - today) / DAY_MS);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Check the plan a node will have after a write (#117). The replacement must
|
|
10
|
+
* be another node that exists. A sunset date with no replacement, and a
|
|
11
|
+
* replacement that is itself deprecated, are allowed but warned about: the
|
|
12
|
+
* same cases `analyze.health` flags.
|
|
13
|
+
*/
|
|
14
|
+
export async function checkDeprecationPlan(db, nodeId, plan) {
|
|
15
|
+
const warnings = [];
|
|
16
|
+
let replacement = null;
|
|
17
|
+
if (plan.replacedBy) {
|
|
18
|
+
if (plan.replacedBy === nodeId) {
|
|
19
|
+
return {
|
|
20
|
+
error: {
|
|
21
|
+
code: ErrorCodes.VALIDATION_ERROR,
|
|
22
|
+
message: 'A node cannot replace itself',
|
|
23
|
+
suggestion: 'Set replacedBy to the node that takes over from this one',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
replacement = await db.getNode(plan.replacedBy);
|
|
28
|
+
if (!replacement || replacement.deletedAt) {
|
|
29
|
+
return {
|
|
30
|
+
error: {
|
|
31
|
+
code: ErrorCodes.NODE_NOT_FOUND,
|
|
32
|
+
message: `Replacement node '${plan.replacedBy}' not found`,
|
|
33
|
+
suggestion: `Use 'node.list' to see available nodes, or create the replacement first`,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (plan.sunsetAt && !plan.replacedBy) {
|
|
39
|
+
warnings.push({
|
|
40
|
+
code: 'SUNSET_WITHOUT_REPLACEMENT',
|
|
41
|
+
message: `'${nodeId}' goes away on ${plan.sunsetAt}, but no node replaces it`,
|
|
42
|
+
severity: 'warning',
|
|
43
|
+
details: { sunsetAt: plan.sunsetAt },
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (replacement?.status === 'deprecated') {
|
|
47
|
+
warnings.push({
|
|
48
|
+
code: 'REPLACEMENT_DEPRECATED',
|
|
49
|
+
message: `The replacement '${replacement.id}' is itself deprecated`,
|
|
50
|
+
severity: 'warning',
|
|
51
|
+
details: {
|
|
52
|
+
replacedBy: replacement.id,
|
|
53
|
+
...(replacement.sunsetAt ? { replacementSunsetAt: replacement.sunsetAt } : {}),
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return { warnings };
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=deprecation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.js","sourceRoot":"","sources":["../../../src/commands/node/deprecation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAY3D,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,sFAAsF;AACtF,MAAM,UAAU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AAI,MAAM,kBAAkB,IAAI,CAAC,QAAQ,2BAA2B;YAC7E,QAAQ,EAAE,SAAS;YACnB,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;SACpC,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,WAAW,EAAE,MAAM,KAAK,YAAY,EAAE,CAAC;QAC1C,QAAQ,CAAC,IAAI,CAAC;YACb,IAAI,EAAE,wBAAwB;YAC9B,OAAO,EAAE,oBAAoB,WAAW,CAAC,EAAE,wBAAwB;YACnE,QAAQ,EAAE,SAAS;YACnB,OAAO,EAAE;gBACR,UAAU,EAAE,WAAW,CAAC,EAAE;gBAC1B,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC9E;SACD,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CommandDefinition } from '../registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for node.get command
|
|
5
|
+
*/
|
|
6
|
+
declare const InputSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
includeAncestry: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
9
|
+
includeOperations: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
/**
|
|
12
|
+
* Output schema for node.get command
|
|
13
|
+
*/
|
|
14
|
+
declare const OutputSchema: z.ZodObject<{
|
|
15
|
+
node: z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
19
|
+
type: z.ZodEnum<{
|
|
20
|
+
custom: "custom";
|
|
21
|
+
device: "device";
|
|
22
|
+
experiment: "experiment";
|
|
23
|
+
locale: "locale";
|
|
24
|
+
platform: "platform";
|
|
25
|
+
product: "product";
|
|
26
|
+
root: "root";
|
|
27
|
+
shared: "shared";
|
|
28
|
+
theme: "theme";
|
|
29
|
+
}>;
|
|
30
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
31
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
32
|
+
active: "active";
|
|
33
|
+
deprecated: "deprecated";
|
|
34
|
+
experimental: "experimental";
|
|
35
|
+
}>>;
|
|
36
|
+
sunsetAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
replacedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
includes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
39
|
+
includePolicy: z.ZodDefault<z.ZodEnum<{
|
|
40
|
+
merge: "merge";
|
|
41
|
+
override: "override";
|
|
42
|
+
}>>;
|
|
43
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
44
|
+
createdAt: z.ZodString;
|
|
45
|
+
updatedAt: z.ZodString;
|
|
46
|
+
deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
ancestryChain: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
51
|
+
sequence: z.ZodNumber;
|
|
52
|
+
type: z.ZodEnum<{
|
|
53
|
+
add: "add";
|
|
54
|
+
copy: "copy";
|
|
55
|
+
override: "override";
|
|
56
|
+
reset: "reset";
|
|
57
|
+
subtract: "subtract";
|
|
58
|
+
}>;
|
|
59
|
+
tokenId: z.ZodString;
|
|
60
|
+
value: z.ZodOptional<z.ZodAny>;
|
|
61
|
+
fromNode: z.ZodOptional<z.ZodString>;
|
|
62
|
+
asTokenId: z.ZodOptional<z.ZodString>;
|
|
63
|
+
toAncestor: z.ZodOptional<z.ZodString>;
|
|
64
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
65
|
+
author: z.ZodOptional<z.ZodString>;
|
|
66
|
+
createdAt: z.ZodString;
|
|
67
|
+
supersededBy: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
tracksSource: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
}, z.core.$strip>>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
type Output = z.infer<typeof OutputSchema>;
|
|
72
|
+
/**
|
|
73
|
+
* node.get command
|
|
74
|
+
*
|
|
75
|
+
* Get a node by ID, optionally with ancestry information.
|
|
76
|
+
*/
|
|
77
|
+
export declare const nodeGetCommand: CommandDefinition<typeof InputSchema, Output>;
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/node/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE;;GAEG;AACH,QAAA,MAAM,WAAW;;;;iBAIf,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMhB,CAAC;AAEH,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,OAAO,WAAW,EAAE,MAAM,CA8FxE,CAAC"}
|