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.cjs CHANGED
@@ -4085,11 +4085,12 @@ 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("404")) throw updateErr;
4093
+ await createWikiPage(instanceUrl, token, scope, id, indexSlug, content);
4093
4094
  }
4094
4095
  }
4095
4096
  async function upsertIndexEntry(instanceUrl, token, scope, id, indexSlug, entry) {
@@ -4112,7 +4113,8 @@ async function removeIndexEntry(instanceUrl, token, scope, id, indexSlug, name)
4112
4113
  async function upsertPage(instanceUrl, token, scope, id, slug, content) {
4113
4114
  try {
4114
4115
  await updateWikiPage(instanceUrl, token, scope, id, slug, content);
4115
- } catch {
4116
+ } catch (updateErr) {
4117
+ if (!updateErr.message?.includes("404")) throw updateErr;
4116
4118
  await createWikiPage(instanceUrl, token, scope, id, slug, content);
4117
4119
  }
4118
4120
  }