Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.
/ CWRC-GitServerClient Public archive

Handles calls from the CWRC-GitDelegator to the CWRC-GitServer.

Notifications You must be signed in to change notification settings

cwrc/CWRC-GitServerClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Picture

CWRC-GitServerClient

Travis Codecov version downloads GPL-2.0 semantic-release Commitizen friendly experimental

  1. Overview
  2. Demo
  3. Installation
  4. Use
  5. API

Overview

DEPRECATED. Functionality has been merged with cwrc-git-dialogs.

Makes http calls to the CWRC-GitServer, invoked from CWRC-GitDelegator running in CWRC-GitWriter.

Demo

The CWRC GitHub Sandbox uses the NPM package published from this repository along with the code in CWRC-Writer, CWRC-GitServer, CWRC-GitWriter, and CWRC-GitDelegator. The same code is easily (for someone with modest development experience) installed on any server to run your own instance.

Installation

npm install cwrc-git-server-client

To simultaneously register as a dependency in your package.json:

npm install cwrc-git-server-client --save

or as shortcut:

npm i -S cwrc-git-server-client

Use

One example:

var cwrcGitServerClient = require('cwrc-git-server-client'); var repos = cwrcGitServerClient.getReposForAuthenticatedGithubUser();

See cwrc-git-dialogs which fully uses the API.

API

The methods exposed (API) by this package are:

	getReposForGithubUser(githubUserName, page, per_page)

    getReposForAuthenticatedGithubUser(page, per_page, affiliation)

    saveDoc(repo, path, content, branch, message, sha)

    saveAsPullRequest(repo, path, content, branch, message, title, sha)
    
    createRepo(repo, description, isPrivate)
    
    getRepoContents(githubRepoName)
        - where githubRepoName is full name including github user name e.g., jchartrand/myRepo
        - uses the recursive option of the Github api
    
    getRepoContentsByDrillDown(githubRepoName)
        - where githubRepoName is full name including github user name e.g., jchartrand/myRepo
        - manually recurses through subdirectories to build full listing
        
    getDoc(repoName, branch, path)
    
    getInfoForAuthenticatedUser()

    getTemplates()
        - retrieves list of templates from CWRC template repository

    getTemplate(templatePath)
        - gets specific CWRC template by name

    search(query, per_page, page)
        - searches using the github api to search within code

About

Handles calls from the CWRC-GitDelegator to the CWRC-GitServer.

Resources

Stars

Watchers

Forks

Packages

No packages published