@microsoft/typespec-msgraph 0.0.1-Preview.7 → 0.0.1-Preview.9
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.d.ts +4 -1
- package/dist/src/components/annotations.d.ts.map +1 -1
- package/dist/src/components/annotations.js +22 -4
- package/dist/src/components/annotations.js.map +1 -1
- package/dist/src/components/filter-restrictions-annotation.d.ts +6 -0
- package/dist/src/components/filter-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/filter-restrictions-annotation.js +10 -0
- package/dist/src/components/filter-restrictions-annotation.js.map +1 -0
- package/dist/src/components/immutable-annotation.d.ts +5 -0
- package/dist/src/components/immutable-annotation.d.ts.map +1 -0
- package/dist/src/components/immutable-annotation.js +6 -0
- package/dist/src/components/immutable-annotation.js.map +1 -0
- package/dist/src/components/index.js +3 -3
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/components/insert-restrictions-annotation.d.ts +6 -0
- package/dist/src/components/insert-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/insert-restrictions-annotation.js +10 -0
- package/dist/src/components/insert-restrictions-annotation.js.map +1 -0
- package/dist/src/components/property-element.d.ts.map +1 -1
- package/dist/src/components/property-element.js +3 -1
- 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 +6 -7
- package/dist/src/components/schema-element.js.map +1 -1
- package/dist/src/decorators/action.d.ts +10 -0
- package/dist/src/decorators/action.d.ts.map +1 -0
- package/dist/src/decorators/action.js +16 -0
- package/dist/src/decorators/action.js.map +1 -0
- package/dist/src/decorators/allowed-values.d.ts +13 -0
- package/dist/src/decorators/allowed-values.d.ts.map +1 -0
- package/dist/src/decorators/allowed-values.js +35 -0
- package/dist/src/decorators/allowed-values.js.map +1 -0
- package/dist/src/decorators/filter.d.ts +11 -0
- package/dist/src/decorators/filter.d.ts.map +1 -0
- package/dist/src/decorators/filter.js +27 -0
- package/dist/src/decorators/filter.js.map +1 -0
- package/dist/src/decorators/graph-route.d.ts +8 -1
- package/dist/src/decorators/graph-route.d.ts.map +1 -1
- package/dist/src/decorators/graph-route.js +27 -13
- package/dist/src/decorators/graph-route.js.map +1 -1
- package/dist/src/decorators/immutable.d.ts +8 -0
- package/dist/src/decorators/immutable.d.ts.map +1 -0
- package/dist/src/decorators/immutable.js +12 -0
- package/dist/src/decorators/immutable.js.map +1 -0
- package/dist/src/decorators/index.d.ts +6 -0
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +6 -0
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/public-namespace.d.ts +10 -0
- package/dist/src/decorators/public-namespace.d.ts.map +1 -0
- package/dist/src/decorators/public-namespace.js +16 -0
- package/dist/src/decorators/public-namespace.js.map +1 -0
- package/dist/src/decorators/required-for-create.d.ts +10 -0
- package/dist/src/decorators/required-for-create.d.ts.map +1 -0
- package/dist/src/decorators/required-for-create.js +14 -0
- package/dist/src/decorators/required-for-create.js.map +1 -0
- package/dist/src/emitter.d.ts +2 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +3 -1
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/entities/annotations.d.ts +9 -0
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +42 -1
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/model.d.ts +6 -0
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +4 -2
- package/dist/src/entities/model.js.map +1 -1
- package/dist/src/entities/namespace.d.ts +3 -3
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +26 -10
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +2 -3
- package/dist/src/entities/operation.js.map +1 -1
- package/dist/src/entities/property.d.ts.map +1 -1
- package/dist/src/entities/property.js +3 -0
- package/dist/src/entities/property.js.map +1 -1
- package/dist/src/lib.d.ts +45 -2
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +23 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +8 -0
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/allowed-values.d.ts +6 -0
- package/dist/src/rules/allowed-values.d.ts.map +1 -0
- package/dist/src/rules/allowed-values.js +59 -0
- package/dist/src/rules/allowed-values.js.map +1 -0
- package/dist/src/rules/filter.d.ts +4 -0
- package/dist/src/rules/filter.d.ts.map +1 -0
- package/dist/src/rules/filter.js +92 -0
- package/dist/src/rules/filter.js.map +1 -0
- package/dist/src/rules/graph-route.d.ts +6 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -0
- package/dist/src/rules/graph-route.js +88 -0
- package/dist/src/rules/graph-route.js.map +1 -0
- package/dist/src/rules/index.d.ts +6 -0
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +6 -0
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/namespace.d.ts +3 -0
- package/dist/src/rules/namespace.d.ts.map +1 -0
- package/dist/src/rules/namespace.js +58 -0
- package/dist/src/rules/namespace.js.map +1 -0
- package/dist/src/rules/required-for-create.d.ts +2 -0
- package/dist/src/rules/required-for-create.d.ts.map +1 -0
- package/dist/src/rules/required-for-create.js +40 -0
- package/dist/src/rules/required-for-create.js.map +1 -0
- package/dist/src/utils.d.ts +3 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +73 -21
- package/dist/src/utils.js.map +1 -1
- package/lib/decorators.tsp +102 -56
- package/lib/deployment.tsp +1 -1
- package/lib/lib.tsp +5 -16
- package/lib/porcelain.tsp +4 -4
- package/lib/responses.tsp +6 -6
- package/lib/shared-models.tsp +4 -3
- package/package.json +11 -12
package/lib/responses.tsp
CHANGED
|
@@ -7,14 +7,14 @@ import "@microsoft/typespec-msgraph";
|
|
|
7
7
|
import "./shared-models.tsp";
|
|
8
8
|
|
|
9
9
|
using TypeSpec.Http;
|
|
10
|
-
using
|
|
11
|
-
using
|
|
10
|
+
using MsGraph;
|
|
11
|
+
using MsGraph.SharedModels;
|
|
12
12
|
|
|
13
13
|
// Raw body models represent the content of the response body, without any additional metadata.
|
|
14
14
|
// Note that these are primarily marker types. CSDL has no notion of what actual body content is returned in such types,
|
|
15
15
|
// but by passing markers through, HIDI can translate to OpenAPI.
|
|
16
16
|
// The content of the types exists for other future emitters that run directly off TypeSpec.
|
|
17
|
-
namespace
|
|
17
|
+
namespace MsGraph.Responses.Bodies {
|
|
18
18
|
|
|
19
19
|
@error
|
|
20
20
|
model ErrorBody {
|
|
@@ -32,18 +32,18 @@ namespace TypeSpec.MsGraph.Responses.Bodies {
|
|
|
32
32
|
|
|
33
33
|
@pagedCollection
|
|
34
34
|
model PagedCollectionBody<TResource> is CollectionBody<TResource> {
|
|
35
|
-
`@odata.nextLink`?: url;
|
|
35
|
+
`@odata.nextLink`?: MsGraph.SharedModels.url;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
@pagedCollection
|
|
39
39
|
@deltaCollection
|
|
40
40
|
model DeltaCollectionBody<TResource> is PagedCollectionBody<TResource> {
|
|
41
|
-
`@odata.deltaLink`?: url;
|
|
41
|
+
`@odata.deltaLink`?: MsGraph.SharedModels.url;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// Response models represent the response as a whole, including the status code, headers, and body.
|
|
46
|
-
namespace
|
|
46
|
+
namespace MsGraph.Responses {
|
|
47
47
|
@doc("Response to represent a Microsoft Graph collection response payload.")
|
|
48
48
|
model CollectionResponse<TResource, TStatus = 200, TBody = Bodies.CollectionBody<TResource>>
|
|
49
49
|
is Http.Response<TStatus> {
|
package/lib/shared-models.tsp
CHANGED
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
// -------------------------------------------------
|
|
5
5
|
import "@microsoft/typespec-msgraph";
|
|
6
6
|
|
|
7
|
-
using
|
|
7
|
+
using MsGraph;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
@publicNamespace("microsoft.graph")
|
|
10
|
+
namespace MsGraph.SharedModels;
|
|
10
11
|
|
|
11
12
|
// TODO: Spec how to deal with specified and unspecified ultimate base entities w.r.t. AGS runtime replacement policies. See #140
|
|
12
13
|
@doc("The primary entity base model for Microsoft Graph.")
|
|
13
14
|
@entity
|
|
14
|
-
model
|
|
15
|
+
model entity {
|
|
15
16
|
@key id: string;
|
|
16
17
|
}
|
|
17
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/typespec-msgraph",
|
|
3
|
-
"version": "0.0.1-Preview.
|
|
3
|
+
"version": "0.0.1-Preview.9",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec for Microsoft Graph provides a description of the Microsoft Graph APIs. It is used for generating API description languages, client and service code, documentation, and other assets.",
|
|
6
6
|
"homepage": "https://github.com/microsoftgraph/typespec-msgraph",
|
|
@@ -52,28 +52,27 @@
|
|
|
52
52
|
"!dist/test/**"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@xmldom/xmldom": "~0.8.
|
|
56
|
-
"@typespec/compiler": "~0.
|
|
57
|
-
"@typespec/http": "~0.
|
|
58
|
-
"@typespec/lint": "~0.
|
|
59
|
-
"@typespec/rest": "~0.45.0",
|
|
55
|
+
"@xmldom/xmldom": "~0.8.4",
|
|
56
|
+
"@typespec/compiler": "~0.49.0",
|
|
57
|
+
"@typespec/http": "~0.49.0",
|
|
58
|
+
"@typespec/lint": "~0.49.0",
|
|
60
59
|
"prettier": "~2.8.7",
|
|
61
60
|
"react-dom": "~18.2.0",
|
|
62
61
|
"react": "~18.2.0",
|
|
63
62
|
"react-reconciler": "~0.27.0"
|
|
64
63
|
},
|
|
65
64
|
"devDependencies": {
|
|
66
|
-
"@types/mocha": "~10.0.
|
|
65
|
+
"@types/mocha": "~10.0.1",
|
|
67
66
|
"@types/node": "~18.11.9",
|
|
68
67
|
"@types/prettier": "2.6.0",
|
|
69
68
|
"@types/react": "~18.0.5",
|
|
70
69
|
"@types/react-reconciler": "~0.28.0",
|
|
71
|
-
"@typespec/eslint-config-typespec": "~0.
|
|
72
|
-
"c8": "~
|
|
73
|
-
"eslint": "^8.
|
|
70
|
+
"@typespec/eslint-config-typespec": "~0.49.0",
|
|
71
|
+
"c8": "~8.0.1",
|
|
72
|
+
"eslint": "^8.49.0",
|
|
74
73
|
"mocha": "~10.2.0",
|
|
75
|
-
"rimraf": "~5.0.
|
|
76
|
-
"typescript": "~5.
|
|
74
|
+
"rimraf": "~5.0.1",
|
|
75
|
+
"typescript": "~5.2.2",
|
|
77
76
|
"xpath": "~0.0.32",
|
|
78
77
|
"tsx": "~3.12.3"
|
|
79
78
|
}
|