Skip to content

Instantly share code, notes, and snippets.

@sebble
Created June 23, 2014 20:43
Show Gist options
  • Save sebble/ed1bf6a723ac8fee8cf1 to your computer and use it in GitHub Desktop.
Save sebble/ed1bf6a723ac8fee8cf1 to your computer and use it in GitHub Desktop.
GitHub, GitLab, Prose.io API comparisons
DELETE /applications/:client_id/tokens
DELETE /applications/:client_id/tokens/:access_token
GET /applications/:client_id/tokens/:access_token
POST /applications/:client_id/tokens/:access_token
GET /authorizations
POST /authorizations
PUT /authorizations/clients/:client_id
DELETE /authorizations/:id
GET /authorizations/:id
PATCH /authorizations/:id
GET /emojis
GET /events
GET /feeds
GET /gists
POST /gists
GET /gists/:gist_id/comments
POST /gists/:gist_id/comments
DELETE /gists/:gist_id/comments/:id
GET /gists/:gist_id/comments/:id
PATCH /gists/:gist_id/comments/:id
DELETE /gists/:id
GET /gists/:id
PATCH /gists/:id
GET /gists/:id/commits
GET /gists/:id/forks
POST /gists/:id/forks
DELETE /gists/:id/star
GET /gists/:id/star
PUT /gists/:id/star
GET /gists/public
GET /gists/starred
GET /gitignore/templates
GET /gitignore/templates/C
GET /issues
GET /legacy/issues/search/:owner/:repository/:state/:keyword
GET /legacy/repos/search/:keyword
GET /legacy/user/email/:email
GET /legacy/user/search/:keyword
POST /markdown
POST /markdown/raw
GET /meta
GET /networks/:owner/:repo/events
GET /notifications
PUT /notifications
GET /notifications/threads/:id
PATCH /notifications/threads/:id
DELETE /notifications/threads/:id/subscription
GET /notifications/threads/:id/subscription
PUT /notifications/threads/:id/subscription
GET /orgs/:org
PATCH /orgs/:org
GET /orgs/:org/events
GET /orgs/:org/issues
GET /orgs/:org/members
DELETE /orgs/:org/members/:user
GET /orgs/:org/members/:user
GET /orgs/:org/public_members
DELETE /orgs/:org/public_members/:user
GET /orgs/:org/public_members/:user
PUT /orgs/:org/public_members/:user
GET /orgs/:org/repos
POST /orgs/:org/repos
GET /orgs/:org/teams
POST /orgs/:org/teams
GET /rate_limit
GET /repositories
DELETE /repos/octocat/Hello-World/git/refs/heads/feature-a
DELETE /repos/octocat/Hello-World/git/refs/tags/v1.0
DELETE /repos/:owner/:repo
GET /repos/:owner/:repo
PATCH /repos/:owner/:repo
GET /repos/:owner/:repo/:archive_format/:ref
GET /repos/:owner/:repo/assignees
GET /repos/:owner/:repo/assignees/:assignee
GET /repos/:owner/:repo/branches
GET /repos/:owner/:repo/branches/:branch
GET /repos/:owner/:repo/collaborators
DELETE /repos/:owner/:repo/collaborators/:user
GET /repos/:owner/:repo/collaborators/:user
PUT /repos/:owner/:repo/collaborators/:user
GET /repos/:owner/:repo/comments
DELETE /repos/:owner/:repo/comments/:id
GET /repos/:owner/:repo/comments/:id
PATCH /repos/:owner/:repo/comments/:id
GET /repos/:owner/:repo/commits
GET /repos/:owner/:repo/commits/:ref/comments
GET /repos/:owner/:repo/commits/:ref/status
GET /repos/:owner/:repo/commits/:sha
POST /repos/:owner/:repo/commits/:sha/comments
GET /repos/:owner/:repo/compare/:base...:head
GET /repos/:owner/:repo/compare/user1:branchname...user2:branchname
DELETE /repos/:owner/:repo/contents/:path
GET /repos/:owner/:repo/contents/:path
PUT /repos/:owner/:repo/contents/:path
PUT /repos/:owner/:repo/contents/:path
GET /repos/:owner/:repo/contributors
GET /repos/:owner/:repo/deployments
POST /repos/:owner/:repo/deployments
GET /repos/:owner/:repo/deployments/:id/statuses
POST /repos/:owner/:repo/deployments/:id/statuses
GET /repos/:owner/:repo/downloads
DELETE /repos/:owner/:repo/downloads/:id
GET /repos/:owner/:repo/downloads/:id
GET /repos/:owner/:repo/events
GET /repos/:owner/:repo/forks
POST /repos/:owner/:repo/forks
POST /repos/:owner/:repo/git/blobs
GET /repos/:owner/:repo/git/blobs/:sha
POST /repos/:owner/:repo/git/commits
GET /repos/:owner/:repo/git/commits/:sha
GET /repos/:owner/:repo/git/refs
POST /repos/:owner/:repo/git/refs
GET /repos/:owner/:repo/git/refs/heads/skunkworkz/featureA
DELETE /repos/:owner/:repo/git/refs/:ref
GET /repos/:owner/:repo/git/refs/:ref
PATCH /repos/:owner/:repo/git/refs/:ref
GET /repos/:owner/:repo/git/refs/tags
POST /repos/:owner/:repo/git/tags
GET /repos/:owner/:repo/git/tags/:sha
POST /repos/:owner/:repo/git/trees
GET /repos/:owner/:repo/git/trees/:sha
GET /repos/:owner/:repo/git/trees/:sha?recursive=1
GET /repos/:owner/:repo/hooks
POST /repos/:owner/:repo/hooks
DELETE /repos/:owner/:repo/hooks/:id
GET /repos/:owner/:repo/hooks/:id
PATCH /repos/:owner/:repo/hooks/:id
POST /repos/:owner/:repo/hooks/:id/pings
POST /repos/:owner/:repo/hooks/:id/tests
GET /repos/:owner/:repo/issues
POST /repos/:owner/:repo/issues
GET /repos/:owner/:repo/issues/comments
DELETE /repos/:owner/:repo/issues/comments/:id
GET /repos/:owner/:repo/issues/comments/:id
PATCH /repos/:owner/:repo/issues/comments/:id
GET /repos/:owner/:repo/issues/events
GET /repos/:owner/:repo/issues/events
GET /repos/:owner/:repo/issues/events/:id
GET /repos/:owner/:repo/issues/:issue_number/events
GET /repos/:owner/:repo/issues/:number
PATCH /repos/:owner/:repo/issues/:number
GET /repos/:owner/:repo/issues/:number/comments
POST /repos/:owner/:repo/issues/:number/comments
DELETE /repos/:owner/:repo/issues/:number/labels
GET /repos/:owner/:repo/issues/:number/labels
POST /repos/:owner/:repo/issues/:number/labels
PUT /repos/:owner/:repo/issues/:number/labels
DELETE /repos/:owner/:repo/issues/:number/labels/:name
GET /repos/:owner/:repo/keys
POST /repos/:owner/:repo/keys
DELETE /repos/:owner/:repo/keys/:id
GET /repos/:owner/:repo/keys/:id
GET /repos/:owner/:repo/labels
POST /repos/:owner/:repo/labels
DELETE /repos/:owner/:repo/labels/:name
GET /repos/:owner/:repo/labels/:name
PATCH /repos/:owner/:repo/labels/:name
GET /repos/:owner/:repo/languages
POST /repos/:owner/:repo/merges
GET /repos/:owner/:repo/milestones
POST /repos/:owner/:repo/milestones
DELETE /repos/:owner/:repo/milestones/:number
GET /repos/:owner/:repo/milestones/:number
PATCH /repos/:owner/:repo/milestones/:number
GET /repos/:owner/:repo/milestones/:number/labels
GET /repos/:owner/:repo/notifications
PUT /repos/:owner/:repo/notifications
GET /repos/:owner/:repo/pages
GET /repos/:owner/:repo/pages/builds
GET /repos/:owner/:repo/pages/builds/latest
GET /repos/:owner/:repo/pulls
POST /repos/:owner/:repo/pulls
GET /repos/:owner/:repo/pulls/comments
DELETE /repos/:owner/:repo/pulls/comments/:number
GET /repos/:owner/:repo/pulls/comments/:number
PATCH /repos/:owner/:repo/pulls/comments/:number
GET /repos/:owner/:repo/pulls/:number
PATCH /repos/:owner/:repo/pulls/:number
GET /repos/:owner/:repo/pulls/:number/comments
POST /repos/:owner/:repo/pulls/:number/comments
GET /repos/:owner/:repo/pulls/:number/commits
GET /repos/:owner/:repo/pulls/:number/files
GET /repos/:owner/:repo/pulls/:number/merge
PUT /repos/:owner/:repo/pulls/:number/merge
GET /repos/:owner/:repo/readme
GET /repos/:owner/:repo/releases
POST /repos/:owner/:repo/releases
DELETE /repos/:owner/:repo/releases/assets/:id
GET /repos/:owner/:repo/releases/assets/:id
PATCH /repos/:owner/:repo/releases/assets/:id
DELETE /repos/:owner/:repo/releases/:id
GET /repos/:owner/:repo/releases/:id
PATCH /repos/:owner/:repo/releases/:id
GET /repos/:owner/:repo/releases/:id/assets
GET /repos/:owner/:repo/stargazers
GET /repos/:owner/:repo/stats/code_frequency
GET /repos/:owner/:repo/stats/commit_activity
GET /repos/:owner/:repo/stats/contributors
GET /repos/:owner/:repo/stats/participation
GET /repos/:owner/:repo/stats/punch_card
GET /repos/:owner/:repo/statuses/:ref
POST /repos/:owner/:repo/statuses/:sha
GET /repos/:owner/:repo/subscribers
DELETE /repos/:owner/:repo/subscription
GET /repos/:owner/:repo/subscription
PUT /repos/:owner/:repo/subscription
GET /repos/:owner/:repo/tags
GET /repos/:owner/:repo/teams
GET /search/code
GET /search/issues
GET /search/repositories
GET /search/users
DELETE /teams/:id
GET /teams/:id
PATCH /teams/:id
GET /teams/:id/members
DELETE /teams/:id/members/:user
GET /teams/:id/members/:user
PUT /teams/:id/members/:user
GET /teams/:id/repos
PUT /teams/:id/repos/:org/:repo
DELETE /teams/:id/repos/:owner/:repo
GET /teams/:id/repos/:owner/:repo
GET /user
PATCH /user
DELETE /user/emails
GET /user/emails
POST /user/emails
GET /user/followers
GET /user/following
DELETE /user/following/:user
GET /user/following/:user
PUT /user/following/:user
GET /user/issues
GET /user/keys
POST /user/keys
DELETE /user/keys/:id
GET /user/keys/:id
GET /user/orgs
GET /user/repos
POST /user/repos
GET /users
GET /user/starred
DELETE /user/starred/:owner/:repo
GET /user/starred/:owner/:repo
PUT /user/starred/:owner/:repo
GET /user/subscriptions
DELETE /user/subscriptions/:owner/:repo
GET /user/subscriptions/:owner/:repo
PUT /user/subscriptions/:owner/:repo
GET /users/:user
GET /users/:user/events
GET /users/:user/events/orgs/:org
GET /users/:user/events/public
GET /users/:user/followers
GET /users/:user/following
GET /users/:user/following/:target_user
GET /users/:user/gists
GET /users/:user/keys
GET /users/:user/orgs
GET /users/:user/received_events
GET /users/:user/received_events/public
GET /users/:user/repos
GET /users/:user/starred
GET /users/:user/subscriptions
GET /user/teams
GET /groups
POST /groups
DELETE /groups/:id
GET /groups/:id
GET /groups/:id/members
POST /groups/:id/members
DELETE /groups/:id/members/:user_id
GET /hooks
POST /hooks
DELETE /hooks/:id
GET /hooks/:id
GET /issues
GET /projects
POST /projects
GET /projects/all
DELETE /projects/:id
GET /projects/:id
GET /projects/:id/events
DELETE /projects/:id/fork
POST /projects/:id/fork/:forked_from_id
GET /projects/:id/hooks
POST /projects/:id/hooks
DELETE /projects/:id/hooks/:hook_id
GET /projects/:id/hooks/:hook_id
PUT /projects/:id/hooks/:hook_id
GET /projects/:id/issues
POST /projects/:id/issues
DELETE /projects/:id/issues/:issue_id
GET /projects/:id/issues/:issue_id
PUT /projects/:id/issues/:issue_id
GET /projects/:id/issues/:issue_id/notes
POST /projects/:id/issues/:issue_id/notes
GET /projects/:id/issues/:issue_id/notes/:note_id
GET /projects/:id/keys
POST /projects/:id/keys
DELETE /projects/:id/keys/:key_id
GET /projects/:id/keys/:key_id
GET /projects/:id/labels
GET /projects/:id/members
POST /projects/:id/members
DELETE /projects/:id/members/:user_id
GET /projects/:id/members/:user_id
PUT /projects/:id/members/:user_id
GET /projects/:id/merge_request/:merge_request_id
PUT /projects/:id/merge_request/:merge_request_id
GET /projects/:id/merge_request/:merge_request_id/comments
POST /projects/:id/merge_request/:merge_request_id/comments
PUT /projects/:id/merge_request/:merge_request_id/merge
GET /projects/:id/merge_requests
POST /projects/:id/merge_requests
GET /projects/:id/merge_requests/:merge_request_id/notes
POST /projects/:id/merge_requests/:merge_request_id/notes
GET /projects/:id/merge_requests/:merge_request_id/notes/:note_id
GET /projects/:id/merge_requests?state=all
GET /projects/:id/merge_requests?state=opened
GET /projects/:id/milestones
POST /projects/:id/milestones
GET /projects/:id/milestones/:milestone_id
PUT /projects/:id/milestones/:milestone_id
GET /projects/:id/repository/archive
GET /projects/:id/repository/blobs/:sha
GET /projects/:id/repository/branches
GET /projects/:id/repository/branches
POST /projects/:id/repository/branches
DELETE /projects/:id/repository/branches/:branch
GET /projects/:id/repository/branches/:branch
GET /projects/:id/repository/branches/:branch
PUT /projects/:id/repository/branches/:branch/protect
PUT /projects/:id/repository/branches/:branch/protect
PUT /projects/:id/repository/branches/:branch/unprotect
PUT /projects/:id/repository/branches/:branch/unprotect
GET /projects/:id/repository/commits
GET /projects/:id/repository/commits/:sha
GET /projects/:id/repository/commits/:sha/diff
GET /projects/:id/repository/compare
GET /projects/:id/repository/compare?from=master&to=feature
DELETE /projects/:id/repository/files
GET /projects/:id/repository/files
POST /projects/:id/repository/files
PUT /projects/:id/repository/files
GET /projects/:id/repository/raw_blobs/:sha
GET /projects/:id/repository/tags
POST /projects/:id/repository/tags
GET /projects/:id/repository/tree
GET /projects/:id/snippets
POST /projects/:id/snippets
DELETE /projects/:id/snippets/:snippet_id
GET /projects/:id/snippets/:snippet_id
PUT /projects/:id/snippets/:snippet_id
GET /projects/:id/snippets/:snippet_id/notes
POST /projects/:id/snippets/:snippet_id/notes
GET /projects/:id/snippets/:snippet_id/notes/:note_id
GET /projects/:id/snippets/:snippet_id/raw
GET /projects/owned
GET /projects/search/:query
POST /projects/user/:user_id
POST /session
GET /user
GET /user/keys
POST /user/keys
DELETE /user/keys/:id
GET /user/keys/:id
GET /users
GET /users
POST /users
DELETE /users/:id
GET /users/:id
GET /users/:id
PUT /users/:id
POST /users/:id/keys
GET /users/:uid/keys
DELETE /users/:uid/keys/:id
Instances of "url:" in prose, note that some GitLab modifications have been made
app/collections/orgs.js: url: function() {
app/collections/orgs.js- if (config.type == 'gitlab-v3')
app/collections/orgs.js- return config.api + '/groups';
app/collections/orgs.js- else
app/collections/orgs.js- return this.user ? config.api + '/users/' + this.user.get('login') + '/orgs' :
app/collections/orgs.js- '/user/orgs';
--
app/collections/files.js: url: file.url || this.repo.url() + '/repository/files?file_path=' + file.name + '&ref=' + this.branch.get('name'),
app/collections/files.js- branch: this.branch,
app/collections/files.js- collection: this,
app/collections/files.js- repo: this.repo
app/collections/files.js- })
app/collections/files.js- }).bind(this));
--
app/collections/files.js: baseurl: config.baseurl,
app/collections/files.js- languages: config.languages
app/collections/files.js- }, config.prose);
app/collections/files.js-
app/collections/files.js- if (config.prose.ignore) {
app/collections/files.js- this.parseIgnore(config.prose.ignore);
--
app/collections/files.js: url: value.field.options,
app/collections/files.js- success: (function(d) {
app/collections/files.js- value.field.options = _.compact(d);
app/collections/files.js- cb();
app/collections/files.js- }).bind(this)
app/collections/files.js- });
--
app/collections/files.js: url: file.contents_url,
app/collections/files.js- headers: {
app/collections/files.js- Accept: 'application/vnd.github.v3.raw'
app/collections/files.js- },
app/collections/files.js- success: (function(res) {
app/collections/files.js- // initialize new File model with content
--
app/collections/files.js: url: function() {
app/collections/files.js- if (host.type == 'gitlab-v3')
app/collections/files.js- return this.repo.url() + '/repository/tree';
app/collections/files.js- else
app/collections/files.js- return this.repo.url() + '/git/trees/' + this.sha + '?recursive=1';
app/collections/files.js- }
--
app/collections/branches.js: url: function() {
app/collections/branches.js- if (config.type == 'gitlab-v3')
app/collections/branches.js- return this.repo.url() + '/repository/branches';
app/collections/branches.js- else
app/collections/branches.js- return this.repo.url() + '/branches';
app/collections/branches.js- }
--
app/collections/commits.js: url: function() {
app/collections/commits.js- if (config.type == 'gitlab-v3')
app/collections/commits.js- return this.repo.url() + '/repository/commits';
app/collections/commits.js- else
app/collections/commits.js- return this.repo.url() + '/commits?sha=' + this.branch;
app/collections/commits.js- }
--
app/collections/repos.js: url: links.next,
app/collections/repos.js- success: options.success,
app/collections/repos.js- error: options.error
app/collections/repos.js- });
app/collections/repos.js- } else {
app/collections/repos.js- if (_.isFunction(options.complete)) options.complete();
--
app/collections/repos.js: url: function() {
app/collections/repos.js- var id = cookie.get('id');
app/collections/repos.js- var type = this.user.get('type');
app/collections/repos.js- var path;
app/collections/repos.js-
app/collections/repos.js- switch(type) {
--
app/status.js: url: config.apiStatus + '?callback=?',
app/status.js- dataType: 'jsonp',
app/status.js- success: function(res) {
app/status.js- return cb(res);
app/status.js- }
app/status.js- });
--
app/config.js: url: oauth.gatekeeperUrl,
app/config.js- username: cookie.get('username'),
app/config.js- auth: 'oauth',
app/config.js- type: oauth.type || 'github-v3'
app/config.js-};
--
app/models/branch.js: url: function() {
app/models/branch.js- return this.repo.url() + '/branches/' + this.get('name');
app/models/branch.js- }
app/models/branch.js-});
--
app/models/file.js: url: this.get('content_url')
app/models/file.js- }));
app/models/file.js- },
app/models/file.js-
app/models/file.js- getContentSync: function(options) {
app/models/file.js- options = options ? _.clone(options) : {};
--
app/models/file.js: url: this.get('content_url')
app/models/file.js- }));
app/models/file.js- },
app/models/file.js-
app/models/file.js- serialize: function() {
app/models/file.js- var metadata = this.get('metadata');
--
app/models/file.js: url: this.collection.repo.url() + '/pulls',
app/models/file.js- data: JSON.stringify({
app/models/file.js- title: res.commit.message,
app/models/file.js- body: 'This pull request has been automatically generated by prose.io.',
app/models/file.js- base: this.collection.branch.get('name'),
app/models/file.js- head: repo.get('owner').login + ':' + branch.get('name')
--
app/models/file.js: url: url + '?' + params,
app/models/file.js- error: function(model, xhr, options) {
app/models/file.js- // TODO: handle 422 Unprocessable Entity error
app/models/file.js- console.log(model, xhr, options);
app/models/file.js- },
app/models/file.js- wait: true
--
app/models/file.js: url: function() {
app/models/file.js- branch = this.collection.branch || this.branch || this.get("branch");
app/models/file.js- if (host.type == 'gitlab-v3')
app/models/file.js- return this.collection.repo.url() + '/repository/files?file_path=' + this.get('path') + '&ref=' + branch.get('name');
app/models/file.js- else
app/models/file.js- return this.collection.repo.url() + '/contents/' + this.get('path') + '?ref=' + branch.get('name');
--
app/models/repo.js: url: this.url() + '/git/refs',
app/models/repo.js- data: JSON.stringify({
app/models/repo.js- ref: options.ref,
app/models/repo.js- sha: options.sha
app/models/repo.js- }),
app/models/repo.js- success: options.success,
--
app/models/repo.js: url: this.url() + '/forks',
app/models/repo.js- success: (function(res) {
app/models/repo.js- // Initialize new Repo model
app/models/repo.js- // TODO: is referencing module.exports in this manner acceptable?
app/models/repo.js- var repo = new module.exports(res);
app/models/repo.js-
--
app/models/repo.js: url: function() {
app/models/repo.js-
app/models/repo.js- // find out why this need fixing sometimes
app/models/repo.js- var owner = this.get('owner').login || this.get('owner').username;
app/models/repo.js- if (config.type == 'gitlab-v3')
app/models/repo.js- return config.api + '/projects/' + owner + '%2F' + this.get('path');
--
app/models/user.js: url: function() {
app/models/user.js- var id = cookie.get('id');
app/models/user.js- var token = cookie.get('oauth-token');
app/models/user.js-
app/models/user.js- // Return '/user' if authenticated but no user id cookie has been set yet
app/models/user.js- // or if this model's id matches authenticated user id
--
app/models/folder.js: url: function() {
app/models/folder.js- return this.repo.url() + '/contents/' + this.get('path') + '?ref=' + this.branch.get('name');
app/models/folder.js- }
app/models/folder.js-});
--
app/models/commit.js: url: function() {
app/models/commit.js- if (config.type == 'gitlab-v3')
app/models/commit.js- return this.repo.url() + '/repository/commits/' + this.get('sha');
app/models/commit.js- else
app/models/commit.js- return this.repo.url() + '/commits/' + this.get('sha');
app/models/commit.js- }
@blackhuman
Copy link

Is it possible to use these patch to make prose work with gitlab?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment