@activepieces/piece-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.
Files changed (37) hide show
  1. package/package.json +16 -0
  2. package/src/index.d.ts +5 -0
  3. package/src/index.d.ts.map +1 -0
  4. package/src/index.js +40 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/add-prospect-to-campaign.d.ts +11 -0
  7. package/src/lib/actions/add-prospect-to-campaign.d.ts.map +1 -0
  8. package/src/lib/actions/add-prospect-to-campaign.js +37 -0
  9. package/src/lib/actions/add-prospect-to-campaign.js.map +1 -0
  10. package/src/lib/actions/create-prospect.d.ts +32 -0
  11. package/src/lib/actions/create-prospect.d.ts.map +1 -0
  12. package/src/lib/actions/create-prospect.js +34 -0
  13. package/src/lib/actions/create-prospect.js.map +1 -0
  14. package/src/lib/actions/get-prospect.d.ts +7 -0
  15. package/src/lib/actions/get-prospect.d.ts.map +1 -0
  16. package/src/lib/actions/get-prospect.js +33 -0
  17. package/src/lib/actions/get-prospect.js.map +1 -0
  18. package/src/lib/actions/update-prospect.d.ts +33 -0
  19. package/src/lib/actions/update-prospect.d.ts.map +1 -0
  20. package/src/lib/actions/update-prospect.js +38 -0
  21. package/src/lib/actions/update-prospect.js.map +1 -0
  22. package/src/lib/auth.d.ts +5 -0
  23. package/src/lib/auth.d.ts.map +1 -0
  24. package/src/lib/auth.js +60 -0
  25. package/src/lib/auth.js.map +1 -0
  26. package/src/lib/common/client.d.ts +25 -0
  27. package/src/lib/common/client.d.ts.map +1 -0
  28. package/src/lib/common/client.js +35 -0
  29. package/src/lib/common/client.js.map +1 -0
  30. package/src/lib/common/constants.d.ts +4 -0
  31. package/src/lib/common/constants.d.ts.map +1 -0
  32. package/src/lib/common/constants.js +7 -0
  33. package/src/lib/common/constants.js.map +1 -0
  34. package/src/lib/common/props.d.ts +61 -0
  35. package/src/lib/common/props.d.ts.map +1 -0
  36. package/src/lib/common/props.js +205 -0
  37. package/src/lib/common/props.js.map +1 -0
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@activepieces/piece-klenty",
3
+ "version": "0.0.1",
4
+ "main": "./src/index.js",
5
+ "types": "./src/index.d.ts",
6
+ "scripts": {
7
+ "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
8
+ "lint": "eslint 'src/**/*.ts'"
9
+ },
10
+ "dependencies": {
11
+ "@activepieces/pieces-common": "0.12.0",
12
+ "@activepieces/pieces-framework": "0.26.0",
13
+ "@activepieces/shared": "0.50.1",
14
+ "tslib": "2.6.2"
15
+ }
16
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare const klenty: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,MAAM;;;GAwBjB,CAAC"}
package/src/index.js ADDED
@@ -0,0 +1,40 @@
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("@activepieces/pieces-common");
6
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
7
+ const shared_1 = require("@activepieces/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.36.1',
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
+ actions: [
23
+ create_prospect_1.createProspectAction,
24
+ update_prospect_1.updateProspectAction,
25
+ get_prospect_1.getProspectAction,
26
+ add_prospect_to_campaign_1.addProspectToCampaignAction,
27
+ (0, pieces_common_1.createCustomApiCallAction)({
28
+ auth: auth_1.klentyAuth,
29
+ baseUrl: (auth) => { var _a, _b; return (0, client_1.getKlentyBaseUrl)((_b = (_a = auth === null || auth === void 0 ? void 0 : auth.props) === null || _a === void 0 ? void 0 : _a.username) !== null && _b !== void 0 ? _b : ''); },
30
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
31
+ return ({
32
+ 'x-API-key': auth.props.apiKey,
33
+ api_key: auth.props.apiKey,
34
+ });
35
+ }),
36
+ }),
37
+ ],
38
+ triggers: [],
39
+ });
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AAErD,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,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,eAAC,OAAA,IAAA,yBAAgB,EAAC,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,QAAQ,mCAAI,EAAE,CAAC,CAAA,EAAA;YAChE,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;oBAC9B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;iBAC3B,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const addProspectToCampaignAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ cadenceName: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
9
+ }>>;
10
+ }>;
11
+ //# sourceMappingURL=add-prospect-to-campaign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-prospect-to-campaign.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-prospect-to-campaign.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,2BAA2B;;;;;;;;;EA0BtC,CAAC"}
@@ -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("@activepieces/pieces-common");
6
+ const pieces_framework_1 = require("@activepieces/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":["../../../../src/lib/actions/add-prospect-to-campaign.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,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,32 @@
1
+ export declare const createProspectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
+ fullName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
+ middleName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ account: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ department: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ companyDomain: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
+ title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
+ location: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
+ twitterId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
16
+ companyPhone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
+ companyEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
18
+ linkedinURL: import("@activepieces/pieces-framework").ShortTextProperty<false>;
19
+ city: import("@activepieces/pieces-framework").ShortTextProperty<false>;
20
+ country: import("@activepieces/pieces-framework").ShortTextProperty<false>;
21
+ listName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
22
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
23
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
24
+ }>>;
25
+ tags: import("@activepieces/pieces-framework").ShortTextProperty<false>;
26
+ outcome: import("@activepieces/pieces-framework").ShortTextProperty<false>;
27
+ owner: import("@activepieces/pieces-framework").ShortTextProperty<false>;
28
+ customFields: import("@activepieces/pieces-framework").ArrayProperty<false> | import("@activepieces/pieces-framework").ArrayProperty<true>;
29
+ email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
30
+ firstName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
31
+ }>;
32
+ //# sourceMappingURL=create-prospect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-prospect.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-prospect.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B/B,CAAC"}
@@ -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("@activepieces/pieces-common");
6
+ const pieces_framework_1 = require("@activepieces/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":["../../../../src/lib/actions/create-prospect.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,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,7 @@
1
+ export declare const getProspectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ }>;
7
+ //# sourceMappingURL=get-prospect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-prospect.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-prospect.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;EAwB5B,CAAC"}
@@ -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("@activepieces/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":["../../../../src/lib/actions/get-prospect.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,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,33 @@
1
+ export declare const updateProspectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
+ fullName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
+ middleName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ account: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ department: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ companyDomain: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
+ title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
+ location: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
+ twitterId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
16
+ companyPhone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
+ companyEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
18
+ linkedinURL: import("@activepieces/pieces-framework").ShortTextProperty<false>;
19
+ city: import("@activepieces/pieces-framework").ShortTextProperty<false>;
20
+ country: import("@activepieces/pieces-framework").ShortTextProperty<false>;
21
+ listName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
22
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
23
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
24
+ }>>;
25
+ tags: import("@activepieces/pieces-framework").ShortTextProperty<false>;
26
+ outcome: import("@activepieces/pieces-framework").ShortTextProperty<false>;
27
+ owner: import("@activepieces/pieces-framework").ShortTextProperty<false>;
28
+ customFields: import("@activepieces/pieces-framework").ArrayProperty<false> | import("@activepieces/pieces-framework").ArrayProperty<true>;
29
+ currentEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
30
+ email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
31
+ firstName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
32
+ }>;
33
+ //# sourceMappingURL=update-prospect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-prospect.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-prospect.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B/B,CAAC"}
@@ -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("@activepieces/pieces-common");
6
+ const pieces_framework_1 = require("@activepieces/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":["../../../../src/lib/actions/update-prospect.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,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,5 @@
1
+ export declare const klentyAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>;
5
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,UAAU;;;EAsCrB,CAAC"}
@@ -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("@activepieces/pieces-common");
6
+ const pieces_framework_1 = require("@activepieces/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":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAAqE;AAErE,kDAA2E;AAE3E,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,25 @@
1
+ import { HttpMethod, QueryParams } from '@activepieces/pieces-common';
2
+ import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
3
+ import { klentyAuth } from '../auth';
4
+ export type KlentyAuthValue = AppConnectionValueForAuthProperty<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>;
25
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EAEZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,MAAM,MAAM,eAAe,GAAG,iCAAiC,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAsB,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,EAC/C,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,WAAW,EACX,IAAI,GACL,EAAE;IACD,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,CAAC,CAAC,CAeb;AAED,wBAAsB,yBAAyB,CAAC,EAC9C,IAAI,EACJ,KAAK,GACN,EAAE;IACD,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CASjC"}
@@ -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("@activepieces/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.props.username)}${path}`,
17
+ headers: Object.assign({ 'x-API-key': auth.props.apiKey, api_key: auth.props.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":["../../../../src/lib/common/client.ts"],"names":[],"mappings":";;AAqBA,4CAEC;AAED,sCA2BC;AAED,8DAeC;;AArED,+DAIqC;AAIrC,2CAAiE;AAajE,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,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,EAAE;YACtD,OAAO,kBACL,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAC9B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAC1B,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,4 @@
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;
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,mCAAmC,CAAC;AAChE,eAAO,MAAM,oBAAoB,mCAAmC,CAAC;AACrE,eAAO,MAAM,iBAAiB,MAAM,CAAC"}
@@ -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":["../../../../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,61 @@
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("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
27
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
28
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
29
+ }>>;
30
+ export declare const cadenceNameProp: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
31
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
32
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
33
+ }>>;
34
+ export declare const prospectCommonProps: {
35
+ company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
36
+ fullName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
37
+ lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
38
+ middleName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
39
+ account: import("@activepieces/pieces-framework").ShortTextProperty<false>;
40
+ department: import("@activepieces/pieces-framework").ShortTextProperty<false>;
41
+ companyDomain: import("@activepieces/pieces-framework").ShortTextProperty<false>;
42
+ title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
43
+ location: import("@activepieces/pieces-framework").ShortTextProperty<false>;
44
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
45
+ twitterId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
46
+ companyPhone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
47
+ companyEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
48
+ linkedinURL: import("@activepieces/pieces-framework").ShortTextProperty<false>;
49
+ city: import("@activepieces/pieces-framework").ShortTextProperty<false>;
50
+ country: import("@activepieces/pieces-framework").ShortTextProperty<false>;
51
+ listName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
52
+ username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
53
+ apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
54
+ }>>;
55
+ tags: import("@activepieces/pieces-framework").ShortTextProperty<false>;
56
+ outcome: import("@activepieces/pieces-framework").ShortTextProperty<false>;
57
+ owner: import("@activepieces/pieces-framework").ShortTextProperty<false>;
58
+ customFields: import("@activepieces/pieces-framework").ArrayProperty<false> | import("@activepieces/pieces-framework").ArrayProperty<true>;
59
+ };
60
+ export declare function buildProspectPayload(input: ProspectPayloadInput): Record<string, unknown>;
61
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,YAAY;;;GA+BvB,CAAC;AAEH,eAAO,MAAM,eAAe;;;GA+B1B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;CAgG/B,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,GAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwCzB"}
@@ -0,0 +1,205 @@
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("@activepieces/pieces-common");
7
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
8
+ const auth_1 = require("../auth");
9
+ const client_1 = require("./client");
10
+ exports.listNameProp = pieces_framework_1.Property.Dropdown({
11
+ displayName: 'List',
12
+ description: 'Select a Klenty list.',
13
+ required: false,
14
+ refreshers: [],
15
+ auth: auth_1.klentyAuth,
16
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
17
+ if (!auth) {
18
+ return {
19
+ disabled: true,
20
+ placeholder: 'Connect your Klenty account first.',
21
+ options: [],
22
+ };
23
+ }
24
+ const lists = yield (0, client_1.klentyRequest)({
25
+ auth,
26
+ method: pieces_common_1.HttpMethod.GET,
27
+ path: '/lists',
28
+ });
29
+ return {
30
+ disabled: false,
31
+ options: (lists !== null && lists !== void 0 ? lists : [])
32
+ .filter((list) => list.name)
33
+ .map((list) => ({
34
+ label: list.name,
35
+ value: list.name,
36
+ })),
37
+ };
38
+ }),
39
+ });
40
+ exports.cadenceNameProp = pieces_framework_1.Property.Dropdown({
41
+ displayName: 'Cadence',
42
+ description: 'Select a Klenty cadence.',
43
+ required: true,
44
+ refreshers: [],
45
+ auth: auth_1.klentyAuth,
46
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
47
+ if (!auth) {
48
+ return {
49
+ disabled: true,
50
+ placeholder: 'Connect your Klenty account first.',
51
+ options: [],
52
+ };
53
+ }
54
+ const cadences = yield (0, client_1.klentyRequest)({
55
+ auth,
56
+ method: pieces_common_1.HttpMethod.GET,
57
+ path: '/cadences',
58
+ });
59
+ return {
60
+ disabled: false,
61
+ options: (cadences !== null && cadences !== void 0 ? cadences : [])
62
+ .filter((cadence) => cadence.name)
63
+ .map((cadence) => ({
64
+ label: cadence.name,
65
+ value: cadence.name,
66
+ })),
67
+ };
68
+ }),
69
+ });
70
+ exports.prospectCommonProps = {
71
+ company: pieces_framework_1.Property.ShortText({
72
+ displayName: 'Company',
73
+ required: false,
74
+ }),
75
+ fullName: pieces_framework_1.Property.ShortText({
76
+ displayName: 'Full Name',
77
+ required: false,
78
+ }),
79
+ lastName: pieces_framework_1.Property.ShortText({
80
+ displayName: 'Last Name',
81
+ required: false,
82
+ }),
83
+ middleName: pieces_framework_1.Property.ShortText({
84
+ displayName: 'Middle Name',
85
+ required: false,
86
+ }),
87
+ account: pieces_framework_1.Property.ShortText({
88
+ displayName: 'Account',
89
+ required: false,
90
+ }),
91
+ department: pieces_framework_1.Property.ShortText({
92
+ displayName: 'Department',
93
+ required: false,
94
+ }),
95
+ companyDomain: pieces_framework_1.Property.ShortText({
96
+ displayName: 'Company Domain',
97
+ required: false,
98
+ }),
99
+ title: pieces_framework_1.Property.ShortText({
100
+ displayName: 'Title',
101
+ required: false,
102
+ }),
103
+ location: pieces_framework_1.Property.ShortText({
104
+ displayName: 'Location',
105
+ required: false,
106
+ }),
107
+ phone: pieces_framework_1.Property.ShortText({
108
+ displayName: 'Phone',
109
+ required: false,
110
+ }),
111
+ twitterId: pieces_framework_1.Property.ShortText({
112
+ displayName: 'Twitter ID',
113
+ required: false,
114
+ }),
115
+ companyPhone: pieces_framework_1.Property.ShortText({
116
+ displayName: 'Company Phone',
117
+ required: false,
118
+ }),
119
+ companyEmail: pieces_framework_1.Property.ShortText({
120
+ displayName: 'Company Email',
121
+ required: false,
122
+ }),
123
+ linkedinURL: pieces_framework_1.Property.ShortText({
124
+ displayName: 'LinkedIn URL',
125
+ required: false,
126
+ }),
127
+ city: pieces_framework_1.Property.ShortText({
128
+ displayName: 'City',
129
+ required: false,
130
+ }),
131
+ country: pieces_framework_1.Property.ShortText({
132
+ displayName: 'Country',
133
+ required: false,
134
+ }),
135
+ listName: exports.listNameProp,
136
+ tags: pieces_framework_1.Property.ShortText({
137
+ displayName: 'Tags',
138
+ description: 'Pipe-separated tag names, for example: Tag1|Tag2',
139
+ required: false,
140
+ }),
141
+ outcome: pieces_framework_1.Property.ShortText({
142
+ displayName: 'Outcome',
143
+ description: 'Klenty outcome value. Case-sensitive.',
144
+ required: false,
145
+ }),
146
+ owner: pieces_framework_1.Property.ShortText({
147
+ displayName: 'Owner',
148
+ description: 'Email address of the Klenty user to assign as prospect owner.',
149
+ required: false,
150
+ }),
151
+ customFields: pieces_framework_1.Property.Array({
152
+ displayName: 'Custom Fields',
153
+ description: 'Key/value pairs to send in Klenty CustomFields.',
154
+ required: false,
155
+ properties: {
156
+ key: pieces_framework_1.Property.ShortText({
157
+ displayName: 'Key',
158
+ required: true,
159
+ }),
160
+ value: pieces_framework_1.Property.ShortText({
161
+ displayName: 'Value',
162
+ required: false,
163
+ }),
164
+ },
165
+ }),
166
+ };
167
+ function buildProspectPayload(input) {
168
+ var _a;
169
+ const customFields = ((_a = input.customFields) !== null && _a !== void 0 ? _a : [])
170
+ .filter((field) => {
171
+ return typeof field === 'object' && field !== null && 'key' in field;
172
+ })
173
+ .map((field) => ({
174
+ key: String(field['key']),
175
+ value: field['value'] === undefined || field['value'] === null
176
+ ? ''
177
+ : String(field['value']),
178
+ }));
179
+ return Object.fromEntries(Object.entries({
180
+ Email: input.email,
181
+ FirstName: input.firstName,
182
+ Company: input.company,
183
+ FullName: input.fullName,
184
+ LastName: input.lastName,
185
+ MiddleName: input.middleName,
186
+ Account: input.account,
187
+ Department: input.department,
188
+ CompanyDomain: input.companyDomain,
189
+ Title: input.title,
190
+ Location: input.location,
191
+ Phone: input.phone,
192
+ TwitterId: input.twitterId,
193
+ CompanyPhone: input.companyPhone,
194
+ CompanyEmail: input.companyEmail,
195
+ LinkedinURL: input.linkedinURL,
196
+ City: input.city,
197
+ Country: input.country,
198
+ List: input.listName,
199
+ Tags: input.tags,
200
+ Outcome: input.outcome,
201
+ Owner: input.owner,
202
+ CustomFields: customFields.length > 0 ? customFields : undefined,
203
+ }).filter(([, value]) => value !== undefined && value !== null && value !== ''));
204
+ }
205
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":";;;AA8MA,oDA0CC;;AAxPD,+DAAyD;AACzD,qEAA0D;AAE1D,kCAAqC;AACrC,qCAAyC;AAsC5B,QAAA,YAAY,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAC5C,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,uBAAuB;IACpC,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,iBAAU;IAChB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAA,sBAAa,EAAe;YAC9C,IAAI;YACJ,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;QAEH,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;iBACnB,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