feat(api-tokens): migrate to v2 token endpoints with shocker control, unified create page, and pause toggle#208
Merged
Merged
Conversation
Deploying openshockapp with
|
| Latest commit: |
fc23aa3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://22df66b3.openshockapp.pages.dev |
| Branch Preview URL: | https://feature-rework-api-tokens.openshockapp.pages.dev |
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.
Summary
Integrates the new v2 token endpoints and reworks the API-tokens UI around the new
required
shockerControlobject. Also unifies token creation into a single page, movestoken dialogs onto the dialog manager, and adds per-token pause/resume.
Changes
v2 token endpoints
tokensCreateTokenV2,tokensEditTokenV2,tokensListTokensV2,tokensGetTokenByIdV2,tokensSelfGetSelfTokenV2,tokensSetTokenPaused, and v2tokensReportTokens.tokenDeleteDeleteToken(no v2 delete endpoint exists).Shocker control editor (new)
shocker-control-settings.svelte: paused switch, intensity & duration ranges,and a Clamp/Lerp mode toggle per range with tooltips explaining each mode.
ControlConstants(intensity 0–100%, duration 0.3–30s),converting seconds→ms at the boundary. Fixes a 400 where
duration.mindefaulted to 0(backend requires ≥ 300 ms).
Unified token creation
/settings/api-tokens/newis now the single surfacefor both in-app self-service and external (OAuth-style) consent.
granting:
name,redirect_uri,permissions,expiration(ISO datetime), and shockercontrol limits (
intensity_min/max/mode,duration_min/max/mode). Values are clamped tovalid ranges defensively.
"Access granted" with auto-redirect plus Retry/Finish fallbacks.
Dialog manager
dialog.open/dialog.confirm).Pause/resume
tokensSetTokenPaused: a visible button in the row plus amenu item, and a Status column (Active/Paused).
ExpirationPicker
Temporal.Instantis now the single source of truth;@internationalized/dateZonedDateTimeis confined to one getter/setter at the calendar boundary. Supports aprefilled custom datetime.
Removed
dialog-token-create.svelte,dialog-token-created.svelte,dialog-token-delete.svelte,and
new/queryParamsType.ts(no longer used).Notes
shared constants.
restrictions-selector.svelte(share limits) still hardcodesmin={0}for duration inline — same latent issue, left out of scope.