@azure/app-configuration 1.9.1-alpha.20250618.1 → 1.9.1-alpha.20250722.2
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/browser/appConfigCredential.js +1 -2
- package/dist/browser/appConfigCredential.js.map +1 -1
- package/dist/browser/appConfigurationClient.js +123 -41
- package/dist/browser/appConfigurationClient.js.map +1 -1
- package/dist/browser/featureFlag.js +13 -5
- package/dist/browser/featureFlag.js.map +1 -1
- package/dist/browser/generated/src/appConfiguration.js +21 -9
- package/dist/browser/generated/src/appConfiguration.js.map +1 -1
- package/dist/browser/generated/src/lroImpl.js +7 -3
- package/dist/browser/generated/src/lroImpl.js.map +1 -1
- package/dist/browser/internal/helpers.js +14 -5
- package/dist/browser/internal/helpers.js.map +1 -1
- package/dist/browser/internal/synctokenpolicy.js +1 -3
- package/dist/browser/internal/synctokenpolicy.js.map +1 -1
- package/dist/browser/secretReference.js +8 -2
- package/dist/browser/secretReference.js.map +1 -1
- package/dist/commonjs/appConfigCredential.js +1 -2
- package/dist/commonjs/appConfigCredential.js.map +1 -1
- package/dist/commonjs/appConfigurationClient.js +123 -41
- package/dist/commonjs/appConfigurationClient.js.map +1 -1
- package/dist/commonjs/featureFlag.js +13 -5
- package/dist/commonjs/featureFlag.js.map +1 -1
- package/dist/commonjs/generated/src/appConfiguration.js +21 -9
- package/dist/commonjs/generated/src/appConfiguration.js.map +1 -1
- package/dist/commonjs/generated/src/lroImpl.js +7 -3
- package/dist/commonjs/generated/src/lroImpl.js.map +1 -1
- package/dist/commonjs/internal/helpers.js +14 -5
- package/dist/commonjs/internal/helpers.js.map +1 -1
- package/dist/commonjs/internal/synctokenpolicy.js +1 -3
- package/dist/commonjs/internal/synctokenpolicy.js.map +1 -1
- package/dist/commonjs/secretReference.js +8 -2
- package/dist/commonjs/secretReference.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/appConfigCredential.js +1 -2
- package/dist/esm/appConfigCredential.js.map +1 -1
- package/dist/esm/appConfigurationClient.js +123 -41
- package/dist/esm/appConfigurationClient.js.map +1 -1
- package/dist/esm/featureFlag.js +13 -5
- package/dist/esm/featureFlag.js.map +1 -1
- package/dist/esm/generated/src/appConfiguration.js +21 -9
- package/dist/esm/generated/src/appConfiguration.js.map +1 -1
- package/dist/esm/generated/src/lroImpl.js +7 -3
- package/dist/esm/generated/src/lroImpl.js.map +1 -1
- package/dist/esm/internal/helpers.js +14 -5
- package/dist/esm/internal/helpers.js.map +1 -1
- package/dist/esm/internal/synctokenpolicy.js +1 -3
- package/dist/esm/internal/synctokenpolicy.js.map +1 -1
- package/dist/esm/secretReference.js +8 -2
- package/dist/esm/secretReference.js.map +1 -1
- package/dist/react-native/appConfigCredential.js +1 -2
- package/dist/react-native/appConfigCredential.js.map +1 -1
- package/dist/react-native/appConfigurationClient.js +123 -41
- package/dist/react-native/appConfigurationClient.js.map +1 -1
- package/dist/react-native/featureFlag.js +13 -5
- package/dist/react-native/featureFlag.js.map +1 -1
- package/dist/react-native/generated/src/appConfiguration.js +21 -9
- package/dist/react-native/generated/src/appConfiguration.js.map +1 -1
- package/dist/react-native/generated/src/lroImpl.js +7 -3
- package/dist/react-native/generated/src/lroImpl.js.map +1 -1
- package/dist/react-native/internal/helpers.js +14 -5
- package/dist/react-native/internal/helpers.js.map +1 -1
- package/dist/react-native/internal/synctokenpolicy.js +1 -3
- package/dist/react-native/internal/synctokenpolicy.js.map +1 -1
- package/dist/react-native/secretReference.js +8 -2
- package/dist/react-native/secretReference.js.map +1 -1
- package/package.json +2 -2
|
@@ -10,11 +10,10 @@ export function appConfigKeyCredentialPolicy(credential, secret) {
|
|
|
10
10
|
return {
|
|
11
11
|
name: "AppConfigKeyCredentialPolicy",
|
|
12
12
|
async sendRequest(request, next) {
|
|
13
|
-
var _a;
|
|
14
13
|
const verb = request.method;
|
|
15
14
|
const utcNow = new Date().toUTCString();
|
|
16
15
|
logger.info("[appConfigKeyCredentialPolicy] Computing SHA-256 from the request body");
|
|
17
|
-
const contentHash = await computeSha256Hash(
|
|
16
|
+
const contentHash = await computeSha256Hash(request.body?.toString() || "", "base64");
|
|
18
17
|
const signedHeaders = "x-ms-date;host;x-ms-content-sha256";
|
|
19
18
|
const url = new URL(request.url);
|
|
20
19
|
const query = url.search;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appConfigCredential.js","sourceRoot":"","sources":["../../src/appConfigCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAAkB,EAAE,MAAc;IAC7E,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB
|
|
1
|
+
{"version":3,"file":"appConfigCredential.js","sourceRoot":"","sources":["../../src/appConfigCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAAkB,EAAE,MAAc;IAC7E,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;YAC5B,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACxC,MAAM,CAAC,IAAI,CAAC,wEAAwE,CAAC,CAAC;YACtF,MAAM,WAAW,GAAG,MAAM,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;YACtF,MAAM,aAAa,GAAG,oCAAoC,CAAC;YAC3D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjC,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC;YACzB,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,QAAQ,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;YACzE,MAAM,YAAY,GAAG,GAAG,IAAI,KAAK,eAAe,KAAK,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,WAAW,EAAE,CAAC;YACzF,MAAM,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAC;YACjF,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;YAE1E,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YACzC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC;YACxD,kCAAkC;YAClC,4GAA4G;YAC5G,OAAO,CAAC,OAAO,CAAC,GAAG,CACjB,eAAe,EACf,0BAA0B,UAAU,kBAAkB,aAAa,cAAc,SAAS,EAAE,CAC7F,CAAC;YAEF,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { computeSha256Hash, computeSha256Hmac } from \"@azure/core-util\";\nimport { logger } from \"./logger.js\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for AppConfig.\n */\nexport function appConfigKeyCredentialPolicy(credential: string, secret: string): PipelinePolicy {\n return {\n name: \"AppConfigKeyCredentialPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const verb = request.method;\n const utcNow = new Date().toUTCString();\n logger.info(\"[appConfigKeyCredentialPolicy] Computing SHA-256 from the request body\");\n const contentHash = await computeSha256Hash(request.body?.toString() || \"\", \"base64\");\n const signedHeaders = \"x-ms-date;host;x-ms-content-sha256\";\n const url = new URL(request.url);\n const query = url.search;\n const urlPathAndQuery = query ? `${url.pathname}${query}` : url.pathname;\n const stringToSign = `${verb}\\n${urlPathAndQuery}\\n${utcNow};${url.host};${contentHash}`;\n logger.info(\"[appConfigKeyCredentialPolicy] Computing a SHA-256 Hmac signature\");\n const signature = await computeSha256Hmac(secret, stringToSign, \"base64\");\n\n request.headers.set(\"x-ms-date\", utcNow);\n request.headers.set(\"x-ms-content-sha256\", contentHash);\n // Syntax for Authorization header\n // Reference - https://learn.microsoft.com/azure/azure-app-configuration/rest-api-authentication-hmac#syntax\n request.headers.set(\n \"Authorization\",\n `HMAC-SHA256 Credential=${credential}&SignedHeaders=${signedHeaders}&Signature=${signature}`,\n );\n\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -28,8 +28,9 @@ const deserializationContentTypes = {
|
|
|
28
28
|
* Client for the Azure App Configuration service.
|
|
29
29
|
*/
|
|
30
30
|
export class AppConfigurationClient {
|
|
31
|
+
client;
|
|
32
|
+
_syncTokens;
|
|
31
33
|
constructor(connectionStringOrEndpoint, tokenCredentialOrOptions, options) {
|
|
32
|
-
var _a;
|
|
33
34
|
let appConfigOptions = {};
|
|
34
35
|
let appConfigCredential;
|
|
35
36
|
let appConfigEndpoint;
|
|
@@ -49,7 +50,7 @@ export class AppConfigurationClient {
|
|
|
49
50
|
}
|
|
50
51
|
else {
|
|
51
52
|
appConfigOptions = tokenCredentialOrOptions || {};
|
|
52
|
-
const regexMatch = connectionStringOrEndpoint
|
|
53
|
+
const regexMatch = connectionStringOrEndpoint?.match(ConnectionStringRegex);
|
|
53
54
|
if (regexMatch) {
|
|
54
55
|
appConfigEndpoint = regexMatch[1];
|
|
55
56
|
authPolicy = appConfigKeyCredentialPolicy(regexMatch[2], regexMatch[3]);
|
|
@@ -59,13 +60,17 @@ export class AppConfigurationClient {
|
|
|
59
60
|
` To mitigate the issue, please refer to the troubleshooting guide here at https://aka.ms/azsdk/js/app-configuration/troubleshoot.`);
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
const internalClientPipelineOptions =
|
|
63
|
+
const internalClientPipelineOptions = {
|
|
64
|
+
...appConfigOptions,
|
|
65
|
+
loggingOptions: {
|
|
63
66
|
logger: logger.info,
|
|
64
|
-
},
|
|
67
|
+
},
|
|
68
|
+
deserializationOptions: {
|
|
65
69
|
expectedContentTypes: deserializationContentTypes,
|
|
66
|
-
}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
67
72
|
this._syncTokens = appConfigOptions.syncTokens || new SyncTokens();
|
|
68
|
-
this.client = new AppConfiguration(appConfigEndpoint,
|
|
73
|
+
this.client = new AppConfiguration(appConfigEndpoint, options?.apiVersion ?? appConfigurationApiVersion, internalClientPipelineOptions);
|
|
69
74
|
this.client.pipeline.addPolicy(authPolicy, { phase: "Sign" });
|
|
70
75
|
this.client.pipeline.addPolicy(syncTokenPolicy(this._syncTokens), { afterPhase: "Retry" });
|
|
71
76
|
}
|
|
@@ -97,7 +102,12 @@ export class AppConfigurationClient {
|
|
|
97
102
|
const keyValue = serializeAsConfigurationSettingParam(configurationSetting);
|
|
98
103
|
logger.info("[addConfigurationSetting] Creating a key value pair");
|
|
99
104
|
try {
|
|
100
|
-
const originalResponse = await this.client.putKeyValue(configurationSetting.key,
|
|
105
|
+
const originalResponse = await this.client.putKeyValue(configurationSetting.key, {
|
|
106
|
+
ifNoneMatch: "*",
|
|
107
|
+
label: configurationSetting.label,
|
|
108
|
+
entity: keyValue,
|
|
109
|
+
...updatedOptions,
|
|
110
|
+
});
|
|
101
111
|
const response = transformKeyValueResponse(originalResponse);
|
|
102
112
|
assertResponse(response);
|
|
103
113
|
return response;
|
|
@@ -138,9 +148,14 @@ export class AppConfigurationClient {
|
|
|
138
148
|
return tracingClient.withSpan("AppConfigurationClient.deleteConfigurationSetting", options, async (updatedOptions) => {
|
|
139
149
|
let status;
|
|
140
150
|
logger.info("[deleteConfigurationSetting] Deleting key value pair");
|
|
141
|
-
const originalResponse = await this.client.deleteKeyValue(id.key,
|
|
151
|
+
const originalResponse = await this.client.deleteKeyValue(id.key, {
|
|
152
|
+
label: id.label,
|
|
153
|
+
...updatedOptions,
|
|
154
|
+
...checkAndFormatIfAndIfNoneMatch(id, options),
|
|
155
|
+
onResponse: (response) => {
|
|
142
156
|
status = response.status;
|
|
143
|
-
}
|
|
157
|
+
},
|
|
158
|
+
});
|
|
144
159
|
const response = transformKeyValueResponseWithStatusCode(originalResponse, status);
|
|
145
160
|
assertResponse(response);
|
|
146
161
|
return response;
|
|
@@ -168,9 +183,16 @@ export class AppConfigurationClient {
|
|
|
168
183
|
return tracingClient.withSpan("AppConfigurationClient.getConfigurationSetting", options, async (updatedOptions) => {
|
|
169
184
|
let status;
|
|
170
185
|
logger.info("[getConfigurationSetting] Getting key value pair");
|
|
171
|
-
const originalResponse = await this.client.getKeyValue(id.key,
|
|
186
|
+
const originalResponse = await this.client.getKeyValue(id.key, {
|
|
187
|
+
...updatedOptions,
|
|
188
|
+
label: id.label,
|
|
189
|
+
select: formatFieldsForSelect(options.fields),
|
|
190
|
+
...formatAcceptDateTime(options),
|
|
191
|
+
...checkAndFormatIfAndIfNoneMatch(id, options),
|
|
192
|
+
onResponse: (response) => {
|
|
172
193
|
status = response.status;
|
|
173
|
-
}
|
|
194
|
+
},
|
|
195
|
+
});
|
|
174
196
|
const response = transformKeyValueResponseWithStatusCode(originalResponse, status);
|
|
175
197
|
// 304 only comes back if the user has passed a conditional option in their
|
|
176
198
|
// request _and_ the remote object has the same etag as what the user passed.
|
|
@@ -209,13 +231,17 @@ export class AppConfigurationClient {
|
|
|
209
231
|
const pagedResult = {
|
|
210
232
|
firstPageLink: undefined,
|
|
211
233
|
getPage: async (pageLink) => {
|
|
212
|
-
|
|
213
|
-
const etag = pageEtags === null || pageEtags === void 0 ? void 0 : pageEtags.shift();
|
|
234
|
+
const etag = pageEtags?.shift();
|
|
214
235
|
try {
|
|
215
|
-
const response = await this.sendConfigurationSettingsRequest(
|
|
216
|
-
const currentResponse =
|
|
236
|
+
const response = await this.sendConfigurationSettingsRequest({ ...options, etag }, pageLink);
|
|
237
|
+
const currentResponse = {
|
|
238
|
+
...response,
|
|
239
|
+
items: response.items != null ? response.items?.map(transformKeyValue) : [],
|
|
240
|
+
continuationToken: response.nextLink
|
|
217
241
|
? extractAfterTokenFromNextLink(response.nextLink)
|
|
218
|
-
: undefined,
|
|
242
|
+
: undefined,
|
|
243
|
+
_response: response._response,
|
|
244
|
+
};
|
|
219
245
|
return {
|
|
220
246
|
page: currentResponse,
|
|
221
247
|
nextPageLink: currentResponse.continuationToken,
|
|
@@ -223,7 +249,7 @@ export class AppConfigurationClient {
|
|
|
223
249
|
}
|
|
224
250
|
catch (error) {
|
|
225
251
|
const err = error;
|
|
226
|
-
const link =
|
|
252
|
+
const link = err.response?.headers?.get("link");
|
|
227
253
|
const continuationToken = link ? extractAfterTokenFromLinkHeader(link) : undefined;
|
|
228
254
|
if (err.statusCode === 304) {
|
|
229
255
|
err.message = `Status 304: No updates for this page`;
|
|
@@ -232,7 +258,7 @@ export class AppConfigurationClient {
|
|
|
232
258
|
page: {
|
|
233
259
|
items: [],
|
|
234
260
|
etag,
|
|
235
|
-
_response:
|
|
261
|
+
_response: { ...err.response, status: 304 },
|
|
236
262
|
},
|
|
237
263
|
nextPageLink: continuationToken,
|
|
238
264
|
};
|
|
@@ -268,11 +294,14 @@ export class AppConfigurationClient {
|
|
|
268
294
|
const pagedResult = {
|
|
269
295
|
firstPageLink: undefined,
|
|
270
296
|
getPage: async (pageLink) => {
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
|
|
297
|
+
const response = await this.sendConfigurationSettingsRequest({ snapshotName, ...options }, pageLink);
|
|
298
|
+
const currentResponse = {
|
|
299
|
+
...response,
|
|
300
|
+
items: response.items != null ? response.items?.map(transformKeyValue) : [],
|
|
301
|
+
continuationToken: response.nextLink
|
|
274
302
|
? extractAfterTokenFromNextLink(response.nextLink)
|
|
275
|
-
: undefined
|
|
303
|
+
: undefined,
|
|
304
|
+
};
|
|
276
305
|
return {
|
|
277
306
|
page: currentResponse,
|
|
278
307
|
nextPageLink: currentResponse.continuationToken,
|
|
@@ -303,11 +332,15 @@ export class AppConfigurationClient {
|
|
|
303
332
|
const pagedResult = {
|
|
304
333
|
firstPageLink: undefined,
|
|
305
334
|
getPage: async (pageLink) => {
|
|
306
|
-
var _a;
|
|
307
335
|
const response = await this.sendLabelsRequest(options, pageLink);
|
|
308
|
-
const currentResponse =
|
|
336
|
+
const currentResponse = {
|
|
337
|
+
...response,
|
|
338
|
+
items: response.items ?? [],
|
|
339
|
+
continuationToken: response.nextLink
|
|
309
340
|
? extractAfterTokenFromNextLink(response.nextLink)
|
|
310
|
-
: undefined,
|
|
341
|
+
: undefined,
|
|
342
|
+
_response: response._response,
|
|
343
|
+
};
|
|
311
344
|
return {
|
|
312
345
|
page: currentResponse,
|
|
313
346
|
nextPageLink: currentResponse.continuationToken,
|
|
@@ -319,13 +352,24 @@ export class AppConfigurationClient {
|
|
|
319
352
|
}
|
|
320
353
|
async sendLabelsRequest(options = {}, pageLink) {
|
|
321
354
|
return tracingClient.withSpan("AppConfigurationClient.listConfigurationSettings", options, async (updatedOptions) => {
|
|
322
|
-
const response = await this.client.getLabels(
|
|
355
|
+
const response = await this.client.getLabels({
|
|
356
|
+
...updatedOptions,
|
|
357
|
+
...formatAcceptDateTime(options),
|
|
358
|
+
...formatLabelsFiltersAndSelect(options),
|
|
359
|
+
after: pageLink,
|
|
360
|
+
});
|
|
323
361
|
return response;
|
|
324
362
|
});
|
|
325
363
|
}
|
|
326
364
|
async sendConfigurationSettingsRequest(options = {}, pageLink) {
|
|
327
365
|
return tracingClient.withSpan("AppConfigurationClient.listConfigurationSettings", options, async (updatedOptions) => {
|
|
328
|
-
const response = await this.client.getKeyValues(
|
|
366
|
+
const response = await this.client.getKeyValues({
|
|
367
|
+
...updatedOptions,
|
|
368
|
+
...formatAcceptDateTime(options),
|
|
369
|
+
...formatConfigurationSettingsFiltersAndSelect(options),
|
|
370
|
+
...checkAndFormatIfAndIfNoneMatch({ etag: options.etag }, { onlyIfChanged: true }),
|
|
371
|
+
after: pageLink,
|
|
372
|
+
});
|
|
329
373
|
return response;
|
|
330
374
|
});
|
|
331
375
|
}
|
|
@@ -352,9 +396,13 @@ export class AppConfigurationClient {
|
|
|
352
396
|
firstPageLink: undefined,
|
|
353
397
|
getPage: async (pageLink) => {
|
|
354
398
|
const response = await this.sendRevisionsRequest(options, pageLink);
|
|
355
|
-
const currentResponse =
|
|
399
|
+
const currentResponse = {
|
|
400
|
+
...response,
|
|
401
|
+
items: response.items != null ? response.items.map(transformKeyValue) : [],
|
|
402
|
+
continuationToken: response.nextLink
|
|
356
403
|
? extractAfterTokenFromNextLink(response.nextLink)
|
|
357
|
-
: undefined
|
|
404
|
+
: undefined,
|
|
405
|
+
};
|
|
358
406
|
// let itemList = currentResponse.items;
|
|
359
407
|
return {
|
|
360
408
|
page: currentResponse,
|
|
@@ -367,7 +415,12 @@ export class AppConfigurationClient {
|
|
|
367
415
|
}
|
|
368
416
|
async sendRevisionsRequest(options = {}, pageLink) {
|
|
369
417
|
return tracingClient.withSpan("AppConfigurationClient.listRevisions", options, async (updatedOptions) => {
|
|
370
|
-
const response = await this.client.getRevisions(
|
|
418
|
+
const response = await this.client.getRevisions({
|
|
419
|
+
...updatedOptions,
|
|
420
|
+
...formatAcceptDateTime(options),
|
|
421
|
+
...formatFiltersAndSelect(updatedOptions),
|
|
422
|
+
after: pageLink,
|
|
423
|
+
});
|
|
371
424
|
return response;
|
|
372
425
|
});
|
|
373
426
|
}
|
|
@@ -394,7 +447,12 @@ export class AppConfigurationClient {
|
|
|
394
447
|
return tracingClient.withSpan("AppConfigurationClient.setConfigurationSetting", options, async (updatedOptions) => {
|
|
395
448
|
const keyValue = serializeAsConfigurationSettingParam(configurationSetting);
|
|
396
449
|
logger.info("[setConfigurationSetting] Setting new key value");
|
|
397
|
-
const response = transformKeyValueResponse(await this.client.putKeyValue(configurationSetting.key,
|
|
450
|
+
const response = transformKeyValueResponse(await this.client.putKeyValue(configurationSetting.key, {
|
|
451
|
+
...updatedOptions,
|
|
452
|
+
label: configurationSetting.label,
|
|
453
|
+
entity: keyValue,
|
|
454
|
+
...checkAndFormatIfAndIfNoneMatch(configurationSetting, options),
|
|
455
|
+
}));
|
|
398
456
|
assertResponse(response);
|
|
399
457
|
return response;
|
|
400
458
|
});
|
|
@@ -408,11 +466,19 @@ export class AppConfigurationClient {
|
|
|
408
466
|
let response;
|
|
409
467
|
if (readOnly) {
|
|
410
468
|
logger.info("[setReadOnly] Setting read-only status to ${readOnly}");
|
|
411
|
-
response = await this.client.putLock(id.key,
|
|
469
|
+
response = await this.client.putLock(id.key, {
|
|
470
|
+
...newOptions,
|
|
471
|
+
label: id.label,
|
|
472
|
+
...checkAndFormatIfAndIfNoneMatch(id, options),
|
|
473
|
+
});
|
|
412
474
|
}
|
|
413
475
|
else {
|
|
414
476
|
logger.info("[setReadOnly] Deleting read-only lock");
|
|
415
|
-
response = await this.client.deleteLock(id.key,
|
|
477
|
+
response = await this.client.deleteLock(id.key, {
|
|
478
|
+
...newOptions,
|
|
479
|
+
label: id.label,
|
|
480
|
+
...checkAndFormatIfAndIfNoneMatch(id, options),
|
|
481
|
+
});
|
|
416
482
|
}
|
|
417
483
|
response = transformKeyValueResponse(response);
|
|
418
484
|
assertResponse(response);
|
|
@@ -434,7 +500,7 @@ export class AppConfigurationClient {
|
|
|
434
500
|
beginCreateSnapshot(snapshot,
|
|
435
501
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
436
502
|
options = {}) {
|
|
437
|
-
return tracingClient.withSpan(`${AppConfigurationClient.name}.beginCreateSnapshot`, options, (updatedOptions) => this.client.beginCreateSnapshot(snapshot.name, snapshot,
|
|
503
|
+
return tracingClient.withSpan(`${AppConfigurationClient.name}.beginCreateSnapshot`, options, (updatedOptions) => this.client.beginCreateSnapshot(snapshot.name, snapshot, { ...updatedOptions }));
|
|
438
504
|
}
|
|
439
505
|
/**
|
|
440
506
|
* Begins creating a snapshot for Azure App Configuration service, waits until it is done,
|
|
@@ -443,7 +509,7 @@ export class AppConfigurationClient {
|
|
|
443
509
|
beginCreateSnapshotAndWait(snapshot,
|
|
444
510
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
445
511
|
options = {}) {
|
|
446
|
-
return tracingClient.withSpan(`${AppConfigurationClient.name}.beginCreateSnapshotAndWait`, options, (updatedOptions) => this.client.beginCreateSnapshotAndWait(snapshot.name, snapshot,
|
|
512
|
+
return tracingClient.withSpan(`${AppConfigurationClient.name}.beginCreateSnapshotAndWait`, options, (updatedOptions) => this.client.beginCreateSnapshotAndWait(snapshot.name, snapshot, { ...updatedOptions }));
|
|
447
513
|
}
|
|
448
514
|
/**
|
|
449
515
|
* Get a snapshot from Azure App Configuration service
|
|
@@ -467,7 +533,9 @@ export class AppConfigurationClient {
|
|
|
467
533
|
getSnapshot(name, options = {}) {
|
|
468
534
|
return tracingClient.withSpan("AppConfigurationClient.getSnapshot", options, async (updatedOptions) => {
|
|
469
535
|
logger.info("[getSnapshot] Get a snapshot");
|
|
470
|
-
const originalResponse = await this.client.getSnapshot(name,
|
|
536
|
+
const originalResponse = await this.client.getSnapshot(name, {
|
|
537
|
+
...updatedOptions,
|
|
538
|
+
});
|
|
471
539
|
const response = transformSnapshotResponse(originalResponse);
|
|
472
540
|
assertResponse(response);
|
|
473
541
|
return response;
|
|
@@ -496,7 +564,10 @@ export class AppConfigurationClient {
|
|
|
496
564
|
options = {}) {
|
|
497
565
|
return tracingClient.withSpan("AppConfigurationClient.recoverSnapshot", options, async (updatedOptions) => {
|
|
498
566
|
logger.info("[recoverSnapshot] Recover a snapshot");
|
|
499
|
-
const originalResponse = await this.client.updateSnapshot(name, { status: "ready" },
|
|
567
|
+
const originalResponse = await this.client.updateSnapshot(name, { status: "ready" }, {
|
|
568
|
+
...updatedOptions,
|
|
569
|
+
...checkAndFormatIfAndIfNoneMatch({ etag: options.etag }, { onlyIfUnchanged: true, ...options }),
|
|
570
|
+
});
|
|
500
571
|
const response = transformSnapshotResponse(originalResponse);
|
|
501
572
|
assertResponse(response);
|
|
502
573
|
return response;
|
|
@@ -525,7 +596,10 @@ export class AppConfigurationClient {
|
|
|
525
596
|
options = {}) {
|
|
526
597
|
return tracingClient.withSpan("AppConfigurationClient.archiveSnapshot", options, async (updatedOptions) => {
|
|
527
598
|
logger.info("[archiveSnapshot] Archive a snapshot");
|
|
528
|
-
const originalResponse = await this.client.updateSnapshot(name, { status: "archived" },
|
|
599
|
+
const originalResponse = await this.client.updateSnapshot(name, { status: "archived" }, {
|
|
600
|
+
...updatedOptions,
|
|
601
|
+
...checkAndFormatIfAndIfNoneMatch({ etag: options.etag }, { onlyIfUnchanged: true, ...options }),
|
|
602
|
+
});
|
|
529
603
|
const response = transformSnapshotResponse(originalResponse);
|
|
530
604
|
assertResponse(response);
|
|
531
605
|
return response;
|
|
@@ -557,9 +631,13 @@ export class AppConfigurationClient {
|
|
|
557
631
|
firstPageLink: undefined,
|
|
558
632
|
getPage: async (pageLink) => {
|
|
559
633
|
const response = await this.sendSnapShotsRequest(options, pageLink);
|
|
560
|
-
const currentResponse =
|
|
634
|
+
const currentResponse = {
|
|
635
|
+
...response,
|
|
636
|
+
items: response.items != null ? response.items : [],
|
|
637
|
+
continuationToken: response.nextLink
|
|
561
638
|
? extractAfterTokenFromNextLink(response.nextLink)
|
|
562
|
-
: undefined
|
|
639
|
+
: undefined,
|
|
640
|
+
};
|
|
563
641
|
return {
|
|
564
642
|
page: currentResponse,
|
|
565
643
|
nextPageLink: currentResponse.continuationToken,
|
|
@@ -571,7 +649,11 @@ export class AppConfigurationClient {
|
|
|
571
649
|
}
|
|
572
650
|
async sendSnapShotsRequest(options = {}, pageLink) {
|
|
573
651
|
return tracingClient.withSpan("AppConfigurationClient.listSnapshots", options, async (updatedOptions) => {
|
|
574
|
-
const response = await this.client.getSnapshots(
|
|
652
|
+
const response = await this.client.getSnapshots({
|
|
653
|
+
...updatedOptions,
|
|
654
|
+
...formatSnapshotFiltersAndSelect(options),
|
|
655
|
+
after: pageLink,
|
|
656
|
+
});
|
|
575
657
|
return response;
|
|
576
658
|
});
|
|
577
659
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appConfigurationClient.js","sourceRoot":"","sources":["../../src/appConfigurationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAsDlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,EACL,cAAc,EACd,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,oBAAoB,EACpB,2CAA2C,EAC3C,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,8BAA8B,EAC9B,QAAQ,EACR,6BAA6B,EAC7B,oCAAoC,EACpC,iBAAiB,EACjB,yBAAyB,EACzB,uCAAuC,EACvC,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACt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,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EACnD,iBAAiB,EAAE,QAAQ,CAAC,QAAQ;wBAClC,CAAC,CAAC,6BAA6B,CAAC,QAAQ,CAAC,QAAQ,CAAC;wBAClD,CAAC,CAAC,SAAS,GACd,CAAC;gBACF,OAAO;oBACL,IAAI,EAAE,eAAe;oBACrB,YAAY,EAAE,eAAe,CAAC,iBAAiB;iBAChD,CAAC;YACJ,CAAC;YACD,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK;SACjC,CAAC;QACF,OAAO,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;IAEO,KAAK,CAAC,oBAAoB,CAChC,UAA+C,EAAE,EACjD,QAA4B;QAE5B,OAAO,aAAa,CAAC,QAAQ,CAC3B,sCAAsC,EACtC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,+CAC1C,cAAc,GACd,8BAA8B,CAAC,OAAO,CAAC,KAC1C,KAAK,EAAE,QAAQ,IACf,CAAC;YAEH,OAAO,QACiD,CAAC;QAC3D,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// https://azure.github.io/azure-sdk/typescript_design.html#ts-config-lib\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport {\n type AddConfigurationSettingOptions,\n type AddConfigurationSettingParam,\n type AddConfigurationSettingResponse,\n type AppConfigurationClientOptions,\n type ConfigurationSetting,\n type ConfigurationSettingId,\n type CreateSnapshotOptions,\n type CreateSnapshotResponse,\n type DeleteConfigurationSettingOptions,\n type DeleteConfigurationSettingResponse,\n type GetConfigurationSettingOptions,\n type GetConfigurationSettingResponse,\n type GetSnapshotOptions,\n type GetSnapshotResponse,\n type HttpResponseField,\n type ListConfigurationSettingPage,\n type ListConfigurationSettingsForSnapshotOptions,\n type ListConfigurationSettingsOptions,\n type ListLabelsOptions,\n type ListLabelsPage,\n type ListRevisionsOptions,\n type ListRevisionsPage,\n type ListSnapshotsOptions,\n type ListSnapshotsPage,\n type PageSettings,\n type SetConfigurationSettingOptions,\n type SetConfigurationSettingParam,\n type SetConfigurationSettingResponse,\n type SetReadOnlyOptions,\n type SetReadOnlyResponse,\n type SettingLabel,\n type SnapshotInfo,\n type UpdateSnapshotOptions,\n type UpdateSnapshotResponse,\n} from \"./models.js\";\nimport type {\n AppConfigurationGetKeyValuesHeaders,\n AppConfigurationGetRevisionsHeaders,\n AppConfigurationGetSnapshotsHeaders,\n GetKeyValuesResponse,\n GetRevisionsResponse,\n GetSnapshotsResponse,\n ConfigurationSnapshot,\n GetLabelsResponse,\n AppConfigurationGetLabelsHeaders,\n} from \"./generated/src/models/index.js\";\nimport type { InternalClientPipelineOptions } from \"@azure/core-client\";\nimport type { PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { getPagedAsyncIterator } from \"@azure/core-paging\";\nimport type { PipelinePolicy, RestError } from \"@azure/core-rest-pipeline\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { SyncTokens, syncTokenPolicy } from \"./internal/synctokenpolicy.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type {\n SendConfigurationSettingsOptions,\n SendLabelsRequestOptions,\n} from \"./internal/helpers.js\";\nimport {\n assertResponse,\n checkAndFormatIfAndIfNoneMatch,\n extractAfterTokenFromLinkHeader,\n extractAfterTokenFromNextLink,\n formatAcceptDateTime,\n formatConfigurationSettingsFiltersAndSelect,\n formatFieldsForSelect,\n formatFiltersAndSelect,\n formatLabelsFiltersAndSelect,\n formatSnapshotFiltersAndSelect,\n getScope,\n makeConfigurationSettingEmpty,\n serializeAsConfigurationSettingParam,\n transformKeyValue,\n transformKeyValueResponse,\n transformKeyValueResponseWithStatusCode,\n transformSnapshotResponse,\n} from \"./internal/helpers.js\";\nimport { AppConfiguration } from \"./generated/src/appConfiguration.js\";\nimport type { FeatureFlagValue } from \"./featureFlag.js\";\nimport type { SecretReferenceValue } from \"./secretReference.js\";\nimport { appConfigKeyCredentialPolicy } from \"./appConfigCredential.js\";\nimport { tracingClient } from \"./internal/tracing.js\";\nimport { logger } from \"./logger.js\";\nimport type { OperationState, SimplePollerLike } from \"@azure/core-lro\";\nimport { appConfigurationApiVersion } from \"./internal/constants.js\";\n\nconst ConnectionStringRegex = /Endpoint=(.*);Id=(.*);Secret=(.*)/;\nconst deserializationContentTypes = {\n json: [\n \"application/vnd.microsoft.appconfig.kvset+json\",\n \"application/vnd.microsoft.appconfig.kv+json\",\n \"application/vnd.microsoft.appconfig.kvs+json\",\n \"application/vnd.microsoft.appconfig.keyset+json\",\n \"application/vnd.microsoft.appconfig.revs+json\",\n \"application/vnd.microsoft.appconfig.snapshotset+json\",\n \"application/vnd.microsoft.appconfig.snapshot+json\",\n \"application/vnd.microsoft.appconfig.labelset+json\",\n \"application/json\",\n ],\n};\n\n/**\n * Provides internal configuration options for AppConfigurationClient.\n * @internal\n */\nexport interface InternalAppConfigurationClientOptions extends AppConfigurationClientOptions {\n /**\n * The sync token cache to use for this client.\n * NOTE: this is an internal option, not for general client usage.\n */\n syncTokens?: SyncTokens;\n}\n\n/**\n * Client for the Azure App Configuration service.\n */\nexport class AppConfigurationClient {\n private client: AppConfiguration;\n private _syncTokens: SyncTokens;\n\n /**\n * Initializes a new instance of the AppConfigurationClient class.\n * @param options - Options for the AppConfigurationClient.\n */\n constructor(connectionString: string, options?: AppConfigurationClientOptions);\n /**\n * Initializes a new instance of the AppConfigurationClient class using\n * a TokenCredential.\n * @param endpoint - The endpoint of the App Configuration service (ex: https://sample.azconfig.io).\n * @param tokenCredential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param options - Options for the AppConfigurationClient.\n */\n constructor(\n endpoint: string,\n tokenCredential: TokenCredential,\n options?: AppConfigurationClientOptions,\n );\n constructor(\n connectionStringOrEndpoint: string,\n tokenCredentialOrOptions?: TokenCredential | AppConfigurationClientOptions,\n options?: AppConfigurationClientOptions,\n ) {\n let appConfigOptions: InternalAppConfigurationClientOptions = {};\n let appConfigCredential: TokenCredential;\n let appConfigEndpoint: string;\n let authPolicy: PipelinePolicy;\n let scope: string;\n\n if (isTokenCredential(tokenCredentialOrOptions)) {\n appConfigOptions = (options as InternalAppConfigurationClientOptions) || {};\n appConfigCredential = tokenCredentialOrOptions;\n appConfigEndpoint = connectionStringOrEndpoint.endsWith(\"/\")\n ? connectionStringOrEndpoint.slice(0, -1)\n : connectionStringOrEndpoint;\n scope = getScope(appConfigEndpoint, appConfigOptions.audience);\n authPolicy = bearerTokenAuthenticationPolicy({\n scopes: scope,\n credential: appConfigCredential,\n });\n } else {\n appConfigOptions = (tokenCredentialOrOptions as InternalAppConfigurationClientOptions) || {};\n const regexMatch = connectionStringOrEndpoint?.match(ConnectionStringRegex);\n if (regexMatch) {\n appConfigEndpoint = regexMatch[1];\n authPolicy = appConfigKeyCredentialPolicy(regexMatch[2], regexMatch[3]);\n } else {\n throw new Error(\n `Invalid connection string. Valid connection strings should match the regex '${ConnectionStringRegex.source}'.` +\n ` To mitigate the issue, please refer to the troubleshooting guide here at https://aka.ms/azsdk/js/app-configuration/troubleshoot.`,\n );\n }\n }\n\n const internalClientPipelineOptions: InternalClientPipelineOptions = {\n ...appConfigOptions,\n loggingOptions: {\n logger: logger.info,\n },\n deserializationOptions: {\n expectedContentTypes: deserializationContentTypes,\n },\n };\n\n this._syncTokens = appConfigOptions.syncTokens || new SyncTokens();\n this.client = new AppConfiguration(\n appConfigEndpoint,\n options?.apiVersion ?? appConfigurationApiVersion,\n internalClientPipelineOptions,\n );\n this.client.pipeline.addPolicy(authPolicy, { phase: \"Sign\" });\n this.client.pipeline.addPolicy(syncTokenPolicy(this._syncTokens), { afterPhase: \"Retry\" });\n }\n\n /**\n * Add a setting into the Azure App Configuration service, failing if it\n * already exists.\n *\n * Example usage:\n * ```ts snippet:AddConfigurationSetting\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const result = await client.addConfigurationSetting({\n * key: \"MyKey\",\n * label: \"MyLabel\",\n * value: \"MyValue\",\n * });\n * ```\n * @param configurationSetting - A configuration setting.\n * @param options - Optional parameters for the request.\n */\n addConfigurationSetting(\n configurationSetting:\n | AddConfigurationSettingParam\n | AddConfigurationSettingParam<FeatureFlagValue>\n | AddConfigurationSettingParam<SecretReferenceValue>,\n options: AddConfigurationSettingOptions = {},\n ): Promise<AddConfigurationSettingResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.addConfigurationSetting\",\n options,\n async (updatedOptions) => {\n const keyValue = serializeAsConfigurationSettingParam(configurationSetting);\n logger.info(\"[addConfigurationSetting] Creating a key value pair\");\n try {\n const originalResponse = await this.client.putKeyValue(configurationSetting.key, {\n ifNoneMatch: \"*\",\n label: configurationSetting.label,\n entity: keyValue,\n ...updatedOptions,\n });\n const response = transformKeyValueResponse(originalResponse);\n assertResponse(response);\n return response;\n } catch (error) {\n const err = error as RestError;\n // Service does not return an error message. Raise a 412 error similar to .NET\n if (err.statusCode === 412) {\n err.message = `Status 412: Setting was already present`;\n }\n throw err;\n }\n throw new Error(\"Unreachable code\");\n },\n );\n }\n\n /**\n * Delete a setting from the Azure App Configuration service\n *\n * Example usage:\n * ```ts snippet:DeleteConfigurationSetting\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const deletedSetting = await client.deleteConfigurationSetting({\n * key: \"MyKey\",\n * label: \"MyLabel\",\n * });\n * ```\n * @param id - The id of the configuration setting to delete.\n * @param options - Optional parameters for the request (ex: etag, label)\n */\n deleteConfigurationSetting(\n id: ConfigurationSettingId,\n options: DeleteConfigurationSettingOptions = {},\n ): Promise<DeleteConfigurationSettingResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.deleteConfigurationSetting\",\n options,\n async (updatedOptions) => {\n let status;\n logger.info(\"[deleteConfigurationSetting] Deleting key value pair\");\n const originalResponse = await this.client.deleteKeyValue(id.key, {\n label: id.label,\n ...updatedOptions,\n ...checkAndFormatIfAndIfNoneMatch(id, options),\n onResponse: (response) => {\n status = response.status;\n },\n });\n\n const response = transformKeyValueResponseWithStatusCode(originalResponse, status);\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Gets a setting from the Azure App Configuration service.\n *\n * Example code:\n * ```ts snippet:GetConfigurationSetting\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const setting = await client.getConfigurationSetting({ key: \"MyKey\", label: \"MyLabel\" });\n * ```\n * @param id - The id of the configuration setting to get.\n * @param options - Optional parameters for the request.\n */\n async getConfigurationSetting(\n id: ConfigurationSettingId,\n options: GetConfigurationSettingOptions = {},\n ): Promise<GetConfigurationSettingResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.getConfigurationSetting\",\n options,\n async (updatedOptions) => {\n let status;\n logger.info(\"[getConfigurationSetting] Getting key value pair\");\n const originalResponse = await this.client.getKeyValue(id.key, {\n ...updatedOptions,\n label: id.label,\n select: formatFieldsForSelect(options.fields),\n ...formatAcceptDateTime(options),\n ...checkAndFormatIfAndIfNoneMatch(id, options),\n onResponse: (response) => {\n status = response.status;\n },\n });\n\n const response = transformKeyValueResponseWithStatusCode(originalResponse, status);\n\n // 304 only comes back if the user has passed a conditional option in their\n // request _and_ the remote object has the same etag as what the user passed.\n if (response.statusCode === 304) {\n // this is one of our few 'required' fields so we'll make sure it does get initialized\n // with a value\n response.key = id.key;\n\n // and now we'll undefine all the other properties that are not HTTP related\n makeConfigurationSettingEmpty(response);\n }\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Lists settings from the Azure App Configuration service, optionally\n * filtered by key names, labels and accept datetime.\n *\n * Example code:\n * ```ts snippet:ListConfigurationSettings\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const allSettingsWithLabel = client.listConfigurationSettings({ labelFilter: \"MyLabel\" });\n * ```\n * @param options - Optional parameters for the request.\n */\n listConfigurationSettings(\n options: ListConfigurationSettingsOptions = {},\n ): PagedAsyncIterableIterator<ConfigurationSetting, ListConfigurationSettingPage, PageSettings> {\n const pageEtags = options.pageEtags ? [...options.pageEtags] : undefined;\n delete options.pageEtags;\n const pagedResult: PagedResult<ListConfigurationSettingPage, PageSettings, string | undefined> =\n {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const etag = pageEtags?.shift();\n try {\n const response = await this.sendConfigurationSettingsRequest(\n { ...options, etag },\n pageLink,\n );\n const currentResponse: ListConfigurationSettingPage = {\n ...response,\n items: response.items != null ? response.items?.map(transformKeyValue) : [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n _response: response._response,\n };\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n } catch (error) {\n const err = error as RestError;\n\n const link = err.response?.headers?.get(\"link\");\n const continuationToken = link ? extractAfterTokenFromLinkHeader(link) : undefined;\n\n if (err.statusCode === 304) {\n err.message = `Status 304: No updates for this page`;\n logger.info(\n `[listConfigurationSettings] No updates for this page. The current etag for the page is ${etag}`,\n );\n return {\n page: {\n items: [],\n etag,\n _response: { ...err.response, status: 304 },\n } as unknown as ListConfigurationSettingPage,\n nextPageLink: continuationToken,\n };\n }\n\n throw err;\n }\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n /**\n * Lists settings from the Azure App Configuration service for snapshots based on name, optionally\n * filtered by key names, labels and accept datetime.\n *\n * Example code:\n * ```ts snippet:ListConfigurationSettingsForSnashots\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const allSettingsWithLabel = client.listConfigurationSettingsForSnashots({\n * snapshotName: \"MySnapshot\",\n * });\n * ```\n * @param options - Optional parameters for the request.\n */\n listConfigurationSettingsForSnapshot(\n snapshotName: string,\n options: ListConfigurationSettingsForSnapshotOptions = {},\n ): PagedAsyncIterableIterator<ConfigurationSetting, ListConfigurationSettingPage, PageSettings> {\n const pagedResult: PagedResult<ListConfigurationSettingPage, PageSettings, string | undefined> =\n {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const response = await this.sendConfigurationSettingsRequest(\n { snapshotName, ...options },\n pageLink,\n );\n const currentResponse = {\n ...response,\n items: response.items != null ? response.items?.map(transformKeyValue) : [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n };\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n /**\n * Get a list of labels from the Azure App Configuration service\n *\n * Example code:\n * ```ts snippet:ListLabels\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const allSettingsWithLabel = client.listLabels({ nameFilter: \"prod*\" });\n * ```\n * @param options - Optional parameters for the request.\n */\n listLabels(\n options: ListLabelsOptions = {},\n ): PagedAsyncIterableIterator<SettingLabel, ListLabelsPage, PageSettings> {\n const pagedResult: PagedResult<ListLabelsPage, PageSettings, string | undefined> = {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const response = await this.sendLabelsRequest(options, pageLink);\n const currentResponse: ListLabelsPage = {\n ...response,\n items: response.items ?? [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n _response: response._response,\n };\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n private async sendLabelsRequest(\n options: SendLabelsRequestOptions & PageSettings = {},\n pageLink: string | undefined,\n ): Promise<GetLabelsResponse & HttpResponseField<AppConfigurationGetLabelsHeaders>> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.listConfigurationSettings\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getLabels({\n ...updatedOptions,\n ...formatAcceptDateTime(options),\n ...formatLabelsFiltersAndSelect(options),\n after: pageLink,\n });\n\n return response as GetLabelsResponse & HttpResponseField<AppConfigurationGetLabelsHeaders>;\n },\n );\n }\n\n private async sendConfigurationSettingsRequest(\n options: SendConfigurationSettingsOptions & PageSettings = {},\n pageLink: string | undefined,\n ): Promise<GetKeyValuesResponse & HttpResponseField<AppConfigurationGetKeyValuesHeaders>> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.listConfigurationSettings\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getKeyValues({\n ...updatedOptions,\n ...formatAcceptDateTime(options),\n ...formatConfigurationSettingsFiltersAndSelect(options),\n ...checkAndFormatIfAndIfNoneMatch({ etag: options.etag }, { onlyIfChanged: true }),\n after: pageLink,\n });\n\n return response as GetKeyValuesResponse &\n HttpResponseField<AppConfigurationGetKeyValuesHeaders>;\n },\n );\n }\n\n /**\n * Lists revisions of a set of keys, optionally filtered by key names,\n * labels and accept datetime.\n *\n * Example code:\n * ```ts snippet:ListRevisions\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const revisionsIterator = client.listRevisions({ keys: [\"MyKey\"] });\n * ```\n * @param options - Optional parameters for the request.\n */\n listRevisions(\n options?: ListRevisionsOptions,\n ): PagedAsyncIterableIterator<ConfigurationSetting, ListRevisionsPage, PageSettings> {\n const pagedResult: PagedResult<ListRevisionsPage, PageSettings, string | undefined> = {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const response = await this.sendRevisionsRequest(options, pageLink);\n const currentResponse = {\n ...response,\n items: response.items != null ? response.items.map(transformKeyValue) : [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n };\n // let itemList = currentResponse.items;\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n private async sendRevisionsRequest(\n options: ListConfigurationSettingsOptions & PageSettings = {},\n pageLink: string | undefined,\n ): Promise<GetKeyValuesResponse & HttpResponseField<AppConfigurationGetKeyValuesHeaders>> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.listRevisions\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getRevisions({\n ...updatedOptions,\n ...formatAcceptDateTime(options),\n ...formatFiltersAndSelect(updatedOptions),\n after: pageLink,\n });\n\n return response as GetRevisionsResponse &\n HttpResponseField<AppConfigurationGetRevisionsHeaders>;\n },\n );\n }\n\n /**\n * Sets the value of a key in the Azure App Configuration service, allowing for an optional etag.\n * @param key - The name of the key.\n * @param configurationSetting - A configuration value.\n * @param options - Optional parameters for the request.\n *\n * Example code:\n * ```ts snippet:SetConfigurationSetting\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * await client.setConfigurationSetting({ key: \"MyKey\", value: \"MyValue\" });\n * ```\n */\n async setConfigurationSetting(\n configurationSetting:\n | SetConfigurationSettingParam\n | SetConfigurationSettingParam<FeatureFlagValue>\n | SetConfigurationSettingParam<SecretReferenceValue>,\n options: SetConfigurationSettingOptions = {},\n ): Promise<SetConfigurationSettingResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.setConfigurationSetting\",\n options,\n async (updatedOptions) => {\n const keyValue = serializeAsConfigurationSettingParam(configurationSetting);\n logger.info(\"[setConfigurationSetting] Setting new key value\");\n const response = transformKeyValueResponse(\n await this.client.putKeyValue(configurationSetting.key, {\n ...updatedOptions,\n label: configurationSetting.label,\n entity: keyValue,\n ...checkAndFormatIfAndIfNoneMatch(configurationSetting, options),\n }),\n );\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Sets or clears a key's read-only status.\n * @param id - The id of the configuration setting to modify.\n */\n async setReadOnly(\n id: ConfigurationSettingId,\n readOnly: boolean,\n options: SetReadOnlyOptions = {},\n ): Promise<SetReadOnlyResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.setReadOnly\",\n options,\n async (newOptions) => {\n let response;\n if (readOnly) {\n logger.info(\"[setReadOnly] Setting read-only status to ${readOnly}\");\n response = await this.client.putLock(id.key, {\n ...newOptions,\n label: id.label,\n ...checkAndFormatIfAndIfNoneMatch(id, options),\n });\n } else {\n logger.info(\"[setReadOnly] Deleting read-only lock\");\n response = await this.client.deleteLock(id.key, {\n ...newOptions,\n label: id.label,\n ...checkAndFormatIfAndIfNoneMatch(id, options),\n });\n }\n response = transformKeyValueResponse(response);\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Adds an external synchronization token to ensure service requests receive up-to-date values.\n *\n * @param syncToken - The synchronization token value.\n */\n updateSyncToken(syncToken: string): void {\n this._syncTokens.addSyncTokenFromHeaderValue(syncToken);\n }\n\n /**\n * Begins creating a snapshot for Azure App Configuration service, fails if it\n * already exists.\n */\n beginCreateSnapshot(\n snapshot: SnapshotInfo,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateSnapshotOptions = {},\n ): Promise<SimplePollerLike<OperationState<CreateSnapshotResponse>, CreateSnapshotResponse>> {\n return tracingClient.withSpan(\n `${AppConfigurationClient.name}.beginCreateSnapshot`,\n options,\n (updatedOptions) =>\n this.client.beginCreateSnapshot(snapshot.name, snapshot, { ...updatedOptions }),\n );\n }\n\n /**\n * Begins creating a snapshot for Azure App Configuration service, waits until it is done,\n * fails if it already exists.\n */\n beginCreateSnapshotAndWait(\n snapshot: SnapshotInfo,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateSnapshotOptions = {},\n ): Promise<CreateSnapshotResponse> {\n return tracingClient.withSpan(\n `${AppConfigurationClient.name}.beginCreateSnapshotAndWait`,\n options,\n (updatedOptions) =>\n this.client.beginCreateSnapshotAndWait(snapshot.name, snapshot, { ...updatedOptions }),\n );\n }\n\n /**\n * Get a snapshot from Azure App Configuration service\n *\n * Example usage:\n * ```ts snippet:GetSnapshot\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const retrievedSnapshot = await client.getSnapshot(\"testsnapshot\");\n * console.log(\"Retrieved snapshot:\", retrievedSnapshot);\n * ```\n * @param name - The name of the snapshot.\n * @param options - Optional parameters for the request.\n */\n getSnapshot(name: string, options: GetSnapshotOptions = {}): Promise<GetSnapshotResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.getSnapshot\",\n options,\n async (updatedOptions) => {\n logger.info(\"[getSnapshot] Get a snapshot\");\n const originalResponse = await this.client.getSnapshot(name, {\n ...updatedOptions,\n });\n const response = transformSnapshotResponse(originalResponse);\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Recover an archived snapshot back to ready status\n *\n * Example usage:\n * ```ts snippet:RecoverSnapshot\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const result = await client.recoverSnapshot(\"MySnapshot\");\n * ```\n * @param name - The name of the snapshot.\n * @param options - Optional parameters for the request.\n */\n recoverSnapshot(\n name: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: UpdateSnapshotOptions = {},\n ): Promise<UpdateSnapshotResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.recoverSnapshot\",\n options,\n async (updatedOptions) => {\n logger.info(\"[recoverSnapshot] Recover a snapshot\");\n const originalResponse = await this.client.updateSnapshot(\n name,\n { status: \"ready\" },\n {\n ...updatedOptions,\n ...checkAndFormatIfAndIfNoneMatch(\n { etag: options.etag },\n { onlyIfUnchanged: true, ...options },\n ),\n },\n );\n const response = transformSnapshotResponse(originalResponse);\n assertResponse(response);\n return response;\n },\n );\n }\n /**\n * Archive a ready snapshot\n *\n * Example usage:\n * ```ts snippet:ArchiveSnapshot\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const result = await client.archiveSnapshot({ name: \"MySnapshot\" });\n * ```\n * @param name - The name of the snapshot.\n * @param options - Optional parameters for the request.\n */\n archiveSnapshot(\n name: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: UpdateSnapshotOptions = {},\n ): Promise<UpdateSnapshotResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.archiveSnapshot\",\n options,\n async (updatedOptions) => {\n logger.info(\"[archiveSnapshot] Archive a snapshot\");\n const originalResponse = await this.client.updateSnapshot(\n name,\n { status: \"archived\" },\n {\n ...updatedOptions,\n ...checkAndFormatIfAndIfNoneMatch(\n { etag: options.etag },\n { onlyIfUnchanged: true, ...options },\n ),\n },\n );\n const response = transformSnapshotResponse(originalResponse);\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * List all snapshots from Azure App Configuration service\n *\n * Example usage:\n * ```ts snippet:ListSnapshots\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const snapshots = await client.listSnapshots();\n *\n * for await (const snapshot of snapshots) {\n * console.log(`Found snapshot: ${snapshot.name}`);\n * }\n * ```\n * @param options - Optional parameters for the request.\n */\n listSnapshots(\n options: ListSnapshotsOptions = {},\n ): PagedAsyncIterableIterator<ConfigurationSnapshot, ListSnapshotsPage, PageSettings> {\n const pagedResult: PagedResult<ListSnapshotsPage, PageSettings, string | undefined> = {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const response = await this.sendSnapShotsRequest(options, pageLink);\n const currentResponse = {\n ...response,\n items: response.items != null ? response.items : [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n };\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n private async sendSnapShotsRequest(\n options: ListSnapshotsOptions & PageSettings = {},\n pageLink: string | undefined,\n ): Promise<GetSnapshotsResponse & HttpResponseField<AppConfigurationGetSnapshotsHeaders>> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.listSnapshots\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getSnapshots({\n ...updatedOptions,\n ...formatSnapshotFiltersAndSelect(options),\n after: pageLink,\n });\n\n return response as GetSnapshotsResponse &\n HttpResponseField<AppConfigurationGetSnapshotsHeaders>;\n },\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"appConfigurationClient.js","sourceRoot":"","sources":["../../src/appConfigurationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAsDlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,EACL,cAAc,EACd,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,oBAAoB,EACpB,2CAA2C,EAC3C,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,8BAA8B,EAC9B,QAAQ,EACR,6BAA6B,EAC7B,oCAAoC,EACpC,iBAAiB,EACjB,yBAAyB,EACzB,uCAAuC,EACvC,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B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jB,GAAG,8BAA8B,CAAC,OAAO,CAAC;gBAC1C,KAAK,EAAE,QAAQ;aAChB,CAAC,CAAC;YAEH,OAAO,QACiD,CAAC;QAC3D,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// https://azure.github.io/azure-sdk/typescript_design.html#ts-config-lib\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport {\n type AddConfigurationSettingOptions,\n type AddConfigurationSettingParam,\n type AddConfigurationSettingResponse,\n type AppConfigurationClientOptions,\n type ConfigurationSetting,\n type ConfigurationSettingId,\n type CreateSnapshotOptions,\n type CreateSnapshotResponse,\n type DeleteConfigurationSettingOptions,\n type DeleteConfigurationSettingResponse,\n type GetConfigurationSettingOptions,\n type GetConfigurationSettingResponse,\n type GetSnapshotOptions,\n type GetSnapshotResponse,\n type HttpResponseField,\n type ListConfigurationSettingPage,\n type ListConfigurationSettingsForSnapshotOptions,\n type ListConfigurationSettingsOptions,\n type ListLabelsOptions,\n type ListLabelsPage,\n type ListRevisionsOptions,\n type ListRevisionsPage,\n type ListSnapshotsOptions,\n type ListSnapshotsPage,\n type PageSettings,\n type SetConfigurationSettingOptions,\n type SetConfigurationSettingParam,\n type SetConfigurationSettingResponse,\n type SetReadOnlyOptions,\n type SetReadOnlyResponse,\n type SettingLabel,\n type SnapshotInfo,\n type UpdateSnapshotOptions,\n type UpdateSnapshotResponse,\n} from \"./models.js\";\nimport type {\n AppConfigurationGetKeyValuesHeaders,\n AppConfigurationGetRevisionsHeaders,\n AppConfigurationGetSnapshotsHeaders,\n GetKeyValuesResponse,\n GetRevisionsResponse,\n GetSnapshotsResponse,\n ConfigurationSnapshot,\n GetLabelsResponse,\n AppConfigurationGetLabelsHeaders,\n} from \"./generated/src/models/index.js\";\nimport type { InternalClientPipelineOptions } from \"@azure/core-client\";\nimport type { PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { getPagedAsyncIterator } from \"@azure/core-paging\";\nimport type { PipelinePolicy, RestError } from \"@azure/core-rest-pipeline\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { SyncTokens, syncTokenPolicy } from \"./internal/synctokenpolicy.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type {\n SendConfigurationSettingsOptions,\n SendLabelsRequestOptions,\n} from \"./internal/helpers.js\";\nimport {\n assertResponse,\n checkAndFormatIfAndIfNoneMatch,\n extractAfterTokenFromLinkHeader,\n extractAfterTokenFromNextLink,\n formatAcceptDateTime,\n formatConfigurationSettingsFiltersAndSelect,\n formatFieldsForSelect,\n formatFiltersAndSelect,\n formatLabelsFiltersAndSelect,\n formatSnapshotFiltersAndSelect,\n getScope,\n makeConfigurationSettingEmpty,\n serializeAsConfigurationSettingParam,\n transformKeyValue,\n transformKeyValueResponse,\n transformKeyValueResponseWithStatusCode,\n transformSnapshotResponse,\n} from \"./internal/helpers.js\";\nimport { AppConfiguration } from \"./generated/src/appConfiguration.js\";\nimport type { FeatureFlagValue } from \"./featureFlag.js\";\nimport type { SecretReferenceValue } from \"./secretReference.js\";\nimport { appConfigKeyCredentialPolicy } from \"./appConfigCredential.js\";\nimport { tracingClient } from \"./internal/tracing.js\";\nimport { logger } from \"./logger.js\";\nimport type { OperationState, SimplePollerLike } from \"@azure/core-lro\";\nimport { appConfigurationApiVersion } from \"./internal/constants.js\";\n\nconst ConnectionStringRegex = /Endpoint=(.*);Id=(.*);Secret=(.*)/;\nconst deserializationContentTypes = {\n json: [\n \"application/vnd.microsoft.appconfig.kvset+json\",\n \"application/vnd.microsoft.appconfig.kv+json\",\n \"application/vnd.microsoft.appconfig.kvs+json\",\n \"application/vnd.microsoft.appconfig.keyset+json\",\n \"application/vnd.microsoft.appconfig.revs+json\",\n \"application/vnd.microsoft.appconfig.snapshotset+json\",\n \"application/vnd.microsoft.appconfig.snapshot+json\",\n \"application/vnd.microsoft.appconfig.labelset+json\",\n \"application/json\",\n ],\n};\n\n/**\n * Provides internal configuration options for AppConfigurationClient.\n * @internal\n */\nexport interface InternalAppConfigurationClientOptions extends AppConfigurationClientOptions {\n /**\n * The sync token cache to use for this client.\n * NOTE: this is an internal option, not for general client usage.\n */\n syncTokens?: SyncTokens;\n}\n\n/**\n * Client for the Azure App Configuration service.\n */\nexport class AppConfigurationClient {\n private client: AppConfiguration;\n private _syncTokens: SyncTokens;\n\n /**\n * Initializes a new instance of the AppConfigurationClient class.\n * @param options - Options for the AppConfigurationClient.\n */\n constructor(connectionString: string, options?: AppConfigurationClientOptions);\n /**\n * Initializes a new instance of the AppConfigurationClient class using\n * a TokenCredential.\n * @param endpoint - The endpoint of the App Configuration service (ex: https://sample.azconfig.io).\n * @param tokenCredential - An object that implements the `TokenCredential` interface used to authenticate requests to the service. Use the \\@azure/identity package to create a credential that suits your needs.\n * @param options - Options for the AppConfigurationClient.\n */\n constructor(\n endpoint: string,\n tokenCredential: TokenCredential,\n options?: AppConfigurationClientOptions,\n );\n constructor(\n connectionStringOrEndpoint: string,\n tokenCredentialOrOptions?: TokenCredential | AppConfigurationClientOptions,\n options?: AppConfigurationClientOptions,\n ) {\n let appConfigOptions: InternalAppConfigurationClientOptions = {};\n let appConfigCredential: TokenCredential;\n let appConfigEndpoint: string;\n let authPolicy: PipelinePolicy;\n let scope: string;\n\n if (isTokenCredential(tokenCredentialOrOptions)) {\n appConfigOptions = (options as InternalAppConfigurationClientOptions) || {};\n appConfigCredential = tokenCredentialOrOptions;\n appConfigEndpoint = connectionStringOrEndpoint.endsWith(\"/\")\n ? connectionStringOrEndpoint.slice(0, -1)\n : connectionStringOrEndpoint;\n scope = getScope(appConfigEndpoint, appConfigOptions.audience);\n authPolicy = bearerTokenAuthenticationPolicy({\n scopes: scope,\n credential: appConfigCredential,\n });\n } else {\n appConfigOptions = (tokenCredentialOrOptions as InternalAppConfigurationClientOptions) || {};\n const regexMatch = connectionStringOrEndpoint?.match(ConnectionStringRegex);\n if (regexMatch) {\n appConfigEndpoint = regexMatch[1];\n authPolicy = appConfigKeyCredentialPolicy(regexMatch[2], regexMatch[3]);\n } else {\n throw new Error(\n `Invalid connection string. Valid connection strings should match the regex '${ConnectionStringRegex.source}'.` +\n ` To mitigate the issue, please refer to the troubleshooting guide here at https://aka.ms/azsdk/js/app-configuration/troubleshoot.`,\n );\n }\n }\n\n const internalClientPipelineOptions: InternalClientPipelineOptions = {\n ...appConfigOptions,\n loggingOptions: {\n logger: logger.info,\n },\n deserializationOptions: {\n expectedContentTypes: deserializationContentTypes,\n },\n };\n\n this._syncTokens = appConfigOptions.syncTokens || new SyncTokens();\n this.client = new AppConfiguration(\n appConfigEndpoint,\n options?.apiVersion ?? appConfigurationApiVersion,\n internalClientPipelineOptions,\n );\n this.client.pipeline.addPolicy(authPolicy, { phase: \"Sign\" });\n this.client.pipeline.addPolicy(syncTokenPolicy(this._syncTokens), { afterPhase: \"Retry\" });\n }\n\n /**\n * Add a setting into the Azure App Configuration service, failing if it\n * already exists.\n *\n * Example usage:\n * ```ts snippet:AddConfigurationSetting\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const result = await client.addConfigurationSetting({\n * key: \"MyKey\",\n * label: \"MyLabel\",\n * value: \"MyValue\",\n * });\n * ```\n * @param configurationSetting - A configuration setting.\n * @param options - Optional parameters for the request.\n */\n addConfigurationSetting(\n configurationSetting:\n | AddConfigurationSettingParam\n | AddConfigurationSettingParam<FeatureFlagValue>\n | AddConfigurationSettingParam<SecretReferenceValue>,\n options: AddConfigurationSettingOptions = {},\n ): Promise<AddConfigurationSettingResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.addConfigurationSetting\",\n options,\n async (updatedOptions) => {\n const keyValue = serializeAsConfigurationSettingParam(configurationSetting);\n logger.info(\"[addConfigurationSetting] Creating a key value pair\");\n try {\n const originalResponse = await this.client.putKeyValue(configurationSetting.key, {\n ifNoneMatch: \"*\",\n label: configurationSetting.label,\n entity: keyValue,\n ...updatedOptions,\n });\n const response = transformKeyValueResponse(originalResponse);\n assertResponse(response);\n return response;\n } catch (error) {\n const err = error as RestError;\n // Service does not return an error message. Raise a 412 error similar to .NET\n if (err.statusCode === 412) {\n err.message = `Status 412: Setting was already present`;\n }\n throw err;\n }\n throw new Error(\"Unreachable code\");\n },\n );\n }\n\n /**\n * Delete a setting from the Azure App Configuration service\n *\n * Example usage:\n * ```ts snippet:DeleteConfigurationSetting\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const deletedSetting = await client.deleteConfigurationSetting({\n * key: \"MyKey\",\n * label: \"MyLabel\",\n * });\n * ```\n * @param id - The id of the configuration setting to delete.\n * @param options - Optional parameters for the request (ex: etag, label)\n */\n deleteConfigurationSetting(\n id: ConfigurationSettingId,\n options: DeleteConfigurationSettingOptions = {},\n ): Promise<DeleteConfigurationSettingResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.deleteConfigurationSetting\",\n options,\n async (updatedOptions) => {\n let status;\n logger.info(\"[deleteConfigurationSetting] Deleting key value pair\");\n const originalResponse = await this.client.deleteKeyValue(id.key, {\n label: id.label,\n ...updatedOptions,\n ...checkAndFormatIfAndIfNoneMatch(id, options),\n onResponse: (response) => {\n status = response.status;\n },\n });\n\n const response = transformKeyValueResponseWithStatusCode(originalResponse, status);\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Gets a setting from the Azure App Configuration service.\n *\n * Example code:\n * ```ts snippet:GetConfigurationSetting\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const setting = await client.getConfigurationSetting({ key: \"MyKey\", label: \"MyLabel\" });\n * ```\n * @param id - The id of the configuration setting to get.\n * @param options - Optional parameters for the request.\n */\n async getConfigurationSetting(\n id: ConfigurationSettingId,\n options: GetConfigurationSettingOptions = {},\n ): Promise<GetConfigurationSettingResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.getConfigurationSetting\",\n options,\n async (updatedOptions) => {\n let status;\n logger.info(\"[getConfigurationSetting] Getting key value pair\");\n const originalResponse = await this.client.getKeyValue(id.key, {\n ...updatedOptions,\n label: id.label,\n select: formatFieldsForSelect(options.fields),\n ...formatAcceptDateTime(options),\n ...checkAndFormatIfAndIfNoneMatch(id, options),\n onResponse: (response) => {\n status = response.status;\n },\n });\n\n const response = transformKeyValueResponseWithStatusCode(originalResponse, status);\n\n // 304 only comes back if the user has passed a conditional option in their\n // request _and_ the remote object has the same etag as what the user passed.\n if (response.statusCode === 304) {\n // this is one of our few 'required' fields so we'll make sure it does get initialized\n // with a value\n response.key = id.key;\n\n // and now we'll undefine all the other properties that are not HTTP related\n makeConfigurationSettingEmpty(response);\n }\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Lists settings from the Azure App Configuration service, optionally\n * filtered by key names, labels and accept datetime.\n *\n * Example code:\n * ```ts snippet:ListConfigurationSettings\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const allSettingsWithLabel = client.listConfigurationSettings({ labelFilter: \"MyLabel\" });\n * ```\n * @param options - Optional parameters for the request.\n */\n listConfigurationSettings(\n options: ListConfigurationSettingsOptions = {},\n ): PagedAsyncIterableIterator<ConfigurationSetting, ListConfigurationSettingPage, PageSettings> {\n const pageEtags = options.pageEtags ? [...options.pageEtags] : undefined;\n delete options.pageEtags;\n const pagedResult: PagedResult<ListConfigurationSettingPage, PageSettings, string | undefined> =\n {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const etag = pageEtags?.shift();\n try {\n const response = await this.sendConfigurationSettingsRequest(\n { ...options, etag },\n pageLink,\n );\n const currentResponse: ListConfigurationSettingPage = {\n ...response,\n items: response.items != null ? response.items?.map(transformKeyValue) : [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n _response: response._response,\n };\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n } catch (error) {\n const err = error as RestError;\n\n const link = err.response?.headers?.get(\"link\");\n const continuationToken = link ? extractAfterTokenFromLinkHeader(link) : undefined;\n\n if (err.statusCode === 304) {\n err.message = `Status 304: No updates for this page`;\n logger.info(\n `[listConfigurationSettings] No updates for this page. The current etag for the page is ${etag}`,\n );\n return {\n page: {\n items: [],\n etag,\n _response: { ...err.response, status: 304 },\n } as unknown as ListConfigurationSettingPage,\n nextPageLink: continuationToken,\n };\n }\n\n throw err;\n }\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n /**\n * Lists settings from the Azure App Configuration service for snapshots based on name, optionally\n * filtered by key names, labels and accept datetime.\n *\n * Example code:\n * ```ts snippet:ListConfigurationSettingsForSnashots\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const allSettingsWithLabel = client.listConfigurationSettingsForSnashots({\n * snapshotName: \"MySnapshot\",\n * });\n * ```\n * @param options - Optional parameters for the request.\n */\n listConfigurationSettingsForSnapshot(\n snapshotName: string,\n options: ListConfigurationSettingsForSnapshotOptions = {},\n ): PagedAsyncIterableIterator<ConfigurationSetting, ListConfigurationSettingPage, PageSettings> {\n const pagedResult: PagedResult<ListConfigurationSettingPage, PageSettings, string | undefined> =\n {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const response = await this.sendConfigurationSettingsRequest(\n { snapshotName, ...options },\n pageLink,\n );\n const currentResponse = {\n ...response,\n items: response.items != null ? response.items?.map(transformKeyValue) : [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n };\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n /**\n * Get a list of labels from the Azure App Configuration service\n *\n * Example code:\n * ```ts snippet:ListLabels\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const allSettingsWithLabel = client.listLabels({ nameFilter: \"prod*\" });\n * ```\n * @param options - Optional parameters for the request.\n */\n listLabels(\n options: ListLabelsOptions = {},\n ): PagedAsyncIterableIterator<SettingLabel, ListLabelsPage, PageSettings> {\n const pagedResult: PagedResult<ListLabelsPage, PageSettings, string | undefined> = {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const response = await this.sendLabelsRequest(options, pageLink);\n const currentResponse: ListLabelsPage = {\n ...response,\n items: response.items ?? [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n _response: response._response,\n };\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n private async sendLabelsRequest(\n options: SendLabelsRequestOptions & PageSettings = {},\n pageLink: string | undefined,\n ): Promise<GetLabelsResponse & HttpResponseField<AppConfigurationGetLabelsHeaders>> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.listConfigurationSettings\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getLabels({\n ...updatedOptions,\n ...formatAcceptDateTime(options),\n ...formatLabelsFiltersAndSelect(options),\n after: pageLink,\n });\n\n return response as GetLabelsResponse & HttpResponseField<AppConfigurationGetLabelsHeaders>;\n },\n );\n }\n\n private async sendConfigurationSettingsRequest(\n options: SendConfigurationSettingsOptions & PageSettings = {},\n pageLink: string | undefined,\n ): Promise<GetKeyValuesResponse & HttpResponseField<AppConfigurationGetKeyValuesHeaders>> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.listConfigurationSettings\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getKeyValues({\n ...updatedOptions,\n ...formatAcceptDateTime(options),\n ...formatConfigurationSettingsFiltersAndSelect(options),\n ...checkAndFormatIfAndIfNoneMatch({ etag: options.etag }, { onlyIfChanged: true }),\n after: pageLink,\n });\n\n return response as GetKeyValuesResponse &\n HttpResponseField<AppConfigurationGetKeyValuesHeaders>;\n },\n );\n }\n\n /**\n * Lists revisions of a set of keys, optionally filtered by key names,\n * labels and accept datetime.\n *\n * Example code:\n * ```ts snippet:ListRevisions\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const revisionsIterator = client.listRevisions({ keys: [\"MyKey\"] });\n * ```\n * @param options - Optional parameters for the request.\n */\n listRevisions(\n options?: ListRevisionsOptions,\n ): PagedAsyncIterableIterator<ConfigurationSetting, ListRevisionsPage, PageSettings> {\n const pagedResult: PagedResult<ListRevisionsPage, PageSettings, string | undefined> = {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const response = await this.sendRevisionsRequest(options, pageLink);\n const currentResponse = {\n ...response,\n items: response.items != null ? response.items.map(transformKeyValue) : [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n };\n // let itemList = currentResponse.items;\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n private async sendRevisionsRequest(\n options: ListConfigurationSettingsOptions & PageSettings = {},\n pageLink: string | undefined,\n ): Promise<GetKeyValuesResponse & HttpResponseField<AppConfigurationGetKeyValuesHeaders>> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.listRevisions\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getRevisions({\n ...updatedOptions,\n ...formatAcceptDateTime(options),\n ...formatFiltersAndSelect(updatedOptions),\n after: pageLink,\n });\n\n return response as GetRevisionsResponse &\n HttpResponseField<AppConfigurationGetRevisionsHeaders>;\n },\n );\n }\n\n /**\n * Sets the value of a key in the Azure App Configuration service, allowing for an optional etag.\n * @param key - The name of the key.\n * @param configurationSetting - A configuration value.\n * @param options - Optional parameters for the request.\n *\n * Example code:\n * ```ts snippet:SetConfigurationSetting\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * await client.setConfigurationSetting({ key: \"MyKey\", value: \"MyValue\" });\n * ```\n */\n async setConfigurationSetting(\n configurationSetting:\n | SetConfigurationSettingParam\n | SetConfigurationSettingParam<FeatureFlagValue>\n | SetConfigurationSettingParam<SecretReferenceValue>,\n options: SetConfigurationSettingOptions = {},\n ): Promise<SetConfigurationSettingResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.setConfigurationSetting\",\n options,\n async (updatedOptions) => {\n const keyValue = serializeAsConfigurationSettingParam(configurationSetting);\n logger.info(\"[setConfigurationSetting] Setting new key value\");\n const response = transformKeyValueResponse(\n await this.client.putKeyValue(configurationSetting.key, {\n ...updatedOptions,\n label: configurationSetting.label,\n entity: keyValue,\n ...checkAndFormatIfAndIfNoneMatch(configurationSetting, options),\n }),\n );\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Sets or clears a key's read-only status.\n * @param id - The id of the configuration setting to modify.\n */\n async setReadOnly(\n id: ConfigurationSettingId,\n readOnly: boolean,\n options: SetReadOnlyOptions = {},\n ): Promise<SetReadOnlyResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.setReadOnly\",\n options,\n async (newOptions) => {\n let response;\n if (readOnly) {\n logger.info(\"[setReadOnly] Setting read-only status to ${readOnly}\");\n response = await this.client.putLock(id.key, {\n ...newOptions,\n label: id.label,\n ...checkAndFormatIfAndIfNoneMatch(id, options),\n });\n } else {\n logger.info(\"[setReadOnly] Deleting read-only lock\");\n response = await this.client.deleteLock(id.key, {\n ...newOptions,\n label: id.label,\n ...checkAndFormatIfAndIfNoneMatch(id, options),\n });\n }\n response = transformKeyValueResponse(response);\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Adds an external synchronization token to ensure service requests receive up-to-date values.\n *\n * @param syncToken - The synchronization token value.\n */\n updateSyncToken(syncToken: string): void {\n this._syncTokens.addSyncTokenFromHeaderValue(syncToken);\n }\n\n /**\n * Begins creating a snapshot for Azure App Configuration service, fails if it\n * already exists.\n */\n beginCreateSnapshot(\n snapshot: SnapshotInfo,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateSnapshotOptions = {},\n ): Promise<SimplePollerLike<OperationState<CreateSnapshotResponse>, CreateSnapshotResponse>> {\n return tracingClient.withSpan(\n `${AppConfigurationClient.name}.beginCreateSnapshot`,\n options,\n (updatedOptions) =>\n this.client.beginCreateSnapshot(snapshot.name, snapshot, { ...updatedOptions }),\n );\n }\n\n /**\n * Begins creating a snapshot for Azure App Configuration service, waits until it is done,\n * fails if it already exists.\n */\n beginCreateSnapshotAndWait(\n snapshot: SnapshotInfo,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateSnapshotOptions = {},\n ): Promise<CreateSnapshotResponse> {\n return tracingClient.withSpan(\n `${AppConfigurationClient.name}.beginCreateSnapshotAndWait`,\n options,\n (updatedOptions) =>\n this.client.beginCreateSnapshotAndWait(snapshot.name, snapshot, { ...updatedOptions }),\n );\n }\n\n /**\n * Get a snapshot from Azure App Configuration service\n *\n * Example usage:\n * ```ts snippet:GetSnapshot\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const retrievedSnapshot = await client.getSnapshot(\"testsnapshot\");\n * console.log(\"Retrieved snapshot:\", retrievedSnapshot);\n * ```\n * @param name - The name of the snapshot.\n * @param options - Optional parameters for the request.\n */\n getSnapshot(name: string, options: GetSnapshotOptions = {}): Promise<GetSnapshotResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.getSnapshot\",\n options,\n async (updatedOptions) => {\n logger.info(\"[getSnapshot] Get a snapshot\");\n const originalResponse = await this.client.getSnapshot(name, {\n ...updatedOptions,\n });\n const response = transformSnapshotResponse(originalResponse);\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * Recover an archived snapshot back to ready status\n *\n * Example usage:\n * ```ts snippet:RecoverSnapshot\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const result = await client.recoverSnapshot(\"MySnapshot\");\n * ```\n * @param name - The name of the snapshot.\n * @param options - Optional parameters for the request.\n */\n recoverSnapshot(\n name: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: UpdateSnapshotOptions = {},\n ): Promise<UpdateSnapshotResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.recoverSnapshot\",\n options,\n async (updatedOptions) => {\n logger.info(\"[recoverSnapshot] Recover a snapshot\");\n const originalResponse = await this.client.updateSnapshot(\n name,\n { status: \"ready\" },\n {\n ...updatedOptions,\n ...checkAndFormatIfAndIfNoneMatch(\n { etag: options.etag },\n { onlyIfUnchanged: true, ...options },\n ),\n },\n );\n const response = transformSnapshotResponse(originalResponse);\n assertResponse(response);\n return response;\n },\n );\n }\n /**\n * Archive a ready snapshot\n *\n * Example usage:\n * ```ts snippet:ArchiveSnapshot\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const result = await client.archiveSnapshot({ name: \"MySnapshot\" });\n * ```\n * @param name - The name of the snapshot.\n * @param options - Optional parameters for the request.\n */\n archiveSnapshot(\n name: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: UpdateSnapshotOptions = {},\n ): Promise<UpdateSnapshotResponse> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.archiveSnapshot\",\n options,\n async (updatedOptions) => {\n logger.info(\"[archiveSnapshot] Archive a snapshot\");\n const originalResponse = await this.client.updateSnapshot(\n name,\n { status: \"archived\" },\n {\n ...updatedOptions,\n ...checkAndFormatIfAndIfNoneMatch(\n { etag: options.etag },\n { onlyIfUnchanged: true, ...options },\n ),\n },\n );\n const response = transformSnapshotResponse(originalResponse);\n assertResponse(response);\n return response;\n },\n );\n }\n\n /**\n * List all snapshots from Azure App Configuration service\n *\n * Example usage:\n * ```ts snippet:ListSnapshots\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { AppConfigurationClient } from \"@azure/app-configuration\";\n *\n * // The endpoint for your App Configuration resource\n * const endpoint = \"https://example.azconfig.io\";\n * const credential = new DefaultAzureCredential();\n * const client = new AppConfigurationClient(endpoint, credential);\n *\n * const snapshots = await client.listSnapshots();\n *\n * for await (const snapshot of snapshots) {\n * console.log(`Found snapshot: ${snapshot.name}`);\n * }\n * ```\n * @param options - Optional parameters for the request.\n */\n listSnapshots(\n options: ListSnapshotsOptions = {},\n ): PagedAsyncIterableIterator<ConfigurationSnapshot, ListSnapshotsPage, PageSettings> {\n const pagedResult: PagedResult<ListSnapshotsPage, PageSettings, string | undefined> = {\n firstPageLink: undefined,\n getPage: async (pageLink: string | undefined) => {\n const response = await this.sendSnapShotsRequest(options, pageLink);\n const currentResponse = {\n ...response,\n items: response.items != null ? response.items : [],\n continuationToken: response.nextLink\n ? extractAfterTokenFromNextLink(response.nextLink)\n : undefined,\n };\n return {\n page: currentResponse,\n nextPageLink: currentResponse.continuationToken,\n };\n },\n toElements: (page) => page.items,\n };\n return getPagedAsyncIterator(pagedResult);\n }\n\n private async sendSnapShotsRequest(\n options: ListSnapshotsOptions & PageSettings = {},\n pageLink: string | undefined,\n ): Promise<GetSnapshotsResponse & HttpResponseField<AppConfigurationGetSnapshotsHeaders>> {\n return tracingClient.withSpan(\n \"AppConfigurationClient.listSnapshots\",\n options,\n async (updatedOptions) => {\n const response = await this.client.getSnapshots({\n ...updatedOptions,\n ...formatSnapshotFiltersAndSelect(options),\n after: pageLink,\n });\n\n return response as GetSnapshotsResponse &\n HttpResponseField<AppConfigurationGetSnapshotsHeaders>;\n },\n );\n }\n}\n"]}
|