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 CHANGED
@@ -1,38 +1,53 @@
1
1
  export type CrudKind = "SAVE" | "GET" | "LIST";
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
- };
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
- GET = "GET",
20
- POST = "POST",
21
- PUT = "PUT",
22
- PATCH = "PATCH",
23
- DELETE = "DELETE"
34
+ GET = "GET",
35
+ POST = "POST",
36
+ PUT = "PUT",
37
+ PATCH = "PATCH",
38
+ DELETE = "DELETE",
24
39
  }
25
40
  export interface NamedTypedValue {
26
- name: string;
27
- cidl_type: CidlType;
41
+ name: string;
42
+ cidl_type: CidlType;
28
43
  }
29
44
  export interface ModelAttribute {
30
- value: NamedTypedValue;
31
- foreign_key_reference: string | null;
45
+ value: NamedTypedValue;
46
+ foreign_key_reference: string | null;
32
47
  }
33
48
  export declare enum MediaType {
34
- Json = "Json",
35
- Octet = "Octet"
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
- 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[];
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
- OneToOne: {
67
+ export type NavigationPropertyKind =
68
+ | {
69
+ OneToOne: {
54
70
  reference: string;
55
- };
56
- } | {
57
- OneToMany: {
71
+ };
72
+ }
73
+ | {
74
+ OneToMany: {
58
75
  reference: string;
59
- };
60
- } | {
61
- ManyToMany: {
76
+ };
77
+ }
78
+ | {
79
+ ManyToMany: {
62
80
  unique_id: string;
81
+ };
63
82
  };
64
- };
65
83
  export interface NavigationProperty {
66
- var_name: string;
67
- model_name: string;
68
- kind: NavigationPropertyKind;
84
+ var_name: string;
85
+ model_name: string;
86
+ kind: NavigationPropertyKind;
69
87
  }
70
- export declare function getNavigationPropertyCidlType(nav: NavigationProperty): CidlType;
88
+ export declare function getNavigationPropertyCidlType(
89
+ nav: NavigationProperty,
90
+ ): CidlType;
71
91
  export interface Model {
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;
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
- name: string;
83
- attributes: NamedTypedValue[];
84
- source_path: string;
102
+ name: string;
103
+ attributes: NamedTypedValue[];
104
+ source_path: string;
85
105
  }
86
106
  export interface ServiceAttribute {
87
- var_name: string;
88
- injected: string;
107
+ var_name: string;
108
+ injected: string;
89
109
  }
90
110
  export interface Service {
91
- name: string;
92
- attributes: ServiceAttribute[];
93
- methods: Record<string, ApiMethod>;
94
- source_path: string;
111
+ name: string;
112
+ attributes: ServiceAttribute[];
113
+ methods: Record<string, ApiMethod>;
114
+ source_path: string;
95
115
  }
96
116
  export interface CidlIncludeTree {
97
- [key: string]: CidlIncludeTree;
117
+ [key: string]: CidlIncludeTree;
98
118
  }
99
119
  export declare const NO_DATA_SOURCE = "none";
100
120
  export interface DataSource {
101
- name: string;
102
- tree: CidlIncludeTree;
121
+ name: string;
122
+ tree: CidlIncludeTree;
103
123
  }
104
124
  export interface WranglerEnv {
105
- name: string;
106
- source_path: string;
107
- db_binding: string;
108
- vars: Record<string, CidlType>;
125
+ name: string;
126
+ source_path: string;
127
+ db_binding: string;
128
+ vars: Record<string, CidlType>;
109
129
  }
110
130
  export interface CloesceAst {
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;
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
- return typeof ty === "object" && ty !== null && "Nullable" in ty;
2
+ return typeof ty === "object" && ty !== null && "Nullable" in ty;
3
3
  }
4
4
  export var HttpVerb;
5
5
  (function (HttpVerb) {
6
- HttpVerb["GET"] = "GET";
7
- HttpVerb["POST"] = "POST";
8
- HttpVerb["PUT"] = "PUT";
9
- HttpVerb["PATCH"] = "PATCH";
10
- HttpVerb["DELETE"] = "DELETE";
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
- MediaType["Json"] = "Json";
15
- MediaType["Octet"] = "Octet";
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
- return MediaType.Json;
23
+ return MediaType.Json;
24
24
  }
25
25
  export function getNavigationPropertyCidlType(nav) {
26
- return "OneToOne" in nav.kind
27
- ? { Object: nav.model_name }
28
- : { Array: { Object: nav.model_name } };
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
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
- //# sourceMappingURL=cli.d.ts.map
3
+ //# sourceMappingURL=cli.d.ts.map