@fleetbase/registry-bridge-engine 0.0.17 → 0.0.19
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/components/extension-card.js +1 -1
- package/addon/components/extension-form.js +1 -1
- package/addon/components/modals/extension-details.hbs +13 -13
- package/addon/engine.js +1 -1
- package/composer.json +1 -7
- package/extension.json +1 -1
- package/package.json +3 -3
- package/server/src/Http/Controllers/Internal/v1/ExtensionInstallerController.php +2 -2
- package/server/src/Http/Controllers/Internal/v1/RegistryAuthController.php +10 -1
- package/server/src/Http/Controllers/Internal/v1/RegistryController.php +2 -3
- package/server/src/Http/Controllers/Internal/v1/RegistryExtensionController.php +2 -2
- package/translations/en-us.yaml +2 -0
|
@@ -165,7 +165,7 @@ export default class ExtensionCardComponent extends Component {
|
|
|
165
165
|
async selfManagedInstallInstructions(options = {}) {
|
|
166
166
|
await this.modalsManager.done();
|
|
167
167
|
this.modalsManager.show('modals/self-managed-install-instructions', {
|
|
168
|
-
title: 'Install
|
|
168
|
+
title: 'Install Extension to Self-Hosted Instance',
|
|
169
169
|
hideDeclineButton: true,
|
|
170
170
|
acceptButtonText: 'Done',
|
|
171
171
|
...options,
|
|
@@ -171,7 +171,7 @@ export default class ExtensionFormComponent extends Component {
|
|
|
171
171
|
async selfManagedInstallInstructions(options = {}) {
|
|
172
172
|
await this.modalsManager.done();
|
|
173
173
|
this.modalsManager.show('modals/self-managed-install-instructions', {
|
|
174
|
-
title: 'Install
|
|
174
|
+
title: 'Install Extension to Self-Hosted Instance',
|
|
175
175
|
hideDeclineButton: true,
|
|
176
176
|
acceptButtonText: 'Done',
|
|
177
177
|
...options,
|
|
@@ -69,21 +69,21 @@
|
|
|
69
69
|
{{/if}}
|
|
70
70
|
</div>
|
|
71
71
|
</div>
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
{{#if @options.viewSelfManagesInstallInstructions}}
|
|
73
|
+
<div class="space-y-2">
|
|
74
74
|
<div>
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
<Button
|
|
76
|
+
@size="xs"
|
|
77
|
+
@type="magic"
|
|
78
|
+
@text={{t "registry-bridge.component.extension-details-modal.self-hosted-install"}}
|
|
79
|
+
@helpText={{t "registry-bridge.component.extension-details-modal.self-hosted-install-help-text"}}
|
|
80
|
+
@tooltipPlacement="right"
|
|
81
|
+
@onClick={{@options.viewSelfManagesInstallInstructions}}
|
|
82
|
+
@icon="circle-info"
|
|
83
|
+
/>
|
|
84
84
|
</div>
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
</div>
|
|
86
|
+
{{/if}}
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
89
89
|
</div>
|
package/addon/engine.js
CHANGED
|
@@ -19,7 +19,7 @@ export default class RegistryBridgeEngine extends Engine {
|
|
|
19
19
|
};
|
|
20
20
|
setupExtension = function (app, engine, universe) {
|
|
21
21
|
// Register menu item in header
|
|
22
|
-
universe.registerHeaderMenuItem('Extensions', 'console.extensions', { icon: 'shapes', priority: 99, slug: 'registry-bridge' });
|
|
22
|
+
universe.registerHeaderMenuItem('Extensions', 'console.extensions', { icon: 'shapes', priority: 99, id: 'registry-bridge', slug: 'registry-bridge' });
|
|
23
23
|
// Register admin controls
|
|
24
24
|
universe.registerAdminMenuPanel(
|
|
25
25
|
'Extensions Registry',
|
package/composer.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fleetbase/registry-bridge",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Internal Bridge between Fleetbase API and Extensions Registry",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fleetbase-extension",
|
|
@@ -33,12 +33,6 @@
|
|
|
33
33
|
"phpstan/phpstan": "^1.10.38",
|
|
34
34
|
"symfony/var-dumper": "^5.4.29"
|
|
35
35
|
},
|
|
36
|
-
"repositories": [
|
|
37
|
-
{
|
|
38
|
-
"type": "vcs",
|
|
39
|
-
"url": "https://github.com/fleetbase/laravel-model-caching"
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
36
|
"autoload": {
|
|
43
37
|
"psr-4": {
|
|
44
38
|
"Fleetbase\\RegistryBridge\\": "server/src/",
|
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/registry-bridge-engine",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
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": "
|
|
43
|
-
"@fleetbase/ember-ui": "
|
|
42
|
+
"@fleetbase/ember-core": "latest",
|
|
43
|
+
"@fleetbase/ember-ui": "latest",
|
|
44
44
|
"@fortawesome/ember-fontawesome": "^2.0.0",
|
|
45
45
|
"@fortawesome/fontawesome-svg-core": "6.4.0",
|
|
46
46
|
"@fortawesome/free-solid-svg-icons": "6.4.0",
|
|
@@ -36,7 +36,7 @@ class ExtensionInstallerController extends Controller
|
|
|
36
36
|
$extension = RegistryExtension::where('public_id', $request->input('extension'))->first();
|
|
37
37
|
|
|
38
38
|
// Check if already installed
|
|
39
|
-
$installed = RegistryExtensionInstall::
|
|
39
|
+
$installed = RegistryExtensionInstall::where(['company_uuid' => session('company'), 'extension_uuid' => $extension->uuid])->exists();
|
|
40
40
|
if ($installed) {
|
|
41
41
|
return response()->error('This extension is already installed.');
|
|
42
42
|
}
|
|
@@ -105,7 +105,7 @@ class ExtensionInstallerController extends Controller
|
|
|
105
105
|
$uninstalled = false;
|
|
106
106
|
|
|
107
107
|
// Check if already uninstalled
|
|
108
|
-
$uninstalled = RegistryExtensionInstall::
|
|
108
|
+
$uninstalled = RegistryExtensionInstall::where(['company_uuid' => session('company'), 'extension_uuid' => $extension->uuid])->doesntExist();
|
|
109
109
|
if ($uninstalled) {
|
|
110
110
|
return response()->error('This extension is not installed.');
|
|
111
111
|
}
|
|
@@ -187,8 +187,17 @@ class RegistryAuthController extends Controller
|
|
|
187
187
|
return response()->json(['allowed' => true]);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
// if no identity provided
|
|
191
|
+
if (!$identity) {
|
|
192
|
+
return response()->error('No identity provided.', 401);
|
|
193
|
+
}
|
|
194
|
+
|
|
190
195
|
// Get registry user via identity
|
|
191
|
-
|
|
196
|
+
try {
|
|
197
|
+
$registryUser = RegistryUser::findFromUsername($identity);
|
|
198
|
+
} catch (\Exception $e) {
|
|
199
|
+
return response()->error($e->getMessage(), 401);
|
|
200
|
+
}
|
|
192
201
|
|
|
193
202
|
// If registry user is admin allow access
|
|
194
203
|
if ($registryUser->is_admin) {
|
|
@@ -49,7 +49,7 @@ class RegistryController extends Controller
|
|
|
49
49
|
public function getInstalledEngines(Request $request)
|
|
50
50
|
{
|
|
51
51
|
if ($request->session()->has('company')) {
|
|
52
|
-
$installedExtensions = RegistryExtension::
|
|
52
|
+
$installedExtensions = RegistryExtension::whereHas('installs', function ($query) {
|
|
53
53
|
$query->where('company_uuid', session('company'));
|
|
54
54
|
})->get()->map(function ($extension) {
|
|
55
55
|
return $extension->currentBundle->meta['package.json'] ?? [];
|
|
@@ -77,8 +77,7 @@ class RegistryController extends Controller
|
|
|
77
77
|
$engine = $request->input('engine');
|
|
78
78
|
|
|
79
79
|
if ($request->session()->has('company') && $engine) {
|
|
80
|
-
$installed = RegistryExtension::
|
|
81
|
-
->whereHas(
|
|
80
|
+
$installed = RegistryExtension::whereHas(
|
|
82
81
|
'currentBundle',
|
|
83
82
|
function ($query) use ($engine) {
|
|
84
83
|
$query->where('meta->package.json->name', $engine);
|
|
@@ -68,7 +68,7 @@ class RegistryExtensionController extends RegistryBridgeController
|
|
|
68
68
|
*/
|
|
69
69
|
public function installed()
|
|
70
70
|
{
|
|
71
|
-
$installedExtensions = RegistryExtension::
|
|
71
|
+
$installedExtensions = RegistryExtension::whereHas('installs', function ($query) {
|
|
72
72
|
$query->where('company_uuid', session('company'));
|
|
73
73
|
})->get();
|
|
74
74
|
|
|
@@ -92,7 +92,7 @@ class RegistryExtensionController extends RegistryBridgeController
|
|
|
92
92
|
*/
|
|
93
93
|
public function purchased()
|
|
94
94
|
{
|
|
95
|
-
$purchasedExtensions = RegistryExtension::
|
|
95
|
+
$purchasedExtensions = RegistryExtension::whereHas('purchases', function ($query) {
|
|
96
96
|
$query->where('company_uuid', session('company'));
|
|
97
97
|
})->get();
|
|
98
98
|
|
package/translations/en-us.yaml
CHANGED
|
@@ -21,6 +21,8 @@ registry-bridge:
|
|
|
21
21
|
website: Website
|
|
22
22
|
self-managed: Self Managed
|
|
23
23
|
self-managed-help-text: A self-managed extension is designed for users who host Fleetbase on their own servers, outside of the cloud/SaaS environment. These extensions require manual installation and configuration. If you are using Fleetbase as a self-hosted instance, you can use these extensions to add additional features. However, they are not available for cloud/SaaS users.
|
|
24
|
+
self-hosted-install: Self Hosted Install
|
|
25
|
+
self-hosted-install-help-text: View self-hosted install instructions.
|
|
24
26
|
extension-pending-publish-viewer:
|
|
25
27
|
content-panel-title: Extensions Pending Publish
|
|
26
28
|
focused-extension-title: >
|