@foxglove/schemas 0.7.1 → 0.7.3
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/.github/workflows/ci.yml +51 -1
- package/.vscode/settings.json +10 -1
- package/Linux.flatc.binary.clang++-12.zip +0 -0
- package/README.md +5 -25
- package/flatc +0 -0
- package/internal/generateFlatbufferSchema.d.ts +6 -0
- package/internal/generateFlatbufferSchema.d.ts.map +1 -0
- package/internal/generateFlatbufferSchema.js +172 -0
- package/internal/generateFlatbufferSchema.js.map +1 -0
- package/internal/generateFlatbufferSchema.test.d.ts +2 -0
- package/internal/generateFlatbufferSchema.test.d.ts.map +1 -0
- package/internal/generateFlatbufferSchema.test.js +120 -0
- package/internal/generateFlatbufferSchema.test.js.map +1 -0
- package/internal/generateFlatbufferSchema.test.ts +118 -0
- package/internal/generateFlatbufferSchema.ts +189 -0
- package/internal/generateProto.test.js +1 -1
- package/internal/generateProto.test.js.map +1 -1
- package/internal/generateProto.test.ts +1 -1
- package/internal/schemas.d.ts.map +1 -1
- package/internal/schemas.js +21 -11
- package/internal/schemas.js.map +1 -1
- package/internal/schemas.test.js +1 -1
- package/internal/schemas.test.js.map +1 -1
- package/internal/schemas.test.ts +1 -1
- package/internal/schemas.ts +23 -11
- package/internal/testFixtures.d.ts.map +1 -1
- package/internal/testFixtures.js +11 -1
- package/internal/testFixtures.js.map +1 -1
- package/internal/testFixtures.ts +12 -1
- package/internal/types.d.ts +2 -1
- package/internal/types.d.ts.map +1 -1
- package/internal/types.ts +2 -1
- package/package.json +1 -1
- package/python/Makefile +39 -0
- package/python/Pipfile +17 -0
- package/python/Pipfile.lock +329 -0
- package/python/foxglove-schemas-protobuf/README.md +23 -0
- package/python/foxglove-schemas-protobuf/foxglove_schemas_protobuf/__init__.py +0 -0
- package/python/foxglove-schemas-protobuf/foxglove_schemas_protobuf/py.typed +0 -0
- package/python/foxglove-schemas-protobuf/pyproject.toml +11 -0
- package/python/foxglove-schemas-protobuf/setup.cfg +21 -0
- package/python/foxglove-schemas-protobuf/tests/test_schemas.py +5 -0
- package/schemas/README.md +8 -2
- package/schemas/flatbuffer/ArrowPrimitive.fbs +29 -0
- package/schemas/flatbuffer/ByteVector.fbs +8 -0
- package/schemas/flatbuffer/CameraCalibration.fbs +78 -0
- package/schemas/flatbuffer/CircleAnnotation.fbs +30 -0
- package/schemas/flatbuffer/Color.fbs +20 -0
- package/schemas/flatbuffer/CompressedImage.fbs +24 -0
- package/schemas/flatbuffer/CubePrimitive.fbs +21 -0
- package/schemas/flatbuffer/CylinderPrimitive.fbs +27 -0
- package/schemas/flatbuffer/Duration.fbs +10 -0
- package/schemas/flatbuffer/FrameTransform.fbs +27 -0
- package/schemas/flatbuffer/GeoJSON.fbs +11 -0
- package/schemas/flatbuffer/Grid.fbs +40 -0
- package/schemas/flatbuffer/ImageAnnotations.fbs +17 -0
- package/schemas/flatbuffer/KeyValuePair.fbs +14 -0
- package/schemas/flatbuffer/LaserScan.fbs +32 -0
- package/schemas/flatbuffer/LinePrimitive.fbs +49 -0
- package/schemas/flatbuffer/LocationFix.fbs +34 -0
- package/schemas/flatbuffer/Log.fbs +42 -0
- package/schemas/flatbuffer/ModelPrimitive.fbs +33 -0
- package/schemas/flatbuffer/PackedElementField.fbs +37 -0
- package/schemas/flatbuffer/Point2.fbs +14 -0
- package/schemas/flatbuffer/Point3.fbs +17 -0
- package/schemas/flatbuffer/PointCloud.fbs +30 -0
- package/schemas/flatbuffer/PointsAnnotation.fbs +45 -0
- package/schemas/flatbuffer/Pose.fbs +17 -0
- package/schemas/flatbuffer/PoseInFrame.fbs +20 -0
- package/schemas/flatbuffer/PosesInFrame.fbs +20 -0
- package/schemas/flatbuffer/Quaternion.fbs +20 -0
- package/schemas/flatbuffer/RawImage.fbs +33 -0
- package/schemas/flatbuffer/SceneEntity.fbs +62 -0
- package/schemas/flatbuffer/SceneEntityDeletion.fbs +27 -0
- package/schemas/flatbuffer/SceneUpdate.fbs +17 -0
- package/schemas/flatbuffer/SpherePrimitive.fbs +21 -0
- package/schemas/flatbuffer/TextPrimitive.fbs +29 -0
- package/schemas/flatbuffer/Time.fbs +9 -0
- package/schemas/flatbuffer/TriangleListPrimitive.fbs +29 -0
- package/schemas/flatbuffer/Vector2.fbs +14 -0
- package/schemas/flatbuffer/Vector3.fbs +17 -0
- package/schemas/jsonschema/CameraCalibration.json +2 -2
- package/schemas/jsonschema/CompressedImage.json +1 -1
- package/schemas/jsonschema/CubePrimitive.json +1 -1
- package/schemas/jsonschema/RawImage.json +1 -1
- package/schemas/jsonschema/SceneEntity.json +1 -1
- package/schemas/jsonschema/SceneUpdate.json +1 -1
- package/schemas/jsonschema/index.d.ts +4510 -35
- package/schemas/jsonschema/index.d.ts.map +1 -1
- package/schemas/jsonschema/index.js +7 -7
- package/schemas/jsonschema/index.js.map +1 -1
- package/schemas/jsonschema/index.ts +42 -42
- package/schemas/proto/foxglove/CameraCalibration.proto +3 -1
- package/schemas/proto/foxglove/CompressedImage.proto +2 -0
- package/schemas/proto/foxglove/CubePrimitive.proto +1 -1
- package/schemas/proto/foxglove/RawImage.proto +2 -0
- package/schemas/ros1/CameraCalibration.msg +3 -1
- package/schemas/ros1/CompressedImage.msg +2 -0
- package/schemas/ros1/CubePrimitive.msg +1 -1
- package/schemas/ros1/RawImage.msg +2 -0
- package/schemas/ros2/CameraCalibration.msg +3 -1
- package/schemas/ros2/CompressedImage.msg +2 -0
- package/schemas/ros2/CubePrimitive.msg +1 -1
- package/schemas/ros2/RawImage.msg +2 -0
- package/schemas/typescript/CameraCalibration.d.ts +6 -2
- package/schemas/typescript/CameraCalibration.d.ts.map +1 -1
- package/schemas/typescript/CameraCalibration.ts +6 -2
- package/schemas/typescript/CompressedImage.d.ts +5 -1
- package/schemas/typescript/CompressedImage.d.ts.map +1 -1
- package/schemas/typescript/CompressedImage.ts +5 -1
- package/schemas/typescript/CubePrimitive.d.ts +1 -1
- package/schemas/typescript/CubePrimitive.d.ts.map +1 -1
- package/schemas/typescript/CubePrimitive.ts +1 -1
- package/schemas/typescript/RawImage.d.ts +5 -1
- package/schemas/typescript/RawImage.d.ts.map +1 -1
- package/schemas/typescript/RawImage.ts +5 -1
- package/scripts/updateGeneratedFiles.js +14 -2
- package/scripts/updateGeneratedFiles.js.map +1 -1
- package/scripts/updateGeneratedFiles.ts +26 -2
package/internal/schemas.ts
CHANGED
|
@@ -9,21 +9,25 @@ const Color: FoxgloveMessageSchema = {
|
|
|
9
9
|
name: "r",
|
|
10
10
|
type: { type: "primitive", name: "float64" },
|
|
11
11
|
description: "Red value between 0 and 1",
|
|
12
|
+
defaultValue: 1.0,
|
|
12
13
|
},
|
|
13
14
|
{
|
|
14
15
|
name: "g",
|
|
15
16
|
type: { type: "primitive", name: "float64" },
|
|
16
17
|
description: "Green value between 0 and 1",
|
|
18
|
+
defaultValue: 1.0,
|
|
17
19
|
},
|
|
18
20
|
{
|
|
19
21
|
name: "b",
|
|
20
22
|
type: { type: "primitive", name: "float64" },
|
|
21
23
|
description: "Blue value between 0 and 1",
|
|
24
|
+
defaultValue: 1.0,
|
|
22
25
|
},
|
|
23
26
|
{
|
|
24
27
|
name: "a",
|
|
25
28
|
type: { type: "primitive", name: "float64" },
|
|
26
29
|
description: "Alpha value between 0 and 1",
|
|
30
|
+
defaultValue: 1.0,
|
|
27
31
|
},
|
|
28
32
|
],
|
|
29
33
|
};
|
|
@@ -37,11 +41,13 @@ const Vector2: FoxgloveMessageSchema = {
|
|
|
37
41
|
name: "x",
|
|
38
42
|
type: { type: "primitive", name: "float64" },
|
|
39
43
|
description: "x coordinate length",
|
|
44
|
+
defaultValue: 1.0,
|
|
40
45
|
},
|
|
41
46
|
{
|
|
42
47
|
name: "y",
|
|
43
48
|
type: { type: "primitive", name: "float64" },
|
|
44
49
|
description: "y coordinate length",
|
|
50
|
+
defaultValue: 1.0,
|
|
45
51
|
},
|
|
46
52
|
],
|
|
47
53
|
};
|
|
@@ -56,16 +62,19 @@ const Vector3: FoxgloveMessageSchema = {
|
|
|
56
62
|
name: "x",
|
|
57
63
|
type: { type: "primitive", name: "float64" },
|
|
58
64
|
description: "x coordinate length",
|
|
65
|
+
defaultValue: 1.0,
|
|
59
66
|
},
|
|
60
67
|
{
|
|
61
68
|
name: "y",
|
|
62
69
|
type: { type: "primitive", name: "float64" },
|
|
63
70
|
description: "y coordinate length",
|
|
71
|
+
defaultValue: 1.0,
|
|
64
72
|
},
|
|
65
73
|
{
|
|
66
74
|
name: "z",
|
|
67
75
|
type: { type: "primitive", name: "float64" },
|
|
68
76
|
description: "z coordinate length",
|
|
77
|
+
defaultValue: 1.0,
|
|
69
78
|
},
|
|
70
79
|
],
|
|
71
80
|
};
|
|
@@ -137,6 +146,7 @@ const Quaternion: FoxgloveMessageSchema = {
|
|
|
137
146
|
name: "w",
|
|
138
147
|
type: { type: "primitive", name: "float64" },
|
|
139
148
|
description: "w value",
|
|
149
|
+
defaultValue: 1.0,
|
|
140
150
|
},
|
|
141
151
|
],
|
|
142
152
|
};
|
|
@@ -181,7 +191,7 @@ const KeyValuePair: FoxgloveMessageSchema = {
|
|
|
181
191
|
const SceneEntityDeletionType: FoxgloveEnumSchema = {
|
|
182
192
|
type: "enum",
|
|
183
193
|
name: "SceneEntityDeletionType",
|
|
184
|
-
|
|
194
|
+
parentSchemaName: "SceneEntityDeletion",
|
|
185
195
|
protobufEnumName: "Type",
|
|
186
196
|
description:
|
|
187
197
|
"An enumeration indicating which entities should match a SceneEntityDeletion command",
|
|
@@ -276,7 +286,7 @@ const CubePrimitive: FoxgloveMessageSchema = {
|
|
|
276
286
|
{
|
|
277
287
|
name: "color",
|
|
278
288
|
type: { type: "nested", schema: Color },
|
|
279
|
-
description: "Color of the
|
|
289
|
+
description: "Color of the cube",
|
|
280
290
|
},
|
|
281
291
|
],
|
|
282
292
|
};
|
|
@@ -343,7 +353,7 @@ const CylinderPrimitive: FoxgloveMessageSchema = {
|
|
|
343
353
|
const LineType: FoxgloveEnumSchema = {
|
|
344
354
|
type: "enum",
|
|
345
355
|
name: "LineType",
|
|
346
|
-
|
|
356
|
+
parentSchemaName: "LinePrimitive",
|
|
347
357
|
protobufEnumName: "Type",
|
|
348
358
|
description: "An enumeration indicating how input points should be interpreted to create lines",
|
|
349
359
|
values: [
|
|
@@ -678,7 +688,8 @@ const CameraCalibration: FoxgloveMessageSchema = {
|
|
|
678
688
|
{
|
|
679
689
|
name: "distortion_model",
|
|
680
690
|
type: { type: "primitive", name: "string" },
|
|
681
|
-
description:
|
|
691
|
+
description:
|
|
692
|
+
"Name of distortion model\n\nSupported values: `plumb_bob` and `rational_polynomial`",
|
|
682
693
|
},
|
|
683
694
|
{
|
|
684
695
|
name: "D",
|
|
@@ -707,7 +718,7 @@ K = [ 0 fy cy]
|
|
|
707
718
|
name: "R",
|
|
708
719
|
type: { type: "primitive", name: "float64" },
|
|
709
720
|
array: 9,
|
|
710
|
-
description: `Rectification matrix (3x3 row-major matrix)
|
|
721
|
+
description: `Rectification matrix (stereo cameras only, 3x3 row-major matrix)
|
|
711
722
|
|
|
712
723
|
A rotation matrix aligning the camera coordinate system to the ideal stereo image plane so that epipolar lines in both stereo images are parallel.`,
|
|
713
724
|
},
|
|
@@ -770,7 +781,7 @@ const CompressedImage: FoxgloveMessageSchema = {
|
|
|
770
781
|
{
|
|
771
782
|
name: "format",
|
|
772
783
|
type: { type: "primitive", name: "string" },
|
|
773
|
-
description: "Image format",
|
|
784
|
+
description: "Image format\n\nSupported values: `webp`, `jpeg`, `png`",
|
|
774
785
|
},
|
|
775
786
|
],
|
|
776
787
|
};
|
|
@@ -805,7 +816,8 @@ const RawImage: FoxgloveMessageSchema = {
|
|
|
805
816
|
{
|
|
806
817
|
name: "encoding",
|
|
807
818
|
type: { type: "primitive", name: "string" },
|
|
808
|
-
description:
|
|
819
|
+
description:
|
|
820
|
+
"Encoding of the raw image data\n\nSupported values: `8UC1`, `8UC3`, `16UC1`, `32FC1`, `bayer_bggr8`, `bayer_gbrg8`, `bayer_grbg8`, `bayer_rggb8`, `bgr8`, `bgra8`, `mono8`, `mono16`, `rgb8`, `rgba8`, `yuv422`",
|
|
809
821
|
},
|
|
810
822
|
{
|
|
811
823
|
name: "step",
|
|
@@ -917,7 +929,7 @@ const NumericType: FoxgloveEnumSchema = {
|
|
|
917
929
|
type: "enum",
|
|
918
930
|
name: "NumericType",
|
|
919
931
|
description: "Numeric type",
|
|
920
|
-
|
|
932
|
+
parentSchemaName: "PackedElementField",
|
|
921
933
|
protobufEnumName: "NumericType",
|
|
922
934
|
values: [
|
|
923
935
|
{ name: "UNKNOWN", value: 0 },
|
|
@@ -1052,7 +1064,7 @@ const PointsAnnotationType: FoxgloveEnumSchema = {
|
|
|
1052
1064
|
type: "enum",
|
|
1053
1065
|
name: "PointsAnnotationType",
|
|
1054
1066
|
description: "Type of points annotation",
|
|
1055
|
-
|
|
1067
|
+
parentSchemaName: "PointsAnnotation",
|
|
1056
1068
|
protobufEnumName: "Type",
|
|
1057
1069
|
values: [
|
|
1058
1070
|
{ name: "UNKNOWN", value: 0 },
|
|
@@ -1133,7 +1145,7 @@ const PositionCovarianceType: FoxgloveEnumSchema = {
|
|
|
1133
1145
|
type: "enum",
|
|
1134
1146
|
name: "PositionCovarianceType",
|
|
1135
1147
|
description: "Type of position covariance",
|
|
1136
|
-
|
|
1148
|
+
parentSchemaName: "LocationFix",
|
|
1137
1149
|
protobufEnumName: "PositionCovarianceType",
|
|
1138
1150
|
values: [
|
|
1139
1151
|
{ name: "UNKNOWN", value: 0 },
|
|
@@ -1183,7 +1195,7 @@ const LogLevel: FoxgloveEnumSchema = {
|
|
|
1183
1195
|
type: "enum",
|
|
1184
1196
|
name: "LogLevel",
|
|
1185
1197
|
description: "Log level",
|
|
1186
|
-
|
|
1198
|
+
parentSchemaName: "Log",
|
|
1187
1199
|
protobufEnumName: "Level",
|
|
1188
1200
|
values: [
|
|
1189
1201
|
{ name: "UNKNOWN", value: 0 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFixtures.d.ts","sourceRoot":"","sources":["testFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAqB,MAAM,SAAS,CAAC;AAYvF,eAAO,MAAM,WAAW,EAAE,kBAUzB,CAAC;AAeF,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"testFixtures.d.ts","sourceRoot":"","sources":["testFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAqB,MAAM,SAAS,CAAC;AAYvF,eAAO,MAAM,WAAW,EAAE,kBAUzB,CAAC;AAeF,eAAO,MAAM,cAAc,EAAE,qBAyD5B,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,qBAK/C,CAAC"}
|
package/internal/testFixtures.js
CHANGED
|
@@ -14,7 +14,7 @@ exports.exampleEnum = {
|
|
|
14
14
|
type: "enum",
|
|
15
15
|
name: "ExampleEnum",
|
|
16
16
|
protobufEnumName: "ExampleProtoEnum",
|
|
17
|
-
|
|
17
|
+
parentSchemaName: "ExampleMessage",
|
|
18
18
|
description: "An example enum",
|
|
19
19
|
values: [
|
|
20
20
|
{ name: "A", value: 1, description: "Value A" },
|
|
@@ -42,6 +42,16 @@ exports.exampleMessage = {
|
|
|
42
42
|
name: `field_${name}`,
|
|
43
43
|
description: `${name} field`,
|
|
44
44
|
type: { type: "primitive", name },
|
|
45
|
+
defaultValue: name === "boolean"
|
|
46
|
+
? true
|
|
47
|
+
: name === "string"
|
|
48
|
+
? "string-type"
|
|
49
|
+
: name === "uint32"
|
|
50
|
+
? 5
|
|
51
|
+
: name === "float64"
|
|
52
|
+
? 1.0
|
|
53
|
+
: // time and duration and bytes
|
|
54
|
+
undefined,
|
|
45
55
|
})),
|
|
46
56
|
...allPrimitives.map((name) => ({
|
|
47
57
|
name: `field_${name}_array`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFixtures.js","sourceRoot":"","sources":["testFixtures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E;YACzC,KAAK,EAAE,IAAI;SACZ;QACD;YACE,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE;SACvD;QACD;YACE,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,wDAAwD;YACrE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE;YACtD,KAAK,EAAE,IAAI;YACX,mBAAmB,EAAE,CAAC;SACvB;KACF;CACF,CAAC;AAEW,QAAA,iCAAiC,GAA0B;IACtE,GAAG,sBAAc;IACjB,MAAM,EAAE,sBAAc,CAAC,MAAM,CAAC,MAAM,CAClC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,mBAAmB,IAAI,IAAI,KAAK,yBAAyB,CACjF;CACF,CAAC"}
|
package/internal/testFixtures.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const exampleEnum: FoxgloveEnumSchema = {
|
|
|
14
14
|
type: "enum",
|
|
15
15
|
name: "ExampleEnum",
|
|
16
16
|
protobufEnumName: "ExampleProtoEnum",
|
|
17
|
-
|
|
17
|
+
parentSchemaName: "ExampleMessage",
|
|
18
18
|
description: "An example enum",
|
|
19
19
|
values: [
|
|
20
20
|
{ name: "A", value: 1, description: "Value A" },
|
|
@@ -44,6 +44,17 @@ export const exampleMessage: FoxgloveMessageSchema = {
|
|
|
44
44
|
name: `field_${name}`,
|
|
45
45
|
description: `${name} field`,
|
|
46
46
|
type: { type: "primitive", name },
|
|
47
|
+
defaultValue:
|
|
48
|
+
name === "boolean"
|
|
49
|
+
? true
|
|
50
|
+
: name === "string"
|
|
51
|
+
? "string-type"
|
|
52
|
+
: name === "uint32"
|
|
53
|
+
? 5
|
|
54
|
+
: name === "float64"
|
|
55
|
+
? 1.0
|
|
56
|
+
: // time and duration and bytes
|
|
57
|
+
undefined,
|
|
47
58
|
})),
|
|
48
59
|
...allPrimitives.map((name): FoxgloveMessageSchema["fields"][0] => ({
|
|
49
60
|
name: `field_${name}_array`,
|
package/internal/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare type FoxgloveEnumSchema = {
|
|
|
3
3
|
type: "enum";
|
|
4
4
|
name: string;
|
|
5
5
|
description: string;
|
|
6
|
-
|
|
6
|
+
parentSchemaName: string;
|
|
7
7
|
protobufEnumName: string;
|
|
8
8
|
values: ReadonlyArray<{
|
|
9
9
|
value: number;
|
|
@@ -27,6 +27,7 @@ export declare type FoxgloveMessageField = {
|
|
|
27
27
|
required?: true;
|
|
28
28
|
description: string;
|
|
29
29
|
protobufFieldNumber?: number;
|
|
30
|
+
defaultValue?: string | number | boolean;
|
|
30
31
|
};
|
|
31
32
|
export declare type FoxgloveMessageSchema = {
|
|
32
33
|
type: "message";
|
package/internal/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB,GACzB,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,MAAM,GACN,UAAU,CAAC;AAEf,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB,GACzB,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,MAAM,GACN,UAAU,CAAC;AAEf,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,aAAa,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;CACJ,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EACA;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,iBAAiB,CAAA;KAAE,GAC9C;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,qBAAqB,CAAA;KAAE,GACjD;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC;IAC/C,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,cAAc,8BAA8B,EAAE,IAAI,CAAC;IACzE,MAAM,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC7C,CAAC;AAEF,oBAAY,cAAc,GAAG,qBAAqB,GAAG,kBAAkB,CAAC"}
|
package/internal/types.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type FoxgloveEnumSchema = {
|
|
|
11
11
|
type: "enum";
|
|
12
12
|
name: string;
|
|
13
13
|
description: string;
|
|
14
|
-
|
|
14
|
+
parentSchemaName: string;
|
|
15
15
|
protobufEnumName: string;
|
|
16
16
|
values: ReadonlyArray<{
|
|
17
17
|
value: number;
|
|
@@ -30,6 +30,7 @@ export type FoxgloveMessageField = {
|
|
|
30
30
|
required?: true;
|
|
31
31
|
description: string;
|
|
32
32
|
protobufFieldNumber?: number;
|
|
33
|
+
defaultValue?: string | number | boolean;
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
export type FoxgloveMessageSchema = {
|
package/package.json
CHANGED
package/python/Makefile
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.PHONY: pipenv
|
|
2
|
+
pipenv:
|
|
3
|
+
SETUPTOOLS_ENABLE_FEATURES="legacy-editable" pipenv install --dev --deploy
|
|
4
|
+
|
|
5
|
+
ifeq ($(shell uname),Darwin)
|
|
6
|
+
SED_ARGS = -i ''
|
|
7
|
+
else
|
|
8
|
+
SED_ARGS = -i
|
|
9
|
+
endif
|
|
10
|
+
|
|
11
|
+
.PHONY: generate-protobuf
|
|
12
|
+
generate-protobuf:
|
|
13
|
+
rm -rf foxglove-schemas-protobuf/foxglove_schemas_protobuf/*_pb2*
|
|
14
|
+
pipenv run protoc \
|
|
15
|
+
--python_out=foxglove-schemas-protobuf/foxglove_schemas_protobuf \
|
|
16
|
+
--mypy_out=foxglove-schemas-protobuf/foxglove_schemas_protobuf \
|
|
17
|
+
--proto_path ../schemas/proto \
|
|
18
|
+
../schemas/proto/foxglove/*.proto
|
|
19
|
+
mv foxglove-schemas-protobuf/foxglove_schemas_protobuf/foxglove/* foxglove-schemas-protobuf/foxglove_schemas_protobuf
|
|
20
|
+
rmdir foxglove-schemas-protobuf/foxglove_schemas_protobuf/foxglove
|
|
21
|
+
sed -E $(SED_ARGS) 's/from foxglove import/from . import/g' foxglove-schemas-protobuf/foxglove_schemas_protobuf/*_pb2.py
|
|
22
|
+
sed -E $(SED_ARGS) 's/import foxglove\.(.+)$$/from . import \1 as foxglove_\1/g' foxglove-schemas-protobuf/foxglove_schemas_protobuf/*_pb2.pyi
|
|
23
|
+
sed -E $(SED_ARGS) 's/foxglove\./foxglove_/g' foxglove-schemas-protobuf/foxglove_schemas_protobuf/*_pb2.pyi
|
|
24
|
+
|
|
25
|
+
.PHONY: build
|
|
26
|
+
build: pipenv generate-protobuf
|
|
27
|
+
pipenv run python -m build foxglove-schemas-protobuf
|
|
28
|
+
|
|
29
|
+
.PHONY: test
|
|
30
|
+
test: pipenv generate-protobuf
|
|
31
|
+
pipenv run python -m pytest foxglove-schemas-protobuf
|
|
32
|
+
|
|
33
|
+
.PHONY: clean
|
|
34
|
+
clean:
|
|
35
|
+
rm -rf dist
|
|
36
|
+
find . -name "build" -type d -exec rm -rf {} +
|
|
37
|
+
find . -name "dist" -type d -exec rm -rf {} +
|
|
38
|
+
find . -name "*.egg-info" -type d -exec rm -rf {} +
|
|
39
|
+
find . -name "*_pb2*" -delete
|
package/python/Pipfile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[[source]]
|
|
2
|
+
url = "https://pypi.org/simple"
|
|
3
|
+
verify_ssl = true
|
|
4
|
+
name = "pypi"
|
|
5
|
+
|
|
6
|
+
[packages]
|
|
7
|
+
protobuf = "*"
|
|
8
|
+
foxglove-schemas-protobuf = {editable = true, path = "./foxglove-schemas-protobuf"}
|
|
9
|
+
|
|
10
|
+
[dev-packages]
|
|
11
|
+
build = "*"
|
|
12
|
+
mypy-protobuf = "*"
|
|
13
|
+
pipenv = "*"
|
|
14
|
+
pytest = "*"
|
|
15
|
+
|
|
16
|
+
[requires]
|
|
17
|
+
python_version = "3"
|