@snaptrude/plugin-core 0.2.9 → 0.5.0
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/AGENTS.md +128 -50
- package/CHANGELOG.md +52 -6
- package/api-manifest.full.json +3999 -0
- package/api-manifest.json +3845 -0
- package/dist/api/core/buildings.d.ts +427 -0
- package/dist/api/core/buildings.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +230 -0
- package/dist/api/core/comment/index.d.ts.map +1 -0
- package/dist/api/core/geom/create/index.d.ts +247 -0
- package/dist/api/core/geom/create/index.d.ts.map +1 -0
- package/dist/api/core/geom/delete/index.d.ts +72 -0
- package/dist/api/core/geom/delete/index.d.ts.map +1 -0
- package/dist/api/core/geom/index.d.ts +24 -23
- package/dist/api/core/geom/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/arc.d.ts +169 -0
- package/dist/api/core/geom/query/arc.d.ts.map +1 -0
- package/dist/api/core/geom/query/brep.d.ts +402 -0
- package/dist/api/core/geom/query/brep.d.ts.map +1 -0
- package/dist/api/core/geom/query/circle.d.ts +378 -0
- package/dist/api/core/geom/query/circle.d.ts.map +1 -0
- package/dist/api/core/geom/query/contour.d.ts +450 -0
- package/dist/api/core/geom/query/contour.d.ts.map +1 -0
- package/dist/api/core/geom/query/curve.d.ts +918 -0
- package/dist/api/core/geom/query/curve.d.ts.map +1 -0
- package/dist/api/core/geom/query/edge.d.ts +128 -0
- package/dist/api/core/geom/query/edge.d.ts.map +1 -0
- package/dist/api/core/geom/query/face.d.ts +363 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -0
- package/dist/api/core/geom/query/halfedge.d.ts +206 -0
- package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
- package/dist/api/core/geom/query/index.d.ts +61 -0
- package/dist/api/core/geom/query/index.d.ts.map +1 -0
- package/dist/api/core/geom/query/profile.d.ts +410 -0
- package/dist/api/core/geom/query/profile.d.ts.map +1 -0
- package/dist/api/core/geom/query/vertex.d.ts +187 -0
- package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
- package/dist/api/core/geom/update/contour.d.ts +272 -0
- package/dist/api/core/geom/update/contour.d.ts.map +1 -0
- package/dist/api/core/geom/update/curve.d.ts +180 -0
- package/dist/api/core/geom/update/curve.d.ts.map +1 -0
- package/dist/api/core/geom/update/index.d.ts +27 -0
- package/dist/api/core/geom/update/index.d.ts.map +1 -0
- package/dist/api/core/geom/update/profile.d.ts +329 -0
- package/dist/api/core/geom/update/profile.d.ts.map +1 -0
- package/dist/api/core/groups.d.ts +485 -0
- package/dist/api/core/groups.d.ts.map +1 -0
- package/dist/api/core/history/index.d.ts +78 -0
- package/dist/api/core/history/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +46 -1
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/layers.d.ts +402 -0
- package/dist/api/core/layers.d.ts.map +1 -0
- package/dist/api/core/math/quat.d.ts +111 -128
- package/dist/api/core/math/quat.d.ts.map +1 -1
- package/dist/api/core/math/vec3.d.ts +120 -102
- package/dist/api/core/math/vec3.d.ts.map +1 -1
- package/dist/api/core/project/index.d.ts +399 -0
- package/dist/api/core/project/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +755 -0
- package/dist/api/core/tags.d.ts.map +1 -0
- package/dist/api/core/units/index.d.ts +175 -0
- package/dist/api/core/units/index.d.ts.map +1 -0
- package/dist/api/core/zoom/index.d.ts +45 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +168 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +828 -0
- package/dist/api/design/create/index.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +63 -0
- package/dist/api/design/delete/index.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +268 -0
- package/dist/api/design/doors/index.d.ts.map +1 -0
- package/dist/api/design/edit/index.d.ts +49 -0
- package/dist/api/design/edit/index.d.ts.map +1 -0
- package/dist/api/design/erase/index.d.ts +160 -0
- package/dist/api/design/erase/index.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +123 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -0
- package/dist/api/design/index.d.ts +153 -0
- package/dist/api/design/index.d.ts.map +1 -0
- package/dist/api/design/lock.d.ts +41 -0
- package/dist/api/design/lock.d.ts.map +1 -0
- package/dist/api/design/materials/index.d.ts +297 -0
- package/dist/api/design/materials/index.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +140 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +1011 -0
- package/dist/api/design/query/index.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +221 -0
- package/dist/api/design/query/spaces.d.ts.map +1 -0
- package/dist/api/design/selection/index.d.ts +138 -0
- package/dist/api/design/selection/index.d.ts.map +1 -0
- package/dist/api/design/shared.d.ts +38 -0
- package/dist/api/design/shared.d.ts.map +1 -0
- package/dist/api/design/transform/index.d.ts +87 -0
- package/dist/api/design/transform/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +178 -0
- package/dist/api/design/update/index.d.ts.map +1 -0
- package/dist/api/design/windows/index.d.ts +189 -0
- package/dist/api/design/windows/index.d.ts.map +1 -0
- package/dist/api/entity/buildableEnvelope.d.ts +51 -23
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/department.d.ts +0 -98
- package/dist/api/entity/department.d.ts.map +1 -1
- package/dist/api/entity/index.d.ts +4 -9
- package/dist/api/entity/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +49 -106
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +76 -828
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +47 -37
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +17 -17
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +440 -0
- package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +81 -0
- package/dist/api/presentation/diagrams.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +113 -0
- package/dist/api/presentation/import.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +46 -0
- package/dist/api/presentation/index.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +176 -0
- package/dist/api/presentation/sheets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +296 -0
- package/dist/api/presentation/views.d.ts.map +1 -0
- package/dist/api/program/adjacency.d.ts +155 -0
- package/dist/api/program/adjacency.d.ts.map +1 -0
- package/dist/api/program/areas.d.ts +360 -0
- package/dist/api/program/areas.d.ts.map +1 -0
- package/dist/api/program/classification.d.ts +135 -0
- package/dist/api/program/classification.d.ts.map +1 -0
- package/dist/api/program/cores.d.ts +174 -0
- package/dist/api/program/cores.d.ts.map +1 -0
- package/dist/api/program/departments.d.ts +431 -0
- package/dist/api/program/departments.d.ts.map +1 -0
- package/dist/api/program/index.d.ts +69 -0
- package/dist/api/program/index.d.ts.map +1 -0
- package/dist/api/program/layout.d.ts +63 -0
- package/dist/api/program/layout.d.ts.map +1 -0
- package/dist/api/program/metrics.d.ts +108 -0
- package/dist/api/program/metrics.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +367 -0
- package/dist/api/program/site.d.ts.map +1 -0
- package/dist/api/program/spreadsheet.d.ts +2041 -0
- package/dist/api/program/spreadsheet.d.ts.map +1 -0
- package/dist/handles.d.ts +138 -0
- package/dist/handles.d.ts.map +1 -0
- package/dist/host-utils.d.ts +7 -5
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +3897 -1542
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3326 -1462
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
- package/scripts/generate-manifest.mjs +193 -0
- package/scripts/generate-manifest.test.mjs +193 -0
- package/src/api/core/buildings.ts +485 -0
- package/src/api/core/comment/index.ts +258 -0
- package/src/api/core/geom/create/index.ts +293 -0
- package/src/api/core/geom/delete/index.ts +78 -0
- package/src/api/core/geom/index.ts +24 -23
- package/src/api/core/geom/query/arc.ts +169 -0
- package/src/api/core/geom/query/brep.ts +444 -0
- package/src/api/core/geom/query/circle.ts +404 -0
- package/src/api/core/geom/query/contour.ts +540 -0
- package/src/api/core/geom/query/curve.ts +1078 -0
- package/src/api/core/geom/query/edge.ts +130 -0
- package/src/api/core/geom/query/face.ts +403 -0
- package/src/api/core/geom/query/halfedge.ts +210 -0
- package/src/api/core/geom/query/index.ts +63 -0
- package/src/api/core/geom/query/profile.ts +473 -0
- package/src/api/core/geom/query/vertex.ts +205 -0
- package/src/api/core/geom/update/contour.ts +315 -0
- package/src/api/core/geom/update/curve.ts +209 -0
- package/src/api/core/geom/update/index.ts +29 -0
- package/src/api/core/geom/update/profile.ts +377 -0
- package/src/api/core/groups.ts +521 -0
- package/src/api/core/history/index.ts +84 -0
- package/src/api/core/index.ts +46 -1
- package/src/api/core/layers.ts +333 -0
- package/src/api/core/math/quat.ts +112 -235
- package/src/api/core/math/vec3.ts +124 -159
- package/src/api/core/project/index.ts +418 -0
- package/src/api/core/tags.ts +808 -0
- package/src/api/core/units/index.ts +164 -0
- package/src/api/core/zoom/index.ts +47 -0
- package/src/api/design/boolean/index.ts +179 -0
- package/src/api/design/create/index.ts +886 -0
- package/src/api/design/delete/index.ts +67 -0
- package/src/api/design/doors/index.ts +285 -0
- package/src/api/design/edit/index.ts +54 -0
- package/src/api/design/erase/index.ts +151 -0
- package/src/api/design/furniture/index.ts +130 -0
- package/src/api/design/index.ts +162 -0
- package/src/api/design/lock.ts +42 -0
- package/src/api/design/materials/index.ts +301 -0
- package/src/api/design/query/geometry/index.ts +166 -0
- package/src/api/design/query/index.ts +937 -0
- package/src/api/design/query/spaces.ts +132 -0
- package/src/api/design/selection/index.ts +144 -0
- package/src/api/design/shared.ts +40 -0
- package/src/api/design/transform/index.ts +93 -0
- package/src/api/design/update/index.ts +117 -0
- package/src/api/design/windows/index.ts +207 -0
- package/src/api/entity/buildableEnvelope.ts +64 -23
- package/src/api/entity/department.ts +0 -113
- package/src/api/entity/index.ts +4 -9
- package/src/api/entity/referenceLine.ts +50 -38
- package/src/api/entity/space.ts +84 -440
- package/src/api/entity/story.ts +53 -42
- package/src/api/index.ts +17 -17
- package/src/api/presentation/aiInspiration.ts +362 -0
- package/src/api/presentation/diagrams.ts +84 -0
- package/src/api/presentation/import.ts +112 -0
- package/src/api/presentation/index.ts +48 -0
- package/src/api/presentation/sheets.ts +198 -0
- package/src/api/presentation/views.ts +303 -0
- package/src/api/program/adjacency.ts +164 -0
- package/src/api/program/areas.ts +335 -0
- package/src/api/program/classification.ts +138 -0
- package/src/api/program/cores.ts +171 -0
- package/src/api/program/departments.ts +465 -0
- package/src/api/program/index.ts +71 -0
- package/src/api/program/layout.ts +68 -0
- package/src/api/program/metrics.ts +120 -0
- package/src/api/program/site.ts +326 -0
- package/src/api/program/spreadsheet.ts +2075 -0
- package/src/handles.ts +148 -0
- package/src/host-utils.ts +10 -6
- package/src/index.ts +1 -0
- package/dist/api/core/geom/arc.d.ts +0 -81
- package/dist/api/core/geom/arc.d.ts.map +0 -1
- package/dist/api/core/geom/curve.d.ts +0 -70
- package/dist/api/core/geom/curve.d.ts.map +0 -1
- package/dist/api/core/geom/line.d.ts +0 -56
- package/dist/api/core/geom/line.d.ts.map +0 -1
- package/dist/api/core/geom/profile.d.ts +0 -121
- package/dist/api/core/geom/profile.d.ts.map +0 -1
- package/dist/api/documentation/aiInspiration.d.ts +0 -2155
- package/dist/api/documentation/aiInspiration.d.ts.map +0 -1
- package/dist/api/documentation/index.d.ts +0 -13
- package/dist/api/documentation/index.d.ts.map +0 -1
- package/dist/api/tools/copy.d.ts +0 -59
- package/dist/api/tools/copy.d.ts.map +0 -1
- package/dist/api/tools/index.d.ts +0 -29
- package/dist/api/tools/index.d.ts.map +0 -1
- package/dist/api/tools/offset.d.ts +0 -43
- package/dist/api/tools/offset.d.ts.map +0 -1
- package/dist/api/tools/selection.d.ts +0 -48
- package/dist/api/tools/selection.d.ts.map +0 -1
- package/dist/api/tools/transform.d.ts +0 -114
- package/dist/api/tools/transform.d.ts.map +0 -1
- package/dist/api/units/index.d.ts +0 -163
- package/dist/api/units/index.d.ts.map +0 -1
- package/src/api/core/geom/arc.ts +0 -70
- package/src/api/core/geom/curve.ts +0 -41
- package/src/api/core/geom/line.ts +0 -53
- package/src/api/core/geom/profile.ts +0 -94
- package/src/api/documentation/aiInspiration.ts +0 -871
- package/src/api/documentation/index.ts +0 -15
- package/src/api/tools/copy.ts +0 -55
- package/src/api/tools/index.ts +0 -35
- package/src/api/tools/offset.ts +0 -43
- package/src/api/tools/selection.ts +0 -51
- package/src/api/tools/transform.ts +0 -117
- package/src/api/units/index.ts +0 -163
|
@@ -0,0 +1,755 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../types";
|
|
3
|
+
import { ComponentHandle } from "../../handles";
|
|
4
|
+
/**
|
|
5
|
+
* Tags — read and edit the tag catalog and its assignments.
|
|
6
|
+
*
|
|
7
|
+
* A **tag** is a colored label that lives in a **category**; a space carries at
|
|
8
|
+
* most one tag per category. This namespace is the catalog + assignment surface:
|
|
9
|
+
* the categories and tags themselves, which components carry which tags, and the
|
|
10
|
+
* assign/unassign operations. Tags attach to **Mass and Floor spaces only**.
|
|
11
|
+
*
|
|
12
|
+
* **Reserved sentinels.** The built-in **`DEPARTMENT`** category is owned by the
|
|
13
|
+
* program layer — it and the tags inside it are read-only here; create/update/
|
|
14
|
+
* delete reject it and direct you to {@linkcode PluginProgramApi}`.departments`.
|
|
15
|
+
* Every category also has a built-in **`DEFAULT`** tag that cannot be deleted;
|
|
16
|
+
* unassigning resets a component's category slot back to `DEFAULT` (a component
|
|
17
|
+
* is never left with a blank slot).
|
|
18
|
+
*
|
|
19
|
+
* Reads return plain records and never throw for a miss (`get*` return `null`,
|
|
20
|
+
* `list*` return `[]`). Ids are stable public strings.
|
|
21
|
+
*
|
|
22
|
+
* Sub-namespace members typed as optional (`?`) are **authored ahead of the
|
|
23
|
+
* host** — declared so plugins and codegen can see the shape, but kept out of the
|
|
24
|
+
* discovery manifest until the host lands them (at which point they are promoted
|
|
25
|
+
* to required `abstract` members).
|
|
26
|
+
*
|
|
27
|
+
* Accessed via `snaptrude.core.tags`.
|
|
28
|
+
*/
|
|
29
|
+
export declare abstract class PluginCoreTagsApi {
|
|
30
|
+
constructor();
|
|
31
|
+
/**
|
|
32
|
+
* List the tag categories.
|
|
33
|
+
*
|
|
34
|
+
* @returns A {@linkcode PluginCoreTagsListCategoriesResult} with a `categories`
|
|
35
|
+
* array (empty when there are none), including the reserved `DEPARTMENT`
|
|
36
|
+
* category.
|
|
37
|
+
*
|
|
38
|
+
* @examplePrompt List all the tag categories
|
|
39
|
+
* @examplePrompt What tag categories do I have?
|
|
40
|
+
* @examplePrompt Show every category and its tags
|
|
41
|
+
*
|
|
42
|
+
* # Example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const { categories } = await snaptrude.core.tags.listCategories()
|
|
45
|
+
* for (const c of categories) console.log(c.name, c.tagIds.length)
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
abstract listCategories(): PluginApiReturn<PluginCoreTagsListCategoriesResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Get a single tag category by id.
|
|
51
|
+
*
|
|
52
|
+
* @param categoryId - The id of the category to read.
|
|
53
|
+
* @returns The matching {@linkcode PluginCoreTagCategory}, or `null` if no
|
|
54
|
+
* category has that id.
|
|
55
|
+
*
|
|
56
|
+
* @examplePrompt Get the tag category with id cat_3
|
|
57
|
+
* @examplePrompt Look up a category by its id
|
|
58
|
+
* @examplePrompt Which tags are in this category?
|
|
59
|
+
*
|
|
60
|
+
* # Example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const category = await snaptrude.core.tags.getCategory("cat_3")
|
|
63
|
+
* if (category) console.log(category.name, category.tagIds)
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
abstract getCategory(categoryId: string): PluginApiReturn<PluginCoreTagsGetCategoryResult>;
|
|
67
|
+
/**
|
|
68
|
+
* List tags, optionally within one category.
|
|
69
|
+
*
|
|
70
|
+
* @param categoryId - Optional category filter; omit to list every tag.
|
|
71
|
+
* @returns A {@linkcode PluginCoreTagsListResult} with a `tags` array (empty
|
|
72
|
+
* when there are none).
|
|
73
|
+
*
|
|
74
|
+
* @examplePrompt List every tag in the project
|
|
75
|
+
* @examplePrompt Show the tags in category cat_3
|
|
76
|
+
* @examplePrompt What tags are available?
|
|
77
|
+
*
|
|
78
|
+
* # Example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const { tags } = await snaptrude.core.tags.list("cat_3")
|
|
81
|
+
* for (const t of tags) console.log(t.name, t.color)
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
abstract list(categoryId?: string): PluginApiReturn<PluginCoreTagsListResult>;
|
|
85
|
+
/**
|
|
86
|
+
* Get a single tag by id.
|
|
87
|
+
*
|
|
88
|
+
* @param tagId - The id of the tag to read.
|
|
89
|
+
* @returns The matching {@linkcode PluginCoreTag}, or `null` if no tag has that
|
|
90
|
+
* id.
|
|
91
|
+
*
|
|
92
|
+
* @examplePrompt Get the tag with id tag_9
|
|
93
|
+
* @examplePrompt Look up a single tag by its id
|
|
94
|
+
* @examplePrompt What color is this tag?
|
|
95
|
+
*
|
|
96
|
+
* # Example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const tag = await snaptrude.core.tags.get("tag_9")
|
|
99
|
+
* if (tag) console.log(tag.name, tag.color)
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
abstract get(tagId: string): PluginApiReturn<PluginCoreTagsGetResult>;
|
|
103
|
+
/**
|
|
104
|
+
* List the tags carried by a component.
|
|
105
|
+
*
|
|
106
|
+
* Returns one entry per category the component is tagged in, each carrying the
|
|
107
|
+
* category and tag names and the tag color.
|
|
108
|
+
*
|
|
109
|
+
* @param componentId - The `Component.id` to read.
|
|
110
|
+
* @returns A {@linkcode PluginCoreTagsGetTagsForComponentResult} with a `tags`
|
|
111
|
+
* array (empty when the component has none or does not exist).
|
|
112
|
+
*
|
|
113
|
+
* @examplePrompt What tags does this space have?
|
|
114
|
+
* @examplePrompt List the tags on component cmp_42
|
|
115
|
+
* @examplePrompt Show the labels applied to this room
|
|
116
|
+
*
|
|
117
|
+
* # Example
|
|
118
|
+
* ```ts
|
|
119
|
+
* const { tags } = await snaptrude.core.tags.getTagsForComponent("cmp_42")
|
|
120
|
+
* for (const t of tags) console.log(t.categoryName, t.tagName)
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
abstract getTagsForComponent(componentId: ComponentHandle): PluginApiReturn<PluginCoreTagsGetTagsForComponentResult>;
|
|
124
|
+
/**
|
|
125
|
+
* List the components carrying a given tag or category.
|
|
126
|
+
*
|
|
127
|
+
* Provide **exactly one** of `tagId` (components with that specific tag) or
|
|
128
|
+
* `categoryId` (components carrying any non-default tag in that category). With
|
|
129
|
+
* `categoryId`, pass `untagged: true` to instead return the components that have
|
|
130
|
+
* **no** non-default tag in that category. `untagged` is valid only alongside
|
|
131
|
+
* `categoryId`.
|
|
132
|
+
*
|
|
133
|
+
* @param filter - A {@linkcode PluginCoreTagsListComponentsArgs} filter with
|
|
134
|
+
* exactly one of `tagId`, `categoryId`, plus optional `untagged` (with
|
|
135
|
+
* `categoryId`).
|
|
136
|
+
* @returns A {@linkcode PluginCoreTagsListComponentsResult} with a
|
|
137
|
+
* `componentIds` array (empty when none match).
|
|
138
|
+
*
|
|
139
|
+
* @examplePrompt Which spaces have the tag tag_9?
|
|
140
|
+
* @examplePrompt List every component tagged in category cat_3
|
|
141
|
+
* @examplePrompt Which spaces are untagged in the Occupancy category?
|
|
142
|
+
*
|
|
143
|
+
* # Example
|
|
144
|
+
* ```ts
|
|
145
|
+
* const { componentIds } = await snaptrude.core.tags.listComponents({ tagId: "tag_9" })
|
|
146
|
+
* console.log(`${componentIds.length} components`)
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
abstract listComponents(filter: {
|
|
150
|
+
tagId?: string;
|
|
151
|
+
categoryId?: string;
|
|
152
|
+
untagged?: boolean;
|
|
153
|
+
}): PluginApiReturn<PluginCoreTagsListComponentsResult>;
|
|
154
|
+
/**
|
|
155
|
+
* Create a new tag category.
|
|
156
|
+
*
|
|
157
|
+
* @param name - Display name of the new category.
|
|
158
|
+
* @returns The new {@linkcode PluginCoreTagCategory}.
|
|
159
|
+
* @throws If the name collides with the reserved `DEPARTMENT` category, or the
|
|
160
|
+
* category could not be created.
|
|
161
|
+
*
|
|
162
|
+
* @examplePrompt Create a tag category called Fire Rating
|
|
163
|
+
* @examplePrompt Add a new category named Zone
|
|
164
|
+
* @examplePrompt Make a category for occupancy type
|
|
165
|
+
*
|
|
166
|
+
* # Example
|
|
167
|
+
* ```ts
|
|
168
|
+
* const category = await snaptrude.core.tags.createCategory("Fire Rating")
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
abstract createCategory(name: string): PluginApiReturn<PluginCoreTagsCreateCategoryResult>;
|
|
172
|
+
/**
|
|
173
|
+
* Rename a tag category.
|
|
174
|
+
*
|
|
175
|
+
* @param categoryId - The id of the category to rename.
|
|
176
|
+
* @param name - The category's new display name.
|
|
177
|
+
* @returns The updated {@linkcode PluginCoreTagCategory}.
|
|
178
|
+
* @throws If no category has the given id, or it is the reserved `DEPARTMENT`
|
|
179
|
+
* category.
|
|
180
|
+
*
|
|
181
|
+
* @examplePrompt Rename category cat_3 to Occupancy
|
|
182
|
+
* @examplePrompt Change the name of this tag category
|
|
183
|
+
* @examplePrompt Update the Zone category's name
|
|
184
|
+
*
|
|
185
|
+
* # Example
|
|
186
|
+
* ```ts
|
|
187
|
+
* const category = await snaptrude.core.tags.updateCategory("cat_3", "Occupancy")
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
abstract updateCategory(categoryId: string, name: string): PluginApiReturn<PluginCoreTagsUpdateCategoryResult>;
|
|
191
|
+
/**
|
|
192
|
+
* Delete a tag category and all its tags.
|
|
193
|
+
*
|
|
194
|
+
* **Non-undoable.** Every component tagged in this category is reset to the
|
|
195
|
+
* category's `DEFAULT`; the result reports how many tags were removed and how
|
|
196
|
+
* many components were reset.
|
|
197
|
+
*
|
|
198
|
+
* @param categoryId - The id of the category to delete.
|
|
199
|
+
* @returns The impact counts (`deletedTagCount`, `resetComponentCount`).
|
|
200
|
+
* @throws If no category has the given id, or it is the reserved `DEPARTMENT`
|
|
201
|
+
* category.
|
|
202
|
+
*
|
|
203
|
+
* @examplePrompt Delete the Zone tag category
|
|
204
|
+
* @examplePrompt Remove category cat_3 and all its tags
|
|
205
|
+
* @examplePrompt Delete this category
|
|
206
|
+
*
|
|
207
|
+
* # Example
|
|
208
|
+
* ```ts
|
|
209
|
+
* const { deletedTagCount } = await snaptrude.core.tags.deleteCategory("cat_3")
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
abstract deleteCategory(categoryId: string): PluginApiReturn<PluginCoreTagsDeleteCategoryResult>;
|
|
213
|
+
/**
|
|
214
|
+
* Create a new tag in a category.
|
|
215
|
+
*
|
|
216
|
+
* @param categoryId - The category the new tag belongs to.
|
|
217
|
+
* @param name - Display name of the new tag.
|
|
218
|
+
* @param color - Optional CSS hex color string (auto-assigned if omitted).
|
|
219
|
+
* @returns The new {@linkcode PluginCoreTag}.
|
|
220
|
+
* @throws If no category has the given id, or it is the reserved `DEPARTMENT`
|
|
221
|
+
* category.
|
|
222
|
+
*
|
|
223
|
+
* @examplePrompt Add a tag called 2-hour to the Fire Rating category
|
|
224
|
+
* @examplePrompt Create a red High Priority tag in category cat_3
|
|
225
|
+
* @examplePrompt Make a new tag named Retail
|
|
226
|
+
*
|
|
227
|
+
* # Example
|
|
228
|
+
* ```ts
|
|
229
|
+
* const tag = await snaptrude.core.tags.create("cat_3", "Retail", "#b5e1dc")
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
abstract create(categoryId: string, name: string, color?: string): PluginApiReturn<PluginCoreTagsCreateResult>;
|
|
233
|
+
/**
|
|
234
|
+
* Update a tag's name and/or color.
|
|
235
|
+
*
|
|
236
|
+
* A **sparse** update: omitted fields are left unchanged.
|
|
237
|
+
*
|
|
238
|
+
* @param tagId - The id of the tag to update.
|
|
239
|
+
* @param options - Any of `name`, `color`; omitted fields are left unchanged.
|
|
240
|
+
* @returns The updated {@linkcode PluginCoreTag}.
|
|
241
|
+
* @throws If no tag has the given id, or it belongs to the reserved
|
|
242
|
+
* `DEPARTMENT` category.
|
|
243
|
+
*
|
|
244
|
+
* @examplePrompt Rename tag tag_9 to Retail
|
|
245
|
+
* @examplePrompt Change this tag's color to #ff8800
|
|
246
|
+
* @examplePrompt Recolor the High Priority tag
|
|
247
|
+
*
|
|
248
|
+
* # Example
|
|
249
|
+
* ```ts
|
|
250
|
+
* const tag = await snaptrude.core.tags.update("tag_9", { name: "Retail" })
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
abstract update(tagId: string, options?: {
|
|
254
|
+
name?: string;
|
|
255
|
+
color?: string;
|
|
256
|
+
}): PluginApiReturn<PluginCoreTagsUpdateResult>;
|
|
257
|
+
/**
|
|
258
|
+
* Delete a tag.
|
|
259
|
+
*
|
|
260
|
+
* **Non-undoable.** Every component carrying this tag is reset to its
|
|
261
|
+
* category's `DEFAULT`; the result reports how many components were reset. The
|
|
262
|
+
* built-in `DEFAULT` tag of a category cannot be deleted.
|
|
263
|
+
*
|
|
264
|
+
* @param tagId - The id of the tag to delete.
|
|
265
|
+
* @returns The impact count (`resetComponentCount`).
|
|
266
|
+
* @throws If no tag has the given id, it is a `DEFAULT` tag, or it belongs to
|
|
267
|
+
* the reserved `DEPARTMENT` category.
|
|
268
|
+
*
|
|
269
|
+
* @examplePrompt Delete the Retail tag
|
|
270
|
+
* @examplePrompt Remove tag tag_9
|
|
271
|
+
* @examplePrompt Delete this label
|
|
272
|
+
*
|
|
273
|
+
* # Example
|
|
274
|
+
* ```ts
|
|
275
|
+
* const { resetComponentCount } = await snaptrude.core.tags.delete("tag_9")
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
278
|
+
abstract delete(tagId: string): PluginApiReturn<PluginCoreTagsDeleteResult>;
|
|
279
|
+
/**
|
|
280
|
+
* Assign a tag to components, creating the category and tag if needed.
|
|
281
|
+
*
|
|
282
|
+
* Resolves `tagName` within the category named `categoryName`: if the category
|
|
283
|
+
* or the tag does not exist yet it is created, otherwise the existing one is
|
|
284
|
+
* reused. The resolved tag is then applied to each taggable component (Mass/Floor
|
|
285
|
+
* spaces) — resolve-or-create and assign are **one atomic, undoable action**.
|
|
286
|
+
* Because a component carries one tag per category, this replaces any existing
|
|
287
|
+
* tag from that category. Components that are locked, not taggable, or not found
|
|
288
|
+
* are returned in `skipped` with a reason — never silently dropped. Rejects the
|
|
289
|
+
* reserved `DEPARTMENT` category.
|
|
290
|
+
*
|
|
291
|
+
* @param componentIds - The components to tag (at least one).
|
|
292
|
+
* @param categoryName - The tag category; created if it does not exist (not
|
|
293
|
+
* `DEPARTMENT`).
|
|
294
|
+
* @param tagName - The tag within the category; created if it does not exist,
|
|
295
|
+
* else reused.
|
|
296
|
+
* @returns A {@linkcode PluginCoreTagsAssignResult} — the resolved
|
|
297
|
+
* `categoryId`/`tagId`, whether each was created, and the `assigned`/`skipped`
|
|
298
|
+
* split.
|
|
299
|
+
* @throws If `categoryName` is the reserved `DEPARTMENT` category.
|
|
300
|
+
*
|
|
301
|
+
* @examplePrompt Tag the selected spaces as Retail in the Zone category
|
|
302
|
+
* @examplePrompt Tag these rooms High Priority, creating the tag if it doesn't exist
|
|
303
|
+
* @examplePrompt Put cmp_1 and cmp_2 in Zone / Retail
|
|
304
|
+
*
|
|
305
|
+
* # Example
|
|
306
|
+
* ```ts
|
|
307
|
+
* const { tagId, tagCreated, assigned } = await snaptrude.core.tags.assign(
|
|
308
|
+
* ["cmp_1", "cmp_2"],
|
|
309
|
+
* "Zone",
|
|
310
|
+
* "Retail",
|
|
311
|
+
* )
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
abstract assign(componentIds: ComponentHandle[], categoryName: string, tagName: string): PluginApiReturn<PluginCoreTagsAssignResult>;
|
|
315
|
+
/**
|
|
316
|
+
* Clear a category's tag from components.
|
|
317
|
+
*
|
|
318
|
+
* Resets each component's slot for the given category back to `DEFAULT` (a
|
|
319
|
+
* component always has a `DEFAULT` — the field is never blanked). Components
|
|
320
|
+
* that are locked, not taggable, or not found are returned in `skipped`.
|
|
321
|
+
*
|
|
322
|
+
* @param categoryId - The category slot to reset to default.
|
|
323
|
+
* @param componentIds - The components to clear (at least one).
|
|
324
|
+
* @returns A {@linkcode PluginCoreAssignOutcome} splitting `assigned` (reset to
|
|
325
|
+
* default) from `skipped`.
|
|
326
|
+
* @throws If no category has the given id.
|
|
327
|
+
*
|
|
328
|
+
* @examplePrompt Remove the Occupancy tag from the selected spaces
|
|
329
|
+
* @examplePrompt Clear category cat_3 on components cmp_1 and cmp_2
|
|
330
|
+
* @examplePrompt Untag these rooms in the Zone category
|
|
331
|
+
*
|
|
332
|
+
* # Example
|
|
333
|
+
* ```ts
|
|
334
|
+
* await snaptrude.core.tags.unassign("cat_3", ["cmp_1", "cmp_2"])
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
abstract unassign(categoryId: string, componentIds: ComponentHandle[]): PluginApiReturn<PluginCoreTagsUnassignResult>;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* A tag category — a named slot that holds a set of mutually-exclusive tags.
|
|
341
|
+
*
|
|
342
|
+
* | Property | Type | Description |
|
|
343
|
+
* |---|---|---|
|
|
344
|
+
* | `id` | `string` | Stable public category id |
|
|
345
|
+
* | `name` | `string` | Display name |
|
|
346
|
+
* | `tagIds` | `string[]` | Ids of the tags in this category |
|
|
347
|
+
*/
|
|
348
|
+
export declare const PluginCoreTagCategory: z.ZodObject<{
|
|
349
|
+
id: z.ZodString;
|
|
350
|
+
name: z.ZodString;
|
|
351
|
+
tagIds: z.ZodArray<z.ZodString>;
|
|
352
|
+
}, z.core.$strip>;
|
|
353
|
+
export type PluginCoreTagCategory = z.infer<typeof PluginCoreTagCategory>;
|
|
354
|
+
/**
|
|
355
|
+
* A tag — a colored label within a category.
|
|
356
|
+
*
|
|
357
|
+
* | Property | Type | Description |
|
|
358
|
+
* |---|---|---|
|
|
359
|
+
* | `id` | `string` | Stable public tag id |
|
|
360
|
+
* | `categoryId` | `string` | The id of the category this tag belongs to |
|
|
361
|
+
* | `name` | `string` | Display name |
|
|
362
|
+
* | `color` | `string` | CSS hex color string (e.g. `"#b5e1dc"`) |
|
|
363
|
+
*/
|
|
364
|
+
export declare const PluginCoreTag: z.ZodObject<{
|
|
365
|
+
id: z.ZodString;
|
|
366
|
+
categoryId: z.ZodString;
|
|
367
|
+
name: z.ZodString;
|
|
368
|
+
color: z.ZodString;
|
|
369
|
+
}, z.core.$strip>;
|
|
370
|
+
export type PluginCoreTag = z.infer<typeof PluginCoreTag>;
|
|
371
|
+
/**
|
|
372
|
+
* A tag as carried by a component — the category and tag names resolved for
|
|
373
|
+
* display.
|
|
374
|
+
*
|
|
375
|
+
* | Property | Type | Description |
|
|
376
|
+
* |---|---|---|
|
|
377
|
+
* | `categoryId` | `string` | The category's id |
|
|
378
|
+
* | `categoryName` | `string` | The category's display name |
|
|
379
|
+
* | `tagId` | `string` | The tag's id |
|
|
380
|
+
* | `tagName` | `string` | The tag's display name |
|
|
381
|
+
* | `color` | `string` | The tag's CSS hex color string |
|
|
382
|
+
*/
|
|
383
|
+
export declare const PluginCoreComponentTag: z.ZodObject<{
|
|
384
|
+
categoryId: z.ZodString;
|
|
385
|
+
categoryName: z.ZodString;
|
|
386
|
+
tagId: z.ZodString;
|
|
387
|
+
tagName: z.ZodString;
|
|
388
|
+
color: z.ZodString;
|
|
389
|
+
}, z.core.$strip>;
|
|
390
|
+
export type PluginCoreComponentTag = z.infer<typeof PluginCoreComponentTag>;
|
|
391
|
+
/**
|
|
392
|
+
* The outcome of an assign/unassign — which components changed and which were
|
|
393
|
+
* skipped (with a reason).
|
|
394
|
+
*
|
|
395
|
+
* | Property | Type | Description |
|
|
396
|
+
* |---|---|---|
|
|
397
|
+
* | `assigned` | `string[]` | Ids of the components that were changed |
|
|
398
|
+
* | `skipped` | `{ id: string; reason: "locked" \| "not-taggable" \| "not-found" }[]` | Components that were not changed, each with a reason |
|
|
399
|
+
*/
|
|
400
|
+
export declare const PluginCoreAssignOutcome: z.ZodObject<{
|
|
401
|
+
assigned: z.ZodArray<z.ZodString>;
|
|
402
|
+
skipped: z.ZodArray<z.ZodObject<{
|
|
403
|
+
id: z.ZodString;
|
|
404
|
+
reason: z.ZodEnum<{
|
|
405
|
+
locked: "locked";
|
|
406
|
+
"not-taggable": "not-taggable";
|
|
407
|
+
"not-found": "not-found";
|
|
408
|
+
}>;
|
|
409
|
+
}, z.core.$strip>>;
|
|
410
|
+
}, z.core.$strip>;
|
|
411
|
+
export type PluginCoreAssignOutcome = z.infer<typeof PluginCoreAssignOutcome>;
|
|
412
|
+
/**
|
|
413
|
+
* Result of {@linkcode PluginCoreTagsApi.listCategories}.
|
|
414
|
+
*
|
|
415
|
+
* | Property | Type | Description |
|
|
416
|
+
* |---|---|---|
|
|
417
|
+
* | `categories` | {@linkcode PluginCoreTagCategory}`[]` | Every tag category (including the reserved `DEPARTMENT`) |
|
|
418
|
+
*/
|
|
419
|
+
export declare const PluginCoreTagsListCategoriesResult: z.ZodObject<{
|
|
420
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
421
|
+
id: z.ZodString;
|
|
422
|
+
name: z.ZodString;
|
|
423
|
+
tagIds: z.ZodArray<z.ZodString>;
|
|
424
|
+
}, z.core.$strip>>;
|
|
425
|
+
}, z.core.$strip>;
|
|
426
|
+
export type PluginCoreTagsListCategoriesResult = z.infer<typeof PluginCoreTagsListCategoriesResult>;
|
|
427
|
+
/**
|
|
428
|
+
* Arguments for {@linkcode PluginCoreTagsApi.getCategory}.
|
|
429
|
+
*
|
|
430
|
+
* | Property | Type | Description |
|
|
431
|
+
* |---|---|---|
|
|
432
|
+
* | `categoryId` | `string` | The id of the category to read |
|
|
433
|
+
*/
|
|
434
|
+
export declare const PluginCoreTagsGetCategoryArgs: z.ZodObject<{
|
|
435
|
+
categoryId: z.ZodString;
|
|
436
|
+
}, z.core.$strip>;
|
|
437
|
+
export type PluginCoreTagsGetCategoryArgs = z.infer<typeof PluginCoreTagsGetCategoryArgs>;
|
|
438
|
+
/**
|
|
439
|
+
* Result of {@linkcode PluginCoreTagsApi.getCategory} — the category, or `null`
|
|
440
|
+
* when no category has the given id.
|
|
441
|
+
*/
|
|
442
|
+
export declare const PluginCoreTagsGetCategoryResult: z.ZodNullable<z.ZodObject<{
|
|
443
|
+
id: z.ZodString;
|
|
444
|
+
name: z.ZodString;
|
|
445
|
+
tagIds: z.ZodArray<z.ZodString>;
|
|
446
|
+
}, z.core.$strip>>;
|
|
447
|
+
export type PluginCoreTagsGetCategoryResult = z.infer<typeof PluginCoreTagsGetCategoryResult>;
|
|
448
|
+
/**
|
|
449
|
+
* Arguments for {@linkcode PluginCoreTagsApi.list}.
|
|
450
|
+
*
|
|
451
|
+
* | Property | Type | Description |
|
|
452
|
+
* |---|---|---|
|
|
453
|
+
* | `categoryId` | `string \| undefined` | Optional category filter; omit to list every tag |
|
|
454
|
+
*/
|
|
455
|
+
export declare const PluginCoreTagsListArgs: z.ZodObject<{
|
|
456
|
+
categoryId: z.ZodOptional<z.ZodString>;
|
|
457
|
+
}, z.core.$strip>;
|
|
458
|
+
export type PluginCoreTagsListArgs = z.infer<typeof PluginCoreTagsListArgs>;
|
|
459
|
+
/**
|
|
460
|
+
* Result of {@linkcode PluginCoreTagsApi.list}.
|
|
461
|
+
*
|
|
462
|
+
* | Property | Type | Description |
|
|
463
|
+
* |---|---|---|
|
|
464
|
+
* | `tags` | {@linkcode PluginCoreTag}`[]` | The matching tags (empty when none) |
|
|
465
|
+
*/
|
|
466
|
+
export declare const PluginCoreTagsListResult: z.ZodObject<{
|
|
467
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
468
|
+
id: z.ZodString;
|
|
469
|
+
categoryId: z.ZodString;
|
|
470
|
+
name: z.ZodString;
|
|
471
|
+
color: z.ZodString;
|
|
472
|
+
}, z.core.$strip>>;
|
|
473
|
+
}, z.core.$strip>;
|
|
474
|
+
export type PluginCoreTagsListResult = z.infer<typeof PluginCoreTagsListResult>;
|
|
475
|
+
/**
|
|
476
|
+
* Arguments for {@linkcode PluginCoreTagsApi.get}.
|
|
477
|
+
*
|
|
478
|
+
* | Property | Type | Description |
|
|
479
|
+
* |---|---|---|
|
|
480
|
+
* | `tagId` | `string` | The id of the tag to read |
|
|
481
|
+
*/
|
|
482
|
+
export declare const PluginCoreTagsGetArgs: z.ZodObject<{
|
|
483
|
+
tagId: z.ZodString;
|
|
484
|
+
}, z.core.$strip>;
|
|
485
|
+
export type PluginCoreTagsGetArgs = z.infer<typeof PluginCoreTagsGetArgs>;
|
|
486
|
+
/**
|
|
487
|
+
* Result of {@linkcode PluginCoreTagsApi.get} — the tag, or `null` when no tag
|
|
488
|
+
* has the given id.
|
|
489
|
+
*/
|
|
490
|
+
export declare const PluginCoreTagsGetResult: z.ZodNullable<z.ZodObject<{
|
|
491
|
+
id: z.ZodString;
|
|
492
|
+
categoryId: z.ZodString;
|
|
493
|
+
name: z.ZodString;
|
|
494
|
+
color: z.ZodString;
|
|
495
|
+
}, z.core.$strip>>;
|
|
496
|
+
export type PluginCoreTagsGetResult = z.infer<typeof PluginCoreTagsGetResult>;
|
|
497
|
+
/**
|
|
498
|
+
* Arguments for {@linkcode PluginCoreTagsApi.getTagsForComponent}.
|
|
499
|
+
*
|
|
500
|
+
* | Property | Type | Description |
|
|
501
|
+
* |---|---|---|
|
|
502
|
+
* | `componentId` | `ComponentHandle` | The `Component.id` to read |
|
|
503
|
+
*/
|
|
504
|
+
export declare const PluginCoreTagsGetTagsForComponentArgs: z.ZodObject<{
|
|
505
|
+
componentId: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
506
|
+
}, z.core.$strip>;
|
|
507
|
+
export type PluginCoreTagsGetTagsForComponentArgs = z.infer<typeof PluginCoreTagsGetTagsForComponentArgs>;
|
|
508
|
+
/**
|
|
509
|
+
* Result of {@linkcode PluginCoreTagsApi.getTagsForComponent}.
|
|
510
|
+
*
|
|
511
|
+
* | Property | Type | Description |
|
|
512
|
+
* |---|---|---|
|
|
513
|
+
* | `tags` | {@linkcode PluginCoreComponentTag}`[]` | The component's tags, one per tagged category (empty when none) |
|
|
514
|
+
*/
|
|
515
|
+
export declare const PluginCoreTagsGetTagsForComponentResult: z.ZodObject<{
|
|
516
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
517
|
+
categoryId: z.ZodString;
|
|
518
|
+
categoryName: z.ZodString;
|
|
519
|
+
tagId: z.ZodString;
|
|
520
|
+
tagName: z.ZodString;
|
|
521
|
+
color: z.ZodString;
|
|
522
|
+
}, z.core.$strip>>;
|
|
523
|
+
}, z.core.$strip>;
|
|
524
|
+
export type PluginCoreTagsGetTagsForComponentResult = z.infer<typeof PluginCoreTagsGetTagsForComponentResult>;
|
|
525
|
+
/**
|
|
526
|
+
* Arguments for {@linkcode PluginCoreTagsApi.listComponents}. Provide exactly one
|
|
527
|
+
* of `tagId`, `categoryId`. `untagged` is valid only with `categoryId`.
|
|
528
|
+
*
|
|
529
|
+
* | Property | Type | Description |
|
|
530
|
+
* |---|---|---|
|
|
531
|
+
* | `tagId` | `string \| undefined` | Components carrying this specific tag |
|
|
532
|
+
* | `categoryId` | `string \| undefined` | Components carrying any non-default tag in this category |
|
|
533
|
+
* | `untagged` | `boolean \| undefined` | With `categoryId`, return components with **no** non-default tag in that category instead |
|
|
534
|
+
*/
|
|
535
|
+
export declare const PluginCoreTagsListComponentsArgs: z.ZodObject<{
|
|
536
|
+
tagId: z.ZodOptional<z.ZodString>;
|
|
537
|
+
categoryId: z.ZodOptional<z.ZodString>;
|
|
538
|
+
untagged: z.ZodOptional<z.ZodBoolean>;
|
|
539
|
+
}, z.core.$strip>;
|
|
540
|
+
export type PluginCoreTagsListComponentsArgs = z.infer<typeof PluginCoreTagsListComponentsArgs>;
|
|
541
|
+
/**
|
|
542
|
+
* Result of {@linkcode PluginCoreTagsApi.listComponents}.
|
|
543
|
+
*
|
|
544
|
+
* | Property | Type | Description |
|
|
545
|
+
* |---|---|---|
|
|
546
|
+
* | `componentIds` | `ComponentHandle[]` | Ids of the matching components (empty when none) |
|
|
547
|
+
*/
|
|
548
|
+
export declare const PluginCoreTagsListComponentsResult: z.ZodObject<{
|
|
549
|
+
componentIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
550
|
+
}, z.core.$strip>;
|
|
551
|
+
export type PluginCoreTagsListComponentsResult = z.infer<typeof PluginCoreTagsListComponentsResult>;
|
|
552
|
+
/**
|
|
553
|
+
* Arguments for {@linkcode PluginCoreTagsApi.createCategory}.
|
|
554
|
+
*
|
|
555
|
+
* | Property | Type | Description |
|
|
556
|
+
* |---|---|---|
|
|
557
|
+
* | `name` | `string` | Display name of the new category |
|
|
558
|
+
*/
|
|
559
|
+
export declare const PluginCoreTagsCreateCategoryArgs: z.ZodObject<{
|
|
560
|
+
name: z.ZodString;
|
|
561
|
+
}, z.core.$strip>;
|
|
562
|
+
export type PluginCoreTagsCreateCategoryArgs = z.infer<typeof PluginCoreTagsCreateCategoryArgs>;
|
|
563
|
+
/** Result of {@linkcode PluginCoreTagsApi.createCategory} — the new category. */
|
|
564
|
+
export declare const PluginCoreTagsCreateCategoryResult: z.ZodObject<{
|
|
565
|
+
id: z.ZodString;
|
|
566
|
+
name: z.ZodString;
|
|
567
|
+
tagIds: z.ZodArray<z.ZodString>;
|
|
568
|
+
}, z.core.$strip>;
|
|
569
|
+
export type PluginCoreTagsCreateCategoryResult = z.infer<typeof PluginCoreTagsCreateCategoryResult>;
|
|
570
|
+
/**
|
|
571
|
+
* Arguments for {@linkcode PluginCoreTagsApi.updateCategory}.
|
|
572
|
+
*
|
|
573
|
+
* | Property | Type | Description |
|
|
574
|
+
* |---|---|---|
|
|
575
|
+
* | `categoryId` | `string` | The id of the category to rename |
|
|
576
|
+
* | `name` | `string` | The category's new display name |
|
|
577
|
+
*/
|
|
578
|
+
export declare const PluginCoreTagsUpdateCategoryArgs: z.ZodObject<{
|
|
579
|
+
categoryId: z.ZodString;
|
|
580
|
+
name: z.ZodString;
|
|
581
|
+
}, z.core.$strip>;
|
|
582
|
+
export type PluginCoreTagsUpdateCategoryArgs = z.infer<typeof PluginCoreTagsUpdateCategoryArgs>;
|
|
583
|
+
/** Result of {@linkcode PluginCoreTagsApi.updateCategory} — the updated category. */
|
|
584
|
+
export declare const PluginCoreTagsUpdateCategoryResult: z.ZodObject<{
|
|
585
|
+
id: z.ZodString;
|
|
586
|
+
name: z.ZodString;
|
|
587
|
+
tagIds: z.ZodArray<z.ZodString>;
|
|
588
|
+
}, z.core.$strip>;
|
|
589
|
+
export type PluginCoreTagsUpdateCategoryResult = z.infer<typeof PluginCoreTagsUpdateCategoryResult>;
|
|
590
|
+
/**
|
|
591
|
+
* Arguments for {@linkcode PluginCoreTagsApi.deleteCategory}.
|
|
592
|
+
*
|
|
593
|
+
* | Property | Type | Description |
|
|
594
|
+
* |---|---|---|
|
|
595
|
+
* | `categoryId` | `string` | The id of the category to delete |
|
|
596
|
+
*/
|
|
597
|
+
export declare const PluginCoreTagsDeleteCategoryArgs: z.ZodObject<{
|
|
598
|
+
categoryId: z.ZodString;
|
|
599
|
+
}, z.core.$strip>;
|
|
600
|
+
export type PluginCoreTagsDeleteCategoryArgs = z.infer<typeof PluginCoreTagsDeleteCategoryArgs>;
|
|
601
|
+
/**
|
|
602
|
+
* Result of {@linkcode PluginCoreTagsApi.deleteCategory} — the impact of the
|
|
603
|
+
* (non-undoable) delete.
|
|
604
|
+
*
|
|
605
|
+
* | Property | Type | Description |
|
|
606
|
+
* |---|---|---|
|
|
607
|
+
* | `deletedTagCount` | `number` | Number of tags removed with the category |
|
|
608
|
+
* | `resetComponentCount` | `number` | Number of components reset to their default |
|
|
609
|
+
*/
|
|
610
|
+
export declare const PluginCoreTagsDeleteCategoryResult: z.ZodObject<{
|
|
611
|
+
deletedTagCount: z.ZodNumber;
|
|
612
|
+
resetComponentCount: z.ZodNumber;
|
|
613
|
+
}, z.core.$strip>;
|
|
614
|
+
export type PluginCoreTagsDeleteCategoryResult = z.infer<typeof PluginCoreTagsDeleteCategoryResult>;
|
|
615
|
+
/**
|
|
616
|
+
* Arguments for {@linkcode PluginCoreTagsApi.create}.
|
|
617
|
+
*
|
|
618
|
+
* | Property | Type | Description |
|
|
619
|
+
* |---|---|---|
|
|
620
|
+
* | `categoryId` | `string` | The category the new tag belongs to |
|
|
621
|
+
* | `name` | `string` | Display name of the new tag |
|
|
622
|
+
* | `color` | `string \| undefined` | CSS hex color string (auto-assigned if omitted) |
|
|
623
|
+
*/
|
|
624
|
+
export declare const PluginCoreTagsCreateArgs: z.ZodObject<{
|
|
625
|
+
categoryId: z.ZodString;
|
|
626
|
+
name: z.ZodString;
|
|
627
|
+
color: z.ZodOptional<z.ZodString>;
|
|
628
|
+
}, z.core.$strip>;
|
|
629
|
+
export type PluginCoreTagsCreateArgs = z.infer<typeof PluginCoreTagsCreateArgs>;
|
|
630
|
+
/** Result of {@linkcode PluginCoreTagsApi.create} — the new tag. */
|
|
631
|
+
export declare const PluginCoreTagsCreateResult: z.ZodObject<{
|
|
632
|
+
id: z.ZodString;
|
|
633
|
+
categoryId: z.ZodString;
|
|
634
|
+
name: z.ZodString;
|
|
635
|
+
color: z.ZodString;
|
|
636
|
+
}, z.core.$strip>;
|
|
637
|
+
export type PluginCoreTagsCreateResult = z.infer<typeof PluginCoreTagsCreateResult>;
|
|
638
|
+
/**
|
|
639
|
+
* Arguments for {@linkcode PluginCoreTagsApi.update}. Sparse — only the provided
|
|
640
|
+
* fields are changed.
|
|
641
|
+
*
|
|
642
|
+
* | Property | Type | Description |
|
|
643
|
+
* |---|---|---|
|
|
644
|
+
* | `tagId` | `string` | The id of the tag to update |
|
|
645
|
+
* | `name` | `string \| undefined` | New display name (unchanged if omitted) |
|
|
646
|
+
* | `color` | `string \| undefined` | New CSS hex color (unchanged if omitted) |
|
|
647
|
+
*/
|
|
648
|
+
export declare const PluginCoreTagsUpdateArgs: z.ZodObject<{
|
|
649
|
+
tagId: z.ZodString;
|
|
650
|
+
name: z.ZodOptional<z.ZodString>;
|
|
651
|
+
color: z.ZodOptional<z.ZodString>;
|
|
652
|
+
}, z.core.$strip>;
|
|
653
|
+
export type PluginCoreTagsUpdateArgs = z.infer<typeof PluginCoreTagsUpdateArgs>;
|
|
654
|
+
/** Result of {@linkcode PluginCoreTagsApi.update} — the updated tag. */
|
|
655
|
+
export declare const PluginCoreTagsUpdateResult: z.ZodObject<{
|
|
656
|
+
id: z.ZodString;
|
|
657
|
+
categoryId: z.ZodString;
|
|
658
|
+
name: z.ZodString;
|
|
659
|
+
color: z.ZodString;
|
|
660
|
+
}, z.core.$strip>;
|
|
661
|
+
export type PluginCoreTagsUpdateResult = z.infer<typeof PluginCoreTagsUpdateResult>;
|
|
662
|
+
/**
|
|
663
|
+
* Arguments for {@linkcode PluginCoreTagsApi.delete}.
|
|
664
|
+
*
|
|
665
|
+
* | Property | Type | Description |
|
|
666
|
+
* |---|---|---|
|
|
667
|
+
* | `tagId` | `string` | The id of the tag to delete |
|
|
668
|
+
*/
|
|
669
|
+
export declare const PluginCoreTagsDeleteArgs: z.ZodObject<{
|
|
670
|
+
tagId: z.ZodString;
|
|
671
|
+
}, z.core.$strip>;
|
|
672
|
+
export type PluginCoreTagsDeleteArgs = z.infer<typeof PluginCoreTagsDeleteArgs>;
|
|
673
|
+
/**
|
|
674
|
+
* Result of {@linkcode PluginCoreTagsApi.delete} — the impact of the
|
|
675
|
+
* (non-undoable) delete.
|
|
676
|
+
*
|
|
677
|
+
* | Property | Type | Description |
|
|
678
|
+
* |---|---|---|
|
|
679
|
+
* | `resetComponentCount` | `number` | Number of components reset to their category default |
|
|
680
|
+
*/
|
|
681
|
+
export declare const PluginCoreTagsDeleteResult: z.ZodObject<{
|
|
682
|
+
resetComponentCount: z.ZodNumber;
|
|
683
|
+
}, z.core.$strip>;
|
|
684
|
+
export type PluginCoreTagsDeleteResult = z.infer<typeof PluginCoreTagsDeleteResult>;
|
|
685
|
+
/**
|
|
686
|
+
* Arguments for {@linkcode PluginCoreTagsApi.assign}.
|
|
687
|
+
*
|
|
688
|
+
* | Property | Type | Description |
|
|
689
|
+
* |---|---|---|
|
|
690
|
+
* | `componentIds` | `ComponentHandle[]` | The components to tag (at least one) |
|
|
691
|
+
* | `categoryName` | `string` | The tag category; created if it does not exist (not `DEPARTMENT`) |
|
|
692
|
+
* | `tagName` | `string` | The tag within the category; created if it does not exist, else reused |
|
|
693
|
+
*/
|
|
694
|
+
export declare const PluginCoreTagsAssignArgs: z.ZodObject<{
|
|
695
|
+
componentIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
696
|
+
categoryName: z.ZodString;
|
|
697
|
+
tagName: z.ZodString;
|
|
698
|
+
}, z.core.$strip>;
|
|
699
|
+
export type PluginCoreTagsAssignArgs = z.infer<typeof PluginCoreTagsAssignArgs>;
|
|
700
|
+
/**
|
|
701
|
+
* Result of {@linkcode PluginCoreTagsApi.assign} — the resolved category/tag, what
|
|
702
|
+
* was created, and the assign outcome.
|
|
703
|
+
*
|
|
704
|
+
* | Property | Type | Description |
|
|
705
|
+
* |---|---|---|
|
|
706
|
+
* | `categoryId` | `string` | Id of the resolved (or newly created) category |
|
|
707
|
+
* | `tagId` | `string` | Id of the resolved (or newly created) tag |
|
|
708
|
+
* | `categoryCreated` | `boolean` | Whether the category was created by this call |
|
|
709
|
+
* | `tagCreated` | `boolean` | Whether the tag was created by this call |
|
|
710
|
+
* | `assigned` | `string[]` | Ids of the components that were tagged |
|
|
711
|
+
* | `skipped` | `{ id: string; reason: "locked" \| "not-taggable" \| "not-found" }[]` | Components not tagged, each with a reason |
|
|
712
|
+
*/
|
|
713
|
+
export declare const PluginCoreTagsAssignResult: z.ZodObject<{
|
|
714
|
+
assigned: z.ZodArray<z.ZodString>;
|
|
715
|
+
skipped: z.ZodArray<z.ZodObject<{
|
|
716
|
+
id: z.ZodString;
|
|
717
|
+
reason: z.ZodEnum<{
|
|
718
|
+
locked: "locked";
|
|
719
|
+
"not-taggable": "not-taggable";
|
|
720
|
+
"not-found": "not-found";
|
|
721
|
+
}>;
|
|
722
|
+
}, z.core.$strip>>;
|
|
723
|
+
categoryId: z.ZodString;
|
|
724
|
+
tagId: z.ZodString;
|
|
725
|
+
categoryCreated: z.ZodBoolean;
|
|
726
|
+
tagCreated: z.ZodBoolean;
|
|
727
|
+
}, z.core.$strip>;
|
|
728
|
+
export type PluginCoreTagsAssignResult = z.infer<typeof PluginCoreTagsAssignResult>;
|
|
729
|
+
/**
|
|
730
|
+
* Arguments for {@linkcode PluginCoreTagsApi.unassign}.
|
|
731
|
+
*
|
|
732
|
+
* | Property | Type | Description |
|
|
733
|
+
* |---|---|---|
|
|
734
|
+
* | `categoryId` | `string` | The category slot to reset to default |
|
|
735
|
+
* | `componentIds` | `ComponentHandle[]` | The components to clear (at least one) |
|
|
736
|
+
*/
|
|
737
|
+
export declare const PluginCoreTagsUnassignArgs: z.ZodObject<{
|
|
738
|
+
categoryId: z.ZodString;
|
|
739
|
+
componentIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
740
|
+
}, z.core.$strip>;
|
|
741
|
+
export type PluginCoreTagsUnassignArgs = z.infer<typeof PluginCoreTagsUnassignArgs>;
|
|
742
|
+
/** Result of {@linkcode PluginCoreTagsApi.unassign} — the unassign outcome. */
|
|
743
|
+
export declare const PluginCoreTagsUnassignResult: z.ZodObject<{
|
|
744
|
+
assigned: z.ZodArray<z.ZodString>;
|
|
745
|
+
skipped: z.ZodArray<z.ZodObject<{
|
|
746
|
+
id: z.ZodString;
|
|
747
|
+
reason: z.ZodEnum<{
|
|
748
|
+
locked: "locked";
|
|
749
|
+
"not-taggable": "not-taggable";
|
|
750
|
+
"not-found": "not-found";
|
|
751
|
+
}>;
|
|
752
|
+
}, z.core.$strip>>;
|
|
753
|
+
}, z.core.$strip>;
|
|
754
|
+
export type PluginCoreTagsUnassignResult = z.infer<typeof PluginCoreTagsUnassignResult>;
|
|
755
|
+
//# sourceMappingURL=tags.d.ts.map
|