mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Updated docs and fixed templates
This commit is contained in:
parent
9cf13411b5
commit
bdbf1e5fed
10
README.md
10
README.md
@ -38,7 +38,9 @@ URL to your GitLab instance should not include `/api/v4` path.
|
||||
|
||||
Instantiate the library using a basic token created in your [Gitlab Profile](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html)
|
||||
```javascript
|
||||
const GitlabAPI = require('node-gitlab-api')({
|
||||
import GitlabAPI from 'node-gitlab-api';
|
||||
|
||||
const API = GitlabAPI({
|
||||
url: 'http://example.com', // Defaults to http://gitlab.com
|
||||
token: 'abcdefghij123456' //Can be created in your profile.
|
||||
})
|
||||
@ -47,7 +49,9 @@ const GitlabAPI = require('node-gitlab-api')({
|
||||
Or, use a OAuth token instead!
|
||||
|
||||
```javascript
|
||||
const GitlabAPI = require('node-gitlab-api')({
|
||||
import GitlabAPI from 'node-gitlab-api';
|
||||
|
||||
const API = GitlabAPI({
|
||||
url: 'http://example.com', // Defaults to http://gitlab.com
|
||||
oauthToken: 'abcdefghij123456'
|
||||
})
|
||||
@ -56,7 +60,7 @@ const GitlabAPI = require('node-gitlab-api')({
|
||||
The same parameters as above, but the require url inclues a `/dist/es5`:
|
||||
|
||||
```javascript
|
||||
const GitlabAPI = require('node-gitlab-api/dist/es5')({
|
||||
const GitlabAPI = require('node-gitlab-api/dist/es5').default({
|
||||
...
|
||||
})
|
||||
```
|
||||
|
||||
20
package-lock.json
generated
20
package-lock.json
generated
@ -356,15 +356,6 @@
|
||||
"@babel/plugin-syntax-export-default-from": "7.0.0-beta.42"
|
||||
}
|
||||
},
|
||||
"@babel/plugin-proposal-export-namespace": {
|
||||
"version": "7.0.0-beta.32",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace/-/plugin-proposal-export-namespace-7.0.0-beta.32.tgz",
|
||||
"integrity": "sha512-vSnkdadqxvkOtNgoY8lo3cpXkBkRBLS6Z/2IoHZRplp1e/V6a/wGRBwwJGEQoi24WDIMwzlOl6V0I7q/MTo9jA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/plugin-syntax-export-extensions": "7.0.0-beta.32"
|
||||
}
|
||||
},
|
||||
"@babel/plugin-proposal-export-namespace-from": {
|
||||
"version": "7.0.0-beta.42",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.0.0-beta.42.tgz",
|
||||
@ -461,12 +452,6 @@
|
||||
"@babel/helper-plugin-utils": "7.0.0-beta.42"
|
||||
}
|
||||
},
|
||||
"@babel/plugin-syntax-export-extensions": {
|
||||
"version": "7.0.0-beta.32",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-extensions/-/plugin-syntax-export-extensions-7.0.0-beta.32.tgz",
|
||||
"integrity": "sha512-rPCgRGdA2nUGRGsDlfII8g665+ECp0IpKtjRtpBJB7GMBG+WpAbWVM6P4h40IsEe9wv38jl0Nuv3lVVvKTi/Mw==",
|
||||
"dev": true
|
||||
},
|
||||
"@babel/plugin-syntax-export-namespace-from": {
|
||||
"version": "7.0.0-beta.42",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.0.0-beta.42.tgz",
|
||||
@ -3129,6 +3114,11 @@
|
||||
"sshpk": "1.14.1"
|
||||
}
|
||||
},
|
||||
"humps": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/humps/-/humps-2.0.1.tgz",
|
||||
"integrity": "sha1-3QLqYIG9BWjcXQcxhEY5V7qe+ao="
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.4.19",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
|
||||
|
||||
@ -7,9 +7,10 @@
|
||||
"node": ">=8.9.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build:clean": "rimraf -rf dist && mkdirp -p dist",
|
||||
"build:es6": "babel src -d dist/latest",
|
||||
"build:es5": "babel src -d dist/es5 --no-babelrc --presets=@babel/env --plugins=@babel/plugin-proposal-export-default-from,@babel/plugin-proposal-export-namespace-from",
|
||||
"build": "npm run build:es6 && npm run build:es5",
|
||||
"build": "npm run build:clean && npm run build:es6 && npm run build:es5",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
@ -40,6 +41,7 @@
|
||||
"eslint-plugin-react": "^7.7.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"humps": "^2.0.1",
|
||||
"parse-link-header": "^1.0.1",
|
||||
"request": "^2.85.0",
|
||||
"request-promise": "^4.2.2",
|
||||
|
||||
172
src/index.js
172
src/index.js
@ -1,8 +1,8 @@
|
||||
import * as Services from './services';
|
||||
import * as APIServices from './services';
|
||||
import { init } from './infrastructure/Namespace';
|
||||
|
||||
// All not initialized
|
||||
// export * from './services';
|
||||
export * from './services';
|
||||
|
||||
// Groups
|
||||
const {
|
||||
@ -13,93 +13,93 @@ const {
|
||||
GroupMilestones,
|
||||
GroupProjects,
|
||||
GroupVariables,
|
||||
} = Services;
|
||||
} = APIServices;
|
||||
|
||||
// export const GroupNamespace = options => init(options, {
|
||||
// Groups,
|
||||
// GroupAccessRequests,
|
||||
// GroupCustomAttributes,
|
||||
// GroupMembers,
|
||||
// GroupMilestones,
|
||||
// GroupProjects,
|
||||
// GroupVariables,
|
||||
// });
|
||||
export const GroupNamespace = options => init(options, {
|
||||
Groups,
|
||||
GroupAccessRequests,
|
||||
GroupCustomAttributes,
|
||||
GroupMembers,
|
||||
GroupMilestones,
|
||||
GroupProjects,
|
||||
GroupVariables,
|
||||
});
|
||||
|
||||
// // Users
|
||||
// const {
|
||||
// Users,
|
||||
// UserEmails,
|
||||
// UserImpersonationTokens,
|
||||
// UserKeys,
|
||||
// UserGPGKeys,
|
||||
// } = Services;
|
||||
// Users
|
||||
const {
|
||||
Users,
|
||||
UserEmails,
|
||||
UserImpersonationTokens,
|
||||
UserKeys,
|
||||
UserGPGKeys,
|
||||
} = APIServices;
|
||||
|
||||
// export const UserNamespace = options => init(options, {
|
||||
// Users,
|
||||
// UserEmails,
|
||||
// UserImpersonationTokens,
|
||||
// UserKeys,
|
||||
// UserGPGKeys,
|
||||
// });
|
||||
export const UserNamespace = options => init(options, {
|
||||
Users,
|
||||
UserEmails,
|
||||
UserImpersonationTokens,
|
||||
UserKeys,
|
||||
UserGPGKeys,
|
||||
});
|
||||
|
||||
// // // Projects
|
||||
// const {
|
||||
// Branches,
|
||||
// Commits,
|
||||
// DeployKeys,
|
||||
// Environments,
|
||||
// Issues,
|
||||
// Jobs,
|
||||
// Labels,
|
||||
// MergeRequests,
|
||||
// MergeRequestNotes,
|
||||
// MergeRequestVersions,
|
||||
// Pipelines,
|
||||
// Projects,
|
||||
// ProjectAccessRequests,
|
||||
// ProjectCustomAttributes,
|
||||
// ProjectHooks,
|
||||
// ProjectMembers,
|
||||
// ProjectMilestones,
|
||||
// ProjectSnippets,
|
||||
// ProtectedBranches,
|
||||
// ProjectVariables,
|
||||
// Repositories,
|
||||
// RepositoryFiles,
|
||||
// Runners,
|
||||
// Services,
|
||||
// Tags,
|
||||
// Triggers,
|
||||
// } = Services;
|
||||
// Projects
|
||||
const {
|
||||
Branches,
|
||||
Commits,
|
||||
DeployKeys,
|
||||
Environments,
|
||||
Issues,
|
||||
Jobs,
|
||||
Labels,
|
||||
MergeRequests,
|
||||
MergeRequestNotes,
|
||||
MergeRequestVersions,
|
||||
Pipelines,
|
||||
Projects,
|
||||
ProjectAccessRequests,
|
||||
ProjectCustomAttributes,
|
||||
ProjectHooks,
|
||||
ProjectMembers,
|
||||
ProjectMilestones,
|
||||
ProjectSnippets,
|
||||
ProtectedBranches,
|
||||
ProjectVariables,
|
||||
Repositories,
|
||||
RepositoryFiles,
|
||||
Runners,
|
||||
Services,
|
||||
Tags,
|
||||
Triggers,
|
||||
} = APIServices;
|
||||
|
||||
// export const ProjectNamespace = options => init(options, {
|
||||
// Branches,
|
||||
// Commits,
|
||||
// DeployKeys,
|
||||
// Environments,
|
||||
// Issues,
|
||||
// Jobs,
|
||||
// Labels,
|
||||
// MergeRequests,
|
||||
// MergeRequestNotes,
|
||||
// MergeRequestVersions,
|
||||
// Pipelines,
|
||||
// Projects,
|
||||
// ProjectAccessRequests,
|
||||
// ProjectCustomAttributes,
|
||||
// ProjectHooks,
|
||||
// ProjectMembers,
|
||||
// ProjectMilestones,
|
||||
// ProjectSnippets,
|
||||
// ProtectedBranches,
|
||||
// ProjectVariables,
|
||||
// Repositories,
|
||||
// RepositoryFiles,
|
||||
// Runners,
|
||||
// Services,
|
||||
// Tags,
|
||||
// Triggers,
|
||||
// });
|
||||
export const ProjectNamespace = options => init(options, {
|
||||
Branches,
|
||||
Commits,
|
||||
DeployKeys,
|
||||
Environments,
|
||||
Issues,
|
||||
Jobs,
|
||||
Labels,
|
||||
MergeRequests,
|
||||
MergeRequestNotes,
|
||||
MergeRequestVersions,
|
||||
Pipelines,
|
||||
Projects,
|
||||
ProjectAccessRequests,
|
||||
ProjectCustomAttributes,
|
||||
ProjectHooks,
|
||||
ProjectMembers,
|
||||
ProjectMilestones,
|
||||
ProjectSnippets,
|
||||
ProtectedBranches,
|
||||
ProjectVariables,
|
||||
Repositories,
|
||||
RepositoryFiles,
|
||||
Runners,
|
||||
Services,
|
||||
Tags,
|
||||
Triggers,
|
||||
});
|
||||
|
||||
// // All initialized
|
||||
// export default options => init(options, Services);
|
||||
// All initialized
|
||||
export default options => init(options, Services);
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceAccessRequests } from '../templates';
|
||||
|
||||
class GroupAccessRequests {
|
||||
class GroupAccessRequests extends ResourceAccessRequests {
|
||||
constructor(options) {
|
||||
return new ResourceAccessRequests('groups', options);
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceCustomAttributes } from '../templates';
|
||||
|
||||
class GroupCustomAttributes {
|
||||
class GroupCustomAttributes extends ResourceCustomAttributes {
|
||||
constructor(options) {
|
||||
return new ResourceCustomAttributes('groups', options);
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceMembers } from '../templates';
|
||||
|
||||
class GroupMembers {
|
||||
class GroupMembers extends ResourceMembers {
|
||||
constructor(options) {
|
||||
return new ResourceMembers('groups', options);
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceMilestones } from '../templates';
|
||||
|
||||
class GroupMilestones {
|
||||
class GroupMilestones extends ResourceMilestones {
|
||||
constructor(options) {
|
||||
return new ResourceMilestones('groups', options);
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceVariables } from '../templates';
|
||||
|
||||
class GroupVariables {
|
||||
class GroupVariables extends ResourceVariables {
|
||||
constructor(options) {
|
||||
return new ResourceVariables('groups', options);
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceNotes } from '../templates';
|
||||
|
||||
class MergeRequestNotes {
|
||||
class MergeRequestNotes extends ResourceNotes {
|
||||
constructor(options) {
|
||||
return new ResourceNotes('mergerequests', 'notes', options);
|
||||
super('mergerequests', 'notes', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceAccessRequests } from '../templates';
|
||||
|
||||
class ProjectAccessRequests {
|
||||
class ProjectAccessRequests extends ResourceAccessRequests {
|
||||
constructor(options) {
|
||||
return new ResourceAccessRequests('projects', options);
|
||||
super('projects', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceCustomAttributes } from '../templates';
|
||||
|
||||
class ProjectCustomAttributes {
|
||||
class ProjectCustomAttributes extends ResourceCustomAttributes {
|
||||
constructor(options) {
|
||||
return new ResourceCustomAttributes('projects', options);
|
||||
super('projects', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceMembers } from '../templates';
|
||||
|
||||
class ProjectMembers {
|
||||
class ProjectMembers extends ResourceMembers {
|
||||
constructor(options) {
|
||||
return new ResourceMembers('projects', options);
|
||||
super('projects', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceMilestones } from '../templates';
|
||||
|
||||
class ProjectMilestones {
|
||||
class ProjectMilestones extends ResourceMilestones {
|
||||
constructor(options) {
|
||||
return new ResourceMilestones('projects', options);
|
||||
super('projects', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceNotes } from '../templates';
|
||||
|
||||
class ProjectSnippets {
|
||||
class ProjectSnippets extends ResourceNotes {
|
||||
constructor(options) {
|
||||
return new ResourceNotes('projects', 'snippets', options);
|
||||
super('projects', 'snippets', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceVariables } from '../templates';
|
||||
|
||||
class ProjectVariables {
|
||||
class ProjectVariables extends ResourceVariables {
|
||||
constructor(options) {
|
||||
return new ResourceVariables('projects', options);
|
||||
super('projects', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ResourceCustomAttributes } from '../templates';
|
||||
|
||||
class UserCustomAttributes {
|
||||
class UserCustomAttributes extends ResourceCustomAttributes {
|
||||
constructor(options) {
|
||||
return new ResourceCustomAttributes('users', options);
|
||||
super('users', options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user