fleekhq / fleek-storage-js Goto Github PK
View Code? Open in Web Editor NEWJS SDK to interact with Fleek Storage
JS SDK to interact with Fleek Storage
I'm attemping to use fleek-storage-js in the browser, to use the upload
function. When I have it imported into my react project, I get an error:
fleek ReferenceError: global is not defined
Has anyone else seen this? any solutions?
Would be great if we can have a way to query pins with dates using the listFiles
method, right now it just has bucket names to filter
If i upload a svg pic with fleekStorgeJS, i can't display it.
However, if i upload a svg pic with Fleek Web App, it goes well.
I figure it might be contentType problem, but i can't custom contentType like what docs said based on the latest version of FleekStorgeJS code.
Hope you can fix this.
at Request.extractError (/home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/services/s3.js:711:35)
at Request.callListeners (/home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/request.js:686:14)
at Request.transition (/home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/request.js:688:12)
at Request.callListeners (/home/prabin/Documents/abc/storage/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
**code: 'AccessDenied',
region: null,
time: 2023-01-30T08:26:18.522Z,
requestId: '173F08B8015F93E4',
extendedRequestId: undefined,
cfId: undefined,
statusCode: 403,
retryable: false,
retryDelay: 39.20758658911196**
}```
I was trying to upload many "objects" to fleek and sometimes I receive this be cause may be request fail.
/Users/ww/git/project-fleek/node_modules/aws-sdk/lib/request.js:31
throw err;
^
Error [TypeError]: Cannot read properties of null (reading 'ETag')
at Request.<anonymous> (/Users/ww/git/project-fleek/node_modules/@fleekhq/fleek-storage-js/utils/upload-file.js:8:21)
at Request.callListeners (/Users/ww/git/project-fleek/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/Users/ww/git/project-fleek/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/Users/ww/git/project-fleek/node_modules/aws-sdk/lib/request.js:686:14)
at Request.transition (/Users/ww/git/project-fleek/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/Users/ww/git/project-fleek/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /Users/ww/git/project-fleek/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/Users/ww/git/project-fleek/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/Users/ww/git/project-fleek/node_modules/aws-sdk/lib/request.js:688:12)
at Request.callListeners (/Users/ww/git/project-fleek/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
code: 'TypeError',
time: 2022-01-12T22:45:58.056Z
}
I don't know really to say. just reporting unexpected error may be
I want to configure my orbit-db with fleek storage so that my orbit-db data get stored on fleek's IPFS and can persist using fleek's pinning service.
my code:
https://github.com/Aiaminm/fake123/blob/main/content/fleekupload.js
When some network error occurs, even using try catch error will cause the program to stop
`/workdir/node_modules/aws-sdk/lib/request.js:31
throw err;
^
Error [TypeError]: Cannot destructure property 'ETag' of 'data' as it is undefined.
at /workdir/node_modules/@fleekhq/fleek-storage-js/utils/stream-upload.js:17:13
at ManagedUpload.callback (/workdir/node_modules/s3-streaming-upload/src/index.js:70:7)
at ManagedUpload.cleanup (/workdir/node_modules/aws-sdk/lib/s3/managed_upload.js:635:10)
at Response. (/workdir/node_modules/aws-sdk/lib/s3/managed_upload.js:572:28)
at Request. (/workdir/node_modules/aws-sdk/lib/request.js:367:18)
at Request.callListeners (/workdir/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/workdir/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/workdir/node_modules/aws-sdk/lib/request.js:686:14)
at Request.transition (/workdir/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/workdir/node_modules/aws-sdk/lib/state_machine.js:14:12) {
code: 'TypeError',
time: 2022-06-23T13:06:11.242Z
}`
Do y'all offer types for typescripts users of the package?
I am using
% node -v
v12.13.0
"svelte": "^3.46.2".
when i add import fleekStorage from '@fleekhq/fleek-storage-js'
it errors with the message
Uncaught ReferenceError: require$$1$4H is not defined
Deploy started at 7:09:11 PM 04/20/2021
7:09:12 PM 04/20/2021: Deploy started
7:09:15 PM 04/20/2021: Docker image: 'fleek/create-react-app'
7:09:15 PM 04/20/2021: Build command: 'yarn && yarn build'
7:09:15 PM 04/20/2021: Triggering build execution...
7:10:14 PM 04/20/2021: yarn install v1.22.5
7:10:14 PM 04/20/2021: [1/4] Resolving packages...
7:10:15 PM 04/20/2021: [2/4] Fetching packages...
7:10:25 PM 04/20/2021: error Command failed.
7:10:25 PM 04/20/2021: Exit code: 128
7:10:25 PM 04/20/2021: Command: git
7:10:25 PM 04/20/2021: Arguments: ls-remote --tags --heads ssh://[email protected]/ethereumjs/ethereumjs-abi.git
7:10:25 PM 04/20/2021: Directory: /workspace
7:10:25 PM 04/20/2021: Output:
7:10:25 PM 04/20/2021: Host key verification failed.
7:10:25 PM 04/20/2021: fatal: Could not read from remote repository.
7:10:25 PM 04/20/2021: Please make sure you have the correct access rights
7:10:25 PM 04/20/2021: and the repository exists.
7:10:25 PM 04/20/2021: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
7:11:15 PM 04/20/2021: Error occured during the build.
At the moment we are storing the GH keys associated to the team which has led to a problem of repositories syncs. We want the users to have their own credentials for GH and not use the teams one.
I've created a folder with a file using the Fleek UI. I'm now trying to list this file programmatically but it's not clear how to use the SDK to do so. When I use the listFiles
function I can see that the top level folder gets returned but I don't see a way to list files within a folder.
Here's an example folder structure:
paymog-team-bucket
\--- test-folder
\--- test-file.txt
Here's an example call to listFiles
const files = await fleekStorage.listFiles({
apiKey: String(yargs['key']),
apiSecret: String(yargs['secret']),
getOptions: [
'bucket',
'key',
'hash',
'publicUrl'
],
})
console.log(files)
This ends up printing
[
{
key: 'test-folder/',
bucket: 'paymog-team-bucket',
hash: 'QmcbEaggdDacn5QxQmXdt4K1eUDpXbx3L9tdHBSkjDR1NS',
publicUrl: 'https://storageapi.fleek.co/paymog-team-bucket/test-folder/'
}
]
How do I recurse into this folder? Is is possible to list files within a folder?
Hi
Have started using fleekstorage and it has worked for a couple of days, but now I am getting an error when i try to call the api:
Inaccessible host: `storageapi.fleek.co' at port `443'. This service may not be available in the `us-east-1' region.
..
code: 'UnknownEndpoint',
region: 'us-east-1',
hostname: 'storageapi.fleek.co',
retryable: true,
originalError: Error: connect EHOSTUNREACH 2606:4700::6812:691:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1237:16) {
errno: -113,
code: 'NetworkingError',
syscall: 'connect',
address: '2606:4700::6812:691',
port: 443,
region: 'us-east-1',
hostname: 'storageapi.fleek.co',
retryable: true,
time: 2022-09-29T09:31:45.287Z
},
time: 2022-09-29T09:31:45.287Z
I am not aware of any changes on my side since it worked. I am on the basic team plan (0.00 USD)
Any suggestions as to why this is happening now.
I get the following warnings when installing the package:
❮❮❮ yarn add @fleekhq/fleek-storage-js
yarn add v1.23.0-20210726.1745
[1/4] 🔍 Resolving packages...
warning @fleekhq/fleek-storage-js > [email protected]: no longer maintained
warning @fleekhq/fleek-storage-js > aws-sdk > [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning @fleekhq/fleek-storage-js > aws-sdk > url > [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning @fleekhq/fleek-storage-js > aws-sdk > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
Are there plans to resolve these warnings?
Very helpful for larger files. Using Fleek to store larger media files, however UX takes a hit when uploading a file that's around 30+MB. I would like to listen to httpUploadProgress
events so that I could show a progress bar client side for visual feedback on the upload status.
I tried getting a similar site but it not working. Please help with the script
del
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.