@seed-hypermedia/cli 0.1.0-alpha.1 → 0.1.0-alpha.7
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 +731 -50
- package/dist/index.js +336 -65
- package/package.json +12 -7
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
20
20
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
21
21
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
22
22
|
|
|
23
|
-
//
|
|
23
|
+
// node_modules/commander/lib/error.js
|
|
24
24
|
var require_error = __commonJS((exports) => {
|
|
25
25
|
class CommanderError extends Error {
|
|
26
26
|
constructor(exitCode, code, message) {
|
|
@@ -44,7 +44,7 @@ var require_error = __commonJS((exports) => {
|
|
|
44
44
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
//
|
|
47
|
+
// node_modules/commander/lib/argument.js
|
|
48
48
|
var require_argument = __commonJS((exports) => {
|
|
49
49
|
var { InvalidArgumentError } = require_error();
|
|
50
50
|
|
|
@@ -123,7 +123,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
123
123
|
exports.humanReadableArgName = humanReadableArgName;
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
//
|
|
126
|
+
// node_modules/commander/lib/help.js
|
|
127
127
|
var require_help = __commonJS((exports) => {
|
|
128
128
|
var { humanReadableArgName } = require_argument();
|
|
129
129
|
|
|
@@ -372,7 +372,7 @@ var require_help = __commonJS((exports) => {
|
|
|
372
372
|
exports.Help = Help;
|
|
373
373
|
});
|
|
374
374
|
|
|
375
|
-
//
|
|
375
|
+
// node_modules/commander/lib/option.js
|
|
376
376
|
var require_option = __commonJS((exports) => {
|
|
377
377
|
var { InvalidArgumentError } = require_error();
|
|
378
378
|
|
|
@@ -523,7 +523,7 @@ var require_option = __commonJS((exports) => {
|
|
|
523
523
|
exports.DualOptions = DualOptions;
|
|
524
524
|
});
|
|
525
525
|
|
|
526
|
-
//
|
|
526
|
+
// node_modules/commander/lib/suggestSimilar.js
|
|
527
527
|
var require_suggestSimilar = __commonJS((exports) => {
|
|
528
528
|
var maxDistance = 3;
|
|
529
529
|
function editDistance(a, b) {
|
|
@@ -596,7 +596,7 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
596
596
|
exports.suggestSimilar = suggestSimilar;
|
|
597
597
|
});
|
|
598
598
|
|
|
599
|
-
//
|
|
599
|
+
// node_modules/commander/lib/command.js
|
|
600
600
|
var require_command = __commonJS((exports) => {
|
|
601
601
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
602
602
|
var childProcess = __require("node:child_process");
|
|
@@ -1839,7 +1839,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1839
1839
|
exports.Command = Command;
|
|
1840
1840
|
});
|
|
1841
1841
|
|
|
1842
|
-
//
|
|
1842
|
+
// node_modules/commander/index.js
|
|
1843
1843
|
var require_commander = __commonJS((exports) => {
|
|
1844
1844
|
var { Argument } = require_argument();
|
|
1845
1845
|
var { Command } = require_command();
|
|
@@ -3966,7 +3966,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
3966
3966
|
toJS.toJS(source, null, ctx);
|
|
3967
3967
|
data = anchors2.get(source);
|
|
3968
3968
|
}
|
|
3969
|
-
if (
|
|
3969
|
+
if (data?.res === undefined) {
|
|
3970
3970
|
const msg = "This should not happen: Alias anchor was not resolved?";
|
|
3971
3971
|
throw new ReferenceError(msg);
|
|
3972
3972
|
}
|
|
@@ -4895,7 +4895,7 @@ ${stringifyComment.indentComment(cs, ctx.indent)}`;
|
|
|
4895
4895
|
}
|
|
4896
4896
|
if (valueStr === "" && !ctx.inFlow) {
|
|
4897
4897
|
if (ws === `
|
|
4898
|
-
`)
|
|
4898
|
+
` && valueComment)
|
|
4899
4899
|
ws = `
|
|
4900
4900
|
|
|
4901
4901
|
`;
|
|
@@ -5576,7 +5576,7 @@ var require_stringifyNumber = __commonJS((exports) => {
|
|
|
5576
5576
|
const num = typeof value === "number" ? value : Number(value);
|
|
5577
5577
|
if (!isFinite(num))
|
|
5578
5578
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
5579
|
-
let n = JSON.stringify(value);
|
|
5579
|
+
let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
5580
5580
|
if (!format2 && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) {
|
|
5581
5581
|
let i = n.indexOf(".");
|
|
5582
5582
|
if (i < 0) {
|
|
@@ -6809,7 +6809,7 @@ var require_errors = __commonJS((exports) => {
|
|
|
6809
6809
|
if (/[^ ]/.test(lineStr)) {
|
|
6810
6810
|
let count = 1;
|
|
6811
6811
|
const end = error.linePos[1];
|
|
6812
|
-
if (end
|
|
6812
|
+
if (end?.line === line && end.col > col) {
|
|
6813
6813
|
count = Math.max(1, Math.min(end.col - col, 80 - ci));
|
|
6814
6814
|
}
|
|
6815
6815
|
const pointer = " ".repeat(ci) + "^".repeat(count);
|
|
@@ -7156,7 +7156,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
|
|
|
7156
7156
|
});
|
|
7157
7157
|
if (!props.found) {
|
|
7158
7158
|
if (props.anchor || props.tag || value) {
|
|
7159
|
-
if (value
|
|
7159
|
+
if (value?.type === "block-seq")
|
|
7160
7160
|
onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
|
|
7161
7161
|
else
|
|
7162
7162
|
onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
|
|
@@ -7345,7 +7345,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
7345
7345
|
onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
|
|
7346
7346
|
}
|
|
7347
7347
|
} else if (value) {
|
|
7348
|
-
if ("source" in value && value.source
|
|
7348
|
+
if ("source" in value && value.source?.[0] === ":")
|
|
7349
7349
|
onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
|
|
7350
7350
|
else
|
|
7351
7351
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
@@ -7383,7 +7383,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
7383
7383
|
const expectedEnd = isMap ? "}" : "]";
|
|
7384
7384
|
const [ce, ...ee] = fc.end;
|
|
7385
7385
|
let cePos = offset;
|
|
7386
|
-
if (ce
|
|
7386
|
+
if (ce?.source === expectedEnd)
|
|
7387
7387
|
cePos = ce.offset + ce.source.length;
|
|
7388
7388
|
else {
|
|
7389
7389
|
const name = fcName[0].toUpperCase() + fcName.substring(1);
|
|
@@ -7448,7 +7448,7 @@ var require_compose_collection = __commonJS((exports) => {
|
|
|
7448
7448
|
let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType);
|
|
7449
7449
|
if (!tag) {
|
|
7450
7450
|
const kt = ctx.schema.knownTags[tagName];
|
|
7451
|
-
if (kt
|
|
7451
|
+
if (kt?.collection === expType) {
|
|
7452
7452
|
ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
|
|
7453
7453
|
tag = kt;
|
|
7454
7454
|
} else {
|
|
@@ -9507,7 +9507,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
9507
9507
|
}
|
|
9508
9508
|
*step() {
|
|
9509
9509
|
const top = this.peek(1);
|
|
9510
|
-
if (this.type === "doc-end" &&
|
|
9510
|
+
if (this.type === "doc-end" && top?.type !== "doc-end") {
|
|
9511
9511
|
while (this.stack.length > 0)
|
|
9512
9512
|
yield* this.pop();
|
|
9513
9513
|
this.stack.push({
|
|
@@ -9985,7 +9985,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
9985
9985
|
do {
|
|
9986
9986
|
yield* this.pop();
|
|
9987
9987
|
top = this.peek(1);
|
|
9988
|
-
} while (top
|
|
9988
|
+
} while (top?.type === "flow-collection");
|
|
9989
9989
|
} else if (fc.end.length === 0) {
|
|
9990
9990
|
switch (this.type) {
|
|
9991
9991
|
case "comma":
|
|
@@ -32322,7 +32322,7 @@ var require_bip32_path = __commonJS((exports, module) => {
|
|
|
32322
32322
|
module.exports = BIPPath;
|
|
32323
32323
|
});
|
|
32324
32324
|
|
|
32325
|
-
//
|
|
32325
|
+
// node_modules/commander/esm.mjs
|
|
32326
32326
|
var import__ = __toESM(require_commander(), 1);
|
|
32327
32327
|
var {
|
|
32328
32328
|
program,
|
|
@@ -33394,6 +33394,11 @@ var defaultEncodeOptions = {
|
|
|
33394
33394
|
mapSorter,
|
|
33395
33395
|
quickEncodeToken
|
|
33396
33396
|
};
|
|
33397
|
+
var rfc8949EncodeOptions = Object.freeze({
|
|
33398
|
+
float64: true,
|
|
33399
|
+
mapSorter: rfc8949MapSorter,
|
|
33400
|
+
quickEncodeToken
|
|
33401
|
+
});
|
|
33397
33402
|
function makeCborEncoders() {
|
|
33398
33403
|
const encoders = [];
|
|
33399
33404
|
encoders[Type.uint.major] = encodeUint;
|
|
@@ -33558,6 +33563,23 @@ function mapSorter(e1, e2) {
|
|
|
33558
33563
|
}
|
|
33559
33564
|
return tcmp;
|
|
33560
33565
|
}
|
|
33566
|
+
function rfc8949MapSorter(e1, e2) {
|
|
33567
|
+
if (e1[0] instanceof Token && e2[0] instanceof Token) {
|
|
33568
|
+
const t1 = e1[0];
|
|
33569
|
+
const t2 = e2[0];
|
|
33570
|
+
if (!t1._keyBytes) {
|
|
33571
|
+
t1._keyBytes = encodeRfc8949(t1.value);
|
|
33572
|
+
}
|
|
33573
|
+
if (!t2._keyBytes) {
|
|
33574
|
+
t2._keyBytes = encodeRfc8949(t2.value);
|
|
33575
|
+
}
|
|
33576
|
+
return compare(t1._keyBytes, t2._keyBytes);
|
|
33577
|
+
}
|
|
33578
|
+
throw new Error("rfc8949MapSorter: complex key types are not supported yet");
|
|
33579
|
+
}
|
|
33580
|
+
function encodeRfc8949(data) {
|
|
33581
|
+
return encodeCustom(data, cborEncoders, rfc8949EncodeOptions);
|
|
33582
|
+
}
|
|
33561
33583
|
function tokensToEncoded(buf2, tokens, encoders, options) {
|
|
33562
33584
|
if (Array.isArray(tokens)) {
|
|
33563
33585
|
for (const token of tokens) {
|
|
@@ -34532,7 +34554,7 @@ function unpackHmId(idOrUid) {
|
|
|
34532
34554
|
}
|
|
34533
34555
|
|
|
34534
34556
|
// src/client.ts
|
|
34535
|
-
var DEFAULT_SERVER = "https://
|
|
34557
|
+
var DEFAULT_SERVER = "https://hyper.media";
|
|
34536
34558
|
function createClient(config) {
|
|
34537
34559
|
const server = config?.server || process.env.SEED_SERVER || DEFAULT_SERVER;
|
|
34538
34560
|
async function request(key, input) {
|
|
@@ -34567,7 +34589,7 @@ function createClient(config) {
|
|
|
34567
34589
|
return request("ResourceMetadata", { id });
|
|
34568
34590
|
}
|
|
34569
34591
|
async function getAccount(uid) {
|
|
34570
|
-
return request("Account", { uid });
|
|
34592
|
+
return request("Account", { id: uid });
|
|
34571
34593
|
}
|
|
34572
34594
|
async function listAccounts() {
|
|
34573
34595
|
return request("ListAccounts", {});
|
|
@@ -35561,7 +35583,7 @@ function asUint8(arr, size, name) {
|
|
|
35561
35583
|
throw new TypeError(makeMessage(name, ` of size ${Number(size)}`));
|
|
35562
35584
|
}
|
|
35563
35585
|
|
|
35564
|
-
// ../../../node_modules/@exodus/bytes/assert.js
|
|
35586
|
+
// ../../../node_modules/@exodus/crypto/node_modules/@exodus/bytes/assert.js
|
|
35565
35587
|
function assertEmptyRest2(rest) {
|
|
35566
35588
|
if (Object.keys(rest).length > 0)
|
|
35567
35589
|
throw new TypeError("Unexpected extra options");
|
|
@@ -35586,7 +35608,7 @@ function assertUint82(arr, options) {
|
|
|
35586
35608
|
throw new TypeError(makeMessage2(name, length2 === undefined ? "" : ` of size ${Number(length2)}`));
|
|
35587
35609
|
}
|
|
35588
35610
|
|
|
35589
|
-
// ../../../node_modules/@exodus/bytes/array.js
|
|
35611
|
+
// ../../../node_modules/@exodus/crypto/node_modules/@exodus/bytes/array.js
|
|
35590
35612
|
var { Buffer: Buffer2 } = globalThis;
|
|
35591
35613
|
function typedView(arr, format2) {
|
|
35592
35614
|
assertTypedArray(arr);
|
|
@@ -35603,48 +35625,25 @@ function typedView(arr, format2) {
|
|
|
35603
35625
|
throw new TypeError("Unexpected format");
|
|
35604
35626
|
}
|
|
35605
35627
|
|
|
35606
|
-
// ../../../node_modules/@exodus/bytes/fallback/_utils.js
|
|
35628
|
+
// ../../../node_modules/@exodus/crypto/node_modules/@exodus/bytes/fallback/_utils.js
|
|
35607
35629
|
var { Buffer: Buffer3, TextEncoder: TextEncoder2, TextDecoder: TextDecoder2 } = globalThis;
|
|
35608
35630
|
var haveNativeBuffer = Buffer3 && !Buffer3.TYPED_ARRAY_SUPPORT;
|
|
35609
|
-
var isHermes =
|
|
35610
|
-
var isDeno =
|
|
35611
|
-
var isLE = new Uint8Array(Uint16Array.of(258).buffer)[0] === 2;
|
|
35631
|
+
var isHermes = !!globalThis.HermesInternal;
|
|
35632
|
+
var isDeno = !!globalThis.Deno;
|
|
35612
35633
|
var isNative = (x) => x && (haveNativeBuffer || `${x}`.includes("[native code]"));
|
|
35613
35634
|
if (!haveNativeBuffer && isNative(() => {}))
|
|
35614
35635
|
isNative = () => false;
|
|
35615
35636
|
var nativeEncoder = isNative(TextEncoder2) ? new TextEncoder2 : null;
|
|
35616
35637
|
var nativeDecoder = isNative(TextDecoder2) ? new TextDecoder2("utf-8", { ignoreBOM: true }) : null;
|
|
35617
|
-
var nativeDecoderLatin1impl = null;
|
|
35618
|
-
if (nativeDecoder) {
|
|
35619
|
-
try {
|
|
35620
|
-
nativeDecoderLatin1impl = new TextDecoder2("latin1", { ignoreBOM: true });
|
|
35621
|
-
} catch {}
|
|
35622
|
-
}
|
|
35623
|
-
var canDecoders = Boolean(nativeDecoderLatin1impl);
|
|
35624
|
-
function shouldSkipBuiltins() {
|
|
35625
|
-
const g = globalThis;
|
|
35626
|
-
if (haveNativeBuffer || isHermes || !g.window || g.chrome || !g.navigator)
|
|
35627
|
-
return false;
|
|
35628
|
-
try {
|
|
35629
|
-
new WeakSet().add(Symbol());
|
|
35630
|
-
return false;
|
|
35631
|
-
} catch {
|
|
35632
|
-
if (!("onmozfullscreenerror" in g))
|
|
35633
|
-
return false;
|
|
35634
|
-
return /firefox/i.test(g.navigator.userAgent || "");
|
|
35635
|
-
}
|
|
35636
|
-
return false;
|
|
35637
|
-
}
|
|
35638
|
-
var skipWeb = shouldSkipBuiltins();
|
|
35639
35638
|
var E_STRING = "Input is not a string";
|
|
35640
35639
|
|
|
35641
|
-
// ../../../node_modules/@exodus/bytes/fallback/latin1.js
|
|
35640
|
+
// ../../../node_modules/@exodus/crypto/node_modules/@exodus/bytes/fallback/latin1.js
|
|
35642
35641
|
var { toBase64: web64 } = Uint8Array.prototype;
|
|
35643
35642
|
|
|
35644
|
-
// ../../../node_modules/@exodus/bytes/fallback/hex.js
|
|
35643
|
+
// ../../../node_modules/@exodus/crypto/node_modules/@exodus/bytes/fallback/hex.js
|
|
35645
35644
|
var E_HEX = "Input is not a hex string";
|
|
35646
35645
|
|
|
35647
|
-
// ../../../node_modules/@exodus/bytes/hex.node.js
|
|
35646
|
+
// ../../../node_modules/@exodus/crypto/node_modules/@exodus/bytes/hex.node.js
|
|
35648
35647
|
if (Buffer.TYPED_ARRAY_SUPPORT)
|
|
35649
35648
|
throw new Error("Unexpected Buffer polyfill");
|
|
35650
35649
|
var { toHex: webHex } = Uint8Array.prototype;
|
|
@@ -35714,7 +35713,7 @@ var makeSignOpen = (verifyDetached) => async function signOpen({ signed, publicK
|
|
|
35714
35713
|
return fromUint8Super(opened, format2);
|
|
35715
35714
|
};
|
|
35716
35715
|
|
|
35717
|
-
// ../../../node_modules/@
|
|
35716
|
+
// ../../../node_modules/@noble/curves/node_modules/@noble/hashes/utils.js
|
|
35718
35717
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
35719
35718
|
function isBytes(a) {
|
|
35720
35719
|
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
@@ -35838,7 +35837,7 @@ var oidNist = (suffix) => ({
|
|
|
35838
35837
|
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, suffix])
|
|
35839
35838
|
});
|
|
35840
35839
|
|
|
35841
|
-
// ../../../node_modules/@
|
|
35840
|
+
// ../../../node_modules/@noble/curves/node_modules/@noble/hashes/_md.js
|
|
35842
35841
|
function Chi(a, b, c) {
|
|
35843
35842
|
return a & b ^ ~a & c;
|
|
35844
35843
|
}
|
|
@@ -35997,7 +35996,7 @@ var SHA512_IV = /* @__PURE__ */ Uint32Array.from([
|
|
|
35997
35996
|
327033209
|
|
35998
35997
|
]);
|
|
35999
35998
|
|
|
36000
|
-
// ../../../node_modules/@
|
|
35999
|
+
// ../../../node_modules/@noble/curves/node_modules/@noble/hashes/_u64.js
|
|
36001
36000
|
var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
36002
36001
|
var _32n = /* @__PURE__ */ BigInt(32);
|
|
36003
36002
|
function fromBig(n, le = false) {
|
|
@@ -36032,7 +36031,7 @@ var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0
|
|
|
36032
36031
|
var add5L = (Al, Bl2, Cl, Dl, El) => (Al >>> 0) + (Bl2 >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
36033
36032
|
var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
|
36034
36033
|
|
|
36035
|
-
// ../../../node_modules/@
|
|
36034
|
+
// ../../../node_modules/@noble/curves/node_modules/@noble/hashes/sha2.js
|
|
36036
36035
|
var SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
|
36037
36036
|
1116352408,
|
|
36038
36037
|
1899447441,
|
|
@@ -36496,7 +36495,7 @@ class _SHA512_256 extends SHA2_64B {
|
|
|
36496
36495
|
}
|
|
36497
36496
|
var sha512 = /* @__PURE__ */ createHasher(() => new _SHA512, /* @__PURE__ */ oidNist(3));
|
|
36498
36497
|
|
|
36499
|
-
// ../../../node_modules/@
|
|
36498
|
+
// ../../../node_modules/@noble/curves/utils.js
|
|
36500
36499
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
36501
36500
|
var _0n = /* @__PURE__ */ BigInt(0);
|
|
36502
36501
|
var _1n = /* @__PURE__ */ BigInt(1);
|
|
@@ -36576,7 +36575,7 @@ function memoized(fn) {
|
|
|
36576
36575
|
};
|
|
36577
36576
|
}
|
|
36578
36577
|
|
|
36579
|
-
// ../../../node_modules/@
|
|
36578
|
+
// ../../../node_modules/@noble/curves/abstract/modular.js
|
|
36580
36579
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
36581
36580
|
var _0n2 = /* @__PURE__ */ BigInt(0);
|
|
36582
36581
|
var _1n2 = /* @__PURE__ */ BigInt(1);
|
|
@@ -36938,7 +36937,7 @@ function Field(ORDER, opts = {}) {
|
|
|
36938
36937
|
return new _Field(ORDER, opts);
|
|
36939
36938
|
}
|
|
36940
36939
|
|
|
36941
|
-
// ../../../node_modules/@
|
|
36940
|
+
// ../../../node_modules/@noble/curves/abstract/curve.js
|
|
36942
36941
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
36943
36942
|
var _0n3 = /* @__PURE__ */ BigInt(0);
|
|
36944
36943
|
var _1n3 = /* @__PURE__ */ BigInt(1);
|
|
@@ -37130,7 +37129,7 @@ function createKeygen(randomSecretKey, getPublicKey) {
|
|
|
37130
37129
|
};
|
|
37131
37130
|
}
|
|
37132
37131
|
|
|
37133
|
-
// ../../../node_modules/@
|
|
37132
|
+
// ../../../node_modules/@noble/curves/abstract/edwards.js
|
|
37134
37133
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
37135
37134
|
var _0n4 = BigInt(0);
|
|
37136
37135
|
var _1n4 = BigInt(1);
|
|
@@ -37515,7 +37514,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
|
|
|
37515
37514
|
});
|
|
37516
37515
|
}
|
|
37517
37516
|
|
|
37518
|
-
// ../../../node_modules/@
|
|
37517
|
+
// ../../../node_modules/@noble/curves/ed25519.js
|
|
37519
37518
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
37520
37519
|
var _1n5 = BigInt(1);
|
|
37521
37520
|
var _2n3 = BigInt(2);
|
|
@@ -37641,16 +37640,16 @@ function assertHmacParams(type, secret, form) {
|
|
|
37641
37640
|
}
|
|
37642
37641
|
var P2SH_OP_0 = Uint8Array.of(0, 20);
|
|
37643
37642
|
|
|
37644
|
-
// ../../../node_modules/@exodus/bytes/fallback/utf8.js
|
|
37643
|
+
// ../../../node_modules/@exodus/crypto/node_modules/@exodus/bytes/fallback/utf8.js
|
|
37645
37644
|
var E_STRICT_UNICODE = "Input is not well-formed Unicode";
|
|
37646
37645
|
|
|
37647
|
-
// ../../../node_modules/@exodus/bytes/utf8.node.js
|
|
37646
|
+
// ../../../node_modules/@exodus/crypto/node_modules/@exodus/bytes/utf8.node.js
|
|
37648
37647
|
if (Buffer.TYPED_ARRAY_SUPPORT)
|
|
37649
37648
|
throw new Error("Unexpected Buffer polyfill");
|
|
37650
37649
|
var decoderFatal;
|
|
37651
37650
|
var decoderLoose = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
37652
37651
|
var { isWellFormed } = String.prototype;
|
|
37653
|
-
var isDeno2 =
|
|
37652
|
+
var isDeno2 = !!globalThis.Deno;
|
|
37654
37653
|
try {
|
|
37655
37654
|
decoderFatal = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
37656
37655
|
} catch {}
|
|
@@ -37810,6 +37809,278 @@ class SLIP10 {
|
|
|
37810
37809
|
}
|
|
37811
37810
|
}
|
|
37812
37811
|
|
|
37812
|
+
// node_modules/multiformats/dist/src/bytes.js
|
|
37813
|
+
var empty2 = new Uint8Array(0);
|
|
37814
|
+
function coerce2(o) {
|
|
37815
|
+
if (o instanceof Uint8Array && o.constructor.name === "Uint8Array") {
|
|
37816
|
+
return o;
|
|
37817
|
+
}
|
|
37818
|
+
if (o instanceof ArrayBuffer) {
|
|
37819
|
+
return new Uint8Array(o);
|
|
37820
|
+
}
|
|
37821
|
+
if (ArrayBuffer.isView(o)) {
|
|
37822
|
+
return new Uint8Array(o.buffer, o.byteOffset, o.byteLength);
|
|
37823
|
+
}
|
|
37824
|
+
throw new Error("Unknown type, must be binary type");
|
|
37825
|
+
}
|
|
37826
|
+
|
|
37827
|
+
// node_modules/multiformats/dist/src/vendor/base-x.js
|
|
37828
|
+
function base2(ALPHABET, name) {
|
|
37829
|
+
if (ALPHABET.length >= 255) {
|
|
37830
|
+
throw new TypeError("Alphabet too long");
|
|
37831
|
+
}
|
|
37832
|
+
var BASE_MAP = new Uint8Array(256);
|
|
37833
|
+
for (var j = 0;j < BASE_MAP.length; j++) {
|
|
37834
|
+
BASE_MAP[j] = 255;
|
|
37835
|
+
}
|
|
37836
|
+
for (var i = 0;i < ALPHABET.length; i++) {
|
|
37837
|
+
var x = ALPHABET.charAt(i);
|
|
37838
|
+
var xc = x.charCodeAt(0);
|
|
37839
|
+
if (BASE_MAP[xc] !== 255) {
|
|
37840
|
+
throw new TypeError(x + " is ambiguous");
|
|
37841
|
+
}
|
|
37842
|
+
BASE_MAP[xc] = i;
|
|
37843
|
+
}
|
|
37844
|
+
var BASE = ALPHABET.length;
|
|
37845
|
+
var LEADER = ALPHABET.charAt(0);
|
|
37846
|
+
var FACTOR = Math.log(BASE) / Math.log(256);
|
|
37847
|
+
var iFACTOR = Math.log(256) / Math.log(BASE);
|
|
37848
|
+
function encode6(source) {
|
|
37849
|
+
if (source instanceof Uint8Array)
|
|
37850
|
+
;
|
|
37851
|
+
else if (ArrayBuffer.isView(source)) {
|
|
37852
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
37853
|
+
} else if (Array.isArray(source)) {
|
|
37854
|
+
source = Uint8Array.from(source);
|
|
37855
|
+
}
|
|
37856
|
+
if (!(source instanceof Uint8Array)) {
|
|
37857
|
+
throw new TypeError("Expected Uint8Array");
|
|
37858
|
+
}
|
|
37859
|
+
if (source.length === 0) {
|
|
37860
|
+
return "";
|
|
37861
|
+
}
|
|
37862
|
+
var zeroes = 0;
|
|
37863
|
+
var length2 = 0;
|
|
37864
|
+
var pbegin = 0;
|
|
37865
|
+
var pend = source.length;
|
|
37866
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
37867
|
+
pbegin++;
|
|
37868
|
+
zeroes++;
|
|
37869
|
+
}
|
|
37870
|
+
var size = (pend - pbegin) * iFACTOR + 1 >>> 0;
|
|
37871
|
+
var b58 = new Uint8Array(size);
|
|
37872
|
+
while (pbegin !== pend) {
|
|
37873
|
+
var carry = source[pbegin];
|
|
37874
|
+
var i2 = 0;
|
|
37875
|
+
for (var it1 = size - 1;(carry !== 0 || i2 < length2) && it1 !== -1; it1--, i2++) {
|
|
37876
|
+
carry += 256 * b58[it1] >>> 0;
|
|
37877
|
+
b58[it1] = carry % BASE >>> 0;
|
|
37878
|
+
carry = carry / BASE >>> 0;
|
|
37879
|
+
}
|
|
37880
|
+
if (carry !== 0) {
|
|
37881
|
+
throw new Error("Non-zero carry");
|
|
37882
|
+
}
|
|
37883
|
+
length2 = i2;
|
|
37884
|
+
pbegin++;
|
|
37885
|
+
}
|
|
37886
|
+
var it2 = size - length2;
|
|
37887
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
37888
|
+
it2++;
|
|
37889
|
+
}
|
|
37890
|
+
var str = LEADER.repeat(zeroes);
|
|
37891
|
+
for (;it2 < size; ++it2) {
|
|
37892
|
+
str += ALPHABET.charAt(b58[it2]);
|
|
37893
|
+
}
|
|
37894
|
+
return str;
|
|
37895
|
+
}
|
|
37896
|
+
function decodeUnsafe(source) {
|
|
37897
|
+
if (typeof source !== "string") {
|
|
37898
|
+
throw new TypeError("Expected String");
|
|
37899
|
+
}
|
|
37900
|
+
if (source.length === 0) {
|
|
37901
|
+
return new Uint8Array;
|
|
37902
|
+
}
|
|
37903
|
+
var psz = 0;
|
|
37904
|
+
if (source[psz] === " ") {
|
|
37905
|
+
return;
|
|
37906
|
+
}
|
|
37907
|
+
var zeroes = 0;
|
|
37908
|
+
var length2 = 0;
|
|
37909
|
+
while (source[psz] === LEADER) {
|
|
37910
|
+
zeroes++;
|
|
37911
|
+
psz++;
|
|
37912
|
+
}
|
|
37913
|
+
var size = (source.length - psz) * FACTOR + 1 >>> 0;
|
|
37914
|
+
var b256 = new Uint8Array(size);
|
|
37915
|
+
while (source[psz]) {
|
|
37916
|
+
var carry = BASE_MAP[source.charCodeAt(psz)];
|
|
37917
|
+
if (carry === 255) {
|
|
37918
|
+
return;
|
|
37919
|
+
}
|
|
37920
|
+
var i2 = 0;
|
|
37921
|
+
for (var it3 = size - 1;(carry !== 0 || i2 < length2) && it3 !== -1; it3--, i2++) {
|
|
37922
|
+
carry += BASE * b256[it3] >>> 0;
|
|
37923
|
+
b256[it3] = carry % 256 >>> 0;
|
|
37924
|
+
carry = carry / 256 >>> 0;
|
|
37925
|
+
}
|
|
37926
|
+
if (carry !== 0) {
|
|
37927
|
+
throw new Error("Non-zero carry");
|
|
37928
|
+
}
|
|
37929
|
+
length2 = i2;
|
|
37930
|
+
psz++;
|
|
37931
|
+
}
|
|
37932
|
+
if (source[psz] === " ") {
|
|
37933
|
+
return;
|
|
37934
|
+
}
|
|
37935
|
+
var it4 = size - length2;
|
|
37936
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
37937
|
+
it4++;
|
|
37938
|
+
}
|
|
37939
|
+
var vch = new Uint8Array(zeroes + (size - it4));
|
|
37940
|
+
var j2 = zeroes;
|
|
37941
|
+
while (it4 !== size) {
|
|
37942
|
+
vch[j2++] = b256[it4++];
|
|
37943
|
+
}
|
|
37944
|
+
return vch;
|
|
37945
|
+
}
|
|
37946
|
+
function decode6(string) {
|
|
37947
|
+
var buffer2 = decodeUnsafe(string);
|
|
37948
|
+
if (buffer2) {
|
|
37949
|
+
return buffer2;
|
|
37950
|
+
}
|
|
37951
|
+
throw new Error(`Non-${name} character`);
|
|
37952
|
+
}
|
|
37953
|
+
return {
|
|
37954
|
+
encode: encode6,
|
|
37955
|
+
decodeUnsafe,
|
|
37956
|
+
decode: decode6
|
|
37957
|
+
};
|
|
37958
|
+
}
|
|
37959
|
+
var src2 = base2;
|
|
37960
|
+
var _brrp__multiformats_scope_baseX2 = src2;
|
|
37961
|
+
var base_x_default2 = _brrp__multiformats_scope_baseX2;
|
|
37962
|
+
|
|
37963
|
+
// node_modules/multiformats/dist/src/bases/base.js
|
|
37964
|
+
class Encoder2 {
|
|
37965
|
+
name;
|
|
37966
|
+
prefix;
|
|
37967
|
+
baseEncode;
|
|
37968
|
+
constructor(name, prefix, baseEncode) {
|
|
37969
|
+
this.name = name;
|
|
37970
|
+
this.prefix = prefix;
|
|
37971
|
+
this.baseEncode = baseEncode;
|
|
37972
|
+
}
|
|
37973
|
+
encode(bytes) {
|
|
37974
|
+
if (bytes instanceof Uint8Array) {
|
|
37975
|
+
return `${this.prefix}${this.baseEncode(bytes)}`;
|
|
37976
|
+
} else {
|
|
37977
|
+
throw Error("Unknown type, must be binary type");
|
|
37978
|
+
}
|
|
37979
|
+
}
|
|
37980
|
+
}
|
|
37981
|
+
|
|
37982
|
+
class Decoder2 {
|
|
37983
|
+
name;
|
|
37984
|
+
prefix;
|
|
37985
|
+
baseDecode;
|
|
37986
|
+
prefixCodePoint;
|
|
37987
|
+
constructor(name, prefix, baseDecode) {
|
|
37988
|
+
this.name = name;
|
|
37989
|
+
this.prefix = prefix;
|
|
37990
|
+
const prefixCodePoint = prefix.codePointAt(0);
|
|
37991
|
+
if (prefixCodePoint === undefined) {
|
|
37992
|
+
throw new Error("Invalid prefix character");
|
|
37993
|
+
}
|
|
37994
|
+
this.prefixCodePoint = prefixCodePoint;
|
|
37995
|
+
this.baseDecode = baseDecode;
|
|
37996
|
+
}
|
|
37997
|
+
decode(text) {
|
|
37998
|
+
if (typeof text === "string") {
|
|
37999
|
+
if (text.codePointAt(0) !== this.prefixCodePoint) {
|
|
38000
|
+
throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);
|
|
38001
|
+
}
|
|
38002
|
+
return this.baseDecode(text.slice(this.prefix.length));
|
|
38003
|
+
} else {
|
|
38004
|
+
throw Error("Can only multibase decode strings");
|
|
38005
|
+
}
|
|
38006
|
+
}
|
|
38007
|
+
or(decoder) {
|
|
38008
|
+
return or2(this, decoder);
|
|
38009
|
+
}
|
|
38010
|
+
}
|
|
38011
|
+
|
|
38012
|
+
class ComposedDecoder2 {
|
|
38013
|
+
decoders;
|
|
38014
|
+
constructor(decoders) {
|
|
38015
|
+
this.decoders = decoders;
|
|
38016
|
+
}
|
|
38017
|
+
or(decoder) {
|
|
38018
|
+
return or2(this, decoder);
|
|
38019
|
+
}
|
|
38020
|
+
decode(input) {
|
|
38021
|
+
const prefix = input[0];
|
|
38022
|
+
const decoder = this.decoders[prefix];
|
|
38023
|
+
if (decoder != null) {
|
|
38024
|
+
return decoder.decode(input);
|
|
38025
|
+
} else {
|
|
38026
|
+
throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`);
|
|
38027
|
+
}
|
|
38028
|
+
}
|
|
38029
|
+
}
|
|
38030
|
+
function or2(left, right) {
|
|
38031
|
+
return new ComposedDecoder2({
|
|
38032
|
+
...left.decoders ?? { [left.prefix]: left },
|
|
38033
|
+
...right.decoders ?? { [right.prefix]: right }
|
|
38034
|
+
});
|
|
38035
|
+
}
|
|
38036
|
+
|
|
38037
|
+
class Codec2 {
|
|
38038
|
+
name;
|
|
38039
|
+
prefix;
|
|
38040
|
+
baseEncode;
|
|
38041
|
+
baseDecode;
|
|
38042
|
+
encoder;
|
|
38043
|
+
decoder;
|
|
38044
|
+
constructor(name, prefix, baseEncode, baseDecode) {
|
|
38045
|
+
this.name = name;
|
|
38046
|
+
this.prefix = prefix;
|
|
38047
|
+
this.baseEncode = baseEncode;
|
|
38048
|
+
this.baseDecode = baseDecode;
|
|
38049
|
+
this.encoder = new Encoder2(name, prefix, baseEncode);
|
|
38050
|
+
this.decoder = new Decoder2(name, prefix, baseDecode);
|
|
38051
|
+
}
|
|
38052
|
+
encode(input) {
|
|
38053
|
+
return this.encoder.encode(input);
|
|
38054
|
+
}
|
|
38055
|
+
decode(input) {
|
|
38056
|
+
return this.decoder.decode(input);
|
|
38057
|
+
}
|
|
38058
|
+
}
|
|
38059
|
+
function from2({ name, prefix, encode: encode6, decode: decode6 }) {
|
|
38060
|
+
return new Codec2(name, prefix, encode6, decode6);
|
|
38061
|
+
}
|
|
38062
|
+
function baseX2({ name, prefix, alphabet }) {
|
|
38063
|
+
const { encode: encode6, decode: decode6 } = base_x_default2(alphabet, name);
|
|
38064
|
+
return from2({
|
|
38065
|
+
prefix,
|
|
38066
|
+
name,
|
|
38067
|
+
encode: encode6,
|
|
38068
|
+
decode: (text) => coerce2(decode6(text))
|
|
38069
|
+
});
|
|
38070
|
+
}
|
|
38071
|
+
|
|
38072
|
+
// node_modules/multiformats/dist/src/bases/base58.js
|
|
38073
|
+
var base58btc2 = baseX2({
|
|
38074
|
+
name: "base58btc",
|
|
38075
|
+
prefix: "z",
|
|
38076
|
+
alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
|
38077
|
+
});
|
|
38078
|
+
var base58flickr2 = baseX2({
|
|
38079
|
+
name: "base58flickr",
|
|
38080
|
+
prefix: "Z",
|
|
38081
|
+
alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
|
|
38082
|
+
});
|
|
38083
|
+
|
|
37813
38084
|
// ../../../node_modules/@noble/ed25519/index.js
|
|
37814
38085
|
/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
|
|
37815
38086
|
var ed25519_CURVE2 = {
|
|
@@ -38642,7 +38913,7 @@ function deriveKeyPairFromMnemonic(mnemonic, passphrase = "") {
|
|
|
38642
38913
|
...ED25519_MULTICODEC_PREFIX,
|
|
38643
38914
|
...publicKey
|
|
38644
38915
|
]);
|
|
38645
|
-
const accountId =
|
|
38916
|
+
const accountId = base58btc2.encode(publicKeyWithPrefix);
|
|
38646
38917
|
return {
|
|
38647
38918
|
privateKey,
|
|
38648
38919
|
publicKey,
|
|
@@ -38799,7 +39070,7 @@ function registerKeyCommands(program2) {
|
|
|
38799
39070
|
|
|
38800
39071
|
// src/index.ts
|
|
38801
39072
|
var program2 = new Command;
|
|
38802
|
-
program2.name("seed").description("CLI for Seed Hypermedia").version("0.1.0").option("-s, --server <url>", "Server URL", process.env.SEED_SERVER || "https://
|
|
39073
|
+
program2.name("seed").description("CLI for Seed Hypermedia").version("0.1.0").option("-s, --server <url>", "Server URL", process.env.SEED_SERVER || "https://hyper.media").option("--json", "JSON output (default)").option("--yaml", "YAML output").option("--pretty", "Pretty formatted output").option("-q, --quiet", "Minimal output");
|
|
38803
39074
|
function getOutputFormat(options) {
|
|
38804
39075
|
if (options.yaml)
|
|
38805
39076
|
return "yaml";
|