Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"scripts": {
"dev": "vite",
"start": "vite build && vite preview",
"build": "vite build",
"build": "yarn clean && vite build",
"test": "vitest run --coverage",
"clean": "rimraf dist coverage .wrangler tsconfig.tsbuildinfo",
"add:npmrc": "cp .npmrc.template .npmrc",
"vercel:install": "yarn run add:npmrc && yarn install",
"lint": "eslint .",
Expand All @@ -18,7 +19,7 @@
},
"dependencies": {
"@headlessui/react": "2.2.9",
"@internxt/lib": "1.3.1",
"@internxt/lib": "1.4.1",
"@internxt/sdk": "1.11.12",
"@sentry/react": "10.22.0",
"async": "3.2.6",
Expand Down Expand Up @@ -89,6 +90,7 @@
"lint-staged": "16.2.6",
"postcss": "8.5.6",
"prettier": "3.6.2",
"rimraf": "6.1.0",
"tailwindcss": "4.1.16",
"vite": "7.1.12",
"vite-plugin-bundle-obfuscator": "1.8.0",
Expand Down
70 changes: 0 additions & 70 deletions src/lib/stringUtils.test.ts

This file was deleted.

106 changes: 0 additions & 106 deletions src/lib/stringUtils.ts

This file was deleted.

7 changes: 3 additions & 4 deletions src/services/upload.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { randomBytes } from 'crypto';
import { queue, QueueObject } from 'async';
import { generateMnemonic } from 'bip39';
import axios from 'axios';
import { aes } from '@internxt/lib';
import { aes, stringUtils } from '@internxt/lib';

import { MAX_ITEMS_PER_LINK, MAX_BYTES_PER_SEND } from '../constants';
import { NetworkService } from './network.service';
import { SendItemData } from '../models/SendItem';
import { getCaptchaToken } from '../lib/auth';
import { encodeSendId, generateRandomStringUrlSafe } from '../lib/stringUtils';
import envService from './env.service';

interface FileWithNetworkId extends File {
Expand Down Expand Up @@ -91,7 +90,7 @@ export class UploadService {
const sendLinksFiles = await UploadService.uploadFiles(itemFiles, opts);
const items = [...sendLinksFolders, ...sendLinksFiles];
const randomMnemonic = generateMnemonic(256);
const code = generateRandomStringUrlSafe(8);
const code = stringUtils.generateRandomStringUrlSafe(8);
const encryptedCode = aes.encrypt(code, randomMnemonic);
const encryptedMnemonic = aes.encrypt(randomMnemonic, code);

Expand All @@ -112,7 +111,7 @@ export class UploadService {

const createSendLinkResponse = await UploadService.storeSendLinks(createSendLinksPayload);

const encodedSendId = encodeSendId(createSendLinkResponse.id);
const encodedSendId = stringUtils.encodeV4Uuid(createSendLinkResponse.id);

return `${originUrl}/d/${encodedSendId}/${code}`;
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/DownloadView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { getAllItemsList } from '../services/items.service';
import { ProgressOptions } from '../services/network.service';
import SendBanner from '../components/SendBanner';
import moment from 'moment';
import { decodeSendId } from '../lib/stringUtils';
import { stringUtils } from '@internxt/lib';

export default function DownloadView() {
const [state, setState] = useState<
Expand All @@ -33,7 +33,7 @@ export default function DownloadView() {

const params = useParams();

const sendId = decodeSendId(params.sendId ?? '');
const sendId = stringUtils.decodeV4Uuid(params.sendId ?? '');

const router = useNavigate();

Expand Down
Loading