@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.
- package/dist/browser/services/registry-broker/client/base-client.d.ts +7 -4
- package/dist/browser/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/client/skills.d.ts +5 -3
- package/dist/browser/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/schemas.d.ts +6871 -24133
- package/dist/browser/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/browser/services/registry-broker/types.d.ts +34 -26
- package/dist/browser/services/registry-broker/types.d.ts.map +1 -1
- package/dist/browser/standards-sdk.browser.js +220 -221
- package/dist/browser/standards-sdk.browser.js.map +1 -1
- package/dist/browser-root/services/registry-broker/client/base-client.d.ts +7 -4
- 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 +5 -3
- package/dist/browser-root/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/schemas.d.ts +6871 -24133
- package/dist/browser-root/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/browser-root/services/registry-broker/types.d.ts +34 -26
- package/dist/browser-root/services/registry-broker/types.d.ts.map +1 -1
- package/dist/browser-root/standards-sdk.root-browser.js +342 -282
- package/dist/browser-root/standards-sdk.root-browser.js.map +1 -1
- package/dist/cjs/services/registry-broker/client/base-client.d.ts +7 -4
- package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client/skills.d.ts +5 -3
- package/dist/cjs/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/schemas.d.ts +6869 -24131
- package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/types.d.ts +34 -26
- package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +1 -1
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/es/services/registry-broker/client/base-client.d.ts +7 -4
- package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client/skills.d.ts +5 -3
- package/dist/es/services/registry-broker/client/skills.d.ts.map +1 -1
- package/dist/es/services/registry-broker/schemas.d.ts +6869 -24131
- package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/es/services/registry-broker/types.d.ts +34 -26
- 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 +28 -11
- 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 +12461 -1778
- package/dist/es/standards-sdk.es160.js.map +1 -1
- package/dist/es/standards-sdk.es161.js +1773 -12461
- package/dist/es/standards-sdk.es161.js.map +1 -1
- package/dist/es/standards-sdk.es163.js +167 -51
- package/dist/es/standards-sdk.es163.js.map +1 -1
- package/dist/es/standards-sdk.es164.js +306 -88
- package/dist/es/standards-sdk.es164.js.map +1 -1
- package/dist/es/standards-sdk.es165.js +336 -71
- package/dist/es/standards-sdk.es165.js.map +1 -1
- package/dist/es/standards-sdk.es166.js +439 -186
- package/dist/es/standards-sdk.es166.js.map +1 -1
- package/dist/es/standards-sdk.es167.js +314 -695
- package/dist/es/standards-sdk.es167.js.map +1 -1
- package/dist/es/standards-sdk.es168.js +66 -63
- package/dist/es/standards-sdk.es168.js.map +1 -1
- package/dist/es/standards-sdk.es169.js +744 -158
- package/dist/es/standards-sdk.es169.js.map +1 -1
- package/dist/es/standards-sdk.es170.js +55 -321
- package/dist/es/standards-sdk.es170.js.map +1 -1
- package/dist/es/standards-sdk.es171.js +88 -330
- package/dist/es/standards-sdk.es171.js.map +1 -1
- package/dist/es/standards-sdk.es172.js +71 -443
- package/dist/es/standards-sdk.es172.js.map +1 -1
- package/dist/es/standards-sdk.es173.js +184 -315
- package/dist/es/standards-sdk.es173.js.map +1 -1
- package/dist/es/standards-sdk.es174.js +63 -66
- 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 +1 -1
|
@@ -1,715 +1,334 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { proto } from "@hashgraph/proto";
|
|
2
|
+
import { Long, FileId, ContractId } from "@hashgraph/sdk";
|
|
3
|
+
import { hasTransactionType } from "./standards-sdk.es168.js";
|
|
4
|
+
class UtilParser {
|
|
5
|
+
/**
|
|
6
|
+
* Parse Utility/System Service transaction using unified dual-branch approach
|
|
7
|
+
* This handles both regular transactions and signed transaction variants
|
|
8
|
+
*/
|
|
9
|
+
static parseUtilTransaction(transaction, originalBytes) {
|
|
10
|
+
try {
|
|
11
|
+
if (originalBytes || transaction.toBytes) {
|
|
12
|
+
try {
|
|
13
|
+
const bytesToParse = originalBytes || transaction.toBytes();
|
|
14
|
+
const decoded = proto.TransactionList.decode(bytesToParse);
|
|
15
|
+
if (decoded.transactionList && decoded.transactionList.length > 0) {
|
|
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
|
+
};
|
|
26
44
|
}
|
|
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
45
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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());
|
|
46
|
+
/**
|
|
47
|
+
* Parse utility transaction from protobuf TransactionBody
|
|
48
|
+
* Handles all utility operations from decoded protobuf data
|
|
49
|
+
*/
|
|
50
|
+
static parseFromProtobufTxBody(txBody) {
|
|
51
|
+
if (txBody.utilPrng) {
|
|
52
|
+
const utilPrng = this.parseUtilPrng(txBody.utilPrng);
|
|
53
|
+
if (utilPrng) {
|
|
54
|
+
return {
|
|
55
|
+
type: "PRNG",
|
|
56
|
+
humanReadableType: "Pseudo Random Number",
|
|
57
|
+
utilPrng
|
|
58
|
+
};
|
|
59
|
+
}
|
|
137
60
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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"
|
|
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
|
+
}
|
|
278
70
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
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}`
|
|
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
|
+
};
|
|
409
79
|
}
|
|
410
80
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
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" }
|
|
81
|
+
if (txBody.systemUndelete) {
|
|
82
|
+
const systemUndelete = this.parseSystemUndeleteFromProto(
|
|
83
|
+
txBody.systemUndelete
|
|
84
|
+
);
|
|
85
|
+
if (systemUndelete) {
|
|
86
|
+
return {
|
|
87
|
+
type: "SYSTEMUNDELETE",
|
|
88
|
+
humanReadableType: "System Undelete",
|
|
89
|
+
systemUndelete
|
|
90
|
+
};
|
|
91
|
+
}
|
|
491
92
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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"
|
|
93
|
+
if (txBody.nodeCreate) {
|
|
94
|
+
const nodeCreate = this.parseNodeCreateFromProto(txBody.nodeCreate);
|
|
95
|
+
if (nodeCreate) {
|
|
96
|
+
return {
|
|
97
|
+
type: "NODECREATE",
|
|
98
|
+
humanReadableType: "Node Create",
|
|
99
|
+
nodeCreate
|
|
100
|
+
};
|
|
530
101
|
}
|
|
531
102
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
`/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
|
|
542
|
-
{
|
|
543
|
-
method: "GET"
|
|
103
|
+
if (txBody.nodeUpdate) {
|
|
104
|
+
const nodeUpdate = this.parseNodeUpdateFromProto(txBody.nodeUpdate);
|
|
105
|
+
if (nodeUpdate) {
|
|
106
|
+
return {
|
|
107
|
+
type: "NODEUPDATE",
|
|
108
|
+
humanReadableType: "Node Update",
|
|
109
|
+
nodeUpdate
|
|
110
|
+
};
|
|
111
|
+
}
|
|
544
112
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
113
|
+
if (txBody.nodeDelete) {
|
|
114
|
+
const nodeDelete = this.parseNodeDeleteFromProto(txBody.nodeDelete);
|
|
115
|
+
if (nodeDelete) {
|
|
116
|
+
return {
|
|
117
|
+
type: "NODEDELETE",
|
|
118
|
+
humanReadableType: "Node Delete",
|
|
119
|
+
nodeDelete
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return {};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Extract utility data from Transaction internal fields
|
|
127
|
+
* This handles cases where data is stored in Transaction object internals
|
|
128
|
+
*/
|
|
129
|
+
static parseFromTransactionInternals(transaction) {
|
|
130
|
+
try {
|
|
131
|
+
const tx = transaction;
|
|
132
|
+
if (hasTransactionType(transaction, "utilPrng")) {
|
|
133
|
+
const utilPrng = {};
|
|
134
|
+
if (tx._range && tx._range !== 0) {
|
|
135
|
+
utilPrng.range = tx._range;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
type: "PRNG",
|
|
139
|
+
humanReadableType: "Pseudo Random Number",
|
|
140
|
+
utilPrng
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
if (hasTransactionType(transaction, "freeze")) {
|
|
144
|
+
const networkFreeze = {};
|
|
145
|
+
if (tx._startTime) {
|
|
146
|
+
networkFreeze.startTime = tx._startTime.toString();
|
|
147
|
+
}
|
|
148
|
+
if (tx._endTime) {
|
|
149
|
+
networkFreeze.endTime = tx._endTime.toString();
|
|
150
|
+
}
|
|
151
|
+
if (tx._updateFile) {
|
|
152
|
+
networkFreeze.updateFile = tx._updateFile.toString();
|
|
153
|
+
}
|
|
154
|
+
if (tx._fileHash) {
|
|
155
|
+
networkFreeze.fileHash = Buffer.from(tx._fileHash).toString("hex");
|
|
156
|
+
}
|
|
157
|
+
if (tx._freezeType) {
|
|
158
|
+
networkFreeze.freezeType = tx._freezeType;
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
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
|
+
};
|
|
194
|
+
}
|
|
195
|
+
return {};
|
|
196
|
+
} catch (error) {
|
|
197
|
+
return {};
|
|
600
198
|
}
|
|
601
|
-
);
|
|
602
|
-
return client.parseWithSchema(
|
|
603
|
-
raw,
|
|
604
|
-
skillVerificationRequestCreateResponseSchema,
|
|
605
|
-
"skill verification request create response"
|
|
606
|
-
);
|
|
607
|
-
}
|
|
608
|
-
async function getSkillVerificationStatus(client, params) {
|
|
609
|
-
const normalizedName = params.name.trim();
|
|
610
|
-
if (!normalizedName) {
|
|
611
|
-
throw new Error("name is required");
|
|
612
|
-
}
|
|
613
|
-
const query = new URLSearchParams();
|
|
614
|
-
query.set("name", normalizedName);
|
|
615
|
-
if (params.version) {
|
|
616
|
-
query.set("version", params.version);
|
|
617
199
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
)
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Parse Network Freeze from protobuf data
|
|
202
|
+
*/
|
|
203
|
+
static parseNetworkFreezeFromProto(body) {
|
|
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();
|
|
287
|
+
}
|
|
288
|
+
return data;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Parse Node Update from protobuf data
|
|
292
|
+
*/
|
|
293
|
+
static parseNodeUpdateFromProto(body) {
|
|
294
|
+
if (!body) return void 0;
|
|
295
|
+
const data = {};
|
|
296
|
+
if (body.nodeId !== void 0) {
|
|
297
|
+
data.nodeId = Long.fromValue(body.nodeId).toNumber();
|
|
298
|
+
}
|
|
299
|
+
return data;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Parse Node Delete from protobuf data
|
|
303
|
+
*/
|
|
304
|
+
static parseNodeDeleteFromProto(body) {
|
|
305
|
+
if (!body) return void 0;
|
|
306
|
+
const data = {};
|
|
307
|
+
if (body.nodeId !== void 0) {
|
|
308
|
+
data.nodeId = Long.fromValue(body.nodeId).toNumber();
|
|
309
|
+
}
|
|
310
|
+
return data;
|
|
632
311
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
{
|
|
636
|
-
|
|
637
|
-
body
|
|
638
|
-
name: normalizedName,
|
|
639
|
-
version: payload.version,
|
|
640
|
-
domain: payload.domain
|
|
641
|
-
},
|
|
642
|
-
headers: { "content-type": "application/json" }
|
|
312
|
+
static parseUtilPrng(body) {
|
|
313
|
+
if (!body) return void 0;
|
|
314
|
+
const data = {};
|
|
315
|
+
if (body.range && body.range !== 0) {
|
|
316
|
+
data.range = body.range;
|
|
643
317
|
}
|
|
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");
|
|
318
|
+
return data;
|
|
656
319
|
}
|
|
657
|
-
|
|
658
|
-
|
|
320
|
+
static parseFreeze(body) {
|
|
321
|
+
return this.parseNetworkFreezeFromProto(body);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Parse Utility/System Service transaction from Transaction object
|
|
325
|
+
* This is the unified entry point that delegates to the comprehensive parsing logic
|
|
326
|
+
*/
|
|
327
|
+
static parseFromTransactionObject(transaction) {
|
|
328
|
+
return this.parseUtilTransaction(transaction);
|
|
659
329
|
}
|
|
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
|
-
);
|
|
678
330
|
}
|
|
679
331
|
export {
|
|
680
|
-
|
|
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
|
|
332
|
+
UtilParser
|
|
714
333
|
};
|
|
715
334
|
//# sourceMappingURL=standards-sdk.es167.js.map
|