@hashgraphonline/standards-sdk 0.1.176 → 0.1.177

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