@hashgraphonline/standards-sdk 0.1.174 → 0.1.176
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/README.md +23 -0
- package/dist/browser/inscribe/inscriber.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/client/base-client.d.ts +9 -5
- package/dist/browser/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/client/skills.d.ts +9 -5
- package/dist/browser/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/schemas.d.ts +2870 -8
- package/dist/browser/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/types.d.ts +36 -1
- package/dist/browser/services/registry-broker/types.d.ts.map +1 -1
- package/dist/browser/standards-sdk.browser.js +171 -15
- package/dist/browser/standards-sdk.browser.js.map +1 -1
- package/dist/browser-root/inscribe/inscriber.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/client/base-client.d.ts +9 -5
- package/dist/browser-root/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/client/skills.d.ts +9 -5
- package/dist/browser-root/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/schemas.d.ts +2870 -8
- package/dist/browser-root/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/types.d.ts +36 -1
- package/dist/browser-root/services/registry-broker/types.d.ts.map +1 -1
- package/dist/browser-root/standards-sdk.root-browser.js +308 -1
- package/dist/browser-root/standards-sdk.root-browser.js.map +1 -1
- package/dist/cjs/inscribe/inscriber.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client/base-client.d.ts +9 -5
- package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client/skills.d.ts +9 -5
- package/dist/cjs/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/schemas.d.ts +2870 -8
- package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/types.d.ts +36 -1
- package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +2 -2
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/es/inscribe/inscriber.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client/base-client.d.ts +9 -5
- package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client/skills.d.ts +9 -5
- package/dist/es/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/es/services/registry-broker/schemas.d.ts +2870 -8
- package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/es/services/registry-broker/types.d.ts +36 -1
- package/dist/es/services/registry-broker/types.d.ts.map +1 -1
- package/dist/es/standards-sdk.es121.js +1 -1
- package/dist/es/standards-sdk.es128.js +5 -5
- package/dist/es/standards-sdk.es138.js +1 -1
- package/dist/es/standards-sdk.es139.js +1 -1
- package/dist/es/standards-sdk.es140.js +5 -5
- package/dist/es/standards-sdk.es142.js +18 -16
- package/dist/es/standards-sdk.es142.js.map +1 -1
- package/dist/es/standards-sdk.es145.js +23 -2
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es148.js +1 -1
- package/dist/es/standards-sdk.es160.js +171 -1
- package/dist/es/standards-sdk.es160.js.map +1 -1
- package/dist/es/standards-sdk.es163.js +55 -572
- package/dist/es/standards-sdk.es163.js.map +1 -1
- package/dist/es/standards-sdk.es164.js +90 -158
- package/dist/es/standards-sdk.es164.js.map +1 -1
- package/dist/es/standards-sdk.es165.js +71 -312
- package/dist/es/standards-sdk.es165.js.map +1 -1
- package/dist/es/standards-sdk.es166.js +187 -333
- package/dist/es/standards-sdk.es166.js.map +1 -1
- package/dist/es/standards-sdk.es167.js +696 -437
- package/dist/es/standards-sdk.es167.js.map +1 -1
- package/dist/es/standards-sdk.es168.js +65 -323
- package/dist/es/standards-sdk.es168.js.map +1 -1
- package/dist/es/standards-sdk.es169.js +162 -66
- package/dist/es/standards-sdk.es169.js.map +1 -1
- package/dist/es/standards-sdk.es170.js +306 -88
- package/dist/es/standards-sdk.es170.js.map +1 -1
- package/dist/es/standards-sdk.es171.js +337 -64
- package/dist/es/standards-sdk.es171.js.map +1 -1
- package/dist/es/standards-sdk.es172.js +452 -55
- package/dist/es/standards-sdk.es172.js.map +1 -1
- package/dist/es/standards-sdk.es173.js +321 -71
- package/dist/es/standards-sdk.es173.js.map +1 -1
- package/dist/es/standards-sdk.es174.js +58 -182
- package/dist/es/standards-sdk.es174.js.map +1 -1
- package/dist/es/standards-sdk.es178.js +1 -1
- package/dist/es/standards-sdk.es181.js +1 -1
- package/dist/es/standards-sdk.es56.js +1 -1
- package/dist/es/standards-sdk.es59.js +1 -1
- package/dist/es/standards-sdk.es60.js +1 -1
- package/dist/es/standards-sdk.es62.js +1 -1
- package/dist/es/standards-sdk.es63.js +2 -2
- package/dist/es/standards-sdk.es64.js +1 -1
- package/dist/es/standards-sdk.es65.js +1 -1
- package/dist/es/standards-sdk.es66.js +1 -1
- package/dist/es/standards-sdk.es69.js +1 -1
- package/package.json +2 -1
|
@@ -1,456 +1,715 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (decoded.transactionList && decoded.transactionList.length > 0) {
|
|
17
|
-
const tx = decoded.transactionList[0];
|
|
18
|
-
let txBody = null;
|
|
19
|
-
if (tx.bodyBytes && tx.bodyBytes.length > 0) {
|
|
20
|
-
txBody = proto.TransactionBody.decode(tx.bodyBytes);
|
|
21
|
-
} else if (tx.signedTransactionBytes && tx.signedTransactionBytes.length > 0) {
|
|
22
|
-
const signedTx = proto.SignedTransaction.decode(
|
|
23
|
-
tx.signedTransactionBytes
|
|
24
|
-
);
|
|
25
|
-
if (signedTx.bodyBytes) {
|
|
26
|
-
txBody = proto.TransactionBody.decode(signedTx.bodyBytes);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (txBody) {
|
|
30
|
-
const protoResult = this.parseFromProtobufTxBody(txBody);
|
|
31
|
-
if (protoResult.type && protoResult.type !== "UNKNOWN") {
|
|
32
|
-
return protoResult;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
} catch (protoError) {
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return this.parseFromTransactionInternals(transaction);
|
|
40
|
-
} catch (error) {
|
|
41
|
-
return {
|
|
42
|
-
type: "UNKNOWN",
|
|
43
|
-
humanReadableType: "Unknown Contract Transaction"
|
|
44
|
-
};
|
|
45
|
-
}
|
|
1
|
+
import { skillRegistryConfigResponseSchema, skillStatusResponseSchema, skillRegistryListResponseSchema, skillSecurityBreakdownResponseSchema, skillCatalogResponseSchema, skillRegistryVersionsResponseSchema, skillRegistryMineResponseSchema, skillRegistryMyListResponseSchema, skillRegistryQuoteResponseSchema, skillRegistryPublishResponseSchema, skillRegistryJobStatusResponseSchema, skillRegistryOwnershipResponseSchema, skillRecommendedVersionResponseSchema, skillDeprecationsResponseSchema, skillDeprecationRecordSchema, skillBadgeResponseSchema, skillPreviewRecordSchema, skillPreviewLookupResponseSchema, skillInstallResponseSchema, skillInstallCopyTelemetryResponseSchema, skillRegistryTagsResponseSchema, skillRegistryCategoriesResponseSchema, skillResolverManifestResponseSchema, skillRegistryVoteStatusResponseSchema, skillVerificationRequestCreateResponseSchema, skillVerificationStatusResponseSchema, skillVerificationDomainProofChallengeResponseSchema, skillVerificationDomainProofVerifyResponseSchema } from "./standards-sdk.es160.js";
|
|
2
|
+
async function skillsConfig(client) {
|
|
3
|
+
const raw = await client.requestJson("/skills/config", {
|
|
4
|
+
method: "GET"
|
|
5
|
+
});
|
|
6
|
+
return client.parseWithSchema(
|
|
7
|
+
raw,
|
|
8
|
+
skillRegistryConfigResponseSchema,
|
|
9
|
+
"skill registry config response"
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
async function getSkillStatus(client, params) {
|
|
13
|
+
const normalizedName = params.name.trim();
|
|
14
|
+
if (!normalizedName) {
|
|
15
|
+
throw new Error("name is required");
|
|
46
16
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
type: "CONTRACTCALL",
|
|
57
|
-
humanReadableType: "Contract Call",
|
|
58
|
-
contractCall
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (txBody.contractCreateInstance) {
|
|
63
|
-
const contractCreate = this.parseContractCreate(
|
|
64
|
-
txBody.contractCreateInstance
|
|
65
|
-
);
|
|
66
|
-
if (contractCreate) {
|
|
67
|
-
return {
|
|
68
|
-
type: "CONTRACTCREATE",
|
|
69
|
-
humanReadableType: "Contract Create",
|
|
70
|
-
contractCreate
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (txBody.contractUpdateInstance) {
|
|
75
|
-
const contractUpdate = this.parseContractUpdate(
|
|
76
|
-
txBody.contractUpdateInstance
|
|
77
|
-
);
|
|
78
|
-
if (contractUpdate) {
|
|
79
|
-
return {
|
|
80
|
-
type: "CONTRACTUPDATE",
|
|
81
|
-
humanReadableType: "Contract Update",
|
|
82
|
-
contractUpdate
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (txBody.contractDeleteInstance) {
|
|
87
|
-
const contractDelete = this.parseContractDelete(
|
|
88
|
-
txBody.contractDeleteInstance
|
|
89
|
-
);
|
|
90
|
-
if (contractDelete) {
|
|
91
|
-
return {
|
|
92
|
-
type: "CONTRACTDELETE",
|
|
93
|
-
humanReadableType: "Contract Delete",
|
|
94
|
-
contractDelete
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (txBody.ethereumTransaction) {
|
|
99
|
-
const ethereumCall = this.parseEthereumTransaction(
|
|
100
|
-
txBody.ethereumTransaction
|
|
101
|
-
);
|
|
102
|
-
if (ethereumCall) {
|
|
103
|
-
return {
|
|
104
|
-
type: "ETHEREUMTRANSACTION",
|
|
105
|
-
humanReadableType: "Ethereum Transaction",
|
|
106
|
-
ethereumTransaction: ethereumCall
|
|
107
|
-
};
|
|
108
|
-
}
|
|
17
|
+
const query = new URLSearchParams();
|
|
18
|
+
query.set("name", normalizedName);
|
|
19
|
+
if (params.version?.trim()) {
|
|
20
|
+
query.set("version", params.version.trim());
|
|
21
|
+
}
|
|
22
|
+
const raw = await client.requestJson(
|
|
23
|
+
`/skills/status?${query.toString()}`,
|
|
24
|
+
{
|
|
25
|
+
method: "GET"
|
|
109
26
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return {};
|
|
27
|
+
);
|
|
28
|
+
return client.parseWithSchema(
|
|
29
|
+
raw,
|
|
30
|
+
skillStatusResponseSchema,
|
|
31
|
+
"skill status response"
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function buildRepoPreviewQuery(params) {
|
|
35
|
+
const repo = params.repo.trim();
|
|
36
|
+
const skillDir = params.skillDir.trim();
|
|
37
|
+
if (!repo) {
|
|
38
|
+
throw new Error("repo is required");
|
|
39
|
+
}
|
|
40
|
+
if (!skillDir) {
|
|
41
|
+
throw new Error("skillDir is required");
|
|
42
|
+
}
|
|
43
|
+
const query = new URLSearchParams();
|
|
44
|
+
query.set("repo", repo);
|
|
45
|
+
query.set("skillDir", skillDir);
|
|
46
|
+
if (params.ref?.trim()) {
|
|
47
|
+
query.set("ref", params.ref.trim());
|
|
48
|
+
}
|
|
49
|
+
return query.toString();
|
|
50
|
+
}
|
|
51
|
+
async function getSkillStatusByRepo(client, params) {
|
|
52
|
+
const query = buildRepoPreviewQuery(params);
|
|
53
|
+
const raw = await client.requestJson(
|
|
54
|
+
`/skills/status/by-repo?${query}`,
|
|
55
|
+
{ method: "GET" }
|
|
56
|
+
);
|
|
57
|
+
return client.parseWithSchema(
|
|
58
|
+
raw,
|
|
59
|
+
skillStatusResponseSchema,
|
|
60
|
+
"skill status response"
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
async function listSkills(client, params = {}) {
|
|
64
|
+
const query = new URLSearchParams();
|
|
65
|
+
if (params.name) {
|
|
66
|
+
query.set("name", params.name);
|
|
67
|
+
}
|
|
68
|
+
if (params.version) {
|
|
69
|
+
query.set("version", params.version);
|
|
70
|
+
}
|
|
71
|
+
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
72
|
+
query.set("limit", String(Math.trunc(params.limit)));
|
|
73
|
+
}
|
|
74
|
+
if (params.cursor) {
|
|
75
|
+
query.set("cursor", params.cursor);
|
|
76
|
+
}
|
|
77
|
+
if (typeof params.includeFiles === "boolean") {
|
|
78
|
+
query.set("includeFiles", params.includeFiles ? "true" : "false");
|
|
79
|
+
}
|
|
80
|
+
if (params.accountId) {
|
|
81
|
+
query.set("accountId", params.accountId);
|
|
82
|
+
}
|
|
83
|
+
if (params.q) {
|
|
84
|
+
query.set("q", params.q);
|
|
85
|
+
}
|
|
86
|
+
if (params.tag) {
|
|
87
|
+
query.set("tag", params.tag);
|
|
88
|
+
}
|
|
89
|
+
if (params.category) {
|
|
90
|
+
query.set("category", params.category);
|
|
91
|
+
}
|
|
92
|
+
if (typeof params.featured === "boolean") {
|
|
93
|
+
query.set("featured", params.featured ? "true" : "false");
|
|
94
|
+
}
|
|
95
|
+
if (typeof params.verified === "boolean") {
|
|
96
|
+
query.set("verified", params.verified ? "true" : "false");
|
|
97
|
+
}
|
|
98
|
+
if (params.view) {
|
|
99
|
+
query.set("view", params.view);
|
|
100
|
+
}
|
|
101
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
102
|
+
const raw = await client.requestJson(`/skills${suffix}`, {
|
|
103
|
+
method: "GET"
|
|
104
|
+
});
|
|
105
|
+
return client.parseWithSchema(
|
|
106
|
+
raw,
|
|
107
|
+
skillRegistryListResponseSchema,
|
|
108
|
+
"skill registry list response"
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
async function getSkillSecurityBreakdown(client, params) {
|
|
112
|
+
const normalizedJobId = params.jobId.trim();
|
|
113
|
+
if (!normalizedJobId) {
|
|
114
|
+
throw new Error("jobId is required");
|
|
115
|
+
}
|
|
116
|
+
const raw = await client.requestJson(
|
|
117
|
+
`/skills/${encodeURIComponent(normalizedJobId)}/security-breakdown`,
|
|
118
|
+
{ method: "GET" }
|
|
119
|
+
);
|
|
120
|
+
return client.parseWithSchema(
|
|
121
|
+
raw,
|
|
122
|
+
skillSecurityBreakdownResponseSchema,
|
|
123
|
+
"skill security breakdown response"
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
async function getSkillsCatalog(client, params = {}) {
|
|
127
|
+
const query = new URLSearchParams();
|
|
128
|
+
if (params.q) {
|
|
129
|
+
query.set("q", params.q);
|
|
130
|
+
}
|
|
131
|
+
if (params.category) {
|
|
132
|
+
query.set("category", params.category);
|
|
133
|
+
}
|
|
134
|
+
params.tags?.forEach((tag) => {
|
|
135
|
+
if (tag.trim()) {
|
|
136
|
+
query.append("tag", tag.trim());
|
|
221
137
|
}
|
|
138
|
+
});
|
|
139
|
+
if (typeof params.featured === "boolean") {
|
|
140
|
+
query.set("featured", params.featured ? "true" : "false");
|
|
222
141
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
142
|
+
if (typeof params.verified === "boolean") {
|
|
143
|
+
query.set("verified", params.verified ? "true" : "false");
|
|
144
|
+
}
|
|
145
|
+
if (params.channel) {
|
|
146
|
+
query.set("channel", params.channel);
|
|
147
|
+
}
|
|
148
|
+
if (params.sortBy) {
|
|
149
|
+
query.set("sortBy", params.sortBy);
|
|
150
|
+
}
|
|
151
|
+
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
152
|
+
query.set("limit", String(Math.trunc(params.limit)));
|
|
153
|
+
}
|
|
154
|
+
if (params.cursor) {
|
|
155
|
+
query.set("cursor", params.cursor);
|
|
156
|
+
}
|
|
157
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
158
|
+
const raw = await client.requestJson(`/skills/catalog${suffix}`, {
|
|
159
|
+
method: "GET"
|
|
160
|
+
});
|
|
161
|
+
return client.parseWithSchema(
|
|
162
|
+
raw,
|
|
163
|
+
skillCatalogResponseSchema,
|
|
164
|
+
"skill catalog response"
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
async function listSkillVersions(client, params) {
|
|
168
|
+
const normalizedName = params.name.trim();
|
|
169
|
+
if (!normalizedName) {
|
|
170
|
+
throw new Error("name is required");
|
|
171
|
+
}
|
|
172
|
+
const query = new URLSearchParams();
|
|
173
|
+
query.set("name", normalizedName);
|
|
174
|
+
const raw = await client.requestJson(
|
|
175
|
+
`/skills/versions?${query.toString()}`,
|
|
176
|
+
{ method: "GET" }
|
|
177
|
+
);
|
|
178
|
+
return client.parseWithSchema(
|
|
179
|
+
raw,
|
|
180
|
+
skillRegistryVersionsResponseSchema,
|
|
181
|
+
"skill registry versions response"
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
async function listMySkills(client, params = {}) {
|
|
185
|
+
const query = new URLSearchParams();
|
|
186
|
+
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
187
|
+
query.set("limit", String(Math.trunc(params.limit)));
|
|
188
|
+
}
|
|
189
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
190
|
+
const raw = await client.requestJson(`/skills/mine${suffix}`, {
|
|
191
|
+
method: "GET"
|
|
192
|
+
});
|
|
193
|
+
return client.parseWithSchema(
|
|
194
|
+
raw,
|
|
195
|
+
skillRegistryMineResponseSchema,
|
|
196
|
+
"skill registry mine response"
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
async function getMySkillsList(client, params = {}) {
|
|
200
|
+
const query = new URLSearchParams();
|
|
201
|
+
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
202
|
+
query.set("limit", String(Math.trunc(params.limit)));
|
|
203
|
+
}
|
|
204
|
+
if (params.cursor) {
|
|
205
|
+
query.set("cursor", params.cursor);
|
|
206
|
+
}
|
|
207
|
+
if (params.accountId) {
|
|
208
|
+
query.set("accountId", params.accountId);
|
|
209
|
+
}
|
|
210
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
211
|
+
const raw = await client.requestJson(`/skills/my-list${suffix}`, {
|
|
212
|
+
method: "GET"
|
|
213
|
+
});
|
|
214
|
+
return client.parseWithSchema(
|
|
215
|
+
raw,
|
|
216
|
+
skillRegistryMyListResponseSchema,
|
|
217
|
+
"skill registry my list response"
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
async function quoteSkillPublish(client, payload) {
|
|
221
|
+
const raw = await client.requestJson("/skills/quote", {
|
|
222
|
+
method: "POST",
|
|
223
|
+
body: payload,
|
|
224
|
+
headers: { "content-type": "application/json" }
|
|
225
|
+
});
|
|
226
|
+
return client.parseWithSchema(
|
|
227
|
+
raw,
|
|
228
|
+
skillRegistryQuoteResponseSchema,
|
|
229
|
+
"skill registry quote response"
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
async function publishSkill(client, payload) {
|
|
233
|
+
const raw = await client.requestJson("/skills/publish", {
|
|
234
|
+
method: "POST",
|
|
235
|
+
body: payload,
|
|
236
|
+
headers: { "content-type": "application/json" }
|
|
237
|
+
});
|
|
238
|
+
return client.parseWithSchema(
|
|
239
|
+
raw,
|
|
240
|
+
skillRegistryPublishResponseSchema,
|
|
241
|
+
"skill registry publish response"
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
async function getSkillPublishJob(client, jobId, params = {}) {
|
|
245
|
+
const normalized = jobId.trim();
|
|
246
|
+
if (!normalized) {
|
|
247
|
+
throw new Error("jobId is required");
|
|
248
|
+
}
|
|
249
|
+
const query = new URLSearchParams();
|
|
250
|
+
if (params.accountId) {
|
|
251
|
+
query.set("accountId", params.accountId);
|
|
252
|
+
}
|
|
253
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
254
|
+
const raw = await client.requestJson(
|
|
255
|
+
`/skills/jobs/${encodeURIComponent(normalized)}${suffix}`,
|
|
256
|
+
{ method: "GET" }
|
|
257
|
+
);
|
|
258
|
+
return client.parseWithSchema(
|
|
259
|
+
raw,
|
|
260
|
+
skillRegistryJobStatusResponseSchema,
|
|
261
|
+
"skill registry job status response"
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
async function getSkillOwnership(client, params) {
|
|
265
|
+
const normalizedName = params.name.trim();
|
|
266
|
+
if (!normalizedName) {
|
|
267
|
+
throw new Error("name is required");
|
|
268
|
+
}
|
|
269
|
+
const query = new URLSearchParams();
|
|
270
|
+
query.set("name", normalizedName);
|
|
271
|
+
if (params.accountId) {
|
|
272
|
+
query.set("accountId", params.accountId);
|
|
273
|
+
}
|
|
274
|
+
const raw = await client.requestJson(
|
|
275
|
+
`/skills/ownership?${query.toString()}`,
|
|
276
|
+
{
|
|
277
|
+
method: "GET"
|
|
271
278
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
279
|
+
);
|
|
280
|
+
return client.parseWithSchema(
|
|
281
|
+
raw,
|
|
282
|
+
skillRegistryOwnershipResponseSchema,
|
|
283
|
+
"skill registry ownership response"
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
async function getRecommendedSkillVersion(client, params) {
|
|
287
|
+
const normalizedName = params.name.trim();
|
|
288
|
+
if (!normalizedName) {
|
|
289
|
+
throw new Error("name is required");
|
|
290
|
+
}
|
|
291
|
+
const query = new URLSearchParams();
|
|
292
|
+
query.set("name", normalizedName);
|
|
293
|
+
const raw = await client.requestJson(
|
|
294
|
+
`/skills/recommended?${query.toString()}`,
|
|
295
|
+
{ method: "GET" }
|
|
296
|
+
);
|
|
297
|
+
return client.parseWithSchema(
|
|
298
|
+
raw,
|
|
299
|
+
skillRecommendedVersionResponseSchema,
|
|
300
|
+
"skill recommended version response"
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
async function setRecommendedSkillVersion(client, payload) {
|
|
304
|
+
const normalizedName = payload.name.trim();
|
|
305
|
+
const normalizedVersion = payload.version.trim();
|
|
306
|
+
if (!normalizedName) {
|
|
307
|
+
throw new Error("name is required");
|
|
308
|
+
}
|
|
309
|
+
if (!normalizedVersion) {
|
|
310
|
+
throw new Error("version is required");
|
|
311
|
+
}
|
|
312
|
+
const raw = await client.requestJson("/skills/recommended", {
|
|
313
|
+
method: "POST",
|
|
314
|
+
body: {
|
|
315
|
+
name: normalizedName,
|
|
316
|
+
version: normalizedVersion
|
|
317
|
+
},
|
|
318
|
+
headers: { "content-type": "application/json" }
|
|
319
|
+
});
|
|
320
|
+
return client.parseWithSchema(
|
|
321
|
+
raw,
|
|
322
|
+
skillRecommendedVersionResponseSchema,
|
|
323
|
+
"skill recommended version response"
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
async function getSkillDeprecations(client, params) {
|
|
327
|
+
const normalizedName = params.name.trim();
|
|
328
|
+
if (!normalizedName) {
|
|
329
|
+
throw new Error("name is required");
|
|
330
|
+
}
|
|
331
|
+
const query = new URLSearchParams();
|
|
332
|
+
query.set("name", normalizedName);
|
|
333
|
+
const raw = await client.requestJson(
|
|
334
|
+
`/skills/deprecations?${query.toString()}`,
|
|
335
|
+
{ method: "GET" }
|
|
336
|
+
);
|
|
337
|
+
return client.parseWithSchema(
|
|
338
|
+
raw,
|
|
339
|
+
skillDeprecationsResponseSchema,
|
|
340
|
+
"skill deprecations response"
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
async function setSkillDeprecation(client, payload) {
|
|
344
|
+
const normalizedName = payload.name.trim();
|
|
345
|
+
if (!normalizedName) {
|
|
346
|
+
throw new Error("name is required");
|
|
347
|
+
}
|
|
348
|
+
const version = payload.version?.trim();
|
|
349
|
+
const reason = payload.reason.trim();
|
|
350
|
+
if (!reason) {
|
|
351
|
+
throw new Error("reason is required");
|
|
352
|
+
}
|
|
353
|
+
const replacementRef = payload.replacementRef?.trim();
|
|
354
|
+
const raw = await client.requestJson("/skills/deprecate", {
|
|
355
|
+
method: "POST",
|
|
356
|
+
body: {
|
|
357
|
+
name: normalizedName,
|
|
358
|
+
version,
|
|
359
|
+
reason,
|
|
360
|
+
replacementRef
|
|
361
|
+
},
|
|
362
|
+
headers: { "content-type": "application/json" }
|
|
363
|
+
});
|
|
364
|
+
return client.parseWithSchema(
|
|
365
|
+
raw,
|
|
366
|
+
skillDeprecationRecordSchema,
|
|
367
|
+
"skill deprecation response"
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
async function getSkillBadge(client, params) {
|
|
371
|
+
const normalizedName = params.name.trim();
|
|
372
|
+
if (!normalizedName) {
|
|
373
|
+
throw new Error("name is required");
|
|
374
|
+
}
|
|
375
|
+
const query = new URLSearchParams();
|
|
376
|
+
query.set("name", normalizedName);
|
|
377
|
+
if (params.metric) {
|
|
378
|
+
query.set("metric", params.metric);
|
|
379
|
+
}
|
|
380
|
+
if (params.label?.trim()) {
|
|
381
|
+
query.set("label", params.label.trim());
|
|
382
|
+
}
|
|
383
|
+
if (params.style) {
|
|
384
|
+
query.set("style", params.style);
|
|
385
|
+
}
|
|
386
|
+
const raw = await client.requestJson(
|
|
387
|
+
`/skills/badge?${query.toString()}`,
|
|
388
|
+
{ method: "GET" }
|
|
389
|
+
);
|
|
390
|
+
return client.parseWithSchema(
|
|
391
|
+
raw,
|
|
392
|
+
skillBadgeResponseSchema,
|
|
393
|
+
"skill badge response"
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
async function uploadSkillPreviewFromGithubOidc(client, payload) {
|
|
397
|
+
const token = payload.token.trim();
|
|
398
|
+
if (!token) {
|
|
399
|
+
throw new Error("token is required");
|
|
400
|
+
}
|
|
401
|
+
const raw = await client.requestJson(
|
|
402
|
+
"/skills/preview/github-oidc",
|
|
403
|
+
{
|
|
404
|
+
method: "POST",
|
|
405
|
+
body: payload.report,
|
|
406
|
+
headers: {
|
|
407
|
+
"content-type": "application/json",
|
|
408
|
+
authorization: `Bearer ${token}`
|
|
292
409
|
}
|
|
293
410
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
411
|
+
);
|
|
412
|
+
return client.parseWithSchema(
|
|
413
|
+
raw,
|
|
414
|
+
skillPreviewRecordSchema,
|
|
415
|
+
"skill preview record response"
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
async function getSkillPreview(client, params) {
|
|
419
|
+
const normalizedName = params.name.trim();
|
|
420
|
+
if (!normalizedName) {
|
|
421
|
+
throw new Error("name is required");
|
|
422
|
+
}
|
|
423
|
+
const query = new URLSearchParams();
|
|
424
|
+
query.set("name", normalizedName);
|
|
425
|
+
if (params.version?.trim()) {
|
|
426
|
+
query.set("version", params.version.trim());
|
|
427
|
+
}
|
|
428
|
+
const raw = await client.requestJson(
|
|
429
|
+
`/skills/preview?${query.toString()}`,
|
|
430
|
+
{ method: "GET" }
|
|
431
|
+
);
|
|
432
|
+
return client.parseWithSchema(
|
|
433
|
+
raw,
|
|
434
|
+
skillPreviewLookupResponseSchema,
|
|
435
|
+
"skill preview response"
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
async function getSkillPreviewByRepo(client, params) {
|
|
439
|
+
const query = buildRepoPreviewQuery(params);
|
|
440
|
+
const raw = await client.requestJson(
|
|
441
|
+
`/skills/preview/by-repo?${query}`,
|
|
442
|
+
{ method: "GET" }
|
|
443
|
+
);
|
|
444
|
+
return client.parseWithSchema(
|
|
445
|
+
raw,
|
|
446
|
+
skillPreviewLookupResponseSchema,
|
|
447
|
+
"skill preview by repo response"
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
async function getSkillPreviewById(client, previewId) {
|
|
451
|
+
const normalizedPreviewId = previewId.trim();
|
|
452
|
+
if (!normalizedPreviewId) {
|
|
453
|
+
throw new Error("previewId is required");
|
|
454
|
+
}
|
|
455
|
+
const raw = await client.requestJson(
|
|
456
|
+
`/skills/preview/${encodeURIComponent(normalizedPreviewId)}`,
|
|
457
|
+
{ method: "GET" }
|
|
458
|
+
);
|
|
459
|
+
return client.parseWithSchema(
|
|
460
|
+
raw,
|
|
461
|
+
skillPreviewLookupResponseSchema,
|
|
462
|
+
"skill preview by id response"
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
async function getSkillInstall(client, skillRef) {
|
|
466
|
+
const normalizedSkillRef = skillRef.trim();
|
|
467
|
+
if (!normalizedSkillRef) {
|
|
468
|
+
throw new Error("skillRef is required");
|
|
469
|
+
}
|
|
470
|
+
const raw = await client.requestJson(
|
|
471
|
+
`/skills/${encodeURIComponent(normalizedSkillRef)}/install`,
|
|
472
|
+
{ method: "GET" }
|
|
473
|
+
);
|
|
474
|
+
return client.parseWithSchema(
|
|
475
|
+
raw,
|
|
476
|
+
skillInstallResponseSchema,
|
|
477
|
+
"skill install response"
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
async function recordSkillInstallCopy(client, skillRef, payload = {}) {
|
|
481
|
+
const normalizedSkillRef = skillRef.trim();
|
|
482
|
+
if (!normalizedSkillRef) {
|
|
483
|
+
throw new Error("skillRef is required");
|
|
484
|
+
}
|
|
485
|
+
const raw = await client.requestJson(
|
|
486
|
+
`/skills/${encodeURIComponent(normalizedSkillRef)}/telemetry/install-copy`,
|
|
487
|
+
{
|
|
488
|
+
method: "POST",
|
|
489
|
+
body: payload,
|
|
490
|
+
headers: { "content-type": "application/json" }
|
|
373
491
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
492
|
+
);
|
|
493
|
+
return client.parseWithSchema(
|
|
494
|
+
raw,
|
|
495
|
+
skillInstallCopyTelemetryResponseSchema,
|
|
496
|
+
"skill install copy telemetry response"
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
async function listSkillTags(client) {
|
|
500
|
+
const raw = await client.requestJson("/skills/tags", {
|
|
501
|
+
method: "GET"
|
|
502
|
+
});
|
|
503
|
+
return client.parseWithSchema(
|
|
504
|
+
raw,
|
|
505
|
+
skillRegistryTagsResponseSchema,
|
|
506
|
+
"skill tags response"
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
async function listSkillCategories(client) {
|
|
510
|
+
const raw = await client.requestJson("/skills/categories", {
|
|
511
|
+
method: "GET"
|
|
512
|
+
});
|
|
513
|
+
return client.parseWithSchema(
|
|
514
|
+
raw,
|
|
515
|
+
skillRegistryCategoriesResponseSchema,
|
|
516
|
+
"skill categories response"
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
async function resolveSkillMarkdown(client, skillRef) {
|
|
520
|
+
const normalizedSkillRef = skillRef.trim();
|
|
521
|
+
if (!normalizedSkillRef) {
|
|
522
|
+
throw new Error("skillRef is required");
|
|
523
|
+
}
|
|
524
|
+
const response = await client.request(
|
|
525
|
+
`/skills/${encodeURIComponent(normalizedSkillRef)}/SKILL.md`,
|
|
526
|
+
{
|
|
527
|
+
method: "GET",
|
|
528
|
+
headers: {
|
|
529
|
+
accept: "text/markdown, text/plain;q=0.9, */*;q=0.8"
|
|
387
530
|
}
|
|
388
|
-
} else {
|
|
389
|
-
data.memo = void 0;
|
|
390
|
-
}
|
|
391
|
-
if (body.stakedAccountId) {
|
|
392
|
-
data.stakedAccountId = new AccountId(
|
|
393
|
-
body.stakedAccountId.shardNum ?? 0,
|
|
394
|
-
body.stakedAccountId.realmNum ?? 0,
|
|
395
|
-
body.stakedAccountId.accountNum ?? 0
|
|
396
|
-
).toString();
|
|
397
|
-
data.stakedNodeId = void 0;
|
|
398
|
-
} else if (body.stakedNodeId !== null && body.stakedNodeId !== void 0 && Long.fromValue(body.stakedNodeId).notEquals(-1)) {
|
|
399
|
-
data.stakedNodeId = Long.fromValue(body.stakedNodeId).toString();
|
|
400
|
-
data.stakedAccountId = void 0;
|
|
401
|
-
} else {
|
|
402
|
-
data.stakedNodeId = void 0;
|
|
403
|
-
data.stakedAccountId = void 0;
|
|
404
|
-
}
|
|
405
|
-
if (body.declineReward?.value !== void 0) {
|
|
406
|
-
data.declineReward = body.declineReward.value;
|
|
407
|
-
}
|
|
408
|
-
if (body.maxAutomaticTokenAssociations?.value !== void 0) {
|
|
409
|
-
data.maxAutomaticTokenAssociations = body.maxAutomaticTokenAssociations.value;
|
|
410
531
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
532
|
+
);
|
|
533
|
+
return response.text();
|
|
534
|
+
}
|
|
535
|
+
async function resolveSkillManifest(client, skillRef) {
|
|
536
|
+
const normalizedSkillRef = skillRef.trim();
|
|
537
|
+
if (!normalizedSkillRef) {
|
|
538
|
+
throw new Error("skillRef is required");
|
|
539
|
+
}
|
|
540
|
+
const raw = await client.requestJson(
|
|
541
|
+
`/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
|
|
542
|
+
{
|
|
543
|
+
method: "GET"
|
|
417
544
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
545
|
+
);
|
|
546
|
+
return client.parseWithSchema(
|
|
547
|
+
raw,
|
|
548
|
+
skillResolverManifestResponseSchema,
|
|
549
|
+
"skill resolver manifest response"
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
async function getSkillVoteStatus(client, params) {
|
|
553
|
+
const normalizedName = params.name.trim();
|
|
554
|
+
if (!normalizedName) {
|
|
555
|
+
throw new Error("name is required");
|
|
556
|
+
}
|
|
557
|
+
const query = new URLSearchParams();
|
|
558
|
+
query.set("name", normalizedName);
|
|
559
|
+
const raw = await client.requestJson(
|
|
560
|
+
`/skills/vote?${query.toString()}`,
|
|
561
|
+
{ method: "GET" }
|
|
562
|
+
);
|
|
563
|
+
return client.parseWithSchema(
|
|
564
|
+
raw,
|
|
565
|
+
skillRegistryVoteStatusResponseSchema,
|
|
566
|
+
"skill registry vote status response"
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
async function setSkillVote(client, payload) {
|
|
570
|
+
const normalizedName = payload.name.trim();
|
|
571
|
+
if (!normalizedName) {
|
|
572
|
+
throw new Error("name is required");
|
|
573
|
+
}
|
|
574
|
+
const raw = await client.requestJson("/skills/vote", {
|
|
575
|
+
method: "POST",
|
|
576
|
+
body: { name: normalizedName, upvoted: payload.upvoted },
|
|
577
|
+
headers: { "content-type": "application/json" }
|
|
578
|
+
});
|
|
579
|
+
return client.parseWithSchema(
|
|
580
|
+
raw,
|
|
581
|
+
skillRegistryVoteStatusResponseSchema,
|
|
582
|
+
"skill registry vote status response"
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
async function requestSkillVerification(client, payload) {
|
|
586
|
+
const normalizedName = payload.name.trim();
|
|
587
|
+
if (!normalizedName) {
|
|
588
|
+
throw new Error("name is required");
|
|
589
|
+
}
|
|
590
|
+
const raw = await client.requestJson(
|
|
591
|
+
"/skills/verification/request",
|
|
592
|
+
{
|
|
593
|
+
method: "POST",
|
|
594
|
+
body: {
|
|
595
|
+
name: normalizedName,
|
|
596
|
+
version: payload.version,
|
|
597
|
+
tier: payload.tier
|
|
598
|
+
},
|
|
599
|
+
headers: { "content-type": "application/json" }
|
|
429
600
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
601
|
+
);
|
|
602
|
+
return client.parseWithSchema(
|
|
603
|
+
raw,
|
|
604
|
+
skillVerificationRequestCreateResponseSchema,
|
|
605
|
+
"skill verification request create response"
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
async function getSkillVerificationStatus(client, params) {
|
|
609
|
+
const normalizedName = params.name.trim();
|
|
610
|
+
if (!normalizedName) {
|
|
611
|
+
throw new Error("name is required");
|
|
612
|
+
}
|
|
613
|
+
const query = new URLSearchParams();
|
|
614
|
+
query.set("name", normalizedName);
|
|
615
|
+
if (params.version) {
|
|
616
|
+
query.set("version", params.version);
|
|
617
|
+
}
|
|
618
|
+
const raw = await client.requestJson(
|
|
619
|
+
`/skills/verification/status?${query.toString()}`,
|
|
620
|
+
{ method: "GET" }
|
|
621
|
+
);
|
|
622
|
+
return client.parseWithSchema(
|
|
623
|
+
raw,
|
|
624
|
+
skillVerificationStatusResponseSchema,
|
|
625
|
+
"skill verification status response"
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
async function createSkillDomainProofChallenge(client, payload) {
|
|
629
|
+
const normalizedName = payload.name.trim();
|
|
630
|
+
if (!normalizedName) {
|
|
631
|
+
throw new Error("name is required");
|
|
632
|
+
}
|
|
633
|
+
const raw = await client.requestJson(
|
|
634
|
+
"/skills/verification/domain/challenge",
|
|
635
|
+
{
|
|
636
|
+
method: "POST",
|
|
637
|
+
body: {
|
|
638
|
+
name: normalizedName,
|
|
639
|
+
version: payload.version,
|
|
640
|
+
domain: payload.domain
|
|
641
|
+
},
|
|
642
|
+
headers: { "content-type": "application/json" }
|
|
442
643
|
}
|
|
443
|
-
|
|
644
|
+
);
|
|
645
|
+
return client.parseWithSchema(
|
|
646
|
+
raw,
|
|
647
|
+
skillVerificationDomainProofChallengeResponseSchema,
|
|
648
|
+
"skill domain proof challenge response"
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
async function verifySkillDomainProof(client, payload) {
|
|
652
|
+
const normalizedName = payload.name.trim();
|
|
653
|
+
const challengeToken = payload.challengeToken.trim();
|
|
654
|
+
if (!normalizedName) {
|
|
655
|
+
throw new Error("name is required");
|
|
444
656
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
* This is the unified entry point that delegates to the comprehensive parsing logic
|
|
448
|
-
*/
|
|
449
|
-
static parseFromTransactionObject(transaction) {
|
|
450
|
-
return this.parseSCSTransaction(transaction);
|
|
657
|
+
if (!challengeToken) {
|
|
658
|
+
throw new Error("challengeToken is required");
|
|
451
659
|
}
|
|
660
|
+
const raw = await client.requestJson(
|
|
661
|
+
"/skills/verification/domain/verify",
|
|
662
|
+
{
|
|
663
|
+
method: "POST",
|
|
664
|
+
body: {
|
|
665
|
+
name: normalizedName,
|
|
666
|
+
version: payload.version,
|
|
667
|
+
domain: payload.domain,
|
|
668
|
+
challengeToken
|
|
669
|
+
},
|
|
670
|
+
headers: { "content-type": "application/json" }
|
|
671
|
+
}
|
|
672
|
+
);
|
|
673
|
+
return client.parseWithSchema(
|
|
674
|
+
raw,
|
|
675
|
+
skillVerificationDomainProofVerifyResponseSchema,
|
|
676
|
+
"skill domain proof verify response"
|
|
677
|
+
);
|
|
452
678
|
}
|
|
453
679
|
export {
|
|
454
|
-
|
|
680
|
+
createSkillDomainProofChallenge,
|
|
681
|
+
getMySkillsList,
|
|
682
|
+
getRecommendedSkillVersion,
|
|
683
|
+
getSkillBadge,
|
|
684
|
+
getSkillDeprecations,
|
|
685
|
+
getSkillInstall,
|
|
686
|
+
getSkillOwnership,
|
|
687
|
+
getSkillPreview,
|
|
688
|
+
getSkillPreviewById,
|
|
689
|
+
getSkillPreviewByRepo,
|
|
690
|
+
getSkillPublishJob,
|
|
691
|
+
getSkillSecurityBreakdown,
|
|
692
|
+
getSkillStatus,
|
|
693
|
+
getSkillStatusByRepo,
|
|
694
|
+
getSkillVerificationStatus,
|
|
695
|
+
getSkillVoteStatus,
|
|
696
|
+
getSkillsCatalog,
|
|
697
|
+
listMySkills,
|
|
698
|
+
listSkillCategories,
|
|
699
|
+
listSkillTags,
|
|
700
|
+
listSkillVersions,
|
|
701
|
+
listSkills,
|
|
702
|
+
publishSkill,
|
|
703
|
+
quoteSkillPublish,
|
|
704
|
+
recordSkillInstallCopy,
|
|
705
|
+
requestSkillVerification,
|
|
706
|
+
resolveSkillManifest,
|
|
707
|
+
resolveSkillMarkdown,
|
|
708
|
+
setRecommendedSkillVersion,
|
|
709
|
+
setSkillDeprecation,
|
|
710
|
+
setSkillVote,
|
|
711
|
+
skillsConfig,
|
|
712
|
+
uploadSkillPreviewFromGithubOidc,
|
|
713
|
+
verifySkillDomainProof
|
|
455
714
|
};
|
|
456
715
|
//# sourceMappingURL=standards-sdk.es167.js.map
|