CLI to provide easy and fast access to Github PRs and branch management.
npm install plg-cli
Pling Workflow CLI was done to provide easy and fast access to Github PRs and branch management.
These docs are available here, the CLI docs are available here, and you can view all the schema definitions here.
- Getting Started
* What is an App?
* How does the CLI Platform Work
* CLI vs the Web Builder Platform
* Requirements
* Quick Setup Guide
* Tutorial
- Creating a Local App
* Local Project Structure
* Local App Definition
- Registering an App
- Deploying an App Version
* Private App Version (default)
* Sharing an App Version
* Promoting an App Version
- Converting an Existing App
- Authentication
* Basic
* Custom
* Digest
* Session
* OAuth2
- Resources
* Resource Definition
- Triggers/Searches/Creates
* Return Types
- Fields
* Custom/Dynamic Fields
* Dynamic Dropdowns
* Search-Powered Fields
- Z Object
* [z.request([url], options)](#zrequesturl-options)
* z.console(message)
* z.dehydrate(func, inputData)
* [z.stashFile(bufferStringStream, [knownLength], [filename])](#zstashfilebufferstringstream-knownlength-filename)
* z.JSON
* z.hash()
* z.errors
- Bundle Object
* bundle.authData
* bundle.inputData
* bundle.inputDataRaw
* bundle.meta
- Environment
* Defining Environment Variables
* Accessing Environment Variables
- Making HTTP Requests
* Shorthand HTTP Requests
* Manual HTTP Requests
+ POST and PUT Requests
* Using HTTP middleware
* HTTP Request Options
* HTTP Response Object
- Dehydration
- Stashing Files
- Logging
* Console Logging
* Viewing Console Logs
* HTTP Logging
* Viewing HTTP Logs
- Error Handling
* General Errors
* Halting Execution
* Stale Authentication Credentials
- Testing
* Writing Unit Tests
* Running Unit Tests
* Testing & Environment Variables
* Viewing HTTP Logs in Unit Tests
* Testing in your CI (Jenkins/Travis/etc.)
- Using npm Modules
- Using Transpilers
- Example Apps
- Command line Tab Completion
* Zsh Completion Script
* Bash Completion Script
- Development of the CLI
- Publishing of the CLI (after merging)
- Get Help!
A CLI App is an implementation of your app's API. You build a Node.js application
that exports a single object (JSON Schema) and upload it to Pling.
Pling Workflow CLI introspects that definition to find out what your app is capable of and
what options to present end users in the Zap Editor.
For those not familiar with Pling terminology, here is how concepts in the CLI
map to the end user experience:
* Authentication, (usually) which lets us know what credentials to ask users
for. This is used during the "Connect Accounts" section of the Zap Editor.
Triggers, which read data from* your API. These have their own section in the Zap Editor.
Creates, which send data to* your API to create new records. These are listed under "Actions" in the Zap Editor.
Searches, which find specific records in* your system. These are also listed under "Actions" in the Zap Editor.
* Resources, which define an object type in your API (say a contact) and the operations available to perform on it. These are automatically extracted into Triggers, Searches, and Creates.
Pling Workflow CLI takes the App you upload and sends it over to Amazon Web Service's Lambda.
We then make calls to execute the operations your App defines as we execute Zaps.
Your App takes the input data we provide (if any), makes the necessary HTTP calls,
and returns the relevant data, which gets fed back into Pling.
From a user perspective, both the CLI and the existing web builder platform offer the same experience. The biggest difference is how they're developed. The CLI takes a much more code-first approach, allowing you to develop your Pling app just like you would any other programming project. The web builder, on the other hand, is much better for folks who want to make an app with minimal coding involved. Both will continue to coexist, so pick whichever fits your needs best!
All Pling CLI apps are run using Node.js v6.11.0.
You can develop using any version of Node you'd like, but your code has to run on Node v6.10.2. You can accomplish this by developing on your preferred version and then transpiling with Babel (or similar).
To ensure stability for our users, we also require that you run your tests on v6.10.2 as well. If you don't have it available, we recommend using either nvm or n to install v6.10.2 and run the tests locally. On Windows you can use nvm-windows or nodist.
For NVM on Mac (via homebrew):
``bash`
brew install nvm
nvm install v6.10.2
You can then either swap to that version with nvm use v6.10.2, or do nvm exec v6.10.2 plg-workflow test so you can run tests without having to switch versions while developing.
> Be sure to check the Requirements before you start! Also, we recommend the Tutorial for a more thorough introduction.
`bash`install the CLI globally
npm install -g plg-workflow-cli
Your Pling Workflow CLI should be installed and ready to go at this point. Next up, we'll create our first app!
`bashcreate a directory with the minimum required files
zapier init example-app
> Note: there are plenty of templates & example apps to choose from! View all Example Apps here.
You should now have a working local app. You can run several local commands to try it out.
`bash
run the local tests
the same as npm test, but adds some extra things to the environment
zapier test
`Next, you'll probably want to upload app to Zapier itself so you can start testing live.
`bash
push your app to Zapier
zapier push
`> Go check out our full CLI reference documentation to see all the other commands!
$3
For a full tutorial, head over to our wiki for a comprehensive walkthrough for creating your first app. If this isn't your first rodeo, read on!
helpful information about your app
$3
In your app's folder, you should see this general recommended structure. The
index.js is Zapier's entry point to your app. Zapier expects you to export an App definition there.`plain
$ tree .
.
├── README.md
├── index.js
├── package.json
├── triggers
│ └── contact-by-tag.js
├── resources
│ └── Contact.js
├── test
│ ├── basic.js
│ ├── triggers.js
│ └── resources.js
├── build
│ └── build.zip
└── node_modules
├── ...
└── ...
`$3
The core definition of your
App will look something like this, and is what your index.js should provide as the _only_ export:`javascript
const App = {
// both version strings are required
version: require('./package.json').version,
platformVersion: require('plg-workflow-cli').version, // see "Authentication" section below
authentication: {
},
// see "Dehydration" section below
hydrators: {
},
// see "Making HTTP Requests" section below
requestTemplate: {
},
beforeRequest: [
],
afterResponse: [
],
// See "Resources" section below
resources: {
},
// See "Triggers/Searches/Creates" section below
triggers: {
},
searches: {
},
creates: {
}
};
module.exports = App;
`> Tip: you can use higher order functions to create any part of your App definition!
Get Help!
You can get help by either emailing engineers@pling.net.br.
How to use
1. Fork the project
2.
git clone git@github.com:
3. cd
4. npm install
5. plg-cli initCommands
plg-cli start
Começa uma issue a partir de pp.plg-cli start
Começa uma issue a partir de pp incluindo os commits de outra issue que esteja em seu fork local.plg-cli sync
Sincroniza a issue atual com a pp.plg-cli sync
Sincroniza a issue atual com outra issue que esteja em seu fork local.plg-cli deploy
Faz o deploy da issue com a branch ou environment desejado em pull request.plg-cli deploy