@azure/arm-hardwaresecuritymodules 1.0.0

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 (109) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +1542 -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/samples-dev/dedicatedHsmCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/dedicatedHsmCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/dedicatedHsmCreateOrUpdateSample.js +109 -0
  11. package/dist-esm/samples-dev/dedicatedHsmCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/dedicatedHsmDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/dedicatedHsmDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/dedicatedHsmDeleteSample.js +31 -0
  15. package/dist-esm/samples-dev/dedicatedHsmDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/dedicatedHsmGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/dedicatedHsmGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/dedicatedHsmGetSample.js +67 -0
  19. package/dist-esm/samples-dev/dedicatedHsmGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.js +75 -0
  23. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.js.map +1 -0
  24. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.js +73 -0
  27. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.js.map +1 -0
  28. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js +45 -0
  31. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js.map +1 -0
  32. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.js +53 -0
  35. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.js.map +1 -0
  36. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/operationsListSample.js +73 -0
  39. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  40. package/dist-esm/src/azureDedicatedHSMResourceProvider.d.ts +20 -0
  41. package/dist-esm/src/azureDedicatedHSMResourceProvider.d.ts.map +1 -0
  42. package/dist-esm/src/azureDedicatedHSMResourceProvider.js +54 -0
  43. package/dist-esm/src/azureDedicatedHSMResourceProvider.js.map +1 -0
  44. package/dist-esm/src/index.d.ts +5 -0
  45. package/dist-esm/src/index.d.ts.map +1 -0
  46. package/dist-esm/src/index.js +12 -0
  47. package/dist-esm/src/index.js.map +1 -0
  48. package/dist-esm/src/lroImpl.d.ts +16 -0
  49. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  50. package/dist-esm/src/lroImpl.js +29 -0
  51. package/dist-esm/src/lroImpl.js.map +1 -0
  52. package/dist-esm/src/models/index.d.ts +372 -0
  53. package/dist-esm/src/models/index.d.ts.map +1 -0
  54. package/dist-esm/src/models/index.js +52 -0
  55. package/dist-esm/src/models/index.js.map +1 -0
  56. package/dist-esm/src/models/mappers.d.ts +21 -0
  57. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  58. package/dist-esm/src/models/mappers.js +534 -0
  59. package/dist-esm/src/models/mappers.js.map +1 -0
  60. package/dist-esm/src/models/parameters.d.ts +14 -0
  61. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  62. package/dist-esm/src/models/parameters.js +124 -0
  63. package/dist-esm/src/models/parameters.js.map +1 -0
  64. package/dist-esm/src/operations/dedicatedHsmOperations.d.ts +134 -0
  65. package/dist-esm/src/operations/dedicatedHsmOperations.d.ts.map +1 -0
  66. package/dist-esm/src/operations/dedicatedHsmOperations.js +624 -0
  67. package/dist-esm/src/operations/dedicatedHsmOperations.js.map +1 -0
  68. package/dist-esm/src/operations/index.d.ts +3 -0
  69. package/dist-esm/src/operations/index.d.ts.map +1 -0
  70. package/dist-esm/src/operations/index.js +10 -0
  71. package/dist-esm/src/operations/index.js.map +1 -0
  72. package/dist-esm/src/operations/operations.d.ts +26 -0
  73. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  74. package/dist-esm/src/operations/operations.js +90 -0
  75. package/dist-esm/src/operations/operations.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.d.ts +78 -0
  77. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/index.d.ts +3 -0
  81. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/index.js +10 -0
  83. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  85. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  87. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  88. package/dist-esm/test/sampleTest.d.ts +2 -0
  89. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  90. package/dist-esm/test/sampleTest.js +41 -0
  91. package/dist-esm/test/sampleTest.js.map +1 -0
  92. package/package.json +118 -0
  93. package/review/arm-hardwaresecuritymodules.api.md +318 -0
  94. package/rollup.config.js +122 -0
  95. package/src/azureDedicatedHSMResourceProvider.ts +79 -0
  96. package/src/index.ts +12 -0
  97. package/src/lroImpl.ts +34 -0
  98. package/src/models/index.ts +428 -0
  99. package/src/models/mappers.ts +562 -0
  100. package/src/models/parameters.ts +144 -0
  101. package/src/operations/dedicatedHsmOperations.ts +830 -0
  102. package/src/operations/index.ts +10 -0
  103. package/src/operations/operations.ts +98 -0
  104. package/src/operationsInterfaces/dedicatedHsmOperations.ts +149 -0
  105. package/src/operationsInterfaces/index.ts +10 -0
  106. package/src/operationsInterfaces/operations.ts +22 -0
  107. package/tsconfig.json +33 -0
  108. package/types/arm-hardwaresecuritymodules.d.ts +524 -0
  109. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,318 @@
1
+ ## API Report File for "@azure/arm-hardwaresecuritymodules"
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 ApiEntityReference {
15
+ id?: string;
16
+ }
17
+
18
+ // @public (undocumented)
19
+ export class AzureDedicatedHSMResourceProvider extends coreClient.ServiceClient {
20
+ // (undocumented)
21
+ $host: string;
22
+ constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureDedicatedHSMResourceProviderOptionalParams);
23
+ // (undocumented)
24
+ apiVersion: string;
25
+ // (undocumented)
26
+ dedicatedHsmOperations: DedicatedHsmOperations;
27
+ // (undocumented)
28
+ operations: Operations;
29
+ // (undocumented)
30
+ subscriptionId: string;
31
+ }
32
+
33
+ // @public
34
+ export interface AzureDedicatedHSMResourceProviderOptionalParams extends coreClient.ServiceClientOptions {
35
+ $host?: string;
36
+ apiVersion?: string;
37
+ endpoint?: string;
38
+ }
39
+
40
+ // @public
41
+ export type DedicatedHsm = Resource & {
42
+ readonly systemData?: SystemData;
43
+ networkProfile?: NetworkProfile;
44
+ managementNetworkProfile?: NetworkProfile;
45
+ stampId?: string;
46
+ readonly statusMessage?: string;
47
+ readonly provisioningState?: JsonWebKeyType;
48
+ };
49
+
50
+ // @public
51
+ export interface DedicatedHsmCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
52
+ resumeFrom?: string;
53
+ updateIntervalInMs?: number;
54
+ }
55
+
56
+ // @public
57
+ export type DedicatedHsmCreateOrUpdateResponse = DedicatedHsm;
58
+
59
+ // @public
60
+ export interface DedicatedHsmDeleteOptionalParams extends coreClient.OperationOptions {
61
+ resumeFrom?: string;
62
+ updateIntervalInMs?: number;
63
+ }
64
+
65
+ // @public
66
+ export interface DedicatedHsmError {
67
+ readonly error?: ErrorModel;
68
+ }
69
+
70
+ // @public
71
+ export interface DedicatedHsmGetOptionalParams extends coreClient.OperationOptions {
72
+ }
73
+
74
+ // @public
75
+ export type DedicatedHsmGetResponse = DedicatedHsm;
76
+
77
+ // @public
78
+ export interface DedicatedHsmListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
79
+ top?: number;
80
+ }
81
+
82
+ // @public
83
+ export type DedicatedHsmListByResourceGroupNextResponse = DedicatedHsmListResult;
84
+
85
+ // @public
86
+ export interface DedicatedHsmListByResourceGroupOptionalParams extends coreClient.OperationOptions {
87
+ top?: number;
88
+ }
89
+
90
+ // @public
91
+ export type DedicatedHsmListByResourceGroupResponse = DedicatedHsmListResult;
92
+
93
+ // @public
94
+ export interface DedicatedHsmListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
95
+ top?: number;
96
+ }
97
+
98
+ // @public
99
+ export type DedicatedHsmListBySubscriptionNextResponse = DedicatedHsmListResult;
100
+
101
+ // @public
102
+ export interface DedicatedHsmListBySubscriptionOptionalParams extends coreClient.OperationOptions {
103
+ top?: number;
104
+ }
105
+
106
+ // @public
107
+ export type DedicatedHsmListBySubscriptionResponse = DedicatedHsmListResult;
108
+
109
+ // @public
110
+ export interface DedicatedHsmListOutboundNetworkDependenciesEndpointsNextOptionalParams extends coreClient.OperationOptions {
111
+ }
112
+
113
+ // @public
114
+ export type DedicatedHsmListOutboundNetworkDependenciesEndpointsNextResponse = OutboundEnvironmentEndpointCollection;
115
+
116
+ // @public
117
+ export interface DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams extends coreClient.OperationOptions {
118
+ }
119
+
120
+ // @public
121
+ export type DedicatedHsmListOutboundNetworkDependenciesEndpointsResponse = OutboundEnvironmentEndpointCollection;
122
+
123
+ // @public
124
+ export interface DedicatedHsmListResult {
125
+ nextLink?: string;
126
+ value?: DedicatedHsm[];
127
+ }
128
+
129
+ // @public
130
+ export interface DedicatedHsmOperation {
131
+ display?: DedicatedHsmOperationDisplay;
132
+ readonly isDataAction?: string;
133
+ name?: string;
134
+ }
135
+
136
+ // @public
137
+ export interface DedicatedHsmOperationDisplay {
138
+ description?: string;
139
+ operation?: string;
140
+ provider?: string;
141
+ resource?: string;
142
+ }
143
+
144
+ // @public
145
+ export interface DedicatedHsmOperationListResult {
146
+ value?: DedicatedHsmOperation[];
147
+ }
148
+
149
+ // @public
150
+ export interface DedicatedHsmOperations {
151
+ beginCreateOrUpdate(resourceGroupName: string, name: string, parameters: DedicatedHsm, options?: DedicatedHsmCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<DedicatedHsmCreateOrUpdateResponse>, DedicatedHsmCreateOrUpdateResponse>>;
152
+ beginCreateOrUpdateAndWait(resourceGroupName: string, name: string, parameters: DedicatedHsm, options?: DedicatedHsmCreateOrUpdateOptionalParams): Promise<DedicatedHsmCreateOrUpdateResponse>;
153
+ beginDelete(resourceGroupName: string, name: string, options?: DedicatedHsmDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
154
+ beginDeleteAndWait(resourceGroupName: string, name: string, options?: DedicatedHsmDeleteOptionalParams): Promise<void>;
155
+ beginUpdate(resourceGroupName: string, name: string, options?: DedicatedHsmUpdateOptionalParams): Promise<PollerLike<PollOperationState<DedicatedHsmUpdateResponse>, DedicatedHsmUpdateResponse>>;
156
+ beginUpdateAndWait(resourceGroupName: string, name: string, options?: DedicatedHsmUpdateOptionalParams): Promise<DedicatedHsmUpdateResponse>;
157
+ get(resourceGroupName: string, name: string, options?: DedicatedHsmGetOptionalParams): Promise<DedicatedHsmGetResponse>;
158
+ listByResourceGroup(resourceGroupName: string, options?: DedicatedHsmListByResourceGroupOptionalParams): PagedAsyncIterableIterator<DedicatedHsm>;
159
+ listBySubscription(options?: DedicatedHsmListBySubscriptionOptionalParams): PagedAsyncIterableIterator<DedicatedHsm>;
160
+ listOutboundNetworkDependenciesEndpoints(resourceGroupName: string, name: string, options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams): PagedAsyncIterableIterator<OutboundEnvironmentEndpoint>;
161
+ }
162
+
163
+ // @public
164
+ export interface DedicatedHsmPatchParameters {
165
+ tags?: {
166
+ [propertyName: string]: string;
167
+ };
168
+ }
169
+
170
+ // @public
171
+ export interface DedicatedHsmUpdateOptionalParams extends coreClient.OperationOptions {
172
+ resumeFrom?: string;
173
+ tags?: {
174
+ [propertyName: string]: string;
175
+ };
176
+ updateIntervalInMs?: number;
177
+ }
178
+
179
+ // @public
180
+ export type DedicatedHsmUpdateResponse = DedicatedHsm;
181
+
182
+ // @public
183
+ export interface EndpointDependency {
184
+ domainName?: string;
185
+ endpointDetails?: EndpointDetail[];
186
+ }
187
+
188
+ // @public
189
+ export interface EndpointDetail {
190
+ description?: string;
191
+ ipAddress?: string;
192
+ port?: number;
193
+ protocol?: string;
194
+ }
195
+
196
+ // @public
197
+ export interface ErrorModel {
198
+ readonly code?: string;
199
+ readonly innerError?: ErrorModel;
200
+ readonly message?: string;
201
+ }
202
+
203
+ // @public
204
+ export type IdentityType = string;
205
+
206
+ // @public
207
+ export type JsonWebKeyType = string;
208
+
209
+ // @public
210
+ export enum KnownIdentityType {
211
+ // (undocumented)
212
+ Application = "Application",
213
+ // (undocumented)
214
+ Key = "Key",
215
+ // (undocumented)
216
+ ManagedIdentity = "ManagedIdentity",
217
+ // (undocumented)
218
+ User = "User"
219
+ }
220
+
221
+ // @public
222
+ export enum KnownJsonWebKeyType {
223
+ Allocating = "Allocating",
224
+ CheckingQuota = "CheckingQuota",
225
+ Connecting = "Connecting",
226
+ Deleting = "Deleting",
227
+ Failed = "Failed",
228
+ Provisioning = "Provisioning",
229
+ Succeeded = "Succeeded"
230
+ }
231
+
232
+ // @public
233
+ export enum KnownSkuName {
234
+ PayShield10KLMK1CPS250 = "payShield10K_LMK1_CPS250",
235
+ PayShield10KLMK1CPS2500 = "payShield10K_LMK1_CPS2500",
236
+ PayShield10KLMK1CPS60 = "payShield10K_LMK1_CPS60",
237
+ PayShield10KLMK2CPS250 = "payShield10K_LMK2_CPS250",
238
+ PayShield10KLMK2CPS2500 = "payShield10K_LMK2_CPS2500",
239
+ PayShield10KLMK2CPS60 = "payShield10K_LMK2_CPS60",
240
+ SafeNetLunaNetworkHSMA790 = "SafeNet Luna Network HSM A790"
241
+ }
242
+
243
+ // @public
244
+ export interface NetworkInterface {
245
+ readonly id?: string;
246
+ privateIpAddress?: string;
247
+ }
248
+
249
+ // @public
250
+ export interface NetworkProfile {
251
+ networkInterfaces?: NetworkInterface[];
252
+ subnet?: ApiEntityReference;
253
+ }
254
+
255
+ // @public
256
+ export interface Operations {
257
+ list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator<DedicatedHsmOperation>;
258
+ }
259
+
260
+ // @public
261
+ export interface OperationsListOptionalParams extends coreClient.OperationOptions {
262
+ }
263
+
264
+ // @public
265
+ export type OperationsListResponse = DedicatedHsmOperationListResult;
266
+
267
+ // @public
268
+ export interface OutboundEnvironmentEndpoint {
269
+ category?: string;
270
+ endpoints?: EndpointDependency[];
271
+ }
272
+
273
+ // @public
274
+ export interface OutboundEnvironmentEndpointCollection {
275
+ readonly nextLink?: string;
276
+ value: OutboundEnvironmentEndpoint[];
277
+ }
278
+
279
+ // @public
280
+ export interface Resource {
281
+ readonly id?: string;
282
+ location: string;
283
+ readonly name?: string;
284
+ sku?: Sku;
285
+ tags?: {
286
+ [propertyName: string]: string;
287
+ };
288
+ readonly type?: string;
289
+ zones?: string[];
290
+ }
291
+
292
+ // @public
293
+ export interface ResourceListResult {
294
+ nextLink?: string;
295
+ value?: Resource[];
296
+ }
297
+
298
+ // @public
299
+ export interface Sku {
300
+ name?: SkuName;
301
+ }
302
+
303
+ // @public
304
+ export type SkuName = string;
305
+
306
+ // @public
307
+ export interface SystemData {
308
+ createdAt?: Date;
309
+ createdBy?: string;
310
+ createdByType?: IdentityType;
311
+ lastModifiedAt?: Date;
312
+ lastModifiedBy?: string;
313
+ lastModifiedByType?: IdentityType;
314
+ }
315
+
316
+ // (No @packageDocumentation comment for this package)
317
+
318
+ ```
@@ -0,0 +1,122 @@
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
+ // #region Warning Handler
18
+
19
+ /**
20
+ * A function that can determine whether a rollup warning should be ignored. If
21
+ * the function returns `true`, then the warning will not be displayed.
22
+ */
23
+
24
+ function ignoreNiseSinonEval(warning) {
25
+ return (
26
+ warning.code === "EVAL" &&
27
+ warning.id &&
28
+ (warning.id.includes("node_modules/nise") ||
29
+ warning.id.includes("node_modules/sinon")) === true
30
+ );
31
+ }
32
+
33
+ function ignoreChaiCircularDependency(warning) {
34
+ return (
35
+ warning.code === "CIRCULAR_DEPENDENCY" &&
36
+ warning.importer && warning.importer.includes("node_modules/chai") === true
37
+ );
38
+ }
39
+
40
+ const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
41
+
42
+ /**
43
+ * Construct a warning handler for the shared rollup configuration
44
+ * that ignores certain warnings that are not relevant to testing.
45
+ */
46
+ function makeOnWarnForTesting() {
47
+ return (warning, warn) => {
48
+ // If every inhibitor returns false (i.e. no inhibitors), then show the warning
49
+ if (warningInhibitors.every((inhib) => !inhib(warning))) {
50
+ warn(warning);
51
+ }
52
+ };
53
+ }
54
+
55
+ // #endregion
56
+
57
+ function makeBrowserTestConfig() {
58
+ const config = {
59
+ input: {
60
+ include: ["dist-esm/test/**/*.spec.js"],
61
+ exclude: ["dist-esm/test/**/node/**"]
62
+ },
63
+ output: {
64
+ file: `dist-test/index.browser.js`,
65
+ format: "umd",
66
+ sourcemap: true
67
+ },
68
+ preserveSymlinks: false,
69
+ plugins: [
70
+ multiEntry({ exports: false }),
71
+ nodeResolve({
72
+ mainFields: ["module", "browser"]
73
+ }),
74
+ cjs(),
75
+ json(),
76
+ sourcemaps()
77
+ //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
78
+ ],
79
+ onwarn: makeOnWarnForTesting(),
80
+ // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
81
+ // rollup started respecting the "sideEffects" field in package.json. Since
82
+ // our package.json sets "sideEffects=false", this also applies to test
83
+ // code, which causes all tests to be removed by tree-shaking.
84
+ treeshake: false
85
+ };
86
+
87
+ return config;
88
+ }
89
+
90
+ const defaultConfigurationOptions = {
91
+ disableBrowserBundle: false
92
+ };
93
+
94
+ export function makeConfig(pkg, options) {
95
+ options = {
96
+ ...defaultConfigurationOptions,
97
+ ...(options || {})
98
+ };
99
+
100
+ const baseConfig = {
101
+ // Use the package's module field if it has one
102
+ input: pkg["module"] || "dist-esm/src/index.js",
103
+ external: [
104
+ ...nodeBuiltins,
105
+ ...Object.keys(pkg.dependencies),
106
+ ...Object.keys(pkg.devDependencies)
107
+ ],
108
+ output: { file: "dist/index.js", format: "cjs", sourcemap: true },
109
+ preserveSymlinks: false,
110
+ plugins: [sourcemaps(), nodeResolve()]
111
+ };
112
+
113
+ const config = [baseConfig];
114
+
115
+ if (!options.disableBrowserBundle) {
116
+ config.push(makeBrowserTestConfig());
117
+ }
118
+
119
+ return config;
120
+ }
121
+
122
+ export default makeConfig(require("./package.json"));
@@ -0,0 +1,79 @@
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 * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import { OperationsImpl, DedicatedHsmOperationsImpl } from "./operations";
12
+ import { Operations, DedicatedHsmOperations } from "./operationsInterfaces";
13
+ import { AzureDedicatedHSMResourceProviderOptionalParams } from "./models";
14
+
15
+ export class AzureDedicatedHSMResourceProvider extends coreClient.ServiceClient {
16
+ $host: string;
17
+ apiVersion: string;
18
+ subscriptionId: string;
19
+
20
+ /**
21
+ * Initializes a new instance of the AzureDedicatedHSMResourceProvider class.
22
+ * @param credentials Subscription credentials which uniquely identify client subscription.
23
+ * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription.
24
+ * The subscription ID forms part of the URI for every service call.
25
+ * @param options The parameter options
26
+ */
27
+ constructor(
28
+ credentials: coreAuth.TokenCredential,
29
+ subscriptionId: string,
30
+ options?: AzureDedicatedHSMResourceProviderOptionalParams
31
+ ) {
32
+ if (credentials === undefined) {
33
+ throw new Error("'credentials' cannot be null");
34
+ }
35
+ if (subscriptionId === undefined) {
36
+ throw new Error("'subscriptionId' cannot be null");
37
+ }
38
+
39
+ // Initializing default values for options
40
+ if (!options) {
41
+ options = {};
42
+ }
43
+ const defaults: AzureDedicatedHSMResourceProviderOptionalParams = {
44
+ requestContentType: "application/json; charset=utf-8",
45
+ credential: credentials
46
+ };
47
+
48
+ const packageDetails = `azsdk-js-arm-hardwaresecuritymodules/1.0.0`;
49
+ const userAgentPrefix =
50
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
51
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
52
+ : `${packageDetails}`;
53
+
54
+ if (!options.credentialScopes) {
55
+ options.credentialScopes = ["https://management.azure.com/.default"];
56
+ }
57
+ const optionsWithDefaults = {
58
+ ...defaults,
59
+ ...options,
60
+ userAgentOptions: {
61
+ userAgentPrefix
62
+ },
63
+ baseUri:
64
+ options.endpoint ?? options.baseUri ?? "https://management.azure.com"
65
+ };
66
+ super(optionsWithDefaults);
67
+ // Parameter assignments
68
+ this.subscriptionId = subscriptionId;
69
+
70
+ // Assigning values to Constant parameters
71
+ this.$host = options.$host || "https://management.azure.com";
72
+ this.apiVersion = options.apiVersion || "2021-11-30";
73
+ this.operations = new OperationsImpl(this);
74
+ this.dedicatedHsmOperations = new DedicatedHsmOperationsImpl(this);
75
+ }
76
+
77
+ operations: Operations;
78
+ dedicatedHsmOperations: DedicatedHsmOperations;
79
+ }
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 { AzureDedicatedHSMResourceProvider } from "./azureDedicatedHSMResourceProvider";
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
+ }