import { PixelbinConfig, PixelbinClient } from "@pixelbin/admin";
export default defineComponent({
props: {
pixelbin: {
type: "app",
app: "pixelbin",
}
},
async run({steps, $}) {
// Creates a Pixelbin config using the API Token
const config = new PixelbinConfig({
domain: "https://api.pixelbin.io",
apiSecret: this.pixelbin.$auth.api_token,
integrationPlatform: "@PipedreamHQ/pipedream v0.1",
});
const pixelbin = new PixelbinClient(config);
const getData = async function() {
try {
// list the assets stored on your organization's Pixelbin Storage
const explorer = pixelbin.assets.listFilesPaginator({
onlyFiles: true,
pageSize: 5,
});
if (explorer.hasNext()) {
return await explorer.next();
}
} catch (err) {
console.log(err);
}
};
//Returns list of assets to use in the Pipedream workflow's downstream steps
return await getData();
},
})
Creates a new folder in Pixelbin. See the documentation
Deletes a file from Pixelbin. See the documentation
List all files. See the documentation
Uploads an asset to Pixelbin from a given URL. See the documentation
Upload a file to Pixelbin. See the documentation
Pixelbin uses API keys for authentication. When you connect your Pixelbin account, Pipedream securely stores the keys so you can easily authenticate to Pixelbin APIs in both code and no-code steps.
To retrieve your API Token and Access Key,