opencode-gitlab-dap 1.15.8 → 1.15.9

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 CHANGED
@@ -3926,11 +3926,12 @@ async function readIndex(instanceUrl, token, scope, id, indexSlug) {
3926
3926
  }
3927
3927
  }
3928
3928
  async function writeIndex(instanceUrl, token, scope, id, indexSlug, entries) {
3929
- const content = formatIndex(entries);
3929
+ const content = formatIndex(entries) || "# Skills Index";
3930
3930
  try {
3931
3931
  await updateWikiPage(instanceUrl, token, scope, id, indexSlug, content);
3932
- } catch {
3933
- await createWikiPage(instanceUrl, token, scope, id, indexSlug, content || "# Skills Index");
3932
+ } catch (updateErr) {
3933
+ if (!updateErr.message?.includes("404")) throw updateErr;
3934
+ await createWikiPage(instanceUrl, token, scope, id, indexSlug, content);
3934
3935
  }
3935
3936
  }
3936
3937
  async function upsertIndexEntry(instanceUrl, token, scope, id, indexSlug, entry) {
@@ -3953,7 +3954,8 @@ async function removeIndexEntry(instanceUrl, token, scope, id, indexSlug, name)
3953
3954
  async function upsertPage(instanceUrl, token, scope, id, slug, content) {
3954
3955
  try {
3955
3956
  await updateWikiPage(instanceUrl, token, scope, id, slug, content);
3956
- } catch {
3957
+ } catch (updateErr) {
3958
+ if (!updateErr.message?.includes("404")) throw updateErr;
3957
3959
  await createWikiPage(instanceUrl, token, scope, id, slug, content);
3958
3960
  }
3959
3961
  }