@azure-tools/typespec-azure-resource-manager 0.71.0-dev.6 → 0.71.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/README.md CHANGED
@@ -30,6 +30,7 @@ Available ruleSets:
30
30
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
31
31
  | [`@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-child-resources`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-agent-base-type-child-resources) | Resources decorated with @azureBaseType for the Agent base type must have both a Conversation and a Response child resource. |
32
32
  | [`@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-lifecycle-operations`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-agent-base-type-lifecycle-operations) | Conversation and Response child resources of an Agent must define create, read, update, and delete lifecycle operations. |
33
+ | [`@azure-tools/typespec-azure-resource-manager/use-relationship-required-properties`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/use-relationship-required-properties) | Resources decorated with @azureBaseType for the Relationship base type must be extension resources with the required Relationship schema. |
33
34
  | [`@azure-tools/typespec-azure-resource-manager/arm-no-record`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-no-record) | Don't use Record types for ARM resources. |
34
35
  | [`@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-no-path-casing-conflicts) | Operation paths must be unique when compared case-insensitively. |
35
36
  | [`@azure-tools/typespec-azure-resource-manager/no-override-props`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-override-props) | Disallow redefining properties already defined in a base type. |
@@ -1 +1 @@
1
- {"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAuFA,eAAO,MAAM,OAAO,+CAElB,CAAC"}
1
+ {"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAyFA,eAAO,MAAM,OAAO,+CAElB,CAAC"}
@@ -39,10 +39,12 @@ import { resourceNameRule } from "./rules/resource-name.js";
39
39
  import { retryAfterRule } from "./rules/retry-after.js";
40
40
  import { secretProprule } from "./rules/secret-prop.js";
41
41
  import { unsupportedTypeRule } from "./rules/unsupported-type.js";
42
+ import { useRelationshipRequiredPropertiesRule } from "./rules/use-relationship-required-properties.js";
42
43
  import { versionProgressionRule } from "./rules/version-progression.js";
43
44
  const rules = [
44
45
  armAgentBaseTypeChildResourcesRule,
45
46
  armAgentBaseTypeLifecycleOperationsRule,
47
+ useRelationshipRequiredPropertiesRule,
46
48
  armNoRecordRule,
47
49
  armNoPathCasingConflictsRule,
48
50
  noOverridePropsRule,
@@ -1 +1 @@
1
- {"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACpG,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,u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1B,yBAAyB;IACzB,+BAA+B;IAC/B,gCAAgC;IAChC,sBAAsB;IACtB,sBAAsB;IACtB,gCAAgC;IAChC,6BAA6B;IAC7B,iBAAiB;IACjB,kBAAkB;IAClB,0BAA0B;IAC1B,uBAAuB;IACvB,cAAc;IACd,gCAAgC;IAChC,qCAAqC;IACrC,qBAAqB;IACrB,yBAAyB;IACzB,kBAAkB;IAClB,8BAA8B;IAC9B,4BAA4B;IAC5B,mBAAmB;IACnB,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,cAAc;IACd,YAAY;IACZ,8BAA8B;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAClC,KAAK;CACN,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const useRelationshipRequiredPropertiesRule: import("@typespec/compiler").LinterRuleDefinition<"use-relationship-required-properties", {
2
+ readonly missingProperties: import("@typespec/compiler").CallableMessage<["missing"]>;
3
+ readonly notExtension: "Relationship resources must be extension resources.";
4
+ }, Record<string, never>>;
5
+ //# sourceMappingURL=use-relationship-required-properties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-relationship-required-properties.d.ts","sourceRoot":"","sources":["../../../src/rules/use-relationship-required-properties.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qCAAqC;;;yBAqFhD,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { createRule, getProperty, paramMessage } from "@typespec/compiler";
2
+ import { getAzureBaseTypes } from "../base-types.js";
3
+ import { getArmResources } from "../resource.js";
4
+ export const useRelationshipRequiredPropertiesRule = createRule({
5
+ name: "use-relationship-required-properties",
6
+ severity: "warning",
7
+ description: "Resources decorated with @azureBaseType for the Relationship base type must be extension resources with the required Relationship schema.",
8
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/use-relationship-required-properties",
9
+ messages: {
10
+ missingProperties: paramMessage `Relationship resources must include required properties: ${"missing"}.`,
11
+ notExtension: "Relationship resources must be extension resources.",
12
+ },
13
+ create(context) {
14
+ return {
15
+ root: (program) => {
16
+ const relationshipResources = getArmResources(program).filter((r) => hasRelationshipBaseType(r.typespecType));
17
+ for (const relationshipResource of relationshipResources) {
18
+ if (relationshipResource.kind !== "Extension") {
19
+ context.reportDiagnostic({
20
+ messageId: "notExtension",
21
+ target: relationshipResource.typespecType,
22
+ });
23
+ }
24
+ const properties = getProperty(relationshipResource.typespecType, "properties")?.type;
25
+ if (properties?.kind !== "Model") {
26
+ context.reportDiagnostic({
27
+ messageId: "missingProperties",
28
+ format: {
29
+ missing: "sourceId, sourceTenant, targetId, targetTenant, provisioningState",
30
+ },
31
+ target: relationshipResource.typespecType,
32
+ });
33
+ continue;
34
+ }
35
+ const missing = [
36
+ "sourceId",
37
+ "sourceTenant",
38
+ "targetId",
39
+ "targetTenant",
40
+ "provisioningState",
41
+ ].filter((propertyName) => getProperty(properties, propertyName) === undefined);
42
+ if (missing.length > 0) {
43
+ context.reportDiagnostic({
44
+ messageId: "missingProperties",
45
+ format: { missing: missing.join(", ") },
46
+ target: properties,
47
+ });
48
+ }
49
+ }
50
+ },
51
+ };
52
+ function hasRelationshipBaseType(model) {
53
+ const visited = new Set();
54
+ return hasRelationshipBaseTypeInternal(model, visited);
55
+ }
56
+ function hasRelationshipBaseTypeInternal(model, visited) {
57
+ if (visited.has(model))
58
+ return false;
59
+ visited.add(model);
60
+ const directTypes = getAzureBaseTypes(context.program, model);
61
+ if (directTypes && isRelationship(directTypes))
62
+ return true;
63
+ if (model.baseModel && hasRelationshipBaseTypeInternal(model.baseModel, visited)) {
64
+ return true;
65
+ }
66
+ if (model.sourceModels) {
67
+ for (const source of model.sourceModels) {
68
+ if (hasRelationshipBaseTypeInternal(source.model, visited))
69
+ return true;
70
+ }
71
+ }
72
+ return false;
73
+ }
74
+ function isRelationship(types) {
75
+ return types.some((bt) => bt.baseType === "Relationship");
76
+ }
77
+ },
78
+ });
79
+ //# sourceMappingURL=use-relationship-required-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-relationship-required-properties.js","sourceRoot":"","sources":["../../../src/rules/use-relationship-required-properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EAAqB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,qCAAqC,GAAG,UAAU,CAAC;IAC9D,IAAI,EAAE,sCAAsC;IAC5C,QAAQ,EAAE,SAAS;IACnB,WAAW,EACT,2IAA2I;IAC7I,GAAG,EAAE,yHAAyH;IAC9H,QAAQ,EAAE;QACR,iBAAiB,EAAE,YAAY,CAAA,4DAA4D,SAAS,GAAG;QACvG,YAAY,EAAE,qDAAqD;KACpE;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,IAAI,EAAE,CAAC,OAAgB,EAAE,EAAE;gBACzB,MAAM,qBAAqB,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAClE,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC,CACxC,CAAC;gBAEF,KAAK,MAAM,oBAAoB,IAAI,qBAAqB,EAAE,CAAC;oBACzD,IAAI,oBAAoB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;wBAC9C,OAAO,CAAC,gBAAgB,CAAC;4BACvB,SAAS,EAAE,cAAc;4BACzB,MAAM,EAAE,oBAAoB,CAAC,YAAY;yBAC1C,CAAC,CAAC;oBACL,CAAC;oBAED,MAAM,UAAU,GAAG,WAAW,CAAC,oBAAoB,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,IAAI,CAAC;oBACtF,IAAI,UAAU,EAAE,IAAI,KAAK,OAAO,EAAE,CAAC;wBACjC,OAAO,CAAC,gBAAgB,CAAC;4BACvB,SAAS,EAAE,mBAAmB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,CAAC;YAED,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;gBACvB,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;oBACxC,IAAI,+BAA+B,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;wBAAE,OAAO,IAAI,CAAC;gBAC1E,CAAC;YACH,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;QAED,SAAS,cAAc,CAAC,KAA0B;YAChD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
package/lib/arm.tsp CHANGED
@@ -14,6 +14,7 @@ import "./extension/extension.tsp";
14
14
  import "./backcompat.tsp";
15
15
  import "./base-types/base-types.tsp";
16
16
  import "./base-types/agent.tsp";
17
+ import "./base-types/relationship.tsp";
17
18
  import "./private.decorators.tsp";
18
19
  import "./models.tsp";
19
20
  import "./operations.tsp";
@@ -186,6 +186,9 @@ model ConversationProperties {
186
186
  /** Timestamp of when the conversation was created. Read-only. */
187
187
  @visibility(Lifecycle.Read)
188
188
  createdAt?: utcDateTime;
189
+
190
+ /** Content input to the conversation. Required on create. */
191
+ input: InputItem;
189
192
  }
190
193
 
191
194
  /**
@@ -232,7 +235,7 @@ enum ItemType {
232
235
  * - `FunctionCallOutput`: `callId`, `output`
233
236
  * - `Compaction`: `summary`
234
237
  */
235
- model ConversationItem {
238
+ model InputItem {
236
239
  /** Unique identifier of the item. Read-only (assigned by the service). */
237
240
  @visibility(Lifecycle.Read)
238
241
  id?: string;
@@ -240,11 +243,12 @@ model ConversationItem {
240
243
  /** The item type discriminator. Determines which variant this item represents. */
241
244
  type: ItemType;
242
245
 
243
- /** The role of the message author. Applies to `Message` items. */
246
+ /** The role of the message author. Applies to `Message` items. Read-only. */
247
+ @visibility(Lifecycle.Read)
244
248
  role?: MessageRole;
245
249
 
246
- /** The text content of the message. Applies to `Message` items. */
247
- content?: string;
250
+ /** The content of the message. Applies to `Message` items. */
251
+ content?: Record<unknown>;
248
252
 
249
253
  /** Identifier correlating a function call with its output. Applies to `FunctionCall` and `FunctionCallOutput` items. */
250
254
  callId?: string;
@@ -316,7 +320,7 @@ model ResponseProperties {
316
320
  status?: ResponseStatus;
317
321
 
318
322
  /** Content input to the model. Required on create. */
319
- input: ConversationItem;
323
+ input: InputItem;
320
324
  }
321
325
 
322
326
  /**
@@ -342,9 +346,9 @@ model ResponseItem {
342
346
  @visibility(Lifecycle.Read)
343
347
  role?: MessageRole;
344
348
 
345
- /** The text content of the message. Applies to `Message` items. Read-only. */
349
+ /** The content of the message. Applies to `Message` items. Read-only. */
346
350
  @visibility(Lifecycle.Read)
347
- content?: string;
351
+ content?: Record<unknown>;
348
352
 
349
353
  /** Identifier correlating a function call with its output. Applies to `FunctionCall` and `FunctionCallOutput` items. Read-only. */
350
354
  @visibility(Lifecycle.Read)
@@ -0,0 +1,46 @@
1
+ import "./base-types.tsp";
2
+
3
+ namespace Azure.ResourceManager.BaseTypes.Relationships;
4
+
5
+ // ============================================================================
6
+ // Relationship Properties (resource property bag)
7
+ // ============================================================================
8
+
9
+ /**
10
+ * Required properties for a relationship resource.
11
+ * @template ProvisioningState The relationship provisioning state values.
12
+ */
13
+ model RelationshipProperties<ProvisioningState extends string = ResourceProvisioningState> {
14
+ /** ARM-managed. Must include the base type descriptor for this resource. */
15
+ @visibility(Lifecycle.Read)
16
+ baseTypes: BaseTypeInfo[];
17
+
18
+ /** The relationship source identifier. */
19
+ sourceId: string;
20
+
21
+ /** The tenant identifier of the relationship source. */
22
+ sourceTenant: string;
23
+
24
+ /** The relationship target identifier. */
25
+ targetId: string;
26
+
27
+ /** The tenant identifier of the relationship target. */
28
+ targetTenant: string;
29
+
30
+ /** The provisioning state of the relationship. */
31
+ @visibility(Lifecycle.Read)
32
+ provisioningState?: ProvisioningState;
33
+ }
34
+
35
+ // ============================================================================
36
+ // Resource Templates
37
+ // ============================================================================
38
+
39
+ /**
40
+ * Model template for a Relationship extension resource.
41
+ * Applies the Relationship base type decorator automatically.
42
+ * @template Properties RP-specific properties for the relationship (must extend RelationshipProperties)
43
+ */
44
+ @azureBaseType(#{ baseType: BaseType.Relationship, version: "2026-04-01" })
45
+ model Relationship<Properties extends RelationshipProperties = RelationshipProperties>
46
+ is ExtensionResource<Properties>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-resource-manager",
3
- "version": "0.71.0-dev.6",
3
+ "version": "0.71.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",
@@ -50,9 +50,9 @@
50
50
  "@azure-tools/typespec-azure-core": "^0.70.0 || >= 0.71.0-dev.3",
51
51
  "@typespec/compiler": "^1.14.0",
52
52
  "@typespec/http": "^1.14.0",
53
+ "@typespec/rest": "^0.84.0",
53
54
  "@typespec/openapi": "^1.14.0",
54
- "@typespec/versioning": "^0.84.0",
55
- "@typespec/rest": "^0.84.0"
55
+ "@typespec/versioning": "^0.84.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@azure-tools/typespec-azure-core": "^0.70.0 || >= 0.71.0-dev.3",
@@ -65,10 +65,10 @@
65
65
  "vitest": "^4.1.3",
66
66
  "@typespec/compiler": "^1.14.0",
67
67
  "@typespec/http": "^1.14.0",
68
- "@typespec/versioning": "^0.84.0",
68
+ "@typespec/rest": "^0.84.0",
69
69
  "@typespec/library-linter": "^0.84.0",
70
+ "@typespec/versioning": "^0.84.0",
70
71
  "@typespec/tspd": "^0.76.0",
71
- "@typespec/rest": "^0.84.0",
72
72
  "@typespec/openapi": "^1.14.0"
73
73
  },
74
74
  "scripts": {