2049 timebox 1j zapier integration 4 define and implement a first trigger for zapier app (#2132)
* Add create company trigger * Refactor * Add operation in subscribe * Add create hook api endpoint * Add import of hook module * Add a test for hook subscribe * Add delete hook api endpoint * Add delete hook test * Add findMany hook route --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,7 +1,20 @@
|
||||
const getBundle = (inputData?: object) => {
|
||||
import { Bundle } from 'zapier-platform-core';
|
||||
|
||||
const getBundle = (inputData?: { [x: string]: any }): Bundle => {
|
||||
return {
|
||||
authData: { apiKey: String(process.env.API_KEY) },
|
||||
inputData,
|
||||
inputData: inputData || {},
|
||||
cleanedRequest: {},
|
||||
inputDataRaw: {},
|
||||
meta: {
|
||||
isBulkRead: false,
|
||||
isFillingDynamicDropdown: false,
|
||||
isLoadingSample: false,
|
||||
isPopulatingDedupe: false,
|
||||
isTestingAuth: false,
|
||||
limit: 1,
|
||||
page: 1,
|
||||
},
|
||||
};
|
||||
};
|
||||
export default getBundle;
|
||||
|
||||
@ -5,6 +5,8 @@ const requestDb = async (z: ZObject, bundle: Bundle, query: string) => {
|
||||
url: `${process.env.SERVER_BASE_URL}/graphql`,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${bundle.authData.apiKey}`,
|
||||
},
|
||||
body: {
|
||||
|
||||
Reference in New Issue
Block a user