@tarkahq/sdk 0.0.0-stage → 0.3.0
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/LICENSE +201 -0
- package/NOTICE +69 -0
- package/README.md +700 -2
- package/api-source.json +38 -0
- package/dist/cjs/client.d.ts +114 -0
- package/dist/cjs/client.js +174 -0
- package/dist/cjs/errors.d.ts +27 -0
- package/dist/cjs/errors.js +78 -0
- package/dist/cjs/generated/google/api/annotations.d.ts +1 -0
- package/dist/cjs/generated/google/api/annotations.js +10 -0
- package/dist/cjs/generated/google/api/http.d.ts +395 -0
- package/dist/cjs/generated/google/api/http.js +421 -0
- package/dist/cjs/generated/google/protobuf/descriptor.d.ts +873 -0
- package/dist/cjs/generated/google/protobuf/descriptor.js +3992 -0
- package/dist/cjs/generated/google/protobuf/empty.d.ts +35 -0
- package/dist/cjs/generated/google/protobuf/empty.js +58 -0
- package/dist/cjs/generated/google/protobuf/struct.d.ts +127 -0
- package/dist/cjs/generated/google/protobuf/struct.js +529 -0
- package/dist/cjs/generated/google/protobuf/timestamp.d.ts +128 -0
- package/dist/cjs/generated/google/protobuf/timestamp.js +95 -0
- package/dist/cjs/generated/protoc-gen-openapiv2/options/annotations.d.ts +1 -0
- package/dist/cjs/generated/protoc-gen-openapiv2/options/annotations.js +10 -0
- package/dist/cjs/generated/protoc-gen-openapiv2/options/openapiv2.d.ts +983 -0
- package/dist/cjs/generated/protoc-gen-openapiv2/options/openapiv2.js +4874 -0
- package/dist/cjs/generated/tarka/access/v1/access.d.ts +322 -0
- package/dist/cjs/generated/tarka/access/v1/access.js +2979 -0
- package/dist/cjs/generated/tarka/channels/v1/channels.d.ts +370 -0
- package/dist/cjs/generated/tarka/channels/v1/channels.js +3603 -0
- package/dist/cjs/generated/tarka/gateway/v1/gateway.d.ts +804 -0
- package/dist/cjs/generated/tarka/gateway/v1/gateway.js +8081 -0
- package/dist/cjs/generated/tarka/iam/v1/iam.d.ts +1291 -0
- package/dist/cjs/generated/tarka/iam/v1/iam.js +13207 -0
- package/dist/cjs/generated/tarka/inference/v1/inference.d.ts +699 -0
- package/dist/cjs/generated/tarka/inference/v1/inference.js +7058 -0
- package/dist/cjs/generated/tarka/provisioning/v1/agent_secrets.d.ts +70 -0
- package/dist/cjs/generated/tarka/provisioning/v1/agent_secrets.js +603 -0
- package/dist/cjs/generated/tarka/provisioning/v1/billing_quote.d.ts +171 -0
- package/dist/cjs/generated/tarka/provisioning/v1/billing_quote.js +1588 -0
- package/dist/cjs/generated/tarka/provisioning/v1/job.d.ts +168 -0
- package/dist/cjs/generated/tarka/provisioning/v1/job.js +1505 -0
- package/dist/cjs/generated/tarka/provisioning/v1/provisioning.d.ts +2644 -0
- package/dist/cjs/generated/tarka/provisioning/v1/provisioning.js +19501 -0
- package/dist/cjs/generated/tarka/provisioning/v1/registry_credentials.d.ts +89 -0
- package/dist/cjs/generated/tarka/provisioning/v1/registry_credentials.js +856 -0
- package/dist/cjs/generated/tarka/provisioning/v1/sandbox.d.ts +431 -0
- package/dist/cjs/generated/tarka/provisioning/v1/sandbox.js +3203 -0
- package/dist/cjs/generated/tarka/provisioning/v1/source_builds.d.ts +291 -0
- package/dist/cjs/generated/tarka/provisioning/v1/source_builds.js +3920 -0
- package/dist/cjs/grpc.d.ts +12 -0
- package/dist/cjs/grpc.js +55 -0
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/resources/inference.d.ts +293 -0
- package/dist/cjs/resources/inference.js +451 -0
- package/dist/cjs/resources/provisioning.d.ts +389 -0
- package/dist/cjs/resources/provisioning.js +552 -0
- package/dist/cjs/resources/sandboxes.d.ts +360 -0
- package/dist/cjs/resources/sandboxes.js +732 -0
- package/dist/cjs/rpc-types.d.ts +36 -0
- package/dist/cjs/rpc-types.js +29 -0
- package/dist/cjs/runtime.d.ts +99 -0
- package/dist/cjs/runtime.js +473 -0
- package/dist/cjs/transport.d.ts +60 -0
- package/dist/cjs/transport.js +114 -0
- package/dist/cjs/types.d.ts +309 -0
- package/dist/cjs/types.js +2 -0
- package/dist/esm/client.d.ts +114 -0
- package/dist/esm/client.js +169 -0
- package/dist/esm/errors.d.ts +27 -0
- package/dist/esm/errors.js +71 -0
- package/dist/esm/generated/google/api/annotations.d.ts +1 -0
- package/dist/esm/generated/google/api/annotations.js +7 -0
- package/dist/esm/generated/google/api/http.d.ts +395 -0
- package/dist/esm/generated/google/api/http.js +418 -0
- package/dist/esm/generated/google/protobuf/descriptor.d.ts +873 -0
- package/dist/esm/generated/google/protobuf/descriptor.js +3977 -0
- package/dist/esm/generated/google/protobuf/empty.d.ts +35 -0
- package/dist/esm/generated/google/protobuf/empty.js +55 -0
- package/dist/esm/generated/google/protobuf/struct.d.ts +127 -0
- package/dist/esm/generated/google/protobuf/struct.js +524 -0
- package/dist/esm/generated/google/protobuf/timestamp.d.ts +128 -0
- package/dist/esm/generated/google/protobuf/timestamp.js +92 -0
- package/dist/esm/generated/protoc-gen-openapiv2/options/annotations.d.ts +1 -0
- package/dist/esm/generated/protoc-gen-openapiv2/options/annotations.js +7 -0
- package/dist/esm/generated/protoc-gen-openapiv2/options/openapiv2.d.ts +983 -0
- package/dist/esm/generated/protoc-gen-openapiv2/options/openapiv2.js +4859 -0
- package/dist/esm/generated/tarka/access/v1/access.d.ts +322 -0
- package/dist/esm/generated/tarka/access/v1/access.js +2976 -0
- package/dist/esm/generated/tarka/channels/v1/channels.d.ts +370 -0
- package/dist/esm/generated/tarka/channels/v1/channels.js +3600 -0
- package/dist/esm/generated/tarka/gateway/v1/gateway.d.ts +804 -0
- package/dist/esm/generated/tarka/gateway/v1/gateway.js +8077 -0
- package/dist/esm/generated/tarka/iam/v1/iam.d.ts +1291 -0
- package/dist/esm/generated/tarka/iam/v1/iam.js +13203 -0
- package/dist/esm/generated/tarka/inference/v1/inference.d.ts +699 -0
- package/dist/esm/generated/tarka/inference/v1/inference.js +7055 -0
- package/dist/esm/generated/tarka/provisioning/v1/agent_secrets.d.ts +70 -0
- package/dist/esm/generated/tarka/provisioning/v1/agent_secrets.js +600 -0
- package/dist/esm/generated/tarka/provisioning/v1/billing_quote.d.ts +171 -0
- package/dist/esm/generated/tarka/provisioning/v1/billing_quote.js +1585 -0
- package/dist/esm/generated/tarka/provisioning/v1/job.d.ts +168 -0
- package/dist/esm/generated/tarka/provisioning/v1/job.js +1500 -0
- package/dist/esm/generated/tarka/provisioning/v1/provisioning.d.ts +2644 -0
- package/dist/esm/generated/tarka/provisioning/v1/provisioning.js +19496 -0
- package/dist/esm/generated/tarka/provisioning/v1/registry_credentials.d.ts +89 -0
- package/dist/esm/generated/tarka/provisioning/v1/registry_credentials.js +853 -0
- package/dist/esm/generated/tarka/provisioning/v1/sandbox.d.ts +431 -0
- package/dist/esm/generated/tarka/provisioning/v1/sandbox.js +3192 -0
- package/dist/esm/generated/tarka/provisioning/v1/source_builds.d.ts +291 -0
- package/dist/esm/generated/tarka/provisioning/v1/source_builds.js +3917 -0
- package/dist/esm/grpc.d.ts +12 -0
- package/dist/esm/grpc.js +11 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/resources/inference.d.ts +293 -0
- package/dist/esm/resources/inference.js +437 -0
- package/dist/esm/resources/provisioning.d.ts +389 -0
- package/dist/esm/resources/provisioning.js +531 -0
- package/dist/esm/resources/sandboxes.d.ts +360 -0
- package/dist/esm/resources/sandboxes.js +718 -0
- package/dist/esm/rpc-types.d.ts +36 -0
- package/dist/esm/rpc-types.js +26 -0
- package/dist/esm/runtime.d.ts +99 -0
- package/dist/esm/runtime.js +466 -0
- package/dist/esm/transport.d.ts +60 -0
- package/dist/esm/transport.js +110 -0
- package/dist/esm/types.d.ts +309 -0
- package/dist/esm/types.js +1 -0
- package/package.json +155 -4
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.4
|
|
5
|
+
// protoc v3.19.1
|
|
6
|
+
// source: google/protobuf/struct.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ListValue = exports.Value = exports.Struct_FieldsEntry = exports.Struct = exports.NullValue = exports.protobufPackage = void 0;
|
|
9
|
+
exports.nullValueFromJSON = nullValueFromJSON;
|
|
10
|
+
exports.nullValueToJSON = nullValueToJSON;
|
|
11
|
+
/* eslint-disable */
|
|
12
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
13
|
+
exports.protobufPackage = "google.protobuf";
|
|
14
|
+
/**
|
|
15
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
16
|
+
* `Value` type union.
|
|
17
|
+
*
|
|
18
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
19
|
+
*/
|
|
20
|
+
var NullValue;
|
|
21
|
+
(function (NullValue) {
|
|
22
|
+
/** NULL_VALUE - Null value. */
|
|
23
|
+
NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
|
|
24
|
+
NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
25
|
+
})(NullValue || (exports.NullValue = NullValue = {}));
|
|
26
|
+
function nullValueFromJSON(object) {
|
|
27
|
+
switch (object) {
|
|
28
|
+
case 0:
|
|
29
|
+
case "NULL_VALUE":
|
|
30
|
+
return NullValue.NULL_VALUE;
|
|
31
|
+
case -1:
|
|
32
|
+
case "UNRECOGNIZED":
|
|
33
|
+
default:
|
|
34
|
+
return NullValue.UNRECOGNIZED;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function nullValueToJSON(object) {
|
|
38
|
+
switch (object) {
|
|
39
|
+
case NullValue.NULL_VALUE:
|
|
40
|
+
return "NULL_VALUE";
|
|
41
|
+
case NullValue.UNRECOGNIZED:
|
|
42
|
+
default:
|
|
43
|
+
return "UNRECOGNIZED";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function createBaseStruct() {
|
|
47
|
+
return { fields: {} };
|
|
48
|
+
}
|
|
49
|
+
exports.Struct = {
|
|
50
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
51
|
+
globalThis.Object.entries(message.fields).forEach(([key, value]) => {
|
|
52
|
+
if (value !== undefined) {
|
|
53
|
+
exports.Struct_FieldsEntry.encode({ key: key, value }, writer.uint32(10).fork()).join();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return writer;
|
|
57
|
+
},
|
|
58
|
+
decode(input, length) {
|
|
59
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
60
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
61
|
+
if (previousRecursionDepth >= 100) {
|
|
62
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
63
|
+
}
|
|
64
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
65
|
+
try {
|
|
66
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
67
|
+
const message = createBaseStruct();
|
|
68
|
+
while (reader.pos < end) {
|
|
69
|
+
const tag = reader.uint32();
|
|
70
|
+
switch (tag >>> 3) {
|
|
71
|
+
case 1: {
|
|
72
|
+
if (tag !== 10) {
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
const entry1 = exports.Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
76
|
+
if (entry1.value !== undefined) {
|
|
77
|
+
message.fields[entry1.key] = entry1.value;
|
|
78
|
+
}
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
reader.skip(tag & 7);
|
|
86
|
+
}
|
|
87
|
+
return message;
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
fromJSON(object) {
|
|
94
|
+
return {
|
|
95
|
+
fields: isObject(object.fields)
|
|
96
|
+
? globalThis.Object.entries(object.fields).reduce((acc, [key, value]) => {
|
|
97
|
+
globalThis.Object.defineProperty(acc, key, {
|
|
98
|
+
value: value,
|
|
99
|
+
enumerable: true,
|
|
100
|
+
configurable: true,
|
|
101
|
+
writable: true,
|
|
102
|
+
});
|
|
103
|
+
return acc;
|
|
104
|
+
}, {})
|
|
105
|
+
: {},
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
toJSON(message) {
|
|
109
|
+
const obj = {};
|
|
110
|
+
if (message.fields) {
|
|
111
|
+
const entries = globalThis.Object.entries(message.fields);
|
|
112
|
+
if (entries.length > 0) {
|
|
113
|
+
obj.fields = {};
|
|
114
|
+
entries.forEach(([k, v]) => {
|
|
115
|
+
obj.fields[k] = v;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return obj;
|
|
120
|
+
},
|
|
121
|
+
create(base) {
|
|
122
|
+
return exports.Struct.fromPartial(base ?? {});
|
|
123
|
+
},
|
|
124
|
+
fromPartial(object) {
|
|
125
|
+
const message = createBaseStruct();
|
|
126
|
+
message.fields = globalThis.Object.entries(object.fields ?? {}).reduce((acc, [key, value]) => {
|
|
127
|
+
if (value !== undefined) {
|
|
128
|
+
acc[key] = value;
|
|
129
|
+
}
|
|
130
|
+
return acc;
|
|
131
|
+
}, {});
|
|
132
|
+
return message;
|
|
133
|
+
},
|
|
134
|
+
wrap(object) {
|
|
135
|
+
const struct = createBaseStruct();
|
|
136
|
+
if (object !== undefined) {
|
|
137
|
+
for (const key of globalThis.Object.keys(object)) {
|
|
138
|
+
struct.fields[key] = object[key];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return struct;
|
|
142
|
+
},
|
|
143
|
+
unwrap(message) {
|
|
144
|
+
const object = {};
|
|
145
|
+
if (message.fields) {
|
|
146
|
+
for (const key of globalThis.Object.keys(message.fields)) {
|
|
147
|
+
object[key] = message.fields[key];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return object;
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
function createBaseStruct_FieldsEntry() {
|
|
154
|
+
return { key: "", value: undefined };
|
|
155
|
+
}
|
|
156
|
+
exports.Struct_FieldsEntry = {
|
|
157
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
158
|
+
if (message.key !== "") {
|
|
159
|
+
writer.uint32(10).string(message.key);
|
|
160
|
+
}
|
|
161
|
+
if (message.value !== undefined) {
|
|
162
|
+
exports.Value.encode(exports.Value.wrap(message.value), writer.uint32(18).fork()).join();
|
|
163
|
+
}
|
|
164
|
+
return writer;
|
|
165
|
+
},
|
|
166
|
+
decode(input, length) {
|
|
167
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
168
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
169
|
+
if (previousRecursionDepth >= 100) {
|
|
170
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
171
|
+
}
|
|
172
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
173
|
+
try {
|
|
174
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
175
|
+
const message = createBaseStruct_FieldsEntry();
|
|
176
|
+
while (reader.pos < end) {
|
|
177
|
+
const tag = reader.uint32();
|
|
178
|
+
switch (tag >>> 3) {
|
|
179
|
+
case 1: {
|
|
180
|
+
if (tag !== 10) {
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
message.key = reader.string();
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
case 2: {
|
|
187
|
+
if (tag !== 18) {
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
message.value = exports.Value.unwrap(exports.Value.decode(reader, reader.uint32()));
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
reader.skip(tag & 7);
|
|
198
|
+
}
|
|
199
|
+
return message;
|
|
200
|
+
}
|
|
201
|
+
finally {
|
|
202
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
fromJSON(object) {
|
|
206
|
+
return {
|
|
207
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
208
|
+
value: isSet(object?.value) ? object.value : undefined,
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
toJSON(message) {
|
|
212
|
+
const obj = {};
|
|
213
|
+
if (message.key !== "") {
|
|
214
|
+
obj.key = message.key;
|
|
215
|
+
}
|
|
216
|
+
if (message.value !== undefined) {
|
|
217
|
+
obj.value = message.value;
|
|
218
|
+
}
|
|
219
|
+
return obj;
|
|
220
|
+
},
|
|
221
|
+
create(base) {
|
|
222
|
+
return exports.Struct_FieldsEntry.fromPartial(base ?? {});
|
|
223
|
+
},
|
|
224
|
+
fromPartial(object) {
|
|
225
|
+
const message = createBaseStruct_FieldsEntry();
|
|
226
|
+
message.key = object.key ?? "";
|
|
227
|
+
message.value = object.value ?? undefined;
|
|
228
|
+
return message;
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
function createBaseValue() {
|
|
232
|
+
return { kind: undefined };
|
|
233
|
+
}
|
|
234
|
+
exports.Value = {
|
|
235
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
236
|
+
switch (message.kind?.$case) {
|
|
237
|
+
case "nullValue":
|
|
238
|
+
writer.uint32(8).int32(message.kind.value);
|
|
239
|
+
break;
|
|
240
|
+
case "numberValue":
|
|
241
|
+
writer.uint32(17).double(message.kind.value);
|
|
242
|
+
break;
|
|
243
|
+
case "stringValue":
|
|
244
|
+
writer.uint32(26).string(message.kind.value);
|
|
245
|
+
break;
|
|
246
|
+
case "boolValue":
|
|
247
|
+
writer.uint32(32).bool(message.kind.value);
|
|
248
|
+
break;
|
|
249
|
+
case "structValue":
|
|
250
|
+
exports.Struct.encode(exports.Struct.wrap(message.kind.value), writer.uint32(42).fork()).join();
|
|
251
|
+
break;
|
|
252
|
+
case "listValue":
|
|
253
|
+
exports.ListValue.encode(exports.ListValue.wrap(message.kind.value), writer.uint32(50).fork()).join();
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
return writer;
|
|
257
|
+
},
|
|
258
|
+
decode(input, length) {
|
|
259
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
260
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
261
|
+
if (previousRecursionDepth >= 100) {
|
|
262
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
263
|
+
}
|
|
264
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
265
|
+
try {
|
|
266
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
267
|
+
const message = createBaseValue();
|
|
268
|
+
while (reader.pos < end) {
|
|
269
|
+
const tag = reader.uint32();
|
|
270
|
+
switch (tag >>> 3) {
|
|
271
|
+
case 1: {
|
|
272
|
+
if (tag !== 8) {
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
message.kind = { $case: "nullValue", value: reader.int32() };
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
case 2: {
|
|
279
|
+
if (tag !== 17) {
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
message.kind = { $case: "numberValue", value: reader.double() };
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
case 3: {
|
|
286
|
+
if (tag !== 26) {
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
message.kind = { $case: "stringValue", value: reader.string() };
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
case 4: {
|
|
293
|
+
if (tag !== 32) {
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
message.kind = { $case: "boolValue", value: reader.bool() };
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
case 5: {
|
|
300
|
+
if (tag !== 42) {
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
message.kind = { $case: "structValue", value: exports.Struct.unwrap(exports.Struct.decode(reader, reader.uint32())) };
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
case 6: {
|
|
307
|
+
if (tag !== 50) {
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
message.kind = { $case: "listValue", value: exports.ListValue.unwrap(exports.ListValue.decode(reader, reader.uint32())) };
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
reader.skip(tag & 7);
|
|
318
|
+
}
|
|
319
|
+
return message;
|
|
320
|
+
}
|
|
321
|
+
finally {
|
|
322
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
fromJSON(object) {
|
|
326
|
+
return {
|
|
327
|
+
kind: isSet(object.nullValue)
|
|
328
|
+
? { $case: "nullValue", value: nullValueFromJSON(object.nullValue) }
|
|
329
|
+
: isSet(object.null_value)
|
|
330
|
+
? { $case: "nullValue", value: nullValueFromJSON(object.null_value) }
|
|
331
|
+
: isSet(object.numberValue)
|
|
332
|
+
? { $case: "numberValue", value: globalThis.Number(object.numberValue) }
|
|
333
|
+
: isSet(object.number_value)
|
|
334
|
+
? { $case: "numberValue", value: globalThis.Number(object.number_value) }
|
|
335
|
+
: isSet(object.stringValue)
|
|
336
|
+
? { $case: "stringValue", value: globalThis.String(object.stringValue) }
|
|
337
|
+
: isSet(object.string_value)
|
|
338
|
+
? { $case: "stringValue", value: globalThis.String(object.string_value) }
|
|
339
|
+
: isSet(object.boolValue)
|
|
340
|
+
? { $case: "boolValue", value: globalThis.Boolean(object.boolValue) }
|
|
341
|
+
: isSet(object.bool_value)
|
|
342
|
+
? { $case: "boolValue", value: globalThis.Boolean(object.bool_value) }
|
|
343
|
+
: isSet(object.structValue)
|
|
344
|
+
? { $case: "structValue", value: object.structValue }
|
|
345
|
+
: isSet(object.struct_value)
|
|
346
|
+
? { $case: "structValue", value: object.struct_value }
|
|
347
|
+
: isSet(object.listValue)
|
|
348
|
+
? { $case: "listValue", value: [...object.listValue] }
|
|
349
|
+
: isSet(object.list_value)
|
|
350
|
+
? { $case: "listValue", value: [...object.list_value] }
|
|
351
|
+
: undefined,
|
|
352
|
+
};
|
|
353
|
+
},
|
|
354
|
+
toJSON(message) {
|
|
355
|
+
const obj = {};
|
|
356
|
+
if (message.kind?.$case === "nullValue") {
|
|
357
|
+
obj.nullValue = nullValueToJSON(message.kind.value);
|
|
358
|
+
}
|
|
359
|
+
else if (message.kind?.$case === "numberValue") {
|
|
360
|
+
obj.numberValue = message.kind.value;
|
|
361
|
+
}
|
|
362
|
+
else if (message.kind?.$case === "stringValue") {
|
|
363
|
+
obj.stringValue = message.kind.value;
|
|
364
|
+
}
|
|
365
|
+
else if (message.kind?.$case === "boolValue") {
|
|
366
|
+
obj.boolValue = message.kind.value;
|
|
367
|
+
}
|
|
368
|
+
else if (message.kind?.$case === "structValue") {
|
|
369
|
+
obj.structValue = message.kind.value;
|
|
370
|
+
}
|
|
371
|
+
else if (message.kind?.$case === "listValue") {
|
|
372
|
+
obj.listValue = message.kind.value;
|
|
373
|
+
}
|
|
374
|
+
return obj;
|
|
375
|
+
},
|
|
376
|
+
create(base) {
|
|
377
|
+
return exports.Value.fromPartial(base ?? {});
|
|
378
|
+
},
|
|
379
|
+
fromPartial(object) {
|
|
380
|
+
const message = createBaseValue();
|
|
381
|
+
switch (object.kind?.$case) {
|
|
382
|
+
case "nullValue": {
|
|
383
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
384
|
+
message.kind = { $case: "nullValue", value: object.kind.value };
|
|
385
|
+
}
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
case "numberValue": {
|
|
389
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
390
|
+
message.kind = { $case: "numberValue", value: object.kind.value };
|
|
391
|
+
}
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
case "stringValue": {
|
|
395
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
396
|
+
message.kind = { $case: "stringValue", value: object.kind.value };
|
|
397
|
+
}
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
case "boolValue": {
|
|
401
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
402
|
+
message.kind = { $case: "boolValue", value: object.kind.value };
|
|
403
|
+
}
|
|
404
|
+
break;
|
|
405
|
+
}
|
|
406
|
+
case "structValue": {
|
|
407
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
408
|
+
message.kind = { $case: "structValue", value: object.kind.value };
|
|
409
|
+
}
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
case "listValue": {
|
|
413
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
414
|
+
message.kind = { $case: "listValue", value: object.kind.value };
|
|
415
|
+
}
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return message;
|
|
420
|
+
},
|
|
421
|
+
wrap(value) {
|
|
422
|
+
const result = createBaseValue();
|
|
423
|
+
if (value === null) {
|
|
424
|
+
result.kind = { $case: "nullValue", value: NullValue.NULL_VALUE };
|
|
425
|
+
}
|
|
426
|
+
else if (typeof value === "boolean") {
|
|
427
|
+
result.kind = { $case: "boolValue", value };
|
|
428
|
+
}
|
|
429
|
+
else if (typeof value === "number") {
|
|
430
|
+
result.kind = { $case: "numberValue", value };
|
|
431
|
+
}
|
|
432
|
+
else if (typeof value === "string") {
|
|
433
|
+
result.kind = { $case: "stringValue", value };
|
|
434
|
+
}
|
|
435
|
+
else if (globalThis.Array.isArray(value)) {
|
|
436
|
+
result.kind = { $case: "listValue", value };
|
|
437
|
+
}
|
|
438
|
+
else if (typeof value === "object") {
|
|
439
|
+
result.kind = { $case: "structValue", value };
|
|
440
|
+
}
|
|
441
|
+
else if (typeof value !== "undefined") {
|
|
442
|
+
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
443
|
+
}
|
|
444
|
+
return result;
|
|
445
|
+
},
|
|
446
|
+
unwrap(message) {
|
|
447
|
+
return (message.kind?.$case === "nullValue") ? null : message.kind?.value;
|
|
448
|
+
},
|
|
449
|
+
};
|
|
450
|
+
function createBaseListValue() {
|
|
451
|
+
return { values: [] };
|
|
452
|
+
}
|
|
453
|
+
exports.ListValue = {
|
|
454
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
455
|
+
for (const v of message.values) {
|
|
456
|
+
exports.Value.encode(exports.Value.wrap(v), writer.uint32(10).fork()).join();
|
|
457
|
+
}
|
|
458
|
+
return writer;
|
|
459
|
+
},
|
|
460
|
+
decode(input, length) {
|
|
461
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
462
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
463
|
+
if (previousRecursionDepth >= 100) {
|
|
464
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
465
|
+
}
|
|
466
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
467
|
+
try {
|
|
468
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
469
|
+
const message = createBaseListValue();
|
|
470
|
+
while (reader.pos < end) {
|
|
471
|
+
const tag = reader.uint32();
|
|
472
|
+
switch (tag >>> 3) {
|
|
473
|
+
case 1: {
|
|
474
|
+
if (tag !== 10) {
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
message.values.push(exports.Value.unwrap(exports.Value.decode(reader, reader.uint32())));
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
reader.skip(tag & 7);
|
|
485
|
+
}
|
|
486
|
+
return message;
|
|
487
|
+
}
|
|
488
|
+
finally {
|
|
489
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
fromJSON(object) {
|
|
493
|
+
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
|
494
|
+
},
|
|
495
|
+
toJSON(message) {
|
|
496
|
+
const obj = {};
|
|
497
|
+
if (message.values?.length) {
|
|
498
|
+
obj.values = message.values;
|
|
499
|
+
}
|
|
500
|
+
return obj;
|
|
501
|
+
},
|
|
502
|
+
create(base) {
|
|
503
|
+
return exports.ListValue.fromPartial(base ?? {});
|
|
504
|
+
},
|
|
505
|
+
fromPartial(object) {
|
|
506
|
+
const message = createBaseListValue();
|
|
507
|
+
message.values = object.values?.map((e) => e) || [];
|
|
508
|
+
return message;
|
|
509
|
+
},
|
|
510
|
+
wrap(array) {
|
|
511
|
+
const result = createBaseListValue();
|
|
512
|
+
result.values = array ?? [];
|
|
513
|
+
return result;
|
|
514
|
+
},
|
|
515
|
+
unwrap(message) {
|
|
516
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
517
|
+
return message.values;
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
return message;
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
};
|
|
524
|
+
function isObject(value) {
|
|
525
|
+
return typeof value === "object" && value !== null;
|
|
526
|
+
}
|
|
527
|
+
function isSet(value) {
|
|
528
|
+
return value !== null && value !== undefined;
|
|
529
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "google.protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
5
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
6
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
7
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
8
|
+
* Gregorian calendar backwards to year one.
|
|
9
|
+
*
|
|
10
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
11
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
12
|
+
* smear](https://developers.google.com/time/smear).
|
|
13
|
+
*
|
|
14
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
15
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
16
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
17
|
+
*
|
|
18
|
+
* # Examples
|
|
19
|
+
*
|
|
20
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
21
|
+
*
|
|
22
|
+
* Timestamp timestamp;
|
|
23
|
+
* timestamp.set_seconds(time(NULL));
|
|
24
|
+
* timestamp.set_nanos(0);
|
|
25
|
+
*
|
|
26
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
27
|
+
*
|
|
28
|
+
* struct timeval tv;
|
|
29
|
+
* gettimeofday(&tv, NULL);
|
|
30
|
+
*
|
|
31
|
+
* Timestamp timestamp;
|
|
32
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
33
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
34
|
+
*
|
|
35
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
36
|
+
*
|
|
37
|
+
* FILETIME ft;
|
|
38
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
39
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
40
|
+
*
|
|
41
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
42
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
43
|
+
* Timestamp timestamp;
|
|
44
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
45
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
46
|
+
*
|
|
47
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
48
|
+
*
|
|
49
|
+
* long millis = System.currentTimeMillis();
|
|
50
|
+
*
|
|
51
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
52
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
53
|
+
*
|
|
54
|
+
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
55
|
+
*
|
|
56
|
+
* Instant now = Instant.now();
|
|
57
|
+
*
|
|
58
|
+
* Timestamp timestamp =
|
|
59
|
+
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
60
|
+
* .setNanos(now.getNano()).build();
|
|
61
|
+
*
|
|
62
|
+
* Example 6: Compute Timestamp from current time in Python.
|
|
63
|
+
*
|
|
64
|
+
* timestamp = Timestamp()
|
|
65
|
+
* timestamp.GetCurrentTime()
|
|
66
|
+
*
|
|
67
|
+
* # JSON Mapping
|
|
68
|
+
*
|
|
69
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
70
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
71
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
72
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
73
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
74
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
75
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
76
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
77
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
78
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
79
|
+
*
|
|
80
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
81
|
+
* 01:30 UTC on January 15, 2017.
|
|
82
|
+
*
|
|
83
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
84
|
+
* standard
|
|
85
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
86
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
87
|
+
* to this format using
|
|
88
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
89
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
90
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
91
|
+
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
|
92
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
93
|
+
*/
|
|
94
|
+
export interface Timestamp {
|
|
95
|
+
/**
|
|
96
|
+
* Represents seconds of UTC time since Unix epoch
|
|
97
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
98
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
99
|
+
*/
|
|
100
|
+
seconds: bigint;
|
|
101
|
+
/**
|
|
102
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
103
|
+
* second values with fractions must still have non-negative nanos values
|
|
104
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
105
|
+
* inclusive.
|
|
106
|
+
*/
|
|
107
|
+
nanos: number;
|
|
108
|
+
}
|
|
109
|
+
export declare const Timestamp: MessageFns<Timestamp>;
|
|
110
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
111
|
+
export type DeepPartial<T> = T extends bigint ? string | number | bigint : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
112
|
+
$case: string;
|
|
113
|
+
value: unknown;
|
|
114
|
+
} ? {
|
|
115
|
+
$case: T["$case"];
|
|
116
|
+
value?: DeepPartial<T["value"]>;
|
|
117
|
+
} : T extends {} ? {
|
|
118
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
119
|
+
} : Partial<T>;
|
|
120
|
+
export interface MessageFns<T> {
|
|
121
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
122
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
123
|
+
fromJSON(object: any): T;
|
|
124
|
+
toJSON(message: T): unknown;
|
|
125
|
+
create(base?: DeepPartial<T>): T;
|
|
126
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
127
|
+
}
|
|
128
|
+
export {};
|