Skip to content

Commit

Permalink
feat: 🎸 Update ipfs gateway utility calls (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmpinto authored Oct 31, 2024
1 parent 6fc3b63 commit f7c8831
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@fleek-platform/tester": "^2.11.1",
"@fleek-platform/utils-gateways": "^0.1.12",
"@fleek-platform/utils-github": "^0.0.2",
"@fleek-platform/utils-ipfs": "^0.4.2",
"@fleek-platform/utils-ipfs": "^0.4.3",
"@fleek-platform/utils-ipns": "^0.1.12",
"@fleek-platform/utils-validation": "^2.4.0",
"@tsconfig/node16": "^16.1.3",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/commands/ipfs/add.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'node:fs';

import {
getIpfsGatewayUrl,
getFleekXyzIpfsGatewayUrl,
getPrivateIpfsGatewayUrl,
} from '@fleek-platform/utils-ipfs';

Expand Down Expand Up @@ -46,7 +47,7 @@ const addAction: SdkGuardedFunction<AddActionArgs> = async ({ sdk, args }) => {

if (privateGatewayDomains.length === 0) {
output.hint(`${t('getFileFromPubAddr')}:`);
output.link(getIpfsGatewayUrl(hash));
output.link(getFleekXyzIpfsGatewayUrl(hash));

return;
}
Expand Down
12 changes: 6 additions & 6 deletions src/commands/storage/add.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { promises as fs, existsSync } from 'node:fs';
import { existsSync, promises as fs } from 'node:fs';
import { basename } from 'node:path';

import {
getCfIpfsGatewayUrl,
getFleekXyzIpfsGatewayUrl,
getPrivateIpfsGatewayUrl,
} from '@fleek-platform/utils-ipfs';
import cliProgress from 'cli-progress';
import { filesFromPaths } from 'files-from-path';

import { output } from '../../cli';
import type { SdkGuardedFunction } from '../../guards/types';
import { withGuards } from '../../guards/withGuards';
import { t } from '../../utils/translation';
import { getAllActivePrivateGatewayDomains } from '../gateways/utils/getAllPrivateGatewayDomains';
import { uploadStorage } from './utils/upload';

import type { SdkGuardedFunction } from '../../guards/types';
import type { FileLike } from './utils/upload';
import { uploadStorage } from './utils/upload';

type AddStorageActionArgs = {
path: string;
Expand Down Expand Up @@ -73,7 +73,7 @@ export const addStorageAction: SdkGuardedFunction<

if (privateGatewayDomains.length === 0) {
output.log(t('visitViaGateway'));
output.link(getCfIpfsGatewayUrl(hash));
output.link(getFleekXyzIpfsGatewayUrl(hash));

return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/storage/utils/CreateOutputTable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FleekSdk, StoragePin } from '@fleek-platform/sdk/node';
import {
getCfIpfsGatewayUrl,
getFleekXyzIpfsGatewayUrl,
getPrivateIpfsGatewayUrl,
} from '@fleek-platform/utils-ipfs';

Expand Down Expand Up @@ -37,7 +37,7 @@ export const createOutputTable = async ({
hash: s.cid,
}),
)
: [getCfIpfsGatewayUrl(s.cid)];
: [getFleekXyzIpfsGatewayUrl(s.cid)];

return gatewayUrls.map((link) => ({
filename,
Expand Down

0 comments on commit f7c8831

Please sign in to comment.