@hashgraphonline/standards-sdk 0.1.186 → 0.1.187
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 +3 -0
- package/dist/es/standards-sdk.es126.js +1 -1
- package/dist/es/standards-sdk.es133.js +5 -5
- package/dist/es/standards-sdk.es143.js +1 -1
- package/dist/es/standards-sdk.es144.js +1 -1
- package/dist/es/standards-sdk.es145.js +5 -5
- package/dist/es/standards-sdk.es147.js +2 -2
- package/dist/es/standards-sdk.es150.js +2 -2
- package/dist/es/standards-sdk.es154.js +1 -1
- package/dist/es/standards-sdk.es185.js +670 -15
- package/dist/es/standards-sdk.es185.js.map +1 -1
- package/dist/es/standards-sdk.es186.js +90 -651
- package/dist/es/standards-sdk.es186.js.map +1 -1
- package/dist/es/standards-sdk.es187.js +58 -96
- package/dist/es/standards-sdk.es187.js.map +1 -1
- package/dist/es/standards-sdk.es188.js +51 -68
- package/dist/es/standards-sdk.es188.js.map +1 -1
- package/dist/es/standards-sdk.es189.js +73 -48
- package/dist/es/standards-sdk.es189.js.map +1 -1
- package/dist/es/standards-sdk.es190.js +180 -61
- package/dist/es/standards-sdk.es190.js.map +1 -1
- package/dist/es/standards-sdk.es191.js +160 -188
- package/dist/es/standards-sdk.es191.js.map +1 -1
- package/dist/es/standards-sdk.es192.js +289 -139
- package/dist/es/standards-sdk.es192.js.map +1 -1
- package/dist/es/standards-sdk.es193.js +298 -274
- package/dist/es/standards-sdk.es193.js.map +1 -1
- package/dist/es/standards-sdk.es194.js +369 -262
- package/dist/es/standards-sdk.es194.js.map +1 -1
- package/dist/es/standards-sdk.es195.js +194 -316
- package/dist/es/standards-sdk.es195.js.map +1 -1
- package/dist/es/standards-sdk.es196.js +64 -319
- package/dist/es/standards-sdk.es196.js.map +1 -1
- package/dist/es/standards-sdk.es197.js +15 -74
- package/dist/es/standards-sdk.es197.js.map +1 -1
- package/dist/es/standards-sdk.es201.js +1 -1
- package/dist/es/standards-sdk.es204.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/dist/es/standards-sdk.es71.js +1 -1
- package/dist/es/standards-sdk.es72.js +1 -1
- package/package.json +1 -1
|
@@ -1,675 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
async function listSkills(client, params = {}) {
|
|
20
|
-
const query = new URLSearchParams();
|
|
21
|
-
if (params.name) {
|
|
22
|
-
query.set("name", params.name);
|
|
23
|
-
}
|
|
24
|
-
if (params.version) {
|
|
25
|
-
query.set("version", params.version);
|
|
26
|
-
}
|
|
27
|
-
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
28
|
-
query.set("limit", String(Math.trunc(params.limit)));
|
|
29
|
-
}
|
|
30
|
-
if (params.cursor) {
|
|
31
|
-
query.set("cursor", params.cursor);
|
|
32
|
-
}
|
|
33
|
-
if (typeof params.includeFiles === "boolean") {
|
|
34
|
-
query.set("includeFiles", params.includeFiles ? "true" : "false");
|
|
35
|
-
}
|
|
36
|
-
if (params.accountId) {
|
|
37
|
-
query.set("accountId", params.accountId);
|
|
38
|
-
}
|
|
39
|
-
if (params.q) {
|
|
40
|
-
query.set("q", params.q);
|
|
41
|
-
}
|
|
42
|
-
if (params.tag) {
|
|
43
|
-
query.set("tag", params.tag);
|
|
44
|
-
}
|
|
45
|
-
if (params.category) {
|
|
46
|
-
query.set("category", params.category);
|
|
47
|
-
}
|
|
48
|
-
if (typeof params.featured === "boolean") {
|
|
49
|
-
query.set("featured", params.featured ? "true" : "false");
|
|
50
|
-
}
|
|
51
|
-
if (typeof params.verified === "boolean") {
|
|
52
|
-
query.set("verified", params.verified ? "true" : "false");
|
|
53
|
-
}
|
|
54
|
-
if (params.view) {
|
|
55
|
-
query.set("view", params.view);
|
|
56
|
-
}
|
|
57
|
-
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
58
|
-
const raw = await client.requestJson(`/skills${suffix}`, {
|
|
59
|
-
method: "GET"
|
|
60
|
-
});
|
|
61
|
-
return client.parseWithSchema(
|
|
62
|
-
raw,
|
|
63
|
-
skillRegistryListResponseSchema,
|
|
64
|
-
"skill registry list response"
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
async function getSkillSecurityBreakdown(client, params) {
|
|
68
|
-
const normalizedJobId = requireTrimmedString(params.jobId, "jobId");
|
|
69
|
-
const raw = await client.requestJson(
|
|
70
|
-
`/skills/${encodeURIComponent(normalizedJobId)}/security-breakdown`,
|
|
71
|
-
{ method: "GET" }
|
|
72
|
-
);
|
|
73
|
-
return client.parseWithSchema(
|
|
74
|
-
raw,
|
|
75
|
-
skillSecurityBreakdownResponseSchema,
|
|
76
|
-
"skill security breakdown response"
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
async function getSkillsCatalog(client, params = {}) {
|
|
80
|
-
const query = new URLSearchParams();
|
|
81
|
-
if (params.q) {
|
|
82
|
-
query.set("q", params.q);
|
|
83
|
-
}
|
|
84
|
-
if (params.category) {
|
|
85
|
-
query.set("category", params.category);
|
|
86
|
-
}
|
|
87
|
-
params.tags?.forEach((tag) => {
|
|
88
|
-
if (tag.trim()) {
|
|
89
|
-
query.append("tag", tag.trim());
|
|
1
|
+
import { isBrowser } from "./standards-sdk.es141.js";
|
|
2
|
+
let nodeRequire;
|
|
3
|
+
const isNodeRuntime = () => typeof process !== "undefined" && Boolean(process.versions?.node);
|
|
4
|
+
function resolveBuiltinModuleLoader() {
|
|
5
|
+
if (typeof process === "undefined") {
|
|
6
|
+
return void 0;
|
|
7
|
+
}
|
|
8
|
+
return process.getBuiltinModule;
|
|
9
|
+
}
|
|
10
|
+
function getNodeRequireSync() {
|
|
11
|
+
try {
|
|
12
|
+
const builtinModuleLoader = resolveBuiltinModuleLoader();
|
|
13
|
+
const moduleNamespace = builtinModuleLoader?.("module");
|
|
14
|
+
if (typeof moduleNamespace?.createRequire === "function") {
|
|
15
|
+
const requireFromModule = moduleNamespace.createRequire(import.meta.url);
|
|
16
|
+
if (typeof requireFromModule.resolve === "function") {
|
|
17
|
+
return requireFromModule;
|
|
18
|
+
}
|
|
90
19
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (params.channel) {
|
|
99
|
-
query.set("channel", params.channel);
|
|
100
|
-
}
|
|
101
|
-
if (params.sortBy) {
|
|
102
|
-
query.set("sortBy", params.sortBy);
|
|
103
|
-
}
|
|
104
|
-
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
105
|
-
query.set("limit", String(Math.trunc(params.limit)));
|
|
106
|
-
}
|
|
107
|
-
if (params.cursor) {
|
|
108
|
-
query.set("cursor", params.cursor);
|
|
109
|
-
}
|
|
110
|
-
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
111
|
-
const raw = await client.requestJson(`/skills/catalog${suffix}`, {
|
|
112
|
-
method: "GET"
|
|
113
|
-
});
|
|
114
|
-
return client.parseWithSchema(
|
|
115
|
-
raw,
|
|
116
|
-
skillCatalogResponseSchema,
|
|
117
|
-
"skill catalog response"
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
async function listSkillVersions(client, params) {
|
|
121
|
-
const normalizedName = requireTrimmedString(params.name, "name");
|
|
122
|
-
const query = new URLSearchParams();
|
|
123
|
-
query.set("name", normalizedName);
|
|
124
|
-
const raw = await client.requestJson(
|
|
125
|
-
`/skills/versions?${query.toString()}`,
|
|
126
|
-
{ method: "GET" }
|
|
127
|
-
);
|
|
128
|
-
return client.parseWithSchema(
|
|
129
|
-
raw,
|
|
130
|
-
skillRegistryVersionsResponseSchema,
|
|
131
|
-
"skill registry versions response"
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
async function listMySkills(client, params = {}) {
|
|
135
|
-
const query = new URLSearchParams();
|
|
136
|
-
if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
|
|
137
|
-
query.set("limit", String(Math.trunc(params.limit)));
|
|
138
|
-
}
|
|
139
|
-
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
140
|
-
const raw = await client.requestJson(`/skills/mine${suffix}`, {
|
|
141
|
-
method: "GET"
|
|
142
|
-
});
|
|
143
|
-
return client.parseWithSchema(
|
|
144
|
-
raw,
|
|
145
|
-
skillRegistryMineResponseSchema,
|
|
146
|
-
"skill registry mine response"
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
async function getMySkillsList(client, params = {}) {
|
|
150
|
-
const query = new URLSearchParams();
|
|
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
|
-
if (params.accountId) {
|
|
158
|
-
query.set("accountId", params.accountId);
|
|
20
|
+
const globalObject = typeof global !== "undefined" ? global : globalThis;
|
|
21
|
+
const runtimeRequire = globalObject.process?.mainModule?.require ?? globalObject.require ?? Function('return typeof require === "function" ? require : undefined;')();
|
|
22
|
+
if (typeof runtimeRequire === "function" && typeof runtimeRequire.resolve === "function") {
|
|
23
|
+
return runtimeRequire;
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
return null;
|
|
159
27
|
}
|
|
160
|
-
|
|
161
|
-
const raw = await client.requestJson(`/skills/my-list${suffix}`, {
|
|
162
|
-
method: "GET"
|
|
163
|
-
});
|
|
164
|
-
return client.parseWithSchema(
|
|
165
|
-
raw,
|
|
166
|
-
skillRegistryMyListResponseSchema,
|
|
167
|
-
"skill registry my list response"
|
|
168
|
-
);
|
|
28
|
+
return null;
|
|
169
29
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
body: payload,
|
|
174
|
-
headers: { "content-type": "application/json" }
|
|
175
|
-
});
|
|
176
|
-
return client.parseWithSchema(
|
|
177
|
-
raw,
|
|
178
|
-
skillRegistryQuoteResponseSchema,
|
|
179
|
-
"skill registry quote response"
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
async function quoteSkillPublishPreview(client, payload) {
|
|
183
|
-
const raw = await client.requestJson("/skills/quote-preview", {
|
|
184
|
-
method: "POST",
|
|
185
|
-
body: payload,
|
|
186
|
-
headers: { "content-type": "application/json" }
|
|
187
|
-
});
|
|
188
|
-
return client.parseWithSchema(
|
|
189
|
-
raw,
|
|
190
|
-
skillQuotePreviewResponseSchema,
|
|
191
|
-
"skill quote preview response"
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
async function publishSkill(client, payload) {
|
|
195
|
-
const raw = await client.requestJson("/skills/publish", {
|
|
196
|
-
method: "POST",
|
|
197
|
-
body: payload,
|
|
198
|
-
headers: { "content-type": "application/json" }
|
|
199
|
-
});
|
|
200
|
-
return client.parseWithSchema(
|
|
201
|
-
raw,
|
|
202
|
-
skillRegistryPublishResponseSchema,
|
|
203
|
-
"skill registry publish response"
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
async function getSkillPublishJob(client, jobId, params = {}) {
|
|
207
|
-
const normalized = requireTrimmedString(jobId, "jobId");
|
|
208
|
-
const query = new URLSearchParams();
|
|
209
|
-
if (params.accountId) {
|
|
210
|
-
query.set("accountId", params.accountId);
|
|
30
|
+
function isModuleNotFound(specifier, error) {
|
|
31
|
+
if (!error || typeof error !== "object") {
|
|
32
|
+
return false;
|
|
211
33
|
}
|
|
212
|
-
const
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return client.parseWithSchema(
|
|
218
|
-
raw,
|
|
219
|
-
skillRegistryJobStatusResponseSchema,
|
|
220
|
-
"skill registry job status response"
|
|
221
|
-
);
|
|
222
|
-
}
|
|
223
|
-
async function getSkillOwnership(client, params) {
|
|
224
|
-
const normalizedName = requireTrimmedString(params.name, "name");
|
|
225
|
-
const query = new URLSearchParams();
|
|
226
|
-
query.set("name", normalizedName);
|
|
227
|
-
if (params.accountId) {
|
|
228
|
-
query.set("accountId", params.accountId);
|
|
34
|
+
const code = Reflect.get(error, "code");
|
|
35
|
+
const message = Reflect.get(error, "message");
|
|
36
|
+
const messageText = typeof message === "string" ? message : "";
|
|
37
|
+
if (typeof code === "string" && code.includes("MODULE_NOT_FOUND")) {
|
|
38
|
+
return messageText.includes(specifier);
|
|
229
39
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
{
|
|
233
|
-
|
|
40
|
+
if (messageText) {
|
|
41
|
+
const lowered = messageText.toLowerCase();
|
|
42
|
+
if (lowered.includes("cannot find module") || lowered.includes("module not found") || lowered.includes("cannot find package")) {
|
|
43
|
+
return lowered.includes(specifier.toLowerCase());
|
|
234
44
|
}
|
|
235
|
-
);
|
|
236
|
-
return client.parseWithSchema(
|
|
237
|
-
raw,
|
|
238
|
-
skillRegistryOwnershipResponseSchema,
|
|
239
|
-
"skill registry ownership response"
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
async function getRecommendedSkillVersion(client, params) {
|
|
243
|
-
const normalizedName = requireTrimmedString(params.name, "name");
|
|
244
|
-
const query = new URLSearchParams();
|
|
245
|
-
query.set("name", normalizedName);
|
|
246
|
-
const raw = await client.requestJson(
|
|
247
|
-
`/skills/recommended?${query.toString()}`,
|
|
248
|
-
{ method: "GET" }
|
|
249
|
-
);
|
|
250
|
-
return client.parseWithSchema(
|
|
251
|
-
raw,
|
|
252
|
-
skillRecommendedVersionResponseSchema,
|
|
253
|
-
"skill recommended version response"
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
async function setRecommendedSkillVersion(client, payload) {
|
|
257
|
-
const normalizedName = requireTrimmedString(payload.name, "name");
|
|
258
|
-
const normalizedVersion = requireTrimmedString(payload.version, "version");
|
|
259
|
-
const raw = await client.requestJson("/skills/recommended", {
|
|
260
|
-
method: "POST",
|
|
261
|
-
body: {
|
|
262
|
-
name: normalizedName,
|
|
263
|
-
version: normalizedVersion
|
|
264
|
-
},
|
|
265
|
-
headers: { "content-type": "application/json" }
|
|
266
|
-
});
|
|
267
|
-
return client.parseWithSchema(
|
|
268
|
-
raw,
|
|
269
|
-
skillRecommendedVersionResponseSchema,
|
|
270
|
-
"skill recommended version response"
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
async function getSkillDeprecations(client, params) {
|
|
274
|
-
const normalizedName = requireTrimmedString(params.name, "name");
|
|
275
|
-
const query = new URLSearchParams();
|
|
276
|
-
query.set("name", normalizedName);
|
|
277
|
-
const raw = await client.requestJson(
|
|
278
|
-
`/skills/deprecations?${query.toString()}`,
|
|
279
|
-
{ method: "GET" }
|
|
280
|
-
);
|
|
281
|
-
return client.parseWithSchema(
|
|
282
|
-
raw,
|
|
283
|
-
skillDeprecationsResponseSchema,
|
|
284
|
-
"skill deprecations response"
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
async function setSkillDeprecation(client, payload) {
|
|
288
|
-
const normalizedName = requireTrimmedString(payload.name, "name");
|
|
289
|
-
const version = payload.version?.trim();
|
|
290
|
-
const reason = requireTrimmedString(payload.reason, "reason");
|
|
291
|
-
const replacementRef = payload.replacementRef?.trim();
|
|
292
|
-
const raw = await client.requestJson("/skills/deprecate", {
|
|
293
|
-
method: "POST",
|
|
294
|
-
body: {
|
|
295
|
-
name: normalizedName,
|
|
296
|
-
version,
|
|
297
|
-
reason,
|
|
298
|
-
replacementRef
|
|
299
|
-
},
|
|
300
|
-
headers: { "content-type": "application/json" }
|
|
301
|
-
});
|
|
302
|
-
return client.parseWithSchema(
|
|
303
|
-
raw,
|
|
304
|
-
skillDeprecationRecordSchema,
|
|
305
|
-
"skill deprecation response"
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
async function getSkillBadge(client, params) {
|
|
309
|
-
const normalizedName = requireTrimmedString(params.name, "name");
|
|
310
|
-
const query = new URLSearchParams();
|
|
311
|
-
query.set("name", normalizedName);
|
|
312
|
-
if (params.metric) {
|
|
313
|
-
query.set("metric", params.metric);
|
|
314
45
|
}
|
|
315
|
-
|
|
316
|
-
query.set("label", params.label.trim());
|
|
317
|
-
}
|
|
318
|
-
if (params.style) {
|
|
319
|
-
query.set("style", params.style);
|
|
320
|
-
}
|
|
321
|
-
const raw = await client.requestJson(
|
|
322
|
-
`/skills/badge?${query.toString()}`,
|
|
323
|
-
{ method: "GET" }
|
|
324
|
-
);
|
|
325
|
-
return client.parseWithSchema(
|
|
326
|
-
raw,
|
|
327
|
-
skillBadgeResponseSchema,
|
|
328
|
-
"skill badge response"
|
|
329
|
-
);
|
|
46
|
+
return false;
|
|
330
47
|
}
|
|
331
|
-
async function
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
query.set("name", normalizedName);
|
|
335
|
-
if (params.version?.trim()) {
|
|
336
|
-
query.set("version", params.version.trim());
|
|
48
|
+
async function resolveNodeRequire() {
|
|
49
|
+
if (nodeRequire !== void 0) {
|
|
50
|
+
return nodeRequire;
|
|
337
51
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
);
|
|
342
|
-
return client.parseWithSchema(
|
|
343
|
-
raw,
|
|
344
|
-
skillStatusResponseSchema,
|
|
345
|
-
"skill status response"
|
|
346
|
-
);
|
|
347
|
-
}
|
|
348
|
-
async function getSkillStatusByRepo(client, params) {
|
|
349
|
-
const repo = requireTrimmedString(params.repo, "repo");
|
|
350
|
-
const skillDir = requireTrimmedString(params.skillDir, "skillDir");
|
|
351
|
-
const query = new URLSearchParams();
|
|
352
|
-
query.set("repo", repo);
|
|
353
|
-
query.set("skillDir", skillDir);
|
|
354
|
-
if (params.ref?.trim()) {
|
|
355
|
-
query.set("ref", params.ref.trim());
|
|
52
|
+
if (isBrowser && !isNodeRuntime()) {
|
|
53
|
+
nodeRequire = null;
|
|
54
|
+
return nodeRequire;
|
|
356
55
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
return client.parseWithSchema(
|
|
362
|
-
raw,
|
|
363
|
-
skillStatusResponseSchema,
|
|
364
|
-
"skill status response"
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
async function getSkillConversionSignalsByRepo(client, params) {
|
|
368
|
-
const repo = requireTrimmedString(params.repo, "repo");
|
|
369
|
-
const skillDir = requireTrimmedString(params.skillDir, "skillDir");
|
|
370
|
-
const query = new URLSearchParams();
|
|
371
|
-
query.set("repo", repo);
|
|
372
|
-
query.set("skillDir", skillDir);
|
|
373
|
-
if (params.ref?.trim()) {
|
|
374
|
-
query.set("ref", params.ref.trim());
|
|
56
|
+
try {
|
|
57
|
+
nodeRequire = getNodeRequireSync();
|
|
58
|
+
} catch {
|
|
59
|
+
nodeRequire = null;
|
|
375
60
|
}
|
|
376
|
-
|
|
377
|
-
`/skills/conversion-signals/by-repo?${query.toString()}`,
|
|
378
|
-
{ method: "GET" }
|
|
379
|
-
);
|
|
380
|
-
return client.parseWithSchema(
|
|
381
|
-
raw,
|
|
382
|
-
skillConversionSignalsResponseSchema,
|
|
383
|
-
"skill conversion signals response"
|
|
384
|
-
);
|
|
61
|
+
return nodeRequire;
|
|
385
62
|
}
|
|
386
|
-
async function
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
63
|
+
async function dynamicImport(specifier) {
|
|
64
|
+
try {
|
|
65
|
+
return await import(
|
|
66
|
+
/* webpackIgnore: true */
|
|
67
|
+
specifier
|
|
68
|
+
);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if (isModuleNotFound(specifier, error)) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async function optionalImport(specifier, options = {}) {
|
|
77
|
+
if (isBrowser && !isNodeRuntime()) {
|
|
78
|
+
return dynamicImport(specifier);
|
|
79
|
+
}
|
|
80
|
+
if (!options.preferImport) {
|
|
81
|
+
const requireFn = await resolveNodeRequire();
|
|
82
|
+
if (requireFn) {
|
|
83
|
+
try {
|
|
84
|
+
return requireFn(specifier);
|
|
85
|
+
} catch (error) {
|
|
86
|
+
if (!isModuleNotFound(specifier, error)) {
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
396
89
|
}
|
|
397
90
|
}
|
|
398
|
-
);
|
|
399
|
-
return client.parseWithSchema(
|
|
400
|
-
raw,
|
|
401
|
-
skillPreviewRecordSchema,
|
|
402
|
-
"skill preview record response"
|
|
403
|
-
);
|
|
404
|
-
}
|
|
405
|
-
async function getSkillPreview(client, params) {
|
|
406
|
-
const normalizedName = requireTrimmedString(params.name, "name");
|
|
407
|
-
const query = new URLSearchParams();
|
|
408
|
-
query.set("name", normalizedName);
|
|
409
|
-
if (params.version?.trim()) {
|
|
410
|
-
query.set("version", params.version.trim());
|
|
411
91
|
}
|
|
412
|
-
|
|
413
|
-
`/skills/preview?${query.toString()}`,
|
|
414
|
-
{ method: "GET" }
|
|
415
|
-
);
|
|
416
|
-
return client.parseWithSchema(
|
|
417
|
-
raw,
|
|
418
|
-
skillPreviewLookupResponseSchema,
|
|
419
|
-
"skill preview response"
|
|
420
|
-
);
|
|
92
|
+
return dynamicImport(specifier);
|
|
421
93
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
const query = new URLSearchParams();
|
|
426
|
-
query.set("repo", repo);
|
|
427
|
-
query.set("skillDir", skillDir);
|
|
428
|
-
if (params.ref?.trim()) {
|
|
429
|
-
query.set("ref", params.ref.trim());
|
|
94
|
+
function optionalImportSync(specifier) {
|
|
95
|
+
if (isBrowser && !isNodeRuntime()) {
|
|
96
|
+
return null;
|
|
430
97
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
return client.parseWithSchema(
|
|
436
|
-
raw,
|
|
437
|
-
skillPreviewLookupResponseSchema,
|
|
438
|
-
"skill preview by repo response"
|
|
439
|
-
);
|
|
440
|
-
}
|
|
441
|
-
async function getSkillPreviewById(client, previewId) {
|
|
442
|
-
const normalizedPreviewId = requireTrimmedString(previewId, "previewId");
|
|
443
|
-
const raw = await client.requestJson(
|
|
444
|
-
`/skills/preview/${encodeURIComponent(normalizedPreviewId)}`,
|
|
445
|
-
{ method: "GET" }
|
|
446
|
-
);
|
|
447
|
-
return client.parseWithSchema(
|
|
448
|
-
raw,
|
|
449
|
-
skillPreviewLookupResponseSchema,
|
|
450
|
-
"skill preview by id response"
|
|
451
|
-
);
|
|
452
|
-
}
|
|
453
|
-
async function getSkillInstall(client, skillRef) {
|
|
454
|
-
const normalizedSkillRef = requireTrimmedString(skillRef, "skillRef");
|
|
455
|
-
const raw = await client.requestJson(
|
|
456
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/install`,
|
|
457
|
-
{ method: "GET" }
|
|
458
|
-
);
|
|
459
|
-
return client.parseWithSchema(
|
|
460
|
-
raw,
|
|
461
|
-
skillInstallResponseSchema,
|
|
462
|
-
"skill install response"
|
|
463
|
-
);
|
|
464
|
-
}
|
|
465
|
-
async function recordSkillInstallCopy(client, skillRef, payload = {}) {
|
|
466
|
-
const normalizedSkillRef = requireTrimmedString(skillRef, "skillRef");
|
|
467
|
-
const raw = await client.requestJson(
|
|
468
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/telemetry/install-copy`,
|
|
469
|
-
{
|
|
470
|
-
method: "POST",
|
|
471
|
-
body: payload,
|
|
472
|
-
headers: { "content-type": "application/json" }
|
|
473
|
-
}
|
|
474
|
-
);
|
|
475
|
-
return client.parseWithSchema(
|
|
476
|
-
raw,
|
|
477
|
-
skillInstallCopyTelemetryResponseSchema,
|
|
478
|
-
"skill install copy telemetry response"
|
|
479
|
-
);
|
|
480
|
-
}
|
|
481
|
-
async function listSkillTags(client) {
|
|
482
|
-
const raw = await client.requestJson("/skills/tags", {
|
|
483
|
-
method: "GET"
|
|
484
|
-
});
|
|
485
|
-
return client.parseWithSchema(
|
|
486
|
-
raw,
|
|
487
|
-
skillRegistryTagsResponseSchema,
|
|
488
|
-
"skill tags response"
|
|
489
|
-
);
|
|
490
|
-
}
|
|
491
|
-
async function listSkillCategories(client) {
|
|
492
|
-
const raw = await client.requestJson("/skills/categories", {
|
|
493
|
-
method: "GET"
|
|
494
|
-
});
|
|
495
|
-
return client.parseWithSchema(
|
|
496
|
-
raw,
|
|
497
|
-
skillRegistryCategoriesResponseSchema,
|
|
498
|
-
"skill categories response"
|
|
499
|
-
);
|
|
500
|
-
}
|
|
501
|
-
async function resolveSkillMarkdown(client, skillRef) {
|
|
502
|
-
const normalizedSkillRef = requireTrimmedString(skillRef, "skillRef");
|
|
503
|
-
const response = await client.request(
|
|
504
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/SKILL.md`,
|
|
505
|
-
{
|
|
506
|
-
method: "GET",
|
|
507
|
-
headers: {
|
|
508
|
-
accept: "text/markdown, text/plain;q=0.9, */*;q=0.8"
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
);
|
|
512
|
-
return response.text();
|
|
513
|
-
}
|
|
514
|
-
async function resolveSkillManifest(client, skillRef) {
|
|
515
|
-
const normalizedSkillRef = requireTrimmedString(skillRef, "skillRef");
|
|
516
|
-
const raw = await client.requestJson(
|
|
517
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
|
|
518
|
-
{
|
|
519
|
-
method: "GET"
|
|
98
|
+
try {
|
|
99
|
+
const requireFn = getNodeRequireSync();
|
|
100
|
+
if (requireFn) {
|
|
101
|
+
return requireFn(specifier);
|
|
520
102
|
}
|
|
521
|
-
)
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
skillResolverManifestResponseSchema,
|
|
525
|
-
"skill resolver manifest response"
|
|
526
|
-
);
|
|
527
|
-
}
|
|
528
|
-
async function getSkillVoteStatus(client, params) {
|
|
529
|
-
const normalizedName = requireTrimmedString(params.name, "name");
|
|
530
|
-
const query = new URLSearchParams();
|
|
531
|
-
query.set("name", normalizedName);
|
|
532
|
-
const raw = await client.requestJson(
|
|
533
|
-
`/skills/vote?${query.toString()}`,
|
|
534
|
-
{ method: "GET" }
|
|
535
|
-
);
|
|
536
|
-
return client.parseWithSchema(
|
|
537
|
-
raw,
|
|
538
|
-
skillRegistryVoteStatusResponseSchema,
|
|
539
|
-
"skill registry vote status response"
|
|
540
|
-
);
|
|
541
|
-
}
|
|
542
|
-
async function setSkillVote(client, payload) {
|
|
543
|
-
const normalizedName = requireTrimmedString(payload.name, "name");
|
|
544
|
-
const raw = await client.requestJson("/skills/vote", {
|
|
545
|
-
method: "POST",
|
|
546
|
-
body: { name: normalizedName, upvoted: payload.upvoted },
|
|
547
|
-
headers: { "content-type": "application/json" }
|
|
548
|
-
});
|
|
549
|
-
return client.parseWithSchema(
|
|
550
|
-
raw,
|
|
551
|
-
skillRegistryVoteStatusResponseSchema,
|
|
552
|
-
"skill registry vote status response"
|
|
553
|
-
);
|
|
554
|
-
}
|
|
555
|
-
async function requestSkillVerification(client, payload) {
|
|
556
|
-
const normalizedName = requireTrimmedString(payload.name, "name");
|
|
557
|
-
const raw = await client.requestJson(
|
|
558
|
-
"/skills/verification/request",
|
|
559
|
-
{
|
|
560
|
-
method: "POST",
|
|
561
|
-
body: {
|
|
562
|
-
name: normalizedName,
|
|
563
|
-
version: payload.version,
|
|
564
|
-
tier: payload.tier
|
|
565
|
-
},
|
|
566
|
-
headers: { "content-type": "application/json" }
|
|
103
|
+
} catch (error) {
|
|
104
|
+
if (!isModuleNotFound(specifier, error)) {
|
|
105
|
+
throw error;
|
|
567
106
|
}
|
|
568
|
-
);
|
|
569
|
-
return client.parseWithSchema(
|
|
570
|
-
raw,
|
|
571
|
-
skillVerificationRequestCreateResponseSchema,
|
|
572
|
-
"skill verification request create response"
|
|
573
|
-
);
|
|
574
|
-
}
|
|
575
|
-
async function getSkillVerificationStatus(client, params) {
|
|
576
|
-
const normalizedName = requireTrimmedString(params.name, "name");
|
|
577
|
-
const query = new URLSearchParams();
|
|
578
|
-
query.set("name", normalizedName);
|
|
579
|
-
if (params.version) {
|
|
580
|
-
query.set("version", params.version);
|
|
581
107
|
}
|
|
582
|
-
|
|
583
|
-
`/skills/verification/status?${query.toString()}`,
|
|
584
|
-
{ method: "GET" }
|
|
585
|
-
);
|
|
586
|
-
return client.parseWithSchema(
|
|
587
|
-
raw,
|
|
588
|
-
skillVerificationStatusResponseSchema,
|
|
589
|
-
"skill verification status response"
|
|
590
|
-
);
|
|
591
|
-
}
|
|
592
|
-
async function createSkillDomainProofChallenge(client, payload) {
|
|
593
|
-
const normalizedName = requireTrimmedString(payload.name, "name");
|
|
594
|
-
const raw = await client.requestJson(
|
|
595
|
-
"/skills/verification/domain/challenge",
|
|
596
|
-
{
|
|
597
|
-
method: "POST",
|
|
598
|
-
body: {
|
|
599
|
-
name: normalizedName,
|
|
600
|
-
version: payload.version,
|
|
601
|
-
domain: payload.domain
|
|
602
|
-
},
|
|
603
|
-
headers: { "content-type": "application/json" }
|
|
604
|
-
}
|
|
605
|
-
);
|
|
606
|
-
return client.parseWithSchema(
|
|
607
|
-
raw,
|
|
608
|
-
skillVerificationDomainProofChallengeResponseSchema,
|
|
609
|
-
"skill domain proof challenge response"
|
|
610
|
-
);
|
|
611
|
-
}
|
|
612
|
-
async function verifySkillDomainProof(client, payload) {
|
|
613
|
-
const normalizedName = requireTrimmedString(payload.name, "name");
|
|
614
|
-
const challengeToken = requireTrimmedString(
|
|
615
|
-
payload.challengeToken,
|
|
616
|
-
"challengeToken"
|
|
617
|
-
);
|
|
618
|
-
const raw = await client.requestJson(
|
|
619
|
-
"/skills/verification/domain/verify",
|
|
620
|
-
{
|
|
621
|
-
method: "POST",
|
|
622
|
-
body: {
|
|
623
|
-
name: normalizedName,
|
|
624
|
-
version: payload.version,
|
|
625
|
-
domain: payload.domain,
|
|
626
|
-
challengeToken
|
|
627
|
-
},
|
|
628
|
-
headers: { "content-type": "application/json" }
|
|
629
|
-
}
|
|
630
|
-
);
|
|
631
|
-
return client.parseWithSchema(
|
|
632
|
-
raw,
|
|
633
|
-
skillVerificationDomainProofVerifyResponseSchema,
|
|
634
|
-
"skill domain proof verify response"
|
|
635
|
-
);
|
|
108
|
+
return null;
|
|
636
109
|
}
|
|
637
110
|
export {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
getRecommendedSkillVersion,
|
|
641
|
-
getSkillBadge,
|
|
642
|
-
getSkillConversionSignalsByRepo,
|
|
643
|
-
getSkillDeprecations,
|
|
644
|
-
getSkillInstall,
|
|
645
|
-
getSkillOwnership,
|
|
646
|
-
getSkillPreview,
|
|
647
|
-
getSkillPreviewById,
|
|
648
|
-
getSkillPreviewByRepo,
|
|
649
|
-
getSkillPublishJob,
|
|
650
|
-
getSkillSecurityBreakdown,
|
|
651
|
-
getSkillStatus,
|
|
652
|
-
getSkillStatusByRepo,
|
|
653
|
-
getSkillVerificationStatus,
|
|
654
|
-
getSkillVoteStatus,
|
|
655
|
-
getSkillsCatalog,
|
|
656
|
-
listMySkills,
|
|
657
|
-
listSkillCategories,
|
|
658
|
-
listSkillTags,
|
|
659
|
-
listSkillVersions,
|
|
660
|
-
listSkills,
|
|
661
|
-
publishSkill,
|
|
662
|
-
quoteSkillPublish,
|
|
663
|
-
quoteSkillPublishPreview,
|
|
664
|
-
recordSkillInstallCopy,
|
|
665
|
-
requestSkillVerification,
|
|
666
|
-
resolveSkillManifest,
|
|
667
|
-
resolveSkillMarkdown,
|
|
668
|
-
setRecommendedSkillVersion,
|
|
669
|
-
setSkillDeprecation,
|
|
670
|
-
setSkillVote,
|
|
671
|
-
skillsConfig,
|
|
672
|
-
uploadSkillPreviewFromGithubOidc,
|
|
673
|
-
verifySkillDomainProof
|
|
111
|
+
optionalImport,
|
|
112
|
+
optionalImportSync
|
|
674
113
|
};
|
|
675
114
|
//# sourceMappingURL=standards-sdk.es186.js.map
|