@azure-tools/typespec-azure-resource-manager 0.42.0-dev.6 → 0.42.0-dev.8
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/src/rules/arm-resource-patch.d.ts.map +1 -1
- package/dist/src/rules/arm-resource-patch.js +3 -2
- package/dist/src/rules/arm-resource-patch.js.map +1 -1
- package/lib/arm.foundations.tsp +2 -2
- package/lib/models.tsp +13 -11
- package/lib/private-links.tsp +10 -8
- package/lib/responses.tsp +11 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arm-resource-patch.d.ts","sourceRoot":"","sources":["../../../src/rules/arm-resource-patch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arm-resource-patch.d.ts","sourceRoot":"","sources":["../../../src/rules/arm-resource-patch.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,mBAAmB;;;;EAwB9B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRule, getEffectiveModelType, getProperty, isErrorType, paramMessage, } from "@typespec/compiler";
|
|
2
|
-
import { getOperationVerb, isBody, isHeader, isPathParam, isQueryParam } from "@typespec/http";
|
|
2
|
+
import { getOperationVerb, isBody, isBodyRoot, isHeader, isPathParam, isQueryParam, } from "@typespec/http";
|
|
3
3
|
import { getArmResource } from "../resource.js";
|
|
4
4
|
import { getSourceModel, isInternalTypeSpec } from "./utils.js";
|
|
5
5
|
export const patchOperationsRule = createRule({
|
|
@@ -95,7 +95,8 @@ function getPatchModel(program, operation) {
|
|
|
95
95
|
isQueryParam(program, property) ||
|
|
96
96
|
isPathParam(program, property))
|
|
97
97
|
continue;
|
|
98
|
-
if (isBody(program, property)
|
|
98
|
+
if ((isBody(program, property) || isBodyRoot(program, property)) &&
|
|
99
|
+
property.type.kind === "Scalar")
|
|
99
100
|
return undefined;
|
|
100
101
|
bodyProperties.push(property);
|
|
101
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arm-resource-patch.js","sourceRoot":"","sources":["../../../src/rules/arm-resource-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"arm-resource-patch.js","sourceRoot":"","sources":["../../../src/rules/arm-resource-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhE,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;IAC5C,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,gCAAgC;IAC7C,QAAQ,EAAE;QACR,OAAO,EAAE,kFAAkF;QAC3F,WAAW,EAAE,kDAAkD;QAC/D,aAAa,EAAE,YAAY,CAAA,2FAA2F,MAAM,qCAAqC,eAAe,IAAI;KACrL;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,SAAS,EAAE,CAAC,SAAoB,EAAE,EAAE;gBAClC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;oBACpD,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;oBAC1D,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;wBACrB,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,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sp
CHANGED
|
@@ -794,7 +794,7 @@ op ArmCreateOperation<
|
|
|
794
794
|
ErrorResponse extends {}
|
|
795
795
|
>(
|
|
796
796
|
...HttpParameters,
|
|
797
|
-
@doc("Resource create parameters.") @
|
|
797
|
+
@doc("Resource create parameters.") @bodyRoot resource: BodyParameter,
|
|
798
798
|
): Response | ErrorResponse;
|
|
799
799
|
|
|
800
800
|
/**
|
|
@@ -811,5 +811,5 @@ op ArmUpdateOperation<
|
|
|
811
811
|
ErrorResponse extends {}
|
|
812
812
|
>(
|
|
813
813
|
...HttpParameters,
|
|
814
|
-
@doc("The resource properties to be updated.") @
|
|
814
|
+
@doc("The resource properties to be updated.") @bodyRoot properties: BodyParameter,
|
|
815
815
|
): Response | ErrorResponse;
|
package/lib/models.tsp
CHANGED
|
@@ -99,32 +99,34 @@ alias ResourceIdentifier<AllowedResourceTypes extends ArmResourceIdentifierAllow
|
|
|
99
99
|
alias ResourceIdentifierAllowedResource = ArmResourceIdentifierAllowedResource;
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
|
-
* Standard terminal provisioning state of resource type. You can
|
|
102
|
+
* Standard terminal provisioning state of resource type. You can include in your
|
|
103
103
|
* custom provision state to avoid duplication and ensure consistency
|
|
104
104
|
*
|
|
105
105
|
* @example
|
|
106
106
|
*
|
|
107
107
|
* ```typespec
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* starting,
|
|
111
|
-
* started,
|
|
112
|
-
* stopping,
|
|
113
|
-
* stopped,
|
|
108
|
+
* union FooProvisioningState {
|
|
109
|
+
* ResourceProvisioningState, // include standard provisioning states
|
|
110
|
+
* starting: "starting",
|
|
111
|
+
* started: "started",
|
|
112
|
+
* stopping: "stopping",
|
|
113
|
+
* stopped: "stopped",
|
|
114
114
|
* }
|
|
115
115
|
* ```
|
|
116
116
|
*/
|
|
117
117
|
@doc("The provisioning state of a resource type.")
|
|
118
118
|
@Azure.Core.lroStatus
|
|
119
|
-
|
|
119
|
+
union ResourceProvisioningState {
|
|
120
120
|
@doc("Resource has been created.")
|
|
121
|
-
Succeeded,
|
|
121
|
+
Succeeded: "Succeeded",
|
|
122
122
|
|
|
123
123
|
@doc("Resource creation failed.")
|
|
124
|
-
Failed,
|
|
124
|
+
Failed: "Failed",
|
|
125
125
|
|
|
126
126
|
@doc("Resource creation was canceled.")
|
|
127
|
-
Canceled,
|
|
127
|
+
Canceled: "Canceled",
|
|
128
|
+
|
|
129
|
+
string,
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
/**
|
package/lib/private-links.tsp
CHANGED
|
@@ -96,26 +96,28 @@ model PrivateLinkServiceConnectionState {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/** The provisioning state of the connection */
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
union PrivateEndpointConnectionProvisioningState {
|
|
100
|
+
ResourceProvisioningState,
|
|
101
101
|
|
|
102
102
|
/** Connection is being created */
|
|
103
|
-
Creating,
|
|
103
|
+
Creating: "Creating",
|
|
104
104
|
|
|
105
105
|
/** Connection is being deleted */
|
|
106
|
-
Deleting,
|
|
106
|
+
Deleting: "Deleting",
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/** The private endpoint connection status */
|
|
110
|
-
|
|
110
|
+
union PrivateEndpointServiceConnectionStatus {
|
|
111
111
|
/** Connectionaiting for approval or rejection */
|
|
112
|
-
Pending,
|
|
112
|
+
Pending: "Pending",
|
|
113
113
|
|
|
114
114
|
/** Connection approved */
|
|
115
|
-
Approved,
|
|
115
|
+
Approved: "Approved",
|
|
116
116
|
|
|
117
117
|
/** Connection Rejected */
|
|
118
|
-
Rejected,
|
|
118
|
+
Rejected: "Rejected",
|
|
119
|
+
|
|
120
|
+
string,
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
model PrivateLinkResource extends Azure.ResourceManager.Foundations.ProxyResourceBase {
|
package/lib/responses.tsp
CHANGED
|
@@ -13,7 +13,10 @@ namespace Azure.ResourceManager;
|
|
|
13
13
|
@doc("Azure operation completed successfully.")
|
|
14
14
|
model ArmResponse<ResponseBody> {
|
|
15
15
|
...OkResponse;
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
@doc("The body type of the operation request or response.")
|
|
18
|
+
@bodyRoot
|
|
19
|
+
body: ResponseBody;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
/**
|
|
@@ -88,7 +91,7 @@ model ArmAcceptedLroResponse<
|
|
|
88
91
|
*/
|
|
89
92
|
model ArmOperationStatus<
|
|
90
93
|
Properties extends {} = never,
|
|
91
|
-
StatusValues extends TypeSpec.Reflection.
|
|
94
|
+
StatusValues extends TypeSpec.Reflection.Union = ResourceProvisioningState
|
|
92
95
|
> is ArmResourceBase {
|
|
93
96
|
/** RP-specific properties for the operationStatus resource, only appears when operation ended with Succeeded status */
|
|
94
97
|
@visibility("read")
|
|
@@ -219,7 +222,7 @@ model ArmResourceCreatedResponse<
|
|
|
219
222
|
|
|
220
223
|
@Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<Resource>)
|
|
221
224
|
@doc("The resource body")
|
|
222
|
-
@
|
|
225
|
+
@bodyRoot
|
|
223
226
|
body: Resource;
|
|
224
227
|
}
|
|
225
228
|
|
|
@@ -228,9 +231,12 @@ model ArmResourceCreatedResponse<
|
|
|
228
231
|
* @template Resource The resource being updated
|
|
229
232
|
*/
|
|
230
233
|
@doc("Resource '{name}' create operation succeeded", Resource)
|
|
231
|
-
model ArmResourceCreatedSyncResponse<Resource extends Azure.ResourceManager.Foundations.ArmResource>
|
|
232
|
-
is Body<Resource> {
|
|
234
|
+
model ArmResourceCreatedSyncResponse<Resource extends Azure.ResourceManager.Foundations.ArmResource> {
|
|
233
235
|
...CreatedResponse;
|
|
236
|
+
|
|
237
|
+
@doc("The body type of the operation request or response.")
|
|
238
|
+
@bodyRoot
|
|
239
|
+
body: Resource;
|
|
234
240
|
}
|
|
235
241
|
|
|
236
242
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-azure-resource-manager",
|
|
3
|
-
"version": "0.42.0-dev.
|
|
3
|
+
"version": "0.42.0-dev.8",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Resource Manager library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|