@sanity/runtime-cli 6.0.0 → 6.1.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
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/6.
|
|
23
|
+
@sanity/runtime-cli/6.1.1 linux-x64 node-v22.15.0
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -77,7 +77,7 @@ EXAMPLES
|
|
|
77
77
|
$ sanity-run blueprints add function --name my-function --fn-type document-publish --lang js
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
80
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/blueprints/add.ts)_
|
|
81
81
|
|
|
82
82
|
## `sanity-run blueprints config`
|
|
83
83
|
|
|
@@ -105,7 +105,7 @@ EXAMPLES
|
|
|
105
105
|
$ sanity-run blueprints config --edit --project-id <projectId>
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
108
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/blueprints/config.ts)_
|
|
109
109
|
|
|
110
110
|
## `sanity-run blueprints deploy`
|
|
111
111
|
|
|
@@ -127,7 +127,7 @@ EXAMPLES
|
|
|
127
127
|
$ sanity-run blueprints deploy --no-wait
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
130
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/blueprints/deploy.ts)_
|
|
131
131
|
|
|
132
132
|
## `sanity-run blueprints destroy`
|
|
133
133
|
|
|
@@ -148,7 +148,7 @@ EXAMPLES
|
|
|
148
148
|
$ sanity-run blueprints destroy
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
151
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/blueprints/destroy.ts)_
|
|
152
152
|
|
|
153
153
|
## `sanity-run blueprints info`
|
|
154
154
|
|
|
@@ -165,7 +165,7 @@ EXAMPLES
|
|
|
165
165
|
$ sanity-run blueprints info
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
168
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/blueprints/info.ts)_
|
|
169
169
|
|
|
170
170
|
## `sanity-run blueprints init [DIR]`
|
|
171
171
|
|
|
@@ -197,7 +197,7 @@ EXAMPLES
|
|
|
197
197
|
$ sanity-run blueprints init --blueprint-type <json|js|ts> --project-id <projectId>
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
200
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/blueprints/init.ts)_
|
|
201
201
|
|
|
202
202
|
## `sanity-run blueprints logs`
|
|
203
203
|
|
|
@@ -219,7 +219,7 @@ EXAMPLES
|
|
|
219
219
|
$ sanity-run blueprints logs --watch
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
222
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/blueprints/logs.ts)_
|
|
223
223
|
|
|
224
224
|
## `sanity-run blueprints plan`
|
|
225
225
|
|
|
@@ -236,7 +236,7 @@ EXAMPLES
|
|
|
236
236
|
$ sanity-run blueprints plan
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
239
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/blueprints/plan.ts)_
|
|
240
240
|
|
|
241
241
|
## `sanity-run functions dev`
|
|
242
242
|
|
|
@@ -256,7 +256,7 @@ EXAMPLES
|
|
|
256
256
|
$ sanity-run functions dev --port 8974
|
|
257
257
|
```
|
|
258
258
|
|
|
259
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
259
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/functions/dev.ts)_
|
|
260
260
|
|
|
261
261
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
262
262
|
|
|
@@ -278,7 +278,7 @@ EXAMPLES
|
|
|
278
278
|
$ sanity-run functions env add MyFunction API_URL https://api.example.com/
|
|
279
279
|
```
|
|
280
280
|
|
|
281
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
281
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/functions/env/add.ts)_
|
|
282
282
|
|
|
283
283
|
## `sanity-run functions env list NAME`
|
|
284
284
|
|
|
@@ -298,7 +298,7 @@ EXAMPLES
|
|
|
298
298
|
$ sanity-run functions env list MyFunction
|
|
299
299
|
```
|
|
300
300
|
|
|
301
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
301
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/functions/env/list.ts)_
|
|
302
302
|
|
|
303
303
|
## `sanity-run functions env remove NAME KEY`
|
|
304
304
|
|
|
@@ -319,7 +319,7 @@ EXAMPLES
|
|
|
319
319
|
$ sanity-run functions env remove MyFunction API_URL
|
|
320
320
|
```
|
|
321
321
|
|
|
322
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
322
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/functions/env/remove.ts)_
|
|
323
323
|
|
|
324
324
|
## `sanity-run functions logs NAME`
|
|
325
325
|
|
|
@@ -327,7 +327,7 @@ Retrieve or delete logs for a Sanity Function
|
|
|
327
327
|
|
|
328
328
|
```
|
|
329
329
|
USAGE
|
|
330
|
-
$ sanity-run functions logs NAME [-f [-d | -l <value> | -j]]
|
|
330
|
+
$ sanity-run functions logs NAME [-u] [-f [-d | -l <value> | -j]]
|
|
331
331
|
|
|
332
332
|
ARGUMENTS
|
|
333
333
|
NAME The name of the Sanity Function
|
|
@@ -337,6 +337,7 @@ FLAGS
|
|
|
337
337
|
-f, --force Skip confirmation for deleting logs
|
|
338
338
|
-j, --json Return logs in JSON format
|
|
339
339
|
-l, --limit=<value> [default: 50] Total number of log entries to retrieve
|
|
340
|
+
-u, --utc Show dates in UTC time zone
|
|
340
341
|
|
|
341
342
|
DESCRIPTION
|
|
342
343
|
Retrieve or delete logs for a Sanity Function
|
|
@@ -351,7 +352,7 @@ EXAMPLES
|
|
|
351
352
|
$ sanity-run functions logs <name> --delete
|
|
352
353
|
```
|
|
353
354
|
|
|
354
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
355
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/functions/logs.ts)_
|
|
355
356
|
|
|
356
357
|
## `sanity-run functions test NAME`
|
|
357
358
|
|
|
@@ -384,7 +385,7 @@ EXAMPLES
|
|
|
384
385
|
$ sanity-run functions test <name> --data '{ "id": 1 }' --timeout 60
|
|
385
386
|
```
|
|
386
387
|
|
|
387
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v6.
|
|
388
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v6.1.1/src/commands/functions/test.ts)_
|
|
388
389
|
|
|
389
390
|
## `sanity-run help [COMMAND]`
|
|
390
391
|
|
|
@@ -5,6 +5,7 @@ type RunDeleteOptions = {
|
|
|
5
5
|
type RunGetOptions = {
|
|
6
6
|
limit: number;
|
|
7
7
|
json?: boolean;
|
|
8
|
+
utc?: boolean;
|
|
8
9
|
};
|
|
9
10
|
export default class LogsCommand extends DeployedBlueprintCommand<typeof LogsCommand> {
|
|
10
11
|
static args: {
|
|
@@ -15,6 +16,7 @@ export default class LogsCommand extends DeployedBlueprintCommand<typeof LogsCom
|
|
|
15
16
|
static flags: {
|
|
16
17
|
limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
utc: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
20
|
delete: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
21
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
22
|
};
|
|
@@ -38,6 +38,11 @@ export default class LogsCommand extends DeployedBlueprintCommand {
|
|
|
38
38
|
description: 'Return logs in JSON format',
|
|
39
39
|
required: false,
|
|
40
40
|
}),
|
|
41
|
+
utc: Flags.boolean({
|
|
42
|
+
char: 'u',
|
|
43
|
+
description: 'Show dates in UTC time zone',
|
|
44
|
+
required: false,
|
|
45
|
+
}),
|
|
41
46
|
delete: Flags.boolean({
|
|
42
47
|
char: 'd',
|
|
43
48
|
exclusive: ['limit', 'json'],
|
|
@@ -111,12 +116,10 @@ export default class LogsCommand extends DeployedBlueprintCommand {
|
|
|
111
116
|
for (const log of filteredLogs) {
|
|
112
117
|
const { time, level, message } = log;
|
|
113
118
|
const date = new Date(time);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
message,
|
|
119
|
-
].join(' '));
|
|
119
|
+
const [dateString, timeString] = options.utc
|
|
120
|
+
? date.toISOString().slice(0, 19).split('T')
|
|
121
|
+
: [date.toLocaleDateString(), date.toLocaleTimeString()];
|
|
122
|
+
this.log([bold(dateString), bold(blue(timeString)), logLevel(level), message].join(' '));
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
125
|
else {
|
|
@@ -49,11 +49,10 @@ export function validateFunctionResource(resource) {
|
|
|
49
49
|
message: `${msgPrefix} memory must be an integer`,
|
|
50
50
|
type: BlueprintParserErrorType.InvalidType,
|
|
51
51
|
});
|
|
52
|
-
// } else if (resource.memory < 1 || resource.memory > 10) {
|
|
53
52
|
}
|
|
54
|
-
else if (resource.memory <
|
|
53
|
+
else if (resource.memory < 1 || resource.memory > 10) {
|
|
55
54
|
errors.push({
|
|
56
|
-
message: `${msgPrefix} memory must be between
|
|
55
|
+
message: `${msgPrefix} memory must be between 1 and 10 (GB)`,
|
|
57
56
|
type: BlueprintParserErrorType.InvalidValue,
|
|
58
57
|
});
|
|
59
58
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -549,6 +549,14 @@
|
|
|
549
549
|
"allowNo": false,
|
|
550
550
|
"type": "boolean"
|
|
551
551
|
},
|
|
552
|
+
"utc": {
|
|
553
|
+
"char": "u",
|
|
554
|
+
"description": "Show dates in UTC time zone",
|
|
555
|
+
"name": "utc",
|
|
556
|
+
"required": false,
|
|
557
|
+
"allowNo": false,
|
|
558
|
+
"type": "boolean"
|
|
559
|
+
},
|
|
552
560
|
"delete": {
|
|
553
561
|
"char": "d",
|
|
554
562
|
"description": "Delete all logs for the function",
|
|
@@ -782,5 +790,5 @@
|
|
|
782
790
|
]
|
|
783
791
|
}
|
|
784
792
|
},
|
|
785
|
-
"version": "6.
|
|
793
|
+
"version": "6.1.1"
|
|
786
794
|
}
|