@milaboratories/pl-client 2.7.12 → 2.7.14

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 (116) hide show
  1. package/dist/core/auth.d.ts.map +1 -1
  2. package/dist/core/cache.d.ts.map +1 -1
  3. package/dist/core/client.d.ts +1 -1
  4. package/dist/core/client.d.ts.map +1 -1
  5. package/dist/core/default_client.d.ts.map +1 -1
  6. package/dist/core/driver.d.ts.map +1 -1
  7. package/dist/core/errors.d.ts.map +1 -1
  8. package/dist/core/final.d.ts.map +1 -1
  9. package/dist/core/ll_client.d.ts.map +1 -1
  10. package/dist/core/ll_transaction.d.ts.map +1 -1
  11. package/dist/core/transaction.d.ts +1 -1
  12. package/dist/core/transaction.d.ts.map +1 -1
  13. package/dist/core/type_conversion.d.ts.map +1 -1
  14. package/dist/core/types.d.ts +1 -1
  15. package/dist/core/types.d.ts.map +1 -1
  16. package/dist/core/unauth_client.d.ts.map +1 -1
  17. package/dist/helpers/pl.d.ts.map +1 -1
  18. package/dist/helpers/poll.d.ts.map +1 -1
  19. package/dist/helpers/state_helpers.d.ts.map +1 -1
  20. package/dist/helpers/tx_helpers.d.ts.map +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +4069 -4075
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts +15 -15
  26. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts.map +1 -1
  27. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts +4 -4
  28. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +1 -1
  29. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +16 -16
  30. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts.map +1 -1
  31. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts +4 -4
  32. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +1 -1
  33. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +59 -59
  34. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +1 -1
  35. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts +8 -8
  36. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +1 -1
  37. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +22 -22
  38. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts.map +1 -1
  39. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +72 -72
  40. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +1 -1
  41. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +152 -152
  42. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +1 -1
  43. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +156 -156
  44. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -1
  45. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +773 -773
  46. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -1
  47. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +163 -163
  48. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +1 -1
  49. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +22 -22
  50. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +1 -1
  51. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts +32 -32
  52. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts.map +1 -1
  53. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts +78 -78
  54. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts.map +1 -1
  55. package/dist/proto/google/api/http.d.ts +89 -89
  56. package/dist/proto/google/api/http.d.ts.map +1 -1
  57. package/dist/proto/google/protobuf/any.d.ts +52 -52
  58. package/dist/proto/google/protobuf/any.d.ts.map +1 -1
  59. package/dist/proto/google/protobuf/descriptor.d.ts +1151 -1151
  60. package/dist/proto/google/protobuf/descriptor.d.ts.map +1 -1
  61. package/dist/proto/google/protobuf/duration.d.ts +19 -19
  62. package/dist/proto/google/protobuf/duration.d.ts.map +1 -1
  63. package/dist/proto/google/protobuf/empty.d.ts.map +1 -1
  64. package/dist/proto/google/protobuf/struct.d.ts +56 -56
  65. package/dist/proto/google/protobuf/struct.d.ts.map +1 -1
  66. package/dist/proto/google/protobuf/timestamp.d.ts +25 -25
  67. package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -1
  68. package/dist/proto/google/protobuf/wrappers.d.ts +72 -72
  69. package/dist/proto/google/protobuf/wrappers.d.ts.map +1 -1
  70. package/dist/test/test_config.d.ts.map +1 -1
  71. package/dist/util/util.d.ts.map +1 -1
  72. package/package.json +17 -13
  73. package/src/core/auth.ts +3 -3
  74. package/src/core/cache.ts +1 -1
  75. package/src/core/client.ts +39 -31
  76. package/src/core/config.ts +21 -21
  77. package/src/core/default_client.ts +15 -14
  78. package/src/core/driver.ts +4 -4
  79. package/src/core/errors.ts +3 -3
  80. package/src/core/final.ts +7 -4
  81. package/src/core/ll_client.ts +31 -27
  82. package/src/core/ll_transaction.ts +17 -17
  83. package/src/core/stat.ts +2 -2
  84. package/src/core/transaction.ts +93 -95
  85. package/src/core/type_conversion.ts +11 -8
  86. package/src/core/types.ts +25 -26
  87. package/src/core/unauth_client.ts +6 -6
  88. package/src/helpers/pl.ts +8 -7
  89. package/src/helpers/poll.ts +25 -21
  90. package/src/helpers/state_helpers.ts +2 -1
  91. package/src/helpers/tx_helpers.ts +4 -3
  92. package/src/proto/github.com/googleapis/googleapis/google/rpc/status.ts +74 -71
  93. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts +21 -20
  94. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts +240 -225
  95. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +21 -20
  96. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +290 -275
  97. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.ts +32 -30
  98. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.ts +388 -364
  99. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +58 -53
  100. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +490 -469
  101. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +262 -237
  102. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.ts +11751 -11032
  103. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +1155 -1114
  104. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +131 -125
  105. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/import.ts +203 -200
  106. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +559 -540
  107. package/src/proto/google/api/http.ts +280 -271
  108. package/src/proto/google/protobuf/any.ts +149 -139
  109. package/src/proto/google/protobuf/descriptor.ts +2952 -2853
  110. package/src/proto/google/protobuf/duration.ts +107 -102
  111. package/src/proto/google/protobuf/empty.ts +41 -38
  112. package/src/proto/google/protobuf/struct.ts +336 -322
  113. package/src/proto/google/protobuf/timestamp.ts +131 -123
  114. package/src/proto/google/protobuf/wrappers.ts +536 -491
  115. package/src/test/test_config.ts +21 -19
  116. package/src/util/util.ts +1 -0
@@ -32,21 +32,21 @@
32
32
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
33
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
34
  //
35
- import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
36
- import type { IBinaryWriter } from "@protobuf-ts/runtime";
37
- import { WireType } from "@protobuf-ts/runtime";
38
- import type { BinaryReadOptions } from "@protobuf-ts/runtime";
39
- import type { IBinaryReader } from "@protobuf-ts/runtime";
40
- import { UnknownFieldHandler } from "@protobuf-ts/runtime";
41
- import type { PartialMessage } from "@protobuf-ts/runtime";
42
- import { reflectionMergePartial } from "@protobuf-ts/runtime";
43
- import { isJsonObject } from "@protobuf-ts/runtime";
44
- import { typeofJsonValue } from "@protobuf-ts/runtime";
45
- import type { JsonValue } from "@protobuf-ts/runtime";
46
- import type { JsonReadOptions } from "@protobuf-ts/runtime";
47
- import type { JsonWriteOptions } from "@protobuf-ts/runtime";
48
- import type { JsonObject } from "@protobuf-ts/runtime";
49
- import { MessageType } from "@protobuf-ts/runtime";
35
+ import type { BinaryWriteOptions } from '@protobuf-ts/runtime';
36
+ import type { IBinaryWriter } from '@protobuf-ts/runtime';
37
+ import { WireType } from '@protobuf-ts/runtime';
38
+ import type { BinaryReadOptions } from '@protobuf-ts/runtime';
39
+ import type { IBinaryReader } from '@protobuf-ts/runtime';
40
+ import { UnknownFieldHandler } from '@protobuf-ts/runtime';
41
+ import type { PartialMessage } from '@protobuf-ts/runtime';
42
+ import { reflectionMergePartial } from '@protobuf-ts/runtime';
43
+ import { isJsonObject } from '@protobuf-ts/runtime';
44
+ import { typeofJsonValue } from '@protobuf-ts/runtime';
45
+ import type { JsonValue } from '@protobuf-ts/runtime';
46
+ import type { JsonReadOptions } from '@protobuf-ts/runtime';
47
+ import type { JsonWriteOptions } from '@protobuf-ts/runtime';
48
+ import type { JsonObject } from '@protobuf-ts/runtime';
49
+ import { MessageType } from '@protobuf-ts/runtime';
50
50
  /**
51
51
  * `Struct` represents a structured data value, consisting of fields
52
52
  * which map to dynamically typed values. In some languages, `Struct`
@@ -60,14 +60,14 @@ import { MessageType } from "@protobuf-ts/runtime";
60
60
  * @generated from protobuf message google.protobuf.Struct
61
61
  */
62
62
  export interface Struct {
63
- /**
63
+ /**
64
64
  * Unordered map of dynamically typed values.
65
65
  *
66
66
  * @generated from protobuf field: map<string, google.protobuf.Value> fields = 1;
67
67
  */
68
- fields: {
69
- [key: string]: Value;
70
- };
68
+ fields: {
69
+ [key: string]: Value;
70
+ };
71
71
  }
72
72
  /**
73
73
  * `Value` represents a dynamically typed value which can be either
@@ -80,60 +80,60 @@ export interface Struct {
80
80
  * @generated from protobuf message google.protobuf.Value
81
81
  */
82
82
  export interface Value {
83
- /**
83
+ /**
84
84
  * @generated from protobuf oneof: kind
85
85
  */
86
- kind: {
87
- oneofKind: "nullValue";
88
- /**
86
+ kind: {
87
+ oneofKind: 'nullValue';
88
+ /**
89
89
  * Represents a null value.
90
90
  *
91
91
  * @generated from protobuf field: google.protobuf.NullValue null_value = 1;
92
92
  */
93
- nullValue: NullValue;
94
- } | {
95
- oneofKind: "numberValue";
96
- /**
93
+ nullValue: NullValue;
94
+ } | {
95
+ oneofKind: 'numberValue';
96
+ /**
97
97
  * Represents a double value.
98
98
  *
99
99
  * @generated from protobuf field: double number_value = 2;
100
100
  */
101
- numberValue: number;
102
- } | {
103
- oneofKind: "stringValue";
104
- /**
101
+ numberValue: number;
102
+ } | {
103
+ oneofKind: 'stringValue';
104
+ /**
105
105
  * Represents a string value.
106
106
  *
107
107
  * @generated from protobuf field: string string_value = 3;
108
108
  */
109
- stringValue: string;
110
- } | {
111
- oneofKind: "boolValue";
112
- /**
109
+ stringValue: string;
110
+ } | {
111
+ oneofKind: 'boolValue';
112
+ /**
113
113
  * Represents a boolean value.
114
114
  *
115
115
  * @generated from protobuf field: bool bool_value = 4;
116
116
  */
117
- boolValue: boolean;
118
- } | {
119
- oneofKind: "structValue";
120
- /**
117
+ boolValue: boolean;
118
+ } | {
119
+ oneofKind: 'structValue';
120
+ /**
121
121
  * Represents a structured value.
122
122
  *
123
123
  * @generated from protobuf field: google.protobuf.Struct struct_value = 5;
124
124
  */
125
- structValue: Struct;
126
- } | {
127
- oneofKind: "listValue";
128
- /**
125
+ structValue: Struct;
126
+ } | {
127
+ oneofKind: 'listValue';
128
+ /**
129
129
  * Represents a repeated `Value`.
130
130
  *
131
131
  * @generated from protobuf field: google.protobuf.ListValue list_value = 6;
132
132
  */
133
- listValue: ListValue;
134
- } | {
135
- oneofKind: undefined;
136
- };
133
+ listValue: ListValue;
134
+ } | {
135
+ oneofKind: undefined;
136
+ };
137
137
  }
138
138
  /**
139
139
  * `ListValue` is a wrapper around a repeated field of values.
@@ -143,12 +143,12 @@ export interface Value {
143
143
  * @generated from protobuf message google.protobuf.ListValue
144
144
  */
145
145
  export interface ListValue {
146
- /**
146
+ /**
147
147
  * Repeated field of dynamically typed values.
148
148
  *
149
149
  * @generated from protobuf field: repeated google.protobuf.Value values = 1;
150
150
  */
151
- values: Value[];
151
+ values: Value[];
152
152
  }
153
153
  /**
154
154
  * `NullValue` is a singleton enumeration to represent the null value for the
@@ -159,98 +159,104 @@ export interface ListValue {
159
159
  * @generated from protobuf enum google.protobuf.NullValue
160
160
  */
161
161
  export enum NullValue {
162
- /**
162
+ /**
163
163
  * Null value.
164
164
  *
165
165
  * @generated from protobuf enum value: NULL_VALUE = 0;
166
166
  */
167
- NULL_VALUE = 0
167
+ NULL_VALUE = 0,
168
168
  }
169
169
  // @generated message type with reflection information, may provide speed optimized methods
170
170
  class Struct$Type extends MessageType<Struct> {
171
- constructor() {
172
- super("google.protobuf.Struct", [
173
- { no: 1, name: "fields", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } }
174
- ]);
175
- }
176
- /**
171
+ constructor() {
172
+ super('google.protobuf.Struct', [
173
+ { no: 1, name: 'fields', kind: 'map', K: 9 /* ScalarType.STRING */, V: { kind: 'message', T: () => Value } },
174
+ ]);
175
+ }
176
+
177
+ /**
177
178
  * Encode `Struct` to JSON object.
178
179
  */
179
- internalJsonWrite(message: Struct, options: JsonWriteOptions): JsonValue {
180
- let json: JsonObject = {};
181
- for (let [k, v] of Object.entries(message.fields)) {
182
- json[k] = Value.toJson(v);
183
- }
184
- return json;
180
+ internalJsonWrite(message: Struct, options: JsonWriteOptions): JsonValue {
181
+ const json: JsonObject = {};
182
+ for (const [k, v] of Object.entries(message.fields)) {
183
+ json[k] = Value.toJson(v);
185
184
  }
186
- /**
185
+ return json;
186
+ }
187
+
188
+ /**
187
189
  * Decode `Struct` from JSON object.
188
190
  */
189
- internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Struct): Struct {
190
- if (!isJsonObject(json))
191
- throw new globalThis.Error("Unable to parse message " + this.typeName + " from JSON " + typeofJsonValue(json) + ".");
192
- if (!target)
193
- target = this.create();
194
- for (let [k, v] of globalThis.Object.entries(json)) {
195
- target.fields[k] = Value.fromJson(v);
196
- }
197
- return target;
191
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Struct): Struct {
192
+ if (!isJsonObject(json))
193
+ throw new globalThis.Error('Unable to parse message ' + this.typeName + ' from JSON ' + typeofJsonValue(json) + '.');
194
+ if (!target)
195
+ target = this.create();
196
+ for (const [k, v] of globalThis.Object.entries(json)) {
197
+ target.fields[k] = Value.fromJson(v);
198
198
  }
199
- create(value?: PartialMessage<Struct>): Struct {
200
- const message = globalThis.Object.create((this.messagePrototype!));
201
- message.fields = {};
202
- if (value !== undefined)
203
- reflectionMergePartial<Struct>(this, message, value);
204
- return message;
205
- }
206
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Struct): Struct {
207
- let message = target ?? this.create(), end = reader.pos + length;
208
- while (reader.pos < end) {
209
- let [fieldNo, wireType] = reader.tag();
210
- switch (fieldNo) {
211
- case /* map<string, google.protobuf.Value> fields */ 1:
212
- this.binaryReadMap1(message.fields, reader, options);
213
- break;
214
- default:
215
- let u = options.readUnknownField;
216
- if (u === "throw")
217
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
218
- let d = reader.skip(wireType);
219
- if (u !== false)
220
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
221
- }
222
- }
223
- return message;
199
+ return target;
200
+ }
201
+
202
+ create(value?: PartialMessage<Struct>): Struct {
203
+ const message = globalThis.Object.create((this.messagePrototype!));
204
+ message.fields = {};
205
+ if (value !== undefined)
206
+ reflectionMergePartial<Struct>(this, message, value);
207
+ return message;
208
+ }
209
+
210
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Struct): Struct {
211
+ const message = target ?? this.create(), end = reader.pos + length;
212
+ while (reader.pos < end) {
213
+ const [fieldNo, wireType] = reader.tag();
214
+ switch (fieldNo) {
215
+ case /* map<string, google.protobuf.Value> fields */ 1:
216
+ this.binaryReadMap1(message.fields, reader, options);
217
+ break;
218
+ default:
219
+ const u = options.readUnknownField;
220
+ if (u === 'throw')
221
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
222
+ const d = reader.skip(wireType);
223
+ if (u !== false)
224
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
225
+ }
224
226
  }
225
- private binaryReadMap1(map: Struct["fields"], reader: IBinaryReader, options: BinaryReadOptions): void {
226
- let len = reader.uint32(), end = reader.pos + len, key: keyof Struct["fields"] | undefined, val: Struct["fields"][any] | undefined;
227
- while (reader.pos < end) {
228
- let [fieldNo, wireType] = reader.tag();
229
- switch (fieldNo) {
230
- case 1:
231
- key = reader.string();
232
- break;
233
- case 2:
234
- val = Value.internalBinaryRead(reader, reader.uint32(), options);
235
- break;
236
- default: throw new globalThis.Error("unknown map entry field for field google.protobuf.Struct.fields");
237
- }
238
- }
239
- map[key ?? ""] = val ?? Value.create();
227
+ return message;
228
+ }
229
+
230
+ private binaryReadMap1(map: Struct['fields'], reader: IBinaryReader, options: BinaryReadOptions): void {
231
+ let len = reader.uint32(), end = reader.pos + len, key: keyof Struct['fields'] | undefined, val: Struct['fields'][any] | undefined;
232
+ while (reader.pos < end) {
233
+ const [fieldNo, wireType] = reader.tag();
234
+ switch (fieldNo) {
235
+ case 1:
236
+ key = reader.string();
237
+ break;
238
+ case 2:
239
+ val = Value.internalBinaryRead(reader, reader.uint32(), options);
240
+ break;
241
+ default: throw new globalThis.Error('unknown map entry field for field google.protobuf.Struct.fields');
242
+ }
240
243
  }
241
- internalBinaryWrite(message: Struct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
242
- /* map<string, google.protobuf.Value> fields = 1; */
243
- for (let k of globalThis.Object.keys(message.fields)) {
244
- writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
245
- writer.tag(2, WireType.LengthDelimited).fork();
246
- Value.internalBinaryWrite(message.fields[k], writer, options);
247
- writer.join().join();
248
- }
249
- let u = options.writeUnknownFields;
250
- if (u !== false)
251
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
252
- return writer;
244
+ map[key ?? ''] = val ?? Value.create();
245
+ }
246
+
247
+ internalBinaryWrite(message: Struct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
248
+ /* map<string, google.protobuf.Value> fields = 1; */
249
+ for (const k of globalThis.Object.keys(message.fields)) {
250
+ writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
251
+ writer.tag(2, WireType.LengthDelimited).fork();
252
+ Value.internalBinaryWrite(message.fields[k], writer, options);
253
+ writer.join().join();
253
254
  }
255
+ const u = options.writeUnknownFields;
256
+ if (u !== false)
257
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
258
+ return writer;
259
+ }
254
260
  }
255
261
  /**
256
262
  * @generated MessageType for protobuf message google.protobuf.Struct
@@ -258,158 +264,161 @@ class Struct$Type extends MessageType<Struct> {
258
264
  export const Struct = new Struct$Type();
259
265
  // @generated message type with reflection information, may provide speed optimized methods
260
266
  class Value$Type extends MessageType<Value> {
261
- constructor() {
262
- super("google.protobuf.Value", [
263
- { no: 1, name: "null_value", kind: "enum", oneof: "kind", T: () => ["google.protobuf.NullValue", NullValue] },
264
- { no: 2, name: "number_value", kind: "scalar", oneof: "kind", T: 1 /*ScalarType.DOUBLE*/ },
265
- { no: 3, name: "string_value", kind: "scalar", oneof: "kind", T: 9 /*ScalarType.STRING*/ },
266
- { no: 4, name: "bool_value", kind: "scalar", oneof: "kind", T: 8 /*ScalarType.BOOL*/ },
267
- { no: 5, name: "struct_value", kind: "message", oneof: "kind", T: () => Struct },
268
- { no: 6, name: "list_value", kind: "message", oneof: "kind", T: () => ListValue }
269
- ]);
270
- }
271
- /**
267
+ constructor() {
268
+ super('google.protobuf.Value', [
269
+ { no: 1, name: 'null_value', kind: 'enum', oneof: 'kind', T: () => ['google.protobuf.NullValue', NullValue] },
270
+ { no: 2, name: 'number_value', kind: 'scalar', oneof: 'kind', T: 1 /* ScalarType.DOUBLE */ },
271
+ { no: 3, name: 'string_value', kind: 'scalar', oneof: 'kind', T: 9 /* ScalarType.STRING */ },
272
+ { no: 4, name: 'bool_value', kind: 'scalar', oneof: 'kind', T: 8 /* ScalarType.BOOL */ },
273
+ { no: 5, name: 'struct_value', kind: 'message', oneof: 'kind', T: () => Struct },
274
+ { no: 6, name: 'list_value', kind: 'message', oneof: 'kind', T: () => ListValue },
275
+ ]);
276
+ }
277
+
278
+ /**
272
279
  * Encode `Value` to JSON value.
273
280
  */
274
- internalJsonWrite(message: Value, options: JsonWriteOptions): JsonValue {
275
- if (message.kind.oneofKind === undefined)
276
- throw new globalThis.Error();
277
- switch (message.kind.oneofKind) {
278
- case undefined: throw new globalThis.Error();
279
- case "boolValue": return message.kind.boolValue;
280
- case "nullValue": return null;
281
- case "numberValue":
282
- let numberValue = message.kind.numberValue;
283
- if (typeof numberValue == "number" && !Number.isFinite(numberValue))
284
- throw new globalThis.Error();
285
- return numberValue;
286
- case "stringValue": return message.kind.stringValue;
287
- case "listValue":
288
- let listValueField = this.fields.find(f => f.no === 6);
289
- if (listValueField?.kind !== "message")
290
- throw new globalThis.Error();
291
- return listValueField.T().toJson(message.kind.listValue);
292
- case "structValue":
293
- let structValueField = this.fields.find(f => f.no === 5);
294
- if (structValueField?.kind !== "message")
295
- throw new globalThis.Error();
296
- return structValueField.T().toJson(message.kind.structValue);
297
- }
281
+ internalJsonWrite(message: Value, options: JsonWriteOptions): JsonValue {
282
+ if (message.kind.oneofKind === undefined)
283
+ throw new globalThis.Error();
284
+ switch (message.kind.oneofKind) {
285
+ case undefined: throw new globalThis.Error();
286
+ case 'boolValue': return message.kind.boolValue;
287
+ case 'nullValue': return null;
288
+ case 'numberValue':
289
+ const numberValue = message.kind.numberValue;
290
+ if (typeof numberValue == 'number' && !Number.isFinite(numberValue))
291
+ throw new globalThis.Error();
292
+ return numberValue;
293
+ case 'stringValue': return message.kind.stringValue;
294
+ case 'listValue':
295
+ const listValueField = this.fields.find((f) => f.no === 6);
296
+ if (listValueField?.kind !== 'message')
297
+ throw new globalThis.Error();
298
+ return listValueField.T().toJson(message.kind.listValue);
299
+ case 'structValue':
300
+ const structValueField = this.fields.find((f) => f.no === 5);
301
+ if (structValueField?.kind !== 'message')
302
+ throw new globalThis.Error();
303
+ return structValueField.T().toJson(message.kind.structValue);
298
304
  }
299
- /**
305
+ }
306
+
307
+ /**
300
308
  * Decode `Value` from JSON value.
301
309
  */
302
- internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Value): Value {
303
- if (!target)
304
- target = this.create();
305
- switch (typeof json) {
306
- case "number":
307
- target.kind = { oneofKind: "numberValue", numberValue: json };
308
- break;
309
- case "string":
310
- target.kind = { oneofKind: "stringValue", stringValue: json };
311
- break;
312
- case "boolean":
313
- target.kind = { oneofKind: "boolValue", boolValue: json };
314
- break;
315
- case "object":
316
- if (json === null) {
317
- target.kind = { oneofKind: "nullValue", nullValue: NullValue.NULL_VALUE };
318
- }
319
- else if (globalThis.Array.isArray(json)) {
320
- target.kind = { oneofKind: "listValue", listValue: ListValue.fromJson(json) };
321
- }
322
- else {
323
- target.kind = { oneofKind: "structValue", structValue: Struct.fromJson(json) };
324
- }
325
- break;
326
- default: throw new globalThis.Error("Unable to parse " + this.typeName + " from JSON " + typeofJsonValue(json));
327
- }
328
- return target;
329
- }
330
- create(value?: PartialMessage<Value>): Value {
331
- const message = globalThis.Object.create((this.messagePrototype!));
332
- message.kind = { oneofKind: undefined };
333
- if (value !== undefined)
334
- reflectionMergePartial<Value>(this, message, value);
335
- return message;
336
- }
337
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Value): Value {
338
- let message = target ?? this.create(), end = reader.pos + length;
339
- while (reader.pos < end) {
340
- let [fieldNo, wireType] = reader.tag();
341
- switch (fieldNo) {
342
- case /* google.protobuf.NullValue null_value */ 1:
343
- message.kind = {
344
- oneofKind: "nullValue",
345
- nullValue: reader.int32()
346
- };
347
- break;
348
- case /* double number_value */ 2:
349
- message.kind = {
350
- oneofKind: "numberValue",
351
- numberValue: reader.double()
352
- };
353
- break;
354
- case /* string string_value */ 3:
355
- message.kind = {
356
- oneofKind: "stringValue",
357
- stringValue: reader.string()
358
- };
359
- break;
360
- case /* bool bool_value */ 4:
361
- message.kind = {
362
- oneofKind: "boolValue",
363
- boolValue: reader.bool()
364
- };
365
- break;
366
- case /* google.protobuf.Struct struct_value */ 5:
367
- message.kind = {
368
- oneofKind: "structValue",
369
- structValue: Struct.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).structValue)
370
- };
371
- break;
372
- case /* google.protobuf.ListValue list_value */ 6:
373
- message.kind = {
374
- oneofKind: "listValue",
375
- listValue: ListValue.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).listValue)
376
- };
377
- break;
378
- default:
379
- let u = options.readUnknownField;
380
- if (u === "throw")
381
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
382
- let d = reader.skip(wireType);
383
- if (u !== false)
384
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
385
- }
310
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Value): Value {
311
+ if (!target)
312
+ target = this.create();
313
+ switch (typeof json) {
314
+ case 'number':
315
+ target.kind = { oneofKind: 'numberValue', numberValue: json };
316
+ break;
317
+ case 'string':
318
+ target.kind = { oneofKind: 'stringValue', stringValue: json };
319
+ break;
320
+ case 'boolean':
321
+ target.kind = { oneofKind: 'boolValue', boolValue: json };
322
+ break;
323
+ case 'object':
324
+ if (json === null) {
325
+ target.kind = { oneofKind: 'nullValue', nullValue: NullValue.NULL_VALUE };
326
+ } else if (globalThis.Array.isArray(json)) {
327
+ target.kind = { oneofKind: 'listValue', listValue: ListValue.fromJson(json) };
328
+ } else {
329
+ target.kind = { oneofKind: 'structValue', structValue: Struct.fromJson(json) };
386
330
  }
387
- return message;
331
+ break;
332
+ default: throw new globalThis.Error('Unable to parse ' + this.typeName + ' from JSON ' + typeofJsonValue(json));
388
333
  }
389
- internalBinaryWrite(message: Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
390
- /* google.protobuf.NullValue null_value = 1; */
391
- if (message.kind.oneofKind === "nullValue")
392
- writer.tag(1, WireType.Varint).int32(message.kind.nullValue);
393
- /* double number_value = 2; */
394
- if (message.kind.oneofKind === "numberValue")
395
- writer.tag(2, WireType.Bit64).double(message.kind.numberValue);
396
- /* string string_value = 3; */
397
- if (message.kind.oneofKind === "stringValue")
398
- writer.tag(3, WireType.LengthDelimited).string(message.kind.stringValue);
399
- /* bool bool_value = 4; */
400
- if (message.kind.oneofKind === "boolValue")
401
- writer.tag(4, WireType.Varint).bool(message.kind.boolValue);
402
- /* google.protobuf.Struct struct_value = 5; */
403
- if (message.kind.oneofKind === "structValue")
404
- Struct.internalBinaryWrite(message.kind.structValue, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
405
- /* google.protobuf.ListValue list_value = 6; */
406
- if (message.kind.oneofKind === "listValue")
407
- ListValue.internalBinaryWrite(message.kind.listValue, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
408
- let u = options.writeUnknownFields;
409
- if (u !== false)
410
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
411
- return writer;
334
+ return target;
335
+ }
336
+
337
+ create(value?: PartialMessage<Value>): Value {
338
+ const message = globalThis.Object.create((this.messagePrototype!));
339
+ message.kind = { oneofKind: undefined };
340
+ if (value !== undefined)
341
+ reflectionMergePartial<Value>(this, message, value);
342
+ return message;
343
+ }
344
+
345
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Value): Value {
346
+ const message = target ?? this.create(), end = reader.pos + length;
347
+ while (reader.pos < end) {
348
+ const [fieldNo, wireType] = reader.tag();
349
+ switch (fieldNo) {
350
+ case /* google.protobuf.NullValue null_value */ 1:
351
+ message.kind = {
352
+ oneofKind: 'nullValue',
353
+ nullValue: reader.int32(),
354
+ };
355
+ break;
356
+ case /* double number_value */ 2:
357
+ message.kind = {
358
+ oneofKind: 'numberValue',
359
+ numberValue: reader.double(),
360
+ };
361
+ break;
362
+ case /* string string_value */ 3:
363
+ message.kind = {
364
+ oneofKind: 'stringValue',
365
+ stringValue: reader.string(),
366
+ };
367
+ break;
368
+ case /* bool bool_value */ 4:
369
+ message.kind = {
370
+ oneofKind: 'boolValue',
371
+ boolValue: reader.bool(),
372
+ };
373
+ break;
374
+ case /* google.protobuf.Struct struct_value */ 5:
375
+ message.kind = {
376
+ oneofKind: 'structValue',
377
+ structValue: Struct.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).structValue),
378
+ };
379
+ break;
380
+ case /* google.protobuf.ListValue list_value */ 6:
381
+ message.kind = {
382
+ oneofKind: 'listValue',
383
+ listValue: ListValue.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).listValue),
384
+ };
385
+ break;
386
+ default:
387
+ const u = options.readUnknownField;
388
+ if (u === 'throw')
389
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
390
+ const d = reader.skip(wireType);
391
+ if (u !== false)
392
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
393
+ }
412
394
  }
395
+ return message;
396
+ }
397
+
398
+ internalBinaryWrite(message: Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
399
+ /* google.protobuf.NullValue null_value = 1; */
400
+ if (message.kind.oneofKind === 'nullValue')
401
+ writer.tag(1, WireType.Varint).int32(message.kind.nullValue);
402
+ /* double number_value = 2; */
403
+ if (message.kind.oneofKind === 'numberValue')
404
+ writer.tag(2, WireType.Bit64).double(message.kind.numberValue);
405
+ /* string string_value = 3; */
406
+ if (message.kind.oneofKind === 'stringValue')
407
+ writer.tag(3, WireType.LengthDelimited).string(message.kind.stringValue);
408
+ /* bool bool_value = 4; */
409
+ if (message.kind.oneofKind === 'boolValue')
410
+ writer.tag(4, WireType.Varint).bool(message.kind.boolValue);
411
+ /* google.protobuf.Struct struct_value = 5; */
412
+ if (message.kind.oneofKind === 'structValue')
413
+ Struct.internalBinaryWrite(message.kind.structValue, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
414
+ /* google.protobuf.ListValue list_value = 6; */
415
+ if (message.kind.oneofKind === 'listValue')
416
+ ListValue.internalBinaryWrite(message.kind.listValue, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
417
+ const u = options.writeUnknownFields;
418
+ if (u !== false)
419
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
420
+ return writer;
421
+ }
413
422
  }
414
423
  /**
415
424
  * @generated MessageType for protobuf message google.protobuf.Value
@@ -417,64 +426,69 @@ class Value$Type extends MessageType<Value> {
417
426
  export const Value = new Value$Type();
418
427
  // @generated message type with reflection information, may provide speed optimized methods
419
428
  class ListValue$Type extends MessageType<ListValue> {
420
- constructor() {
421
- super("google.protobuf.ListValue", [
422
- { no: 1, name: "values", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Value }
423
- ]);
424
- }
425
- /**
429
+ constructor() {
430
+ super('google.protobuf.ListValue', [
431
+ { no: 1, name: 'values', kind: 'message', repeat: 1 /* RepeatType.PACKED */, T: () => Value },
432
+ ]);
433
+ }
434
+
435
+ /**
426
436
  * Encode `ListValue` to JSON array.
427
437
  */
428
- internalJsonWrite(message: ListValue, options: JsonWriteOptions): JsonValue {
429
- return message.values.map(v => Value.toJson(v));
430
- }
431
- /**
438
+ internalJsonWrite(message: ListValue, options: JsonWriteOptions): JsonValue {
439
+ return message.values.map((v) => Value.toJson(v));
440
+ }
441
+
442
+ /**
432
443
  * Decode `ListValue` from JSON array.
433
444
  */
434
- internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: ListValue): ListValue {
435
- if (!globalThis.Array.isArray(json))
436
- throw new globalThis.Error("Unable to parse " + this.typeName + " from JSON " + typeofJsonValue(json));
437
- if (!target)
438
- target = this.create();
439
- let values = json.map(v => Value.fromJson(v));
440
- target.values.push(...values);
441
- return target;
442
- }
443
- create(value?: PartialMessage<ListValue>): ListValue {
444
- const message = globalThis.Object.create((this.messagePrototype!));
445
- message.values = [];
446
- if (value !== undefined)
447
- reflectionMergePartial<ListValue>(this, message, value);
448
- return message;
449
- }
450
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListValue): ListValue {
451
- let message = target ?? this.create(), end = reader.pos + length;
452
- while (reader.pos < end) {
453
- let [fieldNo, wireType] = reader.tag();
454
- switch (fieldNo) {
455
- case /* repeated google.protobuf.Value values */ 1:
456
- message.values.push(Value.internalBinaryRead(reader, reader.uint32(), options));
457
- break;
458
- default:
459
- let u = options.readUnknownField;
460
- if (u === "throw")
461
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
462
- let d = reader.skip(wireType);
463
- if (u !== false)
464
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
465
- }
466
- }
467
- return message;
468
- }
469
- internalBinaryWrite(message: ListValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
470
- /* repeated google.protobuf.Value values = 1; */
471
- for (let i = 0; i < message.values.length; i++)
472
- Value.internalBinaryWrite(message.values[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
473
- let u = options.writeUnknownFields;
474
- if (u !== false)
475
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
476
- return writer;
445
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: ListValue): ListValue {
446
+ if (!globalThis.Array.isArray(json))
447
+ throw new globalThis.Error('Unable to parse ' + this.typeName + ' from JSON ' + typeofJsonValue(json));
448
+ if (!target)
449
+ target = this.create();
450
+ const values = json.map((v) => Value.fromJson(v));
451
+ target.values.push(...values);
452
+ return target;
453
+ }
454
+
455
+ create(value?: PartialMessage<ListValue>): ListValue {
456
+ const message = globalThis.Object.create((this.messagePrototype!));
457
+ message.values = [];
458
+ if (value !== undefined)
459
+ reflectionMergePartial<ListValue>(this, message, value);
460
+ return message;
461
+ }
462
+
463
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListValue): ListValue {
464
+ const message = target ?? this.create(), end = reader.pos + length;
465
+ while (reader.pos < end) {
466
+ const [fieldNo, wireType] = reader.tag();
467
+ switch (fieldNo) {
468
+ case /* repeated google.protobuf.Value values */ 1:
469
+ message.values.push(Value.internalBinaryRead(reader, reader.uint32(), options));
470
+ break;
471
+ default:
472
+ const u = options.readUnknownField;
473
+ if (u === 'throw')
474
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
475
+ const d = reader.skip(wireType);
476
+ if (u !== false)
477
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
478
+ }
477
479
  }
480
+ return message;
481
+ }
482
+
483
+ internalBinaryWrite(message: ListValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
484
+ /* repeated google.protobuf.Value values = 1; */
485
+ for (let i = 0; i < message.values.length; i++)
486
+ Value.internalBinaryWrite(message.values[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
487
+ const u = options.writeUnknownFields;
488
+ if (u !== false)
489
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
490
+ return writer;
491
+ }
478
492
  }
479
493
  /**
480
494
  * @generated MessageType for protobuf message google.protobuf.ListValue