keymaster-api-protocol 0.0.0-stage → 0.1.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.
@@ -0,0 +1,75 @@
1
+ export declare const MsgHello = "hello";
2
+ export declare const MsgWelcome = "welcome";
3
+ export declare const MsgRequest = "request";
4
+ export declare const MsgResponse = "response";
5
+ export declare const MsgCancel = "cancel";
6
+ export declare const MsgSubscribe = "subscribe";
7
+ export declare const MsgUnsubscribe = "unsubscribe";
8
+ export declare const MsgSnapshot = "snapshot";
9
+ export declare const MsgEvent = "event";
10
+ export declare const MsgResync = "resync";
11
+ export declare const MsgAttachBegin = "binary-begin";
12
+ export interface ClientInfo {
13
+ name: string;
14
+ version: string;
15
+ }
16
+ export interface Limits {
17
+ jsonControlMaxBytes: number;
18
+ binarySingleMaxBytes: number;
19
+ connUnackedMaxBytes: number;
20
+ connPendingSendMaxBytes: number;
21
+ connInflightRequests: number;
22
+ attachmentDeadlineSecs: number;
23
+ storagePlainMaxBytes?: number;
24
+ msfileSeedMaxBytes?: number;
25
+ msfileBlockMaxBytes?: number;
26
+ }
27
+ export interface Hello {
28
+ type: string;
29
+ product: string;
30
+ apiVersion: string;
31
+ client: ClientInfo;
32
+ }
33
+ export interface Welcome {
34
+ type: string;
35
+ product: string;
36
+ apiVersion: string;
37
+ instanceId: string;
38
+ connectionId: string;
39
+ limits: Limits;
40
+ }
41
+ export interface RequestMsg {
42
+ type: string;
43
+ id: string;
44
+ method: string;
45
+ params?: unknown;
46
+ /** 随后的二进制附件声明;服务端据此预注册,未声明的附件帧将被忽略。 */
47
+ attachments?: Array<{
48
+ id: string;
49
+ bytes: number;
50
+ }>;
51
+ }
52
+ export interface ErrorDetail {
53
+ code: string;
54
+ message: string;
55
+ retryable?: boolean;
56
+ }
57
+ export interface ResponseMsg {
58
+ type: string;
59
+ id: string;
60
+ result?: unknown;
61
+ error?: ErrorDetail;
62
+ }
63
+ export declare function defaultLimits(): Limits;
64
+ export declare function checkHello(product: string, apiVersion: string): void;
65
+ export declare function checkIdentity(status: {
66
+ product: string;
67
+ apiVersion: string;
68
+ }): void;
69
+ /** 单 WS binary 消息编码:4 字节大端 headerLen + JSON{requestId,attachmentId} + 原始字节。 */
70
+ export declare function encodeAttachment(requestId: string, attachmentId: string, data: Uint8Array): Uint8Array;
71
+ export declare function decodeAttachment(frame: Uint8Array, declared: number): {
72
+ requestId: string;
73
+ attachmentId: string;
74
+ data: Uint8Array;
75
+ };
@@ -0,0 +1,55 @@
1
+ import { Product, APIVersion } from "./methods.gen.js";
2
+ export const MsgHello = "hello";
3
+ export const MsgWelcome = "welcome";
4
+ export const MsgRequest = "request";
5
+ export const MsgResponse = "response";
6
+ export const MsgCancel = "cancel";
7
+ export const MsgSubscribe = "subscribe";
8
+ export const MsgUnsubscribe = "unsubscribe";
9
+ export const MsgSnapshot = "snapshot";
10
+ export const MsgEvent = "event";
11
+ export const MsgResync = "resync";
12
+ export const MsgAttachBegin = "binary-begin";
13
+ export function defaultLimits() {
14
+ return {
15
+ jsonControlMaxBytes: 1 << 20,
16
+ binarySingleMaxBytes: 16 << 20,
17
+ connUnackedMaxBytes: 32 << 20,
18
+ connPendingSendMaxBytes: 32 << 20,
19
+ connInflightRequests: 16,
20
+ attachmentDeadlineSecs: 30,
21
+ storagePlainMaxBytes: 16 << 20,
22
+ msfileSeedMaxBytes: 16 << 20,
23
+ msfileBlockMaxBytes: 256 << 10,
24
+ };
25
+ }
26
+ export function checkHello(product, apiVersion) {
27
+ if (product !== Product)
28
+ throw new Error(`product mismatch: ${product}`);
29
+ if (apiVersion !== APIVersion)
30
+ throw new Error(`apiVersion mismatch: ${apiVersion}`);
31
+ }
32
+ export function checkIdentity(status) {
33
+ checkHello(status.product, status.apiVersion);
34
+ }
35
+ /** 单 WS binary 消息编码:4 字节大端 headerLen + JSON{requestId,attachmentId} + 原始字节。 */
36
+ export function encodeAttachment(requestId, attachmentId, data) {
37
+ const hdr = new TextEncoder().encode(JSON.stringify({ requestId, attachmentId }));
38
+ const out = new Uint8Array(4 + hdr.length + data.length);
39
+ new DataView(out.buffer).setUint32(0, hdr.length, false);
40
+ out.set(hdr, 4);
41
+ out.set(data, 4 + hdr.length);
42
+ return out;
43
+ }
44
+ export function decodeAttachment(frame, declared) {
45
+ if (frame.length < 4)
46
+ throw new Error("附件帧过短");
47
+ const hl = new DataView(frame.buffer, frame.byteOffset, 4).getUint32(0, false);
48
+ if (4 + hl > frame.length)
49
+ throw new Error("附件头长度非法");
50
+ const hdr = JSON.parse(new TextDecoder().decode(frame.slice(4, 4 + hl)));
51
+ const data = frame.slice(4 + hl);
52
+ if (declared >= 0 && data.length !== declared)
53
+ throw new Error("声明长度与实际长度不一致");
54
+ return { requestId: hdr.requestId, attachmentId: hdr.attachmentId, data };
55
+ }
@@ -0,0 +1,48 @@
1
+ export declare class TransportError extends Error {
2
+ readonly op: string;
3
+ readonly cause?: unknown | undefined;
4
+ constructor(op: string, cause?: unknown | undefined);
5
+ }
6
+ /** 已退役:旧 HTTP/SSE 客户端兼容保留,最终删除。新代码使用 ProtocolError。 */
7
+ export declare class HTTPError extends Error {
8
+ readonly op: string;
9
+ readonly status: number;
10
+ readonly body: string;
11
+ constructor(op: string, status: number, body: string);
12
+ }
13
+ export declare class ParseError extends Error {
14
+ readonly op: string;
15
+ readonly cause?: unknown | undefined;
16
+ constructor(op: string, cause?: unknown | undefined);
17
+ }
18
+ export declare class VersionError extends Error {
19
+ readonly op: string;
20
+ readonly field: string;
21
+ readonly got: string;
22
+ readonly want: string;
23
+ constructor(op: string, field: string, got: string, want: string);
24
+ }
25
+ export declare class ProtocolError extends Error {
26
+ readonly op: string;
27
+ readonly code: string;
28
+ readonly message: string;
29
+ readonly id?: string | undefined;
30
+ readonly retryable?: boolean | undefined;
31
+ constructor(op: string, code: string, message: string, id?: string | undefined, retryable?: boolean | undefined);
32
+ }
33
+ /** 是否为连接失败。 */
34
+ export declare function isTransport(err: unknown): boolean;
35
+ /** HTTP 业务状态码(若为 HTTPError,仅旧客户端兼容)。 */
36
+ export declare function httpStatus(err: unknown): number | null;
37
+ /** 业务错误码(若为 ProtocolError)。 */
38
+ export declare function errorCode(err: unknown): string | null;
39
+ /** LOCKED:需解锁。兼容旧 423。 */
40
+ export declare function isLocked(err: unknown): boolean;
41
+ /** NOT_INITIALIZED:需 init。兼容旧 412。 */
42
+ export declare function isNotInitialized(err: unknown): boolean;
43
+ /** STOPPING:后台停止中。兼容旧 503。 */
44
+ export declare function isStopping(err: unknown): boolean;
45
+ /** NOT_FOUND:不存在。兼容旧 404。 */
46
+ export declare function isNotFound(err: unknown): boolean;
47
+ /** CONFLICT/STATE_CONFLICT:版本冲突或审批竞争。兼容旧 409。 */
48
+ export declare function isConflict(err: unknown): boolean;
package/dist/errors.js ADDED
@@ -0,0 +1,105 @@
1
+ export class TransportError extends Error {
2
+ op;
3
+ cause;
4
+ constructor(op, cause) {
5
+ super(`连接后台失败 (${op}): ${String(cause)}`);
6
+ this.op = op;
7
+ this.cause = cause;
8
+ this.name = "TransportError";
9
+ }
10
+ }
11
+ /** 已退役:旧 HTTP/SSE 客户端兼容保留,最终删除。新代码使用 ProtocolError。 */
12
+ export class HTTPError extends Error {
13
+ op;
14
+ status;
15
+ body;
16
+ constructor(op, status, body) {
17
+ super(`后台返回 ${status}: ${body}`);
18
+ this.op = op;
19
+ this.status = status;
20
+ this.body = body;
21
+ this.name = "HTTPError";
22
+ }
23
+ }
24
+ export class ParseError extends Error {
25
+ op;
26
+ cause;
27
+ constructor(op, cause) {
28
+ super(`解析后台响应失败 (${op}): ${String(cause)}`);
29
+ this.op = op;
30
+ this.cause = cause;
31
+ this.name = "ParseError";
32
+ }
33
+ }
34
+ export class VersionError extends Error {
35
+ op;
36
+ field;
37
+ got;
38
+ want;
39
+ constructor(op, field, got, want) {
40
+ super(`后台协议不兼容 (${op}):${field}=${JSON.stringify(got)},需要 ${JSON.stringify(want)}`);
41
+ this.op = op;
42
+ this.field = field;
43
+ this.got = got;
44
+ this.want = want;
45
+ this.name = "VersionError";
46
+ }
47
+ }
48
+ export class ProtocolError extends Error {
49
+ op;
50
+ code;
51
+ message;
52
+ id;
53
+ retryable;
54
+ constructor(op, code, message, id, retryable) {
55
+ super(`后台业务错误 ${code} (${op}): ${message}`);
56
+ this.op = op;
57
+ this.code = code;
58
+ this.message = message;
59
+ this.id = id;
60
+ this.retryable = retryable;
61
+ this.name = "ProtocolError";
62
+ }
63
+ }
64
+ /** 是否为连接失败。 */
65
+ export function isTransport(err) {
66
+ return err instanceof TransportError;
67
+ }
68
+ /** HTTP 业务状态码(若为 HTTPError,仅旧客户端兼容)。 */
69
+ export function httpStatus(err) {
70
+ return err instanceof HTTPError ? err.status : null;
71
+ }
72
+ /** 业务错误码(若为 ProtocolError)。 */
73
+ export function errorCode(err) {
74
+ return err instanceof ProtocolError ? err.code : null;
75
+ }
76
+ /** LOCKED:需解锁。兼容旧 423。 */
77
+ export function isLocked(err) {
78
+ if (err instanceof ProtocolError)
79
+ return err.code === "LOCKED";
80
+ return err instanceof HTTPError && err.status === 423;
81
+ }
82
+ /** NOT_INITIALIZED:需 init。兼容旧 412。 */
83
+ export function isNotInitialized(err) {
84
+ if (err instanceof ProtocolError)
85
+ return err.code === "NOT_INITIALIZED";
86
+ return err instanceof HTTPError && err.status === 412;
87
+ }
88
+ /** STOPPING:后台停止中。兼容旧 503。 */
89
+ export function isStopping(err) {
90
+ if (err instanceof ProtocolError)
91
+ return err.code === "STOPPING";
92
+ return err instanceof HTTPError && err.status === 503;
93
+ }
94
+ /** NOT_FOUND:不存在。兼容旧 404。 */
95
+ export function isNotFound(err) {
96
+ if (err instanceof ProtocolError)
97
+ return err.code === "NOT_FOUND";
98
+ return err instanceof HTTPError && err.status === 404;
99
+ }
100
+ /** CONFLICT/STATE_CONFLICT:版本冲突或审批竞争。兼容旧 409。 */
101
+ export function isConflict(err) {
102
+ if (err instanceof ProtocolError)
103
+ return err.code === "CONFLICT" || err.code === "STATE_CONFLICT";
104
+ return err instanceof HTTPError && err.status === 409;
105
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./types.gen.js";
2
+ export * from "./methods.gen.js";
3
+ export * from "./envelope.js";
4
+ export * from "./errors.js";
5
+ export * from "./ws.js";
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./types.gen.js";
2
+ export * from "./methods.gen.js";
3
+ export * from "./envelope.js";
4
+ export * from "./errors.js";
5
+ export * from "./ws.js";
@@ -0,0 +1,56 @@
1
+ export declare const Product = "km";
2
+ export declare const APIVersion = "v1";
3
+ export declare const WSPath = "/api/ws";
4
+ export declare const MethodCatalogRefresh = "catalog.refresh";
5
+ export declare const MethodCollectorConfig = "collector.config";
6
+ export declare const MethodCollectorDescribe = "collector.describe";
7
+ export declare const MethodCollectorFlush = "collector.flush";
8
+ export declare const MethodCollectorHistory = "collector.history";
9
+ export declare const MethodCollectorRetry = "collector.retry";
10
+ export declare const MethodCollectorStatus = "collector.status";
11
+ export declare const MethodConnectApprovalsDecide = "connect.approvals.decide";
12
+ export declare const MethodConnectApprovalsList = "connect.approvals.list";
13
+ export declare const MethodConnectAppsList = "connect.apps.list";
14
+ export declare const MethodConnectAuthList = "connect.auth.list";
15
+ export declare const MethodConnectAuthRevoke = "connect.auth.revoke";
16
+ export declare const MethodConnectBindingsList = "connect.bindings.list";
17
+ export declare const MethodConnectConnectionPause = "connect.connection.pause";
18
+ export declare const MethodConnectHistoryList = "connect.history.list";
19
+ export declare const MethodConnectLaunchIssue = "connect.launch.issue";
20
+ export declare const MethodConnectPermissionsList = "connect.permissions.list";
21
+ export declare const MethodConnectPermissionsRevoke = "connect.permissions.revoke";
22
+ export declare const MethodConnectRequestExec = "connect.request.exec";
23
+ export declare const MethodEventsSubscribe = "events.subscribe";
24
+ export declare const MethodFilesBrowse = "files.browse";
25
+ export declare const MethodFilesList = "files.list";
26
+ export declare const MethodInfoGet = "info.get";
27
+ export declare const MethodPricingBatch = "pricing.batch";
28
+ export declare const MethodPricingClearFile = "pricing.clearFile";
29
+ export declare const MethodPricingSetDefaults = "pricing.setDefaults";
30
+ export declare const MethodPricingSetFile = "pricing.setFile";
31
+ export declare const MethodRootsAdd = "roots.add";
32
+ export declare const MethodRootsList = "roots.list";
33
+ export declare const MethodRootsRemove = "roots.remove";
34
+ export declare const MethodRootsSetDefault = "roots.setDefault";
35
+ export declare const MethodSettingsGet = "settings.get";
36
+ export declare const MethodSettingsReset = "settings.reset";
37
+ export declare const MethodSettingsUpdate = "settings.update";
38
+ export declare const MethodStatusGet = "status.get";
39
+ export declare const MethodStorageDelete = "storage.delete";
40
+ export declare const MethodStorageGet = "storage.get";
41
+ export declare const MethodStorageList = "storage.list";
42
+ export declare const MethodStoragePut = "storage.put";
43
+ export declare const MethodTasksCancel = "tasks.cancel";
44
+ export declare const MethodTasksCreate = "tasks.create";
45
+ export declare const MethodTasksGet = "tasks.get";
46
+ export declare const MethodTasksList = "tasks.list";
47
+ export declare const MethodTasksSubscribe = "tasks.subscribe";
48
+ export declare const MethodWalletCreate = "wallet.create";
49
+ export declare const MethodWalletImport = "wallet.import";
50
+ export declare const MethodWalletUnlock = "wallet.unlock";
51
+ export declare const MethodTimeout: Record<string, string>;
52
+ export declare const MethodParams: Record<string, string>;
53
+ export declare const MethodResult: Record<string, string>;
54
+ export declare const ErrorCodes: readonly ["BAD_REQUEST", "CANCELLED", "CONFLICT", "FORBIDDEN", "IDENTITY_REQUIRED", "INTERNAL", "LOCKED", "NOT_FOUND", "NOT_INITIALIZED", "ORIGIN_REJECTED", "STATE_CONFLICT", "STOPPING", "TOO_LARGE", "VERSION_MISMATCH"];
55
+ export type ErrorCode = typeof ErrorCodes[number];
56
+ export declare const KnownTopics: readonly ["balance", "collector", "connect", "connection", "roots", "settings", "task", "wallet"];
@@ -0,0 +1,225 @@
1
+ // Code generated by tools/gen. DO NOT EDIT.
2
+ // 来源: spec/protocol.yaml methods/errors/topics/info。
3
+ export const Product = "km";
4
+ export const APIVersion = "v1";
5
+ export const WSPath = "/api/ws";
6
+ export const MethodCatalogRefresh = "catalog.refresh"; // params=CatalogRefreshRequest result=JsonValue timeout=short
7
+ export const MethodCollectorConfig = "collector.config"; // params=CollectorConfigRequest result=Ok timeout=short
8
+ export const MethodCollectorDescribe = "collector.describe"; // params=CollectorDescriptionRequest result=Ok timeout=short
9
+ export const MethodCollectorFlush = "collector.flush"; // params=null result=CollectorFlushResponse timeout=short
10
+ export const MethodCollectorHistory = "collector.history"; // params=null result=CollectorHistory timeout=short
11
+ export const MethodCollectorRetry = "collector.retry"; // params=null result=CollectorRetryResponse timeout=short
12
+ export const MethodCollectorStatus = "collector.status"; // params=null result=CollectorStatus timeout=short
13
+ export const MethodConnectApprovalsDecide = "connect.approvals.decide"; // params=ConnectApprovalDecideRequest result=ConnectApprovalDecideResponse timeout=short
14
+ export const MethodConnectApprovalsList = "connect.approvals.list"; // params=null result=ConnectApprovalsView timeout=short
15
+ export const MethodConnectAppsList = "connect.apps.list"; // params=null result=ConnectAppsView timeout=short
16
+ export const MethodConnectAuthList = "connect.auth.list"; // params=null result=ConnectAuthView timeout=short
17
+ export const MethodConnectAuthRevoke = "connect.auth.revoke"; // params=ConnectAuthRevokeRequest result=Ok timeout=short
18
+ export const MethodConnectBindingsList = "connect.bindings.list"; // params=null result=ConnectBindingsView timeout=short
19
+ export const MethodConnectConnectionPause = "connect.connection.pause"; // params=ConnectConnectionPauseRequest result=Ok timeout=short
20
+ export const MethodConnectHistoryList = "connect.history.list"; // params=ConnectHistoryListRequest result=ConnectHistoryView timeout=short
21
+ export const MethodConnectLaunchIssue = "connect.launch.issue"; // params=ConnectLaunchIssueRequest result=ConnectLaunchIssueResponse timeout=short
22
+ export const MethodConnectPermissionsList = "connect.permissions.list"; // params=ConnectPermissionsListRequest result=ConnectPermissionsView timeout=short
23
+ export const MethodConnectPermissionsRevoke = "connect.permissions.revoke"; // params=ConnectPermissionsRevokeRequest result=Ok timeout=short
24
+ export const MethodConnectRequestExec = "connect.request.exec"; // params=ConnectExecRequest result=JsonValue timeout=connect
25
+ export const MethodEventsSubscribe = "events.subscribe"; // params=EventsSubscribeRequest result=SnapshotEvent timeout=stream
26
+ export const MethodFilesBrowse = "files.browse"; // params=BrowseRequest result=BrowseView timeout=short
27
+ export const MethodFilesList = "files.list"; // params=null result=FilesView timeout=short
28
+ export const MethodInfoGet = "info.get"; // params=null result=Info timeout=short
29
+ export const MethodPricingBatch = "pricing.batch"; // params=PricingBatchRequest result=PricingBatchResponse timeout=short
30
+ export const MethodPricingClearFile = "pricing.clearFile"; // params=PricingClearRequest result=PricingClearResponse timeout=short
31
+ export const MethodPricingSetDefaults = "pricing.setDefaults"; // params=PricingDefaultsRequest result=PricingDefaultsResponse timeout=short
32
+ export const MethodPricingSetFile = "pricing.setFile"; // params=PricingFileRequest result=PricingFileResponse timeout=short
33
+ export const MethodRootsAdd = "roots.add"; // params=AddRootRequest result=AddRootResponse timeout=short
34
+ export const MethodRootsList = "roots.list"; // params=null result=RootsView timeout=short
35
+ export const MethodRootsRemove = "roots.remove"; // params=RootRemoveRequest result=RevisionedOk timeout=short
36
+ export const MethodRootsSetDefault = "roots.setDefault"; // params=SetDefaultRootRequest result=RevisionedOk timeout=short
37
+ export const MethodSettingsGet = "settings.get"; // params=null result=Settings timeout=short
38
+ export const MethodSettingsReset = "settings.reset"; // params=RevisionRequest result=Settings timeout=short
39
+ export const MethodSettingsUpdate = "settings.update"; // params=SettingsUpdate result=Settings timeout=short
40
+ export const MethodStatusGet = "status.get"; // params=null result=Status timeout=probe
41
+ export const MethodStorageDelete = "storage.delete"; // params=StorageDeleteRequest result=Ok timeout=short
42
+ export const MethodStorageGet = "storage.get"; // params=StorageGetRequest result=StorageGetResponse timeout=short
43
+ export const MethodStorageList = "storage.list"; // params=StorageListRequest result=StorageListResponse timeout=short
44
+ export const MethodStoragePut = "storage.put"; // params=StoragePutRequest result=StoragePutResponse timeout=short
45
+ export const MethodTasksCancel = "tasks.cancel"; // params=TaskCancelRequest result=Ok timeout=short
46
+ export const MethodTasksCreate = "tasks.create"; // params=CreateTaskRequest result=Task timeout=long
47
+ export const MethodTasksGet = "tasks.get"; // params=TaskGetRequest result=Task timeout=short
48
+ export const MethodTasksList = "tasks.list"; // params=null result=TaskList timeout=short
49
+ export const MethodTasksSubscribe = "tasks.subscribe"; // params=TaskSubscribeRequest result=Task timeout=stream
50
+ export const MethodWalletCreate = "wallet.create"; // params=WalletCreateRequest result=WalletCreateResponse timeout=long
51
+ export const MethodWalletImport = "wallet.import"; // params=WalletImportRequest result=WalletImportResponse timeout=long
52
+ export const MethodWalletUnlock = "wallet.unlock"; // params=UnlockRequest result=Ok timeout=long
53
+ export const MethodTimeout = {
54
+ "catalog.refresh": "short",
55
+ "collector.config": "short",
56
+ "collector.describe": "short",
57
+ "collector.flush": "short",
58
+ "collector.history": "short",
59
+ "collector.retry": "short",
60
+ "collector.status": "short",
61
+ "connect.approvals.decide": "short",
62
+ "connect.approvals.list": "short",
63
+ "connect.apps.list": "short",
64
+ "connect.auth.list": "short",
65
+ "connect.auth.revoke": "short",
66
+ "connect.bindings.list": "short",
67
+ "connect.connection.pause": "short",
68
+ "connect.history.list": "short",
69
+ "connect.launch.issue": "short",
70
+ "connect.permissions.list": "short",
71
+ "connect.permissions.revoke": "short",
72
+ "connect.request.exec": "connect",
73
+ "events.subscribe": "stream",
74
+ "files.browse": "short",
75
+ "files.list": "short",
76
+ "info.get": "short",
77
+ "pricing.batch": "short",
78
+ "pricing.clearFile": "short",
79
+ "pricing.setDefaults": "short",
80
+ "pricing.setFile": "short",
81
+ "roots.add": "short",
82
+ "roots.list": "short",
83
+ "roots.remove": "short",
84
+ "roots.setDefault": "short",
85
+ "settings.get": "short",
86
+ "settings.reset": "short",
87
+ "settings.update": "short",
88
+ "status.get": "probe",
89
+ "storage.delete": "short",
90
+ "storage.get": "short",
91
+ "storage.list": "short",
92
+ "storage.put": "short",
93
+ "tasks.cancel": "short",
94
+ "tasks.create": "long",
95
+ "tasks.get": "short",
96
+ "tasks.list": "short",
97
+ "tasks.subscribe": "stream",
98
+ "wallet.create": "long",
99
+ "wallet.import": "long",
100
+ "wallet.unlock": "long",
101
+ };
102
+ export const MethodParams = {
103
+ "catalog.refresh": "CatalogRefreshRequest",
104
+ "collector.config": "CollectorConfigRequest",
105
+ "collector.describe": "CollectorDescriptionRequest",
106
+ "collector.flush": "null",
107
+ "collector.history": "null",
108
+ "collector.retry": "null",
109
+ "collector.status": "null",
110
+ "connect.approvals.decide": "ConnectApprovalDecideRequest",
111
+ "connect.approvals.list": "null",
112
+ "connect.apps.list": "null",
113
+ "connect.auth.list": "null",
114
+ "connect.auth.revoke": "ConnectAuthRevokeRequest",
115
+ "connect.bindings.list": "null",
116
+ "connect.connection.pause": "ConnectConnectionPauseRequest",
117
+ "connect.history.list": "ConnectHistoryListRequest",
118
+ "connect.launch.issue": "ConnectLaunchIssueRequest",
119
+ "connect.permissions.list": "ConnectPermissionsListRequest",
120
+ "connect.permissions.revoke": "ConnectPermissionsRevokeRequest",
121
+ "connect.request.exec": "ConnectExecRequest",
122
+ "events.subscribe": "EventsSubscribeRequest",
123
+ "files.browse": "BrowseRequest",
124
+ "files.list": "null",
125
+ "info.get": "null",
126
+ "pricing.batch": "PricingBatchRequest",
127
+ "pricing.clearFile": "PricingClearRequest",
128
+ "pricing.setDefaults": "PricingDefaultsRequest",
129
+ "pricing.setFile": "PricingFileRequest",
130
+ "roots.add": "AddRootRequest",
131
+ "roots.list": "null",
132
+ "roots.remove": "RootRemoveRequest",
133
+ "roots.setDefault": "SetDefaultRootRequest",
134
+ "settings.get": "null",
135
+ "settings.reset": "RevisionRequest",
136
+ "settings.update": "SettingsUpdate",
137
+ "status.get": "null",
138
+ "storage.delete": "StorageDeleteRequest",
139
+ "storage.get": "StorageGetRequest",
140
+ "storage.list": "StorageListRequest",
141
+ "storage.put": "StoragePutRequest",
142
+ "tasks.cancel": "TaskCancelRequest",
143
+ "tasks.create": "CreateTaskRequest",
144
+ "tasks.get": "TaskGetRequest",
145
+ "tasks.list": "null",
146
+ "tasks.subscribe": "TaskSubscribeRequest",
147
+ "wallet.create": "WalletCreateRequest",
148
+ "wallet.import": "WalletImportRequest",
149
+ "wallet.unlock": "UnlockRequest",
150
+ };
151
+ export const MethodResult = {
152
+ "catalog.refresh": "JsonValue",
153
+ "collector.config": "Ok",
154
+ "collector.describe": "Ok",
155
+ "collector.flush": "CollectorFlushResponse",
156
+ "collector.history": "CollectorHistory",
157
+ "collector.retry": "CollectorRetryResponse",
158
+ "collector.status": "CollectorStatus",
159
+ "connect.approvals.decide": "ConnectApprovalDecideResponse",
160
+ "connect.approvals.list": "ConnectApprovalsView",
161
+ "connect.apps.list": "ConnectAppsView",
162
+ "connect.auth.list": "ConnectAuthView",
163
+ "connect.auth.revoke": "Ok",
164
+ "connect.bindings.list": "ConnectBindingsView",
165
+ "connect.connection.pause": "Ok",
166
+ "connect.history.list": "ConnectHistoryView",
167
+ "connect.launch.issue": "ConnectLaunchIssueResponse",
168
+ "connect.permissions.list": "ConnectPermissionsView",
169
+ "connect.permissions.revoke": "Ok",
170
+ "connect.request.exec": "JsonValue",
171
+ "events.subscribe": "SnapshotEvent",
172
+ "files.browse": "BrowseView",
173
+ "files.list": "FilesView",
174
+ "info.get": "Info",
175
+ "pricing.batch": "PricingBatchResponse",
176
+ "pricing.clearFile": "PricingClearResponse",
177
+ "pricing.setDefaults": "PricingDefaultsResponse",
178
+ "pricing.setFile": "PricingFileResponse",
179
+ "roots.add": "AddRootResponse",
180
+ "roots.list": "RootsView",
181
+ "roots.remove": "RevisionedOk",
182
+ "roots.setDefault": "RevisionedOk",
183
+ "settings.get": "Settings",
184
+ "settings.reset": "Settings",
185
+ "settings.update": "Settings",
186
+ "status.get": "Status",
187
+ "storage.delete": "Ok",
188
+ "storage.get": "StorageGetResponse",
189
+ "storage.list": "StorageListResponse",
190
+ "storage.put": "StoragePutResponse",
191
+ "tasks.cancel": "Ok",
192
+ "tasks.create": "Task",
193
+ "tasks.get": "Task",
194
+ "tasks.list": "TaskList",
195
+ "tasks.subscribe": "Task",
196
+ "wallet.create": "WalletCreateResponse",
197
+ "wallet.import": "WalletImportResponse",
198
+ "wallet.unlock": "Ok",
199
+ };
200
+ export const ErrorCodes = [
201
+ "BAD_REQUEST",
202
+ "CANCELLED",
203
+ "CONFLICT",
204
+ "FORBIDDEN",
205
+ "IDENTITY_REQUIRED",
206
+ "INTERNAL",
207
+ "LOCKED",
208
+ "NOT_FOUND",
209
+ "NOT_INITIALIZED",
210
+ "ORIGIN_REJECTED",
211
+ "STATE_CONFLICT",
212
+ "STOPPING",
213
+ "TOO_LARGE",
214
+ "VERSION_MISMATCH",
215
+ ];
216
+ export const KnownTopics = [
217
+ "balance",
218
+ "collector",
219
+ "connect",
220
+ "connection",
221
+ "roots",
222
+ "settings",
223
+ "task",
224
+ "wallet",
225
+ ];