Code Monkey home page Code Monkey logo

zapier-platform-cli's People

Contributors

adamd avatar aekaplan avatar antonioortegajr avatar bcooksey avatar benzapier avatar bradleyayers avatar bradleypriest avatar bryanhelmig avatar buildmaster avatar calebpeterson avatar casshill avatar codebycaleb avatar codekirei avatar cvanderkolk avatar eliangcs avatar fokkezb avatar ibolmo avatar ifedapoolarewaju avatar jvaz11 avatar maguay avatar mariatta avatar mjyoung avatar mojowen avatar rebecca-ghazali avatar robwa10 avatar stevelikesmusic avatar stevemolitor avatar ter0 avatar xavdid avatar zanelyon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zapier-platform-cli's Issues

OAuth2 redirect not calling getAccessToken

I'm trying to implement OAuth2 and it's failing after the redirect stage.

image

I have put a z.console.log in the getAccessToken function and it is never being called. Any ideas what the problem could be?

To clarify, it is hitting the authorize endpoint fine, and redirecting to redirect_uri with a code generated by our server.

AdditionalProperty exists in instance when not allowed

Hi I'm just trying to build and publish a sample app and with any app i try I always get these issue

`zapier validate
Validating project locally.

┌─────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Property │ App.creates.recipe │
│ Message │ additionalProperty "sample" exists in instance when not allowed │
│ Links │ https://github.com/zapier/zapier-platform-schema/blob/v1.0.10/docs/build/schema.md#createschema
│ │
│ Property │ App.creates.recipe │
│ Message │ additionalProperty "outputFields" exists in instance when not allowed │
│ Links │ https://github.com/zapier/zapier-platform-schema/blob/v1.0.10/docs/build/schema.md#createschema
└─────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────`

`zapier build` doesn't directly call `zapier validate`

I noticed this when making a validation-related fix. zapier build says it validates your project. It uses _appCommandZapierWrapper, which in turn wraps core's schemaTools.validateApp(source).

This is mostly fine, but that means any extra validation that happens as part of the validate command (in this case, running style checks), only happens when validate is called directly, but not during build.

Resolution would be to wrap the validate command in cli rather than going straight to core.

Add build numbers to identify multiple pushes of the same version

See discussion for reasoning behind changing this to a FR to support build numbers


Actual

I was able to publish an updated app without bumping its version.

Expected

I'd think publish would fail, telling me to bump the version to publish an update.

Like the README says:

An App Version is related to a specific App but is an "immutable" implementation of your app.

(Side) Notes

Maybe we should also consider following semver here? If an update is a patch or minor bump we should be able to migrate zaps without breaking them. If it is a major bump then we can't.

Error with scaffold

Version:

zapier-platform-cli/0.9.9
node/v4.3.2

I was trying to add a trigger to my app and got the following. search and action work fine

zapier scaffold trigger "Game" --debug
Adding trigger scaffold to your project.


ReferenceError: INPUT_FIELDS is not defined
    at eval (lodash.templateSources[5]:23:11)
    at /Users/david/projects/zapier-platform-cli/lib/commands/scaffold.js:53:69
    at run (/Users/david/projects/zapier-platform-cli/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:87:22)
    at /Users/david/projects/zapier-platform-cli/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:100:28
    at flush (/Users/david/projects/zapier-platform-cli/node_modules/babel-polyfill/node_modules/core-js/modules/_microtask.js:18:9)
    at nextTickCallbackWith0Args (node.js:415:9)
    at process._tickDomainCallback (node.js:385:13)

Error!

Zapier Validate searchOrCreate from resource problem

When validating app with a resource that have list, search and create app tries to add searchOrCreate based on that resource, on validation it throws an error:

[ { "Property": "App.searchOrCreates.contactSearchOrCreate.display.description", "Message": "does not meet minimum length of 12", "Links": "" }, { "Property": "App.searchOrCreates.contactSearchOrCreate.key", "Message": "must match a \"key\" from a search (options: contactSearch)", "Links": "https://github.com/zapier/zapier-platform-schema/blob/v1.0.3/docs/build/schema.md#searchorcreateschema" } ]

I've tried to work it arround by manualy adding this searchOrCreate but I still got error

[ { "Property": "App.searchOrCreates.contactSearchOrCreate.key", "Message": "must match a \"key\" from a search (options: contactSearch)", "Links": "https://github.com/zapier/zapier-platform-schema/blob/v1.0.3/docs/build/schema.md#searchorcreateschema" } ]

It appears even if I add that key manualy with contactSearch value

Validate after Scaffold Resource throws 2 errors for searchOrCreates

After using scaffold to create a new resource, I get the following validation errors:

┌─────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Property    │ App.searchOrCreates.clientSearchOrCreate.display.description                                           │
│ Message     │ does not meet minimum length of 12                                                                     │
│ Links       │                                                                                                        │
│                                                                                                                      │
│ Property    │ App.searchOrCreates.clientSearchOrCreate.key                                                           │
│ Message     │ must match a "key" from a search (options: clientSearch)                                               │
│ Links       │ https://github.com/zapier/zapier-platform-schema/blob/v1.0.3/docs/build/schema.md#searchorcreateschema │
└─────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────┘

The only way I can get the app to pass validation is to remove the search method from the client resource export. I don't see a way to specify the required description.

Unable to pass `--use_strict` as a flag during app validation

Hey there! I'd like to use block-scoped declarations without manually specifying "use strict" at the top of every javascript file. An alternate way of doing this is to pass the --use_strict flag to node or npm when the app is run.

I've figured out how to do so so that zapier test runs (added it to the "test" command in package.json), but I'm unsure of how to do so for zapier validate. Is there a way I can pass build flags to commands such as that?

Conditional requires

It's nice to conditionally require() modules like so:

if (process.env.NODE_ENV !== 'production' && !process.env.RIOT_API_KEY) {
  require('dotenv').load()
}

produces the following error:

Error: Cannot find module 'dotenv' from '/private/var/folders/dg/c2gwj6zx2n9_9zxsb4typ63m0000gn/T/zapier-a5d3418b'
    at /Users/david/.nvm/versions/node/v6.6.0/lib/node_modules/zapier-platform-cli/node_modules/resolve/lib/async.js:46:17
    at process (/Users/david/.nvm/versions/node/v6.6.0/lib/node_modules/zapier-platform-cli/node_modules/resolve/lib/async.js:173:43)
    at ondir (/Users/david/.nvm/versions/node/v6.6.0/lib/node_modules/zapier-platform-cli/node_modules/resolve/lib/async.js:188:17)
    at load (/Users/david/.nvm/versions/node/v6.6.0/lib/node_modules/zapier-platform-cli/node_modules/resolve/lib/async.js:69:43)
    at onex (/Users/david/.nvm/versions/node/v6.6.0/lib/node_modules/zapier-platform-cli/node_modules/resolve/lib/async.js:92:31)
    at /Users/david/.nvm/versions/node/v6.6.0/lib/node_modules/zapier-platform-cli/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:123:15)

I realize this specific action can use zapier.tools.env.inject(), but it's still sometimes a useful pattern for testing

Depreciate String into appTester function?

I've been using what I think is a much less magical way to test methods:

const App = require('../index');
const appTester = zapier.createAppTester(App);

// prefer:
appTester(App.authentication.test);
// instead of:
appTester('authentication.test');

// prefer:
appTester(App.resources.member.list.operation.perform);
// instead of:
appTester('member.list');

Test on Windows 7

We need to make sure the "tutorial" section works fine on Windows 7 as a part of QA'ing releases.

altersDynamicFields not being respected

Some partners have reported an issue where inputFields with altersDynamicFields: true not being properly refreshed in the Zapier editor unless the "Refresh fields" button is clicked.

Some sample code:

const objectField = (z, bundle) => {
  const appId = bundle.inputData.application_id;
  if (!appId) return [];

  return z.request('someUrl')
    .then(res => {
      return [{
        key: 'object_id',
        required: true,
        label: 'Object',
        choices: jsonArrayToChoices(res.json.data),
       }];
    });
};

...
    inputFields: [
      {
        key: 'application_id',
        required: true,
        label: 'Application',
        dynamic: 'applicationList.id.name',
        altersDynamicFields: true
      },
      objectField,
    ],
...

This is has been confirmed and a solution is being investigated.

files.js fixhome function isn't properly refactoring the dir parameter

Found while using "zapier init appname --template=minimal"

Issue: Instead of replacing the start of the path by Home or UserProfile, FixHome function replace just the '~' and broke the path.

Here's an exemple:

Path before replace : "C:\Users\USERUS~1\AppData\Local\Temp\tmp-14492zVmPdO8Gh1LA"
Path after : "C:\Users\USERRGC:\Users\useruserus1\AppData\Local\Temp\tmp-26552m3v9enWUHF3D\zapier-template.zip"

Path after (with indication) : C:\Users\USERRG [[[C:\Users\useruserus]]] 1\AppData\Local\Temp\tmp-26552m3v9enWUHF3D\zapier-template.zip

Sugestion: Make a substring of the start of the path (between start and first index of '~')

After recent upgrade to version 2.0.0, AppTester is not working anymore

I have an App using Zapier CLI 1.0.x and today I decided to upgrade to the latest version, and suddenly all integration tests working with appTester are not working anymore.

After the App is deployed, everything is still working on Zapier.com, the problem occurs only with AppTester while running the mocha tests.

These are the steps I executed for the upgrade:

  • Upgraded Node to 6.10.2
  • Upgraded zapier-platform-core to 2.0.0
  • Upgraded Mocha to 3.4.2

Now, if I try to execute any test with appTester, for example like this one which is working fine on Zapier 1.0.1, I get an odd error from the Zapier Core Framework:

    it.('should authenticate service account', (done) => {

        const bundle = {
            authData: {
                username: process.env.DEMO_USERNAME,
                password: process.env.DEMO_PASSWORD,
                tenant_id: process.env.DEMO_TENANT
            }
        };

        appTester(Auth.authentication.sessionConfig.perform, bundle)
            .then((result) => {
                result.access_token.should.not.be.null();
                result.refresh_token.should.not.be.null();
                result.username.should.not.be.null();
                result.user_id.should.not.be.null();
                result.appUserId.should.not.be.null();
                done();
            })
            .catch(done);
    });

I get a very strange exception which I don't understand where is coming from:

Unhandled rejection SyntaxError: Invalid regular expression: /C:\Program Files\Microsoft MPI\Bin\/: \ at end of pattern
    at RegExp (native)
    at Object.keys.forEach (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\zapier-platform-core\src\tools\cleaner.js:38:18)
    at Array.forEach (native)
    at replacer (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\zapier-platform-core\src\tools\cleaner.js:36:23)
    at recurseReplace (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\zapier-platform-core\src\tools\data.js:99:11)
    at Object.recurseReplaceBank (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\zapier-platform-core\src\tools\cleaner.js:43:10)
    at sendLog (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\zapier-platform-core\src\tools\create-logger.js:89:30)
    at logErrorAndCallbackOnce (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\zapier-platform-core\src\tools\create-lambda-handler.js:60:7)
    at Object.app.then.catch (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\zapier-platform-core\src\tools\create-lambda-handler.js:93:11)
    at bound (domain.js:280:14)
    at Object.runBound (domain.js:293:12)
    at Object.tryCatcher (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromise0 (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\bluebird\js\release\promise.js:689:18)
    at Async._drainQueue (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\DEV\GITHUB\ServiceHubCore\src\Mp.Sh.Zapier\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:666:20)
    at tryOnImmediate (timers.js:639:5)
    at processImmediate [as _immediateCallback] (timers.js:611:5)

Improve RESTHook Example or Docs

The RESTHook example is fine to get started, but I think it could have some extra information.

For instance, I'm working with a legacy codebase. When you create a webhook, all events go to the URL you've provided. You can't subscribe to just one event.

With this in mind, I've created a RESTHook-style controller in our app. You can preform CRUD actions on webhooks, but you still get subscribed to every event. However, each event has it's name in the response, like so:

{
  "event": "user.create",
  "id": 0,
  // ...
}

In short, here's what I'm wondering:

  • What is the preferred way to filter events so that each trigger only responds to the appropriate event? I wouldn't want the order.create trigger firing on user.update.
  • Is there a setter for bubdle.targetUrl? If my webhook broadcasts on any event, it would be best to subscribe a trigger to an existing webhook instead of making a new, redundant webhook each time. I guess I'm looking to create an upsert-style function for bundle.targtUrl

I've looked in the examples and the docs, but I couldn't find anything that touches on this. Any advice or links are appreciated! I'd also be happy to make a PR with updated docs if I sort this out.

Thank you!

Add support for OAuth 1.0a

There's still a lot of Oauth 1.0a apps which are poorly supported by the Web UI. A template based on oauth2 to accelerate development would be super helpful.

Update tutorial to refer to different file names

The tutorial has readers bounce back and forth between app/index.js and test/index.js. To make reading easier, it might be helpful to rename the test file to test/tests.js so there is more of a distinction when we reference each.

Error message could be improved when app cannot be found

When absentmindedly executing zapier [whatever] from the wrong folder, the returned error message is:

Looks like your package.json is missing zapier-platform-core or you haven't run npm install yet!

Potentially something like the following might help:

Could not find your Zapier CLI app. Hint: Are you in the same folder as your `index.js` file?

Create Example App for Files

It would be helpful to have an example app that shows how to read files. Key points to cover:

  • Dehydration + z.stashFile() pattern
  • Writing a file

zapier convert is not converting Sample Data correctly

zapier convert XXX is producing Sample Data like so:

module.exports = {
  key: 'new_completed_ride',
  noun: 'Completed Ride',

  display: {
    label: 'New Completed Ride',
    description: 'Triggers when you complete a ride.'
  },

  operation: {
    inputFields: [

    ],
    sample: {
      destination__address: {
        type: 'string',
        label: 'undefined'
      },
      destination__eta_seconds: {
        type: 'string',
        label: 'undefined'
      },
      destination__lat: {
        type: 'string',
        label: 'undefined'
      },
      destination__lng: {
        type: 'string',
        label: 'undefined'
      },
      driver__first_name: {
        type: 'string',
        label: 'undefined'
      }
    },

    perform: triggerNewcompletedride
  }
};

This should not be the case but instead something along the lines of {vehicle__model: 'example text'}

Validate should check that generated keys from resources do not collide with manually defined keys

When Zapier turns a resource into corresponding triggers/searches/creates, we auto-compute a key for those generated operations. For example, if an app has a resource called "contact", the key for that action/create would be "contactCreate".

What happens if there's already an action defined with that key? We should have validate raise an error so the dev knows to give the standalone action a new key.

Error when `build` folder not found

I was following along to the Zapier CLI Tutorial and ran into an error with zapier push.

image

Peeling back the onion, found that is just an alias for zapier build and zapier upload. Turns out there was an error if the build folder doesn't exist.

image

It would be good if either:

a) the default project template just included an empty build folder
b) zapier build would create the build folder if it doesn't exist

Document --remove for env

When you do zapier help env, the docs do not mention that you can use --remove to delete an environment variable.

zapier link is confusing when failing (EG: trying to link a v2 app)

I've been trying to link an app using zapier link and all I'm getting is this:

 zapier link                      

Which app number do you want to link? (Ctrl-C to cancel) 58305
Which app number do you want to link? (Ctrl-C to cancel) 58305
Which app number do you want to link? (Ctrl-C to cancel) 58305
Which app number do you want to link? (Ctrl-C to cancel) 

It doesn't do anything and just keeps asking for the number.

Docs Improvement

We're missing quite a few documentation sections:

  • Dynamic dropdown fields
  • z.errors and their effects
  • general "error handling" guidance (it is common for folks to throw away the errors)
  • general description of standard "flow" for oauth 2
  • high level description of architecture (basically RPC into AWS Lambda)
  • REST hooks (and example apps)
  • Inline docs for schema need some love. zapier/zapier-platform-schema#12
  • In the basic example app, the test for “style” is weird because it still passes even if you nuke the param. The test should check the request object or something so that removing the bundle/param caused the test to fail
  • Update tutorial to use code snippets that match the breaking changes
  • Show example for usage of dynamic in inputFields
  • Show example for usage of search in inputFields
  • ~~~Show example for usage of dict in inputFields~~~ Can circle back to this when we decide if we want to give detailed docs for every option
  • converting v2 apps
  • Maybe call out resources in the tutorial better so devs know they are there
  • file example app
  • The hosted docs at zapier.github.io have an issue with sub-navigation. Anything that contains a / or a ( does not follow the anchor.

Update the changelog

The CHANGELOG seems to be out of date.

Can you keep this in sync with any changes to make it easier to review for potential issues when updating?

Clarify `altersDynamicFields` should be set for custom fields no matter what

In https://zapier.github.io/zapier-platform-cli/#dynamic-dropdowns we say:

Dynamic dropdowns are one of the few fields that automatically invalidate Zapier's field cache, so it is not necessary to set altersDynamicFields to true for these fields.

That's true only for non-custom fields, so we should make that clearer.

Basically, if your static field is a dynamic dropdown but doesn't have altersDynamicFields, and it alters custom fields, it needs to be set regardless.

Environment improvements

A couple of tweaks could be cool:

  1. It would be great if the version number were optional and defaulted to the most recent version. Especially when adding new variables, which is pretty safe (editing and removing less so)
  2. zapier env 1.0.0 gives an error before 1.0.0 is registered- this makes sense. However, it seems counterintuitive to push a version before required variables are set (say, an API key). Not sure what the best course here is, maybe encouraging to publish right away? Or register pushes a 0.0.0 just to push against?
  3. One of my favorite heroku features (so much so that I wrote the most recent version of it) is the ability to sync the env to and from the platform. Similar functionality would be a nice-to-have for sure!

Upgrade supported node versions?

Node.js had a severe vulnerability patched recently. It involves bumping versions on v4 and v6. We have code that explicitly checks the versions of node used. Wondering if we should update those checks to the new versions.

Bit tricky, as it would be good for us to patch the CLI tool to support the updated versions. However, we've pegged cli and core to the node versions that AWS Lambda supports. At this point, our options are:

  • Bump CLI tool now, leave core lib until Lambda supports update
  • Wait on both until Lambda updates
  • Maybe lambda never updates, so we don't care?

Don't print help docs on error.

It obscures the error message:

$ zapier init
Initializes a new Zapier app in a directory.

Usage: `zapier init path`

Initializes a new Zapier app. If you specify a template, will download and install the app from that template.

After running this, you'll have a new example app in your directory. If you re-run this command on an existing directory it will leave existing files alone and not clobber them.

> Note: this doesn't register or deploy the app with Zapier - try zapier register "Example" and zapier push for that!

**Arguments**

* location [value] -- **required**,
* --template={minimal,resource,trigger,create,search,middleware,basic-auth,custom-auth,oauth2,session-auth,babel} -- _optional_, select a starting app template. Default is minimal

$ zapier init example-app --template=minimal
# Let's initialize your app!
#
#   Downloading zapier/zapier-platform-example-app-minimal starter app - done!
#   Copy /users/username/code/example-app/.gitignore - done!
#   Copy /users/username/code/example-app/index.js - done!
#   Copy /users/username/code/example-app/package.json - done!
#   Copy /users/username/code/example-app/test/index.js - done!
#
# Finished! You might need to npm install then try zapier test!

Errors running command `zapier init`:

!!!   Missing required positional argument 1/location

Probably better would be:

$ zapier init
Errors running command `zapier init`. Try `zapier help init` for more information.

!!!   Missing required positional argument 1/location

Paths in `zapier test` backtraces are `:censored`

When an error occurs during zapier test the paths in the backtrace are unusable because fragments of it are replaced with :censored:....:

Unhandled error: TypeError: Cannot read property 'access_token' of undefined
What happened:
  Starting POST request to :censored:47:3d9c3163dc:/access-token
  Cannot read property 'access_token' of undefined
TypeError: Cannot read property 'access_token' of undefined
    at includeBearerToken (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/:censored:8:b54be9c67e::11:22)
    at Object.<anonymous> (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/node_modules/zapier-platform-core/src/middleware.js:66:23)
    at bound (domain.js:287:14)
    at Object.runBound (domain.js:300:12)
    at Object.tryCatcher (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/:censored:7:7a4bc07188:/git/:censored:34:c5fb744411:/node_modules/bluebird/js/release/async.js:17:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
    1) can fetch an access token

Default init path to CWD (like NPM init)

Currently if you leave out the path it neither refuses to run nor complete successfully. It should do either, and my suggestion is to default to the current working directory, like npm init does.

MacBook-Pro-van-Fokke:swagger fokkezb$ zapier init
Initializes a new Zapier app in a directory.

Usage: `zapier init path`

Initializes a new Zapier app. If you specify a template, will download and install the app from that template.

After running this, you'll have a new example app in your directory. If you re-run this command on an existing directory it will leave existing files alone and not clobber them.

> Note: this doesn't register or deploy the app with Zapier - try zapier register "Example" and zapier push for that!

**Arguments**

* location [value] -- **required**,
* --template={minimal,resource,trigger,create,search,middleware,basic-auth,custom-auth,oauth2,session-auth,babel} -- _optional_, select a starting app template. Default is minimal

$ zapier init example-app --template=minimal
# Let's initialize your app!
#
#   Downloading zapier/zapier-platform-example-app-minimal starter app - done!
#   Copy /users/username/code/example-app/.gitignore - done!
#   Copy /users/username/code/example-app/index.js - done!
#   Copy /users/username/code/example-app/package.json - done!
#   Copy /users/username/code/example-app/test/index.js - done!
#
# Finished! You might need to npm install then try zapier test!

Errors running command `zapier init`:

!!!   Missing required positional argument 1/location

MacBook-Pro-van-Fokke:swagger fokkezb$ zapier init .
Welcome to the Zapier Platform! :-D

                zzzzzzzz
      zzz       zzzzzzzz       zzz
    zzzzzzz     zzzzzzzz     zzzzzzz
   zzzzzzzzzz   zzzzzzzz   zzzzzzzzzz
      zzzzzzzzz zzzzzzzz zzzzzzzzz
        zzzzzzzzzzzzzzzzzzzzzzzz
          zzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzz          zzzzzzzzzzzzzzz
zzzzzzzzzzzzzzz          zzzzzzzzzzzzzzz
zzzzzzzzzzzzzzz          zzzzzzzzzzzzzzz
zzzzzzzzzzzzzzz          zzzzzzzzzzzzzzz
          zzzzzzzzzzzzzzzzzzzz
        zzzzzzzzzzzzzzzzzzzzzzzz
      zzzzzzzzz zzzzzzzz zzzzzzzzz
   zzzzzzzzzz   zzzzzzzz   zzzzzzzzzz
    zzzzzzz     zzzzzzzz     zzzzzzz
      zzz       zzzzzzzz       zzz
                zzzzzzzz

Let's initialize your app!

  Downloading zapier/zapier-platform-example-app-minimal starter app - done!
  Copy /Users/fokkezb/Documents/Zapier/Code/swagger/.gitignore - done!
  Copy /Users/fokkezb/Documents/Zapier/Code/swagger/index.js - done!
  Copy /Users/fokkezb/Documents/Zapier/Code/swagger/package.json - done!
  Copy /Users/fokkezb/Documents/Zapier/Code/swagger/test/index.js - done!

Finished! You might need to `npm install` then try `zapier test`!

Windows: zapier push fails because build's node_modules folder is empty

C:\Program Files\nodejs\node_modules\npm\zapier-example>zapier push --debug
Preparing to build and upload your app.

>> GET https://zapier.com/api/platform/cli/check
<< 200
<< {"success": true}

  Copying project to temp directory     done!
  Installing project dependencies .

Running npm.cmd install --production command in C:\Users\allen\AppData\Local\Te
p\zapier-536ab35f:

..


    done!
  Applying entry point file ...
Error: : File C:\Users\allen\AppData\Local\Temp\zapier-536ab35f/node_modules/za
ier-platform-core/include/zapierwrapper.js not found.
    at C:\Users\allen\AppData\Roaming\npm\node_modules\zapier-platform-cli\lib\
tils\files.js:31:11

Error!

C:\Program Files\nodejs\node_modules\npm\zapier-example>npm version
{ 'zapier-platform-example-app-trigger': '1.0.0',
  npm: '4.6.1',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '57.1',
  modules: '48',
  node: '6.9.1',
  openssl: '1.0.2j',
  uv: '1.9.1',
  v8: '5.1.281.84',
  zlib: '1.2.8' }

Rely on ZAPIER_BASE_ENDPOINT when printing output

Right now commands like zapier convert and zapier push are hard-coded to print messages that refer to zapier.com. Would be helpful for local development and also beta testing if it correctly checked ZAPIER_BASE_ENDPOINT.

PATCH requests don't appear in logs

Actual Behavior

Running the command zapier logs —type=http outputs the HTTP requests, but they do not seem to include PATCH requests made by the app.

Expected Behavior

Patch requests should also be listed

Theories

None at the moment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.