@snaptrude/plugin-client 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.
Files changed (83) hide show
  1. package/AGENTS.md +38 -46
  2. package/CHANGELOG.md +11 -0
  3. package/CLAUDE.md +1 -1
  4. package/dist/api/index.d.ts +12 -16
  5. package/dist/api/index.d.ts.map +1 -1
  6. package/dist/index.cjs +23 -655
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +25 -648
  9. package/dist/index.js.map +1 -1
  10. package/dist/rpc-proxy.d.ts +28 -0
  11. package/dist/rpc-proxy.d.ts.map +1 -0
  12. package/package.json +2 -2
  13. package/src/api/index.ts +26 -22
  14. package/src/rpc-proxy.ts +56 -0
  15. package/dist/api/core/geom/arc.d.ts +0 -5
  16. package/dist/api/core/geom/arc.d.ts.map +0 -1
  17. package/dist/api/core/geom/curve.d.ts +0 -5
  18. package/dist/api/core/geom/curve.d.ts.map +0 -1
  19. package/dist/api/core/geom/index.d.ts +0 -17
  20. package/dist/api/core/geom/index.d.ts.map +0 -1
  21. package/dist/api/core/geom/line.d.ts +0 -5
  22. package/dist/api/core/geom/line.d.ts.map +0 -1
  23. package/dist/api/core/geom/profile.d.ts +0 -7
  24. package/dist/api/core/geom/profile.d.ts.map +0 -1
  25. package/dist/api/core/index.d.ts +0 -11
  26. package/dist/api/core/index.d.ts.map +0 -1
  27. package/dist/api/core/math/index.d.ts +0 -11
  28. package/dist/api/core/math/index.d.ts.map +0 -1
  29. package/dist/api/core/math/quat.d.ts +0 -5
  30. package/dist/api/core/math/quat.d.ts.map +0 -1
  31. package/dist/api/core/math/vec3.d.ts +0 -5
  32. package/dist/api/core/math/vec3.d.ts.map +0 -1
  33. package/dist/api/documentation/aiInspiration.d.ts +0 -24
  34. package/dist/api/documentation/aiInspiration.d.ts.map +0 -1
  35. package/dist/api/documentation/index.d.ts +0 -8
  36. package/dist/api/documentation/index.d.ts.map +0 -1
  37. package/dist/api/entity/buildableEnvelope.d.ts +0 -7
  38. package/dist/api/entity/buildableEnvelope.d.ts.map +0 -1
  39. package/dist/api/entity/department.d.ts +0 -7
  40. package/dist/api/entity/department.d.ts.map +0 -1
  41. package/dist/api/entity/index.d.ts +0 -20
  42. package/dist/api/entity/index.d.ts.map +0 -1
  43. package/dist/api/entity/referenceLine.d.ts +0 -9
  44. package/dist/api/entity/referenceLine.d.ts.map +0 -1
  45. package/dist/api/entity/space.d.ts +0 -15
  46. package/dist/api/entity/space.d.ts.map +0 -1
  47. package/dist/api/entity/story.d.ts +0 -9
  48. package/dist/api/entity/story.d.ts.map +0 -1
  49. package/dist/api/tools/copy.d.ts +0 -3
  50. package/dist/api/tools/copy.d.ts.map +0 -1
  51. package/dist/api/tools/index.d.ts +0 -14
  52. package/dist/api/tools/index.d.ts.map +0 -1
  53. package/dist/api/tools/offset.d.ts +0 -3
  54. package/dist/api/tools/offset.d.ts.map +0 -1
  55. package/dist/api/tools/selection.d.ts +0 -6
  56. package/dist/api/tools/selection.d.ts.map +0 -1
  57. package/dist/api/tools/transform.d.ts +0 -7
  58. package/dist/api/tools/transform.d.ts.map +0 -1
  59. package/dist/api/units/index.d.ts +0 -7
  60. package/dist/api/units/index.d.ts.map +0 -1
  61. package/src/api/core/geom/arc.ts +0 -7
  62. package/src/api/core/geom/curve.ts +0 -7
  63. package/src/api/core/geom/index.ts +0 -25
  64. package/src/api/core/geom/line.ts +0 -7
  65. package/src/api/core/geom/profile.ts +0 -17
  66. package/src/api/core/index.ts +0 -17
  67. package/src/api/core/math/index.ts +0 -17
  68. package/src/api/core/math/quat.ts +0 -7
  69. package/src/api/core/math/vec3.ts +0 -7
  70. package/src/api/documentation/aiInspiration.ts +0 -193
  71. package/src/api/documentation/index.ts +0 -13
  72. package/src/api/entity/buildableEnvelope.ts +0 -34
  73. package/src/api/entity/department.ts +0 -30
  74. package/src/api/entity/index.ts +0 -29
  75. package/src/api/entity/referenceLine.ts +0 -54
  76. package/src/api/entity/space.ts +0 -160
  77. package/src/api/entity/story.ts +0 -66
  78. package/src/api/tools/copy.ts +0 -10
  79. package/src/api/tools/index.ts +0 -33
  80. package/src/api/tools/offset.ts +0 -15
  81. package/src/api/tools/selection.ts +0 -15
  82. package/src/api/tools/transform.ts +0 -44
  83. package/src/api/units/index.ts +0 -34
@@ -1,66 +0,0 @@
1
- import {
2
- PluginStoryApi,
3
- PluginStoryGetArgs,
4
- PluginStoryGetResult,
5
- PluginStoryGetAllResult,
6
- PluginStoryCreateArgs,
7
- PluginStoryCreateResult,
8
- PluginStoryUpdateArgs,
9
- PluginStoryUpdateResult,
10
- } from "@snaptrude/plugin-core"
11
- import { getHostApi } from "../../host-api"
12
-
13
- export class ClientStoryApi extends PluginStoryApi {
14
- constructor() {
15
- super()
16
- }
17
-
18
- public async get({
19
- storyValue,
20
- properties,
21
- }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {
22
- const hostApi = getHostApi()
23
- return hostApi.call({
24
- method: "entity.story.get",
25
- args: {
26
- storyValue,
27
- properties,
28
- },
29
- })
30
- }
31
-
32
- public async getAll(): Promise<PluginStoryGetAllResult> {
33
- const hostApi = getHostApi()
34
- return hostApi.call({
35
- method: "entity.story.getAll",
36
- })
37
- }
38
-
39
- public async create({
40
- storyValue,
41
- height,
42
- }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {
43
- const hostApi = getHostApi()
44
- return hostApi.call({
45
- method: "entity.story.create",
46
- args: {
47
- storyValue,
48
- height,
49
- },
50
- })
51
- }
52
-
53
- public async update({
54
- storyValue,
55
- height,
56
- }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {
57
- const hostApi = getHostApi()
58
- return hostApi.call({
59
- method: "entity.story.update",
60
- args: {
61
- storyValue,
62
- height,
63
- },
64
- })
65
- }
66
- }
@@ -1,10 +0,0 @@
1
- import type { PluginCopyArgs, PluginCopyResult } from "@snaptrude/plugin-core"
2
- import { getHostApi } from "../../host-api"
3
-
4
- export async function copy(args: PluginCopyArgs): Promise<PluginCopyResult> {
5
- const hostApi = getHostApi()
6
- return hostApi.call({
7
- method: "tools.copy",
8
- args,
9
- })
10
- }
@@ -1,33 +0,0 @@
1
- import { PluginToolsApi } from "@snaptrude/plugin-core"
2
- import type {
3
- PluginCopyArgs,
4
- PluginCopyResult,
5
- PluginOffsetArgs,
6
- PluginOffsetResult,
7
- } from "@snaptrude/plugin-core"
8
- import { ClientSelectionApi } from "./selection"
9
- import { ClientTransformApi } from "./transform"
10
- import { copy } from "./copy"
11
- import { offset } from "./offset"
12
-
13
- export class ClientToolsApi extends PluginToolsApi {
14
- public selection: ClientSelectionApi
15
- public transform: ClientTransformApi
16
-
17
- constructor() {
18
- super()
19
- this.selection = new ClientSelectionApi()
20
- this.transform = new ClientTransformApi()
21
- }
22
-
23
- public async copy(args: PluginCopyArgs): Promise<PluginCopyResult> {
24
- return copy(args)
25
- }
26
-
27
- public async offset(args: PluginOffsetArgs): Promise<PluginOffsetResult> {
28
- return offset(args)
29
- }
30
- }
31
-
32
- export * from "./selection"
33
- export * from "./transform"
@@ -1,15 +0,0 @@
1
- import type {
2
- PluginOffsetArgs,
3
- PluginOffsetResult,
4
- } from "@snaptrude/plugin-core"
5
- import { getHostApi } from "../../host-api"
6
-
7
- export async function offset(
8
- args: PluginOffsetArgs,
9
- ): Promise<PluginOffsetResult> {
10
- const hostApi = getHostApi()
11
- return hostApi.call({
12
- method: "tools.offset",
13
- args,
14
- })
15
- }
@@ -1,15 +0,0 @@
1
- import { PluginSelectionApi, PluginSelectionGetResult } from "@snaptrude/plugin-core"
2
- import { getHostApi } from "../../host-api"
3
-
4
- export class ClientSelectionApi extends PluginSelectionApi {
5
- constructor() {
6
- super()
7
- }
8
-
9
- public async get(): Promise<PluginSelectionGetResult> {
10
- const hostApi = getHostApi()
11
- return hostApi.call({
12
- method: "tools.selection.get",
13
- })
14
- }
15
- }
@@ -1,44 +0,0 @@
1
- import {
2
- PluginTransformApi,
3
- PluginMoveArgs,
4
- PluginRotateArgs,
5
- } from "@snaptrude/plugin-core"
6
- import { getHostApi } from "../../host-api"
7
-
8
- export class ClientTransformApi extends PluginTransformApi {
9
- constructor() {
10
- super()
11
- }
12
-
13
- public async move({
14
- componentIds,
15
- displacement,
16
- }: PluginMoveArgs): Promise<void> {
17
- const hostApi = getHostApi()
18
- return hostApi.call({
19
- method: "tools.transform.move",
20
- args: {
21
- componentIds,
22
- displacement,
23
- },
24
- })
25
- }
26
-
27
- public async rotate({
28
- componentIds,
29
- angle,
30
- axis,
31
- pivot,
32
- }: PluginRotateArgs): Promise<void> {
33
- const hostApi = getHostApi()
34
- return hostApi.call({
35
- method: "tools.transform.rotate",
36
- args: {
37
- componentIds,
38
- angle,
39
- axis,
40
- pivot,
41
- },
42
- })
43
- }
44
- }
@@ -1,34 +0,0 @@
1
- import {
2
- PluginUnitsApi,
3
- PluginUnitsConvertFromArgs,
4
- PluginUnitsConvertFromResult,
5
- PluginUnitsConvertToArgs,
6
- PluginUnitsConvertToResult,
7
- } from "@snaptrude/plugin-core"
8
- import { getHostApi } from "../../host-api"
9
-
10
- export class ClientUnitsApi extends PluginUnitsApi {
11
- constructor() {
12
- super()
13
- }
14
-
15
- public async convertFrom(
16
- args: PluginUnitsConvertFromArgs,
17
- ): Promise<PluginUnitsConvertFromResult> {
18
- const hostApi = getHostApi()
19
- return hostApi.call({
20
- method: "units.convertFrom",
21
- args,
22
- })
23
- }
24
-
25
- public async convertTo(
26
- args: PluginUnitsConvertToArgs,
27
- ): Promise<PluginUnitsConvertToResult> {
28
- const hostApi = getHostApi()
29
- return hostApi.call({
30
- method: "units.convertTo",
31
- args,
32
- })
33
- }
34
- }