@taskmagic/apps-klenty 0.0.1

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 ADDED
@@ -0,0 +1,3 @@
1
+ # Klenty
2
+
3
+ Sales engagement platform for managing prospects and adding them to outreach cadences.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@taskmagic/apps-klenty",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "@anthropic-ai/sdk": "0.33.1",
6
+ "@sinclair/typebox": "0.34.11",
7
+ "axios": "1.17.0",
8
+ "axios-retry": "4.4.1",
9
+ "deepmerge-ts": "7.1.0",
10
+ "mime-types": "2.1.35",
11
+ "nanoid": "3.3.8",
12
+ "openai": "4.67.1",
13
+ "replicate": "0.34.1",
14
+ "semver": "7.6.0",
15
+ "zod": "3.25.76",
16
+ "@taskmagic/pieces-common": "0.4.4",
17
+ "@taskmagic/pieces-framework": "0.7.46",
18
+ "@taskmagic/shared": "0.10.171",
19
+ "tslib": "1.14.1"
20
+ },
21
+ "overrides": {
22
+ "cross-spawn": "7.0.6",
23
+ "elliptic": "^6.6.1",
24
+ "fast-xml-parser": "^4.4.1",
25
+ "protobufjs": "^7.5.5",
26
+ "tmp": "^0.2.4",
27
+ "koa": "^2.16.4",
28
+ "picomatch": "^4.0.4",
29
+ "langsmith": "^0.6.0",
30
+ "serialize-javascript": "^6.0.2",
31
+ "elevenlabs": {
32
+ "form-data": "^4.0.4"
33
+ },
34
+ "@tryfabric/martian": {
35
+ "@notionhq/client": "$@notionhq/client"
36
+ },
37
+ "vite": {
38
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
39
+ }
40
+ },
41
+ "resolutions": {
42
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
43
+ },
44
+ "types": "./src/index.d.ts",
45
+ "main": "./src/index.js",
46
+ "type": "commonjs"
47
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export declare const klenty: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").CustomAuthProperty<{
2
+ username: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
4
+ }>>;
package/src/index.js ADDED
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.klenty = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const shared_1 = require("@taskmagic/shared");
8
+ const add_prospect_to_campaign_1 = require("./lib/actions/add-prospect-to-campaign");
9
+ const create_prospect_1 = require("./lib/actions/create-prospect");
10
+ const get_prospect_1 = require("./lib/actions/get-prospect");
11
+ const update_prospect_1 = require("./lib/actions/update-prospect");
12
+ const auth_1 = require("./lib/auth");
13
+ const client_1 = require("./lib/common/client");
14
+ exports.klenty = (0, pieces_framework_1.createPiece)({
15
+ displayName: 'Klenty',
16
+ description: 'Sales engagement platform for managing prospects and adding them to outreach cadences.',
17
+ auth: auth_1.klentyAuth,
18
+ minimumSupportedRelease: '0.30.0',
19
+ logoUrl: 'https://cdn.activepieces.com/pieces/klenty.png',
20
+ authors: ['Harmatta', 'sanket-a11y'],
21
+ categories: [shared_1.PieceCategory.SALES_AND_CRM, shared_1.PieceCategory.MARKETING],
22
+ ai: {
23
+ description: 'Manage Klenty sales-engagement prospects: create and update contacts and enroll them into outreach cadences/campaigns.',
24
+ keywords: [
25
+ 'klenty',
26
+ 'prospect',
27
+ 'lead',
28
+ 'contact',
29
+ 'cadence',
30
+ 'campaign',
31
+ 'sales engagement',
32
+ 'outreach',
33
+ 'sequence',
34
+ ],
35
+ },
36
+ actions: [
37
+ create_prospect_1.createProspectAction,
38
+ update_prospect_1.updateProspectAction,
39
+ get_prospect_1.getProspectAction,
40
+ add_prospect_to_campaign_1.addProspectToCampaignAction,
41
+ (0, pieces_common_1.createCustomApiCallAction)({
42
+ auth: auth_1.klentyAuth,
43
+ baseUrl: (auth) => { var _a; return (0, client_1.getKlentyBaseUrl)((_a = auth.username) !== null && _a !== void 0 ? _a : ''); },
44
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
45
+ return ({
46
+ 'x-API-key': auth.apiKey,
47
+ api_key: auth.apiKey,
48
+ });
49
+ }),
50
+ }),
51
+ ],
52
+ triggers: [],
53
+ });
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/klenty/src/index.ts"],"names":[],"mappings":";;;;AAAA,4DAAqE;AACrE,kEAA0D;AAC1D,8CAAkD;AAElD,qFAAqF;AACrF,mEAAqE;AACrE,6DAA+D;AAC/D,mEAAqE;AACrE,qCAAwC;AACxC,gDAAuD;AAE1C,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EACT,wFAAwF;IAC1F,IAAI,EAAE,iBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,OAAO,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;IACpC,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,EAAE,sBAAa,CAAC,SAAS,CAAC;IAClE,EAAE,EAAE;QACF,WAAW,EACT,wHAAwH;QAC1H,QAAQ,EAAE;YACR,QAAQ;YACR,UAAU;YACV,MAAM;YACN,SAAS;YACT,SAAS;YACT,UAAU;YACV,kBAAkB;YAClB,UAAU;YACV,UAAU;SACX;KACF;IACD,OAAO,EAAE;QACP,sCAAoB;QACpB,sCAAoB;QACpB,gCAAiB;QACjB,sDAA2B;QAC3B,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,iBAAU;YAChB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,WAChB,OAAA,IAAA,yBAAgB,EAAC,MAAC,IAA6C,CAAC,QAAQ,mCAAI,EAAE,CAAC,CAAA,EAAA;YACjF,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,WAAW,EAAG,IAA6C,CAAC,MAAM;oBAClE,OAAO,EAAG,IAA6C,CAAC,MAAM;iBAC/D,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const addProspectToCampaignAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").CustomAuthProperty<{
2
+ username: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ email: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
6
+ cadenceName: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
7
+ }>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addProspectToCampaignAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const auth_1 = require("../auth");
8
+ const client_1 = require("../common/client");
9
+ const props_1 = require("../common/props");
10
+ exports.addProspectToCampaignAction = (0, pieces_framework_1.createAction)({
11
+ name: 'add_prospect_to_campaign',
12
+ displayName: 'Add Prospect to Campaign',
13
+ description: 'Add a prospect to a Klenty campaign/cadence using the startcadence endpoint.',
14
+ auth: auth_1.klentyAuth,
15
+ props: {
16
+ email: pieces_framework_1.Property.ShortText({
17
+ displayName: 'Prospect Email',
18
+ required: true,
19
+ }),
20
+ cadenceName: props_1.cadenceNameProp,
21
+ },
22
+ run(_a) {
23
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
24
+ const response = yield (0, client_1.klentyRequest)({
25
+ auth,
26
+ method: pieces_common_1.HttpMethod.POST,
27
+ path: '/startcadence',
28
+ body: {
29
+ Email: propsValue.email,
30
+ cadenceName: propsValue.cadenceName,
31
+ },
32
+ });
33
+ return response;
34
+ });
35
+ },
36
+ });
37
+ //# sourceMappingURL=add-prospect-to-campaign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-prospect-to-campaign.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/klenty/src/lib/actions/add-prospect-to-campaign.ts"],"names":[],"mappings":";;;;AAAA,4DAAsD;AACtD,kEAAqE;AAErE,kCAAqC;AACrC,6CAAiD;AACjD,2CAAkD;AAErC,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACtD,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,0BAA0B;IACvC,WAAW,EACT,8EAA8E;IAChF,IAAI,EAAE,iBAAU;IAChB,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,gBAAgB;YAC7B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,uBAAe;KAC7B;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAa,EAAC;gBACnC,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,KAAK,EAAE,UAAU,CAAC,KAAK;oBACvB,WAAW,EAAE,UAAU,CAAC,WAAW;iBACpC;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare const createProspectAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").CustomAuthProperty<{
2
+ username: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ company: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
6
+ fullName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
7
+ lastName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
8
+ middleName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
9
+ account: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
10
+ department: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
11
+ companyDomain: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
12
+ title: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
13
+ location: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
14
+ phone: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
15
+ twitterId: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
16
+ companyPhone: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
17
+ companyEmail: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
18
+ linkedinURL: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
19
+ city: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
20
+ country: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
21
+ listName: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
22
+ tags: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
23
+ outcome: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
24
+ owner: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
25
+ customFields: import("@taskmagic/pieces-framework").ArrayProperty<false> | import("@taskmagic/pieces-framework").ArrayProperty<true>;
26
+ email: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
27
+ firstName: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
28
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createProspectAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const auth_1 = require("../auth");
8
+ const client_1 = require("../common/client");
9
+ const props_1 = require("../common/props");
10
+ exports.createProspectAction = (0, pieces_framework_1.createAction)({
11
+ name: 'create_prospect',
12
+ displayName: 'Create Prospect',
13
+ description: 'Create a new prospect in Klenty.',
14
+ auth: auth_1.klentyAuth,
15
+ props: Object.assign({ email: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Email',
17
+ required: true,
18
+ }), firstName: pieces_framework_1.Property.ShortText({
19
+ displayName: 'First Name',
20
+ required: true,
21
+ }) }, props_1.prospectCommonProps),
22
+ run(_a) {
23
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
24
+ const response = yield (0, client_1.klentyRequest)({
25
+ auth,
26
+ method: pieces_common_1.HttpMethod.POST,
27
+ path: '/prospects',
28
+ body: (0, props_1.buildProspectPayload)(propsValue),
29
+ });
30
+ return response;
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=create-prospect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-prospect.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/klenty/src/lib/actions/create-prospect.ts"],"names":[],"mappings":";;;;AAAA,4DAAsD;AACtD,kEAAqE;AAErE,kCAAqC;AACrC,6CAAiD;AACjD,2CAA4E;AAE/D,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,kCAAkC;IAC/C,IAAI,EAAE,iBAAU;IAChB,KAAK,kBACH,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACf,CAAC,EACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,IAAI;SACf,CAAC,IACC,2BAAmB,CACvB;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAa,EAAC;gBACnC,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,IAAA,4BAAoB,EAAC,UAAU,CAAC;aACvC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const getProspectAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").CustomAuthProperty<{
2
+ username: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ email: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
6
+ }>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProspectAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const auth_1 = require("../auth");
7
+ const client_1 = require("../common/client");
8
+ exports.getProspectAction = (0, pieces_framework_1.createAction)({
9
+ name: 'get_prospect',
10
+ displayName: 'Get Prospect by Email',
11
+ description: 'Find a prospect by email address in Klenty.',
12
+ auth: auth_1.klentyAuth,
13
+ props: {
14
+ email: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Email',
16
+ description: 'Email address of the prospect to find.',
17
+ required: true,
18
+ }),
19
+ },
20
+ run(_a) {
21
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
22
+ const prospect = yield (0, client_1.findKlentyProspectByEmail)({
23
+ auth,
24
+ email: propsValue.email,
25
+ });
26
+ if (!prospect) {
27
+ throw new Error(`Prospect ${propsValue.email} was not found in Klenty.`);
28
+ }
29
+ return prospect;
30
+ });
31
+ },
32
+ });
33
+ //# sourceMappingURL=get-prospect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-prospect.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/klenty/src/lib/actions/get-prospect.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AAErE,kCAAqC;AACrC,6CAA6D;AAEhD,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,6CAA6C;IAC1D,IAAI,EAAE,iBAAU;IAChB,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,MAAM,IAAA,kCAAyB,EAAC;gBAC/C,IAAI;gBACJ,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,YAAY,UAAU,CAAC,KAAK,2BAA2B,CAAC,CAAC;YAC3E,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ export declare const updateProspectAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").CustomAuthProperty<{
2
+ username: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ company: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
6
+ fullName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
7
+ lastName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
8
+ middleName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
9
+ account: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
10
+ department: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
11
+ companyDomain: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
12
+ title: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
13
+ location: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
14
+ phone: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
15
+ twitterId: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
16
+ companyPhone: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
17
+ companyEmail: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
18
+ linkedinURL: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
19
+ city: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
20
+ country: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
21
+ listName: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
22
+ tags: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
23
+ outcome: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
24
+ owner: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
25
+ customFields: import("@taskmagic/pieces-framework").ArrayProperty<false> | import("@taskmagic/pieces-framework").ArrayProperty<true>;
26
+ currentEmail: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
27
+ email: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
28
+ firstName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
29
+ }>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateProspectAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const auth_1 = require("../auth");
8
+ const client_1 = require("../common/client");
9
+ const props_1 = require("../common/props");
10
+ exports.updateProspectAction = (0, pieces_framework_1.createAction)({
11
+ name: 'update_prospect',
12
+ displayName: 'Update Prospect',
13
+ description: 'Update an existing prospect in Klenty by email address.',
14
+ auth: auth_1.klentyAuth,
15
+ props: Object.assign({ currentEmail: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Current Prospect Email',
17
+ description: 'The current email used to identify the prospect in Klenty.',
18
+ required: true,
19
+ }), email: pieces_framework_1.Property.ShortText({
20
+ displayName: 'New Email',
21
+ required: false,
22
+ }), firstName: pieces_framework_1.Property.ShortText({
23
+ displayName: 'First Name',
24
+ required: false,
25
+ }) }, props_1.prospectCommonProps),
26
+ run(_a) {
27
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
28
+ const response = yield (0, client_1.klentyRequest)({
29
+ auth,
30
+ method: pieces_common_1.HttpMethod.POST,
31
+ path: `/prospects/${encodeURIComponent(String(propsValue.currentEmail))}`,
32
+ body: (0, props_1.buildProspectPayload)(propsValue),
33
+ });
34
+ return response;
35
+ });
36
+ },
37
+ });
38
+ //# sourceMappingURL=update-prospect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-prospect.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/klenty/src/lib/actions/update-prospect.ts"],"names":[],"mappings":";;;;AAAA,4DAAsD;AACtD,kEAAqE;AAErE,kCAAqC;AACrC,6CAAiD;AACjD,2CAA4E;AAE/D,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,yDAAyD;IACtE,IAAI,EAAE,iBAAU;IAChB,KAAK,kBACH,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,wBAAwB;YACrC,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,IAAI;SACf,CAAC,EACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,KAAK;SAChB,CAAC,EACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC,IACC,2BAAmB,CACvB;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAa,EAAC;gBACnC,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,cAAc,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE;gBACzE,IAAI,EAAE,IAAA,4BAAoB,EAAC,UAAU,CAAC;aACvC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const klentyAuth: import("@taskmagic/pieces-framework").CustomAuthProperty<{
2
+ username: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
4
+ }>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.klentyAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const constants_1 = require("./common/constants");
8
+ function validateHost(baseUrl, username, apiKey) {
9
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
+ const response = yield pieces_common_1.httpClient.sendRequest({
11
+ method: pieces_common_1.HttpMethod.GET,
12
+ url: `${baseUrl}/user/${encodeURIComponent(username)}/lists`,
13
+ headers: {
14
+ 'x-API-key': apiKey,
15
+ api_key: apiKey,
16
+ accept: 'application/json',
17
+ },
18
+ });
19
+ return response.status >= 200 && response.status < 300;
20
+ });
21
+ }
22
+ exports.klentyAuth = pieces_framework_1.PieceAuth.CustomAuth({
23
+ required: true,
24
+ description: `
25
+ **Generating Klenty API Key**
26
+
27
+ To access the Klenty REST APIs, you need to authenticate your requests using the Klenty API Key.
28
+
29
+ 1. Login to your Klenty account.
30
+ 2. Go to **Settings → Integrations → Klenty API Key**.
31
+ 3. Click on the key icon to generate an API Key.
32
+ `,
33
+ props: {
34
+ username: pieces_framework_1.Property.ShortText({
35
+ displayName: 'Username / Email',
36
+ description: 'The Klenty username or email used in the API URL path (for example: you@company.com).',
37
+ required: true,
38
+ }),
39
+ apiKey: pieces_framework_1.PieceAuth.SecretText({
40
+ displayName: 'API Key',
41
+ description: 'Your Klenty API key.',
42
+ required: true,
43
+ }),
44
+ },
45
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
46
+ try {
47
+ yield validateHost(constants_1.KLENTY_API_BASE, auth.username, auth.apiKey);
48
+ return {
49
+ valid: true,
50
+ };
51
+ }
52
+ catch (_b) {
53
+ return {
54
+ valid: false,
55
+ error: 'Invalid Klenty credentials. Verify the username/email used in the path and the API key.',
56
+ };
57
+ }
58
+ }),
59
+ });
60
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/community/klenty/src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,4DAAkE;AAClE,kEAAkE;AAElE,kDAAqD;AAErD,SAAe,YAAY,CACzB,OAAe,EACf,QAAgB,EAChB,MAAc;;QAEd,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;YAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,GAAG,OAAO,SAAS,kBAAkB,CAAC,QAAQ,CAAC,QAAQ;YAC5D,OAAO,EAAE;gBACP,WAAW,EAAE,MAAM;gBACnB,OAAO,EAAE,MAAM;gBACf,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC;IACzD,CAAC;CAAA;AAEY,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE;;;;;;;;GAQZ;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EACT,uFAAuF;YACzF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC3B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,sBAAsB;YACnC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,YAAY,CAAC,2BAAe,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAChE,OAAO;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;QAAC,WAAM,CAAC;YACP,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EACH,yFAAyF;aAC5F,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { HttpMethod, QueryParams } from '@taskmagic/pieces-common';
2
+ import { PiecePropValueSchema } from '@taskmagic/pieces-framework';
3
+ import { klentyAuth } from '../auth';
4
+ export type KlentyAuthValue = PiecePropValueSchema<typeof klentyAuth>;
5
+ export type KlentyProspect = {
6
+ Email?: string;
7
+ FirstName?: string;
8
+ LastName?: string;
9
+ Company?: string;
10
+ List?: string;
11
+ [key: string]: unknown;
12
+ };
13
+ export declare function getKlentyBaseUrl(username: string): string;
14
+ export declare function klentyRequest<T = unknown>({ auth, method, path, queryParams, body, }: {
15
+ auth: KlentyAuthValue;
16
+ method: HttpMethod;
17
+ path: string;
18
+ queryParams?: QueryParams;
19
+ body?: unknown;
20
+ }): Promise<T>;
21
+ export declare function findKlentyProspectByEmail({ auth, email, }: {
22
+ auth: KlentyAuthValue;
23
+ email: string;
24
+ }): Promise<KlentyProspect | null>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getKlentyBaseUrl = getKlentyBaseUrl;
4
+ exports.klentyRequest = klentyRequest;
5
+ exports.findKlentyProspectByEmail = findKlentyProspectByEmail;
6
+ const tslib_1 = require("tslib");
7
+ const pieces_common_1 = require("@taskmagic/pieces-common");
8
+ const constants_1 = require("./constants");
9
+ function getKlentyBaseUrl(username) {
10
+ return `${constants_1.KLENTY_API_BASE}/user/${encodeURIComponent(username)}`;
11
+ }
12
+ function klentyRequest(_a) {
13
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, method, path, queryParams, body, }) {
14
+ const response = yield pieces_common_1.httpClient.sendRequest({
15
+ method,
16
+ url: `${getKlentyBaseUrl(auth.username)}${path}`,
17
+ headers: Object.assign({ 'x-API-key': auth.apiKey, api_key: auth.apiKey, accept: 'application/json' }, (body ? { 'Content-Type': 'application/json' } : {})),
18
+ queryParams,
19
+ body,
20
+ });
21
+ return response.body;
22
+ });
23
+ }
24
+ function findKlentyProspectByEmail(_a) {
25
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, email, }) {
26
+ const prospect = yield klentyRequest({
27
+ auth,
28
+ method: pieces_common_1.HttpMethod.GET,
29
+ path: '/prospects',
30
+ queryParams: { Email: email },
31
+ });
32
+ return prospect !== null && prospect !== void 0 ? prospect : null;
33
+ });
34
+ }
35
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/klenty/src/lib/common/client.ts"],"names":[],"mappings":";;AAqBA,4CAEC;AAED,sCA2BC;AAED,8DAeC;;AArED,4DAIkC;AAIlC,2CAA8C;AAa9C,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,GAAG,2BAAe,SAAS,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;AACnE,CAAC;AAED,SAAsB,aAAa;iEAAc,EAC/C,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,WAAW,EACX,IAAI,GAOL;QACC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAI;YAC/C,MAAM;YACN,GAAG,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,EAAE;YAChD,OAAO,kBACL,WAAW,EAAE,IAAI,CAAC,MAAM,EACxB,OAAO,EAAE,IAAI,CAAC,MAAM,EACpB,MAAM,EAAE,kBAAkB,IACvB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACxD;YACD,WAAW;YACX,IAAI;SACL,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CAAA;AAED,SAAsB,yBAAyB;iEAAC,EAC9C,IAAI,EACJ,KAAK,GAIN;QACC,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAwB;YAC1D,IAAI;YACJ,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;SAC9B,CAAC,CAAC;QAEH,OAAO,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,CAAC;IAC1B,CAAC;CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const KLENTY_API_BASE = "https://app.klenty.com/apis/v1";
2
+ export declare const KLENTY_DOCS_API_BASE = "https://api.klenty.com/apis/v1";
3
+ export declare const DEFAULT_PAGE_SIZE = 100;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_PAGE_SIZE = exports.KLENTY_DOCS_API_BASE = exports.KLENTY_API_BASE = void 0;
4
+ exports.KLENTY_API_BASE = 'https://app.klenty.com/apis/v1';
5
+ exports.KLENTY_DOCS_API_BASE = 'https://api.klenty.com/apis/v1';
6
+ exports.DEFAULT_PAGE_SIZE = 100;
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/klenty/src/lib/common/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,gCAAgC,CAAC;AACnD,QAAA,oBAAoB,GAAG,gCAAgC,CAAC;AACxD,QAAA,iBAAiB,GAAG,GAAG,CAAC"}
@@ -0,0 +1,51 @@
1
+ export type ProspectPayloadInput = {
2
+ email?: string;
3
+ firstName?: string;
4
+ company?: string;
5
+ fullName?: string;
6
+ lastName?: string;
7
+ middleName?: string;
8
+ account?: string;
9
+ department?: string;
10
+ companyDomain?: string;
11
+ title?: string;
12
+ location?: string;
13
+ phone?: string;
14
+ twitterId?: string;
15
+ companyPhone?: string;
16
+ companyEmail?: string;
17
+ linkedinURL?: string;
18
+ city?: string;
19
+ country?: string;
20
+ listName?: string;
21
+ tags?: string;
22
+ outcome?: string;
23
+ owner?: string;
24
+ customFields?: unknown[];
25
+ };
26
+ export declare const listNameProp: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
27
+ export declare const cadenceNameProp: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
28
+ export declare const prospectCommonProps: {
29
+ company: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
30
+ fullName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
31
+ lastName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
32
+ middleName: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
33
+ account: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
34
+ department: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
35
+ companyDomain: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
36
+ title: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
37
+ location: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
38
+ phone: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
39
+ twitterId: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
40
+ companyPhone: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
41
+ companyEmail: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
42
+ linkedinURL: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
43
+ city: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
44
+ country: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
45
+ listName: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
46
+ tags: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
47
+ outcome: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
48
+ owner: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
49
+ customFields: import("@taskmagic/pieces-framework").ArrayProperty<false> | import("@taskmagic/pieces-framework").ArrayProperty<true>;
50
+ };
51
+ export declare function buildProspectPayload(input: ProspectPayloadInput): Record<string, unknown>;
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prospectCommonProps = exports.cadenceNameProp = exports.listNameProp = void 0;
4
+ exports.buildProspectPayload = buildProspectPayload;
5
+ const tslib_1 = require("tslib");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
8
+ const client_1 = require("./client");
9
+ exports.listNameProp = pieces_framework_1.Property.Dropdown({
10
+ displayName: 'List',
11
+ description: 'Select a Klenty list.',
12
+ required: false,
13
+ refreshers: [],
14
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
15
+ if (!auth) {
16
+ return {
17
+ disabled: true,
18
+ placeholder: 'Connect your Klenty account first.',
19
+ options: [],
20
+ };
21
+ }
22
+ const lists = yield (0, client_1.klentyRequest)({
23
+ auth: auth,
24
+ method: pieces_common_1.HttpMethod.GET,
25
+ path: '/lists',
26
+ });
27
+ return {
28
+ disabled: false,
29
+ options: (lists !== null && lists !== void 0 ? lists : [])
30
+ .filter((list) => list.name)
31
+ .map((list) => ({
32
+ label: list.name,
33
+ value: list.name,
34
+ })),
35
+ };
36
+ }),
37
+ });
38
+ exports.cadenceNameProp = pieces_framework_1.Property.Dropdown({
39
+ displayName: 'Cadence',
40
+ description: 'Select a Klenty cadence.',
41
+ required: true,
42
+ refreshers: [],
43
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
44
+ if (!auth) {
45
+ return {
46
+ disabled: true,
47
+ placeholder: 'Connect your Klenty account first.',
48
+ options: [],
49
+ };
50
+ }
51
+ const cadences = yield (0, client_1.klentyRequest)({
52
+ auth: auth,
53
+ method: pieces_common_1.HttpMethod.GET,
54
+ path: '/cadences',
55
+ });
56
+ return {
57
+ disabled: false,
58
+ options: (cadences !== null && cadences !== void 0 ? cadences : [])
59
+ .filter((cadence) => cadence.name)
60
+ .map((cadence) => ({
61
+ label: cadence.name,
62
+ value: cadence.name,
63
+ })),
64
+ };
65
+ }),
66
+ });
67
+ exports.prospectCommonProps = {
68
+ company: pieces_framework_1.Property.ShortText({
69
+ displayName: 'Company',
70
+ required: false,
71
+ }),
72
+ fullName: pieces_framework_1.Property.ShortText({
73
+ displayName: 'Full Name',
74
+ required: false,
75
+ }),
76
+ lastName: pieces_framework_1.Property.ShortText({
77
+ displayName: 'Last Name',
78
+ required: false,
79
+ }),
80
+ middleName: pieces_framework_1.Property.ShortText({
81
+ displayName: 'Middle Name',
82
+ required: false,
83
+ }),
84
+ account: pieces_framework_1.Property.ShortText({
85
+ displayName: 'Account',
86
+ required: false,
87
+ }),
88
+ department: pieces_framework_1.Property.ShortText({
89
+ displayName: 'Department',
90
+ required: false,
91
+ }),
92
+ companyDomain: pieces_framework_1.Property.ShortText({
93
+ displayName: 'Company Domain',
94
+ required: false,
95
+ }),
96
+ title: pieces_framework_1.Property.ShortText({
97
+ displayName: 'Title',
98
+ required: false,
99
+ }),
100
+ location: pieces_framework_1.Property.ShortText({
101
+ displayName: 'Location',
102
+ required: false,
103
+ }),
104
+ phone: pieces_framework_1.Property.ShortText({
105
+ displayName: 'Phone',
106
+ required: false,
107
+ }),
108
+ twitterId: pieces_framework_1.Property.ShortText({
109
+ displayName: 'Twitter ID',
110
+ required: false,
111
+ }),
112
+ companyPhone: pieces_framework_1.Property.ShortText({
113
+ displayName: 'Company Phone',
114
+ required: false,
115
+ }),
116
+ companyEmail: pieces_framework_1.Property.ShortText({
117
+ displayName: 'Company Email',
118
+ required: false,
119
+ }),
120
+ linkedinURL: pieces_framework_1.Property.ShortText({
121
+ displayName: 'LinkedIn URL',
122
+ required: false,
123
+ }),
124
+ city: pieces_framework_1.Property.ShortText({
125
+ displayName: 'City',
126
+ required: false,
127
+ }),
128
+ country: pieces_framework_1.Property.ShortText({
129
+ displayName: 'Country',
130
+ required: false,
131
+ }),
132
+ listName: exports.listNameProp,
133
+ tags: pieces_framework_1.Property.ShortText({
134
+ displayName: 'Tags',
135
+ description: 'Pipe-separated tag names, for example: Tag1|Tag2',
136
+ required: false,
137
+ }),
138
+ outcome: pieces_framework_1.Property.ShortText({
139
+ displayName: 'Outcome',
140
+ description: 'Klenty outcome value. Case-sensitive.',
141
+ required: false,
142
+ }),
143
+ owner: pieces_framework_1.Property.ShortText({
144
+ displayName: 'Owner',
145
+ description: 'Email address of the Klenty user to assign as prospect owner.',
146
+ required: false,
147
+ }),
148
+ customFields: pieces_framework_1.Property.Array({
149
+ displayName: 'Custom Fields',
150
+ description: 'Key/value pairs to send in Klenty CustomFields.',
151
+ required: false,
152
+ properties: {
153
+ key: pieces_framework_1.Property.ShortText({
154
+ displayName: 'Key',
155
+ required: true,
156
+ }),
157
+ value: pieces_framework_1.Property.ShortText({
158
+ displayName: 'Value',
159
+ required: false,
160
+ }),
161
+ },
162
+ }),
163
+ };
164
+ function buildProspectPayload(input) {
165
+ var _a;
166
+ const customFields = ((_a = input.customFields) !== null && _a !== void 0 ? _a : [])
167
+ .filter((field) => {
168
+ return typeof field === 'object' && field !== null && 'key' in field;
169
+ })
170
+ .map((field) => ({
171
+ key: String(field['key']),
172
+ value: field['value'] === undefined || field['value'] === null
173
+ ? ''
174
+ : String(field['value']),
175
+ }));
176
+ return Object.fromEntries(Object.entries({
177
+ Email: input.email,
178
+ FirstName: input.firstName,
179
+ Company: input.company,
180
+ FullName: input.fullName,
181
+ LastName: input.lastName,
182
+ MiddleName: input.middleName,
183
+ Account: input.account,
184
+ Department: input.department,
185
+ CompanyDomain: input.companyDomain,
186
+ Title: input.title,
187
+ Location: input.location,
188
+ Phone: input.phone,
189
+ TwitterId: input.twitterId,
190
+ CompanyPhone: input.companyPhone,
191
+ CompanyEmail: input.companyEmail,
192
+ LinkedinURL: input.linkedinURL,
193
+ City: input.city,
194
+ Country: input.country,
195
+ List: input.listName,
196
+ Tags: input.tags,
197
+ Outcome: input.outcome,
198
+ Owner: input.owner,
199
+ CustomFields: customFields.length > 0 ? customFields : undefined,
200
+ }).filter(([, value]) => value !== undefined && value !== null && value !== ''));
201
+ }
202
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/klenty/src/lib/common/props.ts"],"names":[],"mappings":";;;AA2MA,oDA0CC;;AArPD,4DAAsD;AACtD,kEAAuD;AAEvD,qCAA0D;AAsC7C,QAAA,YAAY,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAC5C,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,uBAAuB;IACpC,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd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