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:
47
client/stores/access_tokens.js
vendored
Normal file
47
client/stores/access_tokens.js
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { defineStore } from "pinia"
|
||||
import { useContentStore } from "~/composables/stores/useContentStore.js"
|
||||
|
||||
export const useAccessTokenStore = defineStore("access_tokens", () => {
|
||||
const contentStore = useContentStore()
|
||||
|
||||
const abilities = [
|
||||
{
|
||||
title: 'Manage integrations',
|
||||
name: 'manage-integrations',
|
||||
},
|
||||
{
|
||||
title: 'List forms',
|
||||
name: 'list-forms',
|
||||
},
|
||||
{
|
||||
title: 'List workspaces',
|
||||
name: 'list-workspaces',
|
||||
},
|
||||
]
|
||||
|
||||
const fetchTokens = () => {
|
||||
contentStore.resetState()
|
||||
contentStore.startLoading()
|
||||
|
||||
return opnFetch('/settings/tokens').then(
|
||||
(data) => {
|
||||
contentStore.save(data)
|
||||
contentStore.stopLoading()
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
const tokens = computed(() => contentStore.getAll.value)
|
||||
|
||||
const getAbility = (name) => {
|
||||
return abilities.find(ability => ability.name == name)
|
||||
}
|
||||
|
||||
return {
|
||||
...contentStore,
|
||||
fetchTokens,
|
||||
tokens,
|
||||
abilities,
|
||||
getAbility
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user