doc2vec 2.10.1 → 2.10.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.
package/README.md CHANGED
@@ -219,6 +219,7 @@ Configuration is managed through two files:
219
219
  * `ticket_status`: (Optional) Filter tickets by status (defaults to `['new', 'open', 'pending', 'hold', 'solved']`).
220
220
  * `ticket_priority`: (Optional) Filter tickets by priority (defaults to all priorities).
221
221
  * `excluded_organizations`: (Optional) An array of Zendesk organization names whose tickets should be skipped. The sync will abort if any name cannot be resolved.
222
+ * `include_internal_comments`: (Optional) Include non-public (internal/agent-only) comments in the indexed content (defaults to `false`, i.e. only public comments are indexed). Internal comments are labeled `(internal)` in the generated markdown.
222
223
 
223
224
  For S3 buckets (`type: 's3'`):
224
225
  * `bucket`: The S3 bucket name.
package/dist/doc2vec.js CHANGED
@@ -1245,13 +1245,16 @@ class Doc2Vec {
1245
1245
  if (comments && comments.length > 0) {
1246
1246
  md += `## Comments\n\n`;
1247
1247
  for (const comment of comments) {
1248
- if (comment.public) {
1249
- md += `### ${comment.author_id} - ${new Date(comment.created_at).toDateString()}\n\n`;
1250
- // Handle comment body
1251
- const rawBody = comment.plain_body || comment.html_body || comment.body || '';
1252
- const commentBody = rawBody.replace(/ /g, " ") || '_No content._';
1253
- md += `${commentBody}\n\n---\n\n`;
1248
+ // Skip non-public comments unless internal comments are explicitly enabled
1249
+ if (!comment.public && !config.include_internal_comments) {
1250
+ continue;
1254
1251
  }
1252
+ const visibility = comment.public ? '' : ' (internal)';
1253
+ md += `### ${comment.author_id} - ${new Date(comment.created_at).toDateString()}${visibility}\n\n`;
1254
+ // Handle comment body
1255
+ const rawBody = comment.plain_body || comment.html_body || comment.body || '';
1256
+ const commentBody = rawBody.replace(/ /g, " ") || '_No content._';
1257
+ md += `${commentBody}\n\n---\n\n`;
1255
1258
  }
1256
1259
  }
1257
1260
  else {
@@ -1284,10 +1287,18 @@ class Doc2Vec {
1284
1287
  return;
1285
1288
  }
1286
1289
  logger.info(`Processing ticket #${ticketId}`);
1287
- // Fetch ticket comments
1288
- const commentsUrl = `${baseUrl}/tickets/${ticketId}/comments.json`;
1289
- const commentsData = await fetchWithRetry(commentsUrl);
1290
- const comments = commentsData?.comments || [];
1290
+ // Fetch ticket comments. Zendesk returns at most 100 comments per page
1291
+ // (ordered oldest-first), so follow next_page to capture the newest
1292
+ // comments on tickets with more than 100 — otherwise they're silently dropped.
1293
+ const comments = [];
1294
+ let commentsUrl = `${baseUrl}/tickets/${ticketId}/comments.json`;
1295
+ while (commentsUrl) {
1296
+ const commentsData = await fetchWithRetry(commentsUrl);
1297
+ comments.push(...(commentsData?.comments || []));
1298
+ commentsUrl = commentsData?.next_page || null;
1299
+ if (commentsUrl)
1300
+ await new Promise(res => setTimeout(res, 1000));
1301
+ }
1291
1302
  // Generate markdown for the ticket
1292
1303
  const markdown = generateMarkdownForTicket(ticket, comments);
1293
1304
  // Chunk the markdown content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doc2vec",
3
- "version": "2.10.1",
3
+ "version": "2.10.2",
4
4
  "type": "commonjs",
5
5
  "description": "",
6
6
  "main": "dist/doc2vec.js",