@mitumba/sdk 5.16.0 → 5.17.0

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.mjs CHANGED
@@ -2485,6 +2485,24 @@ var AdminModule = class {
2485
2485
  async getLibraryDocument(slug, options) {
2486
2486
  return this.client.get(`/admin/library/${encodeURIComponent(slug)}`, void 0, options);
2487
2487
  }
2488
+ /**
2489
+ * Record one occurrence of a scheduled routine as done, with an optional note (at most 500
2490
+ * characters). Only an operator whose role is in the document's audience may record it
2491
+ * (`LibraryDocument.can_record`); the librarian's `library:read_all` alone is not enough.
2492
+ *
2493
+ * `dueOn` (YYYY-MM-DD) must be one of the routine's due days, no more than 45 days old and no
2494
+ * further ahead than its notice. Errors: 403 not in the audience, 404 not readable, 409 already
2495
+ * recorded (the body carries the existing `occurrence`), 422 `invalid_occurrence` with a `reason`
2496
+ * (`not_scheduled`, `not_a_due_day`, `too_early`, `too_old`). Recorded on the audit trail as
2497
+ * `library.routine.completed`.
2498
+ */
2499
+ async completeLibraryOccurrence(slug, dueOn, note, options) {
2500
+ return this.client.post(
2501
+ `/admin/library/${encodeURIComponent(slug)}/occurrences/${encodeURIComponent(dueOn)}/complete`,
2502
+ note ? { note } : {},
2503
+ options
2504
+ );
2505
+ }
2488
2506
  // ── Payout approval ──
2489
2507
  async listPayoutsAwaitingApproval(options) {
2490
2508
  return this.client.get("/admin/payouts/pending-approval", void 0, options);