@azure/arm-servicefabric 2.0.2-alpha.20221214.2 → 2.1.1-alpha.20221216.4
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 +23 -1
- package/dist/index.js +152 -38
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +83 -37
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +38 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts +5 -3
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +14 -11
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/operations/operations.d.ts.map +1 -1
- package/dist-esm/src/operations/operations.js +19 -8
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/src/serviceFabricManagementClient.d.ts +2 -0
- package/dist-esm/src/serviceFabricManagementClient.d.ts.map +1 -1
- package/dist-esm/src/serviceFabricManagementClient.js +49 -18
- package/dist-esm/src/serviceFabricManagementClient.js.map +1 -1
- package/dist-esm/test/{servicefabric.d.ts → servicefabric_examples.spec.d.ts} +1 -1
- package/dist-esm/test/servicefabric_examples.spec.d.ts.map +1 -0
- package/dist-esm/test/{servicefabric.js → servicefabric_examples.spec.js} +17 -19
- package/dist-esm/test/servicefabric_examples.spec.js.map +1 -0
- package/package.json +12 -8
- package/review/arm-servicefabric.api.md +84 -115
- package/src/index.ts +1 -0
- package/src/models/index.ts +91 -37
- package/src/models/mappers.ts +14 -11
- package/src/operations/operations.ts +21 -9
- package/src/pagingHelper.ts +39 -0
- package/src/serviceFabricManagementClient.ts +60 -20
- package/types/arm-servicefabric.d.ts +94 -37
- package/dist-esm/test/servicefabric.d.ts.map +0 -1
- package/dist-esm/test/servicefabric.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
-
## 2.
|
|
3
|
+
## 2.1.1 (Unreleased)
|
|
4
4
|
|
|
5
5
|
### Features Added
|
|
6
6
|
|
|
@@ -10,6 +10,28 @@
|
|
|
10
10
|
|
|
11
11
|
### Other Changes
|
|
12
12
|
|
|
13
|
+
## 2.1.0 (2022-12-12)
|
|
14
|
+
|
|
15
|
+
**Features**
|
|
16
|
+
|
|
17
|
+
- Added Interface ApplicationResource
|
|
18
|
+
- Added Interface ApplicationResourceProperties
|
|
19
|
+
- Added Interface ApplicationResourceUpdate
|
|
20
|
+
- Added Interface ApplicationTypeResource
|
|
21
|
+
- Added Interface ApplicationTypeVersionResource
|
|
22
|
+
- Added Interface Cluster
|
|
23
|
+
- Added Interface NamedPartitionSchemeDescription
|
|
24
|
+
- Added Interface ServiceResource
|
|
25
|
+
- Added Interface ServiceResourceProperties
|
|
26
|
+
- Added Interface ServiceResourceUpdate
|
|
27
|
+
- Added Interface ServiceResourceUpdateProperties
|
|
28
|
+
- Added Interface SingletonPartitionSchemeDescription
|
|
29
|
+
- Added Interface StatefulServiceProperties
|
|
30
|
+
- Added Interface StatefulServiceUpdateProperties
|
|
31
|
+
- Added Interface StatelessServiceProperties
|
|
32
|
+
- Added Interface StatelessServiceUpdateProperties
|
|
33
|
+
- Added Interface UniformInt64RangePartitionSchemeDescription
|
|
34
|
+
|
|
13
35
|
## 2.0.1 (2022-05-01)
|
|
14
36
|
|
|
15
37
|
**Features**
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var tslib = require('tslib');
|
|
5
6
|
var coreClient = require('@azure/core-client');
|
|
6
7
|
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
7
|
-
var tslib = require('tslib');
|
|
8
8
|
var coreLro = require('@azure/core-lro');
|
|
9
9
|
|
|
10
10
|
function _interopNamespace(e) {
|
|
@@ -28,6 +28,38 @@ function _interopNamespace(e) {
|
|
|
28
28
|
var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
|
29
29
|
var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
|
|
30
30
|
|
|
31
|
+
/*
|
|
32
|
+
* Copyright (c) Microsoft Corporation.
|
|
33
|
+
* Licensed under the MIT License.
|
|
34
|
+
*
|
|
35
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
36
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
37
|
+
*/
|
|
38
|
+
const pageMap = new WeakMap();
|
|
39
|
+
/**
|
|
40
|
+
* Given the last `.value` produced by the `byPage` iterator,
|
|
41
|
+
* returns a continuation token that can be used to begin paging from
|
|
42
|
+
* that point later.
|
|
43
|
+
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
|
44
|
+
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
45
|
+
*/
|
|
46
|
+
function getContinuationToken(page) {
|
|
47
|
+
var _a;
|
|
48
|
+
if (typeof page !== "object" || page === null) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
|
|
52
|
+
}
|
|
53
|
+
function setContinuationToken(page, continuationToken) {
|
|
54
|
+
var _a;
|
|
55
|
+
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
|
|
59
|
+
pageInfo.continuationToken = continuationToken;
|
|
60
|
+
pageMap.set(page, pageInfo);
|
|
61
|
+
}
|
|
62
|
+
|
|
31
63
|
/*
|
|
32
64
|
* Copyright (c) Microsoft Corporation.
|
|
33
65
|
* Licensed under the MIT License.
|
|
@@ -38,65 +70,101 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
|
|
|
38
70
|
/** Known values of {@link AddOnFeatures} that the service accepts. */
|
|
39
71
|
exports.KnownAddOnFeatures = void 0;
|
|
40
72
|
(function (KnownAddOnFeatures) {
|
|
73
|
+
/** RepairManager */
|
|
41
74
|
KnownAddOnFeatures["RepairManager"] = "RepairManager";
|
|
75
|
+
/** DnsService */
|
|
42
76
|
KnownAddOnFeatures["DnsService"] = "DnsService";
|
|
77
|
+
/** BackupRestoreService */
|
|
43
78
|
KnownAddOnFeatures["BackupRestoreService"] = "BackupRestoreService";
|
|
79
|
+
/** ResourceMonitorService */
|
|
44
80
|
KnownAddOnFeatures["ResourceMonitorService"] = "ResourceMonitorService";
|
|
45
81
|
})(exports.KnownAddOnFeatures || (exports.KnownAddOnFeatures = {}));
|
|
46
82
|
/** Known values of {@link ClusterEnvironment} that the service accepts. */
|
|
47
83
|
exports.KnownClusterEnvironment = void 0;
|
|
48
84
|
(function (KnownClusterEnvironment) {
|
|
85
|
+
/** Windows */
|
|
49
86
|
KnownClusterEnvironment["Windows"] = "Windows";
|
|
87
|
+
/** Linux */
|
|
50
88
|
KnownClusterEnvironment["Linux"] = "Linux";
|
|
51
89
|
})(exports.KnownClusterEnvironment || (exports.KnownClusterEnvironment = {}));
|
|
52
90
|
/** Known values of {@link StoreName} that the service accepts. */
|
|
53
91
|
exports.KnownStoreName = void 0;
|
|
54
92
|
(function (KnownStoreName) {
|
|
93
|
+
/** AddressBook */
|
|
55
94
|
KnownStoreName["AddressBook"] = "AddressBook";
|
|
95
|
+
/** AuthRoot */
|
|
56
96
|
KnownStoreName["AuthRoot"] = "AuthRoot";
|
|
97
|
+
/** CertificateAuthority */
|
|
57
98
|
KnownStoreName["CertificateAuthority"] = "CertificateAuthority";
|
|
99
|
+
/** Disallowed */
|
|
58
100
|
KnownStoreName["Disallowed"] = "Disallowed";
|
|
101
|
+
/** My */
|
|
59
102
|
KnownStoreName["My"] = "My";
|
|
103
|
+
/** Root */
|
|
60
104
|
KnownStoreName["Root"] = "Root";
|
|
105
|
+
/** TrustedPeople */
|
|
61
106
|
KnownStoreName["TrustedPeople"] = "TrustedPeople";
|
|
107
|
+
/** TrustedPublisher */
|
|
62
108
|
KnownStoreName["TrustedPublisher"] = "TrustedPublisher";
|
|
63
109
|
})(exports.KnownStoreName || (exports.KnownStoreName = {}));
|
|
64
110
|
/** Known values of {@link ClusterState} that the service accepts. */
|
|
65
111
|
exports.KnownClusterState = void 0;
|
|
66
112
|
(function (KnownClusterState) {
|
|
113
|
+
/** WaitingForNodes */
|
|
67
114
|
KnownClusterState["WaitingForNodes"] = "WaitingForNodes";
|
|
115
|
+
/** Deploying */
|
|
68
116
|
KnownClusterState["Deploying"] = "Deploying";
|
|
117
|
+
/** BaselineUpgrade */
|
|
69
118
|
KnownClusterState["BaselineUpgrade"] = "BaselineUpgrade";
|
|
119
|
+
/** UpdatingUserConfiguration */
|
|
70
120
|
KnownClusterState["UpdatingUserConfiguration"] = "UpdatingUserConfiguration";
|
|
121
|
+
/** UpdatingUserCertificate */
|
|
71
122
|
KnownClusterState["UpdatingUserCertificate"] = "UpdatingUserCertificate";
|
|
123
|
+
/** UpdatingInfrastructure */
|
|
72
124
|
KnownClusterState["UpdatingInfrastructure"] = "UpdatingInfrastructure";
|
|
125
|
+
/** EnforcingClusterVersion */
|
|
73
126
|
KnownClusterState["EnforcingClusterVersion"] = "EnforcingClusterVersion";
|
|
127
|
+
/** UpgradeServiceUnreachable */
|
|
74
128
|
KnownClusterState["UpgradeServiceUnreachable"] = "UpgradeServiceUnreachable";
|
|
129
|
+
/** AutoScale */
|
|
75
130
|
KnownClusterState["AutoScale"] = "AutoScale";
|
|
131
|
+
/** Ready */
|
|
76
132
|
KnownClusterState["Ready"] = "Ready";
|
|
77
133
|
})(exports.KnownClusterState || (exports.KnownClusterState = {}));
|
|
78
134
|
/** Known values of {@link DurabilityLevel} that the service accepts. */
|
|
79
135
|
exports.KnownDurabilityLevel = void 0;
|
|
80
136
|
(function (KnownDurabilityLevel) {
|
|
137
|
+
/** Bronze */
|
|
81
138
|
KnownDurabilityLevel["Bronze"] = "Bronze";
|
|
139
|
+
/** Silver */
|
|
82
140
|
KnownDurabilityLevel["Silver"] = "Silver";
|
|
141
|
+
/** Gold */
|
|
83
142
|
KnownDurabilityLevel["Gold"] = "Gold";
|
|
84
143
|
})(exports.KnownDurabilityLevel || (exports.KnownDurabilityLevel = {}));
|
|
85
144
|
/** Known values of {@link ProvisioningState} that the service accepts. */
|
|
86
145
|
exports.KnownProvisioningState = void 0;
|
|
87
146
|
(function (KnownProvisioningState) {
|
|
147
|
+
/** Updating */
|
|
88
148
|
KnownProvisioningState["Updating"] = "Updating";
|
|
149
|
+
/** Succeeded */
|
|
89
150
|
KnownProvisioningState["Succeeded"] = "Succeeded";
|
|
151
|
+
/** Failed */
|
|
90
152
|
KnownProvisioningState["Failed"] = "Failed";
|
|
153
|
+
/** Canceled */
|
|
91
154
|
KnownProvisioningState["Canceled"] = "Canceled";
|
|
92
155
|
})(exports.KnownProvisioningState || (exports.KnownProvisioningState = {}));
|
|
93
156
|
/** Known values of {@link ReliabilityLevel} that the service accepts. */
|
|
94
157
|
exports.KnownReliabilityLevel = void 0;
|
|
95
158
|
(function (KnownReliabilityLevel) {
|
|
159
|
+
/** None */
|
|
96
160
|
KnownReliabilityLevel["None"] = "None";
|
|
161
|
+
/** Bronze */
|
|
97
162
|
KnownReliabilityLevel["Bronze"] = "Bronze";
|
|
163
|
+
/** Silver */
|
|
98
164
|
KnownReliabilityLevel["Silver"] = "Silver";
|
|
165
|
+
/** Gold */
|
|
99
166
|
KnownReliabilityLevel["Gold"] = "Gold";
|
|
167
|
+
/** Platinum */
|
|
100
168
|
KnownReliabilityLevel["Platinum"] = "Platinum";
|
|
101
169
|
})(exports.KnownReliabilityLevel || (exports.KnownReliabilityLevel = {}));
|
|
102
170
|
/** Known values of {@link UpgradeMode} that the service accepts. */
|
|
@@ -158,7 +226,9 @@ exports.KnownNotificationChannel = void 0;
|
|
|
158
226
|
/** Known values of {@link Enum14} that the service accepts. */
|
|
159
227
|
exports.KnownEnum14 = void 0;
|
|
160
228
|
(function (KnownEnum14) {
|
|
229
|
+
/** Windows */
|
|
161
230
|
KnownEnum14["Windows"] = "Windows";
|
|
231
|
+
/** Linux */
|
|
162
232
|
KnownEnum14["Linux"] = "Linux";
|
|
163
233
|
})(exports.KnownEnum14 || (exports.KnownEnum14 = {}));
|
|
164
234
|
/** Known values of {@link ArmUpgradeFailureAction} that the service accepts. */
|
|
@@ -2206,6 +2276,7 @@ const ServiceLoadMetricDescription = {
|
|
|
2206
2276
|
}
|
|
2207
2277
|
};
|
|
2208
2278
|
const ServicePlacementPolicyDescription = {
|
|
2279
|
+
serializedName: "ServicePlacementPolicyDescription",
|
|
2209
2280
|
type: {
|
|
2210
2281
|
name: "Composite",
|
|
2211
2282
|
className: "ServicePlacementPolicyDescription",
|
|
@@ -2955,8 +3026,8 @@ const StatefulServiceProperties = {
|
|
|
2955
3026
|
type: {
|
|
2956
3027
|
name: "Composite",
|
|
2957
3028
|
className: "StatefulServiceProperties",
|
|
2958
|
-
uberParent: "
|
|
2959
|
-
polymorphicDiscriminator:
|
|
3029
|
+
uberParent: "ServiceResourceProperties",
|
|
3030
|
+
polymorphicDiscriminator: ServiceResourceProperties.type.polymorphicDiscriminator,
|
|
2960
3031
|
modelProperties: Object.assign(Object.assign({}, ServiceResourceProperties.type.modelProperties), { hasPersistedState: {
|
|
2961
3032
|
serializedName: "hasPersistedState",
|
|
2962
3033
|
type: {
|
|
@@ -3001,8 +3072,8 @@ const StatelessServiceProperties = {
|
|
|
3001
3072
|
type: {
|
|
3002
3073
|
name: "Composite",
|
|
3003
3074
|
className: "StatelessServiceProperties",
|
|
3004
|
-
uberParent: "
|
|
3005
|
-
polymorphicDiscriminator:
|
|
3075
|
+
uberParent: "ServiceResourceProperties",
|
|
3076
|
+
polymorphicDiscriminator: ServiceResourceProperties.type.polymorphicDiscriminator,
|
|
3006
3077
|
modelProperties: Object.assign(Object.assign({}, ServiceResourceProperties.type.modelProperties), { instanceCount: {
|
|
3007
3078
|
constraints: {
|
|
3008
3079
|
InclusiveMinimum: -1
|
|
@@ -3024,8 +3095,8 @@ const StatefulServiceUpdateProperties = {
|
|
|
3024
3095
|
type: {
|
|
3025
3096
|
name: "Composite",
|
|
3026
3097
|
className: "StatefulServiceUpdateProperties",
|
|
3027
|
-
uberParent: "
|
|
3028
|
-
polymorphicDiscriminator:
|
|
3098
|
+
uberParent: "ServiceResourceUpdateProperties",
|
|
3099
|
+
polymorphicDiscriminator: ServiceResourceUpdateProperties.type.polymorphicDiscriminator,
|
|
3029
3100
|
modelProperties: Object.assign(Object.assign({}, ServiceResourceUpdateProperties.type.modelProperties), { targetReplicaSetSize: {
|
|
3030
3101
|
constraints: {
|
|
3031
3102
|
InclusiveMinimum: 1
|
|
@@ -3065,8 +3136,8 @@ const StatelessServiceUpdateProperties = {
|
|
|
3065
3136
|
type: {
|
|
3066
3137
|
name: "Composite",
|
|
3067
3138
|
className: "StatelessServiceUpdateProperties",
|
|
3068
|
-
uberParent: "
|
|
3069
|
-
polymorphicDiscriminator:
|
|
3139
|
+
uberParent: "ServiceResourceUpdateProperties",
|
|
3140
|
+
polymorphicDiscriminator: ServiceResourceUpdateProperties.type.polymorphicDiscriminator,
|
|
3070
3141
|
modelProperties: Object.assign(Object.assign({}, ServiceResourceUpdateProperties.type.modelProperties), { instanceCount: {
|
|
3071
3142
|
constraints: {
|
|
3072
3143
|
InclusiveMinimum: -1
|
|
@@ -3085,14 +3156,16 @@ const StatelessServiceUpdateProperties = {
|
|
|
3085
3156
|
};
|
|
3086
3157
|
let discriminators = {
|
|
3087
3158
|
PartitionSchemeDescription: PartitionSchemeDescription,
|
|
3088
|
-
"ServicePlacementPolicyDescription.
|
|
3159
|
+
"ServicePlacementPolicyDescription.ServicePlacementPolicyDescription": ServicePlacementPolicyDescription,
|
|
3089
3160
|
"PartitionSchemeDescription.Named": NamedPartitionSchemeDescription,
|
|
3090
3161
|
"PartitionSchemeDescription.Singleton": SingletonPartitionSchemeDescription,
|
|
3091
3162
|
"PartitionSchemeDescription.UniformInt64Range": UniformInt64RangePartitionSchemeDescription,
|
|
3092
3163
|
"ServiceResourcePropertiesBase.ServiceResourceProperties": ServiceResourceProperties,
|
|
3093
3164
|
"ServiceResourcePropertiesBase.ServiceResourceUpdateProperties": ServiceResourceUpdateProperties,
|
|
3094
|
-
"
|
|
3095
|
-
"
|
|
3165
|
+
"ServiceResourceProperties.Stateful": StatefulServiceProperties,
|
|
3166
|
+
"ServiceResourceProperties.Stateless": StatelessServiceProperties,
|
|
3167
|
+
"ServiceResourceUpdateProperties.Stateful": StatefulServiceUpdateProperties,
|
|
3168
|
+
"ServiceResourceUpdateProperties.Stateless": StatelessServiceUpdateProperties
|
|
3096
3169
|
};
|
|
3097
3170
|
|
|
3098
3171
|
var Mappers = /*#__PURE__*/Object.freeze({
|
|
@@ -3907,20 +3980,31 @@ class OperationsImpl {
|
|
|
3907
3980
|
[Symbol.asyncIterator]() {
|
|
3908
3981
|
return this;
|
|
3909
3982
|
},
|
|
3910
|
-
byPage: () => {
|
|
3911
|
-
|
|
3983
|
+
byPage: (settings) => {
|
|
3984
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
3985
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
3986
|
+
}
|
|
3987
|
+
return this.listPagingPage(options, settings);
|
|
3912
3988
|
}
|
|
3913
3989
|
};
|
|
3914
3990
|
}
|
|
3915
|
-
listPagingPage(options) {
|
|
3991
|
+
listPagingPage(options, settings) {
|
|
3916
3992
|
return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
3917
|
-
let result
|
|
3918
|
-
|
|
3919
|
-
|
|
3993
|
+
let result;
|
|
3994
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
3995
|
+
if (!continuationToken) {
|
|
3996
|
+
result = yield tslib.__await(this._list(options));
|
|
3997
|
+
let page = result.value || [];
|
|
3998
|
+
continuationToken = result.nextLink;
|
|
3999
|
+
setContinuationToken(page, continuationToken);
|
|
4000
|
+
yield yield tslib.__await(page);
|
|
4001
|
+
}
|
|
3920
4002
|
while (continuationToken) {
|
|
3921
4003
|
result = yield tslib.__await(this._listNext(continuationToken, options));
|
|
3922
4004
|
continuationToken = result.nextLink;
|
|
3923
|
-
|
|
4005
|
+
let page = result.value || [];
|
|
4006
|
+
setContinuationToken(page, continuationToken);
|
|
4007
|
+
yield yield tslib.__await(page);
|
|
3924
4008
|
}
|
|
3925
4009
|
});
|
|
3926
4010
|
}
|
|
@@ -3987,7 +4071,6 @@ const listNextOperationSpec = {
|
|
|
3987
4071
|
bodyMapper: ErrorModel
|
|
3988
4072
|
}
|
|
3989
4073
|
},
|
|
3990
|
-
queryParameters: [apiVersion],
|
|
3991
4074
|
urlParameters: [$host, nextLink],
|
|
3992
4075
|
headerParameters: [accept],
|
|
3993
4076
|
serializer: serializer$4
|
|
@@ -5180,7 +5263,7 @@ class ServiceFabricManagementClient extends coreClient__namespace.ServiceClient
|
|
|
5180
5263
|
* @param options The parameter options
|
|
5181
5264
|
*/
|
|
5182
5265
|
constructor(credentials, subscriptionId, options) {
|
|
5183
|
-
var _a, _b;
|
|
5266
|
+
var _a, _b, _c;
|
|
5184
5267
|
if (credentials === undefined) {
|
|
5185
5268
|
throw new Error("'credentials' cannot be null");
|
|
5186
5269
|
}
|
|
@@ -5195,32 +5278,34 @@ class ServiceFabricManagementClient extends coreClient__namespace.ServiceClient
|
|
|
5195
5278
|
requestContentType: "application/json; charset=utf-8",
|
|
5196
5279
|
credential: credentials
|
|
5197
5280
|
};
|
|
5198
|
-
const packageDetails = `azsdk-js-arm-servicefabric/2.
|
|
5281
|
+
const packageDetails = `azsdk-js-arm-servicefabric/2.1.1`;
|
|
5199
5282
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
5200
5283
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
5201
5284
|
: `${packageDetails}`;
|
|
5202
|
-
if (!options.credentialScopes) {
|
|
5203
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
5204
|
-
}
|
|
5205
5285
|
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
5206
5286
|
userAgentPrefix
|
|
5207
|
-
},
|
|
5287
|
+
}, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
|
|
5208
5288
|
super(optionsWithDefaults);
|
|
5289
|
+
let bearerTokenAuthenticationPolicyFound = false;
|
|
5209
5290
|
if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
|
|
5210
5291
|
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
5211
|
-
|
|
5292
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
5212
5293
|
coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5294
|
+
}
|
|
5295
|
+
if (!options ||
|
|
5296
|
+
!options.pipeline ||
|
|
5297
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
5298
|
+
!bearerTokenAuthenticationPolicyFound) {
|
|
5299
|
+
this.pipeline.removePolicy({
|
|
5300
|
+
name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
|
|
5301
|
+
});
|
|
5302
|
+
this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
|
|
5303
|
+
credential: credentials,
|
|
5304
|
+
scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
|
|
5305
|
+
challengeCallbacks: {
|
|
5306
|
+
authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
|
|
5307
|
+
}
|
|
5308
|
+
}));
|
|
5224
5309
|
}
|
|
5225
5310
|
// Parameter assignments
|
|
5226
5311
|
this.subscriptionId = subscriptionId;
|
|
@@ -5234,8 +5319,37 @@ class ServiceFabricManagementClient extends coreClient__namespace.ServiceClient
|
|
|
5234
5319
|
this.applicationTypeVersions = new ApplicationTypeVersionsImpl(this);
|
|
5235
5320
|
this.applications = new ApplicationsImpl(this);
|
|
5236
5321
|
this.services = new ServicesImpl(this);
|
|
5322
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
5323
|
+
}
|
|
5324
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
5325
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
5326
|
+
if (!apiVersion) {
|
|
5327
|
+
return;
|
|
5328
|
+
}
|
|
5329
|
+
const apiVersionPolicy = {
|
|
5330
|
+
name: "CustomApiVersionPolicy",
|
|
5331
|
+
sendRequest(request, next) {
|
|
5332
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
5333
|
+
const param = request.url.split("?");
|
|
5334
|
+
if (param.length > 1) {
|
|
5335
|
+
const newParams = param[1].split("&").map((item) => {
|
|
5336
|
+
if (item.indexOf("api-version") > -1) {
|
|
5337
|
+
return "api-version=" + apiVersion;
|
|
5338
|
+
}
|
|
5339
|
+
else {
|
|
5340
|
+
return item;
|
|
5341
|
+
}
|
|
5342
|
+
});
|
|
5343
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
5344
|
+
}
|
|
5345
|
+
return next(request);
|
|
5346
|
+
});
|
|
5347
|
+
}
|
|
5348
|
+
};
|
|
5349
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
5237
5350
|
}
|
|
5238
5351
|
}
|
|
5239
5352
|
|
|
5240
5353
|
exports.ServiceFabricManagementClient = ServiceFabricManagementClient;
|
|
5354
|
+
exports.getContinuationToken = getContinuationToken;
|
|
5241
5355
|
//# sourceMappingURL=index.js.map
|