Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

refactor: add each user tag to the tags #82

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/node/bundlr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ export default class NodeBundlr extends Bundlr {
indexFile,
interactivePreflight,
logFunction,
manifestTags,
jshaw-decides marked this conversation as resolved.
Show resolved Hide resolved
}: {
batchSize?: number;
keepDeleted?: boolean;
indexFile?: string;
interactivePreflight?: boolean;
logFunction?: (log: string) => Promise<void>;
manifestTags?: { name: string, value: string }[]
} = {},
): Promise<UploadResponse | undefined> {
return this.uploader.uploadFolder(path, { indexFile, batchSize, interactivePreflight, keepDeleted, logFunction });
return this.uploader.uploadFolder(path, { indexFile, batchSize, interactivePreflight, keepDeleted, logFunction, manifestTags });
}
public static async init(opts: {
url: string;
Expand Down
3 changes: 3 additions & 0 deletions src/node/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ export default class NodeUploader extends Uploader {
indexFile,
interactivePreflight,
logFunction,
manifestTags,
}: {
batchSize: number;
keepDeleted: boolean;
indexFile?: string;
interactivePreflight?: boolean;
logFunction?: (log: string) => Promise<void>;
manifestTags?: { name: string, value: string}[];
} = { batchSize: 10, keepDeleted: true },
): Promise<UploadResponse | undefined> {
path = resolve(path);
Expand Down Expand Up @@ -214,6 +216,7 @@ export default class NodeUploader extends Uploader {
const tags = [
{ name: "Type", value: "manifest" },
{ name: "Content-Type", value: "application/x.arweave-manifest+json" },
...manifestTags || [] // Added the || [] because I was getting a type error
jshaw-decides marked this conversation as resolved.
Show resolved Hide resolved
jshaw-decides marked this conversation as resolved.
Show resolved Hide resolved
];
const mres = await this.uploadData(createReadStream(jsonManifestPath), { tags }).catch((e) => {
throw new Error(`Failed to upload manifest: ${e.message}`);
Expand Down