Skip to content

Commit

Permalink
four-point package releases for videopress and my-jetpack
Browse files Browse the repository at this point in the history
  • Loading branch information
CGastrell authored and matticbot committed Oct 27, 2023
1 parent 8c64010 commit cf6a708
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 76 deletions.
13 changes: 5 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.11.0] - 2023-10-23
### Added
- DSP media endpoints allowlisting. [#33598]
## [0.10.5-alpha] - unreleased

### Changed
- Updated package dependencies. [#33646] [#33687]
This is an alpha version! The changes listed here are not final.

### Fixed
- Fix unsetting `sub_path` in `Dashboard_REST_Controller`. [#33668]
### Changed
- Updated package dependencies.

## [0.10.4] - 2023-10-16
### Changed
Expand Down Expand Up @@ -225,7 +222,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Updated package dependencies. [#27906]

[0.11.0]: https://github.com/automattic/jetpack-blaze/compare/v0.10.4...v0.11.0
[0.10.5-alpha]: https://github.com/automattic/jetpack-blaze/compare/v0.10.4...v0.10.5-alpha
[0.10.4]: https://github.com/automattic/jetpack-blaze/compare/v0.10.3...v0.10.4
[0.10.3]: https://github.com/automattic/jetpack-blaze/compare/v0.10.2...v0.10.3
[0.10.2]: https://github.com/automattic/jetpack-blaze/compare/v0.10.1...v0.10.2
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-assets": "^1.18.13",
"automattic/jetpack-connection": "^1.58.2",
"automattic/jetpack-plans": "^0.3.5",
"automattic/jetpack-assets": "^1.18.12",
"automattic/jetpack-connection": "^1.58.1",
"automattic/jetpack-plans": "^0.3.4",
"automattic/jetpack-redirect": "^1.7.27",
"automattic/jetpack-status": "^1.18.5",
"automattic/jetpack-sync": "^1.60.0"
"automattic/jetpack-sync": "^1.58.1"
},
"require-dev": {
"yoast/phpunit-polyfills": "1.1.0",
Expand Down Expand Up @@ -53,7 +53,7 @@
"link-template": "https://github.com/automattic/jetpack-blaze/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-trunk": "0.11.x-dev"
"dev-trunk": "0.10.x-dev"
},
"textdomain": "jetpack-blaze",
"version-constants": {
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-blaze",
"version": "0.11.0",
"version": "0.10.5-alpha",
"description": "Attract high-quality traffic to your site using Blaze. Using this service, you can advertise a post or page on some of the millions of pages across WordPress.com and Tumblr from just $5 per day.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/blaze/#readme",
"bugs": {
Expand All @@ -23,16 +23,16 @@
},
"dependencies": {
"@automattic/jetpack-analytics": "^0.1.27",
"@automattic/jetpack-components": "^0.44.1",
"@automattic/jetpack-shared-extension-utils": "^0.12.4",
"@wordpress/block-editor": "12.12.0",
"@wordpress/components": "25.10.0",
"@wordpress/compose": "6.21.0",
"@wordpress/data": "9.14.0",
"@wordpress/element": "5.21.0",
"@wordpress/i18n": "4.44.0",
"@wordpress/icons": "9.35.0",
"@wordpress/plugins": "6.12.0",
"@automattic/jetpack-components": "^0.43.4",
"@automattic/jetpack-shared-extension-utils": "^0.12.3",
"@wordpress/block-editor": "12.11.0",
"@wordpress/components": "25.9.0",
"@wordpress/compose": "6.20.0",
"@wordpress/data": "9.13.0",
"@wordpress/element": "5.20.0",
"@wordpress/i18n": "4.43.0",
"@wordpress/icons": "9.34.0",
"@wordpress/plugins": "6.11.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
Expand All @@ -41,7 +41,7 @@
"@babel/core": "7.23.2",
"@babel/preset-env": "7.23.2",
"@babel/runtime": "7.23.2",
"@wordpress/browserslist-config": "5.27.0",
"@wordpress/browserslist-config": "5.26.0",
"sass": "1.64.1",
"sass-loader": "12.4.0",
"webpack": "5.76.0",
Expand Down
54 changes: 4 additions & 50 deletions src/class-dashboard-rest-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,6 @@ public function register_rest_routes() {
)
);

// WordAds DSP API media query routes
register_rest_route(
static::$namespace,
sprintf( '/sites/%1$d/wordads/dsp/api/v1/wpcom/sites/%1$d/media(?P<sub_path>[a-zA-Z0-9-_\/]*)(\?.*)?', $site_id ),
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_dsp_media' ),
'permission_callback' => array( $this, 'can_user_view_dsp_callback' ),
)
);

// WordAds DSP API media openverse query routes
register_rest_route(
static::$namespace,
sprintf( '/sites/%1$d/wordads/dsp/api/v1/wpcom/media(?P<sub_path>[a-zA-Z0-9-_\/]*)(\?.*)?', $site_id ),
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_dsp_openverse' ),
'permission_callback' => array( $this, 'can_user_view_dsp_callback' ),
)
);

// WordAds DSP API Experiment route
register_rest_route(
static::$namespace,
Expand Down Expand Up @@ -296,8 +274,8 @@ public function get_blaze_posts( $req ) {
}

// We don't use sub_path in the blaze posts, only query strings
if ( isset( $req['sub_path'] ) ) {
unset( $req['sub_path'] );
if ( isset( $params['sub_path'] ) ) {
unset( $req->get_params()['sub_path'] );
}

return $this->request_as_user(
Expand Down Expand Up @@ -344,37 +322,13 @@ public function get_dsp_blaze_posts( $req ) {
}

// We don't use sub_path in the blaze posts, only query strings
if ( isset( $req['sub_path'] ) ) {
unset( $req['sub_path'] );
if ( isset( $params['sub_path'] ) ) {
unset( $req->get_params()['sub_path'] );
}

return $this->get_dsp_generic( sprintf( 'v1/wpcom/sites/%d/blaze/posts', $site_id ), $req );
}

/**
* Redirect GET requests to WordAds DSP Blaze media endpoint for the site.
*
* @param WP_REST_Request $req The request object.
* @return array|WP_Error
*/
public function get_dsp_media( $req ) {
$site_id = $this->get_site_id();
if ( is_wp_error( $site_id ) ) {
return array();
}
return $this->get_dsp_generic( sprintf( 'v1/wpcom/sites/%d/media', $site_id ), $req );
}

/**
* Redirect GET requests to WordAds DSP Blaze openverse endpoint.
*
* @param WP_REST_Request $req The request object.
* @return array|WP_Error
*/
public function get_dsp_openverse( $req ) {
return $this->get_dsp_generic( 'v1/wpcom/media', $req );
}

/**
* Redirect GET requests to WordAds DSP Credits endpoint for the site.
*
Expand Down
2 changes: 1 addition & 1 deletion src/class-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Dashboard {
*
* @var string
*/
const PACKAGE_VERSION = '0.11.0';
const PACKAGE_VERSION = '0.10.5-alpha';

/**
* List of dependencies needed to render the dashboard in wp-admin.
Expand Down

0 comments on commit cf6a708

Please sign in to comment.