BundlesApi
@gravity-rail/sdk / BundlesApi
Class: BundlesApi
Extends
Constructors
Constructor
new BundlesApi(
apiKey,baseUrl,customFetch?):BundlesApi
Parameters
apiKey
string | undefined
baseUrl
string
customFetch?
{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }
Returns
BundlesApi
Inherited from
Methods
createBundle()
createBundle(
wid,data):Promise<BundleSummary>
Create an empty Bundle owned by this workspace.
Parameters
wid
string
data
Returns
Promise<BundleSummary>
getBundle()
getBundle(
wid,bundleUuid):Promise<BundleSummary>
Read an authorized Bundle by UUID, including official solutions hidden from discovery.
Parameters
wid
string
bundleUuid
string
Returns
Promise<BundleSummary>
getBundleDraft()
getBundleDraft(
wid,bundleUuid):Promise<BundleVersionResponse>
The unpublished draft for the owning workspace. A grantee is refused with
404: version_detail checks
root.workspace_uuid != viewer.workspace_uuid for the null version
(lib/db/resources/bundles.py), after the grantee-inclusive predicate has
already admitted them to the Bundle itself.
After publication, the next draft contains a copy of the published items. The owner receives it with 200; a grantee receives 404.
Parameters
wid
string
bundleUuid
string
Returns
Promise<BundleVersionResponse>
getBundleVersion()
getBundleVersion(
wid,bundleUuid,version):Promise<BundleVersionResponse>
One published version, with its items, declared settings and open slots.
Parameters
wid
string
bundleUuid
string
version
number
Returns
Promise<BundleVersionResponse>
getSolutionRelease()
getSolutionRelease(
slug):Promise<SolutionReleaseResponse>
Official solution metadata, independent of the default workspace Library.
Parameters
slug
Returns
Promise<SolutionReleaseResponse>
grantBundle()
grantBundle(
wid,bundleUuid,data):Promise<BundleGrantResponse>
Share throughout the publisher's organization with organization-admin authority. Workspace-specific and global author grants are refused. Official public solutions use the separate staff approval API.
Parameters
wid
string
bundleUuid
string
data
Returns
Promise<BundleGrantResponse>
listBundleGrants()
listBundleGrants(
wid,bundleUuid):Promise<BundleGrantResponse[]>
Who this Bundle is currently granted to.
Parameters
wid
string
bundleUuid
string
Returns
Promise<BundleGrantResponse[]>
listBundleInstallations()
listBundleInstallations(
wid,bundleUuid):Promise<InstallationResponse[]>
Parameters
wid
string
bundleUuid
string
Returns
Promise<InstallationResponse[]>
listBundles()
listBundles(
wid,params?):Promise<PaginatedResponseBundleSummary>
Bundles visible to this workspace through ownership, a live grant, or an administrator of the owning organization.
Parameters
wid
string
params?
page?
number
pageSize?
number
Returns
Promise<PaginatedResponseBundleSummary>
listBundleVersions()
listBundleVersions(
wid,bundleUuid,params?):Promise<PaginatedResponseBundleVersionSummary>
Published versions, newest first.
Parameters
wid
string
bundleUuid
string
params?
page?
number
pageSize?
number
Returns
Promise<PaginatedResponseBundleVersionSummary>
listBundleWorkflowCandidates()
listBundleWorkflowCandidates(
wid):Promise<BundleWorkflowCandidate[]>
This workspace's Workflows for the Bundle picker. eligible pins
revisionUuid (the active revision when published, else the newest
published one); unpublished has nothing to pin. dependenciesChecked is
false until a Bundle add has stored the revision's dependencies; that add
surfaces any refusal as a 409 workflow_not_shareable. Requires
workflows:admin.
Parameters
wid
string
Returns
Promise<BundleWorkflowCandidate[]>
publishBundle()
publishBundle(
wid,bundleUuid,data):Promise<BundleVersionResponse>
Cut a new immutable version from the draft. 409 when expectedGeneration is stale.
Parameters
wid
string
bundleUuid
string
data
Returns
Promise<BundleVersionResponse>
replaceBundleDraft()
replaceBundleDraft(
wid,bundleUuid,data):Promise<BundleVersionResponse>
Replace the whole draft item list. 409 when expectedGeneration is stale.
Parameters
wid
string
bundleUuid
string
data
Returns
Promise<BundleVersionResponse>
revokeBundleGrant()
revokeBundleGrant(
wid,bundleUuid,grantId):Promise<void>
Revoke one grant by id.
Parameters
wid
string
bundleUuid
string
grantId
number
Returns
Promise<void>
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
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
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
updateApiKey()
updateApiKey(
newApiKey):void
Update the API key (used after successful re-authentication).
Parameters
newApiKey
string
Returns
void
Inherited from
updateBundle()
updateBundle(
wid,bundleUuid,data):Promise<BundleSummary>
Parameters
wid
string
bundleUuid
string
data
Returns
Promise<BundleSummary>