"use strict";

const Promise = require("bluebird");
const fs = require("fs");
const path = require("path");
const createSession = require("@modular-matrix/create-session");
const uploadFile = require("./");

return Promise.try(() => {
	return createSession("https://pixie.town/", { accessToken: require("../../../private/access-token") });
}).then((session) => {
	return Promise.try(() => {
		return uploadFile(session, {
			filename: "index.js",
			file: fs.createReadStream(path.join(__dirname, "index.js"))
		});
	}).then((result) => {
		console.log(result);
	});
});
