@evenicanpm/cms 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evenicanpm/cms",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Strapi 5 client and queries for e4 Headless.",
5
5
  "author": "Evenica",
6
6
  "type": "module",
@@ -16,5 +16,5 @@
16
16
  "devDependencies": {
17
17
  "@types/node": "^24.0.13"
18
18
  },
19
- "gitHead": "7552c1e700a0027b8a65506c77cb10dae092fdfb"
19
+ "gitHead": "bbaff05f6f592114ad7a25caeee531e4fa1b14cf"
20
20
  }
@@ -7,8 +7,8 @@
7
7
 
8
8
  export interface Blog {
9
9
  title: string;
10
- content: any;
11
- image: any;
10
+ content: unknown;
11
+ image: unknown;
12
12
  documentId: string;
13
13
  id: number;
14
14
  shortDescription: string;
@@ -17,7 +17,7 @@ export interface Page {
17
17
  // blocks.seo component
18
18
  metaTitle?: string;
19
19
  metaDescription?: string;
20
- shareImage?: any;
20
+ shareImage?: { media: { url: string } };
21
21
  metaImage?: { media: { url: string } };
22
22
  metaKeywords: Array<string>;
23
23
  meta: Array<MetaElement>;
@@ -1,11 +1,26 @@
1
- export type imageSizes = "small" | "medium" | "large" | "thumbnail";
1
+ export interface ImageFormat {
2
+ ext: string;
3
+ url: string;
4
+ hash: string;
5
+ mime: string;
6
+ name: string;
7
+ path: string | null;
8
+ size: number;
9
+ width: number;
10
+ height: number;
11
+ }
12
+
13
+ export interface Formats {
14
+ [size: string]: ImageFormat;
15
+ }
16
+
2
17
  // Media
3
18
  /**
4
19
  * @param formats formats array from CMS data
5
20
  * @param size size of the image
6
21
  * @returns largest available image url
7
22
  */
8
- export const getImageUrl = (formats: any, size?: imageSizes) => {
23
+ export const getImageUrl = (formats: Formats, size?: string) => {
9
24
  if (size) {
10
25
  return formats[size]?.url;
11
26
  }