@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
package/LICENSE
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
WorldEngine 官方作者工具许可证
|
|
2
|
+
|
|
3
|
+
版权所有 (c) 2026 Nixdorfer。保留所有权利。
|
|
4
|
+
|
|
5
|
+
本仓库的源代码、构建材料及附带资源(统称“本作品”)不是开源软件,
|
|
6
|
+
不适用任何 OSI 认证的开源许可证。
|
|
7
|
+
|
|
8
|
+
一、官方作者工具分发许可
|
|
9
|
+
|
|
10
|
+
版权所有者可以通过其官方网站、npm registry、签名安装包或其他官方渠道,
|
|
11
|
+
复制并分发由本作品构建的 WorldEngine 作者工具及其必要运行资源
|
|
12
|
+
(统称“官方作者工具”)。仅版权所有者或其书面指定的发布者享有此分发权。
|
|
13
|
+
|
|
14
|
+
二、作者用户许可
|
|
15
|
+
|
|
16
|
+
从官方渠道取得官方作者工具的作者用户,可以:
|
|
17
|
+
|
|
18
|
+
1. 安装和运行官方作者工具;
|
|
19
|
+
2. 使用官方作者工具创作、编辑、预览、导入、导出和提交其有权处理的内容;
|
|
20
|
+
3. 为上述使用目的制作合理必要的本地备份副本。
|
|
21
|
+
|
|
22
|
+
三、未授予的权利
|
|
23
|
+
|
|
24
|
+
除第二条明确允许的行为外,本许可证不授予作者用户或其他第三方以下权利:
|
|
25
|
+
|
|
26
|
+
1. 修改、改编、反编译、反汇编或制作官方作者工具的派生作品;
|
|
27
|
+
2. 复制、镜像、转发、再上传、出售、出租、再分发或再许可官方作者工具;
|
|
28
|
+
3. 使用本作品的源代码、构建材料或任何部分开发、提供或训练其他产品或服务;
|
|
29
|
+
4. 删除或规避版权、许可、签名、访问控制或其他权利管理信息。
|
|
30
|
+
|
|
31
|
+
法律强制允许且合同不得排除的权利不受上述限制影响。
|
|
32
|
+
|
|
33
|
+
四、源代码查看
|
|
34
|
+
|
|
35
|
+
第三方可以在已获合法访问权限的范围内查看本作品,用于审查、安全研究或学习参考;
|
|
36
|
+
查看不授予运行、复制、修改、分发、再许可或用于其他产品与服务的权利。
|
|
37
|
+
|
|
38
|
+
五、无担保与责任限制
|
|
39
|
+
|
|
40
|
+
本作品与官方作者工具均按“现状”提供,不附带任何明示或暗示的担保。
|
|
41
|
+
在适用法律允许的最大范围内,版权所有者不对因访问或使用本作品或官方作者工具
|
|
42
|
+
造成的任何损失承担责任。
|
|
43
|
+
|
|
44
|
+
六、终止
|
|
45
|
+
|
|
46
|
+
违反本许可证将立即终止相应的访问与使用权;终止不影响版权所有者已经产生的权利和救济。
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical marker for a serialized entity/relation property envelope.
|
|
3
|
+
*
|
|
4
|
+
* Public graph objects may legitimately contain keys such as `value`,
|
|
5
|
+
* `title`, or `states`. Consumers must therefore interpret an object as an
|
|
6
|
+
* envelope only when this explicit marker is present and exactly `true`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SERIALIZED_PROP_ENVELOPE_MARKER: "_system_prop_envelope_v1";
|
|
9
|
+
export declare const SERIALIZED_PROP_ENVELOPE_METADATA_KEYS: readonly ["initial_available", "source_refs", "states", "title", "trigger", "view_access"];
|
|
10
|
+
export declare const SERIALIZED_PROP_ENVELOPE_KNOWN_KEYS: readonly ["_system_prop_envelope_v1", "value", "initial_available", "source_refs", "states", "title", "trigger", "view_access"];
|
|
11
|
+
export type SerializedPropEnvelopeMetadataKey = (typeof SERIALIZED_PROP_ENVELOPE_METADATA_KEYS)[number];
|
|
12
|
+
export type SerializedPropEnvelopeKnownKey = (typeof SERIALIZED_PROP_ENVELOPE_KNOWN_KEYS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* The protocol layer intentionally keeps metadata payloads opaque. Their
|
|
15
|
+
* domain types belong to blocks-editor, Ladybug policy, and scenario schema;
|
|
16
|
+
* importing those packages here would reverse the dependency direction.
|
|
17
|
+
*/
|
|
18
|
+
export type SerializedPropEnvelope<Value = unknown> = Readonly<{
|
|
19
|
+
[SERIALIZED_PROP_ENVELOPE_MARKER]: true;
|
|
20
|
+
value: Value;
|
|
21
|
+
initial_available?: unknown;
|
|
22
|
+
source_refs?: unknown;
|
|
23
|
+
states?: unknown;
|
|
24
|
+
title?: unknown;
|
|
25
|
+
trigger?: unknown;
|
|
26
|
+
view_access?: unknown;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const isSerializedPropEnvelopeKnownKey: (key: string) => key is SerializedPropEnvelopeKnownKey;
|
|
29
|
+
/**
|
|
30
|
+
* Strict marker-aware guard. An unmarked object is ordinary user graph JSON
|
|
31
|
+
* and returns `false`; once the reserved marker is present, malformed marker,
|
|
32
|
+
* missing `value`, or any unknown sibling key is a protocol error rather than
|
|
33
|
+
* a permissive fallback.
|
|
34
|
+
*/
|
|
35
|
+
export declare const isSerializedPropEnvelope: (value: unknown) => value is SerializedPropEnvelope;
|
|
36
|
+
export declare const assertSerializedPropEnvelope: (value: unknown) => asserts value is SerializedPropEnvelope;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical marker for a serialized entity/relation property envelope.
|
|
3
|
+
*
|
|
4
|
+
* Public graph objects may legitimately contain keys such as `value`,
|
|
5
|
+
* `title`, or `states`. Consumers must therefore interpret an object as an
|
|
6
|
+
* envelope only when this explicit marker is present and exactly `true`.
|
|
7
|
+
*/
|
|
8
|
+
export const SERIALIZED_PROP_ENVELOPE_MARKER = "_system_prop_envelope_v1";
|
|
9
|
+
export const SERIALIZED_PROP_ENVELOPE_METADATA_KEYS = Object.freeze([
|
|
10
|
+
"initial_available",
|
|
11
|
+
"source_refs",
|
|
12
|
+
"states",
|
|
13
|
+
"title",
|
|
14
|
+
"trigger",
|
|
15
|
+
"view_access"
|
|
16
|
+
]);
|
|
17
|
+
export const SERIALIZED_PROP_ENVELOPE_KNOWN_KEYS = Object.freeze([
|
|
18
|
+
SERIALIZED_PROP_ENVELOPE_MARKER,
|
|
19
|
+
"value",
|
|
20
|
+
...SERIALIZED_PROP_ENVELOPE_METADATA_KEYS
|
|
21
|
+
]);
|
|
22
|
+
const KNOWN_KEYS = new Set(SERIALIZED_PROP_ENVELOPE_KNOWN_KEYS);
|
|
23
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24
|
+
const hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
25
|
+
export const isSerializedPropEnvelopeKnownKey = (key) => KNOWN_KEYS.has(key);
|
|
26
|
+
/**
|
|
27
|
+
* Strict marker-aware guard. An unmarked object is ordinary user graph JSON
|
|
28
|
+
* and returns `false`; once the reserved marker is present, malformed marker,
|
|
29
|
+
* missing `value`, or any unknown sibling key is a protocol error rather than
|
|
30
|
+
* a permissive fallback.
|
|
31
|
+
*/
|
|
32
|
+
export const isSerializedPropEnvelope = (value) => {
|
|
33
|
+
if (!isRecord(value) || !hasOwn(value, SERIALIZED_PROP_ENVELOPE_MARKER)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (value[SERIALIZED_PROP_ENVELOPE_MARKER] !== true || !hasOwn(value, "value")) {
|
|
37
|
+
throw new Error("entity_prop_envelope_marker_invalid");
|
|
38
|
+
}
|
|
39
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
40
|
+
if (typeof key !== "string" || !isSerializedPropEnvelopeKnownKey(key)) {
|
|
41
|
+
throw new Error(`entity_prop_envelope_unknown_field:${String(key)}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
};
|
|
46
|
+
export const assertSerializedPropEnvelope = (value) => {
|
|
47
|
+
if (!isSerializedPropEnvelope(value)) {
|
|
48
|
+
throw new Error("entity_prop_envelope_marker_missing");
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { ErrorInfo } from "./common.js";
|
|
3
|
+
export interface LoginRequest {
|
|
4
|
+
email: string;
|
|
5
|
+
/** 客户端预先派生的 password 哈希 后端再做 server 侧 KDF */
|
|
6
|
+
password_hash: string;
|
|
7
|
+
_unknownFields?: {
|
|
8
|
+
[key: number]: Uint8Array[];
|
|
9
|
+
} | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface LoginResponse {
|
|
12
|
+
session_id: string;
|
|
13
|
+
two_factor_required: boolean;
|
|
14
|
+
error?: ErrorInfo | undefined;
|
|
15
|
+
_unknownFields?: {
|
|
16
|
+
[key: number]: Uint8Array[];
|
|
17
|
+
} | undefined;
|
|
18
|
+
}
|
|
19
|
+
export interface LogoutRequest {
|
|
20
|
+
session_id: string;
|
|
21
|
+
_unknownFields?: {
|
|
22
|
+
[key: number]: Uint8Array[];
|
|
23
|
+
} | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare const LoginRequest: MessageFns<LoginRequest>;
|
|
26
|
+
export declare const LoginResponse: MessageFns<LoginResponse>;
|
|
27
|
+
export declare const LogoutRequest: MessageFns<LogoutRequest>;
|
|
28
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
29
|
+
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 {} ? {
|
|
30
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
31
|
+
} : Partial<T>;
|
|
32
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
33
|
+
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
34
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
35
|
+
} & {
|
|
36
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
37
|
+
};
|
|
38
|
+
interface MessageFns<T> {
|
|
39
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
40
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
41
|
+
fromJSON(object: any): T;
|
|
42
|
+
toJSON(message: T): unknown;
|
|
43
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
44
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,278 @@
|
|
|
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/auth.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { ErrorInfo } from "./common.js";
|
|
9
|
+
function createBaseLoginRequest() {
|
|
10
|
+
return { email: "", password_hash: "", _unknownFields: {} };
|
|
11
|
+
}
|
|
12
|
+
export const LoginRequest = {
|
|
13
|
+
encode(message, writer = new BinaryWriter()) {
|
|
14
|
+
if (message.email !== "") {
|
|
15
|
+
writer.uint32(10).string(message.email);
|
|
16
|
+
}
|
|
17
|
+
if (message.password_hash !== "") {
|
|
18
|
+
writer.uint32(18).string(message.password_hash);
|
|
19
|
+
}
|
|
20
|
+
if (message._unknownFields !== undefined) {
|
|
21
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
22
|
+
const tag = parseInt(key, 10);
|
|
23
|
+
for (const value of values) {
|
|
24
|
+
writer.uint32(tag).raw(value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return writer;
|
|
29
|
+
},
|
|
30
|
+
decode(input, length) {
|
|
31
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
32
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
33
|
+
const message = createBaseLoginRequest();
|
|
34
|
+
while (reader.pos < end) {
|
|
35
|
+
const tag = reader.uint32();
|
|
36
|
+
switch (tag >>> 3) {
|
|
37
|
+
case 1: {
|
|
38
|
+
if (tag !== 10) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
message.email = reader.string();
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
case 2: {
|
|
45
|
+
if (tag !== 18) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
message.password_hash = reader.string();
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
const buf = reader.skip(tag & 7);
|
|
56
|
+
const list = message._unknownFields[tag];
|
|
57
|
+
if (list === undefined) {
|
|
58
|
+
message._unknownFields[tag] = [buf];
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
list.push(buf);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return message;
|
|
65
|
+
},
|
|
66
|
+
fromJSON(object) {
|
|
67
|
+
return {
|
|
68
|
+
email: isSet(object.email) ? globalThis.String(object.email) : "",
|
|
69
|
+
password_hash: isSet(object.passwordHash)
|
|
70
|
+
? globalThis.String(object.passwordHash)
|
|
71
|
+
: isSet(object.password_hash)
|
|
72
|
+
? globalThis.String(object.password_hash)
|
|
73
|
+
: "",
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
toJSON(message) {
|
|
77
|
+
const obj = {};
|
|
78
|
+
if (message.email !== "") {
|
|
79
|
+
obj.email = message.email;
|
|
80
|
+
}
|
|
81
|
+
if (message.password_hash !== "") {
|
|
82
|
+
obj.passwordHash = message.password_hash;
|
|
83
|
+
}
|
|
84
|
+
return obj;
|
|
85
|
+
},
|
|
86
|
+
create(base) {
|
|
87
|
+
return LoginRequest.fromPartial(base ?? {});
|
|
88
|
+
},
|
|
89
|
+
fromPartial(object) {
|
|
90
|
+
const message = createBaseLoginRequest();
|
|
91
|
+
message.email = object.email ?? "";
|
|
92
|
+
message.password_hash = object.password_hash ?? "";
|
|
93
|
+
return message;
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
function createBaseLoginResponse() {
|
|
97
|
+
return { session_id: "", two_factor_required: false, error: undefined, _unknownFields: {} };
|
|
98
|
+
}
|
|
99
|
+
export const LoginResponse = {
|
|
100
|
+
encode(message, writer = new BinaryWriter()) {
|
|
101
|
+
if (message.session_id !== "") {
|
|
102
|
+
writer.uint32(10).string(message.session_id);
|
|
103
|
+
}
|
|
104
|
+
if (message.two_factor_required !== false) {
|
|
105
|
+
writer.uint32(16).bool(message.two_factor_required);
|
|
106
|
+
}
|
|
107
|
+
if (message.error !== undefined) {
|
|
108
|
+
ErrorInfo.encode(message.error, writer.uint32(26).fork()).join();
|
|
109
|
+
}
|
|
110
|
+
if (message._unknownFields !== undefined) {
|
|
111
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
112
|
+
const tag = parseInt(key, 10);
|
|
113
|
+
for (const value of values) {
|
|
114
|
+
writer.uint32(tag).raw(value);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return writer;
|
|
119
|
+
},
|
|
120
|
+
decode(input, length) {
|
|
121
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
122
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
123
|
+
const message = createBaseLoginResponse();
|
|
124
|
+
while (reader.pos < end) {
|
|
125
|
+
const tag = reader.uint32();
|
|
126
|
+
switch (tag >>> 3) {
|
|
127
|
+
case 1: {
|
|
128
|
+
if (tag !== 10) {
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
message.session_id = reader.string();
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
case 2: {
|
|
135
|
+
if (tag !== 16) {
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
message.two_factor_required = reader.bool();
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
case 3: {
|
|
142
|
+
if (tag !== 26) {
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
message.error = ErrorInfo.decode(reader, reader.uint32());
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
const buf = reader.skip(tag & 7);
|
|
153
|
+
const list = message._unknownFields[tag];
|
|
154
|
+
if (list === undefined) {
|
|
155
|
+
message._unknownFields[tag] = [buf];
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
list.push(buf);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return message;
|
|
162
|
+
},
|
|
163
|
+
fromJSON(object) {
|
|
164
|
+
return {
|
|
165
|
+
session_id: isSet(object.sessionId)
|
|
166
|
+
? globalThis.String(object.sessionId)
|
|
167
|
+
: isSet(object.session_id)
|
|
168
|
+
? globalThis.String(object.session_id)
|
|
169
|
+
: "",
|
|
170
|
+
two_factor_required: isSet(object.twoFactorRequired)
|
|
171
|
+
? globalThis.Boolean(object.twoFactorRequired)
|
|
172
|
+
: isSet(object.two_factor_required)
|
|
173
|
+
? globalThis.Boolean(object.two_factor_required)
|
|
174
|
+
: false,
|
|
175
|
+
error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
toJSON(message) {
|
|
179
|
+
const obj = {};
|
|
180
|
+
if (message.session_id !== "") {
|
|
181
|
+
obj.sessionId = message.session_id;
|
|
182
|
+
}
|
|
183
|
+
if (message.two_factor_required !== false) {
|
|
184
|
+
obj.twoFactorRequired = message.two_factor_required;
|
|
185
|
+
}
|
|
186
|
+
if (message.error !== undefined) {
|
|
187
|
+
obj.error = ErrorInfo.toJSON(message.error);
|
|
188
|
+
}
|
|
189
|
+
return obj;
|
|
190
|
+
},
|
|
191
|
+
create(base) {
|
|
192
|
+
return LoginResponse.fromPartial(base ?? {});
|
|
193
|
+
},
|
|
194
|
+
fromPartial(object) {
|
|
195
|
+
const message = createBaseLoginResponse();
|
|
196
|
+
message.session_id = object.session_id ?? "";
|
|
197
|
+
message.two_factor_required = object.two_factor_required ?? false;
|
|
198
|
+
message.error = (object.error !== undefined && object.error !== null)
|
|
199
|
+
? ErrorInfo.fromPartial(object.error)
|
|
200
|
+
: undefined;
|
|
201
|
+
return message;
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
function createBaseLogoutRequest() {
|
|
205
|
+
return { session_id: "", _unknownFields: {} };
|
|
206
|
+
}
|
|
207
|
+
export const LogoutRequest = {
|
|
208
|
+
encode(message, writer = new BinaryWriter()) {
|
|
209
|
+
if (message.session_id !== "") {
|
|
210
|
+
writer.uint32(10).string(message.session_id);
|
|
211
|
+
}
|
|
212
|
+
if (message._unknownFields !== undefined) {
|
|
213
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
214
|
+
const tag = parseInt(key, 10);
|
|
215
|
+
for (const value of values) {
|
|
216
|
+
writer.uint32(tag).raw(value);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return writer;
|
|
221
|
+
},
|
|
222
|
+
decode(input, length) {
|
|
223
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
224
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
225
|
+
const message = createBaseLogoutRequest();
|
|
226
|
+
while (reader.pos < end) {
|
|
227
|
+
const tag = reader.uint32();
|
|
228
|
+
switch (tag >>> 3) {
|
|
229
|
+
case 1: {
|
|
230
|
+
if (tag !== 10) {
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
message.session_id = reader.string();
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
const buf = reader.skip(tag & 7);
|
|
241
|
+
const list = message._unknownFields[tag];
|
|
242
|
+
if (list === undefined) {
|
|
243
|
+
message._unknownFields[tag] = [buf];
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
list.push(buf);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return message;
|
|
250
|
+
},
|
|
251
|
+
fromJSON(object) {
|
|
252
|
+
return {
|
|
253
|
+
session_id: isSet(object.sessionId)
|
|
254
|
+
? globalThis.String(object.sessionId)
|
|
255
|
+
: isSet(object.session_id)
|
|
256
|
+
? globalThis.String(object.session_id)
|
|
257
|
+
: "",
|
|
258
|
+
};
|
|
259
|
+
},
|
|
260
|
+
toJSON(message) {
|
|
261
|
+
const obj = {};
|
|
262
|
+
if (message.session_id !== "") {
|
|
263
|
+
obj.sessionId = message.session_id;
|
|
264
|
+
}
|
|
265
|
+
return obj;
|
|
266
|
+
},
|
|
267
|
+
create(base) {
|
|
268
|
+
return LogoutRequest.fromPartial(base ?? {});
|
|
269
|
+
},
|
|
270
|
+
fromPartial(object) {
|
|
271
|
+
const message = createBaseLogoutRequest();
|
|
272
|
+
message.session_id = object.session_id ?? "";
|
|
273
|
+
return message;
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
function isSet(value) {
|
|
277
|
+
return value !== null && value !== undefined;
|
|
278
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { ErrorInfo } from "./common.js";
|
|
3
|
+
export declare enum PaymentMethod {
|
|
4
|
+
PAYMENT_METHOD_UNSPECIFIED = 0,
|
|
5
|
+
PAYMENT_METHOD_STRIPE_CARD = 1,
|
|
6
|
+
PAYMENT_METHOD_STRIPE_APPLE_PAY = 2,
|
|
7
|
+
PAYMENT_METHOD_STRIPE_GOOGLE_PAY = 3,
|
|
8
|
+
PAYMENT_METHOD_STRIPE_PAYPAL = 4,
|
|
9
|
+
PAYMENT_METHOD_FOURTH_PARTY_ALIPAY = 5,
|
|
10
|
+
PAYMENT_METHOD_FOURTH_PARTY_WECHAT = 6,
|
|
11
|
+
UNRECOGNIZED = -1
|
|
12
|
+
}
|
|
13
|
+
export declare function paymentMethodFromJSON(object: any): PaymentMethod;
|
|
14
|
+
export declare function paymentMethodToJSON(object: PaymentMethod): string;
|
|
15
|
+
/** 双货币钱包余额 units 为最小单位 (美元 cent 人民币分) currency 遵循 ISO 4217 */
|
|
16
|
+
export interface WalletBalance {
|
|
17
|
+
top_up_balance_units: string;
|
|
18
|
+
credit_balance_units: string;
|
|
19
|
+
currency: string;
|
|
20
|
+
_unknownFields?: {
|
|
21
|
+
[key: number]: Uint8Array[];
|
|
22
|
+
} | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface TopUpIntent {
|
|
25
|
+
amount_units: string;
|
|
26
|
+
currency: string;
|
|
27
|
+
payment_method: string;
|
|
28
|
+
_unknownFields?: {
|
|
29
|
+
[key: number]: Uint8Array[];
|
|
30
|
+
} | undefined;
|
|
31
|
+
}
|
|
32
|
+
export interface TopUpIntentResponse {
|
|
33
|
+
intent_id: string;
|
|
34
|
+
client_secret: string;
|
|
35
|
+
error?: ErrorInfo | undefined;
|
|
36
|
+
_unknownFields?: {
|
|
37
|
+
[key: number]: Uint8Array[];
|
|
38
|
+
} | undefined;
|
|
39
|
+
}
|
|
40
|
+
export interface TokenUsageReport {
|
|
41
|
+
session_id: string;
|
|
42
|
+
model_id: string;
|
|
43
|
+
input_tokens: string;
|
|
44
|
+
output_tokens: string;
|
|
45
|
+
_unknownFields?: {
|
|
46
|
+
[key: number]: Uint8Array[];
|
|
47
|
+
} | undefined;
|
|
48
|
+
}
|
|
49
|
+
export declare const WalletBalance: MessageFns<WalletBalance>;
|
|
50
|
+
export declare const TopUpIntent: MessageFns<TopUpIntent>;
|
|
51
|
+
export declare const TopUpIntentResponse: MessageFns<TopUpIntentResponse>;
|
|
52
|
+
export declare const TokenUsageReport: MessageFns<TokenUsageReport>;
|
|
53
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
54
|
+
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 {} ? {
|
|
55
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
56
|
+
} : Partial<T>;
|
|
57
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
58
|
+
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
59
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
60
|
+
} & {
|
|
61
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
62
|
+
};
|
|
63
|
+
interface MessageFns<T> {
|
|
64
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
65
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
66
|
+
fromJSON(object: any): T;
|
|
67
|
+
toJSON(message: T): unknown;
|
|
68
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
69
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
70
|
+
}
|
|
71
|
+
export {};
|