@snaptrude/plugin-client 0.3.0 → 0.6.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 (77) hide show
  1. package/AGENTS.md +39 -45
  2. package/CHANGELOG.md +121 -0
  3. package/CLAUDE.md +1 -1
  4. package/dist/api/index.d.ts +13 -13
  5. package/dist/api/index.d.ts.map +1 -1
  6. package/dist/index.cjs +24 -467
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +26 -460
  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 +29 -18
  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/entity/department.d.ts +0 -7
  34. package/dist/api/entity/department.d.ts.map +0 -1
  35. package/dist/api/entity/index.d.ts +0 -17
  36. package/dist/api/entity/index.d.ts.map +0 -1
  37. package/dist/api/entity/referenceLine.d.ts +0 -9
  38. package/dist/api/entity/referenceLine.d.ts.map +0 -1
  39. package/dist/api/entity/space.d.ts +0 -11
  40. package/dist/api/entity/space.d.ts.map +0 -1
  41. package/dist/api/entity/story.d.ts +0 -9
  42. package/dist/api/entity/story.d.ts.map +0 -1
  43. package/dist/api/tools/copy.d.ts +0 -3
  44. package/dist/api/tools/copy.d.ts.map +0 -1
  45. package/dist/api/tools/index.d.ts +0 -17
  46. package/dist/api/tools/index.d.ts.map +0 -1
  47. package/dist/api/tools/material.d.ts +0 -6
  48. package/dist/api/tools/material.d.ts.map +0 -1
  49. package/dist/api/tools/offset.d.ts +0 -3
  50. package/dist/api/tools/offset.d.ts.map +0 -1
  51. package/dist/api/tools/selection.d.ts +0 -6
  52. package/dist/api/tools/selection.d.ts.map +0 -1
  53. package/dist/api/tools/transform.d.ts +0 -7
  54. package/dist/api/tools/transform.d.ts.map +0 -1
  55. package/dist/api/units/index.d.ts +0 -7
  56. package/dist/api/units/index.d.ts.map +0 -1
  57. package/src/api/core/geom/arc.ts +0 -7
  58. package/src/api/core/geom/curve.ts +0 -7
  59. package/src/api/core/geom/index.ts +0 -25
  60. package/src/api/core/geom/line.ts +0 -7
  61. package/src/api/core/geom/profile.ts +0 -17
  62. package/src/api/core/index.ts +0 -17
  63. package/src/api/core/math/index.ts +0 -17
  64. package/src/api/core/math/quat.ts +0 -7
  65. package/src/api/core/math/vec3.ts +0 -7
  66. package/src/api/entity/department.ts +0 -30
  67. package/src/api/entity/index.ts +0 -25
  68. package/src/api/entity/referenceLine.ts +0 -54
  69. package/src/api/entity/space.ts +0 -98
  70. package/src/api/entity/story.ts +0 -66
  71. package/src/api/tools/copy.ts +0 -10
  72. package/src/api/tools/index.ts +0 -36
  73. package/src/api/tools/material.ts +0 -22
  74. package/src/api/tools/offset.ts +0 -15
  75. package/src/api/tools/selection.ts +0 -15
  76. package/src/api/tools/transform.ts +0 -44
  77. package/src/api/units/index.ts +0 -34
@@ -1,54 +0,0 @@
1
- import {
2
- PluginReferenceLineApi,
3
- PluginReferenceLineCreateMultiArgs,
4
- PluginReferenceLineCreateMultiResult,
5
- PluginReferenceLineGetArgs,
6
- PluginReferenceLineGetResult,
7
- PluginReferenceLineGetAllResult,
8
- PluginReferenceLineDeleteArgs,
9
- PluginReferenceLineDeleteResult,
10
- } from "@snaptrude/plugin-core"
11
- import { getHostApi } from "../../host-api"
12
-
13
- export class ClientReferenceLineApi extends PluginReferenceLineApi {
14
- constructor() {
15
- super()
16
- }
17
-
18
- public async createMulti(
19
- args: PluginReferenceLineCreateMultiArgs
20
- ): Promise<PluginReferenceLineCreateMultiResult> {
21
- const hostApi = getHostApi()
22
- return hostApi.call({
23
- method: "entity.referenceLine.createMulti",
24
- args,
25
- })
26
- }
27
-
28
- public async get(
29
- args: PluginReferenceLineGetArgs
30
- ): Promise<PluginReferenceLineGetResult> {
31
- const hostApi = getHostApi()
32
- return hostApi.call({
33
- method: "entity.referenceLine.get",
34
- args,
35
- })
36
- }
37
-
38
- public async getAll(): Promise<PluginReferenceLineGetAllResult> {
39
- const hostApi = getHostApi()
40
- return hostApi.call({
41
- method: "entity.referenceLine.getAll",
42
- })
43
- }
44
-
45
- public async delete(
46
- args: PluginReferenceLineDeleteArgs
47
- ): Promise<PluginReferenceLineDeleteResult> {
48
- const hostApi = getHostApi()
49
- return hostApi.call({
50
- method: "entity.referenceLine.delete",
51
- args,
52
- })
53
- }
54
- }
@@ -1,98 +0,0 @@
1
- import {
2
- PluginSpaceApi,
3
- PluginSpaceCreateRectangularArgs,
4
- PluginSpaceCreateRectangularResult,
5
- PluginSpaceCreateFromProfileArgs,
6
- PluginSpaceCreateFromProfileResult,
7
- PluginSpaceDeleteArgs,
8
- PluginSpaceDeleteResult,
9
- PluginSpaceGetArgs,
10
- PluginSpaceGetResult,
11
- PluginSpaceGetAllResult,
12
- PluginSpaceUpdateArgs,
13
- PluginSpaceUpdateResult,
14
- } from "@snaptrude/plugin-core"
15
- import { getHostApi } from "../../host-api"
16
-
17
- export class ClientSpaceApi extends PluginSpaceApi {
18
- constructor() {
19
- super()
20
- }
21
-
22
- public async createRectangular({
23
- position,
24
- dimensions,
25
- }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {
26
- const hostApi = getHostApi()
27
- return hostApi.call({
28
- method: "entity.space.createRectangular",
29
- args: {
30
- position,
31
- dimensions,
32
- },
33
- })
34
- }
35
-
36
- public async createFromProfile({
37
- profile,
38
- extrudeHeight,
39
- position,
40
- }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {
41
- const hostApi = getHostApi()
42
- return hostApi.call({
43
- method: "entity.space.createFromProfile",
44
- args: {
45
- profile,
46
- extrudeHeight,
47
- position,
48
- },
49
- })
50
- }
51
-
52
- public async get({
53
- spaceId,
54
- properties,
55
- }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {
56
- const hostApi = getHostApi()
57
- return hostApi.call({
58
- method: "entity.space.get",
59
- args: {
60
- spaceId,
61
- properties,
62
- },
63
- })
64
- }
65
-
66
- public async getAll(): Promise<PluginSpaceGetAllResult> {
67
- const hostApi = getHostApi()
68
- return hostApi.call({
69
- method: "entity.space.getAll",
70
- })
71
- }
72
-
73
- public async delete({
74
- spaceId,
75
- }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {
76
- const hostApi = getHostApi()
77
- return hostApi.call({
78
- method: "entity.space.delete",
79
- args: {
80
- spaceId,
81
- },
82
- })
83
- }
84
-
85
- public async update({
86
- spaceId,
87
- properties,
88
- }: PluginSpaceUpdateArgs): Promise<PluginSpaceUpdateResult> {
89
- const hostApi = getHostApi()
90
- return hostApi.call({
91
- method: "entity.space.update",
92
- args: {
93
- spaceId,
94
- properties,
95
- },
96
- })
97
- }
98
- }
@@ -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,36 +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 { ClientMaterialApi } from "./material"
11
- import { copy } from "./copy"
12
- import { offset } from "./offset"
13
-
14
- export class ClientToolsApi extends PluginToolsApi {
15
- public selection: ClientSelectionApi
16
- public transform: ClientTransformApi
17
- public material: ClientMaterialApi
18
- constructor() {
19
- super()
20
- this.selection = new ClientSelectionApi()
21
- this.transform = new ClientTransformApi()
22
- this.material = new ClientMaterialApi()
23
- }
24
-
25
- public async copy(args: PluginCopyArgs): Promise<PluginCopyResult> {
26
- return copy(args)
27
- }
28
-
29
- public async offset(args: PluginOffsetArgs): Promise<PluginOffsetResult> {
30
- return offset(args)
31
- }
32
- }
33
-
34
- export * from "./selection"
35
- export * from "./transform"
36
- export * from "./material"
@@ -1,22 +0,0 @@
1
- import { PluginMaterialApi, PluginMaterialArgs } from "@snaptrude/plugin-core"
2
- import { getHostApi } from "../../host-api"
3
-
4
- export class ClientMaterialApi extends PluginMaterialApi {
5
- constructor() {
6
- super()
7
- }
8
-
9
- public async apply({
10
- materialName,
11
- componentIds,
12
- }: PluginMaterialArgs): Promise<void> {
13
- const hostApi = getHostApi()
14
- return hostApi.call({
15
- method: "tools.material.apply",
16
- args: {
17
- materialName,
18
- componentIds,
19
- },
20
- })
21
- }
22
- }
@@ -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
- }