2.1.0 • Published 8 months ago

openmagicline v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Synopsis

I work at a gym that has been using magicline for well over a decade now.

When they switched to a completely new cloud-based web-interface in about 2016, using magicline got a lot slower. The new interface not only took a significant time to get used to, it also runs considerably slower than the previous (native) one. This sucks for an environment where the customer expects fast and reliable service.

I build custom software to speed up the workflow, and Openmagicline is the adapter that powers it.

Openmagicline is a reverse-engineered, strongly-typed version of magicline's internal API.

Usage

This is far from feature-complete as I only implement the parts I need. Feel free to use it, but expect a lot of functionality to be missing.

I am, however, very open to contributions and this project should be a solid starting point for anyone who wants to implement missing functionality.

const magicline = new Openmagicline({
  gym: "gym", // example for https://gym.web.magicline.com
  username: "your username",
  password: "your password",
})

await magicline.login()
await magicline.customer.search("John Doe")

Features

  • Strongly-typed - All API calls and responses are typed
  • Authentication - Automatically re-authenticates on session expiry
  • Covered - Probably close to 100% test coverage

Roadmap

  • Detect magicline version and warn if openmagicline is outdated
  • Improve tests and verify API responses with something like zod

New in v2

  • Added setting organizationUnitId per instance to avoid re-checking it.
    • This is optional, it'll get the default unitID if not provided.
  • Added checkoutByCustomerID to Checkin class which utilizes a cached map of customerID -> checkinID to avoid having to re-list checkins.
  • Switched to Bun for package management and testing.
  • Switched to ofetch for HTTP requests.
  • Switched to Biome for linting and formatting.
2.1.0

8 months ago

2.0.0

9 months ago

1.1.0

2 years ago

1.0.0

2 years ago

0.3.0

2 years ago

0.1.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago