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/manifest.js +1 -1
- package/dist/ui/index.js +5 -1
- package/dist/ui/index.js.map +2 -2
- package/dist/worker.js +12 -5
- package/package.json +1 -1
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
|
|
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(
|
|
17283
|
+
const configuredGitHubTokenRef = getConfiguredGitHubTokenRef(trustedConfig, requestedCompanyId);
|
|
17281
17284
|
const savedGitHubTokenRef = getSavedGitHubTokenRef(normalizedSettings, requestedCompanyId);
|
|
17282
|
-
const configuredBoardTokenRef = getConfiguredPaperclipBoardApiTokenRef(
|
|
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(
|
|
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
|
|
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
|
};
|