feat(sdk): notifications API + remove dead launch(phone=) (#4, #5) - #7
Merged
Conversation
#5: add spore.notifications (NotificationsClient) wrapping POST/DELETE /v1/notifications/register — the one REST route with no SDK coverage. register()/deregister() take platform/workspace_id/user_id (assembled into the 'platform#workspace#user' key spore-bot uses, per spawn/cmd/bot.go) or a raw user_key. user_key is caller-supplied by design — it's a chat identity, not derivable from AWS creds. Adds Client.delete() (JSON-body DELETE). Wired as a lazy proxy + top-level re-exports, same private-module pattern as #2. #4: remove the phone= param from spawn.launch() — it was documented for SMS but silently no-op'd (launch never accepts phone; SMS is the notifications endpoint). Docstring now points to spore.notifications.register(). Tests: register key-assembly (triple + raw + missing-identity ValueError), deregister DELETE body, top-level proxy, launch rejects phone=. 17 pass, ruff clean, build + fresh-install smoke green, 3.9-safe. Bump 0.1.3 -> 0.1.4. Closes #4, closes #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4 and #5 — the two gaps from the feature-completeness review. Makes the SDK cover every REST route.
#5 — notifications API (the one uncovered endpoint)
New
spore.notifications(NotificationsClient) wrappingPOST/DELETE /v1/notifications/register:user_keyis caller-supplied by design — verified it's the spore-bot chat identity ({platform}#{workspace_id}#{user_id}, perspawn/cmd/bot.go), not derivable from AWS creds/API key. The method builds it from the triple, or takes a rawuser_key=; missing both →ValueError.Client.delete()(the DELETE handler reads a JSON body)._notifications-module pattern as the Audit: SDK's two headline entry points are broken (module shadowing + launch TypeError + wrong truffle field keys); no tests #2 fix (no shadowing).#4 — remove the dead
launch(phone=)paramIt was documented for SMS but silently did nothing (launch never accepts
phone; SMS is the notifications endpoint). Removed; docstring now points tospore.notifications.register().Tests / verification
Extended
tests/test_sdk.py(17 total): user_key assembly (triple + raw + missing-identityValueError),deregisterDELETE body, the top-levelspore.notificationsproxy, andlaunch()rejectingphone=.ruffclean;python -m build+ fresh-install smoke green; 3.9-safe (Optional + future annotations, per the #2 lesson). Bump 0.1.3 → 0.1.4.With this, the SDK is API-complete except the additive launch params in #6 (separate small PR).