@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,77 @@
|
|
|
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 { enrichPeopleCore } from 'src/logic-functions/handlers/enrich-people';
|
|
6
|
+
import { type EnrichInput, toBulkEnrichInput } from 'src/logic-functions/utils/to-bulk-enrich-input';
|
|
7
|
+
|
|
8
|
+
const handler = (input: EnrichInput) => {
|
|
9
|
+
return enrichPeopleCore({ input: toBulkEnrichInput(input) });
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default defineLogicFunction({
|
|
13
|
+
universalIdentifier: PDL_LOGIC_FUNCTION_CONSTANTS.enrichPeople.universalIdentifier,
|
|
14
|
+
name: 'enrich-people',
|
|
15
|
+
description: 'Enrich one or more Person records with People Data Labs data',
|
|
16
|
+
timeoutSeconds: 300,
|
|
17
|
+
handler,
|
|
18
|
+
httpRouteTriggerSettings: {
|
|
19
|
+
path: PDL_LOGIC_FUNCTION_CONSTANTS.enrichPeople.path,
|
|
20
|
+
httpMethod: 'POST',
|
|
21
|
+
isAuthRequired: true
|
|
22
|
+
},
|
|
23
|
+
workflowActionTriggerSettings: {
|
|
24
|
+
label: 'Enrich People',
|
|
25
|
+
icon: 'IconSparkles',
|
|
26
|
+
inputSchema: [
|
|
27
|
+
{
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
records: {
|
|
31
|
+
type: 'records',
|
|
32
|
+
objectUniversalIdentifier:
|
|
33
|
+
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.person.universalIdentifier,
|
|
34
|
+
label: 'Records',
|
|
35
|
+
},
|
|
36
|
+
updateFields: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
label: 'Update fields',
|
|
39
|
+
enum: [...UPDATE_FIELDS_OPTION_VALUES],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
outputSchema: [
|
|
45
|
+
{
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: {
|
|
48
|
+
success: { type: 'boolean', label: 'Success' },
|
|
49
|
+
total: { type: 'number', label: 'Total' },
|
|
50
|
+
matched: { type: 'number', label: 'Matched' },
|
|
51
|
+
notFound: { type: 'number', label: 'Not Found' },
|
|
52
|
+
skipped: { type: 'number', label: 'Skipped' },
|
|
53
|
+
errored: { type: 'number', label: 'Errored' },
|
|
54
|
+
results: {
|
|
55
|
+
type: 'array',
|
|
56
|
+
items: {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {
|
|
59
|
+
success: { type: 'boolean', label: 'Success' },
|
|
60
|
+
recordId: { type: 'string', label: 'Record Id' },
|
|
61
|
+
status: { type: 'string', label: 'Status' },
|
|
62
|
+
updatedFields: {
|
|
63
|
+
type: 'array',
|
|
64
|
+
items: { type: 'string' },
|
|
65
|
+
label: 'Updated Fields',
|
|
66
|
+
},
|
|
67
|
+
data: { type: 'object', label: 'Data' },
|
|
68
|
+
message: { type: 'string', label: 'Message' },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
label: 'Results',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
});
|