Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI feature by decorator #147

Closed
wants to merge 41 commits into from
Closed

Add CLI feature by decorator #147

wants to merge 41 commits into from

Conversation

mdsb100
Copy link

@mdsb100 mdsb100 commented Aug 14, 2018

Maybe we need add more description to class and update method description.

By the way, I changed some method arguments. Because the decorator need like this
function all(required, required, ..., optional/*object*/)

For now, look like this:

gitlab
Usage: gitlab
  Please check https://github.com/gitlabhq/gitlabhq/tree/master/doc/api and

  https://github.com/jdalrymple/node-gitlab/tree/master/src/services to determine the requested options.

  For example:

  In node-gitlab > User > events(userId, options)

  Check https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/events.md#get-user-contribution-events

  So usage: gitlab-user events 17 --sort=asc --target_type=issue


  Options:

    -V, --version                 output the version number
    -c, --config                  Get config
    -h, --help                    output usage information

  Commands:

    url [url]                     Get or Set url of your gitlab website. Please make sure your settings are 'http' or 'https'.
    token [token]                 Get or Set token of gitlab
    groups                        use gitlab-groups
    resource-access-requests      use gitlab-resource-access-requests
    group-access-requests         use gitlab-group-access-requests
    group-badges                  use gitlab-group-badges
    group-custom-attributes       use gitlab-group-custom-attributes
    group-issue-boards            use gitlab-group-issue-boards
    group-members                 use gitlab-group-members
    group-milestones              use gitlab-group-milestones
    group-projects                use gitlab-group-projects
    group-variables               use gitlab-group-variables
    epics                         use gitlab-epics
    epic-issues                   use gitlab-epic-issues
    epic-notes                    use gitlab-epic-notes
    epic-discussions              use gitlab-epic-discussions
    events                        use gitlab-events
    users                         use gitlab-users
    user-custom-attributes        use gitlab-user-custom-attributes
    user-emails                   use gitlab-user-emails
    user-impersonation-tokens     use gitlab-user-impersonation-tokens
    user-keys                     use gitlab-user-keys
    user-gpg-keys                 use gitlab-user-gpg-keys
    branches                      use gitlab-branches
    commits                       use gitlab-commits
    commit-discussions            use gitlab-commit-discussions
    deployments                   use gitlab-deployments
    deploy-keys                   use gitlab-deploy-keys
    environments                  use gitlab-environments
    issues                        use gitlab-issues
    issue-notes                   use gitlab-issue-notes
    issue-discussions             use gitlab-issue-discussions
    issue-award-emojis            use gitlab-issue-award-emojis
    jobs                          use gitlab-jobs
    labels                        use gitlab-labels
    merge-requests                use gitlab-merge-requests
    merge-request-award-emojis    use gitlab-merge-request-award-emojis
    merge-request-discussions     use gitlab-merge-request-discussions
    merge-request-notes           use gitlab-merge-request-notes
    pipelines                     use gitlab-pipelines
    pipeline-schedules            use gitlab-pipeline-schedules
    pipeline-schedule-variables   use gitlab-pipeline-schedule-variables
    projects                      use gitlab-projects
    project-access-requests       use gitlab-project-access-requests
    project-badges                use gitlab-project-badges
    project-custom-attributes     use gitlab-project-custom-attributes
    project-import-export         use gitlab-project-import-export
    project-issue-boards          use gitlab-project-issue-boards
    project-hooks                 use gitlab-project-hooks
    project-members               use gitlab-project-members
    project-milestones            use gitlab-project-milestones
    project-snippets              use gitlab-project-snippets
    project-snippet-notes         use gitlab-project-snippet-notes
    project-snippet-discussions   use gitlab-project-snippet-discussions
    project-snippet-award-emojis  use gitlab-project-snippet-award-emojis
    protected-branches            use gitlab-protected-branches
    project-variables             use gitlab-project-variables
    repositories                  use gitlab-repositories
    repository-files              use gitlab-repository-files
    runners                       use gitlab-runners
    services                      use gitlab-services
    tags                          use gitlab-tags
    todos                         use gitlab-todos
    triggers                      use gitlab-triggers
    push-rule                     use gitlab-push-rule
    application-settings          use gitlab-application-settings
    broadcast-messages            use gitlab-broadcast-messages
    feature-flags                 use gitlab-feature-flags
    geo-nodes                     use gitlab-geo-nodes
    gitignore-templates           use gitlab-gitignore-templates
    git-lab-ciyml-templates       use gitlab-git-lab-ciyml-templates
    keys                          use gitlab-keys
    licence                       use gitlab-licence
    licence-templates             use gitlab-licence-templates
    lint                          use gitlab-lint
    namespaces                    use gitlab-namespaces
    notification-settings         use gitlab-notification-settings
    pages-domains                 use gitlab-pages-domains
    search                        use gitlab-search
    sidekiq-metrics               use gitlab-sidekiq-metrics
    system-hooks                  use gitlab-system-hooks
    version                       use gitlab-version
    wikis                         use gitlab-wikis
    help [cmd]                    display help for [cmd]
gitlab-users
Usage: gitlab-users
  Please check https://github.com/gitlabhq/gitlabhq/tree/master/doc/api and

  https://github.com/jdalrymple/node-gitlab/tree/master/src/services to determine the requested options.

  For example:

  In node-gitlab > User > events(userId, options)

  Check https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/events.md#get-user-contribution-events

  So usage: gitlab-user events 17 --sort=asc --target_type=issue


  Options:

    -V, --version               output the version number
    -c, --config                Get config
    -h, --help                  output usage information

  Commands:

    url [url]                   Get or Set url of your gitlab website. Please make sure your settings are 'http' or 'https'.
    token [token]               Get or Set token of gitlab
    all                         Please check options by official document.
    activities                  This commas has not options.
    projects <userId>           This commas has not options.
    block <userId>              This commas has not options.
    create                      Please check options by official document.
    current|whoami              This commas has not options.
    events <userId>             Please check options by official document.
    session <email> <password>  This commas has not options.
    search <emailOrUsername>    This commas has not options.
    show <userId>               Please check options by official document.
    remove <userId>             This commas has not options.
    unblock <userId>            This commas has not options.

@mdsb100
Copy link
Author

mdsb100 commented Aug 14, 2018

I have no idea about to fix CI error.

@jetersen
Copy link
Contributor

CI issues are on going travis-ci/travis-ci#9965

@jdalrymple
Copy link
Owner

Yea still working on figuring out this travis problem :/

@jdalrymple
Copy link
Owner

Not sure if we should merge this now, or wait to do the mapping first.

@mdsb100
Copy link
Author

mdsb100 commented Aug 15, 2018

@jdalrymple Please allow me to publish by using name cli-gitlab first.
If you plan to merge it, I will give a link to node-gitlab and maintain node-gitlab.

@mdsb100
Copy link
Author

mdsb100 commented Aug 15, 2018

CI passed. Would you think about merge it?

@mdsb100 mdsb100 mentioned this pull request Aug 15, 2018
@jdalrymple
Copy link
Owner

Not quite yet! Ill look over the code tomorrow. I definitely want to add CLI, just need to review things :)

@mdsb100
Copy link
Author

mdsb100 commented Aug 15, 2018

Thanks...

pablobirukov and others added 3 commits August 17, 2018 10:15
* Disable cache on travis

* Fix linter failures

* Disable PushRule test (EE-only feature)
fix working tree with
```
git rm --cached -r .
git reset --hard
```
* Fix incorrectly imported 'wait'
* Updated README to mention that we assume Promise polyfilled
semantic-release-bot and others added 20 commits August 17, 2018 10:15
# [3.8.0](jdalrymple/gitbeaker@3.7.0...3.8.0) (2018-08-14)

### Bug Fixes

* **api:** Updating project members all function to include the inherited members.  [jdalrymple#141](jdalrymple#141) ([e081a16](jdalrymple@e081a16))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.0 ([dc9748d](jdalrymple@dc9748d))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.1 ([12b6ca1](jdalrymple@12b6ca1)), closes [jdalrymple#139](jdalrymple#139)
* **package:** Updating packages and fixing [jdalrymple#140](jdalrymple#140) due to a babel update ([04d1769](jdalrymple@04d1769))

### Features

* Add push rule service ([jdalrymple#143](jdalrymple#143)) ([395f83c](jdalrymple@395f83c))
* Add transfer a project to a new namespace ([jdalrymple#145](jdalrymple#145)) ([87e9f55](jdalrymple@87e9f55))
* Disable cache on travis

* Fix linter failures

* Disable PushRule test (EE-only feature)
fix working tree with
```
git rm --cached -r .
git reset --hard
```
* Fix incorrectly imported 'wait'
* Updated README to mention that we assume Promise polyfilled
# [3.8.0](jdalrymple/gitbeaker@3.7.0...3.8.0) (2018-08-14)

### Bug Fixes

* **api:** Updating project members all function to include the inherited members.  [jdalrymple#141](jdalrymple#141) ([e081a16](jdalrymple@e081a16))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.0 ([dc9748d](jdalrymple@dc9748d))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.1 ([12b6ca1](jdalrymple@12b6ca1)), closes [jdalrymple#139](jdalrymple#139)
* **package:** Updating packages and fixing [jdalrymple#140](jdalrymple#140) due to a babel update ([04d1769](jdalrymple@04d1769))

### Features

* Add push rule service ([jdalrymple#143](jdalrymple#143)) ([395f83c](jdalrymple@395f83c))
* Add transfer a project to a new namespace ([jdalrymple#145](jdalrymple#145)) ([87e9f55](jdalrymple@87e9f55))
# [3.9.0](jdalrymple/gitbeaker@3.8.0...3.9.0) (2018-08-15)

### Bug Fixes

* Fix error while throwing an error in RequestHelper ([jdalrymple#156](jdalrymple#156)) ([177d7fd](jdalrymple@177d7fd))
* Handling errors before retrying request ([jdalrymple#142](jdalrymple#142)) [skip-ci] ([bc3b366](jdalrymple@bc3b366))
* Linting Master ([jdalrymple#157](jdalrymple#157)) ([ab14ed7](jdalrymple@ab14ed7))

### Features

* Add deploy keys enable functionality ([jdalrymple#155](jdalrymple#155)) thanks to [Michael Matzka](https://github.com/mimaidms ) ([66547ad](jdalrymple@66547ad))
Allows to be set service wide or on individual request
fixes jdalrymple#142
# [3.10.0](jdalrymple/gitbeaker@3.9.0...3.10.0) (2018-08-15)

### Features

* Expose reject unauthorized in request helper ([jdalrymple#160](jdalrymple#160)) ([01a2ce2](jdalrymple@01a2ce2)), closes [jdalrymple#142](jdalrymple#142)
* chore(package): update @babel/cli to version 7.0.0-rc.1
* chore(package): update @babel/core to version 7.0.0-rc.1
* chore(package): update @babel/plugin-proposal-object-rest-spread to version 7.0.0-rc.1
* chore(package): update @babel/plugin-transform-runtime to version 7.0.0-rc.1
* chore(package): update @babel/preset-env to version 7.0.0-rc.1
* fix(package): update @babel/runtime to version 7.0.0-rc.1
* chore(package): Updating @semantic-release/npm
* chore(package): Updating eslint to version ^5.3.0 
* chore(package): Updating eslint-config-airbnb to version ^17.1.0 
* chore(package): Updating eslint-plugin-import to version ^2.14.0 
* chore(package): Updating eslint-plugin-jest to version ^21.21.0 
* chore(package): Updating eslint-plugin-react to version ^7.11.1 
* chore(package): Updating regenerator-runtime to version ^0.12.1
* chore: Semantic release should be a dev dependency
* fix(package): Fixing jdalrymple#154
Updated URL to point to correct endpoint
## [3.10.1](jdalrymple/gitbeaker@3.10.0...3.10.1) (2018-08-16)

### Bug Fixes

* Typo in PagesDomains all() method ([jdalrymple#162](jdalrymple#162)) ([128f150](jdalrymple@128f150))
@jcrben
Copy link

jcrben commented Dec 11, 2018

how's this going? 😄

@mdsb100
Copy link
Author

mdsb100 commented Dec 11, 2018

@jdalrymple
Copy link
Owner

Sorry everyone! I put this one on hold until 5.0.0 is released officially. This is the next big thing after that though :D

@jdalrymple
Copy link
Owner

This is the next big thing i want to tackle :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants