@bufbuild/protobuf 2.0.0-alpha.4 → 2.0.0-beta.2
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/README.md +2 -3
- package/dist/cjs/clone.d.ts +1 -1
- package/dist/cjs/clone.js +5 -16
- package/dist/cjs/codegenv1/embed.js +25 -25
- package/dist/cjs/codegenv1/enum.d.ts +2 -1
- package/dist/cjs/codegenv1/file.js +1 -1
- package/dist/cjs/codegenv1/message.d.ts +2 -1
- package/dist/cjs/codegenv1/scalar.d.ts +4 -0
- package/dist/cjs/codegenv1/scalar.js +30 -1
- package/dist/cjs/codegenv1/symbols.d.ts +10 -0
- package/dist/cjs/codegenv1/symbols.js +2 -0
- package/dist/cjs/codegenv1/types.d.ts +7 -5
- package/dist/cjs/codegenv1/types.js +2 -1
- package/dist/cjs/create.d.ts +1 -1
- package/dist/cjs/create.js +47 -20
- package/dist/cjs/equals.d.ts +1 -1
- package/dist/cjs/equals.js +8 -15
- package/dist/cjs/from-binary.d.ts +2 -2
- package/dist/cjs/from-binary.js +6 -6
- package/dist/cjs/from-json.d.ts +14 -6
- package/dist/cjs/from-json.js +35 -33
- package/dist/cjs/is-message.d.ts +1 -1
- package/dist/cjs/is-message.js +3 -3
- package/dist/cjs/reflect/reflect-types.d.ts +13 -42
- package/dist/cjs/reflect/reflect.d.ts +29 -18
- package/dist/cjs/reflect/reflect.js +169 -45
- package/dist/cjs/reflect/scalar.d.ts +1 -1
- package/dist/cjs/registry.d.ts +18 -2
- package/dist/cjs/registry.js +63 -61
- package/dist/cjs/to-binary.d.ts +1 -1
- package/dist/cjs/to-binary.js +2 -2
- package/dist/cjs/to-json.d.ts +14 -4
- package/dist/cjs/to-json.js +26 -13
- package/dist/cjs/types.d.ts +9 -0
- package/dist/cjs/wire/size-delimited.d.ts +1 -1
- package/dist/cjs/wkt/any.d.ts +7 -7
- package/dist/cjs/wkt/any.js +5 -5
- package/dist/cjs/wkt/gen/google/protobuf/any_pb.d.ts +9 -3
- package/dist/cjs/wkt/gen/google/protobuf/any_pb.js +4 -4
- package/dist/cjs/wkt/gen/google/protobuf/api_pb.d.ts +88 -9
- package/dist/cjs/wkt/gen/google/protobuf/api_pb.js +8 -8
- package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +107 -11
- package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +11 -11
- package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +1005 -92
- package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js +86 -86
- package/dist/cjs/wkt/gen/google/protobuf/duration_pb.d.ts +7 -3
- package/dist/cjs/wkt/gen/google/protobuf/duration_pb.js +4 -4
- package/dist/cjs/wkt/gen/google/protobuf/empty_pb.d.ts +7 -3
- package/dist/cjs/wkt/gen/google/protobuf/empty_pb.js +4 -4
- package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.d.ts +7 -3
- package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.js +4 -4
- package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.d.ts +12 -3
- package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.js +4 -4
- package/dist/cjs/wkt/gen/google/protobuf/struct_pb.d.ts +25 -8
- package/dist/cjs/wkt/gen/google/protobuf/struct_pb.js +9 -9
- package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.d.ts +7 -3
- package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.js +4 -4
- package/dist/cjs/wkt/gen/google/protobuf/type_pb.d.ts +165 -16
- package/dist/cjs/wkt/gen/google/protobuf/type_pb.js +15 -15
- package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +55 -19
- package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.js +20 -20
- package/dist/cjs/wkt/timestamp.js +1 -2
- package/dist/esm/clone.d.ts +1 -1
- package/dist/esm/clone.js +5 -16
- package/dist/esm/codegenv1/embed.js +26 -26
- package/dist/esm/codegenv1/enum.d.ts +2 -1
- package/dist/esm/codegenv1/file.js +2 -2
- package/dist/esm/codegenv1/message.d.ts +2 -1
- package/dist/esm/codegenv1/scalar.d.ts +4 -0
- package/dist/esm/codegenv1/scalar.js +28 -0
- package/dist/esm/codegenv1/symbols.d.ts +10 -0
- package/dist/esm/codegenv1/symbols.js +2 -0
- package/dist/esm/codegenv1/types.d.ts +7 -5
- package/dist/esm/codegenv1/types.js +2 -1
- package/dist/esm/create.d.ts +1 -1
- package/dist/esm/create.js +47 -20
- package/dist/esm/equals.d.ts +1 -1
- package/dist/esm/equals.js +8 -15
- package/dist/esm/from-binary.d.ts +2 -2
- package/dist/esm/from-binary.js +6 -6
- package/dist/esm/from-json.d.ts +14 -6
- package/dist/esm/from-json.js +33 -33
- package/dist/esm/is-message.d.ts +1 -1
- package/dist/esm/is-message.js +3 -3
- package/dist/esm/reflect/reflect-types.d.ts +13 -42
- package/dist/esm/reflect/reflect-types.js +0 -1
- package/dist/esm/reflect/reflect.d.ts +29 -18
- package/dist/esm/reflect/reflect.js +170 -46
- package/dist/esm/reflect/scalar.d.ts +1 -1
- package/dist/esm/registry.d.ts +18 -2
- package/dist/esm/registry.js +61 -60
- package/dist/esm/to-binary.d.ts +1 -1
- package/dist/esm/to-binary.js +2 -2
- package/dist/esm/to-json.d.ts +14 -4
- package/dist/esm/to-json.js +24 -12
- package/dist/esm/types.d.ts +9 -0
- package/dist/esm/wire/size-delimited.d.ts +1 -1
- package/dist/esm/wkt/any.d.ts +7 -7
- package/dist/esm/wkt/any.js +6 -6
- package/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts +9 -3
- package/dist/esm/wkt/gen/google/protobuf/any_pb.js +3 -3
- package/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +88 -9
- package/dist/esm/wkt/gen/google/protobuf/api_pb.js +9 -9
- package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +107 -11
- package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +11 -11
- package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +1005 -92
- package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +84 -84
- package/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts +7 -3
- package/dist/esm/wkt/gen/google/protobuf/duration_pb.js +3 -3
- package/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts +7 -3
- package/dist/esm/wkt/gen/google/protobuf/empty_pb.js +3 -3
- package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts +7 -3
- package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +3 -3
- package/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts +12 -3
- package/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +3 -3
- package/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts +25 -8
- package/dist/esm/wkt/gen/google/protobuf/struct_pb.js +8 -8
- package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts +7 -3
- package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +3 -3
- package/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts +165 -16
- package/dist/esm/wkt/gen/google/protobuf/type_pb.js +16 -16
- package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +55 -19
- package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +19 -19
- package/dist/esm/wkt/timestamp.js +2 -3
- package/package.json +8 -5
|
@@ -3,7 +3,7 @@ import type { Message } from "../../../../types.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Describes the file google/protobuf/wrappers.proto.
|
|
5
5
|
*/
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const file_google_protobuf_wrappers: GenDescFile;
|
|
7
7
|
/**
|
|
8
8
|
* Wrapper message for `double`.
|
|
9
9
|
*
|
|
@@ -19,11 +19,15 @@ export type DoubleValue = Message<"google.protobuf.DoubleValue"> & {
|
|
|
19
19
|
*/
|
|
20
20
|
value: number;
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* JSON type for the message google.protobuf.DoubleValue.
|
|
24
|
+
*/
|
|
25
|
+
export type DoubleValueJson = number | "NaN" | "Infinity" | "-Infinity";
|
|
22
26
|
/**
|
|
23
27
|
* Describes the message google.protobuf.DoubleValue.
|
|
24
|
-
* Use `create(
|
|
28
|
+
* Use `create(DoubleValueSchema)` to create a new message.
|
|
25
29
|
*/
|
|
26
|
-
export declare const
|
|
30
|
+
export declare const DoubleValueSchema: GenDescMessage<DoubleValue, DoubleValueJson>;
|
|
27
31
|
/**
|
|
28
32
|
* Wrapper message for `float`.
|
|
29
33
|
*
|
|
@@ -39,11 +43,15 @@ export type FloatValue = Message<"google.protobuf.FloatValue"> & {
|
|
|
39
43
|
*/
|
|
40
44
|
value: number;
|
|
41
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* JSON type for the message google.protobuf.FloatValue.
|
|
48
|
+
*/
|
|
49
|
+
export type FloatValueJson = number | "NaN" | "Infinity" | "-Infinity";
|
|
42
50
|
/**
|
|
43
51
|
* Describes the message google.protobuf.FloatValue.
|
|
44
|
-
* Use `create(
|
|
52
|
+
* Use `create(FloatValueSchema)` to create a new message.
|
|
45
53
|
*/
|
|
46
|
-
export declare const
|
|
54
|
+
export declare const FloatValueSchema: GenDescMessage<FloatValue, FloatValueJson>;
|
|
47
55
|
/**
|
|
48
56
|
* Wrapper message for `int64`.
|
|
49
57
|
*
|
|
@@ -59,11 +67,15 @@ export type Int64Value = Message<"google.protobuf.Int64Value"> & {
|
|
|
59
67
|
*/
|
|
60
68
|
value: bigint;
|
|
61
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* JSON type for the message google.protobuf.Int64Value.
|
|
72
|
+
*/
|
|
73
|
+
export type Int64ValueJson = string;
|
|
62
74
|
/**
|
|
63
75
|
* Describes the message google.protobuf.Int64Value.
|
|
64
|
-
* Use `create(
|
|
76
|
+
* Use `create(Int64ValueSchema)` to create a new message.
|
|
65
77
|
*/
|
|
66
|
-
export declare const
|
|
78
|
+
export declare const Int64ValueSchema: GenDescMessage<Int64Value, Int64ValueJson>;
|
|
67
79
|
/**
|
|
68
80
|
* Wrapper message for `uint64`.
|
|
69
81
|
*
|
|
@@ -79,11 +91,15 @@ export type UInt64Value = Message<"google.protobuf.UInt64Value"> & {
|
|
|
79
91
|
*/
|
|
80
92
|
value: bigint;
|
|
81
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* JSON type for the message google.protobuf.UInt64Value.
|
|
96
|
+
*/
|
|
97
|
+
export type UInt64ValueJson = string;
|
|
82
98
|
/**
|
|
83
99
|
* Describes the message google.protobuf.UInt64Value.
|
|
84
|
-
* Use `create(
|
|
100
|
+
* Use `create(UInt64ValueSchema)` to create a new message.
|
|
85
101
|
*/
|
|
86
|
-
export declare const
|
|
102
|
+
export declare const UInt64ValueSchema: GenDescMessage<UInt64Value, UInt64ValueJson>;
|
|
87
103
|
/**
|
|
88
104
|
* Wrapper message for `int32`.
|
|
89
105
|
*
|
|
@@ -99,11 +115,15 @@ export type Int32Value = Message<"google.protobuf.Int32Value"> & {
|
|
|
99
115
|
*/
|
|
100
116
|
value: number;
|
|
101
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* JSON type for the message google.protobuf.Int32Value.
|
|
120
|
+
*/
|
|
121
|
+
export type Int32ValueJson = number;
|
|
102
122
|
/**
|
|
103
123
|
* Describes the message google.protobuf.Int32Value.
|
|
104
|
-
* Use `create(
|
|
124
|
+
* Use `create(Int32ValueSchema)` to create a new message.
|
|
105
125
|
*/
|
|
106
|
-
export declare const
|
|
126
|
+
export declare const Int32ValueSchema: GenDescMessage<Int32Value, Int32ValueJson>;
|
|
107
127
|
/**
|
|
108
128
|
* Wrapper message for `uint32`.
|
|
109
129
|
*
|
|
@@ -119,11 +139,15 @@ export type UInt32Value = Message<"google.protobuf.UInt32Value"> & {
|
|
|
119
139
|
*/
|
|
120
140
|
value: number;
|
|
121
141
|
};
|
|
142
|
+
/**
|
|
143
|
+
* JSON type for the message google.protobuf.UInt32Value.
|
|
144
|
+
*/
|
|
145
|
+
export type UInt32ValueJson = number;
|
|
122
146
|
/**
|
|
123
147
|
* Describes the message google.protobuf.UInt32Value.
|
|
124
|
-
* Use `create(
|
|
148
|
+
* Use `create(UInt32ValueSchema)` to create a new message.
|
|
125
149
|
*/
|
|
126
|
-
export declare const
|
|
150
|
+
export declare const UInt32ValueSchema: GenDescMessage<UInt32Value, UInt32ValueJson>;
|
|
127
151
|
/**
|
|
128
152
|
* Wrapper message for `bool`.
|
|
129
153
|
*
|
|
@@ -139,11 +163,15 @@ export type BoolValue = Message<"google.protobuf.BoolValue"> & {
|
|
|
139
163
|
*/
|
|
140
164
|
value: boolean;
|
|
141
165
|
};
|
|
166
|
+
/**
|
|
167
|
+
* JSON type for the message google.protobuf.BoolValue.
|
|
168
|
+
*/
|
|
169
|
+
export type BoolValueJson = boolean;
|
|
142
170
|
/**
|
|
143
171
|
* Describes the message google.protobuf.BoolValue.
|
|
144
|
-
* Use `create(
|
|
172
|
+
* Use `create(BoolValueSchema)` to create a new message.
|
|
145
173
|
*/
|
|
146
|
-
export declare const
|
|
174
|
+
export declare const BoolValueSchema: GenDescMessage<BoolValue, BoolValueJson>;
|
|
147
175
|
/**
|
|
148
176
|
* Wrapper message for `string`.
|
|
149
177
|
*
|
|
@@ -159,11 +187,15 @@ export type StringValue = Message<"google.protobuf.StringValue"> & {
|
|
|
159
187
|
*/
|
|
160
188
|
value: string;
|
|
161
189
|
};
|
|
190
|
+
/**
|
|
191
|
+
* JSON type for the message google.protobuf.StringValue.
|
|
192
|
+
*/
|
|
193
|
+
export type StringValueJson = string;
|
|
162
194
|
/**
|
|
163
195
|
* Describes the message google.protobuf.StringValue.
|
|
164
|
-
* Use `create(
|
|
196
|
+
* Use `create(StringValueSchema)` to create a new message.
|
|
165
197
|
*/
|
|
166
|
-
export declare const
|
|
198
|
+
export declare const StringValueSchema: GenDescMessage<StringValue, StringValueJson>;
|
|
167
199
|
/**
|
|
168
200
|
* Wrapper message for `bytes`.
|
|
169
201
|
*
|
|
@@ -179,8 +211,12 @@ export type BytesValue = Message<"google.protobuf.BytesValue"> & {
|
|
|
179
211
|
*/
|
|
180
212
|
value: Uint8Array;
|
|
181
213
|
};
|
|
214
|
+
/**
|
|
215
|
+
* JSON type for the message google.protobuf.BytesValue.
|
|
216
|
+
*/
|
|
217
|
+
export type BytesValueJson = string;
|
|
182
218
|
/**
|
|
183
219
|
* Describes the message google.protobuf.BytesValue.
|
|
184
|
-
* Use `create(
|
|
220
|
+
* Use `create(BytesValueSchema)` to create a new message.
|
|
185
221
|
*/
|
|
186
|
-
export declare const
|
|
222
|
+
export declare const BytesValueSchema: GenDescMessage<BytesValue, BytesValueJson>;
|
|
@@ -16,49 +16,49 @@ import { messageDesc } from "../../../../codegenv1/message.js";
|
|
|
16
16
|
/**
|
|
17
17
|
* Describes the file google/protobuf/wrappers.proto.
|
|
18
18
|
*/
|
|
19
|
-
export const
|
|
19
|
+
export const file_google_protobuf_wrappers = /*@__PURE__*/ fileDesc("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM");
|
|
20
20
|
/**
|
|
21
21
|
* Describes the message google.protobuf.DoubleValue.
|
|
22
|
-
* Use `create(
|
|
22
|
+
* Use `create(DoubleValueSchema)` to create a new message.
|
|
23
23
|
*/
|
|
24
|
-
export const
|
|
24
|
+
export const DoubleValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 0);
|
|
25
25
|
/**
|
|
26
26
|
* Describes the message google.protobuf.FloatValue.
|
|
27
|
-
* Use `create(
|
|
27
|
+
* Use `create(FloatValueSchema)` to create a new message.
|
|
28
28
|
*/
|
|
29
|
-
export const
|
|
29
|
+
export const FloatValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 1);
|
|
30
30
|
/**
|
|
31
31
|
* Describes the message google.protobuf.Int64Value.
|
|
32
|
-
* Use `create(
|
|
32
|
+
* Use `create(Int64ValueSchema)` to create a new message.
|
|
33
33
|
*/
|
|
34
|
-
export const
|
|
34
|
+
export const Int64ValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 2);
|
|
35
35
|
/**
|
|
36
36
|
* Describes the message google.protobuf.UInt64Value.
|
|
37
|
-
* Use `create(
|
|
37
|
+
* Use `create(UInt64ValueSchema)` to create a new message.
|
|
38
38
|
*/
|
|
39
|
-
export const
|
|
39
|
+
export const UInt64ValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 3);
|
|
40
40
|
/**
|
|
41
41
|
* Describes the message google.protobuf.Int32Value.
|
|
42
|
-
* Use `create(
|
|
42
|
+
* Use `create(Int32ValueSchema)` to create a new message.
|
|
43
43
|
*/
|
|
44
|
-
export const
|
|
44
|
+
export const Int32ValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 4);
|
|
45
45
|
/**
|
|
46
46
|
* Describes the message google.protobuf.UInt32Value.
|
|
47
|
-
* Use `create(
|
|
47
|
+
* Use `create(UInt32ValueSchema)` to create a new message.
|
|
48
48
|
*/
|
|
49
|
-
export const
|
|
49
|
+
export const UInt32ValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 5);
|
|
50
50
|
/**
|
|
51
51
|
* Describes the message google.protobuf.BoolValue.
|
|
52
|
-
* Use `create(
|
|
52
|
+
* Use `create(BoolValueSchema)` to create a new message.
|
|
53
53
|
*/
|
|
54
|
-
export const
|
|
54
|
+
export const BoolValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 6);
|
|
55
55
|
/**
|
|
56
56
|
* Describes the message google.protobuf.StringValue.
|
|
57
|
-
* Use `create(
|
|
57
|
+
* Use `create(StringValueSchema)` to create a new message.
|
|
58
58
|
*/
|
|
59
|
-
export const
|
|
59
|
+
export const StringValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 7);
|
|
60
60
|
/**
|
|
61
61
|
* Describes the message google.protobuf.BytesValue.
|
|
62
|
-
* Use `create(
|
|
62
|
+
* Use `create(BytesValueSchema)` to create a new message.
|
|
63
63
|
*/
|
|
64
|
-
export const
|
|
64
|
+
export const BytesValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 8);
|
|
@@ -11,14 +11,13 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import {
|
|
14
|
+
import { TimestampSchema } from "./gen/google/protobuf/timestamp_pb.js";
|
|
15
15
|
import { create } from "../create.js";
|
|
16
16
|
import { protoInt64 } from "../proto-int64.js";
|
|
17
17
|
/**
|
|
18
18
|
* Create a google.protobuf.Timestamp for the current time.
|
|
19
19
|
*/
|
|
20
20
|
export function timestampNow() {
|
|
21
|
-
Date.now();
|
|
22
21
|
return timestampFromDate(new Date());
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
@@ -37,7 +36,7 @@ export function timestampDate(timestamp) {
|
|
|
37
36
|
* Create a google.protobuf.Timestamp message from a Unix timestamp in milliseconds.
|
|
38
37
|
*/
|
|
39
38
|
export function timestampFromMs(timestampMs) {
|
|
40
|
-
return create(
|
|
39
|
+
return create(TimestampSchema, {
|
|
41
40
|
seconds: protoInt64.parse(Math.floor(timestampMs / 1000)),
|
|
42
41
|
nanos: (timestampMs % 1000) * 1000000,
|
|
43
42
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bufbuild/protobuf",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"license": "(Apache-2.0 AND BSD-3-Clause)",
|
|
5
5
|
"description": "A complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.",
|
|
6
6
|
"repository": {
|
|
@@ -9,14 +9,17 @@
|
|
|
9
9
|
"directory": "packages/protobuf"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
-
"
|
|
12
|
+
"prebuild": "rm -rf ./dist/*",
|
|
13
13
|
"build": "npm run build:cjs && npm run build:esm",
|
|
14
|
-
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs
|
|
15
|
-
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist/esm
|
|
14
|
+
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
|
|
15
|
+
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist/esm",
|
|
16
16
|
"bootstrap:inject": "node scripts/bootstrap-inject.mjs src",
|
|
17
17
|
"prebootstrap:wkt": "rm -rf .tmp && mkdir -p .tmp && cp -rp src/wkt/gen/* .tmp",
|
|
18
|
-
"bootstrap:wkt": "protoc --es_out=src/wkt/gen --es_opt=bootstrap_wkt=true,target=ts,import_extension=.js --proto_path $(upstream-include wkt) $(upstream-files wkt) && license-header src/wkt/gen",
|
|
18
|
+
"bootstrap:wkt": "protoc --es_out=src/wkt/gen --es_opt=bootstrap_wkt=true,target=ts,import_extension=.js,json_types=true --proto_path $(upstream-include wkt) $(upstream-files wkt) && license-header src/wkt/gen",
|
|
19
19
|
"postbootstrap:wkt": "diff >/dev/null -r .tmp src/wkt/gen && cp -rp .tmp/* src/wkt/gen || true",
|
|
20
|
+
"format": "prettier --write --ignore-unknown '.' '!dist' '!src/wkt/gen'",
|
|
21
|
+
"license-header": "license-header --ignore 'src/wire/varint.ts'",
|
|
22
|
+
"lint": "eslint --max-warnings 0 .",
|
|
20
23
|
"attw": "attw --pack"
|
|
21
24
|
},
|
|
22
25
|
"type": "module",
|