opencode-gitlab-dap 1.15.8 → 1.15.10

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.cjs CHANGED
@@ -4085,11 +4085,13 @@ async function readIndex(instanceUrl, token, scope, id, indexSlug) {
4085
4085
  }
4086
4086
  }
4087
4087
  async function writeIndex(instanceUrl, token, scope, id, indexSlug, entries) {
4088
- const content = formatIndex(entries);
4088
+ const content = formatIndex(entries) || "# Skills Index";
4089
4089
  try {
4090
4090
  await updateWikiPage(instanceUrl, token, scope, id, indexSlug, content);
4091
- } catch {
4092
- await createWikiPage(instanceUrl, token, scope, id, indexSlug, content || "# Skills Index");
4091
+ } catch (updateErr) {
4092
+ if (!updateErr.message?.includes("not found") && !updateErr.message?.includes("404"))
4093
+ throw updateErr;
4094
+ await createWikiPage(instanceUrl, token, scope, id, indexSlug, content);
4093
4095
  }
4094
4096
  }
4095
4097
  async function upsertIndexEntry(instanceUrl, token, scope, id, indexSlug, entry) {
@@ -4112,7 +4114,9 @@ async function removeIndexEntry(instanceUrl, token, scope, id, indexSlug, name)
4112
4114
  async function upsertPage(instanceUrl, token, scope, id, slug, content) {
4113
4115
  try {
4114
4116
  await updateWikiPage(instanceUrl, token, scope, id, slug, content);
4115
- } catch {
4117
+ } catch (updateErr) {
4118
+ if (!updateErr.message?.includes("not found") && !updateErr.message?.includes("404"))
4119
+ throw updateErr;
4116
4120
  await createWikiPage(instanceUrl, token, scope, id, slug, content);
4117
4121
  }
4118
4122
  }