@azure/app-configuration 1.6.2-alpha.20240807.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +98 -13
- package/dist/index.js.map +1 -1
- package/dist-esm/src/appConfigurationClient.js +35 -1
- package/dist-esm/src/appConfigurationClient.js.map +1 -1
- package/dist-esm/src/generated/src/appConfiguration.js +5 -1
- package/dist-esm/src/generated/src/appConfiguration.js.map +1 -1
- package/dist-esm/src/generated/src/models/index.js +6 -6
- package/dist-esm/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/src/generated/src/models/mappers.js +17 -3
- package/dist-esm/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/src/models/parameters.js +18 -0
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/src/internal/constants.js +2 -2
- package/dist-esm/src/internal/constants.js.map +1 -1
- package/dist-esm/src/internal/helpers.js +15 -0
- package/dist-esm/src/internal/helpers.js.map +1 -1
- package/dist-esm/src/models.js.map +1 -1
- package/package.json +4 -4
- package/types/app-configuration.d.ts +58 -2
package/dist/index.js
CHANGED
|
@@ -340,6 +340,7 @@ function formatFiltersAndSelect(listConfigOptions) {
|
|
|
340
340
|
return {
|
|
341
341
|
key: listConfigOptions.keyFilter,
|
|
342
342
|
label: listConfigOptions.labelFilter,
|
|
343
|
+
tags: listConfigOptions.tagsFilter,
|
|
343
344
|
acceptDatetime,
|
|
344
345
|
select: formatFieldsForSelect(listConfigOptions.fields),
|
|
345
346
|
};
|
|
@@ -372,6 +373,20 @@ function formatSnapshotFiltersAndSelect(listSnapshotOptions) {
|
|
|
372
373
|
select: listSnapshotOptions.fields,
|
|
373
374
|
};
|
|
374
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* Transforms some of the key fields in ListLabelsOptions
|
|
378
|
+
* so they can be added to a request using AppConfigurationGetLabelsOptionalParams.
|
|
379
|
+
* - `select` is populated with the proper field names from `options.fields`
|
|
380
|
+
* - `nameFilter` are moved to name
|
|
381
|
+
*
|
|
382
|
+
* @internal
|
|
383
|
+
*/
|
|
384
|
+
function formatLabelsFiltersAndSelect(listLabelsOptions) {
|
|
385
|
+
return {
|
|
386
|
+
name: listLabelsOptions.nameFilter,
|
|
387
|
+
select: listLabelsOptions.fields,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
375
390
|
/**
|
|
376
391
|
* Handles translating a Date acceptDateTime into a string as needed by the API
|
|
377
392
|
* @param newOptions - A newer style options with acceptDateTime as a date (and with proper casing!)
|
|
@@ -912,6 +927,20 @@ const ConfigurationSettingsFilter = {
|
|
|
912
927
|
name: "String",
|
|
913
928
|
},
|
|
914
929
|
},
|
|
930
|
+
tagsFilter: {
|
|
931
|
+
constraints: {
|
|
932
|
+
UniqueItems: true,
|
|
933
|
+
},
|
|
934
|
+
serializedName: "tags",
|
|
935
|
+
type: {
|
|
936
|
+
name: "Sequence",
|
|
937
|
+
element: {
|
|
938
|
+
type: {
|
|
939
|
+
name: "String",
|
|
940
|
+
},
|
|
941
|
+
},
|
|
942
|
+
},
|
|
943
|
+
},
|
|
915
944
|
},
|
|
916
945
|
},
|
|
917
946
|
};
|
|
@@ -941,7 +970,7 @@ const LabelListResult = {
|
|
|
941
970
|
element: {
|
|
942
971
|
type: {
|
|
943
972
|
name: "Composite",
|
|
944
|
-
className: "
|
|
973
|
+
className: "SettingLabel",
|
|
945
974
|
},
|
|
946
975
|
},
|
|
947
976
|
},
|
|
@@ -955,10 +984,10 @@ const LabelListResult = {
|
|
|
955
984
|
},
|
|
956
985
|
},
|
|
957
986
|
};
|
|
958
|
-
const
|
|
987
|
+
const SettingLabel = {
|
|
959
988
|
type: {
|
|
960
989
|
name: "Composite",
|
|
961
|
-
className: "
|
|
990
|
+
className: "SettingLabel",
|
|
962
991
|
modelProperties: {
|
|
963
992
|
name: {
|
|
964
993
|
serializedName: "name",
|
|
@@ -1581,9 +1610,9 @@ var Mappers = /*#__PURE__*/Object.freeze({
|
|
|
1581
1610
|
KeyListResult: KeyListResult,
|
|
1582
1611
|
KeyValue: KeyValue,
|
|
1583
1612
|
KeyValueListResult: KeyValueListResult,
|
|
1584
|
-
Label: Label,
|
|
1585
1613
|
LabelListResult: LabelListResult,
|
|
1586
1614
|
OperationDetails: OperationDetails,
|
|
1615
|
+
SettingLabel: SettingLabel,
|
|
1587
1616
|
SnapshotListResult: SnapshotListResult,
|
|
1588
1617
|
SnapshotUpdateParameters: SnapshotUpdateParameters
|
|
1589
1618
|
});
|
|
@@ -1734,6 +1763,24 @@ const ifNoneMatch = {
|
|
|
1734
1763
|
},
|
|
1735
1764
|
},
|
|
1736
1765
|
};
|
|
1766
|
+
const tags = {
|
|
1767
|
+
parameterPath: ["options", "tags"],
|
|
1768
|
+
mapper: {
|
|
1769
|
+
constraints: {
|
|
1770
|
+
UniqueItems: true,
|
|
1771
|
+
},
|
|
1772
|
+
serializedName: "tags",
|
|
1773
|
+
type: {
|
|
1774
|
+
name: "Sequence",
|
|
1775
|
+
element: {
|
|
1776
|
+
type: {
|
|
1777
|
+
name: "String",
|
|
1778
|
+
},
|
|
1779
|
+
},
|
|
1780
|
+
},
|
|
1781
|
+
},
|
|
1782
|
+
collectionFormat: "Multi",
|
|
1783
|
+
};
|
|
1737
1784
|
const accept2 = {
|
|
1738
1785
|
parameterPath: "accept",
|
|
1739
1786
|
mapper: {
|
|
@@ -1964,7 +2011,7 @@ class AppConfiguration extends coreHttpCompat__namespace.ExtendedServiceClient {
|
|
|
1964
2011
|
const defaults = {
|
|
1965
2012
|
requestContentType: "application/json; charset=utf-8",
|
|
1966
2013
|
};
|
|
1967
|
-
const packageDetails = `azsdk-js-app-configuration/1.
|
|
2014
|
+
const packageDetails = `azsdk-js-app-configuration/1.7.0`;
|
|
1968
2015
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
1969
2016
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
1970
2017
|
: `${packageDetails}`;
|
|
@@ -2301,6 +2348,7 @@ const getKeyValuesOperationSpec = {
|
|
|
2301
2348
|
label,
|
|
2302
2349
|
select,
|
|
2303
2350
|
snapshot,
|
|
2351
|
+
tags,
|
|
2304
2352
|
],
|
|
2305
2353
|
urlParameters: [endpoint],
|
|
2306
2354
|
headerParameters: [
|
|
@@ -2328,6 +2376,7 @@ const checkKeyValuesOperationSpec = {
|
|
|
2328
2376
|
label,
|
|
2329
2377
|
select,
|
|
2330
2378
|
snapshot,
|
|
2379
|
+
tags,
|
|
2331
2380
|
],
|
|
2332
2381
|
urlParameters: [endpoint],
|
|
2333
2382
|
headerParameters: [
|
|
@@ -2679,6 +2728,7 @@ const getRevisionsOperationSpec = {
|
|
|
2679
2728
|
key,
|
|
2680
2729
|
label,
|
|
2681
2730
|
select,
|
|
2731
|
+
tags,
|
|
2682
2732
|
],
|
|
2683
2733
|
urlParameters: [endpoint],
|
|
2684
2734
|
headerParameters: [
|
|
@@ -2703,6 +2753,7 @@ const checkRevisionsOperationSpec = {
|
|
|
2703
2753
|
key,
|
|
2704
2754
|
label,
|
|
2705
2755
|
select,
|
|
2756
|
+
tags,
|
|
2706
2757
|
],
|
|
2707
2758
|
urlParameters: [endpoint],
|
|
2708
2759
|
headerParameters: [syncToken, acceptDatetime],
|
|
@@ -2860,11 +2911,11 @@ function appConfigKeyCredentialPolicy(credential, secret) {
|
|
|
2860
2911
|
/**
|
|
2861
2912
|
* @internal
|
|
2862
2913
|
*/
|
|
2863
|
-
const packageVersion = "1.
|
|
2914
|
+
const packageVersion = "1.7.0";
|
|
2864
2915
|
/**
|
|
2865
2916
|
* @internal
|
|
2866
2917
|
*/
|
|
2867
|
-
const appConfigurationApiVersion = "2023-
|
|
2918
|
+
const appConfigurationApiVersion = "2023-11-01";
|
|
2868
2919
|
|
|
2869
2920
|
// Copyright (c) Microsoft Corporation.
|
|
2870
2921
|
// Licensed under the MIT license.
|
|
@@ -2887,6 +2938,7 @@ const deserializationContentTypes = {
|
|
|
2887
2938
|
"application/vnd.microsoft.appconfig.revs+json",
|
|
2888
2939
|
"application/vnd.microsoft.appconfig.snapshotset+json",
|
|
2889
2940
|
"application/vnd.microsoft.appconfig.snapshot+json",
|
|
2941
|
+
"application/vnd.microsoft.appconfig.labelset+json",
|
|
2890
2942
|
"application/json",
|
|
2891
2943
|
],
|
|
2892
2944
|
};
|
|
@@ -3096,6 +3148,39 @@ class AppConfigurationClient {
|
|
|
3096
3148
|
};
|
|
3097
3149
|
return corePaging.getPagedAsyncIterator(pagedResult);
|
|
3098
3150
|
}
|
|
3151
|
+
/**
|
|
3152
|
+
* Get a list of labels from the Azure App Configuration service
|
|
3153
|
+
*
|
|
3154
|
+
* Example code:
|
|
3155
|
+
* ```ts
|
|
3156
|
+
* const allSettingsWithLabel = client.listLabels({ nameFilter: "prod*" });
|
|
3157
|
+
* ```
|
|
3158
|
+
* @param options - Optional parameters for the request.
|
|
3159
|
+
*/
|
|
3160
|
+
listLabels(options = {}) {
|
|
3161
|
+
const pagedResult = {
|
|
3162
|
+
firstPageLink: undefined,
|
|
3163
|
+
getPage: async (pageLink) => {
|
|
3164
|
+
var _a;
|
|
3165
|
+
const response = await this.sendLabelsRequest(options, pageLink);
|
|
3166
|
+
const currentResponse = Object.assign(Object.assign({}, response), { items: (_a = response.items) !== null && _a !== void 0 ? _a : [], continuationToken: response.nextLink
|
|
3167
|
+
? extractAfterTokenFromNextLink(response.nextLink)
|
|
3168
|
+
: undefined, _response: response._response });
|
|
3169
|
+
return {
|
|
3170
|
+
page: currentResponse,
|
|
3171
|
+
nextPageLink: currentResponse.continuationToken,
|
|
3172
|
+
};
|
|
3173
|
+
},
|
|
3174
|
+
toElements: (page) => page.items,
|
|
3175
|
+
};
|
|
3176
|
+
return corePaging.getPagedAsyncIterator(pagedResult);
|
|
3177
|
+
}
|
|
3178
|
+
async sendLabelsRequest(options = {}, pageLink) {
|
|
3179
|
+
return tracingClient.withSpan("AppConfigurationClient.listConfigurationSettings", options, async (updatedOptions) => {
|
|
3180
|
+
const response = await this.client.getLabels(Object.assign(Object.assign(Object.assign(Object.assign({}, updatedOptions), formatAcceptDateTime(options)), formatLabelsFiltersAndSelect(options)), { after: pageLink }));
|
|
3181
|
+
return response;
|
|
3182
|
+
});
|
|
3183
|
+
}
|
|
3099
3184
|
async sendConfigurationSettingsRequest(options = {}, pageLink) {
|
|
3100
3185
|
return tracingClient.withSpan("AppConfigurationClient.listConfigurationSettings", options, async (updatedOptions) => {
|
|
3101
3186
|
const response = await this.client.getKeyValues(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, updatedOptions), formatAcceptDateTime(options)), formatConfigurationSettingsFiltersAndSelect(options)), checkAndFormatIfAndIfNoneMatch({ etag: options.etag }, { onlyIfChanged: true })), { after: pageLink }));
|
|
@@ -3296,12 +3381,12 @@ class AppConfigurationClient {
|
|
|
3296
3381
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
3297
3382
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
3298
3383
|
*/
|
|
3299
|
-
/** Known values of {@link
|
|
3300
|
-
var
|
|
3301
|
-
(function (
|
|
3302
|
-
/** Api Version '2023-
|
|
3303
|
-
|
|
3304
|
-
})(
|
|
3384
|
+
/** Known values of {@link ApiVersion20231101} that the service accepts. */
|
|
3385
|
+
var KnownApiVersion20231101;
|
|
3386
|
+
(function (KnownApiVersion20231101) {
|
|
3387
|
+
/** Api Version '2023-11-01' */
|
|
3388
|
+
KnownApiVersion20231101["TwoThousandTwentyThree1101"] = "2023-11-01";
|
|
3389
|
+
})(KnownApiVersion20231101 || (KnownApiVersion20231101 = {}));
|
|
3305
3390
|
/** Known values of {@link KeyValueFields} that the service accepts. */
|
|
3306
3391
|
var KnownKeyValueFields;
|
|
3307
3392
|
(function (KnownKeyValueFields) {
|