@azure/arm-locks 1.2.0 → 2.0.0-alpha.20211015.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 (84) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +63 -80
  4. package/dist/index.js +1796 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/esm/index.d.ts +534 -0
  9. package/esm/index.d.ts.map +1 -0
  10. package/esm/index.js +13 -0
  11. package/esm/index.js.map +1 -0
  12. package/esm/managementLockClient.d.ts +9 -18
  13. package/esm/managementLockClient.d.ts.map +1 -1
  14. package/esm/managementLockClient.js +12 -28
  15. package/esm/managementLockClient.js.map +1 -1
  16. package/esm/managementLockClientContext.d.ts +10 -16
  17. package/esm/managementLockClientContext.d.ts.map +1 -1
  18. package/esm/managementLockClientContext.js +34 -46
  19. package/esm/managementLockClientContext.js.map +1 -1
  20. package/esm/models/index.d.ts +208 -445
  21. package/esm/models/index.d.ts.map +1 -1
  22. package/esm/models/index.js +9 -2
  23. package/esm/models/index.js.map +1 -1
  24. package/esm/models/mappers.d.ts +7 -9
  25. package/esm/models/mappers.d.ts.map +1 -1
  26. package/esm/models/mappers.js +69 -78
  27. package/esm/models/mappers.js.map +1 -1
  28. package/esm/models/parameters.d.ts +16 -13
  29. package/esm/models/parameters.d.ts.map +1 -1
  30. package/esm/models/parameters.js +78 -54
  31. package/esm/models/parameters.js.map +1 -1
  32. package/esm/operations/authorizationOperations.d.ts +27 -26
  33. package/esm/operations/authorizationOperations.d.ts.map +1 -1
  34. package/esm/operations/authorizationOperations.js +158 -50
  35. package/esm/operations/authorizationOperations.js.map +1 -1
  36. package/esm/operations/index.d.ts.map +1 -1
  37. package/esm/operations/index.js +3 -5
  38. package/esm/operations/index.js.map +1 -1
  39. package/esm/operations/managementLocks.d.ts +203 -393
  40. package/esm/operations/managementLocks.d.ts.map +1 -1
  41. package/esm/operations/managementLocks.js +993 -485
  42. package/esm/operations/managementLocks.js.map +1 -1
  43. package/esm/operationsInterfaces/authorizationOperations.d.ts +18 -0
  44. package/esm/operationsInterfaces/authorizationOperations.d.ts.map +1 -0
  45. package/esm/operationsInterfaces/authorizationOperations.js +9 -0
  46. package/esm/operationsInterfaces/authorizationOperations.js.map +1 -0
  47. package/esm/operationsInterfaces/index.d.ts +3 -0
  48. package/esm/operationsInterfaces/index.d.ts.map +1 -0
  49. package/esm/operationsInterfaces/index.js +10 -0
  50. package/esm/operationsInterfaces/index.js.map +1 -0
  51. package/esm/operationsInterfaces/managementLocks.d.ts +198 -0
  52. package/esm/operationsInterfaces/managementLocks.d.ts.map +1 -0
  53. package/esm/operationsInterfaces/managementLocks.js +9 -0
  54. package/esm/operationsInterfaces/managementLocks.js.map +1 -0
  55. package/package.json +53 -16
  56. package/review/arm-locks.api.md +313 -0
  57. package/rollup.config.js +181 -30
  58. package/src/index.ts +13 -0
  59. package/src/managementLockClient.ts +23 -36
  60. package/src/managementLockClientContext.ts +47 -45
  61. package/src/models/index.ts +256 -470
  62. package/src/models/mappers.ts +72 -82
  63. package/src/models/parameters.ts +97 -55
  64. package/src/operations/authorizationOperations.ts +155 -70
  65. package/src/operations/index.ts +3 -5
  66. package/src/operations/managementLocks.ts +1165 -869
  67. package/src/operationsInterfaces/authorizationOperations.ts +36 -0
  68. package/src/operationsInterfaces/index.ts +10 -0
  69. package/src/operationsInterfaces/managementLocks.ts +332 -0
  70. package/tsconfig.json +3 -2
  71. package/dist/arm-locks.js +0 -1280
  72. package/dist/arm-locks.js.map +0 -1
  73. package/dist/arm-locks.min.js +0 -1
  74. package/dist/arm-locks.min.js.map +0 -1
  75. package/esm/models/authorizationOperationsMappers.d.ts +0 -2
  76. package/esm/models/authorizationOperationsMappers.d.ts.map +0 -1
  77. package/esm/models/authorizationOperationsMappers.js +0 -9
  78. package/esm/models/authorizationOperationsMappers.js.map +0 -1
  79. package/esm/models/managementLocksMappers.d.ts +0 -2
  80. package/esm/models/managementLocksMappers.d.ts.map +0 -1
  81. package/esm/models/managementLocksMappers.js +0 -9
  82. package/esm/models/managementLocksMappers.js.map +0 -1
  83. package/src/models/authorizationOperationsMappers.ts +0 -14
  84. package/src/models/managementLocksMappers.ts +0 -15
@@ -0,0 +1,313 @@
1
+ ## API Report File for "@azure/arm-locks"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import * as coreAuth from '@azure/core-auth';
8
+ import * as coreClient from '@azure/core-client';
9
+ import { PagedAsyncIterableIterator } from '@azure/core-paging';
10
+
11
+ // @public
12
+ export interface AuthorizationOperations {
13
+ list(options?: AuthorizationOperationsListOptionalParams): PagedAsyncIterableIterator<Operation>;
14
+ listNext(nextLink: string, options?: AuthorizationOperationsListNextOptionalParams): PagedAsyncIterableIterator<Operation>;
15
+ }
16
+
17
+ // @public
18
+ export interface AuthorizationOperationsListNextNextOptionalParams extends coreClient.OperationOptions {
19
+ }
20
+
21
+ // @public
22
+ export type AuthorizationOperationsListNextNextResponse = OperationListResult;
23
+
24
+ // @public
25
+ export interface AuthorizationOperationsListNextOptionalParams extends coreClient.OperationOptions {
26
+ }
27
+
28
+ // @public
29
+ export type AuthorizationOperationsListNextResponse = OperationListResult;
30
+
31
+ // @public
32
+ export interface AuthorizationOperationsListOptionalParams extends coreClient.OperationOptions {
33
+ }
34
+
35
+ // @public
36
+ export type AuthorizationOperationsListResponse = OperationListResult;
37
+
38
+ // @public
39
+ export enum KnownLockLevel {
40
+ // (undocumented)
41
+ CanNotDelete = "CanNotDelete",
42
+ // (undocumented)
43
+ NotSpecified = "NotSpecified",
44
+ // (undocumented)
45
+ ReadOnly = "ReadOnly"
46
+ }
47
+
48
+ // @public
49
+ export type LockLevel = string;
50
+
51
+ // @public (undocumented)
52
+ export class ManagementLockClient extends ManagementLockClientContext {
53
+ constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagementLockClientOptionalParams);
54
+ // (undocumented)
55
+ authorizationOperations: AuthorizationOperations;
56
+ // (undocumented)
57
+ managementLocks: ManagementLocks;
58
+ }
59
+
60
+ // @public (undocumented)
61
+ export class ManagementLockClientContext extends coreClient.ServiceClient {
62
+ // (undocumented)
63
+ $host: string;
64
+ constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ManagementLockClientOptionalParams);
65
+ // (undocumented)
66
+ apiVersion: string;
67
+ // (undocumented)
68
+ subscriptionId: string;
69
+ }
70
+
71
+ // @public
72
+ export interface ManagementLockClientOptionalParams extends coreClient.ServiceClientOptions {
73
+ $host?: string;
74
+ apiVersion?: string;
75
+ endpoint?: string;
76
+ }
77
+
78
+ // @public
79
+ export interface ManagementLockListResult {
80
+ nextLink?: string;
81
+ value?: ManagementLockObject[];
82
+ }
83
+
84
+ // @public
85
+ export interface ManagementLockObject {
86
+ readonly id?: string;
87
+ level: LockLevel;
88
+ readonly name?: string;
89
+ notes?: string;
90
+ owners?: ManagementLockOwner[];
91
+ readonly type?: string;
92
+ }
93
+
94
+ // @public
95
+ export interface ManagementLockOwner {
96
+ applicationId?: string;
97
+ }
98
+
99
+ // @public
100
+ export interface ManagementLocks {
101
+ createOrUpdateAtResourceGroupLevel(resourceGroupName: string, lockName: string, parameters: ManagementLockObject, options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams): Promise<ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse>;
102
+ createOrUpdateAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, parameters: ManagementLockObject, options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams): Promise<ManagementLocksCreateOrUpdateAtResourceLevelResponse>;
103
+ createOrUpdateAtSubscriptionLevel(lockName: string, parameters: ManagementLockObject, options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams): Promise<ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse>;
104
+ createOrUpdateByScope(scope: string, lockName: string, parameters: ManagementLockObject, options?: ManagementLocksCreateOrUpdateByScopeOptionalParams): Promise<ManagementLocksCreateOrUpdateByScopeResponse>;
105
+ deleteAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams): Promise<void>;
106
+ deleteAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: ManagementLocksDeleteAtResourceLevelOptionalParams): Promise<void>;
107
+ deleteAtSubscriptionLevel(lockName: string, options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams): Promise<void>;
108
+ deleteByScope(scope: string, lockName: string, options?: ManagementLocksDeleteByScopeOptionalParams): Promise<void>;
109
+ getAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: ManagementLocksGetAtResourceGroupLevelOptionalParams): Promise<ManagementLocksGetAtResourceGroupLevelResponse>;
110
+ getAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: ManagementLocksGetAtResourceLevelOptionalParams): Promise<ManagementLocksGetAtResourceLevelResponse>;
111
+ getAtSubscriptionLevel(lockName: string, options?: ManagementLocksGetAtSubscriptionLevelOptionalParams): Promise<ManagementLocksGetAtSubscriptionLevelResponse>;
112
+ getByScope(scope: string, lockName: string, options?: ManagementLocksGetByScopeOptionalParams): Promise<ManagementLocksGetByScopeResponse>;
113
+ listAtResourceGroupLevel(resourceGroupName: string, options?: ManagementLocksListAtResourceGroupLevelOptionalParams): PagedAsyncIterableIterator<ManagementLockObject>;
114
+ listAtResourceGroupLevelNext(resourceGroupName: string, nextLink: string, options?: ManagementLocksListAtResourceGroupLevelNextOptionalParams): PagedAsyncIterableIterator<ManagementLockObject>;
115
+ listAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: ManagementLocksListAtResourceLevelOptionalParams): PagedAsyncIterableIterator<ManagementLockObject>;
116
+ listAtResourceLevelNext(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, nextLink: string, options?: ManagementLocksListAtResourceLevelNextOptionalParams): PagedAsyncIterableIterator<ManagementLockObject>;
117
+ listAtSubscriptionLevel(options?: ManagementLocksListAtSubscriptionLevelOptionalParams): PagedAsyncIterableIterator<ManagementLockObject>;
118
+ listAtSubscriptionLevelNext(nextLink: string, options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams): PagedAsyncIterableIterator<ManagementLockObject>;
119
+ listByScope(scope: string, options?: ManagementLocksListByScopeOptionalParams): PagedAsyncIterableIterator<ManagementLockObject>;
120
+ listByScopeNext(scope: string, nextLink: string, options?: ManagementLocksListByScopeNextOptionalParams): PagedAsyncIterableIterator<ManagementLockObject>;
121
+ }
122
+
123
+ // @public
124
+ export interface ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions {
125
+ }
126
+
127
+ // @public
128
+ export type ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse = ManagementLockObject;
129
+
130
+ // @public
131
+ export interface ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams extends coreClient.OperationOptions {
132
+ }
133
+
134
+ // @public
135
+ export type ManagementLocksCreateOrUpdateAtResourceLevelResponse = ManagementLockObject;
136
+
137
+ // @public
138
+ export interface ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams extends coreClient.OperationOptions {
139
+ }
140
+
141
+ // @public
142
+ export type ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse = ManagementLockObject;
143
+
144
+ // @public
145
+ export interface ManagementLocksCreateOrUpdateByScopeOptionalParams extends coreClient.OperationOptions {
146
+ }
147
+
148
+ // @public
149
+ export type ManagementLocksCreateOrUpdateByScopeResponse = ManagementLockObject;
150
+
151
+ // @public
152
+ export interface ManagementLocksDeleteAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions {
153
+ }
154
+
155
+ // @public
156
+ export interface ManagementLocksDeleteAtResourceLevelOptionalParams extends coreClient.OperationOptions {
157
+ }
158
+
159
+ // @public
160
+ export interface ManagementLocksDeleteAtSubscriptionLevelOptionalParams extends coreClient.OperationOptions {
161
+ }
162
+
163
+ // @public
164
+ export interface ManagementLocksDeleteByScopeOptionalParams extends coreClient.OperationOptions {
165
+ }
166
+
167
+ // @public
168
+ export interface ManagementLocksGetAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions {
169
+ }
170
+
171
+ // @public
172
+ export type ManagementLocksGetAtResourceGroupLevelResponse = ManagementLockObject;
173
+
174
+ // @public
175
+ export interface ManagementLocksGetAtResourceLevelOptionalParams extends coreClient.OperationOptions {
176
+ }
177
+
178
+ // @public
179
+ export type ManagementLocksGetAtResourceLevelResponse = ManagementLockObject;
180
+
181
+ // @public
182
+ export interface ManagementLocksGetAtSubscriptionLevelOptionalParams extends coreClient.OperationOptions {
183
+ }
184
+
185
+ // @public
186
+ export type ManagementLocksGetAtSubscriptionLevelResponse = ManagementLockObject;
187
+
188
+ // @public
189
+ export interface ManagementLocksGetByScopeOptionalParams extends coreClient.OperationOptions {
190
+ }
191
+
192
+ // @public
193
+ export type ManagementLocksGetByScopeResponse = ManagementLockObject;
194
+
195
+ // @public
196
+ export interface ManagementLocksListAtResourceGroupLevelNextNextOptionalParams extends coreClient.OperationOptions {
197
+ filter?: string;
198
+ }
199
+
200
+ // @public
201
+ export type ManagementLocksListAtResourceGroupLevelNextNextResponse = ManagementLockListResult;
202
+
203
+ // @public
204
+ export interface ManagementLocksListAtResourceGroupLevelNextOptionalParams extends coreClient.OperationOptions {
205
+ filter?: string;
206
+ }
207
+
208
+ // @public
209
+ export type ManagementLocksListAtResourceGroupLevelNextResponse = ManagementLockListResult;
210
+
211
+ // @public
212
+ export interface ManagementLocksListAtResourceGroupLevelOptionalParams extends coreClient.OperationOptions {
213
+ filter?: string;
214
+ }
215
+
216
+ // @public
217
+ export type ManagementLocksListAtResourceGroupLevelResponse = ManagementLockListResult;
218
+
219
+ // @public
220
+ export interface ManagementLocksListAtResourceLevelNextNextOptionalParams extends coreClient.OperationOptions {
221
+ filter?: string;
222
+ }
223
+
224
+ // @public
225
+ export type ManagementLocksListAtResourceLevelNextNextResponse = ManagementLockListResult;
226
+
227
+ // @public
228
+ export interface ManagementLocksListAtResourceLevelNextOptionalParams extends coreClient.OperationOptions {
229
+ filter?: string;
230
+ }
231
+
232
+ // @public
233
+ export type ManagementLocksListAtResourceLevelNextResponse = ManagementLockListResult;
234
+
235
+ // @public
236
+ export interface ManagementLocksListAtResourceLevelOptionalParams extends coreClient.OperationOptions {
237
+ filter?: string;
238
+ }
239
+
240
+ // @public
241
+ export type ManagementLocksListAtResourceLevelResponse = ManagementLockListResult;
242
+
243
+ // @public
244
+ export interface ManagementLocksListAtSubscriptionLevelNextNextOptionalParams extends coreClient.OperationOptions {
245
+ filter?: string;
246
+ }
247
+
248
+ // @public
249
+ export type ManagementLocksListAtSubscriptionLevelNextNextResponse = ManagementLockListResult;
250
+
251
+ // @public
252
+ export interface ManagementLocksListAtSubscriptionLevelNextOptionalParams extends coreClient.OperationOptions {
253
+ filter?: string;
254
+ }
255
+
256
+ // @public
257
+ export type ManagementLocksListAtSubscriptionLevelNextResponse = ManagementLockListResult;
258
+
259
+ // @public
260
+ export interface ManagementLocksListAtSubscriptionLevelOptionalParams extends coreClient.OperationOptions {
261
+ filter?: string;
262
+ }
263
+
264
+ // @public
265
+ export type ManagementLocksListAtSubscriptionLevelResponse = ManagementLockListResult;
266
+
267
+ // @public
268
+ export interface ManagementLocksListByScopeNextNextOptionalParams extends coreClient.OperationOptions {
269
+ filter?: string;
270
+ }
271
+
272
+ // @public
273
+ export type ManagementLocksListByScopeNextNextResponse = ManagementLockListResult;
274
+
275
+ // @public
276
+ export interface ManagementLocksListByScopeNextOptionalParams extends coreClient.OperationOptions {
277
+ filter?: string;
278
+ }
279
+
280
+ // @public
281
+ export type ManagementLocksListByScopeNextResponse = ManagementLockListResult;
282
+
283
+ // @public
284
+ export interface ManagementLocksListByScopeOptionalParams extends coreClient.OperationOptions {
285
+ filter?: string;
286
+ }
287
+
288
+ // @public
289
+ export type ManagementLocksListByScopeResponse = ManagementLockListResult;
290
+
291
+ // @public
292
+ export interface Operation {
293
+ display?: OperationDisplay;
294
+ name?: string;
295
+ }
296
+
297
+ // @public
298
+ export interface OperationDisplay {
299
+ operation?: string;
300
+ provider?: string;
301
+ resource?: string;
302
+ }
303
+
304
+ // @public
305
+ export interface OperationListResult {
306
+ nextLink?: string;
307
+ value?: Operation[];
308
+ }
309
+
310
+
311
+ // (No @packageDocumentation comment for this package)
312
+
313
+ ```
package/rollup.config.js CHANGED
@@ -1,37 +1,188 @@
1
- import rollup from "rollup";
2
- import nodeResolve from "rollup-plugin-node-resolve";
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
+
9
+ import nodeResolve from "@rollup/plugin-node-resolve";
10
+ import cjs from "@rollup/plugin-commonjs";
3
11
  import sourcemaps from "rollup-plugin-sourcemaps";
12
+ import multiEntry from "@rollup/plugin-multi-entry";
13
+ import json from "@rollup/plugin-json";
14
+
15
+ import nodeBuiltins from "builtin-modules";
16
+
17
+ /**
18
+ * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
19
+ *
20
+ * NOTE: this manual configuration is only needed because OpenTelemetry uses an
21
+ * __exportStar downleveled helper function to declare its exports which confuses
22
+ * rollup's automatic discovery mechanism.
23
+ *
24
+ * @returns an object reference that can be `...`'d into your cjs() configuration.
25
+ */
26
+ export function openTelemetryCommonJs() {
27
+ const namedExports = {};
28
+
29
+ for (const key of [
30
+ "@opentelemetry/api",
31
+ "@azure/core-tracing/node_modules/@opentelemetry/api"
32
+ ]) {
33
+ namedExports[key] = [
34
+ "SpanKind",
35
+ "TraceFlags",
36
+ "getSpan",
37
+ "setSpan",
38
+ "SpanStatusCode",
39
+ "getSpanContext",
40
+ "setSpanContext"
41
+ ];
42
+ }
43
+
44
+ const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
45
+
46
+ for (const version of releasedOpenTelemetryVersions) {
47
+ namedExports[
48
+ // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
49
+ `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
50
+ ] = [
51
+ "SpanKind",
52
+ "TraceFlags",
53
+ "getSpan",
54
+ "setSpan",
55
+ "StatusCode",
56
+ "CanonicalCode",
57
+ "getSpanContext",
58
+ "setSpanContext"
59
+ ];
60
+ }
61
+
62
+ return namedExports;
63
+ }
64
+
65
+ // #region Warning Handler
4
66
 
5
67
  /**
6
- * @type {rollup.RollupFileOptions}
68
+ * A function that can determine whether a rollupwarning should be ignored. If
69
+ * the function returns `true`, then the warning will not be displayed.
7
70
  */
8
- const config = {
9
- input: "./esm/managementLockClient.js",
10
- external: [
11
- "@azure/ms-rest-js",
12
- "@azure/ms-rest-azure-js"
13
- ],
14
- output: {
15
- file: "./dist/arm-locks.js",
16
- format: "umd",
17
- name: "Azure.ArmLocks",
18
- sourcemap: true,
19
- globals: {
20
- "@azure/ms-rest-js": "msRest",
21
- "@azure/ms-rest-azure-js": "msRestAzure"
71
+
72
+ function ignoreNiseSinonEvalWarnings(warning) {
73
+ return (
74
+ warning.code === "EVAL" &&
75
+ warning.id &&
76
+ (warning.id.includes("node_modules/nise") ||
77
+ warning.id.includes("node_modules/sinon")) === true
78
+ );
79
+ }
80
+
81
+ function ignoreChaiCircularDependencyWarnings(warning) {
82
+ return (
83
+ warning.code === "CIRCULAR_DEPENDENCY" &&
84
+ warning.importer && warning.importer.includes("node_modules/chai") === true
85
+ );
86
+ }
87
+
88
+ const warningInhibitors = [
89
+ ignoreChaiCircularDependencyWarnings,
90
+ ignoreNiseSinonEvalWarnings
91
+ ];
92
+
93
+ /**
94
+ * Construct a warning handler for the shared rollup configuration
95
+ * that ignores certain warnings that are not relevant to testing.
96
+ */
97
+ function makeOnWarnForTesting() {
98
+ return (warning, warn) => {
99
+ // If every inhibitor returns false (i.e. no inhibitors), then show the warning
100
+ if (warningInhibitors.every((inhib) => !inhib(warning))) {
101
+ warn(warning);
102
+ }
103
+ };
104
+ }
105
+
106
+ // #endregion
107
+
108
+ function makeBrowserTestConfig() {
109
+ const config = {
110
+ input: {
111
+ include: ["dist-esm/test/**/*.spec.js"],
112
+ exclude: ["dist-esm/test/**/node/**"]
22
113
  },
23
- banner: `/*
24
- * Copyright (c) Microsoft Corporation. All rights reserved.
25
- * Licensed under the MIT License. See License.txt in the project root for license information.
26
- *
27
- * Code generated by Microsoft (R) AutoRest Code Generator.
28
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
29
- */`
30
- },
31
- plugins: [
32
- nodeResolve({ module: true }),
33
- sourcemaps()
34
- ]
114
+ output: {
115
+ file: `dist-test/index.browser.js`,
116
+ format: "umd",
117
+ sourcemap: true
118
+ },
119
+ preserveSymlinks: false,
120
+ plugins: [
121
+ multiEntry({ exports: false }),
122
+ nodeResolve({
123
+ mainFields: ["module", "browser"]
124
+ }),
125
+ cjs({
126
+ namedExports: {
127
+ // Chai's strange internal architecture makes it impossible to statically
128
+ // analyze its exports.
129
+ chai: [
130
+ "version",
131
+ "use",
132
+ "util",
133
+ "config",
134
+ "expect",
135
+ "should",
136
+ "assert"
137
+ ],
138
+ ...openTelemetryCommonJs()
139
+ }
140
+ }),
141
+ json(),
142
+ sourcemaps()
143
+ //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
144
+ ],
145
+ onwarn: makeOnWarnForTesting(),
146
+ // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
147
+ // rollup started respecting the "sideEffects" field in package.json. Since
148
+ // our package.json sets "sideEffects=false", this also applies to test
149
+ // code, which causes all tests to be removed by tree-shaking.
150
+ treeshake: false
151
+ };
152
+
153
+ return config;
154
+ }
155
+
156
+ const defaultConfigurationOptions = {
157
+ disableBrowserBundle: false
35
158
  };
36
159
 
37
- export default config;
160
+ export function makeConfig(pkg, options) {
161
+ options = {
162
+ ...defaultConfigurationOptions,
163
+ ...(options || {})
164
+ };
165
+
166
+ const baseConfig = {
167
+ // Use the package's module field if it has one
168
+ input: pkg["module"] || "dist-esm/src/index.js",
169
+ external: [
170
+ ...nodeBuiltins,
171
+ ...Object.keys(pkg.dependencies),
172
+ ...Object.keys(pkg.devDependencies)
173
+ ],
174
+ output: { file: "dist/index.js", format: "cjs", sourcemap: true },
175
+ preserveSymlinks: false,
176
+ plugins: [sourcemaps(), nodeResolve(), cjs()]
177
+ };
178
+
179
+ const config = [baseConfig];
180
+
181
+ if (!options.disableBrowserBundle) {
182
+ config.push(makeBrowserTestConfig());
183
+ }
184
+
185
+ return config;
186
+ }
187
+
188
+ export default makeConfig(require("./package.json"));
package/src/index.ts ADDED
@@ -0,0 +1,13 @@
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
+
9
+ /// <reference lib="esnext.asynciterable" />
10
+ export * from "./models";
11
+ export { ManagementLockClient } from "./managementLockClient";
12
+ export { ManagementLockClientContext } from "./managementLockClientContext";
13
+ export * from "./operationsInterfaces";
@@ -1,50 +1,37 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import { TokenCredential } from "@azure/core-auth";
13
- import * as Models from "./models";
14
- import * as Mappers from "./models/mappers";
15
- import * as operations from "./operations";
9
+ import * as coreAuth from "@azure/core-auth";
10
+ import { AuthorizationOperationsImpl, ManagementLocksImpl } from "./operations";
11
+ import {
12
+ AuthorizationOperations,
13
+ ManagementLocks
14
+ } from "./operationsInterfaces";
16
15
  import { ManagementLockClientContext } from "./managementLockClientContext";
16
+ import { ManagementLockClientOptionalParams } from "./models";
17
17
 
18
-
19
- class ManagementLockClient extends ManagementLockClientContext {
20
- // Operation groups
21
- authorizationOperations: operations.AuthorizationOperations;
22
- managementLocks: operations.ManagementLocks;
23
-
18
+ export class ManagementLockClient extends ManagementLockClientContext {
24
19
  /**
25
20
  * Initializes a new instance of the ManagementLockClient class.
26
- * @param credentials Credentials needed for the client to connect to Azure. Credentials
27
- * implementing the TokenCredential interface from the @azure/identity package are recommended. For
28
- * more information about these credentials, see
29
- * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
30
- * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
31
- * @azure/ms-rest-browserauth are also supported.
21
+ * @param credentials Subscription credentials which uniquely identify client subscription.
32
22
  * @param subscriptionId The ID of the target subscription.
33
- * @param [options] The parameter options
23
+ * @param options The parameter options
34
24
  */
35
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ManagementLockClientOptions) {
25
+ constructor(
26
+ credentials: coreAuth.TokenCredential,
27
+ subscriptionId: string,
28
+ options?: ManagementLockClientOptionalParams
29
+ ) {
36
30
  super(credentials, subscriptionId, options);
37
- this.authorizationOperations = new operations.AuthorizationOperations(this);
38
- this.managementLocks = new operations.ManagementLocks(this);
31
+ this.authorizationOperations = new AuthorizationOperationsImpl(this);
32
+ this.managementLocks = new ManagementLocksImpl(this);
39
33
  }
40
- }
41
34
 
42
- // Operation Specifications
43
-
44
- export {
45
- ManagementLockClient,
46
- ManagementLockClientContext,
47
- Models as ManagementLockModels,
48
- Mappers as ManagementLockMappers
49
- };
50
- export * from "./operations";
35
+ authorizationOperations: AuthorizationOperations;
36
+ managementLocks: ManagementLocks;
37
+ }