@seed-hypermedia/client 0.0.90 → 0.0.91
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/auto-link.mjs +3 -3
- package/dist/blocks-to-markdown.mjs +2 -2
- package/dist/capability.mjs +2 -2
- package/dist/{chunk-VNZHLLJE.mjs → chunk-2X45222K.mjs} +3 -1
- package/dist/{chunk-T7WF36LU.mjs → chunk-5H44WPFO.mjs} +1 -1
- package/dist/{chunk-Z72PGJKG.mjs → chunk-5ZHBEPRC.mjs} +1 -1
- package/dist/{chunk-4HP5N4I7.mjs → chunk-6FBJVBS6.mjs} +3 -3
- package/dist/{chunk-HNQDRHGQ.mjs → chunk-EBGUVS7T.mjs} +2 -2
- package/dist/{chunk-W7AGZEC2.mjs → chunk-GOKN5MFV.mjs} +1 -1
- package/dist/{chunk-RRXP7SCF.mjs → chunk-HMTFZNX7.mjs} +1 -1
- package/dist/{chunk-UFLGAJWJ.mjs → chunk-IS7QPOMQ.mjs} +3 -3
- package/dist/chunk-JSNDXUPG.mjs +407 -0
- package/dist/{chunk-XXUI3VKA.mjs → chunk-LZOORGGJ.mjs} +1 -1
- package/dist/{chunk-UTZ42CJC.mjs → chunk-OIL62HNH.mjs} +1 -1
- package/dist/{chunk-ZNV6NTUU.mjs → chunk-P5R4E4AU.mjs} +1 -1
- package/dist/{chunk-XB6E7EVC.mjs → chunk-QVRJGK77.mjs} +1 -1
- package/dist/{chunk-JODNNMBZ.mjs → chunk-RPXAWYOC.mjs} +1 -1
- package/dist/chunk-TZMLZHCZ.mjs +230 -0
- package/dist/{chunk-Z2S7TL5U.mjs → chunk-UQL3R7WC.mjs} +1 -1
- package/dist/chunk-VWSAFDOL.mjs +110 -0
- package/dist/chunk-ZWKMAGDU.mjs +10 -0
- package/dist/client.mjs +2 -2
- package/dist/comment.mjs +2 -2
- package/dist/dag-json.d.ts +52 -0
- package/dist/dag-json.mjs +23 -0
- package/dist/document-state.mjs +2 -2
- package/dist/editorblock-to-hmblock.mjs +2 -2
- package/dist/hm-resolver.mjs +2 -2
- package/dist/hm-types.d.ts +541 -0
- package/dist/hm-types.mjs +1 -1
- package/dist/hmblock-to-editorblock.mjs +2 -2
- package/dist/index.mjs +27 -27
- package/dist/markdown-to-blocks.mjs +1 -1
- package/dist/pdf-to-blocks.mjs +3 -3
- package/dist/resource-read.mjs +4 -4
- package/dist/schema-engine.d.ts +127 -0
- package/dist/schema-engine.mjs +83 -0
- package/dist/schema-registry.generated.d.ts +8 -0
- package/dist/schema-registry.generated.mjs +11 -0
- package/dist/schema-resolve.d.ts +135 -0
- package/dist/schema-resolve.mjs +45 -0
- package/dist/schema-subtypes.d.ts +36 -0
- package/dist/schema-subtypes.mjs +94 -0
- package/dist/schema-types.generated.d.ts +1598 -0
- package/dist/schema-types.generated.mjs +0 -0
- package/dist/signed-blob.d.ts +63 -0
- package/dist/signed-blob.mjs +123 -0
- package/dist/tei-to-blocks.mjs +2 -2
- package/dist/unicode.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import {
|
|
2
|
+
STRUCT_URL,
|
|
3
|
+
fieldSchema,
|
|
4
|
+
fieldsToProperties,
|
|
5
|
+
isLiteralSchema,
|
|
6
|
+
loadFrom,
|
|
7
|
+
refToName,
|
|
8
|
+
resolveSchema,
|
|
9
|
+
schemaCid,
|
|
10
|
+
schemaForCid,
|
|
11
|
+
structFields,
|
|
12
|
+
validate
|
|
13
|
+
} from "./chunk-JSNDXUPG.mjs";
|
|
14
|
+
import {
|
|
15
|
+
HM_SCHEMAS
|
|
16
|
+
} from "./chunk-ZWKMAGDU.mjs";
|
|
17
|
+
import {
|
|
18
|
+
parseCidString
|
|
19
|
+
} from "./chunk-VWSAFDOL.mjs";
|
|
20
|
+
import {
|
|
21
|
+
packHmId,
|
|
22
|
+
unpackHmId
|
|
23
|
+
} from "./chunk-2X45222K.mjs";
|
|
24
|
+
|
|
25
|
+
// src/schema-resolve.ts
|
|
26
|
+
var DAG_CBOR_CODE = 113;
|
|
27
|
+
function bareCid(ref) {
|
|
28
|
+
var _a;
|
|
29
|
+
const cid = ref.replace(/^ipfs:\/\//i, "").split("/")[0] ?? "";
|
|
30
|
+
return ((_a = parseCidString(cid)) == null ? void 0 : _a.code) === DAG_CBOR_CODE ? cid : null;
|
|
31
|
+
}
|
|
32
|
+
function classifyRef(ref) {
|
|
33
|
+
var _a;
|
|
34
|
+
let s = typeof ref === "string" ? ref.trim() : "";
|
|
35
|
+
if (!s) return { kind: "none" };
|
|
36
|
+
if (!s.startsWith("hm://")) {
|
|
37
|
+
const cid = bareCid(s);
|
|
38
|
+
if (cid) return { kind: "cid", cid };
|
|
39
|
+
const id = unpackHmId(s);
|
|
40
|
+
if (!id) return { kind: "none" };
|
|
41
|
+
s = `hm://${id.uid}${((_a = id.path) == null ? void 0 : _a.length) ? `/${id.path.join("/")}` : ""}`;
|
|
42
|
+
}
|
|
43
|
+
const name = refToName(s);
|
|
44
|
+
return HM_SCHEMAS[name] ? { kind: "hm-bundled", name } : { kind: "hm-doc", url: s };
|
|
45
|
+
}
|
|
46
|
+
function metadataSchemaOf(schema, reg = {}) {
|
|
47
|
+
if (!schema) return void 0;
|
|
48
|
+
return resolveSchema(schema, {}, reg).schema;
|
|
49
|
+
}
|
|
50
|
+
function schemaDefinitionCid(metadata) {
|
|
51
|
+
const value = metadata == null ? void 0 : metadata.schemaDefinition;
|
|
52
|
+
return typeof value === "string" ? bareCid(value) : null;
|
|
53
|
+
}
|
|
54
|
+
async function fetchSchemaBlob(client, cid) {
|
|
55
|
+
const bundled = schemaForCid(cid);
|
|
56
|
+
if (bundled) return bundled;
|
|
57
|
+
const result = await client.request("GetCID", { cid });
|
|
58
|
+
const value = withoutSchemaLink(result == null ? void 0 : result.value);
|
|
59
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
60
|
+
}
|
|
61
|
+
function documentMetadataSchema(typeMetadataSchema, extraProps = {}, registry = {}) {
|
|
62
|
+
const base = resolveSchema(HM_SCHEMAS["metadata"]).schema;
|
|
63
|
+
const doc = typeMetadataSchema ? resolveSchema(typeMetadataSchema, {}, registry).schema : {};
|
|
64
|
+
const byName = /* @__PURE__ */ new Map();
|
|
65
|
+
for (const f of structFields(base)) byName.set(f.name, f);
|
|
66
|
+
for (const f of structFields(doc)) byName.set(f.name, f);
|
|
67
|
+
for (const [name, schema] of Object.entries(extraProps)) byName.set(name, { name, schema, required: false });
|
|
68
|
+
return { type: STRUCT_URL, properties: fieldsToProperties(Array.from(byName.values())), values: {} };
|
|
69
|
+
}
|
|
70
|
+
async function resolveSchemaRef(client, ref) {
|
|
71
|
+
const cls = classifyRef(ref);
|
|
72
|
+
if (cls.kind === "none") return { kind: "none" };
|
|
73
|
+
if (cls.kind === "hm-bundled") return { kind: cls.kind, schema: HM_SCHEMAS[cls.name], cid: schemaCid(cls.name) };
|
|
74
|
+
if (cls.kind === "cid") {
|
|
75
|
+
const schema2 = await fetchSchemaBlob(client, cls.cid).catch(() => void 0);
|
|
76
|
+
return { kind: cls.kind, schema: schema2, cid: schema2 ? cls.cid : void 0 };
|
|
77
|
+
}
|
|
78
|
+
const id = unpackHmId(cls.url);
|
|
79
|
+
if (!id) return { kind: "none" };
|
|
80
|
+
const resource = await client.request("Resource", id).catch(() => void 0);
|
|
81
|
+
const cid = (resource == null ? void 0 : resource.type) === "document" ? schemaDefinitionCid(resource.document.metadata) : null;
|
|
82
|
+
if (!cid) return { kind: cls.kind, documentUrl: cls.url };
|
|
83
|
+
const schema = await fetchSchemaBlob(client, cid).catch(() => void 0);
|
|
84
|
+
return { kind: cls.kind, schema, cid: schema ? cid : void 0, documentUrl: cls.url };
|
|
85
|
+
}
|
|
86
|
+
function referencesOf(schema, out = []) {
|
|
87
|
+
if (!schema || typeof schema !== "object") return out;
|
|
88
|
+
if (Array.isArray(schema)) {
|
|
89
|
+
for (const s of schema) referencesOf(s, out);
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
const node = schema;
|
|
93
|
+
for (const [key, value] of Object.entries(node)) {
|
|
94
|
+
if ((key === "ref" || key === "type") && typeof value === "string") out.push(value);
|
|
95
|
+
else if (key === "description" || key === "target" || key === "format" || key === "value") {
|
|
96
|
+
if (key === "value" && value && typeof value === "object") referencesOf(value, out);
|
|
97
|
+
} else if (value && typeof value === "object") referencesOf(value, out);
|
|
98
|
+
}
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
function externalSchemaRefs(schema) {
|
|
102
|
+
const out = [];
|
|
103
|
+
for (const ref of referencesOf(schema)) {
|
|
104
|
+
if (!/^(hm|ipfs):\/\//.test(ref) || out.includes(ref) || loadFrom({}, ref)) continue;
|
|
105
|
+
out.push(ref);
|
|
106
|
+
}
|
|
107
|
+
return out;
|
|
108
|
+
}
|
|
109
|
+
async function hydrateSchemaRegistry(client, schema, registry = {}) {
|
|
110
|
+
const pending = [schema];
|
|
111
|
+
const seen = /* @__PURE__ */ new Set();
|
|
112
|
+
while (pending.length) {
|
|
113
|
+
const next = pending.pop();
|
|
114
|
+
if (!next) continue;
|
|
115
|
+
for (const ref of referencesOf(next)) {
|
|
116
|
+
if (!/^(hm|ipfs):\/\//.test(ref) || seen.has(ref)) continue;
|
|
117
|
+
seen.add(ref);
|
|
118
|
+
if (loadFrom(registry, ref)) continue;
|
|
119
|
+
const resolved = await resolveSchemaRef(client, ref);
|
|
120
|
+
if (!resolved.schema) continue;
|
|
121
|
+
registry[refToName(ref)] = resolved.schema;
|
|
122
|
+
pending.push(resolved.schema);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return registry;
|
|
126
|
+
}
|
|
127
|
+
async function effectiveSchemaRef(client, id, metadata) {
|
|
128
|
+
var _a;
|
|
129
|
+
const own = metadata == null ? void 0 : metadata.attributesSchema;
|
|
130
|
+
if (typeof own === "string" && own) return { ref: own, source: "own" };
|
|
131
|
+
if (!id.path || id.path.length === 0) return { ref: null, source: "none" };
|
|
132
|
+
const parentPath = id.path.slice(0, -1);
|
|
133
|
+
const parentId = unpackHmId(`hm://${id.uid}${parentPath.length ? "/" + parentPath.join("/") : ""}`);
|
|
134
|
+
if (!parentId) return { ref: null, source: "none" };
|
|
135
|
+
const parent = await client.request("Resource", parentId).catch(() => void 0);
|
|
136
|
+
const inherited = (parent == null ? void 0 : parent.type) === "document" ? (_a = parent.document.metadata) == null ? void 0 : _a.childAttributesSchema : null;
|
|
137
|
+
return typeof inherited === "string" && inherited ? { ref: inherited, source: "inherited" } : { ref: null, source: "none" };
|
|
138
|
+
}
|
|
139
|
+
var documentUrlOf = (id) => packHmId(id);
|
|
140
|
+
var isFixedLiteral = (schema) => schema !== void 0 && isLiteralSchema(schema);
|
|
141
|
+
async function loadSchemaRef(client, ref) {
|
|
142
|
+
if (typeof ref !== "string") {
|
|
143
|
+
if (!ref || typeof ref !== "object" || Array.isArray(ref)) throw new Error("A schema must be a map");
|
|
144
|
+
return { schema: ref, registry: await hydrateSchemaRegistry(client, ref, {}) };
|
|
145
|
+
}
|
|
146
|
+
if (HM_SCHEMAS[ref]) return { schema: HM_SCHEMAS[ref], cid: schemaCid(ref), registry: {} };
|
|
147
|
+
const resolved = await resolveSchemaRef(client, ref);
|
|
148
|
+
if (resolved.kind === "none")
|
|
149
|
+
throw new Error(`Not a schema reference: ${ref} (expected an ipfs:// CID or an hm:// URL)`);
|
|
150
|
+
if (!resolved.schema) {
|
|
151
|
+
if (resolved.kind === "hm-doc")
|
|
152
|
+
throw new Error(
|
|
153
|
+
`${ref} does not define a schema (no schemaDefinition on the document, or the document was not found)`
|
|
154
|
+
);
|
|
155
|
+
throw new Error(`Could not fetch the schema at ${ref}`);
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
schema: resolved.schema,
|
|
159
|
+
cid: resolved.cid,
|
|
160
|
+
registry: await hydrateSchemaRegistry(client, resolved.schema, {})
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
async function checkDocumentSchema(client, id, metadata, content) {
|
|
164
|
+
const effective = await effectiveSchemaRef(client, id, metadata).catch(() => ({ ref: null, source: "none" }));
|
|
165
|
+
if (!effective.ref || effective.source === "none") {
|
|
166
|
+
return { schema: null, via: "none", required: [], missing: [], violations: [] };
|
|
167
|
+
}
|
|
168
|
+
const base = { schema: effective.ref, via: effective.source };
|
|
169
|
+
let loaded;
|
|
170
|
+
try {
|
|
171
|
+
loaded = await loadSchemaRef(client, effective.ref);
|
|
172
|
+
} catch (error) {
|
|
173
|
+
return { ...base, required: [], missing: [], violations: [], error: error.message };
|
|
174
|
+
}
|
|
175
|
+
const metadataSchema = documentMetadataSchema(metadataSchemaOf(loaded.schema, loaded.registry), {}, loaded.registry);
|
|
176
|
+
const required = structFields(metadataSchema).filter((f) => f.required).map((f) => f.name);
|
|
177
|
+
const present = metadata ?? {};
|
|
178
|
+
const missing = required.filter((name) => !(name in present));
|
|
179
|
+
const violations = validate(metadataSchema, present, "$.metadata", {}, loaded.registry);
|
|
180
|
+
if (content !== void 0) {
|
|
181
|
+
const contentSchema = fieldSchema(resolveSchema(HM_SCHEMAS["document"]).schema, "content");
|
|
182
|
+
if (contentSchema) violations.push(...validate(contentSchema, content, "$.content", {}, loaded.registry));
|
|
183
|
+
}
|
|
184
|
+
return { ...base, required, missing, violations };
|
|
185
|
+
}
|
|
186
|
+
var isPlainMap = (value) => !!value && typeof value === "object" && !Array.isArray(value) && !("/" in value);
|
|
187
|
+
function blobSchemaRef(value) {
|
|
188
|
+
if (!isPlainMap(value)) return null;
|
|
189
|
+
const link = value.schema;
|
|
190
|
+
if (typeof link === "string") return link;
|
|
191
|
+
if (link && typeof link === "object" && typeof link["/"] === "string") {
|
|
192
|
+
return `ipfs://${link["/"]}`;
|
|
193
|
+
}
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
function withoutSchemaLink(value) {
|
|
197
|
+
if (!isPlainMap(value) || blobSchemaRef(value) === null) return value;
|
|
198
|
+
const { schema: _link, ...rest } = value;
|
|
199
|
+
return rest;
|
|
200
|
+
}
|
|
201
|
+
async function checkSchemaDefinition(client, ref) {
|
|
202
|
+
const meta = HM_SCHEMAS["schema"];
|
|
203
|
+
try {
|
|
204
|
+
const loaded = await loadSchemaRef(client, ref);
|
|
205
|
+
return validate(meta, loaded.schema, "$", {}, loaded.registry);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
return [error.message];
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export {
|
|
212
|
+
bareCid,
|
|
213
|
+
classifyRef,
|
|
214
|
+
metadataSchemaOf,
|
|
215
|
+
schemaDefinitionCid,
|
|
216
|
+
fetchSchemaBlob,
|
|
217
|
+
documentMetadataSchema,
|
|
218
|
+
resolveSchemaRef,
|
|
219
|
+
externalSchemaRefs,
|
|
220
|
+
hydrateSchemaRegistry,
|
|
221
|
+
effectiveSchemaRef,
|
|
222
|
+
documentUrlOf,
|
|
223
|
+
isFixedLiteral,
|
|
224
|
+
loadSchemaRef,
|
|
225
|
+
checkDocumentSchema,
|
|
226
|
+
isPlainMap,
|
|
227
|
+
blobSchemaRef,
|
|
228
|
+
withoutSchemaLink,
|
|
229
|
+
checkSchemaDefinition
|
|
230
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// src/dag-json.ts
|
|
2
|
+
import { CID } from "multiformats/cid";
|
|
3
|
+
function isRecord(value) {
|
|
4
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
5
|
+
}
|
|
6
|
+
function isDagJsonLink(value) {
|
|
7
|
+
return isRecord(value) && Object.keys(value).length === 1 && typeof value["/"] === "string";
|
|
8
|
+
}
|
|
9
|
+
function isDagJsonBytes(value) {
|
|
10
|
+
if (!isRecord(value) || Object.keys(value).length !== 1) return false;
|
|
11
|
+
const slash = value["/"];
|
|
12
|
+
return isRecord(slash) && Object.keys(slash).length === 1 && typeof slash.bytes === "string";
|
|
13
|
+
}
|
|
14
|
+
function parseCidString(text) {
|
|
15
|
+
try {
|
|
16
|
+
return CID.parse(text.trim());
|
|
17
|
+
} catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function base64ToBytes(b64) {
|
|
22
|
+
const normalized = b64.replace(/\s+/g, "");
|
|
23
|
+
const padded = normalized + "=".repeat((4 - normalized.length % 4) % 4);
|
|
24
|
+
const binary = atob(padded);
|
|
25
|
+
const bytes = new Uint8Array(binary.length);
|
|
26
|
+
for (let i = 0; i < binary.length; i++) {
|
|
27
|
+
bytes[i] = binary.charCodeAt(i);
|
|
28
|
+
}
|
|
29
|
+
return bytes;
|
|
30
|
+
}
|
|
31
|
+
function bytesToBase64(bytes) {
|
|
32
|
+
let binary = "";
|
|
33
|
+
const chunkSize = 32768;
|
|
34
|
+
for (let i = 0; i < bytes.length; i += chunkSize) {
|
|
35
|
+
binary += String.fromCharCode.apply(null, Array.from(bytes.subarray(i, i + chunkSize)));
|
|
36
|
+
}
|
|
37
|
+
return btoa(binary).replace(/=+$/, "");
|
|
38
|
+
}
|
|
39
|
+
function formatByteSize(size) {
|
|
40
|
+
if (size < 1024) return `${size} ${size === 1 ? "byte" : "bytes"}`;
|
|
41
|
+
if (size < 1024 * 1024) return `${(size / 1024).toFixed(1)} KB`;
|
|
42
|
+
return `${(size / (1024 * 1024)).toFixed(1)} MB`;
|
|
43
|
+
}
|
|
44
|
+
var SEED_INDEXED_TYPE_NAMES = ["Comment", "Change", "Ref", "Capability", "Contact", "Profile"];
|
|
45
|
+
var utf8Encoder = new TextEncoder();
|
|
46
|
+
function cborShortText(text) {
|
|
47
|
+
const body = utf8Encoder.encode(text);
|
|
48
|
+
const bytes = new Uint8Array(body.length + 1);
|
|
49
|
+
bytes[0] = 96 + body.length;
|
|
50
|
+
bytes.set(body, 1);
|
|
51
|
+
return bytes;
|
|
52
|
+
}
|
|
53
|
+
function bytesContain(haystack, needle) {
|
|
54
|
+
outer: for (let i = 0; i + needle.length <= haystack.length; i++) {
|
|
55
|
+
for (let j = 0; j < needle.length; j++) {
|
|
56
|
+
if (haystack[i + j] !== needle[j]) continue outer;
|
|
57
|
+
}
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
function findSeedIndexerCollision(data) {
|
|
63
|
+
const typeKey = cborShortText("type");
|
|
64
|
+
for (const name of SEED_INDEXED_TYPE_NAMES) {
|
|
65
|
+
const value = cborShortText(name);
|
|
66
|
+
const matcher = new Uint8Array(typeKey.length + value.length);
|
|
67
|
+
matcher.set(typeKey, 0);
|
|
68
|
+
matcher.set(value, typeKey.length);
|
|
69
|
+
if (bytesContain(data, matcher)) return name;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function dagJsonToIpld(value) {
|
|
74
|
+
if (isDagJsonLink(value)) {
|
|
75
|
+
const cid = parseCidString(value["/"]);
|
|
76
|
+
if (!cid) throw new Error(`Invalid CID link: ${value["/"]}`);
|
|
77
|
+
return cid;
|
|
78
|
+
}
|
|
79
|
+
if (isDagJsonBytes(value)) {
|
|
80
|
+
return base64ToBytes(value["/"].bytes);
|
|
81
|
+
}
|
|
82
|
+
if (Array.isArray(value)) return value.map(dagJsonToIpld);
|
|
83
|
+
if (isRecord(value)) {
|
|
84
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, dagJsonToIpld(child)]));
|
|
85
|
+
}
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
function ipldToDagJson(value) {
|
|
89
|
+
if (value instanceof Uint8Array) return { "/": { bytes: bytesToBase64(value) } };
|
|
90
|
+
if (value && typeof value === "object" && "asCID" in value && value.asCID) {
|
|
91
|
+
return { "/": value.toString() };
|
|
92
|
+
}
|
|
93
|
+
if (Array.isArray(value)) return value.map(ipldToDagJson);
|
|
94
|
+
if (isRecord(value)) {
|
|
95
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, ipldToDagJson(child)]));
|
|
96
|
+
}
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export {
|
|
101
|
+
isDagJsonLink,
|
|
102
|
+
isDagJsonBytes,
|
|
103
|
+
parseCidString,
|
|
104
|
+
base64ToBytes,
|
|
105
|
+
bytesToBase64,
|
|
106
|
+
formatByteSize,
|
|
107
|
+
findSeedIndexerCollision,
|
|
108
|
+
dagJsonToIpld,
|
|
109
|
+
ipldToDagJson
|
|
110
|
+
};
|