n8n-nodes-repliz 1.0.1 → 1.0.2

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 (57) hide show
  1. package/README.md +112 -98
  2. package/dist/nodes/GenericFunctions.d.ts +3 -0
  3. package/dist/nodes/GenericFunctions.js +37 -0
  4. package/dist/nodes/GenericFunctions.js.map +1 -0
  5. package/dist/nodes/ReplizAccount/ReplizAccount.node.d.ts +5 -0
  6. package/dist/nodes/ReplizAccount/ReplizAccount.node.js +145 -0
  7. package/dist/nodes/ReplizAccount/ReplizAccount.node.js.map +1 -0
  8. package/dist/nodes/ReplizAccount/repliz.svg +4 -0
  9. package/dist/nodes/ReplizAccountFacebook/ReplizAccountFacebook.node.d.ts +5 -0
  10. package/dist/nodes/ReplizAccountFacebook/ReplizAccountFacebook.node.js +94 -0
  11. package/dist/nodes/ReplizAccountFacebook/ReplizAccountFacebook.node.js.map +1 -0
  12. package/dist/nodes/ReplizAccountFacebook/repliz.svg +4 -0
  13. package/dist/nodes/ReplizAccountInstagram/ReplizAccountInstagram.node.d.ts +5 -0
  14. package/dist/nodes/ReplizAccountInstagram/ReplizAccountInstagram.node.js +73 -0
  15. package/dist/nodes/ReplizAccountInstagram/ReplizAccountInstagram.node.js.map +1 -0
  16. package/dist/nodes/ReplizAccountInstagram/repliz.svg +4 -0
  17. package/dist/nodes/ReplizAccountLinkedIn/ReplizAccountLinkedIn.node.d.ts +5 -0
  18. package/dist/nodes/ReplizAccountLinkedIn/ReplizAccountLinkedIn.node.js +89 -0
  19. package/dist/nodes/ReplizAccountLinkedIn/ReplizAccountLinkedIn.node.js.map +1 -0
  20. package/dist/nodes/ReplizAccountLinkedIn/repliz.svg +4 -0
  21. package/dist/nodes/ReplizAccountShopee/ReplizAccountShopee.node.d.ts +5 -0
  22. package/dist/nodes/ReplizAccountShopee/ReplizAccountShopee.node.js +73 -0
  23. package/dist/nodes/ReplizAccountShopee/ReplizAccountShopee.node.js.map +1 -0
  24. package/dist/nodes/ReplizAccountShopee/repliz.svg +4 -0
  25. package/dist/nodes/ReplizAccountThreads/ReplizAccountThreads.node.d.ts +5 -0
  26. package/dist/nodes/ReplizAccountThreads/ReplizAccountThreads.node.js +73 -0
  27. package/dist/nodes/ReplizAccountThreads/ReplizAccountThreads.node.js.map +1 -0
  28. package/dist/nodes/ReplizAccountThreads/repliz.svg +4 -0
  29. package/dist/nodes/ReplizAccountTikTok/ReplizAccountTikTok.node.d.ts +5 -0
  30. package/dist/nodes/ReplizAccountTikTok/ReplizAccountTikTok.node.js +73 -0
  31. package/dist/nodes/ReplizAccountTikTok/ReplizAccountTikTok.node.js.map +1 -0
  32. package/dist/nodes/ReplizAccountTikTok/repliz.svg +4 -0
  33. package/dist/nodes/ReplizAccountYoutube/ReplizAccountYoutube.node.d.ts +5 -0
  34. package/dist/nodes/ReplizAccountYoutube/ReplizAccountYoutube.node.js +89 -0
  35. package/dist/nodes/ReplizAccountYoutube/ReplizAccountYoutube.node.js.map +1 -0
  36. package/dist/nodes/ReplizAccountYoutube/repliz.svg +4 -0
  37. package/dist/nodes/ReplizAddon/ReplizAddon.node.d.ts +5 -0
  38. package/dist/nodes/ReplizAddon/ReplizAddon.node.js +146 -0
  39. package/dist/nodes/ReplizAddon/ReplizAddon.node.js.map +1 -0
  40. package/dist/nodes/ReplizAddon/repliz.svg +4 -0
  41. package/dist/nodes/ReplizChat/ReplizChat.node.d.ts +5 -0
  42. package/dist/nodes/ReplizChat/ReplizChat.node.js +197 -0
  43. package/dist/nodes/ReplizChat/ReplizChat.node.js.map +1 -0
  44. package/dist/nodes/ReplizChat/repliz.svg +4 -0
  45. package/dist/nodes/ReplizComment/ReplizComment.node.d.ts +5 -0
  46. package/dist/nodes/ReplizComment/ReplizComment.node.js +181 -0
  47. package/dist/nodes/ReplizComment/ReplizComment.node.js.map +1 -0
  48. package/dist/nodes/ReplizComment/repliz.svg +4 -0
  49. package/dist/nodes/ReplizContent/ReplizContent.node.d.ts +5 -0
  50. package/dist/nodes/ReplizContent/ReplizContent.node.js +168 -0
  51. package/dist/nodes/ReplizContent/ReplizContent.node.js.map +1 -0
  52. package/dist/nodes/ReplizContent/repliz.svg +4 -0
  53. package/dist/nodes/ReplizSchedule/ReplizSchedule.node.d.ts +5 -0
  54. package/dist/nodes/ReplizSchedule/ReplizSchedule.node.js +202 -0
  55. package/dist/nodes/ReplizSchedule/ReplizSchedule.node.js.map +1 -0
  56. package/dist/nodes/ReplizSchedule/repliz.svg +4 -0
  57. package/package.json +18 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReplizAccountYoutube.node.js","sourceRoot":"","sources":["../../../nodes/ReplizAccountYoutube/ReplizAccountYoutube.node.ts"],"names":[],"mappings":";;;AACA,0DAAuD;AAEvD,MAAa,oBAAoB;IAAjC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE;YAC5C,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACpD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,qCAAqC,EAAE,MAAM,EAAE,mBAAmB,EAAE;wBAC1H,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,E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ACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA5ED,oDA4EC"}
@@ -0,0 +1,4 @@
1
+ <svg width="180" height="180" viewBox="0 0 180 180" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 90C0 40.2944 40.2944 0 90 0C139.706 0 180 40.2944 180 90C180 139.706 139.706 180 90 180C40.2944 180 0 139.706 0 90Z" fill="black"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M115 45C121.63 45 127.989 47.6339 132.678 52.3223C137.366 57.0107 140 63.3696 140 70V110C140 116.63 137.366 122.989 132.678 127.678C127.989 132.366 121.63 135 115 135H45C43.6739 135 42.4021 134.473 41.4645 133.536C40.5268 132.598 40 131.326 40 130V70C40 63.3696 42.6339 57.0107 47.3223 52.3223C52.0107 47.6339 58.3696 45 65 45H115ZM75 80C73.7753 80.0002 72.5933 80.4498 71.6781 81.2636C70.763 82.0774 70.1783 83.1987 70.035 84.415L70 85V95C70.0014 96.2744 70.4894 97.5002 71.3642 98.4268C72.2391 99.3535 73.4348 99.9112 74.707 99.9859C75.9792 100.061 77.2319 99.6466 78.2092 98.8287C79.1864 98.0107 79.8145 96.8505 79.965 95.585L80 95V85C80 83.6739 79.4732 82.4021 78.5355 81.4645C77.5978 80.5268 76.3261 80 75 80ZM105 80C103.674 80 102.402 80.5268 101.464 81.4645C100.527 82.4021 100 83.6739 100 85V95C100 96.3261 100.527 97.5979 101.464 98.5355C102.402 99.4732 103.674 100 105 100C106.326 100 107.598 99.4732 108.536 98.5355C109.473 97.5979 110 96.3261 110 95V85C110 83.6739 109.473 82.4021 108.536 81.4645C107.598 80.5268 106.326 80 105 80Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class ReplizAddon implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplizAddon = void 0;
4
+ const GenericFunctions_1 = require("../GenericFunctions");
5
+ const GENRE_OPTIONS = [
6
+ 'ALL', 'ROCK', 'POP', 'LATIN', 'METAL', 'ELECTRONIC', 'HIP_HOP/RAP', 'ALTERNATIVE/INDIE', 'FOLK',
7
+ 'R&B/SOUL', 'COUNTRY', 'CLASSICAL', 'JAZZ', 'REGGAE', 'CHILDHOOD', 'BLUES', 'EASY_LISTENING',
8
+ 'NEW_AGE', 'WORLD_MUSIC', 'EXPERIMENTAL', 'DEVOTIONAL', 'K-POP', 'J-POP', 'EDM', 'LO-FI',
9
+ 'DANCE_POP', 'INDIE_POP', 'INDIE_ROCK', 'HOUSE', 'TECHNO', 'TRANCE', 'TRAP_RAP', 'FUTURE_BASS',
10
+ 'SYNTH_POP', 'SOUL', 'FUNK', 'DISCO', 'GOSPEL', 'AMBIENT', 'OTHERS',
11
+ ].map(g => ({ name: g.replace(/_/g, ' '), value: g }));
12
+ class ReplizAddon {
13
+ constructor() {
14
+ this.description = {
15
+ displayName: 'Repliz Addon',
16
+ name: 'replizAddon',
17
+ icon: 'file:repliz.svg',
18
+ group: ['transform'],
19
+ version: 1,
20
+ subtitle: '={{$parameter["operation"]}}',
21
+ description: 'Access premium Repliz addons: TikTok trending music, Shopee products, and link metadata (Premium+)',
22
+ defaults: { name: 'Repliz Addon' },
23
+ inputs: ['main'],
24
+ outputs: ['main'],
25
+ credentials: [{ name: 'replizApi', required: true }],
26
+ properties: [
27
+ {
28
+ displayName: 'Operation',
29
+ name: 'operation',
30
+ type: 'options',
31
+ noDataExpression: true,
32
+ options: [
33
+ { name: 'Get TikTok Trending Music', value: 'getTrendingMusic', description: 'Retrieve trending music tracks from TikTok by genre and country', action: 'Get TikTok trending music' },
34
+ { name: 'Get Shopee Products', value: 'getShopeeProducts', description: 'Fetch product listings from a connected Shopee shop', action: 'Get Shopee products' },
35
+ { name: 'Get Link Metadata', value: 'getLinkMetadata', description: 'Extract preview metadata (title, description, image) from a URL', action: 'Get link metadata' },
36
+ ],
37
+ default: 'getTrendingMusic',
38
+ },
39
+ // TikTok Trending Music
40
+ {
41
+ displayName: 'Genre',
42
+ name: 'genre',
43
+ type: 'options',
44
+ required: true,
45
+ displayOptions: { show: { operation: ['getTrendingMusic'] } },
46
+ options: GENRE_OPTIONS,
47
+ default: 'ALL',
48
+ description: 'Music genre to filter trending tracks',
49
+ },
50
+ {
51
+ displayName: 'Country Code',
52
+ name: 'countryCode',
53
+ type: 'string',
54
+ required: true,
55
+ displayOptions: { show: { operation: ['getTrendingMusic'] } },
56
+ default: 'ID',
57
+ placeholder: 'e.g. ID, US, GB, JP',
58
+ description: 'ISO 3166-1 alpha-2 country code to filter trending music by region',
59
+ },
60
+ {
61
+ displayName: 'Date Range',
62
+ name: 'dateRange',
63
+ type: 'options',
64
+ required: true,
65
+ displayOptions: { show: { operation: ['getTrendingMusic'] } },
66
+ options: [
67
+ { name: 'Last 1 Day', value: '1DAY' },
68
+ { name: 'Last 7 Days', value: '7DAY' },
69
+ { name: 'Last 30 Days', value: '30DAY' },
70
+ { name: 'Last 90 Days', value: '90DAY' },
71
+ ],
72
+ default: '7DAY',
73
+ description: 'Time range for trending music data',
74
+ },
75
+ // Shopee Products
76
+ {
77
+ displayName: 'Account ID',
78
+ name: 'accountId',
79
+ type: 'string',
80
+ required: true,
81
+ displayOptions: { show: { operation: ['getShopeeProducts'] } },
82
+ default: '',
83
+ description: 'The Repliz account ID of the connected Shopee shop',
84
+ },
85
+ {
86
+ displayName: 'Next Token',
87
+ name: 'nextToken',
88
+ type: 'string',
89
+ displayOptions: { show: { operation: ['getShopeeProducts'] } },
90
+ default: '',
91
+ description: 'Pagination cursor from a previous response to fetch the next page',
92
+ },
93
+ // Link Metadata
94
+ {
95
+ displayName: 'URL',
96
+ name: 'url',
97
+ type: 'string',
98
+ required: true,
99
+ displayOptions: { show: { operation: ['getLinkMetadata'] } },
100
+ default: '',
101
+ placeholder: 'https://repliz.com',
102
+ description: 'The target URL to extract metadata from',
103
+ },
104
+ ],
105
+ };
106
+ }
107
+ async execute() {
108
+ const items = this.getInputData();
109
+ const returnData = [];
110
+ for (let i = 0; i < items.length; i++) {
111
+ try {
112
+ const operation = this.getNodeParameter('operation', i);
113
+ let responseData;
114
+ if (operation === 'getTrendingMusic') {
115
+ const genre = this.getNodeParameter('genre', i);
116
+ const countryCode = this.getNodeParameter('countryCode', i);
117
+ const dateRange = this.getNodeParameter('dateRange', i);
118
+ responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/tiktok/music', {}, { genre, countryCode, dateRange });
119
+ }
120
+ else if (operation === 'getShopeeProducts') {
121
+ const accountId = this.getNodeParameter('accountId', i);
122
+ const nextToken = this.getNodeParameter('nextToken', i);
123
+ const qs = { accountId };
124
+ if (nextToken)
125
+ qs.nextToken = nextToken;
126
+ responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/shopee/product', {}, qs);
127
+ }
128
+ else if (operation === 'getLinkMetadata') {
129
+ const url = this.getNodeParameter('url', i);
130
+ responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/link/metadata', {}, { url });
131
+ }
132
+ returnData.push(...this.helpers.returnJsonArray(responseData));
133
+ }
134
+ catch (error) {
135
+ if (this.continueOnFail()) {
136
+ returnData.push({ json: { error: error.message } });
137
+ continue;
138
+ }
139
+ throw error;
140
+ }
141
+ }
142
+ return [returnData];
143
+ }
144
+ }
145
+ exports.ReplizAddon = ReplizAddon;
146
+ //# sourceMappingURL=ReplizAddon.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReplizAddon.node.js","sourceRoot":"","sources":["../../../nodes/ReplizAddon/ReplizAddon.node.ts"],"names":[],"mappings":";;;AACA,0DAAuD;AAEvD,MAAM,aAAa,GAAG;IACrB,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,O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,YAAY,GAAG,MAAM,mCAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC/F,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;YAChE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAAC,SAAS;gBAAC,CAAC;gBACxG,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA/HD,kCA+HC"}
@@ -0,0 +1,4 @@
1
+ <svg width="180" height="180" viewBox="0 0 180 180" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 90C0 40.2944 40.2944 0 90 0C139.706 0 180 40.2944 180 90C180 139.706 139.706 180 90 180C40.2944 180 0 139.706 0 90Z" fill="black"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M115 45C121.63 45 127.989 47.6339 132.678 52.3223C137.366 57.0107 140 63.3696 140 70V110C140 116.63 137.366 122.989 132.678 127.678C127.989 132.366 121.63 135 115 135H45C43.6739 135 42.4021 134.473 41.4645 133.536C40.5268 132.598 40 131.326 40 130V70C40 63.3696 42.6339 57.0107 47.3223 52.3223C52.0107 47.6339 58.3696 45 65 45H115ZM75 80C73.7753 80.0002 72.5933 80.4498 71.6781 81.2636C70.763 82.0774 70.1783 83.1987 70.035 84.415L70 85V95C70.0014 96.2744 70.4894 97.5002 71.3642 98.4268C72.2391 99.3535 73.4348 99.9112 74.707 99.9859C75.9792 100.061 77.2319 99.6466 78.2092 98.8287C79.1864 98.0107 79.8145 96.8505 79.965 95.585L80 95V85C80 83.6739 79.4732 82.4021 78.5355 81.4645C77.5978 80.5268 76.3261 80 75 80ZM105 80C103.674 80 102.402 80.5268 101.464 81.4645C100.527 82.4021 100 83.6739 100 85V95C100 96.3261 100.527 97.5979 101.464 98.5355C102.402 99.4732 103.674 100 105 100C106.326 100 107.598 99.4732 108.536 98.5355C109.473 97.5979 110 96.3261 110 95V85C110 83.6739 109.473 82.4021 108.536 81.4645C107.598 80.5268 106.326 80 105 80Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class ReplizChat implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplizChat = void 0;
4
+ const GenericFunctions_1 = require("../GenericFunctions");
5
+ class ReplizChat {
6
+ constructor() {
7
+ this.description = {
8
+ displayName: 'Repliz Chat',
9
+ name: 'replizChat',
10
+ icon: 'file:repliz.svg',
11
+ group: ['transform'],
12
+ version: 1,
13
+ subtitle: '={{$parameter["operation"]}}',
14
+ description: 'Manage live chat conversations and messages in Repliz (Gold+)',
15
+ defaults: { name: 'Repliz Chat' },
16
+ inputs: ['main'],
17
+ outputs: ['main'],
18
+ credentials: [{ name: 'replizApi', required: true }],
19
+ properties: [
20
+ {
21
+ displayName: 'Operation',
22
+ name: 'operation',
23
+ type: 'options',
24
+ noDataExpression: true,
25
+ options: [
26
+ { name: 'Get All', value: 'getAll', description: 'Retrieve all chat conversations', action: 'Get all chats' },
27
+ { name: 'Get', value: 'get', description: 'Retrieve detailed info of a specific chat', action: 'Get a chat' },
28
+ { name: 'Get Messages', value: 'getMessages', description: 'Retrieve message history of a chat', action: 'Get chat messages' },
29
+ { name: 'Send Message', value: 'sendMessage', description: 'Send a message to a conversation', action: 'Send a message' },
30
+ { name: 'Mark as Read', value: 'markRead', description: 'Mark all messages in a chat as read', action: 'Mark chat as read' },
31
+ ],
32
+ default: 'getAll',
33
+ },
34
+ // Get All
35
+ { displayName: 'Return All', name: 'returnAll', type: 'boolean', displayOptions: { show: { operation: ['getAll'] } }, default: false, description: 'Whether to return all results or only up to a limit' },
36
+ { displayName: 'Limit', name: 'limit', type: 'number', displayOptions: { show: { operation: ['getAll', 'getMessages'], returnAll: [false] } }, typeOptions: { minValue: 1, maxValue: 100 }, default: 20, description: 'Max number of results to return' },
37
+ {
38
+ displayName: 'Filters',
39
+ name: 'filters',
40
+ type: 'collection',
41
+ placeholder: 'Add Filter',
42
+ default: {},
43
+ displayOptions: { show: { operation: ['getAll'] } },
44
+ options: [
45
+ { displayName: 'Status', name: 'status', type: 'options', options: [{ name: 'Unread', value: 'unread' }, { name: 'Unreplied', value: 'unreplied' }], default: '', description: 'Filter chats by status' },
46
+ { displayName: 'Account IDs', name: 'accountIds', type: 'string', default: '', placeholder: 'id1,id2,id3', description: 'Comma-separated list of account IDs to filter by' },
47
+ { displayName: 'Search', name: 'search', type: 'string', default: '', description: 'Search chats by sender name' },
48
+ ],
49
+ },
50
+ // Get / Get Messages / Send Message / Mark Read
51
+ { displayName: 'Chat ID', name: 'chatId', type: 'string', required: true, displayOptions: { show: { operation: ['get', 'getMessages', 'sendMessage', 'markRead'] } }, default: '', description: 'The unique identifier of the chat' },
52
+ // Get Messages
53
+ { displayName: 'Return All', name: 'returnAll', type: 'boolean', displayOptions: { show: { operation: ['getMessages'] } }, default: false, description: 'Whether to return all messages or only up to a limit' },
54
+ // Send Message
55
+ {
56
+ displayName: 'Message Type',
57
+ name: 'messageType',
58
+ type: 'options',
59
+ required: true,
60
+ displayOptions: { show: { operation: ['sendMessage'] } },
61
+ options: [
62
+ { name: 'Text', value: 'text' },
63
+ { name: 'Image', value: 'image' },
64
+ { name: 'Video', value: 'video' },
65
+ { name: 'Audio', value: 'audio' },
66
+ { name: 'Document', value: 'document' },
67
+ { name: 'Button', value: 'button' },
68
+ ],
69
+ default: 'text',
70
+ description: 'Type of message to send',
71
+ },
72
+ { displayName: 'Text', name: 'text', type: 'string', typeOptions: { rows: 3 }, displayOptions: { show: { operation: ['sendMessage'], messageType: ['text', 'image', 'video', 'audio', 'document'] } }, default: '', description: 'The text content of the message' },
73
+ { displayName: 'Media URL', name: 'mediaUrl', type: 'string', displayOptions: { show: { operation: ['sendMessage'], messageType: ['image', 'video', 'audio', 'document'] } }, default: '', description: 'URL of the media file to send' },
74
+ { displayName: 'MIME Type', name: 'mimeType', type: 'string', displayOptions: { show: { operation: ['sendMessage'], messageType: ['image', 'video', 'audio', 'document'] } }, default: '', placeholder: 'e.g. image/jpeg, video/mp4', description: 'The MIME type of the media file' },
75
+ { displayName: 'Thumbnail URL', name: 'thumbnailUrl', type: 'string', displayOptions: { show: { operation: ['sendMessage'], messageType: ['image', 'video'] } }, default: '', description: 'Optional thumbnail image URL for the media' },
76
+ { displayName: 'Duration (seconds)', name: 'duration', type: 'number', displayOptions: { show: { operation: ['sendMessage'], messageType: ['video', 'audio'] } }, default: 0, description: 'Duration of the video or audio in seconds' },
77
+ { displayName: 'Document Name', name: 'documentName', type: 'string', displayOptions: { show: { operation: ['sendMessage'], messageType: ['document'] } }, default: '', description: 'Display name of the document file' },
78
+ { displayName: 'Document Size (bytes)', name: 'documentSize', type: 'number', displayOptions: { show: { operation: ['sendMessage'], messageType: ['document'] } }, default: 0, description: 'File size of the document in bytes' },
79
+ { displayName: 'Button Text', name: 'buttonText', type: 'string', displayOptions: { show: { operation: ['sendMessage'], messageType: ['button'] } }, default: '', description: 'Main text displayed in the button message' },
80
+ { displayName: 'Button Image URL', name: 'buttonImageUrl', type: 'string', displayOptions: { show: { operation: ['sendMessage'], messageType: ['button'] } }, default: '', description: 'Optional image URL shown above the button text' },
81
+ {
82
+ displayName: 'Buttons',
83
+ name: 'buttons',
84
+ type: 'fixedCollection',
85
+ typeOptions: { multipleValues: true },
86
+ displayOptions: { show: { operation: ['sendMessage'], messageType: ['button'] } },
87
+ default: {},
88
+ options: [{
89
+ displayName: 'Button Item',
90
+ name: 'buttonItems',
91
+ values: [
92
+ { displayName: 'Type', name: 'type', type: 'options', options: [{ name: 'Web URL', value: 'web_url' }, { name: 'Postback', value: 'postback' }], default: 'web_url' },
93
+ { displayName: 'Title', name: 'title', type: 'string', default: '', description: 'Label displayed on the button' },
94
+ { displayName: 'URL', name: 'url', type: 'string', default: '', description: 'The URL to open when the button is clicked (for web_url type)' },
95
+ ],
96
+ }],
97
+ description: 'List of buttons to display in the message',
98
+ },
99
+ ],
100
+ };
101
+ }
102
+ async execute() {
103
+ const items = this.getInputData();
104
+ const returnData = [];
105
+ for (let i = 0; i < items.length; i++) {
106
+ try {
107
+ const operation = this.getNodeParameter('operation', i);
108
+ let responseData;
109
+ if (operation === 'getAll') {
110
+ const returnAll = this.getNodeParameter('returnAll', i);
111
+ const filters = this.getNodeParameter('filters', i);
112
+ const qs = {};
113
+ if (filters.status)
114
+ qs.status = filters.status;
115
+ if (filters.search)
116
+ qs.search = filters.search;
117
+ if (filters.accountIds)
118
+ qs.accountIds = filters.accountIds.split(',').map((s) => s.trim()).filter(Boolean);
119
+ if (returnAll) {
120
+ responseData = await GenericFunctions_1.replizApiRequestAllItems.call(this, 'GET', '/public/chat', {}, qs);
121
+ }
122
+ else {
123
+ const limit = this.getNodeParameter('limit', i);
124
+ const res = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/chat', {}, { ...qs, page: 1, limit });
125
+ responseData = res.docs || [];
126
+ }
127
+ }
128
+ else if (operation === 'get') {
129
+ const chatId = this.getNodeParameter('chatId', i);
130
+ responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', `/public/chat/${chatId}`);
131
+ }
132
+ else if (operation === 'getMessages') {
133
+ const chatId = this.getNodeParameter('chatId', i);
134
+ const returnAll = this.getNodeParameter('returnAll', i);
135
+ if (returnAll) {
136
+ responseData = await GenericFunctions_1.replizApiRequestAllItems.call(this, 'GET', `/public/chat/${chatId}/message`);
137
+ }
138
+ else {
139
+ const limit = this.getNodeParameter('limit', i);
140
+ const res = await GenericFunctions_1.replizApiRequest.call(this, 'GET', `/public/chat/${chatId}/message`, {}, { page: 1, limit });
141
+ responseData = res.docs || [];
142
+ }
143
+ }
144
+ else if (operation === 'sendMessage') {
145
+ const chatId = this.getNodeParameter('chatId', i);
146
+ const messageType = this.getNodeParameter('messageType', i);
147
+ const body = { type: messageType };
148
+ if (messageType === 'text') {
149
+ body.text = this.getNodeParameter('text', i);
150
+ }
151
+ else if (['image', 'video', 'audio', 'document'].includes(messageType)) {
152
+ body.text = this.getNodeParameter('text', i);
153
+ const mediaObj = { url: this.getNodeParameter('mediaUrl', i), mimetype: this.getNodeParameter('mimeType', i) };
154
+ const thumb = this.getNodeParameter('thumbnailUrl', i);
155
+ if (thumb)
156
+ mediaObj.thumbnail = thumb;
157
+ const dur = this.getNodeParameter('duration', i);
158
+ if (dur && ['video', 'audio'].includes(messageType))
159
+ mediaObj.duration = dur;
160
+ if (messageType === 'document') {
161
+ mediaObj.name = this.getNodeParameter('documentName', i);
162
+ const size = this.getNodeParameter('documentSize', i);
163
+ if (size)
164
+ mediaObj.size = size;
165
+ }
166
+ body[messageType] = mediaObj;
167
+ }
168
+ else if (messageType === 'button') {
169
+ const btnObj = { text: this.getNodeParameter('buttonText', i) };
170
+ const img = this.getNodeParameter('buttonImageUrl', i);
171
+ if (img)
172
+ btnObj.image = img;
173
+ const buttonsData = this.getNodeParameter('buttons.buttonItems', i, []);
174
+ btnObj.buttons = buttonsData.map((btn) => ({ type: btn.type, title: btn.title, url: btn.url }));
175
+ body.button = btnObj;
176
+ }
177
+ responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', `/public/chat/${chatId}/message`, body);
178
+ }
179
+ else if (operation === 'markRead') {
180
+ const chatId = this.getNodeParameter('chatId', i);
181
+ responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', `/public/chat/${chatId}/read`);
182
+ }
183
+ returnData.push(...this.helpers.returnJsonArray(responseData));
184
+ }
185
+ catch (error) {
186
+ if (this.continueOnFail()) {
187
+ returnData.push({ json: { error: error.message } });
188
+ continue;
189
+ }
190
+ throw error;
191
+ }
192
+ }
193
+ return [returnData];
194
+ }
195
+ }
196
+ exports.ReplizChat = ReplizChat;
197
+ //# sourceMappingURL=ReplizChat.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReplizChat.node.js","sourceRoot":"","sources":["../../../nodes/ReplizChat/ReplizChat.node.ts"],"names":[],"mappings":";;;AACA,0DAAiF;AAEjF,MAAa,UAAU;IAAvB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,+DAA+D;YAC5E,QAAQ,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;YACjC,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACpD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE,MAAM,EAAE,eAAe,EAAE;wBAC7G,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,2CAA2C,EAAE,MAAM,EAAE,YAAY,EAAE;wBAC7G,EAAE,IA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AC,GAAG,EAAE,CAAC,CAAC,CAAC;wBACrG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;oBACtB,CAAC;oBAED,YAAY,GAAG,MAAM,mCAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,MAAM,UAAU,EAAE,IAAI,CAAC,CAAC;gBAClG,CAAC;qBAAM,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;oBACrC,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAW,CAAC;oBAC5D,YAAY,GAAG,MAAM,mCAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,MAAM,OAAO,CAAC,CAAC;gBACzF,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;YAChE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAAC,SAAS;gBAAC,CAAC;gBACxG,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAhLD,gCAgLC"}
@@ -0,0 +1,4 @@
1
+ <svg width="180" height="180" viewBox="0 0 180 180" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 90C0 40.2944 40.2944 0 90 0C139.706 0 180 40.2944 180 90C180 139.706 139.706 180 90 180C40.2944 180 0 139.706 0 90Z" fill="black"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M115 45C121.63 45 127.989 47.6339 132.678 52.3223C137.366 57.0107 140 63.3696 140 70V110C140 116.63 137.366 122.989 132.678 127.678C127.989 132.366 121.63 135 115 135H45C43.6739 135 42.4021 134.473 41.4645 133.536C40.5268 132.598 40 131.326 40 130V70C40 63.3696 42.6339 57.0107 47.3223 52.3223C52.0107 47.6339 58.3696 45 65 45H115ZM75 80C73.7753 80.0002 72.5933 80.4498 71.6781 81.2636C70.763 82.0774 70.1783 83.1987 70.035 84.415L70 85V95C70.0014 96.2744 70.4894 97.5002 71.3642 98.4268C72.2391 99.3535 73.4348 99.9112 74.707 99.9859C75.9792 100.061 77.2319 99.6466 78.2092 98.8287C79.1864 98.0107 79.8145 96.8505 79.965 95.585L80 95V85C80 83.6739 79.4732 82.4021 78.5355 81.4645C77.5978 80.5268 76.3261 80 75 80ZM105 80C103.674 80 102.402 80.5268 101.464 81.4645C100.527 82.4021 100 83.6739 100 85V95C100 96.3261 100.527 97.5979 101.464 98.5355C102.402 99.4732 103.674 100 105 100C106.326 100 107.598 99.4732 108.536 98.5355C109.473 97.5979 110 96.3261 110 95V85C110 83.6739 109.473 82.4021 108.536 81.4645C107.598 80.5268 106.326 80 105 80Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class ReplizComment implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplizComment = void 0;
4
+ const GenericFunctions_1 = require("../GenericFunctions");
5
+ class ReplizComment {
6
+ constructor() {
7
+ this.description = {
8
+ displayName: 'Repliz Comment',
9
+ name: 'replizComment',
10
+ icon: 'file:repliz.svg',
11
+ group: ['transform'],
12
+ version: 1,
13
+ subtitle: '={{$parameter["operation"]}}',
14
+ description: 'Manage and moderate comments collected in Repliz (Standard+)',
15
+ defaults: { name: 'Repliz Comment' },
16
+ inputs: ['main'],
17
+ outputs: ['main'],
18
+ credentials: [{ name: 'replizApi', required: true }],
19
+ properties: [
20
+ {
21
+ displayName: 'Operation',
22
+ name: 'operation',
23
+ type: 'options',
24
+ noDataExpression: true,
25
+ options: [
26
+ { name: 'Get All', value: 'getAll', description: 'Retrieve all stored comments', action: 'Get all comments' },
27
+ { name: 'Get', value: 'get', description: 'Retrieve detailed info of a specific comment', action: 'Get a comment' },
28
+ { name: 'Reply', value: 'reply', description: 'Send a reply to a stored comment on the original platform', action: 'Reply to comment' },
29
+ { name: 'Update Status', value: 'updateStatus', description: 'Update comment status (pending, resolved, ignored)', action: 'Update comment status' },
30
+ ],
31
+ default: 'getAll',
32
+ },
33
+ // Get All
34
+ {
35
+ displayName: 'Return All',
36
+ name: 'returnAll',
37
+ type: 'boolean',
38
+ displayOptions: { show: { operation: ['getAll'] } },
39
+ default: false,
40
+ description: 'Whether to return all results or only up to a limit',
41
+ },
42
+ {
43
+ displayName: 'Limit',
44
+ name: 'limit',
45
+ type: 'number',
46
+ displayOptions: { show: { operation: ['getAll'], returnAll: [false] } },
47
+ typeOptions: { minValue: 1, maxValue: 100 },
48
+ default: 20,
49
+ description: 'Max number of results to return',
50
+ },
51
+ {
52
+ displayName: 'Filters',
53
+ name: 'filters',
54
+ type: 'collection',
55
+ placeholder: 'Add Filter',
56
+ default: {},
57
+ displayOptions: { show: { operation: ['getAll'] } },
58
+ options: [
59
+ {
60
+ displayName: 'Status',
61
+ name: 'status',
62
+ type: 'options',
63
+ options: [
64
+ { name: 'Pending', value: 'pending' },
65
+ { name: 'Resolved', value: 'resolved' },
66
+ { name: 'Ignored', value: 'ignored' },
67
+ ],
68
+ default: '',
69
+ description: 'Filter by comment status',
70
+ },
71
+ {
72
+ displayName: 'Account IDs',
73
+ name: 'accountIds',
74
+ type: 'string',
75
+ default: '',
76
+ placeholder: 'id1,id2,id3',
77
+ description: 'Comma-separated list of account IDs to filter by',
78
+ },
79
+ {
80
+ displayName: 'Search',
81
+ name: 'search',
82
+ type: 'string',
83
+ default: '',
84
+ description: 'Search comments by content text',
85
+ },
86
+ ],
87
+ },
88
+ // Get / Reply / Update Status
89
+ {
90
+ displayName: 'Comment ID',
91
+ name: 'commentId',
92
+ type: 'string',
93
+ required: true,
94
+ displayOptions: { show: { operation: ['get', 'reply', 'updateStatus'] } },
95
+ default: '',
96
+ description: 'The unique identifier of the comment',
97
+ },
98
+ // Reply
99
+ {
100
+ displayName: 'Reply Text',
101
+ name: 'text',
102
+ type: 'string',
103
+ required: true,
104
+ typeOptions: { rows: 3 },
105
+ displayOptions: { show: { operation: ['reply'] } },
106
+ default: '',
107
+ description: 'The text to send as a reply to the comment',
108
+ },
109
+ // Update Status
110
+ {
111
+ displayName: 'Status',
112
+ name: 'status',
113
+ type: 'options',
114
+ required: true,
115
+ displayOptions: { show: { operation: ['updateStatus'] } },
116
+ options: [
117
+ { name: 'Pending', value: 'pending' },
118
+ { name: 'Resolved', value: 'resolved' },
119
+ { name: 'Ignored', value: 'ignored' },
120
+ ],
121
+ default: 'resolved',
122
+ description: 'The new status to set for the comment',
123
+ },
124
+ ],
125
+ };
126
+ }
127
+ async execute() {
128
+ const items = this.getInputData();
129
+ const returnData = [];
130
+ for (let i = 0; i < items.length; i++) {
131
+ try {
132
+ const operation = this.getNodeParameter('operation', i);
133
+ let responseData;
134
+ if (operation === 'getAll') {
135
+ const returnAll = this.getNodeParameter('returnAll', i);
136
+ const filters = this.getNodeParameter('filters', i);
137
+ const qs = {};
138
+ if (filters.status)
139
+ qs.status = filters.status;
140
+ if (filters.search)
141
+ qs.search = filters.search;
142
+ if (filters.accountIds)
143
+ qs.accountIds = filters.accountIds.split(',').map((s) => s.trim()).filter(Boolean);
144
+ if (returnAll) {
145
+ responseData = await GenericFunctions_1.replizApiRequestAllItems.call(this, 'GET', '/public/comment', {}, qs);
146
+ }
147
+ else {
148
+ const limit = this.getNodeParameter('limit', i);
149
+ const res = await GenericFunctions_1.replizApiRequest.call(this, 'GET', '/public/comment', {}, { ...qs, page: 1, limit });
150
+ responseData = res.docs || [];
151
+ }
152
+ }
153
+ else if (operation === 'get') {
154
+ const commentId = this.getNodeParameter('commentId', i);
155
+ responseData = await GenericFunctions_1.replizApiRequest.call(this, 'GET', `/public/comment/${commentId}`);
156
+ }
157
+ else if (operation === 'reply') {
158
+ const commentId = this.getNodeParameter('commentId', i);
159
+ const text = this.getNodeParameter('text', i);
160
+ responseData = await GenericFunctions_1.replizApiRequest.call(this, 'POST', `/public/comment/${commentId}`, { text });
161
+ }
162
+ else if (operation === 'updateStatus') {
163
+ const commentId = this.getNodeParameter('commentId', i);
164
+ const status = this.getNodeParameter('status', i);
165
+ responseData = await GenericFunctions_1.replizApiRequest.call(this, 'PUT', `/public/comment/${commentId}/status`, { status });
166
+ }
167
+ returnData.push(...this.helpers.returnJsonArray(responseData));
168
+ }
169
+ catch (error) {
170
+ if (this.continueOnFail()) {
171
+ returnData.push({ json: { error: error.message } });
172
+ continue;
173
+ }
174
+ throw error;
175
+ }
176
+ }
177
+ return [returnData];
178
+ }
179
+ }
180
+ exports.ReplizComment = ReplizComment;
181
+ //# sourceMappingURL=ReplizComment.node.js.map