@snaptrude/plugin-client 0.0.6 → 0.0.8
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/dist/api/entity/department.d.ts +7 -0
- package/dist/api/entity/department.d.ts.map +1 -0
- package/dist/api/entity/index.d.ts +6 -0
- package/dist/api/entity/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +9 -0
- package/dist/api/entity/referenceLine.d.ts.map +1 -0
- package/dist/api/entity/space.d.ts +2 -1
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/index.cjs +91 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/api/entity/department.ts +30 -0
- package/src/api/entity/index.ts +8 -0
- package/src/api/entity/referenceLine.ts +54 -0
- package/src/api/entity/space.ts +16 -0
- package/tsup.config.ts +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PluginDepartmentApi, PluginDepartmentCreateArgs, PluginDepartmentCreateResult, PluginDepartmentGetAllResult } from "@snaptrude/plugin-core";
|
|
2
|
+
export declare class ClientDepartmentApi extends PluginDepartmentApi {
|
|
3
|
+
constructor();
|
|
4
|
+
create(args: PluginDepartmentCreateArgs): Promise<PluginDepartmentCreateResult>;
|
|
5
|
+
getAll(): Promise<PluginDepartmentGetAllResult>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=department.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"department.d.ts","sourceRoot":"","sources":["../../../src/api/entity/department.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,wBAAwB,CAAA;AAG/B,qBAAa,mBAAoB,SAAQ,mBAAmB;;IAK7C,MAAM,CACjB,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,4BAA4B,CAAC;IAQ3B,MAAM,IAAI,OAAO,CAAC,4BAA4B,CAAC;CAM7D"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { PluginEntityApi } from "@snaptrude/plugin-core";
|
|
2
|
+
import { ClientDepartmentApi } from "./department";
|
|
3
|
+
import { ClientReferenceLineApi } from "./referenceLine";
|
|
2
4
|
import { ClientSpaceApi } from "./space";
|
|
3
5
|
import { ClientStoryApi } from "./story";
|
|
4
6
|
export declare class ClientEntityApi extends PluginEntityApi {
|
|
5
7
|
space: ClientSpaceApi;
|
|
6
8
|
story: ClientStoryApi;
|
|
9
|
+
referenceLine: ClientReferenceLineApi;
|
|
10
|
+
department: ClientDepartmentApi;
|
|
7
11
|
constructor();
|
|
8
12
|
}
|
|
13
|
+
export * from "./department";
|
|
14
|
+
export * from "./referenceLine";
|
|
9
15
|
export * from "./space";
|
|
10
16
|
export * from "./story";
|
|
11
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/entity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,qBAAa,eAAgB,SAAQ,eAAe;IAC3C,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,cAAc,CAAA;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/entity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,qBAAa,eAAgB,SAAQ,eAAe;IAC3C,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,cAAc,CAAA;IACrB,aAAa,EAAE,sBAAsB,CAAA;IACrC,UAAU,EAAE,mBAAmB,CAAA;;CASvC;AAED,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PluginReferenceLineApi, PluginReferenceLineCreateMultiArgs, PluginReferenceLineCreateMultiResult, PluginReferenceLineGetArgs, PluginReferenceLineGetResult, PluginReferenceLineGetAllResult, PluginReferenceLineDeleteArgs, PluginReferenceLineDeleteResult } from "@snaptrude/plugin-core";
|
|
2
|
+
export declare class ClientReferenceLineApi extends PluginReferenceLineApi {
|
|
3
|
+
constructor();
|
|
4
|
+
createMulti(args: PluginReferenceLineCreateMultiArgs): Promise<PluginReferenceLineCreateMultiResult>;
|
|
5
|
+
get(args: PluginReferenceLineGetArgs): Promise<PluginReferenceLineGetResult>;
|
|
6
|
+
getAll(): Promise<PluginReferenceLineGetAllResult>;
|
|
7
|
+
delete(args: PluginReferenceLineDeleteArgs): Promise<PluginReferenceLineDeleteResult>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=referenceLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceLine.d.ts","sourceRoot":"","sources":["../../../src/api/entity/referenceLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,kCAAkC,EAClC,oCAAoC,EACpC,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,6BAA6B,EAC7B,+BAA+B,EAChC,MAAM,wBAAwB,CAAA;AAG/B,qBAAa,sBAAuB,SAAQ,sBAAsB;;IAKnD,WAAW,CACtB,IAAI,EAAE,kCAAkC,GACvC,OAAO,CAAC,oCAAoC,CAAC;IAQnC,GAAG,CACd,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,4BAA4B,CAAC;IAQ3B,MAAM,IAAI,OAAO,CAAC,+BAA+B,CAAC;IAOlD,MAAM,CACjB,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,+BAA+B,CAAC;CAO5C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginSpaceApi, PluginSpaceCreateRectangularArgs, PluginSpaceCreateRectangularResult, PluginSpaceCreateFromProfileArgs, PluginSpaceCreateFromProfileResult, PluginSpaceDeleteArgs, PluginSpaceDeleteResult, PluginSpaceGetArgs, PluginSpaceGetResult, PluginSpaceGetAllResult } from "@snaptrude/plugin-core";
|
|
1
|
+
import { PluginSpaceApi, PluginSpaceCreateRectangularArgs, PluginSpaceCreateRectangularResult, PluginSpaceCreateFromProfileArgs, PluginSpaceCreateFromProfileResult, PluginSpaceDeleteArgs, PluginSpaceDeleteResult, PluginSpaceGetArgs, PluginSpaceGetResult, PluginSpaceGetAllResult, PluginSpaceUpdateArgs, PluginSpaceUpdateResult } from "@snaptrude/plugin-core";
|
|
2
2
|
export declare class ClientSpaceApi extends PluginSpaceApi {
|
|
3
3
|
constructor();
|
|
4
4
|
createRectangular({ position, dimensions, }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult>;
|
|
@@ -6,5 +6,6 @@ export declare class ClientSpaceApi extends PluginSpaceApi {
|
|
|
6
6
|
get({ spaceId, properties, }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult>;
|
|
7
7
|
getAll(): Promise<PluginSpaceGetAllResult>;
|
|
8
8
|
delete({ spaceId, }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult>;
|
|
9
|
+
update({ spaceId, properties, }: PluginSpaceUpdateArgs): Promise<PluginSpaceUpdateResult>;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=space.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/api/entity/space.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gCAAgC,EAChC,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EAClC,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,wBAAwB,CAAA;AAG/B,qBAAa,cAAe,SAAQ,cAAc;;IAKnC,iBAAiB,CAAC,EAC7B,QAAQ,EACR,UAAU,GACX,EAAE,gCAAgC,GAAG,OAAO,CAAC,kCAAkC,CAAC;IAWpE,iBAAiB,CAAC,EAC7B,OAAO,EACP,aAAa,EACb,QAAQ,GACT,EAAE,gCAAgC,GAAG,OAAO,CAAC,kCAAkC,CAAC;IAYpE,GAAG,CAAC,EACf,OAAO,EACP,UAAU,GACX,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAWxC,MAAM,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAO1C,MAAM,CAAC,EAClB,OAAO,GACR,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/api/entity/space.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gCAAgC,EAChC,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EAClC,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,wBAAwB,CAAA;AAG/B,qBAAa,cAAe,SAAQ,cAAc;;IAKnC,iBAAiB,CAAC,EAC7B,QAAQ,EACR,UAAU,GACX,EAAE,gCAAgC,GAAG,OAAO,CAAC,kCAAkC,CAAC;IAWpE,iBAAiB,CAAC,EAC7B,OAAO,EACP,aAAa,EACb,QAAQ,GACT,EAAE,gCAAgC,GAAG,OAAO,CAAC,kCAAkC,CAAC;IAYpE,GAAG,CAAC,EACf,OAAO,EACP,UAAU,GACX,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAWxC,MAAM,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAO1C,MAAM,CAAC,EAClB,OAAO,GACR,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAU9C,MAAM,CAAC,EAClB,OAAO,EACP,UAAU,GACX,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAU5D"}
|
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
ClientArcApi: () => ClientArcApi,
|
|
34
34
|
ClientCoreApi: () => ClientCoreApi,
|
|
35
35
|
ClientCurveApi: () => ClientCurveApi,
|
|
36
|
+
ClientDepartmentApi: () => ClientDepartmentApi,
|
|
36
37
|
ClientEntityApi: () => ClientEntityApi,
|
|
37
38
|
ClientGeomApi: () => ClientGeomApi,
|
|
38
39
|
ClientLineApi: () => ClientLineApi,
|
|
@@ -40,6 +41,7 @@ __export(index_exports, {
|
|
|
40
41
|
ClientPluginApi: () => ClientPluginApi,
|
|
41
42
|
ClientProfileApi: () => ClientProfileApi,
|
|
42
43
|
ClientQuatApi: () => ClientQuatApi,
|
|
44
|
+
ClientReferenceLineApi: () => ClientReferenceLineApi,
|
|
43
45
|
ClientSelectionApi: () => ClientSelectionApi,
|
|
44
46
|
ClientSpaceApi: () => ClientSpaceApi,
|
|
45
47
|
ClientStoryApi: () => ClientStoryApi,
|
|
@@ -178,11 +180,67 @@ var ClientCoreApi = class extends import_plugin_core9.PluginCoreApi {
|
|
|
178
180
|
};
|
|
179
181
|
|
|
180
182
|
// src/api/entity/index.ts
|
|
181
|
-
var
|
|
183
|
+
var import_plugin_core14 = require("@snaptrude/plugin-core");
|
|
182
184
|
|
|
183
|
-
// src/api/entity/
|
|
185
|
+
// src/api/entity/department.ts
|
|
184
186
|
var import_plugin_core10 = require("@snaptrude/plugin-core");
|
|
185
|
-
var
|
|
187
|
+
var ClientDepartmentApi = class extends import_plugin_core10.PluginDepartmentApi {
|
|
188
|
+
constructor() {
|
|
189
|
+
super();
|
|
190
|
+
}
|
|
191
|
+
async create(args) {
|
|
192
|
+
const hostApi = getHostApi();
|
|
193
|
+
return hostApi.call({
|
|
194
|
+
method: "entity.department.create",
|
|
195
|
+
args
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
async getAll() {
|
|
199
|
+
const hostApi = getHostApi();
|
|
200
|
+
return hostApi.call({
|
|
201
|
+
method: "entity.department.getAll"
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// src/api/entity/referenceLine.ts
|
|
207
|
+
var import_plugin_core11 = require("@snaptrude/plugin-core");
|
|
208
|
+
var ClientReferenceLineApi = class extends import_plugin_core11.PluginReferenceLineApi {
|
|
209
|
+
constructor() {
|
|
210
|
+
super();
|
|
211
|
+
}
|
|
212
|
+
async createMulti(args) {
|
|
213
|
+
const hostApi = getHostApi();
|
|
214
|
+
return hostApi.call({
|
|
215
|
+
method: "entity.referenceLine.createMulti",
|
|
216
|
+
args
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
async get(args) {
|
|
220
|
+
const hostApi = getHostApi();
|
|
221
|
+
return hostApi.call({
|
|
222
|
+
method: "entity.referenceLine.get",
|
|
223
|
+
args
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
async getAll() {
|
|
227
|
+
const hostApi = getHostApi();
|
|
228
|
+
return hostApi.call({
|
|
229
|
+
method: "entity.referenceLine.getAll"
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
async delete(args) {
|
|
233
|
+
const hostApi = getHostApi();
|
|
234
|
+
return hostApi.call({
|
|
235
|
+
method: "entity.referenceLine.delete",
|
|
236
|
+
args
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// src/api/entity/space.ts
|
|
242
|
+
var import_plugin_core12 = require("@snaptrude/plugin-core");
|
|
243
|
+
var ClientSpaceApi = class extends import_plugin_core12.PluginSpaceApi {
|
|
186
244
|
constructor() {
|
|
187
245
|
super();
|
|
188
246
|
}
|
|
@@ -244,11 +302,24 @@ var ClientSpaceApi = class extends import_plugin_core10.PluginSpaceApi {
|
|
|
244
302
|
}
|
|
245
303
|
});
|
|
246
304
|
}
|
|
305
|
+
async update({
|
|
306
|
+
spaceId,
|
|
307
|
+
properties
|
|
308
|
+
}) {
|
|
309
|
+
const hostApi = getHostApi();
|
|
310
|
+
return hostApi.call({
|
|
311
|
+
method: "entity.space.update",
|
|
312
|
+
args: {
|
|
313
|
+
spaceId,
|
|
314
|
+
properties
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
247
318
|
};
|
|
248
319
|
|
|
249
320
|
// src/api/entity/story.ts
|
|
250
|
-
var
|
|
251
|
-
var ClientStoryApi = class extends
|
|
321
|
+
var import_plugin_core13 = require("@snaptrude/plugin-core");
|
|
322
|
+
var ClientStoryApi = class extends import_plugin_core13.PluginStoryApi {
|
|
252
323
|
constructor() {
|
|
253
324
|
super();
|
|
254
325
|
}
|
|
@@ -300,20 +371,22 @@ var ClientStoryApi = class extends import_plugin_core11.PluginStoryApi {
|
|
|
300
371
|
};
|
|
301
372
|
|
|
302
373
|
// src/api/entity/index.ts
|
|
303
|
-
var ClientEntityApi = class extends
|
|
374
|
+
var ClientEntityApi = class extends import_plugin_core14.PluginEntityApi {
|
|
304
375
|
constructor() {
|
|
305
376
|
super();
|
|
306
377
|
this.space = new ClientSpaceApi();
|
|
307
378
|
this.story = new ClientStoryApi();
|
|
379
|
+
this.referenceLine = new ClientReferenceLineApi();
|
|
380
|
+
this.department = new ClientDepartmentApi();
|
|
308
381
|
}
|
|
309
382
|
};
|
|
310
383
|
|
|
311
384
|
// src/api/tools/index.ts
|
|
312
|
-
var
|
|
385
|
+
var import_plugin_core17 = require("@snaptrude/plugin-core");
|
|
313
386
|
|
|
314
387
|
// src/api/tools/selection.ts
|
|
315
|
-
var
|
|
316
|
-
var ClientSelectionApi = class extends
|
|
388
|
+
var import_plugin_core15 = require("@snaptrude/plugin-core");
|
|
389
|
+
var ClientSelectionApi = class extends import_plugin_core15.PluginSelectionApi {
|
|
317
390
|
constructor() {
|
|
318
391
|
super();
|
|
319
392
|
}
|
|
@@ -326,8 +399,8 @@ var ClientSelectionApi = class extends import_plugin_core13.PluginSelectionApi {
|
|
|
326
399
|
};
|
|
327
400
|
|
|
328
401
|
// src/api/tools/transform.ts
|
|
329
|
-
var
|
|
330
|
-
var ClientTransformApi = class extends
|
|
402
|
+
var import_plugin_core16 = require("@snaptrude/plugin-core");
|
|
403
|
+
var ClientTransformApi = class extends import_plugin_core16.PluginTransformApi {
|
|
331
404
|
constructor() {
|
|
332
405
|
super();
|
|
333
406
|
}
|
|
@@ -364,7 +437,7 @@ var ClientTransformApi = class extends import_plugin_core14.PluginTransformApi {
|
|
|
364
437
|
};
|
|
365
438
|
|
|
366
439
|
// src/api/tools/index.ts
|
|
367
|
-
var ClientToolsApi = class extends
|
|
440
|
+
var ClientToolsApi = class extends import_plugin_core17.PluginToolsApi {
|
|
368
441
|
constructor() {
|
|
369
442
|
super();
|
|
370
443
|
this.selection = new ClientSelectionApi();
|
|
@@ -373,8 +446,8 @@ var ClientToolsApi = class extends import_plugin_core15.PluginToolsApi {
|
|
|
373
446
|
};
|
|
374
447
|
|
|
375
448
|
// src/api/units/index.ts
|
|
376
|
-
var
|
|
377
|
-
var ClientUnitsApi = class extends
|
|
449
|
+
var import_plugin_core18 = require("@snaptrude/plugin-core");
|
|
450
|
+
var ClientUnitsApi = class extends import_plugin_core18.PluginUnitsApi {
|
|
378
451
|
constructor() {
|
|
379
452
|
super();
|
|
380
453
|
}
|
|
@@ -395,8 +468,8 @@ var ClientUnitsApi = class extends import_plugin_core16.PluginUnitsApi {
|
|
|
395
468
|
};
|
|
396
469
|
|
|
397
470
|
// src/api/index.ts
|
|
398
|
-
var
|
|
399
|
-
var ClientPluginApi = class _ClientPluginApi extends
|
|
471
|
+
var import_plugin_core19 = require("@snaptrude/plugin-core");
|
|
472
|
+
var ClientPluginApi = class _ClientPluginApi extends import_plugin_core19.PluginApi {
|
|
400
473
|
constructor() {
|
|
401
474
|
super();
|
|
402
475
|
this.core = new ClientCoreApi();
|
|
@@ -477,6 +550,7 @@ var snaptrude = ClientPluginApi.getInstance();
|
|
|
477
550
|
ClientArcApi,
|
|
478
551
|
ClientCoreApi,
|
|
479
552
|
ClientCurveApi,
|
|
553
|
+
ClientDepartmentApi,
|
|
480
554
|
ClientEntityApi,
|
|
481
555
|
ClientGeomApi,
|
|
482
556
|
ClientLineApi,
|
|
@@ -484,6 +558,7 @@ var snaptrude = ClientPluginApi.getInstance();
|
|
|
484
558
|
ClientPluginApi,
|
|
485
559
|
ClientProfileApi,
|
|
486
560
|
ClientQuatApi,
|
|
561
|
+
ClientReferenceLineApi,
|
|
487
562
|
ClientSelectionApi,
|
|
488
563
|
ClientSpaceApi,
|
|
489
564
|
ClientStoryApi,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/api/core/index.ts","../src/api/core/math/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/geom/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/host-api.ts","../src/api/entity/index.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/tools/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/units/index.ts","../src/api/index.ts","../src/plugin-worker.ts"],"sourcesContent":["import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n","import { PluginCoreApi } from \"@snaptrude/plugin-core\"\nimport { ClientMathApi } from \"./math\"\nimport { ClientGeomApi } from \"./geom\"\n\nexport class ClientCoreApi extends PluginCoreApi {\n public math: ClientMathApi\n public geom: ClientGeomApi\n\n constructor() {\n super()\n this.math = new ClientMathApi()\n this.geom = new ClientGeomApi()\n }\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import { PluginMathApi } from \"@snaptrude/plugin-core\"\nimport { ClientVec3Api } from \"./vec3\"\nimport { ClientQuatApi } from \"./quat\"\n\nexport class ClientMathApi extends PluginMathApi {\n public vec3: ClientVec3Api\n public quat: ClientQuatApi\n\n constructor() {\n super()\n this.vec3 = new ClientVec3Api()\n this.quat = new ClientQuatApi()\n }\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import { PluginVec3Api } from \"@snaptrude/plugin-core\"\n\nexport class ClientVec3Api extends PluginVec3Api {\n constructor() {\n super()\n }\n}\n","import { PluginQuatApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientQuatApi extends PluginQuatApi {\n constructor() {\n super()\n }\n}\n","import { PluginGeomApi } from \"@snaptrude/plugin-core\"\nimport { ClientLineApi } from \"./line\"\nimport { ClientArcApi } from \"./arc\"\nimport { ClientCurveApi } from \"./curve\"\nimport { ClientProfileApi } from \"./profile\"\n\nexport class ClientGeomApi extends PluginGeomApi {\n public line: ClientLineApi\n public arc: ClientArcApi\n public curve: ClientCurveApi\n public profile: ClientProfileApi\n\n constructor() {\n super()\n this.line = new ClientLineApi()\n this.arc = new ClientArcApi()\n this.curve = new ClientCurveApi()\n this.profile = new ClientProfileApi()\n }\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginLineApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientLineApi extends PluginLineApi {\n constructor() {\n super()\n }\n}\n","import { PluginArcApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientArcApi extends PluginArcApi {\n constructor() {\n super()\n }\n}\n","import { PluginCurveApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientCurveApi extends PluginCurveApi {\n constructor() {\n super()\n }\n}\n","import { PluginProfileApi } from \"@snaptrude/plugin-core\"\nimport type { PProfile, PluginProfileFromLinePointsArgs } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../../host-api\"\n\nexport class ClientProfileApi extends PluginProfileApi {\n constructor() {\n super()\n }\n\n public async fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"core.geom.profile.fromLinePoints\",\n args,\n })\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import { PluginEntityApi } from \"@snaptrude/plugin-core\"\nimport { ClientSpaceApi } from \"./space\"\nimport { ClientStoryApi } from \"./story\"\n\nexport class ClientEntityApi extends PluginEntityApi {\n public space: ClientSpaceApi\n public story: ClientStoryApi\n\n constructor() {\n super()\n this.space = new ClientSpaceApi()\n this.story = new ClientStoryApi()\n }\n}\n\nexport * from \"./space\"\nexport * from \"./story\"\n","import {\n PluginSpaceApi,\n PluginSpaceCreateRectangularArgs,\n PluginSpaceCreateRectangularResult,\n PluginSpaceCreateFromProfileArgs,\n PluginSpaceCreateFromProfileResult,\n PluginSpaceDeleteArgs,\n PluginSpaceDeleteResult,\n PluginSpaceGetArgs,\n PluginSpaceGetResult,\n PluginSpaceGetAllResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSpaceApi extends PluginSpaceApi {\n constructor() {\n super()\n }\n\n public async createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createRectangular\",\n args: {\n position,\n dimensions,\n },\n })\n }\n\n public async createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createFromProfile\",\n args: {\n profile,\n extrudeHeight,\n position,\n },\n })\n }\n\n public async get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.get\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginSpaceGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.getAll\",\n })\n }\n\n public async delete({\n spaceId,\n }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.delete\",\n args: {\n spaceId,\n },\n })\n }\n}\n","import {\n PluginStoryApi,\n PluginStoryGetArgs,\n PluginStoryGetResult,\n PluginStoryGetAllResult,\n PluginStoryCreateArgs,\n PluginStoryCreateResult,\n PluginStoryUpdateArgs,\n PluginStoryUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientStoryApi extends PluginStoryApi {\n constructor() {\n super()\n }\n\n public async get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.get\",\n args: {\n storyValue,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginStoryGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.getAll\",\n })\n }\n\n public async create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.create\",\n args: {\n storyValue,\n height,\n },\n })\n }\n\n public async update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.update\",\n args: {\n storyValue,\n height,\n },\n })\n }\n}\n","import { PluginToolsApi } from \"@snaptrude/plugin-core\"\nimport { ClientSelectionApi } from \"./selection\"\nimport { ClientTransformApi } from \"./transform\"\n\nexport class ClientToolsApi extends PluginToolsApi {\n public selection: ClientSelectionApi\n public transform: ClientTransformApi\n\n constructor() {\n super()\n this.selection = new ClientSelectionApi()\n this.transform = new ClientTransformApi()\n }\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginSelectionApi, PluginSelectionGetResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSelectionApi extends PluginSelectionApi {\n constructor() {\n super()\n }\n\n public async get(): Promise<PluginSelectionGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.selection.get\",\n })\n }\n}\n","import {\n PluginTransformApi,\n PluginMoveArgs,\n PluginRotateArgs,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientTransformApi extends PluginTransformApi {\n constructor() {\n super()\n }\n\n public async move({\n componentIds,\n displacement,\n }: PluginMoveArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.move\",\n args: {\n componentIds,\n displacement,\n },\n })\n }\n\n public async rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.rotate\",\n args: {\n componentIds,\n angle,\n axis,\n pivot,\n },\n })\n }\n}\n","import {\n PluginUnitsApi,\n PluginUnitsConvertFromArgs,\n PluginUnitsConvertFromResult,\n PluginUnitsConvertToArgs,\n PluginUnitsConvertToResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientUnitsApi extends PluginUnitsApi {\n constructor() {\n super()\n }\n\n public async convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): Promise<PluginUnitsConvertFromResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertFrom\",\n args,\n })\n }\n\n public async convertTo(\n args: PluginUnitsConvertToArgs,\n ): Promise<PluginUnitsConvertToResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertTo\",\n args,\n })\n }\n}\n","import { ClientCoreApi } from \"./core\"\nimport { ClientEntityApi } from \"./entity\"\nimport { ClientToolsApi } from \"./tools\"\nimport { ClientUnitsApi } from \"./units\"\nimport { PluginApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n public core: ClientCoreApi\n public tools: ClientToolsApi\n public entity: ClientEntityApi\n public units: ClientUnitsApi\n\n private constructor() {\n super()\n this.core = new ClientCoreApi()\n this.tools = new ClientToolsApi()\n this.entity = new ClientEntityApi()\n this.units = new ClientUnitsApi()\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n permissions: string[]\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId, permissions }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,sBAA8B;;;ACA9B,IAAAC,sBAA8B;;;ACA9B,yBAA8B;AAEvB,IAAM,gBAAN,cAA4B,iCAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,IAAAC,sBAA8B;AAEvB,IAAM,gBAAN,cAA4B,kCAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;AFFO,IAAM,gBAAN,cAA4B,kCAAc;AAAA,EAI/C,cAAc;AACZ,UAAM;AACN,SAAK,OAAO,IAAI,cAAc;AAC9B,SAAK,OAAO,IAAI,cAAc;AAAA,EAChC;AACF;;;AGbA,IAAAC,sBAA8B;;;ACA9B,IAAAC,sBAA8B;AAEvB,IAAM,gBAAN,cAA4B,kCAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,IAAAC,sBAA6B;AAEtB,IAAM,eAAN,cAA2B,iCAAa;AAAA,EAC7C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,IAAAC,sBAA+B;AAExB,IAAM,iBAAN,cAA6B,mCAAe;AAAA,EACjD,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,IAAAC,sBAAiC;;;ACAjC,cAAyB;AAoBlB,SAAS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B,IAAe,eAAf,MAA4B;AAAA,EAIjC,cAAc;AACZ,SAAK,UAAkB;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAAA,EAEU,SAAS,QAAgB,SAAwB;AACzD;AAAC,IAAC,KAAK,QAAgC,GAAG,SAAS,EAAE,QAAQ,QAAQ,CAAC;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,WAAiB;AACzB;AAAC,IAAC,KAAK,QAAgC,UAAU,SAAS;AAAA,EAC5D;AAAA,EAEA,MAAM,OAAsB;AAC1B,YAAQ,IAAI,KAAK,UAAU,eAAe;AAC1C,YAAQ,IAAI,KAAK,UAAU,yBAAyB;AAAA,EACtD;AAAA,EAEA,MAAM,UAAyB;AAC7B,YAAQ,IAAI,KAAK,UAAU,qCAAgC;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAwB;AAC5B,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,YAAY,UAAoC;AAAA,EAEtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,QAAc;AACZ,IAAQ;AAAA,MACN;AAAA,QACE,MAAM,CAAC,WAAyB;AAC9B,eAAK,WAAW,OAAO;AACvB,iBAAO,KAAK,KAAK;AAAA,QACnB;AAAA,QACA,SAAS,MAAM,KAAK,QAAQ;AAAA,QAC5B,MAAM,MAAM,KAAK,KAAK;AAAA,QACtB,aAAa,CAAC,YAAuB,KAAK,YAAY,OAAO;AAAA,MAC/D;AAAA,MACA;AAAA,IACF;AACA,YAAQ,IAAI,wCAAwC;AAAA,EACtD;AACF;;;AnBxFO,IAAM,YAAY,gBAAgB,YAAY;","names":["import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","Comlink"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/api/core/index.ts","../src/api/core/math/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/geom/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/host-api.ts","../src/api/entity/index.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/tools/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/units/index.ts","../src/api/index.ts","../src/plugin-worker.ts"],"sourcesContent":["import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n","import { PluginCoreApi } from \"@snaptrude/plugin-core\"\nimport { ClientMathApi } from \"./math\"\nimport { ClientGeomApi } from \"./geom\"\n\nexport class ClientCoreApi extends PluginCoreApi {\n public math: ClientMathApi\n public geom: ClientGeomApi\n\n constructor() {\n super()\n this.math = new ClientMathApi()\n this.geom = new ClientGeomApi()\n }\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import { PluginMathApi } from \"@snaptrude/plugin-core\"\nimport { ClientVec3Api } from \"./vec3\"\nimport { ClientQuatApi } from \"./quat\"\n\nexport class ClientMathApi extends PluginMathApi {\n public vec3: ClientVec3Api\n public quat: ClientQuatApi\n\n constructor() {\n super()\n this.vec3 = new ClientVec3Api()\n this.quat = new ClientQuatApi()\n }\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import { PluginVec3Api } from \"@snaptrude/plugin-core\"\n\nexport class ClientVec3Api extends PluginVec3Api {\n constructor() {\n super()\n }\n}\n","import { PluginQuatApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientQuatApi extends PluginQuatApi {\n constructor() {\n super()\n }\n}\n","import { PluginGeomApi } from \"@snaptrude/plugin-core\"\nimport { ClientLineApi } from \"./line\"\nimport { ClientArcApi } from \"./arc\"\nimport { ClientCurveApi } from \"./curve\"\nimport { ClientProfileApi } from \"./profile\"\n\nexport class ClientGeomApi extends PluginGeomApi {\n public line: ClientLineApi\n public arc: ClientArcApi\n public curve: ClientCurveApi\n public profile: ClientProfileApi\n\n constructor() {\n super()\n this.line = new ClientLineApi()\n this.arc = new ClientArcApi()\n this.curve = new ClientCurveApi()\n this.profile = new ClientProfileApi()\n }\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginLineApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientLineApi extends PluginLineApi {\n constructor() {\n super()\n }\n}\n","import { PluginArcApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientArcApi extends PluginArcApi {\n constructor() {\n super()\n }\n}\n","import { PluginCurveApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientCurveApi extends PluginCurveApi {\n constructor() {\n super()\n }\n}\n","import { PluginProfileApi } from \"@snaptrude/plugin-core\"\nimport type { PProfile, PluginProfileFromLinePointsArgs } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../../host-api\"\n\nexport class ClientProfileApi extends PluginProfileApi {\n constructor() {\n super()\n }\n\n public async fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"core.geom.profile.fromLinePoints\",\n args,\n })\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import { PluginEntityApi } from \"@snaptrude/plugin-core\"\nimport { ClientDepartmentApi } from \"./department\"\nimport { ClientReferenceLineApi } from \"./referenceLine\"\nimport { ClientSpaceApi } from \"./space\"\nimport { ClientStoryApi } from \"./story\"\n\nexport class ClientEntityApi extends PluginEntityApi {\n public space: ClientSpaceApi\n public story: ClientStoryApi\n public referenceLine: ClientReferenceLineApi\n public department: ClientDepartmentApi\n\n constructor() {\n super()\n this.space = new ClientSpaceApi()\n this.story = new ClientStoryApi()\n this.referenceLine = new ClientReferenceLineApi()\n this.department = new ClientDepartmentApi()\n }\n}\n\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import {\n PluginDepartmentApi,\n PluginDepartmentCreateArgs,\n PluginDepartmentCreateResult,\n PluginDepartmentGetAllResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDepartmentApi extends PluginDepartmentApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginDepartmentCreateArgs\n ): Promise<PluginDepartmentCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.create\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginDepartmentGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.getAll\",\n })\n }\n}\n","import {\n PluginReferenceLineApi,\n PluginReferenceLineCreateMultiArgs,\n PluginReferenceLineCreateMultiResult,\n PluginReferenceLineGetArgs,\n PluginReferenceLineGetResult,\n PluginReferenceLineGetAllResult,\n PluginReferenceLineDeleteArgs,\n PluginReferenceLineDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientReferenceLineApi extends PluginReferenceLineApi {\n constructor() {\n super()\n }\n\n public async createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): Promise<PluginReferenceLineCreateMultiResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.createMulti\",\n args,\n })\n }\n\n public async get(\n args: PluginReferenceLineGetArgs\n ): Promise<PluginReferenceLineGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.get\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginReferenceLineGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.getAll\",\n })\n }\n\n public async delete(\n args: PluginReferenceLineDeleteArgs\n ): Promise<PluginReferenceLineDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.delete\",\n args,\n })\n }\n}\n","import {\n PluginSpaceApi,\n PluginSpaceCreateRectangularArgs,\n PluginSpaceCreateRectangularResult,\n PluginSpaceCreateFromProfileArgs,\n PluginSpaceCreateFromProfileResult,\n PluginSpaceDeleteArgs,\n PluginSpaceDeleteResult,\n PluginSpaceGetArgs,\n PluginSpaceGetResult,\n PluginSpaceGetAllResult,\n PluginSpaceUpdateArgs,\n PluginSpaceUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSpaceApi extends PluginSpaceApi {\n constructor() {\n super()\n }\n\n public async createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createRectangular\",\n args: {\n position,\n dimensions,\n },\n })\n }\n\n public async createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createFromProfile\",\n args: {\n profile,\n extrudeHeight,\n position,\n },\n })\n }\n\n public async get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.get\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginSpaceGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.getAll\",\n })\n }\n\n public async delete({\n spaceId,\n }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.delete\",\n args: {\n spaceId,\n },\n })\n }\n\n public async update({\n spaceId,\n properties,\n }: PluginSpaceUpdateArgs): Promise<PluginSpaceUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.update\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n}\n","import {\n PluginStoryApi,\n PluginStoryGetArgs,\n PluginStoryGetResult,\n PluginStoryGetAllResult,\n PluginStoryCreateArgs,\n PluginStoryCreateResult,\n PluginStoryUpdateArgs,\n PluginStoryUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientStoryApi extends PluginStoryApi {\n constructor() {\n super()\n }\n\n public async get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.get\",\n args: {\n storyValue,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginStoryGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.getAll\",\n })\n }\n\n public async create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.create\",\n args: {\n storyValue,\n height,\n },\n })\n }\n\n public async update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.update\",\n args: {\n storyValue,\n height,\n },\n })\n }\n}\n","import { PluginToolsApi } from \"@snaptrude/plugin-core\"\nimport { ClientSelectionApi } from \"./selection\"\nimport { ClientTransformApi } from \"./transform\"\n\nexport class ClientToolsApi extends PluginToolsApi {\n public selection: ClientSelectionApi\n public transform: ClientTransformApi\n\n constructor() {\n super()\n this.selection = new ClientSelectionApi()\n this.transform = new ClientTransformApi()\n }\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginSelectionApi, PluginSelectionGetResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSelectionApi extends PluginSelectionApi {\n constructor() {\n super()\n }\n\n public async get(): Promise<PluginSelectionGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.selection.get\",\n })\n }\n}\n","import {\n PluginTransformApi,\n PluginMoveArgs,\n PluginRotateArgs,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientTransformApi extends PluginTransformApi {\n constructor() {\n super()\n }\n\n public async move({\n componentIds,\n displacement,\n }: PluginMoveArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.move\",\n args: {\n componentIds,\n displacement,\n },\n })\n }\n\n public async rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.rotate\",\n args: {\n componentIds,\n angle,\n axis,\n pivot,\n },\n })\n }\n}\n","import {\n PluginUnitsApi,\n PluginUnitsConvertFromArgs,\n PluginUnitsConvertFromResult,\n PluginUnitsConvertToArgs,\n PluginUnitsConvertToResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientUnitsApi extends PluginUnitsApi {\n constructor() {\n super()\n }\n\n public async convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): Promise<PluginUnitsConvertFromResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertFrom\",\n args,\n })\n }\n\n public async convertTo(\n args: PluginUnitsConvertToArgs,\n ): Promise<PluginUnitsConvertToResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertTo\",\n args,\n })\n }\n}\n","import { ClientCoreApi } from \"./core\"\nimport { ClientEntityApi } from \"./entity\"\nimport { ClientToolsApi } from \"./tools\"\nimport { ClientUnitsApi } from \"./units\"\nimport { PluginApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n public core: ClientCoreApi\n public tools: ClientToolsApi\n public entity: ClientEntityApi\n public units: ClientUnitsApi\n\n private constructor() {\n super()\n this.core = new ClientCoreApi()\n this.tools = new ClientToolsApi()\n this.entity = new ClientEntityApi()\n this.units = new ClientUnitsApi()\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n permissions: string[]\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId, permissions }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AK,UAAU,eAAe;AAC1C,YAAQ,IAAI,KAAK,UAAU,yBAAyB;AAAA,EACtD;AAAA,EAEA,MAAM,UAAyB;AAC7B,YAAQ,IAAI,KAAK,UAAU,qCAAgC;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAwB;AAC5B,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,YAAY,UAAoC;AAAA,EAEtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,QAAc;AACZ,IAAQ;AAAA,MACN;AAAA,QACE,MAAM,CAAC,WAAyB;AAC9B,eAAK,WAAW,OAAO;AACvB,iBAAO,KAAK,KAAK;AAAA,QACnB;AAAA,QACA,SAAS,MAAM,KAAK,QAAQ;AAAA,QAC5B,MAAM,MAAM,KAAK,KAAK;AAAA,QACtB,aAAa,CAAC,YAAuB,KAAK,YAAY,OAAO;AAAA,MAC/D;AAAA,MACA;AAAA,IACF;AACA,YAAQ,IAAI,wCAAwC;AAAA,EACtD;AACF;;;ArBxFO,IAAM,YAAY,gBAAgB,YAAY;","names":["import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","Comlink"]}
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,66 @@ var ClientCoreApi = class extends PluginCoreApi {
|
|
|
124
124
|
// src/api/entity/index.ts
|
|
125
125
|
import { PluginEntityApi } from "@snaptrude/plugin-core";
|
|
126
126
|
|
|
127
|
+
// src/api/entity/department.ts
|
|
128
|
+
import {
|
|
129
|
+
PluginDepartmentApi
|
|
130
|
+
} from "@snaptrude/plugin-core";
|
|
131
|
+
var ClientDepartmentApi = class extends PluginDepartmentApi {
|
|
132
|
+
constructor() {
|
|
133
|
+
super();
|
|
134
|
+
}
|
|
135
|
+
async create(args) {
|
|
136
|
+
const hostApi = getHostApi();
|
|
137
|
+
return hostApi.call({
|
|
138
|
+
method: "entity.department.create",
|
|
139
|
+
args
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
async getAll() {
|
|
143
|
+
const hostApi = getHostApi();
|
|
144
|
+
return hostApi.call({
|
|
145
|
+
method: "entity.department.getAll"
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// src/api/entity/referenceLine.ts
|
|
151
|
+
import {
|
|
152
|
+
PluginReferenceLineApi
|
|
153
|
+
} from "@snaptrude/plugin-core";
|
|
154
|
+
var ClientReferenceLineApi = class extends PluginReferenceLineApi {
|
|
155
|
+
constructor() {
|
|
156
|
+
super();
|
|
157
|
+
}
|
|
158
|
+
async createMulti(args) {
|
|
159
|
+
const hostApi = getHostApi();
|
|
160
|
+
return hostApi.call({
|
|
161
|
+
method: "entity.referenceLine.createMulti",
|
|
162
|
+
args
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
async get(args) {
|
|
166
|
+
const hostApi = getHostApi();
|
|
167
|
+
return hostApi.call({
|
|
168
|
+
method: "entity.referenceLine.get",
|
|
169
|
+
args
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
async getAll() {
|
|
173
|
+
const hostApi = getHostApi();
|
|
174
|
+
return hostApi.call({
|
|
175
|
+
method: "entity.referenceLine.getAll"
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
async delete(args) {
|
|
179
|
+
const hostApi = getHostApi();
|
|
180
|
+
return hostApi.call({
|
|
181
|
+
method: "entity.referenceLine.delete",
|
|
182
|
+
args
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
127
187
|
// src/api/entity/space.ts
|
|
128
188
|
import {
|
|
129
189
|
PluginSpaceApi
|
|
@@ -190,6 +250,19 @@ var ClientSpaceApi = class extends PluginSpaceApi {
|
|
|
190
250
|
}
|
|
191
251
|
});
|
|
192
252
|
}
|
|
253
|
+
async update({
|
|
254
|
+
spaceId,
|
|
255
|
+
properties
|
|
256
|
+
}) {
|
|
257
|
+
const hostApi = getHostApi();
|
|
258
|
+
return hostApi.call({
|
|
259
|
+
method: "entity.space.update",
|
|
260
|
+
args: {
|
|
261
|
+
spaceId,
|
|
262
|
+
properties
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
193
266
|
};
|
|
194
267
|
|
|
195
268
|
// src/api/entity/story.ts
|
|
@@ -253,6 +326,8 @@ var ClientEntityApi = class extends PluginEntityApi {
|
|
|
253
326
|
super();
|
|
254
327
|
this.space = new ClientSpaceApi();
|
|
255
328
|
this.story = new ClientStoryApi();
|
|
329
|
+
this.referenceLine = new ClientReferenceLineApi();
|
|
330
|
+
this.department = new ClientDepartmentApi();
|
|
256
331
|
}
|
|
257
332
|
};
|
|
258
333
|
|
|
@@ -428,6 +503,7 @@ export {
|
|
|
428
503
|
ClientArcApi,
|
|
429
504
|
ClientCoreApi,
|
|
430
505
|
ClientCurveApi,
|
|
506
|
+
ClientDepartmentApi,
|
|
431
507
|
ClientEntityApi,
|
|
432
508
|
ClientGeomApi,
|
|
433
509
|
ClientLineApi,
|
|
@@ -435,6 +511,7 @@ export {
|
|
|
435
511
|
ClientPluginApi,
|
|
436
512
|
ClientProfileApi,
|
|
437
513
|
ClientQuatApi,
|
|
514
|
+
ClientReferenceLineApi,
|
|
438
515
|
ClientSelectionApi,
|
|
439
516
|
ClientSpaceApi,
|
|
440
517
|
ClientStoryApi,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/core/index.ts","../src/api/core/math/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/geom/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/host-api.ts","../src/api/entity/index.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/tools/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/units/index.ts","../src/api/index.ts","../src/plugin-worker.ts","../src/index.ts"],"sourcesContent":["import { PluginCoreApi } from \"@snaptrude/plugin-core\"\nimport { ClientMathApi } from \"./math\"\nimport { ClientGeomApi } from \"./geom\"\n\nexport class ClientCoreApi extends PluginCoreApi {\n public math: ClientMathApi\n public geom: ClientGeomApi\n\n constructor() {\n super()\n this.math = new ClientMathApi()\n this.geom = new ClientGeomApi()\n }\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import { PluginMathApi } from \"@snaptrude/plugin-core\"\nimport { ClientVec3Api } from \"./vec3\"\nimport { ClientQuatApi } from \"./quat\"\n\nexport class ClientMathApi extends PluginMathApi {\n public vec3: ClientVec3Api\n public quat: ClientQuatApi\n\n constructor() {\n super()\n this.vec3 = new ClientVec3Api()\n this.quat = new ClientQuatApi()\n }\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import { PluginVec3Api } from \"@snaptrude/plugin-core\"\n\nexport class ClientVec3Api extends PluginVec3Api {\n constructor() {\n super()\n }\n}\n","import { PluginQuatApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientQuatApi extends PluginQuatApi {\n constructor() {\n super()\n }\n}\n","import { PluginGeomApi } from \"@snaptrude/plugin-core\"\nimport { ClientLineApi } from \"./line\"\nimport { ClientArcApi } from \"./arc\"\nimport { ClientCurveApi } from \"./curve\"\nimport { ClientProfileApi } from \"./profile\"\n\nexport class ClientGeomApi extends PluginGeomApi {\n public line: ClientLineApi\n public arc: ClientArcApi\n public curve: ClientCurveApi\n public profile: ClientProfileApi\n\n constructor() {\n super()\n this.line = new ClientLineApi()\n this.arc = new ClientArcApi()\n this.curve = new ClientCurveApi()\n this.profile = new ClientProfileApi()\n }\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginLineApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientLineApi extends PluginLineApi {\n constructor() {\n super()\n }\n}\n","import { PluginArcApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientArcApi extends PluginArcApi {\n constructor() {\n super()\n }\n}\n","import { PluginCurveApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientCurveApi extends PluginCurveApi {\n constructor() {\n super()\n }\n}\n","import { PluginProfileApi } from \"@snaptrude/plugin-core\"\nimport type { PProfile, PluginProfileFromLinePointsArgs } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../../host-api\"\n\nexport class ClientProfileApi extends PluginProfileApi {\n constructor() {\n super()\n }\n\n public async fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"core.geom.profile.fromLinePoints\",\n args,\n })\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import { PluginEntityApi } from \"@snaptrude/plugin-core\"\nimport { ClientSpaceApi } from \"./space\"\nimport { ClientStoryApi } from \"./story\"\n\nexport class ClientEntityApi extends PluginEntityApi {\n public space: ClientSpaceApi\n public story: ClientStoryApi\n\n constructor() {\n super()\n this.space = new ClientSpaceApi()\n this.story = new ClientStoryApi()\n }\n}\n\nexport * from \"./space\"\nexport * from \"./story\"\n","import {\n PluginSpaceApi,\n PluginSpaceCreateRectangularArgs,\n PluginSpaceCreateRectangularResult,\n PluginSpaceCreateFromProfileArgs,\n PluginSpaceCreateFromProfileResult,\n PluginSpaceDeleteArgs,\n PluginSpaceDeleteResult,\n PluginSpaceGetArgs,\n PluginSpaceGetResult,\n PluginSpaceGetAllResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSpaceApi extends PluginSpaceApi {\n constructor() {\n super()\n }\n\n public async createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createRectangular\",\n args: {\n position,\n dimensions,\n },\n })\n }\n\n public async createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createFromProfile\",\n args: {\n profile,\n extrudeHeight,\n position,\n },\n })\n }\n\n public async get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.get\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginSpaceGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.getAll\",\n })\n }\n\n public async delete({\n spaceId,\n }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.delete\",\n args: {\n spaceId,\n },\n })\n }\n}\n","import {\n PluginStoryApi,\n PluginStoryGetArgs,\n PluginStoryGetResult,\n PluginStoryGetAllResult,\n PluginStoryCreateArgs,\n PluginStoryCreateResult,\n PluginStoryUpdateArgs,\n PluginStoryUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientStoryApi extends PluginStoryApi {\n constructor() {\n super()\n }\n\n public async get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.get\",\n args: {\n storyValue,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginStoryGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.getAll\",\n })\n }\n\n public async create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.create\",\n args: {\n storyValue,\n height,\n },\n })\n }\n\n public async update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.update\",\n args: {\n storyValue,\n height,\n },\n })\n }\n}\n","import { PluginToolsApi } from \"@snaptrude/plugin-core\"\nimport { ClientSelectionApi } from \"./selection\"\nimport { ClientTransformApi } from \"./transform\"\n\nexport class ClientToolsApi extends PluginToolsApi {\n public selection: ClientSelectionApi\n public transform: ClientTransformApi\n\n constructor() {\n super()\n this.selection = new ClientSelectionApi()\n this.transform = new ClientTransformApi()\n }\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginSelectionApi, PluginSelectionGetResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSelectionApi extends PluginSelectionApi {\n constructor() {\n super()\n }\n\n public async get(): Promise<PluginSelectionGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.selection.get\",\n })\n }\n}\n","import {\n PluginTransformApi,\n PluginMoveArgs,\n PluginRotateArgs,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientTransformApi extends PluginTransformApi {\n constructor() {\n super()\n }\n\n public async move({\n componentIds,\n displacement,\n }: PluginMoveArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.move\",\n args: {\n componentIds,\n displacement,\n },\n })\n }\n\n public async rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.rotate\",\n args: {\n componentIds,\n angle,\n axis,\n pivot,\n },\n })\n }\n}\n","import {\n PluginUnitsApi,\n PluginUnitsConvertFromArgs,\n PluginUnitsConvertFromResult,\n PluginUnitsConvertToArgs,\n PluginUnitsConvertToResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientUnitsApi extends PluginUnitsApi {\n constructor() {\n super()\n }\n\n public async convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): Promise<PluginUnitsConvertFromResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertFrom\",\n args,\n })\n }\n\n public async convertTo(\n args: PluginUnitsConvertToArgs,\n ): Promise<PluginUnitsConvertToResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertTo\",\n args,\n })\n }\n}\n","import { ClientCoreApi } from \"./core\"\nimport { ClientEntityApi } from \"./entity\"\nimport { ClientToolsApi } from \"./tools\"\nimport { ClientUnitsApi } from \"./units\"\nimport { PluginApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n public core: ClientCoreApi\n public tools: ClientToolsApi\n public entity: ClientEntityApi\n public units: ClientUnitsApi\n\n private constructor() {\n super()\n this.core = new ClientCoreApi()\n this.tools = new ClientToolsApi()\n this.entity = new ClientEntityApi()\n this.units = new ClientUnitsApi()\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n permissions: string[]\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId, permissions }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n","import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n"],"mappings":";AAAA,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;AAEvB,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,SAAS,qBAAqB;AAEvB,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;AFFO,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAI/C,cAAc;AACZ,UAAM;AACN,SAAK,OAAO,IAAI,cAAc;AAC9B,SAAK,OAAO,IAAI,cAAc;AAAA,EAChC;AACF;;;AGbA,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;AAEvB,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,SAAS,oBAAoB;AAEtB,IAAM,eAAN,cAA2B,aAAa;AAAA,EAC7C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,SAAS,sBAAsB;AAExB,IAAM,iBAAN,cAA6B,eAAe;AAAA,EACjD,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,SAAS,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AACA,WAAO,iBAAgB;AAAA,EACzB;AACF;;;AC5BA,YAAYA,cAAa;AAoClB,IAAe,eAAf,MAA4B;AAAA,EAIjC,cAAc;AACZ,SAAK,UAAkB;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAAA,EAEU,SAAS,QAAgB,SAAwB;AACzD;AAAC,IAAC,KAAK,QAAgC,GAAG,SAAS,EAAE,QAAQ,QAAQ,CAAC;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,WAAiB;AACzB;AAAC,IAAC,KAAK,QAAgC,UAAU,SAAS;AAAA,EAC5D;AAAA,EAEA,MAAM,OAAsB;AAC1B,YAAQ,IAAI,KAAK,UAAU,eAAe;AAC1C,YAAQ,IAAI,KAAK,UAAU,yBAAyB;AAAA,EACtD;AAAA,EAEA,MAAM,UAAyB;AAC7B,YAAQ,IAAI,KAAK,UAAU,qCAAgC;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAwB;AAC5B,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,YAAY,UAAoC;AAAA,EAEtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,QAAc;AACZ,IAAQ;AAAA,MACN;AAAA,QACE,MAAM,CAAC,WAAyB;AAC9B,eAAK,WAAW,OAAO;AACvB,iBAAO,KAAK,KAAK;AAAA,QACnB;AAAA,QACA,SAAS,MAAM,KAAK,QAAQ;AAAA,QAC5B,MAAM,MAAM,KAAK,KAAK;AAAA,QACtB,aAAa,CAAC,YAAuB,KAAK,YAAY,OAAO;AAAA,MAC/D;AAAA,MACA;AAAA,IACF;AACA,YAAQ,IAAI,wCAAwC;AAAA,EACtD;AACF;;;ACxFO,IAAM,YAAY,gBAAgB,YAAY;","names":["Comlink"]}
|
|
1
|
+
{"version":3,"sources":["../src/api/core/index.ts","../src/api/core/math/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/geom/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/host-api.ts","../src/api/entity/index.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/tools/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/units/index.ts","../src/api/index.ts","../src/plugin-worker.ts","../src/index.ts"],"sourcesContent":["import { PluginCoreApi } from \"@snaptrude/plugin-core\"\nimport { ClientMathApi } from \"./math\"\nimport { ClientGeomApi } from \"./geom\"\n\nexport class ClientCoreApi extends PluginCoreApi {\n public math: ClientMathApi\n public geom: ClientGeomApi\n\n constructor() {\n super()\n this.math = new ClientMathApi()\n this.geom = new ClientGeomApi()\n }\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import { PluginMathApi } from \"@snaptrude/plugin-core\"\nimport { ClientVec3Api } from \"./vec3\"\nimport { ClientQuatApi } from \"./quat\"\n\nexport class ClientMathApi extends PluginMathApi {\n public vec3: ClientVec3Api\n public quat: ClientQuatApi\n\n constructor() {\n super()\n this.vec3 = new ClientVec3Api()\n this.quat = new ClientQuatApi()\n }\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import { PluginVec3Api } from \"@snaptrude/plugin-core\"\n\nexport class ClientVec3Api extends PluginVec3Api {\n constructor() {\n super()\n }\n}\n","import { PluginQuatApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientQuatApi extends PluginQuatApi {\n constructor() {\n super()\n }\n}\n","import { PluginGeomApi } from \"@snaptrude/plugin-core\"\nimport { ClientLineApi } from \"./line\"\nimport { ClientArcApi } from \"./arc\"\nimport { ClientCurveApi } from \"./curve\"\nimport { ClientProfileApi } from \"./profile\"\n\nexport class ClientGeomApi extends PluginGeomApi {\n public line: ClientLineApi\n public arc: ClientArcApi\n public curve: ClientCurveApi\n public profile: ClientProfileApi\n\n constructor() {\n super()\n this.line = new ClientLineApi()\n this.arc = new ClientArcApi()\n this.curve = new ClientCurveApi()\n this.profile = new ClientProfileApi()\n }\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginLineApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientLineApi extends PluginLineApi {\n constructor() {\n super()\n }\n}\n","import { PluginArcApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientArcApi extends PluginArcApi {\n constructor() {\n super()\n }\n}\n","import { PluginCurveApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientCurveApi extends PluginCurveApi {\n constructor() {\n super()\n }\n}\n","import { PluginProfileApi } from \"@snaptrude/plugin-core\"\nimport type { PProfile, PluginProfileFromLinePointsArgs } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../../host-api\"\n\nexport class ClientProfileApi extends PluginProfileApi {\n constructor() {\n super()\n }\n\n public async fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"core.geom.profile.fromLinePoints\",\n args,\n })\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import { PluginEntityApi } from \"@snaptrude/plugin-core\"\nimport { ClientDepartmentApi } from \"./department\"\nimport { ClientReferenceLineApi } from \"./referenceLine\"\nimport { ClientSpaceApi } from \"./space\"\nimport { ClientStoryApi } from \"./story\"\n\nexport class ClientEntityApi extends PluginEntityApi {\n public space: ClientSpaceApi\n public story: ClientStoryApi\n public referenceLine: ClientReferenceLineApi\n public department: ClientDepartmentApi\n\n constructor() {\n super()\n this.space = new ClientSpaceApi()\n this.story = new ClientStoryApi()\n this.referenceLine = new ClientReferenceLineApi()\n this.department = new ClientDepartmentApi()\n }\n}\n\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import {\n PluginDepartmentApi,\n PluginDepartmentCreateArgs,\n PluginDepartmentCreateResult,\n PluginDepartmentGetAllResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDepartmentApi extends PluginDepartmentApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginDepartmentCreateArgs\n ): Promise<PluginDepartmentCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.create\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginDepartmentGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.getAll\",\n })\n }\n}\n","import {\n PluginReferenceLineApi,\n PluginReferenceLineCreateMultiArgs,\n PluginReferenceLineCreateMultiResult,\n PluginReferenceLineGetArgs,\n PluginReferenceLineGetResult,\n PluginReferenceLineGetAllResult,\n PluginReferenceLineDeleteArgs,\n PluginReferenceLineDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientReferenceLineApi extends PluginReferenceLineApi {\n constructor() {\n super()\n }\n\n public async createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): Promise<PluginReferenceLineCreateMultiResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.createMulti\",\n args,\n })\n }\n\n public async get(\n args: PluginReferenceLineGetArgs\n ): Promise<PluginReferenceLineGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.get\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginReferenceLineGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.getAll\",\n })\n }\n\n public async delete(\n args: PluginReferenceLineDeleteArgs\n ): Promise<PluginReferenceLineDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.delete\",\n args,\n })\n }\n}\n","import {\n PluginSpaceApi,\n PluginSpaceCreateRectangularArgs,\n PluginSpaceCreateRectangularResult,\n PluginSpaceCreateFromProfileArgs,\n PluginSpaceCreateFromProfileResult,\n PluginSpaceDeleteArgs,\n PluginSpaceDeleteResult,\n PluginSpaceGetArgs,\n PluginSpaceGetResult,\n PluginSpaceGetAllResult,\n PluginSpaceUpdateArgs,\n PluginSpaceUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSpaceApi extends PluginSpaceApi {\n constructor() {\n super()\n }\n\n public async createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createRectangular\",\n args: {\n position,\n dimensions,\n },\n })\n }\n\n public async createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createFromProfile\",\n args: {\n profile,\n extrudeHeight,\n position,\n },\n })\n }\n\n public async get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.get\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginSpaceGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.getAll\",\n })\n }\n\n public async delete({\n spaceId,\n }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.delete\",\n args: {\n spaceId,\n },\n })\n }\n\n public async update({\n spaceId,\n properties,\n }: PluginSpaceUpdateArgs): Promise<PluginSpaceUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.update\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n}\n","import {\n PluginStoryApi,\n PluginStoryGetArgs,\n PluginStoryGetResult,\n PluginStoryGetAllResult,\n PluginStoryCreateArgs,\n PluginStoryCreateResult,\n PluginStoryUpdateArgs,\n PluginStoryUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientStoryApi extends PluginStoryApi {\n constructor() {\n super()\n }\n\n public async get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.get\",\n args: {\n storyValue,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginStoryGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.getAll\",\n })\n }\n\n public async create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.create\",\n args: {\n storyValue,\n height,\n },\n })\n }\n\n public async update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.update\",\n args: {\n storyValue,\n height,\n },\n })\n }\n}\n","import { PluginToolsApi } from \"@snaptrude/plugin-core\"\nimport { ClientSelectionApi } from \"./selection\"\nimport { ClientTransformApi } from \"./transform\"\n\nexport class ClientToolsApi extends PluginToolsApi {\n public selection: ClientSelectionApi\n public transform: ClientTransformApi\n\n constructor() {\n super()\n this.selection = new ClientSelectionApi()\n this.transform = new ClientTransformApi()\n }\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginSelectionApi, PluginSelectionGetResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSelectionApi extends PluginSelectionApi {\n constructor() {\n super()\n }\n\n public async get(): Promise<PluginSelectionGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.selection.get\",\n })\n }\n}\n","import {\n PluginTransformApi,\n PluginMoveArgs,\n PluginRotateArgs,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientTransformApi extends PluginTransformApi {\n constructor() {\n super()\n }\n\n public async move({\n componentIds,\n displacement,\n }: PluginMoveArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.move\",\n args: {\n componentIds,\n displacement,\n },\n })\n }\n\n public async rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.rotate\",\n args: {\n componentIds,\n angle,\n axis,\n pivot,\n },\n })\n }\n}\n","import {\n PluginUnitsApi,\n PluginUnitsConvertFromArgs,\n PluginUnitsConvertFromResult,\n PluginUnitsConvertToArgs,\n PluginUnitsConvertToResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientUnitsApi extends PluginUnitsApi {\n constructor() {\n super()\n }\n\n public async convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): Promise<PluginUnitsConvertFromResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertFrom\",\n args,\n })\n }\n\n public async convertTo(\n args: PluginUnitsConvertToArgs,\n ): Promise<PluginUnitsConvertToResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertTo\",\n args,\n })\n }\n}\n","import { ClientCoreApi } from \"./core\"\nimport { ClientEntityApi } from \"./entity\"\nimport { ClientToolsApi } from \"./tools\"\nimport { ClientUnitsApi } from \"./units\"\nimport { PluginApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n public core: ClientCoreApi\n public tools: ClientToolsApi\n public entity: ClientEntityApi\n public units: ClientUnitsApi\n\n private constructor() {\n super()\n this.core = new ClientCoreApi()\n this.tools = new ClientToolsApi()\n this.entity = new ClientEntityApi()\n this.units = new ClientUnitsApi()\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n permissions: string[]\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId, permissions }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n","import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n"],"mappings":";AAAA,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;AAEvB,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,SAAS,qBAAqB;AAEvB,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;AFFO,IAAM,gBAAN,cA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,QAAc;AACZ,IAAQ;AAAA,MACN;AAAA,QACE,MAAM,CAAC,WAAyB;AAC9B,eAAK,WAAW,OAAO;AACvB,iBAAO,KAAK,KAAK;AAAA,QACnB;AAAA,QACA,SAAS,MAAM,KAAK,QAAQ;AAAA,QAC5B,MAAM,MAAM,KAAK,KAAK;AAAA,QACtB,aAAa,CAAC,YAAuB,KAAK,YAAY,OAAO;AAAA,MAC/D;AAAA,MACA;AAAA,IACF;AACA,YAAQ,IAAI,wCAAwC;AAAA,EACtD;AACF;;;ACxFO,IAAM,YAAY,gBAAgB,YAAY;","names":["Comlink"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snaptrude/plugin-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"comlink": "^4.4.2",
|
|
21
|
-
"@snaptrude/plugin-core": "0.0.
|
|
21
|
+
"@snaptrude/plugin-core": "0.0.8"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"tsup": "^8.5.1",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"check-types": "tsc --noEmit",
|
|
29
|
-
"build": "tsup",
|
|
29
|
+
"build": "tsup --clean",
|
|
30
30
|
"dev": "tsup --watch",
|
|
31
31
|
"clean-dist": "rm -rf dist"
|
|
32
32
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PluginDepartmentApi,
|
|
3
|
+
PluginDepartmentCreateArgs,
|
|
4
|
+
PluginDepartmentCreateResult,
|
|
5
|
+
PluginDepartmentGetAllResult,
|
|
6
|
+
} from "@snaptrude/plugin-core"
|
|
7
|
+
import { getHostApi } from "../../host-api"
|
|
8
|
+
|
|
9
|
+
export class ClientDepartmentApi extends PluginDepartmentApi {
|
|
10
|
+
constructor() {
|
|
11
|
+
super()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public async create(
|
|
15
|
+
args: PluginDepartmentCreateArgs
|
|
16
|
+
): Promise<PluginDepartmentCreateResult> {
|
|
17
|
+
const hostApi = getHostApi()
|
|
18
|
+
return hostApi.call({
|
|
19
|
+
method: "entity.department.create",
|
|
20
|
+
args,
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async getAll(): Promise<PluginDepartmentGetAllResult> {
|
|
25
|
+
const hostApi = getHostApi()
|
|
26
|
+
return hostApi.call({
|
|
27
|
+
method: "entity.department.getAll",
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
}
|
package/src/api/entity/index.ts
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { PluginEntityApi } from "@snaptrude/plugin-core"
|
|
2
|
+
import { ClientDepartmentApi } from "./department"
|
|
3
|
+
import { ClientReferenceLineApi } from "./referenceLine"
|
|
2
4
|
import { ClientSpaceApi } from "./space"
|
|
3
5
|
import { ClientStoryApi } from "./story"
|
|
4
6
|
|
|
5
7
|
export class ClientEntityApi extends PluginEntityApi {
|
|
6
8
|
public space: ClientSpaceApi
|
|
7
9
|
public story: ClientStoryApi
|
|
10
|
+
public referenceLine: ClientReferenceLineApi
|
|
11
|
+
public department: ClientDepartmentApi
|
|
8
12
|
|
|
9
13
|
constructor() {
|
|
10
14
|
super()
|
|
11
15
|
this.space = new ClientSpaceApi()
|
|
12
16
|
this.story = new ClientStoryApi()
|
|
17
|
+
this.referenceLine = new ClientReferenceLineApi()
|
|
18
|
+
this.department = new ClientDepartmentApi()
|
|
13
19
|
}
|
|
14
20
|
}
|
|
15
21
|
|
|
22
|
+
export * from "./department"
|
|
23
|
+
export * from "./referenceLine"
|
|
16
24
|
export * from "./space"
|
|
17
25
|
export * from "./story"
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
}
|
package/src/api/entity/space.ts
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
PluginSpaceGetArgs,
|
|
10
10
|
PluginSpaceGetResult,
|
|
11
11
|
PluginSpaceGetAllResult,
|
|
12
|
+
PluginSpaceUpdateArgs,
|
|
13
|
+
PluginSpaceUpdateResult,
|
|
12
14
|
} from "@snaptrude/plugin-core"
|
|
13
15
|
import { getHostApi } from "../../host-api"
|
|
14
16
|
|
|
@@ -79,4 +81,18 @@ export class ClientSpaceApi extends PluginSpaceApi {
|
|
|
79
81
|
},
|
|
80
82
|
})
|
|
81
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
|
+
}
|
|
82
98
|
}
|