diff --git a/package-lock.json b/package-lock.json index e8e94e137c..ed2b0ec1df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@types/wordpress__edit-post": "^8.4.2", "@types/wordpress__wordcount": "^2.4.5", "@typescript-eslint/eslint-plugin": "^6.21.0", - "@wordpress/api-fetch": "7.29", + "@wordpress/api-fetch": "7.36", "@wordpress/babel-preset-default": "^7.42.0", "@wordpress/block-editor": "^15.6.0", "@wordpress/blocks": "^15.9.0", @@ -2257,7 +2257,6 @@ "integrity": "sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@emotion/memoize": "^0.9.0" } @@ -8346,15 +8345,14 @@ } }, "node_modules/@wordpress/api-fetch": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.29.0.tgz", - "integrity": "sha512-5Z3qtbMCqbvpqHufIxI85T3sloCN5c/10BKd9hzdllEpTONhUAWf42jsVyBYsXh2ZHvq0FekQhs2RdE30cLKAA==", + "version": "7.36.0", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.36.0.tgz", + "integrity": "sha512-71yTZi1tSqYbfzT5O+Cx2L2gWpp3y+twdch8mGIzpRmNDz6L/NvntIko7Qmc73tu3dSVC7KakvEmCduOaDNKRQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@babel/runtime": "7.25.7", - "@wordpress/i18n": "^6.2.0", - "@wordpress/url": "^4.29.0" + "@wordpress/i18n": "^6.9.0", + "@wordpress/url": "^4.36.0" }, "engines": { "node": ">=18.12.0", @@ -8494,21 +8492,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/block-editor/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/base-styles": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-6.9.0.tgz", @@ -8620,21 +8603,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/block-library/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/block-library/node_modules/@wordpress/base-styles": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-6.9.0.tgz", @@ -8996,21 +8964,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/core-data/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/core-data/node_modules/@wordpress/undo-manager": { "version": "1.33.0", "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-1.33.0.tgz", @@ -9584,21 +9537,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/edit-post/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/edit-post/node_modules/@wordpress/base-styles": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-6.9.0.tgz", @@ -9700,21 +9638,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/editor/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/editor/node_modules/@wordpress/base-styles": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-6.9.0.tgz", @@ -10217,21 +10140,6 @@ "react": "^18.0.0" } }, - "node_modules/@wordpress/fields/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/fields/node_modules/@wordpress/base-styles": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-6.9.0.tgz", @@ -10535,21 +10443,6 @@ "npm": ">=8.19.2" } }, - "node_modules/@wordpress/media-utils/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/notices": { "version": "5.33.0", "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-5.33.0.tgz", @@ -11316,21 +11209,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/server-side-render/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/shortcode": { "version": "4.36.0", "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-4.36.0.tgz", @@ -11464,21 +11342,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/upload-media/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/url": { "version": "4.36.0", "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-4.36.0.tgz", @@ -11552,21 +11415,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/widgets/node_modules/@wordpress/api-fetch": { - "version": "7.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-7.33.0.tgz", - "integrity": "sha512-1hUMnX7t+PFBgNNZIITOY8w9J3/ZcVm3sT2gxURPaz1B1BE7LwLwQQyqUWi6hl4Z0eh5qUcEG5HJOUZTGLmVwA==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@wordpress/i18n": "^6.6.0", - "@wordpress/url": "^4.33.0" - }, - "engines": { - "node": ">=18.12.0", - "npm": ">=8.19.2" - } - }, "node_modules/@wordpress/widgets/node_modules/@wordpress/base-styles": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-6.9.0.tgz", diff --git a/package.json b/package.json index 3e1ee9cef6..9c12b606f0 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@types/wordpress__edit-post": "^8.4.2", "@types/wordpress__wordcount": "^2.4.5", "@typescript-eslint/eslint-plugin": "^6.21.0", - "@wordpress/api-fetch": "7.29", + "@wordpress/api-fetch": "7.36", "@wordpress/babel-preset-default": "^7.42.0", "@wordpress/block-editor": "^15.6.0", "@wordpress/blocks": "^15.9.0", diff --git a/src/content-helper/common/providers/base-provider.tsx b/src/content-helper/common/providers/base-provider.tsx index fbe10859d6..85cf93b48c 100644 --- a/src/content-helper/common/providers/base-provider.tsx +++ b/src/content-helper/common/providers/base-provider.tsx @@ -148,7 +148,7 @@ export abstract class BaseProvider { options.signal = abortController.signal; try { - const response = await apiFetch>( options ); + const response = await apiFetch>( options as APIFetchOptions ); // Validate API side errors. if ( response.error ) { diff --git a/src/content-helper/common/providers/base-wordpress-provider.tsx b/src/content-helper/common/providers/base-wordpress-provider.tsx index f60f981e31..213d8790ea 100644 --- a/src/content-helper/common/providers/base-wordpress-provider.tsx +++ b/src/content-helper/common/providers/base-wordpress-provider.tsx @@ -151,7 +151,7 @@ export abstract class BaseWordPressProvider extends BaseProvider { try { // Fetch the raw Response object. - const response = ( await apiFetch( options ) ) as Response; + const response = await apiFetch( options as APIFetchOptions ) as Response; // Access headers from the response. const totalItemsHeader = response.headers.get( 'X-WP-Total' );