@typespec/compiler 0.65.0-dev.11 → 0.65.0-dev.13
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/manifest.js
CHANGED
package/package.json
CHANGED
|
@@ -7,34 +7,40 @@ using TypeSpec.Http;
|
|
|
7
7
|
namespace DemoService;
|
|
8
8
|
|
|
9
9
|
model Widget {
|
|
10
|
-
@visibility("read", "update")
|
|
11
|
-
@path
|
|
12
10
|
id: string;
|
|
13
|
-
|
|
14
11
|
weight: int32;
|
|
15
12
|
color: "red" | "blue";
|
|
16
13
|
}
|
|
17
14
|
|
|
15
|
+
model WidgetList {
|
|
16
|
+
items: Widget[];
|
|
17
|
+
}
|
|
18
|
+
|
|
18
19
|
@error
|
|
19
20
|
model Error {
|
|
20
21
|
code: int32;
|
|
21
22
|
message: string;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
model AnalyzeResult {
|
|
26
|
+
id: string;
|
|
27
|
+
analysis: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
24
30
|
@route("/widgets")
|
|
25
31
|
@tag("Widgets")
|
|
26
32
|
interface Widgets {
|
|
27
33
|
/** List widgets */
|
|
28
|
-
@get list():
|
|
34
|
+
@get list(): WidgetList | Error;
|
|
29
35
|
/** Read widgets */
|
|
30
36
|
@get read(@path id: string): Widget | Error;
|
|
31
37
|
/** Create a widget */
|
|
32
|
-
@post create(
|
|
38
|
+
@post create(@body body: Widget): Widget | Error;
|
|
33
39
|
/** Update a widget */
|
|
34
|
-
@patch update(
|
|
40
|
+
@patch update(@path id: string, @body body: Widget): Widget | Error;
|
|
35
41
|
/** Delete a widget */
|
|
36
42
|
@delete delete(@path id: string): void | Error;
|
|
37
43
|
|
|
38
44
|
/** Analyze a widget */
|
|
39
|
-
@route("{id}/analyze") @post analyze(@path id: string):
|
|
45
|
+
@route("{id}/analyze") @post analyze(@path id: string): AnalyzeResult | Error;
|
|
40
46
|
}
|
package/templates/rest/main.tsp
CHANGED
|
@@ -7,34 +7,40 @@ using TypeSpec.Http;
|
|
|
7
7
|
namespace DemoService;
|
|
8
8
|
|
|
9
9
|
model Widget {
|
|
10
|
-
@visibility("read", "update")
|
|
11
|
-
@path
|
|
12
10
|
id: string;
|
|
13
|
-
|
|
14
11
|
weight: int32;
|
|
15
12
|
color: "red" | "blue";
|
|
16
13
|
}
|
|
17
14
|
|
|
15
|
+
model WidgetList {
|
|
16
|
+
items: Widget[];
|
|
17
|
+
}
|
|
18
|
+
|
|
18
19
|
@error
|
|
19
20
|
model Error {
|
|
20
21
|
code: int32;
|
|
21
22
|
message: string;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
model AnalyzeResult {
|
|
26
|
+
id: string;
|
|
27
|
+
analysis: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
24
30
|
@route("/widgets")
|
|
25
31
|
@tag("Widgets")
|
|
26
32
|
interface Widgets {
|
|
27
33
|
/** List widgets */
|
|
28
|
-
@get list():
|
|
34
|
+
@get list(): WidgetList | Error;
|
|
29
35
|
/** Read widgets */
|
|
30
36
|
@get read(@path id: string): Widget | Error;
|
|
31
37
|
/** Create a widget */
|
|
32
|
-
@post create(
|
|
38
|
+
@post create(@body body: Widget): Widget | Error;
|
|
33
39
|
/** Update a widget */
|
|
34
|
-
@patch update(
|
|
40
|
+
@patch update(@path id: string, @body body: Widget): Widget | Error;
|
|
35
41
|
/** Delete a widget */
|
|
36
42
|
@delete delete(@path id: string): void | Error;
|
|
37
43
|
|
|
38
44
|
/** Analyze a widget */
|
|
39
|
-
@route("{id}/analyze") @post analyze(@path id: string):
|
|
45
|
+
@route("{id}/analyze") @post analyze(@path id: string): AnalyzeResult | Error;
|
|
40
46
|
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"emitter-output-dir": "{output-dir}/clients/java"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
"@typespec
|
|
37
|
+
"@azure-tools/typespec-ts": {
|
|
38
38
|
"description": "JavaScript Client emitter",
|
|
39
39
|
"options": {
|
|
40
40
|
"emitter-output-dir": "{output-dir}/clients/js"
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"@typespec/http-server-csharp": {
|
|
50
50
|
"description": "CSharp server stubs",
|
|
51
51
|
"options": {
|
|
52
|
-
"emitter-output-dir": "{output-dir}/server"
|
|
52
|
+
"emitter-output-dir": "{output-dir}/server/generated"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"@typespec/http-server-
|
|
55
|
+
"@typespec/http-server-javascript": {
|
|
56
56
|
"description": "Javascript server stubs",
|
|
57
57
|
"options": {
|
|
58
58
|
"emitter-output-dir": "{output-dir}/server"
|