@azure/app-configuration 1.9.2-alpha.20251103.1 → 1.9.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/README.md +15 -9
- package/dist/browser/appConfigurationClient.d.ts +2 -3
- package/dist/browser/appConfigurationClient.d.ts.map +1 -1
- package/dist/browser/appConfigurationClient.js.map +1 -1
- package/dist/browser/featureFlag.d.ts +0 -1
- package/dist/browser/featureFlag.d.ts.map +1 -1
- package/dist/browser/featureFlag.js +0 -4
- package/dist/browser/featureFlag.js.map +1 -1
- package/dist/browser/index.d.ts +0 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +0 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/internal/helpers.d.ts +1 -2
- package/dist/browser/internal/helpers.d.ts.map +1 -1
- package/dist/browser/internal/helpers.js +0 -12
- package/dist/browser/internal/helpers.js.map +1 -1
- package/dist/browser/internal/jsonModels.d.ts +1 -8
- package/dist/browser/internal/jsonModels.d.ts.map +1 -1
- package/dist/browser/internal/jsonModels.js.map +1 -1
- package/dist/browser/models.d.ts +4 -5
- package/dist/browser/models.d.ts.map +1 -1
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/secretReference.d.ts +1 -1
- package/dist/browser/secretReference.js +1 -1
- package/dist/browser/secretReference.js.map +1 -1
- package/dist/commonjs/appConfigurationClient.d.ts +2 -3
- package/dist/commonjs/appConfigurationClient.d.ts.map +1 -1
- package/dist/commonjs/appConfigurationClient.js.map +1 -1
- package/dist/commonjs/featureFlag.d.ts +0 -1
- package/dist/commonjs/featureFlag.d.ts.map +1 -1
- package/dist/commonjs/featureFlag.js +0 -4
- package/dist/commonjs/featureFlag.js.map +1 -1
- package/dist/commonjs/index.d.ts +0 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -5
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/internal/helpers.d.ts +1 -2
- package/dist/commonjs/internal/helpers.d.ts.map +1 -1
- package/dist/commonjs/internal/helpers.js +0 -12
- package/dist/commonjs/internal/helpers.js.map +1 -1
- package/dist/commonjs/internal/jsonModels.d.ts +1 -8
- package/dist/commonjs/internal/jsonModels.d.ts.map +1 -1
- package/dist/commonjs/internal/jsonModels.js.map +1 -1
- package/dist/commonjs/models.d.ts +4 -5
- package/dist/commonjs/models.d.ts.map +1 -1
- package/dist/commonjs/models.js.map +1 -1
- package/dist/commonjs/secretReference.d.ts +1 -1
- package/dist/commonjs/secretReference.js +1 -1
- package/dist/commonjs/secretReference.js.map +1 -1
- package/dist/esm/appConfigurationClient.d.ts +2 -3
- package/dist/esm/appConfigurationClient.d.ts.map +1 -1
- package/dist/esm/appConfigurationClient.js.map +1 -1
- package/dist/esm/featureFlag.d.ts +0 -1
- package/dist/esm/featureFlag.d.ts.map +1 -1
- package/dist/esm/featureFlag.js +0 -4
- package/dist/esm/featureFlag.js.map +1 -1
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/helpers.d.ts +1 -2
- package/dist/esm/internal/helpers.d.ts.map +1 -1
- package/dist/esm/internal/helpers.js +0 -12
- package/dist/esm/internal/helpers.js.map +1 -1
- package/dist/esm/internal/jsonModels.d.ts +1 -8
- package/dist/esm/internal/jsonModels.d.ts.map +1 -1
- package/dist/esm/internal/jsonModels.js.map +1 -1
- package/dist/esm/models.d.ts +4 -5
- package/dist/esm/models.d.ts.map +1 -1
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/secretReference.d.ts +1 -1
- package/dist/esm/secretReference.js +1 -1
- package/dist/esm/secretReference.js.map +1 -1
- package/dist/react-native/appConfigurationClient.d.ts +2 -3
- package/dist/react-native/appConfigurationClient.d.ts.map +1 -1
- package/dist/react-native/appConfigurationClient.js.map +1 -1
- package/dist/react-native/featureFlag.d.ts +0 -1
- package/dist/react-native/featureFlag.d.ts.map +1 -1
- package/dist/react-native/featureFlag.js +0 -4
- package/dist/react-native/featureFlag.js.map +1 -1
- package/dist/react-native/index.d.ts +0 -1
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +0 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/internal/helpers.d.ts +1 -2
- package/dist/react-native/internal/helpers.d.ts.map +1 -1
- package/dist/react-native/internal/helpers.js +0 -12
- package/dist/react-native/internal/helpers.js.map +1 -1
- package/dist/react-native/internal/jsonModels.d.ts +1 -8
- package/dist/react-native/internal/jsonModels.d.ts.map +1 -1
- package/dist/react-native/internal/jsonModels.js.map +1 -1
- package/dist/react-native/models.d.ts +4 -5
- package/dist/react-native/models.d.ts.map +1 -1
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/secretReference.d.ts +1 -1
- package/dist/react-native/secretReference.js +1 -1
- package/dist/react-native/secretReference.js.map +1 -1
- package/package.json +13 -13
- package/dist/browser/snapshotReference.d.ts +0 -34
- package/dist/browser/snapshotReference.d.ts.map +0 -1
- package/dist/browser/snapshotReference.js +0 -57
- package/dist/browser/snapshotReference.js.map +0 -1
- package/dist/commonjs/snapshotReference.d.ts +0 -34
- package/dist/commonjs/snapshotReference.d.ts.map +0 -1
- package/dist/commonjs/snapshotReference.js +0 -62
- package/dist/commonjs/snapshotReference.js.map +0 -1
- package/dist/esm/snapshotReference.d.ts +0 -34
- package/dist/esm/snapshotReference.d.ts.map +0 -1
- package/dist/esm/snapshotReference.js +0 -57
- package/dist/esm/snapshotReference.js.map +0 -1
- package/dist/react-native/snapshotReference.d.ts +0 -34
- package/dist/react-native/snapshotReference.d.ts.map +0 -1
- package/dist/react-native/snapshotReference.js +0 -57
- package/dist/react-native/snapshotReference.js.map +0 -1
|
@@ -2,7 +2,6 @@ import type { CompatResponse } from "@azure/core-http-compat";
|
|
|
2
2
|
import type { FeatureFlagValue } from "./featureFlag.js";
|
|
3
3
|
import type { CommonClientOptions, OperationOptions } from "@azure/core-client";
|
|
4
4
|
import type { SecretReferenceValue } from "./secretReference.js";
|
|
5
|
-
import type { SnapshotReferenceValue } from "./snapshotReference.js";
|
|
6
5
|
import type { SnapshotComposition, ConfigurationSettingsFilter, ConfigurationSnapshot, ConfigurationSnapshotStatus, SettingLabel } from "./generated/src/index.js";
|
|
7
6
|
/**
|
|
8
7
|
* Provides configuration options for AppConfigurationClient.
|
|
@@ -59,7 +58,7 @@ export interface ConfigurationSettingId {
|
|
|
59
58
|
/**
|
|
60
59
|
* Necessary fields for updating or creating a new configuration setting
|
|
61
60
|
*/
|
|
62
|
-
export type ConfigurationSettingParam<T extends string | FeatureFlagValue | SecretReferenceValue
|
|
61
|
+
export type ConfigurationSettingParam<T extends string | FeatureFlagValue | SecretReferenceValue = string> = ConfigurationSettingId & {
|
|
63
62
|
/**
|
|
64
63
|
* The content type of the setting's value
|
|
65
64
|
*/
|
|
@@ -85,7 +84,7 @@ export type ConfigurationSettingParam<T extends string | FeatureFlagValue | Secr
|
|
|
85
84
|
* Configuration setting with extra metadata from the server, indicating
|
|
86
85
|
* its etag, whether it is currently readOnly and when it was last modified.
|
|
87
86
|
*/
|
|
88
|
-
export type ConfigurationSetting<T extends string | FeatureFlagValue | SecretReferenceValue
|
|
87
|
+
export type ConfigurationSetting<T extends string | FeatureFlagValue | SecretReferenceValue = string> = ConfigurationSettingParam<T> & {
|
|
89
88
|
/**
|
|
90
89
|
* Whether or not the setting is read-only
|
|
91
90
|
*/
|
|
@@ -127,11 +126,11 @@ export interface HttpResponseField<HeadersT> {
|
|
|
127
126
|
/**
|
|
128
127
|
* Parameters for adding a new configuration setting
|
|
129
128
|
*/
|
|
130
|
-
export type AddConfigurationSettingParam<T extends string | FeatureFlagValue | SecretReferenceValue
|
|
129
|
+
export type AddConfigurationSettingParam<T extends string | FeatureFlagValue | SecretReferenceValue = string> = ConfigurationSettingParam<T>;
|
|
131
130
|
/**
|
|
132
131
|
* Parameters for creating or updating a new configuration setting
|
|
133
132
|
*/
|
|
134
|
-
export type SetConfigurationSettingParam<T extends string | FeatureFlagValue | SecretReferenceValue
|
|
133
|
+
export type SetConfigurationSettingParam<T extends string | FeatureFlagValue | SecretReferenceValue = string> = ConfigurationSettingParam<T>;
|
|
135
134
|
/**
|
|
136
135
|
* Standard base response for getting, deleting or updating a configuration setting
|
|
137
136
|
*/
|
|
@@ -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;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,
|
|
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;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EACV,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,EAC3B,YAAY,EACb,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACxE;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,oBAAY,sBAAsB;IAChC;;OAEG;IACH,UAAU,+BAA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;AAED,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,YAAY,GACb,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiClC;;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;AAwgBD,OAAO,EAIL,wBAAwB,EACxB,gCAAgC,GAGjC,MAAM,0BAA0B,CAAC","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\";\nimport type {\n SnapshotComposition,\n ConfigurationSettingsFilter,\n ConfigurationSnapshot,\n ConfigurationSnapshotStatus,\n SettingLabel,\n} from \"./generated/src/index.js\";\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 `2023-11-01`.\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 * 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} & (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,\n SyncTokenHeaderField,\n HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Response from deleting a ConfigurationSetting.\n */\nexport interface DeleteConfigurationSettingResponse\n extends SyncTokenHeaderField,\n HttpResponseFields,\n HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Options for deleting a ConfigurationSetting.\n */\nexport interface DeleteConfigurationSettingOptions\n extends HttpOnlyIfUnchangedField,\n OperationOptions {}\n\n/**\n * Options used when saving a ConfigurationSetting.\n */\nexport interface SetConfigurationSettingOptions\n extends HttpOnlyIfUnchangedField,\n OperationOptions {}\n\n/**\n * Response from setting a ConfigurationSetting.\n */\nexport interface SetConfigurationSettingResponse\n extends ConfigurationSetting,\n SyncTokenHeaderField,\n 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 ConfigurationSetting,\n GetConfigurationHeaders,\n HttpResponseFields,\n HttpResponseField<GetConfigurationHeaders> {}\n\n/**\n * Options for getting a ConfigurationSetting.\n */\nexport interface GetConfigurationSettingOptions\n extends OperationOptions,\n HttpOnlyIfChangedField,\n 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,\n 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 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,\n ListSnapshots,\n 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>,\n PageSettings,\n 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>,\n PageSettings,\n 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,\n SyncTokenHeaderField,\n 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}\n\nexport {\n ConfigurationSnapshot,\n ConfigurationSettingsFilter,\n SnapshotComposition,\n KnownSnapshotComposition,\n KnownConfigurationSnapshotStatus,\n ConfigurationSnapshotStatus,\n SettingLabel,\n} from \"./generated/src/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAgClC;;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;AAwgBD,OAAO,EAIL,wBAAwB,EACxB,gCAAgC,GAGjC,MAAM,0BAA0B,CAAC","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 {\n SnapshotComposition,\n ConfigurationSettingsFilter,\n ConfigurationSnapshot,\n ConfigurationSnapshotStatus,\n SettingLabel,\n} from \"./generated/src/index.js\";\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 `2023-11-01`.\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 * 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 = 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} & (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 = 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 = 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 = 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,\n SyncTokenHeaderField,\n HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Response from deleting a ConfigurationSetting.\n */\nexport interface DeleteConfigurationSettingResponse\n extends SyncTokenHeaderField,\n HttpResponseFields,\n HttpResponseField<SyncTokenHeaderField> {}\n\n/**\n * Options for deleting a ConfigurationSetting.\n */\nexport interface DeleteConfigurationSettingOptions\n extends HttpOnlyIfUnchangedField,\n OperationOptions {}\n\n/**\n * Options used when saving a ConfigurationSetting.\n */\nexport interface SetConfigurationSettingOptions\n extends HttpOnlyIfUnchangedField,\n OperationOptions {}\n\n/**\n * Response from setting a ConfigurationSetting.\n */\nexport interface SetConfigurationSettingResponse\n extends ConfigurationSetting,\n SyncTokenHeaderField,\n 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 ConfigurationSetting,\n GetConfigurationHeaders,\n HttpResponseFields,\n HttpResponseField<GetConfigurationHeaders> {}\n\n/**\n * Options for getting a ConfigurationSetting.\n */\nexport interface GetConfigurationSettingOptions\n extends OperationOptions,\n HttpOnlyIfChangedField,\n 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,\n 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 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,\n ListSnapshots,\n 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>,\n PageSettings,\n 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>,\n PageSettings,\n 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,\n SyncTokenHeaderField,\n 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}\n\nexport {\n ConfigurationSnapshot,\n ConfigurationSettingsFilter,\n SnapshotComposition,\n KnownSnapshotComposition,\n KnownConfigurationSnapshotStatus,\n ConfigurationSnapshotStatus,\n SettingLabel,\n} from \"./generated/src/index.js\";\n"]}
|
|
@@ -17,7 +17,7 @@ export interface SecretReferenceValue {
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const SecretReferenceHelper: {
|
|
19
19
|
/**
|
|
20
|
-
* Takes the SecretReference (JSON) and returns a ConfigurationSetting (with the props
|
|
20
|
+
* Takes the SecretReference (JSON) and returns a ConfigurationSetting (with the props encodeed in the value).
|
|
21
21
|
*/
|
|
22
22
|
toConfigurationSettingParam: (secretReference: ConfigurationSettingParam<SecretReferenceValue>) => ConfigurationSettingParam;
|
|
23
23
|
};
|
|
@@ -10,7 +10,7 @@ export const secretReferenceContentType = "application/vnd.microsoft.appconfig.k
|
|
|
10
10
|
*/
|
|
11
11
|
export const SecretReferenceHelper = {
|
|
12
12
|
/**
|
|
13
|
-
* Takes the SecretReference (JSON) and returns a ConfigurationSetting (with the props
|
|
13
|
+
* Takes the SecretReference (JSON) and returns a ConfigurationSetting (with the props encodeed in the value).
|
|
14
14
|
*/
|
|
15
15
|
toConfigurationSettingParam: (secretReference) => {
|
|
16
16
|
logger.info("Encoding SecretReference value in a ConfigurationSetting:", secretReference);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secretReference.js","sourceRoot":"","sources":["../../src/secretReference.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GACrC,oEAAoE,CAAC;AAYvE;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC;;OAEG;IACH,2BAA2B,EAAE,CAC3B,eAAgE,EACrC,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,2DAA2D,EAAE,eAAe,CAAC,CAAC;QAC1F,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;YAC3B,MAAM,CAAC,KAAK,CAAC,yCAAyC,EAAE,eAAe,CAAC,CAAC;YACzE,MAAM,IAAI,SAAS,CAAC,6CAA6C,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC;QAC5F,CAAC;QAED,MAAM,wBAAwB,GAA6B;YACzD,GAAG,EAAE,eAAe,CAAC,KAAK,CAAC,QAAQ;SACpC,CAAC;QAEF,MAAM,aAAa,GAAG;YACpB,GAAG,eAAe;YAClB,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC;SAChD,CAAC;QACF,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA6B;IAE7B,MAAM,CAAC,IAAI,CACT,6EAA6E,EAC7E,OAAO,CACR,CAAC;IACF,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,SAAS,CACb,oBAAoB,OAAO,CAAC,GAAG,yGAAyG,CACzI,CAAC;IACJ,CAAC;IAED,MAAM,wBAAwB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAA6B,CAAC;IAEvF,MAAM,eAAe,GAA+C;QAClE,GAAG,OAAO;QACV,KAAK,EAAE,EAAE,QAAQ,EAAE,wBAAwB,CAAC,GAAG,EAAE;KAClD,CAAC;IACF,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAA6B;IAE7B,OAAO,CACL,OAAO;QACP,OAAO,CAAC,WAAW,KAAK,0BAA0B;QAClD,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAClC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConfigurationSetting, ConfigurationSettingParam } from \"./models.js\";\nimport type { JsonSecretReferenceValue } from \"./internal/jsonModels.js\";\nimport { logger } from \"./logger.js\";\n\n/**\n * content-type for the secret reference.\n */\nexport const secretReferenceContentType =\n \"application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8\";\n\n/**\n * Necessary fields for updating or creating a new secret reference.\n */\nexport interface SecretReferenceValue {\n /**\n * Id for the secret reference.\n */\n secretId: string;\n}\n\n/**\n * @internal\n */\nexport const SecretReferenceHelper = {\n /**\n * Takes the SecretReference (JSON) and returns a ConfigurationSetting (with the props
|
|
1
|
+
{"version":3,"file":"secretReference.js","sourceRoot":"","sources":["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ACV,KAAK,EAAE,EAAE,QAAQ,EAAE,wBAAwB,CAAC,GAAG,EAAE;KAClD,CAAC;IACF,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAA6B;IAE7B,OAAO,CACL,OAAO;QACP,OAAO,CAAC,WAAW,KAAK,0BAA0B;QAClD,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAClC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConfigurationSetting, ConfigurationSettingParam } from \"./models.js\";\nimport type { JsonSecretReferenceValue } from \"./internal/jsonModels.js\";\nimport { logger } from \"./logger.js\";\n\n/**\n * content-type for the secret reference.\n */\nexport const secretReferenceContentType =\n \"application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8\";\n\n/**\n * Necessary fields for updating or creating a new secret reference.\n */\nexport interface SecretReferenceValue {\n /**\n * Id for the secret reference.\n */\n secretId: string;\n}\n\n/**\n * @internal\n */\nexport const SecretReferenceHelper = {\n /**\n * Takes the SecretReference (JSON) and returns a ConfigurationSetting (with the props encodeed in the value).\n */\n toConfigurationSettingParam: (\n secretReference: ConfigurationSettingParam<SecretReferenceValue>,\n ): ConfigurationSettingParam => {\n logger.info(\"Encoding SecretReference value in a ConfigurationSetting:\", secretReference);\n if (!secretReference.value) {\n logger.error(`SecretReference has an unexpected value`, secretReference);\n throw new TypeError(`SecretReference has an unexpected value - ${secretReference.value}`);\n }\n\n const jsonSecretReferenceValue: JsonSecretReferenceValue = {\n uri: secretReference.value.secretId,\n };\n\n const configSetting = {\n ...secretReference,\n value: JSON.stringify(jsonSecretReferenceValue),\n };\n return configSetting;\n },\n};\n\n/**\n * Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SecretReferenceValue> by parsing the value string.\n */\nexport function parseSecretReference(\n setting: ConfigurationSetting,\n): ConfigurationSetting<SecretReferenceValue> {\n logger.info(\n \"[parseSecretReference] Parsing the value to return the SecretReferenceValue\",\n setting,\n );\n if (!isSecretReference(setting)) {\n logger.error(\"Invalid SecretReference input\", setting);\n throw TypeError(\n `Setting with key ${setting.key} is not a valid SecretReference, make sure to have the correct content-type and a valid non-null value.`,\n );\n }\n\n const jsonSecretReferenceValue = JSON.parse(setting.value) as JsonSecretReferenceValue;\n\n const secretReference: ConfigurationSetting<SecretReferenceValue> = {\n ...setting,\n value: { secretId: jsonSecretReferenceValue.uri },\n };\n return secretReference;\n}\n\n/**\n * Lets you know if the ConfigurationSetting is a secret reference.\n *\n * [Checks if the content type is secretReferenceContentType `\"application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8\"`]\n */\nexport function isSecretReference(\n setting: ConfigurationSetting,\n): setting is ConfigurationSetting & Required<Pick<ConfigurationSetting, \"value\">> {\n return (\n setting &&\n setting.contentType === secretReferenceContentType &&\n typeof setting.value === \"string\"\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure/app-configuration",
|
|
3
3
|
"author": "Microsoft Corporation",
|
|
4
4
|
"description": "An isomorphic client library for the Azure App Configuration service.",
|
|
5
|
-
"version": "1.9.2
|
|
5
|
+
"version": "1.9.2",
|
|
6
6
|
"sdk-type": "client",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -47,23 +47,23 @@
|
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@azure/abort-controller": "
|
|
51
|
-
"@azure/core-auth": "
|
|
52
|
-
"@azure/core-client": "
|
|
53
|
-
"@azure/core-http-compat": "
|
|
50
|
+
"@azure/abort-controller": "^2.0.0",
|
|
51
|
+
"@azure/core-auth": "^1.3.0",
|
|
52
|
+
"@azure/core-client": "^1.5.0",
|
|
53
|
+
"@azure/core-http-compat": "^2.0.0",
|
|
54
54
|
"@azure/core-lro": "^2.5.1",
|
|
55
|
-
"@azure/core-paging": "
|
|
56
|
-
"@azure/core-rest-pipeline": "
|
|
57
|
-
"@azure/core-tracing": "
|
|
58
|
-
"@azure/core-util": "
|
|
59
|
-
"@azure/logger": "
|
|
55
|
+
"@azure/core-paging": "^1.4.0",
|
|
56
|
+
"@azure/core-rest-pipeline": "^1.6.0",
|
|
57
|
+
"@azure/core-tracing": "^1.0.0",
|
|
58
|
+
"@azure/core-util": "^1.6.1",
|
|
59
|
+
"@azure/logger": "^1.0.0",
|
|
60
60
|
"tslib": "^2.2.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@azure/app-configuration-provider": "^2.2.0",
|
|
64
|
-
"@azure/eventgrid": "
|
|
64
|
+
"@azure/eventgrid": "^5.0.0",
|
|
65
65
|
"@azure/identity": "4.11.1",
|
|
66
|
-
"@azure/keyvault-secrets": "
|
|
66
|
+
"@azure/keyvault-secrets": "^4.2.0",
|
|
67
67
|
"@microsoft/feature-management": "^2.2.0",
|
|
68
68
|
"@types/node": "^20.19.0",
|
|
69
69
|
"@vitest/browser": "^3.2.3",
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"tshy": "^3.0.0",
|
|
79
79
|
"typescript": "~5.9.3",
|
|
80
80
|
"vitest": "^3.2.3",
|
|
81
|
+
"@azure-tools/test-credential": "^2.1.2",
|
|
81
82
|
"@azure-tools/test-recorder": "^4.1.1",
|
|
82
83
|
"@azure/dev-tool": "^1.0.0",
|
|
83
|
-
"@azure-tools/test-credential": "^2.1.2",
|
|
84
84
|
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
|
|
85
85
|
},
|
|
86
86
|
"//sampleConfiguration": {
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ConfigurationSetting, ConfigurationSettingParam } from "./models.js";
|
|
2
|
-
/**
|
|
3
|
-
* content-type for the snapshot reference.
|
|
4
|
-
*/
|
|
5
|
-
export declare const snapshotReferenceContentType = "application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8";
|
|
6
|
-
/**
|
|
7
|
-
* Necessary fields for updating or creating a new snapshot reference.
|
|
8
|
-
*/
|
|
9
|
-
export interface SnapshotReferenceValue {
|
|
10
|
-
/**
|
|
11
|
-
* snapshot name.
|
|
12
|
-
*/
|
|
13
|
-
snapshotName: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare const SnapshotReferenceHelper: {
|
|
19
|
-
/**
|
|
20
|
-
* Takes the SnapshotReference (JSON) and returns a ConfigurationSetting (with the props encoded in the value).
|
|
21
|
-
*/
|
|
22
|
-
toConfigurationSettingParam: (snapshotReference: ConfigurationSettingParam<SnapshotReferenceValue>) => ConfigurationSettingParam;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SnapshotReferenceValue> by parsing the value string.
|
|
26
|
-
*/
|
|
27
|
-
export declare function parseSnapshotReference(setting: ConfigurationSetting): ConfigurationSetting<SnapshotReferenceValue>;
|
|
28
|
-
/**
|
|
29
|
-
* Lets you know if the ConfigurationSetting is a snapshot reference.
|
|
30
|
-
*
|
|
31
|
-
* [Checks if the content type is snapshotReferenceContentType `"application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8"`]
|
|
32
|
-
*/
|
|
33
|
-
export declare function isSnapshotReference(setting: ConfigurationSetting): setting is ConfigurationSetting & Required<Pick<ConfigurationSetting, "value">>;
|
|
34
|
-
//# sourceMappingURL=snapshotReference.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotReference.d.ts","sourceRoot":"","sources":["../../src/snapshotReference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAInF;;GAEG;AACH,eAAO,MAAM,4BAA4B,gGACoD,CAAC;AAE9F;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB;IAClC;;OAEG;qDAEkB,yBAAyB,CAAC,sBAAsB,CAAC,KACnE,yBAAyB;CAiB7B,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,oBAAoB,CAAC,sBAAsB,CAAC,CAmB9C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,IAAI,oBAAoB,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAMjF"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { logger } from "./logger.js";
|
|
4
|
-
/**
|
|
5
|
-
* content-type for the snapshot reference.
|
|
6
|
-
*/
|
|
7
|
-
export const snapshotReferenceContentType = 'application/json; profile="https://azconfig.io/mime-profiles/snapshot-ref"; charset=utf-8';
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export const SnapshotReferenceHelper = {
|
|
12
|
-
/**
|
|
13
|
-
* Takes the SnapshotReference (JSON) and returns a ConfigurationSetting (with the props encoded in the value).
|
|
14
|
-
*/
|
|
15
|
-
toConfigurationSettingParam: (snapshotReference) => {
|
|
16
|
-
logger.info("Encoding SnapshotReference value in a ConfigurationSetting:", snapshotReference);
|
|
17
|
-
if (!snapshotReference.value) {
|
|
18
|
-
logger.error(`SnapshotReference has an unexpected value`, snapshotReference);
|
|
19
|
-
throw new TypeError(`SnapshotReference has an unexpected value - ${snapshotReference.value}`);
|
|
20
|
-
}
|
|
21
|
-
const jsonSnapshotReferenceValue = {
|
|
22
|
-
snapshot_name: snapshotReference.value.snapshotName,
|
|
23
|
-
};
|
|
24
|
-
const configSetting = {
|
|
25
|
-
...snapshotReference,
|
|
26
|
-
value: JSON.stringify(jsonSnapshotReferenceValue),
|
|
27
|
-
};
|
|
28
|
-
return configSetting;
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SnapshotReferenceValue> by parsing the value string.
|
|
33
|
-
*/
|
|
34
|
-
export function parseSnapshotReference(setting) {
|
|
35
|
-
logger.info("[parseSnapshotReference] Parsing the value to return the SnapshotReferenceValue", setting);
|
|
36
|
-
if (!isSnapshotReference(setting)) {
|
|
37
|
-
logger.error("Invalid SnapshotReference input", setting);
|
|
38
|
-
throw TypeError(`Setting with key ${setting.key} is not a valid SnapshotReference, make sure to have the correct content-type and a valid non-null value.`);
|
|
39
|
-
}
|
|
40
|
-
const jsonSnapshotReferenceValue = JSON.parse(setting.value);
|
|
41
|
-
const snapshotReference = {
|
|
42
|
-
...setting,
|
|
43
|
-
value: { snapshotName: jsonSnapshotReferenceValue.snapshot_name },
|
|
44
|
-
};
|
|
45
|
-
return snapshotReference;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Lets you know if the ConfigurationSetting is a snapshot reference.
|
|
49
|
-
*
|
|
50
|
-
* [Checks if the content type is snapshotReferenceContentType `"application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8"`]
|
|
51
|
-
*/
|
|
52
|
-
export function isSnapshotReference(setting) {
|
|
53
|
-
return (setting &&
|
|
54
|
-
setting.contentType === snapshotReferenceContentType &&
|
|
55
|
-
typeof setting.value === "string");
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=snapshotReference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotReference.js","sourceRoot":"","sources":["../../src/snapshotReference.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH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AAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAA6B;IAE7B,OAAO,CACL,OAAO;QACP,OAAO,CAAC,WAAW,KAAK,4BAA4B;QACpD,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAClC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConfigurationSetting, ConfigurationSettingParam } from \"./models.js\";\nimport type { JsonSnapshotReferenceValue } from \"./internal/jsonModels.js\";\nimport { logger } from \"./logger.js\";\n\n/**\n * content-type for the snapshot reference.\n */\nexport const snapshotReferenceContentType =\n 'application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8';\n\n/**\n * Necessary fields for updating or creating a new snapshot reference.\n */\nexport interface SnapshotReferenceValue {\n /**\n * snapshot name.\n */\n snapshotName: string;\n}\n\n/**\n * @internal\n */\nexport const SnapshotReferenceHelper = {\n /**\n * Takes the SnapshotReference (JSON) and returns a ConfigurationSetting (with the props encoded in the value).\n */\n toConfigurationSettingParam: (\n snapshotReference: ConfigurationSettingParam<SnapshotReferenceValue>,\n ): ConfigurationSettingParam => {\n logger.info(\"Encoding SnapshotReference value in a ConfigurationSetting:\", snapshotReference);\n if (!snapshotReference.value) {\n logger.error(`SnapshotReference has an unexpected value`, snapshotReference);\n throw new TypeError(`SnapshotReference has an unexpected value - ${snapshotReference.value}`);\n }\n\n const jsonSnapshotReferenceValue: JsonSnapshotReferenceValue = {\n snapshot_name: snapshotReference.value.snapshotName,\n };\n\n const configSetting = {\n ...snapshotReference,\n value: JSON.stringify(jsonSnapshotReferenceValue),\n };\n return configSetting;\n },\n};\n\n/**\n * Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SnapshotReferenceValue> by parsing the value string.\n */\nexport function parseSnapshotReference(\n setting: ConfigurationSetting,\n): ConfigurationSetting<SnapshotReferenceValue> {\n logger.info(\n \"[parseSnapshotReference] Parsing the value to return the SnapshotReferenceValue\",\n setting,\n );\n if (!isSnapshotReference(setting)) {\n logger.error(\"Invalid SnapshotReference input\", setting);\n throw TypeError(\n `Setting with key ${setting.key} is not a valid SnapshotReference, make sure to have the correct content-type and a valid non-null value.`,\n );\n }\n\n const jsonSnapshotReferenceValue = JSON.parse(setting.value) as JsonSnapshotReferenceValue;\n\n const snapshotReference: ConfigurationSetting<SnapshotReferenceValue> = {\n ...setting,\n value: { snapshotName: jsonSnapshotReferenceValue.snapshot_name },\n };\n return snapshotReference;\n}\n\n/**\n * Lets you know if the ConfigurationSetting is a snapshot reference.\n *\n * [Checks if the content type is snapshotReferenceContentType `\"application/json; profile=\\\"https://azconfig.io/mime-profiles/snapshot-ref\\\"; charset=utf-8\"`]\n */\nexport function isSnapshotReference(\n setting: ConfigurationSetting,\n): setting is ConfigurationSetting & Required<Pick<ConfigurationSetting, \"value\">> {\n return (\n setting &&\n setting.contentType === snapshotReferenceContentType &&\n typeof setting.value === \"string\"\n );\n}\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ConfigurationSetting, ConfigurationSettingParam } from "./models.js";
|
|
2
|
-
/**
|
|
3
|
-
* content-type for the snapshot reference.
|
|
4
|
-
*/
|
|
5
|
-
export declare const snapshotReferenceContentType = "application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8";
|
|
6
|
-
/**
|
|
7
|
-
* Necessary fields for updating or creating a new snapshot reference.
|
|
8
|
-
*/
|
|
9
|
-
export interface SnapshotReferenceValue {
|
|
10
|
-
/**
|
|
11
|
-
* snapshot name.
|
|
12
|
-
*/
|
|
13
|
-
snapshotName: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare const SnapshotReferenceHelper: {
|
|
19
|
-
/**
|
|
20
|
-
* Takes the SnapshotReference (JSON) and returns a ConfigurationSetting (with the props encoded in the value).
|
|
21
|
-
*/
|
|
22
|
-
toConfigurationSettingParam: (snapshotReference: ConfigurationSettingParam<SnapshotReferenceValue>) => ConfigurationSettingParam;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SnapshotReferenceValue> by parsing the value string.
|
|
26
|
-
*/
|
|
27
|
-
export declare function parseSnapshotReference(setting: ConfigurationSetting): ConfigurationSetting<SnapshotReferenceValue>;
|
|
28
|
-
/**
|
|
29
|
-
* Lets you know if the ConfigurationSetting is a snapshot reference.
|
|
30
|
-
*
|
|
31
|
-
* [Checks if the content type is snapshotReferenceContentType `"application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8"`]
|
|
32
|
-
*/
|
|
33
|
-
export declare function isSnapshotReference(setting: ConfigurationSetting): setting is ConfigurationSetting & Required<Pick<ConfigurationSetting, "value">>;
|
|
34
|
-
//# sourceMappingURL=snapshotReference.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotReference.d.ts","sourceRoot":"","sources":["../../src/snapshotReference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAInF;;GAEG;AACH,eAAO,MAAM,4BAA4B,gGACoD,CAAC;AAE9F;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB;IAClC;;OAEG;qDAEkB,yBAAyB,CAAC,sBAAsB,CAAC,KACnE,yBAAyB;CAiB7B,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,oBAAoB,CAAC,sBAAsB,CAAC,CAmB9C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,IAAI,oBAAoB,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAMjF"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.SnapshotReferenceHelper = exports.snapshotReferenceContentType = void 0;
|
|
6
|
-
exports.parseSnapshotReference = parseSnapshotReference;
|
|
7
|
-
exports.isSnapshotReference = isSnapshotReference;
|
|
8
|
-
const logger_js_1 = require("./logger.js");
|
|
9
|
-
/**
|
|
10
|
-
* content-type for the snapshot reference.
|
|
11
|
-
*/
|
|
12
|
-
exports.snapshotReferenceContentType = 'application/json; profile="https://azconfig.io/mime-profiles/snapshot-ref"; charset=utf-8';
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
exports.SnapshotReferenceHelper = {
|
|
17
|
-
/**
|
|
18
|
-
* Takes the SnapshotReference (JSON) and returns a ConfigurationSetting (with the props encoded in the value).
|
|
19
|
-
*/
|
|
20
|
-
toConfigurationSettingParam: (snapshotReference) => {
|
|
21
|
-
logger_js_1.logger.info("Encoding SnapshotReference value in a ConfigurationSetting:", snapshotReference);
|
|
22
|
-
if (!snapshotReference.value) {
|
|
23
|
-
logger_js_1.logger.error(`SnapshotReference has an unexpected value`, snapshotReference);
|
|
24
|
-
throw new TypeError(`SnapshotReference has an unexpected value - ${snapshotReference.value}`);
|
|
25
|
-
}
|
|
26
|
-
const jsonSnapshotReferenceValue = {
|
|
27
|
-
snapshot_name: snapshotReference.value.snapshotName,
|
|
28
|
-
};
|
|
29
|
-
const configSetting = {
|
|
30
|
-
...snapshotReference,
|
|
31
|
-
value: JSON.stringify(jsonSnapshotReferenceValue),
|
|
32
|
-
};
|
|
33
|
-
return configSetting;
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SnapshotReferenceValue> by parsing the value string.
|
|
38
|
-
*/
|
|
39
|
-
function parseSnapshotReference(setting) {
|
|
40
|
-
logger_js_1.logger.info("[parseSnapshotReference] Parsing the value to return the SnapshotReferenceValue", setting);
|
|
41
|
-
if (!isSnapshotReference(setting)) {
|
|
42
|
-
logger_js_1.logger.error("Invalid SnapshotReference input", setting);
|
|
43
|
-
throw TypeError(`Setting with key ${setting.key} is not a valid SnapshotReference, make sure to have the correct content-type and a valid non-null value.`);
|
|
44
|
-
}
|
|
45
|
-
const jsonSnapshotReferenceValue = JSON.parse(setting.value);
|
|
46
|
-
const snapshotReference = {
|
|
47
|
-
...setting,
|
|
48
|
-
value: { snapshotName: jsonSnapshotReferenceValue.snapshot_name },
|
|
49
|
-
};
|
|
50
|
-
return snapshotReference;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Lets you know if the ConfigurationSetting is a snapshot reference.
|
|
54
|
-
*
|
|
55
|
-
* [Checks if the content type is snapshotReferenceContentType `"application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8"`]
|
|
56
|
-
*/
|
|
57
|
-
function isSnapshotReference(setting) {
|
|
58
|
-
return (setting &&
|
|
59
|
-
setting.contentType === exports.snapshotReferenceContentType &&
|
|
60
|
-
typeof setting.value === "string");
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=snapshotReference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotReference.js","sourceRoot":"","sources":["../../src/snapshotReference.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAqDlC,wDAqBC;AAOD,kDAQC;AArFD,2CAAqC;AAErC;;GAEG;AACU,QAAA,4BAA4B,GACvC,2FAA2F,CAAC;AAY9F;;GAEG;AACU,QAAA,uBAAuB,GAAG;IACrC;;OAEG;IACH,2BAA2B,EAAE,CAC3B,iBAAoE,EACzC,EAAE;QAC7B,kBAAM,CAAC,IAAI,CA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":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConfigurationSetting, ConfigurationSettingParam } from \"./models.js\";\nimport type { JsonSnapshotReferenceValue } from \"./internal/jsonModels.js\";\nimport { logger } from \"./logger.js\";\n\n/**\n * content-type for the snapshot reference.\n */\nexport const snapshotReferenceContentType =\n 'application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8';\n\n/**\n * Necessary fields for updating or creating a new snapshot reference.\n */\nexport interface SnapshotReferenceValue {\n /**\n * snapshot name.\n */\n snapshotName: string;\n}\n\n/**\n * @internal\n */\nexport const SnapshotReferenceHelper = {\n /**\n * Takes the SnapshotReference (JSON) and returns a ConfigurationSetting (with the props encoded in the value).\n */\n toConfigurationSettingParam: (\n snapshotReference: ConfigurationSettingParam<SnapshotReferenceValue>,\n ): ConfigurationSettingParam => {\n logger.info(\"Encoding SnapshotReference value in a ConfigurationSetting:\", snapshotReference);\n if (!snapshotReference.value) {\n logger.error(`SnapshotReference has an unexpected value`, snapshotReference);\n throw new TypeError(`SnapshotReference has an unexpected value - ${snapshotReference.value}`);\n }\n\n const jsonSnapshotReferenceValue: JsonSnapshotReferenceValue = {\n snapshot_name: snapshotReference.value.snapshotName,\n };\n\n const configSetting = {\n ...snapshotReference,\n value: JSON.stringify(jsonSnapshotReferenceValue),\n };\n return configSetting;\n },\n};\n\n/**\n * Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SnapshotReferenceValue> by parsing the value string.\n */\nexport function parseSnapshotReference(\n setting: ConfigurationSetting,\n): ConfigurationSetting<SnapshotReferenceValue> {\n logger.info(\n \"[parseSnapshotReference] Parsing the value to return the SnapshotReferenceValue\",\n setting,\n );\n if (!isSnapshotReference(setting)) {\n logger.error(\"Invalid SnapshotReference input\", setting);\n throw TypeError(\n `Setting with key ${setting.key} is not a valid SnapshotReference, make sure to have the correct content-type and a valid non-null value.`,\n );\n }\n\n const jsonSnapshotReferenceValue = JSON.parse(setting.value) as JsonSnapshotReferenceValue;\n\n const snapshotReference: ConfigurationSetting<SnapshotReferenceValue> = {\n ...setting,\n value: { snapshotName: jsonSnapshotReferenceValue.snapshot_name },\n };\n return snapshotReference;\n}\n\n/**\n * Lets you know if the ConfigurationSetting is a snapshot reference.\n *\n * [Checks if the content type is snapshotReferenceContentType `\"application/json; profile=\\\"https://azconfig.io/mime-profiles/snapshot-ref\\\"; charset=utf-8\"`]\n */\nexport function isSnapshotReference(\n setting: ConfigurationSetting,\n): setting is ConfigurationSetting & Required<Pick<ConfigurationSetting, \"value\">> {\n return (\n setting &&\n setting.contentType === snapshotReferenceContentType &&\n typeof setting.value === \"string\"\n );\n}\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ConfigurationSetting, ConfigurationSettingParam } from "./models.js";
|
|
2
|
-
/**
|
|
3
|
-
* content-type for the snapshot reference.
|
|
4
|
-
*/
|
|
5
|
-
export declare const snapshotReferenceContentType = "application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8";
|
|
6
|
-
/**
|
|
7
|
-
* Necessary fields for updating or creating a new snapshot reference.
|
|
8
|
-
*/
|
|
9
|
-
export interface SnapshotReferenceValue {
|
|
10
|
-
/**
|
|
11
|
-
* snapshot name.
|
|
12
|
-
*/
|
|
13
|
-
snapshotName: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare const SnapshotReferenceHelper: {
|
|
19
|
-
/**
|
|
20
|
-
* Takes the SnapshotReference (JSON) and returns a ConfigurationSetting (with the props encoded in the value).
|
|
21
|
-
*/
|
|
22
|
-
toConfigurationSettingParam: (snapshotReference: ConfigurationSettingParam<SnapshotReferenceValue>) => ConfigurationSettingParam;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SnapshotReferenceValue> by parsing the value string.
|
|
26
|
-
*/
|
|
27
|
-
export declare function parseSnapshotReference(setting: ConfigurationSetting): ConfigurationSetting<SnapshotReferenceValue>;
|
|
28
|
-
/**
|
|
29
|
-
* Lets you know if the ConfigurationSetting is a snapshot reference.
|
|
30
|
-
*
|
|
31
|
-
* [Checks if the content type is snapshotReferenceContentType `"application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8"`]
|
|
32
|
-
*/
|
|
33
|
-
export declare function isSnapshotReference(setting: ConfigurationSetting): setting is ConfigurationSetting & Required<Pick<ConfigurationSetting, "value">>;
|
|
34
|
-
//# sourceMappingURL=snapshotReference.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotReference.d.ts","sourceRoot":"","sources":["../../src/snapshotReference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAInF;;GAEG;AACH,eAAO,MAAM,4BAA4B,gGACoD,CAAC;AAE9F;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB;IAClC;;OAEG;qDAEkB,yBAAyB,CAAC,sBAAsB,CAAC,KACnE,yBAAyB;CAiB7B,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,oBAAoB,CAAC,sBAAsB,CAAC,CAmB9C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,IAAI,oBAAoB,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAMjF"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { logger } from "./logger.js";
|
|
4
|
-
/**
|
|
5
|
-
* content-type for the snapshot reference.
|
|
6
|
-
*/
|
|
7
|
-
export const snapshotReferenceContentType = 'application/json; profile="https://azconfig.io/mime-profiles/snapshot-ref"; charset=utf-8';
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export const SnapshotReferenceHelper = {
|
|
12
|
-
/**
|
|
13
|
-
* Takes the SnapshotReference (JSON) and returns a ConfigurationSetting (with the props encoded in the value).
|
|
14
|
-
*/
|
|
15
|
-
toConfigurationSettingParam: (snapshotReference) => {
|
|
16
|
-
logger.info("Encoding SnapshotReference value in a ConfigurationSetting:", snapshotReference);
|
|
17
|
-
if (!snapshotReference.value) {
|
|
18
|
-
logger.error(`SnapshotReference has an unexpected value`, snapshotReference);
|
|
19
|
-
throw new TypeError(`SnapshotReference has an unexpected value - ${snapshotReference.value}`);
|
|
20
|
-
}
|
|
21
|
-
const jsonSnapshotReferenceValue = {
|
|
22
|
-
snapshot_name: snapshotReference.value.snapshotName,
|
|
23
|
-
};
|
|
24
|
-
const configSetting = {
|
|
25
|
-
...snapshotReference,
|
|
26
|
-
value: JSON.stringify(jsonSnapshotReferenceValue),
|
|
27
|
-
};
|
|
28
|
-
return configSetting;
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SnapshotReferenceValue> by parsing the value string.
|
|
33
|
-
*/
|
|
34
|
-
export function parseSnapshotReference(setting) {
|
|
35
|
-
logger.info("[parseSnapshotReference] Parsing the value to return the SnapshotReferenceValue", setting);
|
|
36
|
-
if (!isSnapshotReference(setting)) {
|
|
37
|
-
logger.error("Invalid SnapshotReference input", setting);
|
|
38
|
-
throw TypeError(`Setting with key ${setting.key} is not a valid SnapshotReference, make sure to have the correct content-type and a valid non-null value.`);
|
|
39
|
-
}
|
|
40
|
-
const jsonSnapshotReferenceValue = JSON.parse(setting.value);
|
|
41
|
-
const snapshotReference = {
|
|
42
|
-
...setting,
|
|
43
|
-
value: { snapshotName: jsonSnapshotReferenceValue.snapshot_name },
|
|
44
|
-
};
|
|
45
|
-
return snapshotReference;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Lets you know if the ConfigurationSetting is a snapshot reference.
|
|
49
|
-
*
|
|
50
|
-
* [Checks if the content type is snapshotReferenceContentType `"application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8"`]
|
|
51
|
-
*/
|
|
52
|
-
export function isSnapshotReference(setting) {
|
|
53
|
-
return (setting &&
|
|
54
|
-
setting.contentType === snapshotReferenceContentType &&
|
|
55
|
-
typeof setting.value === "string");
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=snapshotReference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotReference.js","sourceRoot":"","sources":["../../src/snapshotReference.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GACvC,2FAA2F,CAAC;AAY9F;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC;;OAEG;IACH,2BAA2B,EAAE,CAC3B,iBAAoE,EACzC,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,6DAA6D,EAAE,iBAAiB,CAAC,CAAC;QAC9F,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;YAC7B,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,iBAAiB,CAAC,CAAC;YAC7E,MAAM,IAAI,SAAS,CAAC,+CAA+C,iBAAiB,CAAC,KAAK,EAAE,CAAC,CAAC;QAChG,CAAC;QAED,MAAM,0BAA0B,GAA+B;YAC7D,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAAC,YAAY;SACpD,CAAC;QAEF,MAAM,aAAa,GAAG;YACpB,GAAG,iBAAiB;YACpB,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC;SAClD,CAAC;QACF,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAA6B;IAE7B,MAAM,CAAC,IAAI,CACT,iFAAiF,EACjF,OAAO,CACR,CAAC;IACF,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;QACzD,MAAM,SAAS,CACb,oBAAoB,OAAO,CAAC,GAAG,2GAA2G,CAC3I,CAAC;IACJ,CAAC;IAED,MAAM,0BAA0B,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAA+B,CAAC;IAE3F,MAAM,iBAAiB,GAAiD;QACtE,GAAG,OAAO;QACV,KAAK,EAAE,EAAE,YAAY,EAAE,0BAA0B,CAAC,aAAa,EAAE;KAClE,CAAC;IACF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAA6B;IAE7B,OAAO,CACL,OAAO;QACP,OAAO,CAAC,WAAW,KAAK,4BAA4B;QACpD,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAClC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConfigurationSetting, ConfigurationSettingParam } from \"./models.js\";\nimport type { JsonSnapshotReferenceValue } from \"./internal/jsonModels.js\";\nimport { logger } from \"./logger.js\";\n\n/**\n * content-type for the snapshot reference.\n */\nexport const snapshotReferenceContentType =\n 'application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8';\n\n/**\n * Necessary fields for updating or creating a new snapshot reference.\n */\nexport interface SnapshotReferenceValue {\n /**\n * snapshot name.\n */\n snapshotName: string;\n}\n\n/**\n * @internal\n */\nexport const SnapshotReferenceHelper = {\n /**\n * Takes the SnapshotReference (JSON) and returns a ConfigurationSetting (with the props encoded in the value).\n */\n toConfigurationSettingParam: (\n snapshotReference: ConfigurationSettingParam<SnapshotReferenceValue>,\n ): ConfigurationSettingParam => {\n logger.info(\"Encoding SnapshotReference value in a ConfigurationSetting:\", snapshotReference);\n if (!snapshotReference.value) {\n logger.error(`SnapshotReference has an unexpected value`, snapshotReference);\n throw new TypeError(`SnapshotReference has an unexpected value - ${snapshotReference.value}`);\n }\n\n const jsonSnapshotReferenceValue: JsonSnapshotReferenceValue = {\n snapshot_name: snapshotReference.value.snapshotName,\n };\n\n const configSetting = {\n ...snapshotReference,\n value: JSON.stringify(jsonSnapshotReferenceValue),\n };\n return configSetting;\n },\n};\n\n/**\n * Takes the ConfigurationSetting as input and returns the ConfigurationSetting<SnapshotReferenceValue> by parsing the value string.\n */\nexport function parseSnapshotReference(\n setting: ConfigurationSetting,\n): ConfigurationSetting<SnapshotReferenceValue> {\n logger.info(\n \"[parseSnapshotReference] Parsing the value to return the SnapshotReferenceValue\",\n setting,\n );\n if (!isSnapshotReference(setting)) {\n logger.error(\"Invalid SnapshotReference input\", setting);\n throw TypeError(\n `Setting with key ${setting.key} is not a valid SnapshotReference, make sure to have the correct content-type and a valid non-null value.`,\n );\n }\n\n const jsonSnapshotReferenceValue = JSON.parse(setting.value) as JsonSnapshotReferenceValue;\n\n const snapshotReference: ConfigurationSetting<SnapshotReferenceValue> = {\n ...setting,\n value: { snapshotName: jsonSnapshotReferenceValue.snapshot_name },\n };\n return snapshotReference;\n}\n\n/**\n * Lets you know if the ConfigurationSetting is a snapshot reference.\n *\n * [Checks if the content type is snapshotReferenceContentType `\"application/json; profile=\\\"https://azconfig.io/mime-profiles/snapshot-ref\\\"; charset=utf-8\"`]\n */\nexport function isSnapshotReference(\n setting: ConfigurationSetting,\n): setting is ConfigurationSetting & Required<Pick<ConfigurationSetting, \"value\">> {\n return (\n setting &&\n setting.contentType === snapshotReferenceContentType &&\n typeof setting.value === \"string\"\n );\n}\n"]}
|