@azure/arm-commerce 3.0.0 → 4.0.0-beta.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.
- package/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/LICENSE.txt +1 -1
- package/README.md +70 -88
- package/dist/index.js +822 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/samples-dev/getRateCard.d.ts +2 -0
- package/dist-esm/samples-dev/getRateCard.d.ts.map +1 -0
- package/dist-esm/samples-dev/getRateCard.js +30 -0
- package/dist-esm/samples-dev/getRateCard.js.map +1 -0
- package/dist-esm/src/index.d.ts +5 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +12 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +178 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/index.js +1 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +19 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +129 -144
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +13 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/parameters.js +60 -60
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/{esm → dist-esm/src}/operations/index.js +1 -2
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/rateCard.d.ts +27 -0
- package/dist-esm/src/operations/rateCard.d.ts.map +1 -0
- package/dist-esm/src/operations/rateCard.js +55 -0
- package/dist-esm/src/operations/rateCard.js.map +1 -0
- package/dist-esm/src/operations/usageAggregates.d.ts +38 -0
- package/dist-esm/src/operations/usageAggregates.d.ts.map +1 -0
- package/dist-esm/src/operations/usageAggregates.js +144 -0
- package/dist-esm/src/operations/usageAggregates.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +3 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/{esm/models/usageAggregatesMappers.js → dist-esm/src/operationsInterfaces/index.js} +3 -2
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/rateCard.d.ts +19 -0
- package/dist-esm/src/operationsInterfaces/rateCard.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/rateCard.js +9 -0
- package/dist-esm/src/operationsInterfaces/rateCard.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/usageAggregates.d.ts +13 -0
- package/dist-esm/src/operationsInterfaces/usageAggregates.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/usageAggregates.js +9 -0
- package/dist-esm/src/operationsInterfaces/usageAggregates.js.map +1 -0
- package/dist-esm/src/usageManagementClient.d.ts +20 -0
- package/dist-esm/src/usageManagementClient.d.ts.map +1 -0
- package/dist-esm/src/usageManagementClient.js +53 -0
- package/dist-esm/src/usageManagementClient.js.map +1 -0
- package/dist-esm/test/commerce_examples.d.ts +4 -0
- package/dist-esm/test/commerce_examples.d.ts.map +1 -0
- package/dist-esm/test/commerce_examples.js +58 -0
- package/dist-esm/test/commerce_examples.js.map +1 -0
- package/package.json +75 -33
- package/review/arm-commerce.api.md +178 -0
- package/rollup.config.js +181 -30
- package/src/{models/rateCardMappers.ts → index.ts} +4 -10
- package/src/models/index.ts +140 -353
- package/src/models/mappers.ts +135 -148
- package/src/models/parameters.ts +75 -61
- package/src/operations/index.ts +1 -2
- package/src/operations/rateCard.ts +36 -60
- package/src/operations/usageAggregates.ts +122 -88
- package/src/{models/usageAggregatesMappers.ts → operationsInterfaces/index.ts} +2 -7
- package/src/operationsInterfaces/rateCard.ts +30 -0
- package/src/operationsInterfaces/usageAggregates.ts +26 -0
- package/src/usageManagementClient.ts +64 -36
- package/tsconfig.json +5 -4
- package/types/arm-commerce.d.ts +247 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-commerce.js +0 -930
- package/dist/arm-commerce.js.map +0 -1
- package/dist/arm-commerce.min.js +0 -1
- package/dist/arm-commerce.min.js.map +0 -1
- package/esm/models/index.d.ts +0 -397
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -21
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -12
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js.map +0 -1
- package/esm/models/rateCardMappers.d.ts +0 -2
- package/esm/models/rateCardMappers.d.ts.map +0 -1
- package/esm/models/rateCardMappers.js +0 -9
- package/esm/models/rateCardMappers.js.map +0 -1
- package/esm/models/usageAggregatesMappers.d.ts +0 -2
- package/esm/models/usageAggregatesMappers.d.ts.map +0 -1
- package/esm/models/usageAggregatesMappers.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/rateCard.d.ts +0 -43
- package/esm/operations/rateCard.d.ts.map +0 -1
- package/esm/operations/rateCard.js +0 -55
- package/esm/operations/rateCard.js.map +0 -1
- package/esm/operations/usageAggregates.d.ts +0 -58
- package/esm/operations/usageAggregates.d.ts.map +0 -1
- package/esm/operations/usageAggregates.js +0 -96
- package/esm/operations/usageAggregates.js.map +0 -1
- package/esm/usageManagementClient.d.ts +0 -26
- package/esm/usageManagementClient.d.ts.map +0 -1
- package/esm/usageManagementClient.js +0 -39
- package/esm/usageManagementClient.js.map +0 -1
- package/esm/usageManagementClientContext.d.ts +0 -23
- package/esm/usageManagementClientContext.d.ts.map +0 -1
- package/esm/usageManagementClientContext.js +0 -61
- package/esm/usageManagementClientContext.js.map +0 -1
- package/src/usageManagementClientContext.ts +0 -68
package/package.json
CHANGED
|
@@ -1,59 +1,101 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/arm-commerce",
|
|
3
|
+
"sdk-type": "mgmt",
|
|
3
4
|
"author": "Microsoft Corporation",
|
|
4
|
-
"description": "
|
|
5
|
-
"version": "
|
|
5
|
+
"description": "A generated SDK for UsageManagementClient.",
|
|
6
|
+
"version": "4.0.0-beta.1",
|
|
7
|
+
"engines": { "node": ">=12.0.0" },
|
|
6
8
|
"dependencies": {
|
|
7
|
-
"@azure/
|
|
8
|
-
"@azure/
|
|
9
|
-
"@azure/core-auth": "^1.
|
|
10
|
-
"
|
|
9
|
+
"@azure/core-paging": "^1.2.0",
|
|
10
|
+
"@azure/core-client": "^1.0.0",
|
|
11
|
+
"@azure/core-auth": "^1.3.0",
|
|
12
|
+
"@azure/core-rest-pipeline": "^1.1.0",
|
|
13
|
+
"tslib": "^2.2.0"
|
|
11
14
|
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"node",
|
|
14
|
-
"azure",
|
|
15
|
-
"typescript",
|
|
16
|
-
"browser",
|
|
17
|
-
"isomorphic"
|
|
18
|
-
],
|
|
15
|
+
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
|
|
19
16
|
"license": "MIT",
|
|
20
|
-
"main": "./dist/
|
|
21
|
-
"module": "./esm/
|
|
22
|
-
"types": "./
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"module": "./dist-esm/src/index.js",
|
|
19
|
+
"types": "./types/arm-commerce.d.ts",
|
|
23
20
|
"devDependencies": {
|
|
24
|
-
"
|
|
25
|
-
"rollup": "
|
|
26
|
-
"rollup
|
|
21
|
+
"@microsoft/api-extractor": "^7.18.11",
|
|
22
|
+
"@rollup/plugin-commonjs": "11.0.2",
|
|
23
|
+
"@rollup/plugin-json": "^4.0.0",
|
|
24
|
+
"@rollup/plugin-multi-entry": "^3.0.0",
|
|
25
|
+
"@rollup/plugin-node-resolve": "^8.0.0",
|
|
26
|
+
"mkdirp": "^1.0.4",
|
|
27
|
+
"rollup": "^1.16.3",
|
|
27
28
|
"rollup-plugin-sourcemaps": "^0.4.2",
|
|
28
|
-
"
|
|
29
|
+
"typescript": "~4.2.0",
|
|
30
|
+
"uglify-js": "^3.4.9",
|
|
31
|
+
"rimraf": "^3.0.0",
|
|
32
|
+
"@azure/identity": "^2.0.1",
|
|
33
|
+
"@azure-tools/test-recorder": "^1.0.0",
|
|
34
|
+
"mocha": "^7.1.1",
|
|
35
|
+
"cross-env": "^7.0.2"
|
|
29
36
|
},
|
|
30
|
-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/
|
|
37
|
+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/commerce/arm-commerce",
|
|
31
38
|
"repository": {
|
|
32
39
|
"type": "git",
|
|
33
40
|
"url": "https://github.com/Azure/azure-sdk-for-js.git"
|
|
34
41
|
},
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
|
37
|
-
},
|
|
42
|
+
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
|
|
38
43
|
"files": [
|
|
39
44
|
"dist/**/*.js",
|
|
40
45
|
"dist/**/*.js.map",
|
|
41
46
|
"dist/**/*.d.ts",
|
|
42
47
|
"dist/**/*.d.ts.map",
|
|
43
|
-
"esm/**/*.js",
|
|
44
|
-
"esm/**/*.js.map",
|
|
45
|
-
"esm/**/*.d.ts",
|
|
46
|
-
"esm/**/*.d.ts.map",
|
|
48
|
+
"dist-esm/**/*.js",
|
|
49
|
+
"dist-esm/**/*.js.map",
|
|
50
|
+
"dist-esm/**/*.d.ts",
|
|
51
|
+
"dist-esm/**/*.d.ts.map",
|
|
47
52
|
"src/**/*.ts",
|
|
48
53
|
"README.md",
|
|
54
|
+
"LICENSE",
|
|
49
55
|
"rollup.config.js",
|
|
50
|
-
"tsconfig.json"
|
|
56
|
+
"tsconfig.json",
|
|
57
|
+
"review/*",
|
|
58
|
+
"CHANGELOG.md",
|
|
59
|
+
"types/*"
|
|
51
60
|
],
|
|
52
61
|
"scripts": {
|
|
53
|
-
"build": "tsc && rollup -c
|
|
54
|
-
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/
|
|
55
|
-
"prepack": "npm
|
|
62
|
+
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
|
|
63
|
+
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
|
|
64
|
+
"prepack": "npm run build",
|
|
65
|
+
"pack": "npm pack 2>&1",
|
|
66
|
+
"extract-api": "api-extractor run --local",
|
|
67
|
+
"lint": "echo skipped",
|
|
68
|
+
"audit": "echo skipped",
|
|
69
|
+
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
70
|
+
"build:node": "echo skipped",
|
|
71
|
+
"build:browser": "echo skipped",
|
|
72
|
+
"build:test": "echo skipped",
|
|
73
|
+
"build:samples": "echo skipped.",
|
|
74
|
+
"check-format": "echo skipped",
|
|
75
|
+
"execute:samples": "echo skipped",
|
|
76
|
+
"format": "echo skipped",
|
|
77
|
+
"test": "npm run integration-test",
|
|
78
|
+
"test:node": "echo skipped",
|
|
79
|
+
"test:browser": "echo skipped",
|
|
80
|
+
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
81
|
+
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
|
|
82
|
+
"unit-test:browser": "echo skipped",
|
|
83
|
+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
84
|
+
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
|
|
85
|
+
"integration-test:browser": "echo skipped",
|
|
86
|
+
"docs": "echo skipped"
|
|
56
87
|
},
|
|
57
88
|
"sideEffects": false,
|
|
58
|
-
"
|
|
89
|
+
"//metadata": {
|
|
90
|
+
"constantPaths": [
|
|
91
|
+
{ "path": "src/UsageManagementClient.ts", "prefix": "packageDetails" }
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"autoPublish": true,
|
|
95
|
+
"//sampleConfiguration": {
|
|
96
|
+
"productName": "",
|
|
97
|
+
"productSlugs": ["azure"],
|
|
98
|
+
"disableDocsMs": true,
|
|
99
|
+
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-commerce?view=azure-node-preview"
|
|
100
|
+
}
|
|
59
101
|
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
## API Report File for "@azure/arm-commerce"
|
|
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 type AggregationGranularity = "Daily" | "Hourly";
|
|
13
|
+
|
|
14
|
+
// @public
|
|
15
|
+
export interface ErrorResponse {
|
|
16
|
+
code?: string;
|
|
17
|
+
message?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// @public
|
|
21
|
+
export interface InfoField {
|
|
22
|
+
project?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// @public
|
|
26
|
+
export interface MeterInfo {
|
|
27
|
+
effectiveDate?: Date;
|
|
28
|
+
includedQuantity?: number;
|
|
29
|
+
meterCategory?: string;
|
|
30
|
+
meterId?: string;
|
|
31
|
+
meterName?: string;
|
|
32
|
+
meterRates?: {
|
|
33
|
+
[propertyName: string]: number;
|
|
34
|
+
};
|
|
35
|
+
meterRegion?: string;
|
|
36
|
+
meterSubCategory?: string;
|
|
37
|
+
meterTags?: string[];
|
|
38
|
+
unit?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// @public
|
|
42
|
+
export type MonetaryCommitment = OfferTermInfoAutoGenerated & {
|
|
43
|
+
name: "Monetary Commitment";
|
|
44
|
+
tieredDiscount?: {
|
|
45
|
+
[propertyName: string]: number;
|
|
46
|
+
};
|
|
47
|
+
excludedMeterIds?: string[];
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// @public
|
|
51
|
+
export type MonetaryCredit = OfferTermInfoAutoGenerated & {
|
|
52
|
+
name: "Monetary Credit";
|
|
53
|
+
credit?: number;
|
|
54
|
+
excludedMeterIds?: string[];
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// @public
|
|
58
|
+
export type OfferTermInfo = "Recurring Charge" | "Monetary Commitment" | "Monetary Credit";
|
|
59
|
+
|
|
60
|
+
// @public
|
|
61
|
+
export interface OfferTermInfoAutoGenerated {
|
|
62
|
+
effectiveDate?: Date;
|
|
63
|
+
name: "Monetary Credit" | "Monetary Commitment" | "Recurring Charge";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// @public (undocumented)
|
|
67
|
+
export type OfferTermInfoAutoGeneratedUnion = OfferTermInfoAutoGenerated | MonetaryCredit | MonetaryCommitment | RecurringCharge;
|
|
68
|
+
|
|
69
|
+
// @public
|
|
70
|
+
export interface RateCard {
|
|
71
|
+
get(filter: string, options?: RateCardGetOptionalParams): Promise<RateCardGetResponse>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// @public
|
|
75
|
+
export interface RateCardGetOptionalParams extends coreClient.OperationOptions {
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// @public
|
|
79
|
+
export type RateCardGetResponse = ResourceRateCardInfo;
|
|
80
|
+
|
|
81
|
+
// @public
|
|
82
|
+
export interface RateCardQueryParameters {
|
|
83
|
+
currency: string;
|
|
84
|
+
locale: string;
|
|
85
|
+
offerDurableId: string;
|
|
86
|
+
regionInfo: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// @public
|
|
90
|
+
export type RecurringCharge = OfferTermInfoAutoGenerated & {
|
|
91
|
+
name: "Recurring Charge";
|
|
92
|
+
recurringCharge?: number;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// @public
|
|
96
|
+
export interface ResourceRateCardInfo {
|
|
97
|
+
currency?: string;
|
|
98
|
+
isTaxIncluded?: boolean;
|
|
99
|
+
locale?: string;
|
|
100
|
+
meters?: MeterInfo[];
|
|
101
|
+
offerTerms?: OfferTermInfoAutoGeneratedUnion[];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// @public
|
|
105
|
+
export interface UsageAggregates {
|
|
106
|
+
list(reportedStartTime: Date, reportedEndTime: Date, options?: UsageAggregatesListOptionalParams): PagedAsyncIterableIterator<UsageAggregation>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// @public
|
|
110
|
+
export interface UsageAggregatesListNextOptionalParams extends coreClient.OperationOptions {
|
|
111
|
+
aggregationGranularity?: AggregationGranularity;
|
|
112
|
+
continuationToken?: string;
|
|
113
|
+
showDetails?: boolean;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// @public
|
|
117
|
+
export type UsageAggregatesListNextResponse = UsageAggregationListResult;
|
|
118
|
+
|
|
119
|
+
// @public
|
|
120
|
+
export interface UsageAggregatesListOptionalParams extends coreClient.OperationOptions {
|
|
121
|
+
aggregationGranularity?: AggregationGranularity;
|
|
122
|
+
continuationToken?: string;
|
|
123
|
+
showDetails?: boolean;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// @public
|
|
127
|
+
export type UsageAggregatesListResponse = UsageAggregationListResult;
|
|
128
|
+
|
|
129
|
+
// @public
|
|
130
|
+
export interface UsageAggregation {
|
|
131
|
+
id?: string;
|
|
132
|
+
infoFields?: InfoField;
|
|
133
|
+
instanceData?: string;
|
|
134
|
+
meterCategory?: string;
|
|
135
|
+
meterId?: string;
|
|
136
|
+
meterName?: string;
|
|
137
|
+
meterRegion?: string;
|
|
138
|
+
meterSubCategory?: string;
|
|
139
|
+
name?: string;
|
|
140
|
+
quantity?: number;
|
|
141
|
+
subscriptionId?: string;
|
|
142
|
+
type?: string;
|
|
143
|
+
unit?: string;
|
|
144
|
+
usageEndTime?: Date;
|
|
145
|
+
usageStartTime?: Date;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// @public
|
|
149
|
+
export interface UsageAggregationListResult {
|
|
150
|
+
nextLink?: string;
|
|
151
|
+
value?: UsageAggregation[];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// @public (undocumented)
|
|
155
|
+
export class UsageManagementClient extends coreClient.ServiceClient {
|
|
156
|
+
// (undocumented)
|
|
157
|
+
$host: string;
|
|
158
|
+
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: UsageManagementClientOptionalParams);
|
|
159
|
+
// (undocumented)
|
|
160
|
+
apiVersion: string;
|
|
161
|
+
// (undocumented)
|
|
162
|
+
rateCard: RateCard;
|
|
163
|
+
// (undocumented)
|
|
164
|
+
subscriptionId: string;
|
|
165
|
+
// (undocumented)
|
|
166
|
+
usageAggregates: UsageAggregates;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// @public
|
|
170
|
+
export interface UsageManagementClientOptionalParams extends coreClient.ServiceClientOptions {
|
|
171
|
+
$host?: string;
|
|
172
|
+
apiVersion?: string;
|
|
173
|
+
endpoint?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// (No @packageDocumentation comment for this package)
|
|
177
|
+
|
|
178
|
+
```
|
package/rollup.config.js
CHANGED
|
@@ -1,37 +1,188 @@
|
|
|
1
|
-
|
|
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/usageManagementClient.js",
|
|
10
|
-
external: [
|
|
11
|
-
"@azure/ms-rest-js",
|
|
12
|
-
"@azure/ms-rest-azure-js"
|
|
13
|
-
],
|
|
14
|
-
output: {
|
|
15
|
-
file: "./dist/arm-commerce.js",
|
|
16
|
-
format: "umd",
|
|
17
|
-
name: "Azure.ArmCommerce",
|
|
18
|
-
sourcemap: true,
|
|
19
|
-
globals: {
|
|
20
|
-
"@azure/ms-rest-js": "msRest",
|
|
21
|
-
"@azure/ms-rest-azure-js": "msRestAzure"
|
|
22
|
-
},
|
|
23
|
-
banner: `/*
|
|
1
|
+
/*
|
|
24
2
|
* Copyright (c) Microsoft Corporation.
|
|
25
3
|
* Licensed under the MIT License.
|
|
26
4
|
*
|
|
27
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
28
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
35
158
|
};
|
|
36
159
|
|
|
37
|
-
export
|
|
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"));
|
|
@@ -6,13 +6,7 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
MonetaryCommitment,
|
|
14
|
-
MonetaryCredit,
|
|
15
|
-
OfferTermInfo,
|
|
16
|
-
RecurringCharge,
|
|
17
|
-
ResourceRateCardInfo
|
|
18
|
-
} from "../models/mappers";
|
|
9
|
+
/// <reference lib="esnext.asynciterable" />
|
|
10
|
+
export * from "./models";
|
|
11
|
+
export { UsageManagementClient } from "./usageManagementClient";
|
|
12
|
+
export * from "./operationsInterfaces";
|