@nacos-group/sdk-proto 1.0.0-beta.2
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/package.json +21 -0
- package/src/ai/agentcapabilities.ts +104 -0
- package/src/ai/agentcard.ts +292 -0
- package/src/ai/agentcarddetailinfo.ts +308 -0
- package/src/ai/agentendpoint.ts +134 -0
- package/src/ai/agentextension.ts +152 -0
- package/src/ai/agentinterface.ts +93 -0
- package/src/ai/agentprovider.ts +75 -0
- package/src/ai/agentskill.ts +109 -0
- package/src/ai/ai_request.ts +608 -0
- package/src/ai/ai_response.ts +466 -0
- package/src/ai/argument.ts +58 -0
- package/src/ai/encryptobject.ts +142 -0
- package/src/ai/frontendpointconfig.ts +93 -0
- package/src/ai/icon.ts +87 -0
- package/src/ai/input.ts +120 -0
- package/src/ai/keyvalueinput.ts +200 -0
- package/src/ai/mcpendpointinfo.ts +87 -0
- package/src/ai/mcpendpointspec.ts +140 -0
- package/src/ai/mcpresourcespecification.ts +165 -0
- package/src/ai/mcpserverbasicinfo.ts +268 -0
- package/src/ai/mcpserverdetailinfo.ts +316 -0
- package/src/ai/mcpserverremoteserviceconfig.ts +88 -0
- package/src/ai/mcpserviceref.ts +87 -0
- package/src/ai/mcptool.ts +289 -0
- package/src/ai/mcptoolannotations.ts +93 -0
- package/src/ai/mcptoolmeta.ts +209 -0
- package/src/ai/mcptoolspecification.ts +250 -0
- package/src/ai/package.ts +142 -0
- package/src/ai/prompt.ts +96 -0
- package/src/ai/promptvariable.ts +81 -0
- package/src/ai/repository.ts +87 -0
- package/src/ai/securityscheme.ts +142 -0
- package/src/ai/serverversiondetail.ts +89 -0
- package/src/common/common.ts +1166 -0
- package/src/config/config_request.ts +887 -0
- package/src/config/config_response.ts +781 -0
- package/src/google/protobuf/struct.ts +415 -0
- package/src/index.ts +42 -0
- package/src/lock/lock.ts +264 -0
- package/src/naming/instance.ts +199 -0
- package/src/naming/naming_request.ts +768 -0
- package/src/naming/naming_response.ts +574 -0
- package/src/naming/serviceinfo.ts +130 -0
- package/tsconfig.json +11 -0
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nacos-group/sdk-proto",
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
|
+
"description": "Nacos SDK Protocol Buffers for Node.js",
|
|
5
|
+
"main": "src/index.ts",
|
|
6
|
+
"types": "src/index.ts",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=18"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/nacos-group/nacos-sdk-proto"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@grpc/grpc-js": "^1.9.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.8
|
|
4
|
+
// protoc v5.28.3
|
|
5
|
+
// source: ai/agentcapabilities.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { AgentExtension } from "./agentextension";
|
|
9
|
+
|
|
10
|
+
/** Auto-generated by proto-generator. DO NOT EDIT. */
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* metadata.type = "AgentCapabilities"
|
|
14
|
+
* Flattened from: AgentCapabilities
|
|
15
|
+
*/
|
|
16
|
+
export interface AgentCapabilities {
|
|
17
|
+
streaming: boolean;
|
|
18
|
+
pushNotifications: boolean;
|
|
19
|
+
stateTransitionHistory: boolean;
|
|
20
|
+
extendedAgentCard: boolean;
|
|
21
|
+
extensions: AgentExtension[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function createBaseAgentCapabilities(): AgentCapabilities {
|
|
25
|
+
return {
|
|
26
|
+
streaming: false,
|
|
27
|
+
pushNotifications: false,
|
|
28
|
+
stateTransitionHistory: false,
|
|
29
|
+
extendedAgentCard: false,
|
|
30
|
+
extensions: [],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const AgentCapabilities: MessageFns<AgentCapabilities> = {
|
|
35
|
+
fromJSON(object: any): AgentCapabilities {
|
|
36
|
+
return {
|
|
37
|
+
streaming: isSet(object.streaming) ? globalThis.Boolean(object.streaming) : false,
|
|
38
|
+
pushNotifications: isSet(object.pushNotifications) ? globalThis.Boolean(object.pushNotifications) : false,
|
|
39
|
+
stateTransitionHistory: isSet(object.stateTransitionHistory)
|
|
40
|
+
? globalThis.Boolean(object.stateTransitionHistory)
|
|
41
|
+
: false,
|
|
42
|
+
extendedAgentCard: isSet(object.extendedAgentCard) ? globalThis.Boolean(object.extendedAgentCard) : false,
|
|
43
|
+
extensions: globalThis.Array.isArray(object?.extensions)
|
|
44
|
+
? object.extensions.map((e: any) => AgentExtension.fromJSON(e))
|
|
45
|
+
: [],
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
toJSON(message: AgentCapabilities): unknown {
|
|
50
|
+
const obj: any = {};
|
|
51
|
+
if (message.streaming !== false) {
|
|
52
|
+
obj.streaming = message.streaming;
|
|
53
|
+
}
|
|
54
|
+
if (message.pushNotifications !== false) {
|
|
55
|
+
obj.pushNotifications = message.pushNotifications;
|
|
56
|
+
}
|
|
57
|
+
if (message.stateTransitionHistory !== false) {
|
|
58
|
+
obj.stateTransitionHistory = message.stateTransitionHistory;
|
|
59
|
+
}
|
|
60
|
+
if (message.extendedAgentCard !== false) {
|
|
61
|
+
obj.extendedAgentCard = message.extendedAgentCard;
|
|
62
|
+
}
|
|
63
|
+
if (message.extensions?.length) {
|
|
64
|
+
obj.extensions = message.extensions.map((e) => AgentExtension.toJSON(e));
|
|
65
|
+
}
|
|
66
|
+
return obj;
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
create<I extends Exact<DeepPartial<AgentCapabilities>, I>>(base?: I): AgentCapabilities {
|
|
70
|
+
return AgentCapabilities.fromPartial(base ?? ({} as any));
|
|
71
|
+
},
|
|
72
|
+
fromPartial<I extends Exact<DeepPartial<AgentCapabilities>, I>>(object: I): AgentCapabilities {
|
|
73
|
+
const message = createBaseAgentCapabilities();
|
|
74
|
+
message.streaming = object.streaming ?? false;
|
|
75
|
+
message.pushNotifications = object.pushNotifications ?? false;
|
|
76
|
+
message.stateTransitionHistory = object.stateTransitionHistory ?? false;
|
|
77
|
+
message.extendedAgentCard = object.extendedAgentCard ?? false;
|
|
78
|
+
message.extensions = object.extensions?.map((e) => AgentExtension.fromPartial(e)) || [];
|
|
79
|
+
return message;
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
84
|
+
|
|
85
|
+
type DeepPartial<T> = T extends Builtin ? T
|
|
86
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
87
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
88
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
89
|
+
: Partial<T>;
|
|
90
|
+
|
|
91
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
92
|
+
type Exact<P, I extends P> = P extends Builtin ? P
|
|
93
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
94
|
+
|
|
95
|
+
function isSet(value: any): boolean {
|
|
96
|
+
return value !== null && value !== undefined;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface MessageFns<T> {
|
|
100
|
+
fromJSON(object: any): T;
|
|
101
|
+
toJSON(message: T): unknown;
|
|
102
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
103
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
104
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.8
|
|
4
|
+
// protoc v5.28.3
|
|
5
|
+
// source: ai/agentcard.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { AgentCapabilities } from "./agentcapabilities";
|
|
9
|
+
import { AgentInterface } from "./agentinterface";
|
|
10
|
+
import { AgentProvider } from "./agentprovider";
|
|
11
|
+
import { AgentSkill } from "./agentskill";
|
|
12
|
+
import { SecurityScheme } from "./securityscheme";
|
|
13
|
+
|
|
14
|
+
/** Auto-generated by proto-generator. DO NOT EDIT. */
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* metadata.type = "AgentCard"
|
|
18
|
+
* Flattened from: AgentCard -> AgentCardBasicInfo
|
|
19
|
+
*/
|
|
20
|
+
export interface AgentCard {
|
|
21
|
+
protocolVersion: string;
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
version: string;
|
|
25
|
+
iconUrl: string;
|
|
26
|
+
capabilities: AgentCapabilities | undefined;
|
|
27
|
+
skills: AgentSkill[];
|
|
28
|
+
url: string;
|
|
29
|
+
preferredTransport: string;
|
|
30
|
+
additionalInterfaces: AgentInterface[];
|
|
31
|
+
supportedInterfaces: AgentInterface[];
|
|
32
|
+
provider: AgentProvider | undefined;
|
|
33
|
+
documentationUrl: string;
|
|
34
|
+
securitySchemes: { [key: string]: SecurityScheme };
|
|
35
|
+
security: any[];
|
|
36
|
+
securityRequirements: any[];
|
|
37
|
+
defaultInputModes: string[];
|
|
38
|
+
defaultOutputModes: string[];
|
|
39
|
+
supportsAuthenticatedExtendedCard: boolean;
|
|
40
|
+
signatures: any[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface AgentCard_SecuritySchemesEntry {
|
|
44
|
+
key: string;
|
|
45
|
+
value: SecurityScheme | undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function createBaseAgentCard(): AgentCard {
|
|
49
|
+
return {
|
|
50
|
+
protocolVersion: "",
|
|
51
|
+
name: "",
|
|
52
|
+
description: "",
|
|
53
|
+
version: "",
|
|
54
|
+
iconUrl: "",
|
|
55
|
+
capabilities: undefined,
|
|
56
|
+
skills: [],
|
|
57
|
+
url: "",
|
|
58
|
+
preferredTransport: "",
|
|
59
|
+
additionalInterfaces: [],
|
|
60
|
+
supportedInterfaces: [],
|
|
61
|
+
provider: undefined,
|
|
62
|
+
documentationUrl: "",
|
|
63
|
+
securitySchemes: {},
|
|
64
|
+
security: [],
|
|
65
|
+
securityRequirements: [],
|
|
66
|
+
defaultInputModes: [],
|
|
67
|
+
defaultOutputModes: [],
|
|
68
|
+
supportsAuthenticatedExtendedCard: false,
|
|
69
|
+
signatures: [],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const AgentCard: MessageFns<AgentCard> = {
|
|
74
|
+
fromJSON(object: any): AgentCard {
|
|
75
|
+
return {
|
|
76
|
+
protocolVersion: isSet(object.protocolVersion) ? globalThis.String(object.protocolVersion) : "",
|
|
77
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
78
|
+
description: isSet(object.description) ? globalThis.String(object.description) : "",
|
|
79
|
+
version: isSet(object.version) ? globalThis.String(object.version) : "",
|
|
80
|
+
iconUrl: isSet(object.iconUrl) ? globalThis.String(object.iconUrl) : "",
|
|
81
|
+
capabilities: isSet(object.capabilities) ? AgentCapabilities.fromJSON(object.capabilities) : undefined,
|
|
82
|
+
skills: globalThis.Array.isArray(object?.skills) ? object.skills.map((e: any) => AgentSkill.fromJSON(e)) : [],
|
|
83
|
+
url: isSet(object.url) ? globalThis.String(object.url) : "",
|
|
84
|
+
preferredTransport: isSet(object.preferredTransport) ? globalThis.String(object.preferredTransport) : "",
|
|
85
|
+
additionalInterfaces: globalThis.Array.isArray(object?.additionalInterfaces)
|
|
86
|
+
? object.additionalInterfaces.map((e: any) => AgentInterface.fromJSON(e))
|
|
87
|
+
: [],
|
|
88
|
+
supportedInterfaces: globalThis.Array.isArray(object?.supportedInterfaces)
|
|
89
|
+
? object.supportedInterfaces.map((e: any) => AgentInterface.fromJSON(e))
|
|
90
|
+
: [],
|
|
91
|
+
provider: isSet(object.provider) ? AgentProvider.fromJSON(object.provider) : undefined,
|
|
92
|
+
documentationUrl: isSet(object.documentationUrl) ? globalThis.String(object.documentationUrl) : "",
|
|
93
|
+
securitySchemes: isObject(object.securitySchemes)
|
|
94
|
+
? (globalThis.Object.entries(object.securitySchemes) as [string, any][]).reduce(
|
|
95
|
+
(acc: { [key: string]: SecurityScheme }, [key, value]: [string, any]) => {
|
|
96
|
+
acc[key] = SecurityScheme.fromJSON(value);
|
|
97
|
+
return acc;
|
|
98
|
+
},
|
|
99
|
+
{},
|
|
100
|
+
)
|
|
101
|
+
: {},
|
|
102
|
+
security: globalThis.Array.isArray(object?.security) ? [...object.security] : [],
|
|
103
|
+
securityRequirements: globalThis.Array.isArray(object?.securityRequirements)
|
|
104
|
+
? [...object.securityRequirements]
|
|
105
|
+
: [],
|
|
106
|
+
defaultInputModes: globalThis.Array.isArray(object?.defaultInputModes)
|
|
107
|
+
? object.defaultInputModes.map((e: any) => globalThis.String(e))
|
|
108
|
+
: [],
|
|
109
|
+
defaultOutputModes: globalThis.Array.isArray(object?.defaultOutputModes)
|
|
110
|
+
? object.defaultOutputModes.map((e: any) => globalThis.String(e))
|
|
111
|
+
: [],
|
|
112
|
+
supportsAuthenticatedExtendedCard: isSet(object.supportsAuthenticatedExtendedCard)
|
|
113
|
+
? globalThis.Boolean(object.supportsAuthenticatedExtendedCard)
|
|
114
|
+
: false,
|
|
115
|
+
signatures: globalThis.Array.isArray(object?.signatures) ? [...object.signatures] : [],
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
toJSON(message: AgentCard): unknown {
|
|
120
|
+
const obj: any = {};
|
|
121
|
+
if (message.protocolVersion !== "") {
|
|
122
|
+
obj.protocolVersion = message.protocolVersion;
|
|
123
|
+
}
|
|
124
|
+
if (message.name !== "") {
|
|
125
|
+
obj.name = message.name;
|
|
126
|
+
}
|
|
127
|
+
if (message.description !== "") {
|
|
128
|
+
obj.description = message.description;
|
|
129
|
+
}
|
|
130
|
+
if (message.version !== "") {
|
|
131
|
+
obj.version = message.version;
|
|
132
|
+
}
|
|
133
|
+
if (message.iconUrl !== "") {
|
|
134
|
+
obj.iconUrl = message.iconUrl;
|
|
135
|
+
}
|
|
136
|
+
if (message.capabilities !== undefined) {
|
|
137
|
+
obj.capabilities = AgentCapabilities.toJSON(message.capabilities);
|
|
138
|
+
}
|
|
139
|
+
if (message.skills?.length) {
|
|
140
|
+
obj.skills = message.skills.map((e) => AgentSkill.toJSON(e));
|
|
141
|
+
}
|
|
142
|
+
if (message.url !== "") {
|
|
143
|
+
obj.url = message.url;
|
|
144
|
+
}
|
|
145
|
+
if (message.preferredTransport !== "") {
|
|
146
|
+
obj.preferredTransport = message.preferredTransport;
|
|
147
|
+
}
|
|
148
|
+
if (message.additionalInterfaces?.length) {
|
|
149
|
+
obj.additionalInterfaces = message.additionalInterfaces.map((e) => AgentInterface.toJSON(e));
|
|
150
|
+
}
|
|
151
|
+
if (message.supportedInterfaces?.length) {
|
|
152
|
+
obj.supportedInterfaces = message.supportedInterfaces.map((e) => AgentInterface.toJSON(e));
|
|
153
|
+
}
|
|
154
|
+
if (message.provider !== undefined) {
|
|
155
|
+
obj.provider = AgentProvider.toJSON(message.provider);
|
|
156
|
+
}
|
|
157
|
+
if (message.documentationUrl !== "") {
|
|
158
|
+
obj.documentationUrl = message.documentationUrl;
|
|
159
|
+
}
|
|
160
|
+
if (message.securitySchemes) {
|
|
161
|
+
const entries = globalThis.Object.entries(message.securitySchemes) as [string, SecurityScheme][];
|
|
162
|
+
if (entries.length > 0) {
|
|
163
|
+
obj.securitySchemes = {};
|
|
164
|
+
entries.forEach(([k, v]) => {
|
|
165
|
+
obj.securitySchemes[k] = SecurityScheme.toJSON(v);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (message.security?.length) {
|
|
170
|
+
obj.security = message.security;
|
|
171
|
+
}
|
|
172
|
+
if (message.securityRequirements?.length) {
|
|
173
|
+
obj.securityRequirements = message.securityRequirements;
|
|
174
|
+
}
|
|
175
|
+
if (message.defaultInputModes?.length) {
|
|
176
|
+
obj.defaultInputModes = message.defaultInputModes;
|
|
177
|
+
}
|
|
178
|
+
if (message.defaultOutputModes?.length) {
|
|
179
|
+
obj.defaultOutputModes = message.defaultOutputModes;
|
|
180
|
+
}
|
|
181
|
+
if (message.supportsAuthenticatedExtendedCard !== false) {
|
|
182
|
+
obj.supportsAuthenticatedExtendedCard = message.supportsAuthenticatedExtendedCard;
|
|
183
|
+
}
|
|
184
|
+
if (message.signatures?.length) {
|
|
185
|
+
obj.signatures = message.signatures;
|
|
186
|
+
}
|
|
187
|
+
return obj;
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
create<I extends Exact<DeepPartial<AgentCard>, I>>(base?: I): AgentCard {
|
|
191
|
+
return AgentCard.fromPartial(base ?? ({} as any));
|
|
192
|
+
},
|
|
193
|
+
fromPartial<I extends Exact<DeepPartial<AgentCard>, I>>(object: I): AgentCard {
|
|
194
|
+
const message = createBaseAgentCard();
|
|
195
|
+
message.protocolVersion = object.protocolVersion ?? "";
|
|
196
|
+
message.name = object.name ?? "";
|
|
197
|
+
message.description = object.description ?? "";
|
|
198
|
+
message.version = object.version ?? "";
|
|
199
|
+
message.iconUrl = object.iconUrl ?? "";
|
|
200
|
+
message.capabilities = (object.capabilities !== undefined && object.capabilities !== null)
|
|
201
|
+
? AgentCapabilities.fromPartial(object.capabilities)
|
|
202
|
+
: undefined;
|
|
203
|
+
message.skills = object.skills?.map((e) => AgentSkill.fromPartial(e)) || [];
|
|
204
|
+
message.url = object.url ?? "";
|
|
205
|
+
message.preferredTransport = object.preferredTransport ?? "";
|
|
206
|
+
message.additionalInterfaces = object.additionalInterfaces?.map((e) => AgentInterface.fromPartial(e)) || [];
|
|
207
|
+
message.supportedInterfaces = object.supportedInterfaces?.map((e) => AgentInterface.fromPartial(e)) || [];
|
|
208
|
+
message.provider = (object.provider !== undefined && object.provider !== null)
|
|
209
|
+
? AgentProvider.fromPartial(object.provider)
|
|
210
|
+
: undefined;
|
|
211
|
+
message.documentationUrl = object.documentationUrl ?? "";
|
|
212
|
+
message.securitySchemes = (globalThis.Object.entries(object.securitySchemes ?? {}) as [string, SecurityScheme][])
|
|
213
|
+
.reduce((acc: { [key: string]: SecurityScheme }, [key, value]: [string, SecurityScheme]) => {
|
|
214
|
+
if (value !== undefined) {
|
|
215
|
+
acc[key] = SecurityScheme.fromPartial(value);
|
|
216
|
+
}
|
|
217
|
+
return acc;
|
|
218
|
+
}, {});
|
|
219
|
+
message.security = object.security?.map((e) => e) || [];
|
|
220
|
+
message.securityRequirements = object.securityRequirements?.map((e) => e) || [];
|
|
221
|
+
message.defaultInputModes = object.defaultInputModes?.map((e) => e) || [];
|
|
222
|
+
message.defaultOutputModes = object.defaultOutputModes?.map((e) => e) || [];
|
|
223
|
+
message.supportsAuthenticatedExtendedCard = object.supportsAuthenticatedExtendedCard ?? false;
|
|
224
|
+
message.signatures = object.signatures?.map((e) => e) || [];
|
|
225
|
+
return message;
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
function createBaseAgentCard_SecuritySchemesEntry(): AgentCard_SecuritySchemesEntry {
|
|
230
|
+
return { key: "", value: undefined };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export const AgentCard_SecuritySchemesEntry: MessageFns<AgentCard_SecuritySchemesEntry> = {
|
|
234
|
+
fromJSON(object: any): AgentCard_SecuritySchemesEntry {
|
|
235
|
+
return {
|
|
236
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
237
|
+
value: isSet(object.value) ? SecurityScheme.fromJSON(object.value) : undefined,
|
|
238
|
+
};
|
|
239
|
+
},
|
|
240
|
+
|
|
241
|
+
toJSON(message: AgentCard_SecuritySchemesEntry): unknown {
|
|
242
|
+
const obj: any = {};
|
|
243
|
+
if (message.key !== "") {
|
|
244
|
+
obj.key = message.key;
|
|
245
|
+
}
|
|
246
|
+
if (message.value !== undefined) {
|
|
247
|
+
obj.value = SecurityScheme.toJSON(message.value);
|
|
248
|
+
}
|
|
249
|
+
return obj;
|
|
250
|
+
},
|
|
251
|
+
|
|
252
|
+
create<I extends Exact<DeepPartial<AgentCard_SecuritySchemesEntry>, I>>(base?: I): AgentCard_SecuritySchemesEntry {
|
|
253
|
+
return AgentCard_SecuritySchemesEntry.fromPartial(base ?? ({} as any));
|
|
254
|
+
},
|
|
255
|
+
fromPartial<I extends Exact<DeepPartial<AgentCard_SecuritySchemesEntry>, I>>(
|
|
256
|
+
object: I,
|
|
257
|
+
): AgentCard_SecuritySchemesEntry {
|
|
258
|
+
const message = createBaseAgentCard_SecuritySchemesEntry();
|
|
259
|
+
message.key = object.key ?? "";
|
|
260
|
+
message.value = (object.value !== undefined && object.value !== null)
|
|
261
|
+
? SecurityScheme.fromPartial(object.value)
|
|
262
|
+
: undefined;
|
|
263
|
+
return message;
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
268
|
+
|
|
269
|
+
type DeepPartial<T> = T extends Builtin ? T
|
|
270
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
271
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
272
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
273
|
+
: Partial<T>;
|
|
274
|
+
|
|
275
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
276
|
+
type Exact<P, I extends P> = P extends Builtin ? P
|
|
277
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
278
|
+
|
|
279
|
+
function isObject(value: any): boolean {
|
|
280
|
+
return typeof value === "object" && value !== null;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function isSet(value: any): boolean {
|
|
284
|
+
return value !== null && value !== undefined;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
interface MessageFns<T> {
|
|
288
|
+
fromJSON(object: any): T;
|
|
289
|
+
toJSON(message: T): unknown;
|
|
290
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
291
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
292
|
+
}
|