@hashgraphonline/standards-sdk 0.1.175 → 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/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 +155 -1
- package/dist/browser/standards-sdk.browser.js.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/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/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.es116.js +1 -1
- package/dist/es/standards-sdk.es121.js +1 -1
- package/dist/es/standards-sdk.es127.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 +3 -3
- package/dist/es/standards-sdk.es143.js +1 -1
- package/dist/es/standards-sdk.es145.js +24 -3
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es147.js +1 -1
- package/dist/es/standards-sdk.es148.js +1 -1
- package/dist/es/standards-sdk.es16.js +1 -1
- package/dist/es/standards-sdk.es160.js +1778 -12461
- package/dist/es/standards-sdk.es160.js.map +1 -1
- package/dist/es/standards-sdk.es161.js +12461 -1608
- package/dist/es/standards-sdk.es161.js.map +1 -1
- package/dist/es/standards-sdk.es163.js +51 -167
- package/dist/es/standards-sdk.es163.js.map +1 -1
- package/dist/es/standards-sdk.es164.js +88 -306
- package/dist/es/standards-sdk.es164.js.map +1 -1
- package/dist/es/standards-sdk.es165.js +71 -336
- package/dist/es/standards-sdk.es165.js.map +1 -1
- package/dist/es/standards-sdk.es166.js +186 -439
- package/dist/es/standards-sdk.es166.js.map +1 -1
- package/dist/es/standards-sdk.es167.js +695 -314
- package/dist/es/standards-sdk.es167.js.map +1 -1
- package/dist/es/standards-sdk.es168.js +63 -66
- package/dist/es/standards-sdk.es168.js.map +1 -1
- package/dist/es/standards-sdk.es169.js +158 -90
- package/dist/es/standards-sdk.es169.js.map +1 -1
- package/dist/es/standards-sdk.es170.js +314 -65
- package/dist/es/standards-sdk.es170.js.map +1 -1
- package/dist/es/standards-sdk.es171.js +345 -55
- package/dist/es/standards-sdk.es171.js.map +1 -1
- package/dist/es/standards-sdk.es172.js +443 -71
- package/dist/es/standards-sdk.es172.js.map +1 -1
- package/dist/es/standards-sdk.es173.js +315 -184
- package/dist/es/standards-sdk.es173.js.map +1 -1
- package/dist/es/standards-sdk.es174.js +68 -565
- package/dist/es/standards-sdk.es174.js.map +1 -1
- package/dist/es/standards-sdk.es175.js +1 -1
- package/dist/es/standards-sdk.es176.js +1 -1
- package/dist/es/standards-sdk.es178.js +2 -2
- package/dist/es/standards-sdk.es179.js +1 -1
- package/dist/es/standards-sdk.es18.js +2 -2
- package/dist/es/standards-sdk.es180.js +1 -1
- package/dist/es/standards-sdk.es181.js +2 -2
- package/dist/es/standards-sdk.es182.js +1 -1
- package/dist/es/standards-sdk.es183.js +1 -1
- package/dist/es/standards-sdk.es19.js +2 -2
- package/dist/es/standards-sdk.es27.js +2 -2
- package/dist/es/standards-sdk.es30.js +1 -1
- package/dist/es/standards-sdk.es31.js +1 -1
- package/dist/es/standards-sdk.es35.js +2 -2
- package/dist/es/standards-sdk.es36.js +1 -1
- package/dist/es/standards-sdk.es37.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.es67.js +1 -1
- package/dist/es/standards-sdk.es69.js +1 -1
- package/dist/es/standards-sdk.es75.js +1 -1
- package/dist/es/standards-sdk.es84.js +1 -1
- package/package.json +2 -1
|
@@ -1,334 +1,715 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const tx = decoded.transactionList[0];
|
|
17
|
-
let txBody = null;
|
|
18
|
-
if (tx.bodyBytes && tx.bodyBytes.length > 0) {
|
|
19
|
-
txBody = proto.TransactionBody.decode(tx.bodyBytes);
|
|
20
|
-
} else if (tx.signedTransactionBytes && tx.signedTransactionBytes.length > 0) {
|
|
21
|
-
const signedTx = proto.SignedTransaction.decode(
|
|
22
|
-
tx.signedTransactionBytes
|
|
23
|
-
);
|
|
24
|
-
if (signedTx.bodyBytes) {
|
|
25
|
-
txBody = proto.TransactionBody.decode(signedTx.bodyBytes);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
if (txBody) {
|
|
29
|
-
const protoResult = this.parseFromProtobufTxBody(txBody);
|
|
30
|
-
if (protoResult.type && protoResult.type !== "UNKNOWN") {
|
|
31
|
-
return protoResult;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
} catch (protoError) {
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return this.parseFromTransactionInternals(transaction);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
return {
|
|
41
|
-
type: "UNKNOWN",
|
|
42
|
-
humanReadableType: "Unknown Utility Transaction"
|
|
43
|
-
};
|
|
44
|
-
}
|
|
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");
|
|
45
16
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
type: "PRNG",
|
|
56
|
-
humanReadableType: "Pseudo Random Number",
|
|
57
|
-
utilPrng
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (txBody.freeze) {
|
|
62
|
-
const networkFreeze = this.parseNetworkFreezeFromProto(txBody.freeze);
|
|
63
|
-
if (networkFreeze) {
|
|
64
|
-
return {
|
|
65
|
-
type: "FREEZE",
|
|
66
|
-
humanReadableType: "Network Freeze",
|
|
67
|
-
freeze: networkFreeze
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (txBody.systemDelete) {
|
|
72
|
-
const systemDelete = this.parseSystemDeleteFromProto(txBody.systemDelete);
|
|
73
|
-
if (systemDelete) {
|
|
74
|
-
return {
|
|
75
|
-
type: "SYSTEMDELETE",
|
|
76
|
-
humanReadableType: "System Delete",
|
|
77
|
-
systemDelete
|
|
78
|
-
};
|
|
79
|
-
}
|
|
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"
|
|
80
26
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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());
|
|
92
137
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
138
|
+
});
|
|
139
|
+
if (typeof params.featured === "boolean") {
|
|
140
|
+
query.set("featured", params.featured ? "true" : "false");
|
|
141
|
+
}
|
|
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"
|
|
102
278
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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}`
|
|
111
409
|
}
|
|
112
410
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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" }
|
|
122
491
|
}
|
|
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
|
-
type: "FREEZE",
|
|
162
|
-
humanReadableType: "Network Freeze",
|
|
163
|
-
freeze: networkFreeze
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
if (hasTransactionType(transaction, "systemDelete")) {
|
|
167
|
-
const systemDelete = {};
|
|
168
|
-
if (tx._fileId) {
|
|
169
|
-
systemDelete.fileId = tx._fileId.toString();
|
|
170
|
-
} else if (tx._contractId) {
|
|
171
|
-
systemDelete.contractId = tx._contractId.toString();
|
|
172
|
-
}
|
|
173
|
-
if (tx._expirationTime) {
|
|
174
|
-
systemDelete.expirationTime = tx._expirationTime.toString();
|
|
175
|
-
}
|
|
176
|
-
return {
|
|
177
|
-
type: "SYSTEMDELETE",
|
|
178
|
-
humanReadableType: "System Delete",
|
|
179
|
-
systemDelete
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
if (hasTransactionType(transaction, "systemUndelete")) {
|
|
183
|
-
const systemUndelete = {};
|
|
184
|
-
if (tx._fileId) {
|
|
185
|
-
systemUndelete.fileId = tx._fileId.toString();
|
|
186
|
-
} else if (tx._contractId) {
|
|
187
|
-
systemUndelete.contractId = tx._contractId.toString();
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
type: "SYSTEMUNDELETE",
|
|
191
|
-
humanReadableType: "System Undelete",
|
|
192
|
-
systemUndelete
|
|
193
|
-
};
|
|
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"
|
|
194
530
|
}
|
|
195
|
-
return {};
|
|
196
|
-
} catch (error) {
|
|
197
|
-
return {};
|
|
198
531
|
}
|
|
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");
|
|
199
539
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (!body) return void 0;
|
|
205
|
-
const data = {};
|
|
206
|
-
if (body.startTime?.seconds) {
|
|
207
|
-
data.startTime = `${Long.fromValue(
|
|
208
|
-
body.startTime.seconds
|
|
209
|
-
).toString()}.${body.startTime.nanos ?? 0}`;
|
|
210
|
-
}
|
|
211
|
-
if (body.updateFile) {
|
|
212
|
-
data.updateFile = new FileId(
|
|
213
|
-
body.updateFile.shardNum ?? 0,
|
|
214
|
-
body.updateFile.realmNum ?? 0,
|
|
215
|
-
body.updateFile.fileNum ?? 0
|
|
216
|
-
).toString();
|
|
217
|
-
}
|
|
218
|
-
if (body.fileHash && body.fileHash.length > 0) {
|
|
219
|
-
data.fileHash = Buffer.from(body.fileHash).toString("hex");
|
|
220
|
-
}
|
|
221
|
-
if (body.freezeType !== void 0) {
|
|
222
|
-
const freezeTypes = [
|
|
223
|
-
"FREEZE_ONLY",
|
|
224
|
-
"PREPARE_UPGRADE",
|
|
225
|
-
"FREEZE_UPGRADE",
|
|
226
|
-
"FREEZE_ABORT"
|
|
227
|
-
];
|
|
228
|
-
data.freezeType = freezeTypes[body.freezeType] || "FREEZE_ONLY";
|
|
229
|
-
}
|
|
230
|
-
return data;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Parse System Delete from protobuf data
|
|
234
|
-
*/
|
|
235
|
-
static parseSystemDeleteFromProto(body) {
|
|
236
|
-
if (!body) return void 0;
|
|
237
|
-
const data = {};
|
|
238
|
-
if (body.fileID) {
|
|
239
|
-
data.fileId = new FileId(
|
|
240
|
-
body.fileID.shardNum ?? 0,
|
|
241
|
-
body.fileID.realmNum ?? 0,
|
|
242
|
-
body.fileID.fileNum ?? 0
|
|
243
|
-
).toString();
|
|
244
|
-
} else if (body.contractID) {
|
|
245
|
-
data.contractId = new ContractId(
|
|
246
|
-
body.contractID.shardNum ?? 0,
|
|
247
|
-
body.contractID.realmNum ?? 0,
|
|
248
|
-
body.contractID.contractNum ?? 0
|
|
249
|
-
).toString();
|
|
250
|
-
}
|
|
251
|
-
if (body.expirationTime?.seconds) {
|
|
252
|
-
data.expirationTime = Long.fromValue(
|
|
253
|
-
body.expirationTime.seconds
|
|
254
|
-
).toString();
|
|
255
|
-
}
|
|
256
|
-
return data;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Parse System Undelete from protobuf data
|
|
260
|
-
*/
|
|
261
|
-
static parseSystemUndeleteFromProto(body) {
|
|
262
|
-
if (!body) return void 0;
|
|
263
|
-
const data = {};
|
|
264
|
-
if (body.fileID) {
|
|
265
|
-
data.fileId = new FileId(
|
|
266
|
-
body.fileID.shardNum ?? 0,
|
|
267
|
-
body.fileID.realmNum ?? 0,
|
|
268
|
-
body.fileID.fileNum ?? 0
|
|
269
|
-
).toString();
|
|
270
|
-
} else if (body.contractID) {
|
|
271
|
-
data.contractId = new ContractId(
|
|
272
|
-
body.contractID.shardNum ?? 0,
|
|
273
|
-
body.contractID.realmNum ?? 0,
|
|
274
|
-
body.contractID.contractNum ?? 0
|
|
275
|
-
).toString();
|
|
276
|
-
}
|
|
277
|
-
return data;
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Parse Node Create from protobuf data
|
|
281
|
-
*/
|
|
282
|
-
static parseNodeCreateFromProto(body) {
|
|
283
|
-
if (!body) return void 0;
|
|
284
|
-
const data = {};
|
|
285
|
-
if (body.nodeId !== void 0) {
|
|
286
|
-
data.nodeId = Long.fromValue(body.nodeId).toNumber();
|
|
540
|
+
const raw = await client.requestJson(
|
|
541
|
+
`/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
|
|
542
|
+
{
|
|
543
|
+
method: "GET"
|
|
287
544
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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");
|
|
311
589
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
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" }
|
|
317
600
|
}
|
|
318
|
-
|
|
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");
|
|
319
612
|
}
|
|
320
|
-
|
|
321
|
-
|
|
613
|
+
const query = new URLSearchParams();
|
|
614
|
+
query.set("name", normalizedName);
|
|
615
|
+
if (params.version) {
|
|
616
|
+
query.set("version", params.version);
|
|
322
617
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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");
|
|
329
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" }
|
|
643
|
+
}
|
|
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");
|
|
656
|
+
}
|
|
657
|
+
if (!challengeToken) {
|
|
658
|
+
throw new Error("challengeToken is required");
|
|
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
|
+
);
|
|
330
678
|
}
|
|
331
679
|
export {
|
|
332
|
-
|
|
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
|
|
333
714
|
};
|
|
334
715
|
//# sourceMappingURL=standards-sdk.es167.js.map
|