@microsoft/typespec-msgraph 0.0.1-Preview.11 → 0.0.1-Preview.13
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 +21 -3
- package/dist/src/components/annotations.js.map +1 -1
- package/dist/src/components/operation-element.d.ts.map +1 -1
- package/dist/src/components/operation-element.js +16 -5
- package/dist/src/components/operation-element.js.map +1 -1
- package/dist/src/components/property-element.js +1 -1
- package/dist/src/components/property-element.js.map +1 -1
- package/dist/src/components/revisions-annotation.d.ts.map +1 -1
- package/dist/src/components/revisions-annotation.js +2 -1
- package/dist/src/components/revisions-annotation.js.map +1 -1
- package/dist/src/components/schema-element.d.ts.map +1 -1
- package/dist/src/components/schema-element.js +5 -3
- package/dist/src/components/schema-element.js.map +1 -1
- package/dist/src/components/term-element.d.ts +9 -0
- package/dist/src/components/term-element.d.ts.map +1 -0
- package/dist/src/components/term-element.js +8 -0
- package/dist/src/components/term-element.js.map +1 -0
- package/dist/src/decorators/ags-attribute.d.ts +2 -1
- package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
- package/dist/src/decorators/ags-attribute.js +37 -1
- package/dist/src/decorators/ags-attribute.js.map +1 -1
- package/dist/src/decorators/experimental.d.ts +9 -0
- package/dist/src/decorators/experimental.d.ts.map +1 -0
- package/dist/src/decorators/experimental.js +13 -0
- package/dist/src/decorators/experimental.js.map +1 -0
- package/dist/src/decorators/global-operation.d.ts +9 -0
- package/dist/src/decorators/global-operation.d.ts.map +1 -0
- package/dist/src/decorators/global-operation.js +13 -0
- package/dist/src/decorators/global-operation.js.map +1 -0
- package/dist/src/decorators/graph-deprecated.d.ts +11 -0
- package/dist/src/decorators/graph-deprecated.d.ts.map +1 -0
- package/dist/src/decorators/graph-deprecated.js +19 -0
- package/dist/src/decorators/graph-deprecated.js.map +1 -0
- package/dist/src/decorators/index.d.ts +5 -0
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +5 -0
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/is-owner.js +1 -1
- package/dist/src/decorators/ownerless.d.ts +8 -0
- package/dist/src/decorators/ownerless.d.ts.map +1 -0
- package/dist/src/decorators/ownerless.js +12 -0
- package/dist/src/decorators/ownerless.js.map +1 -0
- package/dist/src/decorators/public-namespace.d.ts.map +1 -1
- package/dist/src/decorators/public-namespace.js +4 -1
- package/dist/src/decorators/public-namespace.js.map +1 -1
- package/dist/src/decorators/term.d.ts +13 -0
- package/dist/src/decorators/term.d.ts.map +1 -0
- package/dist/src/decorators/term.js +14 -0
- package/dist/src/decorators/term.js.map +1 -0
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +2 -0
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/entities/annotations.d.ts +4 -0
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +15 -0
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/enum.js.map +1 -1
- package/dist/src/entities/model.d.ts +1 -0
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +54 -4
- package/dist/src/entities/model.js.map +1 -1
- package/dist/src/entities/namespace.d.ts +6 -1
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +93 -6
- 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 +32 -8
- package/dist/src/entities/operation.js.map +1 -1
- package/dist/src/entities/revision-definition.d.ts +1 -0
- package/dist/src/entities/revision-definition.d.ts.map +1 -1
- package/dist/src/entities/revision-definition.js +3 -3
- package/dist/src/entities/revision-definition.js.map +1 -1
- package/dist/src/entities/term.d.ts +8 -0
- package/dist/src/entities/term.d.ts.map +1 -0
- package/dist/src/entities/term.js +14 -0
- package/dist/src/entities/term.js.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +59 -142
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +20 -10
- package/dist/src/lib.js.map +1 -1
- package/dist/src/rules/allowed-values.d.ts +2 -1
- package/dist/src/rules/allowed-values.d.ts.map +1 -1
- package/dist/src/rules/allowed-values.js +7 -7
- package/dist/src/rules/allowed-values.js.map +1 -1
- package/dist/src/rules/alternate-key.d.ts +4 -3
- package/dist/src/rules/alternate-key.d.ts.map +1 -1
- package/dist/src/rules/alternate-key.js +23 -23
- package/dist/src/rules/alternate-key.js.map +1 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.js +9 -9
- package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -1
- package/dist/src/rules/computed.d.ts +2 -1
- package/dist/src/rules/computed.d.ts.map +1 -1
- package/dist/src/rules/computed.js +9 -8
- package/dist/src/rules/computed.js.map +1 -1
- package/dist/src/rules/contains.d.ts +2 -1
- package/dist/src/rules/contains.d.ts.map +1 -1
- package/dist/src/rules/contains.js +9 -8
- package/dist/src/rules/contains.js.map +1 -1
- package/dist/src/rules/count.d.ts +2 -1
- package/dist/src/rules/count.d.ts.map +1 -1
- package/dist/src/rules/count.js +9 -8
- package/dist/src/rules/count.js.map +1 -1
- package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -1
- package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -1
- package/dist/src/rules/disallowed-typespec-decorators.js +29 -25
- package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -1
- package/dist/src/rules/entity.d.ts +5 -2
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +102 -19
- package/dist/src/rules/entity.js.map +1 -1
- package/dist/src/rules/enum.d.ts +3 -1
- package/dist/src/rules/enum.d.ts.map +1 -1
- package/dist/src/rules/enum.js +9 -6
- package/dist/src/rules/enum.js.map +1 -1
- package/dist/src/rules/expand.d.ts +3 -2
- package/dist/src/rules/expand.d.ts.map +1 -1
- package/dist/src/rules/expand.js +16 -16
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/extends-on-same-type.d.ts +2 -1
- package/dist/src/rules/extends-on-same-type.d.ts.map +1 -1
- package/dist/src/rules/extends-on-same-type.js +9 -8
- package/dist/src/rules/extends-on-same-type.js.map +1 -1
- package/dist/src/rules/filter.d.ts +4 -3
- package/dist/src/rules/filter.d.ts.map +1 -1
- package/dist/src/rules/filter.js +23 -23
- package/dist/src/rules/filter.js.map +1 -1
- package/dist/src/rules/function.d.ts +2 -1
- package/dist/src/rules/function.d.ts.map +1 -1
- package/dist/src/rules/function.js +9 -9
- package/dist/src/rules/function.js.map +1 -1
- package/dist/src/rules/global-operation.d.ts +4 -0
- package/dist/src/rules/global-operation.d.ts.map +1 -0
- package/dist/src/rules/global-operation.js +60 -0
- package/dist/src/rules/global-operation.js.map +1 -0
- package/dist/src/rules/graph-deprecated.d.ts +8 -0
- package/dist/src/rules/graph-deprecated.d.ts.map +1 -0
- package/dist/src/rules/graph-deprecated.js +152 -0
- package/dist/src/rules/graph-deprecated.js.map +1 -0
- package/dist/src/rules/graph-route.d.ts +4 -2
- package/dist/src/rules/graph-route.d.ts.map +1 -1
- package/dist/src/rules/graph-route.js +55 -15
- package/dist/src/rules/graph-route.js.map +1 -1
- package/dist/src/rules/has-stream.d.ts +2 -1
- package/dist/src/rules/has-stream.d.ts.map +1 -1
- package/dist/src/rules/has-stream.js +9 -8
- package/dist/src/rules/has-stream.js.map +1 -1
- package/dist/src/rules/index.d.ts +3 -0
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +3 -0
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/namespace.d.ts +4 -2
- package/dist/src/rules/namespace.d.ts.map +1 -1
- package/dist/src/rules/namespace.js +66 -35
- package/dist/src/rules/namespace.js.map +1 -1
- package/dist/src/rules/open.d.ts +2 -1
- package/dist/src/rules/open.d.ts.map +1 -1
- package/dist/src/rules/open.js +9 -8
- package/dist/src/rules/open.js.map +1 -1
- package/dist/src/rules/operation-inside-interface.d.ts +2 -1
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
- package/dist/src/rules/operation-inside-interface.js +9 -8
- package/dist/src/rules/operation-inside-interface.js.map +1 -1
- package/dist/src/rules/order-by.d.ts +3 -2
- package/dist/src/rules/order-by.d.ts.map +1 -1
- package/dist/src/rules/order-by.js +16 -16
- package/dist/src/rules/order-by.js.map +1 -1
- package/dist/src/rules/ownerless.d.ts +10 -0
- package/dist/src/rules/ownerless.d.ts.map +1 -0
- package/dist/src/rules/ownerless.js +155 -0
- package/dist/src/rules/ownerless.js.map +1 -0
- package/dist/src/rules/partial.d.ts +2 -1
- package/dist/src/rules/partial.d.ts.map +1 -1
- package/dist/src/rules/partial.js +9 -8
- package/dist/src/rules/partial.js.map +1 -1
- package/dist/src/rules/references.d.ts +2 -1
- package/dist/src/rules/references.d.ts.map +1 -1
- package/dist/src/rules/references.js +9 -8
- package/dist/src/rules/references.js.map +1 -1
- package/dist/src/rules/required-for-create.d.ts +2 -1
- package/dist/src/rules/required-for-create.d.ts.map +1 -1
- package/dist/src/rules/required-for-create.js +9 -8
- package/dist/src/rules/required-for-create.js.map +1 -1
- package/dist/src/rules/search.d.ts +2 -1
- package/dist/src/rules/search.d.ts.map +1 -1
- package/dist/src/rules/search.js +9 -8
- package/dist/src/rules/search.js.map +1 -1
- package/dist/src/rules/skip.d.ts +2 -1
- package/dist/src/rules/skip.d.ts.map +1 -1
- package/dist/src/rules/skip.js +9 -8
- package/dist/src/rules/skip.js.map +1 -1
- package/dist/src/rules/top.d.ts +2 -1
- package/dist/src/rules/top.d.ts.map +1 -1
- package/dist/src/rules/top.js +9 -8
- package/dist/src/rules/top.js.map +1 -1
- package/dist/src/testing/index.d.ts +1 -0
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +21 -0
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/utils.d.ts +4 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +68 -20
- package/dist/src/utils.js.map +1 -1
- package/dist/src/{linter.d.ts → validate.d.ts} +1 -1
- package/dist/src/validate.d.ts.map +1 -0
- package/dist/src/validate.js +51 -0
- package/dist/src/validate.js.map +1 -0
- package/lib/decorators.tsp +35 -0
- package/package.json +5 -7
- package/dist/src/linter.d.ts.map +0 -1
- package/dist/src/linter.js +0 -44
- package/dist/src/linter.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Program, Interface } from "@typespec/compiler";
|
|
2
|
+
import { RevisionDefinition } from "./revision-definition.js";
|
|
2
3
|
export declare enum OperationKind {
|
|
3
4
|
Unknown = 0,
|
|
4
5
|
Action = 1,
|
|
@@ -15,6 +16,8 @@ export interface MsGraphOperation {
|
|
|
15
16
|
IsNullable: boolean;
|
|
16
17
|
ReturnTypeName: string;
|
|
17
18
|
Description: string | undefined;
|
|
19
|
+
RevisionDefinition: RevisionDefinition | undefined;
|
|
20
|
+
IsGlobalOperation: boolean;
|
|
18
21
|
}
|
|
19
22
|
export interface MsGraphOperationProperty {
|
|
20
23
|
Name: string;
|
|
@@ -23,6 +26,8 @@ export interface MsGraphOperationProperty {
|
|
|
23
26
|
IsOptional: boolean;
|
|
24
27
|
DefaultValue: Record<string, unknown> | undefined;
|
|
25
28
|
Description: string | undefined;
|
|
29
|
+
AgsAttributes: Record<string, string>;
|
|
30
|
+
RevisionDefinition: RevisionDefinition | undefined;
|
|
26
31
|
}
|
|
27
32
|
export declare function GetMsGraphOperations(program: Program, interfaces: Map<string, Interface>): MsGraphOperation[];
|
|
28
33
|
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuD,SAAS,
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuD,SAAS,EAAsB,MAAM,oBAAoB,CAAC;AAMjI,OAAO,EAAyB,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGrF,oBAAY,aAAa;IACvB,OAAO,IAAA;IACP,MAAM,IAAA;IACN,QAAQ,IAAA;CACT;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,eAAe,EAAE,wBAAwB,EAAE,EAAE,CAAC;IAC9C,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,wBAAwB;IAEvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAClD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACpD;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,gBAAgB,EAAE,CAuB7G"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { isVoidType, getDoc } from "@typespec/compiler";
|
|
1
|
+
import { isVoidType, getDoc, getLocationContext } from "@typespec/compiler";
|
|
2
2
|
import { isPathParam } from "@typespec/http";
|
|
3
|
-
import { getAction, getFunction, isOperationParameters } from "../index.js";
|
|
3
|
+
import { extractParamsFromPath, getAction, getFunction, getGraphRoutePaths, isGlobalOperation, isOperationParameters } from "../index.js";
|
|
4
4
|
import { isTypeNullable, getPropertyTypeName, extractTypesFromUnion, getInterfaceNavigationSourceType } from "../utils.js";
|
|
5
5
|
import { getDefaultPropertyValue } from "./property.js";
|
|
6
6
|
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
7
|
+
import { GetRevisionDefinition } from "./revision-definition.js";
|
|
8
|
+
import { usedLibraryTypesKey } from "./namespace.js";
|
|
7
9
|
export var OperationKind;
|
|
8
10
|
(function (OperationKind) {
|
|
9
11
|
OperationKind[OperationKind["Unknown"] = 0] = "Unknown";
|
|
@@ -27,27 +29,29 @@ export function GetMsGraphOperations(program, interfaces) {
|
|
|
27
29
|
return operations;
|
|
28
30
|
}
|
|
29
31
|
function GetMsGraphOperation(program, bindingTypeName, operation) {
|
|
32
|
+
const parameterProperties = deleteRoutingParameters(program, operation);
|
|
30
33
|
const element = {
|
|
31
34
|
Name: "",
|
|
32
35
|
Kind: OperationKind.Unknown,
|
|
33
36
|
BindingTypeName: bindingTypeName,
|
|
34
37
|
AgsAttributes: buildAttributes(program, operation),
|
|
35
|
-
Properties: getParameterProperties(program,
|
|
38
|
+
Properties: getParameterProperties(program, parameterProperties),
|
|
36
39
|
UnionProperties: new Array(),
|
|
37
40
|
IsVoid: isVoidType(operation.returnType),
|
|
38
41
|
IsNullable: false,
|
|
39
42
|
ReturnTypeName: "",
|
|
40
43
|
Description: getDoc(program, operation),
|
|
44
|
+
RevisionDefinition: GetRevisionDefinition(program, operation, operation.namespace),
|
|
45
|
+
IsGlobalOperation: isGlobalOperation(program, operation)
|
|
41
46
|
};
|
|
42
47
|
if (!element.IsVoid) {
|
|
43
|
-
const returnType = operation.returnType
|
|
44
|
-
!!operation.returnType.templateMapper &&
|
|
45
|
-
!!operation.returnType.templateMapper.args.length
|
|
46
|
-
? operation.returnType.templateMapper.args[0]
|
|
47
|
-
: operation.returnType;
|
|
48
|
+
const returnType = operation.returnType;
|
|
48
49
|
if (!returnType || isVoidType(returnType)) {
|
|
49
50
|
element.IsVoid = true;
|
|
50
51
|
}
|
|
52
|
+
if (getLocationContext(program, returnType).type === "library") {
|
|
53
|
+
program.stateSet(usedLibraryTypesKey).add(returnType);
|
|
54
|
+
}
|
|
51
55
|
element.IsNullable = isTypeNullable(program, operation.returnType);
|
|
52
56
|
element.ReturnTypeName = getPropertyTypeName(program, returnType);
|
|
53
57
|
}
|
|
@@ -72,6 +76,19 @@ function GetMsGraphOperation(program, bindingTypeName, operation) {
|
|
|
72
76
|
}
|
|
73
77
|
return element;
|
|
74
78
|
}
|
|
79
|
+
function deleteRoutingParameters(program, operation) {
|
|
80
|
+
const parameterProperties = operation.parameters.properties;
|
|
81
|
+
const paths = getGraphRoutePaths(program, operation.interface);
|
|
82
|
+
if (paths === null || paths === void 0 ? void 0 : paths.length) {
|
|
83
|
+
const routingParams = paths.flatMap((path) => extractParamsFromPath(path));
|
|
84
|
+
parameterProperties.forEach((key, value) => {
|
|
85
|
+
if (routingParams.includes(key.name)) {
|
|
86
|
+
parameterProperties.delete(key.name);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return parameterProperties;
|
|
91
|
+
}
|
|
75
92
|
function getBindingTypeName(program, operation) {
|
|
76
93
|
const bindingType = getInterfaceNavigationSourceType(program, operation.interface);
|
|
77
94
|
if (!bindingType) {
|
|
@@ -81,12 +98,16 @@ function getBindingTypeName(program, operation) {
|
|
|
81
98
|
}
|
|
82
99
|
function getParameterProperties(program, parameters) {
|
|
83
100
|
const properties = [...parameters].flatMap(([, property]) => {
|
|
101
|
+
var _a;
|
|
84
102
|
if (isPathParam(program, property)) {
|
|
85
103
|
return [];
|
|
86
104
|
}
|
|
87
105
|
if (property.type.kind === "Model" && isOperationParameters(program, property.type)) {
|
|
88
106
|
return getParameterProperties(program, property.type.properties);
|
|
89
107
|
}
|
|
108
|
+
if (getLocationContext(program, property.type).type === "library") {
|
|
109
|
+
program.stateSet(usedLibraryTypesKey).add(property.type);
|
|
110
|
+
}
|
|
90
111
|
return [
|
|
91
112
|
{
|
|
92
113
|
Name: property.name,
|
|
@@ -95,6 +116,9 @@ function getParameterProperties(program, parameters) {
|
|
|
95
116
|
IsOptional: property.optional,
|
|
96
117
|
DefaultValue: getDefaultPropertyValue(program, property),
|
|
97
118
|
Description: getDoc(program, property),
|
|
119
|
+
AgsAttributes: buildAttributes(program, property),
|
|
120
|
+
RevisionDefinition: GetRevisionDefinition(program, property, (_a = property.model) === null || _a === void 0 ? void 0 : _a.namespace),
|
|
121
|
+
IsGlobalOperation: false
|
|
98
122
|
},
|
|
99
123
|
];
|
|
100
124
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAE,MAAM,EAAmC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAE,MAAM,EAAmC,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACjI,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,M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AAE,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAC;YAC/D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SAC1D;QAED,OAAO;YACL;gBACE,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC;gBAClD,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC;gBAC7D,UAAU,EAAE,QAAQ,CAAC,QAAQ;gBAC7B,YAAY,EAAE,uBAAuB,CAAC,OAAO,EAAE,QAAQ,CAAC;gBACxD,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;gBACtC,aAAa,EAAE,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC;gBACjD,kBAAkB,EAAE,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAA,QAAQ,CAAC,KAAK,0CAAE,SAAS,CAAC;gBACvF,iBAAiB,EAAE,KAAK;aACzB;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -4,6 +4,7 @@ export interface RevisionDefinition {
|
|
|
4
4
|
Version: string;
|
|
5
5
|
Description?: string;
|
|
6
6
|
RemovalDate: string;
|
|
7
|
+
Category?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare function GetRevisionDefinition(program: Program, type: Model | ModelProperty | EnumMember | Enum | Operation | Namespace, namespace: Namespace | undefined): RevisionDefinition | undefined;
|
|
9
10
|
//# sourceMappingURL=revision-definition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision-definition.d.ts","sourceRoot":"","sources":["../../../src/entities/revision-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"revision-definition.d.ts","sourceRoot":"","sources":["../../../src/entities/revision-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG3G,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,GAAG,aAAa,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,EACvE,SAAS,EAAE,SAAS,GAAG,SAAS,GAC/B,kBAAkB,GAAG,SAAS,CAgBhC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getPrivatePreview, getDeprecatedDefinitions, getPrivatePreviewDefinitions } from "../index.js";
|
|
1
|
+
import { getPrivatePreview, getDeprecatedDefinitions, getPrivatePreviewDefinitions, getGraphDeprecated } from "../index.js";
|
|
3
2
|
export function GetRevisionDefinition(program, type, namespace) {
|
|
4
3
|
if (!namespace) {
|
|
5
4
|
return undefined;
|
|
6
5
|
}
|
|
7
|
-
const deprecated =
|
|
6
|
+
const deprecated = getGraphDeprecated(program, type);
|
|
8
7
|
if (deprecated) {
|
|
9
8
|
return getRevisionDefinitionFromDeprecation(program, namespace, deprecated);
|
|
10
9
|
}
|
|
@@ -25,6 +24,7 @@ function getRevisionDefinitionFromDeprecation(program, namespace, deprecated) {
|
|
|
25
24
|
RemovalDate: definition.removalDate,
|
|
26
25
|
Version: `${definition.announcementDate.substring(0, 7)}/${definition.category}`,
|
|
27
26
|
Description: definition.description,
|
|
27
|
+
Category: definition.category,
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function getRevisionDefinitionFromPrivatePreview(program, namespace, deprecated) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision-definition.js","sourceRoot":"","sources":["../../../src/entities/revision-definition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"revision-definition.js","sourceRoot":"","sources":["../../../src/entities/revision-definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAU5H,MAAM,UAAU,qBAAqB,CACnC,OAAgB,EAChB,IAAuE,EACvE,SAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrD,IAAI,UAAU,EAAE;QACd,OAAO,oCAAoC,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;KAC7E;IAED,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACxD,IAAI,cAAc,EAAE;QAClB,OAAO,uCAAuC,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;KACpF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,oCAAoC,CAC3C,OAAgB,EAChB,SAAoB,EACpB,UAAkB;IAElB,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC3E,MAAM,UAAU,GAAG,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACzD,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,gBAAgB;QACjC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,OAAO,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,UAAU,CAAC,QAAQ,EAAE;QAChF,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,QAAQ,EAAE,UAAU,CAAC,QAAQ;KAC9B,CAAC;AACJ,CAAC;AAED,SAAS,uCAAuC,CAC9C,OAAgB,EAChB,SAAoB,EACpB,UAAkB;IAElB,MAAM,yBAAyB,GAAG,4BAA4B,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACnF,MAAM,UAAU,GAAG,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC7D,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,gBAAgB;QACjC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,OAAO,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,mBAAmB,UAAU,CAAC,IAAI,EAAE;KAC5F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Namespace, Program } from "@typespec/compiler";
|
|
2
|
+
export interface MsGraphTerm {
|
|
3
|
+
Name: string;
|
|
4
|
+
Type: string;
|
|
5
|
+
Description: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function GetMsGraphTerms(program: Program, namespace: Namespace): MsGraphTerm[];
|
|
8
|
+
//# sourceMappingURL=term.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term.d.ts","sourceRoot":"","sources":["../../../src/entities/term.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAIxD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,WAAW,EAAE,CAYrF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getTerms } from "../index.js";
|
|
2
|
+
import { getNameForModelType } from "../utils.js";
|
|
3
|
+
export function GetMsGraphTerms(program, namespace) {
|
|
4
|
+
const terms = new Array();
|
|
5
|
+
getTerms(program, namespace).forEach((term, _) => {
|
|
6
|
+
terms.push({
|
|
7
|
+
Name: term.name,
|
|
8
|
+
Type: getNameForModelType(program, term.type),
|
|
9
|
+
Description: term.description,
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
return terms;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=term.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term.js","sourceRoot":"","sources":["../../../src/entities/term.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAQlD,MAAM,UAAU,eAAe,CAAC,OAAgB,EAAE,SAAoB;IACpE,MAAM,KAAK,GAAG,IAAI,KAAK,EAAe,CAAC;IAEvC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QAC/C,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC;YAC7C,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
package/dist/src/index.js
CHANGED
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
package/dist/src/lib.d.ts
CHANGED
|
@@ -1,189 +1,106 @@
|
|
|
1
|
-
import { JSONSchemaType } from "@typespec/compiler";
|
|
2
1
|
export declare const namespace = "MsGraph";
|
|
3
2
|
export interface MsGraphEmitterOptions {
|
|
4
3
|
filename?: string;
|
|
5
4
|
}
|
|
6
|
-
export declare const
|
|
7
|
-
readonly name: "@microsoft/typespec-msgraph";
|
|
8
|
-
readonly diagnostics: {
|
|
9
|
-
readonly "decorator-missing-dependencies": {
|
|
10
|
-
readonly severity: "error";
|
|
11
|
-
readonly messages: {
|
|
12
|
-
readonly default: import("@typespec/compiler").CallableMessage<["decorator", "required", "location"]>;
|
|
13
|
-
readonly function: import("@typespec/compiler").CallableMessage<[]>;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
readonly "element-missing-dependencies": {
|
|
17
|
-
readonly severity: "error";
|
|
18
|
-
readonly messages: {
|
|
19
|
-
readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
|
|
20
|
-
readonly operation: import("@typespec/compiler").CallableMessage<[]>;
|
|
21
|
-
readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
|
|
22
|
-
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
|
|
23
|
-
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
|
|
24
|
-
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
readonly "decorator-invalid-use": {
|
|
28
|
-
readonly severity: "error";
|
|
29
|
-
readonly messages: {
|
|
30
|
-
readonly default: import("@typespec/compiler").CallableMessage<["decorator", "other", "location"]>;
|
|
31
|
-
readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
|
|
32
|
-
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
|
|
33
|
-
readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
34
|
-
readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
35
|
-
readonly key: import("@typespec/compiler").CallableMessage<[]>;
|
|
36
|
-
readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
37
|
-
readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
|
|
38
|
-
readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
|
|
39
|
-
readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
40
|
-
readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
|
|
41
|
-
readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
|
|
42
|
-
readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
|
|
43
|
-
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
|
|
44
|
-
readonly partial: import("@typespec/compiler").CallableMessage<[]>;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
readonly "singleton-invalid-name": {
|
|
48
|
-
readonly severity: "error";
|
|
49
|
-
readonly messages: {
|
|
50
|
-
readonly default: import("@typespec/compiler").CallableMessage<["value"]>;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
readonly "extends-invalid-use": {
|
|
54
|
-
readonly severity: "error";
|
|
55
|
-
readonly messages: {
|
|
56
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type", "type"]>;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
readonly "use-evolvable-enum": {
|
|
60
|
-
readonly severity: "warning";
|
|
61
|
-
readonly messages: {
|
|
62
|
-
readonly default: import("@typespec/compiler").CallableMessage<["enum"]>;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
readonly emitter: {
|
|
67
|
-
readonly options: JSONSchemaType<MsGraphEmitterOptions>;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
5
|
+
export declare const reportDiagnostic: <C extends "decorator-missing-dependencies" | "element-missing-dependencies" | "decorator-invalid-use" | "singleton-invalid-name" | "extends-invalid-use", M extends keyof {
|
|
71
6
|
"decorator-missing-dependencies": {
|
|
72
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
7
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
73
8
|
readonly function: import("@typespec/compiler").CallableMessage<[]>;
|
|
74
9
|
};
|
|
75
10
|
"element-missing-dependencies": {
|
|
76
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
11
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
77
12
|
readonly operation: import("@typespec/compiler").CallableMessage<[]>;
|
|
78
13
|
readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
|
|
79
|
-
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<[
|
|
80
|
-
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<[
|
|
81
|
-
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<[
|
|
14
|
+
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
15
|
+
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<[string]>;
|
|
16
|
+
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
17
|
+
readonly topLevelNamespaceMissingPublicNamespace: import("@typespec/compiler").CallableMessage<[string]>;
|
|
18
|
+
readonly propertyMissingContainsOrReferences: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
82
19
|
};
|
|
83
20
|
"decorator-invalid-use": {
|
|
84
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
21
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
85
22
|
readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
|
|
86
|
-
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<[
|
|
87
|
-
readonly expandProperties: import("@typespec/compiler").CallableMessage<[
|
|
88
|
-
readonly filterProperties: import("@typespec/compiler").CallableMessage<[
|
|
23
|
+
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<[string]>;
|
|
24
|
+
readonly expandProperties: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
25
|
+
readonly filterProperties: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
89
26
|
readonly key: import("@typespec/compiler").CallableMessage<[]>;
|
|
90
|
-
readonly orderByProperties: import("@typespec/compiler").CallableMessage<[
|
|
91
|
-
readonly required: import("@typespec/compiler").CallableMessage<[
|
|
92
|
-
readonly wrongType: import("@typespec/compiler").CallableMessage<[
|
|
27
|
+
readonly orderByProperties: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
28
|
+
readonly required: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
29
|
+
readonly wrongType: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
93
30
|
readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
94
31
|
readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
|
|
95
32
|
readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
|
|
96
33
|
readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
|
|
97
|
-
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<[
|
|
34
|
+
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<[string]>;
|
|
98
35
|
readonly partial: import("@typespec/compiler").CallableMessage<[]>;
|
|
36
|
+
readonly graphDeprecatedMustBeAccompaniedByDefinition: import("@typespec/compiler").CallableMessage<[]>;
|
|
37
|
+
readonly graphDeprecatedValueMustBeDefinedInDeprecatedDefinition: import("@typespec/compiler").CallableMessage<[]>;
|
|
38
|
+
readonly ownerlessMustBeAppliedToInterfacesWithSingleSegmentGraphRouteRule: import("@typespec/compiler").CallableMessage<[]>;
|
|
39
|
+
readonly referencedEntityModelCannotHaveComplexTypeProperties: import("@typespec/compiler").CallableMessage<[]>;
|
|
40
|
+
readonly referencedEntityModelCanOnlyHaveNavigationProperties: import("@typespec/compiler").CallableMessage<[]>;
|
|
41
|
+
readonly ownerlessInterfaceCannotHaveAnyOperations: import("@typespec/compiler").CallableMessage<[]>;
|
|
42
|
+
readonly ownerlessDecoratorCannotBeUsedWithIsOwner: import("@typespec/compiler").CallableMessage<[]>;
|
|
43
|
+
readonly entityTypeInOnwerlessCannotBeUsedWithOtherInterfaces: import("@typespec/compiler").CallableMessage<[]>;
|
|
44
|
+
readonly globalOperationMustBeUsedWithNonRoutedInterface: import("@typespec/compiler").CallableMessage<[]>;
|
|
45
|
+
readonly globalOperationMustBeUsedWithProjectBindingType: import("@typespec/compiler").CallableMessage<[]>;
|
|
46
|
+
readonly graphRouteWithRoutingParameterAsFinalSegment: import("@typespec/compiler").CallableMessage<[string]>;
|
|
99
47
|
};
|
|
100
48
|
"singleton-invalid-name": {
|
|
101
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
49
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
102
50
|
};
|
|
103
51
|
"extends-invalid-use": {
|
|
104
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
105
|
-
|
|
106
|
-
"use-evolvable-enum": {
|
|
107
|
-
readonly default: import("@typespec/compiler").CallableMessage<["enum"]>;
|
|
108
|
-
};
|
|
109
|
-
}, MsGraphEmitterOptions>;
|
|
110
|
-
export declare const reportDiagnostic: <C extends "decorator-missing-dependencies" | "element-missing-dependencies" | "decorator-invalid-use" | "singleton-invalid-name" | "extends-invalid-use" | "use-evolvable-enum", M extends keyof {
|
|
111
|
-
"decorator-missing-dependencies": {
|
|
112
|
-
readonly default: import("@typespec/compiler").CallableMessage<["decorator", "required", "location"]>;
|
|
113
|
-
readonly function: import("@typespec/compiler").CallableMessage<[]>;
|
|
114
|
-
};
|
|
115
|
-
"element-missing-dependencies": {
|
|
116
|
-
readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
|
|
117
|
-
readonly operation: import("@typespec/compiler").CallableMessage<[]>;
|
|
118
|
-
readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
|
|
119
|
-
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
|
|
120
|
-
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
|
|
121
|
-
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
|
|
122
|
-
};
|
|
123
|
-
"decorator-invalid-use": {
|
|
124
|
-
readonly default: import("@typespec/compiler").CallableMessage<["decorator", "other", "location"]>;
|
|
125
|
-
readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
|
|
126
|
-
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
|
|
127
|
-
readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
128
|
-
readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
129
|
-
readonly key: import("@typespec/compiler").CallableMessage<[]>;
|
|
130
|
-
readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
131
|
-
readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
|
|
132
|
-
readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
|
|
133
|
-
readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
134
|
-
readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
|
|
135
|
-
readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
|
|
136
|
-
readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
|
|
137
|
-
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
|
|
138
|
-
readonly partial: import("@typespec/compiler").CallableMessage<[]>;
|
|
139
|
-
};
|
|
140
|
-
"singleton-invalid-name": {
|
|
141
|
-
readonly default: import("@typespec/compiler").CallableMessage<["value"]>;
|
|
142
|
-
};
|
|
143
|
-
"extends-invalid-use": {
|
|
144
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type", "type"]>;
|
|
145
|
-
};
|
|
146
|
-
"use-evolvable-enum": {
|
|
147
|
-
readonly default: import("@typespec/compiler").CallableMessage<["enum"]>;
|
|
52
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
53
|
+
readonly namespaces: "A model can only extend other models in a different logical namespace. Use @partial instead.";
|
|
148
54
|
};
|
|
149
55
|
}[C]>(program: import("@typespec/compiler").Program, diag: import("@typespec/compiler").DiagnosticReport<{
|
|
150
56
|
"decorator-missing-dependencies": {
|
|
151
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
57
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
152
58
|
readonly function: import("@typespec/compiler").CallableMessage<[]>;
|
|
153
59
|
};
|
|
154
60
|
"element-missing-dependencies": {
|
|
155
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
61
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
156
62
|
readonly operation: import("@typespec/compiler").CallableMessage<[]>;
|
|
157
63
|
readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
|
|
158
|
-
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<[
|
|
159
|
-
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<[
|
|
160
|
-
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<[
|
|
64
|
+
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
65
|
+
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<[string]>;
|
|
66
|
+
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
67
|
+
readonly topLevelNamespaceMissingPublicNamespace: import("@typespec/compiler").CallableMessage<[string]>;
|
|
68
|
+
readonly propertyMissingContainsOrReferences: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
161
69
|
};
|
|
162
70
|
"decorator-invalid-use": {
|
|
163
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
71
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
164
72
|
readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
|
|
165
|
-
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<[
|
|
166
|
-
readonly expandProperties: import("@typespec/compiler").CallableMessage<[
|
|
167
|
-
readonly filterProperties: import("@typespec/compiler").CallableMessage<[
|
|
73
|
+
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<[string]>;
|
|
74
|
+
readonly expandProperties: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
75
|
+
readonly filterProperties: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
168
76
|
readonly key: import("@typespec/compiler").CallableMessage<[]>;
|
|
169
|
-
readonly orderByProperties: import("@typespec/compiler").CallableMessage<[
|
|
170
|
-
readonly required: import("@typespec/compiler").CallableMessage<[
|
|
171
|
-
readonly wrongType: import("@typespec/compiler").CallableMessage<[
|
|
77
|
+
readonly orderByProperties: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
78
|
+
readonly required: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
79
|
+
readonly wrongType: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
172
80
|
readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
173
81
|
readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
|
|
174
82
|
readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
|
|
175
83
|
readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
|
|
176
|
-
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<[
|
|
84
|
+
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<[string]>;
|
|
177
85
|
readonly partial: import("@typespec/compiler").CallableMessage<[]>;
|
|
86
|
+
readonly graphDeprecatedMustBeAccompaniedByDefinition: import("@typespec/compiler").CallableMessage<[]>;
|
|
87
|
+
readonly graphDeprecatedValueMustBeDefinedInDeprecatedDefinition: import("@typespec/compiler").CallableMessage<[]>;
|
|
88
|
+
readonly ownerlessMustBeAppliedToInterfacesWithSingleSegmentGraphRouteRule: import("@typespec/compiler").CallableMessage<[]>;
|
|
89
|
+
readonly referencedEntityModelCannotHaveComplexTypeProperties: import("@typespec/compiler").CallableMessage<[]>;
|
|
90
|
+
readonly referencedEntityModelCanOnlyHaveNavigationProperties: import("@typespec/compiler").CallableMessage<[]>;
|
|
91
|
+
readonly ownerlessInterfaceCannotHaveAnyOperations: import("@typespec/compiler").CallableMessage<[]>;
|
|
92
|
+
readonly ownerlessDecoratorCannotBeUsedWithIsOwner: import("@typespec/compiler").CallableMessage<[]>;
|
|
93
|
+
readonly entityTypeInOnwerlessCannotBeUsedWithOtherInterfaces: import("@typespec/compiler").CallableMessage<[]>;
|
|
94
|
+
readonly globalOperationMustBeUsedWithNonRoutedInterface: import("@typespec/compiler").CallableMessage<[]>;
|
|
95
|
+
readonly globalOperationMustBeUsedWithProjectBindingType: import("@typespec/compiler").CallableMessage<[]>;
|
|
96
|
+
readonly graphRouteWithRoutingParameterAsFinalSegment: import("@typespec/compiler").CallableMessage<[string]>;
|
|
178
97
|
};
|
|
179
98
|
"singleton-invalid-name": {
|
|
180
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
99
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
181
100
|
};
|
|
182
101
|
"extends-invalid-use": {
|
|
183
|
-
readonly default: import("@typespec/compiler").CallableMessage<[
|
|
184
|
-
|
|
185
|
-
"use-evolvable-enum": {
|
|
186
|
-
readonly default: import("@typespec/compiler").CallableMessage<["enum"]>;
|
|
102
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
103
|
+
readonly namespaces: "A model can only extend other models in a different logical namespace. Use @partial instead.";
|
|
187
104
|
};
|
|
188
105
|
}, C, M>) => void;
|
|
189
106
|
//# sourceMappingURL=lib.d.ts.map
|
package/dist/src/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAeD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyEpB,CAAC"}
|
package/dist/src/lib.js
CHANGED
|
@@ -12,7 +12,7 @@ const EmitterOptionsSchema = {
|
|
|
12
12
|
},
|
|
13
13
|
required: [],
|
|
14
14
|
};
|
|
15
|
-
export const
|
|
15
|
+
export const { reportDiagnostic } = createTypeSpecLibrary({
|
|
16
16
|
name: "@microsoft/typespec-msgraph",
|
|
17
17
|
diagnostics: {
|
|
18
18
|
"decorator-missing-dependencies": {
|
|
@@ -31,6 +31,8 @@ export const libDef = {
|
|
|
31
31
|
propertyRequiredForCreate: paramMessage `The property "${"property"}" on "${"model"}" must be nullable, computed, have a default value or be annotated with @requiredForCreate.`,
|
|
32
32
|
modelMissingNamespace: paramMessage `The model "${"model"}" must be defined in a namespace.`,
|
|
33
33
|
operationParameterMismatch: paramMessage `The operation "${"operation"}" must declare the parameters "${"parameters"}", have a "graphRouteParams" parameter or use the porcelain syntax.`,
|
|
34
|
+
topLevelNamespaceMissingPublicNamespace: paramMessage `@publicNamespace decorator is required on namespace "${"namespace"}".`,
|
|
35
|
+
propertyMissingContainsOrReferences: paramMessage `The property "${"property"}" of type "${"entity"}" which is an entity must have @contains or @references.`,
|
|
34
36
|
},
|
|
35
37
|
},
|
|
36
38
|
"decorator-invalid-use": {
|
|
@@ -51,6 +53,17 @@ export const libDef = {
|
|
|
51
53
|
allowedValuesInvalidType: paramMessage `The @allowedValues decorator can only be applied with primitive types.`,
|
|
52
54
|
invalidPublicNamespaceName: paramMessage `The @publicNamespace decorator value on namespace "${"namespace"}" should start with "microsoft.graph".`,
|
|
53
55
|
partial: paramMessage `The base model in the extended clause must match the base class of the referenced entity in the @partial decorator.`,
|
|
56
|
+
graphDeprecatedMustBeAccompaniedByDefinition: paramMessage `The @graphDeprecated decorator must be accompanied by @deprecatedDefinition on the namespace.`,
|
|
57
|
+
graphDeprecatedValueMustBeDefinedInDeprecatedDefinition: paramMessage `The @graphDeprecated value must be defined in the @deprecatedDefinition decorator on the namespace.`,
|
|
58
|
+
ownerlessMustBeAppliedToInterfacesWithSingleSegmentGraphRouteRule: paramMessage `The @ownerless decorator can only be applied to interfaces with a single segment @graphRoute.`,
|
|
59
|
+
referencedEntityModelCannotHaveComplexTypeProperties: paramMessage `The referenced entity model cannot have complex type properties.`,
|
|
60
|
+
referencedEntityModelCanOnlyHaveNavigationProperties: paramMessage `The referenced entity model can only have navigation properties.`,
|
|
61
|
+
ownerlessInterfaceCannotHaveAnyOperations: paramMessage `The @ownerless decorator can only be applied to interfaces without any operations.`,
|
|
62
|
+
ownerlessDecoratorCannotBeUsedWithIsOwner: paramMessage `The referenced model in the ownerless interface cannot be used with @isOwner decorator.`,
|
|
63
|
+
entityTypeInOnwerlessCannotBeUsedWithOtherInterfaces: paramMessage `The referenced model in the ownerless interface cannot be used in the extends clause of other interfaces.`,
|
|
64
|
+
globalOperationMustBeUsedWithNonRoutedInterface: paramMessage `The @globalOperation decorator must be used on an operation with a non-routed interface.`,
|
|
65
|
+
globalOperationMustBeUsedWithProjectBindingType: paramMessage `The @globalOperation decorator must be used on an operation that has a local model binding the interface.`,
|
|
66
|
+
graphRouteWithRoutingParameterAsFinalSegment: paramMessage `The @graphRoute ${"graphRoute"} with a routing parameter as the last segment cannot be used with a collection interface.`,
|
|
54
67
|
},
|
|
55
68
|
},
|
|
56
69
|
"singleton-invalid-name": {
|
|
@@ -63,17 +76,14 @@ export const libDef = {
|
|
|
63
76
|
severity: "error",
|
|
64
77
|
messages: {
|
|
65
78
|
default: paramMessage `A ${"type"} model can only extend a ${"type"} baseModel`,
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
"use-evolvable-enum": {
|
|
69
|
-
severity: "warning",
|
|
70
|
-
messages: {
|
|
71
|
-
default: paramMessage `Enumeration '${"enum"}' should have a member named unknownFutureValue for future extensibility.`,
|
|
79
|
+
namespaces: 'A model can only extend other models in a different logical namespace. Use @partial instead.'
|
|
72
80
|
},
|
|
73
81
|
},
|
|
74
82
|
},
|
|
83
|
+
// TODO: Enable the linter rule
|
|
84
|
+
// linter: {
|
|
85
|
+
// rules: [useEvolvableEnumRule],
|
|
86
|
+
// },
|
|
75
87
|
emitter: { options: EmitterOptionsSchema },
|
|
76
|
-
};
|
|
77
|
-
export const $lib = createTypeSpecLibrary(libDef);
|
|
78
|
-
export const { reportDiagnostic } = $lib;
|
|
88
|
+
});
|
|
79
89
|
//# sourceMappingURL=lib.js.map
|
package/dist/src/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzF,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAMnC,MAAM,oBAAoB,GAA0C;IAClE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wFAAwF;SACtG;KACF;IACD,QAAQ,EAAE,EAAE;CACb,CAAA;AAED,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzF,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAMnC,MAAM,oBAAoB,GAA0C;IAClE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,E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ACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,KAAK,MAAM,4BAA4B,MAAM,YAAY;gBAC9E,UAAU,EAAE,8FAA8F;aAC3G;SACF;KACF;IACD,+BAA+B;IAC/B,YAAY;IACZ,mCAAmC;IACnC,KAAK;IACL,OAAO,EAAE,EAAE,OAAO,EAAE,oBAA6D,EAAE;CAC3E,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Program } from "@typespec/compiler";
|
|
1
2
|
/***
|
|
2
3
|
* @allowedValues can only be applied to string model properties
|
|
3
4
|
* @allowedValues cannot have empty values
|
|
4
5
|
*/
|
|
5
|
-
export declare
|
|
6
|
+
export declare function validateAllowedValuesCannotBeEmpty(program: Program): void;
|
|
6
7
|
//# sourceMappingURL=allowed-values.d.ts.map
|