@activepieces/piece-whatsscale 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 (121) hide show
  1. package/package.json +17 -0
  2. package/src/index.d.ts +1 -0
  3. package/src/index.js +112 -0
  4. package/src/index.js.map +1 -0
  5. package/src/lib/actions/crm/add-crm-contact-tag.d.ts +4 -0
  6. package/src/lib/actions/crm/add-crm-contact-tag.js +32 -0
  7. package/src/lib/actions/crm/add-crm-contact-tag.js.map +1 -0
  8. package/src/lib/actions/crm/create-crm-contact.d.ts +5 -0
  9. package/src/lib/actions/crm/create-crm-contact.js +45 -0
  10. package/src/lib/actions/crm/create-crm-contact.js.map +1 -0
  11. package/src/lib/actions/crm/delete-crm-contact.d.ts +3 -0
  12. package/src/lib/actions/crm/delete-crm-contact.js +27 -0
  13. package/src/lib/actions/crm/delete-crm-contact.js.map +1 -0
  14. package/src/lib/actions/crm/find-crm-contact-by-phone.d.ts +3 -0
  15. package/src/lib/actions/crm/find-crm-contact-by-phone.js +30 -0
  16. package/src/lib/actions/crm/find-crm-contact-by-phone.js.map +1 -0
  17. package/src/lib/actions/crm/get-crm-contact.d.ts +3 -0
  18. package/src/lib/actions/crm/get-crm-contact.js +27 -0
  19. package/src/lib/actions/crm/get-crm-contact.js.map +1 -0
  20. package/src/lib/actions/crm/list-crm-contacts.d.ts +6 -0
  21. package/src/lib/actions/crm/list-crm-contacts.js +86 -0
  22. package/src/lib/actions/crm/list-crm-contacts.js.map +1 -0
  23. package/src/lib/actions/crm/remove-crm-contact-tag.d.ts +4 -0
  24. package/src/lib/actions/crm/remove-crm-contact-tag.js +29 -0
  25. package/src/lib/actions/crm/remove-crm-contact-tag.js.map +1 -0
  26. package/src/lib/actions/crm/update-crm-contact.d.ts +5 -0
  27. package/src/lib/actions/crm/update-crm-contact.js +42 -0
  28. package/src/lib/actions/crm/update-crm-contact.js.map +1 -0
  29. package/src/lib/actions/messaging/send-document-to-contact.d.ts +7 -0
  30. package/src/lib/actions/messaging/send-document-to-contact.js +55 -0
  31. package/src/lib/actions/messaging/send-document-to-contact.js.map +1 -0
  32. package/src/lib/actions/messaging/send-document-to-crm-contact.d.ts +7 -0
  33. package/src/lib/actions/messaging/send-document-to-crm-contact.js +56 -0
  34. package/src/lib/actions/messaging/send-document-to-crm-contact.js.map +1 -0
  35. package/src/lib/actions/messaging/send-document-to-group.d.ts +7 -0
  36. package/src/lib/actions/messaging/send-document-to-group.js +55 -0
  37. package/src/lib/actions/messaging/send-document-to-group.js.map +1 -0
  38. package/src/lib/actions/messaging/send-image-manual.d.ts +8 -0
  39. package/src/lib/actions/messaging/send-image-manual.js +58 -0
  40. package/src/lib/actions/messaging/send-image-manual.js.map +1 -0
  41. package/src/lib/actions/messaging/send-image-to-channel.d.ts +6 -0
  42. package/src/lib/actions/messaging/send-image-to-channel.js +45 -0
  43. package/src/lib/actions/messaging/send-image-to-channel.js.map +1 -0
  44. package/src/lib/actions/messaging/send-image-to-contact.d.ts +6 -0
  45. package/src/lib/actions/messaging/send-image-to-contact.js +45 -0
  46. package/src/lib/actions/messaging/send-image-to-contact.js.map +1 -0
  47. package/src/lib/actions/messaging/send-image-to-crm-contact.d.ts +6 -0
  48. package/src/lib/actions/messaging/send-image-to-crm-contact.js +46 -0
  49. package/src/lib/actions/messaging/send-image-to-crm-contact.js.map +1 -0
  50. package/src/lib/actions/messaging/send-image-to-group.d.ts +6 -0
  51. package/src/lib/actions/messaging/send-image-to-group.js +45 -0
  52. package/src/lib/actions/messaging/send-image-to-group.js.map +1 -0
  53. package/src/lib/actions/messaging/send-text-manual.d.ts +7 -0
  54. package/src/lib/actions/messaging/send-text-manual.js +51 -0
  55. package/src/lib/actions/messaging/send-text-manual.js.map +1 -0
  56. package/src/lib/actions/messaging/send-text-to-channel.d.ts +5 -0
  57. package/src/lib/actions/messaging/send-text-to-channel.js +35 -0
  58. package/src/lib/actions/messaging/send-text-to-channel.js.map +1 -0
  59. package/src/lib/actions/messaging/send-text-to-contact.d.ts +5 -0
  60. package/src/lib/actions/messaging/send-text-to-contact.js +35 -0
  61. package/src/lib/actions/messaging/send-text-to-contact.js.map +1 -0
  62. package/src/lib/actions/messaging/send-text-to-crm-contact.d.ts +5 -0
  63. package/src/lib/actions/messaging/send-text-to-crm-contact.js +35 -0
  64. package/src/lib/actions/messaging/send-text-to-crm-contact.js.map +1 -0
  65. package/src/lib/actions/messaging/send-text-to-group.d.ts +5 -0
  66. package/src/lib/actions/messaging/send-text-to-group.js +35 -0
  67. package/src/lib/actions/messaging/send-text-to-group.js.map +1 -0
  68. package/src/lib/actions/messaging/send-video-manual.d.ts +8 -0
  69. package/src/lib/actions/messaging/send-video-manual.js +60 -0
  70. package/src/lib/actions/messaging/send-video-manual.js.map +1 -0
  71. package/src/lib/actions/messaging/send-video-to-channel.d.ts +6 -0
  72. package/src/lib/actions/messaging/send-video-to-channel.js +47 -0
  73. package/src/lib/actions/messaging/send-video-to-channel.js.map +1 -0
  74. package/src/lib/actions/messaging/send-video-to-contact.d.ts +6 -0
  75. package/src/lib/actions/messaging/send-video-to-contact.js +47 -0
  76. package/src/lib/actions/messaging/send-video-to-contact.js.map +1 -0
  77. package/src/lib/actions/messaging/send-video-to-crm-contact.d.ts +6 -0
  78. package/src/lib/actions/messaging/send-video-to-crm-contact.js +48 -0
  79. package/src/lib/actions/messaging/send-video-to-crm-contact.js.map +1 -0
  80. package/src/lib/actions/messaging/send-video-to-group.d.ts +6 -0
  81. package/src/lib/actions/messaging/send-video-to-group.js +47 -0
  82. package/src/lib/actions/messaging/send-video-to-group.js.map +1 -0
  83. package/src/lib/actions/utility/check-whatsapp.d.ts +4 -0
  84. package/src/lib/actions/utility/check-whatsapp.js +34 -0
  85. package/src/lib/actions/utility/check-whatsapp.js.map +1 -0
  86. package/src/lib/auth.d.ts +1 -0
  87. package/src/lib/auth.js +39 -0
  88. package/src/lib/auth.js.map +1 -0
  89. package/src/lib/common/client.d.ts +3 -0
  90. package/src/lib/common/client.js +22 -0
  91. package/src/lib/common/client.js.map +1 -0
  92. package/src/lib/common/poll-job.d.ts +1 -0
  93. package/src/lib/common/poll-job.js +26 -0
  94. package/src/lib/common/poll-job.js.map +1 -0
  95. package/src/lib/common/prepare-file.d.ts +1 -0
  96. package/src/lib/common/prepare-file.js +16 -0
  97. package/src/lib/common/prepare-file.js.map +1 -0
  98. package/src/lib/common/props.d.ts +14 -0
  99. package/src/lib/common/props.js +257 -0
  100. package/src/lib/common/props.js.map +1 -0
  101. package/src/lib/common/recipients.d.ts +29 -0
  102. package/src/lib/common/recipients.js +52 -0
  103. package/src/lib/common/recipients.js.map +1 -0
  104. package/src/lib/common/types.d.ts +17 -0
  105. package/src/lib/common/types.js +22 -0
  106. package/src/lib/common/types.js.map +1 -0
  107. package/src/lib/triggers/watch-channel-messages.d.ts +10 -0
  108. package/src/lib/triggers/watch-channel-messages.js +56 -0
  109. package/src/lib/triggers/watch-channel-messages.js.map +1 -0
  110. package/src/lib/triggers/watch-group-messages.d.ts +10 -0
  111. package/src/lib/triggers/watch-group-messages.js +64 -0
  112. package/src/lib/triggers/watch-group-messages.js.map +1 -0
  113. package/src/lib/triggers/watch-incoming-messages.d.ts +10 -0
  114. package/src/lib/triggers/watch-incoming-messages.js +62 -0
  115. package/src/lib/triggers/watch-incoming-messages.js.map +1 -0
  116. package/src/lib/triggers/watch-specific-channel-messages.d.ts +14 -0
  117. package/src/lib/triggers/watch-specific-channel-messages.js +58 -0
  118. package/src/lib/triggers/watch-specific-channel-messages.js.map +1 -0
  119. package/src/lib/triggers/watch-specific-group-messages.d.ts +14 -0
  120. package/src/lib/triggers/watch-specific-group-messages.js +66 -0
  121. package/src/lib/triggers/watch-specific-group-messages.js.map +1 -0
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@activepieces/piece-whatsscale",
3
+ "version": "0.0.1",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "dependencies": {
8
+ "@activepieces/pieces-common": "0.12.0",
9
+ "@activepieces/pieces-framework": "0.26.0",
10
+ "@activepieces/shared": "0.45.0",
11
+ "tslib": "2.6.2"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
15
+ "lint": "eslint 'src/**/*.ts'"
16
+ }
17
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const whatsscale: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.whatsscale = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const shared_1 = require("@activepieces/shared");
7
+ const auth_1 = require("./lib/auth");
8
+ // Text actions
9
+ const send_text_manual_1 = require("./lib/actions/messaging/send-text-manual");
10
+ const send_text_to_contact_1 = require("./lib/actions/messaging/send-text-to-contact");
11
+ const send_text_to_group_1 = require("./lib/actions/messaging/send-text-to-group");
12
+ const send_text_to_channel_1 = require("./lib/actions/messaging/send-text-to-channel");
13
+ const send_text_to_crm_contact_1 = require("./lib/actions/messaging/send-text-to-crm-contact");
14
+ // Image actions
15
+ const send_image_to_contact_1 = require("./lib/actions/messaging/send-image-to-contact");
16
+ const send_image_to_group_1 = require("./lib/actions/messaging/send-image-to-group");
17
+ const send_image_to_channel_1 = require("./lib/actions/messaging/send-image-to-channel");
18
+ const send_image_to_crm_contact_1 = require("./lib/actions/messaging/send-image-to-crm-contact");
19
+ const send_image_manual_1 = require("./lib/actions/messaging/send-image-manual");
20
+ // Video actions
21
+ const send_video_to_contact_1 = require("./lib/actions/messaging/send-video-to-contact");
22
+ const send_video_to_group_1 = require("./lib/actions/messaging/send-video-to-group");
23
+ const send_video_to_channel_1 = require("./lib/actions/messaging/send-video-to-channel");
24
+ const send_video_to_crm_contact_1 = require("./lib/actions/messaging/send-video-to-crm-contact");
25
+ const send_video_manual_1 = require("./lib/actions/messaging/send-video-manual");
26
+ // Document actions
27
+ const send_document_to_contact_1 = require("./lib/actions/messaging/send-document-to-contact");
28
+ const send_document_to_group_1 = require("./lib/actions/messaging/send-document-to-group");
29
+ const send_document_to_crm_contact_1 = require("./lib/actions/messaging/send-document-to-crm-contact");
30
+ // CRM actions
31
+ const create_crm_contact_1 = require("./lib/actions/crm/create-crm-contact");
32
+ const get_crm_contact_1 = require("./lib/actions/crm/get-crm-contact");
33
+ const find_crm_contact_by_phone_1 = require("./lib/actions/crm/find-crm-contact-by-phone");
34
+ const update_crm_contact_1 = require("./lib/actions/crm/update-crm-contact");
35
+ const delete_crm_contact_1 = require("./lib/actions/crm/delete-crm-contact");
36
+ const add_crm_contact_tag_1 = require("./lib/actions/crm/add-crm-contact-tag");
37
+ const remove_crm_contact_tag_1 = require("./lib/actions/crm/remove-crm-contact-tag");
38
+ const list_crm_contacts_1 = require("./lib/actions/crm/list-crm-contacts");
39
+ // Utility actions
40
+ const check_whatsapp_1 = require("./lib/actions/utility/check-whatsapp");
41
+ // Triggers
42
+ const watch_incoming_messages_1 = require("./lib/triggers/watch-incoming-messages");
43
+ const watch_group_messages_1 = require("./lib/triggers/watch-group-messages");
44
+ const watch_channel_messages_1 = require("./lib/triggers/watch-channel-messages");
45
+ const watch_specific_group_messages_1 = require("./lib/triggers/watch-specific-group-messages");
46
+ const watch_specific_channel_messages_1 = require("./lib/triggers/watch-specific-channel-messages");
47
+ const pieces_common_1 = require("@activepieces/pieces-common");
48
+ exports.whatsscale = (0, pieces_framework_1.createPiece)({
49
+ displayName: 'WhatsScale',
50
+ auth: auth_1.whatsscaleAuth,
51
+ minimumSupportedRelease: '0.36.0',
52
+ logoUrl: 'https://cdn.activepieces.com/pieces/whatsscale.png',
53
+ authors: ['whatsscale'],
54
+ description: 'Send WhatsApp messages, manage contacts, and automate conversations via WAHA',
55
+ categories: [
56
+ shared_1.PieceCategory.COMMUNICATION,
57
+ shared_1.PieceCategory.MARKETING,
58
+ shared_1.PieceCategory.SALES_AND_CRM,
59
+ ],
60
+ actions: [
61
+ // Text actions
62
+ send_text_manual_1.sendTextManualAction,
63
+ send_text_to_contact_1.sendTextToContactAction,
64
+ send_text_to_group_1.sendTextToGroupAction,
65
+ send_text_to_channel_1.sendTextToChannelAction,
66
+ send_text_to_crm_contact_1.sendTextToCrmContactAction,
67
+ // Image actions
68
+ send_image_to_contact_1.sendImageToContactAction,
69
+ send_image_to_group_1.sendImageToGroupAction,
70
+ send_image_to_channel_1.sendImageToChannelAction,
71
+ send_image_to_crm_contact_1.sendImageToCrmContactAction,
72
+ send_image_manual_1.sendImageManualAction,
73
+ // Video actions
74
+ send_video_to_contact_1.sendVideoToContactAction,
75
+ send_video_to_group_1.sendVideoToGroupAction,
76
+ send_video_to_channel_1.sendVideoToChannelAction,
77
+ send_video_to_crm_contact_1.sendVideoToCrmContactAction,
78
+ send_video_manual_1.sendVideoManualAction,
79
+ // Document actions
80
+ send_document_to_contact_1.sendDocumentToContactAction,
81
+ send_document_to_group_1.sendDocumentToGroupAction,
82
+ send_document_to_crm_contact_1.sendDocumentToCrmContactAction,
83
+ // CRM actions
84
+ create_crm_contact_1.createCrmContactAction,
85
+ get_crm_contact_1.getCrmContactAction,
86
+ find_crm_contact_by_phone_1.findCrmContactByPhoneAction,
87
+ update_crm_contact_1.updateCrmContactAction,
88
+ delete_crm_contact_1.deleteCrmContactAction,
89
+ add_crm_contact_tag_1.addCrmContactTagAction,
90
+ remove_crm_contact_tag_1.removeCrmContactTagAction,
91
+ list_crm_contacts_1.listCrmContactsAction,
92
+ // Utility actions
93
+ check_whatsapp_1.checkWhatsappAction,
94
+ (0, pieces_common_1.createCustomApiCallAction)({
95
+ auth: auth_1.whatsscaleAuth,
96
+ baseUrl: () => 'https://proxy.whatsscale.com',
97
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
98
+ return ({
99
+ 'X-Api-Key': `${auth.secret_text}`,
100
+ });
101
+ }),
102
+ }),
103
+ ],
104
+ triggers: [
105
+ watch_channel_messages_1.watchChannelMessagesTrigger,
106
+ watch_group_messages_1.watchGroupMessagesTrigger,
107
+ watch_incoming_messages_1.watchIncomingMessagesTrigger,
108
+ watch_specific_group_messages_1.watchSpecificGroupMessagesTrigger,
109
+ watch_specific_channel_messages_1.watchSpecificChannelMessagesTrigger,
110
+ ],
111
+ });
112
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,iDAAqD;AACrD,qCAA4C;AAE5C,gBAAgB;AAChB,+EAAgF;AAChF,uFAAuF;AACvF,mFAAmF;AACnF,uFAAuF;AACvF,+FAA8F;AAE9F,gBAAgB;AAChB,yFAAyF;AACzF,qFAAqF;AACrF,yFAAyF;AACzF,iGAAgG;AAChG,iFAAkF;AAElF,gBAAgB;AAChB,yFAAyF;AACzF,qFAAqF;AACrF,yFAAyF;AACzF,iGAAgG;AAChG,iFAAkF;AAElF,mBAAmB;AACnB,+FAA+F;AAC/F,2FAA2F;AAC3F,uGAAsG;AAEtG,cAAc;AACd,6EAA8E;AAC9E,uEAAwE;AACxE,2FAA0F;AAC1F,6EAA8E;AAC9E,6EAA8E;AAC9E,+EAA+E;AAC/E,qFAAqF;AACrF,2EAA4E;AAE5E,kBAAkB;AAClB,yEAA2E;AAE3E,aAAa;AACb,oFAAsF;AACtF,8EAAgF;AAChF,kFAAoF;AACpF,gGAAiG;AACjG,oGAAqG;AACrG,+DAAwE;AAE3D,QAAA,UAAU,GAAG,IAAA,8BAAW,EAAC;IACpC,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,qBAAc;IACpB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,oDAAoD;IAC7D,OAAO,EAAE,CAAC,YAAY,CAAC;IACvB,WAAW,EACT,8EAA8E;IAChF,UAAU,EAAE;QACV,sBAAa,CAAC,aAAa;QAC3B,sBAAa,CAAC,SAAS;QACvB,sBAAa,CAAC,aAAa;KAC5B;IACD,OAAO,EAAE;QACP,eAAe;QACf,uCAAoB;QACpB,8CAAuB;QACvB,0CAAqB;QACrB,8CAAuB;QACvB,qDAA0B;QAC1B,gBAAgB;QAChB,gDAAwB;QACxB,4CAAsB;QACtB,gDAAwB;QACxB,uDAA2B;QAC3B,yCAAqB;QACrB,gBAAgB;QAChB,gDAAwB;QACxB,4CAAsB;QACtB,gDAAwB;QACxB,uDAA2B;QAC3B,yCAAqB;QACrB,mBAAmB;QACnB,sDAA2B;QAC3B,kDAAyB;QACzB,6DAA8B;QAC9B,cAAc;QACd,2CAAsB;QACtB,qCAAmB;QACnB,uDAA2B;QAC3B,2CAAsB;QACtB,2CAAsB;QACtB,4CAAsB;QACtB,kDAAyB;QACzB,yCAAqB;QACrB,kBAAkB;QAClB,oCAAmB;QACnB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,qBAAc;YACpB,OAAO,EAAE,GAAG,EAAE,CAAC,8BAA8B;YAC7C,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,WAAW,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;iBACnC,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE;QACR,oDAA2B;QAC3B,gDAAyB;QACzB,sDAA4B;QAC5B,iEAAiC;QACjC,qEAAmC;KACpC;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const addCrmContactTagAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ contactId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
+ tag: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ }>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addCrmContactTagAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const auth_1 = require("../../auth");
8
+ const client_1 = require("../../common/client");
9
+ const props_1 = require("../../common/props");
10
+ exports.addCrmContactTagAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.whatsscaleAuth,
12
+ name: 'whatsscale_add_crm_contact_tag',
13
+ displayName: 'Add a Tag to a CRM Contact',
14
+ description: 'Add a single tag to an existing CRM contact',
15
+ props: {
16
+ contactId: props_1.whatsscaleProps.crmContact,
17
+ tag: pieces_framework_1.Property.ShortText({
18
+ displayName: 'Tag',
19
+ description: 'Tag to add to the contact (e.g. vip). Tags are automatically lowercased.',
20
+ required: true,
21
+ }),
22
+ },
23
+ run(context) {
24
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
+ const auth = context.auth.secret_text;
26
+ const { contactId, tag } = context.propsValue;
27
+ const response = yield (0, client_1.whatsscaleClient)(auth, pieces_common_1.HttpMethod.POST, `/api/crm/contacts/${contactId}/tags`, { tag });
28
+ return response.body;
29
+ });
30
+ },
31
+ });
32
+ //# sourceMappingURL=add-crm-contact-tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-crm-contact-tag.js","sourceRoot":"","sources":["../../../../../src/lib/actions/crm/add-crm-contact-tag.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,qCAA4C;AAC5C,gDAAuD;AACvD,8CAAqD;AAExC,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,4BAA4B;IACzC,WAAW,EAAE,6CAA6C;IAC1D,KAAK,EAAE;QACL,SAAS,EAAE,uBAAe,CAAC,UAAU;QACrC,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,0EAA0E;YACvF,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YACtC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE9C,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EACrC,IAAI,EACJ,0BAAU,CAAC,IAAI,EACf,qBAAqB,SAAS,OAAO,EACrC,EAAE,GAAG,EAAE,CACR,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const createCrmContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ tags: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ }>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCrmContactAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const auth_1 = require("../../auth");
8
+ const client_1 = require("../../common/client");
9
+ exports.createCrmContactAction = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.whatsscaleAuth,
11
+ name: 'whatsscale_create_crm_contact',
12
+ displayName: 'Create a CRM Contact',
13
+ description: 'Add a new contact to your WhatsScale CRM',
14
+ props: {
15
+ phone: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Phone Number',
17
+ description: 'With country code e.g. +31612345678',
18
+ required: true,
19
+ }),
20
+ name: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Name',
22
+ description: 'Full name of the contact (e.g. John Smith)',
23
+ required: false,
24
+ }),
25
+ tags: pieces_framework_1.Property.ShortText({
26
+ displayName: 'Tags',
27
+ description: 'Comma-separated tags (e.g. vip, customer, lead). Tags are automatically lowercased.',
28
+ required: false,
29
+ }),
30
+ },
31
+ run(context) {
32
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
+ const auth = context.auth.secret_text;
34
+ const { phone, name, tags } = context.propsValue;
35
+ const body = { phone };
36
+ if (name)
37
+ body['name'] = name;
38
+ if (tags)
39
+ body['tags'] = tags;
40
+ const response = yield (0, client_1.whatsscaleClient)(auth, pieces_common_1.HttpMethod.POST, '/api/crm/contacts', body);
41
+ return response.body;
42
+ });
43
+ },
44
+ });
45
+ //# sourceMappingURL=create-crm-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-crm-contact.js","sourceRoot":"","sources":["../../../../../src/lib/actions/crm/create-crm-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,qCAA4C;AAC5C,gDAAuD;AAE1C,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,0CAA0C;IACvD,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,qFAAqF;YAClG,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YACtC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEjD,MAAM,IAAI,GAA4B,EAAE,KAAK,EAAE,CAAC;YAChD,IAAI,IAAI;gBAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;YAC9B,IAAI,IAAI;gBAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;YAE9B,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAC,IAAI,EAAE,0BAAU,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;YAC1F,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const deleteCrmContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ contactId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
+ }>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteCrmContactAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const auth_1 = require("../../auth");
8
+ const client_1 = require("../../common/client");
9
+ const props_1 = require("../../common/props");
10
+ exports.deleteCrmContactAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.whatsscaleAuth,
12
+ name: 'whatsscale_delete_crm_contact',
13
+ displayName: 'Delete a CRM Contact',
14
+ description: 'Permanently delete a contact from your WhatsScale CRM',
15
+ props: {
16
+ contactId: props_1.whatsscaleProps.crmContact,
17
+ },
18
+ run(context) {
19
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
+ const auth = context.auth.secret_text;
21
+ const { contactId } = context.propsValue;
22
+ const response = yield (0, client_1.whatsscaleClient)(auth, pieces_common_1.HttpMethod.DELETE, `/api/crm/contacts/${contactId}`, undefined);
23
+ return response.body;
24
+ });
25
+ },
26
+ });
27
+ //# sourceMappingURL=delete-crm-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-crm-contact.js","sourceRoot":"","sources":["../../../../../src/lib/actions/crm/delete-crm-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,qCAA4C;AAC5C,gDAAuD;AACvD,8CAAqD;AAExC,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,uDAAuD;IACpE,KAAK,EAAE;QACL,SAAS,EAAE,uBAAe,CAAC,UAAU;KACtC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YACtC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEzC,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EACrC,IAAI,EACJ,0BAAU,CAAC,MAAM,EACjB,qBAAqB,SAAS,EAAE,EAChC,SAAS,CACV,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const findCrmContactByPhoneAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findCrmContactByPhoneAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const auth_1 = require("../../auth");
8
+ const client_1 = require("../../common/client");
9
+ exports.findCrmContactByPhoneAction = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.whatsscaleAuth,
11
+ name: 'whatsscale_find_crm_contact_by_phone',
12
+ displayName: 'Find a CRM Contact by Phone',
13
+ description: 'Look up a CRM contact using their phone number',
14
+ props: {
15
+ phone: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Phone Number',
17
+ required: true,
18
+ }),
19
+ },
20
+ run(context) {
21
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
+ const auth = context.auth.secret_text;
23
+ const { phone } = context.propsValue;
24
+ const encodedPhone = encodeURIComponent(phone);
25
+ const response = yield (0, client_1.whatsscaleClient)(auth, pieces_common_1.HttpMethod.GET, `/api/crm/contacts/phone/${encodedPhone}`, undefined);
26
+ return response.body;
27
+ });
28
+ },
29
+ });
30
+ //# sourceMappingURL=find-crm-contact-by-phone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-crm-contact-by-phone.js","sourceRoot":"","sources":["../../../../../src/lib/actions/crm/find-crm-contact-by-phone.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,qCAA4C;AAC5C,gDAAuD;AAE1C,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACtD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,sCAAsC;IAC5C,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YACtC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACrC,MAAM,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAE/C,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EACrC,IAAI,EACJ,0BAAU,CAAC,GAAG,EACd,2BAA2B,YAAY,EAAE,EACzC,SAAS,CACV,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const getCrmContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ contactId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
+ }>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCrmContactAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const auth_1 = require("../../auth");
8
+ const client_1 = require("../../common/client");
9
+ const props_1 = require("../../common/props");
10
+ exports.getCrmContactAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.whatsscaleAuth,
12
+ name: 'whatsscale_get_crm_contact',
13
+ displayName: 'Get a CRM Contact',
14
+ description: 'Retrieve a CRM contact by ID',
15
+ props: {
16
+ contactId: props_1.whatsscaleProps.crmContact,
17
+ },
18
+ run(context) {
19
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
+ const auth = context.auth.secret_text;
21
+ const { contactId } = context.propsValue;
22
+ const response = yield (0, client_1.whatsscaleClient)(auth, pieces_common_1.HttpMethod.GET, `/api/crm/contacts/${contactId}`, undefined);
23
+ return response.body;
24
+ });
25
+ },
26
+ });
27
+ //# sourceMappingURL=get-crm-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-crm-contact.js","sourceRoot":"","sources":["../../../../../src/lib/actions/crm/get-crm-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,qCAA4C;AAC5C,gDAAuD;AACvD,8CAAqD;AAExC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,8BAA8B;IAC3C,KAAK,EAAE;QACL,SAAS,EAAE,uBAAe,CAAC,UAAU;KACtC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YACtC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEzC,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EACrC,IAAI,EACJ,0BAAU,CAAC,GAAG,EACd,qBAAqB,SAAS,EAAE,EAChC,SAAS,CACV,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const listCrmContactsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ tag: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
+ search: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ limit: import("@activepieces/pieces-framework").NumberProperty<false>;
5
+ page: import("@activepieces/pieces-framework").NumberProperty<false>;
6
+ }>;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listCrmContactsAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const auth_1 = require("../../auth");
8
+ const client_1 = require("../../common/client");
9
+ exports.listCrmContactsAction = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.whatsscaleAuth,
11
+ name: 'whatsscale_list_crm_contacts',
12
+ displayName: 'List CRM Contacts',
13
+ description: 'Retrieve a paginated list of CRM contacts with optional filters',
14
+ props: {
15
+ tag: pieces_framework_1.Property.Dropdown({
16
+ auth: auth_1.whatsscaleAuth,
17
+ displayName: 'Filter by Tag',
18
+ description: 'Optional. Filter contacts by tag.',
19
+ required: false,
20
+ refreshers: [],
21
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
22
+ if (!auth) {
23
+ return {
24
+ disabled: true,
25
+ options: [],
26
+ placeholder: 'Please connect your account',
27
+ };
28
+ }
29
+ try {
30
+ const response = yield (0, client_1.whatsscaleClient)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/make/crm/tags', undefined);
31
+ const tags = response.body;
32
+ if (!tags || tags.length === 0) {
33
+ return {
34
+ disabled: true,
35
+ options: [],
36
+ placeholder: 'No tags found',
37
+ };
38
+ }
39
+ return { disabled: false, options: tags };
40
+ }
41
+ catch (_b) {
42
+ return {
43
+ disabled: true,
44
+ options: [],
45
+ placeholder: 'Failed to load tags',
46
+ };
47
+ }
48
+ }),
49
+ }),
50
+ search: pieces_framework_1.Property.ShortText({
51
+ displayName: 'Search',
52
+ description: 'Optional. Search contacts by name or phone number.',
53
+ required: false,
54
+ }),
55
+ limit: pieces_framework_1.Property.Number({
56
+ displayName: 'Limit',
57
+ description: 'Max results to return. Default 50.',
58
+ required: false,
59
+ }),
60
+ page: pieces_framework_1.Property.Number({
61
+ displayName: 'Page',
62
+ description: 'Page number. Default 1.',
63
+ required: false,
64
+ }),
65
+ },
66
+ run(context) {
67
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
68
+ const auth = context.auth.secret_text;
69
+ const { tag, limit, page } = context.propsValue;
70
+ const search = context.propsValue['search'];
71
+ const qp = {};
72
+ if (tag)
73
+ qp['tag'] = tag;
74
+ if (search)
75
+ qp['search'] = search;
76
+ if (limit != null)
77
+ qp['limit'] = String(limit);
78
+ if (page != null)
79
+ qp['page'] = String(page);
80
+ const params = Object.keys(qp).length > 0 ? qp : undefined;
81
+ const response = yield (0, client_1.whatsscaleClient)(auth, pieces_common_1.HttpMethod.GET, '/api/crm/contacts', undefined, params);
82
+ return response.body;
83
+ });
84
+ },
85
+ });
86
+ //# sourceMappingURL=list-crm-contacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-crm-contacts.js","sourceRoot":"","sources":["../../../../../src/lib/actions/crm/list-crm-contacts.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ export declare const removeCrmContactTagAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ contactId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
+ tag: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
+ }>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeCrmContactTagAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const auth_1 = require("../../auth");
8
+ const client_1 = require("../../common/client");
9
+ const props_1 = require("../../common/props");
10
+ exports.removeCrmContactTagAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.whatsscaleAuth,
12
+ name: 'whatsscale_remove_crm_contact_tag',
13
+ displayName: 'Remove a Tag from a CRM Contact',
14
+ description: 'Remove a single tag from a CRM contact',
15
+ props: {
16
+ contactId: props_1.whatsscaleProps.crmContact,
17
+ tag: props_1.whatsscaleProps.crmTag,
18
+ },
19
+ run(context) {
20
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
21
+ const auth = context.auth.secret_text;
22
+ const { contactId, tag } = context.propsValue;
23
+ const encodedTag = encodeURIComponent(tag);
24
+ const response = yield (0, client_1.whatsscaleClient)(auth, pieces_common_1.HttpMethod.DELETE, `/api/crm/contacts/${contactId}/tags/${encodedTag}`, undefined);
25
+ return response.body;
26
+ });
27
+ },
28
+ });
29
+ //# sourceMappingURL=remove-crm-contact-tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-crm-contact-tag.js","sourceRoot":"","sources":["../../../../../src/lib/actions/crm/remove-crm-contact-tag.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,qCAA4C;AAC5C,gDAAuD;AACvD,8CAAqD;AAExC,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,SAAS,EAAE,uBAAe,CAAC,UAAU;QACrC,GAAG,EAAE,uBAAe,CAAC,MAAM;KAC5B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YACtC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC9C,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;YAE3C,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EACrC,IAAI,EACJ,0BAAU,CAAC,MAAM,EACjB,qBAAqB,SAAS,SAAS,UAAU,EAAE,EACnD,SAAS,CACV,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const updateCrmContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ contactId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
+ name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ tags: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ }>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateCrmContactAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const auth_1 = require("../../auth");
8
+ const client_1 = require("../../common/client");
9
+ const props_1 = require("../../common/props");
10
+ exports.updateCrmContactAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.whatsscaleAuth,
12
+ name: 'whatsscale_update_crm_contact',
13
+ displayName: 'Update a CRM Contact',
14
+ description: 'Update the name or tags of an existing CRM contact',
15
+ props: {
16
+ contactId: props_1.whatsscaleProps.crmContact,
17
+ name: pieces_framework_1.Property.ShortText({
18
+ displayName: 'Name',
19
+ description: 'Leave empty to keep the current name unchanged. Set to a blank value to clear it.',
20
+ required: false,
21
+ }),
22
+ tags: pieces_framework_1.Property.ShortText({
23
+ displayName: 'Tags',
24
+ description: 'Replaces all existing tags. Comma-separated (e.g. vip, lead). Leave empty to keep current tags unchanged.',
25
+ required: false,
26
+ }),
27
+ },
28
+ run(context) {
29
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
30
+ const auth = context.auth.secret_text;
31
+ const { contactId, name, tags } = context.propsValue;
32
+ const body = {};
33
+ if (name !== undefined && name !== null)
34
+ body['name'] = name;
35
+ if (tags !== undefined && tags !== null)
36
+ body['tags'] = tags;
37
+ const response = yield (0, client_1.whatsscaleClient)(auth, pieces_common_1.HttpMethod.PATCH, `/api/crm/contacts/${contactId}`, body);
38
+ return response.body;
39
+ });
40
+ },
41
+ });
42
+ //# sourceMappingURL=update-crm-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-crm-contact.js","sourceRoot":"","sources":["../../../../../src/lib/actions/crm/update-crm-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,qCAA4C;AAC5C,gDAAuD;AACvD,8CAAqD;AAExC,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,oDAAoD;IACjE,KAAK,EAAE;QACL,SAAS,EAAE,uBAAe,CAAC,UAAU;QACrC,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,mFAAmF;YAChG,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,2GAA2G;YACxH,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YACtC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEnD,MAAM,IAAI,GAA4B,EAAE,CAAC;YACzC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI;gBAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;YAC/D,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI;gBAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;YAE7D,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EACrC,IAAI,EACJ,0BAAU,CAAC,KAAK,EAChB,qBAAqB,SAAS,EAAE,EAChC,IAAI,CACL,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const sendDocumentToContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ session: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
+ contact: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
+ documentUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ filename: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
+ caption: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ }>;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendDocumentToContactAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const auth_1 = require("../../auth");
8
+ const client_1 = require("../../common/client");
9
+ const props_1 = require("../../common/props");
10
+ const prepare_file_1 = require("../../common/prepare-file");
11
+ const poll_job_1 = require("../../common/poll-job");
12
+ exports.sendDocumentToContactAction = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.whatsscaleAuth,
14
+ name: 'whatsscale_send_document_to_contact',
15
+ displayName: 'Send a Document to a Contact',
16
+ description: 'Send a document to a WhatsApp contact selected from the dropdown.',
17
+ props: {
18
+ session: props_1.whatsscaleProps.session,
19
+ contact: props_1.whatsscaleProps.contact,
20
+ documentUrl: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Document URL',
22
+ description: 'Direct URL to the document file.',
23
+ required: true,
24
+ }),
25
+ filename: pieces_framework_1.Property.ShortText({
26
+ displayName: 'Filename',
27
+ description: 'Optional filename shown in WhatsApp (e.g. report.pdf). Auto-detected from URL if not provided.',
28
+ required: false,
29
+ }),
30
+ caption: pieces_framework_1.Property.ShortText({
31
+ displayName: 'Caption',
32
+ description: 'Optional caption for the document (max 1024 characters).',
33
+ required: false,
34
+ }),
35
+ },
36
+ run(context) {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
+ const { session, contact, documentUrl, filename, caption } = context.propsValue;
39
+ const apiKey = context.auth.secret_text;
40
+ const preparedUrl = yield (0, prepare_file_1.prepareFile)(apiKey, documentUrl, 'document');
41
+ const body = {
42
+ session,
43
+ chatId: contact,
44
+ file: preparedUrl,
45
+ caption: caption !== null && caption !== void 0 ? caption : '',
46
+ };
47
+ if (filename)
48
+ body['filename'] = filename;
49
+ const sendResponse = yield (0, client_1.whatsscaleClient)(apiKey, pieces_common_1.HttpMethod.POST, '/api/sendDocument', body);
50
+ const { jobId } = sendResponse.body;
51
+ return yield (0, poll_job_1.pollJob)(apiKey, jobId);
52
+ });
53
+ },
54
+ });
55
+ //# sourceMappingURL=send-document-to-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-document-to-contact.js","sourceRoot":"","sources":["../../../../../src/lib/actions/messaging/send-document-to-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,qCAA4C;AAC5C,gDAAuD;AACvD,8CAAqD;AACrD,4DAAwD;AACxD,oDAAgD;AAEnC,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACtD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,qCAAqC;IAC3C,WAAW,EAAE,8BAA8B;IAC3C,WAAW,EAAE,mEAAmE;IAChF,KAAK,EAAE;QACL,OAAO,EAAE,uBAAe,CAAC,OAAO;QAChC,OAAO,EAAE,uBAAe,CAAC,OAAO;QAChC,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,gGAAgG;YAC7G,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAChF,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YAExC,MAAM,WAAW,GAAG,MAAM,IAAA,0BAAW,EAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;YAEvE,MAAM,IAAI,GAA4B;gBACpC,OAAO;gBACP,MAAM,EAAE,OAAO;gBACf,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE;aACvB,CAAC;YACF,IAAI,QAAQ;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;YAE1C,MAAM,YAAY,GAAG,MAAM,IAAA,yBAAgB,EAAC,MAAM,EAAE,0BAAU,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;YAChG,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC,IAAyB,CAAC;YACzD,OAAO,MAAM,IAAA,kBAAO,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACtC,CAAC;KAAA;CACF,CAAC,CAAC"}