@azure-tools/typespec-azure-resource-manager 0.31.0-dev.2 → 0.31.0-dev.4
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 +5 -327
- package/dist/src/internal.d.ts +4 -4
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +0 -10
- package/dist/src/internal.js.map +1 -1
- package/dist/src/namespace.d.ts +2 -2
- package/dist/src/namespace.d.ts.map +1 -1
- package/dist/src/namespace.js +1 -4
- package/dist/src/namespace.js.map +1 -1
- package/dist/src/operations.d.ts +9 -9
- package/dist/src/operations.d.ts.map +1 -1
- package/dist/src/operations.js +1 -39
- package/dist/src/operations.js.map +1 -1
- package/dist/src/resource.d.ts +13 -13
- package/dist/src/resource.d.ts.map +1 -1
- package/dist/src/resource.js +1 -48
- package/dist/src/resource.js.map +1 -1
- package/lib/arm.foundations.decorators.tsp +37 -0
- package/lib/arm.tsp +1 -0
- package/lib/decorators.tsp +88 -1
- package/lib/interfaces.tsp +2 -2
- package/lib/models.tsp +4 -4
- package/lib/operations.tsp +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,17 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
This is a library that provides model types and interfaces which can be used to define an Azure Resource Manager service API.
|
|
4
4
|
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Getting Started](#getting-started)
|
|
8
|
-
- [Creating a project with `tsp init`](#creating-a-project-with-typespec-init)
|
|
9
|
-
- [Creating a project manually](#creating-a-project-manually)
|
|
10
|
-
- [Concepts](#concepts)
|
|
11
|
-
- [Defining the Service](#defining-the-service)
|
|
12
|
-
- [Defining Resource Types](#defining-resource-types)
|
|
13
|
-
- [Generating an OpenAPI Specification](#generating-an-openapi-specification)
|
|
14
|
-
- [A Complete Example](#a-complete-example)
|
|
15
|
-
|
|
16
5
|
## Getting Started
|
|
17
6
|
|
|
18
7
|
To author an Azure Resource Manager service definition, you will first need to create a TypeSpec project for your service.
|
|
@@ -24,323 +13,12 @@ https://github.com/Azure/typespec-azure/blob/main/packages/typespec-providerhub-
|
|
|
24
13
|
|
|
25
14
|
Before using this library, you should familiarize yourself with the TypeSpec language and tools. You can do this by reading the [TypeSpec tutorial](https://github.com/microsoft/typespec/blob/main/docs/tutorial.md).
|
|
26
15
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
To define an Azure Resource Manager service, the first thing you will need to do is define the service namespace and decorate it with the `serviceTitle`, `serviceVersion` and `armProviderNamespace` decorators:
|
|
30
|
-
|
|
31
|
-
```typespec
|
|
32
|
-
@armProviderNamespace
|
|
33
|
-
@service({title: "<service name>", version: "<service version>"})
|
|
34
|
-
namespace <mynamespace>;
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
For example:
|
|
38
|
-
|
|
39
|
-
```typespec
|
|
40
|
-
@armProviderNamespace
|
|
41
|
-
@service({
|
|
42
|
-
title: "Contoso User Service",
|
|
43
|
-
version: "2020-10-01-preview",
|
|
44
|
-
})
|
|
45
|
-
namespace Contoso.Users;
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### The `using` keyword
|
|
49
|
-
|
|
50
|
-
Just after the `namespace` declaration, you will also need to include a few `using` statements to pull in symbols from the namespaces of libraries you will for your specification.
|
|
51
|
-
|
|
52
|
-
For example, these lines pull in symbols from the `@typespec/rest` and `@azure-tools/typespec-azure-resource-manager`:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
using TypeSpec.Http;
|
|
56
|
-
using TypeSpec.Rest;
|
|
57
|
-
using Azure.ResourceManager;
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Defining Resource Types
|
|
61
|
-
|
|
62
|
-
A resource provider is composed of resources. The TypeSpec Azure Resource Manager library makes it much easier to define the structure and endpoints of such resources.
|
|
63
|
-
|
|
64
|
-
There are three essential components of a resource defined with TypeSpec:
|
|
65
|
-
|
|
66
|
-
- A model type representing the resource, derived from one of the [base resource types](#base-resource-types)
|
|
67
|
-
- A model type defining the properties of the resource type
|
|
68
|
-
- An interface that defines the operations that can be performed on the resource type, usually a combination of [standard resource operations](#standard-resource-operations) and [custom actions](#custom-actions)
|
|
69
|
-
|
|
70
|
-
Read the [TypeSpec tutorial](https://github.com/Microsoft/typespec/blob/main/docs/tutorial.md) to learn the basics about TypeSpec model types and interfaces.
|
|
71
|
-
|
|
72
|
-
#### 1. **Define a model representing the `properties` of the ARM resource**
|
|
73
|
-
|
|
74
|
-
Each resource type must have a properties type which defines its custom properties. This type will be exposed as the `properties` property of the resource type.
|
|
75
|
-
|
|
76
|
-
```typespec
|
|
77
|
-
@doc("The properties of UserResource")
|
|
78
|
-
model UserResourceProperties {
|
|
79
|
-
@doc("The user's full name")
|
|
80
|
-
fullName: string;
|
|
81
|
-
|
|
82
|
-
@doc("The user's email address.")
|
|
83
|
-
emailAddress: string;
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### 2. **Define a model representing the resource type**
|
|
88
|
-
|
|
89
|
-
Resource types are defined as plain models which pull in a standard resource type using the `is` keyword.
|
|
90
|
-
|
|
91
|
-
You define a resource type, you need the following:
|
|
92
|
-
|
|
93
|
-
- A `name` property which is marked with the following decorators
|
|
94
|
-
- `@key`: Specifies the parameter name for this resource type in the service URI hierarchy
|
|
95
|
-
- `@segment`: Specifies the name of the resource "collection", the URI segment that comes just before the parameter name which identifies the resource type
|
|
96
|
-
- A second model type which defines the resource type's custom properties as we described in step 1
|
|
97
|
-
|
|
98
|
-
Here we define a tracked resource called `UserResource`:
|
|
99
|
-
|
|
100
|
-
```typespec
|
|
101
|
-
@doc("A UserResource")
|
|
102
|
-
model UserResource is TrackedResource<UserResourceProperties> {
|
|
103
|
-
@key("userName")
|
|
104
|
-
@segment("users")
|
|
105
|
-
name: string;
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
#### 3. **Define an interface with operations for the resource type**
|
|
110
|
-
|
|
111
|
-
```typespec
|
|
112
|
-
@armResourceOperations
|
|
113
|
-
interface Users extends TrackedResourceOperations<UserResource> {}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
This will now produce all the endpoints(`get`, `post`, `put`, `patch` and `delete`, listByResourceGroup, listBySubscription) for a resource called `UserResources` and the `operations` endpoint for the service:
|
|
117
|
-
|
|
118
|
-
| Method & Path | Description |
|
|
119
|
-
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
|
|
120
|
-
| `GET /providers/Contoso.Users/operations` | List all operations for your service |
|
|
121
|
-
| `GET /subscriptions/{subscriptionId}/providers/Contoso.Users/users` | list all UserResource by subscription |
|
|
122
|
-
| `GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Contoso.Users/users` | list all UserResource by resource group |
|
|
123
|
-
| `GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Contoso.Users/users/{userName}` | get item |
|
|
124
|
-
| `PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Contoso.Users/users/{userName}` | insert item |
|
|
125
|
-
| `PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Contoso.Users/users/{userName}` | patch item |
|
|
126
|
-
| `DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Contoso.Users/users/{userName}` | delete item |
|
|
127
|
-
|
|
128
|
-
#### Base Resource Types
|
|
129
|
-
|
|
130
|
-
Here are the base resource types you can use when defining your own ARM resources:
|
|
131
|
-
|
|
132
|
-
| Name | Description |
|
|
133
|
-
| ------------------------------ | -------------------------------------------------------------------------------------- |
|
|
134
|
-
| TrackedResource<TProperties> | Defines a normal ARM resource where `TProperties` is the model of the `properties` |
|
|
135
|
-
| ProxyResource<TProperties> | Defines a proxy ARM resource where `TProperties` is the model of the `properties` |
|
|
136
|
-
| ExtensionResource<TProperties> | Defines an extension ARM resource where `TProperties` is the model of the `properties` |
|
|
137
|
-
|
|
138
|
-
### Defining Child Resource Types
|
|
139
|
-
|
|
140
|
-
You can create parent/child relationships between resource types by using the `@parentResource` decorator when defining a resource type.
|
|
141
|
-
|
|
142
|
-
For example, here's how you could create a new `AddressResource` resource under the `UserResource` defined above:
|
|
143
|
-
|
|
144
|
-
```typespec
|
|
145
|
-
@doc("An address resource belonging to a user resource.")
|
|
146
|
-
@parentResource(UserResource)
|
|
147
|
-
model AddressResource is ProxyResource<AddressResourceProperties> {
|
|
148
|
-
@key("addressName")
|
|
149
|
-
@segment("addresses")
|
|
150
|
-
name: string;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
@doc("The properties of AddressResource")
|
|
154
|
-
model AddressResourceProperties {
|
|
155
|
-
@doc("The street address.")
|
|
156
|
-
streetAddress: string;
|
|
157
|
-
|
|
158
|
-
@doc("The city of the address.")
|
|
159
|
-
city: string;
|
|
160
|
-
|
|
161
|
-
@doc("The state of the address.")
|
|
162
|
-
state: string;
|
|
163
|
-
|
|
164
|
-
@doc("The zip code of the address.")
|
|
165
|
-
zip: int32;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
@armResourceOperations
|
|
169
|
-
interface Addresses extends ProxyResourceOperations<AddressResource> {}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### Defining Custom Actions
|
|
173
|
-
|
|
174
|
-
Some resources will provide more than the standard CRUD operations and will need to define a custom action endpoint. Additional resource operations can be added to the `interface` where you pulled in standard resource operations.
|
|
175
|
-
|
|
176
|
-
For example, to add an additional `POST` action called `/notify` to the standard operations of `UserResource`:
|
|
177
|
-
|
|
178
|
-
```typespec
|
|
179
|
-
@doc("The details of a user notification.")
|
|
180
|
-
model NotificationDetails {
|
|
181
|
-
@doc("The notification message.")
|
|
182
|
-
message: string;
|
|
183
|
-
|
|
184
|
-
@doc("If true, the notification is urgent.")
|
|
185
|
-
urgent: boolean;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
@armResourceOperations
|
|
189
|
-
interface Users extends TrackedResourceOperations<UserResource, UserResourceProperties> {
|
|
190
|
-
@post
|
|
191
|
-
@doc("Send a notification to the user")
|
|
192
|
-
@segment("notify")
|
|
193
|
-
NotifyUser(
|
|
194
|
-
...ResourceInstanceParameters<UserResource>,
|
|
195
|
-
@body notification: NotificationDetails
|
|
196
|
-
): ArmResponse<string> | ErrorResponse;
|
|
197
|
-
}
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
#### ARM Response Types
|
|
201
|
-
|
|
202
|
-
Custom operations in ARM still need to respect the correct response schema. This library provides standard ARM response types to help with reusability and compliance.
|
|
203
|
-
|
|
204
|
-
| Model | Code | Description |
|
|
205
|
-
| ----------------------------- | ---- | --------------------------------------------- |
|
|
206
|
-
| `ArmResponse<T>` | 200 | Base Arm 200 response. |
|
|
207
|
-
| `ArmCreatedResponse<T>` | 201 | Resource created response |
|
|
208
|
-
| `ArmDeletedResponse` | 200 | Resource deleted response |
|
|
209
|
-
| `ArmDeleteAcceptedResponse` | 202 | Resource deletion in progress response |
|
|
210
|
-
| `ArmDeletedNoContentResponse` | 204 | Resource deleted response |
|
|
211
|
-
| `Page<T>` | 200 | Return a list of resource with ARM pagination |
|
|
212
|
-
| `ErrorResponse<T>` | x | Error response |
|
|
213
|
-
|
|
214
|
-
#### Common Operation Parameters
|
|
215
|
-
|
|
216
|
-
There are a number of model types which specify common parameters which are used in resource type operations:
|
|
217
|
-
|
|
218
|
-
| Model | In | Description |
|
|
219
|
-
| ---------------------------- | ------------ | ------------------------------------------------------------------ |
|
|
220
|
-
| `ApiVersionParameter` | query | `api-version` parameter |
|
|
221
|
-
| `SubscriptionIdParameter` | path | Subscription ID path parameter |
|
|
222
|
-
| `ResourceGroupNameParameter` | path | Resource Group Name path parameter |
|
|
223
|
-
| `CommonResourceParameters` | path & query | Group of Api version, Subscription ID and Resource group parameter |
|
|
224
|
-
| `ResourceUriParameter` | path | Resource uri path parameter |
|
|
225
|
-
| `OperationIdParameter` | path | Operation Id path parameter |
|
|
226
|
-
|
|
227
|
-
## Generating an OpenAPI Specification
|
|
228
|
-
|
|
229
|
-
To generate an OpenAPI v2 (Swagger) specification from the service definition, run the following command inside of the project folder:
|
|
230
|
-
|
|
231
|
-
```
|
|
232
|
-
tsp compile . --emit @azure-tools/typespec-autorest
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
This will create a file in the `tsp-output` subfolder called `openapi.json`.
|
|
236
|
-
|
|
237
|
-
## A Complete Example
|
|
238
|
-
|
|
239
|
-
Here's a complete example `main.tsp` file based on all of the snippets in this README:
|
|
240
|
-
|
|
241
|
-
```typespec
|
|
242
|
-
import "@typespec/http";
|
|
243
|
-
import "@typespec/rest";
|
|
244
|
-
import "@typespec/versioning";
|
|
245
|
-
import "@azure-tools/typespec-providerhub";
|
|
246
|
-
import "@azure-tools/typespec-azure-core";
|
|
247
|
-
import "@azure-tools/typespec-azure-resource-manager";
|
|
248
|
-
|
|
249
|
-
using TypeSpec.Http;
|
|
250
|
-
using TypeSpec.Rest;
|
|
251
|
-
using TypeSpec.Versioning;
|
|
252
|
-
using Azure.Core;
|
|
253
|
-
using Azure.ResourceManager;
|
|
254
|
-
|
|
255
|
-
@armProviderNamespace
|
|
256
|
-
@service({
|
|
257
|
-
title: "ContosoProviderHubClient",
|
|
258
|
-
version: "2021-01-01-preview",
|
|
259
|
-
})
|
|
260
|
-
@doc("Contoso Resource Provider management API.")
|
|
261
|
-
@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
|
|
262
|
-
namespace Microsoft.ContosoProviderHub;
|
|
263
|
-
|
|
264
|
-
interface Operations extends Azure.ResourceManager.Operations {}
|
|
265
|
-
|
|
266
|
-
@lroStatus
|
|
267
|
-
enum ProvisioningState {
|
|
268
|
-
...ResourceProvisioningState,
|
|
269
|
-
Provisioning,
|
|
270
|
-
Updating,
|
|
271
|
-
Deleting,
|
|
272
|
-
Accepted,
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
@doc("The properties of UserResource")
|
|
276
|
-
model UserResourceProperties {
|
|
277
|
-
@doc("The user's full name")
|
|
278
|
-
fullName: string;
|
|
279
|
-
|
|
280
|
-
@doc("The user's email address.")
|
|
281
|
-
emailAddress: string;
|
|
282
|
-
|
|
283
|
-
@doc("The status of the last operation.")
|
|
284
|
-
provisioningState?: ProvisioningState;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
@doc("A UserResource")
|
|
288
|
-
model UserResource is TrackedResource<UserResourceProperties> {
|
|
289
|
-
@key("userName")
|
|
290
|
-
@segment("users")
|
|
291
|
-
@doc("Address name")
|
|
292
|
-
@path
|
|
293
|
-
name: string;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
@doc("The details of a user notification.")
|
|
297
|
-
model NotificationDetails {
|
|
298
|
-
@doc("The notification message.")
|
|
299
|
-
message: string;
|
|
300
|
-
|
|
301
|
-
@doc("If true, the notification is urgent.")
|
|
302
|
-
urgent: boolean;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
@armResourceOperations
|
|
306
|
-
interface Users extends TrackedResourceOperations<UserResource, UserResourceProperties> {
|
|
307
|
-
@post
|
|
308
|
-
@doc("Send a notification to the user")
|
|
309
|
-
@segment("notify")
|
|
310
|
-
notifyUser(
|
|
311
|
-
...ResourceInstanceParameters<UserResource>,
|
|
312
|
-
@body notification: NotificationDetails
|
|
313
|
-
): ArmResponse<string> | ErrorResponse;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
@doc("An address resource belonging to a user resource.")
|
|
317
|
-
@parentResource(UserResource)
|
|
318
|
-
model AddressResource is ProxyResource<AddressResourceProperties> {
|
|
319
|
-
@doc("Address name")
|
|
320
|
-
@key("addressName")
|
|
321
|
-
@segment("addresses")
|
|
322
|
-
@path
|
|
323
|
-
name: string;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
@doc("The properties of AddressResource")
|
|
327
|
-
model AddressResourceProperties {
|
|
328
|
-
@doc("The street address.")
|
|
329
|
-
streetAddress: string;
|
|
330
|
-
|
|
331
|
-
@doc("The city of the address.")
|
|
332
|
-
city: string;
|
|
16
|
+
## Documentation
|
|
333
17
|
|
|
334
|
-
|
|
335
|
-
state: string;
|
|
18
|
+
All relevant documentation for using the TypeSpec ARM library can be found [here](https://azure.github.io/typespec-azure/).
|
|
336
19
|
|
|
337
|
-
|
|
338
|
-
zip: int32;
|
|
20
|
+
[Getting Started Tutorial](https://azure.github.io/typespec-azure/docs/getstarted/azure-resource-manager/step00)
|
|
339
21
|
|
|
340
|
-
|
|
341
|
-
provisioningState?: ProvisioningState;
|
|
342
|
-
}
|
|
22
|
+
[How-tos and Examples](https://azure.github.io/typespec-azure/docs/howtos/ARM/arm-rules)
|
|
343
23
|
|
|
344
|
-
|
|
345
|
-
interface Addresses extends ProxyResourceOperations<AddressResource> {}
|
|
346
|
-
```
|
|
24
|
+
[Reference](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/reference)
|
package/dist/src/internal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const namespace = "Azure.ResourceManager.Foundations";
|
|
2
|
-
import { DecoratorContext, Interface, Model, ModelProperty,
|
|
2
|
+
import { DecoratorContext, Interface, Model, ModelProperty, Operation, Program } from "@typespec/compiler";
|
|
3
3
|
/**
|
|
4
4
|
* Using ARM common definition for a Model
|
|
5
5
|
* @param {DecoratorContext} context DecoratorContext object
|
|
@@ -9,7 +9,7 @@ import { DecoratorContext, Interface, Model, ModelProperty, Program, Type } from
|
|
|
9
9
|
* @param {string?} referenceFile Optional common file path
|
|
10
10
|
* @returns {void}
|
|
11
11
|
*/
|
|
12
|
-
export declare function $armCommonDefinition(context: DecoratorContext, entity:
|
|
12
|
+
export declare function $armCommonDefinition(context: DecoratorContext, entity: Model, definitionName?: string, version?: string, referenceFile?: string): void;
|
|
13
13
|
/**
|
|
14
14
|
* Refer an model property to be a common ARM parameter
|
|
15
15
|
* @param {DecoratorContext} context DecoratorContext object
|
|
@@ -19,7 +19,7 @@ export declare function $armCommonDefinition(context: DecoratorContext, entity:
|
|
|
19
19
|
* @param {string?} referenceFile Optional common file path
|
|
20
20
|
* @returns void
|
|
21
21
|
*/
|
|
22
|
-
export declare function $armCommonParameter(context: DecoratorContext, entity:
|
|
22
|
+
export declare function $armCommonParameter(context: DecoratorContext, entity: ModelProperty, parameterName?: string, version?: string, referenceFile?: string): void;
|
|
23
23
|
/**
|
|
24
24
|
* This decorator dynamically assigns the serviceNamespace from the containing
|
|
25
25
|
* namespace to the string literal value of the path parameter to which this
|
|
@@ -36,7 +36,7 @@ export declare function $assignProviderNameValue(context: DecoratorContext, targ
|
|
|
36
36
|
* @param {Type} entity Entity to set namespace. Must be a `Operation`.
|
|
37
37
|
* @returns
|
|
38
38
|
*/
|
|
39
|
-
export declare function $armUpdateProviderNamespace(context: DecoratorContext, entity:
|
|
39
|
+
export declare function $armUpdateProviderNamespace(context: DecoratorContext, entity: Operation): void;
|
|
40
40
|
/**
|
|
41
41
|
* Check if an interface is extending the Azure.ResourceManager.Operations interface.
|
|
42
42
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,sCAAsC,CAAC;AAG7D,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,aAAa,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,sCAAsC,CAAC;AAG7D,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,OAAO,EAER,MAAM,oBAAoB,CAAC;AAS5B;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,EACb,cAAc,CAAC,EAAE,MAAM,EACvB,OAAO,CAAC,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,GACrB,IAAI,CAiBN;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,GACrB,IAAI,CAiBN;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,KAAK,GAClB,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,QAwBvF;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAWvF"}
|
package/dist/src/internal.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export const namespace = "Azure.ResourceManager.Foundations";
|
|
2
2
|
import { $useRef } from "@azure-tools/typespec-autorest";
|
|
3
|
-
import { validateDecoratorTarget, } from "@typespec/compiler";
|
|
4
3
|
import { getSegment } from "@typespec/rest";
|
|
5
4
|
import { reportDiagnostic } from "./lib.js";
|
|
6
5
|
import { getArmProviderNamespace } from "./namespace.js";
|
|
@@ -17,9 +16,6 @@ function getArmTypesPath(program) {
|
|
|
17
16
|
* @returns {void}
|
|
18
17
|
*/
|
|
19
18
|
export function $armCommonDefinition(context, entity, definitionName, version, referenceFile) {
|
|
20
|
-
if (!validateDecoratorTarget(context, entity, "@armCommonDefinition", "Model")) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
19
|
// Use the name of the model type if not specified
|
|
24
20
|
if (!definitionName) {
|
|
25
21
|
definitionName = entity.name;
|
|
@@ -47,9 +43,6 @@ export function $armCommonDefinition(context, entity, definitionName, version, r
|
|
|
47
43
|
* @returns void
|
|
48
44
|
*/
|
|
49
45
|
export function $armCommonParameter(context, entity, parameterName, version, referenceFile) {
|
|
50
|
-
if (!validateDecoratorTarget(context, entity, "@armCommonParameter", "ModelProperty")) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
46
|
// Use the name of the model type if not specified
|
|
54
47
|
if (!parameterName) {
|
|
55
48
|
parameterName = entity.name;
|
|
@@ -91,9 +84,6 @@ export function $assignProviderNameValue(context, target, resourceType) {
|
|
|
91
84
|
*/
|
|
92
85
|
export function $armUpdateProviderNamespace(context, entity) {
|
|
93
86
|
const { program } = context;
|
|
94
|
-
if (!validateDecoratorTarget(context, entity, "@armUpdateProviderNamespace", "Operation")) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
87
|
const operation = entity;
|
|
98
88
|
const opInterface = operation.interface;
|
|
99
89
|
if (opInterface && opInterface.namespace) {
|
package/dist/src/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAUzD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,SAAS,eAAe,CAAC,OAAgB;IACvC,OAAO,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,iBAAiB,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,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;wBAClC,SAAS,EAAE,4BAA4B;wBACvC,MAAM,EAAE,aAAa;qBACtB,CAAC,CAAC;oBACH,OAAO;iBACR;gBAED,aAAa,CAAC,IAAI,CAAC,KAAK,GAAG,oBAAoB,CAAC;aACjD;SACF;KACF;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAAgB,EAAE,IAAe;IAC5E,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE;QAC9B,OAAO,KAAK,CAAC;KACd;IACD,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClD,IAAI,aAAa,EAAE;QACjB,IAAI,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,YAAY,EAAE;YACvD,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/src/namespace.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DecoratorContext, Model, Namespace, Program
|
|
1
|
+
import { DecoratorContext, Model, Namespace, Program } from "@typespec/compiler";
|
|
2
2
|
/**
|
|
3
3
|
* `@armProviderNamespace` sets the ARM provider namespace.
|
|
4
4
|
* @param {DecoratorContext} context DecoratorContext object
|
|
5
5
|
* @param {type} entity Target of the decorator. Must be `namespace` type
|
|
6
6
|
* @param {string} armProviderNamespace Provider namespace
|
|
7
7
|
*/
|
|
8
|
-
export declare function $armProviderNamespace(context: DecoratorContext, entity:
|
|
8
|
+
export declare function $armProviderNamespace(context: DecoratorContext, entity: Namespace, armProviderNamespace?: string): void;
|
|
9
9
|
/**
|
|
10
10
|
* Get the ARM provider namespace for a given entity
|
|
11
11
|
* @param {Program} program
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../src/namespace.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EAEhB,KAAK,EAEL,SAAS,EAET,OAAO,
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../src/namespace.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EAEhB,KAAK,EAEL,SAAS,EAET,OAAO,EACR,MAAM,oBAAoB,CAAC;AAS5B;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,oBAAoB,CAAC,EAAE,MAAM,QAmF9B;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,GAAG,KAAK,GACxB,MAAM,GAAG,SAAS,CAepB"}
|
package/dist/src/namespace.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __unsupported_enable_checkStandardOperations } from "@azure-tools/typespec-azure-core";
|
|
2
|
-
import { addService, getNamespaceFullName,
|
|
2
|
+
import { addService, getNamespaceFullName, } from "@typespec/compiler";
|
|
3
3
|
import * as http from "@typespec/http";
|
|
4
4
|
import { getAuthentication, setAuthentication, setRouteOptionsForNamespace } from "@typespec/http";
|
|
5
5
|
import { getResourceTypeForKeyParam } from "@typespec/rest";
|
|
@@ -14,9 +14,6 @@ const armProviderNamespacesKey = createStateSymbol("armProviderNamespaces");
|
|
|
14
14
|
*/
|
|
15
15
|
export function $armProviderNamespace(context, entity, armProviderNamespace) {
|
|
16
16
|
const { program } = context;
|
|
17
|
-
if (!validateDecoratorTarget(context, entity, "@armProviderNamespace", "Namespace")) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
17
|
if (program.stateMap(armProviderNamespacesKey).size > 0) {
|
|
21
18
|
reportDiagnostic(program, {
|
|
22
19
|
code: "single-arm-provider",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../src/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4CAA4C,EAAE,MAAM,kCAAkC,CA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O,SAAS,CAAC;YACnB,CAAC;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAgB,EAChB,MAAyB;IAEzB,IAAI,gBAAgB,GAClB,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;IAE1D,IAAI,oBAAwC,CAAC;IAC7C,OAAO,gBAAgB,EAAE;QACvB,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACxF,IAAI,oBAAoB,EAAE;YACxB,OAAO,oBAAoB,CAAC;SAC7B;QAED,gBAAgB,GAAG,gBAAgB,CAAC,SAAS,CAAC;KAC/C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/src/operations.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DecoratorContext, Model, Operation, Program
|
|
1
|
+
import { DecoratorContext, Model, Operation, Program } from "@typespec/compiler";
|
|
2
2
|
import { HttpOperation } from "@typespec/http";
|
|
3
3
|
export type ArmLifecycleOperationKind = "read" | "createOrUpdate" | "update" | "delete";
|
|
4
4
|
export type ArmOperationKind = ArmLifecycleOperationKind | "list" | "action";
|
|
@@ -28,14 +28,14 @@ interface ArmResourceOperationData {
|
|
|
28
28
|
operationGroup: string;
|
|
29
29
|
}
|
|
30
30
|
export declare function resolveResourceOperations(program: Program, resourceType: Model): ArmResourceOperations;
|
|
31
|
-
export declare function $armResourceRead(context: DecoratorContext, target:
|
|
32
|
-
export declare function $armResourceCreateOrUpdate(context: DecoratorContext, target:
|
|
33
|
-
export declare function $armResourceUpdate(context: DecoratorContext, target:
|
|
34
|
-
export declare function $armResourceDelete(context: DecoratorContext, target:
|
|
35
|
-
export declare function $armResourceList(context: DecoratorContext, target:
|
|
36
|
-
export declare function $armRenameListByOperation(context: DecoratorContext, entity:
|
|
37
|
-
export declare function $armResourceAction(context: DecoratorContext, target:
|
|
38
|
-
export declare function $armResourceCollectionAction(context: DecoratorContext, target:
|
|
31
|
+
export declare function $armResourceRead(context: DecoratorContext, target: Operation, resourceType: Model): void;
|
|
32
|
+
export declare function $armResourceCreateOrUpdate(context: DecoratorContext, target: Operation, resourceType: Model): void;
|
|
33
|
+
export declare function $armResourceUpdate(context: DecoratorContext, target: Operation, resourceType: Model): void;
|
|
34
|
+
export declare function $armResourceDelete(context: DecoratorContext, target: Operation, resourceType: Model): void;
|
|
35
|
+
export declare function $armResourceList(context: DecoratorContext, target: Operation, resourceType: Model): void;
|
|
36
|
+
export declare function $armRenameListByOperation(context: DecoratorContext, entity: Operation, resourceType: Model, parentTypeName?: string, parentFriendlyTypeName?: string): void;
|
|
37
|
+
export declare function $armResourceAction(context: DecoratorContext, target: Operation, resourceType: Model): void;
|
|
38
|
+
export declare function $armResourceCollectionAction(context: DecoratorContext, target: Operation): void;
|
|
39
39
|
export declare function isArmCollectionAction(program: Program, target: Operation): boolean;
|
|
40
40
|
export {};
|
|
41
41
|
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEhB,KAAK,EACL,SAAS,EACT,OAAO,
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEhB,KAAK,EACL,SAAS,EACT,OAAO,EACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKjE,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACxF,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,GAAG,MAAM,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AO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,KAAK,QAkBpB;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,KAAK,EACnB,cAAc,CAAC,EAAE,MAAM,EACvB,sBAAsB,CAAC,EAAE,MAAM,QAyChC;AAkBD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,KAAK,QA0BpB;AASD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,QAExF;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAElF"}
|
package/dist/src/operations.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $doc, ignoreDiagnostics,
|
|
1
|
+
import { $doc, ignoreDiagnostics, } from "@typespec/compiler";
|
|
2
2
|
import { getHttpOperation } from "@typespec/http";
|
|
3
3
|
import { $actionSegment, getActionSegment, getParentResource, getSegment } from "@typespec/rest";
|
|
4
4
|
import { createStateSymbol, reportDiagnostic } from "./lib.js";
|
|
@@ -35,15 +35,6 @@ export function resolveResourceOperations(program, resourceType) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
function setResourceLifecycleOperation(context, target, resourceType, kind, decoratorName) {
|
|
38
|
-
// If the properties type is a template parameter, this must be a templated type
|
|
39
|
-
if (resourceType.kind === "TemplateParameter") {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (!validateDecoratorTarget(context, target, decoratorName, "Operation") ||
|
|
43
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
44
|
-
!validateDecoratorParamType(context.program, target, resourceType, "Model")) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
38
|
// Only register methods from non-templated interface types
|
|
48
39
|
if (target.interface === undefined || target.interface.node.templateParameters.length > 0) {
|
|
49
40
|
return;
|
|
@@ -72,15 +63,6 @@ export function $armResourceDelete(context, target, resourceType) {
|
|
|
72
63
|
setResourceLifecycleOperation(context, target, resourceType, "delete", "@armResourceDelete");
|
|
73
64
|
}
|
|
74
65
|
export function $armResourceList(context, target, resourceType) {
|
|
75
|
-
// If the properties type is a template parameter, this must be a templated type
|
|
76
|
-
if (resourceType.kind === "TemplateParameter") {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (!validateDecoratorTarget(context, target, "@armResourceList", "Operation") ||
|
|
80
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
81
|
-
!validateDecoratorParamType(context.program, target, resourceType, "Model")) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
66
|
// Only register methods from non-templated interface types
|
|
85
67
|
if (target.interface === undefined || target.interface.node.templateParameters.length > 0) {
|
|
86
68
|
return;
|
|
@@ -98,15 +80,6 @@ export function $armResourceList(context, target, resourceType) {
|
|
|
98
80
|
}
|
|
99
81
|
export function $armRenameListByOperation(context, entity, resourceType, parentTypeName, parentFriendlyTypeName) {
|
|
100
82
|
const { program } = context;
|
|
101
|
-
if (resourceType.kind === "TemplateParameter") {
|
|
102
|
-
// Don't execute when this decorator is being applied within a templated interface
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
if (!validateDecoratorTarget(context, entity, "@armRenameListByOperation", "Operation") ||
|
|
106
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
107
|
-
!validateDecoratorParamType(program, entity, resourceType, "Model")) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
83
|
if (parentTypeName === undefined ||
|
|
111
84
|
parentTypeName === "" ||
|
|
112
85
|
parentFriendlyTypeName === undefined ||
|
|
@@ -151,15 +124,6 @@ function getArmParentName(program, resource) {
|
|
|
151
124
|
export function $armResourceAction(context, target, resourceType) {
|
|
152
125
|
var _a;
|
|
153
126
|
const { program } = context;
|
|
154
|
-
// If the properties type is a template parameter, this must be a templated type
|
|
155
|
-
if (resourceType.kind === "TemplateParameter") {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
if (!validateDecoratorTarget(context, target, "@armResourceAction", "Operation") ||
|
|
159
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
160
|
-
!validateDecoratorParamType(program, target, resourceType, "Model")) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
127
|
// Only register methods from non-templated interface types
|
|
164
128
|
if (target.interface === undefined || target.interface.node.templateParameters.length > 0) {
|
|
165
129
|
return;
|
|
@@ -187,8 +151,6 @@ function uncapitalize(name) {
|
|
|
187
151
|
return name[0].toLowerCase() + name.substring(1);
|
|
188
152
|
}
|
|
189
153
|
export function $armResourceCollectionAction(context, target) {
|
|
190
|
-
if (!validateDecoratorTarget(context, target, "@armResourceCollectionAction", "Operation"))
|
|
191
|
-
return;
|
|
192
154
|
context.program.stateMap(armResourceCollectionActionKey).set(target, true);
|
|
193
155
|
}
|
|
194
156
|
export function isArmCollectionAction(program, target) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEJ,iBAAiB,
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEJ,iBAAiB,GAIlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAiB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AA2C1F,MAA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,4BAA4B,CAAC,OAAyB,EAAE,MAAiB;IACvF,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAgB,EAAE,MAAiB;IACvE,OAAO,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;AAC/E,CAAC"}
|
package/dist/src/resource.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DecoratorContext, Model, ModelProperty, Program,
|
|
1
|
+
import { DecoratorContext, Interface, Model, ModelProperty, Operation, Program, Tuple } from "@typespec/compiler";
|
|
2
2
|
import { ArmResourceOperations } from "./operations.js";
|
|
3
3
|
export type ArmResourceKind = "Tracked" | "Proxy" | "Extension";
|
|
4
4
|
/**
|
|
@@ -39,7 +39,7 @@ export declare function getArmResourceKind(resourceType: Model): ArmResourceKind
|
|
|
39
39
|
* decorator, so it also gets applied to the type which absorbs the `TrackedResource<T>`
|
|
40
40
|
* definition by using the `is` keyword.
|
|
41
41
|
*/
|
|
42
|
-
export declare function $armResourceInternal(context: DecoratorContext, resourceType:
|
|
42
|
+
export declare function $armResourceInternal(context: DecoratorContext, resourceType: Model, propertiesType: Model): void;
|
|
43
43
|
/**
|
|
44
44
|
* This decorator is used to identify interfaces containing resource operations.
|
|
45
45
|
* When applied, it marks the interface with the `@autoRoute` decorator so that
|
|
@@ -50,14 +50,14 @@ export declare function $armResourceInternal(context: DecoratorContext, resource
|
|
|
50
50
|
* of the operations will be grouped based on the interface name in generated
|
|
51
51
|
* clients.
|
|
52
52
|
*/
|
|
53
|
-
export declare function $armResourceOperations(context: DecoratorContext, interfaceType:
|
|
53
|
+
export declare function $armResourceOperations(context: DecoratorContext, interfaceType: Interface): void;
|
|
54
54
|
/**
|
|
55
55
|
* This decorator is used to mark a resource type as a "singleton", a type with
|
|
56
56
|
* only one instance. The standard set of resource operations can be applied to
|
|
57
57
|
* such a resource type, they will generate the correct routes and parameter
|
|
58
58
|
* lists.
|
|
59
59
|
*/
|
|
60
|
-
export declare function $singleton(context: DecoratorContext, resourceType:
|
|
60
|
+
export declare function $singleton(context: DecoratorContext, resourceType: Model, keyValue?: string): void;
|
|
61
61
|
export declare function isSingletonResource(program: Program, resourceType: Model): boolean;
|
|
62
62
|
export declare function getSingletonResourceKey(program: Program, resourceType: Model): string | undefined;
|
|
63
63
|
export declare enum ResourceBaseType {
|
|
@@ -67,15 +67,15 @@ export declare enum ResourceBaseType {
|
|
|
67
67
|
ResourceGroup = "ResourceGroup",
|
|
68
68
|
Extension = "Extension"
|
|
69
69
|
}
|
|
70
|
-
export declare function $tenantResource(context: DecoratorContext, entity:
|
|
71
|
-
export declare function $subscriptionResource(context: DecoratorContext, entity:
|
|
72
|
-
export declare function $locationResource(context: DecoratorContext, entity:
|
|
73
|
-
export declare function $resourceGroupResource(context: DecoratorContext, entity:
|
|
74
|
-
export declare function $extensionResource(context: DecoratorContext, entity:
|
|
75
|
-
export declare function $armProviderNameValue(context: DecoratorContext, entity:
|
|
76
|
-
export declare function $resourceParameterBaseFor(context: DecoratorContext, entity:
|
|
77
|
-
export declare function $resourceBaseParametersOf(context: DecoratorContext, entity:
|
|
78
|
-
export declare function $omitIfEmpty(context: DecoratorContext, entity:
|
|
70
|
+
export declare function $tenantResource(context: DecoratorContext, entity: Model): void;
|
|
71
|
+
export declare function $subscriptionResource(context: DecoratorContext, entity: Model): void;
|
|
72
|
+
export declare function $locationResource(context: DecoratorContext, entity: Model): void;
|
|
73
|
+
export declare function $resourceGroupResource(context: DecoratorContext, entity: Model): void;
|
|
74
|
+
export declare function $extensionResource(context: DecoratorContext, entity: Model): void;
|
|
75
|
+
export declare function $armProviderNameValue(context: DecoratorContext, entity: Operation): void;
|
|
76
|
+
export declare function $resourceParameterBaseFor(context: DecoratorContext, entity: ModelProperty, values: Tuple): void;
|
|
77
|
+
export declare function $resourceBaseParametersOf(context: DecoratorContext, entity: Model, resourceType: Model): void;
|
|
78
|
+
export declare function $omitIfEmpty(context: DecoratorContext, entity: Model, propertyName: string): void;
|
|
79
79
|
export declare function isResourceParameterBaseFor(program: Program, property: ModelProperty, resourceBaseType: string): boolean;
|
|
80
80
|
export declare function getResourceParameterBases(program: Program, property: ModelProperty): string[] | undefined;
|
|
81
81
|
export declare function getResourceBaseType(program: Program, resource: Model): ResourceBaseType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAIhB,SAAS,EAET,KAAK,EACL,aAAa,EACb,SAAS,EACT,OAAO,EACP,KAAK,EAEN,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,qBAAqB,EAA6B,MAAM,iBAAiB,CAAC;AAEnF,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,KAAK,CAAC;CACrB;AAED,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,UAAU,EAAE,qBAAqB,CAAC;CACnC;AAiBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAiBtE;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,KAAK,GAClB,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,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,QAE1E;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,QAQjF;AAuBD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,KAAK,QAUd;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,EACb,YAAY,EAAE,KAAK,QAepB;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,QAU1F;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,aAAa,EACvB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAMT;AAgBD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,aAAa,GACtB,MAAM,EAAE,GAAG,SAAS,CAEtB;AAaD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,GAAG,gBAAgB,CAYvF"}
|
package/dist/src/resource.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $tag, $visibility, getKeyName, getTags, getTypeName, isGlobalNamespace,
|
|
1
|
+
import { $tag, $visibility, getKeyName, getTags, getTypeName, isGlobalNamespace, } from "@typespec/compiler";
|
|
2
2
|
import { $autoRoute, getParentResource, getSegment } from "@typespec/rest";
|
|
3
3
|
import { createStateSymbol, reportDiagnostic } from "./lib.js";
|
|
4
4
|
import { getArmProviderNamespace } from "./namespace.js";
|
|
@@ -78,15 +78,6 @@ export function getArmResourceKind(resourceType) {
|
|
|
78
78
|
*/
|
|
79
79
|
export function $armResourceInternal(context, resourceType, propertiesType) {
|
|
80
80
|
const { program } = context;
|
|
81
|
-
// If the properties type is a template parameter, this must be a templated type
|
|
82
|
-
if (propertiesType.kind === "TemplateParameter") {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (!validateDecoratorTarget(context, resourceType, "@armResource", "Model") ||
|
|
86
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
87
|
-
!validateDecoratorParamType(program, resourceType, propertiesType, "Model")) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
81
|
if (resourceType.namespace && getTypeName(resourceType.namespace) === "Azure.ResourceManager") {
|
|
91
82
|
// The @armResource decorator will be evaluated on instantiations of
|
|
92
83
|
// base templated resource types like TrackedResource<SomeResource>,
|
|
@@ -167,9 +158,6 @@ export function $armResourceInternal(context, resourceType, propertiesType) {
|
|
|
167
158
|
*/
|
|
168
159
|
export function $armResourceOperations(context, interfaceType) {
|
|
169
160
|
const { program } = context;
|
|
170
|
-
if (!validateDecoratorTarget(context, interfaceType, "@armResourceOperations", "Interface")) {
|
|
171
|
-
return undefined;
|
|
172
|
-
}
|
|
173
161
|
// All resource interfaces should use @autoRoute
|
|
174
162
|
context.call($autoRoute, interfaceType);
|
|
175
163
|
// If no tag is given for the interface, tag it with the interface name
|
|
@@ -184,9 +172,6 @@ export function $armResourceOperations(context, interfaceType) {
|
|
|
184
172
|
* lists.
|
|
185
173
|
*/
|
|
186
174
|
export function $singleton(context, resourceType, keyValue = "default") {
|
|
187
|
-
if (!validateDecoratorTarget(context, resourceType, "@singleton", "Model")) {
|
|
188
|
-
return undefined;
|
|
189
|
-
}
|
|
190
175
|
context.program.stateMap(armSingletonResourcesKey).set(resourceType, keyValue);
|
|
191
176
|
}
|
|
192
177
|
export function isSingletonResource(program, resourceType) {
|
|
@@ -206,38 +191,21 @@ export var ResourceBaseType;
|
|
|
206
191
|
const resourceBaseTypeKey = createStateSymbol("resourceBaseTypeKey");
|
|
207
192
|
const parameterBaseTypesKey = createStateSymbol("parameterBaseTypesKey");
|
|
208
193
|
export function $tenantResource(context, entity) {
|
|
209
|
-
if (!validateDecoratorTarget(context, entity, "@tenantResource", "Model")) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
194
|
setResourceBaseType(context.program, entity, "Tenant");
|
|
213
195
|
}
|
|
214
196
|
export function $subscriptionResource(context, entity) {
|
|
215
|
-
if (!validateDecoratorTarget(context, entity, "@subscriptionResource", "Model")) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
197
|
setResourceBaseType(context.program, entity, "Subscription");
|
|
219
198
|
}
|
|
220
199
|
export function $locationResource(context, entity) {
|
|
221
|
-
if (!validateDecoratorTarget(context, entity, "@locationResource", "Model")) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
200
|
setResourceBaseType(context.program, entity, "Location");
|
|
225
201
|
}
|
|
226
202
|
export function $resourceGroupResource(context, entity) {
|
|
227
|
-
if (!validateDecoratorTarget(context, entity, "@resourceGroupResource", "Model")) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
203
|
setResourceBaseType(context.program, entity, "ResourceGroup");
|
|
231
204
|
}
|
|
232
205
|
export function $extensionResource(context, entity) {
|
|
233
|
-
if (!validateDecoratorTarget(context, entity, "@extensionResource", "Model")) {
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
206
|
setResourceBaseType(context.program, entity, "Extension");
|
|
237
207
|
}
|
|
238
208
|
export function $armProviderNameValue(context, entity) {
|
|
239
|
-
if (!validateDecoratorTarget(context, entity, "@armProviderNameValue", "Operation"))
|
|
240
|
-
return;
|
|
241
209
|
const armProvider = getServiceNamespace(context.program, entity);
|
|
242
210
|
if (armProvider === undefined)
|
|
243
211
|
return;
|
|
@@ -265,12 +233,6 @@ function getServiceNamespace(program, type) {
|
|
|
265
233
|
}
|
|
266
234
|
}
|
|
267
235
|
export function $resourceParameterBaseFor(context, entity, values) {
|
|
268
|
-
if (!validateDecoratorTarget(context, entity, "@resourceParameterBaseFor", "ModelProperty")) {
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
if (!validateDecoratorTarget(context, values, "@resourceParameterBaseFor", "Tuple")) {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
236
|
const resolvedValues = [];
|
|
275
237
|
for (const value of values.values) {
|
|
276
238
|
if (value.kind !== "EnumMember") {
|
|
@@ -281,12 +243,6 @@ export function $resourceParameterBaseFor(context, entity, values) {
|
|
|
281
243
|
context.program.stateMap(parameterBaseTypesKey).set(entity, resolvedValues);
|
|
282
244
|
}
|
|
283
245
|
export function $resourceBaseParametersOf(context, entity, resourceType) {
|
|
284
|
-
if (!validateDecoratorTarget(context, entity, "@resourceBaseParameterseOf", "Model")) {
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
if (!validateDecoratorTarget(context, resourceType, "@resourceBaseParameterseOf", "Model")) {
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
246
|
const targetResourceBaseType = getResourceBaseType(context.program, resourceType);
|
|
291
247
|
const removedProperties = [];
|
|
292
248
|
for (const [propertyName, property] of entity.properties) {
|
|
@@ -298,9 +254,6 @@ export function $resourceBaseParametersOf(context, entity, resourceType) {
|
|
|
298
254
|
}
|
|
299
255
|
}
|
|
300
256
|
export function $omitIfEmpty(context, entity, propertyName) {
|
|
301
|
-
if (!validateDecoratorTarget(context, entity, "@omitIfEmpty", "Model")) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
257
|
const modelProp = getProperty(entity, propertyName);
|
|
305
258
|
if (modelProp &&
|
|
306
259
|
modelProp.type.kind === "Model" &&
|
package/dist/src/resource.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,WAAW,EAEX,UAAU,EACV,OAAO,EACP,WAAW,EACX,iBAAiB,EAKjB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,gBA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AG,MAAA,KAAK,CAAC,UAAU,0CAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACzD,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,SAAS,EAAE;QACtC,cAAc,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;KAC7D;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,SAAS,WAAW,CAAC,OAAgB,EAAE,KAAY;IACjD,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,KAAK,CAAC,SAAS;QAAE,OAAO,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAClE,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
namespace Azure.ResourceManager.Foundations;
|
|
2
|
+
|
|
3
|
+
using TypeSpec.Reflection;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Update the ARM provider namespace for a given entity.
|
|
7
|
+
*/
|
|
8
|
+
extern dec armUpdateProviderNamespace(target: Reflection.Operation);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param resource Resource model
|
|
12
|
+
*/
|
|
13
|
+
extern dec assignProviderNameValue(target: ModelProperty, resource: Model);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param definitionName Definition name
|
|
17
|
+
* @param version Arm Version
|
|
18
|
+
* @param referenceFile Reference file
|
|
19
|
+
*/
|
|
20
|
+
extern dec armCommonDefinition(
|
|
21
|
+
target: Model,
|
|
22
|
+
definitionName?: string,
|
|
23
|
+
version?: string,
|
|
24
|
+
referenceFile?: string
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @param definitionName Definition name
|
|
29
|
+
* @param version Arm Version
|
|
30
|
+
* @param referenceFile Reference file
|
|
31
|
+
*/
|
|
32
|
+
extern dec armCommonParameter(
|
|
33
|
+
target: ModelProperty,
|
|
34
|
+
definitionName?: string,
|
|
35
|
+
version?: string,
|
|
36
|
+
referenceFile?: string
|
|
37
|
+
);
|
package/lib/arm.tsp
CHANGED
package/lib/decorators.tsp
CHANGED
|
@@ -96,4 +96,91 @@ extern dec armProviderNameValue(target: Operation | object);
|
|
|
96
96
|
/**
|
|
97
97
|
* Marks the operation as being a collection action
|
|
98
98
|
*/
|
|
99
|
-
extern dec armResourceCollectionAction(target: Operation
|
|
99
|
+
extern dec armResourceCollectionAction(target: Operation);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Marks the operation as being a collection action
|
|
103
|
+
* @param resourceType Resource
|
|
104
|
+
* @param parentTypeName: Parent type name.
|
|
105
|
+
* @param parentFriendlyTypeName Friendly name for parent.
|
|
106
|
+
*/
|
|
107
|
+
extern dec armRenameListByOperation(
|
|
108
|
+
target: Operation,
|
|
109
|
+
resourceType: Model,
|
|
110
|
+
parentTypeName?: string,
|
|
111
|
+
parentFriendlyTypeName?: string
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @param resourceType Resource model
|
|
116
|
+
*/
|
|
117
|
+
extern dec armResourceAction(target: Operation, resourceType: Model);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @param resourceType Resource model
|
|
121
|
+
*/
|
|
122
|
+
extern dec armResourceCreateOrUpdate(target: Operation, resourceType: Model);
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @param resourceType Resource model
|
|
126
|
+
*/
|
|
127
|
+
extern dec armResourceRead(target: Operation, resourceType: Model);
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @param resourceType Resource model
|
|
131
|
+
*/
|
|
132
|
+
extern dec armResourceUpdate(target: Operation, resourceType: Model);
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @param resourceType Resource model
|
|
136
|
+
*/
|
|
137
|
+
extern dec armResourceDelete(target: Operation, resourceType: Model);
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @param resourceType Resource model
|
|
141
|
+
*/
|
|
142
|
+
extern dec armResourceList(target: Operation, resourceType: Model);
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* This decorator is used to identify ARM resource types and extract their
|
|
146
|
+
* metadata. It is *not* meant to be used directly by a spec author, it instead
|
|
147
|
+
* gets implicitly applied when the spec author defines a model type in this form:
|
|
148
|
+
*
|
|
149
|
+
* `model Server is TrackedResource<ServerProperties>;`
|
|
150
|
+
*
|
|
151
|
+
* The `TrackedResource<T>` type (and other associated base types) use the `@armResource`
|
|
152
|
+
* decorator, so it also gets applied to the type which absorbs the `TrackedResource<T>`
|
|
153
|
+
* definition by using the `is` keyword.
|
|
154
|
+
*
|
|
155
|
+
* @param properties Arm resource properties
|
|
156
|
+
*/
|
|
157
|
+
extern dec armResourceInternal(target: Model, properties: Model);
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* This decorator is used to identify interfaces containing resource operations.
|
|
161
|
+
* When applied, it marks the interface with the `@autoRoute` decorator so that
|
|
162
|
+
* all of its contained operations will have their routes generated
|
|
163
|
+
* automatically.
|
|
164
|
+
*
|
|
165
|
+
* It also adds a `@tag` decorator bearing the name of the interface so that all
|
|
166
|
+
* of the operations will be grouped based on the interface name in generated
|
|
167
|
+
* clients.
|
|
168
|
+
* @param _ DEPRECATED
|
|
169
|
+
*/
|
|
170
|
+
extern dec armResourceOperations(target: Interface, _?: unknown);
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Omit a property in the target model.
|
|
174
|
+
* @internal
|
|
175
|
+
* @param propertyName Name of the property to omit
|
|
176
|
+
*/
|
|
177
|
+
extern dec omitIfEmpty(target: Model, propertyName: string);
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @param propertyName Name of the property to omit
|
|
181
|
+
*/
|
|
182
|
+
extern dec resourceBaseParametersOf(target: Model, propertyName: Model);
|
|
183
|
+
/**
|
|
184
|
+
* @param values Values
|
|
185
|
+
*/
|
|
186
|
+
extern dec resourceParameterBaseFor(target: ModelProperty, values: unknown[]);
|
package/lib/interfaces.tsp
CHANGED
|
@@ -155,8 +155,8 @@ interface ResourceListBySubscription<TResource extends ArmResource> {
|
|
|
155
155
|
interface ResourceListByParent<
|
|
156
156
|
TResource extends ArmResource,
|
|
157
157
|
TBaseParameters = BaseParameters<TResource>,
|
|
158
|
-
TParentName = "",
|
|
159
|
-
TParentFriendlyName = ""
|
|
158
|
+
TParentName extends string = "",
|
|
159
|
+
TParentFriendlyName extends string = ""
|
|
160
160
|
> {
|
|
161
161
|
/**
|
|
162
162
|
* List resources by parent.
|
package/lib/models.tsp
CHANGED
|
@@ -15,7 +15,7 @@ namespace Azure.ResourceManager;
|
|
|
15
15
|
@doc("Concrete tracked resource types can be created by aliasing this type using a specific property type.")
|
|
16
16
|
@armResourceInternal(TProperties)
|
|
17
17
|
@includeInapplicableMetadataInPayload(false)
|
|
18
|
-
model TrackedResource<TProperties> extends TrackedResourceBase {
|
|
18
|
+
model TrackedResource<TProperties extends {}> extends TrackedResourceBase {
|
|
19
19
|
@doc("The resource-specific properties for this resource.")
|
|
20
20
|
@visibility("read", "create")
|
|
21
21
|
@extension("x-ms-client-flatten", true)
|
|
@@ -31,7 +31,7 @@ model TrackedResource<TProperties> extends TrackedResourceBase {
|
|
|
31
31
|
@doc("Concrete proxy resource types can be created by aliasing this type using a specific property type.")
|
|
32
32
|
@armResourceInternal(TProperties)
|
|
33
33
|
@includeInapplicableMetadataInPayload(false)
|
|
34
|
-
model ProxyResource<TProperties> extends ProxyResourceBase {
|
|
34
|
+
model ProxyResource<TProperties extends {}> extends ProxyResourceBase {
|
|
35
35
|
@doc("The resource-specific properties for this resource.")
|
|
36
36
|
@visibility("read", "create")
|
|
37
37
|
@extension("x-ms-client-flatten", true)
|
|
@@ -48,7 +48,7 @@ model ProxyResource<TProperties> extends ProxyResourceBase {
|
|
|
48
48
|
@doc("Concrete extension resource types can be created by aliasing this type using a specific property type.")
|
|
49
49
|
@armResourceInternal(TProperties)
|
|
50
50
|
@includeInapplicableMetadataInPayload(false)
|
|
51
|
-
model ExtensionResource<TProperties> extends ExtensionResourceBase {
|
|
51
|
+
model ExtensionResource<TProperties extends {}> extends ExtensionResourceBase {
|
|
52
52
|
@doc("The resource-specific properties for this resource.")
|
|
53
53
|
@visibility("read", "create")
|
|
54
54
|
@extension("x-ms-client-flatten", true)
|
|
@@ -76,7 +76,7 @@ model ParentKeysOf<TResource> {}
|
|
|
76
76
|
* Model describing the provider namespace.
|
|
77
77
|
* @template TResource The resource provided by the namespace.
|
|
78
78
|
*/
|
|
79
|
-
model ProviderNamespace<TResource> {
|
|
79
|
+
model ProviderNamespace<TResource extends {}> {
|
|
80
80
|
@path
|
|
81
81
|
@segment("providers")
|
|
82
82
|
@assignProviderNameValue(TResource)
|
package/lib/operations.tsp
CHANGED
|
@@ -38,8 +38,8 @@ op ArmListBySubscription<TResource extends ArmResource>(
|
|
|
38
38
|
op ArmResourceListByParent<
|
|
39
39
|
TResource extends ArmResource,
|
|
40
40
|
TBaseParameters = BaseParameters<TResource>,
|
|
41
|
-
TParentName = "",
|
|
42
|
-
TParentFriendlyName = ""
|
|
41
|
+
TParentName extends string = "",
|
|
42
|
+
TParentFriendlyName extends string = ""
|
|
43
43
|
>(
|
|
44
44
|
...ResourceParentParameters<TResource, TBaseParameters>
|
|
45
45
|
): ArmResponse<ResourceListResult<TResource>> | ErrorResponse;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-azure-resource-manager",
|
|
3
|
-
"version": "0.31.0-dev.
|
|
3
|
+
"version": "0.31.0-dev.4",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Resource Manager library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@typespec/compiler": "~0.44.0 || >=0.45.0-dev <0.45.0",
|
|
46
46
|
"@azure-tools/typespec-azure-core": "~0.30.1 || >=0.31.0-dev <0.31.0",
|
|
47
|
-
"@azure-tools/typespec-autorest": "~0.30.
|
|
47
|
+
"@azure-tools/typespec-autorest": "~0.30.1 || >=0.31.0-dev <0.31.0",
|
|
48
48
|
"@typespec/openapi": "~0.44.0 || >=0.45.0-dev <0.45.0",
|
|
49
49
|
"@typespec/rest": "~0.44.0 || >=0.45.0-dev <0.45.0",
|
|
50
50
|
"@typespec/http": "~0.44.0 || >=0.45.0-dev <0.45.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@typespec/compiler": "~0.44.0 || >=0.45.0-dev <0.45.0",
|
|
58
58
|
"@typespec/openapi": "~0.44.0 || >=0.45.0-dev <0.45.0",
|
|
59
59
|
"@azure-tools/typespec-azure-core": "~0.30.1 || >=0.31.0-dev <0.31.0",
|
|
60
|
-
"@azure-tools/typespec-autorest": "~0.30.
|
|
60
|
+
"@azure-tools/typespec-autorest": "~0.30.1 || >=0.31.0-dev <0.31.0",
|
|
61
61
|
"@typespec/rest": "~0.44.0 || >=0.45.0-dev <0.45.0",
|
|
62
62
|
"@typespec/http": "~0.44.0 || >=0.45.0-dev <0.45.0",
|
|
63
63
|
"@typespec/versioning": "~0.44.0 || >=0.45.0-dev <0.45.0",
|