| 1 |
<?php |
| 2 |
namespace Elementor\Core\App\Modules\KitLibrary\Connect; |
| 3 |
|
| 4 |
use Elementor\Core\Common\Modules\Connect\Apps\Library; |
| 5 |
|
| 6 |
if ( ! defined( 'ABSPATH' ) ) { |
| 7 |
exit; // Exit if accessed directly |
| 8 |
} |
| 9 |
|
| 10 |
class Kit_Library extends Library { |
| 11 |
const DEFAULT_BASE_ENDPOINT = 'https://my.elementor.com/api/v1/kits-library'; |
| 12 |
const FALLBACK_BASE_ENDPOINT = 'https://ms-8874.elementor.com/api/v1/kits-library'; |
| 13 |
|
| 14 |
public function get_title() { |
| 15 |
return __( 'Kit Library', 'elementor' ); |
| 16 |
} |
| 17 |
|
| 18 |
public function get_all() { |
| 19 |
return $this->http_request( 'GET', 'kits' ); |
| 20 |
} |
| 21 |
|
| 22 |
public function get_taxonomies() { |
| 23 |
return $this->http_request( 'GET', 'taxonomies' ); |
| 24 |
} |
| 25 |
|
| 26 |
public function get_manifest( $id ) { |
| 27 |
return $this->http_request( 'GET', "kits/{$id}/manifest" ); |
| 28 |
} |
| 29 |
|
| 30 |
public function download_link( $id ) { |
| 31 |
return $this->http_request( 'GET', "kits/{$id}/download-link" ); |
| 32 |
} |
| 33 |
|
| 34 |
protected function get_api_url() { |
| 35 |
return [ |
| 36 |
static::DEFAULT_BASE_ENDPOINT, |
| 37 |
static::FALLBACK_BASE_ENDPOINT, |
| 38 |
]; |
| 39 |
} |
| 40 |
|
| 41 |
protected function init() { |
| 42 |
// Remove parent init actions. |
| 43 |
} |
| 44 |
} |
| 45 |
|