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