In addition to the Raycast API which is bundled as part of the app, we also provide a sibling package that contains a set of utilities to streamline common patterns and operations used in extensions.
This package can be installed independently using npm.
npm install --save @raycast/utils
@raycast/utils has a peer dependency on @raycast/api. This means that a certain version of utils will require a version above a certain version of api. npm will warn you if that is not the case.
- Fixed an issue with
useSQLon Windows where the query would refuse to be executed because the database is locked
- Fix
useCachedStateto preserve Date objects more precisely.
- Fix compiled file to actually make
useSQLandexecuteSQLwork on Windows.
- Make
useSQLandexecuteSQLwork on Windows.
- Fix the default size of
getFavicon.
getFaviconwill now respect the user's setting for the favicon provider. Note that theAppleprovider isn't supported since it relies on a native API.
- Fix types for ESM extensions
- The library can now be tree-shaken, reducing its size considerably.
- When using
usePromiseand mutating the data with an optimistic update before it is fetched, the current fetch will be aborted to avoid a race condition. - Add a new
runPowerShellScriptfunction.
- Fixed an issue where arguments weren't passed to
withCache.
- Add a new
withCachefunction.
- Fixed an issue where setting
timeoutto0inrunAppleScriptwould not work.
- Add a new `executeSQL function.
- Add a new
createDeeplinkfunction.
- Fixed the bug where
failureToastOptionsdid not apply foruseExecanduseStreamJSONhooks.
- Avoid throwing an error when
useFetchcan't parse theContent-Typeheader of the response.
- Fix an issue where
URLSearchParamscouldn't be passed as an option touseFetchoruseCachedPromise, causing extensions to crash.
- Fixed the refresh token flow to log out the user instead of throwing an error.
- Fixed an issue where
bodyEncodingwasn't properly used in OAuthService.
- Add a
failureToastOptionsprop touseFetch,useCachedPromise, andusePromiseto make it possible to customize the error displayed instead of a generic "Failed to fetch latest data".
- Add
useLocalStoragehook.
- Add
useStreamJSONhook.
- Updated
useFetch'smapResulttype to allow returningcursorin addition todataandhasMore.
- Extended
PaginationOptionswithcursor.
- Fixed non-paginated version of
useFetchnot being re-run whenurlchanges.
- Fixed
optimisticUpdatenot working when paginating beyond the first page when usinguseCachedPromiseor other hooks that build on top of it.. - Fixed
useFetchtype requiringmapResultfor non-paginated overload.
- Added default OAuth URLs for Google, Jira, and Zoom
- Fixed
useFetchtype for non-paginated overload.
- Added pagination support to
usePromise,useCachedPromiseanduseFetch.
- Add string array support for OAuth scope (Thanks @tonka3000!).
- Add
tokenResponseParserandtokenRefreshResponseParserin the options ofOAuthService. - Fix built-in Slack OAuthServices.
- Fixed bodyEncoding for some built-in OAuthServices.
- Fixed types for
OAuthService.slack.
- Fixed the refresh flow of
OAuthServicethat would return outdated tokens.
- Removed some default OAuth clientIDs that could not work with generic scopes.
- Fixed
withAccessTokenwhen used in no-view commands.
- Fixed Google OAuth configuration.
- Added the OAuth utils.
- Fix an issue where the values passed to the
resetfunction of theuseFormhook wouldn't be respected.
- Add a new
showFailureToastfunction.
- Fix an issue where
useForm'sresetfunction would not reset the value of some fields (which defeats its purpose...)
- Add a new
useFrecencySortinghook. - Change the default
options.timeoutofuseExecto 10s.
- Add a new
runAppleScriptfunction. - Change the default
options.timeoutofuseExecto 10s.
Change the signature of getProgressIcon to accept a Color in addition to a string for the options.background.
Change the signature of getProgressIcon to accept a Color in addition to a string for the color.
Added the useAI hook.
Added the useSQL hook.
- Added the
resetmethod touseForm.
- Added the
focusmethod touseForm. - Added the
inputoption touseExec.
Added useExec and useForm hooks.
Added getFavicon method.
First release of the utilities.
