@code0-tech/tucana 0.0.0 → 0.0.37
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/index.js +0 -0
- package/package.json +1 -1
- package/pb/aquila.action_pb.client.ts +41 -0
- package/pb/aquila.action_pb.ts +615 -0
- package/pb/aquila.data_type_pb.client.ts +37 -0
- package/pb/aquila.data_type_pb.ts +140 -0
- package/pb/aquila.execution_pb.client.ts +74 -0
- package/pb/aquila.execution_pb.ts +334 -0
- package/pb/aquila.flow_type_pb.client.ts +41 -0
- package/pb/aquila.flow_type_pb.ts +140 -0
- package/pb/aquila.runtime_function_pb.client.ts +41 -0
- package/pb/aquila.runtime_function_pb.ts +140 -0
- package/pb/sagittarius.action_pb.client.ts +54 -0
- package/pb/sagittarius.action_pb.ts +239 -0
- package/pb/sagittarius.data_type_pb.client.ts +37 -0
- package/pb/sagittarius.data_type_pb.ts +140 -0
- package/pb/sagittarius.flow_pb.client.ts +37 -0
- package/pb/sagittarius.flow_pb.ts +173 -0
- package/pb/sagittarius.flow_type_pb.client.ts +41 -0
- package/pb/sagittarius.flow_type_pb.ts +140 -0
- package/pb/sagittarius.ping_pb.client.ts +36 -0
- package/pb/sagittarius.ping_pb.ts +75 -0
- package/pb/sagittarius.runtime_function_pb.client.ts +41 -0
- package/pb/sagittarius.runtime_function_pb.ts +140 -0
- package/pb/sagittarius.text_execution_pb.client.ts +37 -0
- package/pb/sagittarius.text_execution_pb.ts +456 -0
- package/pb/shared.data_type_pb.ts +1534 -0
- package/pb/shared.event_pb.ts +285 -0
- package/pb/shared.flow_definition_pb.ts +281 -0
- package/pb/shared.flow_pb.ts +845 -0
- package/pb/shared.runtime_function_pb.ts +298 -0
- package/pb/shared.struct_pb.ts +383 -0
- package/pb/shared.translation_pb.ts +86 -0
- package/pb/shared.version_pb.ts +92 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
|
|
2
|
+
// @generated from protobuf file "shared.runtime_function.proto" (package "shared", syntax proto3)
|
|
3
|
+
// tslint:disable
|
|
4
|
+
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
5
|
+
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
6
|
+
import { WireType } from "@protobuf-ts/runtime";
|
|
7
|
+
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
8
|
+
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
9
|
+
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
10
|
+
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
11
|
+
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
12
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
13
|
+
import { Value } from "./shared.struct_pb";
|
|
14
|
+
import { Version } from "./shared.version_pb";
|
|
15
|
+
import { Translation } from "./shared.translation_pb";
|
|
16
|
+
import { DataTypeIdentifier } from "./shared.data_type_pb";
|
|
17
|
+
/**
|
|
18
|
+
* Definition of a function used for execution
|
|
19
|
+
*
|
|
20
|
+
* @generated from protobuf message shared.RuntimeFunctionDefinition
|
|
21
|
+
*/
|
|
22
|
+
export interface RuntimeFunctionDefinition {
|
|
23
|
+
/**
|
|
24
|
+
* @generated from protobuf field: string runtime_name = 1
|
|
25
|
+
*/
|
|
26
|
+
runtimeName: string;
|
|
27
|
+
/**
|
|
28
|
+
* @generated from protobuf field: repeated shared.RuntimeParameterDefinition runtime_parameter_definitions = 2
|
|
29
|
+
*/
|
|
30
|
+
runtimeParameterDefinitions: RuntimeParameterDefinition[];
|
|
31
|
+
/**
|
|
32
|
+
* @generated from protobuf field: optional shared.DataTypeIdentifier return_type_identifier = 3
|
|
33
|
+
*/
|
|
34
|
+
returnTypeIdentifier?: DataTypeIdentifier;
|
|
35
|
+
/**
|
|
36
|
+
* @generated from protobuf field: bool throws_error = 4
|
|
37
|
+
*/
|
|
38
|
+
throwsError: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @generated from protobuf field: repeated string generic_keys = 5
|
|
41
|
+
*/
|
|
42
|
+
genericKeys: string[];
|
|
43
|
+
/**
|
|
44
|
+
* @generated from protobuf field: repeated shared.Translation name = 6
|
|
45
|
+
*/
|
|
46
|
+
name: Translation[];
|
|
47
|
+
/**
|
|
48
|
+
* @generated from protobuf field: repeated shared.Translation description = 7
|
|
49
|
+
*/
|
|
50
|
+
description: Translation[];
|
|
51
|
+
/**
|
|
52
|
+
* @generated from protobuf field: repeated shared.Translation documentation = 8
|
|
53
|
+
*/
|
|
54
|
+
documentation: Translation[];
|
|
55
|
+
/**
|
|
56
|
+
* @generated from protobuf field: repeated shared.Translation deprecation_message = 9
|
|
57
|
+
*/
|
|
58
|
+
deprecationMessage: Translation[];
|
|
59
|
+
/**
|
|
60
|
+
* Version of the runtime function
|
|
61
|
+
*
|
|
62
|
+
* @generated from protobuf field: shared.Version version = 10
|
|
63
|
+
*/
|
|
64
|
+
version?: Version;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Definition of a parameter used for execution
|
|
68
|
+
*
|
|
69
|
+
* @generated from protobuf message shared.RuntimeParameterDefinition
|
|
70
|
+
*/
|
|
71
|
+
export interface RuntimeParameterDefinition {
|
|
72
|
+
/**
|
|
73
|
+
* @generated from protobuf field: shared.DataTypeIdentifier data_type_identifier = 1
|
|
74
|
+
*/
|
|
75
|
+
dataTypeIdentifier?: DataTypeIdentifier;
|
|
76
|
+
/**
|
|
77
|
+
* @generated from protobuf field: string runtime_name = 2
|
|
78
|
+
*/
|
|
79
|
+
runtimeName: string;
|
|
80
|
+
/**
|
|
81
|
+
* @generated from protobuf field: optional shared.Value default_value = 3
|
|
82
|
+
*/
|
|
83
|
+
defaultValue?: Value;
|
|
84
|
+
/**
|
|
85
|
+
* @generated from protobuf field: repeated shared.Translation name = 4
|
|
86
|
+
*/
|
|
87
|
+
name: Translation[];
|
|
88
|
+
/**
|
|
89
|
+
* @generated from protobuf field: repeated shared.Translation description = 5
|
|
90
|
+
*/
|
|
91
|
+
description: Translation[];
|
|
92
|
+
/**
|
|
93
|
+
* @generated from protobuf field: repeated shared.Translation documentation = 6
|
|
94
|
+
*/
|
|
95
|
+
documentation: Translation[];
|
|
96
|
+
}
|
|
97
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
98
|
+
class RuntimeFunctionDefinition$Type extends MessageType<RuntimeFunctionDefinition> {
|
|
99
|
+
constructor() {
|
|
100
|
+
super("shared.RuntimeFunctionDefinition", [
|
|
101
|
+
{ no: 1, name: "runtime_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
102
|
+
{ no: 2, name: "runtime_parameter_definitions", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RuntimeParameterDefinition },
|
|
103
|
+
{ no: 3, name: "return_type_identifier", kind: "message", T: () => DataTypeIdentifier },
|
|
104
|
+
{ no: 4, name: "throws_error", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
105
|
+
{ no: 5, name: "generic_keys", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
106
|
+
{ no: 6, name: "name", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Translation },
|
|
107
|
+
{ no: 7, name: "description", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Translation },
|
|
108
|
+
{ no: 8, name: "documentation", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Translation },
|
|
109
|
+
{ no: 9, name: "deprecation_message", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Translation },
|
|
110
|
+
{ no: 10, name: "version", kind: "message", T: () => Version }
|
|
111
|
+
]);
|
|
112
|
+
}
|
|
113
|
+
create(value?: PartialMessage<RuntimeFunctionDefinition>): RuntimeFunctionDefinition {
|
|
114
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
115
|
+
message.runtimeName = "";
|
|
116
|
+
message.runtimeParameterDefinitions = [];
|
|
117
|
+
message.throwsError = false;
|
|
118
|
+
message.genericKeys = [];
|
|
119
|
+
message.name = [];
|
|
120
|
+
message.description = [];
|
|
121
|
+
message.documentation = [];
|
|
122
|
+
message.deprecationMessage = [];
|
|
123
|
+
if (value !== undefined)
|
|
124
|
+
reflectionMergePartial<RuntimeFunctionDefinition>(this, message, value);
|
|
125
|
+
return message;
|
|
126
|
+
}
|
|
127
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RuntimeFunctionDefinition): RuntimeFunctionDefinition {
|
|
128
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
129
|
+
while (reader.pos < end) {
|
|
130
|
+
let [fieldNo, wireType] = reader.tag();
|
|
131
|
+
switch (fieldNo) {
|
|
132
|
+
case /* string runtime_name */ 1:
|
|
133
|
+
message.runtimeName = reader.string();
|
|
134
|
+
break;
|
|
135
|
+
case /* repeated shared.RuntimeParameterDefinition runtime_parameter_definitions */ 2:
|
|
136
|
+
message.runtimeParameterDefinitions.push(RuntimeParameterDefinition.internalBinaryRead(reader, reader.uint32(), options));
|
|
137
|
+
break;
|
|
138
|
+
case /* optional shared.DataTypeIdentifier return_type_identifier */ 3:
|
|
139
|
+
message.returnTypeIdentifier = DataTypeIdentifier.internalBinaryRead(reader, reader.uint32(), options, message.returnTypeIdentifier);
|
|
140
|
+
break;
|
|
141
|
+
case /* bool throws_error */ 4:
|
|
142
|
+
message.throwsError = reader.bool();
|
|
143
|
+
break;
|
|
144
|
+
case /* repeated string generic_keys */ 5:
|
|
145
|
+
message.genericKeys.push(reader.string());
|
|
146
|
+
break;
|
|
147
|
+
case /* repeated shared.Translation name */ 6:
|
|
148
|
+
message.name.push(Translation.internalBinaryRead(reader, reader.uint32(), options));
|
|
149
|
+
break;
|
|
150
|
+
case /* repeated shared.Translation description */ 7:
|
|
151
|
+
message.description.push(Translation.internalBinaryRead(reader, reader.uint32(), options));
|
|
152
|
+
break;
|
|
153
|
+
case /* repeated shared.Translation documentation */ 8:
|
|
154
|
+
message.documentation.push(Translation.internalBinaryRead(reader, reader.uint32(), options));
|
|
155
|
+
break;
|
|
156
|
+
case /* repeated shared.Translation deprecation_message */ 9:
|
|
157
|
+
message.deprecationMessage.push(Translation.internalBinaryRead(reader, reader.uint32(), options));
|
|
158
|
+
break;
|
|
159
|
+
case /* shared.Version version */ 10:
|
|
160
|
+
message.version = Version.internalBinaryRead(reader, reader.uint32(), options, message.version);
|
|
161
|
+
break;
|
|
162
|
+
default:
|
|
163
|
+
let u = options.readUnknownField;
|
|
164
|
+
if (u === "throw")
|
|
165
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
166
|
+
let d = reader.skip(wireType);
|
|
167
|
+
if (u !== false)
|
|
168
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return message;
|
|
172
|
+
}
|
|
173
|
+
internalBinaryWrite(message: RuntimeFunctionDefinition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
174
|
+
/* string runtime_name = 1; */
|
|
175
|
+
if (message.runtimeName !== "")
|
|
176
|
+
writer.tag(1, WireType.LengthDelimited).string(message.runtimeName);
|
|
177
|
+
/* repeated shared.RuntimeParameterDefinition runtime_parameter_definitions = 2; */
|
|
178
|
+
for (let i = 0; i < message.runtimeParameterDefinitions.length; i++)
|
|
179
|
+
RuntimeParameterDefinition.internalBinaryWrite(message.runtimeParameterDefinitions[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
180
|
+
/* optional shared.DataTypeIdentifier return_type_identifier = 3; */
|
|
181
|
+
if (message.returnTypeIdentifier)
|
|
182
|
+
DataTypeIdentifier.internalBinaryWrite(message.returnTypeIdentifier, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
183
|
+
/* bool throws_error = 4; */
|
|
184
|
+
if (message.throwsError !== false)
|
|
185
|
+
writer.tag(4, WireType.Varint).bool(message.throwsError);
|
|
186
|
+
/* repeated string generic_keys = 5; */
|
|
187
|
+
for (let i = 0; i < message.genericKeys.length; i++)
|
|
188
|
+
writer.tag(5, WireType.LengthDelimited).string(message.genericKeys[i]);
|
|
189
|
+
/* repeated shared.Translation name = 6; */
|
|
190
|
+
for (let i = 0; i < message.name.length; i++)
|
|
191
|
+
Translation.internalBinaryWrite(message.name[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
|
|
192
|
+
/* repeated shared.Translation description = 7; */
|
|
193
|
+
for (let i = 0; i < message.description.length; i++)
|
|
194
|
+
Translation.internalBinaryWrite(message.description[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();
|
|
195
|
+
/* repeated shared.Translation documentation = 8; */
|
|
196
|
+
for (let i = 0; i < message.documentation.length; i++)
|
|
197
|
+
Translation.internalBinaryWrite(message.documentation[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join();
|
|
198
|
+
/* repeated shared.Translation deprecation_message = 9; */
|
|
199
|
+
for (let i = 0; i < message.deprecationMessage.length; i++)
|
|
200
|
+
Translation.internalBinaryWrite(message.deprecationMessage[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join();
|
|
201
|
+
/* shared.Version version = 10; */
|
|
202
|
+
if (message.version)
|
|
203
|
+
Version.internalBinaryWrite(message.version, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
|
|
204
|
+
let u = options.writeUnknownFields;
|
|
205
|
+
if (u !== false)
|
|
206
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
207
|
+
return writer;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* @generated MessageType for protobuf message shared.RuntimeFunctionDefinition
|
|
212
|
+
*/
|
|
213
|
+
export const RuntimeFunctionDefinition = new RuntimeFunctionDefinition$Type();
|
|
214
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
215
|
+
class RuntimeParameterDefinition$Type extends MessageType<RuntimeParameterDefinition> {
|
|
216
|
+
constructor() {
|
|
217
|
+
super("shared.RuntimeParameterDefinition", [
|
|
218
|
+
{ no: 1, name: "data_type_identifier", kind: "message", T: () => DataTypeIdentifier },
|
|
219
|
+
{ no: 2, name: "runtime_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
220
|
+
{ no: 3, name: "default_value", kind: "message", T: () => Value },
|
|
221
|
+
{ no: 4, name: "name", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Translation },
|
|
222
|
+
{ no: 5, name: "description", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Translation },
|
|
223
|
+
{ no: 6, name: "documentation", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Translation }
|
|
224
|
+
]);
|
|
225
|
+
}
|
|
226
|
+
create(value?: PartialMessage<RuntimeParameterDefinition>): RuntimeParameterDefinition {
|
|
227
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
228
|
+
message.runtimeName = "";
|
|
229
|
+
message.name = [];
|
|
230
|
+
message.description = [];
|
|
231
|
+
message.documentation = [];
|
|
232
|
+
if (value !== undefined)
|
|
233
|
+
reflectionMergePartial<RuntimeParameterDefinition>(this, message, value);
|
|
234
|
+
return message;
|
|
235
|
+
}
|
|
236
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RuntimeParameterDefinition): RuntimeParameterDefinition {
|
|
237
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
238
|
+
while (reader.pos < end) {
|
|
239
|
+
let [fieldNo, wireType] = reader.tag();
|
|
240
|
+
switch (fieldNo) {
|
|
241
|
+
case /* shared.DataTypeIdentifier data_type_identifier */ 1:
|
|
242
|
+
message.dataTypeIdentifier = DataTypeIdentifier.internalBinaryRead(reader, reader.uint32(), options, message.dataTypeIdentifier);
|
|
243
|
+
break;
|
|
244
|
+
case /* string runtime_name */ 2:
|
|
245
|
+
message.runtimeName = reader.string();
|
|
246
|
+
break;
|
|
247
|
+
case /* optional shared.Value default_value */ 3:
|
|
248
|
+
message.defaultValue = Value.internalBinaryRead(reader, reader.uint32(), options, message.defaultValue);
|
|
249
|
+
break;
|
|
250
|
+
case /* repeated shared.Translation name */ 4:
|
|
251
|
+
message.name.push(Translation.internalBinaryRead(reader, reader.uint32(), options));
|
|
252
|
+
break;
|
|
253
|
+
case /* repeated shared.Translation description */ 5:
|
|
254
|
+
message.description.push(Translation.internalBinaryRead(reader, reader.uint32(), options));
|
|
255
|
+
break;
|
|
256
|
+
case /* repeated shared.Translation documentation */ 6:
|
|
257
|
+
message.documentation.push(Translation.internalBinaryRead(reader, reader.uint32(), options));
|
|
258
|
+
break;
|
|
259
|
+
default:
|
|
260
|
+
let u = options.readUnknownField;
|
|
261
|
+
if (u === "throw")
|
|
262
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
263
|
+
let d = reader.skip(wireType);
|
|
264
|
+
if (u !== false)
|
|
265
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return message;
|
|
269
|
+
}
|
|
270
|
+
internalBinaryWrite(message: RuntimeParameterDefinition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
271
|
+
/* shared.DataTypeIdentifier data_type_identifier = 1; */
|
|
272
|
+
if (message.dataTypeIdentifier)
|
|
273
|
+
DataTypeIdentifier.internalBinaryWrite(message.dataTypeIdentifier, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
274
|
+
/* string runtime_name = 2; */
|
|
275
|
+
if (message.runtimeName !== "")
|
|
276
|
+
writer.tag(2, WireType.LengthDelimited).string(message.runtimeName);
|
|
277
|
+
/* optional shared.Value default_value = 3; */
|
|
278
|
+
if (message.defaultValue)
|
|
279
|
+
Value.internalBinaryWrite(message.defaultValue, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
280
|
+
/* repeated shared.Translation name = 4; */
|
|
281
|
+
for (let i = 0; i < message.name.length; i++)
|
|
282
|
+
Translation.internalBinaryWrite(message.name[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
|
|
283
|
+
/* repeated shared.Translation description = 5; */
|
|
284
|
+
for (let i = 0; i < message.description.length; i++)
|
|
285
|
+
Translation.internalBinaryWrite(message.description[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
|
|
286
|
+
/* repeated shared.Translation documentation = 6; */
|
|
287
|
+
for (let i = 0; i < message.documentation.length; i++)
|
|
288
|
+
Translation.internalBinaryWrite(message.documentation[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
|
|
289
|
+
let u = options.writeUnknownFields;
|
|
290
|
+
if (u !== false)
|
|
291
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
292
|
+
return writer;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* @generated MessageType for protobuf message shared.RuntimeParameterDefinition
|
|
297
|
+
*/
|
|
298
|
+
export const RuntimeParameterDefinition = new RuntimeParameterDefinition$Type();
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
|
|
2
|
+
// @generated from protobuf file "shared.struct.proto" (package "shared", syntax proto3)
|
|
3
|
+
// tslint:disable
|
|
4
|
+
//
|
|
5
|
+
// Protocol Buffers - Google's data interchange format
|
|
6
|
+
// Copyright 2008 Google Inc. All rights reserved.
|
|
7
|
+
// https://developers.google.com/protocol-buffers/
|
|
8
|
+
//
|
|
9
|
+
// Redistribution and use in source and binary forms, with or without
|
|
10
|
+
// modification, are permitted provided that the following conditions are
|
|
11
|
+
// met:
|
|
12
|
+
//
|
|
13
|
+
// * Redistributions of source code must retain the above copyright
|
|
14
|
+
// notice, this list of conditions and the following disclaimer.
|
|
15
|
+
// * Redistributions in binary form must reproduce the above
|
|
16
|
+
// copyright notice, this list of conditions and the following disclaimer
|
|
17
|
+
// in the documentation and/or other materials provided with the
|
|
18
|
+
// distribution.
|
|
19
|
+
// * Neither the name of Google Inc. nor the names of its
|
|
20
|
+
// contributors may be used to endorse or promote products derived from
|
|
21
|
+
// this software without specific prior written permission.
|
|
22
|
+
//
|
|
23
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
24
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
25
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
26
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
27
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
28
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
29
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
30
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
32
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
|
+
//
|
|
35
|
+
//
|
|
36
|
+
// Code0 Tucana note:
|
|
37
|
+
// The package name and options have been modified to accommodate for the needs of this project
|
|
38
|
+
// The original is located at https://github.com/protocolbuffers/protobuf/blob/18aa4e1fcb8882133e96445c40d1521f16932f1c/src/google/protobuf/struct.proto
|
|
39
|
+
//
|
|
40
|
+
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
41
|
+
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
42
|
+
import { WireType } from "@protobuf-ts/runtime";
|
|
43
|
+
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
44
|
+
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
45
|
+
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
46
|
+
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
47
|
+
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
48
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
49
|
+
/**
|
|
50
|
+
* `Struct` represents a structured data value, consisting of fields
|
|
51
|
+
* which map to dynamically typed values. In some languages, `Struct`
|
|
52
|
+
* might be supported by a native representation. For example, in
|
|
53
|
+
* scripting languages like JS a struct is represented as an
|
|
54
|
+
* object. The details of that representation are described together
|
|
55
|
+
* with the proto support for the language.
|
|
56
|
+
*
|
|
57
|
+
* The JSON representation for `Struct` is JSON object.
|
|
58
|
+
*
|
|
59
|
+
* @generated from protobuf message shared.Struct
|
|
60
|
+
*/
|
|
61
|
+
export interface Struct {
|
|
62
|
+
/**
|
|
63
|
+
* Unordered map of dynamically typed values.
|
|
64
|
+
*
|
|
65
|
+
* @generated from protobuf field: map<string, shared.Value> fields = 1
|
|
66
|
+
*/
|
|
67
|
+
fields: {
|
|
68
|
+
[key: string]: Value;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* `Value` represents a dynamically typed value which can be either
|
|
73
|
+
* null, a number, a string, a boolean, a recursive struct value, or a
|
|
74
|
+
* list of values. A producer of value is expected to set one of these
|
|
75
|
+
* variants. Absence of any variant indicates an error.
|
|
76
|
+
*
|
|
77
|
+
* The JSON representation for `Value` is JSON value.
|
|
78
|
+
*
|
|
79
|
+
* @generated from protobuf message shared.Value
|
|
80
|
+
*/
|
|
81
|
+
export interface Value {
|
|
82
|
+
/**
|
|
83
|
+
* The kind of value.
|
|
84
|
+
*
|
|
85
|
+
* @generated from protobuf oneof: kind
|
|
86
|
+
*/
|
|
87
|
+
kind: {
|
|
88
|
+
oneofKind: "nullValue";
|
|
89
|
+
/**
|
|
90
|
+
* Represents a null value.
|
|
91
|
+
*
|
|
92
|
+
* @generated from protobuf field: shared.NullValue null_value = 1
|
|
93
|
+
*/
|
|
94
|
+
nullValue: NullValue;
|
|
95
|
+
} | {
|
|
96
|
+
oneofKind: "numberValue";
|
|
97
|
+
/**
|
|
98
|
+
* Represents a double value.
|
|
99
|
+
*
|
|
100
|
+
* @generated from protobuf field: double number_value = 2
|
|
101
|
+
*/
|
|
102
|
+
numberValue: number;
|
|
103
|
+
} | {
|
|
104
|
+
oneofKind: "stringValue";
|
|
105
|
+
/**
|
|
106
|
+
* Represents a string value.
|
|
107
|
+
*
|
|
108
|
+
* @generated from protobuf field: string string_value = 3
|
|
109
|
+
*/
|
|
110
|
+
stringValue: string;
|
|
111
|
+
} | {
|
|
112
|
+
oneofKind: "boolValue";
|
|
113
|
+
/**
|
|
114
|
+
* Represents a boolean value.
|
|
115
|
+
*
|
|
116
|
+
* @generated from protobuf field: bool bool_value = 4
|
|
117
|
+
*/
|
|
118
|
+
boolValue: boolean;
|
|
119
|
+
} | {
|
|
120
|
+
oneofKind: "structValue";
|
|
121
|
+
/**
|
|
122
|
+
* Represents a structured value.
|
|
123
|
+
*
|
|
124
|
+
* @generated from protobuf field: shared.Struct struct_value = 5
|
|
125
|
+
*/
|
|
126
|
+
structValue: Struct;
|
|
127
|
+
} | {
|
|
128
|
+
oneofKind: "listValue";
|
|
129
|
+
/**
|
|
130
|
+
* Represents a repeated `Value`.
|
|
131
|
+
*
|
|
132
|
+
* @generated from protobuf field: shared.ListValue list_value = 6
|
|
133
|
+
*/
|
|
134
|
+
listValue: ListValue;
|
|
135
|
+
} | {
|
|
136
|
+
oneofKind: undefined;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* `ListValue` is a wrapper around a repeated field of values.
|
|
141
|
+
*
|
|
142
|
+
* The JSON representation for `ListValue` is JSON array.
|
|
143
|
+
*
|
|
144
|
+
* @generated from protobuf message shared.ListValue
|
|
145
|
+
*/
|
|
146
|
+
export interface ListValue {
|
|
147
|
+
/**
|
|
148
|
+
* Repeated field of dynamically typed values.
|
|
149
|
+
*
|
|
150
|
+
* @generated from protobuf field: repeated shared.Value values = 1
|
|
151
|
+
*/
|
|
152
|
+
values: Value[];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
156
|
+
* `Value` type union.
|
|
157
|
+
*
|
|
158
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
159
|
+
*
|
|
160
|
+
* @generated from protobuf enum shared.NullValue
|
|
161
|
+
*/
|
|
162
|
+
export enum NullValue {
|
|
163
|
+
/**
|
|
164
|
+
* Null value.
|
|
165
|
+
*
|
|
166
|
+
* @generated from protobuf enum value: NULL_VALUE = 0;
|
|
167
|
+
*/
|
|
168
|
+
NULL_VALUE = 0
|
|
169
|
+
}
|
|
170
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
171
|
+
class Struct$Type extends MessageType<Struct> {
|
|
172
|
+
constructor() {
|
|
173
|
+
super("shared.Struct", [
|
|
174
|
+
{ no: 1, name: "fields", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } }
|
|
175
|
+
]);
|
|
176
|
+
}
|
|
177
|
+
create(value?: PartialMessage<Struct>): Struct {
|
|
178
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
179
|
+
message.fields = {};
|
|
180
|
+
if (value !== undefined)
|
|
181
|
+
reflectionMergePartial<Struct>(this, message, value);
|
|
182
|
+
return message;
|
|
183
|
+
}
|
|
184
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Struct): Struct {
|
|
185
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
186
|
+
while (reader.pos < end) {
|
|
187
|
+
let [fieldNo, wireType] = reader.tag();
|
|
188
|
+
switch (fieldNo) {
|
|
189
|
+
case /* map<string, shared.Value> fields */ 1:
|
|
190
|
+
this.binaryReadMap1(message.fields, reader, options);
|
|
191
|
+
break;
|
|
192
|
+
default:
|
|
193
|
+
let u = options.readUnknownField;
|
|
194
|
+
if (u === "throw")
|
|
195
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
196
|
+
let d = reader.skip(wireType);
|
|
197
|
+
if (u !== false)
|
|
198
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return message;
|
|
202
|
+
}
|
|
203
|
+
private binaryReadMap1(map: Struct["fields"], reader: IBinaryReader, options: BinaryReadOptions): void {
|
|
204
|
+
let len = reader.uint32(), end = reader.pos + len, key: keyof Struct["fields"] | undefined, val: Struct["fields"][any] | undefined;
|
|
205
|
+
while (reader.pos < end) {
|
|
206
|
+
let [fieldNo, wireType] = reader.tag();
|
|
207
|
+
switch (fieldNo) {
|
|
208
|
+
case 1:
|
|
209
|
+
key = reader.string();
|
|
210
|
+
break;
|
|
211
|
+
case 2:
|
|
212
|
+
val = Value.internalBinaryRead(reader, reader.uint32(), options);
|
|
213
|
+
break;
|
|
214
|
+
default: throw new globalThis.Error("unknown map entry field for shared.Struct.fields");
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
map[key ?? ""] = val ?? Value.create();
|
|
218
|
+
}
|
|
219
|
+
internalBinaryWrite(message: Struct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
220
|
+
/* map<string, shared.Value> fields = 1; */
|
|
221
|
+
for (let k of globalThis.Object.keys(message.fields)) {
|
|
222
|
+
writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
|
|
223
|
+
writer.tag(2, WireType.LengthDelimited).fork();
|
|
224
|
+
Value.internalBinaryWrite(message.fields[k], writer, options);
|
|
225
|
+
writer.join().join();
|
|
226
|
+
}
|
|
227
|
+
let u = options.writeUnknownFields;
|
|
228
|
+
if (u !== false)
|
|
229
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
230
|
+
return writer;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* @generated MessageType for protobuf message shared.Struct
|
|
235
|
+
*/
|
|
236
|
+
export const Struct = new Struct$Type();
|
|
237
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
238
|
+
class Value$Type extends MessageType<Value> {
|
|
239
|
+
constructor() {
|
|
240
|
+
super("shared.Value", [
|
|
241
|
+
{ no: 1, name: "null_value", kind: "enum", oneof: "kind", T: () => ["shared.NullValue", NullValue] },
|
|
242
|
+
{ no: 2, name: "number_value", kind: "scalar", oneof: "kind", T: 1 /*ScalarType.DOUBLE*/ },
|
|
243
|
+
{ no: 3, name: "string_value", kind: "scalar", oneof: "kind", T: 9 /*ScalarType.STRING*/ },
|
|
244
|
+
{ no: 4, name: "bool_value", kind: "scalar", oneof: "kind", T: 8 /*ScalarType.BOOL*/ },
|
|
245
|
+
{ no: 5, name: "struct_value", kind: "message", oneof: "kind", T: () => Struct },
|
|
246
|
+
{ no: 6, name: "list_value", kind: "message", oneof: "kind", T: () => ListValue }
|
|
247
|
+
]);
|
|
248
|
+
}
|
|
249
|
+
create(value?: PartialMessage<Value>): Value {
|
|
250
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
251
|
+
message.kind = { oneofKind: undefined };
|
|
252
|
+
if (value !== undefined)
|
|
253
|
+
reflectionMergePartial<Value>(this, message, value);
|
|
254
|
+
return message;
|
|
255
|
+
}
|
|
256
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Value): Value {
|
|
257
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
258
|
+
while (reader.pos < end) {
|
|
259
|
+
let [fieldNo, wireType] = reader.tag();
|
|
260
|
+
switch (fieldNo) {
|
|
261
|
+
case /* shared.NullValue null_value */ 1:
|
|
262
|
+
message.kind = {
|
|
263
|
+
oneofKind: "nullValue",
|
|
264
|
+
nullValue: reader.int32()
|
|
265
|
+
};
|
|
266
|
+
break;
|
|
267
|
+
case /* double number_value */ 2:
|
|
268
|
+
message.kind = {
|
|
269
|
+
oneofKind: "numberValue",
|
|
270
|
+
numberValue: reader.double()
|
|
271
|
+
};
|
|
272
|
+
break;
|
|
273
|
+
case /* string string_value */ 3:
|
|
274
|
+
message.kind = {
|
|
275
|
+
oneofKind: "stringValue",
|
|
276
|
+
stringValue: reader.string()
|
|
277
|
+
};
|
|
278
|
+
break;
|
|
279
|
+
case /* bool bool_value */ 4:
|
|
280
|
+
message.kind = {
|
|
281
|
+
oneofKind: "boolValue",
|
|
282
|
+
boolValue: reader.bool()
|
|
283
|
+
};
|
|
284
|
+
break;
|
|
285
|
+
case /* shared.Struct struct_value */ 5:
|
|
286
|
+
message.kind = {
|
|
287
|
+
oneofKind: "structValue",
|
|
288
|
+
structValue: Struct.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).structValue)
|
|
289
|
+
};
|
|
290
|
+
break;
|
|
291
|
+
case /* shared.ListValue list_value */ 6:
|
|
292
|
+
message.kind = {
|
|
293
|
+
oneofKind: "listValue",
|
|
294
|
+
listValue: ListValue.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).listValue)
|
|
295
|
+
};
|
|
296
|
+
break;
|
|
297
|
+
default:
|
|
298
|
+
let u = options.readUnknownField;
|
|
299
|
+
if (u === "throw")
|
|
300
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
301
|
+
let d = reader.skip(wireType);
|
|
302
|
+
if (u !== false)
|
|
303
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return message;
|
|
307
|
+
}
|
|
308
|
+
internalBinaryWrite(message: Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
309
|
+
/* shared.NullValue null_value = 1; */
|
|
310
|
+
if (message.kind.oneofKind === "nullValue")
|
|
311
|
+
writer.tag(1, WireType.Varint).int32(message.kind.nullValue);
|
|
312
|
+
/* double number_value = 2; */
|
|
313
|
+
if (message.kind.oneofKind === "numberValue")
|
|
314
|
+
writer.tag(2, WireType.Bit64).double(message.kind.numberValue);
|
|
315
|
+
/* string string_value = 3; */
|
|
316
|
+
if (message.kind.oneofKind === "stringValue")
|
|
317
|
+
writer.tag(3, WireType.LengthDelimited).string(message.kind.stringValue);
|
|
318
|
+
/* bool bool_value = 4; */
|
|
319
|
+
if (message.kind.oneofKind === "boolValue")
|
|
320
|
+
writer.tag(4, WireType.Varint).bool(message.kind.boolValue);
|
|
321
|
+
/* shared.Struct struct_value = 5; */
|
|
322
|
+
if (message.kind.oneofKind === "structValue")
|
|
323
|
+
Struct.internalBinaryWrite(message.kind.structValue, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
|
|
324
|
+
/* shared.ListValue list_value = 6; */
|
|
325
|
+
if (message.kind.oneofKind === "listValue")
|
|
326
|
+
ListValue.internalBinaryWrite(message.kind.listValue, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
|
|
327
|
+
let u = options.writeUnknownFields;
|
|
328
|
+
if (u !== false)
|
|
329
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
330
|
+
return writer;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* @generated MessageType for protobuf message shared.Value
|
|
335
|
+
*/
|
|
336
|
+
export const Value = new Value$Type();
|
|
337
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
338
|
+
class ListValue$Type extends MessageType<ListValue> {
|
|
339
|
+
constructor() {
|
|
340
|
+
super("shared.ListValue", [
|
|
341
|
+
{ no: 1, name: "values", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Value }
|
|
342
|
+
]);
|
|
343
|
+
}
|
|
344
|
+
create(value?: PartialMessage<ListValue>): ListValue {
|
|
345
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
346
|
+
message.values = [];
|
|
347
|
+
if (value !== undefined)
|
|
348
|
+
reflectionMergePartial<ListValue>(this, message, value);
|
|
349
|
+
return message;
|
|
350
|
+
}
|
|
351
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListValue): ListValue {
|
|
352
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
353
|
+
while (reader.pos < end) {
|
|
354
|
+
let [fieldNo, wireType] = reader.tag();
|
|
355
|
+
switch (fieldNo) {
|
|
356
|
+
case /* repeated shared.Value values */ 1:
|
|
357
|
+
message.values.push(Value.internalBinaryRead(reader, reader.uint32(), options));
|
|
358
|
+
break;
|
|
359
|
+
default:
|
|
360
|
+
let u = options.readUnknownField;
|
|
361
|
+
if (u === "throw")
|
|
362
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
363
|
+
let d = reader.skip(wireType);
|
|
364
|
+
if (u !== false)
|
|
365
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return message;
|
|
369
|
+
}
|
|
370
|
+
internalBinaryWrite(message: ListValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
371
|
+
/* repeated shared.Value values = 1; */
|
|
372
|
+
for (let i = 0; i < message.values.length; i++)
|
|
373
|
+
Value.internalBinaryWrite(message.values[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
374
|
+
let u = options.writeUnknownFields;
|
|
375
|
+
if (u !== false)
|
|
376
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
377
|
+
return writer;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* @generated MessageType for protobuf message shared.ListValue
|
|
382
|
+
*/
|
|
383
|
+
export const ListValue = new ListValue$Type();
|