@agnocon/piece-bigin-by-zoho 0.1.6

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 (157) 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 +72 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/create-call.d.ts +16 -0
  7. package/dist/lib/actions/create-call.d.ts.map +1 -0
  8. package/dist/lib/actions/create-call.js +162 -0
  9. package/dist/lib/actions/create-call.js.map +1 -0
  10. package/dist/lib/actions/create-company.d.ts +14 -0
  11. package/dist/lib/actions/create-company.d.ts.map +1 -0
  12. package/dist/lib/actions/create-company.js +108 -0
  13. package/dist/lib/actions/create-company.js.map +1 -0
  14. package/dist/lib/actions/create-contact.d.ts +18 -0
  15. package/dist/lib/actions/create-contact.d.ts.map +1 -0
  16. package/dist/lib/actions/create-contact.js +130 -0
  17. package/dist/lib/actions/create-contact.js.map +1 -0
  18. package/dist/lib/actions/create-event.d.ts +18 -0
  19. package/dist/lib/actions/create-event.d.ts.map +1 -0
  20. package/dist/lib/actions/create-event.js +360 -0
  21. package/dist/lib/actions/create-event.js.map +1 -0
  22. package/dist/lib/actions/create-pipeline-record.d.ts +16 -0
  23. package/dist/lib/actions/create-pipeline-record.d.ts.map +1 -0
  24. package/dist/lib/actions/create-pipeline-record.js +219 -0
  25. package/dist/lib/actions/create-pipeline-record.js.map +1 -0
  26. package/dist/lib/actions/create-task.d.ts +16 -0
  27. package/dist/lib/actions/create-task.d.ts.map +1 -0
  28. package/dist/lib/actions/create-task.js +380 -0
  29. package/dist/lib/actions/create-task.js.map +1 -0
  30. package/dist/lib/actions/search-company-record.d.ts +5 -0
  31. package/dist/lib/actions/search-company-record.d.ts.map +1 -0
  32. package/dist/lib/actions/search-company-record.js +58 -0
  33. package/dist/lib/actions/search-company-record.js.map +1 -0
  34. package/dist/lib/actions/search-contact-record.d.ts +5 -0
  35. package/dist/lib/actions/search-contact-record.d.ts.map +1 -0
  36. package/dist/lib/actions/search-contact-record.js +82 -0
  37. package/dist/lib/actions/search-contact-record.js.map +1 -0
  38. package/dist/lib/actions/search-pipeline-records.d.ts +5 -0
  39. package/dist/lib/actions/search-pipeline-records.d.ts.map +1 -0
  40. package/dist/lib/actions/search-pipeline-records.js +53 -0
  41. package/dist/lib/actions/search-pipeline-records.js.map +1 -0
  42. package/dist/lib/actions/search-product.d.ts +5 -0
  43. package/dist/lib/actions/search-product.d.ts.map +1 -0
  44. package/dist/lib/actions/search-product.js +60 -0
  45. package/dist/lib/actions/search-product.js.map +1 -0
  46. package/dist/lib/actions/search-user.d.ts +7 -0
  47. package/dist/lib/actions/search-user.d.ts.map +1 -0
  48. package/dist/lib/actions/search-user.js +75 -0
  49. package/dist/lib/actions/search-user.js.map +1 -0
  50. package/dist/lib/actions/update-company.d.ts +7 -0
  51. package/dist/lib/actions/update-company.d.ts.map +1 -0
  52. package/dist/lib/actions/update-company.js +224 -0
  53. package/dist/lib/actions/update-company.js.map +1 -0
  54. package/dist/lib/actions/update-contact.d.ts +7 -0
  55. package/dist/lib/actions/update-contact.d.ts.map +1 -0
  56. package/dist/lib/actions/update-contact.js +248 -0
  57. package/dist/lib/actions/update-contact.js.map +1 -0
  58. package/dist/lib/actions/update-event.d.ts +13 -0
  59. package/dist/lib/actions/update-event.d.ts.map +1 -0
  60. package/dist/lib/actions/update-event.js +466 -0
  61. package/dist/lib/actions/update-event.js.map +1 -0
  62. package/dist/lib/actions/update-pipeline-record.d.ts +14 -0
  63. package/dist/lib/actions/update-pipeline-record.d.ts.map +1 -0
  64. package/dist/lib/actions/update-pipeline-record.js +205 -0
  65. package/dist/lib/actions/update-pipeline-record.js.map +1 -0
  66. package/dist/lib/actions/update-task.d.ts +13 -0
  67. package/dist/lib/actions/update-task.d.ts.map +1 -0
  68. package/dist/lib/actions/update-task.js +449 -0
  69. package/dist/lib/actions/update-task.js.map +1 -0
  70. package/dist/lib/auth.d.ts +2 -0
  71. package/dist/lib/auth.d.ts.map +1 -0
  72. package/dist/lib/auth.js +59 -0
  73. package/dist/lib/auth.js.map +1 -0
  74. package/dist/lib/common/constants.d.ts +23 -0
  75. package/dist/lib/common/constants.d.ts.map +1 -0
  76. package/dist/lib/common/constants.js +72 -0
  77. package/dist/lib/common/constants.js.map +1 -0
  78. package/dist/lib/common/helpers.d.ts +11 -0
  79. package/dist/lib/common/helpers.d.ts.map +1 -0
  80. package/dist/lib/common/helpers.js +40 -0
  81. package/dist/lib/common/helpers.js.map +1 -0
  82. package/dist/lib/common/props.d.ts +10 -0
  83. package/dist/lib/common/props.d.ts.map +1 -0
  84. package/dist/lib/common/props.js +217 -0
  85. package/dist/lib/common/props.js.map +1 -0
  86. package/dist/lib/common/request.d.ts +35 -0
  87. package/dist/lib/common/request.d.ts.map +1 -0
  88. package/dist/lib/common/request.js +226 -0
  89. package/dist/lib/common/request.js.map +1 -0
  90. package/dist/lib/triggers/company-updated.d.ts +3 -0
  91. package/dist/lib/triggers/company-updated.d.ts.map +1 -0
  92. package/dist/lib/triggers/company-updated.js +66 -0
  93. package/dist/lib/triggers/company-updated.js.map +1 -0
  94. package/dist/lib/triggers/contact-updated.d.ts +3 -0
  95. package/dist/lib/triggers/contact-updated.d.ts.map +1 -0
  96. package/dist/lib/triggers/contact-updated.js +66 -0
  97. package/dist/lib/triggers/contact-updated.js.map +1 -0
  98. package/dist/lib/triggers/new-call-created.d.ts +3 -0
  99. package/dist/lib/triggers/new-call-created.d.ts.map +1 -0
  100. package/dist/lib/triggers/new-call-created.js +66 -0
  101. package/dist/lib/triggers/new-call-created.js.map +1 -0
  102. package/dist/lib/triggers/new-company-created.d.ts +3 -0
  103. package/dist/lib/triggers/new-company-created.d.ts.map +1 -0
  104. package/dist/lib/triggers/new-company-created.js +66 -0
  105. package/dist/lib/triggers/new-company-created.js.map +1 -0
  106. package/dist/lib/triggers/new-contact-created.d.ts +3 -0
  107. package/dist/lib/triggers/new-contact-created.d.ts.map +1 -0
  108. package/dist/lib/triggers/new-contact-created.js +75 -0
  109. package/dist/lib/triggers/new-contact-created.js.map +1 -0
  110. package/dist/lib/triggers/new-event-created.d.ts +3 -0
  111. package/dist/lib/triggers/new-event-created.d.ts.map +1 -0
  112. package/dist/lib/triggers/new-event-created.js +66 -0
  113. package/dist/lib/triggers/new-event-created.js.map +1 -0
  114. package/dist/lib/triggers/new-pipeline-record.d.ts +3 -0
  115. package/dist/lib/triggers/new-pipeline-record.d.ts.map +1 -0
  116. package/dist/lib/triggers/new-pipeline-record.js +66 -0
  117. package/dist/lib/triggers/new-pipeline-record.js.map +1 -0
  118. package/dist/lib/triggers/new-task-created.d.ts +3 -0
  119. package/dist/lib/triggers/new-task-created.d.ts.map +1 -0
  120. package/dist/lib/triggers/new-task-created.js +66 -0
  121. package/dist/lib/triggers/new-task-created.js.map +1 -0
  122. package/dist/lib/triggers/pipeline-record-updated.d.ts +3 -0
  123. package/dist/lib/triggers/pipeline-record-updated.d.ts.map +1 -0
  124. package/dist/lib/triggers/pipeline-record-updated.js +66 -0
  125. package/dist/lib/triggers/pipeline-record-updated.js.map +1 -0
  126. package/package.json +46 -0
  127. package/src/index.ts +72 -0
  128. package/src/lib/actions/create-call.ts +168 -0
  129. package/src/lib/actions/create-company.ts +124 -0
  130. package/src/lib/actions/create-contact.ts +151 -0
  131. package/src/lib/actions/create-event.ts +399 -0
  132. package/src/lib/actions/create-pipeline-record.ts +255 -0
  133. package/src/lib/actions/create-task.ts +426 -0
  134. package/src/lib/actions/search-company-record.ts +57 -0
  135. package/src/lib/actions/search-contact-record.ts +79 -0
  136. package/src/lib/actions/search-pipeline-records.ts +52 -0
  137. package/src/lib/actions/search-product.ts +60 -0
  138. package/src/lib/actions/search-user.ts +70 -0
  139. package/src/lib/actions/update-company.ts +235 -0
  140. package/src/lib/actions/update-contact.ts +261 -0
  141. package/src/lib/actions/update-event.ts +528 -0
  142. package/src/lib/actions/update-pipeline-record.ts +235 -0
  143. package/src/lib/actions/update-task.ts +499 -0
  144. package/src/lib/auth.ts +57 -0
  145. package/src/lib/common/constants.ts +68 -0
  146. package/src/lib/common/helpers.ts +46 -0
  147. package/src/lib/common/props.ts +270 -0
  148. package/src/lib/common/request.ts +285 -0
  149. package/src/lib/triggers/company-updated.ts +69 -0
  150. package/src/lib/triggers/contact-updated.ts +65 -0
  151. package/src/lib/triggers/new-call-created.ts +69 -0
  152. package/src/lib/triggers/new-company-created.ts +69 -0
  153. package/src/lib/triggers/new-contact-created.ts +75 -0
  154. package/src/lib/triggers/new-event-created.ts +69 -0
  155. package/src/lib/triggers/new-pipeline-record.ts +69 -0
  156. package/src/lib/triggers/new-task-created.ts +69 -0
  157. package/src/lib/triggers/pipeline-record-updated.ts +69 -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 biginByZoho: import("@agnocon/pieces-framework").Piece<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,WAAW,gJAsCtB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ // Vendored from Activepieces packages/pieces/community/bigin-by-zoho/src/index.ts (MIT).
3
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.biginByZoho = void 0;
6
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
7
+ const new_contact_created_1 = require("./lib/triggers/new-contact-created");
8
+ const pieces_framework_2 = require("@agnocon/pieces-framework");
9
+ const company_updated_1 = require("./lib/triggers/company-updated");
10
+ const contact_updated_1 = require("./lib/triggers/contact-updated");
11
+ const new_call_created_1 = require("./lib/triggers/new-call-created");
12
+ const new_company_created_1 = require("./lib/triggers/new-company-created");
13
+ const new_task_created_1 = require("./lib/triggers/new-task-created");
14
+ const new_event_created_1 = require("./lib/triggers/new-event-created");
15
+ const new_pipeline_record_1 = require("./lib/triggers/new-pipeline-record");
16
+ const pipeline_record_updated_1 = require("./lib/triggers/pipeline-record-updated");
17
+ const create_company_1 = require("./lib/actions/create-company");
18
+ const update_company_1 = require("./lib/actions/update-company");
19
+ const create_contact_1 = require("./lib/actions/create-contact");
20
+ const update_contact_1 = require("./lib/actions/update-contact");
21
+ const create_task_1 = require("./lib/actions/create-task");
22
+ const update_task_1 = require("./lib/actions/update-task");
23
+ const create_call_1 = require("./lib/actions/create-call");
24
+ const create_event_1 = require("./lib/actions/create-event");
25
+ const update_event_1 = require("./lib/actions/update-event");
26
+ const create_pipeline_record_1 = require("./lib/actions/create-pipeline-record");
27
+ const update_pipeline_record_1 = require("./lib/actions/update-pipeline-record");
28
+ const search_pipeline_records_1 = require("./lib/actions/search-pipeline-records");
29
+ const search_company_record_1 = require("./lib/actions/search-company-record");
30
+ const search_contact_record_1 = require("./lib/actions/search-contact-record");
31
+ const search_product_1 = require("./lib/actions/search-product");
32
+ const search_user_1 = require("./lib/actions/search-user");
33
+ const auth_1 = require("./lib/auth");
34
+ exports.biginByZoho = (0, pieces_framework_1.createPiece)({
35
+ displayName: 'Bigin by Zoho CRM',
36
+ description: 'Bigin by Zoho CRM is a lightweight CRM designed for small businesses to manage contacts, companies, deals (pipeline records), tasks, calls, and events.',
37
+ auth: auth_1.biginAuth,
38
+ minimumSupportedRelease: '0.36.1',
39
+ categories: [pieces_framework_2.PieceCategory.SALES_AND_CRM],
40
+ logoUrl: 'https://cdn.activepieces.com/pieces/bigin-by-zoho.png',
41
+ authors: ['gs03dev'],
42
+ actions: [
43
+ create_company_1.createCompany,
44
+ update_company_1.updateCompany,
45
+ create_contact_1.createContact,
46
+ update_contact_1.updateContact,
47
+ create_task_1.createTask,
48
+ update_task_1.updateTask,
49
+ create_call_1.createCall,
50
+ create_event_1.createEvent,
51
+ update_event_1.updateEvent,
52
+ create_pipeline_record_1.createPipelineRecord,
53
+ update_pipeline_record_1.updatePipelineRecord,
54
+ search_pipeline_records_1.searchPipelineRecord,
55
+ search_company_record_1.searchCompanyRecord,
56
+ search_contact_record_1.searchContactRecord,
57
+ search_product_1.searchProductRecord,
58
+ search_user_1.searchUser
59
+ ],
60
+ triggers: [
61
+ new_contact_created_1.newContactCreated,
62
+ contact_updated_1.contactUpdated,
63
+ new_company_created_1.newCompanyCreated,
64
+ company_updated_1.companyUpdated,
65
+ new_call_created_1.newCallCreated,
66
+ new_task_created_1.newTaskCreated,
67
+ new_event_created_1.newEventCreated,
68
+ new_pipeline_record_1.newPipelineRecordCreated,
69
+ pipeline_record_updated_1.pipelineRecordUpdated,
70
+ ],
71
+ });
72
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,yFAAyF;AACzF,qEAAqE;;;AAErE,gEAA6E;AAG7E,4EAAuE;AACvE,gEAA0D;AAC1D,oEAAgE;AAChE,oEAAgE;AAChE,sEAAiE;AACjE,4EAAuE;AACvE,sEAAiE;AACjE,wEAAmE;AACnE,4EAA8E;AAC9E,oFAA+E;AAC/E,iEAA6D;AAC7D,iEAA6D;AAC7D,iEAA6D;AAC7D,iEAA6D;AAC7D,2DAAuD;AACvD,2DAAuD;AACvD,2DAAuD;AAEvD,6DAAyD;AACzD,6DAAyD;AACzD,iFAA4E;AAC5E,iFAA4E;AAC5E,mFAA6E;AAC7E,+EAA0E;AAC1E,+EAA0E;AAC1E,iEAAmE;AACnE,2DAAuD;AACvD,qCAAuC;AAE1B,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,WAAW,EAAE,mBAAmB;IAChC,WAAW,EACT,yJAAyJ;IAC3J,IAAI,EAAE,gBAAS;IACf,uBAAuB,EAAE,QAAQ;IACjC,UAAU,EAAE,CAAC,gCAAa,CAAC,aAAa,CAAC;IACzC,OAAO,EAAE,uDAAuD;IAChE,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,OAAO,EAAE;QACP,8BAAa;QACb,8BAAa;QACb,8BAAa;QACb,8BAAa;QACb,wBAAU;QACV,wBAAU;QACV,wBAAU;QACV,0BAAW;QACX,0BAAW;QACX,6CAAoB;QACpB,6CAAoB;QACpB,8CAAoB;QACpB,2CAAmB;QACnB,2CAAmB;QACnB,oCAAmB;QACnB,wBAAU;KACX;IACD,QAAQ,EAAE;QACR,uCAAiB;QACjB,gCAAc;QACd,uCAAiB;QACjB,gCAAc;QACd,iCAAc;QACd,iCAAc;QACd,mCAAe;QACf,8CAAwB;QACxB,+CAAqB;KACtB;CACF,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const createCall: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ callStartTime: import("@agnocon/pieces-framework").DateTimeProperty<true>;
3
+ callDuration: import("@agnocon/pieces-framework").NumberProperty<true>;
4
+ callType: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
5
+ owner: import("@agnocon/pieces-framework").DropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
6
+ contactName: import("@agnocon/pieces-framework").DropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
7
+ subject: import("@agnocon/pieces-framework").ShortTextProperty<false>;
8
+ description: import("@agnocon/pieces-framework").LongTextProperty<false>;
9
+ callAgenda: import("@agnocon/pieces-framework").LongTextProperty<false>;
10
+ reminder: import("@agnocon/pieces-framework").DateTimeProperty<false>;
11
+ dialledNumber: import("@agnocon/pieces-framework").ShortTextProperty<false>;
12
+ relatedModule: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
13
+ relatedTo: import("@agnocon/pieces-framework").DropdownProperty<any, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
14
+ tag: import("@agnocon/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
15
+ }>;
16
+ //# sourceMappingURL=create-call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-call.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-call.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;EAiKrB,CAAC"}
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCall = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigin-by-zoho/src/lib/actions/create-call.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 auth_1 = require("../auth");
9
+ const props_1 = require("../common/props");
10
+ const request_1 = require("../common/request");
11
+ const helpers_1 = require("../common/helpers");
12
+ exports.createCall = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.biginAuth,
14
+ name: 'createCall',
15
+ displayName: 'Create Call',
16
+ description: 'Creates a Call Log Entry Record',
17
+ audience: 'both',
18
+ aiMetadata: { description: 'Logs a call in Bigin CRM with a required start time, duration in minutes, and type (Outbound, Inbound, or Missed), plus optional subject, description, agenda, reminder, dialed number, owner, contact, and a related Pipeline or Company record. Use to record a phone interaction. Not idempotent: each call creates a new call log entry.', idempotent: false },
19
+ props: {
20
+ callStartTime: pieces_framework_1.Property.DateTime({
21
+ displayName: 'Call Start Time',
22
+ description: 'Provide the start time of the call in ISO8601 format.',
23
+ required: true,
24
+ }),
25
+ callDuration: pieces_framework_1.Property.Number({
26
+ displayName: 'Call Duration (minutes)',
27
+ description: 'Provide the duration of the call in minutes (numeric). For example, 30 for a 30-minute call.',
28
+ required: true,
29
+ }),
30
+ callType: pieces_framework_1.Property.StaticDropdown({
31
+ displayName: 'Call Type',
32
+ description: 'Type of call',
33
+ required: true,
34
+ options: {
35
+ options: [
36
+ { label: 'Outbound', value: 'Outbound' },
37
+ { label: 'Inbound', value: 'Inbound' },
38
+ { label: 'Missed', value: 'Missed' },
39
+ ],
40
+ },
41
+ }),
42
+ owner: props_1.usersDropdown,
43
+ contactName: props_1.contactsDropdown,
44
+ subject: pieces_framework_1.Property.ShortText({
45
+ displayName: 'Subject',
46
+ description: 'Subject of the call',
47
+ required: false,
48
+ }),
49
+ description: pieces_framework_1.Property.LongText({
50
+ displayName: 'Description',
51
+ description: 'Description or notes about the call',
52
+ required: false,
53
+ }),
54
+ callAgenda: pieces_framework_1.Property.LongText({
55
+ displayName: 'Call Agenda',
56
+ description: 'Agenda or purpose of the call',
57
+ required: false,
58
+ }),
59
+ reminder: pieces_framework_1.Property.DateTime({
60
+ displayName: 'Reminder',
61
+ description: 'Reminder date and time for the call',
62
+ required: false,
63
+ }),
64
+ dialledNumber: pieces_framework_1.Property.ShortText({
65
+ displayName: 'Dialed Number',
66
+ description: 'Provide the number dialed for the call.',
67
+ required: false,
68
+ }),
69
+ relatedModule: pieces_framework_1.Property.StaticDropdown({
70
+ displayName: 'Related Module',
71
+ description: 'Select the type of entity the call is related to.',
72
+ required: false,
73
+ defaultValue: 'Pipelines',
74
+ options: {
75
+ options: [
76
+ { label: 'Pipelines', value: 'Pipelines' },
77
+ { label: 'Companies', value: 'Companies' },
78
+ ],
79
+ },
80
+ }),
81
+ relatedTo: pieces_framework_1.Property.Dropdown({
82
+ auth: auth_1.biginAuth,
83
+ displayName: 'Related To',
84
+ description: 'Select the specific record the call is related to.',
85
+ required: false,
86
+ refreshers: ['auth', 'relatedModule'],
87
+ defaultValue: {},
88
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, relatedModule }) {
89
+ if (!auth)
90
+ return (0, helpers_1.handleDropdownError)('Please connect first');
91
+ if (!relatedModule)
92
+ return { options: [] };
93
+ const { access_token, data } = auth;
94
+ const api_domain = data['api_domain'];
95
+ const fetchMap = {
96
+ Pipelines: () => request_1.biginApiService.fetchPipelinesRecords(access_token, api_domain),
97
+ Companies: () => request_1.biginApiService.fetchCompanies(access_token, api_domain),
98
+ };
99
+ const fetchFn = fetchMap[relatedModule];
100
+ const response = yield fetchFn();
101
+ const records = (response === null || response === void 0 ? void 0 : response.data) || [];
102
+ return {
103
+ options: records.map((item) => ({
104
+ label: (0, helpers_1.getSafeLabel)(item),
105
+ value: item.id,
106
+ })),
107
+ };
108
+ }),
109
+ }),
110
+ tag: (0, props_1.tagsDropdown)('Calls'),
111
+ },
112
+ run(_a) {
113
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
114
+ try {
115
+ const { access_token, data } = auth;
116
+ const api_domain = data['api_domain'];
117
+ const payload = {
118
+ Call_Start_Time: (0, helpers_1.formatDateTime)(propsValue.callStartTime),
119
+ Call_Duration: Number(propsValue.callDuration),
120
+ Call_Type: propsValue.callType,
121
+ };
122
+ if (propsValue.subject)
123
+ payload.Subject = propsValue.subject;
124
+ if (propsValue.description)
125
+ payload.Description = propsValue.description;
126
+ if (propsValue.callAgenda)
127
+ payload.Call_Agenda = propsValue.callAgenda;
128
+ if (propsValue.reminder)
129
+ payload.Reminder = (0, helpers_1.formatDateTime)(propsValue.reminder);
130
+ if (propsValue.dialledNumber)
131
+ payload.Dialled_Number = propsValue.dialledNumber;
132
+ if (propsValue.owner)
133
+ payload.Owner = { id: propsValue.owner };
134
+ if (propsValue.contactName)
135
+ payload.Contact_Name = { id: propsValue.contactName };
136
+ if (propsValue.relatedTo && propsValue.relatedModule) {
137
+ const relatedModuleMap = {
138
+ Pipelines: 'Deals',
139
+ Companies: 'Accounts',
140
+ };
141
+ payload.$related_module =
142
+ relatedModuleMap[propsValue.relatedModule] || 'Deals';
143
+ payload.Related_To = { id: propsValue.relatedTo };
144
+ }
145
+ if (propsValue.tag)
146
+ payload.Tag = propsValue.tag.map((t) => ({ name: t }));
147
+ const response = yield request_1.biginApiService.createCall(access_token, api_domain, { data: [payload] });
148
+ return {
149
+ message: 'Call log Entry created successfully',
150
+ data: response.data[0],
151
+ };
152
+ }
153
+ catch (error) {
154
+ console.error('Error creating call log entry:', error);
155
+ throw new Error(error instanceof Error
156
+ ? `Failed to create call log entry: ${error.message}`
157
+ : 'Failed to create call log entry due to an unknown error');
158
+ }
159
+ });
160
+ },
161
+ });
162
+ //# sourceMappingURL=create-call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-call.js","sourceRoot":"","sources":["../../../src/lib/actions/create-call.ts"],"names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AC;gBAEhF,MAAM,QAAQ,GAAG,MAAM,yBAAe,CAAC,UAAU,CAC/C,YAAY,EACZ,UAAU,EACV,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CACpB,CAAC;gBAEF,OAAO;oBACL,OAAO,EAAE,qCAAqC;oBAC9C,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;iBACvB,CAAC;YACJ,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;gBACvD,MAAM,IAAI,KAAK,CACb,KAAK,YAAY,KAAK;oBACpB,CAAC,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE;oBACrD,CAAC,CAAC,yDAAyD,CAC9D,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const createCompany: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ accountName: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ phone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
4
+ website: import("@agnocon/pieces-framework").ShortTextProperty<false>;
5
+ tag: import("@agnocon/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
6
+ description: import("@agnocon/pieces-framework").LongTextProperty<false>;
7
+ owner: import("@agnocon/pieces-framework").DropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
8
+ billingStreet: import("@agnocon/pieces-framework").ShortTextProperty<false>;
9
+ billingCity: import("@agnocon/pieces-framework").ShortTextProperty<false>;
10
+ billingState: import("@agnocon/pieces-framework").ShortTextProperty<false>;
11
+ billingCountry: import("@agnocon/pieces-framework").ShortTextProperty<false>;
12
+ billingCode: import("@agnocon/pieces-framework").ShortTextProperty<false>;
13
+ }>;
14
+ //# sourceMappingURL=create-company.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-company.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-company.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa;;;;;;;;;;;;EAsHxB,CAAC"}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCompany = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigin-by-zoho/src/lib/actions/create-company.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const auth_1 = require("../auth");
8
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
9
+ const props_1 = require("../common/props");
10
+ const request_1 = require("../common/request");
11
+ exports.createCompany = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.biginAuth,
13
+ name: 'createCompany',
14
+ displayName: 'Create Company',
15
+ description: 'Creates a Company Record',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Creates a new company (account) record in Bigin CRM with a name plus optional phone, website, billing address, owner, tags, and description. Use to add an organization the business deals with. Not idempotent: each call creates a new company even if one with the same name already exists, so search first if you need to avoid duplicates.', idempotent: false },
18
+ props: {
19
+ accountName: pieces_framework_1.Property.ShortText({
20
+ displayName: 'Account Name',
21
+ description: 'Provide the name of the company',
22
+ required: true,
23
+ }),
24
+ phone: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Phone',
26
+ description: 'Provide a phone number for the company',
27
+ required: false,
28
+ }),
29
+ website: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Website',
31
+ description: 'Provide a website URL for the company',
32
+ required: false,
33
+ }),
34
+ tag: (0, props_1.tagsDropdown)('Accounts'),
35
+ description: pieces_framework_1.Property.LongText({
36
+ displayName: 'Description',
37
+ description: 'Provide additional descriptions or notes related to the company',
38
+ required: false,
39
+ }),
40
+ owner: props_1.usersDropdown,
41
+ billingStreet: pieces_framework_1.Property.ShortText({
42
+ displayName: 'Billing Street',
43
+ description: 'The street address of the company',
44
+ required: false,
45
+ }),
46
+ billingCity: pieces_framework_1.Property.ShortText({
47
+ displayName: 'Billing City',
48
+ description: 'The city where the company is located',
49
+ required: false,
50
+ }),
51
+ billingState: pieces_framework_1.Property.ShortText({
52
+ displayName: 'Billing State',
53
+ description: 'The state or province where the company is located',
54
+ required: false,
55
+ }),
56
+ billingCountry: pieces_framework_1.Property.ShortText({
57
+ displayName: 'Billing Country',
58
+ description: 'The country of the company',
59
+ required: false,
60
+ }),
61
+ billingCode: pieces_framework_1.Property.ShortText({
62
+ displayName: 'Billing Code',
63
+ description: 'The ZIP or postal code of the company',
64
+ required: false,
65
+ }),
66
+ },
67
+ run(context) {
68
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
69
+ try {
70
+ const { accountName, owner, phone, website, tag, description, billingStreet, billingCity, billingState, billingCountry, billingCode, } = context.propsValue;
71
+ const record = {
72
+ Account_Name: accountName,
73
+ Phone: phone,
74
+ Website: website,
75
+ Description: description,
76
+ Billing_Street: billingStreet,
77
+ Billing_City: billingCity,
78
+ Billing_State: billingState,
79
+ Billing_Country: billingCountry,
80
+ Billing_Code: billingCode,
81
+ Owner: owner ? { id: owner } : undefined,
82
+ Tag: Array.isArray(tag) && tag.length > 0 ? tag.map((t) => ({ name: t })) : undefined,
83
+ };
84
+ Object.keys(record).forEach((k) => {
85
+ const v = record[k];
86
+ if (v === undefined ||
87
+ v === null ||
88
+ (typeof v === 'string' && v.trim() === '') ||
89
+ (Array.isArray(v) && v.length === 0)) {
90
+ delete record[k];
91
+ }
92
+ });
93
+ const response = yield request_1.biginApiService.createCompany(context.auth.access_token, context.auth.api_domain, { data: [record] });
94
+ return {
95
+ message: 'Company created successfully',
96
+ data: response.data[0],
97
+ };
98
+ }
99
+ catch (error) {
100
+ console.error('Error creating company:', error);
101
+ throw new Error(error instanceof Error
102
+ ? `Failed to create company: ${error.message}`
103
+ : 'Failed to create company due to an unknown error');
104
+ }
105
+ });
106
+ },
107
+ });
108
+ //# sourceMappingURL=create-company.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-company.js","sourceRoot":"","sources":["../../../src/lib/actions/create-company.ts"],"names":[],"mappings":";;;;AAAA,8GAA8G;AAC9G,qEAAqE;AACrE,kCAAoC;AACpC,gEAAmE;AACnE,2CAA8D;AAC9D,+CAAoD;AAEvC,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,0BAA0B;IACvC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kVAAkV,EAAE,UAAU,EAAE,KAAK,EAAE;IAClY,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,GAAG,EAAE,IAAA,oBAAY,EAAC,UAAU,CAAC;QAC7B,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,iEAAiE;YACnE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,qBAAa;QACpB,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,gBAAgB;YA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C,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const createContact: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ firstName: import("@agnocon/pieces-framework").ShortTextProperty<false>;
3
+ lastName: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ title: import("@agnocon/pieces-framework").ShortTextProperty<false>;
5
+ email: import("@agnocon/pieces-framework").ShortTextProperty<false>;
6
+ mobile: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ emailOptOut: import("@agnocon/pieces-framework").CheckboxProperty<false>;
8
+ owner: import("@agnocon/pieces-framework").DropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
9
+ accountName: import("@agnocon/pieces-framework").DropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
10
+ tag: import("@agnocon/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
11
+ description: import("@agnocon/pieces-framework").LongTextProperty<false>;
12
+ mailingStreet: import("@agnocon/pieces-framework").ShortTextProperty<false>;
13
+ mailingCity: import("@agnocon/pieces-framework").ShortTextProperty<false>;
14
+ mailingState: import("@agnocon/pieces-framework").ShortTextProperty<false>;
15
+ mailingCountry: import("@agnocon/pieces-framework").ShortTextProperty<false>;
16
+ mailingZip: import("@agnocon/pieces-framework").ShortTextProperty<false>;
17
+ }>;
18
+ //# sourceMappingURL=create-contact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-contact.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-contact.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;EAgJxB,CAAC"}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createContact = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigin-by-zoho/src/lib/actions/create-contact.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const auth_1 = require("../auth");
8
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
9
+ const props_1 = require("../common/props");
10
+ const request_1 = require("../common/request");
11
+ exports.createContact = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.biginAuth,
13
+ name: 'createContact',
14
+ displayName: 'Create Contact',
15
+ description: 'Creates a Contact Record',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Creates a new contact (person) record in Bigin CRM. Last name is required; optionally set email, mobile, title, owner, associated company, tags, mailing address, and description. Use to add a person to the CRM. Not idempotent: each call creates a new contact even with identical details, so search first to avoid duplicates.', idempotent: false },
18
+ props: {
19
+ firstName: pieces_framework_1.Property.ShortText({
20
+ displayName: 'First Name',
21
+ description: 'First name of the contact',
22
+ required: false,
23
+ }),
24
+ lastName: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Last Name',
26
+ description: 'Last name of the contact',
27
+ required: true,
28
+ }),
29
+ title: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Title',
31
+ description: 'Job title of the contact',
32
+ required: false,
33
+ }),
34
+ email: pieces_framework_1.Property.ShortText({
35
+ displayName: 'Email',
36
+ description: 'Email address of the contact',
37
+ required: false,
38
+ }),
39
+ mobile: pieces_framework_1.Property.ShortText({
40
+ displayName: 'Mobile',
41
+ description: 'Mobile phone number',
42
+ required: false,
43
+ }),
44
+ emailOptOut: pieces_framework_1.Property.Checkbox({
45
+ displayName: 'Email Opt Out',
46
+ description: 'Whether the contact has opted out of emails',
47
+ required: false,
48
+ defaultValue: false,
49
+ }),
50
+ owner: props_1.usersDropdown,
51
+ accountName: props_1.companyDropdown,
52
+ tag: (0, props_1.tagsDropdown)('Contacts'),
53
+ description: pieces_framework_1.Property.LongText({
54
+ displayName: 'Description',
55
+ description: 'Provide additional descriptions or notes related to the contact',
56
+ required: false,
57
+ }),
58
+ mailingStreet: pieces_framework_1.Property.ShortText({
59
+ displayName: 'Mailing Street',
60
+ description: 'Street address for mailing',
61
+ required: false,
62
+ }),
63
+ mailingCity: pieces_framework_1.Property.ShortText({
64
+ displayName: 'Mailing City',
65
+ description: 'City for mailing address',
66
+ required: false,
67
+ }),
68
+ mailingState: pieces_framework_1.Property.ShortText({
69
+ displayName: 'Mailing State',
70
+ description: 'State for mailing address',
71
+ required: false,
72
+ }),
73
+ mailingCountry: pieces_framework_1.Property.ShortText({
74
+ displayName: 'Mailing Country',
75
+ description: 'Country for mailing address',
76
+ required: false,
77
+ }),
78
+ mailingZip: pieces_framework_1.Property.ShortText({
79
+ displayName: 'Mailing Zip',
80
+ description: 'ZIP/postal code',
81
+ required: false,
82
+ }),
83
+ },
84
+ run(context) {
85
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
86
+ try {
87
+ const { firstName, lastName, title, email, mobile, emailOptOut, owner, accountName, tag, description, mailingStreet, mailingCity, mailingState, mailingCountry, mailingZip, } = context.propsValue;
88
+ const record = {
89
+ First_Name: firstName,
90
+ Last_Name: lastName,
91
+ Title: title,
92
+ Email: email,
93
+ Mobile: mobile,
94
+ Email_Opt_Out: emailOptOut,
95
+ Owner: owner ? { id: owner } : undefined,
96
+ Account_Name: accountName ? { id: accountName } : undefined,
97
+ Tag: (tag === null || tag === void 0 ? void 0 : tag.length) ? tag.map((t) => ({ name: t })) : undefined,
98
+ Description: description,
99
+ Mailing_Street: mailingStreet,
100
+ Mailing_City: mailingCity,
101
+ Mailing_State: mailingState,
102
+ Mailing_Country: mailingCountry,
103
+ Mailing_Zip: mailingZip,
104
+ };
105
+ Object.keys(record).forEach((k) => {
106
+ const v = record[k];
107
+ if (v === undefined ||
108
+ v === null ||
109
+ (typeof v === 'string' && v.trim() === '') ||
110
+ (Array.isArray(v) && v.length === 0)) {
111
+ delete record[k];
112
+ }
113
+ });
114
+ const payload = { data: [record] };
115
+ const response = yield request_1.biginApiService.createContact(context.auth.access_token, context.auth.data['api_domain'], payload);
116
+ return {
117
+ message: 'Contact created successfully',
118
+ data: response.data[0],
119
+ };
120
+ }
121
+ catch (error) {
122
+ console.error('Error creating contact:', error);
123
+ throw new Error(error instanceof Error
124
+ ? `Failed to create contact: ${error.message}`
125
+ : 'Failed to create contact due to an unknown error');
126
+ }
127
+ });
128
+ },
129
+ });
130
+ //# sourceMappingURL=create-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-contact.js","sourceRoot":"","sources":["../../../src/lib/actions/create-contact.ts"],"names":[],"mappings":";;;;AAAA,8GAA8G;AAC9G,qEAAqE;AACrE,kCAAoC;AACpC,gEAAmE;AACnE,2CAA+E;AAC/E,+CAAoD;AAGvC,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,0BAA0B;IACvC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,sUAAsU,EAAE,UAAU,EAAE,KAAK,EAAE;IACtX,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAA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AAI;wBACV,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;wBAC1C,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,EACpC,CAAC;wBACD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;oBACnB,CAAC;gBACH,CAAC,CAAC,CAAC;gBAEH,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;gBAEnC,MAAM,QAAQ,GAAG,MAAM,yBAAe,CAAC,aAAa,CAClD,OAAO,CAAC,IAAI,CAAC,YAAY,EACzB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAC/B,OAAO,CACR,CAAC;gBAEF,OAAO;oBACL,OAAO,EAAE,8BAA8B;oBACvC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;iBACvB,CAAC;YACJ,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;gBAChD,MAAM,IAAI,KAAK,CACb,KAAK,YAAY,KAAK;oBACpB,CAAC,CAAC,6BAA6B,KAAK,CAAC,OAAO,EAAE;oBAC9C,CAAC,CAAC,kDAAkD,CACvD,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const createEvent: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ eventTitle: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ owner: import("@agnocon/pieces-framework").DropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
4
+ startDateTime: import("@agnocon/pieces-framework").DateTimeProperty<true>;
5
+ endDateTime: import("@agnocon/pieces-framework").DateTimeProperty<true>;
6
+ allDay: import("@agnocon/pieces-framework").CheckboxProperty<false>;
7
+ enableRecurring: import("@agnocon/pieces-framework").CheckboxProperty<false>;
8
+ recurringInfo: import("@agnocon/pieces-framework").DynamicProperties<false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
9
+ enableReminder: import("@agnocon/pieces-framework").CheckboxProperty<false>;
10
+ reminderInfo: import("@agnocon/pieces-framework").DynamicProperties<false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
11
+ venue: import("@agnocon/pieces-framework").ShortTextProperty<false>;
12
+ relatedModule: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
13
+ relatedTo: import("@agnocon/pieces-framework").DropdownProperty<any, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
14
+ participants: import("@agnocon/pieces-framework").ArrayProperty<true> | import("@agnocon/pieces-framework").ArrayProperty<false>;
15
+ description: import("@agnocon/pieces-framework").LongTextProperty<false>;
16
+ tag: import("@agnocon/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
17
+ }>;
18
+ //# sourceMappingURL=create-event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-event.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-event.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;EAuYtB,CAAC"}