2248 zapier integration implement typeorm eventsubscribers (#3122)
* Add new queue to twenty-server * Add triggers to zapier * Rename webhook operation * Use find one or fail * Use logger * Fix typescript templating * Add dedicated call webhook job * Update logging * Fix error handling
This commit is contained in:
@ -1,8 +0,0 @@
|
||||
import { capitalize } from "../../utils/capitalize";
|
||||
|
||||
describe('capitalize', ()=> {
|
||||
test('should capitalize properly', ()=> {
|
||||
expect(capitalize('word')).toEqual('Word')
|
||||
expect(capitalize('word word')).toEqual('Word word')
|
||||
})
|
||||
})
|
||||
8
packages/twenty-zapier/src/test/utils/capitalize.test.ts
Normal file
8
packages/twenty-zapier/src/test/utils/capitalize.test.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { capitalize } from '../../utils/capitalize';
|
||||
|
||||
describe('capitalize', () => {
|
||||
test('should capitalize properly', () => {
|
||||
expect(capitalize('word')).toEqual('Word');
|
||||
expect(capitalize('word word')).toEqual('Word word');
|
||||
});
|
||||
});
|
||||
@ -1,42 +0,0 @@
|
||||
import { computeInputFields } from "../../utils/computeInputFields";
|
||||
|
||||
describe('computeInputFields', ()=> {
|
||||
test('should create Person input fields properly', ()=> {
|
||||
const personInfos = {
|
||||
type: "object",
|
||||
properties: {
|
||||
email: {
|
||||
type: "string"
|
||||
},
|
||||
xLink: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: {
|
||||
type: "string"
|
||||
},
|
||||
label: {
|
||||
type: "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
avatarUrl: {
|
||||
type: "string"
|
||||
},
|
||||
favorites: {
|
||||
type: "array",
|
||||
items: {
|
||||
$ref: "#/components/schemas/Favorite"
|
||||
}
|
||||
},
|
||||
},
|
||||
example: {},
|
||||
required: ['avatarUrl']
|
||||
}
|
||||
expect(computeInputFields(personInfos)).toEqual([
|
||||
{ key: "email", label: "Email", required: false, type: "string" },
|
||||
{ key: "xLink__url", label: "X Link: Url", required: false, type: "string" },
|
||||
{ key: "xLink__label", label: "X Link: Label", required: false, type: "string" },
|
||||
{ key: "avatarUrl", label: "Avatar Url", required: true, type: "string" },
|
||||
])
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,52 @@
|
||||
import { computeInputFields } from '../../utils/computeInputFields';
|
||||
|
||||
describe('computeInputFields', () => {
|
||||
test('should create Person input fields properly', () => {
|
||||
const personInfos = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
email: {
|
||||
type: 'string',
|
||||
},
|
||||
xLink: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
url: {
|
||||
type: 'string',
|
||||
},
|
||||
label: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
avatarUrl: {
|
||||
type: 'string',
|
||||
},
|
||||
favorites: {
|
||||
type: 'array',
|
||||
items: {
|
||||
$ref: '#/components/schemas/Favorite',
|
||||
},
|
||||
},
|
||||
},
|
||||
example: {},
|
||||
required: ['avatarUrl'],
|
||||
};
|
||||
expect(computeInputFields(personInfos)).toEqual([
|
||||
{ key: 'email', label: 'Email', required: false, type: 'string' },
|
||||
{
|
||||
key: 'xLink__url',
|
||||
label: 'X Link: Url',
|
||||
required: false,
|
||||
type: 'string',
|
||||
},
|
||||
{
|
||||
key: 'xLink__label',
|
||||
label: 'X Link: Label',
|
||||
required: false,
|
||||
type: 'string',
|
||||
},
|
||||
{ key: 'avatarUrl', label: 'Avatar Url', required: true, type: 'string' },
|
||||
]);
|
||||
});
|
||||
});
|
||||
@ -7,15 +7,15 @@ describe('utils.handleQueryParams', () => {
|
||||
const expectedResult = '';
|
||||
expect(result).toEqual(expectedResult);
|
||||
});
|
||||
test('should format', async () => {
|
||||
test('should format', () => {
|
||||
const inputData = {
|
||||
name: 'Company Name',
|
||||
address: 'Company Address',
|
||||
domainName: 'Company Domain Name',
|
||||
linkedinUrl__url: '/linkedin_url',
|
||||
linkedinUrl__label: "Test linkedinUrl",
|
||||
linkedinUrl__label: 'Test linkedinUrl',
|
||||
xUrl__url: '/x_url',
|
||||
xUrl__label: "Test xUrl",
|
||||
xUrl__label: 'Test xUrl',
|
||||
annualRecurringRevenue: 100000,
|
||||
idealCustomerProfile: true,
|
||||
employees: 25,
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
import { labelling } from "../../utils/labelling";
|
||||
|
||||
describe('labelling', ()=> {
|
||||
test('should label properly', ()=> {
|
||||
expect(labelling('createdAt')).toEqual('Created At')
|
||||
})
|
||||
})
|
||||
7
packages/twenty-zapier/src/test/utils/labelize.test.ts
Normal file
7
packages/twenty-zapier/src/test/utils/labelize.test.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { labelling } from '../../utils/labelling';
|
||||
|
||||
describe('labelling', () => {
|
||||
test('should label properly', () => {
|
||||
expect(labelling('createdAt')).toEqual('Created At');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user