cloesce 0.0.5-unstable.2 → 0.0.5-unstable.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/dist/ast.d.ts +100 -80
- package/dist/ast.js +12 -12
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +368 -331
- package/dist/extractor/err.d.ts +26 -26
- package/dist/extractor/err.js +129 -100
- package/dist/extractor/extract.d.ts +60 -17
- package/dist/extractor/extract.js +826 -764
- package/dist/router/crud.d.ts +1 -1
- package/dist/router/crud.js +42 -43
- package/dist/router/router.d.ts +135 -98
- package/dist/router/router.js +424 -381
- package/dist/router/validator.d.ts +11 -6
- package/dist/router/validator.js +158 -144
- package/dist/router/wasm.d.ts +56 -22
- package/dist/router/wasm.js +91 -79
- package/dist/ui/backend.d.ts +214 -181
- package/dist/ui/backend.js +258 -245
- package/dist/ui/client.d.ts +1 -1
- package/dist/ui/common.d.ts +54 -31
- package/dist/ui/common.js +171 -159
- package/package.json +1 -1
package/dist/ast.d.ts
CHANGED
|
@@ -1,38 +1,53 @@
|
|
|
1
1
|
export type CrudKind = "SAVE" | "GET" | "LIST";
|
|
2
|
-
export type CidlType =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
2
|
+
export type CidlType =
|
|
3
|
+
| "Void"
|
|
4
|
+
| "Integer"
|
|
5
|
+
| "Real"
|
|
6
|
+
| "Text"
|
|
7
|
+
| "Blob"
|
|
8
|
+
| "DateIso"
|
|
9
|
+
| "Boolean"
|
|
10
|
+
| "Stream"
|
|
11
|
+
| {
|
|
12
|
+
DataSource: string;
|
|
13
|
+
}
|
|
14
|
+
| {
|
|
15
|
+
Inject: string;
|
|
16
|
+
}
|
|
17
|
+
| {
|
|
18
|
+
Object: string;
|
|
19
|
+
}
|
|
20
|
+
| {
|
|
21
|
+
Partial: string;
|
|
22
|
+
}
|
|
23
|
+
| {
|
|
24
|
+
Nullable: CidlType;
|
|
25
|
+
}
|
|
26
|
+
| {
|
|
27
|
+
Array: CidlType;
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
HttpResult: CidlType;
|
|
31
|
+
};
|
|
17
32
|
export declare function isNullableType(ty: CidlType): boolean;
|
|
18
33
|
export declare enum HttpVerb {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
GET = "GET",
|
|
35
|
+
POST = "POST",
|
|
36
|
+
PUT = "PUT",
|
|
37
|
+
PATCH = "PATCH",
|
|
38
|
+
DELETE = "DELETE",
|
|
24
39
|
}
|
|
25
40
|
export interface NamedTypedValue {
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
name: string;
|
|
42
|
+
cidl_type: CidlType;
|
|
28
43
|
}
|
|
29
44
|
export interface ModelAttribute {
|
|
30
|
-
|
|
31
|
-
|
|
45
|
+
value: NamedTypedValue;
|
|
46
|
+
foreign_key_reference: string | null;
|
|
32
47
|
}
|
|
33
48
|
export declare enum MediaType {
|
|
34
|
-
|
|
35
|
-
|
|
49
|
+
Json = "Json",
|
|
50
|
+
Octet = "Octet",
|
|
36
51
|
}
|
|
37
52
|
/**
|
|
38
53
|
* A placeholder value which should be updated by the generator.
|
|
@@ -41,81 +56,86 @@ export declare enum MediaType {
|
|
|
41
56
|
*/
|
|
42
57
|
export declare function defaultMediaType(): MediaType;
|
|
43
58
|
export interface ApiMethod {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
59
|
+
name: string;
|
|
60
|
+
is_static: boolean;
|
|
61
|
+
http_verb: HttpVerb;
|
|
62
|
+
return_media: MediaType;
|
|
63
|
+
return_type: CidlType;
|
|
64
|
+
parameters_media: MediaType;
|
|
65
|
+
parameters: NamedTypedValue[];
|
|
51
66
|
}
|
|
52
|
-
export type NavigationPropertyKind =
|
|
53
|
-
|
|
67
|
+
export type NavigationPropertyKind =
|
|
68
|
+
| {
|
|
69
|
+
OneToOne: {
|
|
54
70
|
reference: string;
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
| {
|
|
74
|
+
OneToMany: {
|
|
58
75
|
reference: string;
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
| {
|
|
79
|
+
ManyToMany: {
|
|
62
80
|
unique_id: string;
|
|
81
|
+
};
|
|
63
82
|
};
|
|
64
|
-
};
|
|
65
83
|
export interface NavigationProperty {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
84
|
+
var_name: string;
|
|
85
|
+
model_name: string;
|
|
86
|
+
kind: NavigationPropertyKind;
|
|
69
87
|
}
|
|
70
|
-
export declare function getNavigationPropertyCidlType(
|
|
88
|
+
export declare function getNavigationPropertyCidlType(
|
|
89
|
+
nav: NavigationProperty,
|
|
90
|
+
): CidlType;
|
|
71
91
|
export interface Model {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
92
|
+
name: string;
|
|
93
|
+
primary_key: NamedTypedValue;
|
|
94
|
+
attributes: ModelAttribute[];
|
|
95
|
+
navigation_properties: NavigationProperty[];
|
|
96
|
+
methods: Record<string, ApiMethod>;
|
|
97
|
+
data_sources: Record<string, DataSource>;
|
|
98
|
+
cruds: CrudKind[];
|
|
99
|
+
source_path: string;
|
|
80
100
|
}
|
|
81
101
|
export interface PlainOldObject {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
name: string;
|
|
103
|
+
attributes: NamedTypedValue[];
|
|
104
|
+
source_path: string;
|
|
85
105
|
}
|
|
86
106
|
export interface ServiceAttribute {
|
|
87
|
-
|
|
88
|
-
|
|
107
|
+
var_name: string;
|
|
108
|
+
injected: string;
|
|
89
109
|
}
|
|
90
110
|
export interface Service {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
111
|
+
name: string;
|
|
112
|
+
attributes: ServiceAttribute[];
|
|
113
|
+
methods: Record<string, ApiMethod>;
|
|
114
|
+
source_path: string;
|
|
95
115
|
}
|
|
96
116
|
export interface CidlIncludeTree {
|
|
97
|
-
|
|
117
|
+
[key: string]: CidlIncludeTree;
|
|
98
118
|
}
|
|
99
119
|
export declare const NO_DATA_SOURCE = "none";
|
|
100
120
|
export interface DataSource {
|
|
101
|
-
|
|
102
|
-
|
|
121
|
+
name: string;
|
|
122
|
+
tree: CidlIncludeTree;
|
|
103
123
|
}
|
|
104
124
|
export interface WranglerEnv {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
125
|
+
name: string;
|
|
126
|
+
source_path: string;
|
|
127
|
+
db_binding: string;
|
|
128
|
+
vars: Record<string, CidlType>;
|
|
109
129
|
}
|
|
110
130
|
export interface CloesceAst {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
131
|
+
[x: string]: any;
|
|
132
|
+
version: string;
|
|
133
|
+
project_name: string;
|
|
134
|
+
language: string;
|
|
135
|
+
wrangler_env?: WranglerEnv;
|
|
136
|
+
models: Record<string, Model>;
|
|
137
|
+
poos: Record<string, PlainOldObject>;
|
|
138
|
+
services: Record<string, Service>;
|
|
139
|
+
app_source: string | null;
|
|
120
140
|
}
|
|
121
|
-
//# sourceMappingURL=ast.d.ts.map
|
|
141
|
+
//# sourceMappingURL=ast.d.ts.map
|
package/dist/ast.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export function isNullableType(ty) {
|
|
2
|
-
|
|
2
|
+
return typeof ty === "object" && ty !== null && "Nullable" in ty;
|
|
3
3
|
}
|
|
4
4
|
export var HttpVerb;
|
|
5
5
|
(function (HttpVerb) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
HttpVerb["GET"] = "GET";
|
|
7
|
+
HttpVerb["POST"] = "POST";
|
|
8
|
+
HttpVerb["PUT"] = "PUT";
|
|
9
|
+
HttpVerb["PATCH"] = "PATCH";
|
|
10
|
+
HttpVerb["DELETE"] = "DELETE";
|
|
11
11
|
})(HttpVerb || (HttpVerb = {}));
|
|
12
12
|
export var MediaType;
|
|
13
13
|
(function (MediaType) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
MediaType["Json"] = "Json";
|
|
15
|
+
MediaType["Octet"] = "Octet";
|
|
16
16
|
})(MediaType || (MediaType = {}));
|
|
17
17
|
/**
|
|
18
18
|
* A placeholder value which should be updated by the generator.
|
|
@@ -20,11 +20,11 @@ export var MediaType;
|
|
|
20
20
|
* @returns MediaType.Json
|
|
21
21
|
*/
|
|
22
22
|
export function defaultMediaType() {
|
|
23
|
-
|
|
23
|
+
return MediaType.Json;
|
|
24
24
|
}
|
|
25
25
|
export function getNavigationPropertyCidlType(nav) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
return "OneToOne" in nav.kind
|
|
27
|
+
? { Object: nav.model_name }
|
|
28
|
+
: { Array: { Object: nav.model_name } };
|
|
29
29
|
}
|
|
30
30
|
export const NO_DATA_SOURCE = "none";
|
package/dist/cli.d.ts
CHANGED