@typespec/rest 0.54.0-dev.1 → 0.54.0
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/README.md +21 -21
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -43,27 +43,27 @@ Specify this operation is an action. (Scoped to a resource item /pets/{petId}/my
|
|
|
43
43
|
|
|
44
44
|
##### Parameters
|
|
45
45
|
|
|
46
|
-
| Name | Type
|
|
47
|
-
| ---- |
|
|
48
|
-
| name | `valueof
|
|
46
|
+
| Name | Type | Description |
|
|
47
|
+
| ---- | ---------------- | ----------------------------------------------------------------------------- |
|
|
48
|
+
| name | `valueof string` | Name of the action. If not specified, the name of the operation will be used. |
|
|
49
49
|
|
|
50
50
|
#### `@actionSeparator`
|
|
51
51
|
|
|
52
52
|
Defines the separator string that is inserted before the action name in auto-generated routes for actions.
|
|
53
53
|
|
|
54
54
|
```typespec
|
|
55
|
-
@TypeSpec.Rest.actionSeparator(seperator: valueof / | : | /:)
|
|
55
|
+
@TypeSpec.Rest.actionSeparator(seperator: valueof "/" | ":" | "/:")
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
##### Target
|
|
59
59
|
|
|
60
|
-
`
|
|
60
|
+
`Model | ModelProperty | Operation`
|
|
61
61
|
|
|
62
62
|
##### Parameters
|
|
63
63
|
|
|
64
64
|
| Name | Type | Description |
|
|
65
65
|
| --------- | ---------------------------- | ---------------------------------------------------------------- |
|
|
66
|
-
| seperator | `valueof
|
|
66
|
+
| seperator | `valueof "/" \| ":" \| "/:"` | Seperator seperating the action segment from the rest of the url |
|
|
67
67
|
|
|
68
68
|
#### `@autoRoute`
|
|
69
69
|
|
|
@@ -75,7 +75,7 @@ This interface or operation should resolve its route automatically. To be used w
|
|
|
75
75
|
|
|
76
76
|
##### Target
|
|
77
77
|
|
|
78
|
-
`
|
|
78
|
+
`Interface | Operation`
|
|
79
79
|
|
|
80
80
|
##### Parameters
|
|
81
81
|
|
|
@@ -104,10 +104,10 @@ Specify this operation is a collection action. (Scopped to a resource, /pets/my-
|
|
|
104
104
|
|
|
105
105
|
##### Parameters
|
|
106
106
|
|
|
107
|
-
| Name | Type
|
|
108
|
-
| ------------ |
|
|
109
|
-
| resourceType | `Model`
|
|
110
|
-
| name | `valueof
|
|
107
|
+
| Name | Type | Description |
|
|
108
|
+
| ------------ | ---------------- | ----------------------------------------------------------------------------- |
|
|
109
|
+
| resourceType | `Model` | Resource marked with |
|
|
110
|
+
| name | `valueof string` | Name of the action. If not specified, the name of the operation will be used. |
|
|
111
111
|
|
|
112
112
|
#### `@copyResourceKeyParameters`
|
|
113
113
|
|
|
@@ -123,9 +123,9 @@ Copy the resource key parameters on the model
|
|
|
123
123
|
|
|
124
124
|
##### Parameters
|
|
125
125
|
|
|
126
|
-
| Name | Type
|
|
127
|
-
| ------ |
|
|
128
|
-
| filter | `valueof
|
|
126
|
+
| Name | Type | Description |
|
|
127
|
+
| ------ | ---------------- | ------------------------------------- |
|
|
128
|
+
| filter | `valueof string` | Filter to exclude certain properties. |
|
|
129
129
|
|
|
130
130
|
#### `@createsOrReplacesResource`
|
|
131
131
|
|
|
@@ -267,9 +267,9 @@ Mark this model as a resource type with a name.
|
|
|
267
267
|
|
|
268
268
|
##### Parameters
|
|
269
269
|
|
|
270
|
-
| Name | Type
|
|
271
|
-
| -------------- |
|
|
272
|
-
| collectionName | `valueof
|
|
270
|
+
| Name | Type | Description |
|
|
271
|
+
| -------------- | ---------------- | ---------------------- |
|
|
272
|
+
| collectionName | `valueof string` | type's collection name |
|
|
273
273
|
|
|
274
274
|
#### `@segment`
|
|
275
275
|
|
|
@@ -281,13 +281,13 @@ Defines the preceding path segment for a
|
|
|
281
281
|
|
|
282
282
|
##### Target
|
|
283
283
|
|
|
284
|
-
`
|
|
284
|
+
`Model | ModelProperty | Operation`
|
|
285
285
|
|
|
286
286
|
##### Parameters
|
|
287
287
|
|
|
288
|
-
| Name | Type
|
|
289
|
-
| ---- |
|
|
290
|
-
| name | `valueof
|
|
288
|
+
| Name | Type | Description |
|
|
289
|
+
| ---- | ---------------- | ---------------------------------------------------------------------------------------------- |
|
|
290
|
+
| name | `valueof string` | Segment that will be inserted into the operation route before the path parameter's name field. |
|
|
291
291
|
|
|
292
292
|
##### Examples
|
|
293
293
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/rest",
|
|
3
|
-
"version": "0.54.0
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec REST protocol binding",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -38,16 +38,11 @@
|
|
|
38
38
|
"!dist/test/**"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@typespec/compiler": "~0.
|
|
42
|
-
"@typespec/http": "~0.
|
|
41
|
+
"@typespec/compiler": "~0.54.0",
|
|
42
|
+
"@typespec/http": "~0.54.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "~18.11.19",
|
|
46
|
-
"@typespec/compiler": "~0.53.1 || >=0.54.0-dev <0.54.0",
|
|
47
|
-
"@typespec/eslint-config-typespec": "~0.53.0 || >=0.54.0-dev <0.54.0",
|
|
48
|
-
"@typespec/eslint-plugin": "~0.53.0 || >=0.54.0-dev <0.54.0",
|
|
49
|
-
"@typespec/http": "~0.53.0 || >=0.54.0-dev <0.54.0",
|
|
50
|
-
"@typespec/library-linter": "~0.53.0 || >=0.54.0-dev <0.54.0",
|
|
51
46
|
"@vitest/coverage-v8": "^1.2.2",
|
|
52
47
|
"@vitest/ui": "^1.2.2",
|
|
53
48
|
"c8": "^9.1.0",
|
|
@@ -55,15 +50,20 @@
|
|
|
55
50
|
"rimraf": "~5.0.5",
|
|
56
51
|
"typescript": "~5.3.3",
|
|
57
52
|
"vitest": "^1.2.2",
|
|
53
|
+
"@typespec/compiler": "~0.54.0",
|
|
54
|
+
"@typespec/eslint-config-typespec": "~0.54.0",
|
|
55
|
+
"@typespec/http": "~0.54.0",
|
|
56
|
+
"@typespec/eslint-plugin": "~0.54.0",
|
|
57
|
+
"@typespec/library-linter": "~0.54.0",
|
|
58
58
|
"@typespec/tspd": "~0.46.0"
|
|
59
59
|
},
|
|
60
|
-
"dependencies": {},
|
|
61
60
|
"scripts": {
|
|
62
61
|
"clean": "rimraf ./dist ./temp",
|
|
63
62
|
"build": "tsc -p . && npm run lint-typespec-library",
|
|
64
63
|
"watch": "tsc -p . --watch",
|
|
65
64
|
"lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit",
|
|
66
65
|
"test": "vitest run",
|
|
66
|
+
"test:watch": "vitest --watch",
|
|
67
67
|
"test:ui": "vitest --ui",
|
|
68
68
|
"test-official": "vitest run --coverage --reporter=junit --reporter=default --no-file-parallelism",
|
|
69
69
|
"lint": "eslint . --ext .ts --max-warnings=0",
|