@sanity/cli-core 2.8.1 → 3.1.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/README.md +7 -6
- package/dist/NonInteractiveError-CSLT5y93.d.ts +13 -0
- package/dist/ProjectRootNotFoundError-RgthN9uy.d.ts +47 -0
- package/dist/SanityCommand.d.ts +26 -355
- package/dist/SanityCommand.js +5 -0
- package/dist/SanityCommand.js.map +1 -1
- package/dist/_exports/browser.d.ts +2 -21
- package/dist/_exports/config.d.ts +5 -661
- package/dist/_exports/debug.d.ts +4 -8
- package/dist/_exports/debug.js +3 -3
- package/dist/_exports/debug.js.map +1 -1
- package/dist/_exports/errors.d.ts +12 -77
- package/dist/_exports/index.d.ts +34 -1674
- package/dist/_exports/package-manager.d.ts +14 -207
- package/dist/_exports/request.d.ts +52 -69
- package/dist/_exports/request.js +5 -4
- package/dist/_exports/request.js.map +1 -1
- package/dist/_exports/schemas.d.ts +2 -235
- package/dist/_exports/tasks.d.ts +2 -120
- package/dist/_exports/telemetry.d.ts +2 -156
- package/dist/_exports/types.d.ts +9 -475
- package/dist/_exports/undeploy.d.ts +45 -62
- package/dist/_exports/undeploy.js +1 -3
- package/dist/_exports/undeploy.js.map +1 -1
- package/dist/_exports/util.d.ts +6 -137
- package/dist/_exports/ux.d.ts +31 -102
- package/dist/apiClient-DXlF5ZV3.d.ts +65 -0
- package/dist/apiClient.d.ts +2 -79
- package/dist/apiClient.js +69 -47
- package/dist/apiClient.js.map +1 -1
- package/dist/cliConfig-CbW8neMv.d.ts +171 -0
- package/dist/errors/enrichAuthError.js +48 -0
- package/dist/errors/enrichAuthError.js.map +1 -0
- package/dist/errors/getErrorMessage.js +3 -1
- package/dist/errors/getErrorMessage.js.map +1 -1
- package/dist/executionContext.d.ts +21 -20
- package/dist/executionContext.js.map +1 -1
- package/dist/exitCodes.d.ts +3 -3
- package/dist/findStudioConfigPath-DcKlHhyW.d.ts +265 -0
- package/dist/getWorkspace-CU32E6Uo.d.ts +54 -0
- package/dist/mockBrowserEnvironment-BjFQPb2W.d.ts +19 -0
- package/dist/noopTelemetry-BJRIvASI.d.ts +64 -0
- package/dist/readPackageJson-Cr_lbjVR.d.ts +67 -0
- package/dist/recursivelyResolveProjectRoot-BE54uEP6.d.ts +18 -0
- package/dist/request/createRequester.js +39 -50
- package/dist/request/createRequester.js.map +1 -1
- package/dist/request/nodeReadableFromWeb.js +64 -0
- package/dist/request/nodeReadableFromWeb.js.map +1 -0
- package/dist/resolveLocalPackage-Dr-TNTyk.d.ts +78 -0
- package/dist/safeStructuredClone-CWB0MXmH.d.ts +58 -0
- package/dist/schemas-DRCVXpyW.d.ts +140 -0
- package/dist/timer-Dwu2TIgB.d.ts +14 -0
- package/dist/tsxWorkerTask-CxG3fWbU.d.ts +97 -0
- package/dist/types-CwJLTYDj.d.ts +23 -0
- package/dist/types-ZNH3prAd.d.ts +91 -0
- package/dist/ux/spinner.js +70 -9
- package/dist/ux/spinner.js.map +1 -1
- package/dist/workbenchApp-Dhtbsuhn.d.ts +22 -0
- package/package.json +7 -8
- package/dist/request/createIsolatedRequester.js +0 -75
- package/dist/request/createIsolatedRequester.js.map +0 -1
package/dist/_exports/types.d.ts
CHANGED
|
@@ -1,475 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
declare const APP_VISIBILITIES: readonly ["default", "unlisted", "disabled"];
|
|
13
|
-
|
|
14
|
-
declare const APPLICATION_TYPES: readonly [
|
|
15
|
-
"coreApp",
|
|
16
|
-
"studio",
|
|
17
|
-
"canvas",
|
|
18
|
-
"dashboard",
|
|
19
|
-
"media-library",
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
/** The resolved kind of a workbench app — `studio` or one of the SDK app types. */
|
|
23
|
-
export declare type ApplicationType = (typeof APPLICATION_TYPES)[number];
|
|
24
|
-
|
|
25
|
-
/** @public */
|
|
26
|
-
declare type AppVisibility = (typeof APP_VISIBILITIES)[number];
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
31
|
-
export declare interface CliConfig {
|
|
32
|
-
/** The project ID and dataset the Sanity CLI should use to run its commands */
|
|
33
|
-
api?: {
|
|
34
|
-
dataset?: string;
|
|
35
|
-
projectId?: string;
|
|
36
|
-
};
|
|
37
|
-
/** Configuration for custom Sanity apps built with the App SDK */
|
|
38
|
-
app?: {
|
|
39
|
-
/** The entrypoint for your custom app. By default, `src/App.tsx` */
|
|
40
|
-
entry?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Path to an icon file relative to project root.
|
|
43
|
-
* The file must be an SVG.
|
|
44
|
-
*/
|
|
45
|
-
icon?: string;
|
|
46
|
-
/** @deprecated Use deployment.appId */
|
|
47
|
-
id?: string;
|
|
48
|
-
/** The ID for the Sanity organization that manages this application */
|
|
49
|
-
organizationId?: string;
|
|
50
|
-
/** The title of the custom app, as it is seen in Dashboard UI */
|
|
51
|
-
title?: string;
|
|
52
|
-
/** Dashboard visibility of the application. Defaults to `default`. */
|
|
53
|
-
visibility?: AppVisibility;
|
|
54
|
-
};
|
|
55
|
-
/** @deprecated Use deployment.autoUpdates */
|
|
56
|
-
autoUpdates?: boolean;
|
|
57
|
-
/** Options for custom app and Studio deployments */
|
|
58
|
-
deployment?: {
|
|
59
|
-
/**
|
|
60
|
-
* The ID for your custom app or Studio. Generated when deploying your app or Studio for the first time.
|
|
61
|
-
* Get your app ID by either:
|
|
62
|
-
* 1. Checking the output of `sanity deploy`, or
|
|
63
|
-
* 2. Checking your project’s Studio tab at https://sanity.io/manage
|
|
64
|
-
*
|
|
65
|
-
* @remarks This is required for all custom app deployments, and for Studios opting in to fine grained version control.
|
|
66
|
-
* {@link https://www.sanity.io/docs/studio/latest-version-of-sanity#k0896ed4574b7}
|
|
67
|
-
*/
|
|
68
|
-
appId?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Enable automatic updates for your Studio or custom app’s Sanity dependencies.
|
|
71
|
-
* {@link https://www.sanity.io/docs/studio/latest-version-of-sanity}
|
|
72
|
-
*/
|
|
73
|
-
autoUpdates?: boolean;
|
|
74
|
-
};
|
|
75
|
-
/** Define the GraphQL APIs that the CLI can deploy and interact with */
|
|
76
|
-
graphql?: Array<{
|
|
77
|
-
filterSuffix?: string;
|
|
78
|
-
generation?: "gen1" | "gen2" | "gen3";
|
|
79
|
-
id?: string;
|
|
80
|
-
nonNullDocumentFields?: boolean;
|
|
81
|
-
playground?: boolean;
|
|
82
|
-
source?: string;
|
|
83
|
-
tag?: string;
|
|
84
|
-
workspace?: string;
|
|
85
|
-
}>;
|
|
86
|
-
/** Configuration for the Media Library */
|
|
87
|
-
mediaLibrary?: {
|
|
88
|
-
/** The path to the Media Library aspects directory. When using the CLI to manage aspects, this is the directory they will be read from and written to. */
|
|
89
|
-
aspectsPath?: string;
|
|
90
|
-
};
|
|
91
|
-
/** Contains the property `basePath` which lets you change the top-level slug for the Studio. You typically need to set this if you embed the Studio in another application where it is one of many routes. Defaults to an empty string. */
|
|
92
|
-
project?: {
|
|
93
|
-
basePath?: string;
|
|
94
|
-
};
|
|
95
|
-
/** Configuration options for React Compiler */
|
|
96
|
-
reactCompiler?: boolean | PluginOptions;
|
|
97
|
-
/** Wraps the Studio in \<React.StrictMode\> root to aid in flagging potential problems related to concurrent features (startTransition, useTransition, useDeferredValue, Suspense). Can also be enabled by setting SANITY_STUDIO_REACT_STRICT_MODE="true"|"false". It only applies to sanity dev in development mode and is ignored in sanity build and in production. Defaults to true. */
|
|
98
|
-
reactStrictMode?: boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Configuration for schema extraction (`sanity schema extract`)
|
|
101
|
-
*/
|
|
102
|
-
schemaExtraction?: {
|
|
103
|
-
/**
|
|
104
|
-
* Enable schema extraction as part of sanity dev and sanity build
|
|
105
|
-
*/
|
|
106
|
-
enabled?: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* When true, schema fields marked as required will be non-optional in the output.
|
|
109
|
-
* Defaults to `false`
|
|
110
|
-
*/
|
|
111
|
-
enforceRequiredFields?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Output path for the extracted schema file.
|
|
114
|
-
* Defaults to `schema.json` in the working directory.
|
|
115
|
-
*/
|
|
116
|
-
path?: string;
|
|
117
|
-
/**
|
|
118
|
-
* Additional glob patterns to watch for schema changes in watch mode.
|
|
119
|
-
* These extend the default patterns:
|
|
120
|
-
* - `sanity.config.{js,jsx,ts,tsx,mjs}`
|
|
121
|
-
* - `schema*\/**\/*.{js,jsx,ts,tsx,mjs}`
|
|
122
|
-
*/
|
|
123
|
-
watchPatterns?: string[];
|
|
124
|
-
/**
|
|
125
|
-
* The name of the workspace to generate a schema for. Required if your Sanity project has more than one
|
|
126
|
-
* workspace.
|
|
127
|
-
*/
|
|
128
|
-
workspace?: string;
|
|
129
|
-
};
|
|
130
|
-
/** Defines the hostname and port that the development server should run on. hostname defaults to localhost, and port to 3333. */
|
|
131
|
-
server?: {
|
|
132
|
-
hostname?: string;
|
|
133
|
-
port?: number;
|
|
134
|
-
};
|
|
135
|
-
/** @deprecated Use deployment.appId */
|
|
136
|
-
studioHost?: string;
|
|
137
|
-
/**
|
|
138
|
-
* Configuration for Sanity typegen
|
|
139
|
-
*/
|
|
140
|
-
typegen?: Partial<TypeGenConfig> & {
|
|
141
|
-
/**
|
|
142
|
-
* Enable typegen as part of sanity dev and sanity build.
|
|
143
|
-
* When enabled, types are generated on startup and when files change.
|
|
144
|
-
* Defaults to `false`
|
|
145
|
-
*/
|
|
146
|
-
enabled?: boolean;
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* Enable Vite's experimental bundled dev mode for `sanity dev`. This serves bundled
|
|
150
|
-
* files during development, which can speed up startup and reloads for large projects.
|
|
151
|
-
* Defaults to `false`.
|
|
152
|
-
*
|
|
153
|
-
* Unstable: may change or be removed without notice while the underlying Vite
|
|
154
|
-
* feature (`experimental.bundledDev`) is experimental.
|
|
155
|
-
* {@link https://vite.dev/guide/rolldown#full-bundle-mode}
|
|
156
|
-
*/
|
|
157
|
-
unstable_bundledDev?: boolean;
|
|
158
|
-
/** Exposes the default Vite configuration for custom apps and the Studio so it can be changed and extended. */
|
|
159
|
-
vite?: UserViteConfig;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* @public
|
|
164
|
-
*/
|
|
165
|
-
export declare type CLITelemetryStore =
|
|
166
|
-
TelemetryLogger<TelemetryUserProperties>;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* A raw key-value store for CLI user configuration.
|
|
170
|
-
* Unlike the typed `getCliUserConfig`/`setCliUserConfig`, this operates on
|
|
171
|
-
* arbitrary keys without schema validation.
|
|
172
|
-
*
|
|
173
|
-
* @public
|
|
174
|
-
*/
|
|
175
|
-
export declare interface ConfigStore {
|
|
176
|
-
/** Remove a key from the config file. */
|
|
177
|
-
delete: (key: string) => void;
|
|
178
|
-
/** Read a value by key. Returns `undefined` if the key does not exist. */
|
|
179
|
-
get: (key: string) => unknown;
|
|
180
|
-
/** Write a value by key, merging it into the existing config. */
|
|
181
|
-
set: (key: string, value: unknown) => void;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export declare type ConsentInformation =
|
|
185
|
-
| {
|
|
186
|
-
reason: "fetchError" | "unauthenticated";
|
|
187
|
-
status: Extract<ConsentStatus, "undetermined">;
|
|
188
|
-
}
|
|
189
|
-
| {
|
|
190
|
-
reason?: "localOverride";
|
|
191
|
-
status: Extract<ConsentStatus, "denied">;
|
|
192
|
-
}
|
|
193
|
-
| {
|
|
194
|
-
reason?: never;
|
|
195
|
-
status: Extract<ConsentStatus, "granted">;
|
|
196
|
-
}
|
|
197
|
-
| {
|
|
198
|
-
reason?: never;
|
|
199
|
-
status: Extract<ConsentStatus, "unset">;
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* 'unknown' - we don't know if the user has consented or not (e.g. something went wrong)
|
|
204
|
-
* 'unset' - the user has not yet been asked for consent
|
|
205
|
-
* 'granted' - the user has consented
|
|
206
|
-
* 'denied' - the user has denied consent
|
|
207
|
-
*/
|
|
208
|
-
declare type ConsentStatus = "undetermined" | "unset" | "granted" | "denied";
|
|
209
|
-
|
|
210
|
-
export declare type CoreAppManifest = z.infer<typeof coreAppManifestSchema>;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Core-app application manifest. Mirrors the workbench's
|
|
214
|
-
* `CoreAppUserApplicationManifest` schema. Strictly validated via zod since the
|
|
215
|
-
* CLI produces the payload in full.
|
|
216
|
-
*/
|
|
217
|
-
declare const coreAppManifestSchema: z.ZodMiniObject<
|
|
218
|
-
{
|
|
219
|
-
group: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
220
|
-
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
221
|
-
priority: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
222
|
-
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
223
|
-
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
224
|
-
version: z.ZodMiniString<string>;
|
|
225
|
-
},
|
|
226
|
-
z.core.$strip
|
|
227
|
-
>;
|
|
228
|
-
|
|
229
|
-
declare interface DeferredEvent<
|
|
230
|
-
Data = unknown,
|
|
231
|
-
Event extends DefinedTelemetryLog<Data> = DefinedTelemetryLog<Data>,
|
|
232
|
-
> {
|
|
233
|
-
createdAt: string;
|
|
234
|
-
event: Event;
|
|
235
|
-
data: Data;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
declare interface DefinedTelemetryLog<Schema> {
|
|
239
|
-
type: "log";
|
|
240
|
-
/** Unique name of the event */
|
|
241
|
-
name: string;
|
|
242
|
-
/** Event version. Increment this by 1 whenever the shape of the data changes in a non-backwards compatible way */
|
|
243
|
-
version: number;
|
|
244
|
-
/** Description of log event */
|
|
245
|
-
description?: string;
|
|
246
|
-
/**
|
|
247
|
-
* Max sample rate of this event.
|
|
248
|
-
* Calling telemetry.log(EventDefinition, data) repeatedly will submit at most one event every specified time interval (in milliseconds)
|
|
249
|
-
* */
|
|
250
|
-
maxSampleRate?: number;
|
|
251
|
-
/** Data schema. Will not be accessible at runtime */
|
|
252
|
-
schema: Schema;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
declare interface DefinedTelemetryTrace<Data = void, Context = void> {
|
|
256
|
-
type: "trace";
|
|
257
|
-
/** Unique name of the trace */
|
|
258
|
-
name: string;
|
|
259
|
-
/** Trace version. Increment this by 1 whenever the shape of the data changes in a non-backwards compatible way */
|
|
260
|
-
version: number;
|
|
261
|
-
/** Description of trace */
|
|
262
|
-
description?: string;
|
|
263
|
-
/** Data schema. Will not be accessible at runtime */
|
|
264
|
-
schema: Data;
|
|
265
|
-
/** Contextual data schema. Will not be accessible at runtime */
|
|
266
|
-
context: Context;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
export declare interface Output {
|
|
270
|
-
error: Command["error"];
|
|
271
|
-
log: Command["log"];
|
|
272
|
-
warn: Command["warn"];
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Comprehensive representation of a package.json file.
|
|
277
|
-
* Consolidates all properties from previous type definitions.
|
|
278
|
-
*
|
|
279
|
-
* @public
|
|
280
|
-
*/
|
|
281
|
-
export declare type PackageJson = z.infer<typeof packageJsonSchema>;
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Comprehensive package.json schema including all common properties.
|
|
285
|
-
* Feel free to add properties to this,
|
|
286
|
-
* 🟠ℹ️ BUT ENSURE OPTIONAL STUFF IS ACTUALLY OPTIONAL ℹ️🟠
|
|
287
|
-
* 🟠ℹ️ SINCE THIS IS USED IN A NUMBER OF LOCATIONS WHERE ℹ️🟠
|
|
288
|
-
* 🟠ℹ️ WE CANNOT ENFORCE/GUARANTEE ANY PARTICULAR PROPS ℹ️🟠
|
|
289
|
-
*/
|
|
290
|
-
declare const packageJsonSchema: z.ZodMiniObject<
|
|
291
|
-
{
|
|
292
|
-
name: z.ZodMiniString<string>;
|
|
293
|
-
version: z.ZodMiniString<string>;
|
|
294
|
-
dependencies: z.ZodMiniOptional<
|
|
295
|
-
z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>
|
|
296
|
-
>;
|
|
297
|
-
devDependencies: z.ZodMiniOptional<
|
|
298
|
-
z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>
|
|
299
|
-
>;
|
|
300
|
-
peerDependencies: z.ZodMiniOptional<
|
|
301
|
-
z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>
|
|
302
|
-
>;
|
|
303
|
-
exports: z.ZodMiniOptional<
|
|
304
|
-
z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>
|
|
305
|
-
>;
|
|
306
|
-
main: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
307
|
-
types: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
308
|
-
author: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
309
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
310
|
-
engines: z.ZodMiniOptional<
|
|
311
|
-
z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>
|
|
312
|
-
>;
|
|
313
|
-
license: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
314
|
-
private: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
315
|
-
repository: z.ZodMiniOptional<
|
|
316
|
-
z.ZodMiniObject<
|
|
317
|
-
{
|
|
318
|
-
type: z.ZodMiniString<string>;
|
|
319
|
-
url: z.ZodMiniString<string>;
|
|
320
|
-
},
|
|
321
|
-
z.core.$strip
|
|
322
|
-
>
|
|
323
|
-
>;
|
|
324
|
-
scripts: z.ZodMiniOptional<
|
|
325
|
-
z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>
|
|
326
|
-
>;
|
|
327
|
-
type: z.ZodMiniOptional<
|
|
328
|
-
z.ZodMiniEnum<{
|
|
329
|
-
module: "module";
|
|
330
|
-
commonjs: "commonjs";
|
|
331
|
-
}>
|
|
332
|
-
>;
|
|
333
|
-
},
|
|
334
|
-
z.core.$loose
|
|
335
|
-
>;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Result of finding a project configuration
|
|
339
|
-
*
|
|
340
|
-
* @public
|
|
341
|
-
*/
|
|
342
|
-
export declare interface ProjectRootResult {
|
|
343
|
-
directory: string;
|
|
344
|
-
/**
|
|
345
|
-
* Path to the project configuration file, if found.
|
|
346
|
-
*/
|
|
347
|
-
path: string;
|
|
348
|
-
/**
|
|
349
|
-
* Type of project root.
|
|
350
|
-
*/
|
|
351
|
-
type: "app" | "studio";
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Options for reading package.json files
|
|
356
|
-
*
|
|
357
|
-
* @public
|
|
358
|
-
*/
|
|
359
|
-
export declare interface ReadPackageJsonOptions {
|
|
360
|
-
/**
|
|
361
|
-
* Default values to merge with the parsed package.json.
|
|
362
|
-
* Parsed values take precedence over defaults.
|
|
363
|
-
*/
|
|
364
|
-
defaults?: Partial<PackageJson>;
|
|
365
|
-
/**
|
|
366
|
-
* Skip Zod schema validation. When true, the file is parsed but not validated.
|
|
367
|
-
* Defaults to false.
|
|
368
|
-
*/
|
|
369
|
-
skipSchemaValidation?: boolean;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
export declare type RequireProps<T, K extends keyof T> = Omit<T, K> &
|
|
373
|
-
Required<Pick<T, K>>;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Interface for `SanityCommand`, a wrapper around OCLIF's Command class.
|
|
377
|
-
* Important to keep updated as `SanityCommand` evolves so that its mock implementation (enabling fast unit tests) stays up to date as well.
|
|
378
|
-
* @see https://oclif.io/docs/base_class/
|
|
379
|
-
*/
|
|
380
|
-
export declare interface SanityCommandInterface {
|
|
381
|
-
getCliConfig: () => Promise<CliConfig>;
|
|
382
|
-
getProjectId: (options?: {
|
|
383
|
-
deprecatedFlagName?: string;
|
|
384
|
-
fallback?: () => Promise<string>;
|
|
385
|
-
}) => Promise<string>;
|
|
386
|
-
getProjectRoot: () => Promise<ProjectRootResult>;
|
|
387
|
-
isUnattended: () => boolean;
|
|
388
|
-
output: Output;
|
|
389
|
-
resolveIsInteractive: () => boolean;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
export declare type SanityOrgUser = {
|
|
393
|
-
/**
|
|
394
|
-
* Null when authenticating with an API token rather than a user account —
|
|
395
|
-
* robot tokens resolve to a user whose `email` and `familyName` are null.
|
|
396
|
-
* Use `getUserDisplayName()` for anything user-facing.
|
|
397
|
-
*/
|
|
398
|
-
email: string | null;
|
|
399
|
-
id: string;
|
|
400
|
-
name: string;
|
|
401
|
-
profileImage?: string;
|
|
402
|
-
/** `sanity-token` is returned when authenticating with an API token. */
|
|
403
|
-
provider: "github" | "google" | "sanity" | "sanity-token" | `saml-${string}`;
|
|
404
|
-
tosAcceptedAt?: string;
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
export declare type StudioManifest = z.infer<typeof studioManifestSchema>;
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Studio application manifest (serialized `create-manifest.json`). Kept loose so
|
|
411
|
-
* the CLI isn't coupled to the workbench's evolving client-side schema — the
|
|
412
|
-
* workbench consumer is authoritative on the inner shape. See its
|
|
413
|
-
* `ClientManifest` for the fields clients expect.
|
|
414
|
-
*/
|
|
415
|
-
declare const studioManifestSchema: z.ZodMiniRecord<
|
|
416
|
-
z.ZodMiniString<string>,
|
|
417
|
-
z.ZodMiniUnknown
|
|
418
|
-
>;
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* Note that `sessionId` is removed from the signature of these functions
|
|
422
|
-
*/
|
|
423
|
-
declare interface TelemetryLogger<UserProperties> {
|
|
424
|
-
updateUserProperties(properties: UserProperties): void;
|
|
425
|
-
resume(events: DeferredEvent[]): void;
|
|
426
|
-
log<Data>(event: DefinedTelemetryLog<Data>, data: Data): void;
|
|
427
|
-
log<Data extends void>(event: DefinedTelemetryLog<Data>): void;
|
|
428
|
-
trace<Data>(
|
|
429
|
-
event: DefinedTelemetryTrace<Data>,
|
|
430
|
-
context?: unknown,
|
|
431
|
-
): TelemetryTrace<UserProperties, Data>;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
declare interface TelemetryTrace<UserProperties, Data> {
|
|
435
|
-
start(): void;
|
|
436
|
-
log(data: Data): void;
|
|
437
|
-
error(error: Error): void;
|
|
438
|
-
complete(): void;
|
|
439
|
-
newContext(name: string): TelemetryLogger<UserProperties>;
|
|
440
|
-
await<P extends Promise<Data>>(promise: P): P;
|
|
441
|
-
await<P extends Promise<unknown>>(promise: P, finalData: Data): P;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* @public
|
|
446
|
-
*/
|
|
447
|
-
export declare interface TelemetryUserProperties {
|
|
448
|
-
cliVersion: string;
|
|
449
|
-
cpuArchitecture: string;
|
|
450
|
-
machinePlatform: string;
|
|
451
|
-
runtime: string;
|
|
452
|
-
runtimeVersion: string;
|
|
453
|
-
dataset?: string;
|
|
454
|
-
projectId?: string;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
export declare interface TypeGenConfig {
|
|
458
|
-
formatGeneratedCode: boolean;
|
|
459
|
-
generates: string;
|
|
460
|
-
overloadClientMethods: boolean;
|
|
461
|
-
path: string | string[];
|
|
462
|
-
schema: string;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* @public
|
|
467
|
-
*/
|
|
468
|
-
export declare type UserViteConfig =
|
|
469
|
-
| ((
|
|
470
|
-
config: InlineConfig,
|
|
471
|
-
env: ConfigEnv,
|
|
472
|
-
) => InlineConfig | Promise<InlineConfig>)
|
|
473
|
-
| InlineConfig;
|
|
474
|
-
|
|
475
|
-
export {};
|
|
1
|
+
import { a as TypeGenConfig, i as ConfigStore, o as UserViteConfig, r as CliConfig } from "../cliConfig-CbW8neMv.js";
|
|
2
|
+
import { t as ProjectRootResult } from "../recursivelyResolveProjectRoot-BE54uEP6.js";
|
|
3
|
+
import { n as ConsentInformation, r as TelemetryUserProperties, t as CLITelemetryStore } from "../types-ZNH3prAd.js";
|
|
4
|
+
import { n as RequireProps, r as SanityOrgUser, t as Output } from "../types-CwJLTYDj.js";
|
|
5
|
+
import { SanityCommandInterface } from "../SanityCommand.js";
|
|
6
|
+
import { t as ApplicationType } from "../workbenchApp-Dhtbsuhn.js";
|
|
7
|
+
import { n as ReadPackageJsonOptions, t as PackageJson } from "../readPackageJson-Cr_lbjVR.js";
|
|
8
|
+
import { n as StudioManifest, t as CoreAppManifest } from "../schemas-DRCVXpyW.js";
|
|
9
|
+
export type { ApplicationType, CLITelemetryStore, CliConfig, ConfigStore, ConsentInformation, CoreAppManifest, Output, PackageJson, ProjectRootResult, ReadPackageJsonOptions, RequireProps, SanityCommandInterface, SanityOrgUser, StudioManifest, TelemetryUserProperties, TypeGenConfig, UserViteConfig };
|
|
@@ -1,74 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* What an undeploy deletes, resolved once and read by every report — the
|
|
3
|
+
* dry-run plan, the `--json` payloads, and the real run's confirmation prompt —
|
|
4
|
+
* so the human and machine outputs can't drift.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
TTarget extends UndeployTarget = UndeployTarget,
|
|
8
|
-
> {
|
|
9
|
-
/** Resolves what an undeploy would delete; read-only. */
|
|
10
|
-
resolveTarget(): Promise<UndeployTargetResolution<TTarget>>;
|
|
11
|
-
type: "coreApp" | "studio";
|
|
12
|
-
/** Deletes the target — the only mutating step, never run on a dry run. */
|
|
13
|
-
undeploy(target: TTarget): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
|
|
6
|
+
type UndeployTarget = UndeployApplicationTarget | UndeployConfigTarget;
|
|
16
7
|
/** An undeploy that deletes the application, along with all its deployments. */
|
|
17
|
-
|
|
18
|
-
deletes:
|
|
8
|
+
interface UndeployApplicationTarget extends UndeployTargetDetails {
|
|
9
|
+
deletes: 'application';
|
|
19
10
|
id: string;
|
|
20
11
|
}
|
|
21
|
-
|
|
22
12
|
/** An undeploy that deletes an installation's deployed config; the installation stays installed. */
|
|
23
|
-
|
|
24
|
-
deletes:
|
|
13
|
+
interface UndeployConfigTarget extends UndeployTargetDetails {
|
|
14
|
+
deletes: 'config';
|
|
25
15
|
id: null;
|
|
26
16
|
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* What an undeploy deletes, resolved once and read by every report — the
|
|
30
|
-
* dry-run plan, the `--json` payloads, and the real run's confirmation prompt —
|
|
31
|
-
* so the human and machine outputs can't drift. Adapters may extend the
|
|
32
|
-
* variants with backend-specific fields; they serialize into `--json` as-is,
|
|
33
|
-
* except the report-only `summary`.
|
|
34
|
-
*/
|
|
35
|
-
export declare type UndeployTarget =
|
|
36
|
-
UndeployApplicationTarget | UndeployConfigTarget;
|
|
37
|
-
|
|
38
|
-
declare interface UndeployTargetDetails {
|
|
39
|
-
/** Details of the deployment currently being served; `null` when none is live. */
|
|
40
|
-
activeDeployment: {
|
|
41
|
-
deployedAt: string;
|
|
42
|
-
deployedBy: string;
|
|
43
|
-
} | null;
|
|
44
|
-
/** Hostname the application is served from; freed for anyone to claim after undeploy. */
|
|
45
|
-
appHost: string | null;
|
|
46
|
-
createdAt: string | null;
|
|
47
|
-
organizationId: string | null;
|
|
48
|
-
projectId: string | null;
|
|
17
|
+
interface UndeployTargetDetails {
|
|
49
18
|
title: string | null;
|
|
50
|
-
type:
|
|
51
|
-
/** Where the deployed studio/app is currently reachable. */
|
|
19
|
+
type: 'coreApp' | 'studio';
|
|
52
20
|
url: string | null;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* the adapter puts on its target, so the report can't drift from the payload.
|
|
57
|
-
*/
|
|
21
|
+
application?: object;
|
|
22
|
+
payload?: UndeployPayload;
|
|
23
|
+
/** Human-report lines only; never serialized. */
|
|
58
24
|
summary?: string[];
|
|
59
25
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
26
|
+
/** Collected locally, so a dry run reports it too. */
|
|
27
|
+
interface UndeployPayload {
|
|
28
|
+
/** The configured `deployment.appId`; `null` when none is set. */
|
|
29
|
+
appId: string | null;
|
|
30
|
+
type: 'coreApp' | 'studio';
|
|
31
|
+
/** Media-library config summary. */
|
|
32
|
+
config?: string;
|
|
33
|
+
services?: object[];
|
|
34
|
+
views?: object[];
|
|
35
|
+
}
|
|
36
|
+
type UndeployTargetResolution<TTarget extends UndeployTarget = UndeployTarget> = {
|
|
37
|
+
message: string;
|
|
38
|
+
solution?: string;
|
|
39
|
+
type: 'none';
|
|
40
|
+
} | {
|
|
41
|
+
target: TTarget;
|
|
42
|
+
type: 'found';
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The parts of an undeploy that differ per application backend. The shared
|
|
46
|
+
* sequence — mode selection, target reporting, confirmation, error handling —
|
|
47
|
+
* lives in the host CLI's runner; adapters only resolve and delete.
|
|
48
|
+
*/
|
|
49
|
+
interface UndeployAdapter<TTarget extends UndeployTarget = UndeployTarget> {
|
|
50
|
+
/** Resolves what an undeploy would delete; read-only. */
|
|
51
|
+
resolveTarget(): Promise<UndeployTargetResolution<TTarget>>;
|
|
52
|
+
type: 'coreApp' | 'studio';
|
|
53
|
+
/** Deletes the target — the only mutating step, never run on a dry run. */
|
|
54
|
+
undeploy(target: TTarget): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
export { UndeployAdapter, UndeployApplicationTarget, UndeployConfigTarget, UndeployPayload, UndeployTarget, UndeployTargetResolution };
|
|
57
|
+
//# sourceMappingURL=undeploy.d.ts.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What an undeploy deletes, resolved once and read by every report — the
|
|
3
3
|
* dry-run plan, the `--json` payloads, and the real run's confirmation prompt —
|
|
4
|
-
* so the human and machine outputs can't drift.
|
|
5
|
-
* variants with backend-specific fields; they serialize into `--json` as-is,
|
|
6
|
-
* except the report-only `summary`.
|
|
4
|
+
* so the human and machine outputs can't drift.
|
|
7
5
|
*/ /**
|
|
8
6
|
* The parts of an undeploy that differ per application backend. The shared
|
|
9
7
|
* sequence — mode selection, target reporting, confirmation, error handling —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/undeploy.ts"],"sourcesContent":["/**\n * What an undeploy deletes, resolved once and read by every report — the\n * dry-run plan, the `--json` payloads, and the real run's confirmation prompt —\n * so the human and machine outputs can't drift
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/undeploy.ts"],"sourcesContent":["/**\n * What an undeploy deletes, resolved once and read by every report — the\n * dry-run plan, the `--json` payloads, and the real run's confirmation prompt —\n * so the human and machine outputs can't drift.\n */\nexport type UndeployTarget = UndeployApplicationTarget | UndeployConfigTarget\n\n/** An undeploy that deletes the application, along with all its deployments. */\nexport interface UndeployApplicationTarget extends UndeployTargetDetails {\n deletes: 'application'\n id: string\n}\n\n/** An undeploy that deletes an installation's deployed config; the installation stays installed. */\nexport interface UndeployConfigTarget extends UndeployTargetDetails {\n deletes: 'config'\n id: null\n}\n\ninterface UndeployTargetDetails {\n title: string | null\n type: 'coreApp' | 'studio'\n url: string | null\n\n application?: object\n payload?: UndeployPayload\n /** Human-report lines only; never serialized. */\n summary?: string[]\n}\n\n/** Collected locally, so a dry run reports it too. */\nexport interface UndeployPayload {\n /** The configured `deployment.appId`; `null` when none is set. */\n appId: string | null\n type: 'coreApp' | 'studio'\n\n /** Media-library config summary. */\n config?: string\n services?: object[]\n views?: object[]\n}\n\nexport type UndeployTargetResolution<TTarget extends UndeployTarget = UndeployTarget> =\n | {message: string; solution?: string; type: 'none'}\n | {target: TTarget; type: 'found'}\n\n/**\n * The parts of an undeploy that differ per application backend. The shared\n * sequence — mode selection, target reporting, confirmation, error handling —\n * lives in the host CLI's runner; adapters only resolve and delete.\n */\nexport interface UndeployAdapter<TTarget extends UndeployTarget = UndeployTarget> {\n /** Resolves what an undeploy would delete; read-only. */\n resolveTarget(): Promise<UndeployTargetResolution<TTarget>>\n type: 'coreApp' | 'studio'\n /** Deletes the target — the only mutating step, never run on a dry run. */\n undeploy(target: TTarget): Promise<void>\n}\n"],"names":[],"mappings":"AAAA;;;;CAIC,GA0CD;;;;CAIC,GACD,WAMC"}
|