@aifabrix/builder 2.53.0 → 2.54.1
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/bin/aifabrix.js +2 -2
- package/lib/api/assistants.api.js +8 -5
- package/lib/api/channel-identity.api.js +41 -0
- package/lib/api/evidence-authoring.api.js +5 -1
- package/lib/api/evidence.api.js +2 -0
- package/lib/api/types/evidence.types.js +2 -0
- package/lib/api/work-search.api.js +136 -0
- package/lib/channels/add-channel.js +163 -126
- package/lib/channels/approval-guides/chatgpt.js +14 -18
- package/lib/channels/approval-guides/claude.js +29 -0
- package/lib/channels/approval-guides/index.js +88 -22
- package/lib/channels/approval-guides/mcp-client.js +27 -0
- package/lib/channels/approval-guides/microsoft-copilot.js +52 -3
- package/lib/channels/approval-guides/slack.js +10 -10
- package/lib/channels/approval-guides/teams-bot.js +8 -12
- package/lib/channels/channel-add-continuations.js +91 -0
- package/lib/channels/channel-add-ensure.js +124 -27
- package/lib/channels/channel-add-existing.js +160 -28
- package/lib/channels/channel-add-failure.js +60 -0
- package/lib/channels/channel-add-remaining.js +486 -0
- package/lib/channels/channel-add-tty.js +190 -0
- package/lib/channels/channel-add-wizard-config.js +138 -0
- package/lib/channels/channel-add-wizard.js +250 -0
- package/lib/channels/channel-artifact-generator.js +27 -13
- package/lib/channels/channel-cardinality.js +83 -0
- package/lib/channels/channel-catalog-icon.js +45 -0
- package/lib/channels/channel-cli-instructions.js +75 -0
- package/lib/channels/channel-configuration-map.js +213 -0
- package/lib/channels/channel-credential.js +11 -14
- package/lib/channels/channel-definition-project.js +101 -0
- package/lib/channels/channel-definition-registry.js +154 -0
- package/lib/channels/channel-description.js +59 -2
- package/lib/channels/channel-discovery.js +16 -2
- package/lib/channels/channel-external-system.js +86 -9
- package/lib/channels/channel-install-envelope-actions.js +88 -0
- package/lib/channels/channel-install-envelope-microsoft.js +155 -0
- package/lib/channels/channel-install-envelope.js +356 -0
- package/lib/channels/channel-install-help-md.js +172 -0
- package/lib/channels/channel-install-http-payload.js +62 -0
- package/lib/channels/channel-install-inventory.js +115 -0
- package/lib/channels/channel-install-profiles.js +90 -0
- package/lib/channels/channel-instance-collision.js +118 -0
- package/lib/channels/channel-instance-key.js +100 -0
- package/lib/channels/channel-instance-materialize.js +240 -0
- package/lib/channels/channel-integration-generator.js +16 -9
- package/lib/channels/channel-integration-template.js +101 -22
- package/lib/channels/channel-inventory-fetch.js +79 -0
- package/lib/channels/channel-oauth-preflight.js +104 -0
- package/lib/channels/channel-package-version.js +76 -0
- package/lib/channels/channel-predefined-client.js +154 -0
- package/lib/channels/channel-probe.js +7 -2
- package/lib/channels/channel-runtime-resolver.js +180 -72
- package/lib/channels/channel-status-display.js +86 -16
- package/lib/channels/channel-targets.js +106 -92
- package/lib/channels/chatgpt-callback.js +318 -0
- package/lib/channels/chatgpt-channel-add.js +229 -0
- package/lib/channels/chatgpt-preflight.js +396 -0
- package/lib/channels/chatgpt-runtime-contract.js +17 -0
- package/lib/channels/chatgpt-setup-values.js +124 -0
- package/lib/channels/claude-callback.js +67 -0
- package/lib/channels/claude-channel-add.js +254 -0
- package/lib/channels/claude-runtime-contract.js +40 -0
- package/lib/channels/claude-runtime.js +58 -0
- package/lib/channels/claude-setup-values.js +89 -0
- package/lib/channels/mcp-client/config-merge.js +148 -0
- package/lib/channels/mcp-client/ensure-client.js +231 -0
- package/lib/channels/mcp-client/paths.js +53 -0
- package/lib/channels/mcp-client/profiles.js +122 -0
- package/lib/channels/mcp-client/redirect-uris.js +99 -0
- package/lib/channels/mcp-client/runtime.js +59 -0
- package/lib/channels/mcp-client-channel-add.js +186 -0
- package/lib/channels/microsoft-copilot-channel-add.js +117 -7
- package/lib/channels/microsoft-copilot-entra-identifier-uris.js +187 -0
- package/lib/channels/microsoft-copilot-entra-sso-form.js +106 -18
- package/lib/channels/microsoft-copilot-entra-sso.js +31 -2
- package/lib/channels/microsoft-copilot-package-prior.js +107 -0
- package/lib/channels/microsoft-copilot-package.js +29 -28
- package/lib/channels/microsoft-provisioning/a365.js +80 -0
- package/lib/channels/microsoft-provisioning/auth-config.js +240 -0
- package/lib/channels/microsoft-provisioning/auth.js +179 -0
- package/lib/channels/microsoft-provisioning/cli.js +71 -0
- package/lib/channels/microsoft-provisioning/constants.js +75 -0
- package/lib/channels/microsoft-provisioning/errors.js +117 -0
- package/lib/channels/microsoft-provisioning/index.js +55 -0
- package/lib/channels/microsoft-provisioning/install-atk.js +158 -0
- package/lib/channels/microsoft-provisioning/install-teams.js +115 -0
- package/lib/channels/microsoft-provisioning/login-portal-device.js +236 -0
- package/lib/channels/microsoft-provisioning/login-portal-parse.js +71 -0
- package/lib/channels/microsoft-provisioning/login-portal-teams.js +193 -0
- package/lib/channels/microsoft-provisioning/login-portal.js +230 -0
- package/lib/channels/microsoft-provisioning/persist.js +110 -0
- package/lib/channels/microsoft-provisioning/teams-bot-args.js +119 -0
- package/lib/channels/microsoft-provisioning/teams-bot-controller.js +123 -0
- package/lib/channels/microsoft-provisioning/teams-bot-parse.js +134 -0
- package/lib/channels/microsoft-provisioning/teams-bot-persist.js +113 -0
- package/lib/channels/microsoft-provisioning/teams-bot-provision.js +234 -0
- package/lib/channels/microsoft-provisioning/teams-bot-secrets.js +45 -0
- package/lib/channels/microsoft-provisioning/teams-cli.js +82 -0
- package/lib/channels/runtime-tool-catalog.js +5 -2
- package/lib/channels/slack-channel-add-portal.js +130 -0
- package/lib/channels/slack-channel-add-tty-auth.js +95 -0
- package/lib/channels/slack-channel-add.js +258 -0
- package/lib/channels/slack-provisioning/apps.js +181 -0
- package/lib/channels/slack-provisioning/auth-store.js +110 -0
- package/lib/channels/slack-provisioning/auth-ticket.js +185 -0
- package/lib/channels/slack-provisioning/auth.js +115 -0
- package/lib/channels/slack-provisioning/callbacks.js +41 -0
- package/lib/channels/slack-provisioning/cli.js +226 -0
- package/lib/channels/slack-provisioning/constants.js +37 -0
- package/lib/channels/slack-provisioning/credentials.js +169 -0
- package/lib/channels/slack-provisioning/curl-shim.js +132 -0
- package/lib/channels/slack-provisioning/developer-install.js +118 -0
- package/lib/channels/slack-provisioning/env-file.js +120 -0
- package/lib/channels/slack-provisioning/errors.js +47 -0
- package/lib/channels/slack-provisioning/go-ca-bundle.js +137 -0
- package/lib/channels/slack-provisioning/index.js +250 -0
- package/lib/channels/slack-provisioning/install-cli.js +323 -0
- package/lib/channels/slack-provisioning/manifest.js +89 -0
- package/lib/channels/slack-provisioning/oauth-lock.js +33 -0
- package/lib/channels/slack-provisioning/offer-cli.js +113 -0
- package/lib/channels/slack-provisioning/onboard-members.js +122 -0
- package/lib/channels/slack-provisioning/onboard.js +89 -0
- package/lib/channels/slack-provisioning/persist.js +95 -0
- package/lib/channels/slack-provisioning/remaining-urls.js +158 -0
- package/lib/channels/slack-provisioning/with-curl-on-path.js +48 -0
- package/lib/channels/teams-bot-channel-add.js +94 -0
- package/lib/channels/vendor-dataplane-url.js +249 -0
- package/lib/cli/setup-certification.help.js +2 -0
- package/lib/cli/setup-external-system-help.js +2 -0
- package/lib/cli/setup-external-system.js +1 -1
- package/lib/commands/channel-add-help.js +366 -0
- package/lib/commands/channel-add-setup.js +162 -80
- package/lib/commands/channel-configure.js +118 -0
- package/lib/commands/channel.js +10 -1
- package/lib/commands/governance-upload-external.js +6 -3
- package/lib/commands/lifecycle-command-action.js +2 -5
- package/lib/commands/lifecycle-external.js +93 -21
- package/lib/commands/repair-datasource-test-payload.js +4 -2
- package/lib/commands/repair-datasource-webhooks-sync-bridge.js +23 -2
- package/lib/commands/repair-datasource.js +3 -0
- package/lib/commands/repair-external-run.js +59 -25
- package/lib/commands/repair-openapi-rest-runtime.js +127 -0
- package/lib/commands/repair-orchestration-tag-merge.js +339 -0
- package/lib/commands/repair-rbac-catalog-defaults.js +96 -0
- package/lib/commands/repair-rbac-platform-preset.js +26 -15
- package/lib/commands/repair-rbac-reader-roles.js +8 -21
- package/lib/commands/repair-rbac.js +10 -34
- package/lib/commands/repair-system-permissions.js +24 -22
- package/lib/commands/role-assistant-test-output.js +14 -0
- package/lib/commands/role-assistant.js +59 -21
- package/lib/commands/test-e2e-external.js +148 -21
- package/lib/commands/upload-credential-push-log.js +2 -1
- package/lib/commands/upload-publish-context.js +1 -1
- package/lib/commands/upload-role-assistant-shell.js +124 -0
- package/lib/commands/upload-sidecar-followups.js +6 -3
- package/lib/commands/upload.js +18 -3
- package/lib/core/secrets-docker-env.js +4 -1
- package/lib/core/secrets-env-content.js +17 -3
- package/lib/datasource/capability/capability-manifest.js +0 -3
- package/lib/datasource/capability/copy-test-payload.js +3 -0
- package/lib/external-system/deploy-helpers.js +26 -1
- package/lib/external-system/deploy.js +10 -6
- package/lib/external-system/download-helpers.js +29 -2
- package/lib/external-system/download-role-assistant.js +83 -4
- package/lib/external-system/download.js +40 -30
- package/lib/external-system/sync-deploy-manifest.js +3 -2
- package/lib/external-system/upload-identity.js +42 -0
- package/lib/generator/index.js +19 -15
- package/lib/generator/split.js +13 -2
- package/lib/lifecycle/role-assistant-governance.js +146 -0
- package/lib/lifecycle/scenario-upload.js +181 -30
- package/lib/programmatic/builder-api-cors.js +143 -0
- package/lib/programmatic/builder-api-request.js +6 -0
- package/lib/programmatic/builder-api-route-dispatch.js +56 -42
- package/lib/programmatic/builder-api-server.js +8 -1
- package/lib/programmatic/capability-registry.js +54 -0
- package/lib/programmatic/channel-install-help-resolve.js +359 -0
- package/lib/programmatic/channel-install-session.js +218 -0
- package/lib/programmatic/help-content/channel-onboarding.md +2 -0
- package/lib/programmatic/help-content/cip-overview.md +3 -1
- package/lib/programmatic/http-raw-response.js +62 -0
- package/lib/programmatic/openapi-channel-install-bindings.js +179 -0
- package/lib/programmatic/openapi-channel-install-schemas.js +286 -0
- package/lib/programmatic/openapi-component-schemas.js +18 -1
- package/lib/programmatic/openapi-description-enricher.js +3 -1
- package/lib/programmatic/openapi-descriptions.js +74 -3
- package/lib/programmatic/openapi-envelope-examples.js +117 -0
- package/lib/programmatic/openapi-operation-bindings.js +4 -1
- package/lib/programmatic/openapi-schema-descriptions-channel.js +316 -0
- package/lib/programmatic/openapi-spec.js +12 -8
- package/lib/programmatic/platform-rbac-catalog.js +36 -18
- package/lib/programmatic/route-handler-map.js +51 -1
- package/lib/programmatic/route-handlers-context.js +2 -1
- package/lib/programmatic/run-auth-permissions.js +54 -0
- package/lib/programmatic/run-channel-catalog.js +196 -0
- package/lib/programmatic/run-channel-install-artifacts.js +137 -0
- package/lib/programmatic/run-channel-install-copilot.js +353 -0
- package/lib/programmatic/run-channel-install-options.js +232 -0
- package/lib/programmatic/run-channel-install-teams-bot.js +204 -0
- package/lib/programmatic/run-channel-install.js +346 -0
- package/lib/programmatic/run-channel-package.js +87 -7
- package/lib/programmatic/workspace-context.js +2 -0
- package/lib/role-assistant/evidence-sync.js +4 -2
- package/lib/role-assistant/evidence-validation-issues.js +51 -0
- package/lib/role-assistant/knowledge-sync.js +10 -4
- package/lib/role-assistant/settings.js +49 -2
- package/lib/role-assistant/test-cases-evaluate.js +30 -2
- package/lib/role-assistant/test-cases-evidence.js +175 -0
- package/lib/role-assistant/test-cases-search.js +229 -0
- package/lib/role-assistant/test-cases.js +37 -4
- package/lib/role-assistant/test-runner-search.js +149 -0
- package/lib/role-assistant/test-runner-workhub-helpers.js +40 -2
- package/lib/role-assistant/test-runner-workhub-soft.js +9 -3
- package/lib/role-assistant/test-runner-workhub.js +29 -11
- package/lib/role-assistant/test-runner.js +16 -1
- package/lib/schema/external-datasource.schema.json +119 -16
- package/lib/schema/external-system.schema.json +159 -2
- package/lib/schema/mcp-client-profile.schema.json +103 -0
- package/lib/utils/app-path-resolve.js +4 -0
- package/lib/utils/authentication-env-template.js +44 -6
- package/lib/utils/credential-secrets-env.js +6 -1
- package/lib/utils/env-copy.js +19 -7
- package/lib/utils/external-env-template.js +20 -2
- package/lib/utils/paths.js +18 -1
- package/lib/utils/platform-shell-package.js +69 -0
- package/lib/utils/port-resolver.js +50 -1
- package/lib/utils/rewrite-name-flag.js +20 -0
- package/lib/utils/role-assistant-paths.js +13 -10
- package/lib/utils/schema-resolver.js +11 -1
- package/lib/utils/secrets-helpers.js +12 -21
- package/lib/utils/token-manager.js +10 -5
- package/lib/validation/validate.js +40 -0
- package/package.json +1 -1
- package/templates/README.md +1 -1
- package/templates/applications/builder-api/Dockerfile +1 -1
- package/templates/applications/builder-api/env.template +7 -0
- package/templates/applications/dataplane/application.yaml +6 -5
- package/templates/applications/dataplane/env.template +2 -2
- package/templates/applications/dataplane/rbac.yaml +7 -2
- package/templates/applications/keycloak/Dockerfile +30 -4
- package/templates/applications/keycloak/application.yaml +2 -2
- package/templates/applications/keycloak/cimd-lenient-parse/AbstractClientIdMetadataDocumentExecutor.java +896 -0
- package/templates/applications/keycloak/cimd-lenient-parse/SOURCE.md +19 -0
- package/templates/applications/keycloak/env.template +3 -0
- package/templates/applications/miso-controller/application.yaml +1 -2
- package/templates/applications/miso-controller/env.template +2 -0
- package/templates/channels/README.md +5 -5
- package/templates/channels/chatgpt/TROUBLESHOOTING.md +51 -0
- package/templates/channels/chatgpt/channel.json +59 -0
- package/templates/channels/chatgpt/icon.svg +1 -0
- package/templates/channels/chatgpt/install.template.md.hbs +20 -95
- package/templates/channels/chatgpt/integration/README.md +1 -1
- package/templates/channels/chatgpt/integration/application.json +2 -2
- package/templates/channels/chatgpt/integration/chatgpt-system.json +49 -4
- package/templates/channels/chatgpt/integration/env.template +2 -4
- package/templates/channels/chatgpt/integration/rbac.json +13 -0
- package/templates/channels/claude/TROUBLESHOOTING.md +41 -0
- package/templates/channels/claude/channel.json +59 -0
- package/templates/channels/claude/icon.svg +1 -0
- package/templates/channels/claude/install.template.md.hbs +21 -0
- package/templates/channels/claude/integration/README.md +14 -0
- package/templates/channels/claude/integration/application.json +15 -0
- package/templates/channels/claude/integration/claude-system.json +59 -0
- package/templates/channels/claude/integration/env.template +2 -0
- package/templates/channels/claude/integration/rbac.json +13 -0
- package/templates/channels/claude/manifest.template.json.hbs +40 -0
- package/templates/channels/mcp-client/channel.json +72 -0
- package/templates/channels/mcp-client/icon.svg +1 -0
- package/templates/channels/mcp-client/install.template.md.hbs +24 -0
- package/templates/channels/mcp-client/integration/README.md +13 -0
- package/templates/channels/mcp-client/integration/application.json +15 -0
- package/templates/channels/mcp-client/integration/env.template +2 -0
- package/templates/channels/mcp-client/integration/mcp-client-system.json +72 -0
- package/templates/channels/mcp-client/integration/rbac.json +13 -0
- package/templates/channels/mcp-client/manifest.template.json.hbs +41 -0
- package/templates/channels/mcp-client/profiles/cursor.json +26 -0
- package/templates/channels/mcp-client/profiles/github-copilot.json +29 -0
- package/templates/channels/mcp-client/profiles/vscode.json +29 -0
- package/templates/channels/microsoft-copilot/channel.json +73 -0
- package/templates/channels/microsoft-copilot/declarative-agent.template.json.hbs +8 -4
- package/templates/channels/microsoft-copilot/entra-sso-registration.template.md.hbs +65 -5
- package/templates/channels/microsoft-copilot/icon.svg +1 -0
- package/templates/channels/microsoft-copilot/install.template.md.hbs +9 -9
- package/templates/channels/microsoft-copilot/integration/README.md +1 -1
- package/templates/channels/microsoft-copilot/integration/application.json +2 -2
- package/templates/channels/microsoft-copilot/integration/env.template +3 -6
- package/templates/channels/microsoft-copilot/integration/microsoft-copilot-system.json +63 -4
- package/templates/channels/microsoft-copilot/integration/rbac.json +13 -0
- package/templates/channels/microsoft-copilot/oauth-plugin-vault-required.template.md.hbs +5 -5
- package/templates/channels/slack/channel.json +223 -0
- package/templates/channels/slack/icon.svg +1 -0
- package/templates/channels/slack/install.template.md.hbs +36 -28
- package/templates/channels/slack/integration/README.md +245 -22
- package/templates/channels/slack/integration/application.json +44 -7
- package/templates/channels/slack/integration/env.template +15 -6
- package/templates/channels/slack/integration/openapi/openapi.json +126 -0
- package/templates/channels/slack/integration/rbac.json +84 -0
- package/templates/channels/slack/integration/slack-datasource-commands.json +154 -0
- package/templates/channels/slack/integration/slack-datasource-conversations.json +28 -3
- package/templates/channels/slack/integration/slack-datasource-events.json +154 -0
- package/templates/channels/slack/integration/slack-datasource-interactive.json +154 -0
- package/templates/channels/slack/integration/slack-datasource-messages.json +40 -2
- package/templates/channels/slack/integration/slack-system.json +155 -77
- package/templates/channels/slack/manifest.template.json.hbs +5 -2
- package/templates/channels/teams-bot/channel.json +161 -0
- package/templates/channels/teams-bot/icon.svg +1 -0
- package/templates/channels/teams-bot/install.template.md.hbs +12 -13
- package/templates/channels/teams-bot/integration/README.md +5 -4
- package/templates/channels/teams-bot/integration/application.json +6 -4
- package/templates/channels/teams-bot/integration/env.template +5 -4
- package/templates/channels/teams-bot/integration/openapi/openapi.json +68 -0
- package/templates/channels/teams-bot/integration/rbac.json +21 -0
- package/templates/channels/teams-bot/integration/teams-bot-datasource-activities.json +154 -0
- package/templates/channels/teams-bot/integration/teams-bot-system.json +128 -23
- package/templates/channels/web-embed/channel.json +60 -0
- package/templates/channels/web-embed/install.template.md.hbs +1 -1
- package/templates/channels/web-embed/integration/README.md +2 -2
- package/templates/channels/web-embed/integration/application.json +2 -2
- package/templates/channels/web-embed/integration/env.template +1 -1
- package/templates/channels/web-embed/integration/rbac.json +13 -0
- package/templates/channels/web-embed/integration/web-embed-system.json +50 -4
|
@@ -53,6 +53,23 @@ const {
|
|
|
53
53
|
getChannelBranding
|
|
54
54
|
} = require('./run-channel-package');
|
|
55
55
|
const { handleGetBuilderHelp } = require('./builder-help');
|
|
56
|
+
const {
|
|
57
|
+
listChannelTargets,
|
|
58
|
+
runChannelInstall,
|
|
59
|
+
getChannelInstall,
|
|
60
|
+
getChannelInstallHelp,
|
|
61
|
+
continueChannelInstall
|
|
62
|
+
} = require('./run-channel-install');
|
|
63
|
+
const {
|
|
64
|
+
getChannelDefinitionDetail,
|
|
65
|
+
getChannelInstallation
|
|
66
|
+
} = require('./run-channel-catalog');
|
|
67
|
+
const {
|
|
68
|
+
listChannelArtifacts,
|
|
69
|
+
getChannelArtifact,
|
|
70
|
+
handleChannelCallback
|
|
71
|
+
} = require('./run-channel-install-artifacts');
|
|
72
|
+
const { getBuilderAuthPermissions } = require('./run-auth-permissions');
|
|
56
73
|
|
|
57
74
|
/** @type {Record<string, Function>} */
|
|
58
75
|
const HANDLER_MAP = {
|
|
@@ -233,7 +250,40 @@ const HANDLER_MAP = {
|
|
|
233
250
|
getChannelBranding: (params, auth) =>
|
|
234
251
|
getChannelBranding(buildContext(auth, params.systemKey)),
|
|
235
252
|
patchChannelBranding: (params, auth, body) =>
|
|
236
|
-
patchChannelBranding(buildContext(auth, params.systemKey), body || {})
|
|
253
|
+
patchChannelBranding(buildContext(auth, params.systemKey), body || {}),
|
|
254
|
+
listChannelTargets: (_params, auth, _body, query) =>
|
|
255
|
+
listChannelTargets(query || {}, buildContext(auth, '_channels')),
|
|
256
|
+
getChannelDefinitionDetail: (params, auth) =>
|
|
257
|
+
getChannelDefinitionDetail(buildContext(auth, params.definitionKey), params.definitionKey),
|
|
258
|
+
getChannelInstallation: (params, auth) =>
|
|
259
|
+
getChannelInstallation(
|
|
260
|
+
buildContext(auth, params.definitionKey),
|
|
261
|
+
params.definitionKey,
|
|
262
|
+
params.systemKey
|
|
263
|
+
),
|
|
264
|
+
runChannelInstall: (params, auth, body) =>
|
|
265
|
+
runChannelInstall(buildContext(auth, params.systemKey), body || {}),
|
|
266
|
+
getChannelInstall: (params, auth, _body, query) =>
|
|
267
|
+
getChannelInstall(buildContext(auth, params.systemKey), query || {}),
|
|
268
|
+
getChannelInstallHelp: (params, auth) =>
|
|
269
|
+
getChannelInstallHelp(buildContext(auth, params.systemKey)),
|
|
270
|
+
continueChannelInstall: (params, auth, body) =>
|
|
271
|
+
continueChannelInstall(buildContext(auth, params.systemKey), body || {}),
|
|
272
|
+
listChannelArtifacts: (params, auth) =>
|
|
273
|
+
listChannelArtifacts(buildContext(auth, params.systemKey)),
|
|
274
|
+
getChannelArtifact: (params, auth) =>
|
|
275
|
+
getChannelArtifact(buildContext(auth, params.systemKey), params.artifactId),
|
|
276
|
+
getChannelCallback: (params, auth, _body, query) =>
|
|
277
|
+
handleChannelCallback(buildContext(auth, params.systemKey), params.provider, query || {}, {}),
|
|
278
|
+
postChannelCallback: (params, auth, body, query) =>
|
|
279
|
+
handleChannelCallback(
|
|
280
|
+
buildContext(auth, params.systemKey),
|
|
281
|
+
params.provider,
|
|
282
|
+
query || {},
|
|
283
|
+
body || {}
|
|
284
|
+
),
|
|
285
|
+
getAuthPermissions: (_params, auth) =>
|
|
286
|
+
getBuilderAuthPermissions(buildContext(auth, '_auth'))
|
|
237
287
|
};
|
|
238
288
|
|
|
239
289
|
/**
|
|
@@ -22,7 +22,8 @@ function buildContext(auth, systemKey) {
|
|
|
22
22
|
bearerToken: auth.bearerToken,
|
|
23
23
|
dataplaneUrl: process.env.DATAPLANE_URL,
|
|
24
24
|
controllerUrl: process.env.MISO_CONTROLLER_URL || process.env.CONTROLLER_URL,
|
|
25
|
-
environment: process.env.DEFAULT_ENVIRONMENT
|
|
25
|
+
environment: process.env.DEFAULT_ENVIRONMENT,
|
|
26
|
+
publicOrigin: auth.publicOrigin
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin Builder forward of Miso GET /api/v1/auth/permissions.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Portal uses published builder-api; no second permission model
|
|
5
|
+
* @author AI Fabrix Team
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const { getAuthPermissions } = require('../api/auth.api');
|
|
12
|
+
const { permissionSlugsFromResponse } = require('../channels/channel-oauth-preflight');
|
|
13
|
+
const { httpError } = require('./channel-install-session');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {unknown} errOrResponse
|
|
17
|
+
* @returns {Error}
|
|
18
|
+
*/
|
|
19
|
+
function mapPermissionsError(errOrResponse) {
|
|
20
|
+
const status = Number(
|
|
21
|
+
errOrResponse && (errOrResponse.statusCode || errOrResponse.status)
|
|
22
|
+
) || 502;
|
|
23
|
+
const message =
|
|
24
|
+
(errOrResponse && (errOrResponse.formattedError || errOrResponse.message)) ||
|
|
25
|
+
'Unable to read authorization permissions.';
|
|
26
|
+
return httpError(String(message), status >= 400 && status < 600 ? status : 502);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param {import('./workspace-context').WorkspaceContext} ctx
|
|
31
|
+
* @param {Object} [deps]
|
|
32
|
+
* @returns {Promise<{ permissions: string[] }>}
|
|
33
|
+
*/
|
|
34
|
+
async function getBuilderAuthPermissions(ctx, deps = {}) {
|
|
35
|
+
const getPerms = deps.getAuthPermissions || getAuthPermissions;
|
|
36
|
+
let response;
|
|
37
|
+
try {
|
|
38
|
+
response = await getPerms(
|
|
39
|
+
ctx.controllerUrl,
|
|
40
|
+
{ type: 'bearer', token: ctx.bearerToken, preserveBearer: true },
|
|
41
|
+
ctx.environment
|
|
42
|
+
);
|
|
43
|
+
} catch (err) {
|
|
44
|
+
throw mapPermissionsError(err);
|
|
45
|
+
}
|
|
46
|
+
if (response && response.success === false) {
|
|
47
|
+
throw mapPermissionsError(response);
|
|
48
|
+
}
|
|
49
|
+
return { permissions: permissionSlugsFromResponse(response) };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = {
|
|
53
|
+
getBuilderAuthPermissions
|
|
54
|
+
};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog, definition, and installation projection handlers.
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview GET /channels[+/:definitionKey][+ /installations/:systemKey]
|
|
5
|
+
* @author AI Fabrix Team
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const { getChannelDefinition } = require('../channels/channel-definition-registry');
|
|
12
|
+
const { listLiveChannelTargetKeys, getChannelTarget } = require('../channels/channel-targets');
|
|
13
|
+
const { profilesForCatalogRow } = require('../channels/channel-install-profiles');
|
|
14
|
+
const { toSafeConfiguration, toPortalFields } = require('../channels/channel-configuration-map');
|
|
15
|
+
const { catalogIconHref } = require('../channels/channel-catalog-icon');
|
|
16
|
+
const {
|
|
17
|
+
formatChannelCliInstructions,
|
|
18
|
+
isCliProvisioningMode
|
|
19
|
+
} = require('../channels/channel-cli-instructions');
|
|
20
|
+
const {
|
|
21
|
+
installationsForDefinition,
|
|
22
|
+
summarizeInstallations
|
|
23
|
+
} = require('../channels/channel-install-inventory');
|
|
24
|
+
const { listConnectedSystemsForInventory } = require('../channels/channel-inventory-fetch');
|
|
25
|
+
const { cardinalityProjection } = require('../channels/channel-cardinality');
|
|
26
|
+
const { httpError } = require('./channel-install-session');
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {Object} target
|
|
30
|
+
* @param {Object[]} [installations]
|
|
31
|
+
* @returns {Object}
|
|
32
|
+
*/
|
|
33
|
+
function toChannelCatalogRow(target, installations = []) {
|
|
34
|
+
const summary = summarizeInstallations(installations);
|
|
35
|
+
const row = {
|
|
36
|
+
key: target.key,
|
|
37
|
+
displayLabel: target.displayLabel,
|
|
38
|
+
description: target.description,
|
|
39
|
+
experimental: target.experimental === true,
|
|
40
|
+
provisioning: target.provisioning || { mode: 'guided' },
|
|
41
|
+
runtimeTarget: target.runtimeTarget,
|
|
42
|
+
installationSummary: summary,
|
|
43
|
+
installations,
|
|
44
|
+
...definitionListFields(target.key)
|
|
45
|
+
};
|
|
46
|
+
const profiles = profilesForCatalogRow(target.key);
|
|
47
|
+
if (profiles.length > 0) {
|
|
48
|
+
row.profiles = profiles;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
...row,
|
|
52
|
+
...cardinalityProjection(getChannelDefinition(target.key), installations)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Safe definition fields for the published catalog list (portal form + CLI copy).
|
|
58
|
+
* @param {string} definitionKey
|
|
59
|
+
* @returns {Object}
|
|
60
|
+
*/
|
|
61
|
+
function definitionListFields(definitionKey) {
|
|
62
|
+
const definition = getChannelDefinition(definitionKey);
|
|
63
|
+
if (!definition) {
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
66
|
+
const fields = {
|
|
67
|
+
configuration: toSafeConfiguration(definition),
|
|
68
|
+
portalFields: toPortalFields(definition)
|
|
69
|
+
};
|
|
70
|
+
const iconHref = catalogIconHref(definitionKey);
|
|
71
|
+
if (iconHref) {
|
|
72
|
+
fields.iconHref = iconHref;
|
|
73
|
+
}
|
|
74
|
+
if (isCliProvisioningMode(definition)) {
|
|
75
|
+
fields.cliInstructions = formatChannelCliInstructions(definition);
|
|
76
|
+
}
|
|
77
|
+
return fields;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @param {Object} [query]
|
|
82
|
+
* @param {Object|null} [ctx]
|
|
83
|
+
* @param {Object} [deps]
|
|
84
|
+
* @returns {Promise<{ channels: Object[] }>}
|
|
85
|
+
*/
|
|
86
|
+
async function listChannelTargets(query = {}, ctx = null, deps = {}) {
|
|
87
|
+
const allowExperimental = query.allowExperimental === 'true' || query.allowExperimental === true;
|
|
88
|
+
const systems = ctx ? await listConnectedSystemsForInventory(ctx, deps) : [];
|
|
89
|
+
const channels = listLiveChannelTargetKeys({ allowExperimental }).map((key) => {
|
|
90
|
+
const target = getChannelTarget(key);
|
|
91
|
+
const installations = installationsForDefinition(systems, key);
|
|
92
|
+
return toChannelCatalogRow(target, installations);
|
|
93
|
+
});
|
|
94
|
+
return { channels };
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @param {string} definitionKey
|
|
99
|
+
* @returns {Object}
|
|
100
|
+
*/
|
|
101
|
+
function requireChannelDefinition(definitionKey) {
|
|
102
|
+
const definition = getChannelDefinition(definitionKey);
|
|
103
|
+
if (!definition) {
|
|
104
|
+
throw httpError(`Unknown channel definition "${definitionKey}".`, 404);
|
|
105
|
+
}
|
|
106
|
+
return definition;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @param {Object} definition
|
|
111
|
+
* @returns {Object}
|
|
112
|
+
*/
|
|
113
|
+
function toSafeDefinition(definition) {
|
|
114
|
+
const channel = definition.channel || {};
|
|
115
|
+
const safe = {
|
|
116
|
+
key: definition.key,
|
|
117
|
+
displayName: definition.displayName,
|
|
118
|
+
description: definition.description,
|
|
119
|
+
type: definition.type,
|
|
120
|
+
systemKind: definition.systemKind,
|
|
121
|
+
configuration: toSafeConfiguration(definition),
|
|
122
|
+
portalFields: toPortalFields(definition),
|
|
123
|
+
channel: {
|
|
124
|
+
definitionKey: channel.definitionKey || definition.key,
|
|
125
|
+
provisioning: channel.provisioning,
|
|
126
|
+
runtimeTarget: channel.runtimeTarget,
|
|
127
|
+
experimental: channel.experimental === true,
|
|
128
|
+
profiles: Array.isArray(channel.profiles) ? channel.profiles : []
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
if (typeof channel.maxInstances === 'number') {
|
|
132
|
+
safe.channel.maxInstances = channel.maxInstances;
|
|
133
|
+
}
|
|
134
|
+
const iconHref = catalogIconHref(definition.key);
|
|
135
|
+
if (iconHref) {
|
|
136
|
+
safe.iconHref = iconHref;
|
|
137
|
+
}
|
|
138
|
+
if (isCliProvisioningMode(definition)) {
|
|
139
|
+
safe.cliInstructions = formatChannelCliInstructions(definition);
|
|
140
|
+
}
|
|
141
|
+
return safe;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @param {Object} ctx
|
|
146
|
+
* @param {string} definitionKey
|
|
147
|
+
* @param {Object} [deps]
|
|
148
|
+
* @returns {Promise<Object>}
|
|
149
|
+
*/
|
|
150
|
+
async function getChannelDefinitionDetail(ctx, definitionKey, deps = {}) {
|
|
151
|
+
const definition = requireChannelDefinition(definitionKey);
|
|
152
|
+
const systems = await listConnectedSystemsForInventory(ctx, deps);
|
|
153
|
+
const installations = installationsForDefinition(systems, definition.key);
|
|
154
|
+
return {
|
|
155
|
+
...toSafeDefinition(definition),
|
|
156
|
+
...cardinalityProjection(definition, installations),
|
|
157
|
+
installations
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @param {Object} ctx
|
|
163
|
+
* @param {string} definitionKey
|
|
164
|
+
* @param {string} systemKey
|
|
165
|
+
* @param {Object} [deps]
|
|
166
|
+
* @returns {Promise<Object>}
|
|
167
|
+
*/
|
|
168
|
+
async function getChannelInstallation(ctx, definitionKey, systemKey, deps = {}) {
|
|
169
|
+
requireChannelDefinition(definitionKey);
|
|
170
|
+
const systems = await listConnectedSystemsForInventory(ctx, deps);
|
|
171
|
+
const installations = installationsForDefinition(systems, definitionKey);
|
|
172
|
+
const found = installations.find((row) => row.key === systemKey);
|
|
173
|
+
if (!found) {
|
|
174
|
+
throw httpError(
|
|
175
|
+
`Channel installation "${systemKey}" was not found for "${definitionKey}".`,
|
|
176
|
+
404
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
definition: {
|
|
181
|
+
key: definitionKey,
|
|
182
|
+
displayName: getChannelTarget(definitionKey).displayLabel,
|
|
183
|
+
provisioning: getChannelTarget(definitionKey).provisioning
|
|
184
|
+
},
|
|
185
|
+
installation: found
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
module.exports = {
|
|
190
|
+
listChannelTargets,
|
|
191
|
+
getChannelDefinitionDetail,
|
|
192
|
+
getChannelInstallation,
|
|
193
|
+
toChannelCatalogRow,
|
|
194
|
+
toSafeDefinition,
|
|
195
|
+
requireChannelDefinition
|
|
196
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel install artifact bytes and vendor callback (no secrets in responses).
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview Linked from help markdown; ZIP as application/zip
|
|
5
|
+
* @author AI Fabrix Team
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const fs = require('../internal/fs-real-sync');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const { getChannelPackageZip } = require('./run-channel-package');
|
|
14
|
+
const { createHttpRawResult } = require('./http-raw-response');
|
|
15
|
+
const {
|
|
16
|
+
httpError,
|
|
17
|
+
readChannelInstallSession,
|
|
18
|
+
requireChannelInstallSession
|
|
19
|
+
} = require('./channel-install-session');
|
|
20
|
+
const { getArtifactOutputPath } = require('../channels/channel-artifact-generator');
|
|
21
|
+
const { toChannelInstallHttpPayload } = require('../channels/channel-install-http-payload');
|
|
22
|
+
const { attachInstallIdentity } = require('./channel-install-help-resolve');
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Credential callback hook — never echo tokens. Tests may inject a mock.
|
|
26
|
+
* @param {import('./workspace-context').WorkspaceContext} _ctx
|
|
27
|
+
* @param {string} _provider
|
|
28
|
+
* @param {Object} _payload
|
|
29
|
+
* @returns {Promise<{ stored: boolean }>}
|
|
30
|
+
*/
|
|
31
|
+
async function storeChannelCallbackCredential(_ctx, _provider, _payload) {
|
|
32
|
+
return { stored: false };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {import('./workspace-context').WorkspaceContext} ctx
|
|
37
|
+
* @returns {Object}
|
|
38
|
+
*/
|
|
39
|
+
function listChannelArtifacts(ctx) {
|
|
40
|
+
const session = readChannelInstallSession(ctx);
|
|
41
|
+
const artifacts =
|
|
42
|
+
session && session.envelope && Array.isArray(session.envelope.artifacts)
|
|
43
|
+
? session.envelope.artifacts
|
|
44
|
+
: [];
|
|
45
|
+
return { artifacts };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @param {import('./workspace-context').WorkspaceContext} ctx
|
|
50
|
+
* @param {string} artifactId
|
|
51
|
+
* @returns {{ absPath: string, contentType: string, fileName: string }}
|
|
52
|
+
*/
|
|
53
|
+
function resolveArtifactFile(ctx, artifactId) {
|
|
54
|
+
const id = String(artifactId || '').trim();
|
|
55
|
+
const root = ctx.getUserRoot();
|
|
56
|
+
const target = ctx.systemKey;
|
|
57
|
+
if (id === 'appPackage') {
|
|
58
|
+
const zip = getChannelPackageZip(ctx);
|
|
59
|
+
const zipPath = path.join(root, 'dist', 'channels', target, 'build', zip.fileName);
|
|
60
|
+
if (fs.existsSync(zipPath)) {
|
|
61
|
+
return { absPath: zipPath, contentType: 'application/zip', fileName: zip.fileName };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (id === 'manifest') {
|
|
65
|
+
const absPath = getArtifactOutputPath(root, target);
|
|
66
|
+
if (fs.existsSync(absPath)) {
|
|
67
|
+
return { absPath, contentType: 'application/json', fileName: path.basename(absPath) };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (id === 'installMd') {
|
|
71
|
+
const absPath = path.join(path.dirname(getArtifactOutputPath(root, target)), 'INSTALL.md');
|
|
72
|
+
if (fs.existsSync(absPath)) {
|
|
73
|
+
return { absPath, contentType: 'text/markdown; charset=utf-8', fileName: 'INSTALL.md' };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
throw httpError(`Artifact not found: ${id}`, 404);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @param {import('./workspace-context').WorkspaceContext} ctx
|
|
81
|
+
* @param {string} artifactId
|
|
82
|
+
* @returns {Object}
|
|
83
|
+
*/
|
|
84
|
+
function getChannelArtifact(ctx, artifactId) {
|
|
85
|
+
if (artifactId === 'appPackage') {
|
|
86
|
+
return getChannelPackageZip(ctx);
|
|
87
|
+
}
|
|
88
|
+
const file = resolveArtifactFile(ctx, artifactId);
|
|
89
|
+
return createHttpRawResult({
|
|
90
|
+
contentType: file.contentType,
|
|
91
|
+
body: fs.readFileSync(file.absPath),
|
|
92
|
+
fileName: file.fileName
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @param {Object} query
|
|
98
|
+
* @param {Object} body
|
|
99
|
+
* @returns {Object}
|
|
100
|
+
*/
|
|
101
|
+
function mergeCallbackPayload(query, body) {
|
|
102
|
+
return { ...(query && typeof query === 'object' ? query : {}), ...(body && typeof body === 'object' ? body : {}) };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @param {import('./workspace-context').WorkspaceContext} ctx
|
|
107
|
+
* @param {string} provider
|
|
108
|
+
* @param {Object} query
|
|
109
|
+
* @param {Object} body
|
|
110
|
+
* @param {Object} [deps]
|
|
111
|
+
* @returns {Promise<Object>}
|
|
112
|
+
*/
|
|
113
|
+
async function handleChannelCallback(ctx, provider, query, body, deps = {}) {
|
|
114
|
+
const session = requireChannelInstallSession(ctx);
|
|
115
|
+
const store = deps.storeCallback || storeChannelCallbackCredential;
|
|
116
|
+
await store(ctx, String(provider || ''), mergeCallbackPayload(query, body));
|
|
117
|
+
if (session.envelope && typeof session.envelope === 'object') {
|
|
118
|
+
const payload = toChannelInstallHttpPayload(session.envelope);
|
|
119
|
+
const definitionKey = session.definitionKey || session.channelTarget;
|
|
120
|
+
const installationKey = session.installationKey;
|
|
121
|
+
if (!definitionKey || !installationKey) {
|
|
122
|
+
return payload;
|
|
123
|
+
}
|
|
124
|
+
return attachInstallIdentity(payload, definitionKey, installationKey);
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
helpMarkdown: session.helpMarkdown,
|
|
128
|
+
helpMarkdownContentType: 'text/markdown'
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
module.exports = {
|
|
133
|
+
listChannelArtifacts,
|
|
134
|
+
getChannelArtifact,
|
|
135
|
+
handleChannelCallback,
|
|
136
|
+
storeChannelCallbackCredential
|
|
137
|
+
};
|