@azure/arm-oep 1.0.0-alpha.20220119.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/index.js +1216 -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/locationsCheckNameAvailability.d.ts +2 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailability.d.ts.map +1 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailability.js +33 -0
- package/dist-esm/samples-dev/locationsCheckNameAvailability.js.map +1 -0
- package/dist-esm/samples-dev/oepResourceCreate.d.ts +2 -0
- package/dist-esm/samples-dev/oepResourceCreate.d.ts.map +1 -0
- package/dist-esm/samples-dev/oepResourceCreate.js +31 -0
- package/dist-esm/samples-dev/oepResourceCreate.js.map +1 -0
- package/dist-esm/samples-dev/oepResourceDelete.d.ts +2 -0
- package/dist-esm/samples-dev/oepResourceDelete.d.ts.map +1 -0
- package/dist-esm/samples-dev/oepResourceDelete.js +31 -0
- package/dist-esm/samples-dev/oepResourceDelete.js.map +1 -0
- package/dist-esm/samples-dev/oepResourceGet.d.ts +2 -0
- package/dist-esm/samples-dev/oepResourceGet.d.ts.map +1 -0
- package/dist-esm/samples-dev/oepResourceGet.js +31 -0
- package/dist-esm/samples-dev/oepResourceGet.js.map +1 -0
- package/dist-esm/samples-dev/oepResourceListByResourceGroup.d.ts +2 -0
- package/dist-esm/samples-dev/oepResourceListByResourceGroup.d.ts.map +1 -0
- package/dist-esm/samples-dev/oepResourceListByResourceGroup.js +44 -0
- package/dist-esm/samples-dev/oepResourceListByResourceGroup.js.map +1 -0
- package/dist-esm/samples-dev/oepResourceListBySubscriptionId.d.ts +2 -0
- package/dist-esm/samples-dev/oepResourceListBySubscriptionId.d.ts.map +1 -0
- package/dist-esm/samples-dev/oepResourceListBySubscriptionId.js +43 -0
- package/dist-esm/samples-dev/oepResourceListBySubscriptionId.js.map +1 -0
- package/dist-esm/samples-dev/oepResourceUpdate.d.ts +2 -0
- package/dist-esm/samples-dev/oepResourceUpdate.d.ts.map +1 -0
- package/dist-esm/samples-dev/oepResourceUpdate.js +31 -0
- package/dist-esm/samples-dev/oepResourceUpdate.js.map +1 -0
- package/dist-esm/samples-dev/operationsList.d.ts +2 -0
- package/dist-esm/samples-dev/operationsList.d.ts.map +1 -0
- package/dist-esm/samples-dev/operationsList.js +29 -0
- package/dist-esm/samples-dev/operationsList.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/lroImpl.d.ts +16 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +29 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +351 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +45 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +17 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +454 -0
- 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/dist-esm/src/models/parameters.js +113 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.d.ts +20 -0
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.d.ts.map +1 -0
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.js +53 -0
- package/dist-esm/src/openEnergyPlatformManagementServiceAPIs.js.map +1 -0
- package/dist-esm/src/operations/energyServices.d.ts +95 -0
- package/dist-esm/src/operations/energyServices.d.ts.map +1 -0
- package/dist-esm/src/operations/energyServices.js +425 -0
- package/dist-esm/src/operations/energyServices.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +4 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +11 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/locations.d.ts +19 -0
- package/dist-esm/src/operations/locations.d.ts.map +1 -0
- package/dist-esm/src/operations/locations.js +48 -0
- package/dist-esm/src/operations/locations.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +18 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +46 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/energyServices.d.ts +59 -0
- package/dist-esm/src/operationsInterfaces/energyServices.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/energyServices.js +9 -0
- package/dist-esm/src/operationsInterfaces/energyServices.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +11 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/locations.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/locations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/locations.js +9 -0
- package/dist-esm/src/operationsInterfaces/locations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +10 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/test/sampleTest.d.ts +2 -0
- package/dist-esm/test/sampleTest.d.ts.map +1 -0
- package/dist-esm/test/sampleTest.js +40 -0
- package/dist-esm/test/sampleTest.js.map +1 -0
- package/package.json +118 -0
- package/review/arm-oep.api.md +316 -0
- package/rollup.config.js +188 -0
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +403 -0
- package/src/models/mappers.ts +475 -0
- package/src/models/parameters.ts +133 -0
- package/src/openEnergyPlatformManagementServiceAPIs.ts +83 -0
- package/src/operations/energyServices.ts +564 -0
- package/src/operations/index.ts +11 -0
- package/src/operations/locations.ts +67 -0
- package/src/operations/operations.ts +59 -0
- package/src/operationsInterfaces/energyServices.ts +113 -0
- package/src/operationsInterfaces/index.ts +11 -0
- package/src/operationsInterfaces/locations.ts +26 -0
- package/src/operationsInterfaces/operations.ts +21 -0
- package/tsconfig.json +20 -0
- package/types/arm-oep.d.ts +492 -0
- package/types/tsdoc-metadata.json +11 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
## API Report File for "@azure/arm-oep"
|
|
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 type ActionType = string;
|
|
15
|
+
|
|
16
|
+
// @public
|
|
17
|
+
export type CheckNameAvailabilityReason = string;
|
|
18
|
+
|
|
19
|
+
// @public
|
|
20
|
+
export interface CheckNameAvailabilityRequest {
|
|
21
|
+
name?: string;
|
|
22
|
+
type?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// @public
|
|
26
|
+
export interface CheckNameAvailabilityResponse {
|
|
27
|
+
message?: string;
|
|
28
|
+
nameAvailable?: boolean;
|
|
29
|
+
reason?: CheckNameAvailabilityReason;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// @public
|
|
33
|
+
export type CreatedByType = string;
|
|
34
|
+
|
|
35
|
+
// @public
|
|
36
|
+
export interface DataPartitionNames {
|
|
37
|
+
// (undocumented)
|
|
38
|
+
name?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// @public
|
|
42
|
+
export interface EnergyResourceUpdate {
|
|
43
|
+
tags?: {
|
|
44
|
+
[propertyName: string]: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// @public (undocumented)
|
|
49
|
+
export type EnergyService = Resource & {
|
|
50
|
+
properties?: EnergyServiceProperties;
|
|
51
|
+
tags?: {
|
|
52
|
+
[propertyName: string]: string;
|
|
53
|
+
};
|
|
54
|
+
location: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// @public
|
|
58
|
+
export interface EnergyServiceList {
|
|
59
|
+
nextLink?: string;
|
|
60
|
+
value?: EnergyService[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// @public (undocumented)
|
|
64
|
+
export interface EnergyServiceProperties {
|
|
65
|
+
// (undocumented)
|
|
66
|
+
authAppId?: string;
|
|
67
|
+
// (undocumented)
|
|
68
|
+
dataPartitionNames?: DataPartitionNames[];
|
|
69
|
+
readonly dnsName?: string;
|
|
70
|
+
readonly provisioningState?: ProvisioningState;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// @public
|
|
74
|
+
export interface EnergyServices {
|
|
75
|
+
beginCreate(resourceGroupName: string, resourceName: string, options?: EnergyServicesCreateOptionalParams): Promise<PollerLike<PollOperationState<EnergyServicesCreateResponse>, EnergyServicesCreateResponse>>;
|
|
76
|
+
beginCreateAndWait(resourceGroupName: string, resourceName: string, options?: EnergyServicesCreateOptionalParams): Promise<EnergyServicesCreateResponse>;
|
|
77
|
+
beginDelete(resourceGroupName: string, resourceName: string, options?: EnergyServicesDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
|
|
78
|
+
beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: EnergyServicesDeleteOptionalParams): Promise<void>;
|
|
79
|
+
get(resourceGroupName: string, resourceName: string, options?: EnergyServicesGetOptionalParams): Promise<EnergyServicesGetResponse>;
|
|
80
|
+
listByResourceGroup(resourceGroupName: string, options?: EnergyServicesListByResourceGroupOptionalParams): PagedAsyncIterableIterator<EnergyService>;
|
|
81
|
+
listBySubscription(options?: EnergyServicesListBySubscriptionOptionalParams): PagedAsyncIterableIterator<EnergyService>;
|
|
82
|
+
// (undocumented)
|
|
83
|
+
update(resourceGroupName: string, resourceName: string, options?: EnergyServicesUpdateOptionalParams): Promise<EnergyServicesUpdateResponse>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// @public
|
|
87
|
+
export interface EnergyServicesCreateOptionalParams extends coreClient.OperationOptions {
|
|
88
|
+
body?: EnergyService;
|
|
89
|
+
resumeFrom?: string;
|
|
90
|
+
updateIntervalInMs?: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// @public
|
|
94
|
+
export type EnergyServicesCreateResponse = EnergyService;
|
|
95
|
+
|
|
96
|
+
// @public
|
|
97
|
+
export interface EnergyServicesDeleteOptionalParams extends coreClient.OperationOptions {
|
|
98
|
+
resumeFrom?: string;
|
|
99
|
+
updateIntervalInMs?: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// @public
|
|
103
|
+
export interface EnergyServicesGetOptionalParams extends coreClient.OperationOptions {
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// @public
|
|
107
|
+
export type EnergyServicesGetResponse = EnergyService;
|
|
108
|
+
|
|
109
|
+
// @public
|
|
110
|
+
export interface EnergyServicesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// @public
|
|
114
|
+
export type EnergyServicesListByResourceGroupNextResponse = EnergyServiceList;
|
|
115
|
+
|
|
116
|
+
// @public
|
|
117
|
+
export interface EnergyServicesListByResourceGroupOptionalParams extends coreClient.OperationOptions {
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// @public
|
|
121
|
+
export type EnergyServicesListByResourceGroupResponse = EnergyServiceList;
|
|
122
|
+
|
|
123
|
+
// @public
|
|
124
|
+
export interface EnergyServicesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// @public
|
|
128
|
+
export type EnergyServicesListBySubscriptionNextResponse = EnergyServiceList;
|
|
129
|
+
|
|
130
|
+
// @public
|
|
131
|
+
export interface EnergyServicesListBySubscriptionOptionalParams extends coreClient.OperationOptions {
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// @public
|
|
135
|
+
export type EnergyServicesListBySubscriptionResponse = EnergyServiceList;
|
|
136
|
+
|
|
137
|
+
// @public
|
|
138
|
+
export interface EnergyServicesUpdateOptionalParams extends coreClient.OperationOptions {
|
|
139
|
+
body?: EnergyResourceUpdate;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// @public
|
|
143
|
+
export type EnergyServicesUpdateResponse = EnergyService;
|
|
144
|
+
|
|
145
|
+
// @public
|
|
146
|
+
export interface ErrorAdditionalInfo {
|
|
147
|
+
readonly info?: Record<string, unknown>;
|
|
148
|
+
readonly type?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// @public
|
|
152
|
+
export interface ErrorDetail {
|
|
153
|
+
readonly additionalInfo?: ErrorAdditionalInfo[];
|
|
154
|
+
readonly code?: string;
|
|
155
|
+
readonly details?: ErrorDetail[];
|
|
156
|
+
readonly message?: string;
|
|
157
|
+
readonly target?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// @public
|
|
161
|
+
export interface ErrorResponse {
|
|
162
|
+
error?: ErrorDetail;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// @public
|
|
166
|
+
export enum KnownActionType {
|
|
167
|
+
// (undocumented)
|
|
168
|
+
Internal = "Internal"
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// @public
|
|
172
|
+
export enum KnownCheckNameAvailabilityReason {
|
|
173
|
+
// (undocumented)
|
|
174
|
+
AlreadyExists = "AlreadyExists",
|
|
175
|
+
// (undocumented)
|
|
176
|
+
Invalid = "Invalid"
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// @public
|
|
180
|
+
export enum KnownCreatedByType {
|
|
181
|
+
// (undocumented)
|
|
182
|
+
Application = "Application",
|
|
183
|
+
// (undocumented)
|
|
184
|
+
Key = "Key",
|
|
185
|
+
// (undocumented)
|
|
186
|
+
ManagedIdentity = "ManagedIdentity",
|
|
187
|
+
// (undocumented)
|
|
188
|
+
User = "User"
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// @public
|
|
192
|
+
export enum KnownOrigin {
|
|
193
|
+
// (undocumented)
|
|
194
|
+
System = "system",
|
|
195
|
+
// (undocumented)
|
|
196
|
+
User = "user",
|
|
197
|
+
// (undocumented)
|
|
198
|
+
UserSystem = "user,system"
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// @public
|
|
202
|
+
export enum KnownProvisioningState {
|
|
203
|
+
// (undocumented)
|
|
204
|
+
Canceled = "Canceled",
|
|
205
|
+
// (undocumented)
|
|
206
|
+
Creating = "Creating",
|
|
207
|
+
// (undocumented)
|
|
208
|
+
Deleting = "Deleting",
|
|
209
|
+
// (undocumented)
|
|
210
|
+
Failed = "Failed",
|
|
211
|
+
// (undocumented)
|
|
212
|
+
Succeeded = "Succeeded",
|
|
213
|
+
// (undocumented)
|
|
214
|
+
Unknown = "Unknown",
|
|
215
|
+
// (undocumented)
|
|
216
|
+
Updating = "Updating"
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// @public
|
|
220
|
+
export interface Locations {
|
|
221
|
+
checkNameAvailability(body: CheckNameAvailabilityRequest, options?: LocationsCheckNameAvailabilityOptionalParams): Promise<LocationsCheckNameAvailabilityResponse>;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// @public
|
|
225
|
+
export interface LocationsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions {
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// @public
|
|
229
|
+
export type LocationsCheckNameAvailabilityResponse = CheckNameAvailabilityResponse;
|
|
230
|
+
|
|
231
|
+
// @public (undocumented)
|
|
232
|
+
export class OpenEnergyPlatformManagementServiceAPIs extends coreClient.ServiceClient {
|
|
233
|
+
// (undocumented)
|
|
234
|
+
$host: string;
|
|
235
|
+
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: OpenEnergyPlatformManagementServiceAPIsOptionalParams);
|
|
236
|
+
// (undocumented)
|
|
237
|
+
apiVersion: string;
|
|
238
|
+
// (undocumented)
|
|
239
|
+
energyServices: EnergyServices;
|
|
240
|
+
// (undocumented)
|
|
241
|
+
locations: Locations;
|
|
242
|
+
// (undocumented)
|
|
243
|
+
operations: Operations;
|
|
244
|
+
// (undocumented)
|
|
245
|
+
subscriptionId: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// @public
|
|
249
|
+
export interface OpenEnergyPlatformManagementServiceAPIsOptionalParams extends coreClient.ServiceClientOptions {
|
|
250
|
+
$host?: string;
|
|
251
|
+
apiVersion?: string;
|
|
252
|
+
endpoint?: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// @public
|
|
256
|
+
export interface Operation {
|
|
257
|
+
readonly actionType?: ActionType;
|
|
258
|
+
display?: OperationDisplay;
|
|
259
|
+
readonly isDataAction?: boolean;
|
|
260
|
+
readonly name?: string;
|
|
261
|
+
readonly origin?: Origin;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// @public
|
|
265
|
+
export interface OperationDisplay {
|
|
266
|
+
readonly description?: string;
|
|
267
|
+
readonly operation?: string;
|
|
268
|
+
readonly provider?: string;
|
|
269
|
+
readonly resource?: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// @public
|
|
273
|
+
export interface OperationListResult {
|
|
274
|
+
readonly nextLink?: string;
|
|
275
|
+
readonly value?: Operation[];
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// @public
|
|
279
|
+
export interface Operations {
|
|
280
|
+
list(options?: OperationsListOptionalParams): Promise<OperationsListResponse>;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// @public
|
|
284
|
+
export interface OperationsListOptionalParams extends coreClient.OperationOptions {
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// @public
|
|
288
|
+
export type OperationsListResponse = OperationListResult;
|
|
289
|
+
|
|
290
|
+
// @public
|
|
291
|
+
export type Origin = string;
|
|
292
|
+
|
|
293
|
+
// @public
|
|
294
|
+
export type ProvisioningState = string;
|
|
295
|
+
|
|
296
|
+
// @public
|
|
297
|
+
export interface Resource {
|
|
298
|
+
readonly id?: string;
|
|
299
|
+
readonly name?: string;
|
|
300
|
+
readonly systemData?: SystemData;
|
|
301
|
+
readonly type?: string;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// @public
|
|
305
|
+
export interface SystemData {
|
|
306
|
+
createdAt?: Date;
|
|
307
|
+
createdBy?: string;
|
|
308
|
+
createdByType?: CreatedByType;
|
|
309
|
+
lastModifiedAt?: Date;
|
|
310
|
+
lastModifiedBy?: string;
|
|
311
|
+
lastModifiedByType?: CreatedByType;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// (No @packageDocumentation comment for this package)
|
|
315
|
+
|
|
316
|
+
```
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
|
|
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
|
|
158
|
+
};
|
|
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"));
|
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 { OpenEnergyPlatformManagementServiceAPIs } from "./openEnergyPlatformManagementServiceAPIs";
|
|
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
|
+
}
|