@foxglove/schemas 0.4.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +1 -1
- package/dist/cjs/schemas/typescript/ArrowPrimitive.d.ts +18 -0
- package/dist/cjs/schemas/typescript/ArrowPrimitive.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/ArrowPrimitive.js +4 -0
- package/dist/cjs/schemas/typescript/ArrowPrimitive.js.map +1 -0
- package/dist/cjs/schemas/typescript/CameraCalibration.d.ts +2 -0
- package/dist/cjs/schemas/typescript/CameraCalibration.d.ts.map +1 -1
- package/dist/cjs/schemas/typescript/CompressedImage.d.ts +2 -0
- package/dist/cjs/schemas/typescript/CompressedImage.d.ts.map +1 -1
- package/dist/cjs/schemas/typescript/CubePrimitive.d.ts +13 -0
- package/dist/cjs/schemas/typescript/CubePrimitive.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/CubePrimitive.js +4 -0
- package/dist/cjs/schemas/typescript/CubePrimitive.js.map +1 -0
- package/dist/cjs/schemas/typescript/CylinderPrimitive.d.ts +17 -0
- package/dist/cjs/schemas/typescript/CylinderPrimitive.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/CylinderPrimitive.js +4 -0
- package/dist/cjs/schemas/typescript/CylinderPrimitive.js.map +1 -0
- package/dist/cjs/schemas/typescript/KeyValuePair.d.ts +8 -0
- package/dist/cjs/schemas/typescript/KeyValuePair.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/KeyValuePair.js +4 -0
- package/dist/cjs/schemas/typescript/KeyValuePair.js.map +1 -0
- package/dist/cjs/schemas/typescript/LinePrimitive.d.ts +28 -0
- package/dist/cjs/schemas/typescript/LinePrimitive.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/LinePrimitive.js +4 -0
- package/dist/cjs/schemas/typescript/LinePrimitive.js.map +1 -0
- package/dist/cjs/schemas/typescript/LineType.d.ts +10 -0
- package/dist/cjs/schemas/typescript/LineType.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/LineType.js +15 -0
- package/dist/cjs/schemas/typescript/LineType.js.map +1 -0
- package/dist/cjs/schemas/typescript/ModelPrimitive.d.ts +21 -0
- package/dist/cjs/schemas/typescript/ModelPrimitive.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/ModelPrimitive.js +4 -0
- package/dist/cjs/schemas/typescript/ModelPrimitive.js.map +1 -0
- package/dist/cjs/schemas/typescript/RawImage.d.ts +2 -0
- package/dist/cjs/schemas/typescript/RawImage.d.ts.map +1 -1
- package/dist/cjs/schemas/typescript/SceneEntity.d.ts +43 -0
- package/dist/cjs/schemas/typescript/SceneEntity.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/SceneEntity.js +4 -0
- package/dist/cjs/schemas/typescript/SceneEntity.js.map +1 -0
- package/dist/cjs/schemas/typescript/SceneEntityDeletion.d.ts +12 -0
- package/dist/cjs/schemas/typescript/SceneEntityDeletion.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/SceneEntityDeletion.js +4 -0
- package/dist/cjs/schemas/typescript/SceneEntityDeletion.js.map +1 -0
- package/dist/cjs/schemas/typescript/SceneEntityDeletionType.d.ts +8 -0
- package/dist/cjs/schemas/typescript/SceneEntityDeletionType.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/SceneEntityDeletionType.js +13 -0
- package/dist/cjs/schemas/typescript/SceneEntityDeletionType.js.map +1 -0
- package/dist/cjs/schemas/typescript/SceneUpdate.d.ts +10 -0
- package/dist/cjs/schemas/typescript/SceneUpdate.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/SceneUpdate.js +4 -0
- package/dist/cjs/schemas/typescript/SceneUpdate.js.map +1 -0
- package/dist/cjs/schemas/typescript/SpherePrimitive.d.ts +13 -0
- package/dist/cjs/schemas/typescript/SpherePrimitive.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/SpherePrimitive.js +4 -0
- package/dist/cjs/schemas/typescript/SpherePrimitive.js.map +1 -0
- package/dist/cjs/schemas/typescript/TextPrimitive.d.ts +18 -0
- package/dist/cjs/schemas/typescript/TextPrimitive.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/TextPrimitive.js +4 -0
- package/dist/cjs/schemas/typescript/TextPrimitive.js.map +1 -0
- package/dist/cjs/schemas/typescript/TriangleListPrimitive.d.ts +21 -0
- package/dist/cjs/schemas/typescript/TriangleListPrimitive.d.ts.map +1 -0
- package/dist/cjs/schemas/typescript/TriangleListPrimitive.js +4 -0
- package/dist/cjs/schemas/typescript/TriangleListPrimitive.js.map +1 -0
- package/dist/cjs/schemas/typescript/index.d.ts +14 -0
- package/dist/cjs/schemas/typescript/index.d.ts.map +1 -1
- package/dist/cjs/schemas/typescript/index.js +14 -0
- package/dist/cjs/schemas/typescript/index.js.map +1 -1
- package/dist/cjs/src/generateJsonSchema.test.js +71 -71
- package/dist/cjs/src/generateProto.d.ts.map +1 -1
- package/dist/cjs/src/generateProto.js +21 -3
- package/dist/cjs/src/generateProto.js.map +1 -1
- package/dist/cjs/src/generateProto.test.js +26 -26
- package/dist/cjs/src/generateRos.js +3 -3
- package/dist/cjs/src/generateRos.js.map +1 -1
- package/dist/cjs/src/generateRos.test.js +116 -116
- package/dist/cjs/src/generateTypeScript.test.js +4 -4
- package/dist/cjs/src/schemas.d.ts +15 -1
- package/dist/cjs/src/schemas.d.ts.map +1 -1
- package/dist/cjs/src/schemas.js +559 -79
- package/dist/cjs/src/schemas.js.map +1 -1
- package/dist/cjs/src/schemas.test.js +17 -0
- package/dist/cjs/src/schemas.test.js.map +1 -1
- package/dist/cjs/src/testFixtures.d.ts.map +1 -1
- package/dist/cjs/src/testFixtures.js +1 -0
- package/dist/cjs/src/testFixtures.js.map +1 -1
- package/dist/cjs/src/types.d.ts +19 -17
- package/dist/cjs/src/types.d.ts.map +1 -1
- package/dist/esm/schemas/typescript/ArrowPrimitive.d.ts +18 -0
- package/dist/esm/schemas/typescript/ArrowPrimitive.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/ArrowPrimitive.js +3 -0
- package/dist/esm/schemas/typescript/ArrowPrimitive.js.map +1 -0
- package/dist/esm/schemas/typescript/CameraCalibration.d.ts +2 -0
- package/dist/esm/schemas/typescript/CameraCalibration.d.ts.map +1 -1
- package/dist/esm/schemas/typescript/CompressedImage.d.ts +2 -0
- package/dist/esm/schemas/typescript/CompressedImage.d.ts.map +1 -1
- package/dist/esm/schemas/typescript/CubePrimitive.d.ts +13 -0
- package/dist/esm/schemas/typescript/CubePrimitive.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/CubePrimitive.js +3 -0
- package/dist/esm/schemas/typescript/CubePrimitive.js.map +1 -0
- package/dist/esm/schemas/typescript/CylinderPrimitive.d.ts +17 -0
- package/dist/esm/schemas/typescript/CylinderPrimitive.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/CylinderPrimitive.js +3 -0
- package/dist/esm/schemas/typescript/CylinderPrimitive.js.map +1 -0
- package/dist/esm/schemas/typescript/KeyValuePair.d.ts +8 -0
- package/dist/esm/schemas/typescript/KeyValuePair.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/KeyValuePair.js +3 -0
- package/dist/esm/schemas/typescript/KeyValuePair.js.map +1 -0
- package/dist/esm/schemas/typescript/LinePrimitive.d.ts +28 -0
- package/dist/esm/schemas/typescript/LinePrimitive.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/LinePrimitive.js +3 -0
- package/dist/esm/schemas/typescript/LinePrimitive.js.map +1 -0
- package/dist/esm/schemas/typescript/LineType.d.ts +10 -0
- package/dist/esm/schemas/typescript/LineType.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/LineType.js +12 -0
- package/dist/esm/schemas/typescript/LineType.js.map +1 -0
- package/dist/esm/schemas/typescript/ModelPrimitive.d.ts +21 -0
- package/dist/esm/schemas/typescript/ModelPrimitive.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/ModelPrimitive.js +3 -0
- package/dist/esm/schemas/typescript/ModelPrimitive.js.map +1 -0
- package/dist/esm/schemas/typescript/RawImage.d.ts +2 -0
- package/dist/esm/schemas/typescript/RawImage.d.ts.map +1 -1
- package/dist/esm/schemas/typescript/SceneEntity.d.ts +43 -0
- package/dist/esm/schemas/typescript/SceneEntity.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/SceneEntity.js +3 -0
- package/dist/esm/schemas/typescript/SceneEntity.js.map +1 -0
- package/dist/esm/schemas/typescript/SceneEntityDeletion.d.ts +12 -0
- package/dist/esm/schemas/typescript/SceneEntityDeletion.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/SceneEntityDeletion.js +3 -0
- package/dist/esm/schemas/typescript/SceneEntityDeletion.js.map +1 -0
- package/dist/esm/schemas/typescript/SceneEntityDeletionType.d.ts +8 -0
- package/dist/esm/schemas/typescript/SceneEntityDeletionType.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/SceneEntityDeletionType.js +10 -0
- package/dist/esm/schemas/typescript/SceneEntityDeletionType.js.map +1 -0
- package/dist/esm/schemas/typescript/SceneUpdate.d.ts +10 -0
- package/dist/esm/schemas/typescript/SceneUpdate.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/SceneUpdate.js +3 -0
- package/dist/esm/schemas/typescript/SceneUpdate.js.map +1 -0
- package/dist/esm/schemas/typescript/SpherePrimitive.d.ts +13 -0
- package/dist/esm/schemas/typescript/SpherePrimitive.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/SpherePrimitive.js +3 -0
- package/dist/esm/schemas/typescript/SpherePrimitive.js.map +1 -0
- package/dist/esm/schemas/typescript/TextPrimitive.d.ts +18 -0
- package/dist/esm/schemas/typescript/TextPrimitive.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/TextPrimitive.js +3 -0
- package/dist/esm/schemas/typescript/TextPrimitive.js.map +1 -0
- package/dist/esm/schemas/typescript/TriangleListPrimitive.d.ts +21 -0
- package/dist/esm/schemas/typescript/TriangleListPrimitive.d.ts.map +1 -0
- package/dist/esm/schemas/typescript/TriangleListPrimitive.js +3 -0
- package/dist/esm/schemas/typescript/TriangleListPrimitive.js.map +1 -0
- package/dist/esm/schemas/typescript/index.d.ts +14 -0
- package/dist/esm/schemas/typescript/index.d.ts.map +1 -1
- package/dist/esm/schemas/typescript/index.js +14 -0
- package/dist/esm/schemas/typescript/index.js.map +1 -1
- package/dist/esm/src/generateJsonSchema.test.js +71 -71
- package/dist/esm/src/generateProto.d.ts.map +1 -1
- package/dist/esm/src/generateProto.js +21 -3
- package/dist/esm/src/generateProto.js.map +1 -1
- package/dist/esm/src/generateProto.test.js +26 -26
- package/dist/esm/src/generateRos.js +4 -4
- package/dist/esm/src/generateRos.js.map +1 -1
- package/dist/esm/src/generateRos.test.js +116 -116
- package/dist/esm/src/generateTypeScript.test.js +4 -4
- package/dist/esm/src/schemas.d.ts +15 -1
- package/dist/esm/src/schemas.d.ts.map +1 -1
- package/dist/esm/src/schemas.js +559 -79
- package/dist/esm/src/schemas.js.map +1 -1
- package/dist/esm/src/schemas.test.js +17 -0
- package/dist/esm/src/schemas.test.js.map +1 -1
- package/dist/esm/src/testFixtures.d.ts.map +1 -1
- package/dist/esm/src/testFixtures.js +1 -0
- package/dist/esm/src/testFixtures.js.map +1 -1
- package/dist/esm/src/types.d.ts +19 -17
- package/dist/esm/src/types.d.ts.map +1 -1
- package/jest.config.json +8 -8
- package/package.json +18 -18
- package/schemas/README.md +1069 -13
- package/schemas/jsonschema/ArrowPrimitive.json +96 -0
- package/schemas/jsonschema/CameraCalibration.json +4 -0
- package/schemas/jsonschema/CompressedImage.json +4 -0
- package/schemas/jsonschema/CubePrimitive.json +99 -0
- package/schemas/jsonschema/CylinderPrimitive.json +107 -0
- package/schemas/jsonschema/KeyValuePair.json +16 -0
- package/schemas/jsonschema/LinePrimitive.json +167 -0
- package/schemas/jsonschema/ModelPrimitive.json +116 -0
- package/schemas/jsonschema/RawImage.json +4 -0
- package/schemas/jsonschema/SceneEntity.json +1012 -0
- package/schemas/jsonschema/SceneEntityDeletion.json +44 -0
- package/schemas/jsonschema/SceneUpdate.json +1070 -0
- package/schemas/jsonschema/SpherePrimitive.json +99 -0
- package/schemas/jsonschema/TextPrimitive.json +96 -0
- package/schemas/jsonschema/TriangleListPrimitive.json +138 -0
- package/schemas/proto/foxglove/ArrowPrimitive.proto +29 -0
- package/schemas/proto/foxglove/CameraCalibration.proto +3 -0
- package/schemas/proto/foxglove/CompressedImage.proto +3 -0
- package/schemas/proto/foxglove/CubePrimitive.proto +21 -0
- package/schemas/proto/foxglove/CylinderPrimitive.proto +27 -0
- package/schemas/proto/foxglove/KeyValuePair.proto +14 -0
- package/schemas/proto/foxglove/LinePrimitive.proto +49 -0
- package/schemas/proto/foxglove/ModelPrimitive.proto +33 -0
- package/schemas/proto/foxglove/RawImage.proto +3 -0
- package/schemas/proto/foxglove/SceneEntity.proto +62 -0
- package/schemas/proto/foxglove/SceneEntityDeletion.proto +27 -0
- package/schemas/proto/foxglove/SceneUpdate.proto +17 -0
- package/schemas/proto/foxglove/SpherePrimitive.proto +21 -0
- package/schemas/proto/foxglove/TextPrimitive.proto +29 -0
- package/schemas/proto/foxglove/TriangleListPrimitive.proto +29 -0
- package/schemas/ros1/ArrowPrimitive.msg +22 -0
- package/schemas/ros1/CameraCalibration.msg +3 -0
- package/schemas/ros1/CompressedImage.msg +3 -0
- package/schemas/ros1/CubePrimitive.msg +13 -0
- package/schemas/ros1/CylinderPrimitive.msg +19 -0
- package/schemas/ros1/KeyValuePair.msg +10 -0
- package/schemas/ros1/LinePrimitive.msg +39 -0
- package/schemas/ros1/ModelPrimitive.msg +25 -0
- package/schemas/ros1/RawImage.msg +3 -0
- package/schemas/ros1/SceneEntity.msg +46 -0
- package/schemas/ros1/SceneEntityDeletion.msg +19 -0
- package/schemas/ros1/SceneUpdate.msg +10 -0
- package/schemas/ros1/SpherePrimitive.msg +13 -0
- package/schemas/ros1/TextPrimitive.msg +22 -0
- package/schemas/ros1/TriangleListPrimitive.msg +21 -0
- package/schemas/ros2/ArrowPrimitive.msg +22 -0
- package/schemas/ros2/CameraCalibration.msg +3 -0
- package/schemas/ros2/CompressedImage.msg +3 -0
- package/schemas/ros2/CubePrimitive.msg +13 -0
- package/schemas/ros2/CylinderPrimitive.msg +19 -0
- package/schemas/ros2/KeyValuePair.msg +10 -0
- package/schemas/ros2/LinePrimitive.msg +39 -0
- package/schemas/ros2/ModelPrimitive.msg +25 -0
- package/schemas/ros2/RawImage.msg +3 -0
- package/schemas/ros2/SceneEntity.msg +46 -0
- package/schemas/ros2/SceneEntityDeletion.msg +19 -0
- package/schemas/ros2/SceneUpdate.msg +10 -0
- package/schemas/ros2/SpherePrimitive.msg +13 -0
- package/schemas/ros2/TextPrimitive.msg +22 -0
- package/schemas/ros2/TriangleListPrimitive.msg +21 -0
- package/schemas/typescript/ArrowPrimitive.ts +25 -0
- package/schemas/typescript/CameraCalibration.ts +3 -0
- package/schemas/typescript/CompressedImage.ts +3 -0
- package/schemas/typescript/CubePrimitive.ts +17 -0
- package/schemas/typescript/CylinderPrimitive.ts +23 -0
- package/schemas/typescript/KeyValuePair.ts +10 -0
- package/schemas/typescript/LinePrimitive.ts +37 -0
- package/schemas/typescript/LineType.ts +13 -0
- package/schemas/typescript/ModelPrimitive.ts +29 -0
- package/schemas/typescript/RawImage.ts +3 -0
- package/schemas/typescript/SceneEntity.ts +58 -0
- package/schemas/typescript/SceneEntityDeletion.ts +16 -0
- package/schemas/typescript/SceneEntityDeletionType.ts +10 -0
- package/schemas/typescript/SceneUpdate.ts +13 -0
- package/schemas/typescript/SpherePrimitive.ts +17 -0
- package/schemas/typescript/TextPrimitive.ts +25 -0
- package/schemas/typescript/TriangleListPrimitive.ts +27 -0
- package/schemas/typescript/index.ts +14 -0
- package/src/generateJsonSchema.test.ts +71 -71
- package/src/generateProto.test.ts +26 -26
- package/src/generateProto.ts +33 -4
- package/src/generateRos.test.ts +116 -116
- package/src/generateRos.ts +6 -6
- package/src/generateTypeScript.test.ts +4 -4
- package/src/schemas.test.ts +19 -0
- package/src/schemas.ts +608 -79
- package/src/testFixtures.ts +1 -0
- package/src/types.ts +14 -11
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated by https://github.com/foxglove/schemas
|
|
2
|
+
/** (Experimental, subject to change) An enumeration indicating which entities should match a SceneEntityDeletion command */
|
|
3
|
+
export var SceneEntityDeletionType;
|
|
4
|
+
(function (SceneEntityDeletionType) {
|
|
5
|
+
/** Delete the existing entity on the same topic that has the provided `id` */
|
|
6
|
+
SceneEntityDeletionType[SceneEntityDeletionType["MATCHING_ID"] = 0] = "MATCHING_ID";
|
|
7
|
+
/** Delete all existing entities on the same topic */
|
|
8
|
+
SceneEntityDeletionType[SceneEntityDeletionType["ALL"] = 1] = "ALL";
|
|
9
|
+
})(SceneEntityDeletionType || (SceneEntityDeletionType = {}));
|
|
10
|
+
//# sourceMappingURL=SceneEntityDeletionType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneEntityDeletionType.js","sourceRoot":"","sources":["../../../../schemas/typescript/SceneEntityDeletionType.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,4HAA4H;AAC5H,MAAM,CAAN,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,8EAA8E;IAC9E,mFAAe,CAAA;IAEf,qDAAqD;IACrD,mEAAO,CAAA;AACT,CAAC,EANW,uBAAuB,KAAvB,uBAAuB,QAMlC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SceneEntity } from "./SceneEntity";
|
|
2
|
+
import { SceneEntityDeletion } from "./SceneEntityDeletion";
|
|
3
|
+
/** (Experimental, subject to change) An update to the entities displayed in a 3D scene */
|
|
4
|
+
export declare type SceneUpdate = {
|
|
5
|
+
/** Scene entities to delete */
|
|
6
|
+
deletions: SceneEntityDeletion[];
|
|
7
|
+
/** Scene entities to add or replace */
|
|
8
|
+
entities: SceneEntity[];
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=SceneUpdate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneUpdate.d.ts","sourceRoot":"","sources":["../../../../schemas/typescript/SceneUpdate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,0FAA0F;AAC1F,oBAAY,WAAW,GAAG;IACxB,+BAA+B;IAC/B,SAAS,EAAE,mBAAmB,EAAE,CAAC;IAEjC,uCAAuC;IACvC,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneUpdate.js","sourceRoot":"","sources":["../../../../schemas/typescript/SceneUpdate.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Color } from "./Color";
|
|
2
|
+
import { Pose } from "./Pose";
|
|
3
|
+
import { Vector3 } from "./Vector3";
|
|
4
|
+
/** (Experimental, subject to change) A primitive representing a sphere or ellipsoid */
|
|
5
|
+
export declare type SpherePrimitive = {
|
|
6
|
+
/** Position of the center of the sphere and orientation of the sphere */
|
|
7
|
+
pose: Pose;
|
|
8
|
+
/** Size (diameter) of the sphere along each axis */
|
|
9
|
+
size: Vector3;
|
|
10
|
+
/** Color of the sphere */
|
|
11
|
+
color: Color;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=SpherePrimitive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpherePrimitive.d.ts","sourceRoot":"","sources":["../../../../schemas/typescript/SpherePrimitive.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,uFAAuF;AACvF,oBAAY,eAAe,GAAG;IAC5B,yEAAyE;IACzE,IAAI,EAAE,IAAI,CAAC;IAEX,oDAAoD;IACpD,IAAI,EAAE,OAAO,CAAC;IAEd,0BAA0B;IAC1B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpherePrimitive.js","sourceRoot":"","sources":["../../../../schemas/typescript/SpherePrimitive.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Color } from "./Color";
|
|
2
|
+
import { Pose } from "./Pose";
|
|
3
|
+
/** (Experimental, subject to change) A primitive representing a text label */
|
|
4
|
+
export declare type TextPrimitive = {
|
|
5
|
+
/** Position of the center of the text box and orientation of the text. Identity orientation means the text is oriented in the xy-plane and flows from -x to +x. */
|
|
6
|
+
pose: Pose;
|
|
7
|
+
/** Whether the text should respect `pose.orientation` (false) or always face the camera (true) */
|
|
8
|
+
billboard: boolean;
|
|
9
|
+
/** Font size (height of one line of text) */
|
|
10
|
+
font_size: number;
|
|
11
|
+
/** Indicates whether `font_size` is a fixed size in screen pixels (true), or specified in world coordinates and scales with distance from the camera (false) */
|
|
12
|
+
scale_invariant: boolean;
|
|
13
|
+
/** Color of the text */
|
|
14
|
+
color: Color;
|
|
15
|
+
/** Text */
|
|
16
|
+
text: string;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=TextPrimitive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextPrimitive.d.ts","sourceRoot":"","sources":["../../../../schemas/typescript/TextPrimitive.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,8EAA8E;AAC9E,oBAAY,aAAa,GAAG;IAC1B,mKAAmK;IACnK,IAAI,EAAE,IAAI,CAAC;IAEX,kGAAkG;IAClG,SAAS,EAAE,OAAO,CAAC;IAEnB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAElB,gKAAgK;IAChK,eAAe,EAAE,OAAO,CAAC;IAEzB,wBAAwB;IACxB,KAAK,EAAE,KAAK,CAAC;IAEb,WAAW;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextPrimitive.js","sourceRoot":"","sources":["../../../../schemas/typescript/TextPrimitive.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Color } from "./Color";
|
|
2
|
+
import { Point3 } from "./Point3";
|
|
3
|
+
import { Pose } from "./Pose";
|
|
4
|
+
/** (Experimental, subject to change) A primitive representing a set of triangles or a surface tiled by triangles */
|
|
5
|
+
export declare type TriangleListPrimitive = {
|
|
6
|
+
/** Origin of triangles relative to reference frame */
|
|
7
|
+
pose: Pose;
|
|
8
|
+
/** Vertices to use for triangles, interpreted as a list of triples (0-1-2, 3-4-5, ...) */
|
|
9
|
+
points: Point3[];
|
|
10
|
+
/** Solid color to use for the whole shape. One of `color` or `colors` must be provided. */
|
|
11
|
+
color: Color;
|
|
12
|
+
/** Per-vertex colors (if specified, must have the same length as `points`). One of `color` or `colors` must be provided. */
|
|
13
|
+
colors: Color[];
|
|
14
|
+
/**
|
|
15
|
+
* Indices into the `points` and `colors` attribute arrays, which can be used to avoid duplicating attribute data.
|
|
16
|
+
*
|
|
17
|
+
* If omitted or empty, indexing will not be used. This default behavior is equivalent to specifying [0, 1, ..., N-1] for the indices (where N is the number of `points` provided).
|
|
18
|
+
*/
|
|
19
|
+
indices: number[];
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=TriangleListPrimitive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriangleListPrimitive.d.ts","sourceRoot":"","sources":["../../../../schemas/typescript/TriangleListPrimitive.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,oHAAoH;AACpH,oBAAY,qBAAqB,GAAG;IAClC,sDAAsD;IACtD,IAAI,EAAE,IAAI,CAAC;IAEX,0FAA0F;IAC1F,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,2FAA2F;IAC3F,KAAK,EAAE,KAAK,CAAC;IAEb,4HAA4H;IAC5H,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhB;;;;OAIG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriangleListPrimitive.js","sourceRoot":"","sources":["../../../../schemas/typescript/TriangleListPrimitive.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
export * from "./ArrowPrimitive";
|
|
1
2
|
export * from "./CameraCalibration";
|
|
2
3
|
export * from "./CircleAnnotation";
|
|
3
4
|
export * from "./Color";
|
|
4
5
|
export * from "./CompressedImage";
|
|
6
|
+
export * from "./CubePrimitive";
|
|
7
|
+
export * from "./CylinderPrimitive";
|
|
5
8
|
export * from "./FrameTransform";
|
|
6
9
|
export * from "./GeoJSON";
|
|
7
10
|
export * from "./Grid";
|
|
8
11
|
export * from "./ImageAnnotations";
|
|
12
|
+
export * from "./KeyValuePair";
|
|
9
13
|
export * from "./LaserScan";
|
|
14
|
+
export * from "./LinePrimitive";
|
|
15
|
+
export * from "./LineType";
|
|
10
16
|
export * from "./LocationFix";
|
|
11
17
|
export * from "./Log";
|
|
12
18
|
export * from "./LogLevel";
|
|
19
|
+
export * from "./ModelPrimitive";
|
|
13
20
|
export * from "./NumericType";
|
|
14
21
|
export * from "./PackedElementField";
|
|
15
22
|
export * from "./Point2";
|
|
@@ -23,6 +30,13 @@ export * from "./PosesInFrame";
|
|
|
23
30
|
export * from "./PositionCovarianceType";
|
|
24
31
|
export * from "./Quaternion";
|
|
25
32
|
export * from "./RawImage";
|
|
33
|
+
export * from "./SceneEntity";
|
|
34
|
+
export * from "./SceneEntityDeletion";
|
|
35
|
+
export * from "./SceneEntityDeletionType";
|
|
36
|
+
export * from "./SceneUpdate";
|
|
37
|
+
export * from "./SpherePrimitive";
|
|
38
|
+
export * from "./TextPrimitive";
|
|
39
|
+
export * from "./TriangleListPrimitive";
|
|
26
40
|
export * from "./Vector2";
|
|
27
41
|
export * from "./Vector3";
|
|
28
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schemas/typescript/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schemas/typescript/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
export * from "./ArrowPrimitive";
|
|
1
2
|
export * from "./CameraCalibration";
|
|
2
3
|
export * from "./CircleAnnotation";
|
|
3
4
|
export * from "./Color";
|
|
4
5
|
export * from "./CompressedImage";
|
|
6
|
+
export * from "./CubePrimitive";
|
|
7
|
+
export * from "./CylinderPrimitive";
|
|
5
8
|
export * from "./FrameTransform";
|
|
6
9
|
export * from "./GeoJSON";
|
|
7
10
|
export * from "./Grid";
|
|
8
11
|
export * from "./ImageAnnotations";
|
|
12
|
+
export * from "./KeyValuePair";
|
|
9
13
|
export * from "./LaserScan";
|
|
14
|
+
export * from "./LinePrimitive";
|
|
15
|
+
export * from "./LineType";
|
|
10
16
|
export * from "./LocationFix";
|
|
11
17
|
export * from "./Log";
|
|
12
18
|
export * from "./LogLevel";
|
|
19
|
+
export * from "./ModelPrimitive";
|
|
13
20
|
export * from "./NumericType";
|
|
14
21
|
export * from "./PackedElementField";
|
|
15
22
|
export * from "./Point2";
|
|
@@ -23,6 +30,13 @@ export * from "./PosesInFrame";
|
|
|
23
30
|
export * from "./PositionCovarianceType";
|
|
24
31
|
export * from "./Quaternion";
|
|
25
32
|
export * from "./RawImage";
|
|
33
|
+
export * from "./SceneEntity";
|
|
34
|
+
export * from "./SceneEntityDeletion";
|
|
35
|
+
export * from "./SceneEntityDeletionType";
|
|
36
|
+
export * from "./SceneUpdate";
|
|
37
|
+
export * from "./SpherePrimitive";
|
|
38
|
+
export * from "./TextPrimitive";
|
|
39
|
+
export * from "./TriangleListPrimitive";
|
|
26
40
|
export * from "./Vector2";
|
|
27
41
|
export * from "./Vector3";
|
|
28
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schemas/typescript/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CA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AAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -5,46 +5,46 @@ import { exampleMessage } from "./testFixtures";
|
|
|
5
5
|
describe("generateJsonSchema", () => {
|
|
6
6
|
it("generates expected JSON Schema", () => {
|
|
7
7
|
expect(generateJsonSchema(exampleMessage)).toMatchInlineSnapshot(`
|
|
8
|
-
|
|
8
|
+
{
|
|
9
9
|
"$comment": "Generated by https://github.com/foxglove/schemas",
|
|
10
10
|
"description": "An example type",
|
|
11
|
-
"properties":
|
|
12
|
-
"field_boolean":
|
|
11
|
+
"properties": {
|
|
12
|
+
"field_boolean": {
|
|
13
13
|
"description": "boolean field",
|
|
14
14
|
"type": "boolean",
|
|
15
15
|
},
|
|
16
|
-
"field_boolean_array":
|
|
16
|
+
"field_boolean_array": {
|
|
17
17
|
"description": "boolean array field",
|
|
18
|
-
"items":
|
|
18
|
+
"items": {
|
|
19
19
|
"type": "boolean",
|
|
20
20
|
},
|
|
21
21
|
"type": "array",
|
|
22
22
|
},
|
|
23
|
-
"field_boolean_fixed_array":
|
|
23
|
+
"field_boolean_fixed_array": {
|
|
24
24
|
"description": "boolean fixed-length array field",
|
|
25
|
-
"items":
|
|
25
|
+
"items": {
|
|
26
26
|
"type": "boolean",
|
|
27
27
|
},
|
|
28
28
|
"maxItems": 3,
|
|
29
29
|
"minItems": 3,
|
|
30
30
|
"type": "array",
|
|
31
31
|
},
|
|
32
|
-
"field_bytes":
|
|
32
|
+
"field_bytes": {
|
|
33
33
|
"contentEncoding": "base64",
|
|
34
34
|
"description": "bytes field",
|
|
35
35
|
"type": "string",
|
|
36
36
|
},
|
|
37
|
-
"field_bytes_array":
|
|
37
|
+
"field_bytes_array": {
|
|
38
38
|
"description": "bytes array field",
|
|
39
|
-
"items":
|
|
39
|
+
"items": {
|
|
40
40
|
"contentEncoding": "base64",
|
|
41
41
|
"type": "string",
|
|
42
42
|
},
|
|
43
43
|
"type": "array",
|
|
44
44
|
},
|
|
45
|
-
"field_bytes_fixed_array":
|
|
45
|
+
"field_bytes_fixed_array": {
|
|
46
46
|
"description": "bytes fixed-length array field",
|
|
47
|
-
"items":
|
|
47
|
+
"items": {
|
|
48
48
|
"contentEncoding": "base64",
|
|
49
49
|
"type": "string",
|
|
50
50
|
},
|
|
@@ -52,31 +52,31 @@ describe("generateJsonSchema", () => {
|
|
|
52
52
|
"minItems": 3,
|
|
53
53
|
"type": "array",
|
|
54
54
|
},
|
|
55
|
-
"field_duration":
|
|
55
|
+
"field_duration": {
|
|
56
56
|
"description": "duration field",
|
|
57
|
-
"properties":
|
|
58
|
-
"nsec":
|
|
57
|
+
"properties": {
|
|
58
|
+
"nsec": {
|
|
59
59
|
"maximum": 999999999,
|
|
60
60
|
"minimum": 0,
|
|
61
61
|
"type": "integer",
|
|
62
62
|
},
|
|
63
|
-
"sec":
|
|
63
|
+
"sec": {
|
|
64
64
|
"type": "integer",
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
"title": "duration",
|
|
68
68
|
"type": "object",
|
|
69
69
|
},
|
|
70
|
-
"field_duration_array":
|
|
70
|
+
"field_duration_array": {
|
|
71
71
|
"description": "duration array field",
|
|
72
|
-
"items":
|
|
73
|
-
"properties":
|
|
74
|
-
"nsec":
|
|
72
|
+
"items": {
|
|
73
|
+
"properties": {
|
|
74
|
+
"nsec": {
|
|
75
75
|
"maximum": 999999999,
|
|
76
76
|
"minimum": 0,
|
|
77
77
|
"type": "integer",
|
|
78
78
|
},
|
|
79
|
-
"sec":
|
|
79
|
+
"sec": {
|
|
80
80
|
"type": "integer",
|
|
81
81
|
},
|
|
82
82
|
},
|
|
@@ -85,16 +85,16 @@ describe("generateJsonSchema", () => {
|
|
|
85
85
|
},
|
|
86
86
|
"type": "array",
|
|
87
87
|
},
|
|
88
|
-
"field_duration_fixed_array":
|
|
88
|
+
"field_duration_fixed_array": {
|
|
89
89
|
"description": "duration fixed-length array field",
|
|
90
|
-
"items":
|
|
91
|
-
"properties":
|
|
92
|
-
"nsec":
|
|
90
|
+
"items": {
|
|
91
|
+
"properties": {
|
|
92
|
+
"nsec": {
|
|
93
93
|
"maximum": 999999999,
|
|
94
94
|
"minimum": 0,
|
|
95
95
|
"type": "integer",
|
|
96
96
|
},
|
|
97
|
-
"sec":
|
|
97
|
+
"sec": {
|
|
98
98
|
"type": "integer",
|
|
99
99
|
},
|
|
100
100
|
},
|
|
@@ -105,15 +105,15 @@ describe("generateJsonSchema", () => {
|
|
|
105
105
|
"minItems": 3,
|
|
106
106
|
"type": "array",
|
|
107
107
|
},
|
|
108
|
-
"field_enum":
|
|
108
|
+
"field_enum": {
|
|
109
109
|
"description": "An enum field",
|
|
110
|
-
"oneOf":
|
|
111
|
-
|
|
110
|
+
"oneOf": [
|
|
111
|
+
{
|
|
112
112
|
"const": 1,
|
|
113
113
|
"description": "Value A",
|
|
114
114
|
"title": "A",
|
|
115
115
|
},
|
|
116
|
-
|
|
116
|
+
{
|
|
117
117
|
"const": 2,
|
|
118
118
|
"description": "Value B",
|
|
119
119
|
"title": "B",
|
|
@@ -121,17 +121,17 @@ describe("generateJsonSchema", () => {
|
|
|
121
121
|
],
|
|
122
122
|
"title": "foxglove.ExampleEnum",
|
|
123
123
|
},
|
|
124
|
-
"field_enum_array":
|
|
124
|
+
"field_enum_array": {
|
|
125
125
|
"description": "An enum array field",
|
|
126
|
-
"items":
|
|
126
|
+
"items": {
|
|
127
127
|
"description": "An enum array field",
|
|
128
|
-
"oneOf":
|
|
129
|
-
|
|
128
|
+
"oneOf": [
|
|
129
|
+
{
|
|
130
130
|
"const": 1,
|
|
131
131
|
"description": "Value A",
|
|
132
132
|
"title": "A",
|
|
133
133
|
},
|
|
134
|
-
|
|
134
|
+
{
|
|
135
135
|
"const": 2,
|
|
136
136
|
"description": "Value B",
|
|
137
137
|
"title": "B",
|
|
@@ -141,30 +141,30 @@ describe("generateJsonSchema", () => {
|
|
|
141
141
|
},
|
|
142
142
|
"type": "array",
|
|
143
143
|
},
|
|
144
|
-
"field_float64":
|
|
144
|
+
"field_float64": {
|
|
145
145
|
"description": "float64 field",
|
|
146
146
|
"type": "number",
|
|
147
147
|
},
|
|
148
|
-
"field_float64_array":
|
|
148
|
+
"field_float64_array": {
|
|
149
149
|
"description": "float64 array field",
|
|
150
|
-
"items":
|
|
150
|
+
"items": {
|
|
151
151
|
"type": "number",
|
|
152
152
|
},
|
|
153
153
|
"type": "array",
|
|
154
154
|
},
|
|
155
|
-
"field_float64_fixed_array":
|
|
155
|
+
"field_float64_fixed_array": {
|
|
156
156
|
"description": "float64 fixed-length array field",
|
|
157
|
-
"items":
|
|
157
|
+
"items": {
|
|
158
158
|
"type": "number",
|
|
159
159
|
},
|
|
160
160
|
"maxItems": 3,
|
|
161
161
|
"minItems": 3,
|
|
162
162
|
"type": "array",
|
|
163
163
|
},
|
|
164
|
-
"field_nested":
|
|
164
|
+
"field_nested": {
|
|
165
165
|
"description": "A nested field",
|
|
166
|
-
"properties":
|
|
167
|
-
"field_enum":
|
|
166
|
+
"properties": {
|
|
167
|
+
"field_enum": {
|
|
168
168
|
"description": "An enum field",
|
|
169
169
|
"minimum": 0,
|
|
170
170
|
"type": "integer",
|
|
@@ -173,17 +173,17 @@ describe("generateJsonSchema", () => {
|
|
|
173
173
|
"title": "foxglove.NestedMessage",
|
|
174
174
|
"type": "object",
|
|
175
175
|
},
|
|
176
|
-
"field_nested_array":
|
|
176
|
+
"field_nested_array": {
|
|
177
177
|
"description": "A nested array field
|
|
178
178
|
With
|
|
179
179
|
a
|
|
180
180
|
very
|
|
181
181
|
long
|
|
182
182
|
description",
|
|
183
|
-
"items":
|
|
183
|
+
"items": {
|
|
184
184
|
"description": "An example nested message",
|
|
185
|
-
"properties":
|
|
186
|
-
"field_enum":
|
|
185
|
+
"properties": {
|
|
186
|
+
"field_enum": {
|
|
187
187
|
"description": "An enum field",
|
|
188
188
|
"minimum": 0,
|
|
189
189
|
"type": "integer",
|
|
@@ -194,35 +194,35 @@ describe("generateJsonSchema", () => {
|
|
|
194
194
|
},
|
|
195
195
|
"type": "array",
|
|
196
196
|
},
|
|
197
|
-
"field_string":
|
|
197
|
+
"field_string": {
|
|
198
198
|
"description": "string field",
|
|
199
199
|
"type": "string",
|
|
200
200
|
},
|
|
201
|
-
"field_string_array":
|
|
201
|
+
"field_string_array": {
|
|
202
202
|
"description": "string array field",
|
|
203
|
-
"items":
|
|
203
|
+
"items": {
|
|
204
204
|
"type": "string",
|
|
205
205
|
},
|
|
206
206
|
"type": "array",
|
|
207
207
|
},
|
|
208
|
-
"field_string_fixed_array":
|
|
208
|
+
"field_string_fixed_array": {
|
|
209
209
|
"description": "string fixed-length array field",
|
|
210
|
-
"items":
|
|
210
|
+
"items": {
|
|
211
211
|
"type": "string",
|
|
212
212
|
},
|
|
213
213
|
"maxItems": 3,
|
|
214
214
|
"minItems": 3,
|
|
215
215
|
"type": "array",
|
|
216
216
|
},
|
|
217
|
-
"field_time":
|
|
217
|
+
"field_time": {
|
|
218
218
|
"description": "time field",
|
|
219
|
-
"properties":
|
|
220
|
-
"nsec":
|
|
219
|
+
"properties": {
|
|
220
|
+
"nsec": {
|
|
221
221
|
"maximum": 999999999,
|
|
222
222
|
"minimum": 0,
|
|
223
223
|
"type": "integer",
|
|
224
224
|
},
|
|
225
|
-
"sec":
|
|
225
|
+
"sec": {
|
|
226
226
|
"minimum": 0,
|
|
227
227
|
"type": "integer",
|
|
228
228
|
},
|
|
@@ -230,16 +230,16 @@ describe("generateJsonSchema", () => {
|
|
|
230
230
|
"title": "time",
|
|
231
231
|
"type": "object",
|
|
232
232
|
},
|
|
233
|
-
"field_time_array":
|
|
233
|
+
"field_time_array": {
|
|
234
234
|
"description": "time array field",
|
|
235
|
-
"items":
|
|
236
|
-
"properties":
|
|
237
|
-
"nsec":
|
|
235
|
+
"items": {
|
|
236
|
+
"properties": {
|
|
237
|
+
"nsec": {
|
|
238
238
|
"maximum": 999999999,
|
|
239
239
|
"minimum": 0,
|
|
240
240
|
"type": "integer",
|
|
241
241
|
},
|
|
242
|
-
"sec":
|
|
242
|
+
"sec": {
|
|
243
243
|
"minimum": 0,
|
|
244
244
|
"type": "integer",
|
|
245
245
|
},
|
|
@@ -249,16 +249,16 @@ describe("generateJsonSchema", () => {
|
|
|
249
249
|
},
|
|
250
250
|
"type": "array",
|
|
251
251
|
},
|
|
252
|
-
"field_time_fixed_array":
|
|
252
|
+
"field_time_fixed_array": {
|
|
253
253
|
"description": "time fixed-length array field",
|
|
254
|
-
"items":
|
|
255
|
-
"properties":
|
|
256
|
-
"nsec":
|
|
254
|
+
"items": {
|
|
255
|
+
"properties": {
|
|
256
|
+
"nsec": {
|
|
257
257
|
"maximum": 999999999,
|
|
258
258
|
"minimum": 0,
|
|
259
259
|
"type": "integer",
|
|
260
260
|
},
|
|
261
|
-
"sec":
|
|
261
|
+
"sec": {
|
|
262
262
|
"minimum": 0,
|
|
263
263
|
"type": "integer",
|
|
264
264
|
},
|
|
@@ -270,22 +270,22 @@ describe("generateJsonSchema", () => {
|
|
|
270
270
|
"minItems": 3,
|
|
271
271
|
"type": "array",
|
|
272
272
|
},
|
|
273
|
-
"field_uint32":
|
|
273
|
+
"field_uint32": {
|
|
274
274
|
"description": "uint32 field",
|
|
275
275
|
"minimum": 0,
|
|
276
276
|
"type": "integer",
|
|
277
277
|
},
|
|
278
|
-
"field_uint32_array":
|
|
278
|
+
"field_uint32_array": {
|
|
279
279
|
"description": "uint32 array field",
|
|
280
|
-
"items":
|
|
280
|
+
"items": {
|
|
281
281
|
"minimum": 0,
|
|
282
282
|
"type": "integer",
|
|
283
283
|
},
|
|
284
284
|
"type": "array",
|
|
285
285
|
},
|
|
286
|
-
"field_uint32_fixed_array":
|
|
286
|
+
"field_uint32_fixed_array": {
|
|
287
287
|
"description": "uint32 fixed-length array field",
|
|
288
|
-
"items":
|
|
288
|
+
"items": {
|
|
289
289
|
"minimum": 0,
|
|
290
290
|
"type": "integer",
|
|
291
291
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateProto.d.ts","sourceRoot":"","sources":["../../../src/generateProto.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"generateProto.d.ts","sourceRoot":"","sources":["../../../src/generateProto.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EAEtB,MAAM,SAAS,CAAC;AAiBjB,wBAAgB,aAAa,CAC3B,MAAM,EAAE,qBAAqB,EAC7B,WAAW,EAAE,kBAAkB,EAAE,GAChC,MAAM,CAoGR"}
|
|
@@ -25,9 +25,27 @@ export function generateProto(schema, nestedEnums) {
|
|
|
25
25
|
});
|
|
26
26
|
enumDefinitions.push(` // ${enumSchema.description}\n enum ${enumSchema.protobufEnumName} {\n ${fields.join("\n\n ")}\n }\n`);
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
const explicitFieldNumbers = new Set();
|
|
29
|
+
for (const field of schema.fields) {
|
|
30
|
+
if (field.protobufFieldNumber != undefined) {
|
|
31
|
+
if (explicitFieldNumbers.has(field.protobufFieldNumber)) {
|
|
32
|
+
throw new Error(`More than one field with protobufFieldNumber ${field.protobufFieldNumber}`);
|
|
33
|
+
}
|
|
34
|
+
explicitFieldNumbers.add(field.protobufFieldNumber);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
let nextFieldNumber = 1;
|
|
38
|
+
const numberedFields = schema.fields.map((field) => {
|
|
39
|
+
if (field.protobufFieldNumber != undefined) {
|
|
40
|
+
return { ...field, protobufFieldNumber: field.protobufFieldNumber };
|
|
41
|
+
}
|
|
42
|
+
while (explicitFieldNumbers.has(nextFieldNumber)) {
|
|
43
|
+
++nextFieldNumber;
|
|
44
|
+
}
|
|
45
|
+
return { ...field, protobufFieldNumber: nextFieldNumber++ };
|
|
46
|
+
});
|
|
29
47
|
const imports = new Set();
|
|
30
|
-
const fields =
|
|
48
|
+
const fields = numberedFields.map((field) => {
|
|
31
49
|
const lineComments = [];
|
|
32
50
|
const qualifiers = [];
|
|
33
51
|
if (field.array != undefined) {
|
|
@@ -62,7 +80,7 @@ export function generateProto(schema, nestedEnums) {
|
|
|
62
80
|
.trim()
|
|
63
81
|
.split("\n")
|
|
64
82
|
.map((line) => ` // ${line}\n`)
|
|
65
|
-
.join("")} ${qualifiers.join(" ")} ${field.name} = ${
|
|
83
|
+
.join("")} ${qualifiers.join(" ")} ${field.name} = ${field.protobufFieldNumber};${lineComments.length > 0 ? " // " + lineComments.join(", ") : ""}`;
|
|
66
84
|
});
|
|
67
85
|
const definition = `// ${schema.description}\nmessage ${schema.name} {\n${enumDefinitions.join("\n\n")}${fields.join("\n\n")}\n}`;
|
|
68
86
|
const outputSections = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateProto.js","sourceRoot":"","sources":["../../../src/generateProto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateProto.js","sourceRoot":"","sources":["../../../src/generateProto.ts"],"names":[],"mappings":"AAOA,SAAS,gBAAgB,CAAC,IAAqD;IAC7E,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC;QAChB,KAAK,SA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