Skip to main content

InstallationsApi

@gravity-rail/sdk


@gravity-rail/sdk / InstallationsApi

Class: InstallationsApi

Extends​

Constructors​

Constructor​

new InstallationsApi(apiKey, baseUrl, customFetch?): InstallationsApi

Parameters​

apiKey​

string | undefined

baseUrl​

string

customFetch?​

{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Returns​

InstallationsApi

Inherited from​

BaseApiClient.constructor

Methods​

bindInstallationSlots()​

bindInstallationSlots(wid, installationUuid, data): Promise<InstallationResponse>

Fill open slots. A slot that already carries a target is refused with 409.

Parameters​

wid​

string

installationUuid​

string

data​

BindInstallationSlotsRequest

Returns​

Promise<InstallationResponse>


getInstallation()​

getInstallation(wid, installationUuid): Promise<InstallationResponse>

Parameters​

wid​

string

installationUuid​

string

Returns​

Promise<InstallationResponse>


getInstallationReadiness()​

getInstallationReadiness(wid, installationUuid): Promise<InstallationReadiness>

Open slots, bindings whose target no longer resolves, Forms that drifted from their recipe, missing or changed Workflow dependencies, and archived items. Computed on read, never stored.

Parameters​

wid​

string

installationUuid​

string

Returns​

Promise<InstallationReadiness>


getThemeSettingsSchema()​

getThemeSettingsSchema(wid, slug): Promise<ThemeSettingField[]>

The settings a compiled theme declares, for labelling a Site item's slots before any Site exists. 404 for an unknown slug and for source-site, whose schema is a per-workspace build artifact rather than a catalog one. Requires sites:read; no Bundle installation authority is needed.

Parameters​

wid​

string

slug​

string

Returns​

Promise<ThemeSettingField[]>


installBundle()​

installBundle(wid, bundleUuid, data): Promise<InstallationResponse>

Install a published Bundle version into this workspace.

A key in bindings that this version has no slot or Form item for is refused; a missing required slot is not.

Parameters​

wid​

string

bundleUuid​

string

data​

InstallBundleRequest

Returns​

Promise<InstallationResponse>


listInstallations()​

listInstallations(wid): Promise<InstallationResponse[]>

Every installation this workspace holds, oldest first.

Parameters​

wid​

string

Returns​

Promise<InstallationResponse[]>


preflightBundleInstallation()​

preflightBundleInstallation(wid, bundleUuid, data): Promise<BundleInstallationPreflightResponse>

Inspect one published release and its selected example dependencies.

Parameters​

wid​

string

bundleUuid​

string

data​

BundleInstallationPreflightRequest

Returns​

Promise<BundleInstallationPreflightResponse>


previewInstallationUpgrade()​

previewInstallationUpgrade(wid, installationUuid, to): Promise<InstallationUpgradePreview>

What moving to version to would change: per-item differences, the slots that would still be unbound, and the release notes of every version in between. to must be newer than the version the installation holds.

Parameters​

wid​

string

installationUuid​

string

to​

number

Returns​

Promise<InstallationUpgradePreview>


reconcileInstallation()​

reconcileInstallation(wid, installationUuid): Promise<InstallationResponse>

Settle an installation left pending by an interrupted operation.

The body is empty and required: a bodyless cookie-auth POST is forgeable by a cross-site form, so the route demands JSON.

Parameters​

wid​

string

installationUuid​

string

Returns​

Promise<InstallationResponse>


restoreInstallationForm()​

restoreInstallationForm(wid, installationUuid, data): Promise<InstallationResponse>

Recreate one deleted Form from the version already installed.

Parameters​

wid​

string

installationUuid​

string

data​

RestoreInstallationFormRequest

Returns​

Promise<InstallationResponse>


restoreInstallationWorkflowResources()​

restoreInstallationWorkflowResources(wid, installationUuid, data): Promise<InstallationResponse>

Recreate missing dependency resources for an installed Workflow.

Parameters​

wid​

string

installationUuid​

string

data​

RestoreInstallationWorkflowResourcesRequest

Returns​

Promise<InstallationResponse>


setEnhancedAuthHandler()​

setEnhancedAuthHandler(handler): void

Set the handler for enhanced authentication requirements (RFC 9470 Step-Up Auth). This handler is called when a 401 response includes WWW-Authenticate header with error="insufficient_user_authentication".

Parameters​

handler​

EnhancedAuthHandler | undefined

Returns​

void

Inherited from​

BaseApiClient.setEnhancedAuthHandler


setInstallationPolicy()​

setInstallationPolicy(wid, installationUuid, data): Promise<InstallationResponse>

pinned holds the installed version; auto follows each publication.

Parameters​

wid​

string

installationUuid​

string

data​

SetInstallationPolicyRequest

Returns​

Promise<InstallationResponse>


setOrgAuthHandler()​

setOrgAuthHandler(handler): void

Set the handler for organization authentication requirements. This handler is called when a 401 response includes WWW-Authenticate header with realm="org". The handler should redirect the user to complete org auth.

Parameters​

handler​

OrgAuthHandler | undefined

Returns​

void

Inherited from​

BaseApiClient.setOrgAuthHandler


setOrgSession()​

setOrgSession(session, orgUuid?): void

Set the opaque org session credential for cross-domain requests. Opaque gr_sess_ values use X-Org-Session. Legacy orgToken JWE values still use X-Org-Token through setOrgToken() during the migration window.

orgUuid is the org that issued the credential; passing it lets the 401 handler detect a stale session when a subsequent request targets a different org and re-fire the org-auth handler instead of silently 401-ing. Callers without that context (legacy / unknown) may omit it.

Parameters​

session​

string | undefined

orgUuid?​

string

Returns​

void

Inherited from​

BaseApiClient.setOrgSession


setOrgToken()​

setOrgToken(token, orgUuid?): void

Parameters​

token​

string | undefined

orgUuid?​

string

Returns​

void

Deprecated​

Legacy compatibility for stateless orgToken JWE credentials. Prefer setOrgSession() for opaque org browser sessions.

Inherited from​

BaseApiClient.setOrgToken


unsubscribeInstallation()​

unsubscribeInstallation(wid, installationUuid): Promise<InstallationResponse>

Stop future Bundle updates while keeping the workspace's installed content.

Parameters​

wid​

string

installationUuid​

string

Returns​

Promise<InstallationResponse>


updateApiKey()​

updateApiKey(newApiKey): void

Update the API key (used after successful re-authentication).

Parameters​

newApiKey​

string

Returns​

void

Inherited from​

BaseApiClient.updateApiKey


upgradeInstallation()​

upgradeInstallation(wid, installationUuid, data): Promise<InstallationResponse>

Move the installation onto a newer published version. The version it already holds, and any earlier one, are refused with 409.

Parameters​

wid​

string

installationUuid​

string

data​

UpgradeInstallationRequest

Returns​

Promise<InstallationResponse>