@snaptrude/plugin-core 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/index.js CHANGED
@@ -17,8 +17,8 @@ var PluginVec3Api = class {
17
17
  * // { x: 1, y: 2, z: 3 }
18
18
  * ```
19
19
  */
20
- new(x, y, z12) {
21
- return { x, y, z: z12 };
20
+ new(x, y, z14) {
21
+ return { x, y, z: z14 };
22
22
  }
23
23
  /**
24
24
  * Add two vectors component-wise.
@@ -196,8 +196,8 @@ var PluginQuatApi = class {
196
196
  * @param w - The W (scalar) component
197
197
  * @returns A new {@linkcode PQuat}
198
198
  */
199
- new(x, y, z12, w) {
200
- return { x, y, z: z12, w };
199
+ new(x, y, z14, w) {
200
+ return { x, y, z: z14, w };
201
201
  }
202
202
  /**
203
203
  * Create an identity quaternion representing no rotation.
@@ -241,13 +241,13 @@ var PluginQuatApi = class {
241
241
  * @param z - Rotation around Z axis in **radians**
242
242
  * @returns A new {@linkcode PQuat}
243
243
  */
244
- fromEuler(x, y, z12) {
244
+ fromEuler(x, y, z14) {
245
245
  const cx = Math.cos(x / 2);
246
246
  const sx = Math.sin(x / 2);
247
247
  const cy = Math.cos(y / 2);
248
248
  const sy = Math.sin(y / 2);
249
- const cz = Math.cos(z12 / 2);
250
- const sz = Math.sin(z12 / 2);
249
+ const cz = Math.cos(z14 / 2);
250
+ const sz = Math.sin(z14 / 2);
251
251
  return {
252
252
  x: sx * cy * cz + cx * sy * sz,
253
253
  y: cx * sy * cz - sx * cy * sz,
@@ -578,73 +578,200 @@ var PluginCoreApi = class {
578
578
  }
579
579
  };
580
580
 
581
- // src/api/entity/space.ts
581
+ // src/api/entity/department.ts
582
582
  import * as z7 from "zod";
583
+ var PluginDepartmentApi = class {
584
+ constructor() {
585
+ }
586
+ };
587
+ var PluginDepartmentCreateArgs = z7.object({
588
+ name: z7.string(),
589
+ color: z7.string()
590
+ });
591
+ var PluginDepartmentCreateResult = z7.object({
592
+ departmentId: z7.string()
593
+ });
594
+ var PluginDepartmentEntry = z7.object({
595
+ id: z7.string(),
596
+ name: z7.string(),
597
+ color: z7.string()
598
+ });
599
+ var PluginDepartmentGetAllResult = z7.object({
600
+ departments: z7.array(PluginDepartmentEntry)
601
+ });
602
+
603
+ // src/api/entity/referenceLine.ts
604
+ import * as z8 from "zod";
605
+ var PluginReferenceLineApi = class {
606
+ constructor() {
607
+ }
608
+ };
609
+ var PluginReferenceLineCreateMultiArgs = z8.object({
610
+ profile: PProfile
611
+ });
612
+ var PluginReferenceLineCreateMultiResult = z8.object({
613
+ referenceLineIds: z8.array(z8.string())
614
+ });
615
+ var PluginReferenceLineGetProperty = z8.enum([
616
+ "curve"
617
+ ]);
618
+ var PluginReferenceLineGetArgs = z8.object({
619
+ referenceLineId: z8.string(),
620
+ properties: z8.array(PluginReferenceLineGetProperty)
621
+ });
622
+ var PluginReferenceLineGetResult = z8.object({
623
+ curve: PCurve
624
+ }).partial();
625
+ var PluginReferenceLineGetAllResult = z8.object({
626
+ referenceLineIds: z8.array(z8.string())
627
+ });
628
+ var PluginReferenceLineDeleteArgs = z8.object({
629
+ referenceLineId: z8.string()
630
+ });
631
+
632
+ // src/api/entity/space.ts
633
+ import * as z9 from "zod";
583
634
  var PluginSpaceApi = class {
584
635
  constructor() {
585
636
  }
586
637
  };
587
- var PluginSpaceCreateRectangularArgs = z7.object({
638
+ var PluginSpaceCreateRectangularArgs = z9.object({
588
639
  position: PVec3,
589
- dimensions: z7.object({
590
- width: z7.number(),
591
- height: z7.number(),
592
- depth: z7.number()
640
+ dimensions: z9.object({
641
+ width: z9.number(),
642
+ height: z9.number(),
643
+ depth: z9.number()
593
644
  })
594
645
  });
595
- var PluginSpaceCreateRectangularResult = z7.object({
596
- spaceId: z7.string()
646
+ var PluginSpaceCreateRectangularResult = z9.object({
647
+ spaceId: z9.string()
597
648
  });
598
- var PluginSpaceCreateFromProfileArgs = z7.object({
649
+ var PluginSpaceCreateFromProfileArgs = z9.object({
599
650
  profile: PProfile,
600
- extrudeHeight: z7.number(),
651
+ extrudeHeight: z9.number(),
601
652
  position: PVec3
602
653
  });
603
- var PluginSpaceCreateFromProfileResult = z7.object({
604
- spaceId: z7.string()
654
+ var PluginSpaceCreateFromProfileResult = z9.object({
655
+ spaceId: z9.string()
605
656
  });
606
- var PluginSpaceGetProperty = z7.enum([
657
+ var PluginSpaceGetProperty = z9.enum([
658
+ // Basic
607
659
  "id",
608
660
  "type",
609
661
  "room_type",
610
662
  "name",
663
+ // Derived from parametric data
611
664
  "area",
612
- "department",
665
+ "breadth",
666
+ "depth",
667
+ "height",
668
+ "massType",
669
+ "spaceType",
670
+ "storey",
671
+ "departmentId",
672
+ "departmentName",
673
+ "departmentColor",
674
+ // Derived from mesh
613
675
  "position",
614
676
  "absolutePosition",
615
677
  "rotation",
616
- "rotationQuaternion"
678
+ "rotationQuaternion",
679
+ // Derived from brep
680
+ "planPoints"
617
681
  ]);
618
- var PluginSpaceGetArgs = z7.object({
619
- spaceId: z7.string(),
620
- properties: z7.array(PluginSpaceGetProperty)
682
+ var PluginSpaceGetArgs = z9.object({
683
+ spaceId: z9.string(),
684
+ properties: z9.array(PluginSpaceGetProperty)
621
685
  });
622
- var PluginSpaceGetResult = z7.object({
623
- id: z7.string(),
624
- type: z7.string(),
625
- room_type: z7.string(),
626
- name: z7.string(),
627
- area: z7.number(),
628
- department: z7.string(),
686
+ var PluginSpaceType = z9.enum([
687
+ "Room",
688
+ "Program Block",
689
+ "Balcony",
690
+ "Road",
691
+ "Garden",
692
+ "Deck",
693
+ "Pool",
694
+ "Walkway"
695
+ ]);
696
+ var PluginSpaceGetResult = z9.object({
697
+ // Basic
698
+ id: z9.string(),
699
+ type: z9.string(),
700
+ room_type: z9.string(),
701
+ name: z9.string(),
702
+ // Derived from parametric data
703
+ area: z9.number(),
704
+ breadth: z9.number(),
705
+ depth: z9.number(),
706
+ height: z9.number(),
707
+ massType: z9.string().nullable(),
708
+ spaceType: PluginSpaceType.nullable(),
709
+ storey: z9.number().nullable(),
710
+ departmentId: z9.string().nullable(),
711
+ departmentName: z9.string(),
712
+ departmentColor: z9.string(),
713
+ // Derived from mesh
629
714
  position: PVec3,
630
715
  absolutePosition: PVec3,
631
716
  rotation: PVec3,
632
- rotationQuaternion: PQuat.nullable()
717
+ rotationQuaternion: PQuat.nullable(),
718
+ // Derived from brep
719
+ planPoints: z9.array(PVec3)
633
720
  }).partial();
634
- var PluginSpaceGetAllResult = z7.object({
635
- spacesIds: z7.array(z7.string())
721
+ var PluginSpaceGetAllResult = z9.object({
722
+ spacesIds: z9.array(z9.string())
636
723
  });
637
- var PluginSpaceDeleteArgs = z7.object({
638
- spaceId: z7.string()
724
+ var PluginSpaceDeleteArgs = z9.object({
725
+ spaceId: z9.string()
726
+ });
727
+ var PluginMassType = z9.enum([
728
+ "Plinth",
729
+ "Void",
730
+ "Pergola",
731
+ "Furniture",
732
+ "Facade element",
733
+ "Generic mass",
734
+ "Room",
735
+ "Department",
736
+ "Building",
737
+ "Revit Import",
738
+ "Mass",
739
+ "Site"
740
+ ]);
741
+ var PluginWellKnownDepartmentId = z9.enum([
742
+ "DEFAULT",
743
+ "SITE",
744
+ "ENVELOPE",
745
+ "CORE"
746
+ ]);
747
+ var PluginDepartmentId = z9.union([
748
+ PluginWellKnownDepartmentId,
749
+ z9.uuid()
750
+ ]);
751
+ var PluginSpaceUpdateArgs = z9.object({
752
+ spaceId: z9.string(),
753
+ properties: z9.object({
754
+ room_type: z9.string().optional(),
755
+ massType: PluginMassType.optional(),
756
+ spaceType: PluginSpaceType.optional(),
757
+ departmentId: PluginDepartmentId.optional()
758
+ })
759
+ });
760
+ var PluginSpaceUpdateResult = z9.object({
761
+ spaceId: z9.string(),
762
+ room_type: z9.string().optional(),
763
+ massType: z9.string().optional(),
764
+ spaceType: z9.string().optional(),
765
+ departmentId: z9.string().nullable().optional()
639
766
  });
640
767
 
641
768
  // src/api/entity/story.ts
642
- import * as z8 from "zod";
769
+ import * as z10 from "zod";
643
770
  var PluginStoryApi = class {
644
771
  constructor() {
645
772
  }
646
773
  };
647
- var PluginStoryGetProperty = z8.enum([
774
+ var PluginStoryGetProperty = z10.enum([
648
775
  "value",
649
776
  "id",
650
777
  "name",
@@ -654,44 +781,44 @@ var PluginStoryGetProperty = z8.enum([
654
781
  "spacesCount",
655
782
  "totalArea"
656
783
  ]);
657
- var PluginStoryGetArgs = z8.object({
658
- storyValue: z8.number().int(),
659
- properties: z8.array(PluginStoryGetProperty)
660
- });
661
- var PluginStoryGetResult = z8.object({
662
- value: z8.number(),
663
- id: z8.string(),
664
- name: z8.string(),
665
- height: z8.number(),
666
- base: z8.number(),
667
- hidden: z8.boolean(),
668
- spacesCount: z8.number(),
669
- totalArea: z8.number()
784
+ var PluginStoryGetArgs = z10.object({
785
+ storyValue: z10.number().int(),
786
+ properties: z10.array(PluginStoryGetProperty)
787
+ });
788
+ var PluginStoryGetResult = z10.object({
789
+ value: z10.number(),
790
+ id: z10.string(),
791
+ name: z10.string(),
792
+ height: z10.number(),
793
+ base: z10.number(),
794
+ hidden: z10.boolean(),
795
+ spacesCount: z10.number(),
796
+ totalArea: z10.number()
670
797
  }).partial();
671
- var PluginStoryGetAllResult = z8.object({
672
- stories: z8.array(
673
- z8.object({
674
- value: z8.number(),
675
- id: z8.string(),
676
- name: z8.string()
798
+ var PluginStoryGetAllResult = z10.object({
799
+ stories: z10.array(
800
+ z10.object({
801
+ value: z10.number(),
802
+ id: z10.string(),
803
+ name: z10.string()
677
804
  })
678
805
  )
679
806
  });
680
- var PluginStoryCreateArgs = z8.object({
681
- storyValue: z8.number().int(),
682
- height: z8.number().optional()
807
+ var PluginStoryCreateArgs = z10.object({
808
+ storyValue: z10.number().int(),
809
+ height: z10.number().optional()
683
810
  });
684
- var PluginStoryCreateResult = z8.object({
685
- storyId: z8.string(),
686
- storyValue: z8.number()
811
+ var PluginStoryCreateResult = z10.object({
812
+ storyId: z10.string(),
813
+ storyValue: z10.number()
687
814
  });
688
- var PluginStoryUpdateArgs = z8.object({
689
- storyValue: z8.number().int(),
690
- height: z8.number()
815
+ var PluginStoryUpdateArgs = z10.object({
816
+ storyValue: z10.number().int(),
817
+ height: z10.number()
691
818
  });
692
- var PluginStoryUpdateResult = z8.object({
693
- storyValue: z8.number(),
694
- height: z8.number()
819
+ var PluginStoryUpdateResult = z10.object({
820
+ storyValue: z10.number(),
821
+ height: z10.number()
695
822
  });
696
823
 
697
824
  // src/api/entity/index.ts
@@ -701,28 +828,28 @@ var PluginEntityApi = class {
701
828
  };
702
829
 
703
830
  // src/api/tools/selection.ts
704
- import * as z9 from "zod";
831
+ import * as z11 from "zod";
705
832
  var PluginSelectionApi = class {
706
833
  constructor() {
707
834
  }
708
835
  };
709
- var PluginSelectionGetResult = z9.object({
710
- selected: z9.array(z9.string())
836
+ var PluginSelectionGetResult = z11.object({
837
+ selected: z11.array(z11.string())
711
838
  });
712
839
 
713
840
  // src/api/tools/transform.ts
714
- import * as z10 from "zod";
841
+ import * as z12 from "zod";
715
842
  var PluginTransformApi = class {
716
843
  constructor() {
717
844
  }
718
845
  };
719
- var PluginMoveArgs = z10.object({
720
- componentIds: z10.array(z10.string()),
846
+ var PluginMoveArgs = z12.object({
847
+ componentIds: z12.array(z12.string()),
721
848
  displacement: PVec3
722
849
  });
723
- var PluginRotateArgs = z10.object({
724
- componentIds: z10.array(z10.string()),
725
- angle: z10.number(),
850
+ var PluginRotateArgs = z12.object({
851
+ componentIds: z12.array(z12.string()),
852
+ angle: z12.number(),
726
853
  axis: PVec3,
727
854
  pivot: PVec3
728
855
  });
@@ -734,12 +861,12 @@ var PluginToolsApi = class {
734
861
  };
735
862
 
736
863
  // src/api/units/index.ts
737
- import * as z11 from "zod";
864
+ import * as z13 from "zod";
738
865
  var PluginUnitsApi = class {
739
866
  constructor() {
740
867
  }
741
868
  };
742
- var PUnitType = z11.enum([
869
+ var PUnitType = z13.enum([
743
870
  "meters",
744
871
  "feet-inches",
745
872
  "inches",
@@ -748,19 +875,21 @@ var PUnitType = z11.enum([
748
875
  "kilometers",
749
876
  "miles"
750
877
  ]);
751
- var PluginUnitsConvertFromArgs = z11.object({
878
+ var PluginUnitsConvertFromArgs = z13.object({
752
879
  unit: PUnitType,
753
- value: z11.number()
880
+ value: z13.number(),
881
+ degree: z13.number().int().min(1).max(3).optional()
754
882
  });
755
- var PluginUnitsConvertFromResult = z11.object({
756
- value: z11.number()
883
+ var PluginUnitsConvertFromResult = z13.object({
884
+ value: z13.number()
757
885
  });
758
- var PluginUnitsConvertToArgs = z11.object({
886
+ var PluginUnitsConvertToArgs = z13.object({
759
887
  unit: PUnitType,
760
- value: z11.number()
888
+ value: z13.number(),
889
+ degree: z13.number().int().min(1).max(3).optional()
761
890
  });
762
- var PluginUnitsConvertToResult = z11.object({
763
- value: z11.number()
891
+ var PluginUnitsConvertToResult = z13.object({
892
+ value: z13.number()
764
893
  });
765
894
 
766
895
  // src/api/index.ts
@@ -780,14 +909,29 @@ export {
780
909
  PluginArcApi,
781
910
  PluginCoreApi,
782
911
  PluginCurveApi,
912
+ PluginDepartmentApi,
913
+ PluginDepartmentCreateArgs,
914
+ PluginDepartmentCreateResult,
915
+ PluginDepartmentEntry,
916
+ PluginDepartmentGetAllResult,
917
+ PluginDepartmentId,
783
918
  PluginEntityApi,
784
919
  PluginGeomApi,
785
920
  PluginLineApi,
921
+ PluginMassType,
786
922
  PluginMathApi,
787
923
  PluginMoveArgs,
788
924
  PluginProfileApi,
789
925
  PluginProfileFromLinePointsArgs,
790
926
  PluginQuatApi,
927
+ PluginReferenceLineApi,
928
+ PluginReferenceLineCreateMultiArgs,
929
+ PluginReferenceLineCreateMultiResult,
930
+ PluginReferenceLineDeleteArgs,
931
+ PluginReferenceLineGetAllResult,
932
+ PluginReferenceLineGetArgs,
933
+ PluginReferenceLineGetProperty,
934
+ PluginReferenceLineGetResult,
791
935
  PluginRotateArgs,
792
936
  PluginSelectionApi,
793
937
  PluginSelectionGetResult,
@@ -801,6 +945,9 @@ export {
801
945
  PluginSpaceGetArgs,
802
946
  PluginSpaceGetProperty,
803
947
  PluginSpaceGetResult,
948
+ PluginSpaceType,
949
+ PluginSpaceUpdateArgs,
950
+ PluginSpaceUpdateResult,
804
951
  PluginStoryApi,
805
952
  PluginStoryCreateArgs,
806
953
  PluginStoryCreateResult,
@@ -817,6 +964,7 @@ export {
817
964
  PluginUnitsConvertFromResult,
818
965
  PluginUnitsConvertToArgs,
819
966
  PluginUnitsConvertToResult,
820
- PluginVec3Api
967
+ PluginVec3Api,
968
+ PluginWellKnownDepartmentId
821
969
  };
822
970
  //# sourceMappingURL=index.js.map