@bufbuild/protobuf 1.3.1 → 1.3.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.
Files changed (117) hide show
  1. package/dist/cjs/google/protobuf/struct_pb.js +1 -1
  2. package/dist/cjs/google/protobuf/type_pb.js +1 -1
  3. package/dist/esm/binary-encoding.d.ts +421 -0
  4. package/dist/esm/binary-format.d.ts +87 -0
  5. package/dist/esm/codegen-info.d.ts +23 -0
  6. package/dist/esm/create-descriptor-set.d.ts +16 -0
  7. package/dist/esm/create-registry-from-desc.d.ts +15 -0
  8. package/dist/esm/create-registry.d.ts +8 -0
  9. package/dist/esm/descriptor-set.d.ts +606 -0
  10. package/dist/esm/enum.d.ts +35 -0
  11. package/dist/esm/field-list.d.ts +27 -0
  12. package/dist/esm/field.d.ts +255 -0
  13. package/dist/esm/google/protobuf/any_pb.d.ts +156 -0
  14. package/dist/esm/google/protobuf/api_pb.d.ts +256 -0
  15. package/dist/esm/google/protobuf/compiler/plugin_pb.d.ts +236 -0
  16. package/dist/esm/google/protobuf/descriptor_pb.d.ts +1851 -0
  17. package/dist/esm/google/protobuf/duration_pb.d.ts +100 -0
  18. package/dist/esm/google/protobuf/empty_pb.d.ts +28 -0
  19. package/dist/esm/google/protobuf/field_mask_pb.d.ts +227 -0
  20. package/dist/esm/google/protobuf/source_context_pb.d.ts +29 -0
  21. package/dist/esm/google/protobuf/struct_pb.d.ts +158 -0
  22. package/dist/esm/google/protobuf/struct_pb.js +1 -1
  23. package/dist/esm/google/protobuf/timestamp_pb.d.ts +132 -0
  24. package/dist/esm/google/protobuf/type_pb.d.ts +437 -0
  25. package/dist/esm/google/protobuf/type_pb.js +1 -1
  26. package/dist/esm/google/protobuf/wrappers_pb.d.ts +267 -0
  27. package/dist/esm/google/varint.d.ts +70 -0
  28. package/dist/esm/index.d.ts +38 -0
  29. package/dist/esm/json-format.d.ts +110 -0
  30. package/dist/esm/message-type.d.ts +51 -0
  31. package/dist/esm/message.d.ts +130 -0
  32. package/dist/esm/private/assert.d.ts +16 -0
  33. package/dist/esm/private/binary-format-common.d.ts +13 -0
  34. package/dist/esm/private/binary-format-proto2.d.ts +2 -0
  35. package/dist/esm/private/binary-format-proto3.d.ts +2 -0
  36. package/dist/esm/private/enum.d.ts +27 -0
  37. package/dist/esm/private/field-list.d.ts +18 -0
  38. package/dist/esm/private/field-wrapper.d.ts +25 -0
  39. package/dist/esm/private/field.d.ts +15 -0
  40. package/dist/esm/private/json-format-common.d.ts +9 -0
  41. package/dist/esm/private/json-format-proto2.d.ts +2 -0
  42. package/dist/esm/private/json-format-proto3.d.ts +2 -0
  43. package/dist/esm/private/message-type.d.ts +18 -0
  44. package/dist/esm/private/names.d.ts +43 -0
  45. package/dist/esm/private/options-map.d.ts +7 -0
  46. package/dist/esm/private/proto-runtime.d.ts +47 -0
  47. package/dist/esm/private/reify-wkt.d.ts +100 -0
  48. package/dist/esm/private/scalars.d.ts +27 -0
  49. package/dist/esm/private/util-common.d.ts +2 -0
  50. package/dist/esm/private/util.d.ts +38 -0
  51. package/dist/esm/proto-base64.d.ts +18 -0
  52. package/dist/esm/proto-delimited.d.ts +54 -0
  53. package/dist/esm/proto-double.d.ts +5 -0
  54. package/dist/esm/proto-int64.d.ts +95 -0
  55. package/dist/esm/proto2.d.ts +4 -0
  56. package/dist/esm/proto3.d.ts +4 -0
  57. package/dist/esm/service-type.d.ts +96 -0
  58. package/dist/esm/to-plain-message.d.ts +9 -0
  59. package/dist/esm/type-registry.d.ts +30 -0
  60. package/dist/proxy/index.d.ts +1 -0
  61. package/dist/proxy/index.js +1 -0
  62. package/package.json +14 -11
  63. /package/dist/{types → cjs}/binary-encoding.d.ts +0 -0
  64. /package/dist/{types → cjs}/binary-format.d.ts +0 -0
  65. /package/dist/{types → cjs}/codegen-info.d.ts +0 -0
  66. /package/dist/{types → cjs}/create-descriptor-set.d.ts +0 -0
  67. /package/dist/{types → cjs}/create-registry-from-desc.d.ts +0 -0
  68. /package/dist/{types → cjs}/create-registry.d.ts +0 -0
  69. /package/dist/{types → cjs}/descriptor-set.d.ts +0 -0
  70. /package/dist/{types → cjs}/enum.d.ts +0 -0
  71. /package/dist/{types → cjs}/field-list.d.ts +0 -0
  72. /package/dist/{types → cjs}/field.d.ts +0 -0
  73. /package/dist/{types → cjs}/google/protobuf/any_pb.d.ts +0 -0
  74. /package/dist/{types → cjs}/google/protobuf/api_pb.d.ts +0 -0
  75. /package/dist/{types → cjs}/google/protobuf/compiler/plugin_pb.d.ts +0 -0
  76. /package/dist/{types → cjs}/google/protobuf/descriptor_pb.d.ts +0 -0
  77. /package/dist/{types → cjs}/google/protobuf/duration_pb.d.ts +0 -0
  78. /package/dist/{types → cjs}/google/protobuf/empty_pb.d.ts +0 -0
  79. /package/dist/{types → cjs}/google/protobuf/field_mask_pb.d.ts +0 -0
  80. /package/dist/{types → cjs}/google/protobuf/source_context_pb.d.ts +0 -0
  81. /package/dist/{types → cjs}/google/protobuf/struct_pb.d.ts +0 -0
  82. /package/dist/{types → cjs}/google/protobuf/timestamp_pb.d.ts +0 -0
  83. /package/dist/{types → cjs}/google/protobuf/type_pb.d.ts +0 -0
  84. /package/dist/{types → cjs}/google/protobuf/wrappers_pb.d.ts +0 -0
  85. /package/dist/{types → cjs}/google/varint.d.ts +0 -0
  86. /package/dist/{types → cjs}/index.d.ts +0 -0
  87. /package/dist/{types → cjs}/json-format.d.ts +0 -0
  88. /package/dist/{types → cjs}/message-type.d.ts +0 -0
  89. /package/dist/{types → cjs}/message.d.ts +0 -0
  90. /package/dist/{types → cjs}/private/assert.d.ts +0 -0
  91. /package/dist/{types → cjs}/private/binary-format-common.d.ts +0 -0
  92. /package/dist/{types → cjs}/private/binary-format-proto2.d.ts +0 -0
  93. /package/dist/{types → cjs}/private/binary-format-proto3.d.ts +0 -0
  94. /package/dist/{types → cjs}/private/enum.d.ts +0 -0
  95. /package/dist/{types → cjs}/private/field-list.d.ts +0 -0
  96. /package/dist/{types → cjs}/private/field-wrapper.d.ts +0 -0
  97. /package/dist/{types → cjs}/private/field.d.ts +0 -0
  98. /package/dist/{types → cjs}/private/json-format-common.d.ts +0 -0
  99. /package/dist/{types → cjs}/private/json-format-proto2.d.ts +0 -0
  100. /package/dist/{types → cjs}/private/json-format-proto3.d.ts +0 -0
  101. /package/dist/{types → cjs}/private/message-type.d.ts +0 -0
  102. /package/dist/{types → cjs}/private/names.d.ts +0 -0
  103. /package/dist/{types → cjs}/private/options-map.d.ts +0 -0
  104. /package/dist/{types → cjs}/private/proto-runtime.d.ts +0 -0
  105. /package/dist/{types → cjs}/private/reify-wkt.d.ts +0 -0
  106. /package/dist/{types → cjs}/private/scalars.d.ts +0 -0
  107. /package/dist/{types → cjs}/private/util-common.d.ts +0 -0
  108. /package/dist/{types → cjs}/private/util.d.ts +0 -0
  109. /package/dist/{types → cjs}/proto-base64.d.ts +0 -0
  110. /package/dist/{types → cjs}/proto-delimited.d.ts +0 -0
  111. /package/dist/{types → cjs}/proto-double.d.ts +0 -0
  112. /package/dist/{types → cjs}/proto-int64.d.ts +0 -0
  113. /package/dist/{types → cjs}/proto2.d.ts +0 -0
  114. /package/dist/{types → cjs}/proto3.d.ts +0 -0
  115. /package/dist/{types → cjs}/service-type.d.ts +0 -0
  116. /package/dist/{types → cjs}/to-plain-message.d.ts +0 -0
  117. /package/dist/{types → cjs}/type-registry.d.ts +0 -0
@@ -0,0 +1,100 @@
1
+ import type { PartialMessage, PlainMessage } from "../../message.js";
2
+ import { Message } from "../../message.js";
3
+ import { proto3 } from "../../proto3.js";
4
+ import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js";
5
+ import type { FieldList } from "../../field-list.js";
6
+ import type { BinaryReadOptions } from "../../binary-format.js";
7
+ /**
8
+ * A Duration represents a signed, fixed-length span of time represented
9
+ * as a count of seconds and fractions of seconds at nanosecond
10
+ * resolution. It is independent of any calendar and concepts like "day"
11
+ * or "month". It is related to Timestamp in that the difference between
12
+ * two Timestamp values is a Duration and it can be added or subtracted
13
+ * from a Timestamp. Range is approximately +-10,000 years.
14
+ *
15
+ * # Examples
16
+ *
17
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
18
+ *
19
+ * Timestamp start = ...;
20
+ * Timestamp end = ...;
21
+ * Duration duration = ...;
22
+ *
23
+ * duration.seconds = end.seconds - start.seconds;
24
+ * duration.nanos = end.nanos - start.nanos;
25
+ *
26
+ * if (duration.seconds < 0 && duration.nanos > 0) {
27
+ * duration.seconds += 1;
28
+ * duration.nanos -= 1000000000;
29
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
30
+ * duration.seconds -= 1;
31
+ * duration.nanos += 1000000000;
32
+ * }
33
+ *
34
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
35
+ *
36
+ * Timestamp start = ...;
37
+ * Duration duration = ...;
38
+ * Timestamp end = ...;
39
+ *
40
+ * end.seconds = start.seconds + duration.seconds;
41
+ * end.nanos = start.nanos + duration.nanos;
42
+ *
43
+ * if (end.nanos < 0) {
44
+ * end.seconds -= 1;
45
+ * end.nanos += 1000000000;
46
+ * } else if (end.nanos >= 1000000000) {
47
+ * end.seconds += 1;
48
+ * end.nanos -= 1000000000;
49
+ * }
50
+ *
51
+ * Example 3: Compute Duration from datetime.timedelta in Python.
52
+ *
53
+ * td = datetime.timedelta(days=3, minutes=10)
54
+ * duration = Duration()
55
+ * duration.FromTimedelta(td)
56
+ *
57
+ * # JSON Mapping
58
+ *
59
+ * In JSON format, the Duration type is encoded as a string rather than an
60
+ * object, where the string ends in the suffix "s" (indicating seconds) and
61
+ * is preceded by the number of seconds, with nanoseconds expressed as
62
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
63
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
64
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
65
+ * microsecond should be expressed in JSON format as "3.000001s".
66
+ *
67
+ *
68
+ * @generated from message google.protobuf.Duration
69
+ */
70
+ export declare class Duration extends Message<Duration> {
71
+ /**
72
+ * Signed seconds of the span of time. Must be from -315,576,000,000
73
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
74
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
75
+ *
76
+ * @generated from field: int64 seconds = 1;
77
+ */
78
+ seconds: bigint;
79
+ /**
80
+ * Signed fractions of a second at nanosecond resolution of the span
81
+ * of time. Durations less than one second are represented with a 0
82
+ * `seconds` field and a positive or negative `nanos` field. For durations
83
+ * of one second or more, a non-zero value for the `nanos` field must be
84
+ * of the same sign as the `seconds` field. Must be from -999,999,999
85
+ * to +999,999,999 inclusive.
86
+ *
87
+ * @generated from field: int32 nanos = 2;
88
+ */
89
+ nanos: number;
90
+ constructor(data?: PartialMessage<Duration>);
91
+ fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
92
+ toJson(options?: Partial<JsonWriteOptions>): JsonValue;
93
+ static readonly runtime: typeof proto3;
94
+ static readonly typeName = "google.protobuf.Duration";
95
+ static readonly fields: FieldList;
96
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Duration;
97
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Duration;
98
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Duration;
99
+ static equals(a: Duration | PlainMessage<Duration> | undefined, b: Duration | PlainMessage<Duration> | undefined): boolean;
100
+ }
@@ -0,0 +1,28 @@
1
+ import type { PartialMessage, PlainMessage } from "../../message.js";
2
+ import { Message } from "../../message.js";
3
+ import { proto3 } from "../../proto3.js";
4
+ import type { FieldList } from "../../field-list.js";
5
+ import type { BinaryReadOptions } from "../../binary-format.js";
6
+ import type { JsonReadOptions, JsonValue } from "../../json-format.js";
7
+ /**
8
+ * A generic empty message that you can re-use to avoid defining duplicated
9
+ * empty messages in your APIs. A typical example is to use it as the request
10
+ * or the response type of an API method. For instance:
11
+ *
12
+ * service Foo {
13
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
14
+ * }
15
+ *
16
+ *
17
+ * @generated from message google.protobuf.Empty
18
+ */
19
+ export declare class Empty extends Message<Empty> {
20
+ constructor(data?: PartialMessage<Empty>);
21
+ static readonly runtime: typeof proto3;
22
+ static readonly typeName = "google.protobuf.Empty";
23
+ static readonly fields: FieldList;
24
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Empty;
25
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Empty;
26
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Empty;
27
+ static equals(a: Empty | PlainMessage<Empty> | undefined, b: Empty | PlainMessage<Empty> | undefined): boolean;
28
+ }
@@ -0,0 +1,227 @@
1
+ import type { PartialMessage, PlainMessage } from "../../message.js";
2
+ import { Message } from "../../message.js";
3
+ import { proto3 } from "../../proto3.js";
4
+ import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js";
5
+ import type { FieldList } from "../../field-list.js";
6
+ import type { BinaryReadOptions } from "../../binary-format.js";
7
+ /**
8
+ * `FieldMask` represents a set of symbolic field paths, for example:
9
+ *
10
+ * paths: "f.a"
11
+ * paths: "f.b.d"
12
+ *
13
+ * Here `f` represents a field in some root message, `a` and `b`
14
+ * fields in the message found in `f`, and `d` a field found in the
15
+ * message in `f.b`.
16
+ *
17
+ * Field masks are used to specify a subset of fields that should be
18
+ * returned by a get operation or modified by an update operation.
19
+ * Field masks also have a custom JSON encoding (see below).
20
+ *
21
+ * # Field Masks in Projections
22
+ *
23
+ * When used in the context of a projection, a response message or
24
+ * sub-message is filtered by the API to only contain those fields as
25
+ * specified in the mask. For example, if the mask in the previous
26
+ * example is applied to a response message as follows:
27
+ *
28
+ * f {
29
+ * a : 22
30
+ * b {
31
+ * d : 1
32
+ * x : 2
33
+ * }
34
+ * y : 13
35
+ * }
36
+ * z: 8
37
+ *
38
+ * The result will not contain specific values for fields x,y and z
39
+ * (their value will be set to the default, and omitted in proto text
40
+ * output):
41
+ *
42
+ *
43
+ * f {
44
+ * a : 22
45
+ * b {
46
+ * d : 1
47
+ * }
48
+ * }
49
+ *
50
+ * A repeated field is not allowed except at the last position of a
51
+ * paths string.
52
+ *
53
+ * If a FieldMask object is not present in a get operation, the
54
+ * operation applies to all fields (as if a FieldMask of all fields
55
+ * had been specified).
56
+ *
57
+ * Note that a field mask does not necessarily apply to the
58
+ * top-level response message. In case of a REST get operation, the
59
+ * field mask applies directly to the response, but in case of a REST
60
+ * list operation, the mask instead applies to each individual message
61
+ * in the returned resource list. In case of a REST custom method,
62
+ * other definitions may be used. Where the mask applies will be
63
+ * clearly documented together with its declaration in the API. In
64
+ * any case, the effect on the returned resource/resources is required
65
+ * behavior for APIs.
66
+ *
67
+ * # Field Masks in Update Operations
68
+ *
69
+ * A field mask in update operations specifies which fields of the
70
+ * targeted resource are going to be updated. The API is required
71
+ * to only change the values of the fields as specified in the mask
72
+ * and leave the others untouched. If a resource is passed in to
73
+ * describe the updated values, the API ignores the values of all
74
+ * fields not covered by the mask.
75
+ *
76
+ * If a repeated field is specified for an update operation, new values will
77
+ * be appended to the existing repeated field in the target resource. Note that
78
+ * a repeated field is only allowed in the last position of a `paths` string.
79
+ *
80
+ * If a sub-message is specified in the last position of the field mask for an
81
+ * update operation, then new value will be merged into the existing sub-message
82
+ * in the target resource.
83
+ *
84
+ * For example, given the target message:
85
+ *
86
+ * f {
87
+ * b {
88
+ * d: 1
89
+ * x: 2
90
+ * }
91
+ * c: [1]
92
+ * }
93
+ *
94
+ * And an update message:
95
+ *
96
+ * f {
97
+ * b {
98
+ * d: 10
99
+ * }
100
+ * c: [2]
101
+ * }
102
+ *
103
+ * then if the field mask is:
104
+ *
105
+ * paths: ["f.b", "f.c"]
106
+ *
107
+ * then the result will be:
108
+ *
109
+ * f {
110
+ * b {
111
+ * d: 10
112
+ * x: 2
113
+ * }
114
+ * c: [1, 2]
115
+ * }
116
+ *
117
+ * An implementation may provide options to override this default behavior for
118
+ * repeated and message fields.
119
+ *
120
+ * In order to reset a field's value to the default, the field must
121
+ * be in the mask and set to the default value in the provided resource.
122
+ * Hence, in order to reset all fields of a resource, provide a default
123
+ * instance of the resource and set all fields in the mask, or do
124
+ * not provide a mask as described below.
125
+ *
126
+ * If a field mask is not present on update, the operation applies to
127
+ * all fields (as if a field mask of all fields has been specified).
128
+ * Note that in the presence of schema evolution, this may mean that
129
+ * fields the client does not know and has therefore not filled into
130
+ * the request will be reset to their default. If this is unwanted
131
+ * behavior, a specific service may require a client to always specify
132
+ * a field mask, producing an error if not.
133
+ *
134
+ * As with get operations, the location of the resource which
135
+ * describes the updated values in the request message depends on the
136
+ * operation kind. In any case, the effect of the field mask is
137
+ * required to be honored by the API.
138
+ *
139
+ * ## Considerations for HTTP REST
140
+ *
141
+ * The HTTP kind of an update operation which uses a field mask must
142
+ * be set to PATCH instead of PUT in order to satisfy HTTP semantics
143
+ * (PUT must only be used for full updates).
144
+ *
145
+ * # JSON Encoding of Field Masks
146
+ *
147
+ * In JSON, a field mask is encoded as a single string where paths are
148
+ * separated by a comma. Fields name in each path are converted
149
+ * to/from lower-camel naming conventions.
150
+ *
151
+ * As an example, consider the following message declarations:
152
+ *
153
+ * message Profile {
154
+ * User user = 1;
155
+ * Photo photo = 2;
156
+ * }
157
+ * message User {
158
+ * string display_name = 1;
159
+ * string address = 2;
160
+ * }
161
+ *
162
+ * In proto a field mask for `Profile` may look as such:
163
+ *
164
+ * mask {
165
+ * paths: "user.display_name"
166
+ * paths: "photo"
167
+ * }
168
+ *
169
+ * In JSON, the same mask is represented as below:
170
+ *
171
+ * {
172
+ * mask: "user.displayName,photo"
173
+ * }
174
+ *
175
+ * # Field Masks and Oneof Fields
176
+ *
177
+ * Field masks treat fields in oneofs just as regular fields. Consider the
178
+ * following message:
179
+ *
180
+ * message SampleMessage {
181
+ * oneof test_oneof {
182
+ * string name = 4;
183
+ * SubMessage sub_message = 9;
184
+ * }
185
+ * }
186
+ *
187
+ * The field mask can be:
188
+ *
189
+ * mask {
190
+ * paths: "name"
191
+ * }
192
+ *
193
+ * Or:
194
+ *
195
+ * mask {
196
+ * paths: "sub_message"
197
+ * }
198
+ *
199
+ * Note that oneof type names ("test_oneof" in this case) cannot be used in
200
+ * paths.
201
+ *
202
+ * ## Field Mask Verification
203
+ *
204
+ * The implementation of any API method which has a FieldMask type field in the
205
+ * request should verify the included field paths, and return an
206
+ * `INVALID_ARGUMENT` error if any path is unmappable.
207
+ *
208
+ * @generated from message google.protobuf.FieldMask
209
+ */
210
+ export declare class FieldMask extends Message<FieldMask> {
211
+ /**
212
+ * The set of field mask paths.
213
+ *
214
+ * @generated from field: repeated string paths = 1;
215
+ */
216
+ paths: string[];
217
+ constructor(data?: PartialMessage<FieldMask>);
218
+ toJson(options?: Partial<JsonWriteOptions>): JsonValue;
219
+ fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
220
+ static readonly runtime: typeof proto3;
221
+ static readonly typeName = "google.protobuf.FieldMask";
222
+ static readonly fields: FieldList;
223
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FieldMask;
224
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): FieldMask;
225
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): FieldMask;
226
+ static equals(a: FieldMask | PlainMessage<FieldMask> | undefined, b: FieldMask | PlainMessage<FieldMask> | undefined): boolean;
227
+ }
@@ -0,0 +1,29 @@
1
+ import type { PartialMessage, PlainMessage } from "../../message.js";
2
+ import { Message } from "../../message.js";
3
+ import { proto3 } from "../../proto3.js";
4
+ import type { FieldList } from "../../field-list.js";
5
+ import type { BinaryReadOptions } from "../../binary-format.js";
6
+ import type { JsonReadOptions, JsonValue } from "../../json-format.js";
7
+ /**
8
+ * `SourceContext` represents information about the source of a
9
+ * protobuf element, like the file in which it is defined.
10
+ *
11
+ * @generated from message google.protobuf.SourceContext
12
+ */
13
+ export declare class SourceContext extends Message<SourceContext> {
14
+ /**
15
+ * The path-qualified name of the .proto file that contained the associated
16
+ * protobuf element. For example: `"google/protobuf/source_context.proto"`.
17
+ *
18
+ * @generated from field: string file_name = 1;
19
+ */
20
+ fileName: string;
21
+ constructor(data?: PartialMessage<SourceContext>);
22
+ static readonly runtime: typeof proto3;
23
+ static readonly typeName = "google.protobuf.SourceContext";
24
+ static readonly fields: FieldList;
25
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SourceContext;
26
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SourceContext;
27
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SourceContext;
28
+ static equals(a: SourceContext | PlainMessage<SourceContext> | undefined, b: SourceContext | PlainMessage<SourceContext> | undefined): boolean;
29
+ }
@@ -0,0 +1,158 @@
1
+ import { proto3 } from "../../proto3.js";
2
+ import type { PartialMessage, PlainMessage } from "../../message.js";
3
+ import { Message } from "../../message.js";
4
+ import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js";
5
+ import type { FieldList } from "../../field-list.js";
6
+ import type { BinaryReadOptions } from "../../binary-format.js";
7
+ /**
8
+ * `NullValue` is a singleton enumeration to represent the null value for the
9
+ * `Value` type union.
10
+ *
11
+ * The JSON representation for `NullValue` is JSON `null`.
12
+ *
13
+ * @generated from enum google.protobuf.NullValue
14
+ */
15
+ export declare enum NullValue {
16
+ /**
17
+ * Null value.
18
+ *
19
+ * @generated from enum value: NULL_VALUE = 0;
20
+ */
21
+ NULL_VALUE = 0
22
+ }
23
+ /**
24
+ * `Struct` represents a structured data value, consisting of fields
25
+ * which map to dynamically typed values. In some languages, `Struct`
26
+ * might be supported by a native representation. For example, in
27
+ * scripting languages like JS a struct is represented as an
28
+ * object. The details of that representation are described together
29
+ * with the proto support for the language.
30
+ *
31
+ * The JSON representation for `Struct` is JSON object.
32
+ *
33
+ * @generated from message google.protobuf.Struct
34
+ */
35
+ export declare class Struct extends Message<Struct> {
36
+ /**
37
+ * Unordered map of dynamically typed values.
38
+ *
39
+ * @generated from field: map<string, google.protobuf.Value> fields = 1;
40
+ */
41
+ fields: {
42
+ [key: string]: Value;
43
+ };
44
+ constructor(data?: PartialMessage<Struct>);
45
+ toJson(options?: Partial<JsonWriteOptions>): JsonValue;
46
+ fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
47
+ static readonly runtime: typeof proto3;
48
+ static readonly typeName = "google.protobuf.Struct";
49
+ static readonly fields: FieldList;
50
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Struct;
51
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Struct;
52
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Struct;
53
+ static equals(a: Struct | PlainMessage<Struct> | undefined, b: Struct | PlainMessage<Struct> | undefined): boolean;
54
+ }
55
+ /**
56
+ * `Value` represents a dynamically typed value which can be either
57
+ * null, a number, a string, a boolean, a recursive struct value, or a
58
+ * list of values. A producer of value is expected to set one of these
59
+ * variants. Absence of any variant indicates an error.
60
+ *
61
+ * The JSON representation for `Value` is JSON value.
62
+ *
63
+ * @generated from message google.protobuf.Value
64
+ */
65
+ export declare class Value extends Message<Value> {
66
+ /**
67
+ * The kind of value.
68
+ *
69
+ * @generated from oneof google.protobuf.Value.kind
70
+ */
71
+ kind: {
72
+ /**
73
+ * Represents a null value.
74
+ *
75
+ * @generated from field: google.protobuf.NullValue null_value = 1;
76
+ */
77
+ value: NullValue;
78
+ case: "nullValue";
79
+ } | {
80
+ /**
81
+ * Represents a double value.
82
+ *
83
+ * @generated from field: double number_value = 2;
84
+ */
85
+ value: number;
86
+ case: "numberValue";
87
+ } | {
88
+ /**
89
+ * Represents a string value.
90
+ *
91
+ * @generated from field: string string_value = 3;
92
+ */
93
+ value: string;
94
+ case: "stringValue";
95
+ } | {
96
+ /**
97
+ * Represents a boolean value.
98
+ *
99
+ * @generated from field: bool bool_value = 4;
100
+ */
101
+ value: boolean;
102
+ case: "boolValue";
103
+ } | {
104
+ /**
105
+ * Represents a structured value.
106
+ *
107
+ * @generated from field: google.protobuf.Struct struct_value = 5;
108
+ */
109
+ value: Struct;
110
+ case: "structValue";
111
+ } | {
112
+ /**
113
+ * Represents a repeated `Value`.
114
+ *
115
+ * @generated from field: google.protobuf.ListValue list_value = 6;
116
+ */
117
+ value: ListValue;
118
+ case: "listValue";
119
+ } | {
120
+ case: undefined;
121
+ value?: undefined;
122
+ };
123
+ constructor(data?: PartialMessage<Value>);
124
+ toJson(options?: Partial<JsonWriteOptions>): JsonValue;
125
+ fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
126
+ static readonly runtime: typeof proto3;
127
+ static readonly typeName = "google.protobuf.Value";
128
+ static readonly fields: FieldList;
129
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Value;
130
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Value;
131
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Value;
132
+ static equals(a: Value | PlainMessage<Value> | undefined, b: Value | PlainMessage<Value> | undefined): boolean;
133
+ }
134
+ /**
135
+ * `ListValue` is a wrapper around a repeated field of values.
136
+ *
137
+ * The JSON representation for `ListValue` is JSON array.
138
+ *
139
+ * @generated from message google.protobuf.ListValue
140
+ */
141
+ export declare class ListValue extends Message<ListValue> {
142
+ /**
143
+ * Repeated field of dynamically typed values.
144
+ *
145
+ * @generated from field: repeated google.protobuf.Value values = 1;
146
+ */
147
+ values: Value[];
148
+ constructor(data?: PartialMessage<ListValue>);
149
+ toJson(options?: Partial<JsonWriteOptions>): JsonValue;
150
+ fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
151
+ static readonly runtime: typeof proto3;
152
+ static readonly typeName = "google.protobuf.ListValue";
153
+ static readonly fields: FieldList;
154
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ListValue;
155
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ListValue;
156
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ListValue;
157
+ static equals(a: ListValue | PlainMessage<ListValue> | undefined, b: ListValue | PlainMessage<ListValue> | undefined): boolean;
158
+ }
@@ -11,7 +11,7 @@
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
- // @generated by protoc-gen-es v1.3.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
14
+ // @generated by protoc-gen-es v1.3.3 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
15
15
  // @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
16
16
  /* eslint-disable */
17
17
  import { proto3 } from "../../proto3.js";
@@ -0,0 +1,132 @@
1
+ import type { PartialMessage, PlainMessage } from "../../message.js";
2
+ import { Message } from "../../message.js";
3
+ import { proto3 } from "../../proto3.js";
4
+ import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js";
5
+ import type { FieldList } from "../../field-list.js";
6
+ import type { BinaryReadOptions } from "../../binary-format.js";
7
+ /**
8
+ * A Timestamp represents a point in time independent of any time zone or local
9
+ * calendar, encoded as a count of seconds and fractions of seconds at
10
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
11
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
12
+ * Gregorian calendar backwards to year one.
13
+ *
14
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
15
+ * second table is needed for interpretation, using a [24-hour linear
16
+ * smear](https://developers.google.com/time/smear).
17
+ *
18
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
19
+ * restricting to that range, we ensure that we can convert to and from [RFC
20
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
21
+ *
22
+ * # Examples
23
+ *
24
+ * Example 1: Compute Timestamp from POSIX `time()`.
25
+ *
26
+ * Timestamp timestamp;
27
+ * timestamp.set_seconds(time(NULL));
28
+ * timestamp.set_nanos(0);
29
+ *
30
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
31
+ *
32
+ * struct timeval tv;
33
+ * gettimeofday(&tv, NULL);
34
+ *
35
+ * Timestamp timestamp;
36
+ * timestamp.set_seconds(tv.tv_sec);
37
+ * timestamp.set_nanos(tv.tv_usec * 1000);
38
+ *
39
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
40
+ *
41
+ * FILETIME ft;
42
+ * GetSystemTimeAsFileTime(&ft);
43
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
44
+ *
45
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
46
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
47
+ * Timestamp timestamp;
48
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
49
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
50
+ *
51
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
52
+ *
53
+ * long millis = System.currentTimeMillis();
54
+ *
55
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
56
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
57
+ *
58
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
59
+ *
60
+ * Instant now = Instant.now();
61
+ *
62
+ * Timestamp timestamp =
63
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
64
+ * .setNanos(now.getNano()).build();
65
+ *
66
+ * Example 6: Compute Timestamp from current time in Python.
67
+ *
68
+ * timestamp = Timestamp()
69
+ * timestamp.GetCurrentTime()
70
+ *
71
+ * # JSON Mapping
72
+ *
73
+ * In JSON format, the Timestamp type is encoded as a string in the
74
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
75
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
76
+ * where {year} is always expressed using four digits while {month}, {day},
77
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
78
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
79
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
80
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
81
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
82
+ * able to accept both UTC and other timezones (as indicated by an offset).
83
+ *
84
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
85
+ * 01:30 UTC on January 15, 2017.
86
+ *
87
+ * In JavaScript, one can convert a Date object to this format using the
88
+ * standard
89
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
90
+ * method. In Python, a standard `datetime.datetime` object can be converted
91
+ * to this format using
92
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
93
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
94
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
95
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
96
+ * ) to obtain a formatter capable of generating timestamps in this format.
97
+ *
98
+ *
99
+ * @generated from message google.protobuf.Timestamp
100
+ */
101
+ export declare class Timestamp extends Message<Timestamp> {
102
+ /**
103
+ * Represents seconds of UTC time since Unix epoch
104
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
105
+ * 9999-12-31T23:59:59Z inclusive.
106
+ *
107
+ * @generated from field: int64 seconds = 1;
108
+ */
109
+ seconds: bigint;
110
+ /**
111
+ * Non-negative fractions of a second at nanosecond resolution. Negative
112
+ * second values with fractions must still have non-negative nanos values
113
+ * that count forward in time. Must be from 0 to 999,999,999
114
+ * inclusive.
115
+ *
116
+ * @generated from field: int32 nanos = 2;
117
+ */
118
+ nanos: number;
119
+ constructor(data?: PartialMessage<Timestamp>);
120
+ fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
121
+ toJson(options?: Partial<JsonWriteOptions>): JsonValue;
122
+ toDate(): Date;
123
+ static readonly runtime: typeof proto3;
124
+ static readonly typeName = "google.protobuf.Timestamp";
125
+ static readonly fields: FieldList;
126
+ static now(): Timestamp;
127
+ static fromDate(date: Date): Timestamp;
128
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Timestamp;
129
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Timestamp;
130
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Timestamp;
131
+ static equals(a: Timestamp | PlainMessage<Timestamp> | undefined, b: Timestamp | PlainMessage<Timestamp> | undefined): boolean;
132
+ }