Bsport
@magistr/bsportv2026.10.25.10
01README
bsport member API client — read the class calendar (with waitlist sizing), your upcoming/past bookings, registered offers, and your waitlist positions; email/password login → Token auth, DRF pagination, and 429 back-off
02Release Notes
2026.10.25.10
- Repo-wide republish; no functional change.
03Behaviors
@magistr/bsportv2026.10.25.10extensions/models/bsport.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| token? | string | A DRF auth token (sent as `Authorization: Token <token>`). When set, the |
| email? | string | Member login email (used only when `token` is not set). Vault ref: |
| password? | string | Member login password (used only when `token` is not set). Vault ref: |
| companyId | string | Studio company id (the `company` filter on the calendar), e.g. "1234". |
| memberId? | string | This member's numeric id (the `member` filter on /booking/). Required by |
| consumerId? | string | This member's numeric consumer id (the `consumer` filter on the waitlist |
| baseUrl? | string | API host without trailing slash (production shown by default). |
| authPath? | string | Path prefix of the authentication service under baseUrl. |
| timeoutMs? | number | Per-request fetch timeout in milliseconds. |
| maxRetries? | number | How many times to retry a request after an HTTP 429 rate-limit response. |
| userAgent? | string | User-Agent header sent on all outbound requests. |
fn listEstablishments()
List the company's establishments/venues (GET /book/v1/establishment/
fn listOffers(establishments?: array, levels?: array, activities?: array, coaches?: array, onlyFutureStrict?: boolean, maxResults?: number, pageSize?: number)
List calendar offers (GET /book/v1/offer/) in a date window,
| Argument | Type | Description |
|---|---|---|
| establishments? | array | Filter by establishment id(s) (maps to establishments=…). |
| levels? | array | Filter by level id(s) (maps to levels=…). |
| activities? | array | Filter by meta-activity id(s) (maps to activity__in=…). |
| coaches? | array | Filter by coach id(s) (maps to coaches=…). |
| onlyFutureStrict? | boolean | Restrict to strictly-future offers (maps to only_future_strict). |
| maxResults? | number | Upper bound on offers retrieved across all pages. |
| pageSize? | number | Offers per page request. |
fn getOffers(ids: array)
Fetch specific offers by id (GET /book/v1/offer/?id__in=…). Writes
| Argument | Type | Description |
|---|---|---|
| ids | array | Offer id(s) to fetch (maps to id__in=…). |
fn listFutureBookings(maxResults?: number, pageSize?: number)
List the member's upcoming bookings (GET /book/v1/booking/ with
| Argument | Type | Description |
|---|---|---|
| maxResults? | number | Upper bound on bookings retrieved across all pages. |
| pageSize? | number | Bookings per page request. |
fn listPastBookings(maxResults?: number, pageSize?: number)
List the member's past bookings (GET /book/v1/booking/ with
| Argument | Type | Description |
|---|---|---|
| maxResults? | number | Upper bound on bookings retrieved across all pages. |
| pageSize? | number | Bookings per page request. |
fn listMyWaitlist(maxResults?: number, pageSize?: number)
List the member's own waitlist entries
| Argument | Type | Description |
|---|---|---|
| maxResults? | number | Upper bound on bookings retrieved across all pages. |
| pageSize? | number | Bookings per page request. |
fn listRegisteredOffers()
List offers the member is registered for, booked or waitlisted
fn listWaitlist(offerIds?: array)
List the member's waitlist positions
| Argument | Type | Description |
|---|---|---|
| offerIds? | array | Offer id(s) to check waitlist position for. When omitted, the method |
Resources
offer(infinite)— One bsport offer (calendar class), including booking counts and
booking(infinite)— One of the member's own bookings (factory output).
waitlistPosition(infinite)— The member's waitlist position on one offer.
establishment(infinite)— One studio establishment (venue) of the company.
waitlistEntry(infinite)— One of the member's own waitlist booking-options (from the
summary(infinite)— Per-operation summary: scope, filters, count, and item ids.
04Previous Versions
2026.10.15.9MIT
2026.10.15.9
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.8MIT
2026.10.15.8
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.6MIT
2026.10.15.6
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.5MIT
2026.10.15.5
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.4MIT
2026.10.15.4
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.3MIT
2026.10.15.3
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.2MIT
2026.10.15.2
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.10.15.1MIT
2026.10.15.1
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
2026.09.15.1MIT
2026.09.15.1
First release.
- Read-only member-API client for bsport studios:
listOffers,getOffers,listEstablishments,listFutureBookings,listPastBookings,listMyWaitlist,listWaitlist,listRegisteredOffers. Each is a fan-out factory that writes one resource per item plus asummary. - Auth by a configured DRF
token, or by email/password login againstauthPath. The token is held in memory only and never stored. - DRF
page/page_sizepagination, and retry on HTTP 429 perRetry-After. - Test suites: contract-fixture (against
fixtures/), methods, adversarial, coverage and fast-check property tests. No test touches the network.
Fixed before release
companyIdhas no default: it is required, so the extension ships no particular studio. Set it to your studio'scompanyid.tokenandpasswordare now declared sensitive, so swamp masks them.listOffersrejectsminDate/maxDatethat are notYYYY-MM-DD. Before, free text went into the summary instance name.- Pagination stops when a page adds no new items. Before, a server that ignored
pageand kept sendingnextmade the method loop forever. summary.idsholds only real item ids. Before, items without an id added negative placeholder numbers; they still count towardtotal.listMyWaitlistcaps entries atmaxResults, setstruncated, removes duplicate offer ids before the position lookup, and gives id-less entries distinct instance names. Before, it could exceedmaxResultsby one page, and id-less entries overwrote each other.listFutureBookings/listPastBookingscheckmemberIdbefore they log in.Retry-Afterin HTTP-date form is honoured. Before, it fell back to 1 s.- The request timeout now also covers reading the response body, and a non-JSON 2xx body gives a clear error.
baseUrlmust behttp/httpswith no embedded credentials.
05Stats
A
100 / 100
Downloads
19
Archive size
17.9 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned
Repository
https://github.com/umag/swamp-workspace06Platforms
07Labels