@restatedev/restate-sdk 0.7.0 → 0.7.2-worker
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/dist/cloudflare_bundle.js +26133 -0
- package/dist/io/encoder.d.ts +2 -1
- package/dist/io/encoder.d.ts.map +1 -1
- package/package.json +6 -3
- package/dist/connection/buffered_connection.js +0 -44
- package/dist/connection/buffered_connection.js.map +0 -1
- package/dist/connection/connection.js +0 -13
- package/dist/connection/connection.js.map +0 -1
- package/dist/connection/embedded_connection.js +0 -59
- package/dist/connection/embedded_connection.js.map +0 -1
- package/dist/connection/http_connection.js +0 -203
- package/dist/connection/http_connection.js.map +0 -1
- package/dist/connection/lambda_connection.js +0 -58
- package/dist/connection/lambda_connection.js.map +0 -1
- package/dist/embedded/api.js +0 -35
- package/dist/embedded/api.js.map +0 -1
- package/dist/embedded/handler.js +0 -28
- package/dist/embedded/handler.js.map +0 -1
- package/dist/embedded/http2_remote.js +0 -91
- package/dist/embedded/http2_remote.js.map +0 -1
- package/dist/embedded/invocation.js +0 -94
- package/dist/embedded/invocation.js.map +0 -1
- package/dist/generated/dev/restate/events.js +0 -371
- package/dist/generated/dev/restate/events.js.map +0 -1
- package/dist/generated/dev/restate/ext.js +0 -215
- package/dist/generated/dev/restate/ext.js.map +0 -1
- package/dist/generated/google/protobuf/descriptor.js +0 -6676
- package/dist/generated/google/protobuf/descriptor.js.map +0 -1
- package/dist/generated/google/protobuf/empty.js +0 -107
- package/dist/generated/google/protobuf/empty.js.map +0 -1
- package/dist/generated/google/protobuf/struct.js +0 -754
- package/dist/generated/google/protobuf/struct.js.map +0 -1
- package/dist/generated/proto/discovery.js +0 -364
- package/dist/generated/proto/discovery.js.map +0 -1
- package/dist/generated/proto/dynrpc.js +0 -668
- package/dist/generated/proto/dynrpc.js.map +0 -1
- package/dist/generated/proto/javascript.js +0 -297
- package/dist/generated/proto/javascript.js.map +0 -1
- package/dist/generated/proto/protocol.js +0 -2398
- package/dist/generated/proto/protocol.js.map +0 -1
- package/dist/generated/proto/services.js +0 -1535
- package/dist/generated/proto/services.js.map +0 -1
- package/dist/generated/proto/test.js +0 -321
- package/dist/generated/proto/test.js.map +0 -1
- package/dist/invocation.js +0 -154
- package/dist/invocation.js.map +0 -1
- package/dist/io/decoder.js +0 -133
- package/dist/io/decoder.js.map +0 -1
- package/dist/io/encoder.js +0 -68
- package/dist/io/encoder.js.map +0 -1
- package/dist/journal.js +0 -372
- package/dist/journal.js.map +0 -1
- package/dist/local_state_store.js +0 -72
- package/dist/local_state_store.js.map +0 -1
- package/dist/public_api.js +0 -58
- package/dist/public_api.js.map +0 -1
- package/dist/restate_context.js +0 -46
- package/dist/restate_context.js.map +0 -1
- package/dist/restate_context_impl.js +0 -375
- package/dist/restate_context_impl.js.map +0 -1
- package/dist/server/base_restate_server.js +0 -364
- package/dist/server/base_restate_server.js.map +0 -1
- package/dist/server/restate_lambda_handler.js +0 -247
- package/dist/server/restate_lambda_handler.js.map +0 -1
- package/dist/server/restate_server.js +0 -186
- package/dist/server/restate_server.js.map +0 -1
- package/dist/state_machine.js +0 -403
- package/dist/state_machine.js.map +0 -1
- package/dist/types/errors.js +0 -267
- package/dist/types/errors.js.map +0 -1
- package/dist/types/grpc.js +0 -68
- package/dist/types/grpc.js.map +0 -1
- package/dist/types/protocol.js +0 -125
- package/dist/types/protocol.js.map +0 -1
- package/dist/types/router.js +0 -36
- package/dist/types/router.js.map +0 -1
- package/dist/types/types.js +0 -126
- package/dist/types/types.js.map +0 -1
- package/dist/utils/assumpsions.js +0 -101
- package/dist/utils/assumpsions.js.map +0 -1
- package/dist/utils/logger.js +0 -102
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/public_utils.js +0 -49
- package/dist/utils/public_utils.js.map +0 -1
- package/dist/utils/rand.js +0 -114
- package/dist/utils/rand.js.map +0 -1
- package/dist/utils/utils.js +0 -144
- package/dist/utils/utils.js.map +0 -1
|
@@ -1,754 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.protoMetadata = exports.ListValue = exports.Value = exports.Struct_FieldsEntry = exports.Struct = exports.nullValueToJSON = exports.nullValueFromJSON = exports.NullValue = exports.protobufPackage = void 0;
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
|
-
const ts_proto_descriptors_1 = require("ts-proto-descriptors");
|
|
10
|
-
exports.protobufPackage = "google.protobuf";
|
|
11
|
-
/**
|
|
12
|
-
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
13
|
-
* `Value` type union.
|
|
14
|
-
*
|
|
15
|
-
* The JSON representation for `NullValue` is JSON `null`.
|
|
16
|
-
*/
|
|
17
|
-
var NullValue;
|
|
18
|
-
(function (NullValue) {
|
|
19
|
-
/** NULL_VALUE - Null value. */
|
|
20
|
-
NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
|
|
21
|
-
NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
22
|
-
})(NullValue = exports.NullValue || (exports.NullValue = {}));
|
|
23
|
-
function nullValueFromJSON(object) {
|
|
24
|
-
switch (object) {
|
|
25
|
-
case 0:
|
|
26
|
-
case "NULL_VALUE":
|
|
27
|
-
return NullValue.NULL_VALUE;
|
|
28
|
-
case -1:
|
|
29
|
-
case "UNRECOGNIZED":
|
|
30
|
-
default:
|
|
31
|
-
return NullValue.UNRECOGNIZED;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.nullValueFromJSON = nullValueFromJSON;
|
|
35
|
-
function nullValueToJSON(object) {
|
|
36
|
-
switch (object) {
|
|
37
|
-
case NullValue.NULL_VALUE:
|
|
38
|
-
return "NULL_VALUE";
|
|
39
|
-
case NullValue.UNRECOGNIZED:
|
|
40
|
-
default:
|
|
41
|
-
return "UNRECOGNIZED";
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.nullValueToJSON = nullValueToJSON;
|
|
45
|
-
function createBaseStruct() {
|
|
46
|
-
return { fields: {} };
|
|
47
|
-
}
|
|
48
|
-
exports.Struct = {
|
|
49
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
50
|
-
Object.entries(message.fields).forEach(([key, value]) => {
|
|
51
|
-
if (value !== undefined) {
|
|
52
|
-
exports.Struct_FieldsEntry.encode({ key: key, value }, writer.uint32(10).fork()).ldelim();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
return writer;
|
|
56
|
-
},
|
|
57
|
-
decode(input, length) {
|
|
58
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
59
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
60
|
-
const message = createBaseStruct();
|
|
61
|
-
while (reader.pos < end) {
|
|
62
|
-
const tag = reader.uint32();
|
|
63
|
-
switch (tag >>> 3) {
|
|
64
|
-
case 1:
|
|
65
|
-
if (tag !== 10) {
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
const entry1 = exports.Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
69
|
-
if (entry1.value !== undefined) {
|
|
70
|
-
message.fields[entry1.key] = entry1.value;
|
|
71
|
-
}
|
|
72
|
-
continue;
|
|
73
|
-
}
|
|
74
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
reader.skipType(tag & 7);
|
|
78
|
-
}
|
|
79
|
-
return message;
|
|
80
|
-
},
|
|
81
|
-
fromJSON(object) {
|
|
82
|
-
return {
|
|
83
|
-
fields: isObject(object.fields)
|
|
84
|
-
? Object.entries(object.fields).reduce((acc, [key, value]) => {
|
|
85
|
-
acc[key] = value;
|
|
86
|
-
return acc;
|
|
87
|
-
}, {})
|
|
88
|
-
: {},
|
|
89
|
-
};
|
|
90
|
-
},
|
|
91
|
-
toJSON(message) {
|
|
92
|
-
const obj = {};
|
|
93
|
-
if (message.fields) {
|
|
94
|
-
const entries = Object.entries(message.fields);
|
|
95
|
-
if (entries.length > 0) {
|
|
96
|
-
obj.fields = {};
|
|
97
|
-
entries.forEach(([k, v]) => {
|
|
98
|
-
obj.fields[k] = v;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return obj;
|
|
103
|
-
},
|
|
104
|
-
create(base) {
|
|
105
|
-
return exports.Struct.fromPartial(base ?? {});
|
|
106
|
-
},
|
|
107
|
-
fromPartial(object) {
|
|
108
|
-
const message = createBaseStruct();
|
|
109
|
-
message.fields = Object.entries(object.fields ?? {}).reduce((acc, [key, value]) => {
|
|
110
|
-
if (value !== undefined) {
|
|
111
|
-
acc[key] = value;
|
|
112
|
-
}
|
|
113
|
-
return acc;
|
|
114
|
-
}, {});
|
|
115
|
-
return message;
|
|
116
|
-
},
|
|
117
|
-
wrap(object) {
|
|
118
|
-
const struct = createBaseStruct();
|
|
119
|
-
if (object !== undefined) {
|
|
120
|
-
Object.keys(object).forEach((key) => {
|
|
121
|
-
struct.fields[key] = object[key];
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
return struct;
|
|
125
|
-
},
|
|
126
|
-
unwrap(message) {
|
|
127
|
-
const object = {};
|
|
128
|
-
if (message.fields) {
|
|
129
|
-
Object.keys(message.fields).forEach((key) => {
|
|
130
|
-
object[key] = message.fields[key];
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
return object;
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
function createBaseStruct_FieldsEntry() {
|
|
137
|
-
return { key: "", value: undefined };
|
|
138
|
-
}
|
|
139
|
-
exports.Struct_FieldsEntry = {
|
|
140
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
141
|
-
if (message.key !== "") {
|
|
142
|
-
writer.uint32(10).string(message.key);
|
|
143
|
-
}
|
|
144
|
-
if (message.value !== undefined) {
|
|
145
|
-
exports.Value.encode(exports.Value.wrap(message.value), writer.uint32(18).fork()).ldelim();
|
|
146
|
-
}
|
|
147
|
-
return writer;
|
|
148
|
-
},
|
|
149
|
-
decode(input, length) {
|
|
150
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
151
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
152
|
-
const message = createBaseStruct_FieldsEntry();
|
|
153
|
-
while (reader.pos < end) {
|
|
154
|
-
const tag = reader.uint32();
|
|
155
|
-
switch (tag >>> 3) {
|
|
156
|
-
case 1:
|
|
157
|
-
if (tag !== 10) {
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
message.key = reader.string();
|
|
161
|
-
continue;
|
|
162
|
-
case 2:
|
|
163
|
-
if (tag !== 18) {
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
message.value = exports.Value.unwrap(exports.Value.decode(reader, reader.uint32()));
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
reader.skipType(tag & 7);
|
|
173
|
-
}
|
|
174
|
-
return message;
|
|
175
|
-
},
|
|
176
|
-
fromJSON(object) {
|
|
177
|
-
return {
|
|
178
|
-
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
179
|
-
value: isSet(object?.value) ? object.value : undefined,
|
|
180
|
-
};
|
|
181
|
-
},
|
|
182
|
-
toJSON(message) {
|
|
183
|
-
const obj = {};
|
|
184
|
-
if (message.key !== "") {
|
|
185
|
-
obj.key = message.key;
|
|
186
|
-
}
|
|
187
|
-
if (message.value !== undefined) {
|
|
188
|
-
obj.value = message.value;
|
|
189
|
-
}
|
|
190
|
-
return obj;
|
|
191
|
-
},
|
|
192
|
-
create(base) {
|
|
193
|
-
return exports.Struct_FieldsEntry.fromPartial(base ?? {});
|
|
194
|
-
},
|
|
195
|
-
fromPartial(object) {
|
|
196
|
-
const message = createBaseStruct_FieldsEntry();
|
|
197
|
-
message.key = object.key ?? "";
|
|
198
|
-
message.value = object.value ?? undefined;
|
|
199
|
-
return message;
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
function createBaseValue() {
|
|
203
|
-
return {
|
|
204
|
-
nullValue: undefined,
|
|
205
|
-
numberValue: undefined,
|
|
206
|
-
stringValue: undefined,
|
|
207
|
-
boolValue: undefined,
|
|
208
|
-
structValue: undefined,
|
|
209
|
-
listValue: undefined,
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
exports.Value = {
|
|
213
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
214
|
-
if (message.nullValue !== undefined) {
|
|
215
|
-
writer.uint32(8).int32(message.nullValue);
|
|
216
|
-
}
|
|
217
|
-
if (message.numberValue !== undefined) {
|
|
218
|
-
writer.uint32(17).double(message.numberValue);
|
|
219
|
-
}
|
|
220
|
-
if (message.stringValue !== undefined) {
|
|
221
|
-
writer.uint32(26).string(message.stringValue);
|
|
222
|
-
}
|
|
223
|
-
if (message.boolValue !== undefined) {
|
|
224
|
-
writer.uint32(32).bool(message.boolValue);
|
|
225
|
-
}
|
|
226
|
-
if (message.structValue !== undefined) {
|
|
227
|
-
exports.Struct.encode(exports.Struct.wrap(message.structValue), writer.uint32(42).fork()).ldelim();
|
|
228
|
-
}
|
|
229
|
-
if (message.listValue !== undefined) {
|
|
230
|
-
exports.ListValue.encode(exports.ListValue.wrap(message.listValue), writer.uint32(50).fork()).ldelim();
|
|
231
|
-
}
|
|
232
|
-
return writer;
|
|
233
|
-
},
|
|
234
|
-
decode(input, length) {
|
|
235
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
236
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
237
|
-
const message = createBaseValue();
|
|
238
|
-
while (reader.pos < end) {
|
|
239
|
-
const tag = reader.uint32();
|
|
240
|
-
switch (tag >>> 3) {
|
|
241
|
-
case 1:
|
|
242
|
-
if (tag !== 8) {
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
message.nullValue = reader.int32();
|
|
246
|
-
continue;
|
|
247
|
-
case 2:
|
|
248
|
-
if (tag !== 17) {
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
message.numberValue = reader.double();
|
|
252
|
-
continue;
|
|
253
|
-
case 3:
|
|
254
|
-
if (tag !== 26) {
|
|
255
|
-
break;
|
|
256
|
-
}
|
|
257
|
-
message.stringValue = reader.string();
|
|
258
|
-
continue;
|
|
259
|
-
case 4:
|
|
260
|
-
if (tag !== 32) {
|
|
261
|
-
break;
|
|
262
|
-
}
|
|
263
|
-
message.boolValue = reader.bool();
|
|
264
|
-
continue;
|
|
265
|
-
case 5:
|
|
266
|
-
if (tag !== 42) {
|
|
267
|
-
break;
|
|
268
|
-
}
|
|
269
|
-
message.structValue = exports.Struct.unwrap(exports.Struct.decode(reader, reader.uint32()));
|
|
270
|
-
continue;
|
|
271
|
-
case 6:
|
|
272
|
-
if (tag !== 50) {
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
message.listValue = exports.ListValue.unwrap(exports.ListValue.decode(reader, reader.uint32()));
|
|
276
|
-
continue;
|
|
277
|
-
}
|
|
278
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
279
|
-
break;
|
|
280
|
-
}
|
|
281
|
-
reader.skipType(tag & 7);
|
|
282
|
-
}
|
|
283
|
-
return message;
|
|
284
|
-
},
|
|
285
|
-
fromJSON(object) {
|
|
286
|
-
return {
|
|
287
|
-
nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
|
|
288
|
-
numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined,
|
|
289
|
-
stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
|
|
290
|
-
boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
|
|
291
|
-
structValue: isObject(object.structValue) ? object.structValue : undefined,
|
|
292
|
-
listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined,
|
|
293
|
-
};
|
|
294
|
-
},
|
|
295
|
-
toJSON(message) {
|
|
296
|
-
const obj = {};
|
|
297
|
-
if (message.nullValue !== undefined) {
|
|
298
|
-
obj.nullValue = nullValueToJSON(message.nullValue);
|
|
299
|
-
}
|
|
300
|
-
if (message.numberValue !== undefined) {
|
|
301
|
-
obj.numberValue = message.numberValue;
|
|
302
|
-
}
|
|
303
|
-
if (message.stringValue !== undefined) {
|
|
304
|
-
obj.stringValue = message.stringValue;
|
|
305
|
-
}
|
|
306
|
-
if (message.boolValue !== undefined) {
|
|
307
|
-
obj.boolValue = message.boolValue;
|
|
308
|
-
}
|
|
309
|
-
if (message.structValue !== undefined) {
|
|
310
|
-
obj.structValue = message.structValue;
|
|
311
|
-
}
|
|
312
|
-
if (message.listValue !== undefined) {
|
|
313
|
-
obj.listValue = message.listValue;
|
|
314
|
-
}
|
|
315
|
-
return obj;
|
|
316
|
-
},
|
|
317
|
-
create(base) {
|
|
318
|
-
return exports.Value.fromPartial(base ?? {});
|
|
319
|
-
},
|
|
320
|
-
fromPartial(object) {
|
|
321
|
-
const message = createBaseValue();
|
|
322
|
-
message.nullValue = object.nullValue ?? undefined;
|
|
323
|
-
message.numberValue = object.numberValue ?? undefined;
|
|
324
|
-
message.stringValue = object.stringValue ?? undefined;
|
|
325
|
-
message.boolValue = object.boolValue ?? undefined;
|
|
326
|
-
message.structValue = object.structValue ?? undefined;
|
|
327
|
-
message.listValue = object.listValue ?? undefined;
|
|
328
|
-
return message;
|
|
329
|
-
},
|
|
330
|
-
wrap(value) {
|
|
331
|
-
const result = createBaseValue();
|
|
332
|
-
if (value === null) {
|
|
333
|
-
result.nullValue = NullValue.NULL_VALUE;
|
|
334
|
-
}
|
|
335
|
-
else if (typeof value === "boolean") {
|
|
336
|
-
result.boolValue = value;
|
|
337
|
-
}
|
|
338
|
-
else if (typeof value === "number") {
|
|
339
|
-
result.numberValue = value;
|
|
340
|
-
}
|
|
341
|
-
else if (typeof value === "string") {
|
|
342
|
-
result.stringValue = value;
|
|
343
|
-
}
|
|
344
|
-
else if (globalThis.Array.isArray(value)) {
|
|
345
|
-
result.listValue = value;
|
|
346
|
-
}
|
|
347
|
-
else if (typeof value === "object") {
|
|
348
|
-
result.structValue = value;
|
|
349
|
-
}
|
|
350
|
-
else if (typeof value !== "undefined") {
|
|
351
|
-
throw new Error("Unsupported any value type: " + typeof value);
|
|
352
|
-
}
|
|
353
|
-
return result;
|
|
354
|
-
},
|
|
355
|
-
unwrap(message) {
|
|
356
|
-
if (message.stringValue !== undefined) {
|
|
357
|
-
return message.stringValue;
|
|
358
|
-
}
|
|
359
|
-
else if (message?.numberValue !== undefined) {
|
|
360
|
-
return message.numberValue;
|
|
361
|
-
}
|
|
362
|
-
else if (message?.boolValue !== undefined) {
|
|
363
|
-
return message.boolValue;
|
|
364
|
-
}
|
|
365
|
-
else if (message?.structValue !== undefined) {
|
|
366
|
-
return message.structValue;
|
|
367
|
-
}
|
|
368
|
-
else if (message?.listValue !== undefined) {
|
|
369
|
-
return message.listValue;
|
|
370
|
-
}
|
|
371
|
-
else if (message?.nullValue !== undefined) {
|
|
372
|
-
return null;
|
|
373
|
-
}
|
|
374
|
-
return undefined;
|
|
375
|
-
},
|
|
376
|
-
};
|
|
377
|
-
function createBaseListValue() {
|
|
378
|
-
return { values: [] };
|
|
379
|
-
}
|
|
380
|
-
exports.ListValue = {
|
|
381
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
382
|
-
for (const v of message.values) {
|
|
383
|
-
exports.Value.encode(exports.Value.wrap(v), writer.uint32(10).fork()).ldelim();
|
|
384
|
-
}
|
|
385
|
-
return writer;
|
|
386
|
-
},
|
|
387
|
-
decode(input, length) {
|
|
388
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
389
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
390
|
-
const message = createBaseListValue();
|
|
391
|
-
while (reader.pos < end) {
|
|
392
|
-
const tag = reader.uint32();
|
|
393
|
-
switch (tag >>> 3) {
|
|
394
|
-
case 1:
|
|
395
|
-
if (tag !== 10) {
|
|
396
|
-
break;
|
|
397
|
-
}
|
|
398
|
-
message.values.push(exports.Value.unwrap(exports.Value.decode(reader, reader.uint32())));
|
|
399
|
-
continue;
|
|
400
|
-
}
|
|
401
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
402
|
-
break;
|
|
403
|
-
}
|
|
404
|
-
reader.skipType(tag & 7);
|
|
405
|
-
}
|
|
406
|
-
return message;
|
|
407
|
-
},
|
|
408
|
-
fromJSON(object) {
|
|
409
|
-
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
|
410
|
-
},
|
|
411
|
-
toJSON(message) {
|
|
412
|
-
const obj = {};
|
|
413
|
-
if (message.values?.length) {
|
|
414
|
-
obj.values = message.values;
|
|
415
|
-
}
|
|
416
|
-
return obj;
|
|
417
|
-
},
|
|
418
|
-
create(base) {
|
|
419
|
-
return exports.ListValue.fromPartial(base ?? {});
|
|
420
|
-
},
|
|
421
|
-
fromPartial(object) {
|
|
422
|
-
const message = createBaseListValue();
|
|
423
|
-
message.values = object.values?.map((e) => e) || [];
|
|
424
|
-
return message;
|
|
425
|
-
},
|
|
426
|
-
wrap(array) {
|
|
427
|
-
const result = createBaseListValue();
|
|
428
|
-
result.values = array ?? [];
|
|
429
|
-
return result;
|
|
430
|
-
},
|
|
431
|
-
unwrap(message) {
|
|
432
|
-
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
433
|
-
return message.values;
|
|
434
|
-
}
|
|
435
|
-
else {
|
|
436
|
-
return message;
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
|
-
};
|
|
440
|
-
exports.protoMetadata = {
|
|
441
|
-
fileDescriptor: ts_proto_descriptors_1.FileDescriptorProto.fromPartial({
|
|
442
|
-
"name": "google/protobuf/struct.proto",
|
|
443
|
-
"package": "google.protobuf",
|
|
444
|
-
"dependency": [],
|
|
445
|
-
"publicDependency": [],
|
|
446
|
-
"weakDependency": [],
|
|
447
|
-
"messageType": [{
|
|
448
|
-
"name": "Struct",
|
|
449
|
-
"field": [{
|
|
450
|
-
"name": "fields",
|
|
451
|
-
"number": 1,
|
|
452
|
-
"label": 3,
|
|
453
|
-
"type": 11,
|
|
454
|
-
"typeName": ".google.protobuf.Struct.FieldsEntry",
|
|
455
|
-
"extendee": "",
|
|
456
|
-
"defaultValue": "",
|
|
457
|
-
"oneofIndex": 0,
|
|
458
|
-
"jsonName": "fields",
|
|
459
|
-
"options": undefined,
|
|
460
|
-
"proto3Optional": false,
|
|
461
|
-
}],
|
|
462
|
-
"extension": [],
|
|
463
|
-
"nestedType": [{
|
|
464
|
-
"name": "FieldsEntry",
|
|
465
|
-
"field": [{
|
|
466
|
-
"name": "key",
|
|
467
|
-
"number": 1,
|
|
468
|
-
"label": 1,
|
|
469
|
-
"type": 9,
|
|
470
|
-
"typeName": "",
|
|
471
|
-
"extendee": "",
|
|
472
|
-
"defaultValue": "",
|
|
473
|
-
"oneofIndex": 0,
|
|
474
|
-
"jsonName": "key",
|
|
475
|
-
"options": undefined,
|
|
476
|
-
"proto3Optional": false,
|
|
477
|
-
}, {
|
|
478
|
-
"name": "value",
|
|
479
|
-
"number": 2,
|
|
480
|
-
"label": 1,
|
|
481
|
-
"type": 11,
|
|
482
|
-
"typeName": ".google.protobuf.Value",
|
|
483
|
-
"extendee": "",
|
|
484
|
-
"defaultValue": "",
|
|
485
|
-
"oneofIndex": 0,
|
|
486
|
-
"jsonName": "value",
|
|
487
|
-
"options": undefined,
|
|
488
|
-
"proto3Optional": false,
|
|
489
|
-
}],
|
|
490
|
-
"extension": [],
|
|
491
|
-
"nestedType": [],
|
|
492
|
-
"enumType": [],
|
|
493
|
-
"extensionRange": [],
|
|
494
|
-
"oneofDecl": [],
|
|
495
|
-
"options": {
|
|
496
|
-
"messageSetWireFormat": false,
|
|
497
|
-
"noStandardDescriptorAccessor": false,
|
|
498
|
-
"deprecated": false,
|
|
499
|
-
"mapEntry": true,
|
|
500
|
-
"uninterpretedOption": [],
|
|
501
|
-
},
|
|
502
|
-
"reservedRange": [],
|
|
503
|
-
"reservedName": [],
|
|
504
|
-
}],
|
|
505
|
-
"enumType": [],
|
|
506
|
-
"extensionRange": [],
|
|
507
|
-
"oneofDecl": [],
|
|
508
|
-
"options": undefined,
|
|
509
|
-
"reservedRange": [],
|
|
510
|
-
"reservedName": [],
|
|
511
|
-
}, {
|
|
512
|
-
"name": "Value",
|
|
513
|
-
"field": [{
|
|
514
|
-
"name": "null_value",
|
|
515
|
-
"number": 1,
|
|
516
|
-
"label": 1,
|
|
517
|
-
"type": 14,
|
|
518
|
-
"typeName": ".google.protobuf.NullValue",
|
|
519
|
-
"extendee": "",
|
|
520
|
-
"defaultValue": "",
|
|
521
|
-
"oneofIndex": 0,
|
|
522
|
-
"jsonName": "nullValue",
|
|
523
|
-
"options": undefined,
|
|
524
|
-
"proto3Optional": false,
|
|
525
|
-
}, {
|
|
526
|
-
"name": "number_value",
|
|
527
|
-
"number": 2,
|
|
528
|
-
"label": 1,
|
|
529
|
-
"type": 1,
|
|
530
|
-
"typeName": "",
|
|
531
|
-
"extendee": "",
|
|
532
|
-
"defaultValue": "",
|
|
533
|
-
"oneofIndex": 0,
|
|
534
|
-
"jsonName": "numberValue",
|
|
535
|
-
"options": undefined,
|
|
536
|
-
"proto3Optional": false,
|
|
537
|
-
}, {
|
|
538
|
-
"name": "string_value",
|
|
539
|
-
"number": 3,
|
|
540
|
-
"label": 1,
|
|
541
|
-
"type": 9,
|
|
542
|
-
"typeName": "",
|
|
543
|
-
"extendee": "",
|
|
544
|
-
"defaultValue": "",
|
|
545
|
-
"oneofIndex": 0,
|
|
546
|
-
"jsonName": "stringValue",
|
|
547
|
-
"options": undefined,
|
|
548
|
-
"proto3Optional": false,
|
|
549
|
-
}, {
|
|
550
|
-
"name": "bool_value",
|
|
551
|
-
"number": 4,
|
|
552
|
-
"label": 1,
|
|
553
|
-
"type": 8,
|
|
554
|
-
"typeName": "",
|
|
555
|
-
"extendee": "",
|
|
556
|
-
"defaultValue": "",
|
|
557
|
-
"oneofIndex": 0,
|
|
558
|
-
"jsonName": "boolValue",
|
|
559
|
-
"options": undefined,
|
|
560
|
-
"proto3Optional": false,
|
|
561
|
-
}, {
|
|
562
|
-
"name": "struct_value",
|
|
563
|
-
"number": 5,
|
|
564
|
-
"label": 1,
|
|
565
|
-
"type": 11,
|
|
566
|
-
"typeName": ".google.protobuf.Struct",
|
|
567
|
-
"extendee": "",
|
|
568
|
-
"defaultValue": "",
|
|
569
|
-
"oneofIndex": 0,
|
|
570
|
-
"jsonName": "structValue",
|
|
571
|
-
"options": undefined,
|
|
572
|
-
"proto3Optional": false,
|
|
573
|
-
}, {
|
|
574
|
-
"name": "list_value",
|
|
575
|
-
"number": 6,
|
|
576
|
-
"label": 1,
|
|
577
|
-
"type": 11,
|
|
578
|
-
"typeName": ".google.protobuf.ListValue",
|
|
579
|
-
"extendee": "",
|
|
580
|
-
"defaultValue": "",
|
|
581
|
-
"oneofIndex": 0,
|
|
582
|
-
"jsonName": "listValue",
|
|
583
|
-
"options": undefined,
|
|
584
|
-
"proto3Optional": false,
|
|
585
|
-
}],
|
|
586
|
-
"extension": [],
|
|
587
|
-
"nestedType": [],
|
|
588
|
-
"enumType": [],
|
|
589
|
-
"extensionRange": [],
|
|
590
|
-
"oneofDecl": [{ "name": "kind", "options": undefined }],
|
|
591
|
-
"options": undefined,
|
|
592
|
-
"reservedRange": [],
|
|
593
|
-
"reservedName": [],
|
|
594
|
-
}, {
|
|
595
|
-
"name": "ListValue",
|
|
596
|
-
"field": [{
|
|
597
|
-
"name": "values",
|
|
598
|
-
"number": 1,
|
|
599
|
-
"label": 3,
|
|
600
|
-
"type": 11,
|
|
601
|
-
"typeName": ".google.protobuf.Value",
|
|
602
|
-
"extendee": "",
|
|
603
|
-
"defaultValue": "",
|
|
604
|
-
"oneofIndex": 0,
|
|
605
|
-
"jsonName": "values",
|
|
606
|
-
"options": undefined,
|
|
607
|
-
"proto3Optional": false,
|
|
608
|
-
}],
|
|
609
|
-
"extension": [],
|
|
610
|
-
"nestedType": [],
|
|
611
|
-
"enumType": [],
|
|
612
|
-
"extensionRange": [],
|
|
613
|
-
"oneofDecl": [],
|
|
614
|
-
"options": undefined,
|
|
615
|
-
"reservedRange": [],
|
|
616
|
-
"reservedName": [],
|
|
617
|
-
}],
|
|
618
|
-
"enumType": [{
|
|
619
|
-
"name": "NullValue",
|
|
620
|
-
"value": [{ "name": "NULL_VALUE", "number": 0, "options": undefined }],
|
|
621
|
-
"options": undefined,
|
|
622
|
-
"reservedRange": [],
|
|
623
|
-
"reservedName": [],
|
|
624
|
-
}],
|
|
625
|
-
"service": [],
|
|
626
|
-
"extension": [],
|
|
627
|
-
"options": {
|
|
628
|
-
"javaPackage": "com.google.protobuf",
|
|
629
|
-
"javaOuterClassname": "StructProto",
|
|
630
|
-
"javaMultipleFiles": true,
|
|
631
|
-
"javaGenerateEqualsAndHash": false,
|
|
632
|
-
"javaStringCheckUtf8": false,
|
|
633
|
-
"optimizeFor": 1,
|
|
634
|
-
"goPackage": "google.golang.org/protobuf/types/known/structpb",
|
|
635
|
-
"ccGenericServices": false,
|
|
636
|
-
"javaGenericServices": false,
|
|
637
|
-
"pyGenericServices": false,
|
|
638
|
-
"phpGenericServices": false,
|
|
639
|
-
"deprecated": false,
|
|
640
|
-
"ccEnableArenas": true,
|
|
641
|
-
"objcClassPrefix": "GPB",
|
|
642
|
-
"csharpNamespace": "Google.Protobuf.WellKnownTypes",
|
|
643
|
-
"swiftPrefix": "",
|
|
644
|
-
"phpClassPrefix": "",
|
|
645
|
-
"phpNamespace": "",
|
|
646
|
-
"phpMetadataNamespace": "",
|
|
647
|
-
"rubyPackage": "",
|
|
648
|
-
"uninterpretedOption": [],
|
|
649
|
-
},
|
|
650
|
-
"sourceCodeInfo": {
|
|
651
|
-
"location": [{
|
|
652
|
-
"path": [4, 0],
|
|
653
|
-
"span": [50, 0, 53, 1],
|
|
654
|
-
"leadingComments": " `Struct` represents a structured data value, consisting of fields\n which map to dynamically typed values. In some languages, `Struct`\n might be supported by a native representation. For example, in\n scripting languages like JS a struct is represented as an\n object. The details of that representation are described together\n with the proto support for the language.\n\n The JSON representation for `Struct` is JSON object.\n",
|
|
655
|
-
"trailingComments": "",
|
|
656
|
-
"leadingDetachedComments": [],
|
|
657
|
-
}, {
|
|
658
|
-
"path": [4, 0, 2, 0],
|
|
659
|
-
"span": [52, 2, 32],
|
|
660
|
-
"leadingComments": " Unordered map of dynamically typed values.\n",
|
|
661
|
-
"trailingComments": "",
|
|
662
|
-
"leadingDetachedComments": [],
|
|
663
|
-
}, {
|
|
664
|
-
"path": [4, 1],
|
|
665
|
-
"span": [61, 0, 77, 1],
|
|
666
|
-
"leadingComments": " `Value` represents a dynamically typed value which can be either\n null, a number, a string, a boolean, a recursive struct value, or a\n list of values. A producer of value is expected to set one of these\n variants. Absence of any variant indicates an error.\n\n The JSON representation for `Value` is JSON value.\n",
|
|
667
|
-
"trailingComments": "",
|
|
668
|
-
"leadingDetachedComments": [],
|
|
669
|
-
}, {
|
|
670
|
-
"path": [4, 1, 8, 0],
|
|
671
|
-
"span": [63, 2, 76, 3],
|
|
672
|
-
"leadingComments": " The kind of value.\n",
|
|
673
|
-
"trailingComments": "",
|
|
674
|
-
"leadingDetachedComments": [],
|
|
675
|
-
}, {
|
|
676
|
-
"path": [4, 1, 2, 0],
|
|
677
|
-
"span": [65, 4, 29],
|
|
678
|
-
"leadingComments": " Represents a null value.\n",
|
|
679
|
-
"trailingComments": "",
|
|
680
|
-
"leadingDetachedComments": [],
|
|
681
|
-
}, {
|
|
682
|
-
"path": [4, 1, 2, 1],
|
|
683
|
-
"span": [67, 4, 28],
|
|
684
|
-
"leadingComments": " Represents a double value.\n",
|
|
685
|
-
"trailingComments": "",
|
|
686
|
-
"leadingDetachedComments": [],
|
|
687
|
-
}, {
|
|
688
|
-
"path": [4, 1, 2, 2],
|
|
689
|
-
"span": [69, 4, 28],
|
|
690
|
-
"leadingComments": " Represents a string value.\n",
|
|
691
|
-
"trailingComments": "",
|
|
692
|
-
"leadingDetachedComments": [],
|
|
693
|
-
}, {
|
|
694
|
-
"path": [4, 1, 2, 3],
|
|
695
|
-
"span": [71, 4, 24],
|
|
696
|
-
"leadingComments": " Represents a boolean value.\n",
|
|
697
|
-
"trailingComments": "",
|
|
698
|
-
"leadingDetachedComments": [],
|
|
699
|
-
}, {
|
|
700
|
-
"path": [4, 1, 2, 4],
|
|
701
|
-
"span": [73, 4, 28],
|
|
702
|
-
"leadingComments": " Represents a structured value.\n",
|
|
703
|
-
"trailingComments": "",
|
|
704
|
-
"leadingDetachedComments": [],
|
|
705
|
-
}, {
|
|
706
|
-
"path": [4, 1, 2, 5],
|
|
707
|
-
"span": [75, 4, 29],
|
|
708
|
-
"leadingComments": " Represents a repeated `Value`.\n",
|
|
709
|
-
"trailingComments": "",
|
|
710
|
-
"leadingDetachedComments": [],
|
|
711
|
-
}, {
|
|
712
|
-
"path": [5, 0],
|
|
713
|
-
"span": [83, 0, 86, 1],
|
|
714
|
-
"leadingComments": " `NullValue` is a singleton enumeration to represent the null value for the\n `Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n",
|
|
715
|
-
"trailingComments": "",
|
|
716
|
-
"leadingDetachedComments": [],
|
|
717
|
-
}, {
|
|
718
|
-
"path": [5, 0, 2, 0],
|
|
719
|
-
"span": [85, 2, 17],
|
|
720
|
-
"leadingComments": " Null value.\n",
|
|
721
|
-
"trailingComments": "",
|
|
722
|
-
"leadingDetachedComments": [],
|
|
723
|
-
}, {
|
|
724
|
-
"path": [4, 2],
|
|
725
|
-
"span": [91, 0, 94, 1],
|
|
726
|
-
"leadingComments": " `ListValue` is a wrapper around a repeated field of values.\n\n The JSON representation for `ListValue` is JSON array.\n",
|
|
727
|
-
"trailingComments": "",
|
|
728
|
-
"leadingDetachedComments": [],
|
|
729
|
-
}, {
|
|
730
|
-
"path": [4, 2, 2, 0],
|
|
731
|
-
"span": [93, 2, 28],
|
|
732
|
-
"leadingComments": " Repeated field of dynamically typed values.\n",
|
|
733
|
-
"trailingComments": "",
|
|
734
|
-
"leadingDetachedComments": [],
|
|
735
|
-
}],
|
|
736
|
-
},
|
|
737
|
-
"syntax": "proto3",
|
|
738
|
-
}),
|
|
739
|
-
references: {
|
|
740
|
-
".google.protobuf.NullValue": NullValue,
|
|
741
|
-
".google.protobuf.Struct": exports.Struct,
|
|
742
|
-
".google.protobuf.Struct.FieldsEntry": exports.Struct_FieldsEntry,
|
|
743
|
-
".google.protobuf.Value": exports.Value,
|
|
744
|
-
".google.protobuf.ListValue": exports.ListValue,
|
|
745
|
-
},
|
|
746
|
-
dependencies: [],
|
|
747
|
-
};
|
|
748
|
-
function isObject(value) {
|
|
749
|
-
return typeof value === "object" && value !== null;
|
|
750
|
-
}
|
|
751
|
-
function isSet(value) {
|
|
752
|
-
return value !== null && value !== undefined;
|
|
753
|
-
}
|
|
754
|
-
//# sourceMappingURL=struct.js.map
|