@microsoft/typespec-msgraph 0.0.1-Preview.20 → 0.0.1-Preview.22
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/components/annotations.js +2 -2
- package/dist/src/components/entity-container-element.d.ts.map +1 -1
- package/dist/src/components/entity-container-element.js +6 -2
- package/dist/src/components/entity-container-element.js.map +1 -1
- package/dist/src/components/enum-type-element.js +1 -1
- package/dist/src/components/enum-type-element.js.map +1 -1
- package/dist/src/components/property-element.d.ts.map +1 -1
- package/dist/src/components/property-element.js +2 -2
- package/dist/src/components/property-element.js.map +1 -1
- package/dist/src/components/schema-element.d.ts.map +1 -1
- package/dist/src/components/schema-element.js +4 -1
- package/dist/src/components/schema-element.js.map +1 -1
- package/dist/src/decorators/abstract.d.ts +2 -0
- package/dist/src/decorators/abstract.d.ts.map +1 -1
- package/dist/src/decorators/abstract.js +2 -0
- package/dist/src/decorators/abstract.js.map +1 -1
- package/dist/src/decorators/action.d.ts +2 -0
- package/dist/src/decorators/action.d.ts.map +1 -1
- package/dist/src/decorators/action.js +2 -0
- package/dist/src/decorators/action.js.map +1 -1
- package/dist/src/decorators/additional-query-parameters.d.ts +2 -0
- package/dist/src/decorators/additional-query-parameters.d.ts.map +1 -1
- package/dist/src/decorators/additional-query-parameters.js +2 -0
- package/dist/src/decorators/additional-query-parameters.js.map +1 -1
- package/dist/src/decorators/address-url-msa.d.ts +2 -0
- package/dist/src/decorators/address-url-msa.d.ts.map +1 -1
- package/dist/src/decorators/address-url-msa.js +2 -0
- package/dist/src/decorators/address-url-msa.js.map +1 -1
- package/dist/src/decorators/ags-attribute.d.ts +2 -2
- package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
- package/dist/src/decorators/ags-attribute.js +24 -23
- package/dist/src/decorators/ags-attribute.js.map +1 -1
- package/dist/src/decorators/contains.d.ts +2 -0
- package/dist/src/decorators/contains.d.ts.map +1 -1
- package/dist/src/decorators/contains.js +2 -0
- package/dist/src/decorators/contains.js.map +1 -1
- package/dist/src/decorators/deprecated-definition.d.ts +2 -0
- package/dist/src/decorators/deprecated-definition.d.ts.map +1 -1
- package/dist/src/decorators/deprecated-definition.js.map +1 -1
- package/dist/src/decorators/expand.d.ts +2 -0
- package/dist/src/decorators/expand.d.ts.map +1 -1
- package/dist/src/decorators/expand.js +2 -0
- package/dist/src/decorators/expand.js.map +1 -1
- package/dist/src/decorators/experimental.d.ts +2 -0
- package/dist/src/decorators/experimental.d.ts.map +1 -1
- package/dist/src/decorators/experimental.js +2 -0
- package/dist/src/decorators/experimental.js.map +1 -1
- package/dist/src/decorators/function.d.ts +2 -0
- package/dist/src/decorators/function.d.ts.map +1 -1
- package/dist/src/decorators/function.js +3 -1
- package/dist/src/decorators/function.js.map +1 -1
- package/dist/src/decorators/global-operation.d.ts +2 -0
- package/dist/src/decorators/global-operation.d.ts.map +1 -1
- package/dist/src/decorators/global-operation.js +2 -0
- package/dist/src/decorators/global-operation.js.map +1 -1
- package/dist/src/decorators/graph-deprecated.d.ts +2 -0
- package/dist/src/decorators/graph-deprecated.d.ts.map +1 -1
- package/dist/src/decorators/graph-deprecated.js +2 -0
- package/dist/src/decorators/graph-deprecated.js.map +1 -1
- package/dist/src/decorators/graph-route.d.ts +2 -0
- package/dist/src/decorators/graph-route.d.ts.map +1 -1
- package/dist/src/decorators/graph-route.js +33 -1
- package/dist/src/decorators/graph-route.js.map +1 -1
- package/dist/src/decorators/graphFlags.d.ts +11 -0
- package/dist/src/decorators/graphFlags.d.ts.map +1 -0
- package/dist/src/decorators/graphFlags.js +15 -0
- package/dist/src/decorators/graphFlags.js.map +1 -0
- package/dist/src/decorators/immutable.d.ts +2 -0
- package/dist/src/decorators/immutable.d.ts.map +1 -1
- package/dist/src/decorators/immutable.js +2 -0
- package/dist/src/decorators/immutable.js.map +1 -1
- package/dist/src/decorators/index.d.ts +2 -1
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +2 -1
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/is-owner.d.ts +2 -0
- package/dist/src/decorators/is-owner.d.ts.map +1 -1
- package/dist/src/decorators/is-owner.js +2 -0
- package/dist/src/decorators/is-owner.js.map +1 -1
- package/dist/src/decorators/limited-charset.d.ts +2 -0
- package/dist/src/decorators/limited-charset.d.ts.map +1 -1
- package/dist/src/decorators/limited-charset.js +2 -0
- package/dist/src/decorators/limited-charset.js.map +1 -1
- package/dist/src/decorators/media.d.ts +2 -0
- package/dist/src/decorators/media.d.ts.map +1 -1
- package/dist/src/decorators/media.js +2 -0
- package/dist/src/decorators/media.js.map +1 -1
- package/dist/src/decorators/open.d.ts +2 -0
- package/dist/src/decorators/open.d.ts.map +1 -1
- package/dist/src/decorators/open.js +2 -0
- package/dist/src/decorators/open.js.map +1 -1
- package/dist/src/decorators/operation-parameters.d.ts +2 -0
- package/dist/src/decorators/operation-parameters.d.ts.map +1 -1
- package/dist/src/decorators/operation-parameters.js +2 -0
- package/dist/src/decorators/operation-parameters.js.map +1 -1
- package/dist/src/decorators/ownerless.d.ts +2 -0
- package/dist/src/decorators/ownerless.d.ts.map +1 -1
- package/dist/src/decorators/ownerless.js +2 -0
- package/dist/src/decorators/ownerless.js.map +1 -1
- package/dist/src/decorators/passthrough-address-url-msa.d.ts +4 -1
- package/dist/src/decorators/passthrough-address-url-msa.d.ts.map +1 -1
- package/dist/src/decorators/passthrough-address-url-msa.js +4 -1
- package/dist/src/decorators/passthrough-address-url-msa.js.map +1 -1
- package/dist/src/decorators/passthrough-address-url.d.ts +4 -1
- package/dist/src/decorators/passthrough-address-url.d.ts.map +1 -1
- package/dist/src/decorators/passthrough-address-url.js +4 -1
- package/dist/src/decorators/passthrough-address-url.js.map +1 -1
- package/dist/src/decorators/prefixed-graph-routes.d.ts +10 -0
- package/dist/src/decorators/prefixed-graph-routes.d.ts.map +1 -0
- package/dist/src/decorators/prefixed-graph-routes.js +27 -0
- package/dist/src/decorators/prefixed-graph-routes.js.map +1 -0
- package/dist/src/decorators/private-preview.d.ts +2 -2
- package/dist/src/decorators/private-preview.d.ts.map +1 -1
- package/dist/src/decorators/private-preview.js.map +1 -1
- package/dist/src/decorators/privileged.d.ts +2 -0
- package/dist/src/decorators/privileged.d.ts.map +1 -1
- package/dist/src/decorators/privileged.js +2 -0
- package/dist/src/decorators/privileged.js.map +1 -1
- package/dist/src/decorators/read-only.d.ts +2 -0
- package/dist/src/decorators/read-only.d.ts.map +1 -1
- package/dist/src/decorators/read-only.js +2 -0
- package/dist/src/decorators/read-only.js.map +1 -1
- package/dist/src/decorators/reference-target.d.ts +1 -0
- package/dist/src/decorators/reference-target.d.ts.map +1 -1
- package/dist/src/decorators/reference-target.js +1 -0
- package/dist/src/decorators/reference-target.js.map +1 -1
- package/dist/src/decorators/references.d.ts +2 -0
- package/dist/src/decorators/references.d.ts.map +1 -1
- package/dist/src/decorators/references.js +2 -0
- package/dist/src/decorators/references.js.map +1 -1
- package/dist/src/decorators/return-source.d.ts +2 -0
- package/dist/src/decorators/return-source.d.ts.map +1 -1
- package/dist/src/decorators/return-source.js +2 -0
- package/dist/src/decorators/return-source.js.map +1 -1
- package/dist/src/decorators/select.d.ts +2 -0
- package/dist/src/decorators/select.d.ts.map +1 -1
- package/dist/src/decorators/select.js +2 -0
- package/dist/src/decorators/select.js.map +1 -1
- package/dist/src/decorators/workload-name-msa.d.ts +2 -0
- package/dist/src/decorators/workload-name-msa.d.ts.map +1 -1
- package/dist/src/decorators/workload-name-msa.js +2 -0
- package/dist/src/decorators/workload-name-msa.js.map +1 -1
- package/dist/src/decorators/workload-name.d.ts +2 -0
- package/dist/src/decorators/workload-name.d.ts.map +1 -1
- package/dist/src/decorators/workload-name.js +2 -0
- package/dist/src/decorators/workload-name.js.map +1 -1
- package/dist/src/decorators/workload-namespace.d.ts +2 -0
- package/dist/src/decorators/workload-namespace.d.ts.map +1 -1
- package/dist/src/decorators/workload-namespace.js +2 -0
- package/dist/src/decorators/workload-namespace.js.map +1 -1
- package/dist/src/decorators/write-only.d.ts +2 -0
- package/dist/src/decorators/write-only.d.ts.map +1 -1
- package/dist/src/decorators/write-only.js +2 -0
- package/dist/src/decorators/write-only.js.map +1 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +9 -6
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/entities/address-url.js +2 -2
- package/dist/src/entities/address-url.js.map +1 -1
- package/dist/src/entities/annotations.d.ts +2 -2
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +15 -15
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/entity-container.d.ts +3 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -1
- package/dist/src/entities/entity-container.js +3 -0
- package/dist/src/entities/entity-container.js.map +1 -1
- package/dist/src/entities/enum.d.ts +1 -1
- package/dist/src/entities/enum.d.ts.map +1 -1
- package/dist/src/entities/enum.js +8 -6
- package/dist/src/entities/enum.js.map +1 -1
- package/dist/src/entities/model.d.ts +19 -11
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +100 -34
- package/dist/src/entities/model.js.map +1 -1
- package/dist/src/entities/ms-graph-route.d.ts.map +1 -1
- package/dist/src/entities/ms-graph-route.js +6 -9
- package/dist/src/entities/ms-graph-route.js.map +1 -1
- package/dist/src/entities/namespace.d.ts +12 -0
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +176 -17
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/operation.d.ts +5 -0
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +59 -3
- package/dist/src/entities/operation.js.map +1 -1
- package/dist/src/entities/revision-definition.d.ts +2 -2
- package/dist/src/entities/revision-definition.d.ts.map +1 -1
- package/dist/src/entities/revision-definition.js +14 -3
- package/dist/src/entities/revision-definition.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +11 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +10 -2
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +14 -2
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/address-url.d.ts +1 -0
- package/dist/src/rules/address-url.d.ts.map +1 -1
- package/dist/src/rules/address-url.js +85 -3
- package/dist/src/rules/address-url.js.map +1 -1
- package/dist/src/rules/delta.d.ts.map +1 -1
- package/dist/src/rules/delta.js +6 -7
- package/dist/src/rules/delta.js.map +1 -1
- package/dist/src/rules/documentation.d.ts +4 -0
- package/dist/src/rules/documentation.d.ts.map +1 -0
- package/dist/src/rules/documentation.js +88 -0
- package/dist/src/rules/documentation.js.map +1 -0
- package/dist/src/rules/entity.d.ts +3 -0
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +32 -5
- package/dist/src/rules/entity.js.map +1 -1
- package/dist/src/rules/enum.d.ts +2 -0
- package/dist/src/rules/enum.d.ts.map +1 -1
- package/dist/src/rules/enum.js +27 -1
- package/dist/src/rules/enum.js.map +1 -1
- package/dist/src/rules/expand.d.ts.map +1 -1
- package/dist/src/rules/expand.js +3 -6
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/filter.js +7 -7
- package/dist/src/rules/filter.js.map +1 -1
- package/dist/src/rules/function.d.ts +1 -0
- package/dist/src/rules/function.d.ts.map +1 -1
- package/dist/src/rules/function.js +39 -0
- package/dist/src/rules/function.js.map +1 -1
- package/dist/src/rules/graph-route.d.ts +1 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -1
- package/dist/src/rules/graph-route.js +72 -1
- package/dist/src/rules/graph-route.js.map +1 -1
- package/dist/src/rules/index.d.ts +1 -0
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +1 -0
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/model.d.ts +5 -0
- package/dist/src/rules/model.d.ts.map +1 -1
- package/dist/src/rules/model.js +73 -3
- package/dist/src/rules/model.js.map +1 -1
- package/dist/src/rules/operation-inside-interface.d.ts +3 -0
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
- package/dist/src/rules/operation-inside-interface.js +36 -2
- package/dist/src/rules/operation-inside-interface.js.map +1 -1
- package/dist/src/rules/order-by.js +3 -3
- package/dist/src/rules/order-by.js.map +1 -1
- package/dist/src/rules/ownerless.d.ts.map +1 -1
- package/dist/src/rules/ownerless.js +3 -6
- package/dist/src/rules/ownerless.js.map +1 -1
- package/dist/src/rules/record-t.d.ts +6 -0
- package/dist/src/rules/record-t.d.ts.map +1 -1
- package/dist/src/rules/record-t.js +48 -1
- package/dist/src/rules/record-t.js.map +1 -1
- package/dist/src/rules/required-for-create.d.ts.map +1 -1
- package/dist/src/rules/required-for-create.js +4 -5
- package/dist/src/rules/required-for-create.js.map +1 -1
- package/dist/src/utils.d.ts +20 -4
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +222 -113
- package/dist/src/utils.js.map +1 -1
- package/dist/src/validate.d.ts.map +1 -1
- package/dist/src/validate.js +5 -0
- package/dist/src/validate.js.map +1 -1
- package/lib/decorators.tsp +24 -12
- package/lib/shared-models.tsp +5 -0
- package/package.json +4 -5
- package/dist/src/decorators/flags.d.ts +0 -9
- package/dist/src/decorators/flags.d.ts.map +0 -1
- package/dist/src/decorators/flags.js +0 -13
- package/dist/src/decorators/flags.js.map +0 -1
package/dist/src/rules/model.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { createRule, getLocationContext, paramMessage } from "@typespec/compiler";
|
|
2
|
-
import { isExcludedCoreType } from "../utils.js";
|
|
3
|
-
import { isEntity, isComplex } from "../index.js";
|
|
1
|
+
import { createRule, getLocationContext, navigateTypesInNamespace, paramMessage } from "@typespec/compiler";
|
|
2
|
+
import { extractTypesFromUnion, getTypeModel, isExcludedCoreType, isTypeDefinedInExternalLibrary } from "../utils.js";
|
|
3
|
+
import { isEntity, isComplex, isContains } from "../index.js";
|
|
4
|
+
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
5
|
+
import { reportDiagnostic } from "../lib.js";
|
|
4
6
|
export const modelShouldBeEntityOrComplexType = createRule({
|
|
5
7
|
name: "model-should-be-entity-or-complex-type",
|
|
6
8
|
severity: "warning",
|
|
@@ -33,4 +35,72 @@ export const modelShouldBeEntityOrComplexType = createRule({
|
|
|
33
35
|
};
|
|
34
36
|
},
|
|
35
37
|
});
|
|
38
|
+
export const containedNavigationPropertyTypeShouldNotBeExternallyReferenced = createRule({
|
|
39
|
+
name: "contained-navigation-property-type-should-not-be-externally-referenced",
|
|
40
|
+
severity: "warning",
|
|
41
|
+
description: "Contained navigation property type should not be an externally referenced type",
|
|
42
|
+
messages: {
|
|
43
|
+
default: paramMessage `Contained navigation property '${"property"}' type should not be an externally referenced type.`,
|
|
44
|
+
},
|
|
45
|
+
create(context) {
|
|
46
|
+
return {
|
|
47
|
+
model: (model) => {
|
|
48
|
+
const properties = model.properties;
|
|
49
|
+
for (const [_, property] of properties) {
|
|
50
|
+
const propertyType = getTypeModel(context.program, property.type);
|
|
51
|
+
if (propertyType && isContains(context.program, property) && isTypeDefinedInExternalLibrary(context.program, propertyType)) {
|
|
52
|
+
context.reportDiagnostic({
|
|
53
|
+
target: property,
|
|
54
|
+
format: {
|
|
55
|
+
property: property.name,
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
export function validatePropertyTypeIsNotStringLiteral(program) {
|
|
65
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
66
|
+
navigateTypesInNamespace(namespace, {
|
|
67
|
+
modelProperty: (property) => {
|
|
68
|
+
if (!property.model || isExcludedCoreType(program, property.model)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// To skip cases like '@path value:"$value"', '@header contentType: "image/*"'
|
|
72
|
+
const propDecoratorToSkip = ["@path", "@header"];
|
|
73
|
+
const propDecorators = property.decorators
|
|
74
|
+
.map((decorator) => { var _a; return (_a = decorator.definition) === null || _a === void 0 ? void 0 : _a.name; });
|
|
75
|
+
if (propDecoratorToSkip.some(value => propDecorators.includes(value))) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (property.type.kind === "Union") {
|
|
79
|
+
const unionTypes = extractTypesFromUnion(property.type);
|
|
80
|
+
unionTypes.forEach(type => {
|
|
81
|
+
reportModelPropertyTypeDiagnostics(program, property, type.kind);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
reportModelPropertyTypeDiagnostics(program, property, property.type.kind);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function reportModelPropertyTypeDiagnostics(program, property, propertyTypeKind) {
|
|
92
|
+
const literalTypes = ["String", "Boolean", "Number", "Tuple"];
|
|
93
|
+
if (!literalTypes.includes(propertyTypeKind)) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
reportDiagnostic(program, {
|
|
97
|
+
code: "type-invalid-use",
|
|
98
|
+
target: property,
|
|
99
|
+
messageId: "propertyTypeCannotBeStringLiteral",
|
|
100
|
+
format: {
|
|
101
|
+
property: property.name,
|
|
102
|
+
type: propertyTypeKind.toLowerCase()
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
36
106
|
//# sourceMappingURL=model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/rules/model.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/rules/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,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AAM,EAAE,QAAQ;QAChB,SAAS,EAAE,mCAAmC;QAC9C,MAAM,EAAE;YACN,QAAQ,EAAE,QAAQ,CAAC,IAAI;YACvB,IAAI,EAAE,gBAAgB,CAAC,WAAW,EAAE;SACrC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Program } from "@typespec/compiler";
|
|
2
2
|
export declare function validateOperationInsideInterface(program: Program): void;
|
|
3
3
|
export declare function validateOperationsShouldNotBeAddedToInterfaceWithPartialTypes(program: Program): void;
|
|
4
|
+
export declare const getPutPostAndPatchOperationsShouldHaveSelectDecorator: import("@typespec/compiler").LinterRuleDefinition<"get-put-post-patch-operations-should-have-select-decorator", {
|
|
5
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
6
|
+
}>;
|
|
4
7
|
//# sourceMappingURL=operation-inside-interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-inside-interface.d.ts","sourceRoot":"","sources":["../../../src/rules/operation-inside-interface.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"operation-inside-interface.d.ts","sourceRoot":"","sources":["../../../src/rules/operation-inside-interface.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAA0E,MAAM,oBAAoB,CAAC;AAIrH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,OAAO,QAqBhE;AAED,wBAAgB,6DAA6D,CAAC,OAAO,EAAE,OAAO,QAuC7F;AAED,eAAO,MAAM,qDAAqD;;EAiChE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { reportDiagnostic } from "../lib.js";
|
|
2
|
-
import { getInterfaceNavigationSourceType, isExcludedCoreType, isInterfaceBindingTypeOwned } from "../utils.js";
|
|
3
|
-
import { getLocationContext, navigateTypesInNamespace } from "@typespec/compiler";
|
|
2
|
+
import { getInterfaceNavigationSourceType, getTypeModel, isExcludedCoreType, isInterfaceBindingTypeOwned } from "../utils.js";
|
|
3
|
+
import { createRule, getLocationContext, navigateTypesInNamespace, paramMessage } from "@typespec/compiler";
|
|
4
4
|
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
5
5
|
import { isGlobalOperation } from "../index.js";
|
|
6
6
|
export function validateOperationInsideInterface(program) {
|
|
@@ -59,4 +59,38 @@ export function validateOperationsShouldNotBeAddedToInterfaceWithPartialTypes(pr
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
export const getPutPostAndPatchOperationsShouldHaveSelectDecorator = createRule({
|
|
63
|
+
name: "get-put-post-patch-operations-should-have-select-decorator",
|
|
64
|
+
severity: "warning",
|
|
65
|
+
description: "Get, Put, Post and Patch(if it returns a response) operations must be marked with @select",
|
|
66
|
+
messages: {
|
|
67
|
+
default: paramMessage `Operation '${"operation"}' must be marked with @select decorator`,
|
|
68
|
+
},
|
|
69
|
+
create(context) {
|
|
70
|
+
return {
|
|
71
|
+
operation: (operation) => {
|
|
72
|
+
if (isExcludedCoreType(context.program, operation)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const typeModel = getTypeModel(context.program, operation.returnType);
|
|
76
|
+
if (operation.decorators.some(decorator => {
|
|
77
|
+
var _a, _b, _c, _d;
|
|
78
|
+
return ((_a = decorator.definition) === null || _a === void 0 ? void 0 : _a.name) === "@get" ||
|
|
79
|
+
((_b = decorator.definition) === null || _b === void 0 ? void 0 : _b.name) === "@put" ||
|
|
80
|
+
((_c = decorator.definition) === null || _c === void 0 ? void 0 : _c.name) === "@post" ||
|
|
81
|
+
(((_d = decorator.definition) === null || _d === void 0 ? void 0 : _d.name) === "@patch" && typeModel && typeModel.name !== "EmptyResponse");
|
|
82
|
+
})) {
|
|
83
|
+
if (!operation.decorators.some(decorator => { var _a; return ((_a = decorator.definition) === null || _a === void 0 ? void 0 : _a.name) === "@select"; })) {
|
|
84
|
+
context.reportDiagnostic({
|
|
85
|
+
target: operation,
|
|
86
|
+
format: {
|
|
87
|
+
operation: operation.name,
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
62
96
|
//# sourceMappingURL=operation-inside-interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-inside-interface.js","sourceRoot":"","sources":["../../../src/rules/operation-inside-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"operation-inside-interface.js","sourceRoot":"","sources":["../../../src/rules/operation-inside-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,YAAY,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC9H,OAAO,EAAW,UAAU,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACrH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,gCAAgC,CAAC,OAAgB;IAC/D,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,wBAAwB,CAAC,SAAS,EAAE;YAClC,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;oBACxB,OAAO;gBACT,CAAC;gBAED,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;oBAC3C,OAAO;gBACT,CAAC;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CAAC,UAAU,0CAAE,IAAI,MAAK,QAAQ,IAAI,SAAS,IAAI,SAAS,CAAC,IAAI,KAAK,eAAe,CAAC,CAAA;iBAAA,CAAC,EAAC,CAAC;oBAC/F,IAAG,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,WAAC,OAAA,CAAA,MAAA,SAAS,CAAC,UAAU,0CAAE,IAAI,MAAK,SAAS,CAAA,EAAA,CAAC,EAAC,CAAC;wBACpF,OAAO,CAAC,gBAAgB,CAAC;4BACvB,MAAM,EAAE,SAAS;4BACjB,MAAM,EAAE;gCACN,SAAS,EAAE,SAAS,CAAC,IAAI;6BAC1B;yBACF,CAAC,CAAA;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { navigateTypesInNamespace, walkPropertiesInherited } from "@typespec/compiler";
|
|
2
2
|
import { getOperationVerb } from "@typespec/http";
|
|
3
|
-
import { getOrderBy,
|
|
4
|
-
import { isTypeCollection } from "../utils.js";
|
|
3
|
+
import { getOrderBy, isOrderBy } from "../index.js";
|
|
4
|
+
import { isNavigationProperty, isTypeCollection } from "../utils.js";
|
|
5
5
|
import { reportDiagnostic } from "../lib.js";
|
|
6
6
|
import { getNavigationSourceType } from "../utils.js";
|
|
7
7
|
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
@@ -47,7 +47,7 @@ export function validateOrderByOnlyNonNavigationProperties(program) {
|
|
|
47
47
|
}
|
|
48
48
|
const modelType = returnType.indexer ? returnType.indexer.value : returnType;
|
|
49
49
|
const nonNavigationProperties = [...walkPropertiesInherited(modelType)]
|
|
50
|
-
.filter((property) => !
|
|
50
|
+
.filter((property) => !isNavigationProperty(program, property))
|
|
51
51
|
.map((property) => property.name);
|
|
52
52
|
const invalidOrderBys = ordered.filter((property) => !nonNavigationProperties.includes(property));
|
|
53
53
|
if (!invalidOrderBys.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-by.js","sourceRoot":"","sources":["../../../src/rules/order-by.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"order-by.js","sourceRoot":"","sources":["../../../src/rules/order-by.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,UAAU,0DAA0D,CAAC,OAAgB;IACzF,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,wBAAwB,CAAC,SAAS,EAAE;YAClC,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;oBACnC,OAAO;gBACT,CAAC;gBAED,IAAI,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,KAAK,EAAE,CAAC;oBACnD,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;oBACxC,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;oBAC3D,IAAI,YAAY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CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAC1D,CAAC;gBAEF,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;oBAC5B,OAAO;gBACT,CAAC;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,mBAAmB;oBAC9B,MAAM,EAAE;wBACN,KAAK,EAAE,SAAS,CAAC,IAAI;wBACrB,UAAU,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;qBACvC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAAA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ownerless.d.ts","sourceRoot":"","sources":["../../../src/rules/ownerless.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAiD,MAAM,oBAAoB,CAAC;AAO9G;;GAEG;AAEH,wBAAgB,yEAAyE,CAAC,OAAO,EAAE,OAAO,QAqBzG;AAED,wBAAgB,0EAA0E,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"ownerless.d.ts","sourceRoot":"","sources":["../../../src/rules/ownerless.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAiD,MAAM,oBAAoB,CAAC;AAO9G;;GAEG;AAEH,wBAAgB,yEAAyE,CAAC,OAAO,EAAE,OAAO,QAqBzG;AAED,wBAAgB,0EAA0E,CAAC,OAAO,EAAE,OAAO,QAwB1G;AAED,wBAAgB,kDAAkD,CAAC,OAAO,EAAE,OAAO,QAalF;AAED,wBAAgB,iDAAiD,CAAC,OAAO,EAAE,OAAO,QAcjF;AAED,wBAAgB,6CAA6C,CAAC,OAAO,EAAE,OAAO,QAc7E;AAED,wBAAgB,uEAAuE,CAAC,OAAO,EAAE,OAAO,QAkBvG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getLocationContext, navigateTypesInNamespace, } from "@typespec/compiler";
|
|
2
|
-
import { getGraphRoutePaths, hasIsOwner, isComplex,
|
|
3
|
-
import { getInterfaceNavigationSourceType } from "../utils.js";
|
|
2
|
+
import { getGraphRoutePaths, hasIsOwner, isComplex, isOwnerless } from "../index.js";
|
|
3
|
+
import { getInterfaceNavigationSourceType, isNavigationProperty } from "../utils.js";
|
|
4
4
|
import { reportDiagnostic } from "../lib.js";
|
|
5
5
|
import { GetDeclaredNamespaces, getNavigationSources } from "../entities/namespace.js";
|
|
6
6
|
/***
|
|
@@ -39,10 +39,7 @@ export function validateOwnerlessEntityModelReferencedMustOnlyHaveNavigationProp
|
|
|
39
39
|
if (bindingType) {
|
|
40
40
|
const bindingTypeProperties = [...bindingType.properties];
|
|
41
41
|
bindingTypeProperties.forEach(([_, property]) => {
|
|
42
|
-
if (
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (isReferences(program, property)) {
|
|
42
|
+
if (isNavigationProperty(program, property)) {
|
|
46
43
|
return;
|
|
47
44
|
}
|
|
48
45
|
if (property.type.kind === "Model" && isComplex(program, property.type)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ownerless.js","sourceRoot":"","sources":["../../../src/rules/ownerless.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,kBAAkB,EAAE,wBAAwB,GAAG,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"ownerless.js","sourceRoot":"","sources":["../../../src/rules/ownerless.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,kBAAkB,EAAE,wBAAwB,GAAG,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,gCAAgC,EAAE,oBAAoB,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B,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC3D,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACvB,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,2BAA2B,CAAC,OAAgB,EAAE,cAAyB;IAC9E,OAAO,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AACjH,CAAC;AAED,6HAA6H;AAC7H,kHAAkH;AAClH,SAAS,yBAAyB,CAAC,OAAgB,EAAE,cAAyB,EAAE,SAAgB;IAC9F,gBAAgB,CAAC,OAAO,EAAE;QACxB,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,SAAS;QACpB,MAAM,EAAE;YACN,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;YACb,SAAS,EAAE,YAAY;YACvB,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,EAAE;YACT,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,MAAM,EAAE,EAAE;SACX;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -2,4 +2,10 @@ import { Program } from "@typespec/compiler";
|
|
|
2
2
|
export declare function validateRecordsCannotBePrepopulated(program: Program): void;
|
|
3
3
|
export declare function validateRecordTypeCannotBeNull(program: Program): void;
|
|
4
4
|
export declare function validateRecordTypeCannotBeUsedInLine(program: Program): void;
|
|
5
|
+
export declare const useRecordTypeInsteadOfDictionary: import("@typespec/compiler").LinterRuleDefinition<"use-record-type-instead-of-dictionary", {
|
|
6
|
+
readonly default: import("@typespec/compiler").CallableMessage<[]>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const dictionaryTypeIsMostlyUsedWithRecordType: import("@typespec/compiler").LinterRuleDefinition<"dictionary-type-is-mostly-used-with-record-type", {
|
|
9
|
+
readonly default: import("@typespec/compiler").CallableMessage<[]>;
|
|
10
|
+
}>;
|
|
5
11
|
//# sourceMappingURL=record-t.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-t.d.ts","sourceRoot":"","sources":["../../../src/rules/record-t.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"record-t.d.ts","sourceRoot":"","sources":["../../../src/rules/record-t.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAA0E,MAAM,oBAAoB,CAAC;AAM5H,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,OAAO,QAyBnE;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,QA4B9D;AAED,wBAAgB,oCAAoC,CAAC,OAAO,EAAE,OAAO,QAiBpE;AAED,eAAO,MAAM,gCAAgC;;EAsB3C,CAAA;AAEF,eAAO,MAAM,wCAAwC;;EAsBnD,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { getLocationContext, navigateTypesInNamespace } from "@typespec/compiler";
|
|
1
|
+
import { createRule, getLocationContext, navigateTypesInNamespace, paramMessage } from "@typespec/compiler";
|
|
2
2
|
import { reportDiagnostic } from "../lib.js";
|
|
3
3
|
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
4
4
|
import { extractTypesFromUnion, isNullType } from "../utils.js";
|
|
5
|
+
import { isComplex, isEntity } from "../index.js";
|
|
5
6
|
export function validateRecordsCannotBePrepopulated(program) {
|
|
6
7
|
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
7
8
|
navigateTypesInNamespace(namespace, {
|
|
@@ -75,4 +76,50 @@ export function validateRecordTypeCannotBeUsedInLine(program) {
|
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
}
|
|
79
|
+
export const useRecordTypeInsteadOfDictionary = createRule({
|
|
80
|
+
name: "use-record-type-instead-of-dictionary",
|
|
81
|
+
severity: "warning",
|
|
82
|
+
description: "Use Record type instead of a self declaration of Dictionary complex type",
|
|
83
|
+
messages: {
|
|
84
|
+
default: paramMessage `Use Record type instead of a self declaration of Dictionary complex type`
|
|
85
|
+
},
|
|
86
|
+
create(context) {
|
|
87
|
+
return {
|
|
88
|
+
model: (model) => {
|
|
89
|
+
if (getLocationContext(context.program, model).type === "library") {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (isComplex(context.program, model) && model.name === "Dictionary") {
|
|
93
|
+
context.reportDiagnostic({
|
|
94
|
+
target: model,
|
|
95
|
+
format: {}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
export const dictionaryTypeIsMostlyUsedWithRecordType = createRule({
|
|
103
|
+
name: "dictionary-type-is-mostly-used-with-record-type",
|
|
104
|
+
severity: "warning",
|
|
105
|
+
description: "Dictionary type is mostly used with Record<T> complex types",
|
|
106
|
+
messages: {
|
|
107
|
+
default: paramMessage `Using Dictionary as an entity model type might clash with a Dictionary complex type that is emitted when there is a Record<T> in the TypeSpec`
|
|
108
|
+
},
|
|
109
|
+
create(context) {
|
|
110
|
+
return {
|
|
111
|
+
model: (model) => {
|
|
112
|
+
if (getLocationContext(context.program, model).type === "library") {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (isEntity(context.program, model) && model.name === "Dictionary") {
|
|
116
|
+
context.reportDiagnostic({
|
|
117
|
+
target: model,
|
|
118
|
+
format: {}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
});
|
|
78
125
|
//# sourceMappingURL=record-t.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-t.js","sourceRoot":"","sources":["../../../src/rules/record-t.ts"],"names":[],"mappings":"A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AO,EAAE,KAAK,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;oBACjE,OAAO;gBACT,CAAC;gBACD,IAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAC,CAAC;oBAClE,OAAO,CAAC,gBAAgB,CAAC;wBACvB,MAAM,EAAE,KAAK;wBACb,MAAM,EAAE,EAAE;qBACX,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC;SACF,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"required-for-create.d.ts","sourceRoot":"","sources":["../../../src/rules/required-for-create.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,OAAO,EAA4B,MAAM,oBAAoB,CAAC;AAI9E,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"required-for-create.d.ts","sourceRoot":"","sources":["../../../src/rules/required-for-create.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,OAAO,EAA4B,MAAM,oBAAoB,CAAC;AAI9E,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,OAAO,QAsCjE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isComputed,
|
|
2
|
-
import { getIdForType, isTypeNullable } from "../utils.js";
|
|
1
|
+
import { isComputed, isRequiredForCreate } from "../index.js";
|
|
2
|
+
import { getIdForType, isNavigationProperty, isTypeNullable } from "../utils.js";
|
|
3
3
|
import { getOperationVerb } from "@typespec/http";
|
|
4
4
|
import { navigateTypesInNamespace } from "@typespec/compiler";
|
|
5
5
|
import { reportDiagnostic } from "../lib.js";
|
|
@@ -18,10 +18,9 @@ export function validateRequiredRequestParameters(program) {
|
|
|
18
18
|
[...model.properties].forEach(([_, property]) => {
|
|
19
19
|
if (!(isRequiredForCreate(program, property) ||
|
|
20
20
|
isTypeNullable(program, property.type) ||
|
|
21
|
-
|
|
22
|
-
isContains(program, property) ||
|
|
21
|
+
isNavigationProperty(program, property) ||
|
|
23
22
|
isComputed(program, property) ||
|
|
24
|
-
property.
|
|
23
|
+
property.defaultValue)) {
|
|
25
24
|
reportDiagnostic(program, {
|
|
26
25
|
code: "element-missing-dependencies",
|
|
27
26
|
target: property,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"required-for-create.js","sourceRoot":"","sources":["../../../src/rules/required-for-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"required-for-create.js","sourceRoot":"","sources":["../../../src/rules/required-for-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAkB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,UAAU,iCAAiC,CAAC,OAAgB;IAChE,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,wBAAwB,CAAC,SAAS,EAAE;YAClC,SAAS,EAAE,CAAC,YAAY,EAAE,EAAE;gBAC1B,MAAM,cAAc,GAAG,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC;qBAChD,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC;qBAClC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,MAAM,CAAC,CAAC;gBAE1E,cAAc,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;oBACnC,IAAI,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;wBAChD,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;wBACzD,MAAM,KAAK,GAAU,IAAK,CAAC,IAAI,CAAC;wBAChC,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE;4BAC9C,IACE,CAAC,CACC,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC;gCACtC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC;gCACtC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC;gCACvC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC;gCAC7B,QAAQ,CAAC,YAAY,CACtB,EACD,CAAC;gCACD,gBAAgB,CAAC,OAAO,EAAE;oCACxB,IAAI,EAAE,8BAA8B;oCACpC,MAAM,EAAE,QAAQ;oCAChB,SAAS,EAAE,2BAA2B;oCACtC,MAAM,EAAE;wCACN,QAAQ,EAAE,QAAQ,CAAC,IAAI;wCACvB,KAAK,EAAE,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAM,CAAC;qCAC9C;iCACF,CAAC,CAAC;4BACL,CAAC;wBACH,CAAC,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Enum, Interface, IntrinsicType, Model, ModelProperty, Namespace, Operation, Program, Scalar, Type, Union } from "@typespec/compiler";
|
|
2
2
|
import { HttpVerb } from "@typespec/http";
|
|
3
3
|
import { DeltaProperties } from "./entities/model.js";
|
|
4
|
-
|
|
4
|
+
import { MsGraphOperation } from "./entities/operation.js";
|
|
5
|
+
export interface GraphOperation {
|
|
5
6
|
theOperation: Operation;
|
|
6
7
|
verb: HttpVerb | undefined;
|
|
7
8
|
graphRoute: string;
|
|
8
9
|
}
|
|
9
10
|
export interface MsGraphInterface {
|
|
10
11
|
theInterface: Interface;
|
|
11
|
-
operations:
|
|
12
|
+
operations: GraphOperation[];
|
|
12
13
|
path: string;
|
|
13
14
|
}
|
|
14
15
|
export declare function hasSchemaNamespace(program: Program, namespace: Namespace): boolean;
|
|
@@ -54,7 +55,7 @@ export declare function isExcludedCoreType(program: Program, type: Model | Scala
|
|
|
54
55
|
export declare function isExcludedLibraryType(program: Program, type: Model | Scalar | Operation | ModelProperty | Interface | Namespace | Enum): boolean;
|
|
55
56
|
export declare function isNavigationProperty(program: Program, property: ModelProperty): boolean;
|
|
56
57
|
export declare function isNavigationSource(theInterface: Interface): boolean;
|
|
57
|
-
export declare function isTopLevelNavigationSource(
|
|
58
|
+
export declare function isTopLevelNavigationSource(theInterface: MsGraphInterface): boolean;
|
|
58
59
|
export declare function getInterfaceNavigationSourceType(program: Program, theInterface: Interface): Model | undefined;
|
|
59
60
|
export declare function getNavigationSourceType(program: Program, operation: Operation): Model | undefined;
|
|
60
61
|
/**
|
|
@@ -74,11 +75,26 @@ export declare function isTypeDefinedInExternalLibrary(program: Program, type: T
|
|
|
74
75
|
* @returns an array of all source interfaces
|
|
75
76
|
*/
|
|
76
77
|
export declare function getSourceInterfaces(theInterface: Interface): Interface[];
|
|
77
|
-
export declare function
|
|
78
|
+
export declare function getModelStructuralPropertyNames(program: Program, model: Model): string[];
|
|
79
|
+
export declare function getAllModelPropertyNames(program: Program, model: Model): string[];
|
|
78
80
|
export declare function isInterfaceBindingTypeOwned(program: Program, $interface: Interface): boolean;
|
|
79
81
|
export declare function getNestedComplexTypes(program: Program, model: Model, nestedModels?: Set<Model>): Set<Model>;
|
|
82
|
+
export declare function generateDeltaPropertiesForNavigationProperties(program: Program, navigationProperty: ModelProperty): DeltaProperties | undefined;
|
|
83
|
+
export declare function getInterfacesTargetingModel(program: Program, type: Type): Interface[];
|
|
80
84
|
export declare function getDeltaProperties(program: Program, entity: Interface): DeltaProperties | undefined;
|
|
81
85
|
export declare function isCollection(theInterfaces: Interface[]): boolean;
|
|
82
86
|
export declare function isUnion(type: Type): boolean;
|
|
83
87
|
export declare function filterMapByIdenticalValues<K, V>(inputMap: Map<K, V>): Map<K, V>;
|
|
88
|
+
export declare function getAllNestedNavigationPaths(program: Program, model: Model): string[];
|
|
89
|
+
export declare function removeTrailingSlash(path: string): string;
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* @param obj1 Function that checks for equality of two objects
|
|
93
|
+
* @param obj2
|
|
94
|
+
* @returns
|
|
95
|
+
*/
|
|
96
|
+
export declare function isEqual<T>(obj1: T, obj2: T): boolean;
|
|
97
|
+
export declare function checkFunctionOverloadsWithReturnType(operation1: MsGraphOperation, operation2: MsGraphOperation): boolean;
|
|
98
|
+
export declare function checkFunctionOverloads(operation1: MsGraphOperation, operation2: MsGraphOperation): boolean;
|
|
99
|
+
export declare function getTypeModel(program: Program, type: Type, structuralPropertiesOnly?: boolean): Model | undefined;
|
|
84
100
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAGJ,SAAS,EACT,aAAa,EAEb,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EAEP,MAAM,EACN,IAAI,EACJ,KAAK,EAEN,MAAM,oBAAoB,CAAC;AAoB5B,OAAO,EAAoB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file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