Skip to content

Commit

Permalink
Add more models
Browse files Browse the repository at this point in the history
  • Loading branch information
n2o committed Sep 12, 2024
1 parent 4cd103a commit 312eb6f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ getImageUrlForSize(annoyotronImage, "large")
// => returns the large URL of the image, if available. If not, it returns the next best size, i.e. medium, and so on.
```

## Models

There are plenty of common models, e.g. API Responses, Image attributes etc.
Check out the [src/models.ts](src/models.ts).

## Release

To release a new version, run the following command:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@schnaq/strapi4-utils",
"version": "1.1.1",
"version": "1.2.0",
"description": "Utility functions for working with Strapi v4",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
15 changes: 15 additions & 0 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ export type StrapiBaseProps = {
publishedAt?: string | Date
}

export type StrapiSearchParams = {
populate?: string[] | Record<string, any>
pagination?: {
page: number
pageSize?: number
withCount?: boolean
start?: number
limit?: number
}
sort?: string[]
filter?: Record<string, any>
publicationState?: "live" | "preview"
fields?: string[]
}

export type StrapiResponse<T> = {
data: T
error?: {
Expand Down

0 comments on commit 312eb6f

Please sign in to comment.