n8n-nodes-base 1.95.0 → 1.96.0

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 (132) hide show
  1. package/dist/credentials/PerplexityApi.credentials.js +1 -1
  2. package/dist/credentials/PerplexityApi.credentials.js.map +1 -1
  3. package/dist/nodes/Adalo/__schema__/v1.0.0/collection/getAll.json +21 -0
  4. package/dist/nodes/Airtable/test/v2/node/helpers.js +12 -2
  5. package/dist/nodes/Airtable/test/v2/node/helpers.js.map +1 -1
  6. package/dist/nodes/Airtop/__schema__/v1.0.0/extraction/query.json +7 -1
  7. package/dist/nodes/Airtop/__schema__/v1.0.0/session/create.json +9 -0
  8. package/dist/nodes/Airtop/__schema__/v1.0.0/window/create.json +40 -0
  9. package/dist/nodes/Airtop/test/node/helpers.js +12 -2
  10. package/dist/nodes/Airtop/test/node/helpers.js.map +1 -1
  11. package/dist/nodes/Asana/__schema__/v1.0.0/subtask/getAll.json +4 -1
  12. package/dist/nodes/Aws/S3/__schema__/v2.0.0/file/getAll.json +7 -1
  13. package/dist/nodes/Aws/S3/__schema__/v2.0.0/folder/getAll.json +7 -1
  14. package/dist/nodes/BambooHr/__schema__/v1.0.0/employee/getAll.json +1 -4
  15. package/dist/nodes/ClickUp/__schema__/v1.0.0/list/customFields.json +23 -1
  16. package/dist/nodes/Code/Pyodide.js +24 -0
  17. package/dist/nodes/Code/Pyodide.js.map +1 -1
  18. package/dist/nodes/CompareDatasets/GenericFunctions.js +5 -5
  19. package/dist/nodes/CompareDatasets/GenericFunctions.js.map +1 -1
  20. package/dist/nodes/Discord/__schema__/v2.0.0/message/sendAndWait.json +14 -0
  21. package/dist/nodes/Discord/v2/helpers/utils.js +2 -2
  22. package/dist/nodes/Discord/v2/helpers/utils.js.map +1 -1
  23. package/dist/nodes/Dropbox/__schema__/v1.0.0/file/download.json +31 -1
  24. package/dist/nodes/Dropcontact/__schema__/v1.0.0/contact/enrich.json +15 -1
  25. package/dist/nodes/Dropcontact/__schema__/v1.0.0/contact/fetchRequest.json +50 -0
  26. package/dist/nodes/EmailReadImap/v2/utils.js +16 -3
  27. package/dist/nodes/EmailReadImap/v2/utils.js.map +1 -1
  28. package/dist/nodes/EmailSend/__schema__/v2.1.0/email/send.json +1 -7
  29. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +1 -1
  30. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -1
  31. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js +2 -2
  32. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js.map +1 -1
  33. package/dist/nodes/Freshservice/GenericFunctions.js +12 -2
  34. package/dist/nodes/Freshservice/GenericFunctions.js.map +1 -1
  35. package/dist/nodes/Google/Ads/__schema__/v1.0.0/campaign/getAll.json +13 -1
  36. package/dist/nodes/Google/Analytics/__schema__/v2.0.0/report/get.json +1 -4
  37. package/dist/nodes/Google/Calendar/__schema__/v1.3.0/event/getAll.json +1 -4
  38. package/dist/nodes/Google/Chat/__schema__/v1.0.0/message/create.json +30 -1
  39. package/dist/nodes/Google/Drive/__schema__/v3.0.0/file/upload.json +4 -1
  40. package/dist/nodes/Google/Drive/test/v2/node/helpers.js +12 -2
  41. package/dist/nodes/Google/Drive/test/v2/node/helpers.js.map +1 -1
  42. package/dist/nodes/Google/Firebase/CloudFirestore/__schema__/v1.1.0/document/query.json +1 -7
  43. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/addLabels.json +13 -1
  44. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/get.json +1 -7
  45. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/markAsRead.json +13 -1
  46. package/dist/nodes/Google/Gmail/__schema__/v2.1.0/thread/addLabels.json +16 -1
  47. package/dist/nodes/Google/Sheet/v2/actions/sheet/update.operation.js +10 -4
  48. package/dist/nodes/Google/Sheet/v2/actions/sheet/update.operation.js.map +1 -1
  49. package/dist/nodes/HaloPSA/__schema__/v1.0.0/ticket/getAll.json +1 -268
  50. package/dist/nodes/HttpRequest/shared/optimizeResponse.js +5 -3
  51. package/dist/nodes/HttpRequest/shared/optimizeResponse.js.map +1 -1
  52. package/dist/nodes/Hubspot/__schema__/v2.1.0/company/getAll.json +1 -4
  53. package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/getAll.json +64 -1
  54. package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/search.json +1 -4
  55. package/dist/nodes/Hubspot/__schema__/v2.1.0/ticket/get.json +1 -61
  56. package/dist/nodes/JinaAI/__schema__/v1.0.0/reader/read.json +26 -0
  57. package/dist/nodes/Jira/__schema__/v1.0.0/issue/get.json +604 -7
  58. package/dist/nodes/Jira/__schema__/v1.0.0/issue/getAll.json +1 -110
  59. package/dist/nodes/Lemlist/__schema__/v2.0.0/lead/create.json +1 -4
  60. package/dist/nodes/Lemlist/__schema__/v2.0.0/lead/get.json +30 -0
  61. package/dist/nodes/Line/__schema__/v1.0.0/notification/send.json +4 -7
  62. package/dist/nodes/Linear/__schema__/v1.0.0/issue/getAll.json +12 -1
  63. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js +23 -3
  64. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js.map +1 -1
  65. package/dist/nodes/Microsoft/Entra/__schema__/v1.0.0/user/getAll.json +1 -7
  66. package/dist/nodes/Microsoft/Entra/descriptions/GroupDescription.js +12 -2
  67. package/dist/nodes/Microsoft/Entra/descriptions/GroupDescription.js.map +1 -1
  68. package/dist/nodes/Microsoft/Entra/descriptions/UserDescription.js +13 -3
  69. package/dist/nodes/Microsoft/Entra/descriptions/UserDescription.js.map +1 -1
  70. package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/file/download.json +23 -10
  71. package/dist/nodes/Microsoft/OneDrive/__schema__/v1.0.0/folder/create.json +1 -15
  72. package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/event/getAll.json +1 -4
  73. package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/folderMessage/getAll.json +124 -1
  74. package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/getAll.json +1 -56
  75. package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js +12 -2
  76. package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js.map +1 -1
  77. package/dist/nodes/Microsoft/Storage/__schema__/v1.0.0/blob/create.json +39 -0
  78. package/dist/nodes/Microsoft/Storage/__schema__/v1.0.0/blob/get.json +44 -0
  79. package/dist/nodes/Microsoft/ToDo/__schema__/v1.0.0/task/getAll.json +5 -21
  80. package/dist/nodes/N8n/WorkflowDescription.js +40 -0
  81. package/dist/nodes/N8n/WorkflowDescription.js.map +1 -1
  82. package/dist/nodes/Nasa/__schema__/v1.0.0/donkiSolarFlare/get.json +1 -4
  83. package/dist/nodes/Notion/__schema__/v2.2.0/database/get.json +2 -149
  84. package/dist/nodes/Odoo/__schema__/v1.0.0/contact/get.json +1 -4
  85. package/dist/nodes/Odoo/__schema__/v1.0.0/contact/getAll.json +1 -10
  86. package/dist/nodes/Odoo/__schema__/v1.0.0/opportunity/getAll.json +1 -40
  87. package/dist/nodes/OpenAi/__schema__/v1.1.0/chat/complete.json +29 -1
  88. package/dist/nodes/Perplexity/perplexity.dark.svg +35 -0
  89. package/dist/nodes/Pipedrive/__schema__/v1.0.0/person/search.json +7 -1
  90. package/dist/nodes/QuickBase/__schema__/v1.0.0/record/getAll.json +9 -0
  91. package/dist/nodes/QuickBooks/__schema__/v1.0.0/transaction/getReport.json +4 -1
  92. package/dist/nodes/RssFeedRead/RssFeedRead.node.js +9 -3
  93. package/dist/nodes/RssFeedRead/RssFeedRead.node.js.map +1 -1
  94. package/dist/nodes/S3/__schema__/v1.0.0/file/download.json +21 -0
  95. package/dist/nodes/Salesforce/__schema__/v1.0.0/customObject/getAll.json +1 -4
  96. package/dist/nodes/Salesforce/__schema__/v1.0.0/lead/getAll.json +1 -4
  97. package/dist/nodes/Salesforce/__schema__/v1.0.0/opportunity/getAll.json +1 -4
  98. package/dist/nodes/Salesforce/__schema__/v1.0.0/search/query.json +1 -4
  99. package/dist/nodes/Shopify/__schema__/v1.0.0/order/getAll.json +250 -3
  100. package/dist/nodes/Slack/__schema__/v2.3.0/channel/history.json +1 -50
  101. package/dist/nodes/Slack/__schema__/v2.3.0/channel/member.json +168 -2
  102. package/dist/nodes/Slack/__schema__/v2.3.0/message/post.json +1 -4
  103. package/dist/nodes/Sms77/__schema__/v1.0.0/sms/send.json +1 -10
  104. package/dist/nodes/Strapi/__schema__/v1.0.0/entry/getAll.json +10 -1
  105. package/dist/nodes/Telegram/__schema__/v1.2.0/chat/member.json +1 -4
  106. package/dist/nodes/Telegram/__schema__/v1.2.0/message/editMessageText.json +4 -1
  107. package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendAndWait.json +14 -0
  108. package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendMessage.json +4 -21
  109. package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendPhoto.json +1 -7
  110. package/dist/nodes/Telegram/tests/Helpers.js +12 -2
  111. package/dist/nodes/Telegram/tests/Helpers.js.map +1 -1
  112. package/dist/nodes/Transform/RemoveDuplicates/utils.js +8 -6
  113. package/dist/nodes/Transform/RemoveDuplicates/utils.js.map +1 -1
  114. package/dist/nodes/Trello/__schema__/v1.0.0/list/getAll.json +1 -4
  115. package/dist/nodes/Trello/__schema__/v1.0.0/list/getCards.json +1 -4
  116. package/dist/nodes/Twitter/__schema__/v2.0.0/tweet/search.json +7 -1
  117. package/dist/nodes/Wordpress/__schema__/v1.0.0/post/get.json +1 -7
  118. package/dist/nodes/Zoho/__schema__/v1.0.0/contact/getAll.json +1 -4
  119. package/dist/nodes/Zoho/__schema__/v1.0.0/lead/getAll.json +99 -1
  120. package/dist/test/nodes/Helpers.js +12 -2
  121. package/dist/test/nodes/Helpers.js.map +1 -1
  122. package/dist/types/credentials.json +1 -1
  123. package/dist/types/nodes.json +13 -13
  124. package/dist/utils/binary.js +12 -9
  125. package/dist/utils/binary.js.map +1 -1
  126. package/dist/utils/sendAndWait/utils.js +20 -5
  127. package/dist/utils/sendAndWait/utils.js.map +1 -1
  128. package/dist/utils/utilities.js +31 -16
  129. package/dist/utils/utilities.js.map +1 -1
  130. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js +2 -2
  131. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js.map +1 -1
  132. package/package.json +7 -7
@@ -4,285 +4,18 @@
4
4
  "agent_id": {
5
5
  "type": "integer"
6
6
  },
7
- "appointment_type": {
8
- "type": "integer"
9
- },
10
- "attachment_count": {
11
- "type": "integer"
12
- },
13
- "category_1": {
14
- "type": "string"
15
- },
16
- "category_2": {
17
- "type": "string"
18
- },
19
- "category_3": {
20
- "type": "string"
21
- },
22
- "category_4": {
23
- "type": "string"
24
- },
25
- "child_count": {
26
- "type": "integer"
27
- },
28
- "client_id": {
29
- "type": "integer"
30
- },
31
- "client_name": {
32
- "type": "string"
33
- },
34
- "cost": {
35
- "type": "integer"
36
- },
37
- "dateoccurred": {
38
- "type": "string"
39
- },
40
- "deadlinedate": {
41
- "type": "string"
42
- },
43
- "department_id": {
44
- "type": "integer"
45
- },
46
7
  "details": {
47
8
  "type": "string"
48
9
  },
49
- "emailcclist": {
50
- "type": "string"
51
- },
52
- "emailtolist": {
53
- "type": "string"
54
- },
55
- "enduserstatus": {
56
- "type": "integer"
57
- },
58
- "estimatedays": {
59
- "type": "integer"
60
- },
61
- "excludefromsla": {
62
- "type": "boolean"
63
- },
64
- "fixbydate": {
65
- "type": "string"
66
- },
67
- "flagged": {
68
- "type": "boolean"
69
- },
70
- "guid": {
71
- "type": "string"
72
- },
73
10
  "id": {
74
11
  "type": "integer"
75
12
  },
76
- "idsummary": {
77
- "type": "string"
78
- },
79
- "impact": {
80
- "type": "integer"
81
- },
82
- "impactlevel": {
83
- "type": "integer"
84
- },
85
- "inactive": {
86
- "type": "boolean"
87
- },
88
- "invoiceseperatelyoverride": {
89
- "type": "boolean"
90
- },
91
- "is_vip": {
92
- "type": "boolean"
93
- },
94
- "isimportantcontact": {
95
- "type": "boolean"
96
- },
97
- "itil_requesttype_id": {
98
- "type": "integer"
99
- },
100
- "last_update": {
101
- "type": "string"
102
- },
103
- "lastactiondate": {
104
- "type": "string"
105
- },
106
- "lastincomingemail": {
107
- "type": "string"
108
- },
109
- "matched_kb_id": {
110
- "type": "integer"
111
- },
112
- "maximumRestrictedPriority": {
113
- "type": "integer"
114
- },
115
- "merged_into_id": {
116
- "type": "integer"
117
- },
118
- "notuseful_count": {
119
- "type": "integer"
120
- },
121
- "onhold": {
122
- "type": "boolean"
123
- },
124
- "oppcompanyname": {
125
- "type": "string"
126
- },
127
- "oppvalueadjusted": {
128
- "type": "integer"
129
- },
130
- "organisation_id": {
131
- "type": "integer"
132
- },
133
- "pipeline_stage_id": {
134
- "type": "integer"
135
- },
136
- "priority_id": {
137
- "type": "integer"
138
- },
139
- "product_id": {
140
- "type": "integer"
141
- },
142
- "projectinternaltask": {
143
- "type": "boolean"
144
- },
145
- "purchaseordernumber": {
146
- "type": "string"
147
- },
148
- "quantity": {
149
- "type": "integer"
150
- },
151
- "read": {
152
- "type": "boolean"
153
- },
154
- "release_id": {
155
- "type": "integer"
156
- },
157
- "release_important": {
158
- "type": "boolean"
159
- },
160
- "release2_id": {
161
- "type": "integer"
162
- },
163
- "release3_id": {
164
- "type": "integer"
165
- },
166
- "releasenotegroup_id": {
167
- "type": "integer"
168
- },
169
- "reportedby": {
170
- "type": "string"
171
- },
172
- "respondbydate": {
173
- "type": "string"
174
- },
175
- "responsedate": {
176
- "type": "string"
177
- },
178
- "reviewed": {
179
- "type": "boolean"
180
- },
181
- "section_timezone": {
182
- "type": "string"
183
- },
184
- "servicestatusnote": {
185
- "type": "string"
186
- },
187
- "site_id": {
188
- "type": "integer"
189
- },
190
- "site_name": {
191
- "type": "string"
192
- },
193
- "site_timezone": {
194
- "type": "string"
195
- },
196
- "sla_id": {
197
- "type": "integer"
198
- },
199
- "slaresponsestate": {
200
- "type": "string"
201
- },
202
- "source": {
203
- "type": "integer"
204
- },
205
- "starttime": {
206
- "type": "string"
207
- },
208
- "starttimeslot": {
209
- "type": "integer"
210
- },
211
- "status_id": {
212
- "type": "integer"
213
- },
214
13
  "summary": {
215
14
  "type": "string"
216
15
  },
217
- "supplier_status": {
218
- "type": "integer"
219
- },
220
- "table": {
221
- "type": "integer"
222
- },
223
16
  "targetdate": {
224
17
  "type": "string"
225
- },
226
- "targettime": {
227
- "type": "string"
228
- },
229
- "targettimeslot": {
230
- "type": "integer"
231
- },
232
- "team": {
233
- "type": "string"
234
- },
235
- "ticket_tags": {
236
- "type": "string"
237
- },
238
- "ticketage": {
239
- "type": "number"
240
- },
241
- "tickettype_id": {
242
- "type": "integer"
243
- },
244
- "updateservicestatus": {
245
- "type": "boolean"
246
- },
247
- "urgency": {
248
- "type": "integer"
249
- },
250
- "use": {
251
- "type": "string"
252
- },
253
- "useful_count": {
254
- "type": "integer"
255
- },
256
- "user_email": {
257
- "type": "string"
258
- },
259
- "user_id": {
260
- "type": "integer"
261
- },
262
- "user_name": {
263
- "type": "string"
264
- },
265
- "userdef1": {
266
- "type": "string"
267
- },
268
- "userdef2": {
269
- "type": "string"
270
- },
271
- "userdef3": {
272
- "type": "string"
273
- },
274
- "userdef4": {
275
- "type": "string"
276
- },
277
- "userdef5": {
278
- "type": "string"
279
- },
280
- "workflow_id": {
281
- "type": "integer"
282
- },
283
- "workflow_step": {
284
- "type": "integer"
285
18
  }
286
19
  },
287
- "version": 1
20
+ "version": 2
288
21
  }
@@ -36,7 +36,9 @@ var import_readability = require("@mozilla/readability");
36
36
  var cheerio = __toESM(require("cheerio"));
37
37
  var import_html_to_text = require("html-to-text");
38
38
  var import_jsdom = require("jsdom");
39
- var import_lodash = require("lodash");
39
+ var import_get = __toESM(require("lodash/get"));
40
+ var import_set = __toESM(require("lodash/set"));
41
+ var import_unset = __toESM(require("lodash/unset"));
40
42
  var import_n8n_workflow = require("n8n-workflow");
41
43
  function htmlOptimizer(ctx, itemIndex, maxLength) {
42
44
  const cssSelector = ctx.getNodeParameter("cssSelector", itemIndex, "");
@@ -172,7 +174,7 @@ const jsonOptimizer = (ctx, itemIndex) => {
172
174
  for (const item of responseData) {
173
175
  const newItem = {};
174
176
  for (const field of fields) {
175
- (0, import_lodash.set)(newItem, field, (0, import_lodash.get)(item, field));
177
+ (0, import_set.default)(newItem, field, (0, import_get.default)(item, field));
176
178
  }
177
179
  returnData.push(newItem);
178
180
  }
@@ -180,7 +182,7 @@ const jsonOptimizer = (ctx, itemIndex) => {
180
182
  if (fieldsToInclude === "except") {
181
183
  for (const item of responseData) {
182
184
  for (const field of fields) {
183
- (0, import_lodash.unset)(item, field);
185
+ (0, import_unset.default)(item, field);
184
186
  }
185
187
  returnData.push(item);
186
188
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/HttpRequest/shared/optimizeResponse.ts"],"sourcesContent":["import { Readability } from '@mozilla/readability';\nimport * as cheerio from 'cheerio';\nimport { convert } from 'html-to-text';\nimport { JSDOM } from 'jsdom';\nimport { get, set, unset } from 'lodash';\nimport {\n\ttype INodeProperties,\n\tjsonParse,\n\tNodeOperationError,\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n} from 'n8n-workflow';\n\ntype ResponseOptimizerFn = (\n\tx: IDataObject | IDataObject[] | string,\n) => IDataObject | IDataObject[] | string;\n\nfunction htmlOptimizer(\n\tctx: IExecuteFunctions,\n\titemIndex: number,\n\tmaxLength: number,\n): ResponseOptimizerFn {\n\tconst cssSelector = ctx.getNodeParameter('cssSelector', itemIndex, '') as string;\n\tconst onlyContent = ctx.getNodeParameter('onlyContent', itemIndex, false) as boolean;\n\tlet elementsToOmit: string[] = [];\n\n\tif (onlyContent) {\n\t\tconst elementsToOmitUi = ctx.getNodeParameter('elementsToOmit', itemIndex, '') as\n\t\t\t| string\n\t\t\t| string[];\n\n\t\tif (typeof elementsToOmitUi === 'string') {\n\t\t\telementsToOmit = elementsToOmitUi\n\t\t\t\t.split(',')\n\t\t\t\t.filter((s) => s)\n\t\t\t\t.map((s) => s.trim());\n\t\t}\n\t}\n\n\treturn (response) => {\n\t\tif (typeof response !== 'string') {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t`The response type must be a string. Received: ${typeof response}`,\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\t\tconst returnData: string[] = [];\n\n\t\tconst html = cheerio.load(response);\n\t\tconst htmlElements = html(cssSelector);\n\n\t\thtmlElements.each((_, el) => {\n\t\t\tlet value = html(el).html() || '';\n\n\t\t\tif (onlyContent) {\n\t\t\t\tlet htmlToTextOptions;\n\n\t\t\t\tif (elementsToOmit?.length) {\n\t\t\t\t\thtmlToTextOptions = {\n\t\t\t\t\t\tselectors: elementsToOmit.map((selector) => ({\n\t\t\t\t\t\t\tselector,\n\t\t\t\t\t\t\tformat: 'skip',\n\t\t\t\t\t\t})),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tvalue = convert(value, htmlToTextOptions);\n\t\t\t}\n\n\t\t\tvalue = value\n\t\t\t\t.trim()\n\t\t\t\t.replace(/^\\s+|\\s+$/g, '')\n\t\t\t\t.replace(/(\\r\\n|\\n|\\r)/gm, '')\n\t\t\t\t.replace(/\\s+/g, ' ');\n\n\t\t\treturnData.push(value);\n\t\t});\n\n\t\tconst text = JSON.stringify(returnData, null, 2);\n\n\t\tif (maxLength > 0 && text.length > maxLength) {\n\t\t\treturn text.substring(0, maxLength);\n\t\t}\n\n\t\treturn text;\n\t};\n}\n\nconst textOptimizer = (\n\tctx: IExecuteFunctions,\n\titemIndex: number,\n\tmaxLength: number,\n): ResponseOptimizerFn => {\n\treturn (response) => {\n\t\tif (typeof response === 'object') {\n\t\t\ttry {\n\t\t\t\tresponse = JSON.stringify(response, null, 2);\n\t\t\t} catch (error) {}\n\t\t}\n\n\t\tif (typeof response !== 'string') {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t`The response type must be a string. Received: ${typeof response}`,\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\n\t\tconst dom = new JSDOM(response);\n\t\tconst article = new Readability(dom.window.document, {\n\t\t\tkeepClasses: true,\n\t\t}).parse();\n\n\t\tconst text = article?.textContent || '';\n\n\t\tif (maxLength > 0 && text.length > maxLength) {\n\t\t\treturn text.substring(0, maxLength);\n\t\t}\n\n\t\treturn text;\n\t};\n};\n\nconst jsonOptimizer = (ctx: IExecuteFunctions, itemIndex: number): ResponseOptimizerFn => {\n\treturn (response) => {\n\t\tlet responseData: IDataObject | IDataObject[] | string | null = response;\n\n\t\tif (typeof response === 'string') {\n\t\t\ttry {\n\t\t\t\tresponseData = jsonParse(response, { errorMessage: 'Invalid JSON response' });\n\t\t\t} catch (error) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tctx.getNode(),\n\t\t\t\t\t`Received invalid JSON from response '${response}'`,\n\t\t\t\t\t{ itemIndex },\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (typeof responseData !== 'object' || !responseData) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t'The response type must be an object or an array of objects',\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\n\t\tconst dataField = ctx.getNodeParameter('dataField', itemIndex, '') as string;\n\t\tlet returnData: IDataObject[] = [];\n\n\t\tif (!Array.isArray(responseData)) {\n\t\t\tif (dataField) {\n\t\t\t\tif (!Object.prototype.hasOwnProperty.call(responseData, dataField)) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tctx.getNode(),\n\t\t\t\t\t\t`Target field \"${dataField}\" not found in response.`,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\tdescription: `The response contained these fields: [${Object.keys(responseData).join(', ')}]`,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst data = responseData[dataField] as IDataObject | IDataObject[];\n\n\t\t\t\tif (Array.isArray(data)) {\n\t\t\t\t\tresponseData = data;\n\t\t\t\t} else {\n\t\t\t\t\tresponseData = [data];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresponseData = [responseData];\n\t\t\t}\n\t\t} else {\n\t\t\tif (dataField) {\n\t\t\t\tresponseData = responseData.map((data) => data[dataField]) as IDataObject[];\n\t\t\t}\n\t\t}\n\n\t\tconst fieldsToInclude = ctx.getNodeParameter('fieldsToInclude', itemIndex, 'all') as\n\t\t\t| 'all'\n\t\t\t| 'selected'\n\t\t\t| 'except';\n\n\t\tlet fields: string | string[] = [];\n\n\t\tif (fieldsToInclude !== 'all') {\n\t\t\tfields = ctx.getNodeParameter('fields', itemIndex, []) as string[] | string;\n\n\t\t\tif (typeof fields === 'string') {\n\t\t\t\tfields = fields.split(',').map((field) => field.trim());\n\t\t\t}\n\t\t} else {\n\t\t\treturnData = responseData;\n\t\t}\n\n\t\tif (fieldsToInclude === 'selected') {\n\t\t\tfor (const item of responseData) {\n\t\t\t\tconst newItem: IDataObject = {};\n\n\t\t\t\tfor (const field of fields) {\n\t\t\t\t\tset(newItem, field, get(item, field));\n\t\t\t\t}\n\n\t\t\t\treturnData.push(newItem);\n\t\t\t}\n\t\t}\n\n\t\tif (fieldsToInclude === 'except') {\n\t\t\tfor (const item of responseData) {\n\t\t\t\tfor (const field of fields) {\n\t\t\t\t\tunset(item, field);\n\t\t\t\t}\n\n\t\t\t\treturnData.push(item);\n\t\t\t}\n\t\t}\n\n\t\treturn returnData;\n\t};\n};\n\nexport const configureResponseOptimizer = (\n\tctx: IExecuteFunctions,\n\titemIndex: number,\n): ResponseOptimizerFn => {\n\tconst optimizeResponse = ctx.getNodeParameter('optimizeResponse', itemIndex, false) as boolean;\n\n\tif (optimizeResponse) {\n\t\tconst responseType = ctx.getNodeParameter('responseType', itemIndex) as\n\t\t\t| 'json'\n\t\t\t| 'text'\n\t\t\t| 'html';\n\n\t\tlet maxLength = 0;\n\t\tconst truncateResponse = ctx.getNodeParameter('truncateResponse', itemIndex, false) as boolean;\n\n\t\tif (truncateResponse) {\n\t\t\tmaxLength = ctx.getNodeParameter('maxLength', itemIndex, 0) as number;\n\t\t}\n\n\t\tswitch (responseType) {\n\t\t\tcase 'html':\n\t\t\t\treturn htmlOptimizer(ctx, itemIndex, maxLength);\n\t\t\tcase 'text':\n\t\t\t\treturn textOptimizer(ctx, itemIndex, maxLength);\n\t\t\tcase 'json':\n\t\t\t\treturn jsonOptimizer(ctx, itemIndex);\n\t\t}\n\t}\n\n\treturn (x) => x;\n};\n\nexport const optimizeResponseProperties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Optimize Response',\n\t\tname: 'optimizeResponse',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdescription:\n\t\t\t'Whether the optimize the tool response to reduce amount of data passed to the LLM that could lead to better result and reduce cost',\n\t},\n\t{\n\t\tdisplayName: 'Expected Response Type',\n\t\tname: 'responseType',\n\t\ttype: 'options',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'JSON',\n\t\t\t\tvalue: 'json',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'HTML',\n\t\t\t\tvalue: 'html',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Text',\n\t\t\t\tvalue: 'text',\n\t\t\t},\n\t\t],\n\t\tdefault: 'json',\n\t},\n\t{\n\t\tdisplayName: 'Field Containing Data',\n\t\tname: 'dataField',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. records',\n\t\tdescription: 'Specify the name of the field in the response containing the data',\n\t\thint: 'leave blank to use whole response',\n\t\trequiresDataPath: 'single',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['json'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Include Fields',\n\t\tname: 'fieldsToInclude',\n\t\ttype: 'options',\n\t\tdescription: 'What fields response object should include',\n\t\tdefault: 'all',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['json'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'All',\n\t\t\t\tvalue: 'all',\n\t\t\t\tdescription: 'Include all fields',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Selected',\n\t\t\t\tvalue: 'selected',\n\t\t\t\tdescription: 'Include only fields specified below',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Except',\n\t\t\t\tvalue: 'except',\n\t\t\t\tdescription: 'Exclude fields specified below',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Fields',\n\t\tname: 'fields',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. field1,field2',\n\t\tdescription:\n\t\t\t'Comma-separated list of the field names. Supports dot notation. You can drag the selected fields from the input panel.',\n\t\trequiresDataPath: 'multiple',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['json'],\n\t\t\t},\n\t\t\thide: {\n\t\t\t\tfieldsToInclude: ['all'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Selector (CSS)',\n\t\tname: 'cssSelector',\n\t\ttype: 'string',\n\t\tdescription:\n\t\t\t'Select specific element(e.g. body) or multiple elements(e.g. div) of chosen type in the response HTML.',\n\t\tplaceholder: 'e.g. body',\n\t\tdefault: 'body',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['html'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Return Only Content',\n\t\tname: 'onlyContent',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to return only content of html elements, stripping html tags and attributes',\n\t\thint: 'Uses less tokens and may be easier for model to understand',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['html'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Elements To Omit',\n\t\tname: 'elementsToOmit',\n\t\ttype: 'string',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['html'],\n\t\t\t\tonlyContent: [true],\n\t\t\t},\n\t\t},\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. img, .className, #ItemId',\n\t\tdescription: 'Comma-separated list of selectors that would be excluded when extracting content',\n\t},\n\t{\n\t\tdisplayName: 'Truncate Response',\n\t\tname: 'truncateResponse',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\thint: 'Helps save tokens',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['text', 'html'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Max Response Characters',\n\t\tname: 'maxLength',\n\t\ttype: 'number',\n\t\tdefault: 1000,\n\t\ttypeOptions: {\n\t\t\tminValue: 1,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['text', 'html'],\n\t\t\t\ttruncateResponse: [true],\n\t\t\t},\n\t\t},\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAC5B,cAAyB;AACzB,0BAAwB;AACxB,m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QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,MAAM;AAAA,MACtB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD,MAAM;AAAA,IACN,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,MAAM;AAAA,MACtB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,MAAM;AAAA,QACrB,aAAa,CAAC,IAAI;AAAA,MACnB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,QAAQ,MAAM;AAAA,MAC9B;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,MACZ,UAAU;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,QAAQ,MAAM;AAAA,QAC7B,kBAAkB,CAAC,IAAI;AAAA,MACxB;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/HttpRequest/shared/optimizeResponse.ts"],"sourcesContent":["import { Readability } from '@mozilla/readability';\nimport * as cheerio from 'cheerio';\nimport { convert } from 'html-to-text';\nimport { JSDOM } from 'jsdom';\nimport get from 'lodash/get';\nimport set from 'lodash/set';\nimport unset from 'lodash/unset';\nimport {\n\ttype INodeProperties,\n\tjsonParse,\n\tNodeOperationError,\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n} from 'n8n-workflow';\n\ntype ResponseOptimizerFn = (\n\tx: IDataObject | IDataObject[] | string,\n) => IDataObject | IDataObject[] | string;\n\nfunction htmlOptimizer(\n\tctx: IExecuteFunctions,\n\titemIndex: number,\n\tmaxLength: number,\n): ResponseOptimizerFn {\n\tconst cssSelector = ctx.getNodeParameter('cssSelector', itemIndex, '') as string;\n\tconst onlyContent = ctx.getNodeParameter('onlyContent', itemIndex, false) as boolean;\n\tlet elementsToOmit: string[] = [];\n\n\tif (onlyContent) {\n\t\tconst elementsToOmitUi = ctx.getNodeParameter('elementsToOmit', itemIndex, '') as\n\t\t\t| string\n\t\t\t| string[];\n\n\t\tif (typeof elementsToOmitUi === 'string') {\n\t\t\telementsToOmit = elementsToOmitUi\n\t\t\t\t.split(',')\n\t\t\t\t.filter((s) => s)\n\t\t\t\t.map((s) => s.trim());\n\t\t}\n\t}\n\n\treturn (response) => {\n\t\tif (typeof response !== 'string') {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t`The response type must be a string. Received: ${typeof response}`,\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\t\tconst returnData: string[] = [];\n\n\t\tconst html = cheerio.load(response);\n\t\tconst htmlElements = html(cssSelector);\n\n\t\thtmlElements.each((_, el) => {\n\t\t\tlet value = html(el).html() || '';\n\n\t\t\tif (onlyContent) {\n\t\t\t\tlet htmlToTextOptions;\n\n\t\t\t\tif (elementsToOmit?.length) {\n\t\t\t\t\thtmlToTextOptions = {\n\t\t\t\t\t\tselectors: elementsToOmit.map((selector) => ({\n\t\t\t\t\t\t\tselector,\n\t\t\t\t\t\t\tformat: 'skip',\n\t\t\t\t\t\t})),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tvalue = convert(value, htmlToTextOptions);\n\t\t\t}\n\n\t\t\tvalue = value\n\t\t\t\t.trim()\n\t\t\t\t.replace(/^\\s+|\\s+$/g, '')\n\t\t\t\t.replace(/(\\r\\n|\\n|\\r)/gm, '')\n\t\t\t\t.replace(/\\s+/g, ' ');\n\n\t\t\treturnData.push(value);\n\t\t});\n\n\t\tconst text = JSON.stringify(returnData, null, 2);\n\n\t\tif (maxLength > 0 && text.length > maxLength) {\n\t\t\treturn text.substring(0, maxLength);\n\t\t}\n\n\t\treturn text;\n\t};\n}\n\nconst textOptimizer = (\n\tctx: IExecuteFunctions,\n\titemIndex: number,\n\tmaxLength: number,\n): ResponseOptimizerFn => {\n\treturn (response) => {\n\t\tif (typeof response === 'object') {\n\t\t\ttry {\n\t\t\t\tresponse = JSON.stringify(response, null, 2);\n\t\t\t} catch (error) {}\n\t\t}\n\n\t\tif (typeof response !== 'string') {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t`The response type must be a string. Received: ${typeof response}`,\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\n\t\tconst dom = new JSDOM(response);\n\t\tconst article = new Readability(dom.window.document, {\n\t\t\tkeepClasses: true,\n\t\t}).parse();\n\n\t\tconst text = article?.textContent || '';\n\n\t\tif (maxLength > 0 && text.length > maxLength) {\n\t\t\treturn text.substring(0, maxLength);\n\t\t}\n\n\t\treturn text;\n\t};\n};\n\nconst jsonOptimizer = (ctx: IExecuteFunctions, itemIndex: number): ResponseOptimizerFn => {\n\treturn (response) => {\n\t\tlet responseData: IDataObject | IDataObject[] | string | null = response;\n\n\t\tif (typeof response === 'string') {\n\t\t\ttry {\n\t\t\t\tresponseData = jsonParse(response, { errorMessage: 'Invalid JSON response' });\n\t\t\t} catch (error) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tctx.getNode(),\n\t\t\t\t\t`Received invalid JSON from response '${response}'`,\n\t\t\t\t\t{ itemIndex },\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (typeof responseData !== 'object' || !responseData) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t'The response type must be an object or an array of objects',\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\n\t\tconst dataField = ctx.getNodeParameter('dataField', itemIndex, '') as string;\n\t\tlet returnData: IDataObject[] = [];\n\n\t\tif (!Array.isArray(responseData)) {\n\t\t\tif (dataField) {\n\t\t\t\tif (!Object.prototype.hasOwnProperty.call(responseData, dataField)) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tctx.getNode(),\n\t\t\t\t\t\t`Target field \"${dataField}\" not found in response.`,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\tdescription: `The response contained these fields: [${Object.keys(responseData).join(', ')}]`,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst data = responseData[dataField] as IDataObject | IDataObject[];\n\n\t\t\t\tif (Array.isArray(data)) {\n\t\t\t\t\tresponseData = data;\n\t\t\t\t} else {\n\t\t\t\t\tresponseData = [data];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresponseData = [responseData];\n\t\t\t}\n\t\t} else {\n\t\t\tif (dataField) {\n\t\t\t\tresponseData = responseData.map((data) => data[dataField]) as IDataObject[];\n\t\t\t}\n\t\t}\n\n\t\tconst fieldsToInclude = ctx.getNodeParameter('fieldsToInclude', itemIndex, 'all') as\n\t\t\t| 'all'\n\t\t\t| 'selected'\n\t\t\t| 'except';\n\n\t\tlet fields: string | string[] = [];\n\n\t\tif (fieldsToInclude !== 'all') {\n\t\t\tfields = ctx.getNodeParameter('fields', itemIndex, []) as string[] | string;\n\n\t\t\tif (typeof fields === 'string') {\n\t\t\t\tfields = fields.split(',').map((field) => field.trim());\n\t\t\t}\n\t\t} else {\n\t\t\treturnData = responseData;\n\t\t}\n\n\t\tif (fieldsToInclude === 'selected') {\n\t\t\tfor (const item of responseData) {\n\t\t\t\tconst newItem: IDataObject = {};\n\n\t\t\t\tfor (const field of fields) {\n\t\t\t\t\tset(newItem, field, get(item, field));\n\t\t\t\t}\n\n\t\t\t\treturnData.push(newItem);\n\t\t\t}\n\t\t}\n\n\t\tif (fieldsToInclude === 'except') {\n\t\t\tfor (const item of responseData) {\n\t\t\t\tfor (const field of fields) {\n\t\t\t\t\tunset(item, field);\n\t\t\t\t}\n\n\t\t\t\treturnData.push(item);\n\t\t\t}\n\t\t}\n\n\t\treturn returnData;\n\t};\n};\n\nexport const configureResponseOptimizer = (\n\tctx: IExecuteFunctions,\n\titemIndex: number,\n): ResponseOptimizerFn => {\n\tconst optimizeResponse = ctx.getNodeParameter('optimizeResponse', itemIndex, false) as boolean;\n\n\tif (optimizeResponse) {\n\t\tconst responseType = ctx.getNodeParameter('responseType', itemIndex) as\n\t\t\t| 'json'\n\t\t\t| 'text'\n\t\t\t| 'html';\n\n\t\tlet maxLength = 0;\n\t\tconst truncateResponse = ctx.getNodeParameter('truncateResponse', itemIndex, false) as boolean;\n\n\t\tif (truncateResponse) {\n\t\t\tmaxLength = ctx.getNodeParameter('maxLength', itemIndex, 0) as number;\n\t\t}\n\n\t\tswitch (responseType) {\n\t\t\tcase 'html':\n\t\t\t\treturn htmlOptimizer(ctx, itemIndex, maxLength);\n\t\t\tcase 'text':\n\t\t\t\treturn textOptimizer(ctx, itemIndex, maxLength);\n\t\t\tcase 'json':\n\t\t\t\treturn jsonOptimizer(ctx, itemIndex);\n\t\t}\n\t}\n\n\treturn (x) => x;\n};\n\nexport const optimizeResponseProperties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Optimize Response',\n\t\tname: 'optimizeResponse',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdescription:\n\t\t\t'Whether the optimize the tool response to reduce amount of data passed to the LLM that could lead to better result and reduce cost',\n\t},\n\t{\n\t\tdisplayName: 'Expected Response Type',\n\t\tname: 'responseType',\n\t\ttype: 'options',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'JSON',\n\t\t\t\tvalue: 'json',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'HTML',\n\t\t\t\tvalue: 'html',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Text',\n\t\t\t\tvalue: 'text',\n\t\t\t},\n\t\t],\n\t\tdefault: 'json',\n\t},\n\t{\n\t\tdisplayName: 'Field Containing Data',\n\t\tname: 'dataField',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. records',\n\t\tdescription: 'Specify the name of the field in the response containing the data',\n\t\thint: 'leave blank to use whole response',\n\t\trequiresDataPath: 'single',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['json'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Include Fields',\n\t\tname: 'fieldsToInclude',\n\t\ttype: 'options',\n\t\tdescription: 'What fields response object should include',\n\t\tdefault: 'all',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['json'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'All',\n\t\t\t\tvalue: 'all',\n\t\t\t\tdescription: 'Include all fields',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Selected',\n\t\t\t\tvalue: 'selected',\n\t\t\t\tdescription: 'Include only fields specified below',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Except',\n\t\t\t\tvalue: 'except',\n\t\t\t\tdescription: 'Exclude fields specified below',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Fields',\n\t\tname: 'fields',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. field1,field2',\n\t\tdescription:\n\t\t\t'Comma-separated list of the field names. Supports dot notation. You can drag the selected fields from the input panel.',\n\t\trequiresDataPath: 'multiple',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['json'],\n\t\t\t},\n\t\t\thide: {\n\t\t\t\tfieldsToInclude: ['all'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Selector (CSS)',\n\t\tname: 'cssSelector',\n\t\ttype: 'string',\n\t\tdescription:\n\t\t\t'Select specific element(e.g. body) or multiple elements(e.g. div) of chosen type in the response HTML.',\n\t\tplaceholder: 'e.g. body',\n\t\tdefault: 'body',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['html'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Return Only Content',\n\t\tname: 'onlyContent',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to return only content of html elements, stripping html tags and attributes',\n\t\thint: 'Uses less tokens and may be easier for model to understand',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['html'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Elements To Omit',\n\t\tname: 'elementsToOmit',\n\t\ttype: 'string',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['html'],\n\t\t\t\tonlyContent: [true],\n\t\t\t},\n\t\t},\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. img, .className, #ItemId',\n\t\tdescription: 'Comma-separated list of selectors that would be excluded when extracting content',\n\t},\n\t{\n\t\tdisplayName: 'Truncate Response',\n\t\tname: 'truncateResponse',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\thint: 'Helps save tokens',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['text', 'html'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Max Response Characters',\n\t\tname: 'maxLength',\n\t\ttype: 'number',\n\t\tdefault: 1000,\n\t\ttypeOptions: {\n\t\t\tminValue: 1,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['text', 'html'],\n\t\t\t\ttruncateResponse: [true],\n\t\t\t},\n\t\t},\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAC5B,cAAyB;AACzB,0BAAwB;AACxB,mBAAsB;AACtB,iBAAgB;AAChB,iBAAgB;AAChB,mBAAkB;AAClB,0BAMO;AAMP,SAAS,cACR,KACA,WACA,WACsB;AACtB,QAAM,cAAc,IAAI,iBAAiB,eAAe,WAAW,EAAE;AACrE,QAAM,cAAc,IAAI,iBAAiB,eAAe,WAAW,KAAK;AACxE,MAAI,iBAA2B,CAAC;AAEhC,MAAI,aAAa;AAChB,UAAM,mBAAmB,IAAI,iBAAiB,kBAAkB,WAAW,EAAE;AAI7E,QAAI,OAAO,qBAAqB,UAAU;AACzC,uBAAiB,iBACf,MAAM,GAAG,EACT,OAAO,CAAC,MAAM,CAAC,EACf,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;AAAA,IACtB;AAAA,EACD;AAEA,SAAO,CAAC,aAAa;AACpB,QAAI,OAAO,aAAa,UAAU;AACjC,YAAM,IAAI;AAAA,QACT,IAAI,QAAQ;AAAA,QACZ,iDAAiD,OAAO,QAAQ;AAAA,QAChE,EAAE,UAAU;AAAA,MACb;AAAA,IACD;AACA,UAAM,aAAuB,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d;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,QAAQ,MAAM;AAAA,MAC9B;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,MACZ,UAAU;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,QAAQ,MAAM;AAAA,QAC7B,kBAAkB,CAAC,IAAI;AAAA,MACxB;AAAA,IACD;AAAA,EACD;AACD;","names":["set","get","unset"]}
@@ -45,9 +45,6 @@
45
45
  "timestamp": {
46
46
  "type": "integer"
47
47
  },
48
- "updatedByUserId": {
49
- "type": "integer"
50
- },
51
48
  "useTimestampAsPersistenceTimestamp": {
52
49
  "type": "boolean"
53
50
  },
@@ -76,5 +73,5 @@
76
73
  }
77
74
  }
78
75
  },
79
- "version": 3
76
+ "version": 4
80
77
  }
@@ -14,6 +14,49 @@
14
14
  "type": "object",
15
15
  "properties": {
16
16
  "dealname": {
17
+ "type": "object",
18
+ "properties": {
19
+ "source": {
20
+ "type": "string"
21
+ },
22
+ "timestamp": {
23
+ "type": "integer"
24
+ },
25
+ "value": {
26
+ "type": "string"
27
+ },
28
+ "versions": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "object",
32
+ "properties": {
33
+ "name": {
34
+ "type": "string"
35
+ },
36
+ "requestId": {
37
+ "type": "string"
38
+ },
39
+ "source": {
40
+ "type": "string"
41
+ },
42
+ "sourceId": {
43
+ "type": "string"
44
+ },
45
+ "timestamp": {
46
+ "type": "integer"
47
+ },
48
+ "updatedByUserId": {
49
+ "type": "integer"
50
+ },
51
+ "value": {
52
+ "type": "string"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "dealstage": {
17
60
  "type": "object",
18
61
  "properties": {
19
62
  "source": {
@@ -36,6 +79,9 @@
36
79
  "name": {
37
80
  "type": "string"
38
81
  },
82
+ "requestId": {
83
+ "type": "string"
84
+ },
39
85
  "source": {
40
86
  "type": "string"
41
87
  },
@@ -48,6 +94,9 @@
48
94
  "updatedByUserId": {
49
95
  "type": "integer"
50
96
  },
97
+ "useTimestampAsPersistenceTimestamp": {
98
+ "type": "boolean"
99
+ },
51
100
  "value": {
52
101
  "type": "string"
53
102
  }
@@ -57,7 +106,21 @@
57
106
  }
58
107
  }
59
108
  }
109
+ },
110
+ "stateChanges": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "object",
114
+ "properties": {
115
+ "changeFlag": {
116
+ "type": "string"
117
+ },
118
+ "timestamp": {
119
+ "type": "integer"
120
+ }
121
+ }
122
+ }
60
123
  }
61
124
  },
62
- "version": 3
125
+ "version": 4
63
126
  }
@@ -16,9 +16,6 @@
16
16
  "createdate": {
17
17
  "type": "string"
18
18
  },
19
- "dealname": {
20
- "type": "string"
21
- },
22
19
  "hs_lastmodifieddate": {
23
20
  "type": "string"
24
21
  },
@@ -31,5 +28,5 @@
31
28
  "type": "string"
32
29
  }
33
30
  },
34
- "version": 3
31
+ "version": 4
35
32
  }
@@ -12,67 +12,7 @@
12
12
  },
13
13
  "portalId": {
14
14
  "type": "integer"
15
- },
16
- "properties": {
17
- "type": "object",
18
- "properties": {
19
- "subject": {
20
- "type": "object",
21
- "properties": {
22
- "persistenceTimestamp": {
23
- "type": "integer"
24
- },
25
- "sensitivityLevel": {
26
- "type": "string"
27
- },
28
- "source": {
29
- "type": "string"
30
- },
31
- "timestamp": {
32
- "type": "integer"
33
- },
34
- "value": {
35
- "type": "string"
36
- },
37
- "versions": {
38
- "type": "array",
39
- "items": {
40
- "type": "object",
41
- "properties": {
42
- "name": {
43
- "type": "string"
44
- },
45
- "persistenceTimestamp": {
46
- "type": "integer"
47
- },
48
- "requestId": {
49
- "type": "string"
50
- },
51
- "source": {
52
- "type": "string"
53
- },
54
- "sourceId": {
55
- "type": "string"
56
- },
57
- "sourceVid": {
58
- "type": "array",
59
- "items": {
60
- "type": "integer"
61
- }
62
- },
63
- "timestamp": {
64
- "type": "integer"
65
- },
66
- "value": {
67
- "type": "string"
68
- }
69
- }
70
- }
71
- }
72
- }
73
- }
74
- }
75
15
  }
76
16
  },
77
- "version": 3
17
+ "version": 4
78
18
  }
@@ -0,0 +1,26 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "content": {
5
+ "type": "string"
6
+ },
7
+ "description": {
8
+ "type": "string"
9
+ },
10
+ "title": {
11
+ "type": "string"
12
+ },
13
+ "url": {
14
+ "type": "string"
15
+ },
16
+ "usage": {
17
+ "type": "object",
18
+ "properties": {
19
+ "tokens": {
20
+ "type": "integer"
21
+ }
22
+ }
23
+ }
24
+ },
25
+ "version": 1
26
+ }