@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.d.mts CHANGED
@@ -1158,7 +1158,79 @@ interface OidcSigningKey {
1158
1158
  rotated_at: string | null;
1159
1159
  }
1160
1160
  type LibraryKind = 'runbook' | 'routine' | 'incident' | 'reference';
1161
- type LibraryCadence = 'daily' | 'weekly' | 'monthly' | 'quarterly';
1161
+ /** The coarse label of a schedule: its most frequent rule. */
1162
+ type LibraryCadence = 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly';
1163
+ type LibraryWeekday = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
1164
+ /** Part of the year, MM-DD to MM-DD inclusive. `from` after `to` wraps the new year. */
1165
+ interface LibrarySeason {
1166
+ from: string;
1167
+ to: string;
1168
+ }
1169
+ /** One rule of a routine's schedule. Every day is East Africa Time. */
1170
+ type LibraryScheduleRule = {
1171
+ every: 'daily';
1172
+ during: LibrarySeason | null;
1173
+ } | {
1174
+ every: 'weekdays';
1175
+ during: LibrarySeason | null;
1176
+ } | {
1177
+ every: 'weekly';
1178
+ weekday: LibraryWeekday;
1179
+ during: LibrarySeason | null;
1180
+ } | {
1181
+ every: 'monthly';
1182
+ day: number | 'last';
1183
+ during: LibrarySeason | null;
1184
+ } | {
1185
+ every: 'quarterly';
1186
+ day: number | 'last';
1187
+ } | {
1188
+ every: 'yearly';
1189
+ date: string;
1190
+ };
1191
+ /** When a routine is due: on any day at least one rule matches. */
1192
+ interface LibrarySchedule {
1193
+ rules: LibraryScheduleRule[];
1194
+ /** The rules in plain words, e.g. "Every Monday". */
1195
+ label: string;
1196
+ /** Days ahead of a monthly, quarterly or yearly due day the audience is reminded; 0 for none. */
1197
+ noticeDays: number;
1198
+ /** Days after the due day before an unrecorded occurrence is escalated; null uses each rule's default. */
1199
+ graceDays: number | null;
1200
+ }
1201
+ /** Where one occurrence of a routine stands. `missed` occurrences may still be recorded, as late. */
1202
+ type LibraryOccurrenceStatus = 'upcoming' | 'due' | 'missed' | 'done';
1203
+ /** Who recorded an occurrence: a users.id or `iam:<id>`, with their name and address when known. */
1204
+ interface LibraryCompleter {
1205
+ subject: string;
1206
+ name: string | null;
1207
+ email: string | null;
1208
+ }
1209
+ /** One due day of a routine. */
1210
+ interface LibraryOccurrence {
1211
+ /** YYYY-MM-DD. */
1212
+ dueOn: string;
1213
+ status: LibraryOccurrenceStatus;
1214
+ /** YYYY-MM-DD: the last day it may be recorded before it counts as missed. */
1215
+ graceEndsOn: string;
1216
+ completedAt: string | null;
1217
+ completedBy: LibraryCompleter | null;
1218
+ note: string | null;
1219
+ }
1220
+ /** Where a scheduled routine stands today. */
1221
+ interface LibraryRoutineState {
1222
+ /** The latest due day on or before today, or null when none falls in the lookback. */
1223
+ current: LibraryOccurrence | null;
1224
+ /** YYYY-MM-DD, or null when no due day falls within a year. */
1225
+ nextDueOn: string | null;
1226
+ /** Missed and still unrecorded occurrences (since tracking began, at most 45 days back). */
1227
+ missedCount: number;
1228
+ }
1229
+ /** The result of `admin.completeLibraryOccurrence()`. */
1230
+ interface LibraryOccurrenceRecorded {
1231
+ ok: true;
1232
+ occurrence: LibraryOccurrence;
1233
+ }
1162
1234
  /** A library document as listed by `admin.listLibrary()`. Never includes the body. */
1163
1235
  interface LibraryDocumentSummary {
1164
1236
  slug: string;
@@ -1168,8 +1240,15 @@ interface LibraryDocumentSummary {
1168
1240
  /** The permissions that may read this document (any one of them suffices). */
1169
1241
  audience: AdminPermission[];
1170
1242
  owner: string;
1171
- /** How often a routine is carried out; null when the document is not a routine. */
1243
+ /** How often a routine is carried out, coarsely; null when the document has no schedule. */
1172
1244
  cadence: LibraryCadence | null;
1245
+ /** When the routine is due; null when the document has no schedule. */
1246
+ schedule: LibrarySchedule | null;
1247
+ /**
1248
+ * Where the routine stands today. Null for an unscheduled document, and also when the worker
1249
+ * cannot read routine state at the moment (the document itself is still served).
1250
+ */
1251
+ routine: LibraryRoutineState | null;
1173
1252
  /** How often the document itself must be re-checked. */
1174
1253
  reviewEveryDays: number;
1175
1254
  /** YYYY-MM-DD. */
@@ -1182,6 +1261,10 @@ interface LibraryDocumentSummary {
1182
1261
  /** One library document with its markdown body, from `admin.getLibraryDocument()`. */
1183
1262
  interface LibraryDocument extends LibraryDocumentSummary {
1184
1263
  markdown: string;
1264
+ /** Recent occurrences, newest first, starting with the next due day. Empty when unscheduled. */
1265
+ occurrences: LibraryOccurrence[];
1266
+ /** True when the caller's role is in the audience, so they may record occurrences as done. */
1267
+ can_record: boolean;
1185
1268
  }
1186
1269
  interface LibraryListing {
1187
1270
  /** Only the documents the caller may read. */
@@ -4372,6 +4455,18 @@ declare class AdminModule {
4372
4455
  * exactly like one that does not exist (404).
4373
4456
  */
4374
4457
  getLibraryDocument(slug: string, options?: RequestOptions): Promise<LibraryDocument>;
4458
+ /**
4459
+ * Record one occurrence of a scheduled routine as done, with an optional note (at most 500
4460
+ * characters). Only an operator whose role is in the document's audience may record it
4461
+ * (`LibraryDocument.can_record`); the librarian's `library:read_all` alone is not enough.
4462
+ *
4463
+ * `dueOn` (YYYY-MM-DD) must be one of the routine's due days, no more than 45 days old and no
4464
+ * further ahead than its notice. Errors: 403 not in the audience, 404 not readable, 409 already
4465
+ * recorded (the body carries the existing `occurrence`), 422 `invalid_occurrence` with a `reason`
4466
+ * (`not_scheduled`, `not_a_due_day`, `too_early`, `too_old`). Recorded on the audit trail as
4467
+ * `library.routine.completed`.
4468
+ */
4469
+ completeLibraryOccurrence(slug: string, dueOn: string, note?: string, options?: RequestOptions): Promise<LibraryOccurrenceRecorded>;
4375
4470
  listPayoutsAwaitingApproval(options?: RequestOptions): Promise<{
4376
4471
  payouts: PendingPayoutApproval[];
4377
4472
  }>;
@@ -4850,4 +4945,4 @@ declare class MitumbaClient {
4850
4945
  isAuthenticated(): Promise<boolean>;
4851
4946
  }
4852
4947
 
4853
- export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
4948
+ export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
package/dist/index.d.ts CHANGED
@@ -1158,7 +1158,79 @@ interface OidcSigningKey {
1158
1158
  rotated_at: string | null;
1159
1159
  }
1160
1160
  type LibraryKind = 'runbook' | 'routine' | 'incident' | 'reference';
1161
- type LibraryCadence = 'daily' | 'weekly' | 'monthly' | 'quarterly';
1161
+ /** The coarse label of a schedule: its most frequent rule. */
1162
+ type LibraryCadence = 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly';
1163
+ type LibraryWeekday = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
1164
+ /** Part of the year, MM-DD to MM-DD inclusive. `from` after `to` wraps the new year. */
1165
+ interface LibrarySeason {
1166
+ from: string;
1167
+ to: string;
1168
+ }
1169
+ /** One rule of a routine's schedule. Every day is East Africa Time. */
1170
+ type LibraryScheduleRule = {
1171
+ every: 'daily';
1172
+ during: LibrarySeason | null;
1173
+ } | {
1174
+ every: 'weekdays';
1175
+ during: LibrarySeason | null;
1176
+ } | {
1177
+ every: 'weekly';
1178
+ weekday: LibraryWeekday;
1179
+ during: LibrarySeason | null;
1180
+ } | {
1181
+ every: 'monthly';
1182
+ day: number | 'last';
1183
+ during: LibrarySeason | null;
1184
+ } | {
1185
+ every: 'quarterly';
1186
+ day: number | 'last';
1187
+ } | {
1188
+ every: 'yearly';
1189
+ date: string;
1190
+ };
1191
+ /** When a routine is due: on any day at least one rule matches. */
1192
+ interface LibrarySchedule {
1193
+ rules: LibraryScheduleRule[];
1194
+ /** The rules in plain words, e.g. "Every Monday". */
1195
+ label: string;
1196
+ /** Days ahead of a monthly, quarterly or yearly due day the audience is reminded; 0 for none. */
1197
+ noticeDays: number;
1198
+ /** Days after the due day before an unrecorded occurrence is escalated; null uses each rule's default. */
1199
+ graceDays: number | null;
1200
+ }
1201
+ /** Where one occurrence of a routine stands. `missed` occurrences may still be recorded, as late. */
1202
+ type LibraryOccurrenceStatus = 'upcoming' | 'due' | 'missed' | 'done';
1203
+ /** Who recorded an occurrence: a users.id or `iam:<id>`, with their name and address when known. */
1204
+ interface LibraryCompleter {
1205
+ subject: string;
1206
+ name: string | null;
1207
+ email: string | null;
1208
+ }
1209
+ /** One due day of a routine. */
1210
+ interface LibraryOccurrence {
1211
+ /** YYYY-MM-DD. */
1212
+ dueOn: string;
1213
+ status: LibraryOccurrenceStatus;
1214
+ /** YYYY-MM-DD: the last day it may be recorded before it counts as missed. */
1215
+ graceEndsOn: string;
1216
+ completedAt: string | null;
1217
+ completedBy: LibraryCompleter | null;
1218
+ note: string | null;
1219
+ }
1220
+ /** Where a scheduled routine stands today. */
1221
+ interface LibraryRoutineState {
1222
+ /** The latest due day on or before today, or null when none falls in the lookback. */
1223
+ current: LibraryOccurrence | null;
1224
+ /** YYYY-MM-DD, or null when no due day falls within a year. */
1225
+ nextDueOn: string | null;
1226
+ /** Missed and still unrecorded occurrences (since tracking began, at most 45 days back). */
1227
+ missedCount: number;
1228
+ }
1229
+ /** The result of `admin.completeLibraryOccurrence()`. */
1230
+ interface LibraryOccurrenceRecorded {
1231
+ ok: true;
1232
+ occurrence: LibraryOccurrence;
1233
+ }
1162
1234
  /** A library document as listed by `admin.listLibrary()`. Never includes the body. */
1163
1235
  interface LibraryDocumentSummary {
1164
1236
  slug: string;
@@ -1168,8 +1240,15 @@ interface LibraryDocumentSummary {
1168
1240
  /** The permissions that may read this document (any one of them suffices). */
1169
1241
  audience: AdminPermission[];
1170
1242
  owner: string;
1171
- /** How often a routine is carried out; null when the document is not a routine. */
1243
+ /** How often a routine is carried out, coarsely; null when the document has no schedule. */
1172
1244
  cadence: LibraryCadence | null;
1245
+ /** When the routine is due; null when the document has no schedule. */
1246
+ schedule: LibrarySchedule | null;
1247
+ /**
1248
+ * Where the routine stands today. Null for an unscheduled document, and also when the worker
1249
+ * cannot read routine state at the moment (the document itself is still served).
1250
+ */
1251
+ routine: LibraryRoutineState | null;
1173
1252
  /** How often the document itself must be re-checked. */
1174
1253
  reviewEveryDays: number;
1175
1254
  /** YYYY-MM-DD. */
@@ -1182,6 +1261,10 @@ interface LibraryDocumentSummary {
1182
1261
  /** One library document with its markdown body, from `admin.getLibraryDocument()`. */
1183
1262
  interface LibraryDocument extends LibraryDocumentSummary {
1184
1263
  markdown: string;
1264
+ /** Recent occurrences, newest first, starting with the next due day. Empty when unscheduled. */
1265
+ occurrences: LibraryOccurrence[];
1266
+ /** True when the caller's role is in the audience, so they may record occurrences as done. */
1267
+ can_record: boolean;
1185
1268
  }
1186
1269
  interface LibraryListing {
1187
1270
  /** Only the documents the caller may read. */
@@ -4372,6 +4455,18 @@ declare class AdminModule {
4372
4455
  * exactly like one that does not exist (404).
4373
4456
  */
4374
4457
  getLibraryDocument(slug: string, options?: RequestOptions): Promise<LibraryDocument>;
4458
+ /**
4459
+ * Record one occurrence of a scheduled routine as done, with an optional note (at most 500
4460
+ * characters). Only an operator whose role is in the document's audience may record it
4461
+ * (`LibraryDocument.can_record`); the librarian's `library:read_all` alone is not enough.
4462
+ *
4463
+ * `dueOn` (YYYY-MM-DD) must be one of the routine's due days, no more than 45 days old and no
4464
+ * further ahead than its notice. Errors: 403 not in the audience, 404 not readable, 409 already
4465
+ * recorded (the body carries the existing `occurrence`), 422 `invalid_occurrence` with a `reason`
4466
+ * (`not_scheduled`, `not_a_due_day`, `too_early`, `too_old`). Recorded on the audit trail as
4467
+ * `library.routine.completed`.
4468
+ */
4469
+ completeLibraryOccurrence(slug: string, dueOn: string, note?: string, options?: RequestOptions): Promise<LibraryOccurrenceRecorded>;
4375
4470
  listPayoutsAwaitingApproval(options?: RequestOptions): Promise<{
4376
4471
  payouts: PendingPayoutApproval[];
4377
4472
  }>;
@@ -4850,4 +4945,4 @@ declare class MitumbaClient {
4850
4945
  isAuthenticated(): Promise<boolean>;
4851
4946
  }
4852
4947
 
4853
- export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
4948
+ export { APIClient, APIError, type APIErrorResponse, type ActivateIamUserInput, type ActivateIamUserResult, type Add2FAMethodInput, type Add2FAMethodResult, type AddAddressInput, type AddDepotInput, type AddIamPasskeyResult, type AddIamTotpResult, type AddIamTwoFactorMethodInput, type AddPaymentMethodInput, type Address, type AdminAuditActor, type AdminAuditEntry, type AdminAuditQuery, type AdminAuthStrength, type AdminListingItem, AdminModule, type AdminOperator, type AdminOrderDetail, type AdminOrderListItem, type AdminPayoutItem, type AdminPermission, type AdminPermissionDescription, type AdminRecoveryEvent, type AdminRecoveryRequest, type AdminReport, type AdminRolePreset, type AdminStoreDetail, type AdminStoreListItem, type AdminUserDetail, type AdminUserListItem, type AdminVaziOutfit, type AdminVerificationItem, type AdminWholesalePendingStore, type ApiResponse, type AttachmentDownloadAuthorization, type AttachmentUploadAuthorization, type AttachmentUploadBody, type AttachmentUploadState, type AttachmentUploadStatus, type AuthCapabilities, AuthModule, type AuthTokens, type AuthenticationResponseJSON, BALE_ORDER_STATUSES, type Bale, type BaleDetail, type BaleFeedItem, type BaleFulfillment, type BaleGrade, type BaleImageUploadResult, type BaleOrder, type BaleOrderEvent, type BaleOrderStatus, type BaleType, type BecomeBaleSellerInput, type BecomeSellerInput, type BlockedIp, type Business, type BusinessType, BusinessesModule, type BuyerResolveThreadInput, type BuyerSummary, CONDITIONS, type CartItem, CartModule, type Category, type ChangePasswordInput, type CheckoutNextAction, type CheckoutOrder, type CheckoutPaymentMethod, type CheckoutStatus, type CheckoutStatusResponse, type City, type CompleteOnboardingInput, type CompleteRecoveryResult, type Condition, type Conversation, type ConversationId, type ConversationSummary, type CreateAttachmentUploadInput, type CreateBaleInput, type CreateBaleOrderInput, type CreateIamUserInput, type CreateIamUserResult, type CreateListingInput, type CreateMessageBlockInput, type CreateMessageBlockResult, type CreateMessageReportInput, type CreateMessageReportResult, type CreateOrderInput, type CreateOrganizationInput, type CreateReportInput, type CreateReviewInput, type CreateStoreInput, type CursorPage, DEFAULT_SHARE_ORIGIN, DESIRED_RESOLUTIONS, DISPUTE_REASONS, DISPUTE_STATUSES, type DeliveryAddress, type DesiredResolution, type Dispute, type DisputeEvent, type DisputeEvidence, type DisputeListParams, type DisputeReason, type DisputeStatus, DisputesModule, type EmailLoginInput, type EmailRegisterInput, type FileResponse, type FinishIamPasskeyEnrollmentInput, type FinishIamPasskeyLoginInput, type FollowedStore, type ForgotPasswordInput, IDBTokenStore, type IamActivation, type IamLoginInput, type IamLoginMethod, type IamMethodsResult, IamModule, type IamPasskeyLoginOptions, type IamProfile, type IamTokens, type IamTwoFactorRequired, type IamUser, type IamUserStatus, type InboxRealtimeEvent, type InitiateCheckoutInput, type InitiateCheckoutResponse, type Jwk, type Jwks, type KnownPaymentProvider, LISTING_STATUSES, type LegacyLinkResolution, type LegacyMessageArchiveSummary, type LegacyMessagePage, type LegacyMessageRecord, type LibraryCadence, type LibraryCompleter, type LibraryDocument, type LibraryDocumentSummary, type LibraryKind, type LibraryListing, type LibraryOccurrence, type LibraryOccurrenceRecorded, type LibraryOccurrenceStatus, type LibraryRoutineState, type LibrarySchedule, type LibraryScheduleRule, type LibrarySeason, type LibraryWeekday, type LinkedAccount, type LinkedAccountProvider, type ListConversationsParams, type ListIamUsersResult, type ListThreadMessagesParams, type ListThreadsParams, type Listing, type ListingImage, type ListingStatus, type ListingsFeedParams, ListingsModule, type LoginInput, MailerModule, type MailerTemplate, type Market, type MarketCurrency, type MarketPhone, type MarketRegion, type MarketRegionsResponse, type MarketStatus, MarketsModule, type MarketsResponse, MemoryTokenStore, type Message, type MessageAttachment, type MessageAuthor, type MessageId, type MessagePage, type MessageReportReason, type MessageResponse, MessagesModule, type MessagesRealtimeConnection, type MessagesRealtimeEnvelope, type MessagesRealtimeEvent, type MessagesRealtimeOptions, type MessagesRealtimeState, type MessagesRealtimeTicket, type MessagingBlockInput, type MessagingBlockRemovedResult, type MessagingBlockResult, type MessagingCapabilities, type MessagingCursor, type MessagingErrorCode, type MessagingIdempotentRequestOptions, type MessagingInboxes, type MessagingPerspective, MitumbaClient, type MitumbaClientConfig, type MpesaInput, type Notification, type NotificationPref, type NotificationType, NotificationsModule, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthClient, type OAuthClientSummary, type OAuthClientTrustLevel, type OAuthClientType, type OAuthConsent, type OAuthConsentInput, type OAuthConsentRequired, type OAuthConsentRevokeResult, OAuthModule, type OAuthTokenExchangeInput, type OAuthTokenResult, ORDER_STATUSES, type OidcSigningKey, type OpenIdConfiguration, type OperatorPermissionGrant, type Order, type OrderDocument, type OrderDocumentKind, type OrderEvent, type OrderHistoryParams, type OrderStatus, OrdersModule, type Organization, type OrganizationKind, type OrganizationStatus, type OrganizationSummary, PAYMENT_STATUSES, type PaginatedResponse, PayModule, type PaymentAttemptStatus, type PaymentMethod, type PaymentMethodType, type PaymentProvider, type PaymentStatus, type PaymentStatusResponse, type PaystackInitResponse, type PaystackInput, type PendingPayoutApproval, type PhoneLoginInput, type PhoneRegisterInput, type PresignImageResponse, type ProviderId, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RaiseDisputeInput, type ReadCursorResult, RealtimeProtocolError, RealtimeUnavailableError, type RecoveryStatus, type RecoveryStatusResult, type RegenerateBackupCodesResult, type RegenerateIamBackupCodesResult, type RegisterInput, type RegisterOAuthClientInput, type RegisteredOAuthClient, type RegistrationResponseJSON, ReportsModule, type RequestOptions, type RequestRecoveryInput, type RequestRecoveryResult, type ResetPasswordInput, type ResolveDisputeInput, type ResolveThreadResult, type RespondDisputeInput, type Review, type ReviewableOrder, ReviewsModule, type RootSetupInput, type RootSetupResult, type SaveSearchInput, type SaveWholesaleStoreInput, type SearchHistoryItem, SearchModule, type SearchParams, type SearchResult, type SellerProfile, type SellerStorefront, type SellerType, type SendEmailInput, type SendMessageInput, type SendOtpInput, type SendThreadMessageInput, type SendThreadMessageResult, type Session, SettingsModule, type ShareUrlOptions, type SilentAuthorizeResult, type SimilarListing, type StiEvent, type StkPushInput, type StkPushResponse, type Store, type StoreAnalytics, type StoreResolveThreadInput, type StoreReviewsPage, type StoreSettings, type StoreStats, type StoreSummary, StoresModule, type SubscriptionTier, type SystemStats, TWO_FACTOR_METHOD_TYPES, type ThreadCard, type ThreadId, type ThreadMessage, type ThreadSubject, type ThreadSystemEvent, type ThreadTimelineItem, type ThreadTimelineItemId, type TokenStore, type TransitionOrderInput, type TrendingTerm, type TwoFactorMethod, type TwoFactorMethodType, type TwoFactorRequired, type UpdateBusinessInput, type UpdateConversationPreferencesInput, type UpdateListingInput, type UpdateOrganizationInput, type UpdateProfileInput, type UpdateStoreInput, type UpdateThreadPreferencesInput, UploadsModule, type UserInfo, type UserProfile, type VAZIOutfit, type VAZIOutfitDetail, type VAZIOutfitDetailItem, type VAZIOutfitItem, type VaziFeedParams, type VaziFeedResponse, VaziModule, type Verify2FAInput, type VerifyIamMethodResult, type VerifyIamTwoFactorInput, type VerifyOtpInput, type WebSocketCloseEventLike, type WebSocketFactory, type WebSocketLike, type WebSocketMessageEventLike, type WholesaleAnalytics, type WholesaleDepot, type WholesaleFeedParams, WholesaleModule, type WholesaleReviewStatus, type WholesaleStore, type WishlistListing, WishlistsModule, activeMarkets, baleShareUrl, createTokenStore, findMarket, findRegion, formatAmount, formatMoney, formatMoneyCompact, formatPhone, isConsentRequired, isMessagingAPIError, isValidPhone, listingShareUrl, maskPhone, normalizePhone, regionById, storeShareUrl };
package/dist/index.js CHANGED
@@ -2487,6 +2487,24 @@ var AdminModule = class {
2487
2487
  async getLibraryDocument(slug, options) {
2488
2488
  return this.client.get(`/admin/library/${encodeURIComponent(slug)}`, void 0, options);
2489
2489
  }
2490
+ /**
2491
+ * Record one occurrence of a scheduled routine as done, with an optional note (at most 500
2492
+ * characters). Only an operator whose role is in the document's audience may record it
2493
+ * (`LibraryDocument.can_record`); the librarian's `library:read_all` alone is not enough.
2494
+ *
2495
+ * `dueOn` (YYYY-MM-DD) must be one of the routine's due days, no more than 45 days old and no
2496
+ * further ahead than its notice. Errors: 403 not in the audience, 404 not readable, 409 already
2497
+ * recorded (the body carries the existing `occurrence`), 422 `invalid_occurrence` with a `reason`
2498
+ * (`not_scheduled`, `not_a_due_day`, `too_early`, `too_old`). Recorded on the audit trail as
2499
+ * `library.routine.completed`.
2500
+ */
2501
+ async completeLibraryOccurrence(slug, dueOn, note, options) {
2502
+ return this.client.post(
2503
+ `/admin/library/${encodeURIComponent(slug)}/occurrences/${encodeURIComponent(dueOn)}/complete`,
2504
+ note ? { note } : {},
2505
+ options
2506
+ );
2507
+ }
2490
2508
  // ── Payout approval ──
2491
2509
  async listPayoutsAwaitingApproval(options) {
2492
2510
  return this.client.get("/admin/payouts/pending-approval", void 0, options);