cloesce 0.0.5-unstable.1 → 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 CHANGED
@@ -1,53 +1,38 @@
1
1
  export type CrudKind = "SAVE" | "GET" | "LIST";
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
- };
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
- GET = "GET",
35
- POST = "POST",
36
- PUT = "PUT",
37
- PATCH = "PATCH",
38
- DELETE = "DELETE",
19
+ GET = "GET",
20
+ POST = "POST",
21
+ PUT = "PUT",
22
+ PATCH = "PATCH",
23
+ DELETE = "DELETE"
39
24
  }
40
25
  export interface NamedTypedValue {
41
- name: string;
42
- cidl_type: CidlType;
26
+ name: string;
27
+ cidl_type: CidlType;
43
28
  }
44
29
  export interface ModelAttribute {
45
- value: NamedTypedValue;
46
- foreign_key_reference: string | null;
30
+ value: NamedTypedValue;
31
+ foreign_key_reference: string | null;
47
32
  }
48
33
  export declare enum MediaType {
49
- Json = "Json",
50
- Octet = "Octet",
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
- 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[];
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
- var_name: string;
85
- model_name: string;
86
- kind: NavigationPropertyKind;
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
- 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;
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
- name: string;
103
- attributes: NamedTypedValue[];
104
- source_path: string;
82
+ name: string;
83
+ attributes: NamedTypedValue[];
84
+ source_path: string;
105
85
  }
106
86
  export interface ServiceAttribute {
107
- var_name: string;
108
- injected: string;
87
+ var_name: string;
88
+ injected: string;
109
89
  }
110
90
  export interface Service {
111
- name: string;
112
- attributes: ServiceAttribute[];
113
- methods: Record<string, ApiMethod>;
114
- source_path: string;
91
+ name: string;
92
+ attributes: ServiceAttribute[];
93
+ methods: Record<string, ApiMethod>;
94
+ source_path: string;
115
95
  }
116
96
  export interface CidlIncludeTree {
117
- [key: string]: CidlIncludeTree;
97
+ [key: string]: CidlIncludeTree;
118
98
  }
119
99
  export declare const NO_DATA_SOURCE = "none";
120
100
  export interface DataSource {
121
- name: string;
122
- tree: CidlIncludeTree;
101
+ name: string;
102
+ tree: CidlIncludeTree;
123
103
  }
124
104
  export interface WranglerEnv {
125
- name: string;
126
- source_path: string;
127
- db_binding: string;
128
- vars: Record<string, CidlType>;
105
+ name: string;
106
+ source_path: string;
107
+ db_binding: string;
108
+ vars: Record<string, CidlType>;
129
109
  }
130
110
  export interface CloesceAst {
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;
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
- 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