Zapier integration (#491)

* create zapier app

* install sanctum

* move OAuthProviderController

* make `api-external` middleware

* add zapier endpoints

* add tests

* token management

* zapier event handler

* add policy

* use `slug` instead of `id`

* wip

* check policies

* change api prefix to `external`

* ui tweaks

* validate token abilities

* open zapier URL

* zapier ui tweaks

* update zap

* Fix linting

* Added sample endpoints + minor UI changes

* Run PHP code linter

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Boris Lepikhin
2024-08-12 02:14:02 -07:00
committed by GitHub
parent 7ad62fb3ea
commit 517bccc695
61 changed files with 5799 additions and 51 deletions

View File

@@ -0,0 +1,20 @@
const zapier = require('zapier-platform-core');
// Use this to make test calls into your app:
const App = require('../../index');
const appTester = zapier.createAppTester(App);
// read the `.env` file into the environment, if available
zapier.tools.env.inject();
describe('triggers.list_forms', () => {
it('should run', async () => {
const bundle = { inputData: {} };
const results = await appTester(
App.triggers['list_forms'].operation.perform,
bundle
);
expect(results).toBeDefined();
// TODO: add more assertions
});
});

View File

@@ -0,0 +1,20 @@
const zapier = require('zapier-platform-core');
// Use this to make test calls into your app:
const App = require('../../index');
const appTester = zapier.createAppTester(App);
// read the `.env` file into the environment, if available
zapier.tools.env.inject();
describe('triggers.list_workspaces', () => {
it('should run', async () => {
const bundle = { inputData: {} };
const results = await appTester(
App.triggers['list_workspaces'].operation.perform,
bundle
);
expect(results).toBeDefined();
// TODO: add more assertions
});
});

View File

@@ -0,0 +1,20 @@
const zapier = require('zapier-platform-core');
// Use this to make test calls into your app:
const App = require('../../index');
const appTester = zapier.createAppTester(App);
// read the `.env` file into the environment, if available
zapier.tools.env.inject();
describe('triggers.new_submission', () => {
it('should run', async () => {
const bundle = { inputData: {} };
const results = await appTester(
App.triggers['new_submission'].operation.perform,
bundle
);
expect(results).toBeDefined();
// TODO: add more assertions
});
});