diff --git a/example-apps/babel/src/index.js b/example-apps/babel/src/index.js index b3babc1b1..906adc904 100644 --- a/example-apps/babel/src/index.js +++ b/example-apps/babel/src/index.js @@ -14,14 +14,14 @@ const App = { afterResponse: [], resources: { - [Recipe.key]: Recipe, + [Recipe.key]: Recipe }, triggers: {}, searches: {}, - creates: {}, + creates: {} }; export default App; diff --git a/example-apps/create/index.js b/example-apps/create/index.js index 8c4e023ea..dc26a8c91 100644 --- a/example-apps/create/index.js +++ b/example-apps/create/index.js @@ -21,8 +21,8 @@ const App = { // If you want your creates to show up, you better include it here! creates: { - [recipe.key]: recipe, - }, + [recipe.key]: recipe + } }; // Finally, export the app. diff --git a/example-apps/create/test/creates.js b/example-apps/create/test/creates.js index 2b6f6e457..ee9dcd755 100644 --- a/example-apps/create/test/creates.js +++ b/example-apps/create/test/creates.js @@ -9,17 +9,17 @@ const appTester = zapier.createAppTester(App); describe('creates', () => { describe('create recipe create', () => { - it('should create a new recipe', (done) => { + it('should create a new recipe', done => { const bundle = { inputData: { name: 'Smith Family Recipe', directions: '1. Order out :)', - authorId: 1, - }, + authorId: 1 + } }; appTester(App.creates.recipe.operation.perform, bundle) - .then((result) => { + .then(result => { result.should.have.property('name'); done(); }) diff --git a/example-apps/github/samples/sample_issue.js b/example-apps/github/samples/sample_issue.js index 1906f3ca9..1a1e64fa0 100644 --- a/example-apps/github/samples/sample_issue.js +++ b/example-apps/github/samples/sample_issue.js @@ -31,7 +31,7 @@ module.exports = { events_url: 'https://api.github.com/users/octocat/events{/privacy}', received_events_url: 'https://api.github.com/users/octocat/received_events', type: 'User', - site_admin: false, + site_admin: false }, labels: [ { @@ -39,8 +39,8 @@ module.exports = { url: 'https://api.github.com/repos/octocat/Hello-World/labels/bug', name: 'bug', color: 'f29513', - default: true, - }, + default: true + } ], assignee: { login: 'octocat', @@ -60,7 +60,7 @@ module.exports = { events_url: 'https://api.github.com/users/octocat/events{/privacy}', received_events_url: 'https://api.github.com/users/octocat/received_events', type: 'User', - site_admin: false, + site_admin: false }, assignees: [ { @@ -83,8 +83,8 @@ module.exports = { received_events_url: 'https://api.github.com/users/octocat/received_events', type: 'User', - site_admin: false, - }, + site_admin: false + } ], milestone: { url: 'https://api.github.com/repos/octocat/Hello-World/milestones/1', @@ -116,14 +116,14 @@ module.exports = { received_events_url: 'https://api.github.com/users/octocat/received_events', type: 'User', - site_admin: false, + site_admin: false }, open_issues: 4, closed_issues: 8, created_at: '2011-04-10T20:09:31Z', updated_at: '2014-03-03T18:58:10Z', closed_at: '2013-02-12T13:22:01Z', - due_on: '2012-10-09T23:39:01Z', + due_on: '2012-10-09T23:39:01Z' }, locked: false, comments: 0, @@ -131,7 +131,7 @@ module.exports = { url: 'https://api.github.com/repos/octocat/Hello-World/pulls/1347', html_url: 'https://github.com/octocat/Hello-World/pull/1347', diff_url: 'https://github.com/octocat/Hello-World/pull/1347.diff', - patch_url: 'https://github.com/octocat/Hello-World/pull/1347.patch', + patch_url: 'https://github.com/octocat/Hello-World/pull/1347.patch' }, closed_at: null, created_at: '2011-04-22T13:33:48Z', @@ -154,6 +154,6 @@ module.exports = { events_url: 'https://api.github.com/users/octocat/events{/privacy}', received_events_url: 'https://api.github.com/users/octocat/received_events', type: 'User', - site_admin: false, - }, + site_admin: false + } }; diff --git a/example-apps/github/samples/sample_repo_list.js b/example-apps/github/samples/sample_repo_list.js index c9c03f4be..5b0641da1 100644 --- a/example-apps/github/samples/sample_repo_list.js +++ b/example-apps/github/samples/sample_repo_list.js @@ -18,7 +18,7 @@ module.exports = { events_url: 'https://api.github.com/users/octocat/events{/privacy}', received_events_url: 'https://api.github.com/users/octocat/received_events', type: 'User', - site_admin: false, + site_admin: false }, name: 'Hello-World', full_name: 'octocat/Hello-World', @@ -109,7 +109,7 @@ module.exports = { permissions: { admin: false, push: false, - pull: true, + pull: true }, allow_rebase_merge: true, allow_squash_merge: true, @@ -121,6 +121,6 @@ module.exports = { name: 'MIT License', spdx_id: 'MIT', url: 'https://api.github.com/licenses/mit', - html_url: 'https://choosealicense.com/licenses/mit/', - }, + html_url: 'https://choosealicense.com/licenses/mit/' + } }; diff --git a/example-apps/middleware/test/triggers.js b/example-apps/middleware/test/triggers.js index be4b3c36d..ea9cb1c8c 100644 --- a/example-apps/middleware/test/triggers.js +++ b/example-apps/middleware/test/triggers.js @@ -9,9 +9,9 @@ const appTester = zapier.createAppTester(App); describe('triggers', () => { describe('new recipe trigger', () => { - it('should load recipes', (done) => { + it('should load recipes', done => { appTester(App.triggers.recipe.operation.perform) - .then((results) => { + .then(results => { results.should.be.an.Array(); results.length.should.be.above(1); @@ -31,9 +31,9 @@ describe('triggers', () => { }); describe('new movie trigger', () => { - it('should load movies', (done) => { + it('should load movies', done => { appTester(App.triggers.movie.operation.perform) - .then((results) => { + .then(results => { results.should.be.an.Array(); results.length.should.be.above(1); diff --git a/example-apps/oauth1-tumblr/authentication.js b/example-apps/oauth1-tumblr/authentication.js index 9cd9d7779..e2ca50cd7 100644 --- a/example-apps/oauth1-tumblr/authentication.js +++ b/example-apps/oauth1-tumblr/authentication.js @@ -22,14 +22,14 @@ const config = { oauth_consumer_key: '{{process.env.CLIENT_ID}}', oauth_consumer_secret: '{{process.env.CLIENT_SECRET}}', oauth_signature_method: 'HMAC-SHA1', - oauth_callback: '{{bundle.inputData.redirect_uri}}', - }, + oauth_callback: '{{bundle.inputData.redirect_uri}}' + } }, authorizeUrl: { url: AUTHORIZE_URL, params: { - oauth_token: '{{bundle.inputData.oauth_token}}', - }, + oauth_token: '{{bundle.inputData.oauth_token}}' + } }, getAccessToken: { url: ACCESS_TOKEN_URL, @@ -39,14 +39,14 @@ const config = { oauth_consumer_secret: '{{process.env.CLIENT_SECRET}}', oauth_token: '{{bundle.inputData.oauth_token}}', oauth_token_secret: '{{bundle.inputData.oauth_token_secret}}', - oauth_verifier: '{{bundle.inputData.oauth_verifier}}', - }, - }, + oauth_verifier: '{{bundle.inputData.oauth_verifier}}' + } + } }, test: { - url: 'https://api.tumblr.com/v2/user/info', + url: 'https://api.tumblr.com/v2/user/info' }, - connectionLabel: getConnectionLabel, + connectionLabel: getConnectionLabel }; // A middleware that is run before z.request() actually makes the request. Here we're @@ -64,7 +64,7 @@ const includeAccessToken = (req, z, bundle) => { oauth_consumer_key: process.env.CLIENT_ID, oauth_consumer_secret: process.env.CLIENT_SECRET, oauth_token: bundle.authData.oauth_token, - oauth_token_secret: bundle.authData.oauth_token_secret, + oauth_token_secret: bundle.authData.oauth_token_secret }); } return req; @@ -72,5 +72,5 @@ const includeAccessToken = (req, z, bundle) => { module.exports = { config, - includeAccessToken, + includeAccessToken }; diff --git a/example-apps/oauth1-tumblr/index.js b/example-apps/oauth1-tumblr/index.js index 879dfaeda..5186452fe 100644 --- a/example-apps/oauth1-tumblr/index.js +++ b/example-apps/oauth1-tumblr/index.js @@ -20,14 +20,14 @@ const App = { // If you want your trigger to show up, you better include it here! triggers: { - [LikeTrigger.key]: LikeTrigger, + [LikeTrigger.key]: LikeTrigger }, // If you want your searches to show up, you better include it here! searches: {}, // If you want your creates to show up, you better include it here! - creates: {}, + creates: {} }; // Finally, export the app. diff --git a/example-apps/oauth1-tumblr/test/index.js b/example-apps/oauth1-tumblr/test/index.js index 84cb64d92..b215c3578 100644 --- a/example-apps/oauth1-tumblr/test/index.js +++ b/example-apps/oauth1-tumblr/test/index.js @@ -9,7 +9,7 @@ require('should'); // const appTester = zapier.createAppTester(App); describe('My App', () => { - it('should test something', (done) => { + it('should test something', done => { const x = 1; x.should.eql(1); diff --git a/example-apps/oauth1-twitter/index.js b/example-apps/oauth1-twitter/index.js index 879dfaeda..5186452fe 100644 --- a/example-apps/oauth1-twitter/index.js +++ b/example-apps/oauth1-twitter/index.js @@ -20,14 +20,14 @@ const App = { // If you want your trigger to show up, you better include it here! triggers: { - [LikeTrigger.key]: LikeTrigger, + [LikeTrigger.key]: LikeTrigger }, // If you want your searches to show up, you better include it here! searches: {}, // If you want your creates to show up, you better include it here! - creates: {}, + creates: {} }; // Finally, export the app. diff --git a/example-apps/oauth1-twitter/triggers/like.js b/example-apps/oauth1-twitter/triggers/like.js index b2cc4495b..baf2727a5 100644 --- a/example-apps/oauth1-twitter/triggers/like.js +++ b/example-apps/oauth1-twitter/triggers/like.js @@ -4,12 +4,12 @@ module.exports = { display: { label: 'New Like', - description: 'Triggers when you like a tweet.', + description: 'Triggers when you like a tweet.' }, operation: { perform: { - url: 'https://api.twitter.com/1.1/favorites/list.json', + url: 'https://api.twitter.com/1.1/favorites/list.json' }, sample: { coordinates: null, @@ -21,9 +21,10 @@ module.exports = { entities: { urls: [], hashtags: [], - user_mentions: [], + user_mentions: [] }, - text: "Note to self: don't die during off-peak hours on a holiday weekend.", + text: + "Note to self: don't die during off-peak hours on a holiday weekend.", contributors: null, id: 243014525132091400, retweet_count: 0, @@ -48,8 +49,8 @@ module.exports = { profile_link_color: '2FC2EF', entities: { description: { - urls: [], - }, + urls: [] + } }, favourites_count: 594, url: null, @@ -81,7 +82,7 @@ module.exports = { statuses_count: 2629, following: true, screen_name: 'theSeanCook', - show_all_inline_media: true, + show_all_inline_media: true }, place: { name: 'San Francisco', @@ -96,15 +97,15 @@ module.exports = { [-122.51368188, 37.70813196], [-122.35845384, 37.70813196], [-122.35845384, 37.83245301], - [-122.51368188, 37.83245301], - ], + [-122.51368188, 37.83245301] + ] ], - type: 'Polygon', + type: 'Polygon' }, full_name: 'San Francisco, CA', - place_type: 'city', + place_type: 'city' }, - in_reply_to_status_id: null, - }, - }, + in_reply_to_status_id: null + } + } }; diff --git a/example-apps/onedrive/.eslintrc.json b/example-apps/onedrive/.eslintrc.json index 61203657d..454c3349d 100644 --- a/example-apps/onedrive/.eslintrc.json +++ b/example-apps/onedrive/.eslintrc.json @@ -11,19 +11,19 @@ "comma-spacing": 2, "consistent-return": 2, "curly": [2, "all"], - "dot-notation": [2, { "allowKeywords": true }], + "dot-notation": [2, {"allowKeywords": true}], "eol-last": 2, "eqeqeq": [2, "smart"], "indent": [2, 2], "jsx-quotes": [2, "prefer-double"], - "key-spacing": [2, { "beforeColon": false, "afterColon": true }], + "key-spacing": [2, {"beforeColon": false, "afterColon": true}], "keyword-spacing": 2, "new-cap": 0, "new-parens": 2, "no-alert": 2, "no-array-constructor": 2, "no-caller": 2, - "no-console": [2, { "allow": ["info", "warn", "error"] }], + "no-console": [2, {"allow": ["info", "warn", "error"]}], "no-delete-var": 2, "no-eval": 2, "no-extend-native": 2, @@ -59,21 +59,14 @@ "no-undef-init": 2, "no-underscore-dangle": 0, "no-unused-expressions": 2, - "no-unused-vars": [ - 2, - { "vars": "all", "args": "after-used", "varsIgnorePattern": "should" } - ], + "no-unused-vars": [2, {"vars": "all", "args": "after-used", "varsIgnorePattern": "should"}], "no-use-before-define": 2, "no-with": 2, - "quotes": [ - 2, - "single", - { "avoidEscape": true, "allowTemplateLiterals": true } - ], + "quotes": [2, "single", {"avoidEscape": true, "allowTemplateLiterals": true}], "semi": 2, - "semi-spacing": [2, { "before": false, "after": true }], + "semi-spacing": [2, {"before": false, "after": true}], "space-infix-ops": 2, - "space-unary-ops": [2, { "words": true, "nonwords": false }], + "space-unary-ops": [2, {"words": true, "nonwords": false}], "strict": [0, "never"], "yoda": [2, "never"] }, diff --git a/example-apps/onedrive/before-handlers.js b/example-apps/onedrive/before-handlers.js index 15d6d7bfb..739bc9061 100644 --- a/example-apps/onedrive/before-handlers.js +++ b/example-apps/onedrive/before-handlers.js @@ -1,14 +1,14 @@ -'use strict' +'use strict'; // This adds the needed auth header to a request. By registering this on the // app's `beforeRequest` section, every z.request() call will run this function. const includeBearerToken = (request, z, bundle) => { if (bundle.authData.access_token) { - request.headers.Authorization = `Bearer ${bundle.authData.access_token}` + request.headers.Authorization = `Bearer ${bundle.authData.access_token}`; } - return request -} + return request; +}; module.exports = { - includeBearerToken, -} + includeBearerToken +}; diff --git a/example-apps/onedrive/constants.js b/example-apps/onedrive/constants.js index 269f4b4fa..9c30b89cf 100644 --- a/example-apps/onedrive/constants.js +++ b/example-apps/onedrive/constants.js @@ -8,5 +8,5 @@ const BINARY_CONTENT_MSG = 'Binary contents unsupported.' module.exports = { BASE_ITEM_URL, BIG_FILE_MSG, - BINARY_CONTENT_MSG, + BINARY_CONTENT_MSG } diff --git a/example-apps/onedrive/hydrators.js b/example-apps/onedrive/hydrators.js index c70a89872..653e5b373 100644 --- a/example-apps/onedrive/hydrators.js +++ b/example-apps/onedrive/hydrators.js @@ -6,12 +6,12 @@ const getStringByteSize = utils.getStringByteSize const { BASE_ITEM_URL, BIG_FILE_MSG, - BINARY_CONTENT_MSG, + BINARY_CONTENT_MSG } = require('./constants') const getFileContents = (z, bundle) => { const options = { - url: `${BASE_ITEM_URL}/me/drive/items/${bundle.inputData.id}/content`, + url: `${BASE_ITEM_URL}/me/drive/items/${bundle.inputData.id}/content` } return z @@ -46,5 +46,5 @@ const getFileContents = (z, bundle) => { } module.exports = { - getFileContents, + getFileContents } diff --git a/example-apps/onedrive/index.js b/example-apps/onedrive/index.js index 9f35fa6e8..ba33c3c33 100644 --- a/example-apps/onedrive/index.js +++ b/example-apps/onedrive/index.js @@ -29,7 +29,7 @@ const App = { */ resources: { [folder.key]: folder, - [file.key]: file, + [file.key]: file }, triggers: {}, @@ -40,8 +40,8 @@ const App = { * allow users to create plain text files, so we register that create here. */ creates: { - [createTextFile.key]: createTextFile, - }, + [createTextFile.key]: createTextFile + } } module.exports = App diff --git a/example-apps/onedrive/test/authentication.js b/example-apps/onedrive/test/authentication.js index c72a8fba0..fcef218af 100644 --- a/example-apps/onedrive/test/authentication.js +++ b/example-apps/onedrive/test/authentication.js @@ -14,8 +14,8 @@ describe('Authentication', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', - }, + accountType: 'personal' + } } appTester(App.authentication.oauth2Config.refreshAccessToken, bundle) @@ -32,11 +32,11 @@ describe('Authentication', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { - accountType: 'personal', - }, + accountType: 'personal' + } } appTester(App.authentication.test, bundle) @@ -55,12 +55,12 @@ describe('Authentication', () => { inputData: { state: '4444', redirect_uri: 'https://zapier.com/', - accountType: 'personal', + accountType: 'personal' }, environment: { CLIENT_ID: '1234', - CLIENT_SECRET: 'asdf', - }, + CLIENT_SECRET: 'asdf' + } } appTester(App.authentication.oauth2Config.authorizeUrl, bundle) diff --git a/example-apps/onedrive/test/creates/text-file.js b/example-apps/onedrive/test/creates/text-file.js index 94796c2ea..10910e46a 100644 --- a/example-apps/onedrive/test/creates/text-file.js +++ b/example-apps/onedrive/test/creates/text-file.js @@ -21,13 +21,13 @@ describe('Create Text File', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { folder: '', file, - name, - }, + name + } } appTester(App.creates.textFile.operation.perform, bundle) @@ -53,13 +53,13 @@ describe('Create Text File', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { folder: TEST_RESOURCES.folder.path, name, - file, - }, + file + } } appTester(App.creates.textFile.operation.perform, bundle) @@ -85,13 +85,13 @@ describe('Create Text File', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { folder: '', file, - name, - }, + name + } } appTester(App.creates.textFile.operation.perform, bundle) diff --git a/example-apps/onedrive/test/hydrators.js b/example-apps/onedrive/test/hydrators.js index 67a2253e0..e9191ab7e 100644 --- a/example-apps/onedrive/test/hydrators.js +++ b/example-apps/onedrive/test/hydrators.js @@ -14,11 +14,11 @@ describe('Hydrators', () => { it('should get file contents', (done) => { const bundle = { authData: { - access_token: process.env.ACCESS_TOKEN, + access_token: process.env.ACCESS_TOKEN }, inputData: { - id: TEST_RESOURCES.root.id, - }, + id: TEST_RESOURCES.root.id + } } appTester(App.hydrators.getFileContents, bundle) diff --git a/example-apps/onedrive/test/resources/file.js b/example-apps/onedrive/test/resources/file.js index da5547f0a..efbacba39 100644 --- a/example-apps/onedrive/test/resources/file.js +++ b/example-apps/onedrive/test/resources/file.js @@ -18,11 +18,11 @@ describe('File Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { - id: TEST_RESOURCES.root.id, - }, + id: TEST_RESOURCES.root.id + } } appTester(App.resources.file.get.operation.perform, bundle) @@ -49,11 +49,11 @@ describe('File Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { - folder: '', - }, + folder: '' + } } appTester(App.resources.file.list.operation.perform, bundle) @@ -74,11 +74,11 @@ describe('File Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { - folder: '', - }, + folder: '' + } } appTester(App.resources.file.list.operation.perform, bundle) @@ -106,13 +106,13 @@ describe('File Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { folder: '', file, - name, - }, + name + } } appTester(App.resources.file.create.operation.perform, bundle) @@ -150,12 +150,12 @@ describe('File Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { folder: '', - name: 'sample', - }, + name: 'sample' + } } appTester(App.resources.file.search.operation.perform, bundle) diff --git a/example-apps/onedrive/test/resources/folder.js b/example-apps/onedrive/test/resources/folder.js index eed04c97b..e235c9cab 100644 --- a/example-apps/onedrive/test/resources/folder.js +++ b/example-apps/onedrive/test/resources/folder.js @@ -18,11 +18,11 @@ describe('Folder Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { - id: TEST_RESOURCES.folder.id, - }, + id: TEST_RESOURCES.folder.id + } } appTester(App.resources.folder.get.operation.perform, bundle) @@ -49,14 +49,14 @@ describe('Folder Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { - folder: '', + folder: '' }, meta: { - prefill: false, - }, + prefill: false + } } appTester(App.resources.folder.list.operation.perform, bundle) @@ -80,14 +80,14 @@ describe('Folder Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { - folder: TEST_RESOURCES.childFolder.path, + folder: TEST_RESOURCES.childFolder.path }, meta: { - prefill: false, - }, + prefill: false + } } appTester(App.resources.folder.list.operation.perform, bundle) @@ -116,14 +116,14 @@ describe('Folder Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { - folder: TEST_RESOURCES.childFolder.path, + folder: TEST_RESOURCES.childFolder.path }, meta: { - prefill: true, - }, + prefill: true + } } appTester(App.resources.folder.list.operation.perform, bundle) @@ -152,14 +152,14 @@ describe('Folder Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { - folder: '', + folder: '' }, meta: { - prefill: false, - }, + prefill: false + } } appTester(App.resources.folder.list.operation.perform, bundle) @@ -185,12 +185,12 @@ describe('Folder Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { folder: '', - name, - }, + name + } } appTester(App.resources.folder.create.operation.perform, bundle) @@ -217,12 +217,12 @@ describe('Folder Resource', () => { authData: { access_token: process.env.ACCESS_TOKEN, refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', + accountType: 'personal' }, inputData: { folder: '', - name: 'Documents', - }, + name: 'Documents' + } } appTester(App.resources.folder.search.operation.perform, bundle) diff --git a/example-apps/onedrive/test/test-utils.js b/example-apps/onedrive/test/test-utils.js index b5869250d..916131490 100644 --- a/example-apps/onedrive/test/test-utils.js +++ b/example-apps/onedrive/test/test-utils.js @@ -26,8 +26,8 @@ const globalBeforeSetup = (done) => { authData: { access_token: '', refresh_token: process.env.REFRESH_TOKEN, - accountType: 'personal', - }, + accountType: 'personal' + } } appTester(App.authentication.oauth2Config.refreshAccessToken, bundle) @@ -54,30 +54,30 @@ const TEST_RESOURCES = { id: '', name: 'sample.pdf', path: '/sample.pdf', - parent: '', + parent: '' }, nested: { id: '', name: 'test.txt', path: '/Documents/Testing/test.txt', - parent: '/Documents/Testing', + parent: '/Documents/Testing' }, folder: { id: '', name: 'Documents', path: '/Documents', - parent: '', + parent: '' }, childFolder: { id: '', name: 'Testing', path: '/Documents/Testing', - parent: '/Documents', - }, + parent: '/Documents' + } } module.exports = { globalBeforeSetup, - TEST_RESOURCES, + TEST_RESOURCES } diff --git a/example-apps/onedrive/test/utils.js b/example-apps/onedrive/test/utils.js index e9194a21b..b78ac1148 100644 --- a/example-apps/onedrive/test/utils.js +++ b/example-apps/onedrive/test/utils.js @@ -45,20 +45,20 @@ describe('Utils', () => { const tests = [ { string: 'asd', - expected: 3, + expected: 3 }, { string: '@€£¶‰dfg', - expected: 14, + expected: 14 }, { string: '÷¶[]÷d()ß-°ú', - expected: 18, + expected: 18 }, { string: 'ç€is-æ', - expected: 10, - }, + expected: 10 + } ] tests.forEach((test) => diff --git a/example-apps/onedrive/utils.js b/example-apps/onedrive/utils.js index d1ce36ad6..16d4a88af 100644 --- a/example-apps/onedrive/utils.js +++ b/example-apps/onedrive/utils.js @@ -112,8 +112,9 @@ const getFileDetailsFromRequest = (url) => const disposition = response.headers.get('content-disposition') if (disposition) { - fileDetails.filename = - contentDisposition.parse(disposition).parameters.filename + fileDetails.filename = contentDisposition.parse( + disposition + ).parameters.filename } return response.buffer() diff --git a/example-apps/resource/index.js b/example-apps/resource/index.js index 533994736..f3c3b2756 100644 --- a/example-apps/resource/index.js +++ b/example-apps/resource/index.js @@ -19,7 +19,7 @@ const App = { // If you want your resource to show up, you better include it here! resources: { - [Recipe.key]: Recipe, + [Recipe.key]: Recipe }, // If you want your trigger to show up, you better include it here! @@ -29,7 +29,7 @@ const App = { searches: {}, // If you want your creates to show up, you better include it here! - creates: {}, + creates: {} }; // Finally, export the app. diff --git a/example-apps/resource/test/resources/recipe.js b/example-apps/resource/test/resources/recipe.js index d891b8f30..30d1b9ec7 100644 --- a/example-apps/resource/test/resources/recipe.js +++ b/example-apps/resource/test/resources/recipe.js @@ -8,15 +8,15 @@ const App = require('../../index'); const appTester = zapier.createAppTester(App); describe('recipe resource', () => { - it('should get an existing recipe', (done) => { + it('should get an existing recipe', done => { const bundle = { inputData: { - id: 1, - }, + id: 1 + } }; appTester(App.resources.recipe.get.operation.perform, bundle) - .then((results) => { + .then(results => { results.name.should.eql('name 1'); results.directions.should.eql('directions 1'); done(); @@ -24,15 +24,15 @@ describe('recipe resource', () => { .catch(done); }); - it('should list existing recipes', (done) => { + it('should list existing recipes', done => { const bundle = { inputData: { - style: 'style 2', - }, + style: 'style 2' + } }; appTester(App.resources.recipe.list.operation.perform, bundle) - .then((results) => { + .then(results => { results.length.should.above(0); const firstRecipe = results[0]; @@ -43,32 +43,32 @@ describe('recipe resource', () => { .catch(done); }); - it('should create a new recipe', (done) => { + it('should create a new recipe', done => { const bundle = { inputData: { name: 'Smith Family Recipe', directions: '1. Order out :)', - authorId: 1, - }, + authorId: 1 + } }; appTester(App.resources.recipe.create.operation.perform, bundle) - .then((results) => { + .then(results => { results.should.have.property('name'); done(); }) .catch(done); }); - it('should find a recipe', (done) => { + it('should find a recipe', done => { const bundle = { inputData: { - name: 'Smith Family Recipe', - }, + name: 'Smith Family Recipe' + } }; appTester(App.resources.recipe.search.operation.perform, bundle) - .then((results) => { + .then(results => { results[0].should.have.property('name'); done(); }) diff --git a/example-apps/rest-hooks/index.js b/example-apps/rest-hooks/index.js index a881da07b..e8b9756f4 100644 --- a/example-apps/rest-hooks/index.js +++ b/example-apps/rest-hooks/index.js @@ -15,14 +15,14 @@ const App = { // If you want your trigger to show up, you better include it here! triggers: { - [recipe.key]: recipe, + [recipe.key]: recipe }, // If you want your searches to show up, you better include it here! searches: {}, // If you want your creates to show up, you better include it here! - creates: {}, + creates: {} }; // Finally, export the app. diff --git a/example-apps/rest-hooks/test/triggers.js b/example-apps/rest-hooks/test/triggers.js index e4e83032b..b9f880cc9 100644 --- a/example-apps/rest-hooks/test/triggers.js +++ b/example-apps/rest-hooks/test/triggers.js @@ -9,20 +9,20 @@ const appTester = zapier.createAppTester(App); describe('triggers', () => { describe('new recipe trigger', () => { - it('should load recipe from fake hook', (done) => { + it('should load recipe from fake hook', done => { const bundle = { inputData: { - style: 'mediterranean', + style: 'mediterranean' }, cleanedRequest: { id: 1, name: 'name 1', - directions: 'directions 1', - }, + directions: 'directions 1' + } }; appTester(App.triggers.recipe.operation.perform, bundle) - .then((results) => { + .then(results => { results.length.should.eql(1); const firstRecipe = results[0]; @@ -34,18 +34,18 @@ describe('triggers', () => { .catch(done); }); - it('should load recipe from list', (done) => { + it('should load recipe from list', done => { const bundle = { inputData: { - style: 'mediterranean', + style: 'mediterranean' }, meta: { - frontend: true, - }, + frontend: true + } }; appTester(App.triggers.recipe.operation.performList, bundle) - .then((results) => { + .then(results => { results.length.should.be.greaterThan(1); const firstRecipe = results[0]; diff --git a/example-apps/search/index.js b/example-apps/search/index.js index 20cd8a6d6..3e49a7100 100644 --- a/example-apps/search/index.js +++ b/example-apps/search/index.js @@ -24,11 +24,11 @@ const App = { // If you want your searches to show up, you better include it here! searches: { - [search.key]: search, + [search.key]: search }, // If you want your creates to show up, you better include it here! - creates: {}, + creates: {} }; // Finally, export the app. diff --git a/example-apps/search/test/searches.js b/example-apps/search/test/searches.js index 6a246f308..afab374c6 100644 --- a/example-apps/search/test/searches.js +++ b/example-apps/search/test/searches.js @@ -9,15 +9,15 @@ const appTester = zapier.createAppTester(App); describe('searches', () => { describe('search recipe', () => { - it('should find a recipe', (done) => { + it('should find a recipe', done => { const bundle = { inputData: { - style: 'style 2', - }, + style: 'style 2' + } }; appTester(App.searches.recipe.operation.perform, bundle) - .then((results) => { + .then(results => { results.length.should.be.aboveOrEqual(1); const firstRecipe = results[0]; diff --git a/example-apps/trigger/index.js b/example-apps/trigger/index.js index 92421461d..cd16d4067 100644 --- a/example-apps/trigger/index.js +++ b/example-apps/trigger/index.js @@ -21,14 +21,14 @@ const App = { // If you want your trigger to show up, you better include it here! triggers: { - [recipe.key]: recipe, + [recipe.key]: recipe }, // If you want your searches to show up, you better include it here! searches: {}, // If you want your creates to show up, you better include it here! - creates: {}, + creates: {} }; // Finally, export the app. diff --git a/package.json b/package.json index 56bb8bd25..564269e9f 100644 --- a/package.json +++ b/package.json @@ -46,11 +46,10 @@ "eslint --fix --quiet" ], "*.{js,json}": [ - "prettier --write --ignore-path=.prettierignore" + "prettier --write" ] }, "prettier": { - "singleQuote": true, - "trailingComma": "es5" + "singleQuote": true } } diff --git a/packages/cli/src/oclif/commands/canary/list.js b/packages/cli/src/oclif/commands/canary/list.js index c43c6f29f..587d4f567 100644 --- a/packages/cli/src/oclif/commands/canary/list.js +++ b/packages/cli/src/oclif/commands/canary/list.js @@ -7,11 +7,11 @@ class CanaryListCommand extends ZapierBaseCommand { async perform() { const canaries = await listCanaries(); - const formattedCanaries = canaries.objects.map((c) => ({ + const formattedCanaries = canaries.objects.map(c => ({ from_version: c.from_version, to_version: c.to_version, percent: c.percent, - seconds_remaining: c.until_timestamp - Math.floor(Date.now() / 1000), + seconds_remaining: c.until_timestamp - Math.floor(Date.now() / 1000) })); this.log(bold('Active Canaries') + '\n'); @@ -23,14 +23,16 @@ class CanaryListCommand extends ZapierBaseCommand { ['Traffic Amount', 'percent'], ['Seconds Remaining', 'seconds_remaining'], ], - emptyMessage: grey(`No active canary deployments found.`), + emptyMessage: grey( + `No active canary deployments found.` + ), }); } } CanaryListCommand.flags = buildFlags({ opts: { format: true } }); CanaryListCommand.description = 'List all active canary deployments'; -CanaryListCommand.examples = ['zapier canary:list']; +CanaryListCommand.examples = ['zapier canary:list'] CanaryListCommand.skipValidInstallCheck = true; -module.exports = CanaryListCommand; +module.exports = CanaryListCommand; \ No newline at end of file diff --git a/packages/cli/src/oclif/commands/promote.js b/packages/cli/src/oclif/commands/promote.js index 9d46103e8..36b101716 100644 --- a/packages/cli/src/oclif/commands/promote.js +++ b/packages/cli/src/oclif/commands/promote.js @@ -52,8 +52,9 @@ class PromoteCommand extends BaseCommand { const assumeYes = 'yes' in this.flags; let shouldContinue; - const { changelog, appMetadata, issueMetadata } = - await getVersionChangelog(version); + const { changelog, appMetadata, issueMetadata } = await getVersionChangelog( + version + ); const metadataPromptHelper = `Issues are indicated by ${colors.bold.underline( '#' diff --git a/packages/cli/src/oclif/commands/team/add.js b/packages/cli/src/oclif/commands/team/add.js index a59b8b587..1553b9184 100644 --- a/packages/cli/src/oclif/commands/team/add.js +++ b/packages/cli/src/oclif/commands/team/add.js @@ -42,8 +42,8 @@ class TeamAddCommand extends ZapierBaseCommand { role === 'admin' ? `/apps/${id}/collaborators` : role === 'subscriber' - ? `${BASE_ENDPOINT}/api/platform/v3/integrations/${id}/subscribers` - : `/apps/${id}/limited_collaborators`; + ? `${BASE_ENDPOINT}/api/platform/v3/integrations/${id}/subscribers` + : `/apps/${id}/limited_collaborators`; await callAPI(url, { url: url.startsWith('http') ? url : undefined, diff --git a/packages/cli/src/oclif/commands/team/remove.js b/packages/cli/src/oclif/commands/team/remove.js index b8f924c45..3eac469eb 100644 --- a/packages/cli/src/oclif/commands/team/remove.js +++ b/packages/cli/src/oclif/commands/team/remove.js @@ -49,8 +49,8 @@ class TeamRemoveCommand extends ZapierBaseCommand { role === 'admin' ? `/apps/${appId}/collaborators/${invitationId}` : role === 'subscriber' - ? `${BASE_ENDPOINT}/api/platform/v3/integrations/${appId}/subscribers/${invitationId}` - : `/apps/${appId}/limited_collaborators`; + ? `${BASE_ENDPOINT}/api/platform/v3/integrations/${appId}/subscribers/${invitationId}` + : `/apps/${appId}/limited_collaborators`; await callAPI(url, { url: url.startsWith('http') ? url : undefined, diff --git a/packages/cli/src/tests/fixtures/registerFieldChoices.js b/packages/cli/src/tests/fixtures/registerFieldChoices.js index da6926833..afa5cbfb5 100644 --- a/packages/cli/src/tests/fixtures/registerFieldChoices.js +++ b/packages/cli/src/tests/fixtures/registerFieldChoices.js @@ -2,11 +2,13 @@ module.exports = { intention: [ { value: 'global', - name: "Public: I'm evaluating making my app available to the entire Zapier ecosystem", + name: + "Public: I'm evaluating making my app available to the entire Zapier ecosystem", }, { value: 'private', - name: "Private: I'm building an integration for personal use or to explore the Zapier platform", + name: + "Private: I'm building an integration for personal use or to explore the Zapier platform", }, ], role: [ diff --git a/packages/cli/src/utils/api.js b/packages/cli/src/utils/api.js index 9544dfc3d..41208afe7 100644 --- a/packages/cli/src/utils/api.js +++ b/packages/cli/src/utils/api.js @@ -162,19 +162,22 @@ const createCanary = async (versionFrom, versionTo, percent, duration) => { method: 'POST', body: { percent, - duration, - }, + duration + } } - ); -}; + ) +} const listCanaries = async () => { const linkedAppId = (await getLinkedAppConfig(undefined, true))?.id; - return callAPI(`/apps/${linkedAppId}/canaries`, { - method: 'GET', - }); -}; + return callAPI( + `/apps/${linkedAppId}/canaries`, + { + method: 'GET', + } + ) +} const deleteCanary = async (versionFrom, versionTo) => { const linkedAppId = (await getLinkedAppConfig(undefined, true))?.id; @@ -184,8 +187,8 @@ const deleteCanary = async (versionFrom, versionTo) => { { method: 'DELETE', } - ); -}; + ) +} /** * read local `apprc` file diff --git a/packages/cli/src/utils/build.js b/packages/cli/src/utils/build.js index ac5c219ef..f5150e437 100644 --- a/packages/cli/src/utils/build.js +++ b/packages/cli/src/utils/build.js @@ -285,9 +285,10 @@ const maybeRunBuildScript = async (options = {}) => { // Make sure we don't accidentally call the Zapier build hook inside itself if (process.env.npm_lifecycle_event !== ZAPIER_BUILD_KEY) { - const pJson = require( - path.resolve(options.cwd || process.cwd(), 'package.json') - ); + const pJson = require(path.resolve( + options.cwd || process.cwd(), + 'package.json' + )); if (_.get(pJson, ['scripts', ZAPIER_BUILD_KEY])) { startSpinner(`Running ${ZAPIER_BUILD_KEY} script`); diff --git a/packages/cli/src/utils/convert.js b/packages/cli/src/utils/convert.js index 58e6869a1..32006c0ae 100644 --- a/packages/cli/src/utils/convert.js +++ b/packages/cli/src/utils/convert.js @@ -47,12 +47,12 @@ const prettifyJSON = (origString) => JSON.stringify(origString, null, 2); const renderTemplate = async ( templateFile, templateContext, - prettify = true + prettify = true, ) => { const templateBuf = await readFile(templateFile); const template = templateBuf.toString(); let content = _.template(template, { interpolate: /<%=([\s\S]+?)%>/g })( - templateContext + templateContext, ); if (prettify) { @@ -99,7 +99,7 @@ const getAuthFieldKeys = (appDefinition) => { const renderPackageJson = async (appInfo, appDefinition) => { const name = _.kebabCase( - appInfo.title || _.get(appInfo, ['general', 'title']) + appInfo.title || _.get(appInfo, ['general', 'title']), ); // Not using escapeSpecialChars because we don't want to escape single quotes (not @@ -180,7 +180,7 @@ const renderSource = (definition, functions = {}) => { funcName = `${funcNameBase}${funcNum}`; } functions[funcName] = `const ${funcName} = async (${args.join( - ', ' + ', ', )}) => {\n${source}\n};`; this.parent.update(makePlaceholder(funcName)); @@ -195,7 +195,7 @@ const renderDefinitionSlice = (definitionSlice, filename) => { renderSource(exportBlock, functionBlock); exportBlock = `module.exports = ${replacePlaceholders( - JSON.stringify(exportBlock) + JSON.stringify(exportBlock), )};\n`; functionBlock = Object.values(functionBlock).join('\n\n'); @@ -206,8 +206,9 @@ const renderDefinitionSlice = (definitionSlice, filename) => { } catch (err) { console.warn( `Warning: Your code has syntax error in ${chalk.underline.bold( - filename - )}. ` + `It will be left as is and won't be prettified.\n\n${err.message}` + filename, + )}. ` + + `It will be left as is and won't be prettified.\n\n${err.message}`, ); return uglyCode; } @@ -238,7 +239,7 @@ const renderIndex = async (appDefinition) => { // replace version and platformVersion with dynamic reference exportBlock.version = makePlaceholder("require('./package.json').version"); exportBlock.platformVersion = makePlaceholder( - "require('zapier-platform-core').version" + "require('zapier-platform-core').version", ); if (appDefinition.authentication) { @@ -269,7 +270,7 @@ const renderIndex = async (appDefinition) => { exportBlock[stepType][makePlaceholder(`[${importName}.key]`)] = makePlaceholder(importName); }); - } + }, ); if (!_.isEmpty(appDefinition.hydrators)) { @@ -282,20 +283,20 @@ const renderIndex = async (appDefinition) => { if (appDefinition.legacy && appDefinition.legacy.scriptingSource) { importBlock.push("\nconst fs = require('fs');"); importBlock.push( - "const scriptingSource = fs.readFileSync('./scripting.js', { encoding: 'utf8' });" + "const scriptingSource = fs.readFileSync('./scripting.js', { encoding: 'utf8' });", ); exportBlock.legacy.scriptingSource = makePlaceholder('scriptingSource'); } exportBlock = `module.exports = ${replacePlaceholders( - JSON.stringify(exportBlock) + JSON.stringify(exportBlock), )};`; importBlock = importBlock.join('\n'); functionBlock = Object.values(functionBlock).join('\n\n'); return prettifyJs( - importBlock + '\n\n' + functionBlock + '\n\n' + exportBlock + importBlock + '\n\n' + functionBlock + '\n\n' + exportBlock, ); }; @@ -339,7 +340,7 @@ const writeScripting = async (appDefinition, newAppDir) => { await createFile( appDefinition.legacy.scriptingSource, 'scripting.js', - newAppDir + newAppDir, ); }; @@ -385,7 +386,7 @@ const convertApp = async (appInfo, appDefinition, newAppDir) => { _.each(appDefinition[stepType], (definition, key) => { promises.push( writeStep(stepType, definition, key, newAppDir), - writeStepTest(stepType, definition, key, newAppDir) + writeStepTest(stepType, definition, key, newAppDir), ); }); }); @@ -405,7 +406,7 @@ const convertApp = async (appInfo, appDefinition, newAppDir) => { writeIndex(appDefinition, newAppDir), writeEnvironment(appDefinition, newAppDir), writeGitIgnore(newAppDir), - writeZapierAppRc(appInfo, appDefinition, newAppDir) + writeZapierAppRc(appInfo, appDefinition, newAppDir), ); return Promise.all(promises); diff --git a/packages/cli/src/utils/misc.js b/packages/cli/src/utils/misc.js index 2fa669ca5..166d4d846 100644 --- a/packages/cli/src/utils/misc.js +++ b/packages/cli/src/utils/misc.js @@ -135,9 +135,10 @@ const isValidAppInstall = () => { }; } - const installedPackageJson = require( - path.join(corePackageDir, 'package.json') - ); + const installedPackageJson = require(path.join( + corePackageDir, + 'package.json' + )); const installedCoreVersion = installedPackageJson.version; if (installedCoreVersion !== dependedCoreVersion) { @@ -209,9 +210,9 @@ const printVersionInfo = (context) => { ) ) { // double check they have the right version installed - const installedPkgVersion = require( - path.resolve(`./node_modules/${PLATFORM_PACKAGE}/package.json`) - ).version; + const installedPkgVersion = require(path.resolve( + `./node_modules/${PLATFORM_PACKAGE}/package.json` + )).version; if (requiredVersion !== installedPkgVersion) { versions.push( diff --git a/packages/cli/src/utils/team.js b/packages/cli/src/utils/team.js index 27d3fd49d..f64048ede 100644 --- a/packages/cli/src/utils/team.js +++ b/packages/cli/src/utils/team.js @@ -10,8 +10,8 @@ const transformUserRole = (role) => role === 'collaborator' ? 'admin' : role === 'subscriber' - ? 'subscriber' - : 'collaborator'; + ? 'subscriber' + : 'collaborator'; const listTeamMembers = async () => { return listEndpointMulti( diff --git a/packages/core/smoke-test/smoke-test.js b/packages/core/smoke-test/smoke-test.js index f5dd41d02..af8459831 100644 --- a/packages/core/smoke-test/smoke-test.js +++ b/packages/core/smoke-test/smoke-test.js @@ -83,8 +83,9 @@ const npmPackCore = (schemaPackagePath) => { encoding: 'utf8', }); const packageJson = JSON.parse(originalPackageJsonText); - packageJson.dependencies['zapier-platform-schema'] = - `file:${schemaPackagePath}`; + packageJson.dependencies[ + 'zapier-platform-schema' + ] = `file:${schemaPackagePath}`; fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson)); let filename; diff --git a/packages/core/src/app-middlewares/before/z-object.js b/packages/core/src/app-middlewares/before/z-object.js index c8306db08..8f2c295ac 100644 --- a/packages/core/src/app-middlewares/before/z-object.js +++ b/packages/core/src/app-middlewares/before/z-object.js @@ -30,11 +30,9 @@ const injectZObject = (input) => { hash: hashing.hashify, JSON: createJSONtool(), require: (moduleName) => - require( - require.resolve(moduleName, { - paths: module.paths.concat([process.cwd()]), - }) - ), + require(require.resolve(moduleName, { + paths: module.paths.concat([process.cwd()]), + })), stashFile: createFileStasher(input), }; diff --git a/packages/core/src/tools/create-cache.js b/packages/core/src/tools/create-cache.js index 09ba6c3bd..f2d6e8513 100644 --- a/packages/core/src/tools/create-cache.js +++ b/packages/core/src/tools/create-cache.js @@ -54,14 +54,7 @@ const createCache = (input) => { set: async (key, value, ttl = null, scope = null, nx = null) => { runValidationChecks(rpc, key, value, ttl, scope, nx); - return await rpc( - 'zcache_set', - key, - JSON.stringify(value), - ttl, - scope, - nx - ); + return await rpc('zcache_set', key, JSON.stringify(value), ttl, scope, nx); }, delete: async (key, scope = null) => { runValidationChecks(rpc, key, scope); diff --git a/packages/core/test/fixtures/truncate-test-data.json b/packages/core/test/fixtures/truncate-test-data.json index ecd2e2d5e..c4c1ccea8 100644 --- a/packages/core/test/fixtures/truncate-test-data.json +++ b/packages/core/test/fixtures/truncate-test-data.json @@ -41,8 +41,15 @@ { "description": "truncateData will do its best to truncate a big string that would push it past the maxLength, but in a case where the last evaluated item isn't a string, it will just 'drop' the last evaluated item and the output length won't match the maxLength. that's okay! here's an example.", "input": [ - 1234567890, 2345678901, 3456789012, 4567890123, 5678901234, 6789012345, - 7890123456, 8901234567, 9012345678 + 1234567890, + 2345678901, + 3456789012, + 4567890123, + 5678901234, + 6789012345, + 7890123456, + 8901234567, + 9012345678 ], "maxLength": 94, "output": [ diff --git a/packages/core/test/misc-tools.js b/packages/core/test/misc-tools.js index 2c52b15e4..f55aaf14c 100644 --- a/packages/core/test/misc-tools.js +++ b/packages/core/test/misc-tools.js @@ -441,8 +441,7 @@ describe('Tools', () => { }, { name: 'TypeError', - message: - "Type 'function' is not JSON-encodable (path: 'foo.1.hello')", + message: "Type 'function' is not JSON-encodable (path: 'foo.1.hello')", } ); assert.throws( diff --git a/packages/core/test/test-tools.js b/packages/core/test/test-tools.js index d864819c6..6e49684f8 100644 --- a/packages/core/test/test-tools.js +++ b/packages/core/test/test-tools.js @@ -63,21 +63,17 @@ describe('test-tools', () => { // retrieves custom fields from API appTester.zcacheTestObj.should.eql({}); const freshResults = await appTester( - appDefinition.resources.cachedcustominputfields.list.operation - .inputFields, + appDefinition.resources.cachedcustominputfields.list.operation.inputFields, {}, - true + true, ); freshResults.should.eql(customInputFields); // retrieves custom fields from cache - _.values(appTester.zcacheTestObj).should.containDeep([ - JSON.stringify(customInputFields), - ]); + _.values(appTester.zcacheTestObj).should.containDeep([JSON.stringify(customInputFields)]); const cachedResults = await appTester( - appDefinition.resources.cachedcustominputfields.list.operation - .inputFields, - {} + appDefinition.resources.cachedcustominputfields.list.operation.inputFields, + {}, ); cachedResults.should.eql(customInputFields); }); diff --git a/packages/core/test/userapp/helpers.js b/packages/core/test/userapp/helpers.js index 6e6d4f87f..ba5054daa 100644 --- a/packages/core/test/userapp/helpers.js +++ b/packages/core/test/userapp/helpers.js @@ -5,7 +5,10 @@ module.exports = { getCustomFields: async (z, bundle) => { const expensiveCustomFieldsRequestMock = async () => { return { - data: [{ key: 'custom-field-1' }, { key: 'custom-field-2' }], + data: [ + { key: 'custom-field-1' }, + { key: 'custom-field-2' }, + ], }; }; diff --git a/packages/schema/lib/functional-constraints/uniqueInputFieldKeys.js b/packages/schema/lib/functional-constraints/uniqueInputFieldKeys.js index 5f5706124..4ccfab90d 100644 --- a/packages/schema/lib/functional-constraints/uniqueInputFieldKeys.js +++ b/packages/schema/lib/functional-constraints/uniqueInputFieldKeys.js @@ -52,8 +52,9 @@ const uniqueInputFieldKeys = (definition) => { ) ); } else { - existingKeys[subField.key] = - `inputFields[${index}].children[${subFieldIndex}]`; + existingKeys[ + subField.key + ] = `inputFields[${index}].children[${subFieldIndex}]`; } }); }); diff --git a/packages/schema/lib/schemas/AppSchema.js b/packages/schema/lib/schemas/AppSchema.js index 9385a0b54..07c57597a 100644 --- a/packages/schema/lib/schemas/AppSchema.js +++ b/packages/schema/lib/schemas/AppSchema.js @@ -107,7 +107,8 @@ module.exports = makeSchema( $ref: AppFlagsSchema.id, }, throttle: { - description: `Zapier uses this configuration to apply throttling when the limit for the window is exceeded. When set here, it is the default throttle configuration used on each action of the integration. And when set in an action's operation object, it gets overwritten for that action only.`, + description: + `Zapier uses this configuration to apply throttling when the limit for the window is exceeded. When set here, it is the default throttle configuration used on each action of the integration. And when set in an action's operation object, it gets overwritten for that action only.`, $ref: ThrottleObjectSchema.id, }, legacy: { diff --git a/packages/schema/lib/schemas/BasicOperationSchema.js b/packages/schema/lib/schemas/BasicOperationSchema.js index 2a2d2faa5..beaa37cb0 100644 --- a/packages/schema/lib/schemas/BasicOperationSchema.js +++ b/packages/schema/lib/schemas/BasicOperationSchema.js @@ -81,13 +81,5 @@ module.exports = makeSchema( ], additionalProperties: false, }, - [ - DynamicFieldsSchema, - FunctionSchema, - KeySchema, - LockObjectSchema, - RequestSchema, - ResultsSchema, - ThrottleObjectSchema, - ] + [DynamicFieldsSchema, FunctionSchema, KeySchema, LockObjectSchema, RequestSchema, ResultsSchema, ThrottleObjectSchema] ); diff --git a/packages/schema/lib/schemas/FieldChoiceWithLabelSchema.js b/packages/schema/lib/schemas/FieldChoiceWithLabelSchema.js index 6b28cc138..e3e218a68 100644 --- a/packages/schema/lib/schemas/FieldChoiceWithLabelSchema.js +++ b/packages/schema/lib/schemas/FieldChoiceWithLabelSchema.js @@ -17,7 +17,7 @@ module.exports = makeSchema({ }, sample: { description: - 'A legacy field that is no longer used by the editor, but it is still required for now and should match the value.', + "A legacy field that is no longer used by the editor, but it is still required for now and should match the value.", type: 'string', minLength: 1, },