@agnocon/piece-bookedin 0.1.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.
Files changed (52) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +48 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/bulk-delete-leads.d.ts +4 -0
  7. package/dist/lib/actions/bulk-delete-leads.d.ts.map +1 -0
  8. package/dist/lib/actions/bulk-delete-leads.js +41 -0
  9. package/dist/lib/actions/bulk-delete-leads.js.map +1 -0
  10. package/dist/lib/actions/create-lead.d.ts +7 -0
  11. package/dist/lib/actions/create-lead.d.ts.map +1 -0
  12. package/dist/lib/actions/create-lead.js +59 -0
  13. package/dist/lib/actions/create-lead.js.map +1 -0
  14. package/dist/lib/actions/delete-lead.d.ts +4 -0
  15. package/dist/lib/actions/delete-lead.d.ts.map +1 -0
  16. package/dist/lib/actions/delete-lead.js +33 -0
  17. package/dist/lib/actions/delete-lead.js.map +1 -0
  18. package/dist/lib/actions/get-lead-stats.d.ts +2 -0
  19. package/dist/lib/actions/get-lead-stats.d.ts.map +1 -0
  20. package/dist/lib/actions/get-lead-stats.js +31 -0
  21. package/dist/lib/actions/get-lead-stats.js.map +1 -0
  22. package/dist/lib/actions/get-lead.d.ts +4 -0
  23. package/dist/lib/actions/get-lead.d.ts.map +1 -0
  24. package/dist/lib/actions/get-lead.js +33 -0
  25. package/dist/lib/actions/get-lead.js.map +1 -0
  26. package/dist/lib/actions/get-leads.d.ts +9 -0
  27. package/dist/lib/actions/get-leads.d.ts.map +1 -0
  28. package/dist/lib/actions/get-leads.js +78 -0
  29. package/dist/lib/actions/get-leads.js.map +1 -0
  30. package/dist/lib/actions/update-lead.d.ts +10 -0
  31. package/dist/lib/actions/update-lead.d.ts.map +1 -0
  32. package/dist/lib/actions/update-lead.js +86 -0
  33. package/dist/lib/actions/update-lead.js.map +1 -0
  34. package/dist/lib/auth.d.ts +2 -0
  35. package/dist/lib/auth.d.ts.map +1 -0
  36. package/dist/lib/auth.js +54 -0
  37. package/dist/lib/auth.js.map +1 -0
  38. package/dist/lib/common/props.d.ts +9 -0
  39. package/dist/lib/common/props.d.ts.map +1 -0
  40. package/dist/lib/common/props.js +125 -0
  41. package/dist/lib/common/props.js.map +1 -0
  42. package/package.json +46 -0
  43. package/src/index.ts +43 -0
  44. package/src/lib/actions/bulk-delete-leads.ts +40 -0
  45. package/src/lib/actions/create-lead.ts +57 -0
  46. package/src/lib/actions/delete-lead.ts +27 -0
  47. package/src/lib/actions/get-lead-stats.ts +25 -0
  48. package/src/lib/actions/get-lead.ts +27 -0
  49. package/src/lib/actions/get-leads.ts +69 -0
  50. package/src/lib/actions/update-lead.ts +92 -0
  51. package/src/lib/auth.ts +48 -0
  52. package/src/lib/common/props.ts +138 -0
package/LICENSE.MIT-AP ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) Activepieces AB
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Derived helpers in this folder are adapted from Activepieces (MIT) for use
24
+ inside CX without depending on @activepieces/* packages at runtime.
@@ -0,0 +1,2 @@
1
+ export declare const bookedin: import("@agnocon/pieces-framework").Piece<import("@agnocon/pieces-framework").SecretTextProperty<true>>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,QAAQ,yGA2BnB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bookedin = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bookedin/src/index.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const props_1 = require("./lib/common/props");
10
+ const get_leads_1 = require("./lib/actions/get-leads");
11
+ const create_lead_1 = require("./lib/actions/create-lead");
12
+ const get_lead_1 = require("./lib/actions/get-lead");
13
+ const delete_lead_1 = require("./lib/actions/delete-lead");
14
+ const get_lead_stats_1 = require("./lib/actions/get-lead-stats");
15
+ const update_lead_1 = require("./lib/actions/update-lead");
16
+ const pieces_framework_2 = require("@agnocon/pieces-framework");
17
+ const auth_1 = require("./lib/auth");
18
+ // --- Authentication ---
19
+ // --- Piece Definition ---
20
+ exports.bookedin = (0, pieces_framework_1.createPiece)({
21
+ displayName: 'Bookedin',
22
+ description: 'AI agents for lead conversion and appointment booking.',
23
+ logoUrl: 'https://cdn.activepieces.com/pieces/bookedin.png',
24
+ categories: [pieces_framework_2.PieceCategory.SALES_AND_CRM],
25
+ auth: auth_1.bookedinAuth,
26
+ minimumSupportedRelease: '0.36.1',
27
+ authors: ["drona2938", "onyedikachi-david"],
28
+ actions: [
29
+ get_leads_1.getLeads,
30
+ create_lead_1.createLead,
31
+ get_lead_1.getLead,
32
+ delete_lead_1.deleteLead,
33
+ get_lead_stats_1.getLeadStats,
34
+ update_lead_1.updateLead,
35
+ (0, pieces_common_1.createCustomApiCallAction)({
36
+ baseUrl: () => props_1.BASE_URL,
37
+ auth: auth_1.bookedinAuth,
38
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
39
+ const apiKey = (0, props_1.extractApiKey)(auth);
40
+ return {
41
+ 'X-API-Key': apiKey,
42
+ };
43
+ }),
44
+ }),
45
+ ],
46
+ triggers: [],
47
+ });
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,oFAAoF;AACpF,qEAAqE;AACrE,gEAAmE;AACnE,0DAA2F;AAC3F,8CAA6D;AAC7D,uDAAmD;AACnD,2DAAuD;AACvD,qDAAiD;AACjD,2DAAuD;AACvD,iEAA4D;AAC5D,2DAAuD;AACvD,gEAA0D;AAC1D,qCAA0C;AAE1C,yBAAyB;AACzB,2BAA2B;AACd,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,wDAAwD;IACrE,OAAO,EAAE,kDAAkD;IAC3D,UAAU,EAAE,CAAC,gCAAa,CAAC,aAAa,CAAC;IACzC,IAAI,EAAE,mBAAY;IAClB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,CAAC,WAAW,EAAE,mBAAmB,CAAC;IAC3C,OAAO,EAAE;QACP,oBAAQ;QACR,wBAAU;QACV,kBAAO;QACP,wBAAU;QACV,6BAAY;QACZ,wBAAU;QACV,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAQ;YACvB,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,MAAM,MAAM,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC;gBACnC,OAAO;oBACL,WAAW,EAAE,MAAM;iBACpB,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const bulkDeleteLeads: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
2
+ lead_ids: import("@agnocon/pieces-framework").MultiSelectDropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
3
+ }>;
4
+ //# sourceMappingURL=bulk-delete-leads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-delete-leads.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/bulk-delete-leads.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe;;EAkC1B,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bulkDeleteLeads = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bookedin/src/lib/actions/bulk-delete-leads.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const props_1 = require("../common/props");
11
+ exports.bulkDeleteLeads = (0, pieces_framework_1.createAction)({
12
+ name: 'bulkDeleteLeads',
13
+ displayName: 'Bulk Delete Leads',
14
+ description: 'Delete multiple leads (max 500 per request)',
15
+ auth: auth_1.bookedinAuth,
16
+ props: {
17
+ lead_ids: props_1.leadIdsMultiSelectDropdown,
18
+ },
19
+ run(_a) {
20
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
21
+ const apiKey = (0, props_1.extractApiKey)(auth);
22
+ const leadIds = Array.isArray(propsValue.lead_ids) ? propsValue.lead_ids : [propsValue.lead_ids];
23
+ if (leadIds.length === 0) {
24
+ throw new Error('At least one lead must be selected');
25
+ }
26
+ if (leadIds.length > 500) {
27
+ throw new Error('Maximum 500 leads can be deleted per request');
28
+ }
29
+ const response = yield pieces_common_1.httpClient.sendRequest({
30
+ method: pieces_common_1.HttpMethod.POST,
31
+ url: `${props_1.BASE_URL}/leads/bulk-delete`,
32
+ headers: Object.assign(Object.assign({}, (0, props_1.getBookedinHeaders)(apiKey)), { 'Content-Type': 'application/json' }),
33
+ body: {
34
+ lead_ids: leadIds,
35
+ },
36
+ });
37
+ return response.body;
38
+ });
39
+ },
40
+ });
41
+ //# sourceMappingURL=bulk-delete-leads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-delete-leads.js","sourceRoot":"","sources":["../../../src/lib/actions/bulk-delete-leads.ts"],"names":[],"mappings":";;;;AAAA,4GAA4G;AAC5G,qEAAqE;AACrE,gEAAyD;AACzD,0DAAgE;AAChE,kCAAuC;AACvC,2CAA0G;AAE7F,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,6CAA6C;IAC1D,IAAI,EAAE,mBAAY;IAClB,KAAK,EAAE;QACL,QAAQ,EAAE,kCAA0B;KACrC;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC;YACnC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YAEjG,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;YACxD,CAAC;YAED,IAAI,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;YAClE,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,gBAAQ,oBAAoB;gBACpC,OAAO,kCACF,IAAA,0BAAkB,EAAC,MAAM,CAAC,KAC7B,cAAc,EAAE,kBAAkB,GACnC;gBACD,IAAI,EAAE;oBACJ,QAAQ,EAAE,OAAO;iBAClB;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const createLead: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
2
+ firstName: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ lastName: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ email: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ phone: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ }>;
7
+ //# sourceMappingURL=create-lead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-lead.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-lead.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU;;;;;EAmDrB,CAAC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLead = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bookedin/src/lib/actions/create-lead.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const props_1 = require("../common/props");
11
+ exports.createLead = (0, pieces_framework_1.createAction)({
12
+ name: 'createLead',
13
+ displayName: 'Create Lead',
14
+ description: 'Creates a new lead in Bookedin AI',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Create a new lead in Bookedin for the authenticated business from a contact first name, last name, email, and phone (all required). Use it to add a prospect into the lead pipeline. Not idempotent — each call creates a separate lead, with no de-duplication on email or phone.', idempotent: false },
17
+ auth: auth_1.bookedinAuth,
18
+ props: {
19
+ firstName: pieces_framework_1.Property.ShortText({
20
+ displayName: 'First Name',
21
+ required: true,
22
+ }),
23
+ lastName: pieces_framework_1.Property.ShortText({
24
+ displayName: 'Last Name',
25
+ required: true,
26
+ }),
27
+ email: pieces_framework_1.Property.ShortText({
28
+ displayName: 'Email',
29
+ required: true,
30
+ }),
31
+ phone: pieces_framework_1.Property.ShortText({
32
+ displayName: 'Phone Number',
33
+ required: true,
34
+ }),
35
+ },
36
+ run(_a) {
37
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
38
+ const apiKey = (0, props_1.extractApiKey)(auth);
39
+ const payload = {
40
+ contact: {
41
+ name: {
42
+ last: propsValue.lastName,
43
+ first: propsValue.firstName,
44
+ },
45
+ email: propsValue.email,
46
+ number: propsValue.phone,
47
+ },
48
+ };
49
+ const response = yield pieces_common_1.httpClient.sendRequest({
50
+ method: pieces_common_1.HttpMethod.POST,
51
+ url: `${props_1.BASE_URL}/leads/`,
52
+ headers: Object.assign(Object.assign({}, (0, props_1.getBookedinHeaders)(apiKey)), { 'Content-Type': 'application/json' }),
53
+ body: payload,
54
+ });
55
+ return response.body;
56
+ });
57
+ },
58
+ });
59
+ //# sourceMappingURL=create-lead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-lead.js","sourceRoot":"","sources":["../../../src/lib/actions/create-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AAC,IAAI;gBACvB,GAAG,EAAE,GAAG,gBAAQ,SAAS;gBACzB,OAAO,kCACF,IAAA,0BAAkB,EAAC,MAAM,CAAC,KAC7B,cAAc,EAAE,kBAAkB,GACnC;gBACD,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const deleteLead: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
2
+ lead_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
3
+ }>;
4
+ //# sourceMappingURL=delete-lead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-lead.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/delete-lead.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU;;EAqBrB,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteLead = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bookedin/src/lib/actions/delete-lead.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const props_1 = require("../common/props");
11
+ exports.deleteLead = (0, pieces_framework_1.createAction)({
12
+ name: 'deleteLead',
13
+ displayName: 'Delete Lead',
14
+ description: 'Delete a lead.',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Permanently delete a lead by its Bookedin lead ID. Use it to remove a known lead from the pipeline; this is destructive and cannot be undone. Idempotent on the end state — once the lead is gone, re-running targets an already-removed record.', idempotent: true },
17
+ auth: auth_1.bookedinAuth,
18
+ props: {
19
+ lead_id: props_1.leadIdDropdown,
20
+ },
21
+ run(_a) {
22
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
23
+ const apiKey = (0, props_1.extractApiKey)(auth);
24
+ const response = yield pieces_common_1.httpClient.sendRequest({
25
+ method: pieces_common_1.HttpMethod.DELETE,
26
+ url: `${props_1.BASE_URL}/leads/${propsValue.lead_id}`,
27
+ headers: (0, props_1.getBookedinHeaders)(apiKey),
28
+ });
29
+ return response.body;
30
+ });
31
+ },
32
+ });
33
+ //# sourceMappingURL=delete-lead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-lead.js","sourceRoot":"","sources":["../../../src/lib/actions/delete-lead.ts"],"names":[],"mappings":";;;;AAAA,sGAAsG;AACtG,qEAAqE;AACrE,gEAAyD;AACzD,0DAAgE;AAChE,kCAAuC;AACvC,2CAA8F;AAEjF,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kPAAkP,EAAE,UAAU,EAAE,IAAI,EAAE;IACjS,IAAI,EAAE,mBAAY;IAClB,KAAK,EAAE;QACL,OAAO,EAAE,sBAAc;KACxB;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC;YAEnC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,GAAG,EAAE,GAAG,gBAAQ,UAAU,UAAU,CAAC,OAAO,EAAE;gBAC9C,OAAO,EAAE,IAAA,0BAAkB,EAAC,MAAM,CAAC;aACpC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const getLeadStats: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {}>;
2
+ //# sourceMappingURL=get-lead-stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-lead-stats.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/get-lead-stats.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,+GAmBvB,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLeadStats = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bookedin/src/lib/actions/get-lead-stats.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const props_1 = require("../common/props");
11
+ exports.getLeadStats = (0, pieces_framework_1.createAction)({
12
+ name: 'getLeadStats',
13
+ displayName: 'Get Lead Stats',
14
+ description: 'Get lead statistics (Hot, Warm, Cold, Objectives Met, Total).',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Get aggregate lead statistics for the authenticated Bookedin business, such as counts of Hot, Warm, and Cold leads, objectives met, and the total. Use it for a quick pipeline summary rather than fetching individual leads. Takes no input; read-only and idempotent.', idempotent: true },
17
+ auth: auth_1.bookedinAuth,
18
+ props: {},
19
+ run(_a) {
20
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth }) {
21
+ const apiKey = (0, props_1.extractApiKey)(auth);
22
+ const response = yield pieces_common_1.httpClient.sendRequest({
23
+ method: pieces_common_1.HttpMethod.GET,
24
+ url: `${props_1.BASE_URL}/leads/stats`,
25
+ headers: (0, props_1.getBookedinHeaders)(apiKey),
26
+ });
27
+ return response.body;
28
+ });
29
+ },
30
+ });
31
+ //# sourceMappingURL=get-lead-stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-lead-stats.js","sourceRoot":"","sources":["../../../src/lib/actions/get-lead-stats.ts"],"names":[],"mappings":";;;;AAAA,yGAAyG;AACzG,qEAAqE;AACrE,gEAAyD;AACzD,0DAAgE;AAChE,kCAAuC;AACvC,2CAA8E;AAEjE,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,+DAA+D;IAC5E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,yQAAyQ,EAAE,UAAU,EAAE,IAAI,EAAE;IACxT,IAAI,EAAE,mBAAY;IAClB,KAAK,EAAE,EAAE;IACH,GAAG;qEAAC,EAAE,IAAI,EAAE;YAChB,MAAM,MAAM,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC;YAEnC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,gBAAQ,cAAc;gBAC9B,OAAO,EAAE,IAAA,0BAAkB,EAAC,MAAM,CAAC;aACpC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const getLead: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
2
+ lead_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
3
+ }>;
4
+ //# sourceMappingURL=get-lead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-lead.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/get-lead.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO;;EAqBlB,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLead = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bookedin/src/lib/actions/get-lead.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const props_1 = require("../common/props");
11
+ exports.getLead = (0, pieces_framework_1.createAction)({
12
+ name: 'getLead',
13
+ displayName: 'Get Lead',
14
+ description: 'Get a specific lead by ID.',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Fetch a single lead by its Bookedin lead ID. Use it to read the full record for one known lead; if you only have a name, email, or phone, find the ID first with Get Leads. Read-only and idempotent.', idempotent: true },
17
+ auth: auth_1.bookedinAuth,
18
+ props: {
19
+ lead_id: props_1.leadIdDropdown,
20
+ },
21
+ run(_a) {
22
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
23
+ const apiKey = (0, props_1.extractApiKey)(auth);
24
+ const response = yield pieces_common_1.httpClient.sendRequest({
25
+ method: pieces_common_1.HttpMethod.GET,
26
+ url: `${props_1.BASE_URL}/leads/${propsValue.lead_id}`,
27
+ headers: (0, props_1.getBookedinHeaders)(apiKey),
28
+ });
29
+ return response.body;
30
+ });
31
+ },
32
+ });
33
+ //# sourceMappingURL=get-lead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-lead.js","sourceRoot":"","sources":["../../../src/lib/actions/get-lead.ts"],"names":[],"mappings":";;;;AAAA,mGAAmG;AACnG,qEAAqE;AACrE,gEAAyD;AACzD,0DAAgE;AAChE,kCAAuC;AACvC,2CAA8F;AAEjF,QAAA,OAAO,GAAG,IAAA,+BAAY,EAAC;IAClC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,4BAA4B;IACzC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,uMAAuM,EAAE,UAAU,EAAE,IAAI,EAAE;IACtP,IAAI,EAAE,mBAAY;IAClB,KAAK,EAAE;QACL,OAAO,EAAE,sBAAc;KACxB;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC;YAEnC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,gBAAQ,UAAU,UAAU,CAAC,OAAO,EAAE;gBAC9C,OAAO,EAAE,IAAA,0BAAkB,EAAC,MAAM,CAAC;aACpC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const getLeads: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
2
+ search: import("@agnocon/pieces-framework").ShortTextProperty<false>;
3
+ source: import("@agnocon/pieces-framework").ShortTextProperty<false>;
4
+ email: import("@agnocon/pieces-framework").ShortTextProperty<false>;
5
+ phone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
6
+ limit: import("@agnocon/pieces-framework").NumberProperty<false>;
7
+ skip: import("@agnocon/pieces-framework").NumberProperty<false>;
8
+ }>;
9
+ //# sourceMappingURL=get-leads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-leads.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/get-leads.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ;;;;;;;EA+DnB,CAAC"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLeads = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bookedin/src/lib/actions/get-leads.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const props_1 = require("../common/props");
11
+ exports.getLeads = (0, pieces_framework_1.createAction)({
12
+ name: 'getLeads',
13
+ displayName: 'Get Leads',
14
+ description: 'Get all leads for the current business with pagination metadata.',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'List leads for the authenticated Bookedin business, returning a page with pagination metadata. Use it to browse or find leads; leave the filter fields empty to fetch all, or narrow by free-text search (name/email/phone), exact email, phone, or source, and page through results with limit/skip. Read-only and idempotent.', idempotent: true },
17
+ auth: auth_1.bookedinAuth,
18
+ props: {
19
+ search: pieces_framework_1.Property.ShortText({
20
+ displayName: 'Search',
21
+ description: 'Search text in name, email, or phone number',
22
+ required: false,
23
+ }),
24
+ source: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Source',
26
+ description: 'Filter by lead source (e.g., "API", "Import")',
27
+ required: false,
28
+ }),
29
+ email: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Email',
31
+ description: 'Filter by exact email address',
32
+ required: false,
33
+ }),
34
+ phone: pieces_framework_1.Property.ShortText({
35
+ displayName: 'Phone',
36
+ description: 'Filter by phone number',
37
+ required: false,
38
+ }),
39
+ limit: pieces_framework_1.Property.Number({
40
+ displayName: 'Limit',
41
+ description: 'Number of leads to return',
42
+ required: false,
43
+ defaultValue: 100,
44
+ }),
45
+ skip: pieces_framework_1.Property.Number({
46
+ displayName: 'Skip',
47
+ description: 'Number of leads to skip (pagination)',
48
+ required: false,
49
+ defaultValue: 0,
50
+ }),
51
+ },
52
+ run(_a) {
53
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
54
+ var _b, _c;
55
+ const apiKey = (0, props_1.extractApiKey)(auth);
56
+ const queryParams = {
57
+ limit: ((_b = propsValue.limit) !== null && _b !== void 0 ? _b : 100).toString(),
58
+ skip: ((_c = propsValue.skip) !== null && _c !== void 0 ? _c : 0).toString(),
59
+ };
60
+ if (propsValue.search)
61
+ queryParams['search'] = propsValue.search;
62
+ if (propsValue.source)
63
+ queryParams['source'] = propsValue.source;
64
+ if (propsValue.email)
65
+ queryParams['email'] = propsValue.email;
66
+ if (propsValue.phone)
67
+ queryParams['phone'] = propsValue.phone;
68
+ const response = yield pieces_common_1.httpClient.sendRequest({
69
+ method: pieces_common_1.HttpMethod.GET,
70
+ url: `${props_1.BASE_URL}/leads/`,
71
+ headers: (0, props_1.getBookedinHeaders)(apiKey),
72
+ queryParams,
73
+ });
74
+ return response.body;
75
+ });
76
+ },
77
+ });
78
+ //# sourceMappingURL=get-leads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-leads.js","sourceRoot":"","sources":["../../../src/lib/actions/get-leads.ts"],"names":[],"mappings":";;;;AAAA,oGAAoG;AACpG,qEAAqE;AACrE,gEAAmE;AACnE,0DAAgE;AAChE,kCAAuC;AACvC,2CAA8E;AAEjE,QAAA,QAAQ,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,kEAAkE;IAC/E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,iUAAiU,EAAE,UAAU,EAAE,IAAI,EAAE;IAChX,IAAI,EAAE,mBAAY;IAClB,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAA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U,CAAC,KAAK,CAAC;YAE9D,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,gBAAQ,SAAS;gBACzB,OAAO,EAAE,IAAA,0BAAkB,EAAC,MAAM,CAAC;gBACnC,WAAW;aACZ,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const updateLead: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
2
+ lead_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").SecretTextProperty<true>>;
3
+ firstName: import("@agnocon/pieces-framework").ShortTextProperty<false>;
4
+ lastName: import("@agnocon/pieces-framework").ShortTextProperty<false>;
5
+ email: import("@agnocon/pieces-framework").ShortTextProperty<false>;
6
+ phone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ handling_status: import("@agnocon/pieces-framework").ShortTextProperty<false>;
8
+ update_json: import("@agnocon/pieces-framework").JsonProperty<false>;
9
+ }>;
10
+ //# sourceMappingURL=update-lead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-lead.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/update-lead.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU;;;;;;;;EAqFrB,CAAC"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateLead = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bookedin/src/lib/actions/update-lead.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const props_1 = require("../common/props");
11
+ const pieces_framework_2 = require("@agnocon/pieces-framework");
12
+ exports.updateLead = (0, pieces_framework_1.createAction)({
13
+ name: 'updateLead',
14
+ displayName: 'Update Lead',
15
+ description: 'Update a lead.',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Update an existing lead identified by its Bookedin lead ID. Supply any of the individual contact fields (first/last name, email, phone) and handling status, and/or pass a raw JSON payload for complex updates that merges over those fields. Use it to edit a known lead; only the fields you provide are changed. Idempotent — re-applying the same values yields the same lead state.', idempotent: true },
18
+ auth: auth_1.bookedinAuth,
19
+ props: {
20
+ lead_id: props_1.leadIdDropdown,
21
+ firstName: pieces_framework_1.Property.ShortText({
22
+ displayName: 'First Name',
23
+ required: false,
24
+ }),
25
+ lastName: pieces_framework_1.Property.ShortText({
26
+ displayName: 'Last Name',
27
+ required: false,
28
+ }),
29
+ email: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Email',
31
+ required: false,
32
+ }),
33
+ phone: pieces_framework_1.Property.ShortText({
34
+ displayName: 'Phone Number',
35
+ required: false,
36
+ }),
37
+ handling_status: pieces_framework_1.Property.ShortText({
38
+ displayName: 'Handling Status',
39
+ required: false,
40
+ }),
41
+ update_json: pieces_framework_1.Property.Json({
42
+ displayName: 'Update Payload (JSON)',
43
+ description: 'Optional JSON body for complex updates. Merges with individual fields above.',
44
+ required: false,
45
+ defaultValue: {},
46
+ }),
47
+ },
48
+ run(_a) {
49
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
50
+ const apiKey = (0, props_1.extractApiKey)(auth);
51
+ const basePayload = {};
52
+ if (!(0, pieces_framework_2.isNil)(propsValue.firstName) || !(0, pieces_framework_2.isNil)(propsValue.lastName) || !(0, pieces_framework_2.isNil)(propsValue.email) || !(0, pieces_framework_2.isNil)(propsValue.phone)) {
53
+ const contact = {};
54
+ const nameParts = {};
55
+ if (!(0, pieces_framework_2.isNil)(propsValue.firstName) && propsValue.firstName !== '') {
56
+ nameParts['first'] = propsValue.firstName;
57
+ }
58
+ if (!(0, pieces_framework_2.isNil)(propsValue.lastName) && propsValue.lastName !== '') {
59
+ nameParts['last'] = propsValue.lastName;
60
+ }
61
+ if (Object.keys(nameParts).length > 0) {
62
+ contact['name'] = nameParts;
63
+ }
64
+ if (!(0, pieces_framework_2.isNil)(propsValue.email) && propsValue.email !== '') {
65
+ contact['email'] = propsValue.email;
66
+ }
67
+ if (!(0, pieces_framework_2.isNil)(propsValue.phone) && propsValue.phone !== '') {
68
+ contact['number'] = propsValue.phone;
69
+ }
70
+ basePayload['contact'] = contact;
71
+ }
72
+ if (!(0, pieces_framework_2.isNil)(propsValue.handling_status) && propsValue.handling_status !== '') {
73
+ basePayload['handling_status'] = propsValue.handling_status;
74
+ }
75
+ const finalPayload = Object.assign(Object.assign({}, basePayload), (propsValue.update_json || {}));
76
+ const response = yield pieces_common_1.httpClient.sendRequest({
77
+ method: pieces_common_1.HttpMethod.PUT,
78
+ url: `${props_1.BASE_URL}/leads/${propsValue.lead_id}`,
79
+ headers: Object.assign(Object.assign({}, (0, props_1.getBookedinHeaders)(apiKey)), { 'Content-Type': 'application/json' }),
80
+ body: finalPayload,
81
+ });
82
+ return response.body;
83
+ });
84
+ },
85
+ });
86
+ //# sourceMappingURL=update-lead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-lead.js","sourceRoot":"","sources":["../../../src/lib/actions/update-lead.ts"],"names":[],"mappings":";;;;AAAA,sGAAsG;AACtG,qEAAqE;AACrE,gEAAmE;AACnE,0DAAgE;AAChE,kCAAuC;AACvC,2CAA8F;AAC9F,gEAAkD;AAErC,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,2XAA2X,EAAE,UAAU,EAAE,IAAI,EAAE;IAC1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AAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,gBAAQ,UAAU,UAAU,CAAC,OAAO,EAAE;gBAC9C,OAAO,kCACF,IAAA,0BAAkB,EAAC,MAAM,CAAC,KAC7B,cAAc,EAAE,kBAAkB,GACnC;gBACD,IAAI,EAAE,YAAY;aACnB,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const bookedinAuth: import("@agnocon/pieces-framework").SecretTextProperty<true>;
2
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,8DA2CvB,CAAC"}