@sanity/runtime-cli 1.3.1 → 1.4.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 +11 -14
- package/dist/actions/blueprints/logs.d.ts +1 -0
- package/dist/actions/blueprints/logs.js +3 -2
- package/dist/actions/blueprints/operations.d.ts +1 -0
- package/dist/actions/blueprints/operations.js +3 -2
- package/dist/actions/blueprints/read-blueprint.d.ts +16 -7
- package/dist/actions/blueprints/read-blueprint.js +56 -10
- package/dist/actions/blueprints/stacks.d.ts +6 -6
- package/dist/actions/blueprints/stacks.js +10 -14
- package/dist/actions/blueprints/stash-asset.d.ts +1 -0
- package/dist/actions/blueprints/stash-asset.js +2 -5
- package/dist/actions/functions/invoke.d.ts +6 -2
- package/dist/actions/functions/invoke.js +9 -11
- package/dist/actions/functions/logs.d.ts +6 -1
- package/dist/actions/functions/logs.js +10 -10
- package/dist/commands/blueprints/deploy.js +19 -18
- package/dist/commands/blueprints/info.js +18 -38
- package/dist/commands/blueprints/logs.d.ts +0 -1
- package/dist/commands/blueprints/logs.js +12 -41
- package/dist/commands/blueprints/plan.js +14 -4
- package/dist/commands/functions/invoke.js +19 -2
- package/dist/commands/functions/logs.js +26 -2
- package/dist/config.js +6 -5
- package/dist/server/static/api.d.ts +10 -0
- package/dist/server/static/api.js +38 -43
- package/dist/server/static/components/api-base.d.ts +9 -0
- package/dist/server/static/components/api-base.js +6 -7
- package/dist/server/static/components/function-list.d.ts +1 -0
- package/dist/server/static/components/function-list.js +44 -48
- package/dist/server/static/components/network-spinner.d.ts +1 -0
- package/dist/server/static/components/network-spinner.js +6 -7
- package/dist/server/static/components/payload-panel.d.ts +1 -0
- package/dist/server/static/components/payload-panel.js +32 -36
- package/dist/server/static/components/response-panel.d.ts +1 -0
- package/dist/server/static/components/response-panel.js +50 -64
- package/dist/server/static/static/api.js +53 -0
- package/dist/server/static/static/components/api-base.js +10 -0
- package/dist/server/static/static/components/function-list.js +54 -0
- package/dist/server/static/static/components/network-spinner.js +71 -0
- package/dist/server/static/static/components/payload-panel.js +45 -0
- package/dist/server/static/static/components/response-panel.js +83 -0
- package/dist/server/static/static/vendor/vendor.bundle.js +26879 -0
- package/dist/server/static/vendor/vendor.bundle.d.ts +1815 -0
- package/dist/server/static/vendor/vendor.bundle.js +913 -1029
- package/dist/utils/child-process-wrapper.d.ts +1 -0
- package/dist/utils/display/blueprints-formatting.js +2 -2
- package/dist/utils/get-headers.d.ts +8 -0
- package/dist/utils/get-headers.js +9 -0
- package/dist/utils/get-token.d.ts +3 -1
- package/dist/utils/get-token.js +2 -2
- package/dist/utils/types.d.ts +44 -30
- package/dist/utils/types.js +8 -1
- package/dist/utils/vendor/parser-validator.d.ts +8 -0
- package/dist/utils/vendor/parser-validator.js +514 -0
- package/oclif.manifest.json +1 -11
- package/package.json +10 -11
- /package/dist/server/static/{components → static/components}/app.css +0 -0
- /package/dist/server/static/{index.html → static/index.html} +0 -0
- /package/dist/server/static/{sanity-logo-sm.svg → static/sanity-logo-sm.svg} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,8 +18,8 @@ export function formatResourceTree(resources, logger) {
|
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
logger(`${blue('Stack Resources')} [${resources.length}]`);
|
|
21
|
-
const functionResources = resources.filter((r) => r.
|
|
22
|
-
const otherResources = resources.filter((r) => r.
|
|
21
|
+
const functionResources = resources.filter((r) => r.type.startsWith('sanity.function.'));
|
|
22
|
+
const otherResources = resources.filter((r) => !r.type.startsWith('sanity.function.'));
|
|
23
23
|
const hasOtherResources = otherResources.length > 0;
|
|
24
24
|
if (functionResources.length > 0) {
|
|
25
25
|
logger(` ${hasOtherResources ? '├─' : '└─'} ${bold('Functions')} [${functionResources.length}]`);
|
package/dist/utils/get-token.js
CHANGED
|
@@ -2,8 +2,8 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import { tmpdir, userInfo } from 'node:os';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { xdgConfig } from 'xdg-basedir';
|
|
5
|
-
export default function getToken(
|
|
6
|
-
const environmentDir =
|
|
5
|
+
export default function getToken({ prod = true }) {
|
|
6
|
+
const environmentDir = prod ? 'sanity' : 'sanity-staging';
|
|
7
7
|
const user = (userInfo().username || 'user').replace(/\\/g, '');
|
|
8
8
|
const configDir = xdgConfig || join(tmpdir(), user, '.config');
|
|
9
9
|
const configPath = join(configDir, environmentDir, 'config.json');
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,63 +1,48 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
1
|
+
/** @internal */
|
|
4
2
|
export interface PayloadOptions {
|
|
5
3
|
data: string | undefined;
|
|
6
4
|
file: string | undefined;
|
|
7
5
|
timeout?: number | undefined;
|
|
8
6
|
}
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
7
|
+
/** @internal */
|
|
12
8
|
export interface InvocationResponse {
|
|
13
9
|
error: undefined | unknown;
|
|
14
10
|
json: object | undefined;
|
|
15
11
|
logs: string | undefined;
|
|
16
12
|
}
|
|
17
13
|
type LogFunction = (input: string) => void;
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
14
|
+
/** @internal */
|
|
21
15
|
export interface BlueprintsContext {
|
|
22
16
|
log: LogFunction;
|
|
23
17
|
}
|
|
24
|
-
/**
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
18
|
+
/** @internal */
|
|
27
19
|
export interface Blueprint {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
blueprintVersion: string;
|
|
21
|
+
values: Record<string, unknown>;
|
|
22
|
+
outputs: Array<Record<string, unknown>>;
|
|
31
23
|
resources: Array<BlueprintResource>;
|
|
32
24
|
}
|
|
33
|
-
/**
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
25
|
+
/** @internal */
|
|
36
26
|
export interface BlueprintDocument {
|
|
37
27
|
resources: Array<BlueprintResource>;
|
|
38
28
|
}
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
29
|
+
/** @internal */
|
|
42
30
|
export interface BlueprintJob {
|
|
43
31
|
name: string;
|
|
44
32
|
projectId: string;
|
|
45
33
|
document: BlueprintDocument;
|
|
46
34
|
}
|
|
47
|
-
/**
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
35
|
+
/** @internal */
|
|
50
36
|
export interface BlueprintResource {
|
|
51
37
|
id: string;
|
|
52
38
|
displayName: string;
|
|
53
39
|
name: string;
|
|
54
40
|
kind: string;
|
|
41
|
+
type: string;
|
|
55
42
|
src: string;
|
|
56
43
|
externalId: string;
|
|
57
44
|
}
|
|
58
|
-
/**
|
|
59
|
-
* @internal
|
|
60
|
-
*/
|
|
45
|
+
/** @internal */
|
|
61
46
|
export interface BlueprintOperation {
|
|
62
47
|
id: string;
|
|
63
48
|
status: string;
|
|
@@ -68,16 +53,45 @@ export interface BlueprintStack {
|
|
|
68
53
|
id: string;
|
|
69
54
|
name: string;
|
|
70
55
|
displayName: string;
|
|
56
|
+
projectId: string;
|
|
71
57
|
resources: Array<BlueprintResource>;
|
|
72
58
|
createdAt?: string;
|
|
73
59
|
updatedAt?: string;
|
|
74
60
|
recentOperation?: BlueprintOperation;
|
|
75
61
|
}
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
/** @internal */
|
|
63
|
+
export declare enum BlueprintErrorType {
|
|
64
|
+
MissingProject = "missing_project",
|
|
65
|
+
MissingStack = "missing_stack",
|
|
66
|
+
InvalidProperty = "invalid_property",
|
|
67
|
+
InvalidStack = "invalid_stack"
|
|
68
|
+
}
|
|
69
|
+
/** @internal */
|
|
70
|
+
export interface BlueprintError {
|
|
71
|
+
message: string;
|
|
72
|
+
type: BlueprintErrorType;
|
|
73
|
+
}
|
|
74
|
+
/** @internal */
|
|
79
75
|
export interface BlueprintLog {
|
|
80
76
|
timestamp: string;
|
|
81
77
|
message: string;
|
|
82
78
|
}
|
|
79
|
+
/** @internal */
|
|
80
|
+
export interface AuthParams {
|
|
81
|
+
token: string;
|
|
82
|
+
projectId: string;
|
|
83
|
+
}
|
|
84
|
+
/** @internal */
|
|
85
|
+
export interface FunctionLog {
|
|
86
|
+
eventId: string;
|
|
87
|
+
ingestionTime: string;
|
|
88
|
+
timestamp: string;
|
|
89
|
+
message: string;
|
|
90
|
+
}
|
|
91
|
+
/** @internal */
|
|
92
|
+
export interface FunctionLogGroup {
|
|
93
|
+
events: Array<FunctionLog>;
|
|
94
|
+
nextBackwardToken: string;
|
|
95
|
+
nextForwardToken: string;
|
|
96
|
+
}
|
|
83
97
|
export {};
|
package/dist/utils/types.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/** @internal */
|
|
2
|
+
export var BlueprintErrorType;
|
|
3
|
+
(function (BlueprintErrorType) {
|
|
4
|
+
BlueprintErrorType["MissingProject"] = "missing_project";
|
|
5
|
+
BlueprintErrorType["MissingStack"] = "missing_stack";
|
|
6
|
+
BlueprintErrorType["InvalidProperty"] = "invalid_property";
|
|
7
|
+
BlueprintErrorType["InvalidStack"] = "invalid_stack";
|
|
8
|
+
})(BlueprintErrorType || (BlueprintErrorType = {}));
|