@azure/arm-resourcegraph 5.0.0-beta.2 → 5.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +1 -1
  3. package/dist/index.js +81 -23
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/src/index.d.ts +1 -0
  8. package/dist-esm/src/index.d.ts.map +1 -1
  9. package/dist-esm/src/index.js +1 -0
  10. package/dist-esm/src/index.js.map +1 -1
  11. package/dist-esm/src/models/index.d.ts +4 -4
  12. package/dist-esm/src/models/index.d.ts.map +1 -1
  13. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  14. package/dist-esm/src/operations/operations.js +8 -4
  15. package/dist-esm/src/operations/operations.js.map +1 -1
  16. package/dist-esm/src/pagingHelper.d.ts +13 -0
  17. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  18. package/dist-esm/src/pagingHelper.js +32 -0
  19. package/dist-esm/src/pagingHelper.js.map +1 -0
  20. package/dist-esm/src/resourceGraphClient.d.ts +2 -0
  21. package/dist-esm/src/resourceGraphClient.d.ts.map +1 -1
  22. package/dist-esm/src/resourceGraphClient.js +49 -18
  23. package/dist-esm/src/resourceGraphClient.js.map +1 -1
  24. package/dist-esm/test/sampleTest.js +11 -13
  25. package/dist-esm/test/sampleTest.js.map +1 -1
  26. package/package.json +15 -11
  27. package/review/arm-resourcegraph.api.md +10 -7
  28. package/src/index.ts +1 -0
  29. package/src/models/index.ts +5 -4
  30. package/src/operations/operations.ts +10 -5
  31. package/src/pagingHelper.ts +39 -0
  32. package/src/resourceGraphClient.ts +60 -20
  33. package/types/arm-resourcegraph.d.ts +15 -4
  34. package/types/tsdoc-metadata.json +1 -1
  35. package/dist-esm/samples-dev/accessAPropertiesField.d.ts +0 -2
  36. package/dist-esm/samples-dev/accessAPropertiesField.d.ts.map +0 -1
  37. package/dist-esm/samples-dev/accessAPropertiesField.js +0 -32
  38. package/dist-esm/samples-dev/accessAPropertiesField.js.map +0 -1
  39. package/dist-esm/samples-dev/basicManagementGroupQuery.d.ts +0 -2
  40. package/dist-esm/samples-dev/basicManagementGroupQuery.d.ts.map +0 -1
  41. package/dist-esm/samples-dev/basicManagementGroupQuery.js +0 -32
  42. package/dist-esm/samples-dev/basicManagementGroupQuery.js.map +0 -1
  43. package/dist-esm/samples-dev/basicQuery.d.ts +0 -2
  44. package/dist-esm/samples-dev/basicQuery.d.ts.map +0 -1
  45. package/dist-esm/samples-dev/basicQuery.js +0 -32
  46. package/dist-esm/samples-dev/basicQuery.js.map +0 -1
  47. package/dist-esm/samples-dev/basicTenantQuery.d.ts +0 -2
  48. package/dist-esm/samples-dev/basicTenantQuery.d.ts.map +0 -1
  49. package/dist-esm/samples-dev/basicTenantQuery.js +0 -31
  50. package/dist-esm/samples-dev/basicTenantQuery.js.map +0 -1
  51. package/dist-esm/samples-dev/complexQuery.d.ts +0 -2
  52. package/dist-esm/samples-dev/complexQuery.d.ts.map +0 -1
  53. package/dist-esm/samples-dev/complexQuery.js +0 -32
  54. package/dist-esm/samples-dev/complexQuery.js.map +0 -1
  55. package/dist-esm/samples-dev/filterResources.d.ts +0 -2
  56. package/dist-esm/samples-dev/filterResources.d.ts.map +0 -1
  57. package/dist-esm/samples-dev/filterResources.js +0 -32
  58. package/dist-esm/samples-dev/filterResources.js.map +0 -1
  59. package/dist-esm/samples-dev/firstPageQuery.d.ts +0 -2
  60. package/dist-esm/samples-dev/firstPageQuery.d.ts.map +0 -1
  61. package/dist-esm/samples-dev/firstPageQuery.js +0 -33
  62. package/dist-esm/samples-dev/firstPageQuery.js.map +0 -1
  63. package/dist-esm/samples-dev/nextPageQuery.d.ts +0 -2
  64. package/dist-esm/samples-dev/nextPageQuery.d.ts.map +0 -1
  65. package/dist-esm/samples-dev/nextPageQuery.js +0 -35
  66. package/dist-esm/samples-dev/nextPageQuery.js.map +0 -1
  67. package/dist-esm/samples-dev/operationsList.d.ts +0 -2
  68. package/dist-esm/samples-dev/operationsList.d.ts.map +0 -1
  69. package/dist-esm/samples-dev/operationsList.js +0 -42
  70. package/dist-esm/samples-dev/operationsList.js.map +0 -1
  71. package/dist-esm/samples-dev/queryWithAFacetRequest.d.ts +0 -2
  72. package/dist-esm/samples-dev/queryWithAFacetRequest.d.ts.map +0 -1
  73. package/dist-esm/samples-dev/queryWithAFacetRequest.js +0 -51
  74. package/dist-esm/samples-dev/queryWithAFacetRequest.js.map +0 -1
  75. package/dist-esm/samples-dev/randomPageQuery.d.ts +0 -2
  76. package/dist-esm/samples-dev/randomPageQuery.d.ts.map +0 -1
  77. package/dist-esm/samples-dev/randomPageQuery.js +0 -33
  78. package/dist-esm/samples-dev/randomPageQuery.js.map +0 -1
  79. package/dist-esm/samples-dev/resourceHistoryManagementGroupScopeQuery.d.ts +0 -2
  80. package/dist-esm/samples-dev/resourceHistoryManagementGroupScopeQuery.d.ts.map +0 -1
  81. package/dist-esm/samples-dev/resourceHistoryManagementGroupScopeQuery.js +0 -38
  82. package/dist-esm/samples-dev/resourceHistoryManagementGroupScopeQuery.js.map +0 -1
  83. package/dist-esm/samples-dev/resourceHistoryQuery.d.ts +0 -2
  84. package/dist-esm/samples-dev/resourceHistoryQuery.d.ts.map +0 -1
  85. package/dist-esm/samples-dev/resourceHistoryQuery.js +0 -38
  86. package/dist-esm/samples-dev/resourceHistoryQuery.js.map +0 -1
  87. package/dist-esm/samples-dev/summarizeResourcesByLocation.d.ts +0 -2
  88. package/dist-esm/samples-dev/summarizeResourcesByLocation.d.ts.map +0 -1
  89. package/dist-esm/samples-dev/summarizeResourcesByLocation.js +0 -32
  90. package/dist-esm/samples-dev/summarizeResourcesByLocation.js.map +0 -1
@@ -8,6 +8,11 @@
8
8
 
9
9
  import * as coreClient from "@azure/core-client";
10
10
  import * as coreRestPipeline from "@azure/core-rest-pipeline";
11
+ import {
12
+ PipelineRequest,
13
+ PipelineResponse,
14
+ SendRequest
15
+ } from "@azure/core-rest-pipeline";
11
16
  import * as coreAuth from "@azure/core-auth";
12
17
  import { OperationsImpl } from "./operations";
13
18
  import { Operations } from "./operationsInterfaces";
@@ -49,53 +54,88 @@ export class ResourceGraphClient extends coreClient.ServiceClient {
49
54
  credential: credentials
50
55
  };
51
56
 
52
- const packageDetails = `azsdk-js-arm-resourcegraph/5.0.0-beta.2`;
57
+ const packageDetails = `azsdk-js-arm-resourcegraph/5.0.0-beta.3`;
53
58
  const userAgentPrefix =
54
59
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
55
60
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
56
61
  : `${packageDetails}`;
57
62
 
58
- if (!options.credentialScopes) {
59
- options.credentialScopes = ["https://management.azure.com/.default"];
60
- }
61
63
  const optionsWithDefaults = {
62
64
  ...defaults,
63
65
  ...options,
64
66
  userAgentOptions: {
65
67
  userAgentPrefix
66
68
  },
67
- baseUri:
69
+ endpoint:
68
70
  options.endpoint ?? options.baseUri ?? "https://management.azure.com"
69
71
  };
70
72
  super(optionsWithDefaults);
71
73
 
74
+ let bearerTokenAuthenticationPolicyFound: boolean = false;
72
75
  if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
73
76
  const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
74
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
77
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
75
78
  (pipelinePolicy) =>
76
79
  pipelinePolicy.name ===
77
80
  coreRestPipeline.bearerTokenAuthenticationPolicyName
78
81
  );
79
- if (!bearerTokenAuthenticationPolicyFound) {
80
- this.pipeline.removePolicy({
81
- name: coreRestPipeline.bearerTokenAuthenticationPolicyName
82
- });
83
- this.pipeline.addPolicy(
84
- coreRestPipeline.bearerTokenAuthenticationPolicy({
85
- scopes: `${optionsWithDefaults.baseUri}/.default`,
86
- challengeCallbacks: {
87
- authorizeRequestOnChallenge:
88
- coreClient.authorizeRequestOnClaimChallenge
89
- }
90
- })
91
- );
92
- }
82
+ }
83
+ if (
84
+ !options ||
85
+ !options.pipeline ||
86
+ options.pipeline.getOrderedPolicies().length == 0 ||
87
+ !bearerTokenAuthenticationPolicyFound
88
+ ) {
89
+ this.pipeline.removePolicy({
90
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
91
+ });
92
+ this.pipeline.addPolicy(
93
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
94
+ credential: credentials,
95
+ scopes:
96
+ optionsWithDefaults.credentialScopes ??
97
+ `${optionsWithDefaults.endpoint}/.default`,
98
+ challengeCallbacks: {
99
+ authorizeRequestOnChallenge:
100
+ coreClient.authorizeRequestOnClaimChallenge
101
+ }
102
+ })
103
+ );
93
104
  }
94
105
 
95
106
  // Assigning values to Constant parameters
96
107
  this.$host = options.$host || "https://management.azure.com";
97
108
  this.apiVersion = options.apiVersion || "2021-06-01-preview";
98
109
  this.operations = new OperationsImpl(this);
110
+ this.addCustomApiVersionPolicy(options.apiVersion);
111
+ }
112
+
113
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
114
+ private addCustomApiVersionPolicy(apiVersion?: string) {
115
+ if (!apiVersion) {
116
+ return;
117
+ }
118
+ const apiVersionPolicy = {
119
+ name: "CustomApiVersionPolicy",
120
+ async sendRequest(
121
+ request: PipelineRequest,
122
+ next: SendRequest
123
+ ): Promise<PipelineResponse> {
124
+ const param = request.url.split("?");
125
+ if (param.length > 1) {
126
+ const newParams = param[1].split("&").map((item) => {
127
+ if (item.indexOf("api-version") > -1) {
128
+ return "api-version=" + apiVersion;
129
+ } else {
130
+ return item;
131
+ }
132
+ });
133
+ request.url = param[0] + "?" + newParams.join("&");
134
+ }
135
+ return next(request);
136
+ }
137
+ };
138
+ this.pipeline.addPolicy(apiVersionPolicy);
99
139
  }
100
140
 
101
141
  /**
@@ -59,12 +59,12 @@ export declare interface Facet {
59
59
  }
60
60
 
61
61
  /** A facet whose execution resulted in an error. */
62
- export declare type FacetError = Facet & {
62
+ export declare interface FacetError extends Facet {
63
63
  /** Polymorphic discriminator, which specifies the different types this object can be */
64
64
  resultType: "FacetError";
65
65
  /** An array containing detected facet errors with details. */
66
66
  errors: ErrorDetails[];
67
- };
67
+ }
68
68
 
69
69
  /** A request to compute additional statistics (facets) over the query results. */
70
70
  export declare interface FacetRequest {
@@ -87,7 +87,7 @@ export declare interface FacetRequestOptions {
87
87
  }
88
88
 
89
89
  /** Successfully executed facet containing additional statistics on the response of a query. */
90
- export declare type FacetResult = Facet & {
90
+ export declare interface FacetResult extends Facet {
91
91
  /** Polymorphic discriminator, which specifies the different types this object can be */
92
92
  resultType: "FacetResult";
93
93
  /** Number of total records in the facet results. */
@@ -96,13 +96,22 @@ export declare type FacetResult = Facet & {
96
96
  count: number;
97
97
  /** A JObject array or Table containing the desired facets. Only present if the facet is valid. */
98
98
  data: Record<string, unknown>;
99
- };
99
+ }
100
100
 
101
101
  /** Defines values for FacetSortOrder. */
102
102
  export declare type FacetSortOrder = "asc" | "desc";
103
103
 
104
104
  export declare type FacetUnion = Facet | FacetResult | FacetError;
105
105
 
106
+ /**
107
+ * Given the last `.value` produced by the `byPage` iterator,
108
+ * returns a continuation token that can be used to begin paging from
109
+ * that point later.
110
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
111
+ * @returns The continuation token that can be passed into byPage() during future calls.
112
+ */
113
+ export declare function getContinuationToken(page: unknown): string | undefined;
114
+
106
115
  /** Resource Graph REST API operation definition. */
107
116
  export declare interface Operation {
108
117
  /** Operation name: {provider}/{resource}/{operation} */
@@ -202,6 +211,8 @@ export declare class ResourceGraphClient extends coreClient.ServiceClient {
202
211
  * @param options The parameter options
203
212
  */
204
213
  constructor(credentials: coreAuth.TokenCredential, options?: ResourceGraphClientOptionalParams);
214
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
215
+ private addCustomApiVersionPolicy;
205
216
  /**
206
217
  * Queries the resources managed by Azure Resource Manager for scopes specified in the request.
207
218
  * @param query Request specifying query and its options.
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.18.11"
8
+ "packageVersion": "7.33.7"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=accessAPropertiesField.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accessAPropertiesField.d.ts","sourceRoot":"","sources":["../../samples-dev/accessAPropertiesField.ts"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __awaiter } from "tslib";
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- /**
12
- * This sample demonstrates how to Queries the resources managed by Azure Resource Manager for scopes specified in the request.
13
- *
14
- * @summary Queries the resources managed by Azure Resource Manager for scopes specified in the request.
15
- * x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesPropertiesQuery.json
16
- */
17
- import { ResourceGraphClient } from "@azure/arm-resourcegraph";
18
- import { DefaultAzureCredential } from "@azure/identity";
19
- function accessAPropertiesField() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const query = {
22
- query: "Resources | where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by tostring(properties.storageProfile.osDisk.osType)",
23
- subscriptions: ["cfbbd179-59d2-4052-aa06-9270a38aa9d6"]
24
- };
25
- const credential = new DefaultAzureCredential();
26
- const client = new ResourceGraphClient(credential);
27
- const result = yield client.resources(query);
28
- console.log(result);
29
- });
30
- }
31
- accessAPropertiesField().catch(console.error);
32
- //# sourceMappingURL=accessAPropertiesField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accessAPropertiesField.js","sourceRoot":"","sources":["../../samples-dev/accessAPropertiesField.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AACH,OAAO,EAAgB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAe,sBAAsB;;QACnC,MAAM,KAAK,GAAiB;YAC1B,KAAK,EACH,wIAAwI;YAC1I,aAAa,EAAE,CAAC,sCAAsC,CAAC;SACxD,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,sBAAsB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=basicManagementGroupQuery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basicManagementGroupQuery.d.ts","sourceRoot":"","sources":["../../samples-dev/basicManagementGroupQuery.ts"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __awaiter } from "tslib";
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- /**
12
- * This sample demonstrates how to Queries the resources managed by Azure Resource Manager for scopes specified in the request.
13
- *
14
- * @summary Queries the resources managed by Azure Resource Manager for scopes specified in the request.
15
- * x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesMgBasicQuery.json
16
- */
17
- import { ResourceGraphClient } from "@azure/arm-resourcegraph";
18
- import { DefaultAzureCredential } from "@azure/identity";
19
- function basicManagementGroupQuery() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const query = {
22
- managementGroups: ["e927f598-c1d4-4f72-8541-95d83a6a4ac8", "ProductionMG"],
23
- query: "Resources | project id, name, type, location, tags | limit 3"
24
- };
25
- const credential = new DefaultAzureCredential();
26
- const client = new ResourceGraphClient(credential);
27
- const result = yield client.resources(query);
28
- console.log(result);
29
- });
30
- }
31
- basicManagementGroupQuery().catch(console.error);
32
- //# sourceMappingURL=basicManagementGroupQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basicManagementGroupQuery.js","sourceRoot":"","sources":["../../samples-dev/basicManagementGroupQuery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AACH,OAAO,EAAgB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAe,yBAAyB;;QACtC,MAAM,KAAK,GAAiB;YAC1B,gBAAgB,EAAE,CAAC,sCAAsC,EAAE,cAAc,CAAC;YAC1E,KAAK,EAAE,8DAA8D;SACtE,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,yBAAyB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=basicQuery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basicQuery.d.ts","sourceRoot":"","sources":["../../samples-dev/basicQuery.ts"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __awaiter } from "tslib";
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- /**
12
- * This sample demonstrates how to Queries the resources managed by Azure Resource Manager for scopes specified in the request.
13
- *
14
- * @summary Queries the resources managed by Azure Resource Manager for scopes specified in the request.
15
- * x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesBasicQuery.json
16
- */
17
- import { ResourceGraphClient } from "@azure/arm-resourcegraph";
18
- import { DefaultAzureCredential } from "@azure/identity";
19
- function basicQuery() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const query = {
22
- query: "Resources | project id, name, type, location, tags | limit 3",
23
- subscriptions: ["cfbbd179-59d2-4052-aa06-9270a38aa9d6"]
24
- };
25
- const credential = new DefaultAzureCredential();
26
- const client = new ResourceGraphClient(credential);
27
- const result = yield client.resources(query);
28
- console.log(result);
29
- });
30
- }
31
- basicQuery().catch(console.error);
32
- //# sourceMappingURL=basicQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basicQuery.js","sourceRoot":"","sources":["../../samples-dev/basicQuery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AACH,OAAO,EAAgB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAe,UAAU;;QACvB,MAAM,KAAK,GAAiB;YAC1B,KAAK,EAAE,8DAA8D;YACrE,aAAa,EAAE,CAAC,sCAAsC,CAAC;SACxD,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,UAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=basicTenantQuery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basicTenantQuery.d.ts","sourceRoot":"","sources":["../../samples-dev/basicTenantQuery.ts"],"names":[],"mappings":""}
@@ -1,31 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __awaiter } from "tslib";
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- /**
12
- * This sample demonstrates how to Queries the resources managed by Azure Resource Manager for scopes specified in the request.
13
- *
14
- * @summary Queries the resources managed by Azure Resource Manager for scopes specified in the request.
15
- * x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesTenantBasicQuery.json
16
- */
17
- import { ResourceGraphClient } from "@azure/arm-resourcegraph";
18
- import { DefaultAzureCredential } from "@azure/identity";
19
- function basicTenantQuery() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const query = {
22
- query: "Resources | project id, name, type, location, tags | limit 3"
23
- };
24
- const credential = new DefaultAzureCredential();
25
- const client = new ResourceGraphClient(credential);
26
- const result = yield client.resources(query);
27
- console.log(result);
28
- });
29
- }
30
- basicTenantQuery().catch(console.error);
31
- //# sourceMappingURL=basicTenantQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basicTenantQuery.js","sourceRoot":"","sources":["../../samples-dev/basicTenantQuery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AACH,OAAO,EAAgB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAe,gBAAgB;;QAC7B,MAAM,KAAK,GAAiB;YAC1B,KAAK,EAAE,8DAA8D;SACtE,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,gBAAgB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=complexQuery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"complexQuery.d.ts","sourceRoot":"","sources":["../../samples-dev/complexQuery.ts"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __awaiter } from "tslib";
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- /**
12
- * This sample demonstrates how to Queries the resources managed by Azure Resource Manager for scopes specified in the request.
13
- *
14
- * @summary Queries the resources managed by Azure Resource Manager for scopes specified in the request.
15
- * x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesComplexQuery.json
16
- */
17
- import { ResourceGraphClient } from "@azure/arm-resourcegraph";
18
- import { DefaultAzureCredential } from "@azure/identity";
19
- function complexQuery() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const query = {
22
- query: "Resources | project id, name, type, location | where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by location | top 3 by count_",
23
- subscriptions: ["cfbbd179-59d2-4052-aa06-9270a38aa9d6"]
24
- };
25
- const credential = new DefaultAzureCredential();
26
- const client = new ResourceGraphClient(credential);
27
- const result = yield client.resources(query);
28
- console.log(result);
29
- });
30
- }
31
- complexQuery().catch(console.error);
32
- //# sourceMappingURL=complexQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"complexQuery.js","sourceRoot":"","sources":["../../samples-dev/complexQuery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AACH,OAAO,EAAgB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAe,YAAY;;QACzB,MAAM,KAAK,GAAiB;YAC1B,KAAK,EACH,oJAAoJ;YACtJ,aAAa,EAAE,CAAC,sCAAsC,CAAC;SACxD,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,YAAY,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=filterResources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterResources.d.ts","sourceRoot":"","sources":["../../samples-dev/filterResources.ts"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __awaiter } from "tslib";
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- /**
12
- * This sample demonstrates how to Queries the resources managed by Azure Resource Manager for scopes specified in the request.
13
- *
14
- * @summary Queries the resources managed by Azure Resource Manager for scopes specified in the request.
15
- * x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesFilterQuery.json
16
- */
17
- import { ResourceGraphClient } from "@azure/arm-resourcegraph";
18
- import { DefaultAzureCredential } from "@azure/identity";
19
- function filterResources() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const query = {
22
- query: "Resources | project id, name, type, location | where type =~ 'Microsoft.Compute/virtualMachines' | limit 3",
23
- subscriptions: ["cfbbd179-59d2-4052-aa06-9270a38aa9d6"]
24
- };
25
- const credential = new DefaultAzureCredential();
26
- const client = new ResourceGraphClient(credential);
27
- const result = yield client.resources(query);
28
- console.log(result);
29
- });
30
- }
31
- filterResources().catch(console.error);
32
- //# sourceMappingURL=filterResources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterResources.js","sourceRoot":"","sources":["../../samples-dev/filterResources.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AACH,OAAO,EAAgB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAe,eAAe;;QAC5B,MAAM,KAAK,GAAiB;YAC1B,KAAK,EACH,4GAA4G;YAC9G,aAAa,EAAE,CAAC,sCAAsC,CAAC;SACxD,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,eAAe,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=firstPageQuery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"firstPageQuery.d.ts","sourceRoot":"","sources":["../../samples-dev/firstPageQuery.ts"],"names":[],"mappings":""}
@@ -1,33 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __awaiter } from "tslib";
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- /**
12
- * This sample demonstrates how to Queries the resources managed by Azure Resource Manager for scopes specified in the request.
13
- *
14
- * @summary Queries the resources managed by Azure Resource Manager for scopes specified in the request.
15
- * x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesFirstPageQuery.json
16
- */
17
- import { ResourceGraphClient } from "@azure/arm-resourcegraph";
18
- import { DefaultAzureCredential } from "@azure/identity";
19
- function firstPageQuery() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const query = {
22
- options: { skip: 0, top: 3 },
23
- query: "Resources | where name contains 'test' | project id, name, type, location",
24
- subscriptions: ["cfbbd179-59d2-4052-aa06-9270a38aa9d6"]
25
- };
26
- const credential = new DefaultAzureCredential();
27
- const client = new ResourceGraphClient(credential);
28
- const result = yield client.resources(query);
29
- console.log(result);
30
- });
31
- }
32
- firstPageQuery().catch(console.error);
33
- //# sourceMappingURL=firstPageQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"firstPageQuery.js","sourceRoot":"","sources":["../../samples-dev/firstPageQuery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AACH,OAAO,EAAgB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAe,cAAc;;QAC3B,MAAM,KAAK,GAAiB;YAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;YAC5B,KAAK,EACH,2EAA2E;YAC7E,aAAa,EAAE,CAAC,sCAAsC,CAAC;SACxD,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,cAAc,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=nextPageQuery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nextPageQuery.d.ts","sourceRoot":"","sources":["../../samples-dev/nextPageQuery.ts"],"names":[],"mappings":""}
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __awaiter } from "tslib";
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- /**
12
- * This sample demonstrates how to Queries the resources managed by Azure Resource Manager for scopes specified in the request.
13
- *
14
- * @summary Queries the resources managed by Azure Resource Manager for scopes specified in the request.
15
- * x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesNextPageQuery.json
16
- */
17
- import { ResourceGraphClient } from "@azure/arm-resourcegraph";
18
- import { DefaultAzureCredential } from "@azure/identity";
19
- function nextPageQuery() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const query = {
22
- options: {
23
- skipToken: "eyAibm8iOiAibHVjayIsICJidXQiOiAibmljZSIsICJ0cnkiOiAiISIgfQ=="
24
- },
25
- query: "Resources | where name contains 'test' | project id, name, type, location",
26
- subscriptions: ["cfbbd179-59d2-4052-aa06-9270a38aa9d6"]
27
- };
28
- const credential = new DefaultAzureCredential();
29
- const client = new ResourceGraphClient(credential);
30
- const result = yield client.resources(query);
31
- console.log(result);
32
- });
33
- }
34
- nextPageQuery().catch(console.error);
35
- //# sourceMappingURL=nextPageQuery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nextPageQuery.js","sourceRoot":"","sources":["../../samples-dev/nextPageQuery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AACH,OAAO,EAAgB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAe,aAAa;;QAC1B,MAAM,KAAK,GAAiB;YAC1B,OAAO,EAAE;gBACP,SAAS,EAAE,8DAA8D;aAC1E;YACD,KAAK,EACH,2EAA2E;YAC7E,aAAa,EAAE,CAAC,sCAAsC,CAAC;SACxD,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CAAA;AAED,aAAa,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=operationsList.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"operationsList.d.ts","sourceRoot":"","sources":["../../samples-dev/operationsList.ts"],"names":[],"mappings":""}
@@ -1,42 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { __asyncValues, __awaiter } from "tslib";
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- /**
12
- * This sample demonstrates how to Lists all of the available REST API operations.
13
- *
14
- * @summary Lists all of the available REST API operations.
15
- * x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/OperationsList.json
16
- */
17
- import { ResourceGraphClient } from "@azure/arm-resourcegraph";
18
- import { DefaultAzureCredential } from "@azure/identity";
19
- function operationsList() {
20
- var e_1, _a;
21
- return __awaiter(this, void 0, void 0, function* () {
22
- const credential = new DefaultAzureCredential();
23
- const client = new ResourceGraphClient(credential);
24
- const resArray = new Array();
25
- try {
26
- for (var _b = __asyncValues(client.operations.list()), _c; _c = yield _b.next(), !_c.done;) {
27
- let item = _c.value;
28
- resArray.push(item);
29
- }
30
- }
31
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
32
- finally {
33
- try {
34
- if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
35
- }
36
- finally { if (e_1) throw e_1.error; }
37
- }
38
- console.log(resArray);
39
- });
40
- }
41
- operationsList().catch(console.error);
42
- //# sourceMappingURL=operationsList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"operationsList.js","sourceRoot":"","sources":["../../samples-dev/operationsList.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAe,cAAc;;;QAC3B,MAAM,UAAU,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;;YAC7B,KAAuB,IAAA,KAAA,cAAA,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA,IAAA;gBAApC,IAAI,IAAI,WAAA,CAAA;gBACjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACrB;;;;;;;;;QACD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;;CACvB;AAED,cAAc,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=queryWithAFacetRequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryWithAFacetRequest.d.ts","sourceRoot":"","sources":["../../samples-dev/queryWithAFacetRequest.ts"],"names":[],"mappings":""}