Test Account
test.mathbook.cafe
Test Account
@test.mathbook.cafe
@mathbook.cafe
okay, I could go into much more detail if I felt like it... but really I just wanted to send out the full demonstration, recursive screenshots and all
November 5, 2024 at 9:07 PM
messages seemed straightforward at first... until I wrestled with the union types on the in the lexicon. luckily, by composing cleanly and accepting 'any' on my client's create record endpoint, I could use a generic constraint to specify the embeds
November 5, 2024 at 9:07 PM
from a technical POV, the 🧵 must start with a valid session token, which will be used in all the requests to the api. I embed the Session in a Client, which will request a new token when necessary (eg expiration)
November 5, 2024 at 9:07 PM
okay, I could go into much more detail if I felt like it... but really I just wanted to send out the full demonstration, recursive screenshots and all
November 5, 2024 at 9:07 PM
messages seemed straightforward at first... until I wrestled with the union types on the in the lexicon. luckily, by composing cleanly and accepting 'any' on my client's create record endpoint, I could use a generic constraint to specify the embeds
November 5, 2024 at 9:06 PM
from a technical POV, the 🧵 must start with a valid session token, which will be used in all the requests to the api. I embed the Session in a Client, which will request a new token when necessary (eg expiration)
November 5, 2024 at 9:06 PM
now with image attachments
November 5, 2024 at 8:28 PM
now with image attachments
November 5, 2024 at 8:27 PM
now with image attachments
November 5, 2024 at 8:25 PM
now with image attachments
November 5, 2024 at 8:17 PM
now with image attachments
November 5, 2024 at 8:16 PM
now with image attachments
November 5, 2024 at 8:15 PM
now with image attachments
November 5, 2024 at 8:10 PM
posting images takes a bit more work. The client must first upload the raw image data or 'blob', then use a reference to the blob upload as an 'embed'. Really, we're just uploading images separately and linking them to our messages, allowing the client to bring them back together
November 4, 2024 at 5:55 PM
Next, sending a plain text message means packaging the text itself and a timestamp of when the client created the message. A language field is optional, but I think good practice. Note you can specify multiple languages, making multilingual support built-in for the future.
November 4, 2024 at 5:42 PM
The login flow requires both an identifier, which can be either a 'did' or a username 'handle', and a password. The client sends a POST message with these data in JSON format, and returns the did, handle, access, and refresh tokens. Deserialize these into a struct, and you're good to go
November 4, 2024 at 5:37 PM
My code follows a simple design pattern. The session object holds the access and refresh tokens, the client handles the API calls, and the endpoints have static definitions
November 4, 2024 at 5:27 PM
posting images
November 3, 2024 at 8:05 PM
now supporting image embeds
November 2, 2024 at 1:47 AM
now supporting image embeds
November 2, 2024 at 1:44 AM