@webstudio-is/sdk 0.144.1-89bca38.0 → 0.145.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.
|
@@ -9,8 +9,8 @@ export type Diagnostic = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const lintExpression: ({ expression, availableVariables, allowAssignment, }: {
|
|
11
11
|
expression: string;
|
|
12
|
-
availableVariables?: Set<
|
|
13
|
-
allowAssignment?: boolean
|
|
12
|
+
availableVariables?: Set<Identifier["name"]>;
|
|
13
|
+
allowAssignment?: boolean;
|
|
14
14
|
}) => Diagnostic[];
|
|
15
15
|
/**
|
|
16
16
|
* check whether provided expression is a literal value
|
|
@@ -29,79 +29,15 @@ export declare const getExpressionIdentifiers: (expression: string) => Set<strin
|
|
|
29
29
|
*/
|
|
30
30
|
export declare const transpileExpression: ({ expression, executable, replaceVariable, }: {
|
|
31
31
|
expression: string;
|
|
32
|
-
executable?: boolean
|
|
33
|
-
replaceVariable?: (
|
|
32
|
+
executable?: boolean;
|
|
33
|
+
replaceVariable?: (identifier: string, assignee: boolean) => string | undefined | void;
|
|
34
34
|
}) => string;
|
|
35
35
|
export declare const encodeDataSourceVariable: (id: string) => string;
|
|
36
36
|
export declare const decodeDataSourceVariable: (name: string) => string | undefined;
|
|
37
37
|
export declare const generateExpression: ({ expression, dataSources, usedDataSources, scope, }: {
|
|
38
38
|
expression: string;
|
|
39
|
-
dataSources:
|
|
40
|
-
|
|
41
|
-
value: number;
|
|
42
|
-
type: "number";
|
|
43
|
-
} | {
|
|
44
|
-
value: string;
|
|
45
|
-
type: "string";
|
|
46
|
-
} | {
|
|
47
|
-
value: boolean;
|
|
48
|
-
type: "boolean";
|
|
49
|
-
} | {
|
|
50
|
-
value: string[];
|
|
51
|
-
type: "string[]";
|
|
52
|
-
} | {
|
|
53
|
-
type: "json";
|
|
54
|
-
value?: unknown;
|
|
55
|
-
};
|
|
56
|
-
type: "variable";
|
|
57
|
-
id: string;
|
|
58
|
-
name: string;
|
|
59
|
-
scopeInstanceId?: string | undefined;
|
|
60
|
-
} | {
|
|
61
|
-
type: "parameter";
|
|
62
|
-
id: string;
|
|
63
|
-
name: string;
|
|
64
|
-
scopeInstanceId?: string | undefined;
|
|
65
|
-
} | {
|
|
66
|
-
type: "resource";
|
|
67
|
-
id: string;
|
|
68
|
-
name: string;
|
|
69
|
-
resourceId: string;
|
|
70
|
-
scopeInstanceId?: string | undefined;
|
|
71
|
-
}>;
|
|
72
|
-
usedDataSources: Map<string, {
|
|
73
|
-
value: {
|
|
74
|
-
value: number;
|
|
75
|
-
type: "number";
|
|
76
|
-
} | {
|
|
77
|
-
value: string;
|
|
78
|
-
type: "string";
|
|
79
|
-
} | {
|
|
80
|
-
value: boolean;
|
|
81
|
-
type: "boolean";
|
|
82
|
-
} | {
|
|
83
|
-
value: string[];
|
|
84
|
-
type: "string[]";
|
|
85
|
-
} | {
|
|
86
|
-
type: "json";
|
|
87
|
-
value?: unknown;
|
|
88
|
-
};
|
|
89
|
-
type: "variable";
|
|
90
|
-
id: string;
|
|
91
|
-
name: string;
|
|
92
|
-
scopeInstanceId?: string | undefined;
|
|
93
|
-
} | {
|
|
94
|
-
type: "parameter";
|
|
95
|
-
id: string;
|
|
96
|
-
name: string;
|
|
97
|
-
scopeInstanceId?: string | undefined;
|
|
98
|
-
} | {
|
|
99
|
-
type: "resource";
|
|
100
|
-
id: string;
|
|
101
|
-
name: string;
|
|
102
|
-
resourceId: string;
|
|
103
|
-
scopeInstanceId?: string | undefined;
|
|
104
|
-
}>;
|
|
39
|
+
dataSources: DataSources;
|
|
40
|
+
usedDataSources: DataSources;
|
|
105
41
|
scope: Scope;
|
|
106
42
|
}) => string;
|
|
107
43
|
export declare const executeExpression: (expression: undefined | string) => any;
|
|
@@ -19,37 +19,5 @@ export type PageMeta = {
|
|
|
19
19
|
export declare const generatePageMeta: ({ globalScope, page, dataSources, }: {
|
|
20
20
|
globalScope: Scope;
|
|
21
21
|
page: Page;
|
|
22
|
-
dataSources:
|
|
23
|
-
value: {
|
|
24
|
-
value: number;
|
|
25
|
-
type: "number";
|
|
26
|
-
} | {
|
|
27
|
-
value: string;
|
|
28
|
-
type: "string";
|
|
29
|
-
} | {
|
|
30
|
-
value: boolean;
|
|
31
|
-
type: "boolean";
|
|
32
|
-
} | {
|
|
33
|
-
value: string[];
|
|
34
|
-
type: "string[]";
|
|
35
|
-
} | {
|
|
36
|
-
type: "json";
|
|
37
|
-
value?: unknown;
|
|
38
|
-
};
|
|
39
|
-
type: "variable";
|
|
40
|
-
id: string;
|
|
41
|
-
name: string;
|
|
42
|
-
scopeInstanceId?: string | undefined;
|
|
43
|
-
} | {
|
|
44
|
-
type: "parameter";
|
|
45
|
-
id: string;
|
|
46
|
-
name: string;
|
|
47
|
-
scopeInstanceId?: string | undefined;
|
|
48
|
-
} | {
|
|
49
|
-
type: "resource";
|
|
50
|
-
id: string;
|
|
51
|
-
name: string;
|
|
52
|
-
resourceId: string;
|
|
53
|
-
scopeInstanceId?: string | undefined;
|
|
54
|
-
}>;
|
|
22
|
+
dataSources: DataSources;
|
|
55
23
|
}) => string;
|
|
@@ -5,48 +5,6 @@ import type { Scope } from "./scope";
|
|
|
5
5
|
export declare const generateResourcesLoader: ({ scope, page, dataSources, resources, }: {
|
|
6
6
|
scope: Scope;
|
|
7
7
|
page: Page;
|
|
8
|
-
dataSources:
|
|
9
|
-
|
|
10
|
-
value: number;
|
|
11
|
-
type: "number";
|
|
12
|
-
} | {
|
|
13
|
-
value: string;
|
|
14
|
-
type: "string";
|
|
15
|
-
} | {
|
|
16
|
-
value: boolean;
|
|
17
|
-
type: "boolean";
|
|
18
|
-
} | {
|
|
19
|
-
value: string[];
|
|
20
|
-
type: "string[]";
|
|
21
|
-
} | {
|
|
22
|
-
type: "json";
|
|
23
|
-
value?: unknown;
|
|
24
|
-
};
|
|
25
|
-
type: "variable";
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
scopeInstanceId?: string | undefined;
|
|
29
|
-
} | {
|
|
30
|
-
type: "parameter";
|
|
31
|
-
id: string;
|
|
32
|
-
name: string;
|
|
33
|
-
scopeInstanceId?: string | undefined;
|
|
34
|
-
} | {
|
|
35
|
-
type: "resource";
|
|
36
|
-
id: string;
|
|
37
|
-
name: string;
|
|
38
|
-
resourceId: string;
|
|
39
|
-
scopeInstanceId?: string | undefined;
|
|
40
|
-
}>;
|
|
41
|
-
resources: Map<string, {
|
|
42
|
-
id: string;
|
|
43
|
-
name: string;
|
|
44
|
-
method: "post" | "get" | "put" | "delete";
|
|
45
|
-
url: string;
|
|
46
|
-
headers: {
|
|
47
|
-
value: string;
|
|
48
|
-
name: string;
|
|
49
|
-
}[];
|
|
50
|
-
body?: string | undefined;
|
|
51
|
-
}>;
|
|
8
|
+
dataSources: DataSources;
|
|
9
|
+
resources: Resources;
|
|
52
10
|
}) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.145.0",
|
|
4
4
|
"description": "Webstudio project data schema",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"acorn-walk": "^8.3.2",
|
|
23
23
|
"type-fest": "^4.3.1",
|
|
24
24
|
"zod": "^3.22.4",
|
|
25
|
-
"@webstudio-is/
|
|
26
|
-
"@webstudio-is/
|
|
25
|
+
"@webstudio-is/css-engine": "0.145.0",
|
|
26
|
+
"@webstudio-is/fonts": "0.145.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@jest/globals": "^29.7.0",
|
|
30
30
|
"strip-indent": "^4.0.0",
|
|
31
|
-
"@webstudio-is/jest-config": "1.0.
|
|
32
|
-
"@webstudio-is/tsconfig": "1.0.
|
|
31
|
+
"@webstudio-is/jest-config": "1.0.7",
|
|
32
|
+
"@webstudio-is/tsconfig": "1.0.7"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"typecheck": "tsc",
|