diff --git a/dist/app.js b/dist/app.js deleted file mode 100644 index dda1a07..0000000 --- a/dist/app.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -// < Project Heimir by Alex Arbuckle > // -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// import < -const cron = require('node-cron'); -const lxrbckl_1 = require("lxrbckl"); -const archiveManager_1 = __importDefault(require("./src/managers/archiveManager")); -const archiveManagerConfig_1 = __importDefault(require("./src/config/archiveManagerConfig")); -// -(() => __awaiter(void 0, void 0, void 0, function* () { - const archiveHandler = new archiveManager_1.default({ - githubUsers: yield (0, lxrbckl_1.axiosGet)(archiveManagerConfig_1.default.urlGitHubUsers) - }); - const archive = yield archiveHandler.getArchive(); - yield archiveHandler.setArchive({ archive: archive }); - // cron.schedule('0 0 * * *', async () => { - // }); -}))(); diff --git a/dist/src/config/archiveManagerConfig.js b/dist/src/config/archiveManagerConfig.js deleted file mode 100644 index a33ee8a..0000000 --- a/dist/src/config/archiveManagerConfig.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -// import < -Object.defineProperty(exports, "__esModule", { value: true }); -// > -const archiveManagerConfig = { - file: process.env.archiveFile, - owner: process.env.archiveOwner, - token: process.env.octokitToken, - branch: process.env.archiveBranch, - repository: process.env.archiveRepository, - urlGitHubUsers: process.env.urlGitHubUsers -}; -// export < -exports.default = archiveManagerConfig; -// > diff --git a/dist/src/managers/archiveManager.js b/dist/src/managers/archiveManager.js deleted file mode 100644 index a7f3f5e..0000000 --- a/dist/src/managers/archiveManager.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// imports < -const lxrbckl_1 = require("lxrbckl"); -const archiveManagerConfig_1 = __importDefault(require("../config/archiveManagerConfig")); -// > -class archiveManager { - constructor({ githubUsers }) { - this._githubUsers = githubUsers; - this._octokit = new lxrbckl_1.octokit({ - owner: archiveManagerConfig_1.default.owner, - token: archiveManagerConfig_1.default.token - }); - } - setArchive(_a) { - return __awaiter(this, arguments, void 0, function* ({ archive }) { - yield this._octokit.respositorySet({ - data: archive, - file: archiveManagerConfig_1.default.file, - branch: archiveManagerConfig_1.default.branch, - repository: archiveManagerConfig_1.default.repository - }); - }); - } - getArchive() { - return __awaiter(this, void 0, void 0, function* () { - var archive = {}; - for (const u of this._githubUsers) { - const endpointRepos = `GET /users/${u}/repos`; - for (const r of yield this._octokit.request({ endpoint: endpointRepos })) { - const endpointLanguages = `GET /repos/${u}/${r.name}/languages`; - const languages = yield this._octokit.request({ endpoint: endpointLanguages }); - archive[r.name] = { - 'topics': r.topics, - 'owner': r.owner.login, - 'languages': Object.keys(languages), - 'url': `https://github.com/${u}/${r.name}`, - 'description': (r.description).split('.')[0] - }; - } - } - return archive; - }); - } -} -exports.default = archiveManager;