@azure/arm-devspaces 1.2.1 → 2.0.1-alpha.20220201.1

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 (140) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +21 -0
  3. package/README.md +69 -83
  4. package/dist/index.js +1321 -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/dist-esm/src/devSpacesManagementClient.d.ts +20 -0
  9. package/dist-esm/src/devSpacesManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/devSpacesManagementClient.js +53 -0
  11. package/dist-esm/src/devSpacesManagementClient.js.map +1 -0
  12. package/dist-esm/src/index.d.ts +5 -0
  13. package/dist-esm/src/index.d.ts.map +1 -0
  14. package/dist-esm/src/index.js +12 -0
  15. package/dist-esm/src/index.js.map +1 -0
  16. package/dist-esm/src/lroImpl.d.ts +16 -0
  17. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  18. package/dist-esm/src/lroImpl.js +29 -0
  19. package/dist-esm/src/lroImpl.js.map +1 -0
  20. package/dist-esm/src/models/index.d.ts +287 -0
  21. package/dist-esm/src/models/index.d.ts.map +1 -0
  22. package/dist-esm/src/models/index.js +29 -0
  23. package/dist-esm/src/models/index.js.map +1 -0
  24. package/dist-esm/src/models/mappers.d.ts +23 -0
  25. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  26. package/{esm → dist-esm/src}/models/mappers.js +204 -231
  27. package/dist-esm/src/models/mappers.js.map +1 -0
  28. package/dist-esm/src/models/parameters.d.ts +15 -0
  29. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  30. package/dist-esm/src/models/parameters.js +129 -0
  31. package/dist-esm/src/models/parameters.js.map +1 -0
  32. package/dist-esm/src/operations/containerHostMappings.d.ts +23 -0
  33. package/dist-esm/src/operations/containerHostMappings.d.ts.map +1 -0
  34. package/dist-esm/src/operations/containerHostMappings.js +59 -0
  35. package/dist-esm/src/operations/containerHostMappings.js.map +1 -0
  36. package/dist-esm/src/operations/controllers.d.ts +111 -0
  37. package/dist-esm/src/operations/controllers.d.ts.map +1 -0
  38. package/dist-esm/src/operations/controllers.js +490 -0
  39. package/dist-esm/src/operations/controllers.js.map +1 -0
  40. package/{esm → dist-esm/src}/operations/index.d.ts +1 -1
  41. package/dist-esm/src/operations/index.d.ts.map +1 -0
  42. package/{esm → dist-esm/src}/operations/index.js +4 -6
  43. package/dist-esm/src/operations/index.js.map +1 -0
  44. package/dist-esm/src/operations/operations.d.ts +34 -0
  45. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  46. package/dist-esm/src/operations/operations.js +116 -0
  47. package/dist-esm/src/operations/operations.js.map +1 -0
  48. package/dist-esm/src/operationsInterfaces/containerHostMappings.d.ts +15 -0
  49. package/dist-esm/src/operationsInterfaces/containerHostMappings.d.ts.map +1 -0
  50. package/dist-esm/src/operationsInterfaces/containerHostMappings.js +9 -0
  51. package/dist-esm/src/operationsInterfaces/containerHostMappings.js.map +1 -0
  52. package/dist-esm/src/operationsInterfaces/controllers.d.ts +74 -0
  53. package/dist-esm/src/operationsInterfaces/controllers.d.ts.map +1 -0
  54. package/dist-esm/src/operationsInterfaces/controllers.js +9 -0
  55. package/dist-esm/src/operationsInterfaces/controllers.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  57. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  58. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  59. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/operations.d.ts +12 -0
  61. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  64. package/dist-esm/test/sampleTest.d.ts +2 -0
  65. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  66. package/dist-esm/test/sampleTest.js +40 -0
  67. package/dist-esm/test/sampleTest.js.map +1 -0
  68. package/package.json +69 -24
  69. package/review/arm-devspaces.api.md +300 -0
  70. package/rollup.config.js +184 -27
  71. package/src/devSpacesManagementClient.ts +74 -39
  72. package/src/index.ts +12 -0
  73. package/src/lroImpl.ts +34 -0
  74. package/src/models/index.ts +251 -512
  75. package/src/models/mappers.ts +202 -226
  76. package/src/models/parameters.ts +98 -38
  77. package/src/operations/containerHostMappings.ts +51 -69
  78. package/src/operations/controllers.ts +469 -377
  79. package/src/operations/index.ts +4 -6
  80. package/src/operations/operations.ts +87 -81
  81. package/src/operationsInterfaces/containerHostMappings.ts +32 -0
  82. package/src/operationsInterfaces/controllers.ts +140 -0
  83. package/src/operationsInterfaces/index.ts +11 -0
  84. package/src/operationsInterfaces/operations.ts +26 -0
  85. package/tsconfig.json +4 -4
  86. package/types/arm-devspaces.d.ts +451 -0
  87. package/types/tsdoc-metadata.json +11 -0
  88. package/dist/arm-devspaces.js +0 -1261
  89. package/dist/arm-devspaces.js.map +0 -1
  90. package/dist/arm-devspaces.min.js +0 -1
  91. package/dist/arm-devspaces.min.js.map +0 -1
  92. package/esm/devSpacesManagementClient.d.ts +0 -26
  93. package/esm/devSpacesManagementClient.d.ts.map +0 -1
  94. package/esm/devSpacesManagementClient.js +0 -40
  95. package/esm/devSpacesManagementClient.js.map +0 -1
  96. package/esm/devSpacesManagementClientContext.d.ts +0 -22
  97. package/esm/devSpacesManagementClientContext.d.ts.map +0 -1
  98. package/esm/devSpacesManagementClientContext.js +0 -61
  99. package/esm/devSpacesManagementClientContext.js.map +0 -1
  100. package/esm/models/containerHostMappingsMappers.d.ts +0 -2
  101. package/esm/models/containerHostMappingsMappers.d.ts.map +0 -1
  102. package/esm/models/containerHostMappingsMappers.js +0 -11
  103. package/esm/models/containerHostMappingsMappers.js.map +0 -1
  104. package/esm/models/controllersMappers.d.ts +0 -2
  105. package/esm/models/controllersMappers.d.ts.map +0 -1
  106. package/esm/models/controllersMappers.js +0 -11
  107. package/esm/models/controllersMappers.js.map +0 -1
  108. package/esm/models/index.d.ts +0 -564
  109. package/esm/models/index.d.ts.map +0 -1
  110. package/esm/models/index.js +0 -10
  111. package/esm/models/index.js.map +0 -1
  112. package/esm/models/mappers.d.ts +0 -24
  113. package/esm/models/mappers.d.ts.map +0 -1
  114. package/esm/models/mappers.js.map +0 -1
  115. package/esm/models/operationsMappers.d.ts +0 -2
  116. package/esm/models/operationsMappers.d.ts.map +0 -1
  117. package/esm/models/operationsMappers.js +0 -11
  118. package/esm/models/operationsMappers.js.map +0 -1
  119. package/esm/models/parameters.d.ts +0 -9
  120. package/esm/models/parameters.d.ts.map +0 -1
  121. package/esm/models/parameters.js +0 -90
  122. package/esm/models/parameters.js.map +0 -1
  123. package/esm/operations/containerHostMappings.d.ts +0 -35
  124. package/esm/operations/containerHostMappings.d.ts.map +0 -1
  125. package/esm/operations/containerHostMappings.js +0 -66
  126. package/esm/operations/containerHostMappings.js.map +0 -1
  127. package/esm/operations/controllers.d.ts +0 -198
  128. package/esm/operations/controllers.d.ts.map +0 -1
  129. package/esm/operations/controllers.js +0 -346
  130. package/esm/operations/controllers.js.map +0 -1
  131. package/esm/operations/index.d.ts.map +0 -1
  132. package/esm/operations/index.js.map +0 -1
  133. package/esm/operations/operations.d.ts +0 -50
  134. package/esm/operations/operations.d.ts.map +0 -1
  135. package/esm/operations/operations.js +0 -77
  136. package/esm/operations/operations.js.map +0 -1
  137. package/src/devSpacesManagementClientContext.ts +0 -68
  138. package/src/models/containerHostMappingsMappers.ts +0 -16
  139. package/src/models/controllersMappers.ts +0 -27
  140. package/src/models/operationsMappers.ts +0 -18
@@ -0,0 +1,300 @@
1
+ ## API Report File for "@azure/arm-devspaces"
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
+ import { PollerLike } from '@azure/core-lro';
11
+ import { PollOperationState } from '@azure/core-lro';
12
+
13
+ // @public
14
+ export interface ContainerHostMapping {
15
+ containerHostResourceId?: string;
16
+ readonly mappedControllerResourceId?: string;
17
+ }
18
+
19
+ // @public
20
+ export interface ContainerHostMappings {
21
+ getContainerHostMapping(resourceGroupName: string, location: string, containerHostMapping: ContainerHostMapping, options?: ContainerHostMappingsGetContainerHostMappingOptionalParams): Promise<ContainerHostMappingsGetContainerHostMappingResponse>;
22
+ }
23
+
24
+ // @public
25
+ export interface ContainerHostMappingsGetContainerHostMappingOptionalParams extends coreClient.OperationOptions {
26
+ }
27
+
28
+ // @public
29
+ export type ContainerHostMappingsGetContainerHostMappingResponse = ContainerHostMapping;
30
+
31
+ // @public (undocumented)
32
+ export type Controller = TrackedResource & {
33
+ sku: Sku;
34
+ readonly provisioningState?: ProvisioningState;
35
+ readonly hostSuffix?: string;
36
+ readonly dataPlaneFqdn?: string;
37
+ readonly targetContainerHostApiServerFqdn?: string;
38
+ targetContainerHostResourceId: string;
39
+ targetContainerHostCredentialsBase64: string;
40
+ };
41
+
42
+ // @public (undocumented)
43
+ export interface ControllerConnectionDetails {
44
+ orchestratorSpecificConnectionDetails?: OrchestratorSpecificConnectionDetailsUnion;
45
+ }
46
+
47
+ // @public (undocumented)
48
+ export interface ControllerConnectionDetailsList {
49
+ connectionDetailsList?: ControllerConnectionDetails[];
50
+ }
51
+
52
+ // @public (undocumented)
53
+ export interface ControllerList {
54
+ readonly nextLink?: string;
55
+ value?: Controller[];
56
+ }
57
+
58
+ // @public
59
+ export interface Controllers {
60
+ beginCreate(resourceGroupName: string, name: string, controller: Controller, options?: ControllersCreateOptionalParams): Promise<PollerLike<PollOperationState<ControllersCreateResponse>, ControllersCreateResponse>>;
61
+ beginCreateAndWait(resourceGroupName: string, name: string, controller: Controller, options?: ControllersCreateOptionalParams): Promise<ControllersCreateResponse>;
62
+ beginDelete(resourceGroupName: string, name: string, options?: ControllersDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
63
+ beginDeleteAndWait(resourceGroupName: string, name: string, options?: ControllersDeleteOptionalParams): Promise<void>;
64
+ get(resourceGroupName: string, name: string, options?: ControllersGetOptionalParams): Promise<ControllersGetResponse>;
65
+ list(options?: ControllersListOptionalParams): PagedAsyncIterableIterator<Controller>;
66
+ listByResourceGroup(resourceGroupName: string, options?: ControllersListByResourceGroupOptionalParams): PagedAsyncIterableIterator<Controller>;
67
+ listConnectionDetails(resourceGroupName: string, name: string, listConnectionDetailsParameters: ListConnectionDetailsParameters, options?: ControllersListConnectionDetailsOptionalParams): Promise<ControllersListConnectionDetailsResponse>;
68
+ update(resourceGroupName: string, name: string, controllerUpdateParameters: ControllerUpdateParameters, options?: ControllersUpdateOptionalParams): Promise<ControllersUpdateResponse>;
69
+ }
70
+
71
+ // @public
72
+ export interface ControllersCreateOptionalParams extends coreClient.OperationOptions {
73
+ resumeFrom?: string;
74
+ updateIntervalInMs?: number;
75
+ }
76
+
77
+ // @public
78
+ export type ControllersCreateResponse = Controller;
79
+
80
+ // @public
81
+ export interface ControllersDeleteOptionalParams extends coreClient.OperationOptions {
82
+ resumeFrom?: string;
83
+ updateIntervalInMs?: number;
84
+ }
85
+
86
+ // @public
87
+ export interface ControllersGetOptionalParams extends coreClient.OperationOptions {
88
+ }
89
+
90
+ // @public
91
+ export type ControllersGetResponse = Controller;
92
+
93
+ // @public
94
+ export interface ControllersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
95
+ }
96
+
97
+ // @public
98
+ export type ControllersListByResourceGroupNextResponse = ControllerList;
99
+
100
+ // @public
101
+ export interface ControllersListByResourceGroupOptionalParams extends coreClient.OperationOptions {
102
+ }
103
+
104
+ // @public
105
+ export type ControllersListByResourceGroupResponse = ControllerList;
106
+
107
+ // @public
108
+ export interface ControllersListConnectionDetailsOptionalParams extends coreClient.OperationOptions {
109
+ }
110
+
111
+ // @public
112
+ export type ControllersListConnectionDetailsResponse = ControllerConnectionDetailsList;
113
+
114
+ // @public
115
+ export interface ControllersListNextOptionalParams extends coreClient.OperationOptions {
116
+ }
117
+
118
+ // @public
119
+ export type ControllersListNextResponse = ControllerList;
120
+
121
+ // @public
122
+ export interface ControllersListOptionalParams extends coreClient.OperationOptions {
123
+ }
124
+
125
+ // @public
126
+ export type ControllersListResponse = ControllerList;
127
+
128
+ // @public
129
+ export interface ControllersUpdateOptionalParams extends coreClient.OperationOptions {
130
+ }
131
+
132
+ // @public
133
+ export type ControllersUpdateResponse = Controller;
134
+
135
+ // @public
136
+ export interface ControllerUpdateParameters {
137
+ tags?: {
138
+ [propertyName: string]: string;
139
+ };
140
+ targetContainerHostCredentialsBase64?: string;
141
+ }
142
+
143
+ // @public
144
+ export interface DevSpacesErrorResponse {
145
+ error?: ErrorDetails;
146
+ }
147
+
148
+ // @public (undocumented)
149
+ export class DevSpacesManagementClient extends coreClient.ServiceClient {
150
+ // (undocumented)
151
+ $host: string;
152
+ constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DevSpacesManagementClientOptionalParams);
153
+ // (undocumented)
154
+ apiVersion: string;
155
+ // (undocumented)
156
+ containerHostMappings: ContainerHostMappings;
157
+ // (undocumented)
158
+ controllers: Controllers;
159
+ // (undocumented)
160
+ operations: Operations;
161
+ // (undocumented)
162
+ subscriptionId: string;
163
+ }
164
+
165
+ // @public
166
+ export interface DevSpacesManagementClientOptionalParams extends coreClient.ServiceClientOptions {
167
+ $host?: string;
168
+ apiVersion?: string;
169
+ endpoint?: string;
170
+ }
171
+
172
+ // @public (undocumented)
173
+ export interface ErrorDetails {
174
+ readonly code?: string;
175
+ readonly message?: string;
176
+ readonly target?: string;
177
+ }
178
+
179
+ // @public
180
+ export enum KnownProvisioningState {
181
+ // (undocumented)
182
+ Canceled = "Canceled",
183
+ // (undocumented)
184
+ Creating = "Creating",
185
+ // (undocumented)
186
+ Deleted = "Deleted",
187
+ // (undocumented)
188
+ Deleting = "Deleting",
189
+ // (undocumented)
190
+ Failed = "Failed",
191
+ // (undocumented)
192
+ Succeeded = "Succeeded",
193
+ // (undocumented)
194
+ Updating = "Updating"
195
+ }
196
+
197
+ // @public
198
+ export enum KnownSkuName {
199
+ // (undocumented)
200
+ S1 = "S1"
201
+ }
202
+
203
+ // @public
204
+ export enum KnownSkuTier {
205
+ // (undocumented)
206
+ Standard = "Standard"
207
+ }
208
+
209
+ // @public
210
+ export type KubernetesConnectionDetails = OrchestratorSpecificConnectionDetails & {
211
+ instanceType: "Kubernetes";
212
+ kubeConfig?: string;
213
+ };
214
+
215
+ // @public
216
+ export interface ListConnectionDetailsParameters {
217
+ targetContainerHostResourceId: string;
218
+ }
219
+
220
+ // @public
221
+ export interface Operations {
222
+ list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator<ResourceProviderOperationDefinition>;
223
+ }
224
+
225
+ // @public
226
+ export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {
227
+ }
228
+
229
+ // @public
230
+ export type OperationsListNextResponse = ResourceProviderOperationList;
231
+
232
+ // @public
233
+ export interface OperationsListOptionalParams extends coreClient.OperationOptions {
234
+ }
235
+
236
+ // @public
237
+ export type OperationsListResponse = ResourceProviderOperationList;
238
+
239
+ // @public
240
+ export interface OrchestratorSpecificConnectionDetails {
241
+ instanceType: "Kubernetes";
242
+ }
243
+
244
+ // @public (undocumented)
245
+ export type OrchestratorSpecificConnectionDetailsUnion = OrchestratorSpecificConnectionDetails | KubernetesConnectionDetails;
246
+
247
+ // @public
248
+ export type ProvisioningState = string;
249
+
250
+ // @public
251
+ export interface Resource {
252
+ readonly id?: string;
253
+ readonly name?: string;
254
+ readonly type?: string;
255
+ }
256
+
257
+ // @public (undocumented)
258
+ export interface ResourceProviderOperationDefinition {
259
+ // (undocumented)
260
+ display?: ResourceProviderOperationDisplay;
261
+ name?: string;
262
+ }
263
+
264
+ // @public (undocumented)
265
+ export interface ResourceProviderOperationDisplay {
266
+ description?: string;
267
+ operation?: string;
268
+ provider?: string;
269
+ resource?: string;
270
+ }
271
+
272
+ // @public (undocumented)
273
+ export interface ResourceProviderOperationList {
274
+ readonly nextLink?: string;
275
+ value?: ResourceProviderOperationDefinition[];
276
+ }
277
+
278
+ // @public
279
+ export interface Sku {
280
+ name: SkuName;
281
+ tier?: SkuTier;
282
+ }
283
+
284
+ // @public
285
+ export type SkuName = string;
286
+
287
+ // @public
288
+ export type SkuTier = string;
289
+
290
+ // @public
291
+ export type TrackedResource = Resource & {
292
+ tags?: {
293
+ [propertyName: string]: string;
294
+ };
295
+ location?: string;
296
+ };
297
+
298
+ // (No @packageDocumentation comment for this package)
299
+
300
+ ```
package/rollup.config.js CHANGED
@@ -1,31 +1,188 @@
1
- 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";
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
66
+
67
+ /**
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.
70
+ */
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
+
2
93
  /**
3
- * @type {import('rollup').RollupFileOptions}
94
+ * Construct a warning handler for the shared rollup configuration
95
+ * that ignores certain warnings that are not relevant to testing.
4
96
  */
5
- const config = {
6
- input: './esm/devSpacesManagementClient.js',
7
- external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
8
- output: {
9
- file: "./dist/arm-devspaces.js",
10
- format: "umd",
11
- name: "Azure.ArmDevspaces",
12
- sourcemap: true,
13
- globals: {
14
- "@azure/ms-rest-js": "msRest",
15
- "@azure/ms-rest-azure-js": "msRestAzure"
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/**"]
16
113
  },
17
- banner: `/*
18
- * Copyright (c) Microsoft Corporation. All rights reserved.
19
- * Licensed under the MIT License. See License.txt in the project root for
20
- * license information.
21
- *
22
- * Code generated by Microsoft (R) AutoRest Code Generator.
23
- * Changes may cause incorrect behavior and will be lost if the code is
24
- * regenerated.
25
- */`
26
- },
27
- plugins: [
28
- nodeResolve({ module: true })
29
- ]
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
30
158
  };
31
- export default config;
159
+
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"));
@@ -1,52 +1,87 @@
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";
16
- import { DevSpacesManagementClientContext } from "./devSpacesManagementClientContext";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import {
12
+ ContainerHostMappingsImpl,
13
+ OperationsImpl,
14
+ ControllersImpl
15
+ } from "./operations";
16
+ import {
17
+ ContainerHostMappings,
18
+ Operations,
19
+ Controllers
20
+ } from "./operationsInterfaces";
21
+ import { DevSpacesManagementClientOptionalParams } from "./models";
17
22
 
18
-
19
- class DevSpacesManagementClient extends DevSpacesManagementClientContext {
20
- // Operation groups
21
- containerHostMappings: operations.ContainerHostMappings;
22
- controllers: operations.Controllers;
23
- operations: operations.Operations;
23
+ export class DevSpacesManagementClient extends coreClient.ServiceClient {
24
+ $host: string;
25
+ apiVersion: string;
26
+ subscriptionId: string;
24
27
 
25
28
  /**
26
29
  * Initializes a new instance of the DevSpacesManagementClient class.
27
- * @param credentials Credentials needed for the client to connect to Azure. Credentials
28
- * implementing the TokenCredential interface from the @azure/identity package are recommended. For
29
- * more information about these credentials, see
30
- * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
31
- * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
32
- * @azure/ms-rest-browserauth are also supported.
30
+ * @param credentials Subscription credentials which uniquely identify client subscription.
33
31
  * @param subscriptionId Azure subscription ID.
34
- * @param [options] The parameter options
32
+ * @param options The parameter options
35
33
  */
36
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.DevSpacesManagementClientOptions) {
37
- super(credentials, subscriptionId, options);
38
- this.containerHostMappings = new operations.ContainerHostMappings(this);
39
- this.controllers = new operations.Controllers(this);
40
- this.operations = new operations.Operations(this);
41
- }
42
- }
34
+ constructor(
35
+ credentials: coreAuth.TokenCredential,
36
+ subscriptionId: string,
37
+ options?: DevSpacesManagementClientOptionalParams
38
+ ) {
39
+ if (credentials === undefined) {
40
+ throw new Error("'credentials' cannot be null");
41
+ }
42
+ if (subscriptionId === undefined) {
43
+ throw new Error("'subscriptionId' cannot be null");
44
+ }
45
+
46
+ // Initializing default values for options
47
+ if (!options) {
48
+ options = {};
49
+ }
50
+ const defaults: DevSpacesManagementClientOptionalParams = {
51
+ requestContentType: "application/json; charset=utf-8",
52
+ credential: credentials
53
+ };
43
54
 
44
- // Operation Specifications
55
+ const packageDetails = `azsdk-js-arm-devspaces/2.0.0`;
56
+ const userAgentPrefix =
57
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
58
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
59
+ : `${packageDetails}`;
45
60
 
46
- export {
47
- DevSpacesManagementClient,
48
- DevSpacesManagementClientContext,
49
- Models as DevSpacesManagementModels,
50
- Mappers as DevSpacesManagementMappers
51
- };
52
- export * from "./operations";
61
+ if (!options.credentialScopes) {
62
+ options.credentialScopes = ["https://management.azure.com/.default"];
63
+ }
64
+ const optionsWithDefaults = {
65
+ ...defaults,
66
+ ...options,
67
+ userAgentOptions: {
68
+ userAgentPrefix
69
+ },
70
+ baseUri: options.endpoint || "https://management.azure.com"
71
+ };
72
+ super(optionsWithDefaults);
73
+ // Parameter assignments
74
+ this.subscriptionId = subscriptionId;
75
+
76
+ // Assigning values to Constant parameters
77
+ this.$host = options.$host || "https://management.azure.com";
78
+ this.apiVersion = options.apiVersion || "2019-04-01";
79
+ this.containerHostMappings = new ContainerHostMappingsImpl(this);
80
+ this.operations = new OperationsImpl(this);
81
+ this.controllers = new ControllersImpl(this);
82
+ }
83
+
84
+ containerHostMappings: ContainerHostMappings;
85
+ operations: Operations;
86
+ controllers: Controllers;
87
+ }
package/src/index.ts ADDED
@@ -0,0 +1,12 @@
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 { DevSpacesManagementClient } from "./devSpacesManagementClient";
12
+ export * from "./operationsInterfaces";
package/src/lroImpl.ts ADDED
@@ -0,0 +1,34 @@
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 { LongRunningOperation, LroResponse } from "@azure/core-lro";
10
+
11
+ export class LroImpl<T> implements LongRunningOperation<T> {
12
+ constructor(
13
+ private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
14
+ private args: Record<string, unknown>,
15
+ private spec: {
16
+ readonly requestBody?: unknown;
17
+ readonly path?: string;
18
+ readonly httpMethod: string;
19
+ } & Record<string, any>,
20
+ public requestPath: string = spec.path!,
21
+ public requestMethod: string = spec.httpMethod
22
+ ) {}
23
+ public async sendInitialRequest(): Promise<LroResponse<T>> {
24
+ return this.sendOperationFn(this.args, this.spec);
25
+ }
26
+ public async sendPollRequest(path: string): Promise<LroResponse<T>> {
27
+ const { requestBody, ...restSpec } = this.spec;
28
+ return this.sendOperationFn(this.args, {
29
+ ...restSpec,
30
+ path,
31
+ httpMethod: "GET"
32
+ });
33
+ }
34
+ }