From 41274582b91d032263f4447a5e4d8c276b12fcb9 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 10 Dec 2023 20:05:57 -0500 Subject: [PATCH] refactor: move upload and download to methods folder --- src/client.ts | 4 ++-- src/{ => methods}/download.ts | 4 ++-- src/{ => methods}/upload.ts | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) rename src/{ => methods}/download.ts (97%) rename src/{ => methods}/upload.ts (97%) diff --git a/src/client.ts b/src/client.ts index f919210..3825e81 100644 --- a/src/client.ts +++ b/src/client.ts @@ -13,8 +13,8 @@ import { uploadSmallFile, uploadSmallFileRequest, uploadLargeFileRequest, -} from "./upload.js"; -import { downloadFile, getCidUrl, getMetadata } from "./download.js"; +} from "./methods/upload.js"; +import { downloadFile, getCidUrl, getMetadata } from "./methods/download.js"; import { defaultPortalUrl, ensureUrl } from "./utils/url.js"; diff --git a/src/download.ts b/src/methods/download.ts similarity index 97% rename from src/download.ts rename to src/methods/download.ts index eb8b17e..df49bd3 100644 --- a/src/download.ts +++ b/src/methods/download.ts @@ -1,7 +1,7 @@ import { ResponseType } from "axios"; -import { S5Client } from "./client.js"; -import { BaseCustomOptions, DEFAULT_BASE_OPTIONS } from "./utils/options.js"; +import { S5Client } from "../client.js"; +import { BaseCustomOptions, DEFAULT_BASE_OPTIONS } from "../utils/options.js"; import path from "path"; /** diff --git a/src/upload.ts b/src/methods/upload.ts similarity index 97% rename from src/upload.ts rename to src/methods/upload.ts index 9bcfbee..265ab71 100644 --- a/src/upload.ts +++ b/src/methods/upload.ts @@ -4,11 +4,11 @@ import { DetailedError, HttpRequest, Upload } from "tus-js-client"; import { blake3 } from "@noble/hashes/blake3"; import { Buffer } from "buffer"; -import { getFileMimeType } from "./utils/file.js"; -import { BaseCustomOptions, DEFAULT_BASE_OPTIONS } from "./utils/options.js"; -import { S5Client } from "./client.js"; -import type { JsonData } from "./utils/types.js"; -import { buildRequestHeaders, buildRequestUrl } from "./request.js"; +import { getFileMimeType } from "../utils/file.js"; +import { BaseCustomOptions, DEFAULT_BASE_OPTIONS } from "../utils/options.js"; +import { S5Client } from "../client.js"; +import type { JsonData } from "../utils/types.js"; +import { buildRequestHeaders, buildRequestUrl } from "../request.js"; import { CID_HASH_TYPES, CID_TYPES } from "@lumeweb/libs5"; /**