@sanity/workbench-cli 2.22.2 → 2.23.0
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/dist/_exports/build.d.ts +1 -1
- package/dist/_exports/deploy.d.ts +16 -4
- package/dist/_exports/deploy.js +1 -0
- package/dist/_exports/deploy.js.map +1 -1
- package/dist/_exports/undeploy.d.ts +1 -1
- package/dist/actions/deploy/confirmDashboard2Replacement.js +23 -0
- package/dist/actions/deploy/confirmDashboard2Replacement.js.map +1 -0
- package/dist/services/applications.js.map +1 -1
- package/package.json +3 -3
package/dist/_exports/build.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as DASHBOARD_CONFIG_CONTRACT_VERSION, w as MEDIA_LIBRARY_CONFIG_CONTRACT_VERSION } from "./defineApp-zjy9NZQF.js";
|
|
2
1
|
import { i as resolveWorkbenchApp, n as WorkbenchExposes, r as resolveAppEntry, t as ResolvedWorkbenchApp } from "./resolveWorkbenchApp-Cqyc0Rgf.js";
|
|
2
|
+
import { _ as DASHBOARD_CONFIG_CONTRACT_VERSION, w as MEDIA_LIBRARY_CONFIG_CONTRACT_VERSION } from "./defineApp-zjy9NZQF.js";
|
|
3
3
|
import { t as resolveWorkbenchConfig } from "./resolveWorkbenchConfig-DVIYlkMD.js";
|
|
4
4
|
import { CliConfig } from "@sanity/cli-core";
|
|
5
5
|
import { InlineConfig, PluginOption } from "vite";
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { L as WorkbenchConfigValue } from "./defineApp-zjy9NZQF.js";
|
|
2
|
-
import { t as resolveWorkbenchConfig } from "./resolveWorkbenchConfig-DVIYlkMD.js";
|
|
3
2
|
import { a as DeployedInterface, c as summarizeInterfaces, l as DeployableWorkbenchApp, n as fetchOrganizationSummary, o as DeployedView, r as formatDeploySummary, s as DeployedWebWorker, t as fetchDeploySummaryDetails, u as getWorkbench } from "./deploySummary-D43W05vj.js";
|
|
4
|
-
import {
|
|
3
|
+
import { t as resolveWorkbenchConfig } from "./resolveWorkbenchConfig-DVIYlkMD.js";
|
|
4
|
+
import { AppVisibility, CliConfig, Output } from "@sanity/cli-core";
|
|
5
5
|
import { ImageFile } from "@sanity/cli-core/images";
|
|
6
6
|
import "node:stream";
|
|
7
7
|
import { ApplicationBase } from "@sanity/sdk";
|
|
8
|
+
/**
|
|
9
|
+
* Warns, and confirms unless `yes`, before a federated deploy replaces an application deployed for the previous Dashboard.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
declare function confirmDashboard2Replacement({ applicationId, output, warn, yes }: {
|
|
13
|
+
applicationId: string;
|
|
14
|
+
output: Output;
|
|
15
|
+
warn: (message: string) => void;
|
|
16
|
+
yes: boolean;
|
|
17
|
+
}): Promise<void>;
|
|
8
18
|
/**
|
|
9
19
|
* The org's active installation for an app type, or `undefined` when none is
|
|
10
20
|
* installed. Read-only, so `--dry-run` can report deployability.
|
|
@@ -83,7 +93,9 @@ interface BrettWorkspace {
|
|
|
83
93
|
declare function getWorkbenchUrl(organizationId: string, hostSlug?: string | null): string;
|
|
84
94
|
/** Where a deployed application is served on its organization's workbench. */
|
|
85
95
|
declare function getApplicationUrl(application: Pick<Application, 'id' | 'organizationId' | 'slug' | 'type'>, hostSlug?: string | null): string;
|
|
86
|
-
declare function getApplication(applicationId: string): Promise<Application
|
|
96
|
+
declare function getApplication(applicationId: string): Promise<(Application & {
|
|
97
|
+
isLegacy?: boolean;
|
|
98
|
+
}) | null>;
|
|
87
99
|
/** Every application in an organization, in one page (`limit=none`). */
|
|
88
100
|
declare function listApplications(organizationId: string): Promise<Application[]>;
|
|
89
101
|
/**
|
|
@@ -195,5 +207,5 @@ interface AppIcon extends ImageFile {
|
|
|
195
207
|
* @internal
|
|
196
208
|
*/
|
|
197
209
|
declare function readAppIcon(workDir: string, iconPath: string): Promise<AppIcon>;
|
|
198
|
-
export { type Application, type BrettAccess, type BrettWorkspace, type CreatedApplication, type DeployedInterface, type DeployedView, type DeployedWebWorker, type WorkbenchDeployPayload, createCoreApp, createStudio, deployConfig, deployWorkbenchApp, fetchDeploySummaryDetails, fetchOrganizationSummary, formatDeploySummary, getApplication, getApplicationUrl, getOrganizationDashboard, getWorkbench, getWorkbenchUrl, listApplications, readAppIcon, resolveInstallationId, resolveWorkbenchConfig, selectWorkbenchAppId, summarizeConfig, summarizeInterfaces, toWorkbenchPayload, uploadDashboardConfig };
|
|
210
|
+
export { type Application, type BrettAccess, type BrettWorkspace, type CreatedApplication, type DeployedInterface, type DeployedView, type DeployedWebWorker, type WorkbenchDeployPayload, confirmDashboard2Replacement, createCoreApp, createStudio, deployConfig, deployWorkbenchApp, fetchDeploySummaryDetails, fetchOrganizationSummary, formatDeploySummary, getApplication, getApplicationUrl, getOrganizationDashboard, getWorkbench, getWorkbenchUrl, listApplications, readAppIcon, resolveInstallationId, resolveWorkbenchConfig, selectWorkbenchAppId, summarizeConfig, summarizeInterfaces, toWorkbenchPayload, uploadDashboardConfig };
|
|
199
211
|
//# sourceMappingURL=deploy.d.ts.map
|
package/dist/_exports/deploy.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { confirmDashboard2Replacement } from '../actions/deploy/confirmDashboard2Replacement.js';
|
|
1
2
|
export { deployConfig, resolveInstallationId, summarizeConfig } from '../actions/deploy/deployConfig.js';
|
|
2
3
|
export { toWorkbenchPayload } from '../actions/deploy/deployPayload.js';
|
|
3
4
|
export { fetchDeploySummaryDetails, fetchOrganizationSummary, formatDeploySummary } from '../actions/deploy/deploySummary.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/deploy.ts"],"sourcesContent":["export {\n deployConfig,\n resolveInstallationId,\n summarizeConfig,\n} from '../actions/deploy/deployConfig.js'\nexport {toWorkbenchPayload, type WorkbenchDeployPayload} from '../actions/deploy/deployPayload.js'\nexport {\n fetchDeploySummaryDetails,\n fetchOrganizationSummary,\n formatDeploySummary,\n} from '../actions/deploy/deploySummary.js'\nexport {\n createCoreApp,\n type CreatedApplication,\n createStudio,\n deployWorkbenchApp,\n} from '../actions/deploy/deployWorkbenchApp.js'\nexport {getWorkbench} from '../actions/deploy/getWorkbench.js'\nexport {selectWorkbenchAppId} from '../actions/deploy/selectWorkbenchAppId.js'\nexport {\n type DeployedInterface,\n type DeployedView,\n type DeployedWebWorker,\n summarizeInterfaces,\n} from '../actions/deploy/summarizeInterfaces.js'\nexport {uploadDashboardConfig} from '../actions/deploy/uploadDashboardConfig.js'\nexport {readAppIcon} from '../readAppIcon.js'\nexport {resolveWorkbenchConfig} from '../resolveWorkbenchConfig.js'\nexport {\n type Application,\n type BrettAccess,\n type BrettWorkspace,\n getApplication,\n getApplicationUrl,\n getWorkbenchUrl,\n listApplications,\n} from '../services/applications.js'\nexport {getOrganizationDashboard} from '../services/dashboard-configs.js'\n"],"names":["deployConfig","resolveInstallationId","summarizeConfig","toWorkbenchPayload","fetchDeploySummaryDetails","fetchOrganizationSummary","formatDeploySummary","createCoreApp","createStudio","deployWorkbenchApp","getWorkbench","selectWorkbenchAppId","summarizeInterfaces","uploadDashboardConfig","readAppIcon","resolveWorkbenchConfig","getApplication","getApplicationUrl","getWorkbenchUrl","listApplications","getOrganizationDashboard"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/deploy.ts"],"sourcesContent":["export {confirmDashboard2Replacement} from '../actions/deploy/confirmDashboard2Replacement.js'\nexport {\n deployConfig,\n resolveInstallationId,\n summarizeConfig,\n} from '../actions/deploy/deployConfig.js'\nexport {toWorkbenchPayload, type WorkbenchDeployPayload} from '../actions/deploy/deployPayload.js'\nexport {\n fetchDeploySummaryDetails,\n fetchOrganizationSummary,\n formatDeploySummary,\n} from '../actions/deploy/deploySummary.js'\nexport {\n createCoreApp,\n type CreatedApplication,\n createStudio,\n deployWorkbenchApp,\n} from '../actions/deploy/deployWorkbenchApp.js'\nexport {getWorkbench} from '../actions/deploy/getWorkbench.js'\nexport {selectWorkbenchAppId} from '../actions/deploy/selectWorkbenchAppId.js'\nexport {\n type DeployedInterface,\n type DeployedView,\n type DeployedWebWorker,\n summarizeInterfaces,\n} from '../actions/deploy/summarizeInterfaces.js'\nexport {uploadDashboardConfig} from '../actions/deploy/uploadDashboardConfig.js'\nexport {readAppIcon} from '../readAppIcon.js'\nexport {resolveWorkbenchConfig} from '../resolveWorkbenchConfig.js'\nexport {\n type Application,\n type BrettAccess,\n type BrettWorkspace,\n getApplication,\n getApplicationUrl,\n getWorkbenchUrl,\n listApplications,\n} from '../services/applications.js'\nexport {getOrganizationDashboard} from '../services/dashboard-configs.js'\n"],"names":["confirmDashboard2Replacement","deployConfig","resolveInstallationId","summarizeConfig","toWorkbenchPayload","fetchDeploySummaryDetails","fetchOrganizationSummary","formatDeploySummary","createCoreApp","createStudio","deployWorkbenchApp","getWorkbench","selectWorkbenchAppId","summarizeInterfaces","uploadDashboardConfig","readAppIcon","resolveWorkbenchConfig","getApplication","getApplicationUrl","getWorkbenchUrl","listApplications","getOrganizationDashboard"],"mappings":"AAAA,SAAQA,4BAA4B,QAAO,oDAAmD;AAC9F,SACEC,YAAY,EACZC,qBAAqB,EACrBC,eAAe,QACV,oCAAmC;AAC1C,SAAQC,kBAAkB,QAAoC,qCAAoC;AAClG,SACEC,yBAAyB,EACzBC,wBAAwB,EACxBC,mBAAmB,QACd,qCAAoC;AAC3C,SACEC,aAAa,EAEbC,YAAY,EACZC,kBAAkB,QACb,0CAAyC;AAChD,SAAQC,YAAY,QAAO,oCAAmC;AAC9D,SAAQC,oBAAoB,QAAO,4CAA2C;AAC9E,SAIEC,mBAAmB,QACd,2CAA0C;AACjD,SAAQC,qBAAqB,QAAO,6CAA4C;AAChF,SAAQC,WAAW,QAAO,oBAAmB;AAC7C,SAAQC,sBAAsB,QAAO,+BAA8B;AACnE,SAIEC,cAAc,EACdC,iBAAiB,EACjBC,eAAe,EACfC,gBAAgB,QACX,8BAA6B;AACpC,SAAQC,wBAAwB,QAAO,mCAAkC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as WorkbenchConfig } from "./defineApp-zjy9NZQF.js";
|
|
2
1
|
import { i as formatUndeploySummary, l as DeployableWorkbenchApp, o as DeployedView, s as DeployedWebWorker } from "./deploySummary-D43W05vj.js";
|
|
2
|
+
import { l as WorkbenchConfig } from "./defineApp-zjy9NZQF.js";
|
|
3
3
|
import "node:stream";
|
|
4
4
|
import { UndeployAdapter, UndeployApplicationTarget, UndeployConfigTarget } from "@sanity/cli-core/undeploy";
|
|
5
5
|
interface ConfigSnapshot {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { exitCodes } from '@sanity/cli-core';
|
|
2
|
+
import { confirm } from '@sanity/cli-core/ux';
|
|
3
|
+
import { getApplication } from '../../services/applications.js';
|
|
4
|
+
/**
|
|
5
|
+
* Warns, and confirms unless `yes`, before a federated deploy replaces an application deployed for the previous Dashboard.
|
|
6
|
+
* @internal
|
|
7
|
+
*/ export async function confirmDashboard2Replacement({ applicationId, output, warn, yes }) {
|
|
8
|
+
const application = await getApplication(applicationId);
|
|
9
|
+
if (!application?.isLegacy) return;
|
|
10
|
+
warn(`"${application.title}" was deployed for the previous Dashboard. ` + 'This deploy replaces it with a version that only opens in the new Dashboard. ' + `Members of organization ${application.organizationId} who use the previous Dashboard can no longer open it. ` + 'Pass --yes to skip this confirmation.');
|
|
11
|
+
if (yes) return;
|
|
12
|
+
const proceed = await confirm({
|
|
13
|
+
default: false,
|
|
14
|
+
message: `Replace "${application.title}" with a version for the new Dashboard?`
|
|
15
|
+
});
|
|
16
|
+
if (!proceed) {
|
|
17
|
+
output.error(`Deploy cancelled. "${application.title}" is unchanged.`, {
|
|
18
|
+
exit: exitCodes.USER_ABORT
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=confirmDashboard2Replacement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/actions/deploy/confirmDashboard2Replacement.ts"],"sourcesContent":["import {exitCodes, type Output} from '@sanity/cli-core'\nimport {confirm} from '@sanity/cli-core/ux'\n\nimport {getApplication} from '../../services/applications.js'\n\n/**\n * Warns, and confirms unless `yes`, before a federated deploy replaces an application deployed for the previous Dashboard.\n * @internal\n */\nexport async function confirmDashboard2Replacement({\n applicationId,\n output,\n warn,\n yes,\n}: {\n applicationId: string\n output: Output\n warn: (message: string) => void\n yes: boolean\n}): Promise<void> {\n const application = await getApplication(applicationId)\n\n if (!application?.isLegacy) return\n\n warn(\n `\"${application.title}\" was deployed for the previous Dashboard. ` +\n 'This deploy replaces it with a version that only opens in the new Dashboard. ' +\n `Members of organization ${application.organizationId} who use the previous Dashboard can no longer open it. ` +\n 'Pass --yes to skip this confirmation.',\n )\n\n if (yes) return\n\n const proceed = await confirm({\n default: false,\n message: `Replace \"${application.title}\" with a version for the new Dashboard?`,\n })\n\n if (!proceed) {\n output.error(`Deploy cancelled. \"${application.title}\" is unchanged.`, {\n exit: exitCodes.USER_ABORT,\n })\n }\n}\n"],"names":["exitCodes","confirm","getApplication","confirmDashboard2Replacement","applicationId","output","warn","yes","application","isLegacy","title","organizationId","proceed","default","message","error","exit","USER_ABORT"],"mappings":"AAAA,SAAQA,SAAS,QAAoB,mBAAkB;AACvD,SAAQC,OAAO,QAAO,sBAAqB;AAE3C,SAAQC,cAAc,QAAO,iCAAgC;AAE7D;;;CAGC,GACD,OAAO,eAAeC,6BAA6B,EACjDC,aAAa,EACbC,MAAM,EACNC,IAAI,EACJC,GAAG,EAMJ;IACC,MAAMC,cAAc,MAAMN,eAAeE;IAEzC,IAAI,CAACI,aAAaC,UAAU;IAE5BH,KACE,CAAC,CAAC,EAAEE,YAAYE,KAAK,CAAC,2CAA2C,CAAC,GAChE,kFACA,CAAC,wBAAwB,EAAEF,YAAYG,cAAc,CAAC,uDAAuD,CAAC,GAC9G;IAGJ,IAAIJ,KAAK;IAET,MAAMK,UAAU,MAAMX,QAAQ;QAC5BY,SAAS;QACTC,SAAS,CAAC,SAAS,EAAEN,YAAYE,KAAK,CAAC,uCAAuC,CAAC;IACjF;IAEA,IAAI,CAACE,SAAS;QACZP,OAAOU,KAAK,CAAC,CAAC,mBAAmB,EAAEP,YAAYE,KAAK,CAAC,eAAe,CAAC,EAAE;YACrEM,MAAMhB,UAAUiB,UAAU;QAC5B;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/applications.ts"],"sourcesContent":["import {PassThrough, type Readable} from 'node:stream'\n\nimport {type AppVisibility, getGlobalCliClient} from '@sanity/cli-core'\nimport {type ImageFile} from '@sanity/cli-core/images'\nimport {isStaging} from '@sanity/cli-core/util'\nimport {type ApplicationBase} from '@sanity/sdk'\nimport FormData from 'form-data'\n\nimport {type TileInterfaceMetadata, type ViewPlacementMetadata} from '../contract.js'\nimport {APP_WORKBENCH_API_VERSION} from './apiVersion.js'\n\nexport type ApplicationType = 'coreApp' | 'studio'\n\nexport type Application = ApplicationBase\n\ninterface BrettInterfaceBase {\n moduleId: string\n name: string\n title: string\n version: string\n}\n\n/**\n * An interface as Brett stores it, discriminated on `type`. `moduleId` is\n * remote-relative — the host prepends the app's id. Brett assigns the id.\n * @internal\n */\nexport type BrettInterface =\n | (BrettInterfaceBase & {metadata: null; type: 'asset_source'})\n | (BrettInterfaceBase & {metadata: null; type: 'worker'})\n | (BrettInterfaceBase & {metadata: TileInterfaceMetadata; type: 'tile'})\n | (BrettInterfaceBase & {metadata: ViewPlacementMetadata | null; type: 'app'})\n | (BrettInterfaceBase & {metadata: ViewPlacementMetadata | null; type: 'panel'})\n\n/**\n * A resource a deployment may interact with, as Brett stores it. Per-deployment\n * and forbidden for singletons (the server 400s).\n */\nexport interface BrettAccess {\n resourceId: string\n resourceType: 'canvas' | 'dashboard' | 'dataset' | 'media-library'\n}\n\n/** A studio workspace as Brett stores it. */\nexport interface BrettWorkspace {\n dataset: string\n projectId: string\n /** Lexicon schema descriptor id; Brett requires one per workspace. */\n schemaDescriptorId: string\n\n basePath?: string\n icon?: string\n name?: string\n subtitle?: string\n title?: string\n}\n\n/**\n * The organization's Dashboard, on its host slug when it has one. Sessions are\n * per origin and the org ID host redirects to the slug host, so a link to the\n * org ID host would make the user sign in again.\n */\nexport function getWorkbenchUrl(organizationId: string, hostSlug?: string | null): string {\n const host = (hostSlug ?? organizationId).toLowerCase()\n return `https://${host}.${isStaging() ? 'run.sanity.work' : 'sanity.run'}`\n}\n\n/** Where a deployed application is served on its organization's workbench. */\nexport function getApplicationUrl(\n application: Pick<Application, 'id' | 'organizationId' | 'slug' | 'type'>,\n hostSlug?: string | null,\n): string {\n const segment = application.type === 'studio' ? 'studios' : 'applications'\n return `${getWorkbenchUrl(application.organizationId, hostSlug)}/${segment}/${application.slug ?? application.id}`\n}\n\nasync function getClient() {\n return getGlobalCliClient({apiVersion: APP_WORKBENCH_API_VERSION, requireUser: true})\n}\n\nexport async function getApplication(applicationId: string): Promise<Application | null> {\n const client = await getClient()\n try {\n return await client.request({url: `/applications/${applicationId}`})\n } catch (err) {\n if ((err as {statusCode?: number})?.statusCode === 404) return null\n throw err\n }\n}\n\nexport async function getOrganizationApplication(\n organizationId: string,\n idOrSlug: string,\n signal?: AbortSignal,\n): Promise<\n (Application & {activeDeployment: {createdAt: string; deployedBy: string} | null}) | null\n> {\n const client = await getGlobalCliClient({\n apiVersion: APP_WORKBENCH_API_VERSION,\n ignoreWarnings: ['This is an experimental API version', 'which will change without warning'],\n requireUser: true,\n })\n try {\n return await client.request({\n query: {include: 'activeDeployment'},\n signal,\n url: `/organizations/${organizationId}/applications/${idOrSlug}`,\n })\n } catch (err) {\n if ((err as {statusCode?: number})?.statusCode === 404) return null\n throw err\n }\n}\n\n/** Every application in an organization, in one page (`limit=none`). */\nexport async function listApplications(organizationId: string): Promise<Application[]> {\n const client = await getClient()\n const {data}: {data: Application[]} = await client.request({\n query: {limit: 'none', organizationId},\n url: '/applications',\n })\n return data\n}\n\n/**\n * Create an application record (no deployment), so the CLI can build with the\n * returned id, then ship it via {@link createDeployment}.\n */\nexport async function createApplication(options: {\n /** The origin a customer serves the build from; Brett then never hosts a bundle for it. */\n externalUrl?: string\n isSingleton?: boolean\n name?: string\n organizationId: string\n projectId?: string\n slug: string\n title: string\n type: ApplicationType\n visibility?: AppVisibility\n}): Promise<Application> {\n const {externalUrl, isSingleton, name, organizationId, projectId, slug, title, type, visibility} =\n options\n const client = await getClient()\n return client.request({\n body: {\n organizationId,\n slug,\n title,\n type,\n // Identity, distinct from the slug address. Omitted → Brett defaults it to slug.\n ...(name ? {name} : {}),\n // Brett requires `isSingleton` on `POST /applications`, so the request\n // builder keeps forwarding it even though the CLI itself never sets it.\n ...(isSingleton === undefined ? {} : {isSingleton}),\n ...(visibility ? {visibility} : {}),\n ...(externalUrl ? {externalUrl} : {}),\n // Studio config is set once, at create — it's immutable on redeploy.\n ...(projectId ? {config: {studio: {projectId}}} : {}),\n },\n method: 'POST',\n url: `/applications`,\n })\n}\n\n/** Mutable application fields the deploy flow patches after create. */\nexport interface ApplicationUpdate {\n /** The address the application is served at; renaming moves it. */\n slug?: string\n title?: string\n visibility?: AppVisibility\n}\n\n// Patch an application's mutable fields.\nexport async function updateApplication(\n applicationId: string,\n update: ApplicationUpdate,\n): Promise<void> {\n const client = await getClient()\n await client.request({body: update, method: 'PATCH', url: `/applications/${applicationId}`})\n}\n\n/** Upload the application's icon, replacing any it has. */\nexport async function setApplicationIcon(applicationId: string, icon: ImageFile): Promise<void> {\n const client = await getClient()\n await client.request({\n body: icon.image,\n headers: {'Content-Type': icon.contentType},\n method: 'PUT',\n url: `/applications/${applicationId}/icon`,\n })\n}\n\n/** Remove the application's icon; removing one that isn't set changes nothing. */\nexport async function removeApplicationIcon(applicationId: string): Promise<void> {\n const client = await getClient()\n await client.request({method: 'DELETE', url: `/applications/${applicationId}/icon`})\n}\n\n/** Upload an app or panel interface's icon, replacing any it has. */\nexport async function setInterfaceIcon(\n applicationId: string,\n interfaceId: string,\n icon: ImageFile,\n): Promise<void> {\n const client = await getClient()\n await client.request({\n body: icon.image,\n headers: {'Content-Type': icon.contentType},\n method: 'PUT',\n url: `/applications/${applicationId}/interfaces/${interfaceId}/icon`,\n })\n}\n\n/**\n * Deploy a new active version to an existing application. `mfManifest` is the\n * build's federation manifest; `tarball` is omitted for an external application,\n * whose build the customer serves themselves.\n */\nexport async function createDeployment(options: {\n access?: readonly BrettAccess[]\n applicationId: string\n interfaces: readonly BrettInterface[]\n isAutoUpdating: boolean\n mfManifest: Record<string, unknown>\n tarball?: Readable\n version: string\n workspaces?: readonly BrettWorkspace[]\n}): Promise<{id: string; interfaces: {id: string; name: string; type: BrettInterface['type']}[]}> {\n const {\n access,\n applicationId,\n interfaces,\n isAutoUpdating,\n mfManifest,\n tarball,\n version,\n workspaces,\n } = options\n const formData = new FormData()\n formData.append('isAutoUpdating', isAutoUpdating.toString())\n appendDeploymentParts(formData, {access, interfaces, mfManifest, tarball, version, workspaces})\n return request(`/applications/${applicationId}/deployments`, formData)\n}\n\n/** Soft-deletes the application and all its deployments; already deleted counts as done. */\nexport async function deleteApplication(applicationId: string): Promise<void> {\n const client = await getClient()\n try {\n await client.request({method: 'DELETE', url: `/applications/${applicationId}`})\n } catch (err) {\n if ((err as {statusCode?: number})?.statusCode !== 404) throw err\n }\n}\n\nfunction appendDeploymentParts(\n formData: FormData,\n {\n access,\n interfaces,\n mfManifest,\n tarball,\n version,\n workspaces,\n }: {\n access?: readonly BrettAccess[]\n interfaces: readonly BrettInterface[]\n mfManifest: Record<string, unknown>\n tarball?: Readable\n version: string\n workspaces?: readonly BrettWorkspace[]\n },\n): void {\n formData.append('version', version)\n appendJson(formData, 'interfaces', interfaces)\n // Studio-only — the server rejects a workspaces part on non-studio types.\n if (workspaces?.length) appendJson(formData, 'workspaces', workspaces)\n // Per-deployment; forbidden for singletons, so callers omit it there.\n if (access?.length) appendJson(formData, 'access', access)\n appendJson(formData, 'mfManifest', mfManifest)\n // Last: the server requires every field part to precede the tarball.\n if (tarball) {\n formData.append('tarball', tarball, {contentType: 'application/gzip', filename: 'app.tar.gz'})\n }\n}\n\n/** Structured parts must arrive as JSON so the server parses them. */\nfunction appendJson(formData: FormData, name: string, value: unknown): void {\n formData.append(name, JSON.stringify(value), {contentType: 'application/json'})\n}\n\nasync function request<T>(url: string, formData: FormData): Promise<T> {\n const client = await getClient()\n return client.request({\n body: formData.pipe(new PassThrough()),\n headers: formData.getHeaders(),\n method: 'POST',\n url,\n })\n}\n"],"names":["PassThrough","getGlobalCliClient","isStaging","FormData","APP_WORKBENCH_API_VERSION","getWorkbenchUrl","organizationId","hostSlug","host","toLowerCase","getApplicationUrl","application","segment","type","slug","id","getClient","apiVersion","requireUser","getApplication","applicationId","client","request","url","err","statusCode","getOrganizationApplication","idOrSlug","signal","ignoreWarnings","query","include","listApplications","data","limit","createApplication","options","externalUrl","isSingleton","name","projectId","title","visibility","body","undefined","config","studio","method","updateApplication","update","setApplicationIcon","icon","image","headers","contentType","removeApplicationIcon","setInterfaceIcon","interfaceId","createDeployment","access","interfaces","isAutoUpdating","mfManifest","tarball","version","workspaces","formData","append","toString","appendDeploymentParts","deleteApplication","appendJson","length","filename","value","JSON","stringify","pipe","getHeaders"],"mappings":"AAAA,SAAQA,WAAW,QAAsB,cAAa;AAEtD,SAA4BC,kBAAkB,QAAO,mBAAkB;AAEvE,SAAQC,SAAS,QAAO,wBAAuB;AAE/C,OAAOC,cAAc,YAAW;AAGhC,SAAQC,yBAAyB,QAAO,kBAAiB;AAgDzD;;;;CAIC,GACD,OAAO,SAASC,gBAAgBC,cAAsB,EAAEC,QAAwB;IAC9E,MAAMC,OAAO,AAACD,CAAAA,YAAYD,cAAa,EAAGG,WAAW;IACrD,OAAO,CAAC,QAAQ,EAAED,KAAK,CAAC,EAAEN,cAAc,oBAAoB,cAAc;AAC5E;AAEA,4EAA4E,GAC5E,OAAO,SAASQ,kBACdC,WAAyE,EACzEJ,QAAwB;IAExB,MAAMK,U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;IACnC,0EAA0E;IAC1E,IAAIK,YAAYO,QAAQD,WAAWL,UAAU,cAAcD;IAC3D,sEAAsE;IACtE,IAAIN,QAAQa,QAAQD,WAAWL,UAAU,UAAUP;IACnDY,WAAWL,UAAU,cAAcJ;IACnC,qEAAqE;IACrE,IAAIC,SAAS;QACXG,SAASC,MAAM,CAAC,WAAWJ,SAAS;YAACT,aAAa;YAAoBmB,UAAU;QAAY;IAC9F;AACF;AAEA,oEAAoE,GACpE,SAASF,WAAWL,QAAkB,EAAE3B,IAAY,EAAEmC,KAAc;IAClER,SAASC,MAAM,CAAC5B,MAAMoC,KAAKC,SAAS,CAACF,QAAQ;QAACpB,aAAa;IAAkB;AAC/E;AAEA,eAAehC,QAAWC,GAAW,EAAE2C,QAAkB;IACvD,MAAM7C,SAAS,MAAML;IACrB,OAAOK,OAAOC,OAAO,CAAC;QACpBqB,MAAMuB,SAASW,IAAI,CAAC,IAAI7E;QACxBqD,SAASa,SAASY,UAAU;QAC5B/B,QAAQ;QACRxB;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/services/applications.ts"],"sourcesContent":["import {PassThrough, type Readable} from 'node:stream'\n\nimport {type AppVisibility, getGlobalCliClient} from '@sanity/cli-core'\nimport {type ImageFile} from '@sanity/cli-core/images'\nimport {isStaging} from '@sanity/cli-core/util'\nimport {type ApplicationBase} from '@sanity/sdk'\nimport FormData from 'form-data'\n\nimport {type TileInterfaceMetadata, type ViewPlacementMetadata} from '../contract.js'\nimport {APP_WORKBENCH_API_VERSION} from './apiVersion.js'\n\nexport type ApplicationType = 'coreApp' | 'studio'\n\nexport type Application = ApplicationBase\n\ninterface BrettInterfaceBase {\n moduleId: string\n name: string\n title: string\n version: string\n}\n\n/**\n * An interface as Brett stores it, discriminated on `type`. `moduleId` is\n * remote-relative — the host prepends the app's id. Brett assigns the id.\n * @internal\n */\nexport type BrettInterface =\n | (BrettInterfaceBase & {metadata: null; type: 'asset_source'})\n | (BrettInterfaceBase & {metadata: null; type: 'worker'})\n | (BrettInterfaceBase & {metadata: TileInterfaceMetadata; type: 'tile'})\n | (BrettInterfaceBase & {metadata: ViewPlacementMetadata | null; type: 'app'})\n | (BrettInterfaceBase & {metadata: ViewPlacementMetadata | null; type: 'panel'})\n\n/**\n * A resource a deployment may interact with, as Brett stores it. Per-deployment\n * and forbidden for singletons (the server 400s).\n */\nexport interface BrettAccess {\n resourceId: string\n resourceType: 'canvas' | 'dashboard' | 'dataset' | 'media-library'\n}\n\n/** A studio workspace as Brett stores it. */\nexport interface BrettWorkspace {\n dataset: string\n projectId: string\n /** Lexicon schema descriptor id; Brett requires one per workspace. */\n schemaDescriptorId: string\n\n basePath?: string\n icon?: string\n name?: string\n subtitle?: string\n title?: string\n}\n\n/**\n * The organization's Dashboard, on its host slug when it has one. Sessions are\n * per origin and the org ID host redirects to the slug host, so a link to the\n * org ID host would make the user sign in again.\n */\nexport function getWorkbenchUrl(organizationId: string, hostSlug?: string | null): string {\n const host = (hostSlug ?? organizationId).toLowerCase()\n return `https://${host}.${isStaging() ? 'run.sanity.work' : 'sanity.run'}`\n}\n\n/** Where a deployed application is served on its organization's workbench. */\nexport function getApplicationUrl(\n application: Pick<Application, 'id' | 'organizationId' | 'slug' | 'type'>,\n hostSlug?: string | null,\n): string {\n const segment = application.type === 'studio' ? 'studios' : 'applications'\n return `${getWorkbenchUrl(application.organizationId, hostSlug)}/${segment}/${application.slug ?? application.id}`\n}\n\nasync function getClient() {\n return getGlobalCliClient({apiVersion: APP_WORKBENCH_API_VERSION, requireUser: true})\n}\n\nexport async function getApplication(\n applicationId: string,\n): Promise<(Application & {isLegacy?: boolean}) | null> {\n const client = await getClient()\n try {\n return await client.request({url: `/applications/${applicationId}`})\n } catch (err) {\n if ((err as {statusCode?: number})?.statusCode === 404) return null\n throw err\n }\n}\n\nexport async function getOrganizationApplication(\n organizationId: string,\n idOrSlug: string,\n signal?: AbortSignal,\n): Promise<\n (Application & {activeDeployment: {createdAt: string; deployedBy: string} | null}) | null\n> {\n const client = await getGlobalCliClient({\n apiVersion: APP_WORKBENCH_API_VERSION,\n ignoreWarnings: ['This is an experimental API version', 'which will change without warning'],\n requireUser: true,\n })\n try {\n return await client.request({\n query: {include: 'activeDeployment'},\n signal,\n url: `/organizations/${organizationId}/applications/${idOrSlug}`,\n })\n } catch (err) {\n if ((err as {statusCode?: number})?.statusCode === 404) return null\n throw err\n }\n}\n\n/** Every application in an organization, in one page (`limit=none`). */\nexport async function listApplications(organizationId: string): Promise<Application[]> {\n const client = await getClient()\n const {data}: {data: Application[]} = await client.request({\n query: {limit: 'none', organizationId},\n url: '/applications',\n })\n return data\n}\n\n/**\n * Create an application record (no deployment), so the CLI can build with the\n * returned id, then ship it via {@link createDeployment}.\n */\nexport async function createApplication(options: {\n /** The origin a customer serves the build from; Brett then never hosts a bundle for it. */\n externalUrl?: string\n isSingleton?: boolean\n name?: string\n organizationId: string\n projectId?: string\n slug: string\n title: string\n type: ApplicationType\n visibility?: AppVisibility\n}): Promise<Application> {\n const {externalUrl, isSingleton, name, organizationId, projectId, slug, title, type, visibility} =\n options\n const client = await getClient()\n return client.request({\n body: {\n organizationId,\n slug,\n title,\n type,\n // Identity, distinct from the slug address. Omitted → Brett defaults it to slug.\n ...(name ? {name} : {}),\n // Brett requires `isSingleton` on `POST /applications`, so the request\n // builder keeps forwarding it even though the CLI itself never sets it.\n ...(isSingleton === undefined ? {} : {isSingleton}),\n ...(visibility ? {visibility} : {}),\n ...(externalUrl ? {externalUrl} : {}),\n // Studio config is set once, at create — it's immutable on redeploy.\n ...(projectId ? {config: {studio: {projectId}}} : {}),\n },\n method: 'POST',\n url: `/applications`,\n })\n}\n\n/** Mutable application fields the deploy flow patches after create. */\nexport interface ApplicationUpdate {\n /** The address the application is served at; renaming moves it. */\n slug?: string\n title?: string\n visibility?: AppVisibility\n}\n\n// Patch an application's mutable fields.\nexport async function updateApplication(\n applicationId: string,\n update: ApplicationUpdate,\n): Promise<void> {\n const client = await getClient()\n await client.request({body: update, method: 'PATCH', url: `/applications/${applicationId}`})\n}\n\n/** Upload the application's icon, replacing any it has. */\nexport async function setApplicationIcon(applicationId: string, icon: ImageFile): Promise<void> {\n const client = await getClient()\n await client.request({\n body: icon.image,\n headers: {'Content-Type': icon.contentType},\n method: 'PUT',\n url: `/applications/${applicationId}/icon`,\n })\n}\n\n/** Remove the application's icon; removing one that isn't set changes nothing. */\nexport async function removeApplicationIcon(applicationId: string): Promise<void> {\n const client = await getClient()\n await client.request({method: 'DELETE', url: `/applications/${applicationId}/icon`})\n}\n\n/** Upload an app or panel interface's icon, replacing any it has. */\nexport async function setInterfaceIcon(\n applicationId: string,\n interfaceId: string,\n icon: ImageFile,\n): Promise<void> {\n const client = await getClient()\n await client.request({\n body: icon.image,\n headers: {'Content-Type': icon.contentType},\n method: 'PUT',\n url: `/applications/${applicationId}/interfaces/${interfaceId}/icon`,\n })\n}\n\n/**\n * Deploy a new active version to an existing application. `mfManifest` is the\n * build's federation manifest; `tarball` is omitted for an external application,\n * whose build the customer serves themselves.\n */\nexport async function createDeployment(options: {\n access?: readonly BrettAccess[]\n applicationId: string\n interfaces: readonly BrettInterface[]\n isAutoUpdating: boolean\n mfManifest: Record<string, unknown>\n tarball?: Readable\n version: string\n workspaces?: readonly BrettWorkspace[]\n}): Promise<{id: string; interfaces: {id: string; name: string; type: BrettInterface['type']}[]}> {\n const {\n access,\n applicationId,\n interfaces,\n isAutoUpdating,\n mfManifest,\n tarball,\n version,\n workspaces,\n } = options\n const formData = new FormData()\n formData.append('isAutoUpdating', isAutoUpdating.toString())\n appendDeploymentParts(formData, {access, interfaces, mfManifest, tarball, version, workspaces})\n return request(`/applications/${applicationId}/deployments`, formData)\n}\n\n/** Soft-deletes the application and all its deployments; already deleted counts as done. */\nexport async function deleteApplication(applicationId: string): Promise<void> {\n const client = await getClient()\n try {\n await client.request({method: 'DELETE', url: `/applications/${applicationId}`})\n } catch (err) {\n if ((err as {statusCode?: number})?.statusCode !== 404) throw err\n }\n}\n\nfunction appendDeploymentParts(\n formData: FormData,\n {\n access,\n interfaces,\n mfManifest,\n tarball,\n version,\n workspaces,\n }: {\n access?: readonly BrettAccess[]\n interfaces: readonly BrettInterface[]\n mfManifest: Record<string, unknown>\n tarball?: Readable\n version: string\n workspaces?: readonly BrettWorkspace[]\n },\n): void {\n formData.append('version', version)\n appendJson(formData, 'interfaces', interfaces)\n // Studio-only — the server rejects a workspaces part on non-studio types.\n if (workspaces?.length) appendJson(formData, 'workspaces', workspaces)\n // Per-deployment; forbidden for singletons, so callers omit it there.\n if (access?.length) appendJson(formData, 'access', access)\n appendJson(formData, 'mfManifest', mfManifest)\n // Last: the server requires every field part to precede the tarball.\n if (tarball) {\n formData.append('tarball', tarball, {contentType: 'application/gzip', filename: 'app.tar.gz'})\n }\n}\n\n/** Structured parts must arrive as JSON so the server parses them. */\nfunction appendJson(formData: FormData, name: string, value: unknown): void {\n formData.append(name, JSON.stringify(value), {contentType: 'application/json'})\n}\n\nasync function request<T>(url: string, formData: FormData): Promise<T> {\n const client = await getClient()\n return client.request({\n body: formData.pipe(new PassThrough()),\n headers: formData.getHeaders(),\n method: 'POST',\n url,\n })\n}\n"],"names":["PassThrough","getGlobalCliClient","isStaging","FormData","APP_WORKBENCH_API_VERSION","getWorkbenchUrl","organizationId","hostSlug","host","toLowerCase","getApplicationUrl","application","segment","type","slug","id","getClient","apiVersion","requireUser","getApplication","applicationId","client","request","url","err","statusCode","getOrganizationApplication","idOrSlug","signal","ignoreWarnings","query","include","listApplications","data","limit","createApplication","options","externalUrl","isSingleton","name","projectId","title","visibility","body","undefined","config","studio","method","updateApplication","update","setApplicationIcon","icon","image","headers","contentType","removeApplicationIcon","setInterfaceIcon","interfaceId","createDeployment","access","interfaces","isAutoUpdating","mfManifest","tarball","version","workspaces","formData","append","toString","appendDeploymentParts","deleteApplication","appendJson","length","filename","value","JSON","stringify","pipe","getHeaders"],"mappings":"AAAA,SAAQA,WAAW,QAAsB,cAAa;AAEtD,SAA4BC,kBAAkB,Q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D,aAAqB;IAC3D,MAAMC,SAAS,MAAML;IACrB,IAAI;QACF,MAAMK,OAAOC,OAAO,CAAC;YAACyB,QAAQ;YAAUxB,KAAK,CAAC,cAAc,EAAEH,eAAe;QAAA;IAC/E,EAAE,OAAOI,KAAK;QACZ,IAAI,AAACA,KAA+BC,eAAe,KAAK,MAAMD;IAChE;AACF;AAEA,SAAS6C,sBACPH,QAAkB,EAClB,EACEP,MAAM,EACNC,UAAU,EACVE,UAAU,EACVC,OAAO,EACPC,OAAO,EACPC,UAAU,EAQX;IAEDC,SAASC,MAAM,CAAC,WAAWH;IAC3BO,WAAWL,UAAU,cAAcN;IACnC,0EAA0E;IAC1E,IAAIK,YAAYO,QAAQD,WAAWL,UAAU,cAAcD;IAC3D,sEAAsE;IACtE,IAAIN,QAAQa,QAAQD,WAAWL,UAAU,UAAUP;IACnDY,WAAWL,UAAU,cAAcJ;IACnC,qEAAqE;IACrE,IAAIC,SAAS;QACXG,SAASC,MAAM,CAAC,WAAWJ,SAAS;YAACT,aAAa;YAAoBmB,UAAU;QAAY;IAC9F;AACF;AAEA,oEAAoE,GACpE,SAASF,WAAWL,QAAkB,EAAE3B,IAAY,EAAEmC,KAAc;IAClER,SAASC,MAAM,CAAC5B,MAAMoC,KAAKC,SAAS,CAACF,QAAQ;QAACpB,aAAa;IAAkB;AAC/E;AAEA,eAAehC,QAAWC,GAAW,EAAE2C,QAAkB;IACvD,MAAM7C,SAAS,MAAML;IACrB,OAAOK,OAAOC,OAAO,CAAC;QACpBqB,MAAMuB,SAASW,IAAI,CAAC,IAAI7E;QACxBqD,SAASa,SAASY,UAAU;QAC5B/B,QAAQ;QACRxB;IACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/workbench-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"description": "Internal implementation detail of the Sanity CLI's unstable workbench support. Not intended for direct use.",
|
|
5
5
|
"homepage": "https://github.com/sanity-io/cli",
|
|
6
6
|
"bugs": "https://github.com/sanity-io/cli/issues",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@module-federation/runtime": "2.9.4",
|
|
69
69
|
"@module-federation/vite": "1.25.1",
|
|
70
|
-
"@sanity/cli-core": "^3.
|
|
70
|
+
"@sanity/cli-core": "^3.19.0",
|
|
71
71
|
"@sanity/sdk": "^3.18.0",
|
|
72
72
|
"@sanity/types": "^6.26.0",
|
|
73
73
|
"@vitejs/plugin-react": "^6.3.1",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@repo/oxc-config": "0.0.0",
|
|
84
84
|
"@repo/package.config": "0.0.1",
|
|
85
85
|
"@repo/tsconfig": "3.70.0",
|
|
86
|
-
"@sanity/cli-test": "
|
|
86
|
+
"@sanity/cli-test": "29.0.0",
|
|
87
87
|
"@sanity/pkg-utils": "^12.3.4",
|
|
88
88
|
"@swc/cli": "^0.8.2",
|
|
89
89
|
"@swc/core": "^1.16.22",
|