Skip to content

Commit

Permalink
Update strapi-raycast-extension extension (#16724)
Browse files Browse the repository at this point in the history
- Update CHANGELOG.md
- 1.0.1
- Remove Preferences type references
- Add Compatibility info
- Initial commit
  • Loading branch information
douwepausma authored Feb 2, 2025
1 parent a3a4cb0 commit 92673f4
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 12 deletions.
5 changes: 5 additions & 0 deletions extensions/strapi-raycast-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Strapi Changelog

## [Clean up] - 2025-01-30

- Remove remaining preferences type references
- Add 'Compatibility' section to README

## [Initial Version] - 2025-01-30
3 changes: 3 additions & 0 deletions extensions/strapi-raycast-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Strapi extension for Raycast. Explore your Strapi content & media all from within Raycast.

## Compatibility
This extension currently only supports Strapi v5 instances.

## Required settings
|Setting|Description|
|-------|-----------|
Expand Down
6 changes: 4 additions & 2 deletions extensions/strapi-raycast-extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extensions/strapi-raycast-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Strapi extension for Raycast",
"icon": "extension-icon.png",
"author": "douwepausma",
"version": "1.0.0",
"version": "1.0.1",
"categories": [
"Developer Tools"
],
Expand Down
4 changes: 2 additions & 2 deletions extensions/strapi-raycast-extension/src/explore-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { kindName, entryTtile, entrySubtitle, capitalize } from "./lib/utils";

export default function ExploreContent() {
const { isLoading, data } = getContentTypes();
const { host } = getPreferenceValues<Preferences>();
const { host } = getPreferenceValues();

return (
<List isLoading={isLoading}>
Expand Down Expand Up @@ -42,7 +42,7 @@ export default function ExploreContent() {
}

function Entries({ contentType }: { contentType: ContentType }) {
const { host } = getPreferenceValues<Preferences>();
const { host } = getPreferenceValues();
const { data, isLoading } = getEntries(contentType.route);

return (
Expand Down
12 changes: 6 additions & 6 deletions extensions/strapi-raycast-extension/src/lib/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import fetch from "node-fetch";
* @returns An object containing the fetched content types and the state of the fetch request.
*/
export const getContentTypes = () => {
const { host, apiKey } = getPreferenceValues<Preferences>();
const { host, apiKey } = getPreferenceValues();

const res = useFetch<ContentTypesResponse>(`${host}/api/content-type-builder/content-types`, {
headers: {
Expand Down Expand Up @@ -44,7 +44,7 @@ export const getContentTypes = () => {
* @returns The fetched content type.
*/
export const getContentType = (uid: string) => {
const { host, apiKey } = getPreferenceValues<Preferences>();
const { host, apiKey } = getPreferenceValues();

const res = useFetch<ContentTypeResponse>(`${host}/api/content-type-builder/content-types/${uid}`, {
headers: {
Expand Down Expand Up @@ -74,7 +74,7 @@ export const getContentType = (uid: string) => {
* @returns An object containing the fetched entries and the state of the fetch request.
*/
export const getEntries = (route: string) => {
const { host, apiKey } = getPreferenceValues<Preferences>();
const { host, apiKey } = getPreferenceValues();

const res = useFetch<EntryResponse>(`${host}/api${route}?status=draft&pagination[limit]=10000`, {
headers: {
Expand All @@ -100,7 +100,7 @@ export const getEntries = (route: string) => {
* @param data - The data to submit.
*/
export const createEntry = async (route: string, data: object) => {
const { host, apiKey } = getPreferenceValues<Preferences>();
const { host, apiKey } = getPreferenceValues();

const res = await fetch(`${host}/api${route}`, {
method: "POST",
Expand All @@ -121,7 +121,7 @@ export const createEntry = async (route: string, data: object) => {
* @param uid - The UID of the component to fetch.
*/
export const getComponent = (uid: string) => {
const { host, apiKey } = getPreferenceValues<Preferences>();
const { host, apiKey } = getPreferenceValues();

const res = useFetch<ComponentResponse>(`${host}/api/content-type-builder/components/${uid}`, {
headers: {
Expand All @@ -141,7 +141,7 @@ export const getComponent = (uid: string) => {
* @returns An array containing the fetched files and the state of the fetch request.
*/
export const getFiles = () => {
const { host, apiKey } = getPreferenceValues<Preferences>();
const { host, apiKey } = getPreferenceValues();

const res = useFetch<StrapiFile[]>(`${host}/api/upload/files`, {
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StrapiFile } from "./types";

export default function SearchMediaLibrary() {
const files = getFiles();
const { host } = getPreferenceValues<Preferences>();
const { host } = getPreferenceValues();

return (
<List isShowingDetail isLoading={files.isLoading}>
Expand Down

0 comments on commit 92673f4

Please sign in to comment.