@typespec/rest 0.44.0-dev.1 → 0.44.0-dev.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/lib/rest-decorators.tsp +13 -13
- package/package.json +2 -2
package/lib/rest-decorators.tsp
CHANGED
|
@@ -27,75 +27,75 @@ extern dec autoRoute(target: Interface | Operation);
|
|
|
27
27
|
* get(@segment("pets") @path id: string): void; //-> route: /pets/{id}
|
|
28
28
|
* }
|
|
29
29
|
*/
|
|
30
|
-
extern dec segment(target:
|
|
30
|
+
extern dec segment(target: Model | ModelProperty | Operation, name: string);
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Returns the URL segment of a given model if it has `@segment` and `@key` decorator.
|
|
34
34
|
*/
|
|
35
|
-
extern dec segmentOf(target: Operation, type:
|
|
35
|
+
extern dec segmentOf(target: Operation, type: Model);
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Defines the separator string that is inserted before the action name in auto-generated routes for actions.
|
|
39
39
|
*
|
|
40
40
|
* @param seperator Seperator seperating the action segment from the rest of the url
|
|
41
41
|
*/
|
|
42
|
-
extern dec actionSeparator(target:
|
|
42
|
+
extern dec actionSeparator(target: Model | ModelProperty | Operation, seperator: "/" | ":" | "/:");
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Mark this model as a resource type with a name.
|
|
46
46
|
*
|
|
47
47
|
* @param collectionName type's collection name
|
|
48
48
|
*/
|
|
49
|
-
extern dec resource(target:
|
|
49
|
+
extern dec resource(target: Model, collectionName: string);
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Specify that this is a Read operation for a given resource.
|
|
53
53
|
*
|
|
54
54
|
* @param resource Resource marked with @resource
|
|
55
55
|
*/
|
|
56
|
-
extern dec readsResource(target: Operation, resourceType:
|
|
56
|
+
extern dec readsResource(target: Operation, resourceType: Model);
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Specify that this is a Create operation for a given resource.
|
|
60
60
|
*
|
|
61
61
|
* @param resource Resource marked with @resource
|
|
62
62
|
*/
|
|
63
|
-
extern dec createsResource(target: Operation, resourceType:
|
|
63
|
+
extern dec createsResource(target: Operation, resourceType: Model);
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* Specify that this is a CreateOrReplace operation for a given resource.
|
|
67
67
|
*
|
|
68
68
|
* @param resource Resource marked with @resource
|
|
69
69
|
*/
|
|
70
|
-
extern dec createsOrReplacesResource(target: Operation, resourceType:
|
|
70
|
+
extern dec createsOrReplacesResource(target: Operation, resourceType: Model);
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Specify that this is a CreatesOrUpdate operation for a given resource.
|
|
74
74
|
*
|
|
75
75
|
* @param resource Resource marked with @resource
|
|
76
76
|
*/
|
|
77
|
-
extern dec createsOrUpdatesResource(target: Operation, resourceType:
|
|
77
|
+
extern dec createsOrUpdatesResource(target: Operation, resourceType: Model);
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Specify that this is a Update operation for a given resource.
|
|
81
81
|
*
|
|
82
82
|
* @param resource Resource marked with @resource
|
|
83
83
|
*/
|
|
84
|
-
extern dec updatesResource(target: Operation, resourceType:
|
|
84
|
+
extern dec updatesResource(target: Operation, resourceType: Model);
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* Specify that this is a Delete operation for a given resource.
|
|
88
88
|
*
|
|
89
89
|
* @param resource Resource marked with @resource
|
|
90
90
|
*/
|
|
91
|
-
extern dec deletesResource(target: Operation, resourceType:
|
|
91
|
+
extern dec deletesResource(target: Operation, resourceType: Model);
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* Specify that this is a List operation for a given resource.
|
|
95
95
|
*
|
|
96
96
|
* @param resource Resource marked with @resource
|
|
97
97
|
*/
|
|
98
|
-
extern dec listsResource(target: Operation, resourceType:
|
|
98
|
+
extern dec listsResource(target: Operation, resourceType: Model);
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Specify this operation is an action. (Scopped to a resource item /pets/{petId}/my-action)
|
|
@@ -105,8 +105,8 @@ extern dec action(target: Operation, name?: string);
|
|
|
105
105
|
/**
|
|
106
106
|
* Specify this operation is a collection action. (Scopped to a resource, /pets/my-action)
|
|
107
107
|
*/
|
|
108
|
-
extern dec collectionAction(target: Operation, resourceType:
|
|
108
|
+
extern dec collectionAction(target: Operation, resourceType: Model, name?: string);
|
|
109
109
|
|
|
110
110
|
namespace Private {
|
|
111
|
-
extern dec resourceLocation(target: string, resourceType:
|
|
111
|
+
extern dec resourceLocation(target: string, resourceType: Model);
|
|
112
112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/rest",
|
|
3
|
-
"version": "0.44.0-dev.
|
|
3
|
+
"version": "0.44.0-dev.2",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec REST protocol binding",
|
|
6
6
|
"homepage": "https://microsoft.github.io/typespec",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/mocha": "~10.0.0",
|
|
49
49
|
"@types/node": "~18.11.9",
|
|
50
50
|
"@typespec/compiler": ">=0.43.0",
|
|
51
|
-
"@typespec/http": ">=0.43.
|
|
51
|
+
"@typespec/http": ">=0.43.1",
|
|
52
52
|
"@typespec/eslint-config-typespec": ">=0.6.0",
|
|
53
53
|
"@typespec/library-linter": ">=0.43.0",
|
|
54
54
|
"@typespec/eslint-plugin": ">=0.43.0",
|