@azure-tools/typespec-azure-core 0.59.0-dev.2 → 0.59.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 +4 -0
- package/dist/generated-defs/Azure.Core.d.ts +10 -10
- package/dist/generated-defs/Azure.Core.d.ts.map +1 -1
- package/dist/src/rules/use-standard-names.d.ts.map +1 -1
- package/dist/src/rules/use-standard-names.js +6 -4
- package/dist/src/rules/use-standard-names.js.map +1 -1
- package/lib/decorators.tsp +2 -0
- package/lib/foundations.tsp +5 -3
- package/lib/legacy.tsp +1 -1
- package/lib/models.tsp +1 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -129,6 +129,8 @@ Identifies that an operation is the final operation for an LRO.
|
|
|
129
129
|
|
|
130
130
|
#### `@items`
|
|
131
131
|
|
|
132
|
+
_Deprecated: Do not use this decorator. Use @pageItems instead._
|
|
133
|
+
|
|
132
134
|
Identifies the ModelProperty that contains the paged items. Can only be used on a Model marked with `@pagedResult`.
|
|
133
135
|
|
|
134
136
|
```typespec
|
|
@@ -289,6 +291,8 @@ Identifies an operation that is linked to the target operation.
|
|
|
289
291
|
|
|
290
292
|
#### `@pagedResult`
|
|
291
293
|
|
|
294
|
+
_Deprecated: Do not use this decorator. Use @list decorator on the operation instead._
|
|
295
|
+
|
|
292
296
|
Marks a Model as a paged collection.
|
|
293
297
|
|
|
294
298
|
```typespec
|
|
@@ -20,14 +20,6 @@ export type FinalLocationDecorator = (context: DecoratorContext, entity: ModelPr
|
|
|
20
20
|
* property is ResourceLocation<Resource>
|
|
21
21
|
*/
|
|
22
22
|
export type PollingLocationDecorator = (context: DecoratorContext, entity: ModelProperty, options?: Type) => void;
|
|
23
|
-
/**
|
|
24
|
-
* Identifies the ModelProperty that contains the paged items. Can only be used on a Model marked with `@pagedResult`.
|
|
25
|
-
*/
|
|
26
|
-
export type ItemsDecorator = (context: DecoratorContext, entity: ModelProperty) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Marks a Model as a paged collection.
|
|
29
|
-
*/
|
|
30
|
-
export type PagedResultDecorator = (context: DecoratorContext, entity: Model) => void;
|
|
31
23
|
/**
|
|
32
24
|
* Decorator that marks a Version EnumMember as a preview version.
|
|
33
25
|
* This is used to indicate that the version is not yet stable and may change in future releases.
|
|
@@ -48,6 +40,14 @@ export type PagedResultDecorator = (context: DecoratorContext, entity: Model) =>
|
|
|
48
40
|
* ```
|
|
49
41
|
*/
|
|
50
42
|
export type PreviewVersionDecorator = (context: DecoratorContext, target: EnumMember) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Marks a Model as a paged collection.
|
|
45
|
+
*/
|
|
46
|
+
export type PagedResultDecorator = (context: DecoratorContext, entity: Model) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Identifies the ModelProperty that contains the paged items. Can only be used on a Model marked with `@pagedResult`.
|
|
49
|
+
*/
|
|
50
|
+
export type ItemsDecorator = (context: DecoratorContext, entity: ModelProperty) => void;
|
|
51
51
|
/**
|
|
52
52
|
* Used for custom StatusMonitor implementation.
|
|
53
53
|
* Identifies an EnumMember as a long-running "Succeeded" terminal state.
|
|
@@ -126,9 +126,9 @@ export type AzureCoreDecorators = {
|
|
|
126
126
|
lroStatus: LroStatusDecorator;
|
|
127
127
|
finalLocation: FinalLocationDecorator;
|
|
128
128
|
pollingLocation: PollingLocationDecorator;
|
|
129
|
-
items: ItemsDecorator;
|
|
130
|
-
pagedResult: PagedResultDecorator;
|
|
131
129
|
previewVersion: PreviewVersionDecorator;
|
|
130
|
+
pagedResult: PagedResultDecorator;
|
|
131
|
+
items: ItemsDecorator;
|
|
132
132
|
lroSucceeded: LroSucceededDecorator;
|
|
133
133
|
lroCanceled: LroCanceledDecorator;
|
|
134
134
|
lroFailed: LroFailedDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Azure.Core.d.ts","sourceRoot":"","sources":["../../generated-defs/Azure.Core.ts"],"names":[],"mappings":"AAAA,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C;IACtC,yBAAyB,EAAE,kCAAkC,CAAC;IAC9D,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,cAAc,EAAE,uBAAuB,CAAC;IACxC,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,iBAAiB,EAAE,0BAA0B,CAAC;CAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-standard-names.d.ts","sourceRoot":"","sources":["../../../src/rules/use-standard-names.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-standard-names.d.ts","sourceRoot":"","sources":["../../../src/rules/use-standard-names.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB;;;;;;;;EAqF3B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRule, ignoreDiagnostics, isTemplateDeclarationOrInstance, } from "@typespec/compiler";
|
|
1
|
+
import { createRule, ignoreDiagnostics, isList, isTemplateDeclarationOrInstance, } from "@typespec/compiler";
|
|
2
2
|
import { getHttpOperation } from "@typespec/http";
|
|
3
3
|
import { isListOperation } from "@typespec/rest";
|
|
4
4
|
import { getPagedResult } from "../decorators.js";
|
|
@@ -25,14 +25,16 @@ export const useStandardNames = createRule({
|
|
|
25
25
|
const name = op.name;
|
|
26
26
|
const statusCodes = httpOp.responses.map((x) => x.statusCodes.toString());
|
|
27
27
|
// operation is a list if it is decoratored as such (for example, through a template) or returns a paged result
|
|
28
|
-
const
|
|
28
|
+
const isListOp = isListOperation(context.program, op) ||
|
|
29
|
+
getPagedResult(context.program, op) !== undefined ||
|
|
30
|
+
isList(context.program, op);
|
|
29
31
|
let errorMessage;
|
|
30
32
|
switch (verb) {
|
|
31
33
|
case "get":
|
|
32
|
-
if (
|
|
34
|
+
if (isListOp && !name.startsWith("list")) {
|
|
33
35
|
errorMessage = "list";
|
|
34
36
|
}
|
|
35
|
-
else if (!
|
|
37
|
+
else if (!isListOp && !name.startsWith("get")) {
|
|
36
38
|
errorMessage = "get";
|
|
37
39
|
}
|
|
38
40
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-standard-names.js","sourceRoot":"","sources":["../../../src/rules/use-standard-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,iBAAiB,EACjB,+BAA+B,GAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE;QACR,GAAG,EAAE,mEAAmE;QACxE,IAAI,EAAE,2DAA2D;QACjE,eAAe,EACb,iFAAiF;QACnF,SAAS,EAAE,gFAAgF;QAC3F,UAAU,EAAE,iFAAiF;QAC7F,KAAK,EACH,4FAA4F;QAC9F,MAAM,EAAE,8CAA8C;KACvD;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,SAAS,EAAE,CAAC,EAAa,EAAE,EAAE;gBAC3B,IAAI,+BAA+B,CAAC,EAAE,CAAC;oBAAE,OAAO;gBAChD,MAAM,MAAM,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;gBACxE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;gBACzB,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC;gBACrB,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC1E,+GAA+G;gBAC/G,MAAM,
|
|
1
|
+
{"version":3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KAAK,OAAO;wBACV,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAC;wBAC3E,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;4BAC5E,YAAY,GAAG,OAAO,CAAC;wBACzB,CAAC;wBACD,MAAM;oBACR,KAAK,QAAQ;wBACX,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;4BAC/B,YAAY,GAAG,QAAQ,CAAC;wBAC1B,CAAC;wBACD,MAAM;gBACV,CAAC;gBACD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;oBAC/B,OAAO,CAAC,gBAAgB,CAAC;wBACvB,SAAS,EAAE,YAAY;wBACvB,MAAM,EAAE,EAAE;qBACX,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/lib/decorators.tsp
CHANGED
|
@@ -26,11 +26,13 @@ namespace Azure.Core {
|
|
|
26
26
|
/**
|
|
27
27
|
* Marks a Model as a paged collection.
|
|
28
28
|
*/
|
|
29
|
+
#deprecated "Do not use this decorator. Use @list decorator on the operation instead."
|
|
29
30
|
extern dec pagedResult(entity: Model);
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Identifies the ModelProperty that contains the paged items. Can only be used on a Model marked with `@pagedResult`.
|
|
33
34
|
*/
|
|
35
|
+
#deprecated "Do not use this decorator. Use @pageItems instead."
|
|
34
36
|
extern dec items(entity: ModelProperty);
|
|
35
37
|
|
|
36
38
|
/**
|
package/lib/foundations.tsp
CHANGED
|
@@ -242,7 +242,6 @@ model CustomResponseFields<Custom extends TypeSpec.Reflection.Model> {}
|
|
|
242
242
|
* @template Resource The type of the resource.
|
|
243
243
|
* @template Traits Traits which apply to the page.
|
|
244
244
|
*/
|
|
245
|
-
@pagedResult
|
|
246
245
|
@friendlyName("Paged{name}", Resource)
|
|
247
246
|
@doc("Paged collection of {name} items", Resource)
|
|
248
247
|
model CustomPage<
|
|
@@ -250,7 +249,7 @@ model CustomPage<
|
|
|
250
249
|
Traits extends TypeSpec.Reflection.Model = {}
|
|
251
250
|
> {
|
|
252
251
|
@doc("The {name} items on this page", Resource)
|
|
253
|
-
@
|
|
252
|
+
@pageItems
|
|
254
253
|
value: Resource[];
|
|
255
254
|
|
|
256
255
|
@doc("The link to the next page of items")
|
|
@@ -389,6 +388,7 @@ op ResourceCollectionOperation<
|
|
|
389
388
|
* @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
390
389
|
*/
|
|
391
390
|
@listsResource(Resource)
|
|
391
|
+
@list
|
|
392
392
|
@Private.ensureResourceType(Resource)
|
|
393
393
|
op ResourceList<
|
|
394
394
|
Resource extends TypeSpec.Reflection.Model,
|
|
@@ -406,11 +406,13 @@ op ResourceList<
|
|
|
406
406
|
*/
|
|
407
407
|
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
|
|
408
408
|
@autoRoute
|
|
409
|
+
@listsResource(Resource)
|
|
410
|
+
@Private.ensureResourceType(Resource)
|
|
409
411
|
op NonPagedResourceList<
|
|
410
412
|
Resource extends TypeSpec.Reflection.Model,
|
|
411
413
|
Traits extends TypeSpec.Reflection.Model = {},
|
|
412
414
|
ErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
413
|
-
> is
|
|
415
|
+
> is ResourceCollectionOperation<
|
|
414
416
|
Resource,
|
|
415
417
|
TraitProperties<Traits, TraitLocation.Parameters, TraitContext.List>,
|
|
416
418
|
Body<Resource[]> & TraitProperties<Traits, TraitLocation.Response, TraitContext.List>,
|
package/lib/legacy.tsp
CHANGED
|
@@ -14,7 +14,7 @@ namespace Azure.Core.Legacy;
|
|
|
14
14
|
* name: string;
|
|
15
15
|
* }
|
|
16
16
|
* model Page {
|
|
17
|
-
* @
|
|
17
|
+
* @pageItems items: Certificate[];
|
|
18
18
|
* @nextLink nextLink: Azure.Core.Legacy.parameterizedNextLink<[ListCertificateOptions.includePending]>;
|
|
19
19
|
* }
|
|
20
20
|
* ```
|
package/lib/models.tsp
CHANGED
|
@@ -11,12 +11,11 @@ namespace Azure.Core;
|
|
|
11
11
|
* Describes a page of resource object.
|
|
12
12
|
* @template Resource The resource type.
|
|
13
13
|
*/
|
|
14
|
-
@pagedResult
|
|
15
14
|
@friendlyName("Paged{name}", Resource)
|
|
16
15
|
@doc("Paged collection of {name} items", Resource)
|
|
17
16
|
model Page<Resource extends TypeSpec.Reflection.Model> {
|
|
18
17
|
@doc("The {name} items on this page", Resource)
|
|
19
|
-
@
|
|
18
|
+
@pageItems
|
|
20
19
|
value: Resource[];
|
|
21
20
|
|
|
22
21
|
@doc("The link to the next page of items")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-azure-core",
|
|
3
|
-
"version": "0.59.0-dev.
|
|
3
|
+
"version": "0.59.0-dev.4",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Core library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@typespec/rest": "^0.72.1 || >=0.73.0-dev <0.73.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@types/node": "~24.0
|
|
48
|
+
"@types/node": "~24.1.0",
|
|
49
49
|
"@typespec/compiler": "^1.2.1",
|
|
50
50
|
"@typespec/http": "^1.2.1",
|
|
51
51
|
"@typespec/library-linter": "^0.72.1 || >=0.73.0-dev <0.73.0",
|