@sanity/runtime-cli 4.5.0 → 4.5.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/README.md +49 -77
- package/dist/actions/blueprints/blueprint.d.ts +6 -12
- package/dist/actions/blueprints/blueprint.js +38 -45
- package/dist/actions/blueprints/index.d.ts +33 -0
- package/dist/actions/blueprints/index.js +32 -0
- package/dist/actions/blueprints/projects.d.ts +9 -0
- package/dist/actions/blueprints/projects.js +12 -0
- package/dist/actions/blueprints/stacks.d.ts +0 -12
- package/dist/actions/blueprints/stacks.js +3 -30
- package/dist/baseCommands.d.ts +24 -0
- package/dist/baseCommands.js +69 -0
- package/dist/commands/blueprints/add.d.ts +1 -1
- package/dist/commands/blueprints/add.js +7 -6
- package/dist/commands/blueprints/config.d.ts +1 -1
- package/dist/commands/blueprints/config.js +24 -11
- package/dist/commands/blueprints/deploy.d.ts +2 -2
- package/dist/commands/blueprints/deploy.js +18 -33
- package/dist/commands/blueprints/destroy.d.ts +4 -3
- package/dist/commands/blueprints/destroy.js +32 -35
- package/dist/commands/blueprints/info.d.ts +2 -2
- package/dist/commands/blueprints/info.js +16 -36
- package/dist/commands/blueprints/init.d.ts +10 -2
- package/dist/commands/blueprints/init.js +85 -26
- package/dist/commands/blueprints/logs.d.ts +2 -2
- package/dist/commands/blueprints/logs.js +18 -32
- package/dist/commands/blueprints/plan.d.ts +2 -2
- package/dist/commands/blueprints/plan.js +10 -16
- package/dist/commands/blueprints/stacks.d.ts +3 -2
- package/dist/commands/blueprints/stacks.js +10 -29
- package/dist/commands/functions/env/add.d.ts +2 -2
- package/dist/commands/functions/env/add.js +6 -17
- package/dist/commands/functions/env/list.d.ts +2 -2
- package/dist/commands/functions/env/list.js +10 -17
- package/dist/commands/functions/env/remove.d.ts +2 -2
- package/dist/commands/functions/env/remove.js +6 -17
- package/dist/commands/functions/invoke.d.ts +2 -2
- package/dist/commands/functions/invoke.js +7 -14
- package/dist/commands/functions/logs.d.ts +3 -7
- package/dist/commands/functions/logs.js +21 -37
- package/dist/commands/functions/test.d.ts +3 -3
- package/dist/commands/functions/test.js +10 -8
- package/dist/server/app.js +3 -3
- package/dist/server/static/vendor/vendor.bundle.d.ts +2 -2
- package/dist/utils/display/blueprints-formatting.js +2 -2
- package/dist/utils/display/errors.d.ts +4 -0
- package/dist/utils/display/errors.js +27 -0
- package/dist/utils/display/index.d.ts +1 -0
- package/dist/utils/display/index.js +1 -0
- package/dist/utils/types.d.ts +10 -3
- package/dist/utils/types.js +9 -3
- package/oclif.manifest.json +59 -37
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeployedBlueprintCommand } from '../../baseCommands.js';
|
|
2
2
|
type RunDeleteOptions = {
|
|
3
3
|
force: boolean;
|
|
4
4
|
};
|
|
@@ -6,7 +6,7 @@ type RunGetOptions = {
|
|
|
6
6
|
limit: number;
|
|
7
7
|
json?: boolean;
|
|
8
8
|
};
|
|
9
|
-
export default class
|
|
9
|
+
export default class LogsCommand extends DeployedBlueprintCommand<typeof LogsCommand> {
|
|
10
10
|
static args: {
|
|
11
11
|
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
12
12
|
};
|
|
@@ -18,13 +18,9 @@ export default class Logs extends Command {
|
|
|
18
18
|
delete: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
19
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
externalId: string | undefined;
|
|
22
22
|
run(): Promise<void>;
|
|
23
23
|
runDeleteLogs(name: string, options: RunDeleteOptions): Promise<void>;
|
|
24
24
|
runGetLogs(name: string, options: RunGetOptions): Promise<void>;
|
|
25
|
-
getProjectAndExternalId(name: string): Promise<{
|
|
26
|
-
projectId?: string;
|
|
27
|
-
externalId?: string;
|
|
28
|
-
}>;
|
|
29
25
|
}
|
|
30
26
|
export {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Args,
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import Spinner from 'yocto-spinner';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { deleteLogs as deleteLogsAction, logs as getLogsAction, } from '../../actions/functions/logs.js';
|
|
5
|
+
import { DeployedBlueprintCommand } from '../../baseCommands.js';
|
|
6
6
|
import { formatTitle } from '../../utils/display/blueprints-formatting.js';
|
|
7
7
|
import { blue, bold, green, red, yellow } from '../../utils/display/colors.js';
|
|
8
8
|
import { findFunctionByName } from '../../utils/find-function.js';
|
|
9
|
-
import { validTokenOrErrorMessage } from '../../utils/validated-token.js';
|
|
10
9
|
function logLevel(level) {
|
|
11
10
|
if (level === 'ERROR') {
|
|
12
11
|
return red(level);
|
|
@@ -16,7 +15,7 @@ function logLevel(level) {
|
|
|
16
15
|
}
|
|
17
16
|
return green(level);
|
|
18
17
|
}
|
|
19
|
-
export default class
|
|
18
|
+
export default class LogsCommand extends DeployedBlueprintCommand {
|
|
20
19
|
static args = {
|
|
21
20
|
name: Args.string({ description: 'The name of the Sanity Function', required: true }),
|
|
22
21
|
};
|
|
@@ -52,13 +51,12 @@ export default class Logs extends Command {
|
|
|
52
51
|
required: false,
|
|
53
52
|
}),
|
|
54
53
|
};
|
|
55
|
-
|
|
54
|
+
externalId;
|
|
56
55
|
async run() {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
this.
|
|
61
|
-
const { args, flags } = await this.parse(Logs);
|
|
56
|
+
const args = this.args;
|
|
57
|
+
const flags = this.flags;
|
|
58
|
+
const { externalId } = findFunctionByName(this.deployedStack, args.name);
|
|
59
|
+
this.externalId = externalId;
|
|
62
60
|
if (flags.delete === true) {
|
|
63
61
|
await this.runDeleteLogs(args.name, flags);
|
|
64
62
|
}
|
|
@@ -67,6 +65,8 @@ export default class Logs extends Command {
|
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
async runDeleteLogs(name, options) {
|
|
68
|
+
if (!this.externalId)
|
|
69
|
+
this.error('Unable to delete logs. Unable to determine function ID.');
|
|
70
70
|
if (!options.force) {
|
|
71
71
|
const { certain } = await inquirer.prompt({
|
|
72
72
|
type: 'confirm',
|
|
@@ -77,14 +77,8 @@ export default class Logs extends Command {
|
|
|
77
77
|
if (!certain)
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
const { projectId, externalId } = await this.getProjectAndExternalId(name);
|
|
81
|
-
if (!projectId || !externalId) {
|
|
82
|
-
this.error('Stack not found');
|
|
83
|
-
}
|
|
84
|
-
if (!this.sanityToken)
|
|
85
|
-
this.error('Unable to delete logs. Missing API token.');
|
|
86
80
|
const spinner = Spinner({ text: `Deleting logs for function ${yellow(name)}` }).start();
|
|
87
|
-
const { ok, error } = await deleteLogsAction(externalId,
|
|
81
|
+
const { ok, error } = await deleteLogsAction(this.externalId, this.auth);
|
|
88
82
|
if (!ok) {
|
|
89
83
|
spinner.error(`${red('Failed')} to retrieve logs`);
|
|
90
84
|
this.log(`Error: ${error || 'Unknown error'}`);
|
|
@@ -93,14 +87,10 @@ export default class Logs extends Command {
|
|
|
93
87
|
spinner.success('Logs deleted');
|
|
94
88
|
}
|
|
95
89
|
async runGetLogs(name, options) {
|
|
90
|
+
if (!this.externalId)
|
|
91
|
+
this.error('Unable to retrieve logs. Unable to determine function ID.');
|
|
96
92
|
const spinner = Spinner({ text: `Finding logs for function "${name}"` }).start();
|
|
97
|
-
const {
|
|
98
|
-
if (!projectId || !externalId) {
|
|
99
|
-
this.error('Stack not found');
|
|
100
|
-
}
|
|
101
|
-
if (!this.sanityToken)
|
|
102
|
-
this.error('Unable to retrieve logs. Missing API token.');
|
|
103
|
-
const { ok, error, logs, total } = await logsAction(externalId, { limit: options.limit }, { token: this.sanityToken, projectId });
|
|
93
|
+
const { ok, error, logs, total } = await getLogsAction(this.externalId, { limit: options.limit }, this.auth);
|
|
104
94
|
if (!ok) {
|
|
105
95
|
spinner.error(`${red('Failed')} to retrieve logs`);
|
|
106
96
|
this.log(`Error: ${error || 'Unknown error'}`);
|
|
@@ -121,22 +111,16 @@ export default class Logs extends Command {
|
|
|
121
111
|
for (const log of filteredLogs) {
|
|
122
112
|
const { time, level, message } = log;
|
|
123
113
|
const date = new Date(time);
|
|
124
|
-
this.log(
|
|
114
|
+
this.log([
|
|
115
|
+
bold(date.toLocaleDateString()),
|
|
116
|
+
bold(blue(date.toLocaleTimeString())),
|
|
117
|
+
logLevel(level),
|
|
118
|
+
message,
|
|
119
|
+
].join(' '));
|
|
125
120
|
}
|
|
126
121
|
}
|
|
127
122
|
else {
|
|
128
123
|
this.log(JSON.stringify(filteredLogs, null, 2));
|
|
129
124
|
}
|
|
130
125
|
}
|
|
131
|
-
async getProjectAndExternalId(name) {
|
|
132
|
-
if (!this.sanityToken)
|
|
133
|
-
this.error('Missing API token.');
|
|
134
|
-
const { deployedStack } = await readBlueprintOnDisk({ getStack: true, token: this.sanityToken });
|
|
135
|
-
if (!deployedStack) {
|
|
136
|
-
return {};
|
|
137
|
-
}
|
|
138
|
-
const { projectId } = deployedStack;
|
|
139
|
-
const { externalId } = findFunctionByName(deployedStack, name);
|
|
140
|
-
return { projectId, externalId };
|
|
141
|
-
}
|
|
142
126
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class
|
|
1
|
+
import { BlueprintCommand } from '../../baseCommands.js';
|
|
2
|
+
export default class TestCommand extends BlueprintCommand<typeof TestCommand> {
|
|
3
3
|
static args: {
|
|
4
4
|
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
@@ -11,7 +11,7 @@ export default class Test extends Command {
|
|
|
11
11
|
timeout: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
api: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
dataset: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'project-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
15
|
};
|
|
16
16
|
run(): Promise<void>;
|
|
17
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Args,
|
|
2
|
-
import { readBlueprintOnDisk } from '../../actions/blueprints/blueprint.js';
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
2
|
import { testAction } from '../../actions/functions/test.js';
|
|
3
|
+
import { BlueprintCommand } from '../../baseCommands.js';
|
|
4
4
|
import { findFunctionByName } from '../../utils/find-function.js';
|
|
5
|
-
export default class
|
|
5
|
+
export default class TestCommand extends BlueprintCommand {
|
|
6
6
|
static args = {
|
|
7
7
|
name: Args.string({ description: 'The name of the Sanity Function', required: true }),
|
|
8
8
|
};
|
|
@@ -33,14 +33,16 @@ export default class Test extends Command {
|
|
|
33
33
|
description: 'The Sanity dataset to use',
|
|
34
34
|
required: false,
|
|
35
35
|
}),
|
|
36
|
-
project: Flags.string({
|
|
37
|
-
description: '
|
|
36
|
+
'project-id': Flags.string({
|
|
37
|
+
description: 'Sanity Project ID to use',
|
|
38
|
+
aliases: ['project', 'projectId'],
|
|
38
39
|
required: false,
|
|
39
40
|
}),
|
|
40
41
|
};
|
|
41
42
|
async run() {
|
|
42
|
-
const
|
|
43
|
-
const
|
|
43
|
+
const args = this.args;
|
|
44
|
+
const flags = this.flags;
|
|
45
|
+
const parsedBlueprint = this.blueprint.parsedBlueprint;
|
|
44
46
|
try {
|
|
45
47
|
const resource = findFunctionByName(parsedBlueprint, args.name);
|
|
46
48
|
const { json, logs, error } = await testAction(resource, {
|
|
@@ -51,7 +53,7 @@ export default class Test extends Command {
|
|
|
51
53
|
clientOptions: {
|
|
52
54
|
apiVersion: flags.api,
|
|
53
55
|
dataset: flags.dataset,
|
|
54
|
-
projectId: flags
|
|
56
|
+
projectId: flags['project-id'],
|
|
55
57
|
},
|
|
56
58
|
});
|
|
57
59
|
if (!error) {
|
package/dist/server/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import * as http from 'node:http';
|
|
3
3
|
import { default as mime } from 'mime-types';
|
|
4
|
-
import {
|
|
4
|
+
import { readLocalBlueprint } from '../actions/blueprints/blueprint.js';
|
|
5
5
|
import config from '../config.js';
|
|
6
6
|
import { findFunctionByName } from '../utils/find-function.js';
|
|
7
7
|
import invoke from '../utils/invoke-local.js';
|
|
@@ -13,7 +13,7 @@ const app = (port) => {
|
|
|
13
13
|
switch (true) {
|
|
14
14
|
case req.url === '/blueprint': {
|
|
15
15
|
try {
|
|
16
|
-
const { parsedBlueprint } = await
|
|
16
|
+
const { parsedBlueprint } = await readLocalBlueprint();
|
|
17
17
|
res.setHeader('Content-Type', 'application/json');
|
|
18
18
|
res.writeHead(200);
|
|
19
19
|
res.end(JSON.stringify(parsedBlueprint)); // Use parsedBlueprint directly
|
|
@@ -34,7 +34,7 @@ const app = (port) => {
|
|
|
34
34
|
const { data, func: functionName } = parseInvokeRequest(Buffer.concat(body));
|
|
35
35
|
const { context, event } = data;
|
|
36
36
|
const start = performance.now();
|
|
37
|
-
const { parsedBlueprint } = await
|
|
37
|
+
const { parsedBlueprint } = await readLocalBlueprint();
|
|
38
38
|
const resource = findFunctionByName(parsedBlueprint, functionName);
|
|
39
39
|
const readBlueprintTime = performance.now() - start;
|
|
40
40
|
const response = await invoke(resource, event, context);
|
|
@@ -1018,9 +1018,9 @@ declare class ViewState {
|
|
|
1018
1018
|
viewport: Viewport | undefined;
|
|
1019
1019
|
lineGaps: any[];
|
|
1020
1020
|
lineGapDeco: any;
|
|
1021
|
-
updateForViewport():
|
|
1021
|
+
updateForViewport(): 0 | 2;
|
|
1022
1022
|
viewports: (Viewport | undefined)[] | undefined;
|
|
1023
|
-
updateScaler():
|
|
1023
|
+
updateScaler(): 0 | 2;
|
|
1024
1024
|
updateViewportLines(): void;
|
|
1025
1025
|
viewportLines: any[] | undefined;
|
|
1026
1026
|
update(update: any, scrollTarget?: null): void;
|
|
@@ -6,10 +6,10 @@ export function formatTitle(title, name) {
|
|
|
6
6
|
}
|
|
7
7
|
export function formatResourceTree(resources) {
|
|
8
8
|
if (!resources || resources.length === 0) {
|
|
9
|
-
return ' Zero resources
|
|
9
|
+
return ' Zero deployed resources';
|
|
10
10
|
}
|
|
11
11
|
const output = [];
|
|
12
|
-
output.push(`${blue('
|
|
12
|
+
output.push(`${blue('Blueprint Resources')} [${resources.length}]`);
|
|
13
13
|
const functionResources = resources.filter((r) => r.type?.startsWith('sanity.function.'));
|
|
14
14
|
const otherResources = resources.filter((r) => !r.type?.startsWith('sanity.function.'));
|
|
15
15
|
const hasOtherResources = otherResources.length > 0;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BlueprintIssue } from '../../actions/blueprints/index.js';
|
|
2
|
+
import type { BlueprintParserError } from '../types.js';
|
|
3
|
+
export declare function presentBlueprintIssues(issues: BlueprintIssue[]): string;
|
|
4
|
+
export declare function presentBlueprintParserErrors(errors: BlueprintParserError[]): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function presentBlueprintIssues(issues) {
|
|
2
|
+
const report = [];
|
|
3
|
+
for (const issue of issues) {
|
|
4
|
+
switch (issue.code) {
|
|
5
|
+
case 'PARSE_ERROR':
|
|
6
|
+
report.push(issue.message);
|
|
7
|
+
if (issue.errors)
|
|
8
|
+
report.push(presentBlueprintParserErrors(issue.errors));
|
|
9
|
+
break;
|
|
10
|
+
case 'NO_STACK_ID':
|
|
11
|
+
report.push('Existing deployment not found.');
|
|
12
|
+
break;
|
|
13
|
+
case 'NO_PROJECT_ID':
|
|
14
|
+
report.push('Project ID not found.');
|
|
15
|
+
break;
|
|
16
|
+
case 'NO_STACK':
|
|
17
|
+
report.push('Existing deployment not found.');
|
|
18
|
+
break;
|
|
19
|
+
default:
|
|
20
|
+
report.push(issue.message);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return report.join('\n');
|
|
24
|
+
}
|
|
25
|
+
export function presentBlueprintParserErrors(errors) {
|
|
26
|
+
return errors.map((e) => e.message).join('\n');
|
|
27
|
+
}
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export interface StackPayload {
|
|
|
96
96
|
name: string;
|
|
97
97
|
projectId: string;
|
|
98
98
|
document: LocalBlueprint;
|
|
99
|
+
useProjectBasedId?: boolean;
|
|
99
100
|
}
|
|
100
101
|
/** @internal */
|
|
101
102
|
export interface InvokePayloadOptions {
|
|
@@ -135,10 +136,16 @@ export interface FunctionLog {
|
|
|
135
136
|
}
|
|
136
137
|
/** @internal */
|
|
137
138
|
export declare enum BlueprintParserErrorType {
|
|
138
|
-
MissingProject = "missing_project",
|
|
139
|
-
MissingStack = "missing_stack",
|
|
140
139
|
InvalidProperty = "invalid_property",
|
|
141
|
-
|
|
140
|
+
InvalidVersion = "invalid_version",
|
|
141
|
+
InvalidType = "invalid_type",
|
|
142
|
+
MissingRequiredProperty = "missing_required_property",
|
|
143
|
+
DuplicateName = "duplicate_name",
|
|
144
|
+
InvalidFormat = "invalid_format",
|
|
145
|
+
InvalidValue = "invalid_value",
|
|
146
|
+
JsonValidationError = "json_validation_error",
|
|
147
|
+
InvalidInput = "invalid_input",
|
|
148
|
+
MissingParameter = "missing_parameter"
|
|
142
149
|
}
|
|
143
150
|
/** @internal */
|
|
144
151
|
export interface BlueprintParserError {
|
package/dist/utils/types.js
CHANGED
|
@@ -4,8 +4,14 @@ export function isLocalFunctionResource(r) {
|
|
|
4
4
|
/** @internal */
|
|
5
5
|
export var BlueprintParserErrorType;
|
|
6
6
|
(function (BlueprintParserErrorType) {
|
|
7
|
-
BlueprintParserErrorType["MissingProject"] = "missing_project";
|
|
8
|
-
BlueprintParserErrorType["MissingStack"] = "missing_stack";
|
|
9
7
|
BlueprintParserErrorType["InvalidProperty"] = "invalid_property";
|
|
10
|
-
BlueprintParserErrorType["
|
|
8
|
+
BlueprintParserErrorType["InvalidVersion"] = "invalid_version";
|
|
9
|
+
BlueprintParserErrorType["InvalidType"] = "invalid_type";
|
|
10
|
+
BlueprintParserErrorType["MissingRequiredProperty"] = "missing_required_property";
|
|
11
|
+
BlueprintParserErrorType["DuplicateName"] = "duplicate_name";
|
|
12
|
+
BlueprintParserErrorType["InvalidFormat"] = "invalid_format";
|
|
13
|
+
BlueprintParserErrorType["InvalidValue"] = "invalid_value";
|
|
14
|
+
BlueprintParserErrorType["JsonValidationError"] = "json_validation_error";
|
|
15
|
+
BlueprintParserErrorType["InvalidInput"] = "invalid_input";
|
|
16
|
+
BlueprintParserErrorType["MissingParameter"] = "missing_parameter";
|
|
11
17
|
})(BlueprintParserErrorType || (BlueprintParserErrorType = {}));
|
package/oclif.manifest.json
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"<%= config.bin %> <%= command.id %>",
|
|
66
66
|
"<%= config.bin %> <%= command.id %> --test-config",
|
|
67
67
|
"<%= config.bin %> <%= command.id %> --edit",
|
|
68
|
-
"<%= config.bin %> <%= command.id %> --edit --project-id <projectId>
|
|
68
|
+
"<%= config.bin %> <%= command.id %> --edit --project-id <projectId>"
|
|
69
69
|
],
|
|
70
70
|
"flags": {
|
|
71
71
|
"test-config": {
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
"edit"
|
|
110
110
|
],
|
|
111
111
|
"description": "Update the Stack ID in the configuration. Requires --edit flag",
|
|
112
|
+
"hidden": true,
|
|
112
113
|
"name": "stack-id",
|
|
113
114
|
"hasDynamicHelp": false,
|
|
114
115
|
"multiple": false,
|
|
@@ -136,7 +137,8 @@
|
|
|
136
137
|
"args": {},
|
|
137
138
|
"description": "Deploy a Blueprint",
|
|
138
139
|
"examples": [
|
|
139
|
-
"<%= config.bin %> <%= command.id %>"
|
|
140
|
+
"<%= config.bin %> <%= command.id %>",
|
|
141
|
+
"<%= config.bin %> <%= command.id %> --no-wait"
|
|
140
142
|
],
|
|
141
143
|
"flags": {
|
|
142
144
|
"no-wait": {
|
|
@@ -153,7 +155,6 @@
|
|
|
153
155
|
"pluginName": "@sanity/runtime-cli",
|
|
154
156
|
"pluginType": "core",
|
|
155
157
|
"strict": true,
|
|
156
|
-
"enableJsonFlag": false,
|
|
157
158
|
"isESM": true,
|
|
158
159
|
"relativePath": [
|
|
159
160
|
"dist",
|
|
@@ -165,25 +166,40 @@
|
|
|
165
166
|
"blueprints:destroy": {
|
|
166
167
|
"aliases": [],
|
|
167
168
|
"args": {},
|
|
168
|
-
"description": "Destroy a
|
|
169
|
+
"description": "Destroy a Blueprint deployment",
|
|
169
170
|
"examples": [
|
|
170
|
-
"<%= config.bin %> <%= command.id %>"
|
|
171
|
-
"<%= config.bin %> <%= command.id %> --id ST-a1b2c3"
|
|
171
|
+
"<%= config.bin %> <%= command.id %>"
|
|
172
172
|
],
|
|
173
173
|
"flags": {
|
|
174
|
+
"force": {
|
|
175
|
+
"description": "Force destroy (skip confirmation)",
|
|
176
|
+
"name": "force",
|
|
177
|
+
"allowNo": false,
|
|
178
|
+
"type": "boolean"
|
|
179
|
+
},
|
|
180
|
+
"projectId": {
|
|
181
|
+
"dependsOn": [
|
|
182
|
+
"id",
|
|
183
|
+
"force"
|
|
184
|
+
],
|
|
185
|
+
"description": "Project associated with the Stack (defaults to current Project)",
|
|
186
|
+
"hidden": true,
|
|
187
|
+
"name": "projectId",
|
|
188
|
+
"hasDynamicHelp": false,
|
|
189
|
+
"multiple": false,
|
|
190
|
+
"type": "option"
|
|
191
|
+
},
|
|
174
192
|
"id": {
|
|
193
|
+
"dependsOn": [
|
|
194
|
+
"projectId",
|
|
195
|
+
"force"
|
|
196
|
+
],
|
|
175
197
|
"description": "Stack ID to destroy (defaults to current Stack)",
|
|
198
|
+
"hidden": true,
|
|
176
199
|
"name": "id",
|
|
177
|
-
"required": false,
|
|
178
200
|
"hasDynamicHelp": false,
|
|
179
201
|
"multiple": false,
|
|
180
202
|
"type": "option"
|
|
181
|
-
},
|
|
182
|
-
"force": {
|
|
183
|
-
"description": "Force destroy (skip confirmation)",
|
|
184
|
-
"name": "force",
|
|
185
|
-
"allowNo": false,
|
|
186
|
-
"type": "boolean"
|
|
187
203
|
}
|
|
188
204
|
},
|
|
189
205
|
"hasDynamicHelp": false,
|
|
@@ -193,7 +209,6 @@
|
|
|
193
209
|
"pluginName": "@sanity/runtime-cli",
|
|
194
210
|
"pluginType": "core",
|
|
195
211
|
"strict": true,
|
|
196
|
-
"enableJsonFlag": false,
|
|
197
212
|
"isESM": true,
|
|
198
213
|
"relativePath": [
|
|
199
214
|
"dist",
|
|
@@ -205,16 +220,15 @@
|
|
|
205
220
|
"blueprints:info": {
|
|
206
221
|
"aliases": [],
|
|
207
222
|
"args": {},
|
|
208
|
-
"description": "Show information about a
|
|
223
|
+
"description": "Show information about a Blueprint deployment",
|
|
209
224
|
"examples": [
|
|
210
|
-
"<%= config.bin %> <%= command.id %>"
|
|
211
|
-
"<%= config.bin %> <%= command.id %> --id ST-a1b2c3"
|
|
225
|
+
"<%= config.bin %> <%= command.id %>"
|
|
212
226
|
],
|
|
213
227
|
"flags": {
|
|
214
228
|
"id": {
|
|
215
229
|
"description": "Stack ID to show info for (defaults to current stack)",
|
|
230
|
+
"hidden": true,
|
|
216
231
|
"name": "id",
|
|
217
|
-
"required": false,
|
|
218
232
|
"hasDynamicHelp": false,
|
|
219
233
|
"multiple": false,
|
|
220
234
|
"type": "option"
|
|
@@ -227,7 +241,6 @@
|
|
|
227
241
|
"pluginName": "@sanity/runtime-cli",
|
|
228
242
|
"pluginType": "core",
|
|
229
243
|
"strict": true,
|
|
230
|
-
"enableJsonFlag": false,
|
|
231
244
|
"isESM": true,
|
|
232
245
|
"relativePath": [
|
|
233
246
|
"dist",
|
|
@@ -238,15 +251,27 @@
|
|
|
238
251
|
},
|
|
239
252
|
"blueprints:init": {
|
|
240
253
|
"aliases": [],
|
|
241
|
-
"args": {
|
|
254
|
+
"args": {
|
|
255
|
+
"dir": {
|
|
256
|
+
"description": "Directory to create the Blueprint in",
|
|
257
|
+
"name": "dir"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
242
260
|
"description": "Initialize a new Blueprint",
|
|
243
261
|
"examples": [
|
|
244
262
|
"<%= config.bin %> <%= command.id %>",
|
|
263
|
+
"<%= config.bin %> <%= command.id %> [directory]",
|
|
245
264
|
"<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
|
|
246
|
-
"<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts> --project-id <projectId>
|
|
247
|
-
"<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts> --project-id <projectId> --stack-name <stackName>"
|
|
265
|
+
"<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts> --project-id <projectId>"
|
|
248
266
|
],
|
|
249
267
|
"flags": {
|
|
268
|
+
"dir": {
|
|
269
|
+
"description": "Directory to create the Blueprint in",
|
|
270
|
+
"name": "dir",
|
|
271
|
+
"hasDynamicHelp": false,
|
|
272
|
+
"multiple": false,
|
|
273
|
+
"type": "option"
|
|
274
|
+
},
|
|
250
275
|
"blueprint-type": {
|
|
251
276
|
"aliases": [
|
|
252
277
|
"type"
|
|
@@ -285,6 +310,7 @@
|
|
|
285
310
|
"exclusive": [
|
|
286
311
|
"stack-name"
|
|
287
312
|
],
|
|
313
|
+
"hidden": true,
|
|
288
314
|
"name": "stack-id",
|
|
289
315
|
"hasDynamicHelp": false,
|
|
290
316
|
"multiple": false,
|
|
@@ -294,7 +320,6 @@
|
|
|
294
320
|
"aliases": [
|
|
295
321
|
"name"
|
|
296
322
|
],
|
|
297
|
-
"char": "n",
|
|
298
323
|
"dependsOn": [
|
|
299
324
|
"project-id"
|
|
300
325
|
],
|
|
@@ -302,6 +327,7 @@
|
|
|
302
327
|
"exclusive": [
|
|
303
328
|
"stack-id"
|
|
304
329
|
],
|
|
330
|
+
"hidden": true,
|
|
305
331
|
"name": "stack-name",
|
|
306
332
|
"hasDynamicHelp": false,
|
|
307
333
|
"multiple": false,
|
|
@@ -327,7 +353,7 @@
|
|
|
327
353
|
"blueprints:logs": {
|
|
328
354
|
"aliases": [],
|
|
329
355
|
"args": {},
|
|
330
|
-
"description": "Display logs for a Blueprint
|
|
356
|
+
"description": "Display logs for a Blueprint deployment",
|
|
331
357
|
"examples": [
|
|
332
358
|
"<%= config.bin %> <%= command.id %>",
|
|
333
359
|
"<%= config.bin %> <%= command.id %> --watch"
|
|
@@ -349,7 +375,6 @@
|
|
|
349
375
|
"pluginName": "@sanity/runtime-cli",
|
|
350
376
|
"pluginType": "core",
|
|
351
377
|
"strict": true,
|
|
352
|
-
"enableJsonFlag": false,
|
|
353
378
|
"isESM": true,
|
|
354
379
|
"relativePath": [
|
|
355
380
|
"dist",
|
|
@@ -373,7 +398,6 @@
|
|
|
373
398
|
"pluginName": "@sanity/runtime-cli",
|
|
374
399
|
"pluginType": "core",
|
|
375
400
|
"strict": true,
|
|
376
|
-
"enableJsonFlag": false,
|
|
377
401
|
"isESM": true,
|
|
378
402
|
"relativePath": [
|
|
379
403
|
"dist",
|
|
@@ -401,13 +425,13 @@
|
|
|
401
425
|
}
|
|
402
426
|
},
|
|
403
427
|
"hasDynamicHelp": false,
|
|
428
|
+
"hidden": true,
|
|
404
429
|
"hiddenAliases": [],
|
|
405
430
|
"id": "blueprints:stacks",
|
|
406
431
|
"pluginAlias": "@sanity/runtime-cli",
|
|
407
432
|
"pluginName": "@sanity/runtime-cli",
|
|
408
433
|
"pluginType": "core",
|
|
409
434
|
"strict": true,
|
|
410
|
-
"enableJsonFlag": false,
|
|
411
435
|
"isESM": true,
|
|
412
436
|
"relativePath": [
|
|
413
437
|
"dist",
|
|
@@ -491,7 +515,6 @@
|
|
|
491
515
|
"pluginName": "@sanity/runtime-cli",
|
|
492
516
|
"pluginType": "core",
|
|
493
517
|
"strict": true,
|
|
494
|
-
"enableJsonFlag": false,
|
|
495
518
|
"isESM": true,
|
|
496
519
|
"relativePath": [
|
|
497
520
|
"dist",
|
|
@@ -566,7 +589,6 @@
|
|
|
566
589
|
"pluginName": "@sanity/runtime-cli",
|
|
567
590
|
"pluginType": "core",
|
|
568
591
|
"strict": true,
|
|
569
|
-
"enableJsonFlag": false,
|
|
570
592
|
"isESM": true,
|
|
571
593
|
"relativePath": [
|
|
572
594
|
"dist",
|
|
@@ -635,9 +657,13 @@
|
|
|
635
657
|
"multiple": false,
|
|
636
658
|
"type": "option"
|
|
637
659
|
},
|
|
638
|
-
"project": {
|
|
639
|
-
"
|
|
640
|
-
|
|
660
|
+
"project-id": {
|
|
661
|
+
"aliases": [
|
|
662
|
+
"project",
|
|
663
|
+
"projectId"
|
|
664
|
+
],
|
|
665
|
+
"description": "Sanity Project ID to use",
|
|
666
|
+
"name": "project-id",
|
|
641
667
|
"required": false,
|
|
642
668
|
"hasDynamicHelp": false,
|
|
643
669
|
"multiple": false,
|
|
@@ -651,7 +677,6 @@
|
|
|
651
677
|
"pluginName": "@sanity/runtime-cli",
|
|
652
678
|
"pluginType": "core",
|
|
653
679
|
"strict": true,
|
|
654
|
-
"enableJsonFlag": false,
|
|
655
680
|
"isESM": true,
|
|
656
681
|
"relativePath": [
|
|
657
682
|
"dist",
|
|
@@ -691,7 +716,6 @@
|
|
|
691
716
|
"pluginName": "@sanity/runtime-cli",
|
|
692
717
|
"pluginType": "core",
|
|
693
718
|
"strict": true,
|
|
694
|
-
"enableJsonFlag": false,
|
|
695
719
|
"isESM": true,
|
|
696
720
|
"relativePath": [
|
|
697
721
|
"dist",
|
|
@@ -722,7 +746,6 @@
|
|
|
722
746
|
"pluginName": "@sanity/runtime-cli",
|
|
723
747
|
"pluginType": "core",
|
|
724
748
|
"strict": true,
|
|
725
|
-
"enableJsonFlag": false,
|
|
726
749
|
"isESM": true,
|
|
727
750
|
"relativePath": [
|
|
728
751
|
"dist",
|
|
@@ -758,7 +781,6 @@
|
|
|
758
781
|
"pluginName": "@sanity/runtime-cli",
|
|
759
782
|
"pluginType": "core",
|
|
760
783
|
"strict": true,
|
|
761
|
-
"enableJsonFlag": false,
|
|
762
784
|
"isESM": true,
|
|
763
785
|
"relativePath": [
|
|
764
786
|
"dist",
|
|
@@ -769,5 +791,5 @@
|
|
|
769
791
|
]
|
|
770
792
|
}
|
|
771
793
|
},
|
|
772
|
-
"version": "4.5.
|
|
794
|
+
"version": "4.5.1"
|
|
773
795
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/runtime-cli",
|
|
3
3
|
"description": "Sanity's Runtime CLI for Blueprints and Functions",
|
|
4
|
-
"version": "4.5.
|
|
4
|
+
"version": "4.5.1",
|
|
5
5
|
"author": "Sanity Runtime Team",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"chalk": "^5.4.1",
|
|
68
68
|
"color-json": "^3.0.5",
|
|
69
69
|
"eventsource": "^3.0.6",
|
|
70
|
+
"find-up": "^7.0.0",
|
|
70
71
|
"inquirer": "^12.5.2",
|
|
71
72
|
"mime-types": "^3.0.1",
|
|
72
73
|
"vite": "^6.3.3",
|