@twentyhq/people-data-labs 1.0.4 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/manifest.json +18 -16
- package/package.json +4 -4
- package/src/front-components/enrich-companies-component-effect.mjs +10 -10
- package/src/front-components/enrich-companies-component-effect.mjs.map +4 -4
- package/src/front-components/enrich-companies-component-effect.tsx +21 -0
- package/src/front-components/enrich-people-component-effect.mjs +10 -10
- package/src/front-components/enrich-people-component-effect.mjs.map +4 -4
- package/src/front-components/enrich-people-component-effect.tsx +21 -0
- package/src/logic-functions/enrich-companies.function.mjs.map +3 -3
- package/src/logic-functions/enrich-companies.function.ts +77 -0
- package/src/logic-functions/enrich-company.function.mjs.map +3 -3
- package/src/logic-functions/enrich-company.function.ts +75 -0
- package/src/logic-functions/enrich-people.function.mjs.map +3 -3
- package/src/logic-functions/enrich-people.function.ts +77 -0
- package/src/logic-functions/enrich-person.function.mjs.map +3 -3
- package/src/logic-functions/enrich-person.function.ts +75 -0
- package/src/logic-functions/post-install.function.mjs.map +1 -1
- package/src/logic-functions/post-install.function.ts +17 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { defineLogicFunction, STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS } from 'twenty-sdk/define';
|
|
2
|
+
|
|
3
|
+
import { UPDATE_FIELDS_OPTION_VALUES } from 'src/constants/update-fields-option-values';
|
|
4
|
+
import { PDL_LOGIC_FUNCTION_CONSTANTS } from 'src/constants/universal-identifiers';
|
|
5
|
+
import { enrichCompanyCore } from 'src/logic-functions/handlers/enrich-company';
|
|
6
|
+
import { type SingleEnrichInput } from 'src/types/single-enrich-input';
|
|
7
|
+
|
|
8
|
+
const handler = (input: SingleEnrichInput) => enrichCompanyCore({ input });
|
|
9
|
+
|
|
10
|
+
export default defineLogicFunction({
|
|
11
|
+
universalIdentifier: PDL_LOGIC_FUNCTION_CONSTANTS.enrichCompany.universalIdentifier,
|
|
12
|
+
name: 'enrich-company',
|
|
13
|
+
description:
|
|
14
|
+
'Enrich a single Company record with People Data Labs data (industry, size, funding, location, etc.) given its record id.',
|
|
15
|
+
timeoutSeconds: 60,
|
|
16
|
+
handler,
|
|
17
|
+
workflowActionTriggerSettings: {
|
|
18
|
+
label: 'Enrich Company',
|
|
19
|
+
icon: 'IconSparkles',
|
|
20
|
+
inputSchema: [
|
|
21
|
+
{
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {
|
|
24
|
+
recordId: {
|
|
25
|
+
type: 'record',
|
|
26
|
+
objectUniversalIdentifier:
|
|
27
|
+
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.company.universalIdentifier,
|
|
28
|
+
label: 'Record',
|
|
29
|
+
},
|
|
30
|
+
updateFields: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
label: 'Update fields',
|
|
33
|
+
enum: [...UPDATE_FIELDS_OPTION_VALUES],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
outputSchema: [
|
|
39
|
+
{
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
success: { type: 'boolean', label: 'Success' },
|
|
43
|
+
recordId: { type: 'string', label: 'Record Id' },
|
|
44
|
+
status: { type: 'string', label: 'Status' },
|
|
45
|
+
updatedFields: {
|
|
46
|
+
type: 'array',
|
|
47
|
+
items: { type: 'string' },
|
|
48
|
+
label: 'Updated Fields',
|
|
49
|
+
},
|
|
50
|
+
data: { type: 'object', label: 'Data' },
|
|
51
|
+
message: { type: 'string', label: 'Message' },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
toolTriggerSettings: {
|
|
57
|
+
inputSchema: {
|
|
58
|
+
type: 'object',
|
|
59
|
+
properties: {
|
|
60
|
+
recordId: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'The id of the Company record to enrich.',
|
|
63
|
+
},
|
|
64
|
+
updateFields: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
enum: [...UPDATE_FIELDS_OPTION_VALUES],
|
|
67
|
+
description:
|
|
68
|
+
'Whether to write the enriched data back to the record. "Yes and overwrite" replaces existing values; "Yes and don\'t overwrite" only fills empty fields; "No" returns the enriched data without modifying the record.',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
required: ['recordId'],
|
|
72
|
+
additionalProperties: false,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
});
|