@fleetbase/registry-bridge-engine 0.1.6 → 0.1.8
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/addon/extension.js
CHANGED
|
@@ -5,7 +5,33 @@ export default {
|
|
|
5
5
|
const menuService = universe.getService('menu');
|
|
6
6
|
|
|
7
7
|
// Register menu item in header
|
|
8
|
-
menuService.registerHeaderMenuItem('Extensions', 'console.extensions', {
|
|
8
|
+
menuService.registerHeaderMenuItem('Extensions', 'console.extensions', {
|
|
9
|
+
icon: 'shapes',
|
|
10
|
+
priority: 99,
|
|
11
|
+
id: 'registry-bridge',
|
|
12
|
+
slug: 'registry-bridge',
|
|
13
|
+
description: 'Discover, install, and publish extensions to the Fleetbase extension registry.',
|
|
14
|
+
shortcuts: [
|
|
15
|
+
{
|
|
16
|
+
title: 'Explore',
|
|
17
|
+
description: 'Browse and discover extensions available in the registry.',
|
|
18
|
+
icon: 'compass',
|
|
19
|
+
route: 'console.extensions.explore',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: 'Installed',
|
|
23
|
+
description: 'View and manage extensions currently installed in your console.',
|
|
24
|
+
icon: 'puzzle-piece',
|
|
25
|
+
route: 'console.extensions.installed',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: 'Purchased',
|
|
29
|
+
description: 'Access extensions you have purchased from the registry.',
|
|
30
|
+
icon: 'receipt',
|
|
31
|
+
route: 'console.extensions.purchased',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
});
|
|
9
35
|
|
|
10
36
|
// Register admin controls
|
|
11
37
|
menuService.registerAdminMenuPanel(
|
package/composer.json
CHANGED
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/registry-bridge-engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Internal Bridge between Fleetbase API and Extensions Registry",
|
|
5
5
|
"fleetbase": {
|
|
6
6
|
"route": "extensions"
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@babel/core": "^7.23.2",
|
|
42
|
-
"@fleetbase/ember-core": "^0.3.
|
|
43
|
-
"@fleetbase/ember-ui": "^0.3.
|
|
42
|
+
"@fleetbase/ember-core": "^0.3.17",
|
|
43
|
+
"@fleetbase/ember-ui": "^0.3.25",
|
|
44
44
|
"@fortawesome/ember-fontawesome": "^2.0.0",
|
|
45
45
|
"@fortawesome/fontawesome-svg-core": "6.4.0",
|
|
46
46
|
"@fortawesome/free-brands-svg-icons": "6.4.0",
|
|
@@ -8,6 +8,7 @@ use Fleetbase\Models\Setting;
|
|
|
8
8
|
use Fleetbase\RegistryBridge\Http\Controllers\RegistryBridgeController;
|
|
9
9
|
use Fleetbase\RegistryBridge\Http\Requests\CreateRegistryExtensionRequest;
|
|
10
10
|
use Fleetbase\RegistryBridge\Http\Requests\RegistryExtensionActionRequest;
|
|
11
|
+
use Fleetbase\RegistryBridge\Http\Resources\PublicRegistryExtension;
|
|
11
12
|
use Fleetbase\RegistryBridge\Models\RegistryExtension;
|
|
12
13
|
use Fleetbase\RegistryBridge\Support\Utils;
|
|
13
14
|
use Illuminate\Http\Request;
|
|
@@ -41,14 +42,15 @@ class RegistryExtensionController extends RegistryBridgeController
|
|
|
41
42
|
|
|
42
43
|
$extensions = \Illuminate\Support\Facades\Cache::remember($cacheKey, $cacheTtl, function () {
|
|
43
44
|
return RegistryExtension::where('status', 'published')
|
|
44
|
-
->with(['
|
|
45
|
-
->
|
|
45
|
+
->with(['company', 'category', 'currentBundle'])
|
|
46
|
+
->withCount('installs')
|
|
47
|
+
->orderBy('installs_count', 'desc')
|
|
46
48
|
->get();
|
|
47
49
|
});
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
PublicRegistryExtension::withoutWrapping();
|
|
50
52
|
|
|
51
|
-
return
|
|
53
|
+
return PublicRegistryExtension::collection($extensions);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
/**
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Fleetbase\RegistryBridge\Http\Resources;
|
|
4
|
+
|
|
5
|
+
use Fleetbase\Http\Resources\FleetbaseResource;
|
|
6
|
+
|
|
7
|
+
class PublicRegistryExtension extends FleetbaseResource
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Transform the resource into an array.
|
|
11
|
+
*
|
|
12
|
+
* Only exposes fields that are safe for public consumption.
|
|
13
|
+
* No UUIDs, no Stripe data, no internal IDs, no bundle file relationships,
|
|
14
|
+
* no purchase/install relationships, no sensitive company data.
|
|
15
|
+
*
|
|
16
|
+
* @param \Illuminate\Http\Request $request
|
|
17
|
+
*
|
|
18
|
+
* @return array
|
|
19
|
+
*/
|
|
20
|
+
public function toArray($request)
|
|
21
|
+
{
|
|
22
|
+
return [
|
|
23
|
+
// Core identity (public_id only, no uuid)
|
|
24
|
+
'id' => $this->public_id,
|
|
25
|
+
'slug' => $this->slug,
|
|
26
|
+
'name' => $this->name,
|
|
27
|
+
'subtitle' => $this->subtitle,
|
|
28
|
+
'description' => $this->description,
|
|
29
|
+
'promotional_text' => $this->promotional_text,
|
|
30
|
+
'fa_icon' => $this->fa_icon,
|
|
31
|
+
'icon_url' => $this->icon_url,
|
|
32
|
+
'tags' => $this->tags ?? [],
|
|
33
|
+
'languages' => $this->languages ?? [],
|
|
34
|
+
'primary_language' => $this->primary_language,
|
|
35
|
+
'version' => $this->version,
|
|
36
|
+
'status' => $this->status,
|
|
37
|
+
|
|
38
|
+
// URLs
|
|
39
|
+
'website_url' => $this->website_url,
|
|
40
|
+
'repo_url' => $this->repo_url,
|
|
41
|
+
'support_url' => $this->support_url,
|
|
42
|
+
'privacy_policy_url' => $this->privacy_policy_url,
|
|
43
|
+
'tos_url' => $this->tos_url,
|
|
44
|
+
'copyright' => $this->copyright,
|
|
45
|
+
|
|
46
|
+
// Pricing (public-safe fields only, no Stripe IDs)
|
|
47
|
+
'payment_required' => $this->payment_required,
|
|
48
|
+
'price' => $this->price,
|
|
49
|
+
'sale_price' => $this->sale_price,
|
|
50
|
+
'on_sale' => $this->on_sale,
|
|
51
|
+
'currency' => $this->currency,
|
|
52
|
+
'subscription_required' => $this->subscription_required,
|
|
53
|
+
|
|
54
|
+
// Flags
|
|
55
|
+
'core_extension' => $this->core_extension,
|
|
56
|
+
'self_managed' => $this->self_managed,
|
|
57
|
+
|
|
58
|
+
// Stats
|
|
59
|
+
'installs_count' => $this->installs_count ?? 0,
|
|
60
|
+
|
|
61
|
+
// Timestamps
|
|
62
|
+
'published_at' => $this->published_at,
|
|
63
|
+
'created_at' => $this->created_at,
|
|
64
|
+
'updated_at' => $this->updated_at,
|
|
65
|
+
|
|
66
|
+
// Publisher (minimal safe fields only)
|
|
67
|
+
'publisher' => $this->when($this->relationLoaded('company') && $this->company, [
|
|
68
|
+
'name' => data_get($this, 'company.name'),
|
|
69
|
+
'slug' => data_get($this, 'company.slug'),
|
|
70
|
+
'type' => data_get($this, 'company.type'),
|
|
71
|
+
'website_url' => data_get($this, 'company.website_url'),
|
|
72
|
+
'description' => data_get($this, 'company.description'),
|
|
73
|
+
]),
|
|
74
|
+
|
|
75
|
+
// Category (safe fields only, no UUIDs)
|
|
76
|
+
'category' => $this->when($this->relationLoaded('category') && $this->category, [
|
|
77
|
+
'id' => data_get($this, 'category.public_id'),
|
|
78
|
+
'name' => data_get($this, 'category.name'),
|
|
79
|
+
'slug' => data_get($this, 'category.slug'),
|
|
80
|
+
'description' => data_get($this, 'category.description'),
|
|
81
|
+
'icon' => data_get($this, 'category.icon'),
|
|
82
|
+
'icon_color' => data_get($this, 'category.icon_color'),
|
|
83
|
+
'tags' => data_get($this, 'category.tags', []),
|
|
84
|
+
]),
|
|
85
|
+
|
|
86
|
+
// Current bundle (status, version, meta, bundle_number only - no file relationships, no UUIDs)
|
|
87
|
+
'current_bundle' => $this->when($this->relationLoaded('currentBundle') && $this->currentBundle, [
|
|
88
|
+
'bundle_number' => data_get($this, 'currentBundle.bundle_number'),
|
|
89
|
+
'version' => data_get($this, 'currentBundle.version'),
|
|
90
|
+
'status' => data_get($this, 'currentBundle.status'),
|
|
91
|
+
'meta' => data_get($this, 'currentBundle.meta'),
|
|
92
|
+
]),
|
|
93
|
+
];
|
|
94
|
+
}
|
|
95
|
+
}
|