@twentyhq/people-data-labs 1.0.2 → 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/README.md +16 -0
- package/manifest.json +39 -38
- package/package.json +5 -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 +22 -17
- package/src/logic-functions/enrich-companies.function.mjs.map +4 -4
- package/src/logic-functions/enrich-companies.function.ts +77 -0
- package/src/logic-functions/enrich-company.function.mjs +22 -16
- package/src/logic-functions/enrich-company.function.mjs.map +4 -4
- package/src/logic-functions/enrich-company.function.ts +75 -0
- package/src/logic-functions/enrich-people.function.mjs +22 -17
- package/src/logic-functions/enrich-people.function.mjs.map +4 -4
- package/src/logic-functions/enrich-people.function.ts +77 -0
- package/src/logic-functions/enrich-person.function.mjs +22 -16
- package/src/logic-functions/enrich-person.function.mjs.map +4 -4
- 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,21 @@
|
|
|
1
|
+
import { defineFrontComponent } from 'twenty-sdk/define';
|
|
2
|
+
import { Command, useSelectedRecordIds } from 'twenty-sdk/front-component';
|
|
3
|
+
import {
|
|
4
|
+
PDL_FRONT_COMPONENT_UNIVERSAL_IDENTIFIERS,
|
|
5
|
+
PDL_LOGIC_FUNCTION_CONSTANTS
|
|
6
|
+
} from 'src/constants/universal-identifiers';
|
|
7
|
+
import { execute } from 'src/front-components/utils/call-enrich-logic-function.utils';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const Enrich = () => {
|
|
11
|
+
const recordIds = useSelectedRecordIds();
|
|
12
|
+
return <Command execute={() => execute({ path: PDL_LOGIC_FUNCTION_CONSTANTS.enrichPeople.path, recordIds })} />;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default defineFrontComponent({
|
|
16
|
+
universalIdentifier: PDL_FRONT_COMPONENT_UNIVERSAL_IDENTIFIERS.enrichPeople,
|
|
17
|
+
name: 'enrich-people-effect',
|
|
18
|
+
description: 'Enrich people effect',
|
|
19
|
+
component: Enrich,
|
|
20
|
+
isHeadless: true
|
|
21
|
+
});
|
|
@@ -211,6 +211,7 @@ var __anyHandler = {
|
|
|
211
211
|
};
|
|
212
212
|
var __anyStub = new Proxy(() => void 0, __anyHandler);
|
|
213
213
|
var defineLogicFunction = __defineFactoryStub;
|
|
214
|
+
var STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS = __anyStub;
|
|
214
215
|
|
|
215
216
|
// src/constants/update-fields-options.ts
|
|
216
217
|
var UPDATE_FIELDS_OPTIONS = {
|
|
@@ -5660,32 +5661,36 @@ var buildSkippedResult = ({
|
|
|
5660
5661
|
});
|
|
5661
5662
|
|
|
5662
5663
|
// node_modules/twenty-sdk/dist/billing/index.mjs
|
|
5663
|
-
var e =
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5664
|
+
var e = /* @__PURE__ */ (function(e2) {
|
|
5665
|
+
return e2.ACTOR = "ACTOR", e2.ADDRESS = "ADDRESS", e2.ARRAY = "ARRAY", e2.BOOLEAN = "BOOLEAN", e2.CURRENCY = "CURRENCY", e2.DATE = "DATE", e2.DATE_TIME = "DATE_TIME", e2.EMAILS = "EMAILS", e2.FILES = "FILES", e2.FULL_NAME = "FULL_NAME", e2.LINKS = "LINKS", e2.MORPH_RELATION = "MORPH_RELATION", e2.MULTI_SELECT = "MULTI_SELECT", e2.NUMBER = "NUMBER", e2.NUMERIC = "NUMERIC", e2.PHONES = "PHONES", e2.POSITION = "POSITION", e2.RATING = "RATING", e2.RAW_JSON = "RAW_JSON", e2.RELATION = "RELATION", e2.RICH_TEXT = "RICH_TEXT", e2.SELECT = "SELECT", e2.TEXT = "TEXT", e2.TS_VECTOR = "TS_VECTOR", e2.UUID = "UUID", e2;
|
|
5666
|
+
})({});
|
|
5667
|
+
e.TEXT, e.ARRAY, e.BOOLEAN, e.DATE, e.DATE_TIME, e.NUMBER, e.NUMERIC, e.RAW_JSON, e.RICH_TEXT, e.SELECT, e.MULTI_SELECT;
|
|
5668
|
+
var t = "TWENTY_API_URL";
|
|
5669
|
+
var n = "TWENTY_APP_ACCESS_TOKEN";
|
|
5670
|
+
var r = 5e3;
|
|
5671
|
+
var i = async ({ creditsUsedMicro: e2, operationType: i2, quantity: a = 1, resourceContext: o }) => {
|
|
5672
|
+
let s = process.env[t], c = process.env[n];
|
|
5668
5673
|
if (!(!s || !c)) try {
|
|
5669
|
-
let
|
|
5674
|
+
let t2 = await fetch(`${s.replace(/\/$/, "")}/app/billing/charge`, {
|
|
5670
5675
|
method: "POST",
|
|
5671
5676
|
headers: {
|
|
5672
5677
|
Authorization: `Bearer ${c}`,
|
|
5673
5678
|
"Content-Type": "application/json"
|
|
5674
5679
|
},
|
|
5675
5680
|
body: JSON.stringify({
|
|
5676
|
-
creditsUsedMicro:
|
|
5681
|
+
creditsUsedMicro: e2,
|
|
5677
5682
|
quantity: a,
|
|
5678
|
-
operationType:
|
|
5683
|
+
operationType: i2,
|
|
5679
5684
|
resourceContext: o
|
|
5680
5685
|
}),
|
|
5681
|
-
signal: AbortSignal.timeout(
|
|
5686
|
+
signal: AbortSignal.timeout(r)
|
|
5682
5687
|
});
|
|
5683
|
-
if (!
|
|
5684
|
-
let
|
|
5685
|
-
console.error(`chargeCredits: ${
|
|
5688
|
+
if (!t2.ok) {
|
|
5689
|
+
let e3 = await t2.text().catch(() => "");
|
|
5690
|
+
console.error(`chargeCredits: ${t2.status} ${t2.statusText}: ${e3}`);
|
|
5686
5691
|
}
|
|
5687
|
-
} catch (
|
|
5688
|
-
console.error(`chargeCredits: ${
|
|
5692
|
+
} catch (e3) {
|
|
5693
|
+
console.error(`chargeCredits: ${e3 instanceof Error ? e3.message : String(e3)}`);
|
|
5689
5694
|
}
|
|
5690
5695
|
};
|
|
5691
5696
|
|
|
@@ -5707,7 +5712,7 @@ var chargeMatchedEnrichments = async ({
|
|
|
5707
5712
|
const creditsPerMatchMicro = Math.round(
|
|
5708
5713
|
costPerMatchDollars * BILLING_MARGIN_MULTIPLIER * MICRO_CREDITS_PER_DOLLAR
|
|
5709
5714
|
);
|
|
5710
|
-
await
|
|
5715
|
+
await i({
|
|
5711
5716
|
creditsUsedMicro: matchedCount * creditsPerMatchMicro,
|
|
5712
5717
|
operationType: "CODE_EXECUTION",
|
|
5713
5718
|
quantity: matchedCount,
|
|
@@ -6082,8 +6087,8 @@ var enrich_companies_function_default = defineLogicFunction({
|
|
|
6082
6087
|
type: "object",
|
|
6083
6088
|
properties: {
|
|
6084
6089
|
records: {
|
|
6085
|
-
type: "
|
|
6086
|
-
|
|
6090
|
+
type: "records",
|
|
6091
|
+
objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.company.universalIdentifier,
|
|
6087
6092
|
label: "Records"
|
|
6088
6093
|
},
|
|
6089
6094
|
updateFields: {
|