How to use the gitlab/dist/es5.default function in gitlab

To help you get started, we’ve selected a few gitlab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ruslang02 / atomos / apps / official / market / market.js View on Github external
async function login() {
	if (access) {
		try {
			api = new GitLab({
				url: BASE_SERVER,
				oauthToken: access.access_token
			});
			console.log(api);
			currentUser = await api.Users.current();
			await renderUser();
			return;
		} catch (e) {
			console.log("Login using access_token failed. Proceeding with OAuth2", e, access);
		}
	} else
		console.log("First time login. Welcome in!");
	let modal = document.createElement("div");
	modal.dialog = document.createElement("form");
	modal.content = document.createElement("main");
	modal.dialog.className = "modal-dialog modal-dialog-centered";
github GetPublii / Publii / app / back-end / modules / deploy / gitlab-pages.js View on Github external
this.repository = this.deployment.siteConfig.deployment.gitlab.repo;
        this.user = this.deployment.siteConfig.deployment.gitlab.user;
        this.branch = this.deployment.siteConfig.deployment.gitlab.branch;
        this.remoteFilesList = [];
        this.filesToRemove = [];
        this.filesToUpdate = [];
        this.filesToUpload = [];
        this.waitForTimeout = true;
        let token = this.deployment.siteConfig.deployment.gitlab.token;
        let account = slug(this.deployment.siteConfig.name);

        if (token === 'publii-gl-token ' + account) {
            token = await passwordSafeStorage.getPassword('publii-gl-token', account);
        }

        this.client = new Gitlab({
            url: this.deployment.siteConfig.deployment.gitlab.server,
            token: token
        });

        this.setUploadProgress(6);
        console.log('(!) CLIENT CREATED');

        process.send({
            type: 'web-contents',
            message: 'app-connection-in-progress'
        });

        this.deployment.setInput();
        this.deployment.setOutput(true);
        this.deployment.prepareLocalFilesList();
        this.setUploadProgress(7);
github eduardoboucas / staticman / lib / GitLab.js View on Github external
constructor (options = {}) {
    super(options.username, options.repository, options.branch)

    const token = config.get('gitlabToken')

    if (options.oauthToken) {
      this.api = new GitLabApi({
        url: config.get('gitlabBaseUrl'),
        oauthToken: options.oauthToken
      })
    } else if (token) {
      this.api = new GitLabApi({
        url: config.get('gitlabBaseUrl'),
        token
      })
    } else {
      throw new Error('Require an `oauthToken` or `token` option')
    }
  }
github pfdgithub / verdaccio-auth-gitlab / src / roles.js View on Github external
constructor(logger, url, token) {
    this.classProperties();

    this.logger = logger;
    this.api = new Gitlab({
      url: url,
      token: token
    });

    this.url = url;
    this.token = token;
  }
github TrueGrom / gitlab_helper_bot / api.js View on Github external
constructor({ token, projectId }) {
    this._api = new Gitlab({ token });
    this._projectId = projectId;
  }
github GetPublii / Publii / app / back-end / modules / deploy / gitlab-pages.js View on Github external
async testConnection (app, deploymentConfig, siteName) {
        let repository = deploymentConfig.gitlab.repo;
        let branchName = deploymentConfig.gitlab.branch;
        let token = deploymentConfig.gitlab.token;
        let account = slug(siteName);
        this.waitForTimeout = true;

        if (token === 'publii-gl-token ' + account) {
            token = await passwordSafeStorage.getPassword('publii-gl-token', account);
        }

        this.client = new Gitlab({
            url: deploymentConfig.gitlab.server,
            token: token
        });

        this.client.Projects.all({
            owned: true,
            maxPages: 1,
            perPage: 1
        }).then(project => {
            this.client.Projects.all({
                search: repository,
                owned: true,
                maxPages: 1,
                perPage: 1
            }).then(projects => {
                let projectID = projects[0].id;
github vishwanatharondekar / gitlab-cli / index.js View on Github external
var colors = require('colors');
var Gitlab = require('gitlab/dist/es5').default;
var editor = require('editor');
var exec = childProcess.exec;
var fs = require('fs');
var legacies = {};
var open = require('open');
var projectDir = process.cwd();
var Promise = require('promise');
var URL = require('url');
var options = require('./options')
var packageJson = require('./package.json')

var regexParseProjectName = /(.+:\/\/.+?\/|.+:)(.+\/[^\.]+)+(\.git)?/;

var gitlab = new Gitlab(options);
gitlab.options = options;

var store = (function(){
  return {
    set : function(obj){
      Object.assign(this, obj)
    },
    get : function(key){
      return this[key]
    }
  }
})()
var log = {
  getInstance: function(verbose) {
    return {
      log: function() {
github faultline / faultline / src / lib / notifications / gitlab.js View on Github external
module.exports = (n, errorData) => {
    const title = messageBuilder.title(n, errorData);
    let endpoint = 'https://gitlab.com';
    if (n.endpoint) {
        endpoint = n.endpoint;
    }

    const g = new Gitlab({
        url: endpoint,
        token: n.personalAccessToken
    });

    let acitonIfExist = 'reopen-and-comment';
    if (n.if_exist) {
        acitonIfExist = n.if_exist;
    }

    function isReopen() {
        return (['reopen', 'reopen-and-comment', 'reopen-and-update'].indexOf(acitonIfExist) >= 0);
    }

    function isComment() {
        return (['comment', 'reopen-and-comment'].indexOf(acitonIfExist) >= 0);
    }

gitlab

Full NodeJS implementation of the GitLab API. Supports Promises, Async/Await.

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis