@betterportal/config-manager 11.0.9 → 11.0.10
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/lib/.bsb/clients/service-betterportal-config-manager.d.ts +1 -1
- package/lib/.bsb/clients/service-betterportal-config-manager.js +1 -1
- package/lib/bp-contracts/org.betterportal.config-manager.json +1 -1
- package/lib/plugins/service-betterportal-config-manager/adminApi.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/adminApi.js +22 -6
- package/lib/plugins/service-betterportal-config-manager/adminApi.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/_renderer.bootstrap5/GET.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/_renderer.bootstrap5/GET.js +2 -3
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/_renderer.bootstrap5/GET.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/_renderer.bootstrap5/GET.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/_renderer.bootstrap5/GET.js +1 -2
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/_renderer.bootstrap5/GET.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_renderer.bootstrap5/GET.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_renderer.bootstrap5/GET.js +2 -7
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_renderer.bootstrap5/GET.js.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/serviceConnections.d.ts +5 -0
- package/lib/plugins/service-betterportal-config-manager/serviceConnections.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/serviceConnections.js +11 -0
- package/lib/plugins/service-betterportal-config-manager/serviceConnections.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/setupTokens.d.ts.map +1 -1
- package/lib/plugins/service-betterportal-config-manager/setupTokens.js +6 -7
- package/lib/plugins/service-betterportal-config-manager/setupTokens.js.map +1 -1
- package/lib/schemas/service-betterportal-config-manager.json +1 -1
- package/lib/schemas/service-betterportal-config-manager.plugin.json +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated BSB virtual client for service-betterportal-config-manager
|
|
3
3
|
* DO NOT EDIT - Regenerated on every build
|
|
4
|
-
* @version 11.0.
|
|
4
|
+
* @version 11.0.10
|
|
5
5
|
*/
|
|
6
6
|
import { ServiceClient, BSBService } from "@bsb/base";
|
|
7
7
|
import type { Observable, BSBServiceClientDefinition, EventInputType } from "@bsb/base";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto-generated BSB virtual client for service-betterportal-config-manager
|
|
3
3
|
* DO NOT EDIT - Regenerated on every build
|
|
4
|
-
* @version 11.0.
|
|
4
|
+
* @version 11.0.10
|
|
5
5
|
*/
|
|
6
6
|
import { ServiceClient, importPortableSchema, createFireAndForgetEvent, createBroadcastEvent, createEventSchemas } from "@bsb/base";
|
|
7
7
|
const _webhookDeliveryAvailableSchema = importPortableSchema(JSON.parse("{\"anyvaliVersion\":\"1.0\",\"schemaVersion\":\"1.1\",\"root\":{\"kind\":\"object\",\"properties\":{},\"required\":[],\"unknownKeys\":\"strip\"},\"definitions\":{},\"extensions\":{}}"));
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"pluginId": "org.betterportal.config-manager",
|
|
5
5
|
"title": "BetterPortal Config Manager",
|
|
6
6
|
"description": "Admin-facing BetterPortal service for discovering and managing service config surfaces.",
|
|
7
|
-
"version": "11.0.
|
|
7
|
+
"version": "11.0.10",
|
|
8
8
|
"category": "service",
|
|
9
9
|
"deploymentModes": [
|
|
10
10
|
"self-hosted"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adminApi.d.ts","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/adminApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2C,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhH,OAAO,KAAK,EACV,iBAAiB,EAEjB,mBAAmB,EACnB,SAAS,EACV,MAAM,yBAAyB,CAAC;AAejC,OAAO,KAAK,EAAuE,kBAAkB,EAAE,eAAe,EAAgE,MAAM,yBAAyB,CAAC;AACtN,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"adminApi.d.ts","sourceRoot":"","sources":["../../../src/plugins/service-betterportal-config-manager/adminApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2C,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhH,OAAO,KAAK,EACV,iBAAiB,EAEjB,mBAAmB,EACnB,SAAS,EACV,MAAM,yBAAyB,CAAC;AAejC,OAAO,KAAK,EAAuE,kBAAkB,EAAE,eAAe,EAAgE,MAAM,yBAAyB,CAAC;AACtN,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAuLzD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GACvC,MAAM,GAAG,SAAS,CAiBpB;AAwGD,iBAAS,wBAAwB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,MAAM,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CA6FjM;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD,GAAG,MAAM,CAwaT"}
|
|
@@ -9,6 +9,7 @@ import { getCachedManifestForService, getManifestCache, reconcileCachedServiceRo
|
|
|
9
9
|
import { apiRoutePath, appRoutePatternKey, isApiRoute, pageRoutePath } from "./routeMounts.js";
|
|
10
10
|
import { M2MConnectionError, approveM2MConnections, buildM2MConnectionModel, revokeM2MConnection } from "./m2mConnections.js";
|
|
11
11
|
import { isPreviewApp } from "./previewEnvironments.js";
|
|
12
|
+
import { renderServiceConnection } from "./serviceConnections.js";
|
|
12
13
|
const API_BASE = "/.well-known/bp/admin";
|
|
13
14
|
const CONFIG_TICKET_TTL_SECONDS = 5 * 60;
|
|
14
15
|
// Parse-only base for relative request URLs. Never emit this origin.
|
|
@@ -178,7 +179,9 @@ function fixedParamsFromBody(body) {
|
|
|
178
179
|
export function validateFixedParamValue(name, value, paramsSchema) {
|
|
179
180
|
if (value.length > 100)
|
|
180
181
|
return `${name} must be at most 100 characters.`;
|
|
181
|
-
|
|
182
|
+
// The SDK publishes {} when no parameter schema was declared. This is
|
|
183
|
+
// different from an explicitly declared AnyVali object with no such field.
|
|
184
|
+
if (!paramsSchema || Object.keys(paramsSchema).length === 0)
|
|
182
185
|
return undefined;
|
|
183
186
|
try {
|
|
184
187
|
const document = paramsSchema;
|
|
@@ -2011,12 +2014,19 @@ export function registerAdminApiRoutes(app, store, cpState, database) {
|
|
|
2011
2014
|
const appDef = config.apps.find((candidate) => candidate.id === appId);
|
|
2012
2015
|
if (!appDef)
|
|
2013
2016
|
return jsonResponse({ error: "App not found" }, 404);
|
|
2017
|
+
if (wantsHtmx(event) && selections.length !== 1)
|
|
2018
|
+
return htmxError("Choose one service connection to update", 400);
|
|
2014
2019
|
try {
|
|
2015
2020
|
const result = approveM2MConnections(config, appId, selections);
|
|
2016
2021
|
if (result.created.length > 0)
|
|
2017
2022
|
await store.saveConfig(config);
|
|
2018
|
-
if (wantsHtmx(event))
|
|
2019
|
-
|
|
2023
|
+
if (wantsHtmx(event)) {
|
|
2024
|
+
const connections = buildM2MConnectionModel(config, appId);
|
|
2025
|
+
const selected = selections.length === 1 ? connections.find(connection => connection.sourceServiceId === selections[0].sourceServiceId && connection.requestId === selections[0].requestId) : undefined;
|
|
2026
|
+
return selected
|
|
2027
|
+
? htmlResponse(String(renderServiceConnection(selected, appId, API_BASE)), 200, "text/html; mode=fragment")
|
|
2028
|
+
: htmxError("Service connection is no longer available", 404);
|
|
2029
|
+
}
|
|
2020
2030
|
return jsonResponse(result, result.created.length > 0 ? 201 : 200);
|
|
2021
2031
|
}
|
|
2022
2032
|
catch (error) {
|
|
@@ -2032,12 +2042,15 @@ export function registerAdminApiRoutes(app, store, cpState, database) {
|
|
|
2032
2042
|
return jsonResponse({ error: "appId and bindingId required" }, 400);
|
|
2033
2043
|
const config = await store.loadConfig();
|
|
2034
2044
|
const appDef = config.apps.find((candidate) => candidate.id === appId);
|
|
2045
|
+
const previous = buildM2MConnectionModel(config, appId).find(connection => connection.bindingId === bindingId);
|
|
2035
2046
|
if (!appDef || !revokeM2MConnection(config, appId, bindingId)) {
|
|
2036
2047
|
return wantsHtmx(event) ? htmxError("Service connection not found", 404) : jsonResponse({ error: "Service connection not found" }, 404);
|
|
2037
2048
|
}
|
|
2038
2049
|
await store.saveConfig(config);
|
|
2039
|
-
if (wantsHtmx(event))
|
|
2040
|
-
|
|
2050
|
+
if (wantsHtmx(event)) {
|
|
2051
|
+
const selected = previous && buildM2MConnectionModel(config, appId).find(connection => connection.sourceServiceId === previous.sourceServiceId && connection.requestId === previous.requestId);
|
|
2052
|
+
return htmlResponse(selected ? String(renderServiceConnection(selected, appId, API_BASE)) : '<div class="list-group-item bp-service-connection">Service connection revoked.</div>', 200, "text/html; mode=fragment");
|
|
2053
|
+
}
|
|
2041
2054
|
return jsonResponse({ ok: true });
|
|
2042
2055
|
});
|
|
2043
2056
|
// Routes (per app)
|
|
@@ -2148,7 +2161,10 @@ export function registerAdminApiRoutes(app, store, cpState, database) {
|
|
|
2148
2161
|
const servicePathError = validateCanonicalRoutePath(requestedServicePath, "Service path");
|
|
2149
2162
|
if (servicePathError)
|
|
2150
2163
|
return validationError(event, servicePathError);
|
|
2151
|
-
const
|
|
2164
|
+
const hasFixedParams = Object.keys(body).some(key => key.startsWith("fixedParam."));
|
|
2165
|
+
const submittedFixed = !hasFixedParams && !routeIdentityChanged && body.servicePathVariant === undefined
|
|
2166
|
+
? route.fixedParams ?? {}
|
|
2167
|
+
: fixedParamsFromBody(body);
|
|
2152
2168
|
const pageRenderable = isPageOperation(manifestOperation);
|
|
2153
2169
|
const mappedAppPath = !pageRenderable
|
|
2154
2170
|
? apiRoutePath(manifest?.serviceId ?? route.serviceId, requestedServicePath)
|