@defend-tech/opencode-optima 0.1.10 → 0.1.12
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/index.js +9 -2
- package/dist/sanitize_cli.js +9 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9035,7 +9035,13 @@ async function ensureClickUpWebhookSubscription({ validation, worktree, clickupC
|
|
|
9035
9035
|
});
|
|
9036
9036
|
const createdState = normalizeClickUpWebhookApiResponse(created, config);
|
|
9037
9037
|
const stateForValidation = { ...createdState, recentEventKeys: existing.recentEventKeys || [] };
|
|
9038
|
-
|
|
9038
|
+
let createdValidation = await validateClickUpWebhookState(stateForValidation, config, clickupClient?.listWebhooks ? clickupClient : null);
|
|
9039
|
+
if (!createdValidation.valid && createdValidation.reason === "remote_state_missing") {
|
|
9040
|
+
const localCreatedValidation = await validateClickUpWebhookState(stateForValidation, config, null);
|
|
9041
|
+
if (localCreatedValidation.valid) {
|
|
9042
|
+
createdValidation = { ...localCreatedValidation, mode: "created_pending_remote_validation", limitation: "ClickUp webhook created from API response; remote list validation had not propagated yet." };
|
|
9043
|
+
}
|
|
9044
|
+
}
|
|
9039
9045
|
if (!createdValidation.valid) {
|
|
9040
9046
|
if (stateForValidation.webhookId && clickupClient?.deleteWebhook) {
|
|
9041
9047
|
try {
|
|
@@ -9046,7 +9052,8 @@ async function ensureClickUpWebhookSubscription({ validation, worktree, clickupC
|
|
|
9046
9052
|
return { active: false, valid: false, reason: "created_state_invalid", validation: createdValidation, state: stateForValidation };
|
|
9047
9053
|
}
|
|
9048
9054
|
const next = writeClickUpWebhookState(worktree, createdValidation.state || stateForValidation, config);
|
|
9049
|
-
|
|
9055
|
+
const mode = createdValidation.mode === "created_pending_remote_validation" ? "created_pending_remote_validation" : clickupClient?.listWebhooks ? "created_remote_validated" : "created";
|
|
9056
|
+
return { active: true, valid: true, mode, limitation: createdValidation.limitation, state: next };
|
|
9050
9057
|
}
|
|
9051
9058
|
function verifyClickUpSignature(rawBody, signatureHeader, secret) {
|
|
9052
9059
|
const signature = String(signatureHeader || "").replace(/^sha256=/i, "").trim();
|
package/dist/sanitize_cli.js
CHANGED
|
@@ -9042,7 +9042,13 @@ async function ensureClickUpWebhookSubscription({ validation, worktree, clickupC
|
|
|
9042
9042
|
});
|
|
9043
9043
|
const createdState = normalizeClickUpWebhookApiResponse(created, config);
|
|
9044
9044
|
const stateForValidation = { ...createdState, recentEventKeys: existing.recentEventKeys || [] };
|
|
9045
|
-
|
|
9045
|
+
let createdValidation = await validateClickUpWebhookState(stateForValidation, config, clickupClient?.listWebhooks ? clickupClient : null);
|
|
9046
|
+
if (!createdValidation.valid && createdValidation.reason === "remote_state_missing") {
|
|
9047
|
+
const localCreatedValidation = await validateClickUpWebhookState(stateForValidation, config, null);
|
|
9048
|
+
if (localCreatedValidation.valid) {
|
|
9049
|
+
createdValidation = { ...localCreatedValidation, mode: "created_pending_remote_validation", limitation: "ClickUp webhook created from API response; remote list validation had not propagated yet." };
|
|
9050
|
+
}
|
|
9051
|
+
}
|
|
9046
9052
|
if (!createdValidation.valid) {
|
|
9047
9053
|
if (stateForValidation.webhookId && clickupClient?.deleteWebhook) {
|
|
9048
9054
|
try {
|
|
@@ -9053,7 +9059,8 @@ async function ensureClickUpWebhookSubscription({ validation, worktree, clickupC
|
|
|
9053
9059
|
return { active: false, valid: false, reason: "created_state_invalid", validation: createdValidation, state: stateForValidation };
|
|
9054
9060
|
}
|
|
9055
9061
|
const next = writeClickUpWebhookState(worktree, createdValidation.state || stateForValidation, config);
|
|
9056
|
-
|
|
9062
|
+
const mode = createdValidation.mode === "created_pending_remote_validation" ? "created_pending_remote_validation" : clickupClient?.listWebhooks ? "created_remote_validated" : "created";
|
|
9063
|
+
return { active: true, valid: true, mode, limitation: createdValidation.limitation, state: next };
|
|
9057
9064
|
}
|
|
9058
9065
|
function verifyClickUpSignature(rawBody, signatureHeader, secret) {
|
|
9059
9066
|
const signature = String(signatureHeader || "").replace(/^sha256=/i, "").trim();
|