@sanity/runtime-cli 14.13.1 → 14.13.3
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
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.3 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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/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.3/src/commands/functions/test.ts)_
|
|
718
718
|
|
|
719
719
|
## `sanity-run help [COMMAND]`
|
|
720
720
|
|
|
@@ -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;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
1
|
import { mkdir, readFile, rm, stat, writeFile } from 'node:fs/promises';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import { performance } from 'node:perf_hooks';
|
|
@@ -37,7 +36,7 @@ export async function transpileFunction(resource, { installer } = {}) {
|
|
|
37
36
|
try {
|
|
38
37
|
const viteStart = performance.now();
|
|
39
38
|
// Always bundle the code if pnpm usage is detected or specified by the user
|
|
40
|
-
const bundle =
|
|
39
|
+
const bundle = !!find.file('pnpm-workspace.yaml') || installer === 'pnpm';
|
|
41
40
|
const result = await viteBuild({
|
|
42
41
|
root: fnRootDir,
|
|
43
42
|
logLevel: 'silent',
|
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