@world-engines/protocol-ts 0.1.0-alpha.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 +46 -0
- package/dist/entity-prop-envelope.d.ts +36 -0
- package/dist/entity-prop-envelope.js +50 -0
- package/dist/gen/v1/auth.d.ts +46 -0
- package/dist/gen/v1/auth.js +278 -0
- package/dist/gen/v1/billing.d.ts +71 -0
- package/dist/gen/v1/billing.js +521 -0
- package/dist/gen/v1/common.d.ts +65 -0
- package/dist/gen/v1/common.js +387 -0
- package/dist/gen/v1/llm.d.ts +317 -0
- package/dist/gen/v1/llm.js +3557 -0
- package/dist/gen/v1/mcp.d.ts +373 -0
- package/dist/gen/v1/mcp.js +3190 -0
- package/dist/gen/v1/moderation.d.ts +51 -0
- package/dist/gen/v1/moderation.js +368 -0
- package/dist/gen/v1/neutral_scenario_source.d.ts +80 -0
- package/dist/gen/v1/neutral_scenario_source.js +569 -0
- package/dist/gen/v1/relation_kind.d.ts +105 -0
- package/dist/gen/v1/relation_kind.js +562 -0
- package/dist/gen/v1/rest/admin.d.ts +432 -0
- package/dist/gen/v1/rest/admin.js +4957 -0
- package/dist/gen/v1/rest/asset.d.ts +205 -0
- package/dist/gen/v1/rest/asset.js +2200 -0
- package/dist/gen/v1/rest/auth.d.ts +275 -0
- package/dist/gen/v1/rest/auth.js +2896 -0
- package/dist/gen/v1/rest/billing.d.ts +101 -0
- package/dist/gen/v1/rest/billing.js +866 -0
- package/dist/gen/v1/rest/common.d.ts +179 -0
- package/dist/gen/v1/rest/common.js +1358 -0
- package/dist/gen/v1/rest/creator.d.ts +354 -0
- package/dist/gen/v1/rest/creator.js +4169 -0
- package/dist/gen/v1/rest/messaging.d.ts +190 -0
- package/dist/gen/v1/rest/messaging.js +2017 -0
- package/dist/gen/v1/rest/moderation.d.ts +61 -0
- package/dist/gen/v1/rest/moderation.js +569 -0
- package/dist/gen/v1/rest/pet.d.ts +98 -0
- package/dist/gen/v1/rest/pet.js +698 -0
- package/dist/gen/v1/rest/project_transfer.d.ts +470 -0
- package/dist/gen/v1/rest/project_transfer.js +5266 -0
- package/dist/gen/v1/rest/scenario.d.ts +756 -0
- package/dist/gen/v1/rest/scenario.js +8768 -0
- package/dist/gen/v1/rest/stock_bounty.d.ts +154 -0
- package/dist/gen/v1/rest/stock_bounty.js +1547 -0
- package/dist/gen/v1/rest/stocks.d.ts +465 -0
- package/dist/gen/v1/rest/stocks.js +5200 -0
- package/dist/gen/v1/rest/support_ticket.d.ts +61 -0
- package/dist/gen/v1/rest/support_ticket.js +511 -0
- package/dist/gen/v1/rest/users.d.ts +292 -0
- package/dist/gen/v1/rest/users.js +2879 -0
- package/dist/gen/v1/rest/violations.d.ts +52 -0
- package/dist/gen/v1/rest/violations.js +338 -0
- package/dist/gen/v1/sav.d.ts +987 -0
- package/dist/gen/v1/sav.js +12327 -0
- package/dist/gen/v1/save.d.ts +68 -0
- package/dist/gen/v1/save.js +595 -0
- package/dist/gen/v1/scenario_part_source.d.ts +94 -0
- package/dist/gen/v1/scenario_part_source.js +913 -0
- package/dist/gen/v1/session.d.ts +49 -0
- package/dist/gen/v1/session.js +311 -0
- package/dist/gen/v1/view_state.d.ts +267 -0
- package/dist/gen/v1/view_state.js +3239 -0
- package/dist/gen/v1/world.d.ts +82 -0
- package/dist/gen/v1/world.js +707 -0
- package/dist/gen/v1/world_memory.d.ts +545 -0
- package/dist/gen/v1/world_memory.js +5816 -0
- package/dist/gen/v1/world_memory_privacy.d.ts +96 -0
- package/dist/gen/v1/world_memory_privacy.js +994 -0
- package/dist/gen/v1/ws_frame.d.ts +1626 -0
- package/dist/gen/v1/ws_frame.js +18253 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/ladybug-extraction.d.ts +36 -0
- package/dist/ladybug-extraction.js +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.12.0
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: v1/billing.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { ErrorInfo } from "./common.js";
|
|
9
|
+
export var PaymentMethod;
|
|
10
|
+
(function (PaymentMethod) {
|
|
11
|
+
PaymentMethod[PaymentMethod["PAYMENT_METHOD_UNSPECIFIED"] = 0] = "PAYMENT_METHOD_UNSPECIFIED";
|
|
12
|
+
PaymentMethod[PaymentMethod["PAYMENT_METHOD_STRIPE_CARD"] = 1] = "PAYMENT_METHOD_STRIPE_CARD";
|
|
13
|
+
PaymentMethod[PaymentMethod["PAYMENT_METHOD_STRIPE_APPLE_PAY"] = 2] = "PAYMENT_METHOD_STRIPE_APPLE_PAY";
|
|
14
|
+
PaymentMethod[PaymentMethod["PAYMENT_METHOD_STRIPE_GOOGLE_PAY"] = 3] = "PAYMENT_METHOD_STRIPE_GOOGLE_PAY";
|
|
15
|
+
PaymentMethod[PaymentMethod["PAYMENT_METHOD_STRIPE_PAYPAL"] = 4] = "PAYMENT_METHOD_STRIPE_PAYPAL";
|
|
16
|
+
PaymentMethod[PaymentMethod["PAYMENT_METHOD_FOURTH_PARTY_ALIPAY"] = 5] = "PAYMENT_METHOD_FOURTH_PARTY_ALIPAY";
|
|
17
|
+
PaymentMethod[PaymentMethod["PAYMENT_METHOD_FOURTH_PARTY_WECHAT"] = 6] = "PAYMENT_METHOD_FOURTH_PARTY_WECHAT";
|
|
18
|
+
PaymentMethod[PaymentMethod["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(PaymentMethod || (PaymentMethod = {}));
|
|
20
|
+
export function paymentMethodFromJSON(object) {
|
|
21
|
+
switch (object) {
|
|
22
|
+
case 0:
|
|
23
|
+
case "PAYMENT_METHOD_UNSPECIFIED":
|
|
24
|
+
return PaymentMethod.PAYMENT_METHOD_UNSPECIFIED;
|
|
25
|
+
case 1:
|
|
26
|
+
case "PAYMENT_METHOD_STRIPE_CARD":
|
|
27
|
+
return PaymentMethod.PAYMENT_METHOD_STRIPE_CARD;
|
|
28
|
+
case 2:
|
|
29
|
+
case "PAYMENT_METHOD_STRIPE_APPLE_PAY":
|
|
30
|
+
return PaymentMethod.PAYMENT_METHOD_STRIPE_APPLE_PAY;
|
|
31
|
+
case 3:
|
|
32
|
+
case "PAYMENT_METHOD_STRIPE_GOOGLE_PAY":
|
|
33
|
+
return PaymentMethod.PAYMENT_METHOD_STRIPE_GOOGLE_PAY;
|
|
34
|
+
case 4:
|
|
35
|
+
case "PAYMENT_METHOD_STRIPE_PAYPAL":
|
|
36
|
+
return PaymentMethod.PAYMENT_METHOD_STRIPE_PAYPAL;
|
|
37
|
+
case 5:
|
|
38
|
+
case "PAYMENT_METHOD_FOURTH_PARTY_ALIPAY":
|
|
39
|
+
return PaymentMethod.PAYMENT_METHOD_FOURTH_PARTY_ALIPAY;
|
|
40
|
+
case 6:
|
|
41
|
+
case "PAYMENT_METHOD_FOURTH_PARTY_WECHAT":
|
|
42
|
+
return PaymentMethod.PAYMENT_METHOD_FOURTH_PARTY_WECHAT;
|
|
43
|
+
case -1:
|
|
44
|
+
case "UNRECOGNIZED":
|
|
45
|
+
default:
|
|
46
|
+
return PaymentMethod.UNRECOGNIZED;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function paymentMethodToJSON(object) {
|
|
50
|
+
switch (object) {
|
|
51
|
+
case PaymentMethod.PAYMENT_METHOD_UNSPECIFIED:
|
|
52
|
+
return "PAYMENT_METHOD_UNSPECIFIED";
|
|
53
|
+
case PaymentMethod.PAYMENT_METHOD_STRIPE_CARD:
|
|
54
|
+
return "PAYMENT_METHOD_STRIPE_CARD";
|
|
55
|
+
case PaymentMethod.PAYMENT_METHOD_STRIPE_APPLE_PAY:
|
|
56
|
+
return "PAYMENT_METHOD_STRIPE_APPLE_PAY";
|
|
57
|
+
case PaymentMethod.PAYMENT_METHOD_STRIPE_GOOGLE_PAY:
|
|
58
|
+
return "PAYMENT_METHOD_STRIPE_GOOGLE_PAY";
|
|
59
|
+
case PaymentMethod.PAYMENT_METHOD_STRIPE_PAYPAL:
|
|
60
|
+
return "PAYMENT_METHOD_STRIPE_PAYPAL";
|
|
61
|
+
case PaymentMethod.PAYMENT_METHOD_FOURTH_PARTY_ALIPAY:
|
|
62
|
+
return "PAYMENT_METHOD_FOURTH_PARTY_ALIPAY";
|
|
63
|
+
case PaymentMethod.PAYMENT_METHOD_FOURTH_PARTY_WECHAT:
|
|
64
|
+
return "PAYMENT_METHOD_FOURTH_PARTY_WECHAT";
|
|
65
|
+
case PaymentMethod.UNRECOGNIZED:
|
|
66
|
+
default:
|
|
67
|
+
return "UNRECOGNIZED";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function createBaseWalletBalance() {
|
|
71
|
+
return { top_up_balance_units: "0", credit_balance_units: "0", currency: "", _unknownFields: {} };
|
|
72
|
+
}
|
|
73
|
+
export const WalletBalance = {
|
|
74
|
+
encode(message, writer = new BinaryWriter()) {
|
|
75
|
+
if (message.top_up_balance_units !== "0") {
|
|
76
|
+
writer.uint32(8).int64(message.top_up_balance_units);
|
|
77
|
+
}
|
|
78
|
+
if (message.credit_balance_units !== "0") {
|
|
79
|
+
writer.uint32(16).int64(message.credit_balance_units);
|
|
80
|
+
}
|
|
81
|
+
if (message.currency !== "") {
|
|
82
|
+
writer.uint32(26).string(message.currency);
|
|
83
|
+
}
|
|
84
|
+
if (message._unknownFields !== undefined) {
|
|
85
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
86
|
+
const tag = parseInt(key, 10);
|
|
87
|
+
for (const value of values) {
|
|
88
|
+
writer.uint32(tag).raw(value);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return writer;
|
|
93
|
+
},
|
|
94
|
+
decode(input, length) {
|
|
95
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
96
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
97
|
+
const message = createBaseWalletBalance();
|
|
98
|
+
while (reader.pos < end) {
|
|
99
|
+
const tag = reader.uint32();
|
|
100
|
+
switch (tag >>> 3) {
|
|
101
|
+
case 1: {
|
|
102
|
+
if (tag !== 8) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
message.top_up_balance_units = reader.int64().toString();
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
case 2: {
|
|
109
|
+
if (tag !== 16) {
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
message.credit_balance_units = reader.int64().toString();
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
case 3: {
|
|
116
|
+
if (tag !== 26) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
message.currency = reader.string();
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
const buf = reader.skip(tag & 7);
|
|
127
|
+
const list = message._unknownFields[tag];
|
|
128
|
+
if (list === undefined) {
|
|
129
|
+
message._unknownFields[tag] = [buf];
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
list.push(buf);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return message;
|
|
136
|
+
},
|
|
137
|
+
fromJSON(object) {
|
|
138
|
+
return {
|
|
139
|
+
top_up_balance_units: isSet(object.topUpBalanceUnits)
|
|
140
|
+
? globalThis.String(object.topUpBalanceUnits)
|
|
141
|
+
: isSet(object.top_up_balance_units)
|
|
142
|
+
? globalThis.String(object.top_up_balance_units)
|
|
143
|
+
: "0",
|
|
144
|
+
credit_balance_units: isSet(object.creditBalanceUnits)
|
|
145
|
+
? globalThis.String(object.creditBalanceUnits)
|
|
146
|
+
: isSet(object.credit_balance_units)
|
|
147
|
+
? globalThis.String(object.credit_balance_units)
|
|
148
|
+
: "0",
|
|
149
|
+
currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
toJSON(message) {
|
|
153
|
+
const obj = {};
|
|
154
|
+
if (message.top_up_balance_units !== "0") {
|
|
155
|
+
obj.topUpBalanceUnits = message.top_up_balance_units;
|
|
156
|
+
}
|
|
157
|
+
if (message.credit_balance_units !== "0") {
|
|
158
|
+
obj.creditBalanceUnits = message.credit_balance_units;
|
|
159
|
+
}
|
|
160
|
+
if (message.currency !== "") {
|
|
161
|
+
obj.currency = message.currency;
|
|
162
|
+
}
|
|
163
|
+
return obj;
|
|
164
|
+
},
|
|
165
|
+
create(base) {
|
|
166
|
+
return WalletBalance.fromPartial(base ?? {});
|
|
167
|
+
},
|
|
168
|
+
fromPartial(object) {
|
|
169
|
+
const message = createBaseWalletBalance();
|
|
170
|
+
message.top_up_balance_units = object.top_up_balance_units ?? "0";
|
|
171
|
+
message.credit_balance_units = object.credit_balance_units ?? "0";
|
|
172
|
+
message.currency = object.currency ?? "";
|
|
173
|
+
return message;
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
function createBaseTopUpIntent() {
|
|
177
|
+
return { amount_units: "0", currency: "", payment_method: "", _unknownFields: {} };
|
|
178
|
+
}
|
|
179
|
+
export const TopUpIntent = {
|
|
180
|
+
encode(message, writer = new BinaryWriter()) {
|
|
181
|
+
if (message.amount_units !== "0") {
|
|
182
|
+
writer.uint32(8).int64(message.amount_units);
|
|
183
|
+
}
|
|
184
|
+
if (message.currency !== "") {
|
|
185
|
+
writer.uint32(18).string(message.currency);
|
|
186
|
+
}
|
|
187
|
+
if (message.payment_method !== "") {
|
|
188
|
+
writer.uint32(26).string(message.payment_method);
|
|
189
|
+
}
|
|
190
|
+
if (message._unknownFields !== undefined) {
|
|
191
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
192
|
+
const tag = parseInt(key, 10);
|
|
193
|
+
for (const value of values) {
|
|
194
|
+
writer.uint32(tag).raw(value);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return writer;
|
|
199
|
+
},
|
|
200
|
+
decode(input, length) {
|
|
201
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
202
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
203
|
+
const message = createBaseTopUpIntent();
|
|
204
|
+
while (reader.pos < end) {
|
|
205
|
+
const tag = reader.uint32();
|
|
206
|
+
switch (tag >>> 3) {
|
|
207
|
+
case 1: {
|
|
208
|
+
if (tag !== 8) {
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
message.amount_units = reader.int64().toString();
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
case 2: {
|
|
215
|
+
if (tag !== 18) {
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
message.currency = reader.string();
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
case 3: {
|
|
222
|
+
if (tag !== 26) {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
message.payment_method = reader.string();
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
const buf = reader.skip(tag & 7);
|
|
233
|
+
const list = message._unknownFields[tag];
|
|
234
|
+
if (list === undefined) {
|
|
235
|
+
message._unknownFields[tag] = [buf];
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
list.push(buf);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return message;
|
|
242
|
+
},
|
|
243
|
+
fromJSON(object) {
|
|
244
|
+
return {
|
|
245
|
+
amount_units: isSet(object.amountUnits)
|
|
246
|
+
? globalThis.String(object.amountUnits)
|
|
247
|
+
: isSet(object.amount_units)
|
|
248
|
+
? globalThis.String(object.amount_units)
|
|
249
|
+
: "0",
|
|
250
|
+
currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
|
|
251
|
+
payment_method: isSet(object.paymentMethod)
|
|
252
|
+
? globalThis.String(object.paymentMethod)
|
|
253
|
+
: isSet(object.payment_method)
|
|
254
|
+
? globalThis.String(object.payment_method)
|
|
255
|
+
: "",
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
toJSON(message) {
|
|
259
|
+
const obj = {};
|
|
260
|
+
if (message.amount_units !== "0") {
|
|
261
|
+
obj.amountUnits = message.amount_units;
|
|
262
|
+
}
|
|
263
|
+
if (message.currency !== "") {
|
|
264
|
+
obj.currency = message.currency;
|
|
265
|
+
}
|
|
266
|
+
if (message.payment_method !== "") {
|
|
267
|
+
obj.paymentMethod = message.payment_method;
|
|
268
|
+
}
|
|
269
|
+
return obj;
|
|
270
|
+
},
|
|
271
|
+
create(base) {
|
|
272
|
+
return TopUpIntent.fromPartial(base ?? {});
|
|
273
|
+
},
|
|
274
|
+
fromPartial(object) {
|
|
275
|
+
const message = createBaseTopUpIntent();
|
|
276
|
+
message.amount_units = object.amount_units ?? "0";
|
|
277
|
+
message.currency = object.currency ?? "";
|
|
278
|
+
message.payment_method = object.payment_method ?? "";
|
|
279
|
+
return message;
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
function createBaseTopUpIntentResponse() {
|
|
283
|
+
return { intent_id: "", client_secret: "", error: undefined, _unknownFields: {} };
|
|
284
|
+
}
|
|
285
|
+
export const TopUpIntentResponse = {
|
|
286
|
+
encode(message, writer = new BinaryWriter()) {
|
|
287
|
+
if (message.intent_id !== "") {
|
|
288
|
+
writer.uint32(10).string(message.intent_id);
|
|
289
|
+
}
|
|
290
|
+
if (message.client_secret !== "") {
|
|
291
|
+
writer.uint32(18).string(message.client_secret);
|
|
292
|
+
}
|
|
293
|
+
if (message.error !== undefined) {
|
|
294
|
+
ErrorInfo.encode(message.error, writer.uint32(26).fork()).join();
|
|
295
|
+
}
|
|
296
|
+
if (message._unknownFields !== undefined) {
|
|
297
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
298
|
+
const tag = parseInt(key, 10);
|
|
299
|
+
for (const value of values) {
|
|
300
|
+
writer.uint32(tag).raw(value);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return writer;
|
|
305
|
+
},
|
|
306
|
+
decode(input, length) {
|
|
307
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
308
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
309
|
+
const message = createBaseTopUpIntentResponse();
|
|
310
|
+
while (reader.pos < end) {
|
|
311
|
+
const tag = reader.uint32();
|
|
312
|
+
switch (tag >>> 3) {
|
|
313
|
+
case 1: {
|
|
314
|
+
if (tag !== 10) {
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
message.intent_id = reader.string();
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
case 2: {
|
|
321
|
+
if (tag !== 18) {
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
message.client_secret = reader.string();
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
case 3: {
|
|
328
|
+
if (tag !== 26) {
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
message.error = ErrorInfo.decode(reader, reader.uint32());
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
const buf = reader.skip(tag & 7);
|
|
339
|
+
const list = message._unknownFields[tag];
|
|
340
|
+
if (list === undefined) {
|
|
341
|
+
message._unknownFields[tag] = [buf];
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
list.push(buf);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return message;
|
|
348
|
+
},
|
|
349
|
+
fromJSON(object) {
|
|
350
|
+
return {
|
|
351
|
+
intent_id: isSet(object.intentId)
|
|
352
|
+
? globalThis.String(object.intentId)
|
|
353
|
+
: isSet(object.intent_id)
|
|
354
|
+
? globalThis.String(object.intent_id)
|
|
355
|
+
: "",
|
|
356
|
+
client_secret: isSet(object.clientSecret)
|
|
357
|
+
? globalThis.String(object.clientSecret)
|
|
358
|
+
: isSet(object.client_secret)
|
|
359
|
+
? globalThis.String(object.client_secret)
|
|
360
|
+
: "",
|
|
361
|
+
error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
|
|
362
|
+
};
|
|
363
|
+
},
|
|
364
|
+
toJSON(message) {
|
|
365
|
+
const obj = {};
|
|
366
|
+
if (message.intent_id !== "") {
|
|
367
|
+
obj.intentId = message.intent_id;
|
|
368
|
+
}
|
|
369
|
+
if (message.client_secret !== "") {
|
|
370
|
+
obj.clientSecret = message.client_secret;
|
|
371
|
+
}
|
|
372
|
+
if (message.error !== undefined) {
|
|
373
|
+
obj.error = ErrorInfo.toJSON(message.error);
|
|
374
|
+
}
|
|
375
|
+
return obj;
|
|
376
|
+
},
|
|
377
|
+
create(base) {
|
|
378
|
+
return TopUpIntentResponse.fromPartial(base ?? {});
|
|
379
|
+
},
|
|
380
|
+
fromPartial(object) {
|
|
381
|
+
const message = createBaseTopUpIntentResponse();
|
|
382
|
+
message.intent_id = object.intent_id ?? "";
|
|
383
|
+
message.client_secret = object.client_secret ?? "";
|
|
384
|
+
message.error = (object.error !== undefined && object.error !== null)
|
|
385
|
+
? ErrorInfo.fromPartial(object.error)
|
|
386
|
+
: undefined;
|
|
387
|
+
return message;
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
function createBaseTokenUsageReport() {
|
|
391
|
+
return { session_id: "", model_id: "", input_tokens: "0", output_tokens: "0", _unknownFields: {} };
|
|
392
|
+
}
|
|
393
|
+
export const TokenUsageReport = {
|
|
394
|
+
encode(message, writer = new BinaryWriter()) {
|
|
395
|
+
if (message.session_id !== "") {
|
|
396
|
+
writer.uint32(10).string(message.session_id);
|
|
397
|
+
}
|
|
398
|
+
if (message.model_id !== "") {
|
|
399
|
+
writer.uint32(18).string(message.model_id);
|
|
400
|
+
}
|
|
401
|
+
if (message.input_tokens !== "0") {
|
|
402
|
+
writer.uint32(24).int64(message.input_tokens);
|
|
403
|
+
}
|
|
404
|
+
if (message.output_tokens !== "0") {
|
|
405
|
+
writer.uint32(32).int64(message.output_tokens);
|
|
406
|
+
}
|
|
407
|
+
if (message._unknownFields !== undefined) {
|
|
408
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
409
|
+
const tag = parseInt(key, 10);
|
|
410
|
+
for (const value of values) {
|
|
411
|
+
writer.uint32(tag).raw(value);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return writer;
|
|
416
|
+
},
|
|
417
|
+
decode(input, length) {
|
|
418
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
419
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
420
|
+
const message = createBaseTokenUsageReport();
|
|
421
|
+
while (reader.pos < end) {
|
|
422
|
+
const tag = reader.uint32();
|
|
423
|
+
switch (tag >>> 3) {
|
|
424
|
+
case 1: {
|
|
425
|
+
if (tag !== 10) {
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
message.session_id = reader.string();
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
case 2: {
|
|
432
|
+
if (tag !== 18) {
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
message.model_id = reader.string();
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
case 3: {
|
|
439
|
+
if (tag !== 24) {
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
message.input_tokens = reader.int64().toString();
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
445
|
+
case 4: {
|
|
446
|
+
if (tag !== 32) {
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
message.output_tokens = reader.int64().toString();
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
const buf = reader.skip(tag & 7);
|
|
457
|
+
const list = message._unknownFields[tag];
|
|
458
|
+
if (list === undefined) {
|
|
459
|
+
message._unknownFields[tag] = [buf];
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
list.push(buf);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return message;
|
|
466
|
+
},
|
|
467
|
+
fromJSON(object) {
|
|
468
|
+
return {
|
|
469
|
+
session_id: isSet(object.sessionId)
|
|
470
|
+
? globalThis.String(object.sessionId)
|
|
471
|
+
: isSet(object.session_id)
|
|
472
|
+
? globalThis.String(object.session_id)
|
|
473
|
+
: "",
|
|
474
|
+
model_id: isSet(object.modelId)
|
|
475
|
+
? globalThis.String(object.modelId)
|
|
476
|
+
: isSet(object.model_id)
|
|
477
|
+
? globalThis.String(object.model_id)
|
|
478
|
+
: "",
|
|
479
|
+
input_tokens: isSet(object.inputTokens)
|
|
480
|
+
? globalThis.String(object.inputTokens)
|
|
481
|
+
: isSet(object.input_tokens)
|
|
482
|
+
? globalThis.String(object.input_tokens)
|
|
483
|
+
: "0",
|
|
484
|
+
output_tokens: isSet(object.outputTokens)
|
|
485
|
+
? globalThis.String(object.outputTokens)
|
|
486
|
+
: isSet(object.output_tokens)
|
|
487
|
+
? globalThis.String(object.output_tokens)
|
|
488
|
+
: "0",
|
|
489
|
+
};
|
|
490
|
+
},
|
|
491
|
+
toJSON(message) {
|
|
492
|
+
const obj = {};
|
|
493
|
+
if (message.session_id !== "") {
|
|
494
|
+
obj.sessionId = message.session_id;
|
|
495
|
+
}
|
|
496
|
+
if (message.model_id !== "") {
|
|
497
|
+
obj.modelId = message.model_id;
|
|
498
|
+
}
|
|
499
|
+
if (message.input_tokens !== "0") {
|
|
500
|
+
obj.inputTokens = message.input_tokens;
|
|
501
|
+
}
|
|
502
|
+
if (message.output_tokens !== "0") {
|
|
503
|
+
obj.outputTokens = message.output_tokens;
|
|
504
|
+
}
|
|
505
|
+
return obj;
|
|
506
|
+
},
|
|
507
|
+
create(base) {
|
|
508
|
+
return TokenUsageReport.fromPartial(base ?? {});
|
|
509
|
+
},
|
|
510
|
+
fromPartial(object) {
|
|
511
|
+
const message = createBaseTokenUsageReport();
|
|
512
|
+
message.session_id = object.session_id ?? "";
|
|
513
|
+
message.model_id = object.model_id ?? "";
|
|
514
|
+
message.input_tokens = object.input_tokens ?? "0";
|
|
515
|
+
message.output_tokens = object.output_tokens ?? "0";
|
|
516
|
+
return message;
|
|
517
|
+
},
|
|
518
|
+
};
|
|
519
|
+
function isSet(value) {
|
|
520
|
+
return value !== null && value !== undefined;
|
|
521
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
/** 部署 region 路由 DO 与数据中心 */
|
|
3
|
+
export declare enum Region {
|
|
4
|
+
REGION_UNSPECIFIED = 0,
|
|
5
|
+
REGION_TOKYO = 1,
|
|
6
|
+
REGION_SINGAPORE = 2,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export declare function regionFromJSON(object: any): Region;
|
|
10
|
+
export declare function regionToJSON(object: Region): string;
|
|
11
|
+
/** 占位空消息 用于 rpc 无参 / 无返回 */
|
|
12
|
+
export interface Empty {
|
|
13
|
+
_unknownFields?: {
|
|
14
|
+
[key: number]: Uint8Array[];
|
|
15
|
+
} | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** unix 毫秒时间戳 各端统一以 UTC ms 为基准 */
|
|
18
|
+
export interface Timestamp {
|
|
19
|
+
unix_ms: string;
|
|
20
|
+
_unknownFields?: {
|
|
21
|
+
[key: number]: Uint8Array[];
|
|
22
|
+
} | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** 通用错误信息 跨 message 复用 trace_id 串联日志链路 */
|
|
25
|
+
export interface ErrorInfo {
|
|
26
|
+
code: number;
|
|
27
|
+
message: string;
|
|
28
|
+
trace_id: string;
|
|
29
|
+
_unknownFields?: {
|
|
30
|
+
[key: number]: Uint8Array[];
|
|
31
|
+
} | undefined;
|
|
32
|
+
}
|
|
33
|
+
/** 通用附件引用 跨 REST / ws 复用 name/url/size/mime 四字段 */
|
|
34
|
+
export interface AttachmentRef {
|
|
35
|
+
name: string;
|
|
36
|
+
url: string;
|
|
37
|
+
size: string;
|
|
38
|
+
mime: string;
|
|
39
|
+
_unknownFields?: {
|
|
40
|
+
[key: number]: Uint8Array[];
|
|
41
|
+
} | undefined;
|
|
42
|
+
}
|
|
43
|
+
export declare const Empty: MessageFns<Empty>;
|
|
44
|
+
export declare const Timestamp: MessageFns<Timestamp>;
|
|
45
|
+
export declare const ErrorInfo: MessageFns<ErrorInfo>;
|
|
46
|
+
export declare const AttachmentRef: MessageFns<AttachmentRef>;
|
|
47
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
48
|
+
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
49
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
50
|
+
} : Partial<T>;
|
|
51
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
52
|
+
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
53
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
54
|
+
} & {
|
|
55
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
56
|
+
};
|
|
57
|
+
interface MessageFns<T> {
|
|
58
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
59
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
60
|
+
fromJSON(object: any): T;
|
|
61
|
+
toJSON(message: T): unknown;
|
|
62
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
63
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
64
|
+
}
|
|
65
|
+
export {};
|