@azure/app-configuration 1.12.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/appConfigurationClient.d.ts.map +1 -1
- package/dist/browser/appConfigurationClient.js +11 -11
- package/dist/browser/appConfigurationClient.js.map +1 -1
- package/dist/browser/generated/api/appConfigurationContext.js +1 -1
- package/dist/browser/generated/api/appConfigurationContext.js.map +1 -1
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +1 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/internal/constants.d.ts +1 -1
- package/dist/browser/internal/constants.js +1 -1
- package/dist/browser/internal/constants.js.map +1 -1
- package/dist/browser/internal/helpers.d.ts +8 -2
- package/dist/browser/internal/helpers.d.ts.map +1 -1
- package/dist/browser/internal/helpers.js +20 -10
- package/dist/browser/internal/helpers.js.map +1 -1
- package/dist/browser/models.d.ts +6 -3
- package/dist/browser/models.d.ts.map +1 -1
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/package.json +6 -1
- package/dist/commonjs/appConfigurationClient.d.ts.map +1 -1
- package/dist/commonjs/appConfigurationClient.js +20 -16
- package/dist/commonjs/appConfigurationClient.js.map +2 -2
- package/dist/commonjs/generated/api/appConfigurationContext.js +1 -1
- package/dist/commonjs/generated/api/appConfigurationContext.js.map +1 -1
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +5 -0
- package/dist/commonjs/index.js.map +2 -2
- package/dist/commonjs/internal/constants.d.ts +1 -1
- package/dist/commonjs/internal/constants.js +1 -1
- package/dist/commonjs/internal/constants.js.map +1 -1
- package/dist/commonjs/internal/helpers.d.ts +8 -2
- package/dist/commonjs/internal/helpers.d.ts.map +1 -1
- package/dist/commonjs/internal/helpers.js +21 -6
- package/dist/commonjs/internal/helpers.js.map +2 -2
- package/dist/commonjs/models.d.ts +6 -3
- package/dist/commonjs/models.d.ts.map +1 -1
- package/dist/commonjs/models.js.map +2 -2
- package/dist/commonjs/package.json +6 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/appConfigurationClient.d.ts.map +1 -1
- package/dist/esm/appConfigurationClient.js +11 -11
- package/dist/esm/appConfigurationClient.js.map +1 -1
- package/dist/esm/generated/api/appConfigurationContext.js +1 -1
- package/dist/esm/generated/api/appConfigurationContext.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/constants.d.ts +1 -1
- package/dist/esm/internal/constants.js +1 -1
- package/dist/esm/internal/constants.js.map +1 -1
- package/dist/esm/internal/helpers.d.ts +8 -2
- package/dist/esm/internal/helpers.d.ts.map +1 -1
- package/dist/esm/internal/helpers.js +20 -10
- package/dist/esm/internal/helpers.js.map +1 -1
- package/dist/esm/models.d.ts +6 -3
- package/dist/esm/models.d.ts.map +1 -1
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/package.json +6 -1
- package/dist/react-native/appConfigurationClient.d.ts.map +1 -1
- package/dist/react-native/appConfigurationClient.js +11 -11
- package/dist/react-native/appConfigurationClient.js.map +1 -1
- package/dist/react-native/generated/api/appConfigurationContext.js +1 -1
- package/dist/react-native/generated/api/appConfigurationContext.js.map +1 -1
- package/dist/react-native/index.d.ts +1 -0
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +1 -0
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/internal/constants.d.ts +1 -1
- package/dist/react-native/internal/constants.js +1 -1
- package/dist/react-native/internal/constants.js.map +1 -1
- package/dist/react-native/internal/helpers.d.ts +8 -2
- package/dist/react-native/internal/helpers.d.ts.map +1 -1
- package/dist/react-native/internal/helpers.js +20 -10
- package/dist/react-native/internal/helpers.js.map +1 -1
- package/dist/react-native/models.d.ts +6 -3
- package/dist/react-native/models.d.ts.map +1 -1
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/package.json +6 -1
- package/package.json +11 -15
|
@@ -360,7 +360,7 @@ export function hasUnderscoreResponse(result) {
|
|
|
360
360
|
/**
|
|
361
361
|
* Get the scope for the App Configuration service based on the endpoint and audience.
|
|
362
362
|
* If the audience is provided, it will be used as the scope.
|
|
363
|
-
* If not, the scope is
|
|
363
|
+
* If not, the scope is inferred from the endpoint.
|
|
364
364
|
*
|
|
365
365
|
* @internal
|
|
366
366
|
*/
|
|
@@ -368,16 +368,26 @@ export function getScope(appConfigEndpoint, appConfigAudience) {
|
|
|
368
368
|
if (appConfigAudience) {
|
|
369
369
|
return `${appConfigAudience}/.default`;
|
|
370
370
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
371
|
+
const hostname = new URL(appConfigEndpoint).hostname;
|
|
372
|
+
const stagingDomain = "appconfig-staging.azure.com";
|
|
373
|
+
if (hostname.endsWith(`.${stagingDomain}`)) {
|
|
374
|
+
return `https://${stagingDomain}/.default`;
|
|
374
375
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
376
|
+
const labels = hostname.split(".");
|
|
377
|
+
for (let index = labels.length - 1; index >= 0; index--) {
|
|
378
|
+
const label = labels[index].toLowerCase();
|
|
379
|
+
if (label === "appconfig" || label === "azconfig") {
|
|
380
|
+
return `https://${labels.slice(index).join(".")}/.default`;
|
|
381
|
+
}
|
|
381
382
|
}
|
|
383
|
+
return `${KnownAppConfigAudience.AzurePublicCloud}/.default`;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Encodes a value for use as a URL path parameter according to RFC 3986.
|
|
387
|
+
*
|
|
388
|
+
* @internal
|
|
389
|
+
*/
|
|
390
|
+
export function encodePathParameter(str) {
|
|
391
|
+
return encodeURIComponent(str).replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
382
392
|
}
|
|
383
393
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/internal/helpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAeL,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAe9E,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAuBtC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,IAAwB;IAChD,kDAAkD;IAClD,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,IAAI,GAAG,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAC5C,cAA0B,EAC1B,OAA0D;IAE1D,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;QACrD,MAAM,CAAC,KAAK,CACV,sDAAsD,EACtD,OAAO,CAAC,aAAa,EACrB,O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cAAc,CAAC,MAAM,EAAE,WAAW,EAAE;YACzC,UAAU,EAAE,KAAK;YACjB,KAAK,EACH,sJAAsJ;SACzJ,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,MAAS;IAET,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,iBAAyB,EAAE,iBAA0B;IAC5E,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,GAAG,iBAAiB,WAAW,CAAC;IACzC,CAAC;SAAM,IACL,iBAAiB,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAC/C,iBAAiB,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAChD,CAAC;QACD,OAAO,GAAG,sBAAsB,CAAC,eAAe,WAAW,CAAC;IAC9D,CAAC;SAAM,IACL,iBAAiB,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAC/C,iBAAiB,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAChD,CAAC;QACD,OAAO,GAAG,sBAAsB,CAAC,UAAU,WAAW,CAAC;IACzD,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,sBAAsB,CAAC,gBAAgB,WAAW,CAAC;IAC/D,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n type ConfigurationSetting,\n type ConfigurationSettingParam,\n type HttpOnlyIfChangedField,\n type HttpOnlyIfUnchangedField,\n type HttpResponseField,\n type HttpResponseFields,\n type ListRevisionsOptions,\n type ListSettingsOptions,\n type ListSnapshotsOptions,\n type ConfigurationSnapshot,\n type SnapshotResponse,\n type EtagEntity,\n type ListLabelsOptions,\n type SnapshotInfo,\n KnownAppConfigAudience,\n} from \"../models.js\";\nimport type { FeatureFlagValue } from \"../featureFlag.js\";\nimport { FeatureFlagHelper, featureFlagContentType } from \"../featureFlag.js\";\nimport type {\n GetKeyValuesOptionalParams,\n GetLabelsOptionalParams,\n GetSnapshotsOptionalParams,\n} from \"../generated/api/options.js\";\nimport type {\n KeyValue,\n ConfigurationSnapshot as Snapshot,\n KeyValueFields,\n SnapshotFields,\n CompositionType,\n SnapshotStatus,\n} from \"../generated/models/models.js\";\nimport type { SecretReferenceValue } from \"../secretReference.js\";\nimport { SecretReferenceHelper, secretReferenceContentType } from \"../secretReference.js\";\nimport type { SnapshotReferenceValue } from \"../snapshotReference.js\";\nimport { SnapshotReferenceHelper, snapshotReferenceContentType } from \"../snapshotReference.js\";\nimport { isDefined } from \"@azure/core-util\";\nimport { logger } from \"../logger.js\";\nimport type { OperationOptions } from \"@azure/core-client\";\n\n/**\n * Options for listConfigurationSettings that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface SendConfigurationSettingsOptions\n extends OperationOptions, ListSettingsOptions, EtagEntity {\n /**\n * A filter used get configuration setting for a snapshot. Not valid when used with 'key' and 'label' filters\n */\n snapshotName?: string;\n}\n\n/**\n * Options for listLabels that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface SendLabelsRequestOptions extends ListLabelsOptions {}\n\n/**\n * Formats the etag so it can be used with a If-Match/If-None-Match header\n * @internal\n */\nexport function quoteETag(etag: string | undefined): string | undefined {\n // https://tools.ietf.org/html/rfc7232#section-3.1\n if (etag === undefined || etag === \"*\") {\n return etag;\n }\n\n if (etag.startsWith('\"') && etag.endsWith('\"')) {\n return etag;\n }\n\n if (etag.startsWith(\"'\") && etag.endsWith(\"'\")) {\n return etag;\n }\n\n return `\"${etag}\"`;\n}\n\n/**\n * Checks the onlyIfChanged/onlyIfUnchanged properties to make sure we haven't specified both\n * and throws an Error. Otherwise, returns the properties properly quoted.\n * @param options - An options object with onlyIfChanged/onlyIfUnchanged fields\n * @internal\n */\nexport function checkAndFormatIfAndIfNoneMatch(\n objectWithEtag: EtagEntity,\n options: HttpOnlyIfChangedField & HttpOnlyIfUnchangedField,\n): { ifMatch: string | undefined; ifNoneMatch: string | undefined } {\n if (options.onlyIfChanged && options.onlyIfUnchanged) {\n logger.error(\n \"onlyIfChanged and onlyIfUnchanged are both specified\",\n options.onlyIfChanged,\n options.onlyIfUnchanged,\n );\n throw new Error(\"onlyIfChanged and onlyIfUnchanged are mutually-exclusive\");\n }\n\n let ifMatch;\n let ifNoneMatch;\n\n if (options.onlyIfUnchanged) {\n ifMatch = quoteETag(objectWithEtag.etag);\n }\n\n if (options.onlyIfChanged) {\n ifNoneMatch = quoteETag(objectWithEtag.etag);\n }\n\n return {\n ifMatch: ifMatch,\n ifNoneMatch: ifNoneMatch,\n };\n}\n\n/**\n * Transforms some of the key fields in SendConfigurationSettingsOptions and ListRevisionsOptions\n * so they can be added to a request using AppConfigurationGetKeyValuesOptionalParams.\n * - `options.acceptDateTime` is converted into an ISO string\n * - `select` is populated with the proper field names from `options.fields`\n * - keyFilter and labelFilter are moved to key and label, respectively.\n *\n * @internal\n */\nexport function formatFiltersAndSelect(\n listConfigOptions: ListRevisionsOptions,\n): Pick<GetKeyValuesOptionalParams, \"key\" | \"label\" | \"select\" | \"acceptDatetime\" | \"tags\"> {\n let acceptDatetime: string | undefined = undefined;\n\n if (listConfigOptions.acceptDateTime) {\n acceptDatetime = listConfigOptions.acceptDateTime.toISOString();\n }\n return {\n key: listConfigOptions.keyFilter,\n label: listConfigOptions.labelFilter,\n // Ensure the tags are URL-encoded when encoding\n tags: listConfigOptions.tagsFilter?.map((t) => encodeURIComponent(t)),\n acceptDatetime,\n select: formatFieldsForSelect(listConfigOptions.fields),\n };\n}\n\n/**\n * Transforms some of the key fields in SendConfigurationSettingsOptions\n * so they can be added to a request using AppConfigurationGetKeyValuesOptionalParams.\n * - `options.acceptDateTime` is converted into an ISO string\n * - `select` is populated with the proper field names from `options.fields`\n * - keyFilter, labelFilter, snapshotName are moved to key, label, and snapshot respectively.\n *\n * @internal\n */\nexport function formatConfigurationSettingsFiltersAndSelect(\n listConfigOptions: SendConfigurationSettingsOptions,\n): Pick<\n GetKeyValuesOptionalParams,\n \"key\" | \"label\" | \"select\" | \"acceptDatetime\" | \"snapshot\" | \"tags\"\n> {\n const { snapshotName: snapshot, ...options } = listConfigOptions;\n return {\n ...formatFiltersAndSelect(options),\n snapshot,\n };\n}\n/**\n * Transforms some of the key fields in ListSnapshotsOptions\n * so they can be added to a request using AppConfigurationGetSnapshotsOptionalParams.\n * - `select` is populated with the proper field names from `options.fields`\n * - keyFilter and labelFilter are moved to key and label, respectively.\n *\n * @internal\n */\nexport function formatSnapshotFiltersAndSelect(\n listSnapshotOptions: ListSnapshotsOptions,\n): Pick<GetSnapshotsOptionalParams, \"name\" | \"select\" | \"status\"> {\n return {\n name: listSnapshotOptions.nameFilter,\n status: listSnapshotOptions.statusFilter as SnapshotStatus[] | undefined,\n select: listSnapshotOptions.fields as SnapshotFields[] | undefined,\n };\n}\n\n/**\n * Transforms some of the key fields in ListLabelsOptions\n * so they can be added to a request using AppConfigurationGetLabelsOptionalParams.\n * - `select` is populated with the proper field names from `options.fields`\n * - `nameFilter` are moved to name\n *\n * @internal\n */\nexport function formatLabelsFiltersAndSelect(\n listLabelsOptions: ListLabelsOptions,\n): Pick<GetLabelsOptionalParams, \"name\" | \"select\"> {\n return {\n name: listLabelsOptions.nameFilter,\n select: listLabelsOptions.fields,\n };\n}\n/**\n * Handles translating a Date acceptDateTime into a string as needed by the API\n * @param newOptions - A newer style options with acceptDateTime as a date (and with proper casing!)\n * @internal\n */\nexport function formatAcceptDateTime(newOptions: { acceptDateTime?: Date }): {\n acceptDatetime?: string;\n} {\n return {\n acceptDatetime: newOptions.acceptDateTime && newOptions.acceptDateTime.toISOString(),\n };\n}\n\n/**\n * Take the URL that gets returned from next link and extract the 'after' token needed\n * to get the next page of results.\n * @internal\n */\nexport function extractAfterTokenFromNextLink(nextLink: string): string {\n const searchParams = new URLSearchParams(nextLink);\n const afterToken = searchParams.get(\"after\");\n\n if (afterToken == null || Array.isArray(afterToken)) {\n logger.error(\"Invalid nextLink - invalid after token\", afterToken, Array.isArray(afterToken));\n throw new Error(\"Invalid nextLink - invalid after token\");\n }\n\n return decodeURIComponent(afterToken);\n}\n\n/**\n * Take the header link that gets returned from 304 response and extract the 'after' token needed\n * to get the next page of results.\n *\n * @internal\n */\nexport function extractAfterTokenFromLinkHeader(link: string): string {\n // Example transformation of the link header\n // link:\n // '</kv?api-version=2023-10-01&key=listResults714&after=bGlzdE4>; rel=\"next\"'\n //\n // linkValue:\n // </kv?api-version=2023-10-01&key=listResults714&after=bGlzdE4>\n //\n // nextLink:\n // /kv?api-version=2023-10-01&key=listResults714&after=bGlzdE4\n const linkValue = link.split(\";\")[0];\n const nextLink = linkValue.substring(1, linkValue.length - 1);\n return extractAfterTokenFromNextLink(nextLink);\n}\n\n/**\n * Makes a ConfigurationSetting-based response throw for all of the data members. Used primarily\n * to prevent possible errors by the user in accessing a model that is uninitialized. This can happen\n * in cases like HTTP status code 204 or 304, which return an empty response body.\n *\n * @param configurationSetting - The configuration setting to alter\n */\nexport function makeConfigurationSettingEmpty(\n configurationSetting: Partial<Record<Exclude<keyof ConfigurationSetting, \"key\">, any>>,\n): void {\n const names: Exclude<keyof ConfigurationSetting, \"key\">[] = [\n \"contentType\",\n \"description\",\n \"etag\",\n \"label\",\n \"lastModified\",\n \"isReadOnly\",\n \"tags\",\n \"value\",\n ];\n\n for (const name of names) {\n configurationSetting[name] = undefined;\n }\n}\n\n/**\n * @internal\n */\nexport function transformKeyValue<T>(kvp: T & KeyValue): T & ConfigurationSetting {\n const setting = {\n value: undefined,\n ...kvp,\n isReadOnly: !!kvp.locked,\n lastModified: kvp.lastModified ? new Date(kvp.lastModified) : undefined,\n };\n delete setting.locked;\n if (!setting.label) {\n delete setting.label;\n }\n if (!setting.contentType) {\n delete setting.contentType;\n }\n return setting;\n}\n\n/**\n * @internal\n */\nfunction isConfigSettingWithSecretReferenceValue(\n setting: any,\n): setting is ConfigurationSetting<SecretReferenceValue> {\n return (\n setting.contentType === secretReferenceContentType &&\n isDefined(setting.value) &&\n typeof setting.value !== \"string\"\n );\n}\n\n/**\n * @internal\n */\nfunction isConfigSettingWithSnapshotReferenceValue(\n setting: any,\n): setting is ConfigurationSetting<SnapshotReferenceValue> {\n return (\n setting.contentType === snapshotReferenceContentType &&\n isDefined(setting.value) &&\n typeof setting.value !== \"string\"\n );\n}\n\n/**\n * @internal\n */\nfunction isConfigSettingWithFeatureFlagValue(\n setting: any,\n): setting is ConfigurationSetting<FeatureFlagValue> {\n return (\n setting.contentType === featureFlagContentType &&\n isDefined(setting.value) &&\n typeof setting.value !== \"string\"\n );\n}\n\n/**\n * @internal\n */\nfunction isSimpleConfigSetting(setting: any): setting is ConfigurationSetting {\n return typeof setting.value === \"string\" || !isDefined(setting.value);\n}\n\n/**\n * @internal\n */\nexport function serializeAsConfigurationSettingParam(\n setting:\n | ConfigurationSettingParam\n | ConfigurationSettingParam<FeatureFlagValue>\n | ConfigurationSettingParam<SecretReferenceValue>\n | ConfigurationSettingParam<SnapshotReferenceValue>,\n): ConfigurationSettingParam {\n if (isSimpleConfigSetting(setting)) {\n return setting as ConfigurationSettingParam;\n }\n try {\n if (isConfigSettingWithFeatureFlagValue(setting)) {\n return FeatureFlagHelper.toConfigurationSettingParam(setting);\n }\n if (isConfigSettingWithSecretReferenceValue(setting)) {\n return SecretReferenceHelper.toConfigurationSettingParam(setting);\n }\n if (isConfigSettingWithSnapshotReferenceValue(setting)) {\n return SnapshotReferenceHelper.toConfigurationSettingParam(setting);\n }\n } catch (error: any) {\n return setting as ConfigurationSettingParam;\n }\n logger.error(\"Unable to serialize to a configuration setting\", setting);\n throw new TypeError(\n `Unable to serialize the setting with key \"${setting.key}\" as a configuration setting`,\n );\n}\n\n/**\n * @internal\n */\nexport function transformKeyValueResponseWithStatusCode<T extends KeyValue>(\n kvp: T | undefined,\n status: number | undefined,\n): ConfigurationSetting & { eTag?: string } & HttpResponseFields {\n const source = (kvp ?? {}) as T;\n const response = {\n ...transformKeyValue(source),\n statusCode: status ?? -1,\n };\n\n if (hasUnderscoreResponse(source)) {\n Object.defineProperty(response, \"_response\", {\n enumerable: false,\n value: source._response,\n });\n }\n return response;\n}\n\n/**\n * @internal\n */\nexport function transformKeyValueResponse<T extends KeyValue & { eTag?: string }>(\n kvp: T,\n): ConfigurationSetting {\n const setting = transformKeyValue(kvp);\n if (hasUnderscoreResponse(kvp)) {\n Object.defineProperty(setting, \"_response\", {\n enumerable: false,\n value: kvp._response,\n });\n }\n\n delete setting.eTag;\n return setting;\n}\n\n/**\n * @internal\n */\nexport function transformSnapshotResponse<T extends Snapshot>(snapshot: T): SnapshotResponse {\n const configSnapshot: ConfigurationSnapshot = {\n ...snapshot,\n createdOn: snapshot.createdOn ? new Date(snapshot.createdOn) : undefined,\n expiresOn: snapshot.expiresOn ? new Date(snapshot.expiresOn) : undefined,\n itemCount: snapshot.itemsCount,\n };\n if (hasUnderscoreResponse(snapshot)) {\n Object.defineProperty(configSnapshot, \"_response\", {\n enumerable: false,\n value: (snapshot as any)._response,\n });\n }\n return configSnapshot as unknown as SnapshotResponse;\n}\n\n/**\n * Converts a public-facing SnapshotInfo to the generated Snapshot type.\n * @internal\n */\nexport function snapshotInfoToGenerated(snapshot: SnapshotInfo): Snapshot {\n return {\n ...snapshot,\n compositionType: snapshot.compositionType as CompositionType,\n };\n}\n\n/**\n * Translates user-facing field names into their `select` equivalents (these can be\n * seen in the `KnownEnum5`)\n *\n * @param fieldNames - fieldNames from users.\n * @returns The field names translated into the `select` field equivalents.\n *\n * @internal\n */\nexport function formatFieldsForSelect(\n fieldNames: (keyof ConfigurationSetting)[] | undefined,\n): KeyValueFields[] | undefined {\n if (fieldNames == null) {\n return undefined;\n }\n\n const mappedFieldNames = fieldNames.map((fn) => {\n switch (fn) {\n case \"lastModified\":\n return \"last_modified\";\n case \"contentType\":\n return \"content_type\";\n case \"isReadOnly\":\n return \"locked\";\n default:\n return fn;\n }\n });\n\n return mappedFieldNames as KeyValueFields[];\n}\n\n/**\n * @internal\n */\nexport function errorMessageForUnexpectedSetting(\n key: string,\n expectedType: \"FeatureFlag\" | \"SecretReference\",\n): string {\n return `Setting with key ${key} is not a valid ${expectedType}, make sure to have the correct content-type and a valid non-null value.`;\n}\n\nexport function assertResponse<T extends object>(\n result: T,\n): asserts result is T & HttpResponseField<any> {\n if (!hasUnderscoreResponse(result)) {\n Object.defineProperty(result, \"_response\", {\n enumerable: false,\n value:\n \"Something went wrong, _response(raw response) is supposed to be part of the response. Please file a bug at https://github.com/Azure/azure-sdk-for-js\",\n });\n }\n}\n\nexport function hasUnderscoreResponse<T extends object>(\n result: T,\n): result is T & HttpResponseField<any> {\n return Object.prototype.hasOwnProperty.call(result, \"_response\");\n}\n\n/**\n * Get the scope for the App Configuration service based on the endpoint and audience.\n * If the audience is provided, it will be used as the scope.\n * If not, the scope is defaulted to Azure Public Cloud when not specified.\n *\n * @internal\n */\nexport function getScope(appConfigEndpoint: string, appConfigAudience?: string): string {\n if (appConfigAudience) {\n return `${appConfigAudience}/.default`;\n } else if (\n appConfigEndpoint.endsWith(\"azconfig.azure.us\") ||\n appConfigEndpoint.endsWith(\"appconfig.azure.us\")\n ) {\n return `${KnownAppConfigAudience.AzureGovernment}/.default`;\n } else if (\n appConfigEndpoint.endsWith(\"azconfig.azure.cn\") ||\n appConfigEndpoint.endsWith(\"appconfig.azure.cn\")\n ) {\n return `${KnownAppConfigAudience.AzureChina}/.default`;\n } else {\n return `${KnownAppConfigAudience.AzurePublicCloud}/.default`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/internal/helpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAeL,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE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,\n type ConfigurationSettingParam,\n type HttpOnlyIfChangedField,\n type HttpOnlyIfUnchangedField,\n type HttpResponseField,\n type HttpResponseFields,\n type ListRevisionsOptions,\n type ListSettingsOptions,\n type ListSnapshotsOptions,\n type ConfigurationSnapshot,\n type SnapshotResponse,\n type EtagEntity,\n type ListLabelsOptions,\n type SnapshotInfo,\n KnownAppConfigAudience,\n} from \"../models.js\";\nimport type { FeatureFlagValue } from \"../featureFlag.js\";\nimport { FeatureFlagHelper, featureFlagContentType } from \"../featureFlag.js\";\nimport type {\n GetKeyValuesOptionalParams,\n GetLabelsOptionalParams,\n GetSnapshotsOptionalParams,\n} from \"../generated/api/options.js\";\nimport type {\n KeyValue,\n ConfigurationSnapshot as Snapshot,\n KeyValueFields,\n SnapshotFields,\n CompositionType,\n SnapshotStatus,\n} from \"../generated/models/models.js\";\nimport type { SecretReferenceValue } from \"../secretReference.js\";\nimport { SecretReferenceHelper, secretReferenceContentType } from \"../secretReference.js\";\nimport type { SnapshotReferenceValue } from \"../snapshotReference.js\";\nimport { SnapshotReferenceHelper, snapshotReferenceContentType } from \"../snapshotReference.js\";\nimport { isDefined } from \"@azure/core-util\";\nimport { logger } from \"../logger.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\n\n/**\n * Options for listConfigurationSettings that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface SendConfigurationSettingsOptions\n extends OperationOptions, ListSettingsOptions, EtagEntity {\n /**\n * A filter used get configuration setting for a snapshot. Not valid when used with 'key' and 'label' filters\n */\n snapshotName?: string;\n}\n\n/**\n * Options for listLabels that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface SendLabelsRequestOptions extends ListLabelsOptions {}\n\n/**\n * Formats the etag so it can be used with a If-Match/If-None-Match header\n * @internal\n */\nexport function quoteETag(etag: string | undefined): string | undefined {\n // https://tools.ietf.org/html/rfc7232#section-3.1\n if (etag === undefined || etag === \"*\") {\n return etag;\n }\n\n if (etag.startsWith('\"') && etag.endsWith('\"')) {\n return etag;\n }\n\n if (etag.startsWith(\"'\") && etag.endsWith(\"'\")) {\n return etag;\n }\n\n return `\"${etag}\"`;\n}\n\n/**\n * Checks the onlyIfChanged/onlyIfUnchanged properties to make sure we haven't specified both\n * and throws an Error. Otherwise, returns the properties properly quoted.\n * @param options - An options object with onlyIfChanged/onlyIfUnchanged fields\n * @internal\n */\nexport function checkAndFormatIfAndIfNoneMatch(\n objectWithEtag: EtagEntity,\n options: HttpOnlyIfChangedField & HttpOnlyIfUnchangedField,\n): { ifMatch: string | undefined; ifNoneMatch: string | undefined } {\n if (options.onlyIfChanged && options.onlyIfUnchanged) {\n logger.error(\n \"onlyIfChanged and onlyIfUnchanged are both specified\",\n options.onlyIfChanged,\n options.onlyIfUnchanged,\n );\n throw new Error(\"onlyIfChanged and onlyIfUnchanged are mutually-exclusive\");\n }\n\n let ifMatch;\n let ifNoneMatch;\n\n if (options.onlyIfUnchanged) {\n ifMatch = quoteETag(objectWithEtag.etag);\n }\n\n if (options.onlyIfChanged) {\n ifNoneMatch = quoteETag(objectWithEtag.etag);\n }\n\n return {\n ifMatch: ifMatch,\n ifNoneMatch: ifNoneMatch,\n };\n}\n\n/**\n * Transforms some of the key fields in SendConfigurationSettingsOptions and ListRevisionsOptions\n * so they can be added to a request using AppConfigurationGetKeyValuesOptionalParams.\n * - `options.acceptDateTime` is converted into an ISO string\n * - `select` is populated with the proper field names from `options.fields`\n * - keyFilter and labelFilter are moved to key and label, respectively.\n *\n * @internal\n */\nexport function formatFiltersAndSelect(\n listConfigOptions: ListRevisionsOptions,\n): Pick<GetKeyValuesOptionalParams, \"key\" | \"label\" | \"select\" | \"acceptDatetime\" | \"tags\"> {\n let acceptDatetime: string | undefined = undefined;\n\n if (listConfigOptions.acceptDateTime) {\n acceptDatetime = listConfigOptions.acceptDateTime.toISOString();\n }\n return {\n key: listConfigOptions.keyFilter,\n label: listConfigOptions.labelFilter,\n // Ensure the tags are URL-encoded when encoding\n tags: listConfigOptions.tagsFilter?.map((t) => encodeURIComponent(t)),\n acceptDatetime,\n select: formatFieldsForSelect(listConfigOptions.fields),\n };\n}\n\n/**\n * Transforms some of the key fields in SendConfigurationSettingsOptions\n * so they can be added to a request using AppConfigurationGetKeyValuesOptionalParams.\n * - `options.acceptDateTime` is converted into an ISO string\n * - `select` is populated with the proper field names from `options.fields`\n * - keyFilter, labelFilter, snapshotName are moved to key, label, and snapshot respectively.\n *\n * @internal\n */\nexport function formatConfigurationSettingsFiltersAndSelect(\n listConfigOptions: SendConfigurationSettingsOptions,\n): Pick<\n GetKeyValuesOptionalParams,\n \"key\" | \"label\" | \"select\" | \"acceptDatetime\" | \"snapshot\" | \"tags\"\n> {\n const { snapshotName: snapshot, ...options } = listConfigOptions;\n return {\n ...formatFiltersAndSelect(options),\n snapshot,\n };\n}\n/**\n * Transforms some of the key fields in ListSnapshotsOptions\n * so they can be added to a request using AppConfigurationGetSnapshotsOptionalParams.\n * - `select` is populated with the proper field names from `options.fields`\n * - keyFilter and labelFilter are moved to key and label, respectively.\n *\n * @internal\n */\nexport function formatSnapshotFiltersAndSelect(\n listSnapshotOptions: ListSnapshotsOptions,\n): Pick<GetSnapshotsOptionalParams, \"name\" | \"select\" | \"status\"> {\n return {\n name: listSnapshotOptions.nameFilter,\n status: listSnapshotOptions.statusFilter as SnapshotStatus[] | undefined,\n select: listSnapshotOptions.fields as SnapshotFields[] | undefined,\n };\n}\n\n/**\n * Transforms some of the key fields in ListLabelsOptions\n * so they can be added to a request using AppConfigurationGetLabelsOptionalParams.\n * - `select` is populated with the proper field names from `options.fields`\n * - `nameFilter` are moved to name\n *\n * @internal\n */\nexport function formatLabelsFiltersAndSelect(\n listLabelsOptions: ListLabelsOptions,\n): Pick<GetLabelsOptionalParams, \"name\" | \"select\"> {\n return {\n name: listLabelsOptions.nameFilter,\n select: listLabelsOptions.fields,\n };\n}\n/**\n * Handles translating a Date acceptDateTime into a string as needed by the API\n * @param newOptions - A newer style options with acceptDateTime as a date (and with proper casing!)\n * @internal\n */\nexport function formatAcceptDateTime(newOptions: { acceptDateTime?: Date }): {\n acceptDatetime?: string;\n} {\n return {\n acceptDatetime: newOptions.acceptDateTime && newOptions.acceptDateTime.toISOString(),\n };\n}\n\n/**\n * Take the URL that gets returned from next link and extract the 'after' token needed\n * to get the next page of results.\n * @internal\n */\nexport function extractAfterTokenFromNextLink(nextLink: string): string {\n const searchParams = new URLSearchParams(nextLink);\n const afterToken = searchParams.get(\"after\");\n\n if (afterToken == null || Array.isArray(afterToken)) {\n logger.error(\"Invalid nextLink - invalid after token\", afterToken, Array.isArray(afterToken));\n throw new Error(\"Invalid nextLink - invalid after token\");\n }\n\n return decodeURIComponent(afterToken);\n}\n\n/**\n * Take the header link that gets returned from 304 response and extract the 'after' token needed\n * to get the next page of results.\n *\n * @internal\n */\nexport function extractAfterTokenFromLinkHeader(link: string): string {\n // Example transformation of the link header\n // link:\n // '</kv?api-version=2023-10-01&key=listResults714&after=bGlzdE4>; rel=\"next\"'\n //\n // linkValue:\n // </kv?api-version=2023-10-01&key=listResults714&after=bGlzdE4>\n //\n // nextLink:\n // /kv?api-version=2023-10-01&key=listResults714&after=bGlzdE4\n const linkValue = link.split(\";\")[0];\n const nextLink = linkValue.substring(1, linkValue.length - 1);\n return extractAfterTokenFromNextLink(nextLink);\n}\n\n/**\n * Makes a ConfigurationSetting-based response throw for all of the data members. Used primarily\n * to prevent possible errors by the user in accessing a model that is uninitialized. This can happen\n * in cases like HTTP status code 204 or 304, which return an empty response body.\n *\n * @param configurationSetting - The configuration setting to alter\n */\nexport function makeConfigurationSettingEmpty(\n configurationSetting: Partial<Record<Exclude<keyof ConfigurationSetting, \"key\">, any>>,\n): void {\n const names: Exclude<keyof ConfigurationSetting, \"key\">[] = [\n \"contentType\",\n \"description\",\n \"etag\",\n \"label\",\n \"lastModified\",\n \"isReadOnly\",\n \"tags\",\n \"value\",\n ];\n\n for (const name of names) {\n configurationSetting[name] = undefined;\n }\n}\n\n/**\n * @internal\n */\nexport function transformKeyValue<T>(kvp: T & KeyValue): T & ConfigurationSetting {\n const setting = {\n value: undefined,\n ...kvp,\n isReadOnly: !!kvp.locked,\n lastModified: kvp.lastModified ? new Date(kvp.lastModified) : undefined,\n };\n delete setting.locked;\n if (!setting.label) {\n delete setting.label;\n }\n if (!setting.contentType) {\n delete setting.contentType;\n }\n return setting;\n}\n\n/**\n * @internal\n */\nfunction isConfigSettingWithSecretReferenceValue(\n setting: any,\n): setting is ConfigurationSetting<SecretReferenceValue> {\n return (\n setting.contentType === secretReferenceContentType &&\n isDefined(setting.value) &&\n typeof setting.value !== \"string\"\n );\n}\n\n/**\n * @internal\n */\nfunction isConfigSettingWithSnapshotReferenceValue(\n setting: any,\n): setting is ConfigurationSetting<SnapshotReferenceValue> {\n return (\n setting.contentType === snapshotReferenceContentType &&\n isDefined(setting.value) &&\n typeof setting.value !== \"string\"\n );\n}\n\n/**\n * @internal\n */\nfunction isConfigSettingWithFeatureFlagValue(\n setting: any,\n): setting is ConfigurationSetting<FeatureFlagValue> {\n return (\n setting.contentType === featureFlagContentType &&\n isDefined(setting.value) &&\n typeof setting.value !== \"string\"\n );\n}\n\n/**\n * @internal\n */\nfunction isSimpleConfigSetting(setting: any): setting is ConfigurationSetting {\n return typeof setting.value === \"string\" || !isDefined(setting.value);\n}\n\n/**\n * @internal\n */\nexport function serializeAsConfigurationSettingParam(\n setting:\n | ConfigurationSettingParam\n | ConfigurationSettingParam<FeatureFlagValue>\n | ConfigurationSettingParam<SecretReferenceValue>\n | ConfigurationSettingParam<SnapshotReferenceValue>,\n): ConfigurationSettingParam {\n if (isSimpleConfigSetting(setting)) {\n return setting as ConfigurationSettingParam;\n }\n try {\n if (isConfigSettingWithFeatureFlagValue(setting)) {\n return FeatureFlagHelper.toConfigurationSettingParam(setting);\n }\n if (isConfigSettingWithSecretReferenceValue(setting)) {\n return SecretReferenceHelper.toConfigurationSettingParam(setting);\n }\n if (isConfigSettingWithSnapshotReferenceValue(setting)) {\n return SnapshotReferenceHelper.toConfigurationSettingParam(setting);\n }\n } catch (error: any) {\n return setting as ConfigurationSettingParam;\n }\n logger.error(\"Unable to serialize to a configuration setting\", setting);\n throw new TypeError(\n `Unable to serialize the setting with key \"${setting.key}\" as a configuration setting`,\n );\n}\n\n/**\n * @internal\n */\nexport function transformKeyValueResponseWithStatusCode<T extends KeyValue>(\n kvp: T | undefined,\n status: number | undefined,\n): ConfigurationSetting & { eTag?: string } & HttpResponseFields {\n const source = (kvp ?? {}) as T;\n const response = {\n ...transformKeyValue(source),\n statusCode: status ?? -1,\n };\n\n if (hasUnderscoreResponse(source)) {\n Object.defineProperty(response, \"_response\", {\n enumerable: false,\n value: source._response,\n });\n }\n return response;\n}\n\n/**\n * @internal\n */\nexport function transformKeyValueResponse<T extends KeyValue & { eTag?: string }>(\n kvp: T,\n): ConfigurationSetting {\n const setting = transformKeyValue(kvp);\n if (hasUnderscoreResponse(kvp)) {\n Object.defineProperty(setting, \"_response\", {\n enumerable: false,\n value: kvp._response,\n });\n }\n\n delete setting.eTag;\n return setting;\n}\n\n/**\n * @internal\n */\nexport function transformSnapshotResponse<T extends Snapshot>(snapshot: T): SnapshotResponse {\n const configSnapshot: ConfigurationSnapshot = {\n ...snapshot,\n createdOn: snapshot.createdOn ? new Date(snapshot.createdOn) : undefined,\n expiresOn: snapshot.expiresOn ? new Date(snapshot.expiresOn) : undefined,\n itemCount: snapshot.itemsCount,\n };\n if (hasUnderscoreResponse(snapshot)) {\n Object.defineProperty(configSnapshot, \"_response\", {\n enumerable: false,\n value: (snapshot as any)._response,\n });\n }\n return configSnapshot as unknown as SnapshotResponse;\n}\n\n/**\n * Converts a public-facing SnapshotInfo to the generated Snapshot type.\n * @internal\n */\nexport function snapshotInfoToGenerated(snapshot: SnapshotInfo): Snapshot {\n return {\n ...snapshot,\n compositionType: snapshot.compositionType as CompositionType,\n };\n}\n\n/**\n * Translates user-facing field names into their `select` equivalents (these can be\n * seen in the `KnownEnum5`)\n *\n * @param fieldNames - fieldNames from users.\n * @returns The field names translated into the `select` field equivalents.\n *\n * @internal\n */\nexport function formatFieldsForSelect(\n fieldNames: (keyof ConfigurationSetting)[] | undefined,\n): KeyValueFields[] | undefined {\n if (fieldNames == null) {\n return undefined;\n }\n\n const mappedFieldNames = fieldNames.map((fn) => {\n switch (fn) {\n case \"lastModified\":\n return \"last_modified\";\n case \"contentType\":\n return \"content_type\";\n case \"isReadOnly\":\n return \"locked\";\n default:\n return fn;\n }\n });\n\n return mappedFieldNames as KeyValueFields[];\n}\n\n/**\n * @internal\n */\nexport function errorMessageForUnexpectedSetting(\n key: string,\n expectedType: \"FeatureFlag\" | \"SecretReference\",\n): string {\n return `Setting with key ${key} is not a valid ${expectedType}, make sure to have the correct content-type and a valid non-null value.`;\n}\n\nexport function assertResponse<T extends object>(\n result: T,\n): asserts result is T & HttpResponseField<any> {\n if (!hasUnderscoreResponse(result)) {\n Object.defineProperty(result, \"_response\", {\n enumerable: false,\n value:\n \"Something went wrong, _response(raw response) is supposed to be part of the response. Please file a bug at https://github.com/Azure/azure-sdk-for-js\",\n });\n }\n}\n\nexport function hasUnderscoreResponse<T extends object>(\n result: T,\n): result is T & HttpResponseField<any> {\n return Object.prototype.hasOwnProperty.call(result, \"_response\");\n}\n\n/**\n * Get the scope for the App Configuration service based on the endpoint and audience.\n * If the audience is provided, it will be used as the scope.\n * If not, the scope is inferred from the endpoint.\n *\n * @internal\n */\nexport function getScope(appConfigEndpoint: string, appConfigAudience?: string): string {\n if (appConfigAudience) {\n return `${appConfigAudience}/.default`;\n }\n\n const hostname = new URL(appConfigEndpoint).hostname;\n const stagingDomain = \"appconfig-staging.azure.com\";\n if (hostname.endsWith(`.${stagingDomain}`)) {\n return `https://${stagingDomain}/.default`;\n }\n\n const labels = hostname.split(\".\");\n for (let index = labels.length - 1; index >= 0; index--) {\n const label = labels[index].toLowerCase();\n if (label === \"appconfig\" || label === \"azconfig\") {\n return `https://${labels.slice(index).join(\".\")}/.default`;\n }\n }\n\n return `${KnownAppConfigAudience.AzurePublicCloud}/.default`;\n}\n\n/**\n * Encodes a value for use as a URL path parameter according to RFC 3986.\n *\n * @internal\n */\nexport function encodePathParameter(str: string): string {\n return encodeURIComponent(str).replace(\n /[!'()*]/g,\n (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`,\n );\n}\n"]}
|
package/dist/browser/models.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CompatResponse } from "@azure/core-http-compat";
|
|
2
2
|
import type { FeatureFlagValue } from "./featureFlag.js";
|
|
3
|
-
import type { CommonClientOptions
|
|
3
|
+
import type { CommonClientOptions } from "@azure/core-client";
|
|
4
|
+
import type { OperationOptions } from "@azure-rest/core-client";
|
|
4
5
|
import type { SecretReferenceValue } from "./secretReference.js";
|
|
5
6
|
import type { SnapshotReferenceValue } from "./snapshotReference.js";
|
|
6
7
|
/**
|
|
@@ -88,9 +89,11 @@ export interface AppConfigurationClientOptions extends CommonClientOptions {
|
|
|
88
89
|
*/
|
|
89
90
|
apiVersion?: string;
|
|
90
91
|
/**
|
|
91
|
-
* The
|
|
92
|
+
* The audience to use for authentication with Microsoft Entra ID.
|
|
92
93
|
* {@link KnownAppConfigAudience} can be used interchangeably with audience.
|
|
93
|
-
* If not specified, the
|
|
94
|
+
* If not specified, the audience is inferred from the App Configuration endpoint. If the
|
|
95
|
+
* endpoint does not contain a recognizable App Configuration domain, the audience defaults to
|
|
96
|
+
* Azure Public Cloud.
|
|
94
97
|
*/
|
|
95
98
|
audience?: string;
|
|
96
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC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AE,MAAM,CAAC;IAClC,gCAAgC;IAChC,IAAI,CAAC,EAAE;QAAE,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC1C,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAclC,4EAA4E;AAC5E,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,UAAU;IACV,uCAAW,CAAA;IACX,eAAe;IACf,kDAAsB,CAAA;AACxB,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAQD,oFAAoF;AACpF,MAAM,CAAN,IAAY,gCASX;AATD,WAAY,gCAAgC;IAC1C,mBAAmB;IACnB,iEAA6B,CAAA;IAC7B,YAAY;IACZ,mDAAe,CAAA;IACf,eAAe;IACf,yDAAqB,CAAA;IACrB,aAAa;IACb,qDAAiB,CAAA;AACnB,CAAC,EATW,gCAAgC,KAAhC,gCAAgC,QAS3C;AAoED;;GAEG;AACH,MAAM,CAAN,IAAY,sBAaX;AAbD,WAAY,sBAAsB;IAChC;;OAEG;IACH,mEAAyC,CAAA;IACzC;;OAEG;IACH,wEAA8C,CAAA;IAC9C;;OAEG;IACH,0EAAgD,CAAA;AAClD,CAAC,EAbW,sBAAsB,KAAtB,sBAAsB,QAajC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,+BAOX;AAPD,WAAY,+BAA+B;IACzC,iCAAiC;IACjC,2DAAwB,CAAA;IACxB,iCAAiC;IACjC,2DAAwB,CAAA;IACxB,iCAAiC;IACjC,2DAAwB,CAAA;AAC1B,CAAC,EAPW,+BAA+B,KAA/B,+BAA+B,QAO1C","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CompatResponse } from \"@azure/core-http-compat\";\nimport type { FeatureFlagValue } from \"./featureFlag.js\";\nimport type { CommonClientOptions, OperationOptions } from \"@azure/core-client\";\nimport type { SecretReferenceValue } from \"./secretReference.js\";\nimport type { SnapshotReferenceValue } from \"./snapshotReference.js\";\n\n/**\n * Defines values for SnapshotComposition.\n * {@link KnownSnapshotComposition} can be used interchangeably with SnapshotComposition.\n */\nexport type SnapshotComposition = string;\n\n/** Known values of {@link SnapshotComposition} that the service accepts. */\nexport enum KnownSnapshotComposition {\n /** Key */\n Key = \"key\",\n /** KeyLabel */\n KeyLabel = \"key_label\",\n}\n\n/**\n * Defines values for ConfigurationSnapshotStatus.\n * {@link KnownConfigurationSnapshotStatus} can be used interchangeably with ConfigurationSnapshotStatus.\n */\nexport type ConfigurationSnapshotStatus = string;\n\n/** Known values of {@link ConfigurationSnapshotStatus} that the service accepts. */\nexport enum KnownConfigurationSnapshotStatus {\n /** Provisioning */\n Provisioning = \"provisioning\",\n /** Ready */\n Ready = \"ready\",\n /** Archived */\n Archived = \"archived\",\n /** Failed */\n Failed = \"failed\",\n}\n\n/**\n * Enables filtering of key-values. Syntax reference:\n * https://aka.ms/azconfig/docs/restapisnapshots\n */\nexport interface ConfigurationSettingsFilter {\n /** Filters key-values by their key field. */\n keyFilter: string;\n /** Filters key-values by their label field. */\n labelFilter?: string;\n /** Filters key-values by their tags field. */\n tagsFilter?: string[];\n}\n\n/** A snapshot is a named, immutable subset of an App Configuration store's key-values. */\nexport interface ConfigurationSnapshot {\n /** The name of the snapshot. */\n readonly name: string;\n /** The current status of the snapshot. */\n readonly status?: ConfigurationSnapshotStatus;\n /** A list of filters used to filter the key-values included in the snapshot. */\n filters: ConfigurationSettingsFilter[];\n /** The composition type describes how the key-values within the snapshot are composed. */\n compositionType?: SnapshotComposition;\n /** The time that the snapshot was created. */\n readonly createdOn?: Date;\n /** The time that the snapshot will expire. */\n readonly expiresOn?: Date;\n /** The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. */\n retentionPeriodInSeconds?: number;\n /** The size in bytes of the snapshot. */\n readonly sizeInBytes?: number;\n /** The amount of key-values in the snapshot. */\n readonly itemCount?: number;\n /** The tags of the snapshot. */\n tags?: { [propertyName: string]: string };\n /** The description of the snapshot. */\n description?: string;\n /** A value representing the current state of the snapshot. */\n readonly etag?: string;\n}\n\n/** Labels are used to group key-values. */\nexport interface SettingLabel {\n /** The name of the label. */\n readonly name?: string;\n}\n\n/**\n * Provides configuration options for AppConfigurationClient.\n */\nexport interface AppConfigurationClientOptions extends CommonClientOptions {\n /**\n * The API version to use when interacting with the service. The default value is `2026-04-01`.\n * {@link KnownAppConfigurationApiVersion} can be used interchangeably with apiVersion.\n * Note that overriding this default value may result in unsupported behavior.\n */\n apiVersion?: string;\n\n /**\n * The Audience to use for authentication with Azure Active Directory (AAD).\n * {@link KnownAppConfigAudience} can be used interchangeably with audience.\n * If not specified, the default audience will be set to Azure Public Cloud.\n */\n audience?: string;\n}\n\n/**\n * Known values for Azure App Configuration Audience\n */\nexport enum KnownAppConfigAudience {\n /**\n * Audience for Azure China\n */\n AzureChina = \"https://appconfig.azure.cn\",\n /**\n * Audience for Azure Government\n */\n AzureGovernment = \"https://appconfig.azure.us\",\n /**\n * Audience for Azure Public\n */\n AzurePublicCloud = \"https://appconfig.azure.com\",\n}\n\n/**\n * Known service API versions supported by AppConfigurationClient.\n */\nexport enum KnownAppConfigurationApiVersion {\n /** The 2023-11-01 API version */\n V20231101 = \"2023-11-01\",\n /** The 2024-09-01 API version */\n V20240901 = \"2024-09-01\",\n /** The 2026-04-01 API version */\n V20260401 = \"2026-04-01\",\n}\n\n/**\n * Fields that uniquely identify a configuration setting\n */\nexport interface ConfigurationSettingId {\n /**\n * The etag for this setting\n */\n etag?: string;\n /**\n * The key for this setting.\n * Feature flags must be prefixed with `.appconfig.featureflag/<feature-flag-name>`.\n */\n key: string;\n\n /**\n * The label for this setting. Leaving this undefined means this\n * setting does not have a label.\n */\n label?: string;\n}\n/**\n * Necessary fields for updating or creating a new configuration setting\n */\nexport type ConfigurationSettingParam<\n T extends string | FeatureFlagValue | SecretReferenceValue | SnapshotReferenceValue = string,\n> = ConfigurationSettingId & {\n /**\n * The content type of the setting's value\n */\n contentType?: string;\n\n /**\n * Tags for this key\n */\n tags?: { [propertyName: string]: string };\n\n /**\n * The description of the setting.\n */\n description?: string;\n} & (T extends string\n ? {\n /**\n * The setting's value\n */\n value?: string;\n }\n : {\n /**\n * The setting's value\n */\n value: T;\n });\n\n/**\n * Configuration setting with extra metadata from the server, indicating\n * its etag, whether it is currently readOnly and when it was last modified.\n */\nexport type ConfigurationSetting<\n T extends string | FeatureFlagValue | SecretReferenceValue | SnapshotReferenceValue = string,\n> = ConfigurationSettingParam<T> & {\n /**\n * Whether or not the setting is read-only\n */\n isReadOnly: boolean;\n\n /**\n * The date when this setting was last modified\n */\n lastModified?: Date;\n};\n\n/**\n * Fields that are hoisted up from the _response field of the object\n * Used in cases where individual HTTP response fields are important for\n * the user to use in common-use cases like handling http status codes 204 or 304.\n */\nexport interface HttpResponseFields {\n /**\n * The HTTP status code for the response\n */\n statusCode: number;\n}\n/**\n * HTTP response related information - headers and raw body.\n */\nexport interface HttpResponseField<HeadersT> {\n /**\n * The underlying HTTP response.\n */\n _response: CompatResponse & {\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: HeadersT;\n\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n };\n}\n/**\n * Parameters for adding a new configuration setting\n */\nexport type AddConfigurationSettingParam<\n T extends string | FeatureFlagValue | SecretReferenceValue | SnapshotReferenceValue = string,\n> = ConfigurationSettingParam<T>;\n\n/**\n * Parameters for creating or updating a new configuration setting\n */\nexport type SetConfigurationSettingParam<\n T extends string | FeatureFlagValue | SecretReferenceValue | SnapshotReferenceValue = string,\n> = ConfigurationSettingParam<T>;\n\n/**\n * Standard base response for getting, deleting or updating a configuration setting\n */\nexport type ConfigurationSettingResponse<HeadersT> = ConfigurationSetting &\n HttpResponseField<HeadersT> &\n Pick<HeadersT, Exclude<keyof HeadersT, \"eTag\">>;\n\n/**\n * Options used to provide if-none-match for an HTTP request\n */\nexport interface HttpOnlyIfChangedField {\n /**\n * Used to perform an operation only if the targeted resource's etag does not match the value\n * provided.\n */\n onlyIfChanged?: boolean;\n}\n\n/**\n * Options used to provide if-match for an HTTP request\n */\nexport interface HttpOnlyIfUnchangedField {\n /**\n * Used to perform an operation only if the targeted resource's etag matches the value provided.\n */\n onlyIfUnchanged?: boolean;\n}\n\n/**\n * Used when the API supports selectively returning fields.\n */\nexport interface OptionalFields {\n /**\n * Which fields to return for each ConfigurationSetting\n */\n fields?: (keyof ConfigurationSetting)[];\n}\n\n/**\n * Used when the API supports selectively returning fields.\n */\nexport interface OptionalSnapshotFields {\n /**\n * Which fields to return for each ConfigurationSetting\n */\n fields?: (keyof ConfigurationSnapshot)[];\n}\n\n/**\n * Used when the API supports selectively returning labels fields.\n */\nexport interface OptionalLabelsFields {\n /**\n * Which fields to return for each ConfigurationSetting\n */\n fields?: (keyof SettingLabel)[];\n}\n/**\n * Sync token header field\n */\nexport interface SyncTokenHeaderField {\n /**\n * Enables real-time consistency between requests by providing the returned value in the next\n * request made to the server.\n */\n syncToken?: string;\n}\n\n/**\n * Options used when adding a ConfigurationSetting.\n */\nexport interface AddConfigurationSettingOptions extends OperationOptions {}\n\n/**\n * Response from adding a ConfigurationSetting.\n */\nexport interface AddConfigurationSettingResponse\n extends ConfigurationSetting, SyncTokenHeaderField, HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Response from deleting a ConfigurationSetting.\n */\nexport interface DeleteConfigurationSettingResponse\n extends SyncTokenHeaderField, HttpResponseFields, HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Options for deleting a ConfigurationSetting.\n */\nexport interface DeleteConfigurationSettingOptions\n extends HttpOnlyIfUnchangedField, OperationOptions {}\n\n/**\n * Options used when saving a ConfigurationSetting.\n */\nexport interface SetConfigurationSettingOptions\n extends HttpOnlyIfUnchangedField, OperationOptions {}\n\n/**\n * Response from setting a ConfigurationSetting.\n */\nexport interface SetConfigurationSettingResponse\n extends ConfigurationSetting, SyncTokenHeaderField, HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Headers from getting a ConfigurationSetting.\n */\nexport interface GetConfigurationHeaders extends SyncTokenHeaderField {}\n\n/**\n * Response from retrieving a ConfigurationSetting.\n */\nexport interface GetConfigurationSettingResponse\n extends\n ConfigurationSetting,\n GetConfigurationHeaders,\n HttpResponseFields,\n HttpResponseField<GetConfigurationHeaders> {}\n\n/**\n * Options for getting a ConfigurationSetting.\n */\nexport interface GetConfigurationSettingOptions\n extends OperationOptions, HttpOnlyIfChangedField, OptionalFields {\n /**\n * Requests the server to respond with the state of the resource at the specified time.\n */\n acceptDateTime?: Date;\n}\n\n/**\n * Common options for 'list' style APIs in AppConfig used to specify wildcards as well as\n * the accept date time header.\n */\nexport interface ListSettingsOptions extends OptionalFields {\n /**\n * Requests the server to respond with the state of the resource at the specified time.\n */\n acceptDateTime?: Date;\n\n /**\n * Filters for keys. There are two types of matching:\n *\n * 1. Exact matching. Up to 5 key names are allowed, separated by commas (',')\n * 2. Wildcard matching. A single wildcard expression can be specified.\n *\n * | Value | Matches |\n * |--------------|---------------------------------------|\n * | omitted or * | Matches any key |\n * | abc | Matches a key named abc |\n * | abc* | Matches key names that start with abc |\n *\n * These characters are reserved and must be prefixed with backslash in order\n * to be specified: * or \\\\ or ,\n */\n keyFilter?: string;\n\n /* eslint-disable tsdoc/syntax */\n /**\n * Filters for labels. There are two types of matching:\n *\n * 1. Exact matching. Up to 5 labels are allowed, separated by commas (',')\n * 2. Wildcard matching. A single wildcard expression can be specified.\n *\n * | Value | Matches |\n * |--------------|------------------------------------------------------|\n * | omitted or * | Matches any key |\n * | \\0 | Matches any key without a label (URL encoded as %00) |\n * | prod | Matches a key with label named prod |\n * | prod* | Matches key with label names that start with prod |\n * These characters are reserved and must be prefixed with backslash in order\n * to be specified: * or \\\\ or ,\n *\n * Reference: https://learn.microsoft.com/azure/azure-app-configuration/rest-api-key-value\n */\n labelFilter?: string;\n\n /** A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering */\n tagsFilter?: string[];\n}\n\n/**\n * Common options for 'list' style APIs in AppConfig used to specify wildcards as well as\n * the accept date time header.\n */\nexport interface ListConfigurationSettingsForSnapshotOptions\n extends OperationOptions, OptionalFields {}\n\n/**\n * Options for listConfigurationSettings that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface ListConfigurationSettingsOptions extends OperationOptions, ListSettingsOptions {\n /**\n * Etags list for page\n */\n pageEtags?: string[];\n}\n\n/**\n * Options for checkConfigurationSettings that allow for filtering based on keys, labels and other fields.\n */\nexport interface CheckConfigurationSettingsOptions extends OperationOptions, ListSettingsOptions {\n /**\n * Etags list for page\n */\n pageEtags?: string[];\n}\n\n/**\n * Options for listLabels\n */\nexport interface ListLabelsOptions extends OperationOptions, OptionalLabelsFields {\n /** A filter for the name of the returned labels. */\n nameFilter?: string;\n\n /**\n * Requests the server to respond with the state of the resource at the specified time.\n */\n acceptDateTime?: Date;\n}\n\n/**\n * Common options for 'list' style APIs in AppConfig used to specify wildcards as well as\n * the accept date time header.\n */\nexport interface ListSnapshots extends OptionalSnapshotFields {\n /** A filter for the name of the returned snapshots. */\n nameFilter?: string;\n\n /** Used to filter returned snapshots by their status property. */\n statusFilter?: ConfigurationSnapshotStatus[];\n}\n\n/**\n * Options for listConfigurationSettings that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface ListSnapshotsOptions\n extends OperationOptions, ListSnapshots, OptionalSnapshotFields {}\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n // The appconfig service doesn't currently support letting you select a page size\n // so we're ignoring their setting for now.\n}\n\n/**\n * Entity with etag.\n */\nexport interface EtagEntity {\n /**\n * The etag for this entity\n */\n etag?: string;\n}\n\n/**\n * A page of configuration settings and the corresponding HTTP response\n */\nexport interface ListConfigurationSettingPage\n extends HttpResponseField<SyncTokenHeaderField>, PageSettings, EtagEntity {\n /**\n * The configuration settings for this page of results.\n */\n items: ConfigurationSetting[];\n}\n\n/**\n * A page of configuration settings and the corresponding HTTP response\n */\nexport interface ListLabelsPage\n extends HttpResponseField<SyncTokenHeaderField>, PageSettings, EtagEntity {\n /**\n * The collection of labels\n */\n items: SettingLabel[];\n}\n\n/**\n * A page of configuration settings and the corresponding HTTP response\n */\nexport interface ListSnapshotsPage extends SyncTokenHeaderField, PageSettings {\n /**\n * The configuration settings for this page of results.\n */\n items: ConfigurationSnapshot[];\n}\n\n/**\n * Options for listRevisions that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface ListRevisionsOptions extends OperationOptions, ListSettingsOptions {}\n\n/**\n * A page of configuration settings and the corresponding HTTP response\n */\nexport interface ListRevisionsPage extends HttpResponseField<SyncTokenHeaderField>, PageSettings {\n /**\n * The configuration settings for this page of results.\n */\n items: ConfigurationSetting[];\n}\n\n/**\n * Options for setReadOnly\n */\nexport interface SetReadOnlyOptions extends HttpOnlyIfUnchangedField, OperationOptions {}\n\n/**\n * Response when setting a value to read-only.\n */\nexport interface SetReadOnlyResponse\n extends ConfigurationSetting, SyncTokenHeaderField, HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Options that control how to retry failed requests.\n */\nexport interface RetryOptions {\n /**\n * The maximum number of retry attempts. Defaults to 3.\n */\n maxRetries?: number;\n\n /**\n * The maximum delay in milliseconds allowed before retrying an operation.\n */\n maxRetryDelayInMs?: number;\n}\n\n/**\n * Options used when creating a Snapshot.\n */\nexport interface CreateSnapshotOptions extends OperationOptions {\n /**\n * The amount of time to wait (in milliseconds) between subsequent requests relating to the same operation.\n */\n updateIntervalInMs?: number;\n}\n\n/**\n * Response from adding a Snapshot.\n */\nexport interface SnapshotResponse extends ConfigurationSnapshot, SyncTokenHeaderField {}\n\n/**\n * Options used when getting a Snapshot.\n */\nexport interface GetSnapshotOptions extends OperationOptions, OptionalSnapshotFields {}\n\n/**\n * Response from getting a Snapshot.\n */\nexport interface GetSnapshotResponse extends SnapshotResponse {}\n\n/**\n * Options used when updating a Snapshot.\n */\nexport interface UpdateSnapshotOptions extends OperationOptions {\n /**\n * The etag for this snapshot\n */\n etag?: string;\n}\n\n/**\n * Response from updating a Snapshot.\n */\nexport interface UpdateSnapshotResponse extends SnapshotResponse {}\n/**\n * Response from updating a Snapshot.\n */\nexport interface CreateSnapshotResponse extends SnapshotResponse {}\n\n/**\n * Fields that uniquely identify a snapshot\n */\nexport interface SnapshotInfo {\n /** The name for this snapshot */\n name: string;\n /** A list of filters used to filter the key-values included in the snapshot. */\n filters: ConfigurationSettingsFilter[];\n /** The composition type describes how the key-values within the snapshot are composed. The 'all' composition type includes all key-values. The 'group_by_key' composition type ensures there are no two key-values containing the same key. */\n compositionType?: SnapshotComposition;\n /** The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. This property is only writable during the creation of a snapshot. If not specified, the default lifetime of key-value revisions will be used. */\n retentionPeriodInSeconds?: number;\n /** The tags of the snapshot. */\n tags?: { [propertyName: string]: string };\n /** The description of the snapshot. */\n description?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAelC,4EAA4E;AAC5E,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,UAAU;IACV,uCAAW,CAAA;IACX,eAAe;IACf,kDAAsB,CAAA;AACxB,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAQD,oFAAoF;AACpF,MAAM,CAAN,IAAY,gCASX;AATD,WAAY,gCAAgC;IAC1C,mBAAmB;IACnB,iEAA6B,CAAA;IAC7B,YAAY;IACZ,mDAAe,CAAA;IACf,eAAe;IACf,yDAAqB,CAAA;IACrB,aAAa;IACb,qDAAiB,CAAA;AACnB,CAAC,EATW,gCAAgC,KAAhC,gCAAgC,QAS3C;AAsED;;GAEG;AACH,MAAM,CAAN,IAAY,sBAaX;AAbD,WAAY,sBAAsB;IAChC;;OAEG;IACH,mEAAyC,CAAA;IACzC;;OAEG;IACH,wEAA8C,CAAA;IAC9C;;OAEG;IACH,0EAAgD,CAAA;AAClD,CAAC,EAbW,sBAAsB,KAAtB,sBAAsB,QAajC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,+BAOX;AAPD,WAAY,+BAA+B;IACzC,iCAAiC;IACjC,2DAAwB,CAAA;IACxB,iCAAiC;IACjC,2DAAwB,CAAA;IACxB,iCAAiC;IACjC,2DAAwB,CAAA;AAC1B,CAAC,EAPW,+BAA+B,KAA/B,+BAA+B,QAO1C","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CompatResponse } from \"@azure/core-http-compat\";\nimport type { FeatureFlagValue } from \"./featureFlag.js\";\nimport type { CommonClientOptions } from \"@azure/core-client\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { SecretReferenceValue } from \"./secretReference.js\";\nimport type { SnapshotReferenceValue } from \"./snapshotReference.js\";\n\n/**\n * Defines values for SnapshotComposition.\n * {@link KnownSnapshotComposition} can be used interchangeably with SnapshotComposition.\n */\nexport type SnapshotComposition = string;\n\n/** Known values of {@link SnapshotComposition} that the service accepts. */\nexport enum KnownSnapshotComposition {\n /** Key */\n Key = \"key\",\n /** KeyLabel */\n KeyLabel = \"key_label\",\n}\n\n/**\n * Defines values for ConfigurationSnapshotStatus.\n * {@link KnownConfigurationSnapshotStatus} can be used interchangeably with ConfigurationSnapshotStatus.\n */\nexport type ConfigurationSnapshotStatus = string;\n\n/** Known values of {@link ConfigurationSnapshotStatus} that the service accepts. */\nexport enum KnownConfigurationSnapshotStatus {\n /** Provisioning */\n Provisioning = \"provisioning\",\n /** Ready */\n Ready = \"ready\",\n /** Archived */\n Archived = \"archived\",\n /** Failed */\n Failed = \"failed\",\n}\n\n/**\n * Enables filtering of key-values. Syntax reference:\n * https://aka.ms/azconfig/docs/restapisnapshots\n */\nexport interface ConfigurationSettingsFilter {\n /** Filters key-values by their key field. */\n keyFilter: string;\n /** Filters key-values by their label field. */\n labelFilter?: string;\n /** Filters key-values by their tags field. */\n tagsFilter?: string[];\n}\n\n/** A snapshot is a named, immutable subset of an App Configuration store's key-values. */\nexport interface ConfigurationSnapshot {\n /** The name of the snapshot. */\n readonly name: string;\n /** The current status of the snapshot. */\n readonly status?: ConfigurationSnapshotStatus;\n /** A list of filters used to filter the key-values included in the snapshot. */\n filters: ConfigurationSettingsFilter[];\n /** The composition type describes how the key-values within the snapshot are composed. */\n compositionType?: SnapshotComposition;\n /** The time that the snapshot was created. */\n readonly createdOn?: Date;\n /** The time that the snapshot will expire. */\n readonly expiresOn?: Date;\n /** The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. */\n retentionPeriodInSeconds?: number;\n /** The size in bytes of the snapshot. */\n readonly sizeInBytes?: number;\n /** The amount of key-values in the snapshot. */\n readonly itemCount?: number;\n /** The tags of the snapshot. */\n tags?: { [propertyName: string]: string };\n /** The description of the snapshot. */\n description?: string;\n /** A value representing the current state of the snapshot. */\n readonly etag?: string;\n}\n\n/** Labels are used to group key-values. */\nexport interface SettingLabel {\n /** The name of the label. */\n readonly name?: string;\n}\n\n/**\n * Provides configuration options for AppConfigurationClient.\n */\nexport interface AppConfigurationClientOptions extends CommonClientOptions {\n /**\n * The API version to use when interacting with the service. The default value is `2026-04-01`.\n * {@link KnownAppConfigurationApiVersion} can be used interchangeably with apiVersion.\n * Note that overriding this default value may result in unsupported behavior.\n */\n apiVersion?: string;\n\n /**\n * The audience to use for authentication with Microsoft Entra ID.\n * {@link KnownAppConfigAudience} can be used interchangeably with audience.\n * If not specified, the audience is inferred from the App Configuration endpoint. If the\n * endpoint does not contain a recognizable App Configuration domain, the audience defaults to\n * Azure Public Cloud.\n */\n audience?: string;\n}\n\n/**\n * Known values for Azure App Configuration Audience\n */\nexport enum KnownAppConfigAudience {\n /**\n * Audience for Azure China\n */\n AzureChina = \"https://appconfig.azure.cn\",\n /**\n * Audience for Azure Government\n */\n AzureGovernment = \"https://appconfig.azure.us\",\n /**\n * Audience for Azure Public\n */\n AzurePublicCloud = \"https://appconfig.azure.com\",\n}\n\n/**\n * Known service API versions supported by AppConfigurationClient.\n */\nexport enum KnownAppConfigurationApiVersion {\n /** The 2023-11-01 API version */\n V20231101 = \"2023-11-01\",\n /** The 2024-09-01 API version */\n V20240901 = \"2024-09-01\",\n /** The 2026-04-01 API version */\n V20260401 = \"2026-04-01\",\n}\n\n/**\n * Fields that uniquely identify a configuration setting\n */\nexport interface ConfigurationSettingId {\n /**\n * The etag for this setting\n */\n etag?: string;\n /**\n * The key for this setting.\n * Feature flags must be prefixed with `.appconfig.featureflag/<feature-flag-name>`.\n */\n key: string;\n\n /**\n * The label for this setting. Leaving this undefined means this\n * setting does not have a label.\n */\n label?: string;\n}\n/**\n * Necessary fields for updating or creating a new configuration setting\n */\nexport type ConfigurationSettingParam<\n T extends string | FeatureFlagValue | SecretReferenceValue | SnapshotReferenceValue = string,\n> = ConfigurationSettingId & {\n /**\n * The content type of the setting's value\n */\n contentType?: string;\n\n /**\n * Tags for this key\n */\n tags?: { [propertyName: string]: string };\n\n /**\n * The description of the setting.\n */\n description?: string;\n} & (T extends string\n ? {\n /**\n * The setting's value\n */\n value?: string;\n }\n : {\n /**\n * The setting's value\n */\n value: T;\n });\n\n/**\n * Configuration setting with extra metadata from the server, indicating\n * its etag, whether it is currently readOnly and when it was last modified.\n */\nexport type ConfigurationSetting<\n T extends string | FeatureFlagValue | SecretReferenceValue | SnapshotReferenceValue = string,\n> = ConfigurationSettingParam<T> & {\n /**\n * Whether or not the setting is read-only\n */\n isReadOnly: boolean;\n\n /**\n * The date when this setting was last modified\n */\n lastModified?: Date;\n};\n\n/**\n * Fields that are hoisted up from the _response field of the object\n * Used in cases where individual HTTP response fields are important for\n * the user to use in common-use cases like handling http status codes 204 or 304.\n */\nexport interface HttpResponseFields {\n /**\n * The HTTP status code for the response\n */\n statusCode: number;\n}\n/**\n * HTTP response related information - headers and raw body.\n */\nexport interface HttpResponseField<HeadersT> {\n /**\n * The underlying HTTP response.\n */\n _response: CompatResponse & {\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: HeadersT;\n\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n };\n}\n/**\n * Parameters for adding a new configuration setting\n */\nexport type AddConfigurationSettingParam<\n T extends string | FeatureFlagValue | SecretReferenceValue | SnapshotReferenceValue = string,\n> = ConfigurationSettingParam<T>;\n\n/**\n * Parameters for creating or updating a new configuration setting\n */\nexport type SetConfigurationSettingParam<\n T extends string | FeatureFlagValue | SecretReferenceValue | SnapshotReferenceValue = string,\n> = ConfigurationSettingParam<T>;\n\n/**\n * Standard base response for getting, deleting or updating a configuration setting\n */\nexport type ConfigurationSettingResponse<HeadersT> = ConfigurationSetting &\n HttpResponseField<HeadersT> &\n Pick<HeadersT, Exclude<keyof HeadersT, \"eTag\">>;\n\n/**\n * Options used to provide if-none-match for an HTTP request\n */\nexport interface HttpOnlyIfChangedField {\n /**\n * Used to perform an operation only if the targeted resource's etag does not match the value\n * provided.\n */\n onlyIfChanged?: boolean;\n}\n\n/**\n * Options used to provide if-match for an HTTP request\n */\nexport interface HttpOnlyIfUnchangedField {\n /**\n * Used to perform an operation only if the targeted resource's etag matches the value provided.\n */\n onlyIfUnchanged?: boolean;\n}\n\n/**\n * Used when the API supports selectively returning fields.\n */\nexport interface OptionalFields {\n /**\n * Which fields to return for each ConfigurationSetting\n */\n fields?: (keyof ConfigurationSetting)[];\n}\n\n/**\n * Used when the API supports selectively returning fields.\n */\nexport interface OptionalSnapshotFields {\n /**\n * Which fields to return for each ConfigurationSetting\n */\n fields?: (keyof ConfigurationSnapshot)[];\n}\n\n/**\n * Used when the API supports selectively returning labels fields.\n */\nexport interface OptionalLabelsFields {\n /**\n * Which fields to return for each ConfigurationSetting\n */\n fields?: (keyof SettingLabel)[];\n}\n/**\n * Sync token header field\n */\nexport interface SyncTokenHeaderField {\n /**\n * Enables real-time consistency between requests by providing the returned value in the next\n * request made to the server.\n */\n syncToken?: string;\n}\n\n/**\n * Options used when adding a ConfigurationSetting.\n */\nexport interface AddConfigurationSettingOptions extends OperationOptions {}\n\n/**\n * Response from adding a ConfigurationSetting.\n */\nexport interface AddConfigurationSettingResponse\n extends ConfigurationSetting, SyncTokenHeaderField, HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Response from deleting a ConfigurationSetting.\n */\nexport interface DeleteConfigurationSettingResponse\n extends SyncTokenHeaderField, HttpResponseFields, HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Options for deleting a ConfigurationSetting.\n */\nexport interface DeleteConfigurationSettingOptions\n extends HttpOnlyIfUnchangedField, OperationOptions {}\n\n/**\n * Options used when saving a ConfigurationSetting.\n */\nexport interface SetConfigurationSettingOptions\n extends HttpOnlyIfUnchangedField, OperationOptions {}\n\n/**\n * Response from setting a ConfigurationSetting.\n */\nexport interface SetConfigurationSettingResponse\n extends ConfigurationSetting, SyncTokenHeaderField, HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Headers from getting a ConfigurationSetting.\n */\nexport interface GetConfigurationHeaders extends SyncTokenHeaderField {}\n\n/**\n * Response from retrieving a ConfigurationSetting.\n */\nexport interface GetConfigurationSettingResponse\n extends\n ConfigurationSetting,\n GetConfigurationHeaders,\n HttpResponseFields,\n HttpResponseField<GetConfigurationHeaders> {}\n\n/**\n * Options for getting a ConfigurationSetting.\n */\nexport interface GetConfigurationSettingOptions\n extends OperationOptions, HttpOnlyIfChangedField, OptionalFields {\n /**\n * Requests the server to respond with the state of the resource at the specified time.\n */\n acceptDateTime?: Date;\n}\n\n/**\n * Common options for 'list' style APIs in AppConfig used to specify wildcards as well as\n * the accept date time header.\n */\nexport interface ListSettingsOptions extends OptionalFields {\n /**\n * Requests the server to respond with the state of the resource at the specified time.\n */\n acceptDateTime?: Date;\n\n /**\n * Filters for keys. There are two types of matching:\n *\n * 1. Exact matching. Up to 5 key names are allowed, separated by commas (',')\n * 2. Wildcard matching. A single wildcard expression can be specified.\n *\n * | Value | Matches |\n * |--------------|---------------------------------------|\n * | omitted or * | Matches any key |\n * | abc | Matches a key named abc |\n * | abc* | Matches key names that start with abc |\n *\n * These characters are reserved and must be prefixed with backslash in order\n * to be specified: * or \\\\ or ,\n */\n keyFilter?: string;\n\n /* eslint-disable tsdoc/syntax */\n /**\n * Filters for labels. There are two types of matching:\n *\n * 1. Exact matching. Up to 5 labels are allowed, separated by commas (',')\n * 2. Wildcard matching. A single wildcard expression can be specified.\n *\n * | Value | Matches |\n * |--------------|------------------------------------------------------|\n * | omitted or * | Matches any key |\n * | \\0 | Matches any key without a label (URL encoded as %00) |\n * | prod | Matches a key with label named prod |\n * | prod* | Matches key with label names that start with prod |\n * These characters are reserved and must be prefixed with backslash in order\n * to be specified: * or \\\\ or ,\n *\n * Reference: https://learn.microsoft.com/azure/azure-app-configuration/rest-api-key-value\n */\n labelFilter?: string;\n\n /** A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering */\n tagsFilter?: string[];\n}\n\n/**\n * Common options for 'list' style APIs in AppConfig used to specify wildcards as well as\n * the accept date time header.\n */\nexport interface ListConfigurationSettingsForSnapshotOptions\n extends OperationOptions, OptionalFields {}\n\n/**\n * Options for listConfigurationSettings that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface ListConfigurationSettingsOptions extends OperationOptions, ListSettingsOptions {\n /**\n * Etags list for page\n */\n pageEtags?: string[];\n}\n\n/**\n * Options for checkConfigurationSettings that allow for filtering based on keys, labels and other fields.\n */\nexport interface CheckConfigurationSettingsOptions extends OperationOptions, ListSettingsOptions {\n /**\n * Etags list for page\n */\n pageEtags?: string[];\n}\n\n/**\n * Options for listLabels\n */\nexport interface ListLabelsOptions extends OperationOptions, OptionalLabelsFields {\n /** A filter for the name of the returned labels. */\n nameFilter?: string;\n\n /**\n * Requests the server to respond with the state of the resource at the specified time.\n */\n acceptDateTime?: Date;\n}\n\n/**\n * Common options for 'list' style APIs in AppConfig used to specify wildcards as well as\n * the accept date time header.\n */\nexport interface ListSnapshots extends OptionalSnapshotFields {\n /** A filter for the name of the returned snapshots. */\n nameFilter?: string;\n\n /** Used to filter returned snapshots by their status property. */\n statusFilter?: ConfigurationSnapshotStatus[];\n}\n\n/**\n * Options for listConfigurationSettings that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface ListSnapshotsOptions\n extends OperationOptions, ListSnapshots, OptionalSnapshotFields {}\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n // The appconfig service doesn't currently support letting you select a page size\n // so we're ignoring their setting for now.\n}\n\n/**\n * Entity with etag.\n */\nexport interface EtagEntity {\n /**\n * The etag for this entity\n */\n etag?: string;\n}\n\n/**\n * A page of configuration settings and the corresponding HTTP response\n */\nexport interface ListConfigurationSettingPage\n extends HttpResponseField<SyncTokenHeaderField>, PageSettings, EtagEntity {\n /**\n * The configuration settings for this page of results.\n */\n items: ConfigurationSetting[];\n}\n\n/**\n * A page of configuration settings and the corresponding HTTP response\n */\nexport interface ListLabelsPage\n extends HttpResponseField<SyncTokenHeaderField>, PageSettings, EtagEntity {\n /**\n * The collection of labels\n */\n items: SettingLabel[];\n}\n\n/**\n * A page of configuration settings and the corresponding HTTP response\n */\nexport interface ListSnapshotsPage extends SyncTokenHeaderField, PageSettings {\n /**\n * The configuration settings for this page of results.\n */\n items: ConfigurationSnapshot[];\n}\n\n/**\n * Options for listRevisions that allow for filtering based on keys, labels and other fields.\n * Also provides `fields` which allows you to selectively choose which fields are populated in the\n * result.\n */\nexport interface ListRevisionsOptions extends OperationOptions, ListSettingsOptions {}\n\n/**\n * A page of configuration settings and the corresponding HTTP response\n */\nexport interface ListRevisionsPage extends HttpResponseField<SyncTokenHeaderField>, PageSettings {\n /**\n * The configuration settings for this page of results.\n */\n items: ConfigurationSetting[];\n}\n\n/**\n * Options for setReadOnly\n */\nexport interface SetReadOnlyOptions extends HttpOnlyIfUnchangedField, OperationOptions {}\n\n/**\n * Response when setting a value to read-only.\n */\nexport interface SetReadOnlyResponse\n extends ConfigurationSetting, SyncTokenHeaderField, HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Options that control how to retry failed requests.\n */\nexport interface RetryOptions {\n /**\n * The maximum number of retry attempts. Defaults to 3.\n */\n maxRetries?: number;\n\n /**\n * The maximum delay in milliseconds allowed before retrying an operation.\n */\n maxRetryDelayInMs?: number;\n}\n\n/**\n * Options used when creating a Snapshot.\n */\nexport interface CreateSnapshotOptions extends OperationOptions {\n /**\n * The amount of time to wait (in milliseconds) between subsequent requests relating to the same operation.\n */\n updateIntervalInMs?: number;\n}\n\n/**\n * Response from adding a Snapshot.\n */\nexport interface SnapshotResponse extends ConfigurationSnapshot, SyncTokenHeaderField {}\n\n/**\n * Options used when getting a Snapshot.\n */\nexport interface GetSnapshotOptions extends OperationOptions, OptionalSnapshotFields {}\n\n/**\n * Response from getting a Snapshot.\n */\nexport interface GetSnapshotResponse extends SnapshotResponse {}\n\n/**\n * Options used when updating a Snapshot.\n */\nexport interface UpdateSnapshotOptions extends OperationOptions {\n /**\n * The etag for this snapshot\n */\n etag?: string;\n}\n\n/**\n * Response from updating a Snapshot.\n */\nexport interface UpdateSnapshotResponse extends SnapshotResponse {}\n/**\n * Response from updating a Snapshot.\n */\nexport interface CreateSnapshotResponse extends SnapshotResponse {}\n\n/**\n * Fields that uniquely identify a snapshot\n */\nexport interface SnapshotInfo {\n /** The name for this snapshot */\n name: string;\n /** A list of filters used to filter the key-values included in the snapshot. */\n filters: ConfigurationSettingsFilter[];\n /** The composition type describes how the key-values within the snapshot are composed. The 'all' composition type includes all key-values. The 'group_by_key' composition type ensures there are no two key-values containing the same key. */\n compositionType?: SnapshotComposition;\n /** The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. This property is only writable during the creation of a snapshot. If not specified, the default lifetime of key-value revisions will be used. */\n retentionPeriodInSeconds?: number;\n /** The tags of the snapshot. */\n tags?: { [propertyName: string]: string };\n /** The description of the snapshot. */\n description?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appConfigurationClient.d.ts","sourceRoot":"","sources":["../../src/appConfigurationClient.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,iCAAiC,EACtC,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EACvC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,2CAA2C,EAChD,KAAK,gCAAgC,EACrC,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,0BAA0B,EAAe,MAAM,oBAAoB,CAAC;AAKlF,OAAO,EAAE,UAAU,EAAmB,MAAM,+BAA+B,CAAC;AAG5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"appConfigurationClient.d.ts","sourceRoot":"","sources":["../../src/appConfigurationClient.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,iCAAiC,EACtC,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EACvC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,2CAA2C,EAChD,KAAK,gCAAgC,EACrC,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,0BAA0B,EAAe,MAAM,oBAAoB,CAAC;AAKlF,OAAO,EAAE,UAAU,EAAmB,MAAM,+BAA+B,CAAC;AAG5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAoDxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,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AAE,sBAAsB,CAAC,CAAC;IAsC5F;;;OAGG;IACH,0BAA0B,CACxB,QAAQ,EAAE,YAAY,EAEtB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC;IAsClC;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAoBzF;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CACb,IAAI,EAAE,MAAM,EAEZ,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC;IA4BlC;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CACb,IAAI,EAAE,MAAM,EAEZ,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC;IA6BlC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,aAAa,CACX,OAAO,GAAE,oBAAyB,GACjC,0BAA0B,CAAC,qBAAqB,EAAE,iBAAiB,EAAE,YAAY,CAAC;YAuBvE,oBAAoB;CAsBnC"}
|
|
@@ -41,7 +41,7 @@ class AppConfigurationClient {
|
|
|
41
41
|
client;
|
|
42
42
|
_syncTokens;
|
|
43
43
|
constructor(connectionStringOrEndpoint, tokenCredentialOrOptions, options) {
|
|
44
|
-
let appConfigOptions
|
|
44
|
+
let appConfigOptions;
|
|
45
45
|
let appConfigCredential = void 0;
|
|
46
46
|
let appConfigEndpoint;
|
|
47
47
|
let authPolicy;
|
|
@@ -70,7 +70,7 @@ class AppConfigurationClient {
|
|
|
70
70
|
...appConfigOptions,
|
|
71
71
|
userAgentOptions: {
|
|
72
72
|
...appConfigOptions.userAgentOptions,
|
|
73
|
-
userAgentPrefix:
|
|
73
|
+
userAgentPrefix: appConfigOptions.userAgentOptions?.userAgentPrefix ? `${appConfigOptions.userAgentOptions.userAgentPrefix} azsdk-js-app-configuration/${import_constants.packageVersion}` : `azsdk-js-app-configuration/${import_constants.packageVersion}`
|
|
74
74
|
},
|
|
75
75
|
loggingOptions: {
|
|
76
76
|
logger: import_logger.logger.info
|
|
@@ -139,7 +139,7 @@ class AppConfigurationClient {
|
|
|
139
139
|
try {
|
|
140
140
|
const originalResponse = await this.client.putKeyValue(
|
|
141
141
|
"application/json",
|
|
142
|
-
configurationSetting.key,
|
|
142
|
+
(0, import_helpers.encodePathParameter)(configurationSetting.key),
|
|
143
143
|
{
|
|
144
144
|
ifNoneMatch: "*",
|
|
145
145
|
label: configurationSetting.label,
|
|
@@ -193,7 +193,7 @@ class AppConfigurationClient {
|
|
|
193
193
|
async (updatedOptions) => {
|
|
194
194
|
let status;
|
|
195
195
|
import_logger.logger.info("[deleteConfigurationSetting] Deleting key value pair");
|
|
196
|
-
const originalResponse = await this.client.deleteKeyValue(id.key, {
|
|
196
|
+
const originalResponse = await this.client.deleteKeyValue((0, import_helpers.encodePathParameter)(id.key), {
|
|
197
197
|
label: id.label,
|
|
198
198
|
...updatedOptions,
|
|
199
199
|
...(0, import_helpers.checkAndFormatIfAndIfNoneMatch)(id, options),
|
|
@@ -238,7 +238,7 @@ class AppConfigurationClient {
|
|
|
238
238
|
let rawResponse;
|
|
239
239
|
import_logger.logger.info("[getConfigurationSetting] Getting key value pair");
|
|
240
240
|
try {
|
|
241
|
-
const originalResponse = await this.client.getKeyValue(id.key, {
|
|
241
|
+
const originalResponse = await this.client.getKeyValue((0, import_helpers.encodePathParameter)(id.key), {
|
|
242
242
|
...updatedOptions,
|
|
243
243
|
label: id.label,
|
|
244
244
|
select: (0, import_helpers.formatFieldsForSelect)(options.fields),
|
|
@@ -639,16 +639,20 @@ class AppConfigurationClient {
|
|
|
639
639
|
const keyValue = (0, import_helpers.serializeAsConfigurationSettingParam)(configurationSetting);
|
|
640
640
|
import_logger.logger.info("[setConfigurationSetting] Setting new key value");
|
|
641
641
|
const response = (0, import_helpers.transformKeyValueResponse)(
|
|
642
|
-
await this.client.putKeyValue(
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
642
|
+
await this.client.putKeyValue(
|
|
643
|
+
"application/json",
|
|
644
|
+
(0, import_helpers.encodePathParameter)(configurationSetting.key),
|
|
645
|
+
{
|
|
646
|
+
...updatedOptions,
|
|
647
|
+
label: configurationSetting.label,
|
|
648
|
+
entity: keyValue,
|
|
649
|
+
...(0, import_helpers.checkAndFormatIfAndIfNoneMatch)(configurationSetting, options),
|
|
650
|
+
requestOptions: {
|
|
651
|
+
...updatedOptions.requestOptions,
|
|
652
|
+
skipUrlEncoding: true
|
|
653
|
+
}
|
|
650
654
|
}
|
|
651
|
-
|
|
655
|
+
)
|
|
652
656
|
);
|
|
653
657
|
(0, import_helpers.assertResponse)(response);
|
|
654
658
|
return response;
|
|
@@ -667,7 +671,7 @@ class AppConfigurationClient {
|
|
|
667
671
|
let response;
|
|
668
672
|
if (readOnly) {
|
|
669
673
|
import_logger.logger.info("[setReadOnly] Setting read-only status to ${readOnly}");
|
|
670
|
-
response = await this.client.putLock(id.key, {
|
|
674
|
+
response = await this.client.putLock((0, import_helpers.encodePathParameter)(id.key), {
|
|
671
675
|
...newOptions,
|
|
672
676
|
label: id.label,
|
|
673
677
|
...(0, import_helpers.checkAndFormatIfAndIfNoneMatch)(id, options),
|
|
@@ -678,7 +682,7 @@ class AppConfigurationClient {
|
|
|
678
682
|
});
|
|
679
683
|
} else {
|
|
680
684
|
import_logger.logger.info("[setReadOnly] Deleting read-only lock");
|
|
681
|
-
response = await this.client.deleteLock(id.key, {
|
|
685
|
+
response = await this.client.deleteLock((0, import_helpers.encodePathParameter)(id.key), {
|
|
682
686
|
...newOptions,
|
|
683
687
|
label: id.label,
|
|
684
688
|
...(0, import_helpers.checkAndFormatIfAndIfNoneMatch)(id, options),
|