paperclip-github-plugin 0.3.2 → 0.3.3

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/dist/manifest.js CHANGED
@@ -435,7 +435,7 @@ var require2 = createRequire(import.meta.url);
435
435
  var packageJson = require2("../package.json");
436
436
  var DASHBOARD_WIDGET_CAPABILITY = "ui.dashboardWidget.register";
437
437
  var SCHEDULE_TICK_CRON = "* * * * *";
438
- var MANIFEST_VERSION = "0.3.2"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
438
+ var MANIFEST_VERSION = "0.3.3"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
439
439
  var manifest = {
440
440
  id: "paperclip-github-plugin",
441
441
  apiVersion: 1,
package/dist/worker.js CHANGED
@@ -1157,6 +1157,9 @@ function createMappingId(index) {
1157
1157
  function normalizeOptionalString2(value) {
1158
1158
  return typeof value === "string" && value.trim() ? value.trim() : void 0;
1159
1159
  }
1160
+ function stripNullBytes(value) {
1161
+ return value.replace(/\u0000/g, "");
1162
+ }
1160
1163
  function getErrorStatus(error) {
1161
1164
  if (!error || typeof error !== "object" || !("status" in error)) {
1162
1165
  return void 0;
@@ -1419,7 +1422,11 @@ function normalizeSecretRef(value) {
1419
1422
  return typeof value === "string" && value.trim() ? value.trim() : void 0;
1420
1423
  }
1421
1424
  function normalizeGitHubUserLogin(value) {
1422
- return typeof value === "string" && value.trim() ? value.trim().toLowerCase() : void 0;
1425
+ if (typeof value !== "string") {
1426
+ return void 0;
1427
+ }
1428
+ const trimmed = stripNullBytes(value).trim();
1429
+ return trimmed ? trimmed.toLowerCase() : void 0;
1423
1430
  }
1424
1431
  function normalizeGitHubTokenRef(value) {
1425
1432
  return normalizeSecretRef(value);
@@ -2839,7 +2846,7 @@ function normalizeGitHubUsername(value) {
2839
2846
  if (typeof value !== "string") {
2840
2847
  return void 0;
2841
2848
  }
2842
- const trimmed = value.trim().replace(/^@+/, "");
2849
+ const trimmed = stripNullBytes(value).trim().replace(/^@+/, "");
2843
2850
  return trimmed ? trimmed.toLowerCase() : void 0;
2844
2851
  }
2845
2852
  function buildGitHubUsernameAliases(value) {
@@ -3126,7 +3133,7 @@ function normalizeGitHubIssueLabels(value) {
3126
3133
  const seen = /* @__PURE__ */ new Set();
3127
3134
  const labels = [];
3128
3135
  for (const entry of value) {
3129
- const name = typeof entry === "string" ? entry.trim() : entry && typeof entry === "object" && typeof entry.name === "string" ? entry.name.trim() : "";
3136
+ const name = typeof entry === "string" ? stripNullBytes(entry).trim() : entry && typeof entry === "object" && typeof entry.name === "string" ? stripNullBytes(entry.name).trim() : "";
3130
3137
  if (!name) {
3131
3138
  continue;
3132
3139
  }
@@ -3146,8 +3153,8 @@ function normalizeGitHubIssueRecord(issue) {
3146
3153
  return {
3147
3154
  id: issue.id,
3148
3155
  number: issue.number,
3149
- title: issue.title,
3150
- body: issue.body ?? null,
3156
+ title: stripNullBytes(issue.title),
3157
+ body: typeof issue.body === "string" ? stripNullBytes(issue.body) : null,
3151
3158
  htmlUrl: issue.html_url,
3152
3159
  ...normalizeGitHubUsername(issue.user?.login) ? { authorLogin: normalizeGitHubUsername(issue.user?.login) } : {},
3153
3160
  labels: normalizeGitHubIssueLabels(issue.labels),
@@ -3978,7 +3985,7 @@ async function listNewGitHubIssueCommentsSinceCount(octokit, repository, issueNu
3978
3985
  for (const comment of response.data.slice(remainingOffset)) {
3979
3986
  comments.push({
3980
3987
  id: comment.id,
3981
- body: comment.body ?? "",
3988
+ body: typeof comment.body === "string" ? stripNullBytes(comment.body) : "",
3982
3989
  url: comment.html_url ?? void 0,
3983
3990
  authorLogin: normalizeGitHubUserLogin(comment.user?.login),
3984
3991
  createdAt: comment.created_at ?? void 0,
@@ -4179,7 +4186,7 @@ function normalizeGitHubIssueBodyForPaperclip(body) {
4179
4186
  if (typeof body !== "string") {
4180
4187
  return void 0;
4181
4188
  }
4182
- const trimmed = body.trim();
4189
+ const trimmed = stripNullBytes(body).trim();
4183
4190
  if (!trimmed) {
4184
4191
  return void 0;
4185
4192
  }
@@ -6405,7 +6412,7 @@ async function listAllGitHubIssueComments(octokit, repository, issueNumber) {
6405
6412
  for (const comment of response.data) {
6406
6413
  comments.push({
6407
6414
  id: comment.id,
6408
- body: comment.body ?? "",
6415
+ body: typeof comment.body === "string" ? stripNullBytes(comment.body) : "",
6409
6416
  url: comment.html_url ?? void 0,
6410
6417
  authorLogin: normalizeGitHubUserLogin(comment.user?.login),
6411
6418
  authorUrl: comment.user?.html_url ?? void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperclip-github-plugin",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Paperclip plugin for synchronizing GitHub issues into Paperclip projects.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",