paperclip-github-plugin 0.15.5 → 0.15.7

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/worker.js CHANGED
@@ -17275,11 +17275,14 @@ var plugin = definePlugin({
17275
17275
  const saved = await ctx.state.get(SETTINGS_SCOPE);
17276
17276
  const importRegistry = normalizeImportRegistry(await ctx.state.get(IMPORT_REGISTRY_SCOPE));
17277
17277
  const normalizedSettings = normalizeSettings(saved);
17278
- const config = await getResolvedConfig(ctx);
17278
+ const [config, trustedConfig] = await Promise.all([
17279
+ getResolvedConfig(ctx),
17280
+ ctx.config.get().then((value) => normalizeConfig(value))
17281
+ ]);
17279
17282
  const githubTokenConfigured = hasConfiguredGithubToken(normalizedSettings, config, requestedCompanyId);
17280
- const configuredGitHubTokenRef = getConfiguredGitHubTokenRef(config, requestedCompanyId);
17283
+ const configuredGitHubTokenRef = getConfiguredGitHubTokenRef(trustedConfig, requestedCompanyId);
17281
17284
  const savedGitHubTokenRef = getSavedGitHubTokenRef(normalizedSettings, requestedCompanyId);
17282
- const configuredBoardTokenRef = getConfiguredPaperclipBoardApiTokenRef(config, requestedCompanyId);
17285
+ const configuredBoardTokenRef = getConfiguredPaperclipBoardApiTokenRef(trustedConfig, requestedCompanyId);
17283
17286
  const savedBoardTokenRef = getSavedPaperclipBoardApiTokenRef(normalizedSettings, requestedCompanyId);
17284
17287
  const settingsForResponse = sanitizeSettingsForCurrentSetup(
17285
17288
  materializeScopedSettings(normalizedSettings, config, requestedCompanyId),
@@ -17303,7 +17306,9 @@ var plugin = definePlugin({
17303
17306
  ...savedGitHubTokenRef ? { githubTokenConfigSyncRef: savedGitHubTokenRef } : {},
17304
17307
  githubTokenNeedsConfigSync: Boolean(savedGitHubTokenRef && configuredGitHubTokenRef !== savedGitHubTokenRef),
17305
17308
  ...savedBoardTokenRef ? { paperclipBoardAccessConfigSyncRef: savedBoardTokenRef } : {},
17306
- paperclipBoardAccessNeedsConfigSync: Boolean(savedBoardTokenRef && !configuredBoardTokenRef)
17309
+ paperclipBoardAccessNeedsConfigSync: Boolean(
17310
+ savedBoardTokenRef && configuredBoardTokenRef !== savedBoardTokenRef
17311
+ )
17307
17312
  };
17308
17313
  });
17309
17314
  ctx.data.register("dashboard.metrics", async (input) => {
@@ -17507,7 +17512,9 @@ var plugin = definePlugin({
17507
17512
  throw new Error("A company id is required to update Paperclip board access.");
17508
17513
  }
17509
17514
  const nextSecretRef = normalizeSecretRef(record.paperclipBoardApiTokenRef);
17510
- const nextBoardApiToken = normalizeGitHubToken(record.paperclipBoardApiToken);
17515
+ const boardAccessRecord = record.paperclipBoardAccess && typeof record.paperclipBoardAccess === "object" ? record.paperclipBoardAccess : {};
17516
+ const boardAuthorizationRecord = boardAccessRecord.authorization && typeof boardAccessRecord.authorization === "object" ? boardAccessRecord.authorization : {};
17517
+ const nextBoardApiToken = normalizeGitHubToken(record.paperclipBoardApiToken) ?? normalizeGitHubToken(boardAuthorizationRecord.bearer);
17511
17518
  const nextPaperclipBoardApiTokenRefs = {
17512
17519
  ...previous.paperclipBoardApiTokenRefs ?? {}
17513
17520
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperclip-github-plugin",
3
- "version": "0.15.5",
3
+ "version": "0.15.7",
4
4
  "description": "Paperclip plugin for synchronizing GitHub issues into Paperclip projects.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",