@snaptrude/plugin-core 0.8.0 → 0.9.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.
Files changed (129) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/api-manifest.full.json +1350 -89
  3. package/api-manifest.json +1146 -48
  4. package/dist/api/analysis/daylight.d.ts +603 -0
  5. package/dist/api/analysis/daylight.d.ts.map +1 -0
  6. package/dist/api/analysis/heatmaps.d.ts +438 -14
  7. package/dist/api/analysis/heatmaps.d.ts.map +1 -1
  8. package/dist/api/analysis/index.d.ts +15 -0
  9. package/dist/api/analysis/index.d.ts.map +1 -1
  10. package/dist/api/analysis/solar.d.ts +249 -0
  11. package/dist/api/analysis/solar.d.ts.map +1 -0
  12. package/dist/api/analysis/weather.d.ts +193 -0
  13. package/dist/api/analysis/weather.d.ts.map +1 -0
  14. package/dist/api/core/camera/index.d.ts +37 -0
  15. package/dist/api/core/camera/index.d.ts.map +1 -1
  16. package/dist/api/core/geom/create/index.d.ts +318 -1
  17. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  18. package/dist/api/core/index.d.ts +9 -0
  19. package/dist/api/core/index.d.ts.map +1 -1
  20. package/dist/api/core/io/export/index.d.ts +3 -1
  21. package/dist/api/core/io/export/index.d.ts.map +1 -1
  22. package/dist/api/core/io/import/index.d.ts +61 -0
  23. package/dist/api/core/io/import/index.d.ts.map +1 -1
  24. package/dist/api/core/io/terrain/index.d.ts +132 -0
  25. package/dist/api/core/io/terrain/index.d.ts.map +1 -1
  26. package/dist/api/core/mode/index.d.ts +99 -0
  27. package/dist/api/core/mode/index.d.ts.map +1 -0
  28. package/dist/api/core/storeys/index.d.ts +251 -0
  29. package/dist/api/core/storeys/index.d.ts.map +1 -0
  30. package/dist/api/core/tags.d.ts +24 -0
  31. package/dist/api/core/tags.d.ts.map +1 -1
  32. package/dist/api/core/zoom/index.d.ts +4 -0
  33. package/dist/api/core/zoom/index.d.ts.map +1 -1
  34. package/dist/api/design/create/index.d.ts +115 -4
  35. package/dist/api/design/create/index.d.ts.map +1 -1
  36. package/dist/api/design/delete/index.d.ts +3 -0
  37. package/dist/api/design/delete/index.d.ts.map +1 -1
  38. package/dist/api/design/query/geometry/index.d.ts +112 -0
  39. package/dist/api/design/query/geometry/index.d.ts.map +1 -1
  40. package/dist/api/design/query/index.d.ts +4 -0
  41. package/dist/api/design/query/index.d.ts.map +1 -1
  42. package/dist/api/design/query/referenceLines.d.ts +45 -0
  43. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  44. package/dist/api/design/query/spaces.d.ts +173 -0
  45. package/dist/api/design/query/spaces.d.ts.map +1 -1
  46. package/dist/api/design/transform/index.d.ts +12 -0
  47. package/dist/api/design/transform/index.d.ts.map +1 -1
  48. package/dist/api/design/update/index.d.ts +51 -1
  49. package/dist/api/design/update/index.d.ts.map +1 -1
  50. package/dist/api/entity/buildableEnvelope.d.ts +4 -0
  51. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  52. package/dist/api/entity/referenceLine.d.ts +8 -0
  53. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  54. package/dist/api/entity/story.d.ts +20 -0
  55. package/dist/api/entity/story.d.ts.map +1 -1
  56. package/dist/api/index.d.ts +5 -0
  57. package/dist/api/index.d.ts.map +1 -1
  58. package/dist/api/presentation/annotate.d.ts +23 -4
  59. package/dist/api/presentation/annotate.d.ts.map +1 -1
  60. package/dist/api/presentation/diagrams.d.ts +64 -2
  61. package/dist/api/presentation/diagrams.d.ts.map +1 -1
  62. package/dist/api/presentation/export.d.ts +4 -0
  63. package/dist/api/presentation/export.d.ts.map +1 -1
  64. package/dist/api/presentation/import.d.ts +6 -0
  65. package/dist/api/presentation/import.d.ts.map +1 -1
  66. package/dist/api/presentation/index.d.ts +20 -1
  67. package/dist/api/presentation/index.d.ts.map +1 -1
  68. package/dist/api/presentation/placedViews.d.ts +1139 -0
  69. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  70. package/dist/api/presentation/shapes.d.ts +481 -0
  71. package/dist/api/presentation/shapes.d.ts.map +1 -0
  72. package/dist/api/presentation/sheets.d.ts +42 -0
  73. package/dist/api/presentation/sheets.d.ts.map +1 -1
  74. package/dist/api/presentation/slideshow.d.ts +125 -0
  75. package/dist/api/presentation/slideshow.d.ts.map +1 -0
  76. package/dist/api/presentation/tables.d.ts +81 -0
  77. package/dist/api/presentation/tables.d.ts.map +1 -0
  78. package/dist/api/program/site.d.ts +260 -2
  79. package/dist/api/program/site.d.ts.map +1 -1
  80. package/dist/api/program/spreadsheet.d.ts +260 -28
  81. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  82. package/dist/api/workspace/index.d.ts +505 -0
  83. package/dist/api/workspace/index.d.ts.map +1 -0
  84. package/dist/index.cjs +2904 -1761
  85. package/dist/index.cjs.map +1 -1
  86. package/dist/index.js +2762 -1761
  87. package/dist/index.js.map +1 -1
  88. package/package.json +3 -2
  89. package/scripts/generate-manifest.mjs +45 -0
  90. package/src/api/analysis/daylight.ts +470 -0
  91. package/src/api/analysis/heatmaps.ts +444 -17
  92. package/src/api/analysis/index.ts +15 -0
  93. package/src/api/analysis/solar.ts +237 -0
  94. package/src/api/analysis/weather.ts +179 -0
  95. package/src/api/core/camera/index.ts +39 -0
  96. package/src/api/core/geom/create/index.ts +344 -1
  97. package/src/api/core/index.ts +9 -0
  98. package/src/api/core/io/export/index.ts +3 -1
  99. package/src/api/core/io/import/index.ts +64 -0
  100. package/src/api/core/io/terrain/index.ts +143 -0
  101. package/src/api/core/mode/index.ts +96 -0
  102. package/src/api/core/storeys/index.ts +279 -0
  103. package/src/api/core/tags.ts +27 -0
  104. package/src/api/core/zoom/index.ts +4 -0
  105. package/src/api/design/create/index.ts +138 -1
  106. package/src/api/design/delete/index.ts +3 -0
  107. package/src/api/design/query/geometry/index.ts +125 -3
  108. package/src/api/design/query/index.ts +4 -0
  109. package/src/api/design/query/referenceLines.ts +52 -0
  110. package/src/api/design/query/spaces.ts +143 -0
  111. package/src/api/design/transform/index.ts +12 -0
  112. package/src/api/design/update/index.ts +66 -1
  113. package/src/api/entity/buildableEnvelope.ts +4 -0
  114. package/src/api/entity/referenceLine.ts +8 -0
  115. package/src/api/entity/story.ts +20 -0
  116. package/src/api/index.ts +5 -0
  117. package/src/api/presentation/annotate.ts +27 -2
  118. package/src/api/presentation/diagrams.ts +67 -2
  119. package/src/api/presentation/export.ts +4 -0
  120. package/src/api/presentation/import.ts +6 -0
  121. package/src/api/presentation/index.ts +20 -1
  122. package/src/api/presentation/placedViews.ts +1120 -0
  123. package/src/api/presentation/shapes.ts +274 -0
  124. package/src/api/presentation/sheets.ts +54 -0
  125. package/src/api/presentation/slideshow.ts +134 -0
  126. package/src/api/presentation/tables.ts +84 -0
  127. package/src/api/program/site.ts +205 -2
  128. package/src/api/program/spreadsheet.ts +251 -6
  129. package/src/api/workspace/index.ts +563 -0
@@ -0,0 +1,563 @@
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../types"
3
+
4
+ /**
5
+ * `snaptrude.workspace.*` — the dashboard surface: projects and teams outside the
6
+ * open canvas.
7
+ *
8
+ * This namespace reads and creates the containers a design lives in — the
9
+ * project itself and the team it belongs to — mirroring the Snaptrude dashboard.
10
+ * Teams are **read-only** here (no create/invite/delete in v1, a deliberate
11
+ * safety decision); there are no folders in v1. A `projectId` is the project's
12
+ * floorkey. Plan limits are enforced by the backend — a limit rejection surfaces
13
+ * as a normal host error. It also carries the workspace-level mode switch for
14
+ * Present mode ({@linkcode PluginWorkspaceApi.openPresentMode} /
15
+ * {@linkcode PluginWorkspaceApi.closePresentMode}).
16
+ *
17
+ * - {@linkcode PluginWorkspaceApi.projects} — Create, copy, list, read & rename projects
18
+ * - {@linkcode PluginWorkspaceApi.teams} — Read teams and their members
19
+ * - {@linkcode PluginWorkspaceApi.openPresentMode} / {@linkcode PluginWorkspaceApi.closePresentMode} — Open/close the Present-mode documentation editor
20
+ */
21
+ export abstract class PluginWorkspaceApi {
22
+ /** Projects — create, copy, list, read & rename. See {@linkcode PluginWorkspaceProjectsApi}. */
23
+ public abstract projects: PluginWorkspaceProjectsApi
24
+ /** Teams — read teams and their members. See {@linkcode PluginWorkspaceTeamsApi}. */
25
+ public abstract teams: PluginWorkspaceTeamsApi
26
+
27
+ /**
28
+ * Open Present mode — the documentation editor the `presentation.*`
29
+ * namespaces operate on.
30
+ *
31
+ * Switches the workspace into Present mode and resolves only once the
32
+ * Present canvas has finished mounting (waits up to ~15s; a mount that
33
+ * never completes is refused with a typed `PRECONDITION_FAILED`), so a
34
+ * `presentation.*` call issued right after this resolves finds Present
35
+ * mode open. Idempotent — resolves immediately when Present mode is
36
+ * already open. Write-gated: switching the mode under the user's feet is
37
+ * approval-controlled by design.
38
+ *
39
+ * @throws `PRECONDITION_FAILED` if the Present canvas does not mount within
40
+ * the timeout.
41
+ *
42
+ * @examplePrompt Open present mode
43
+ * @examplePrompt Switch to the presentation editor
44
+ * @examplePrompt Open the sheets so I can lay out views
45
+ *
46
+ * # Example
47
+ * ```ts
48
+ * await snaptrude.workspace.openPresentMode()
49
+ * const { sheets } = await snaptrude.presentation.sheets.list()
50
+ * ```
51
+ */
52
+ public abstract openPresentMode(): PluginApiReturn<void>
53
+
54
+ /**
55
+ * Close Present mode and return to the modeling canvas.
56
+ *
57
+ * Idempotent — a no-op when Present mode is not open. Write-gated, like
58
+ * {@linkcode PluginWorkspaceApi.openPresentMode}.
59
+ *
60
+ * @examplePrompt Close present mode
61
+ * @examplePrompt Exit the presentation editor
62
+ * @examplePrompt Go back to the modeling canvas
63
+ *
64
+ * # Example
65
+ * ```ts
66
+ * await snaptrude.workspace.closePresentMode()
67
+ * ```
68
+ */
69
+ public abstract closePresentMode(): PluginApiReturn<void>
70
+
71
+ constructor() {}
72
+ }
73
+
74
+ /**
75
+ * `workspace.projects.*` — create, copy, list, read & rename projects.
76
+ *
77
+ * A **project** is a single Snaptrude model, identified by its `projectId`
78
+ * (floorkey). Reads never throw for a miss ({@linkcode PluginWorkspaceProjectsApi.get}
79
+ * returns `null`). Create/copy/rename go through the backend, which enforces plan
80
+ * limits — a rejection surfaces as a normal host error.
81
+ *
82
+ * Accessed via `snaptrude.workspace.projects`.
83
+ */
84
+ export abstract class PluginWorkspaceProjectsApi {
85
+ constructor() {}
86
+
87
+ /**
88
+ * Create a new, empty BIM project.
89
+ *
90
+ * Creates the project on the backend and returns its `projectId` (floorkey).
91
+ * Pass `options.teamId` to create it inside a team (otherwise it lands in the
92
+ * user's personal workspace) and `options.unit` to set the default length unit.
93
+ *
94
+ * @param name - Display name of the new project.
95
+ * @param options - Optional `unit` (default length unit) and `teamId` (owning team).
96
+ * @returns The new project's `projectId`.
97
+ * @throws If the backend rejects the create (e.g. a plan project limit).
98
+ *
99
+ * @examplePrompt Create a new project called Tower Study
100
+ * @examplePrompt Start a new project in the Acme team
101
+ * @examplePrompt Make a fresh project using millimeters
102
+ * @examplePrompt Create an empty project for me to work in
103
+ *
104
+ * # Example
105
+ * ```ts
106
+ * const { projectId } = await snaptrude.workspace.projects.create("Tower Study", {
107
+ * teamId: "team_1",
108
+ * unit: "mm",
109
+ * })
110
+ * ```
111
+ */
112
+ public abstract create(
113
+ name: string,
114
+ options?: { unit?: string; teamId?: string },
115
+ ): PluginApiReturn<PluginWorkspaceProjectsCreateResult>
116
+
117
+ /**
118
+ * Copy the **current** project into a new project — the dashboard's "Save As".
119
+ *
120
+ * Duplicates the project that is currently open into a new project with the
121
+ * given name, and returns the new `projectId`. Pass `options.teamId` to place
122
+ * the copy in a specific team.
123
+ *
124
+ * @param name - Display name for the copy.
125
+ * @param options - Optional `teamId` (team to place the copy in).
126
+ * @returns The new project's `projectId`.
127
+ * @throws If the backend rejects the copy (e.g. a plan project limit).
128
+ *
129
+ * @examplePrompt Save this project as a new copy called Tower Study v2
130
+ * @examplePrompt Duplicate the current project into the Acme team
131
+ * @examplePrompt Make a copy of this project so I can try changes
132
+ *
133
+ * # Example
134
+ * ```ts
135
+ * const { projectId } = await snaptrude.workspace.projects.copy("Tower Study v2")
136
+ * ```
137
+ */
138
+ public abstract copy(
139
+ name: string,
140
+ options?: { teamId?: string },
141
+ ): PluginApiReturn<PluginWorkspaceProjectsCopyResult>
142
+
143
+ /**
144
+ * List the projects the user can access.
145
+ *
146
+ * Returns a {@linkcode PluginProjectRef} per project. Pass `options.teamId` to
147
+ * scope the list to a single team; omit it for the user's accessible projects.
148
+ *
149
+ * @param options - Optional `teamId` filter.
150
+ * @returns A {@linkcode PluginWorkspaceProjectsListResult} with a `projects`
151
+ * array (empty when there are none).
152
+ *
153
+ * @examplePrompt List all my projects
154
+ * @examplePrompt Show the projects in the Acme team
155
+ * @examplePrompt How many projects do I have?
156
+ * @examplePrompt What projects can I open?
157
+ *
158
+ * # Example
159
+ * ```ts
160
+ * const { projects } = await snaptrude.workspace.projects.list({ teamId: "team_1" })
161
+ * for (const p of projects) console.log(p.id, p.name)
162
+ * ```
163
+ */
164
+ public abstract list(
165
+ options?: { teamId?: string },
166
+ ): PluginApiReturn<PluginWorkspaceProjectsListResult>
167
+
168
+ /**
169
+ * Get a single project by id.
170
+ *
171
+ * @param projectId - The project's `projectId` (floorkey).
172
+ * @returns The matching {@linkcode PluginProjectRef}, or `null` if no project
173
+ * has that id / the user cannot access it.
174
+ *
175
+ * @examplePrompt Get the project with this id
176
+ * @examplePrompt Look up a project by its floorkey
177
+ * @examplePrompt What is the name of this project?
178
+ *
179
+ * # Example
180
+ * ```ts
181
+ * const project = await snaptrude.workspace.projects.get("floorkey_123")
182
+ * if (project) console.log(project.name)
183
+ * ```
184
+ */
185
+ public abstract get(
186
+ projectId: string,
187
+ ): PluginApiReturn<PluginWorkspaceProjectsGetResult>
188
+
189
+ /**
190
+ * Rename a project.
191
+ *
192
+ * @param projectId - The project's `projectId` (floorkey).
193
+ * @param name - The project's new display name.
194
+ * @returns The renamed project's `projectId`.
195
+ * @throws If no project has the given id or the rename is rejected.
196
+ *
197
+ * @examplePrompt Rename this project to Tower Study Final
198
+ * @examplePrompt Change the name of project floorkey_123
199
+ * @examplePrompt Give this project a new name
200
+ *
201
+ * # Example
202
+ * ```ts
203
+ * const { projectId } = await snaptrude.workspace.projects.rename(
204
+ * "floorkey_123",
205
+ * "Tower Study Final",
206
+ * )
207
+ * ```
208
+ */
209
+ public abstract rename(
210
+ projectId: string,
211
+ name: string,
212
+ ): PluginApiReturn<PluginWorkspaceProjectsRenameResult>
213
+ }
214
+
215
+ /**
216
+ * `workspace.teams.*` — read teams and their members.
217
+ *
218
+ * A **team** is a shared workspace that owns projects and members. **Read-only**
219
+ * in v1: there is no create/invite/delete (a deliberate safety decision). Reads
220
+ * never throw for a miss ({@linkcode PluginWorkspaceTeamsApi.get} returns `null`).
221
+ *
222
+ * Accessed via `snaptrude.workspace.teams`.
223
+ */
224
+ export abstract class PluginWorkspaceTeamsApi {
225
+ constructor() {}
226
+
227
+ /**
228
+ * List the teams the user belongs to.
229
+ *
230
+ * @returns A {@linkcode PluginWorkspaceTeamsListResult} with a `teams` array
231
+ * (empty when the user belongs to none).
232
+ *
233
+ * @examplePrompt List all my teams
234
+ * @examplePrompt Which teams am I a member of?
235
+ * @examplePrompt Show every team I can access
236
+ *
237
+ * # Example
238
+ * ```ts
239
+ * const { teams } = await snaptrude.workspace.teams.list()
240
+ * for (const t of teams) console.log(t.id, t.name)
241
+ * ```
242
+ */
243
+ public abstract list(): PluginApiReturn<PluginWorkspaceTeamsListResult>
244
+
245
+ /**
246
+ * Get a single team by id.
247
+ *
248
+ * @param teamId - The id of the team to read.
249
+ * @returns The matching {@linkcode PluginTeamRef}, or `null` if no team has that
250
+ * id / the user is not a member.
251
+ *
252
+ * @examplePrompt Get the team with id team_1
253
+ * @examplePrompt Look up a team by its id
254
+ * @examplePrompt What is the name of this team?
255
+ *
256
+ * # Example
257
+ * ```ts
258
+ * const team = await snaptrude.workspace.teams.get("team_1")
259
+ * if (team) console.log(team.name)
260
+ * ```
261
+ */
262
+ public abstract get(
263
+ teamId: string,
264
+ ): PluginApiReturn<PluginWorkspaceTeamsGetResult>
265
+
266
+ /**
267
+ * List the members of a team.
268
+ *
269
+ * @param teamId - The id of the team whose members to list.
270
+ * @returns A {@linkcode PluginWorkspaceTeamsListMembersResult} with a `members`
271
+ * array (empty when the team has none / is missing).
272
+ *
273
+ * @examplePrompt List the members of the Acme team
274
+ * @examplePrompt Who is on team_1?
275
+ * @examplePrompt How many people are in this team?
276
+ *
277
+ * # Example
278
+ * ```ts
279
+ * const { members } = await snaptrude.workspace.teams.listMembers("team_1")
280
+ * for (const m of members) console.log(m.name, m.email)
281
+ * ```
282
+ */
283
+ public abstract listMembers(
284
+ teamId: string,
285
+ ): PluginApiReturn<PluginWorkspaceTeamsListMembersResult>
286
+ }
287
+
288
+ // ---------------------------------------------------------------------------
289
+ // DTOs — conservative, never raw backend payloads
290
+ // ---------------------------------------------------------------------------
291
+
292
+ /**
293
+ * A project reference — a conservative projection of a project, never the raw
294
+ * backend payload.
295
+ *
296
+ * | Property | Type | Description |
297
+ * |---|---|---|
298
+ * | `id` | `string` | The project's `projectId` (floorkey) |
299
+ * | `name` | `string` | Display name |
300
+ * | `teamId` | `string?` | Owning team id (absent for personal projects) |
301
+ * | `createdAt` | `string?` | Creation timestamp (ISO 8601) when known |
302
+ * | `modifiedAt` | `string?` | Last-modified timestamp (ISO 8601) when known |
303
+ */
304
+ export const PluginProjectRef = z.object({
305
+ id: z.string(),
306
+ name: z.string(),
307
+ teamId: z.string().optional(),
308
+ createdAt: z.string().optional(),
309
+ modifiedAt: z.string().optional(),
310
+ })
311
+ export type PluginProjectRef = z.infer<typeof PluginProjectRef>
312
+
313
+ /**
314
+ * A team reference — a conservative projection of a team, never the raw backend
315
+ * payload.
316
+ *
317
+ * | Property | Type | Description |
318
+ * |---|---|---|
319
+ * | `id` | `string` | Stable team id |
320
+ * | `name` | `string` | Display name |
321
+ * | `role` | `string?` | The user's role in the team when known |
322
+ */
323
+ export const PluginTeamRef = z.object({
324
+ id: z.string(),
325
+ name: z.string(),
326
+ role: z.string().optional(),
327
+ })
328
+ export type PluginTeamRef = z.infer<typeof PluginTeamRef>
329
+
330
+ /**
331
+ * A team member reference — a conservative projection of a member, never the raw
332
+ * backend payload.
333
+ *
334
+ * | Property | Type | Description |
335
+ * |---|---|---|
336
+ * | `id` | `string` | Stable user id |
337
+ * | `name` | `string` | Display name |
338
+ * | `email` | `string?` | Email address when known |
339
+ * | `role` | `string?` | The member's role in the team when known |
340
+ */
341
+ export const PluginTeamMemberRef = z.object({
342
+ id: z.string(),
343
+ name: z.string(),
344
+ email: z.string().optional(),
345
+ role: z.string().optional(),
346
+ })
347
+ export type PluginTeamMemberRef = z.infer<typeof PluginTeamMemberRef>
348
+
349
+ // ---------------------------------------------------------------------------
350
+ // projects — args + results
351
+ // ---------------------------------------------------------------------------
352
+
353
+ /**
354
+ * Arguments for {@linkcode PluginWorkspaceProjectsApi.create} (options flattened).
355
+ *
356
+ * | Property | Type | Description |
357
+ * |---|---|---|
358
+ * | `name` | `string` | Display name of the new project |
359
+ * | `unit` | `string?` | Default length unit |
360
+ * | `teamId` | `string?` | Owning team id (personal workspace if omitted) |
361
+ */
362
+ export const PluginWorkspaceProjectsCreateArgs = z.object({
363
+ name: z.string(),
364
+ unit: z.string().optional(),
365
+ teamId: z.string().optional(),
366
+ })
367
+ export type PluginWorkspaceProjectsCreateArgs = z.infer<
368
+ typeof PluginWorkspaceProjectsCreateArgs
369
+ >
370
+
371
+ /**
372
+ * Result of {@linkcode PluginWorkspaceProjectsApi.create}.
373
+ *
374
+ * | Property | Type | Description |
375
+ * |---|---|---|
376
+ * | `projectId` | `string` | The id (floorkey) of the created project |
377
+ */
378
+ export const PluginWorkspaceProjectsCreateResult = z.object({
379
+ projectId: z.string(),
380
+ })
381
+ export type PluginWorkspaceProjectsCreateResult = z.infer<
382
+ typeof PluginWorkspaceProjectsCreateResult
383
+ >
384
+
385
+ /**
386
+ * Arguments for {@linkcode PluginWorkspaceProjectsApi.copy} (options flattened).
387
+ *
388
+ * | Property | Type | Description |
389
+ * |---|---|---|
390
+ * | `name` | `string` | Display name for the copy |
391
+ * | `teamId` | `string?` | Team to place the copy in |
392
+ */
393
+ export const PluginWorkspaceProjectsCopyArgs = z.object({
394
+ name: z.string(),
395
+ teamId: z.string().optional(),
396
+ })
397
+ export type PluginWorkspaceProjectsCopyArgs = z.infer<
398
+ typeof PluginWorkspaceProjectsCopyArgs
399
+ >
400
+
401
+ /**
402
+ * Result of {@linkcode PluginWorkspaceProjectsApi.copy}.
403
+ *
404
+ * | Property | Type | Description |
405
+ * |---|---|---|
406
+ * | `projectId` | `string` | The id (floorkey) of the copied project |
407
+ */
408
+ export const PluginWorkspaceProjectsCopyResult = z.object({
409
+ projectId: z.string(),
410
+ })
411
+ export type PluginWorkspaceProjectsCopyResult = z.infer<
412
+ typeof PluginWorkspaceProjectsCopyResult
413
+ >
414
+
415
+ /**
416
+ * Arguments for {@linkcode PluginWorkspaceProjectsApi.list} (options flattened).
417
+ *
418
+ * | Property | Type | Description |
419
+ * |---|---|---|
420
+ * | `teamId` | `string?` | Scope the list to this team; omit for all accessible projects |
421
+ */
422
+ export const PluginWorkspaceProjectsListArgs = z.object({
423
+ teamId: z.string().optional(),
424
+ })
425
+ export type PluginWorkspaceProjectsListArgs = z.infer<
426
+ typeof PluginWorkspaceProjectsListArgs
427
+ >
428
+
429
+ /**
430
+ * Result of {@linkcode PluginWorkspaceProjectsApi.list}.
431
+ *
432
+ * | Property | Type | Description |
433
+ * |---|---|---|
434
+ * | `projects` | {@linkcode PluginProjectRef}`[]` | Accessible projects (empty when none) |
435
+ */
436
+ export const PluginWorkspaceProjectsListResult = z.object({
437
+ projects: z.array(PluginProjectRef),
438
+ })
439
+ export type PluginWorkspaceProjectsListResult = z.infer<
440
+ typeof PluginWorkspaceProjectsListResult
441
+ >
442
+
443
+ /**
444
+ * Arguments for {@linkcode PluginWorkspaceProjectsApi.get}.
445
+ *
446
+ * | Property | Type | Description |
447
+ * |---|---|---|
448
+ * | `projectId` | `string` | The project's `projectId` (floorkey) |
449
+ */
450
+ export const PluginWorkspaceProjectsGetArgs = z.object({
451
+ projectId: z.string(),
452
+ })
453
+ export type PluginWorkspaceProjectsGetArgs = z.infer<
454
+ typeof PluginWorkspaceProjectsGetArgs
455
+ >
456
+
457
+ /**
458
+ * Result of {@linkcode PluginWorkspaceProjectsApi.get} — the project, or `null`
459
+ * when no project has the given id.
460
+ */
461
+ export const PluginWorkspaceProjectsGetResult = PluginProjectRef.nullable()
462
+ export type PluginWorkspaceProjectsGetResult = z.infer<
463
+ typeof PluginWorkspaceProjectsGetResult
464
+ >
465
+
466
+ /**
467
+ * Arguments for {@linkcode PluginWorkspaceProjectsApi.rename}.
468
+ *
469
+ * | Property | Type | Description |
470
+ * |---|---|---|
471
+ * | `projectId` | `string` | The project's `projectId` (floorkey) |
472
+ * | `name` | `string` | The project's new display name |
473
+ */
474
+ export const PluginWorkspaceProjectsRenameArgs = z.object({
475
+ projectId: z.string(),
476
+ name: z.string(),
477
+ })
478
+ export type PluginWorkspaceProjectsRenameArgs = z.infer<
479
+ typeof PluginWorkspaceProjectsRenameArgs
480
+ >
481
+
482
+ /**
483
+ * Result of {@linkcode PluginWorkspaceProjectsApi.rename}.
484
+ *
485
+ * | Property | Type | Description |
486
+ * |---|---|---|
487
+ * | `projectId` | `string` | The id (floorkey) of the renamed project |
488
+ */
489
+ export const PluginWorkspaceProjectsRenameResult = z.object({
490
+ projectId: z.string(),
491
+ })
492
+ export type PluginWorkspaceProjectsRenameResult = z.infer<
493
+ typeof PluginWorkspaceProjectsRenameResult
494
+ >
495
+
496
+ // ---------------------------------------------------------------------------
497
+ // teams — args + results
498
+ // ---------------------------------------------------------------------------
499
+
500
+ /**
501
+ * Result of {@linkcode PluginWorkspaceTeamsApi.list}.
502
+ *
503
+ * | Property | Type | Description |
504
+ * |---|---|---|
505
+ * | `teams` | {@linkcode PluginTeamRef}`[]` | The user's teams (empty when none) |
506
+ */
507
+ export const PluginWorkspaceTeamsListResult = z.object({
508
+ teams: z.array(PluginTeamRef),
509
+ })
510
+ export type PluginWorkspaceTeamsListResult = z.infer<
511
+ typeof PluginWorkspaceTeamsListResult
512
+ >
513
+
514
+ /**
515
+ * Arguments for {@linkcode PluginWorkspaceTeamsApi.get}.
516
+ *
517
+ * | Property | Type | Description |
518
+ * |---|---|---|
519
+ * | `teamId` | `string` | The id of the team to read |
520
+ */
521
+ export const PluginWorkspaceTeamsGetArgs = z.object({
522
+ teamId: z.string(),
523
+ })
524
+ export type PluginWorkspaceTeamsGetArgs = z.infer<
525
+ typeof PluginWorkspaceTeamsGetArgs
526
+ >
527
+
528
+ /**
529
+ * Result of {@linkcode PluginWorkspaceTeamsApi.get} — the team, or `null` when no
530
+ * team has the given id.
531
+ */
532
+ export const PluginWorkspaceTeamsGetResult = PluginTeamRef.nullable()
533
+ export type PluginWorkspaceTeamsGetResult = z.infer<
534
+ typeof PluginWorkspaceTeamsGetResult
535
+ >
536
+
537
+ /**
538
+ * Arguments for {@linkcode PluginWorkspaceTeamsApi.listMembers}.
539
+ *
540
+ * | Property | Type | Description |
541
+ * |---|---|---|
542
+ * | `teamId` | `string` | The id of the team whose members to list |
543
+ */
544
+ export const PluginWorkspaceTeamsListMembersArgs = z.object({
545
+ teamId: z.string(),
546
+ })
547
+ export type PluginWorkspaceTeamsListMembersArgs = z.infer<
548
+ typeof PluginWorkspaceTeamsListMembersArgs
549
+ >
550
+
551
+ /**
552
+ * Result of {@linkcode PluginWorkspaceTeamsApi.listMembers}.
553
+ *
554
+ * | Property | Type | Description |
555
+ * |---|---|---|
556
+ * | `members` | {@linkcode PluginTeamMemberRef}`[]` | The team's members (empty when none) |
557
+ */
558
+ export const PluginWorkspaceTeamsListMembersResult = z.object({
559
+ members: z.array(PluginTeamMemberRef),
560
+ })
561
+ export type PluginWorkspaceTeamsListMembersResult = z.infer<
562
+ typeof PluginWorkspaceTeamsListMembersResult
563
+ >