@azure-tools/typespec-azure-resource-manager 0.69.0 → 0.70.0-dev.1

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.
Files changed (50) hide show
  1. package/README.md +40 -0
  2. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.d.ts +29 -0
  3. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.d.ts.map +1 -0
  4. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.js +2 -0
  5. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.js.map +1 -0
  6. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.ts-test.d.ts +2 -0
  7. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.ts-test.d.ts.map +1 -0
  8. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.ts-test.js +8 -0
  9. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.ts-test.js.map +1 -0
  10. package/dist/generated-defs/Azure.ResourceManager.Private.d.ts +12 -0
  11. package/dist/generated-defs/Azure.ResourceManager.Private.d.ts.map +1 -1
  12. package/dist/src/base-types.d.ts +16 -0
  13. package/dist/src/base-types.d.ts.map +1 -0
  14. package/dist/src/base-types.js +30 -0
  15. package/dist/src/base-types.js.map +1 -0
  16. package/dist/src/index.d.ts +1 -0
  17. package/dist/src/index.d.ts.map +1 -1
  18. package/dist/src/index.js +1 -0
  19. package/dist/src/index.js.map +1 -1
  20. package/dist/src/lib.d.ts +17 -2
  21. package/dist/src/lib.d.ts.map +1 -1
  22. package/dist/src/lib.js +6 -0
  23. package/dist/src/lib.js.map +1 -1
  24. package/dist/src/linter.d.ts.map +1 -1
  25. package/dist/src/linter.js +4 -0
  26. package/dist/src/linter.js.map +1 -1
  27. package/dist/src/private.decorators.d.ts.map +1 -1
  28. package/dist/src/private.decorators.js +20 -2
  29. package/dist/src/private.decorators.js.map +1 -1
  30. package/dist/src/resource.d.ts +1 -1
  31. package/dist/src/rules/arm-agent-base-type-child-resources.d.ts +4 -0
  32. package/dist/src/rules/arm-agent-base-type-child-resources.d.ts.map +1 -0
  33. package/dist/src/rules/arm-agent-base-type-child-resources.js +94 -0
  34. package/dist/src/rules/arm-agent-base-type-child-resources.js.map +1 -0
  35. package/dist/src/rules/arm-agent-base-type-lifecycle-operations.d.ts +4 -0
  36. package/dist/src/rules/arm-agent-base-type-lifecycle-operations.d.ts.map +1 -0
  37. package/dist/src/rules/arm-agent-base-type-lifecycle-operations.js +99 -0
  38. package/dist/src/rules/arm-agent-base-type-lifecycle-operations.js.map +1 -0
  39. package/dist/src/state.d.ts +1 -0
  40. package/dist/src/state.d.ts.map +1 -1
  41. package/dist/src/state.js +2 -0
  42. package/dist/src/state.js.map +1 -1
  43. package/dist/src/tsp-index.d.ts.map +1 -1
  44. package/dist/src/tsp-index.js +4 -0
  45. package/dist/src/tsp-index.js.map +1 -1
  46. package/lib/arm.tsp +2 -0
  47. package/lib/base-types/agent.tsp +351 -0
  48. package/lib/base-types/base-types.tsp +39 -0
  49. package/lib/private.decorators.tsp +16 -0
  50. package/package.json +13 -13
@@ -0,0 +1,39 @@
1
+ using Reflection;
2
+
3
+ namespace Azure.ResourceManager.BaseTypes;
4
+
5
+ /**
6
+ * An ARM-managed base type descriptor identifying the schema contract a resource conforms to.
7
+ * Used as a parameter to the `@azureBaseType` decorator to indicate which
8
+ * base types a resource conforms to.
9
+ */
10
+ model BaseTypeInfo {
11
+ /** The base type identifier (for example, "Agent"). */
12
+ baseType: string;
13
+
14
+ /** The schema version of the base type. */
15
+ version: string;
16
+ }
17
+
18
+ /**
19
+ * `@azureBaseType` marks an Azure Resource Manager resource properties model as implementing
20
+ * a base type. Base types define structured constraints including required and
21
+ * optional properties that conforming resources must implement.
22
+ *
23
+ * This decorator may be applied multiple times to indicate conformance to
24
+ * multiple base types. Duplicate entries are ignored.
25
+ *
26
+ * @param baseType The base type specification this resource implements.
27
+ *
28
+ * @example
29
+ *
30
+ * ```typespec
31
+ * @azureBaseType(#{ baseType: "Agent", version: "2024-06-01" })
32
+ * model MyAgentProperties {
33
+ * ...AgentProperties;
34
+ * ...AgentToolProperty;
35
+ * ...DefaultProvisioningStateProperty;
36
+ * }
37
+ * ```
38
+ */
39
+ extern dec azureBaseType(target: Model, baseType: valueof BaseTypeInfo);
@@ -119,6 +119,22 @@ extern dec armResourcePropertiesOptionality(target: ModelProperty, isOptional: v
119
119
  /** designates a parameter as an explicit bodyRoot and sets the optionality of the parameter */
120
120
  extern dec armBodyRoot(target: ModelProperty, isOptional: valueof boolean);
121
121
 
122
+ /**
123
+ * Controls visibility of a base type property based on whether the property is present
124
+ * and whether the deployment model is Appliance or Platform.
125
+ *
126
+ * If `isPresent` is false, the property is made invisible (removed from all lifecycle visibility).
127
+ * If `isAppliance` is true, the property is made read-only.
128
+ *
129
+ * @param isPresent Whether this property is present in the current template instantiation.
130
+ * @param isAppliance Whether the current deployment model is Appliance (true) or Platform (false).
131
+ */
132
+ extern dec baseTypeOptional(
133
+ target: ModelProperty,
134
+ isPresent: valueof boolean,
135
+ isAppliance: valueof boolean
136
+ );
137
+
122
138
  /** designates a type as a legacy type and emits a warning diagnostic when used */
123
139
  extern dec legacyType(target: Model | Operation | Interface | Scalar);
124
140
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-resource-manager",
3
- "version": "0.69.0",
3
+ "version": "0.70.0-dev.1",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Resource Manager library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",
@@ -47,29 +47,29 @@
47
47
  "pluralize": "^8.0.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@azure-tools/typespec-azure-core": "^0.69.0",
50
+ "@azure-tools/typespec-azure-core": "^0.69.0 || >=0.70.0-dev <0.70.0",
51
51
  "@typespec/compiler": "^1.13.0",
52
52
  "@typespec/http": "^1.13.0",
53
- "@typespec/rest": "^0.83.0",
53
+ "@typespec/rest": "^0.83.0 || >=0.84.0-dev <0.84.0",
54
54
  "@typespec/openapi": "^1.13.0",
55
- "@typespec/versioning": "^0.83.0"
55
+ "@typespec/versioning": "^0.83.0 || >=0.84.0-dev <0.84.0"
56
56
  },
57
57
  "devDependencies": {
58
+ "@azure-tools/typespec-azure-core": "^0.69.0 || >=0.70.0-dev <0.70.0",
58
59
  "@types/node": "^25.5.2",
59
60
  "@types/pluralize": "^0.0.33",
61
+ "@typespec/compiler": "^1.13.0",
62
+ "@typespec/http": "^1.13.0",
63
+ "@typespec/library-linter": "^0.83.0 || >=0.84.0-dev <0.84.0",
64
+ "@typespec/rest": "^0.83.0 || >=0.84.0-dev <0.84.0",
65
+ "@typespec/tspd": "^0.75.0 || >=0.76.0-dev <0.76.0",
66
+ "@typespec/versioning": "^0.83.0 || >=0.84.0-dev <0.84.0",
67
+ "@typespec/openapi": "^1.13.0",
60
68
  "@vitest/coverage-v8": "^4.1.3",
61
69
  "@vitest/ui": "^4.1.3",
62
70
  "rimraf": "^6.1.3",
63
71
  "typescript": "~6.0.2",
64
- "vitest": "^4.1.3",
65
- "@typespec/compiler": "^1.13.0",
66
- "@azure-tools/typespec-azure-core": "^0.69.0",
67
- "@typespec/http": "^1.13.0",
68
- "@typespec/tspd": "^0.75.0",
69
- "@typespec/library-linter": "^0.83.0",
70
- "@typespec/rest": "^0.83.0",
71
- "@typespec/versioning": "^0.83.0",
72
- "@typespec/openapi": "^1.13.0"
72
+ "vitest": "^4.1.3"
73
73
  },
74
74
  "scripts": {
75
75
  "clean": "rimraf ./dist ./temp",