@sanity/runtime-cli 14.13.2 → 14.13.4
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 +18 -18
- package/dist/actions/blueprints/blueprint.js +13 -11
- package/dist/baseCommands.js +5 -5
- package/dist/cores/blueprints/config.js +11 -5
- package/dist/cores/blueprints/doctor.js +7 -7
- package/dist/cores/blueprints/promote.js +3 -3
- package/dist/cores/functions/test.js +3 -3
- package/dist/cores/index.js +1 -1
- package/dist/utils/types.d.ts +6 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g @sanity/runtime-cli
|
|
|
20
20
|
$ sanity-run COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ sanity-run (--version)
|
|
23
|
-
@sanity/runtime-cli/14.13.
|
|
23
|
+
@sanity/runtime-cli/14.13.4 linux-x64 node-v24.14.1
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -102,7 +102,7 @@ EXAMPLES
|
|
|
102
102
|
$ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
105
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/add.ts)_
|
|
106
106
|
|
|
107
107
|
## `sanity-run blueprints config`
|
|
108
108
|
|
|
@@ -141,7 +141,7 @@ EXAMPLES
|
|
|
141
141
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack <name-or-id>
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
144
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/config.ts)_
|
|
145
145
|
|
|
146
146
|
## `sanity-run blueprints deploy`
|
|
147
147
|
|
|
@@ -183,7 +183,7 @@ EXAMPLES
|
|
|
183
183
|
$ sanity-run blueprints deploy --fn-installer npm
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
186
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/deploy.ts)_
|
|
187
187
|
|
|
188
188
|
## `sanity-run blueprints destroy`
|
|
189
189
|
|
|
@@ -219,7 +219,7 @@ EXAMPLES
|
|
|
219
219
|
$ sanity-run blueprints destroy --stack <name-or-id> --project-id <projectId> --force --no-wait
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
222
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/destroy.ts)_
|
|
223
223
|
|
|
224
224
|
## `sanity-run blueprints doctor`
|
|
225
225
|
|
|
@@ -251,7 +251,7 @@ EXAMPLES
|
|
|
251
251
|
$ sanity-run blueprints doctor --fix
|
|
252
252
|
```
|
|
253
253
|
|
|
254
|
-
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
254
|
+
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/doctor.ts)_
|
|
255
255
|
|
|
256
256
|
## `sanity-run blueprints info`
|
|
257
257
|
|
|
@@ -286,7 +286,7 @@ EXAMPLES
|
|
|
286
286
|
$ sanity-run blueprints info --project-id <id> --stack <name-or-id>
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
289
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/info.ts)_
|
|
290
290
|
|
|
291
291
|
## `sanity-run blueprints init [DIR]`
|
|
292
292
|
|
|
@@ -339,7 +339,7 @@ EXAMPLES
|
|
|
339
339
|
$ sanity-run blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
|
|
340
340
|
```
|
|
341
341
|
|
|
342
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
342
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/init.ts)_
|
|
343
343
|
|
|
344
344
|
## `sanity-run blueprints logs`
|
|
345
345
|
|
|
@@ -370,7 +370,7 @@ EXAMPLES
|
|
|
370
370
|
$ sanity-run blueprints logs --watch
|
|
371
371
|
```
|
|
372
372
|
|
|
373
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
373
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/logs.ts)_
|
|
374
374
|
|
|
375
375
|
## `sanity-run blueprints plan`
|
|
376
376
|
|
|
@@ -398,7 +398,7 @@ EXAMPLES
|
|
|
398
398
|
$ sanity-run blueprints plan
|
|
399
399
|
```
|
|
400
400
|
|
|
401
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
401
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/plan.ts)_
|
|
402
402
|
|
|
403
403
|
## `sanity-run blueprints stacks`
|
|
404
404
|
|
|
@@ -436,7 +436,7 @@ EXAMPLES
|
|
|
436
436
|
$ sanity-run blueprints stacks --organization-id <organizationId> --include-projects
|
|
437
437
|
```
|
|
438
438
|
|
|
439
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
439
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/blueprints/stacks.ts)_
|
|
440
440
|
|
|
441
441
|
## `sanity-run functions add`
|
|
442
442
|
|
|
@@ -489,7 +489,7 @@ EXAMPLES
|
|
|
489
489
|
$ sanity-run functions add --name my-function --type document-create --type document-update --lang js
|
|
490
490
|
```
|
|
491
491
|
|
|
492
|
-
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
492
|
+
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/functions/add.ts)_
|
|
493
493
|
|
|
494
494
|
## `sanity-run functions dev`
|
|
495
495
|
|
|
@@ -525,7 +525,7 @@ EXAMPLES
|
|
|
525
525
|
$ sanity-run functions dev --timeout 60
|
|
526
526
|
```
|
|
527
527
|
|
|
528
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
528
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/functions/dev.ts)_
|
|
529
529
|
|
|
530
530
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
531
531
|
|
|
@@ -556,7 +556,7 @@ EXAMPLES
|
|
|
556
556
|
$ sanity-run functions env add MyFunction API_URL https://api.example.com/
|
|
557
557
|
```
|
|
558
558
|
|
|
559
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
559
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/functions/env/add.ts)_
|
|
560
560
|
|
|
561
561
|
## `sanity-run functions env list NAME`
|
|
562
562
|
|
|
@@ -584,7 +584,7 @@ EXAMPLES
|
|
|
584
584
|
$ sanity-run functions env list MyFunction
|
|
585
585
|
```
|
|
586
586
|
|
|
587
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
587
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/functions/env/list.ts)_
|
|
588
588
|
|
|
589
589
|
## `sanity-run functions env remove NAME KEY`
|
|
590
590
|
|
|
@@ -614,7 +614,7 @@ EXAMPLES
|
|
|
614
614
|
$ sanity-run functions env remove MyFunction API_URL
|
|
615
615
|
```
|
|
616
616
|
|
|
617
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
617
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/functions/env/remove.ts)_
|
|
618
618
|
|
|
619
619
|
## `sanity-run functions logs [NAME]`
|
|
620
620
|
|
|
@@ -656,7 +656,7 @@ EXAMPLES
|
|
|
656
656
|
$ sanity-run functions logs <name> --delete
|
|
657
657
|
```
|
|
658
658
|
|
|
659
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
659
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/functions/logs.ts)_
|
|
660
660
|
|
|
661
661
|
## `sanity-run functions test [NAME]`
|
|
662
662
|
|
|
@@ -714,7 +714,7 @@ EXAMPLES
|
|
|
714
714
|
$ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
|
|
715
715
|
```
|
|
716
716
|
|
|
717
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.
|
|
717
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v14.13.4/src/commands/functions/test.ts)_
|
|
718
718
|
|
|
719
719
|
## `sanity-run help [COMMAND]`
|
|
720
720
|
|
|
@@ -87,11 +87,11 @@ export async function loadBlueprintFile(fileInfo) {
|
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
default:
|
|
90
|
-
throw Error(`Unsupported
|
|
90
|
+
throw Error(`Unsupported Blueprint manifest extension: ${extension}`);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
catch (err) {
|
|
94
|
-
throw Error(`
|
|
94
|
+
throw Error(`Could not parse Blueprint manifest: ${fileName}\n${err}`);
|
|
95
95
|
}
|
|
96
96
|
// Dynamic modules: extract attached properties, then execute to get raw blueprint
|
|
97
97
|
if (blueprintModule) {
|
|
@@ -100,15 +100,15 @@ export async function loadBlueprintFile(fileInfo) {
|
|
|
100
100
|
rawBlueprint = blueprintModule();
|
|
101
101
|
}
|
|
102
102
|
catch {
|
|
103
|
-
throw Error(`Error executing Blueprint
|
|
103
|
+
throw Error(`Error executing Blueprint manifest: ${fileName}`);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
|
-
throw Error(`Blueprint ${fileName} must export a default function
|
|
107
|
+
throw Error(`Blueprint manifest ${fileName} must export a default function.`);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
if (typeof rawBlueprint === 'undefined') {
|
|
111
|
-
throw Error('
|
|
111
|
+
throw Error('Could not read Blueprint manifest.');
|
|
112
112
|
}
|
|
113
113
|
return { rawBlueprint, module: blueprintModule };
|
|
114
114
|
}
|
|
@@ -148,8 +148,9 @@ export function parseBlueprintContent(rawBlueprint, options) {
|
|
|
148
148
|
*/
|
|
149
149
|
export async function loadAndParseBlueprint(blueprintPath, options = { validateResources: true }) {
|
|
150
150
|
const fileInfo = findBlueprintFile(blueprintPath);
|
|
151
|
-
if (!fileInfo)
|
|
152
|
-
throw Error('Could not find Blueprint
|
|
151
|
+
if (!fileInfo) {
|
|
152
|
+
throw Error('Could not find a Blueprint manifest (sanity.blueprint.ts, .js, or .json). Run `blueprints init` to create one.');
|
|
153
|
+
}
|
|
153
154
|
const loaded = await loadBlueprintFile(fileInfo);
|
|
154
155
|
const parsed = parseBlueprintContent(loaded.rawBlueprint, options);
|
|
155
156
|
return {
|
|
@@ -169,8 +170,9 @@ export async function loadAndParseBlueprint(blueprintPath, options = { validateR
|
|
|
169
170
|
*/
|
|
170
171
|
export async function readLocalBlueprint(logger, validate, blueprintPath) {
|
|
171
172
|
const fileInfo = findBlueprintFile(blueprintPath);
|
|
172
|
-
if (!fileInfo)
|
|
173
|
-
throw Error('Could not find Blueprint
|
|
173
|
+
if (!fileInfo) {
|
|
174
|
+
throw Error('Could not find a Blueprint manifest (sanity.blueprint.ts, .js, or .json). Run `blueprints init` to create one.');
|
|
175
|
+
}
|
|
174
176
|
// 1. Load blueprint from disk
|
|
175
177
|
const loaded = await loadBlueprintFile(fileInfo);
|
|
176
178
|
const { rawBlueprint } = loaded;
|
|
@@ -226,7 +228,7 @@ export function writeBlueprintToDisk({ blueprintFilePath, jsonContent = JSON_BLU
|
|
|
226
228
|
break;
|
|
227
229
|
}
|
|
228
230
|
default: {
|
|
229
|
-
throw Error(`Unsupported
|
|
231
|
+
throw Error(`Unsupported Blueprint manifest extension: ${extension}`);
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
234
|
mkdirSync(dir, { recursive: true });
|
|
@@ -236,7 +238,7 @@ export function writeBlueprintToDisk({ blueprintFilePath, jsonContent = JSON_BLU
|
|
|
236
238
|
export function addResourceToBlueprint({ blueprintFilePath, resource, }) {
|
|
237
239
|
const blueprintFile = findBlueprintFile(blueprintFilePath);
|
|
238
240
|
if (!blueprintFile)
|
|
239
|
-
throw Error('Could not find Blueprint
|
|
241
|
+
throw Error('Could not find a Blueprint manifest.');
|
|
240
242
|
const { blueprintFilePath: foundPath, extension } = blueprintFile;
|
|
241
243
|
// modify .json files directly
|
|
242
244
|
if (extension === '.json') {
|
package/dist/baseCommands.js
CHANGED
|
@@ -216,7 +216,7 @@ export class ResolvedCommand extends RuntimeCommand {
|
|
|
216
216
|
let blueprintModule;
|
|
217
217
|
if (needsBlueprint) {
|
|
218
218
|
if (!blueprintFileInfo) {
|
|
219
|
-
this.error('Could not find Blueprint
|
|
219
|
+
this.error('Could not find a Blueprint manifest (sanity.blueprint.ts, .js, or .json).', {
|
|
220
220
|
suggestions: [
|
|
221
221
|
`Run \`${this.config.bin} blueprints init\` to create one.`,
|
|
222
222
|
`Run \`${this.config.bin} blueprints doctor\` to check your configuration.`,
|
|
@@ -229,9 +229,9 @@ export class ResolvedCommand extends RuntimeCommand {
|
|
|
229
229
|
});
|
|
230
230
|
if (parsed.errors.length > 0) {
|
|
231
231
|
log(presentBlueprintParserErrors(parsed.errors));
|
|
232
|
-
this.error('Blueprint
|
|
232
|
+
this.error('Blueprint manifest contains errors.', {
|
|
233
233
|
suggestions: [
|
|
234
|
-
'Fix the
|
|
234
|
+
'Fix the manifest errors listed above.',
|
|
235
235
|
`Run \`${this.config.bin} blueprints doctor\` to check your configuration.`,
|
|
236
236
|
],
|
|
237
237
|
});
|
|
@@ -285,7 +285,7 @@ export class ResolvedCommand extends RuntimeCommand {
|
|
|
285
285
|
// 5. Scope
|
|
286
286
|
if (needsScope) {
|
|
287
287
|
if (!resolved.scopeType || !resolved.scopeId) {
|
|
288
|
-
this.error('Missing scope: provide --project-id or --organization-id, or
|
|
288
|
+
this.error('Missing scope: provide --project-id or --organization-id, or run `blueprints init` to create a Blueprint config (.sanity/blueprint.config.json).', {
|
|
289
289
|
suggestions: [
|
|
290
290
|
`Run \`${this.config.bin} blueprints doctor\` to check your configuration.`,
|
|
291
291
|
],
|
|
@@ -307,7 +307,7 @@ export class ResolvedCommand extends RuntimeCommand {
|
|
|
307
307
|
stackId = await resolveStackIdByNameOrId(stackOverride, auth, log);
|
|
308
308
|
}
|
|
309
309
|
if (!stackId) {
|
|
310
|
-
this.error(
|
|
310
|
+
this.error(`Missing Stack: provide --stack, or set a Stack in your Blueprint config (\`${this.config.bin} blueprints config --edit\`).`, {
|
|
311
311
|
suggestions: [
|
|
312
312
|
`Run \`${this.config.bin} blueprints doctor\` to check your configuration.`,
|
|
313
313
|
],
|
|
@@ -12,10 +12,10 @@ export async function blueprintConfigCore(options) {
|
|
|
12
12
|
const hasConfigFile = !!blueprintConfig;
|
|
13
13
|
if (!configStackId && !configScopeType && !configScopeId) {
|
|
14
14
|
if (hasConfigFile) {
|
|
15
|
-
log(warn('
|
|
15
|
+
log(warn('Blueprint config (.sanity/blueprint.config.json) is incomplete.'));
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
18
|
-
log('No
|
|
18
|
+
log('No Blueprint config found at .sanity/blueprint.config.json.');
|
|
19
19
|
}
|
|
20
20
|
if (!editConfig) {
|
|
21
21
|
log(`Run \`npx ${bin} blueprints doctor\` for diagnostics.`);
|
|
@@ -26,7 +26,7 @@ export async function blueprintConfigCore(options) {
|
|
|
26
26
|
printConfig({ configLabel: 'Current', log, config: blueprintConfig });
|
|
27
27
|
// passing new config without --edit flag is not allowed
|
|
28
28
|
if (providedConfigFlag && !editConfig) {
|
|
29
|
-
log('To update the
|
|
29
|
+
log('To update the Blueprint config, use the --edit flag.');
|
|
30
30
|
return { success: true, json: blueprintConfig ? { config: blueprintConfig } : undefined };
|
|
31
31
|
}
|
|
32
32
|
if (!editConfig) {
|
|
@@ -70,7 +70,10 @@ export async function blueprintConfigCore(options) {
|
|
|
70
70
|
return { success: true, json: { config: newConfig } };
|
|
71
71
|
}
|
|
72
72
|
catch {
|
|
73
|
-
return {
|
|
73
|
+
return {
|
|
74
|
+
success: false,
|
|
75
|
+
error: 'Could not update Blueprint config (.sanity/blueprint.config.json).',
|
|
76
|
+
};
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
}
|
|
@@ -107,7 +110,10 @@ export async function blueprintConfigCore(options) {
|
|
|
107
110
|
return { success: true, json: { config: newConfig } };
|
|
108
111
|
}
|
|
109
112
|
catch {
|
|
110
|
-
return {
|
|
113
|
+
return {
|
|
114
|
+
success: false,
|
|
115
|
+
error: 'Could not update Blueprint config (.sanity/blueprint.config.json).',
|
|
116
|
+
};
|
|
111
117
|
}
|
|
112
118
|
}
|
|
113
119
|
}
|
|
@@ -15,7 +15,7 @@ import { blueprintConfigCore } from './config.js';
|
|
|
15
15
|
const diagLookup = {
|
|
16
16
|
online: 'Host online',
|
|
17
17
|
tokenValid: 'Authenticated',
|
|
18
|
-
blueprintValid: '
|
|
18
|
+
blueprintValid: 'Manifest valid',
|
|
19
19
|
stackReady: 'Stack ready',
|
|
20
20
|
userHasAccess: 'User has access',
|
|
21
21
|
};
|
|
@@ -24,9 +24,9 @@ function sourceLabel(source) {
|
|
|
24
24
|
case 'env':
|
|
25
25
|
return 'environment';
|
|
26
26
|
case 'module':
|
|
27
|
-
return '
|
|
27
|
+
return 'manifest module';
|
|
28
28
|
case 'config':
|
|
29
|
-
return 'config
|
|
29
|
+
return '.sanity/blueprint.config.json';
|
|
30
30
|
case 'inferred':
|
|
31
31
|
return 'inferred';
|
|
32
32
|
default:
|
|
@@ -91,7 +91,7 @@ export async function blueprintDoctorCore(options) {
|
|
|
91
91
|
blueprintConfig,
|
|
92
92
|
...resolved,
|
|
93
93
|
};
|
|
94
|
-
envRows.push(['
|
|
94
|
+
envRows.push(['Manifest', filePathRelativeToCwd(blueprint.fileInfo.blueprintFilePath)]);
|
|
95
95
|
if (blueprint.errors.length === 0) {
|
|
96
96
|
diagnostics.blueprintValid = { status: true };
|
|
97
97
|
}
|
|
@@ -129,7 +129,7 @@ export async function blueprintDoctorCore(options) {
|
|
|
129
129
|
configRows.push(['Source', filePathRelativeToCwd(blueprintConfig.configPath)]);
|
|
130
130
|
}
|
|
131
131
|
else if (!blueprintConfig) {
|
|
132
|
-
configRows.push(['Source', styleText('dim', 'no config
|
|
132
|
+
configRows.push(['Source', styleText('dim', 'no .sanity/blueprint.config.json')]);
|
|
133
133
|
}
|
|
134
134
|
if (blueprintConfig?.updatedAt) {
|
|
135
135
|
configRows.push(['Updated', new Date(blueprintConfig.updatedAt).toLocaleString('sv-SE')]);
|
|
@@ -315,8 +315,8 @@ export async function blueprintDoctorCore(options) {
|
|
|
315
315
|
if (!localBlueprint) {
|
|
316
316
|
return {
|
|
317
317
|
success: false,
|
|
318
|
-
error: `${errorMessage}. Unable to fix: Blueprint is missing or invalid`,
|
|
319
|
-
suggestions: [`Run \`npx ${bin} blueprints init\` to create a new Blueprint.`],
|
|
318
|
+
error: `${errorMessage}. Unable to fix: Blueprint manifest is missing or invalid`,
|
|
319
|
+
suggestions: [`Run \`npx ${bin} blueprints init\` to create a new Blueprint manifest.`],
|
|
320
320
|
data: { diagnostics: flatDiagnostics },
|
|
321
321
|
};
|
|
322
322
|
}
|
|
@@ -38,14 +38,14 @@ export async function blueprintPromoteCore(options) {
|
|
|
38
38
|
organizationId: stack.scopeId,
|
|
39
39
|
projectId: null,
|
|
40
40
|
});
|
|
41
|
-
log('Blueprint
|
|
41
|
+
log('Blueprint config updated (.sanity/blueprint.config.json)');
|
|
42
42
|
}
|
|
43
43
|
catch {
|
|
44
44
|
return {
|
|
45
45
|
success: false,
|
|
46
|
-
error: 'Stack promoted
|
|
46
|
+
error: 'Stack promoted, but could not update Blueprint config (.sanity/blueprint.config.json).',
|
|
47
47
|
suggestions: [
|
|
48
|
-
`Run \`npx ${bin} blueprints config --edit\` to update your
|
|
48
|
+
`Run \`npx ${bin} blueprints config --edit\` to update your Blueprint config manually.`,
|
|
49
49
|
],
|
|
50
50
|
};
|
|
51
51
|
}
|
|
@@ -8,7 +8,7 @@ import buildPayload from '../../utils/build-payload.js';
|
|
|
8
8
|
import { findFunctionInResources, getFunctionNames } from '../../utils/find-function.js';
|
|
9
9
|
import { fetchAsset, fetchDocument } from '../../utils/functions/fetch-document.js';
|
|
10
10
|
import { parseJsonObject } from '../../utils/parse-json-object.js';
|
|
11
|
-
import { isEventType,
|
|
11
|
+
import { isEventType, } from '../../utils/types.js';
|
|
12
12
|
export async function functionTestCore(options) {
|
|
13
13
|
const { blueprint, log, error, args, flags, helpText } = options;
|
|
14
14
|
const { name: fnName } = args;
|
|
@@ -53,9 +53,9 @@ export async function functionTestCore(options) {
|
|
|
53
53
|
functionResourceType: 'project',
|
|
54
54
|
functionResourceId: projectId || '',
|
|
55
55
|
}
|
|
56
|
-
: {};
|
|
56
|
+
: { clientOptions: {} };
|
|
57
57
|
// If the user sets the flag to use the real token set it in our options
|
|
58
|
-
if (withUserToken
|
|
58
|
+
if (withUserToken) {
|
|
59
59
|
contextOptions.clientOptions.token = config.token || undefined;
|
|
60
60
|
}
|
|
61
61
|
let before = null;
|
package/dist/cores/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export async function initBlueprintConfig({ bin, log, token, validateResources =
|
|
|
19
19
|
const blueprint = await readLocalBlueprint(log, { resources: validateResources }, blueprintPath);
|
|
20
20
|
if (blueprint.errors.length > 0) {
|
|
21
21
|
log(presentBlueprintParserErrors(blueprint.errors));
|
|
22
|
-
return { ok: false, error: 'Blueprint
|
|
22
|
+
return { ok: false, error: 'Blueprint manifest contains errors.' };
|
|
23
23
|
}
|
|
24
24
|
return {
|
|
25
25
|
ok: true,
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -124,7 +124,12 @@ export interface InvokeGroqContextOptions {
|
|
|
124
124
|
/** The resource ID of the function container; resource ID that houses the function. */
|
|
125
125
|
functionResourceId: string;
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
/** @internal */
|
|
128
|
+
export interface InvokeScheduleContextOptions {
|
|
129
|
+
clientOptions: {
|
|
130
|
+
token?: string;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
128
133
|
export type InvokeContextOptions = InvokeGroqContextOptions | InvokeScheduleContextOptions;
|
|
129
134
|
export declare function isGroqContextOptions(context: InvokeContextOptions): context is InvokeGroqContextOptions;
|
|
130
135
|
/** @internal */
|
package/oclif.manifest.json
CHANGED