@azure/arm-maps 2.0.0 → 3.0.0-alpha.20220131.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 (132) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +68 -81
  4. package/dist/index.js +1892 -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/azureMapsManagementClient.d.ts +20 -0
  9. package/dist-esm/src/azureMapsManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/azureMapsManagementClient.js +53 -0
  11. package/dist-esm/src/azureMapsManagementClient.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/{esm/models/mapsMappers.js → dist-esm/src/index.js} +5 -2
  15. package/dist-esm/src/index.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +480 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +35 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +25 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/{esm → dist-esm/src}/models/mappers.js +332 -379
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +16 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +131 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/accounts.d.ts +103 -0
  29. package/dist-esm/src/operations/accounts.d.ts.map +1 -0
  30. package/dist-esm/src/operations/accounts.js +427 -0
  31. package/dist-esm/src/operations/accounts.js.map +1 -0
  32. package/dist-esm/src/operations/creators.d.ts +74 -0
  33. package/dist-esm/src/operations/creators.d.ts.map +1 -0
  34. package/dist-esm/src/operations/creators.js +281 -0
  35. package/dist-esm/src/operations/creators.js.map +1 -0
  36. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  37. package/dist-esm/src/operations/index.d.ts.map +1 -0
  38. package/{esm → dist-esm/src}/operations/index.js +1 -2
  39. package/dist-esm/src/operations/index.js.map +1 -0
  40. package/dist-esm/src/operations/maps.d.ts +51 -0
  41. package/dist-esm/src/operations/maps.d.ts.map +1 -0
  42. package/dist-esm/src/operations/maps.js +220 -0
  43. package/dist-esm/src/operations/maps.js.map +1 -0
  44. package/dist-esm/src/operationsInterfaces/accounts.d.ts +67 -0
  45. package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
  46. package/dist-esm/src/operationsInterfaces/accounts.js +9 -0
  47. package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
  48. package/dist-esm/src/operationsInterfaces/creators.d.ts +49 -0
  49. package/dist-esm/src/operationsInterfaces/creators.d.ts.map +1 -0
  50. package/dist-esm/src/operationsInterfaces/creators.js +9 -0
  51. package/dist-esm/src/operationsInterfaces/creators.js.map +1 -0
  52. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  53. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  54. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  55. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/maps.d.ts +16 -0
  57. package/dist-esm/src/operationsInterfaces/maps.d.ts.map +1 -0
  58. package/{esm/models/index.js → dist-esm/src/operationsInterfaces/maps.js} +2 -1
  59. package/dist-esm/src/operationsInterfaces/maps.js.map +1 -0
  60. package/dist-esm/test/sampleTest.d.ts +2 -0
  61. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  62. package/dist-esm/test/sampleTest.js +40 -0
  63. package/dist-esm/test/sampleTest.js.map +1 -0
  64. package/package.json +71 -21
  65. package/review/arm-maps.api.md +423 -0
  66. package/rollup.config.js +181 -24
  67. package/src/azureMapsManagementClient.ts +61 -30
  68. package/src/{models/mapsMappers.ts → index.ts} +4 -11
  69. package/src/models/index.ts +380 -684
  70. package/src/models/mappers.ts +333 -378
  71. package/src/models/parameters.ts +99 -36
  72. package/src/operations/accounts.ts +315 -502
  73. package/src/operations/creators.ts +202 -341
  74. package/src/operations/index.ts +1 -2
  75. package/src/operations/maps.ts +196 -77
  76. package/src/operationsInterfaces/accounts.ts +125 -0
  77. package/src/operationsInterfaces/creators.ts +95 -0
  78. package/src/operationsInterfaces/index.ts +11 -0
  79. package/src/operationsInterfaces/maps.ts +33 -0
  80. package/tsconfig.json +3 -3
  81. package/types/arm-maps.d.ts +696 -0
  82. package/types/tsdoc-metadata.json +11 -0
  83. package/dist/arm-maps.js +0 -1661
  84. package/dist/arm-maps.js.map +0 -1
  85. package/dist/arm-maps.min.js +0 -1
  86. package/dist/arm-maps.min.js.map +0 -1
  87. package/esm/azureMapsManagementClient.d.ts +0 -20
  88. package/esm/azureMapsManagementClient.d.ts.map +0 -1
  89. package/esm/azureMapsManagementClient.js +0 -34
  90. package/esm/azureMapsManagementClient.js.map +0 -1
  91. package/esm/azureMapsManagementClientContext.d.ts +0 -16
  92. package/esm/azureMapsManagementClientContext.d.ts.map +0 -1
  93. package/esm/azureMapsManagementClientContext.js +0 -56
  94. package/esm/azureMapsManagementClientContext.js.map +0 -1
  95. package/esm/models/accountsMappers.d.ts +0 -2
  96. package/esm/models/accountsMappers.d.ts.map +0 -1
  97. package/esm/models/accountsMappers.js +0 -9
  98. package/esm/models/accountsMappers.js.map +0 -1
  99. package/esm/models/creatorsMappers.d.ts +0 -2
  100. package/esm/models/creatorsMappers.d.ts.map +0 -1
  101. package/esm/models/creatorsMappers.js +0 -9
  102. package/esm/models/creatorsMappers.js.map +0 -1
  103. package/esm/models/index.d.ts +0 -793
  104. package/esm/models/index.d.ts.map +0 -1
  105. package/esm/models/index.js.map +0 -1
  106. package/esm/models/mappers.d.ts +0 -29
  107. package/esm/models/mappers.d.ts.map +0 -1
  108. package/esm/models/mappers.js.map +0 -1
  109. package/esm/models/mapsMappers.d.ts +0 -2
  110. package/esm/models/mapsMappers.d.ts.map +0 -1
  111. package/esm/models/mapsMappers.js.map +0 -1
  112. package/esm/models/parameters.d.ts +0 -9
  113. package/esm/models/parameters.d.ts.map +0 -1
  114. package/esm/models/parameters.js +0 -91
  115. package/esm/models/parameters.js.map +0 -1
  116. package/esm/operations/accounts.d.ts +0 -222
  117. package/esm/operations/accounts.d.ts.map +0 -1
  118. package/esm/operations/accounts.js +0 -271
  119. package/esm/operations/accounts.js.map +0 -1
  120. package/esm/operations/creators.d.ts +0 -157
  121. package/esm/operations/creators.d.ts.map +0 -1
  122. package/esm/operations/creators.js +0 -201
  123. package/esm/operations/creators.js.map +0 -1
  124. package/esm/operations/index.d.ts.map +0 -1
  125. package/esm/operations/index.js.map +0 -1
  126. package/esm/operations/maps.d.ts +0 -46
  127. package/esm/operations/maps.d.ts.map +0 -1
  128. package/esm/operations/maps.js +0 -69
  129. package/esm/operations/maps.js.map +0 -1
  130. package/src/azureMapsManagementClientContext.ts +0 -68
  131. package/src/models/accountsMappers.ts +0 -28
  132. package/src/models/creatorsMappers.ts +0 -26
@@ -0,0 +1,423 @@
1
+ ## API Report File for "@azure/arm-maps"
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 Accounts {
13
+ createOrUpdate(resourceGroupName: string, accountName: string, mapsAccount: MapsAccount, options?: AccountsCreateOrUpdateOptionalParams): Promise<AccountsCreateOrUpdateResponse>;
14
+ delete(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise<void>;
15
+ get(resourceGroupName: string, accountName: string, options?: AccountsGetOptionalParams): Promise<AccountsGetResponse>;
16
+ listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator<MapsAccount>;
17
+ listBySubscription(options?: AccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator<MapsAccount>;
18
+ listKeys(resourceGroupName: string, accountName: string, options?: AccountsListKeysOptionalParams): Promise<AccountsListKeysResponse>;
19
+ regenerateKeys(resourceGroupName: string, accountName: string, keySpecification: MapsKeySpecification, options?: AccountsRegenerateKeysOptionalParams): Promise<AccountsRegenerateKeysResponse>;
20
+ update(resourceGroupName: string, accountName: string, mapsAccountUpdateParameters: MapsAccountUpdateParameters, options?: AccountsUpdateOptionalParams): Promise<AccountsUpdateResponse>;
21
+ }
22
+
23
+ // @public
24
+ export interface AccountsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
25
+ }
26
+
27
+ // @public
28
+ export type AccountsCreateOrUpdateResponse = MapsAccount;
29
+
30
+ // @public
31
+ export interface AccountsDeleteOptionalParams extends coreClient.OperationOptions {
32
+ }
33
+
34
+ // @public
35
+ export interface AccountsGetOptionalParams extends coreClient.OperationOptions {
36
+ }
37
+
38
+ // @public
39
+ export type AccountsGetResponse = MapsAccount;
40
+
41
+ // @public
42
+ export interface AccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
43
+ }
44
+
45
+ // @public
46
+ export type AccountsListByResourceGroupNextResponse = MapsAccounts;
47
+
48
+ // @public
49
+ export interface AccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions {
50
+ }
51
+
52
+ // @public
53
+ export type AccountsListByResourceGroupResponse = MapsAccounts;
54
+
55
+ // @public
56
+ export interface AccountsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
57
+ }
58
+
59
+ // @public
60
+ export type AccountsListBySubscriptionNextResponse = MapsAccounts;
61
+
62
+ // @public
63
+ export interface AccountsListBySubscriptionOptionalParams extends coreClient.OperationOptions {
64
+ }
65
+
66
+ // @public
67
+ export type AccountsListBySubscriptionResponse = MapsAccounts;
68
+
69
+ // @public
70
+ export interface AccountsListKeysOptionalParams extends coreClient.OperationOptions {
71
+ }
72
+
73
+ // @public
74
+ export type AccountsListKeysResponse = MapsAccountKeys;
75
+
76
+ // @public
77
+ export interface AccountsRegenerateKeysOptionalParams extends coreClient.OperationOptions {
78
+ }
79
+
80
+ // @public
81
+ export type AccountsRegenerateKeysResponse = MapsAccountKeys;
82
+
83
+ // @public
84
+ export interface AccountsUpdateOptionalParams extends coreClient.OperationOptions {
85
+ }
86
+
87
+ // @public
88
+ export type AccountsUpdateResponse = MapsAccount;
89
+
90
+ // @public (undocumented)
91
+ export class AzureMapsManagementClient extends coreClient.ServiceClient {
92
+ // (undocumented)
93
+ $host: string;
94
+ constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureMapsManagementClientOptionalParams);
95
+ // (undocumented)
96
+ accounts: Accounts;
97
+ // (undocumented)
98
+ apiVersion: string;
99
+ // (undocumented)
100
+ creators: Creators;
101
+ // (undocumented)
102
+ maps: Maps;
103
+ // (undocumented)
104
+ subscriptionId: string;
105
+ }
106
+
107
+ // @public
108
+ export interface AzureMapsManagementClientOptionalParams extends coreClient.ServiceClientOptions {
109
+ $host?: string;
110
+ apiVersion?: string;
111
+ endpoint?: string;
112
+ }
113
+
114
+ // @public
115
+ export type CreatedByType = string;
116
+
117
+ // @public
118
+ export type Creator = TrackedResource & {
119
+ properties: CreatorProperties;
120
+ };
121
+
122
+ // @public
123
+ export interface CreatorList {
124
+ nextLink?: string;
125
+ readonly value?: Creator[];
126
+ }
127
+
128
+ // @public
129
+ export interface CreatorProperties {
130
+ readonly provisioningState?: string;
131
+ storageUnits: number;
132
+ }
133
+
134
+ // @public
135
+ export interface Creators {
136
+ createOrUpdate(resourceGroupName: string, accountName: string, creatorName: string, creatorResource: Creator, options?: CreatorsCreateOrUpdateOptionalParams): Promise<CreatorsCreateOrUpdateResponse>;
137
+ delete(resourceGroupName: string, accountName: string, creatorName: string, options?: CreatorsDeleteOptionalParams): Promise<void>;
138
+ get(resourceGroupName: string, accountName: string, creatorName: string, options?: CreatorsGetOptionalParams): Promise<CreatorsGetResponse>;
139
+ listByAccount(resourceGroupName: string, accountName: string, options?: CreatorsListByAccountOptionalParams): PagedAsyncIterableIterator<Creator>;
140
+ update(resourceGroupName: string, accountName: string, creatorName: string, creatorUpdateParameters: CreatorUpdateParameters, options?: CreatorsUpdateOptionalParams): Promise<CreatorsUpdateResponse>;
141
+ }
142
+
143
+ // @public
144
+ export interface CreatorsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
145
+ }
146
+
147
+ // @public
148
+ export type CreatorsCreateOrUpdateResponse = Creator;
149
+
150
+ // @public
151
+ export interface CreatorsDeleteOptionalParams extends coreClient.OperationOptions {
152
+ }
153
+
154
+ // @public
155
+ export interface CreatorsGetOptionalParams extends coreClient.OperationOptions {
156
+ }
157
+
158
+ // @public
159
+ export type CreatorsGetResponse = Creator;
160
+
161
+ // @public
162
+ export interface CreatorsListByAccountNextOptionalParams extends coreClient.OperationOptions {
163
+ }
164
+
165
+ // @public
166
+ export type CreatorsListByAccountNextResponse = CreatorList;
167
+
168
+ // @public
169
+ export interface CreatorsListByAccountOptionalParams extends coreClient.OperationOptions {
170
+ }
171
+
172
+ // @public
173
+ export type CreatorsListByAccountResponse = CreatorList;
174
+
175
+ // @public
176
+ export interface CreatorsUpdateOptionalParams extends coreClient.OperationOptions {
177
+ }
178
+
179
+ // @public
180
+ export type CreatorsUpdateResponse = Creator;
181
+
182
+ // @public
183
+ export interface CreatorUpdateParameters {
184
+ readonly provisioningState?: string;
185
+ storageUnits?: number;
186
+ tags?: {
187
+ [propertyName: string]: string;
188
+ };
189
+ }
190
+
191
+ // @public
192
+ export interface Dimension {
193
+ displayName?: string;
194
+ internalMetricName?: string;
195
+ internalName?: string;
196
+ name?: string;
197
+ sourceMdmNamespace?: string;
198
+ toBeExportedToShoebox?: boolean;
199
+ }
200
+
201
+ // @public
202
+ export interface ErrorAdditionalInfo {
203
+ readonly info?: Record<string, unknown>;
204
+ readonly type?: string;
205
+ }
206
+
207
+ // @public
208
+ export interface ErrorDetail {
209
+ readonly additionalInfo?: ErrorAdditionalInfo[];
210
+ readonly code?: string;
211
+ readonly details?: ErrorDetail[];
212
+ readonly message?: string;
213
+ readonly target?: string;
214
+ }
215
+
216
+ // @public
217
+ export interface ErrorResponse {
218
+ error?: ErrorDetail;
219
+ }
220
+
221
+ // @public
222
+ type KeyType_2 = string;
223
+ export { KeyType_2 as KeyType }
224
+
225
+ // @public
226
+ export type Kind = string;
227
+
228
+ // @public
229
+ export enum KnownCreatedByType {
230
+ // (undocumented)
231
+ Application = "Application",
232
+ // (undocumented)
233
+ Key = "Key",
234
+ // (undocumented)
235
+ ManagedIdentity = "ManagedIdentity",
236
+ // (undocumented)
237
+ User = "User"
238
+ }
239
+
240
+ // @public
241
+ export enum KnownKeyType {
242
+ // (undocumented)
243
+ Primary = "primary",
244
+ // (undocumented)
245
+ Secondary = "secondary"
246
+ }
247
+
248
+ // @public
249
+ export enum KnownKind {
250
+ // (undocumented)
251
+ Gen1 = "Gen1",
252
+ // (undocumented)
253
+ Gen2 = "Gen2"
254
+ }
255
+
256
+ // @public
257
+ export enum KnownName {
258
+ // (undocumented)
259
+ G2 = "G2",
260
+ // (undocumented)
261
+ S0 = "S0",
262
+ // (undocumented)
263
+ S1 = "S1"
264
+ }
265
+
266
+ // @public
267
+ export interface Maps {
268
+ listOperations(options?: MapsListOperationsOptionalParams): PagedAsyncIterableIterator<OperationDetail>;
269
+ listSubscriptionOperations(options?: MapsListSubscriptionOperationsOptionalParams): PagedAsyncIterableIterator<OperationDetail>;
270
+ }
271
+
272
+ // @public
273
+ export type MapsAccount = TrackedResource & {
274
+ sku: Sku;
275
+ kind?: Kind;
276
+ readonly systemData?: SystemData;
277
+ properties?: MapsAccountProperties;
278
+ };
279
+
280
+ // @public
281
+ export interface MapsAccountKeys {
282
+ readonly primaryKey?: string;
283
+ readonly primaryKeyLastUpdated?: string;
284
+ readonly secondaryKey?: string;
285
+ readonly secondaryKeyLastUpdated?: string;
286
+ }
287
+
288
+ // @public
289
+ export interface MapsAccountProperties {
290
+ disableLocalAuth?: boolean;
291
+ readonly provisioningState?: string;
292
+ readonly uniqueId?: string;
293
+ }
294
+
295
+ // @public
296
+ export interface MapsAccounts {
297
+ nextLink?: string;
298
+ readonly value?: MapsAccount[];
299
+ }
300
+
301
+ // @public
302
+ export interface MapsAccountUpdateParameters {
303
+ disableLocalAuth?: boolean;
304
+ kind?: Kind;
305
+ readonly provisioningState?: string;
306
+ sku?: Sku;
307
+ tags?: {
308
+ [propertyName: string]: string;
309
+ };
310
+ readonly uniqueId?: string;
311
+ }
312
+
313
+ // @public
314
+ export interface MapsKeySpecification {
315
+ keyType: KeyType_2;
316
+ }
317
+
318
+ // @public
319
+ export interface MapsListOperationsNextOptionalParams extends coreClient.OperationOptions {
320
+ }
321
+
322
+ // @public
323
+ export type MapsListOperationsNextResponse = MapsOperations;
324
+
325
+ // @public
326
+ export interface MapsListOperationsOptionalParams extends coreClient.OperationOptions {
327
+ }
328
+
329
+ // @public
330
+ export type MapsListOperationsResponse = MapsOperations;
331
+
332
+ // @public
333
+ export interface MapsListSubscriptionOperationsNextOptionalParams extends coreClient.OperationOptions {
334
+ }
335
+
336
+ // @public
337
+ export type MapsListSubscriptionOperationsNextResponse = MapsOperations;
338
+
339
+ // @public
340
+ export interface MapsListSubscriptionOperationsOptionalParams extends coreClient.OperationOptions {
341
+ }
342
+
343
+ // @public
344
+ export type MapsListSubscriptionOperationsResponse = MapsOperations;
345
+
346
+ // @public
347
+ export interface MapsOperations {
348
+ nextLink?: string;
349
+ readonly value?: OperationDetail[];
350
+ }
351
+
352
+ // @public
353
+ export interface MetricSpecification {
354
+ aggregationType?: string;
355
+ category?: string;
356
+ dimensions?: Dimension[];
357
+ displayDescription?: string;
358
+ displayName?: string;
359
+ fillGapWithZero?: boolean;
360
+ name?: string;
361
+ resourceIdDimensionNameOverride?: string;
362
+ unit?: string;
363
+ }
364
+
365
+ // @public
366
+ export type Name = string;
367
+
368
+ // @public
369
+ export interface OperationDetail {
370
+ display?: OperationDisplay;
371
+ isDataAction?: boolean;
372
+ name?: string;
373
+ origin?: string;
374
+ serviceSpecification?: ServiceSpecification;
375
+ }
376
+
377
+ // @public
378
+ export interface OperationDisplay {
379
+ description?: string;
380
+ operation?: string;
381
+ provider?: string;
382
+ resource?: string;
383
+ }
384
+
385
+ // @public
386
+ export interface Resource {
387
+ readonly id?: string;
388
+ readonly name?: string;
389
+ readonly type?: string;
390
+ }
391
+
392
+ // @public
393
+ export interface ServiceSpecification {
394
+ metricSpecifications?: MetricSpecification[];
395
+ }
396
+
397
+ // @public
398
+ export interface Sku {
399
+ name: Name;
400
+ readonly tier?: string;
401
+ }
402
+
403
+ // @public
404
+ export interface SystemData {
405
+ createdAt?: Date;
406
+ createdBy?: string;
407
+ createdByType?: CreatedByType;
408
+ lastModifiedAt?: Date;
409
+ lastModifiedBy?: string;
410
+ lastModifiedByType?: CreatedByType;
411
+ }
412
+
413
+ // @public
414
+ export type TrackedResource = Resource & {
415
+ tags?: {
416
+ [propertyName: string]: string;
417
+ };
418
+ location: string;
419
+ };
420
+
421
+ // (No @packageDocumentation comment for this package)
422
+
423
+ ```
package/rollup.config.js CHANGED
@@ -1,31 +1,188 @@
1
- import rollup from "rollup";
2
- import nodeResolve from "rollup-plugin-node-resolve";
3
- import sourcemaps from "rollup-plugin-sourcemaps";
4
-
5
- /**
6
- * @type {rollup.RollupFileOptions}
7
- */
8
- const config = {
9
- input: "./esm/azureMapsManagementClient.js",
10
- external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
11
- output: {
12
- file: "./dist/arm-maps.js",
13
- format: "umd",
14
- name: "Azure.ArmMaps",
15
- sourcemap: true,
16
- globals: {
17
- "@azure/ms-rest-js": "msRest",
18
- "@azure/ms-rest-azure-js": "msRestAzure"
19
- },
20
- banner: `/*
1
+ /*
21
2
  * Copyright (c) Microsoft Corporation.
22
3
  * Licensed under the MIT License.
23
4
  *
24
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
25
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
26
- */`
27
- },
28
- plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()]
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
+
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/**"]
113
+ },
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
29
158
  };
30
159
 
31
- 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"));