You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@codefresh-io/cf-git-providers

Package Overview
Dependencies
Maintainers
34
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codefresh-io/cf-git-providers - npm Package Compare versions

Comparing version

to
0.2.1

44

lib/providers/gitlab.js

@@ -61,2 +61,10 @@ "use strict";

};
const _toUser = (user, email) => {
return {
login: user.username,
email: email || user.email,
avatar_url: user.avatar_url,
web_url: user.web_url,
};
};
const _toRepo = (rawRepo) => {

@@ -323,6 +331,38 @@ const isGroup = lodash_1.get(rawRepo, 'namespace.kind') === 'group'; // is it a group/org repository

async getUser(opt) {
throw new Error('Method not implemented.');
const user = (opt === null || opt === void 0 ? void 0 : opt.username) ? opt.username : 'authenticated user';
const [err, res] = await helpers_1.to(this.performAPICall({
api: (opt === null || opt === void 0 ? void 0 : opt.username) ? 'users' : 'user',
json: true,
qs: (opt === null || opt === void 0 ? void 0 : opt.username) ? { username: opt.username } : {}
}));
if (err) {
throw new CFError({
message: `Failed to get ${user}: , status code: ${err.statusCode}`,
cause: err,
});
}
else if (res.statusCode >= 400) {
throw new CFError(`Failed to get user: ${user}, status code: ${res.statusCode}`);
}
return _toUser(res.body);
}
async getUserByEmail(email) {
throw new Error('Method not implemented.');
const [err, res] = await helpers_1.to(this.performAPICall({
api: 'users',
json: true,
qs: { search: email }
}));
if (err) {
throw new CFError({
message: `Failed to get user with email ${email}: , status code: ${err.statusCode}`,
cause: err,
});
}
else if (res.statusCode >= 400) {
throw new CFError(`Failed to get user with email: ${email}, status code: ${res.statusCode}`);
}
if (res.body.length === 0) {
throw new CFError(`No user with email: ${email} was found on ${this.getName()}`);
}
return _toUser(res.body[0], email);
}

@@ -329,0 +369,0 @@ }

4

package.json
{
"name": "@codefresh-io/cf-git-providers",
"version": "0.2.0",
"version": "0.2.1",
"description": "An NPM module/CLI for interacting with various git providers",

@@ -70,2 +70,2 @@ "keywords": [

}
}
}

Sorry, the diff of this file is not supported yet