PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / trunk
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! vtrunk
3.8.0 3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 All 112 releases
templately / modules / ai-studio / module.php

module.php in Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! trunk, at modules/ai-studio/module.php

46 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * AI-Studio module.
4 *
5 * "AI Studio" in the cloud sidebar — every site this account generated through
6 * Templately AI, so a generation can be re-imported at any time instead of the
7 * user having to keep its templately.com link, plus the credit balance and
8 * usage history that sit alongside it.
9 *
10 * Ported from `latest`, where the endpoints lived as `includes/API/AiCredit.php`
11 * and the screen as `profile/AiSites.js` + `profile/CreditsTab.js`.
12 *
13 * The LIST of generations is not here: it is
14 * `ai-content/chatbot-conversations` in `modules/ai-fsi`, alongside the
15 * single-conversation route it is the plural of, and this module reaches it by
16 * URL rather than by importing that module.
17 *
18 * @package Templately
19 */
20
21 namespace Templately\Modules\AiStudio;
22
23 use Templately\Core\Module_Base;
24 use Templately\Modules\AiStudio\REST\AiCredit;
25
26 class Module extends Module_Base {
27
28 public function get_name(): string {
29 return 'ai-studio';
30 }
31
32 /**
33 * NOTE: no `get_dependencies()` on ai-fsi or full-site-import.
34 *
35 * The screen's Import action dispatches `triggerFSIHandleClick` and mounts a
36 * headless `FullSiteImport`, which are JS-side imports resolved through the
37 * single first-party bundle graph — not a PHP boot-order edge. The endpoint
38 * it reads is reached by route string. Declaring a dependency here would
39 * assert an ordering constraint that does not exist, and this module boots
40 * fine with either of those absent.
41 */
42 public function register_rest_routes(): void {
43 AiCredit::get_instance()->register_routes();
44 }
45 }
46