nrdocs 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/bin.mjs +16 -14
  2. package/package.json +1 -1
package/dist/bin.mjs CHANGED
@@ -6429,46 +6429,46 @@ var ApiClient = class {
6429
6429
  if (filters?.access) params.set("access", filters.access);
6430
6430
  if (filters?.owner) params.set("owner", filters.owner);
6431
6431
  const qs = params.toString();
6432
- return this.request("GET", `/api/operator/repos${qs ? `?${qs}` : ""}`);
6432
+ return this.request("GET", `/api/repos${qs ? `?${qs}` : ""}`);
6433
6433
  }
6434
6434
  async getRepo(owner, repo) {
6435
- return this.request("GET", `/api/operator/repos/${owner}/${repo}`);
6435
+ return this.request("GET", `/api/repos/${owner}/${repo}`);
6436
6436
  }
6437
6437
  async approveRepo(owner, repo, accessMode) {
6438
- return this.request("POST", `/api/operator/repos/${owner}/${repo}/approve`, {
6438
+ return this.request("POST", `/api/repos/${owner}/${repo}/approve`, {
6439
6439
  access_mode: accessMode
6440
6440
  });
6441
6441
  }
6442
6442
  async disableRepo(owner, repo, reason) {
6443
- return this.request("POST", `/api/operator/repos/${owner}/${repo}/disable`, {
6443
+ return this.request("POST", `/api/repos/${owner}/${repo}/disable`, {
6444
6444
  reason: reason ?? void 0
6445
6445
  });
6446
6446
  }
6447
6447
  async setAccess(owner, repo, accessMode) {
6448
- return this.request("PUT", `/api/operator/repos/${owner}/${repo}/access`, {
6448
+ return this.request("POST", `/api/repos/${owner}/${repo}/access`, {
6449
6449
  access_mode: accessMode
6450
6450
  });
6451
6451
  }
6452
6452
  async setPassword(owner, repo, password) {
6453
- return this.request("PUT", `/api/operator/repos/${owner}/${repo}/password`, {
6453
+ return this.request("POST", `/api/repos/${owner}/${repo}/password`, {
6454
6454
  password
6455
6455
  });
6456
6456
  }
6457
6457
  async listRules() {
6458
- return this.request("GET", "/api/operator/rules");
6458
+ return this.request("GET", "/api/auto-approval-rules");
6459
6459
  }
6460
6460
  async addRule(pattern, accessMode, applyExisting) {
6461
- return this.request("POST", "/api/operator/rules", {
6461
+ return this.request("POST", "/api/auto-approval-rules", {
6462
6462
  pattern,
6463
6463
  access_mode: accessMode,
6464
6464
  apply_existing: applyExisting ?? false
6465
6465
  });
6466
6466
  }
6467
6467
  async removeRule(ruleId) {
6468
- return this.request("DELETE", `/api/operator/rules/${ruleId}`);
6468
+ return this.request("DELETE", `/api/auto-approval-rules/${ruleId}`);
6469
6469
  }
6470
6470
  async getStatus(owner, repo) {
6471
- return this.request("GET", `/api/operator/repos/${owner}/${repo}/status`);
6471
+ return this.request("GET", `/api/repos/${owner}/${repo}`);
6472
6472
  }
6473
6473
  async getOperatorMe() {
6474
6474
  return this.request("GET", "/api/operator/me");
@@ -6583,13 +6583,15 @@ async function handlePublish(args2) {
6583
6583
  process.exit(12);
6584
6584
  }
6585
6585
  const { owner, repo } = repoInfo;
6586
+ const ownerLower = owner.toLowerCase();
6587
+ const repoLower = repo.toLowerCase();
6586
6588
  const siteTitle = validation.title || "Documentation";
6587
6589
  const apiUrl = validation.apiUrl || process.env["NRDOCS_API_URL"] || "";
6588
6590
  if (!apiUrl) {
6589
6591
  console.error("Error: No API URL configured. Set api_url in nrdocs.yml or NRDOCS_API_URL env var.");
6590
6592
  process.exit(10);
6591
6593
  }
6592
- console.log(`Publishing docs for ${owner}/${repo}...`);
6594
+ console.log(`Publishing docs for ${ownerLower}/${repoLower}...`);
6593
6595
  console.log(`Docs directory: ${docsDir}`);
6594
6596
  console.log(`Site title: ${siteTitle}`);
6595
6597
  console.log("Rendering Markdown...");
@@ -6597,8 +6599,8 @@ async function handlePublish(args2) {
6597
6599
  docsDir,
6598
6600
  siteTitle,
6599
6601
  baseUrl: apiUrl,
6600
- owner,
6601
- repo
6602
+ owner: ownerLower,
6603
+ repo: repoLower
6602
6604
  });
6603
6605
  console.log(`Rendered ${site.files.length} files.`);
6604
6606
  console.log("Creating archive...");
@@ -6623,7 +6625,7 @@ async function handlePublish(args2) {
6623
6625
  const result = await client.publish(formData);
6624
6626
  if (result.ok) {
6625
6627
  console.log("Published successfully!");
6626
- console.log(`View at: ${apiUrl}/${owner}/${repo}/`);
6628
+ console.log(`View at: ${apiUrl}/${ownerLower}/${repoLower}/`);
6627
6629
  } else {
6628
6630
  console.error(`Error: Upload failed \u2014 ${result.error?.message || "unknown error"}`);
6629
6631
  process.exit(14);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nrdocs",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "CLI for nrdocs - serverless docs publishing for private GitHub repos",
5
5
  "type": "module",
6
6
  "bin": {