@azure/app-configuration 1.4.1-alpha.20230406.2 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -96
- package/dist/index.js.map +1 -1
- package/dist-esm/samples-dev/featureFlag.js +12 -5
- package/dist-esm/samples-dev/featureFlag.js.map +1 -1
- package/dist-esm/samples-dev/getSettingOnlyIfChanged.js +13 -6
- package/dist-esm/samples-dev/getSettingOnlyIfChanged.js.map +1 -1
- package/dist-esm/samples-dev/helloworld.js +12 -5
- package/dist-esm/samples-dev/helloworld.js.map +1 -1
- package/dist-esm/samples-dev/helloworldWithLabels.js +12 -5
- package/dist-esm/samples-dev/helloworldWithLabels.js.map +1 -1
- package/dist-esm/samples-dev/listConfigurationSettings.js +23 -9
- package/dist-esm/samples-dev/listConfigurationSettings.js.map +1 -1
- package/dist-esm/samples-dev/listRevisions.js +25 -11
- package/dist-esm/samples-dev/listRevisions.js.map +1 -1
- package/dist-esm/samples-dev/optimisticConcurrencyViaEtag.js +13 -6
- package/dist-esm/samples-dev/optimisticConcurrencyViaEtag.js.map +1 -1
- package/dist-esm/samples-dev/secretReference.js +12 -5
- package/dist-esm/samples-dev/secretReference.js.map +1 -1
- package/dist-esm/samples-dev/setReadOnlySample.js +13 -6
- package/dist-esm/samples-dev/setReadOnlySample.js.map +1 -1
- package/dist-esm/samples-dev/updateSyncTokenSample.js +12 -5
- package/dist-esm/samples-dev/updateSyncTokenSample.js.map +1 -1
- package/dist-esm/src/generated/src/appConfiguration.js +10 -18
- package/dist-esm/src/generated/src/appConfiguration.js.map +1 -1
- package/dist-esm/src/generated/src/models/index.js +17 -72
- package/dist-esm/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/src/generated/src/models/parameters.js +1 -78
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/test/public/featureFlag.spec.js +36 -22
- package/dist-esm/test/public/featureFlag.spec.js.map +1 -1
- package/dist-esm/test/public/secretReference.spec.js +35 -21
- package/dist-esm/test/public/secretReference.spec.js.map +1 -1
- package/dist-esm/test/public/utils/testHelpers.js +50 -22
- package/dist-esm/test/public/utils/testHelpers.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generated/src/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA6LH,qEAAqE;AACrE,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,wBAAwB;IACxB,iCAAY,CAAA;AACd,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAWD,sEAAsE;AACtE,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,iCAAW,CAAA;IACX,qCAAe,CAAA;IACf,kDAA4B,CAAA;IAC5B,qCAAe,CAAA;IACf,oDAA8B,CAAA;IAC9B,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,mCAAa,CAAA;AACf,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAkBD,uEAAuE;AACvE,MAAM,CAAN,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,sCAAe,CAAA;IACf,mDAA4B,CAAA;IAC5B,sCAAe,CAAA;IACf,qDAA8B,CAAA;IAC9B,oCAAa,CAAA;IACb,wCAAiB,CAAA;IACjB,oCAAa,CAAA;AACf,CAAC,EATW,mBAAmB,KAAnB,mBAAmB,QAS9B;AAkBD,sEAAsE;AACtE,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,iCAAW,CAAA;IACX,qCAAe,CAAA;IACf,kDAA4B,CAAA;IAC5B,qCAAe,CAAA;IACf,oDAA8B,CAAA;IAC9B,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,mCAAa,CAAA;AACf,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAkBD,uEAAuE;AACvE,MAAM,CAAN,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,sCAAe,CAAA;IACf,mDAA4B,CAAA;IAC5B,sCAAe,CAAA;IACf,qDAA8B,CAAA;IAC9B,oCAAa,CAAA;IACb,wCAAiB,CAAA;IACjB,oCAAa,CAAA;AACf,CAAC,EATW,mBAAmB,KAAnB,mBAAmB,QAS9B;AAkBD,8DAA8D;AAC9D,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,0CAA4B,CAAA;IAC5B,6BAAe,CAAA;IACf,4CAA8B,CAAA;IAC9B,2BAAa,CAAA;IACb,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACf,CAAC,EATW,UAAU,KAAV,UAAU,QASrB;AAkBD,8DAA8D;AAC9D,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,0CAA4B,CAAA;IAC5B,6BAAe,CAAA;IACf,4CAA8B,CAAA;IAC9B,2BAAa,CAAA;IACb,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACf,CAAC,EATW,UAAU,KAAV,UAAU,QASrB","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreHttpCompat from \"@azure/core-http-compat\";\n\n/** The result of a list request. */\nexport interface KeyListResult {\n /** The collection value. */\n items?: Key[];\n /** The URI that can be used to request the next set of paged results. */\n nextLink?: string;\n}\n\nexport interface Key {\n /** NOTE: This property will not be serialized. It can only be populated by the server. */\n readonly name?: string;\n}\n\n/** Azure App Configuration error object. */\nexport interface ErrorModel {\n /** The type of the error. */\n type?: string;\n /** A brief summary of the error. */\n title?: string;\n /** The name of the parameter that resulted in the error. */\n name?: string;\n /** A detailed description of the error. */\n detail?: string;\n /** The HTTP status code that the error maps to. */\n status?: number;\n}\n\n/** The result of a list request. */\nexport interface KeyValueListResult {\n /** The collection value. */\n items?: KeyValue[];\n /** The URI that can be used to request the next set of paged results. */\n nextLink?: string;\n}\n\nexport interface KeyValue {\n key: string;\n label?: string;\n contentType?: string;\n value?: string;\n lastModified?: Date;\n /** Dictionary of <string> */\n tags?: { [propertyName: string]: string };\n locked?: boolean;\n etag?: string;\n}\n\n/** The result of a list request. */\nexport interface LabelListResult {\n /** The collection value. */\n items?: Label[];\n /** The URI that can be used to request the next set of paged results. */\n nextLink?: string;\n}\n\nexport interface Label {\n /** NOTE: This property will not be serialized. It can only be populated by the server. */\n readonly name?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeys operation. */\nexport interface AppConfigurationGetKeysHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_checkKeys operation. */\nexport interface AppConfigurationCheckKeysHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeyValues operation. */\nexport interface AppConfigurationGetKeyValuesHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_checkKeyValues operation. */\nexport interface AppConfigurationCheckKeyValuesHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeyValue operation. */\nexport interface AppConfigurationGetKeyValueHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n /** A UTC datetime that specifies the last time the resource was modified. */\n lastModified?: string;\n}\n\n/** Defines headers for AppConfiguration_putKeyValue operation. */\nexport interface AppConfigurationPutKeyValueHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n}\n\n/** Defines headers for AppConfiguration_deleteKeyValue operation. */\nexport interface AppConfigurationDeleteKeyValueHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n}\n\n/** Defines headers for AppConfiguration_checkKeyValue operation. */\nexport interface AppConfigurationCheckKeyValueHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n /** A UTC datetime that specifies the last time the resource was modified. */\n lastModified?: string;\n}\n\n/** Defines headers for AppConfiguration_getLabels operation. */\nexport interface AppConfigurationGetLabelsHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_checkLabels operation. */\nexport interface AppConfigurationCheckLabelsHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_putLock operation. */\nexport interface AppConfigurationPutLockHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n}\n\n/** Defines headers for AppConfiguration_deleteLock operation. */\nexport interface AppConfigurationDeleteLockHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n}\n\n/** Defines headers for AppConfiguration_getRevisions operation. */\nexport interface AppConfigurationGetRevisionsHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_checkRevisions operation. */\nexport interface AppConfigurationCheckRevisionsHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeysNext operation. */\nexport interface AppConfigurationGetKeysNextHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeyValuesNext operation. */\nexport interface AppConfigurationGetKeyValuesNextHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getLabelsNext operation. */\nexport interface AppConfigurationGetLabelsNextHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getRevisionsNext operation. */\nexport interface AppConfigurationGetRevisionsNextHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Known values of {@link ApiVersion10} that the service accepts. */\nexport enum KnownApiVersion10 {\n /** Api Version '1.0' */\n One0 = \"1.0\"\n}\n\n/**\n * Defines values for ApiVersion10. \\\n * {@link KnownApiVersion10} can be used interchangeably with ApiVersion10,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **1.0**: Api Version '1.0'\n */\nexport type ApiVersion10 = string;\n\n/** Known values of {@link Get6ItemsItem} that the service accepts. */\nexport enum KnownGet6ItemsItem {\n Key = \"key\",\n Label = \"label\",\n ContentType = \"content_type\",\n Value = \"value\",\n LastModified = \"last_modified\",\n Tags = \"tags\",\n Locked = \"locked\",\n Etag = \"etag\"\n}\n\n/**\n * Defines values for Get6ItemsItem. \\\n * {@link KnownGet6ItemsItem} can be used interchangeably with Get6ItemsItem,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **key** \\\n * **label** \\\n * **content_type** \\\n * **value** \\\n * **last_modified** \\\n * **tags** \\\n * **locked** \\\n * **etag**\n */\nexport type Get6ItemsItem = string;\n\n/** Known values of {@link Head6ItemsItem} that the service accepts. */\nexport enum KnownHead6ItemsItem {\n Key = \"key\",\n Label = \"label\",\n ContentType = \"content_type\",\n Value = \"value\",\n LastModified = \"last_modified\",\n Tags = \"tags\",\n Locked = \"locked\",\n Etag = \"etag\"\n}\n\n/**\n * Defines values for Head6ItemsItem. \\\n * {@link KnownHead6ItemsItem} can be used interchangeably with Head6ItemsItem,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **key** \\\n * **label** \\\n * **content_type** \\\n * **value** \\\n * **last_modified** \\\n * **tags** \\\n * **locked** \\\n * **etag**\n */\nexport type Head6ItemsItem = string;\n\n/** Known values of {@link Get7ItemsItem} that the service accepts. */\nexport enum KnownGet7ItemsItem {\n Key = \"key\",\n Label = \"label\",\n ContentType = \"content_type\",\n Value = \"value\",\n LastModified = \"last_modified\",\n Tags = \"tags\",\n Locked = \"locked\",\n Etag = \"etag\"\n}\n\n/**\n * Defines values for Get7ItemsItem. \\\n * {@link KnownGet7ItemsItem} can be used interchangeably with Get7ItemsItem,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **key** \\\n * **label** \\\n * **content_type** \\\n * **value** \\\n * **last_modified** \\\n * **tags** \\\n * **locked** \\\n * **etag**\n */\nexport type Get7ItemsItem = string;\n\n/** Known values of {@link Head7ItemsItem} that the service accepts. */\nexport enum KnownHead7ItemsItem {\n Key = \"key\",\n Label = \"label\",\n ContentType = \"content_type\",\n Value = \"value\",\n LastModified = \"last_modified\",\n Tags = \"tags\",\n Locked = \"locked\",\n Etag = \"etag\"\n}\n\n/**\n * Defines values for Head7ItemsItem. \\\n * {@link KnownHead7ItemsItem} can be used interchangeably with Head7ItemsItem,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **key** \\\n * **label** \\\n * **content_type** \\\n * **value** \\\n * **last_modified** \\\n * **tags** \\\n * **locked** \\\n * **etag**\n */\nexport type Head7ItemsItem = string;\n\n/** Known values of {@link Enum5} that the service accepts. */\nexport enum KnownEnum5 {\n Key = \"key\",\n Label = \"label\",\n ContentType = \"content_type\",\n Value = \"value\",\n LastModified = \"last_modified\",\n Tags = \"tags\",\n Locked = \"locked\",\n Etag = \"etag\"\n}\n\n/**\n * Defines values for Enum5. \\\n * {@link KnownEnum5} can be used interchangeably with Enum5,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **key** \\\n * **label** \\\n * **content_type** \\\n * **value** \\\n * **last_modified** \\\n * **tags** \\\n * **locked** \\\n * **etag**\n */\nexport type Enum5 = string;\n\n/** Known values of {@link Enum6} that the service accepts. */\nexport enum KnownEnum6 {\n Key = \"key\",\n Label = \"label\",\n ContentType = \"content_type\",\n Value = \"value\",\n LastModified = \"last_modified\",\n Tags = \"tags\",\n Locked = \"locked\",\n Etag = \"etag\"\n}\n\n/**\n * Defines values for Enum6. \\\n * {@link KnownEnum6} can be used interchangeably with Enum6,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **key** \\\n * **label** \\\n * **content_type** \\\n * **value** \\\n * **last_modified** \\\n * **tags** \\\n * **locked** \\\n * **etag**\n */\nexport type Enum6 = string;\n\n/** Optional parameters. */\nexport interface GetKeysOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned keys. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n}\n\n/** Contains response data for the getKeys operation. */\nexport type GetKeysResponse = AppConfigurationGetKeysHeaders & KeyListResult;\n\n/** Optional parameters. */\nexport interface CheckKeysOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned keys. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n}\n\n/** Contains response data for the checkKeys operation. */\nexport type CheckKeysResponse = AppConfigurationCheckKeysHeaders;\n\n/** Optional parameters. */\nexport interface GetKeyValuesOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: Get6ItemsItem[];\n}\n\n/** Contains response data for the getKeyValues operation. */\nexport type GetKeyValuesResponse = AppConfigurationGetKeyValuesHeaders &\n KeyValueListResult;\n\n/** Optional parameters. */\nexport interface CheckKeyValuesOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: Head6ItemsItem[];\n}\n\n/** Contains response data for the checkKeyValues operation. */\nexport type CheckKeyValuesResponse = AppConfigurationCheckKeyValuesHeaders;\n\n/** Optional parameters. */\nexport interface GetKeyValueOptionalParams extends coreClient.OperationOptions {\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** The label of the key-value to retrieve. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: Get7ItemsItem[];\n}\n\n/** Contains response data for the getKeyValue operation. */\nexport type GetKeyValueResponse = AppConfigurationGetKeyValueHeaders & KeyValue;\n\n/** Optional parameters. */\nexport interface PutKeyValueOptionalParams extends coreClient.OperationOptions {\n /** The label of the key-value to create. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n /** The key-value to create. */\n entity?: KeyValue;\n}\n\n/** Contains response data for the putKeyValue operation. */\nexport type PutKeyValueResponse = AppConfigurationPutKeyValueHeaders & KeyValue;\n\n/** Optional parameters. */\nexport interface DeleteKeyValueOptionalParams\n extends coreClient.OperationOptions {\n /** The label of the key-value to delete. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n}\n\n/** Contains response data for the deleteKeyValue operation. */\nexport type DeleteKeyValueResponse = AppConfigurationDeleteKeyValueHeaders &\n KeyValue;\n\n/** Optional parameters. */\nexport interface CheckKeyValueOptionalParams\n extends coreClient.OperationOptions {\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** The label of the key-value to retrieve. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: Head7ItemsItem[];\n}\n\n/** Contains response data for the checkKeyValue operation. */\nexport type CheckKeyValueResponse = AppConfigurationCheckKeyValueHeaders;\n\n/** Optional parameters. */\nexport interface GetLabelsOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned labels. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: string[];\n}\n\n/** Contains response data for the getLabels operation. */\nexport type GetLabelsResponse = AppConfigurationGetLabelsHeaders &\n LabelListResult;\n\n/** Optional parameters. */\nexport interface CheckLabelsOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned labels. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: string[];\n}\n\n/** Contains response data for the checkLabels operation. */\nexport type CheckLabelsResponse = AppConfigurationCheckLabelsHeaders;\n\n/** Optional parameters. */\nexport interface PutLockOptionalParams extends coreClient.OperationOptions {\n /** The label, if any, of the key-value to lock. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n}\n\n/** Contains response data for the putLock operation. */\nexport type PutLockResponse = AppConfigurationPutLockHeaders & KeyValue;\n\n/** Optional parameters. */\nexport interface DeleteLockOptionalParams extends coreClient.OperationOptions {\n /** The label, if any, of the key-value to unlock. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n}\n\n/** Contains response data for the deleteLock operation. */\nexport type DeleteLockResponse = AppConfigurationDeleteLockHeaders & KeyValue;\n\n/** Optional parameters. */\nexport interface GetRevisionsOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: Enum5[];\n}\n\n/** Contains response data for the getRevisions operation. */\nexport type GetRevisionsResponse = AppConfigurationGetRevisionsHeaders &\n KeyValueListResult;\n\n/** Optional parameters. */\nexport interface CheckRevisionsOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: Enum6[];\n}\n\n/** Contains response data for the checkRevisions operation. */\nexport type CheckRevisionsResponse = AppConfigurationCheckRevisionsHeaders;\n\n/** Optional parameters. */\nexport interface GetKeysNextOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned keys. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n}\n\n/** Contains response data for the getKeysNext operation. */\nexport type GetKeysNextResponse = AppConfigurationGetKeysNextHeaders &\n KeyListResult;\n\n/** Optional parameters. */\nexport interface GetKeyValuesNextOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: Get6ItemsItem[];\n}\n\n/** Contains response data for the getKeyValuesNext operation. */\nexport type GetKeyValuesNextResponse = AppConfigurationGetKeyValuesNextHeaders &\n KeyValueListResult;\n\n/** Optional parameters. */\nexport interface GetLabelsNextOptionalParams\n extends coreClient.OperationOptions {\n /** A filter for the name of the returned labels. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: string[];\n}\n\n/** Contains response data for the getLabelsNext operation. */\nexport type GetLabelsNextResponse = AppConfigurationGetLabelsNextHeaders &\n LabelListResult;\n\n/** Optional parameters. */\nexport interface GetRevisionsNextOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: Enum5[];\n}\n\n/** Contains response data for the getRevisionsNext operation. */\nexport type GetRevisionsNextResponse = AppConfigurationGetRevisionsNextHeaders &\n KeyValueListResult;\n\n/** Optional parameters. */\nexport interface AppConfigurationOptionalParams\n extends coreHttpCompat.ExtendedServiceClientOptions {\n /** Used to guarantee real-time consistency between requests. */\n syncToken?: string;\n /** Overrides client endpoint. */\n endpoint?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generated/src/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA6LH,qEAAqE;AACrE,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,wBAAwB;IACxB,iCAAY,CAAA;AACd,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAWD,uEAAuE;AACvE,MAAM,CAAN,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,sCAAe,CAAA;IACf,mDAA4B,CAAA;IAC5B,sCAAe,CAAA;IACf,qDAA8B,CAAA;IAC9B,oCAAa,CAAA;IACb,wCAAiB,CAAA;IACjB,oCAAa,CAAA;AACf,CAAC,EATW,mBAAmB,KAAnB,mBAAmB,QAS9B;AAkBD,oEAAoE;AACpE,MAAM,CAAN,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;AACf,CAAC,EAFW,gBAAgB,KAAhB,gBAAgB,QAE3B","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreHttpCompat from \"@azure/core-http-compat\";\n\n/** The result of a list request. */\nexport interface KeyListResult {\n /** The collection value. */\n items?: Key[];\n /** The URI that can be used to request the next set of paged results. */\n nextLink?: string;\n}\n\nexport interface Key {\n /** NOTE: This property will not be serialized. It can only be populated by the server. */\n readonly name?: string;\n}\n\n/** Azure App Configuration error object. */\nexport interface ErrorModel {\n /** The type of the error. */\n type?: string;\n /** A brief summary of the error. */\n title?: string;\n /** The name of the parameter that resulted in the error. */\n name?: string;\n /** A detailed description of the error. */\n detail?: string;\n /** The HTTP status code that the error maps to. */\n status?: number;\n}\n\n/** The result of a list request. */\nexport interface KeyValueListResult {\n /** The collection value. */\n items?: KeyValue[];\n /** The URI that can be used to request the next set of paged results. */\n nextLink?: string;\n}\n\nexport interface KeyValue {\n key: string;\n label?: string;\n contentType?: string;\n value?: string;\n lastModified?: Date;\n /** Dictionary of <string> */\n tags?: { [propertyName: string]: string };\n locked?: boolean;\n etag?: string;\n}\n\n/** The result of a list request. */\nexport interface LabelListResult {\n /** The collection value. */\n items?: Label[];\n /** The URI that can be used to request the next set of paged results. */\n nextLink?: string;\n}\n\nexport interface Label {\n /** NOTE: This property will not be serialized. It can only be populated by the server. */\n readonly name?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeys operation. */\nexport interface AppConfigurationGetKeysHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_checkKeys operation. */\nexport interface AppConfigurationCheckKeysHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeyValues operation. */\nexport interface AppConfigurationGetKeyValuesHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_checkKeyValues operation. */\nexport interface AppConfigurationCheckKeyValuesHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeyValue operation. */\nexport interface AppConfigurationGetKeyValueHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n /** A UTC datetime that specifies the last time the resource was modified. */\n lastModified?: string;\n}\n\n/** Defines headers for AppConfiguration_putKeyValue operation. */\nexport interface AppConfigurationPutKeyValueHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n}\n\n/** Defines headers for AppConfiguration_deleteKeyValue operation. */\nexport interface AppConfigurationDeleteKeyValueHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n}\n\n/** Defines headers for AppConfiguration_checkKeyValue operation. */\nexport interface AppConfigurationCheckKeyValueHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n /** A UTC datetime that specifies the last time the resource was modified. */\n lastModified?: string;\n}\n\n/** Defines headers for AppConfiguration_getLabels operation. */\nexport interface AppConfigurationGetLabelsHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_checkLabels operation. */\nexport interface AppConfigurationCheckLabelsHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_putLock operation. */\nexport interface AppConfigurationPutLockHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n}\n\n/** Defines headers for AppConfiguration_deleteLock operation. */\nexport interface AppConfigurationDeleteLockHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n /** An identifier representing the returned state of the resource. */\n eTag?: string;\n}\n\n/** Defines headers for AppConfiguration_getRevisions operation. */\nexport interface AppConfigurationGetRevisionsHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_checkRevisions operation. */\nexport interface AppConfigurationCheckRevisionsHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeysNext operation. */\nexport interface AppConfigurationGetKeysNextHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getKeyValuesNext operation. */\nexport interface AppConfigurationGetKeyValuesNextHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getLabelsNext operation. */\nexport interface AppConfigurationGetLabelsNextHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Defines headers for AppConfiguration_getRevisionsNext operation. */\nexport interface AppConfigurationGetRevisionsNextHeaders {\n /** Enables real-time consistency between requests by providing the returned value in the next request made to the server. */\n syncToken?: string;\n}\n\n/** Known values of {@link ApiVersion10} that the service accepts. */\nexport enum KnownApiVersion10 {\n /** Api Version '1.0' */\n One0 = \"1.0\"\n}\n\n/**\n * Defines values for ApiVersion10. \\\n * {@link KnownApiVersion10} can be used interchangeably with ApiVersion10,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **1.0**: Api Version '1.0'\n */\nexport type ApiVersion10 = string;\n\n/** Known values of {@link KeyValueFields} that the service accepts. */\nexport enum KnownKeyValueFields {\n Key = \"key\",\n Label = \"label\",\n ContentType = \"content_type\",\n Value = \"value\",\n LastModified = \"last_modified\",\n Tags = \"tags\",\n Locked = \"locked\",\n Etag = \"etag\"\n}\n\n/**\n * Defines values for KeyValueFields. \\\n * {@link KnownKeyValueFields} can be used interchangeably with KeyValueFields,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **key** \\\n * **label** \\\n * **content_type** \\\n * **value** \\\n * **last_modified** \\\n * **tags** \\\n * **locked** \\\n * **etag**\n */\nexport type KeyValueFields = string;\n\n/** Known values of {@link LabelFields} that the service accepts. */\nexport enum KnownLabelFields {\n Name = \"name\"\n}\n\n/**\n * Defines values for LabelFields. \\\n * {@link KnownLabelFields} can be used interchangeably with LabelFields,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **name**\n */\nexport type LabelFields = string;\n\n/** Optional parameters. */\nexport interface GetKeysOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned keys. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n}\n\n/** Contains response data for the getKeys operation. */\nexport type GetKeysResponse = AppConfigurationGetKeysHeaders & KeyListResult;\n\n/** Optional parameters. */\nexport interface CheckKeysOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned keys. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n}\n\n/** Contains response data for the checkKeys operation. */\nexport type CheckKeysResponse = AppConfigurationCheckKeysHeaders;\n\n/** Optional parameters. */\nexport interface GetKeyValuesOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: KeyValueFields[];\n}\n\n/** Contains response data for the getKeyValues operation. */\nexport type GetKeyValuesResponse = AppConfigurationGetKeyValuesHeaders &\n KeyValueListResult;\n\n/** Optional parameters. */\nexport interface CheckKeyValuesOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: KeyValueFields[];\n}\n\n/** Contains response data for the checkKeyValues operation. */\nexport type CheckKeyValuesResponse = AppConfigurationCheckKeyValuesHeaders;\n\n/** Optional parameters. */\nexport interface GetKeyValueOptionalParams extends coreClient.OperationOptions {\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** The label of the key-value to retrieve. */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: KeyValueFields[];\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n}\n\n/** Contains response data for the getKeyValue operation. */\nexport type GetKeyValueResponse = AppConfigurationGetKeyValueHeaders & KeyValue;\n\n/** Optional parameters. */\nexport interface PutKeyValueOptionalParams extends coreClient.OperationOptions {\n /** The label of the key-value to create. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n /** The key-value to create. */\n entity?: KeyValue;\n}\n\n/** Contains response data for the putKeyValue operation. */\nexport type PutKeyValueResponse = AppConfigurationPutKeyValueHeaders & KeyValue;\n\n/** Optional parameters. */\nexport interface DeleteKeyValueOptionalParams\n extends coreClient.OperationOptions {\n /** The label of the key-value to delete. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n}\n\n/** Contains response data for the deleteKeyValue operation. */\nexport type DeleteKeyValueResponse = AppConfigurationDeleteKeyValueHeaders &\n KeyValue;\n\n/** Optional parameters. */\nexport interface CheckKeyValueOptionalParams\n extends coreClient.OperationOptions {\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** The label of the key-value to retrieve. */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: KeyValueFields[];\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n}\n\n/** Contains response data for the checkKeyValue operation. */\nexport type CheckKeyValueResponse = AppConfigurationCheckKeyValueHeaders;\n\n/** Optional parameters. */\nexport interface GetLabelsOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned labels. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: LabelFields[];\n}\n\n/** Contains response data for the getLabels operation. */\nexport type GetLabelsResponse = AppConfigurationGetLabelsHeaders &\n LabelListResult;\n\n/** Optional parameters. */\nexport interface CheckLabelsOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned labels. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: LabelFields[];\n}\n\n/** Contains response data for the checkLabels operation. */\nexport type CheckLabelsResponse = AppConfigurationCheckLabelsHeaders;\n\n/** Optional parameters. */\nexport interface PutLockOptionalParams extends coreClient.OperationOptions {\n /** The label, if any, of the key-value to lock. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n}\n\n/** Contains response data for the putLock operation. */\nexport type PutLockResponse = AppConfigurationPutLockHeaders & KeyValue;\n\n/** Optional parameters. */\nexport interface DeleteLockOptionalParams extends coreClient.OperationOptions {\n /** The label, if any, of the key-value to unlock. */\n label?: string;\n /** Used to perform an operation only if the targeted resource's etag matches the value provided. */\n ifMatch?: string;\n /** Used to perform an operation only if the targeted resource's etag does not match the value provided. */\n ifNoneMatch?: string;\n}\n\n/** Contains response data for the deleteLock operation. */\nexport type DeleteLockResponse = AppConfigurationDeleteLockHeaders & KeyValue;\n\n/** Optional parameters. */\nexport interface GetRevisionsOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: KeyValueFields[];\n}\n\n/** Contains response data for the getRevisions operation. */\nexport type GetRevisionsResponse = AppConfigurationGetRevisionsHeaders &\n KeyValueListResult;\n\n/** Optional parameters. */\nexport interface CheckRevisionsOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: KeyValueFields[];\n}\n\n/** Contains response data for the checkRevisions operation. */\nexport type CheckRevisionsResponse = AppConfigurationCheckRevisionsHeaders;\n\n/** Optional parameters. */\nexport interface GetKeysNextOptionalParams extends coreClient.OperationOptions {\n /** A filter for the name of the returned keys. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n}\n\n/** Contains response data for the getKeysNext operation. */\nexport type GetKeysNextResponse = AppConfigurationGetKeysNextHeaders &\n KeyListResult;\n\n/** Optional parameters. */\nexport interface GetKeyValuesNextOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: KeyValueFields[];\n}\n\n/** Contains response data for the getKeyValuesNext operation. */\nexport type GetKeyValuesNextResponse = AppConfigurationGetKeyValuesNextHeaders &\n KeyValueListResult;\n\n/** Optional parameters. */\nexport interface GetLabelsNextOptionalParams\n extends coreClient.OperationOptions {\n /** A filter for the name of the returned labels. */\n name?: string;\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: LabelFields[];\n}\n\n/** Contains response data for the getLabelsNext operation. */\nexport type GetLabelsNextResponse = AppConfigurationGetLabelsNextHeaders &\n LabelListResult;\n\n/** Optional parameters. */\nexport interface GetRevisionsNextOptionalParams\n extends coreClient.OperationOptions {\n /** Instructs the server to return elements that appear after the element referred to by the specified token. */\n after?: string;\n /** Requests the server to respond with the state of the resource at the specified time. */\n acceptDatetime?: string;\n /** A filter used to match keys. */\n key?: string;\n /** A filter used to match labels */\n label?: string;\n /** Used to select what fields are present in the returned resource(s). */\n select?: KeyValueFields[];\n}\n\n/** Contains response data for the getRevisionsNext operation. */\nexport type GetRevisionsNextResponse = AppConfigurationGetRevisionsNextHeaders &\n KeyValueListResult;\n\n/** Optional parameters. */\nexport interface AppConfigurationOptionalParams\n extends coreHttpCompat.ExtendedServiceClientOptions {\n /** Used to guarantee real-time consistency between requests. */\n syncToken?: string;\n /** Overrides client endpoint. */\n endpoint?: string;\n}\n"]}
|
|
@@ -118,21 +118,6 @@ export const select = {
|
|
|
118
118
|
},
|
|
119
119
|
collectionFormat: "CSV"
|
|
120
120
|
};
|
|
121
|
-
export const select1 = {
|
|
122
|
-
parameterPath: ["options", "select"],
|
|
123
|
-
mapper: {
|
|
124
|
-
serializedName: "$Select",
|
|
125
|
-
type: {
|
|
126
|
-
name: "Sequence",
|
|
127
|
-
element: {
|
|
128
|
-
type: {
|
|
129
|
-
name: "String"
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
collectionFormat: "CSV"
|
|
135
|
-
};
|
|
136
121
|
export const accept2 = {
|
|
137
122
|
parameterPath: "accept",
|
|
138
123
|
mapper: {
|
|
@@ -172,21 +157,6 @@ export const ifNoneMatch = {
|
|
|
172
157
|
}
|
|
173
158
|
}
|
|
174
159
|
};
|
|
175
|
-
export const select2 = {
|
|
176
|
-
parameterPath: ["options", "select"],
|
|
177
|
-
mapper: {
|
|
178
|
-
serializedName: "$Select",
|
|
179
|
-
type: {
|
|
180
|
-
name: "Sequence",
|
|
181
|
-
element: {
|
|
182
|
-
type: {
|
|
183
|
-
name: "String"
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
collectionFormat: "CSV"
|
|
189
|
-
};
|
|
190
160
|
export const contentType = {
|
|
191
161
|
parameterPath: ["options", "contentType"],
|
|
192
162
|
mapper: {
|
|
@@ -202,21 +172,6 @@ export const entity = {
|
|
|
202
172
|
parameterPath: ["options", "entity"],
|
|
203
173
|
mapper: KeyValueMapper
|
|
204
174
|
};
|
|
205
|
-
export const select3 = {
|
|
206
|
-
parameterPath: ["options", "select"],
|
|
207
|
-
mapper: {
|
|
208
|
-
serializedName: "$Select",
|
|
209
|
-
type: {
|
|
210
|
-
name: "Sequence",
|
|
211
|
-
element: {
|
|
212
|
-
type: {
|
|
213
|
-
name: "String"
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
collectionFormat: "CSV"
|
|
219
|
-
};
|
|
220
175
|
export const accept3 = {
|
|
221
176
|
parameterPath: "accept",
|
|
222
177
|
mapper: {
|
|
@@ -228,39 +183,7 @@ export const accept3 = {
|
|
|
228
183
|
}
|
|
229
184
|
}
|
|
230
185
|
};
|
|
231
|
-
export const
|
|
232
|
-
parameterPath: ["options", "select"],
|
|
233
|
-
mapper: {
|
|
234
|
-
serializedName: "$Select",
|
|
235
|
-
type: {
|
|
236
|
-
name: "Sequence",
|
|
237
|
-
element: {
|
|
238
|
-
defaultValue: "name",
|
|
239
|
-
isConstant: true,
|
|
240
|
-
type: {
|
|
241
|
-
name: "String"
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
collectionFormat: "CSV"
|
|
247
|
-
};
|
|
248
|
-
export const select5 = {
|
|
249
|
-
parameterPath: ["options", "select"],
|
|
250
|
-
mapper: {
|
|
251
|
-
serializedName: "$Select",
|
|
252
|
-
type: {
|
|
253
|
-
name: "Sequence",
|
|
254
|
-
element: {
|
|
255
|
-
type: {
|
|
256
|
-
name: "String"
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
},
|
|
261
|
-
collectionFormat: "CSV"
|
|
262
|
-
};
|
|
263
|
-
export const select6 = {
|
|
186
|
+
export const select1 = {
|
|
264
187
|
parameterPath: ["options", "select"],
|
|
265
188
|
mapper: {
|
|
266
189
|
serializedName: "$Select",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../../src/generated/src/models/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,CAAC,MAAM,MAAM,GAAuB;IACxC,aAAa,EAAE,QAAQ;IACvB,MAAM,EAAE;QACN,YAAY,EACV,6FAA6F;QAC/F,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,QAAQ;QACxB,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAA0B;IAC7C,aAAa,EAAE,UAAU;IACzB,MAAM,EAAE;QACN,cAAc,EAAE,UAAU;QAC1B,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;IACD,YAAY,EAAE,IAAI;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAA4B;IAC3C,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IAClC,MAAM,EAAE;QACN,cAAc,EAAE,MAAM;QACtB,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAuB;IAC3C,aAAa,E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AE,QAAQ;SACf;KACF;IACD,YAAY,EAAE,IAAI;CACnB,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport { KeyValue as KeyValueMapper } from \"../models/mappers\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue:\n \"application/vnd.microsoft.appconfig.keyset+json, application/json, application/problem+json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const endpoint: OperationURLParameter = {\n parameterPath: \"endpoint\",\n mapper: {\n serializedName: \"endpoint\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const name: OperationQueryParameter = {\n parameterPath: [\"options\", \"name\"],\n mapper: {\n serializedName: \"name\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const syncToken: OperationParameter = {\n parameterPath: \"syncToken\",\n mapper: {\n serializedName: \"Sync-Token\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const apiVersion: OperationQueryParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n serializedName: \"api-version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const after: OperationQueryParameter = {\n parameterPath: [\"options\", \"after\"],\n mapper: {\n serializedName: \"After\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const acceptDatetime: OperationParameter = {\n parameterPath: [\"options\", \"acceptDatetime\"],\n mapper: {\n serializedName: \"Accept-Datetime\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const accept1: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue:\n \"application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const key: OperationQueryParameter = {\n parameterPath: [\"options\", \"key\"],\n mapper: {\n serializedName: \"key\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const label: OperationQueryParameter = {\n parameterPath: [\"options\", \"label\"],\n mapper: {\n serializedName: \"label\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const select: OperationQueryParameter = {\n parameterPath: [\"options\", \"select\"],\n mapper: {\n serializedName: \"$Select\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const select1: OperationQueryParameter = {\n parameterPath: [\"options\", \"select\"],\n mapper: {\n serializedName: \"$Select\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const accept2: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue:\n \"application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const key1: OperationURLParameter = {\n parameterPath: \"key\",\n mapper: {\n serializedName: \"key\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const ifMatch: OperationParameter = {\n parameterPath: [\"options\", \"ifMatch\"],\n mapper: {\n serializedName: \"If-Match\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const ifNoneMatch: OperationParameter = {\n parameterPath: [\"options\", \"ifNoneMatch\"],\n mapper: {\n serializedName: \"If-None-Match\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const select2: OperationQueryParameter = {\n parameterPath: [\"options\", \"select\"],\n mapper: {\n serializedName: \"$Select\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/vnd.microsoft.appconfig.kv+json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const entity: OperationParameter = {\n parameterPath: [\"options\", \"entity\"],\n mapper: KeyValueMapper\n};\n\nexport const select3: OperationQueryParameter = {\n parameterPath: [\"options\", \"select\"],\n mapper: {\n serializedName: \"$Select\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const accept3: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue:\n \"application/vnd.microsoft.appconfig.labelset+json, application/json, application/problem+json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const select4: OperationQueryParameter = {\n parameterPath: [\"options\", \"select\"],\n mapper: {\n serializedName: \"$Select\",\n type: {\n name: \"Sequence\",\n element: {\n defaultValue: \"name\",\n isConstant: true,\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const select5: OperationQueryParameter = {\n parameterPath: [\"options\", \"select\"],\n mapper: {\n serializedName: \"$Select\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const select6: OperationQueryParameter = {\n parameterPath: [\"options\", \"select\"],\n mapper: {\n serializedName: \"$Select\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const nextLink: OperationURLParameter = {\n parameterPath: \"nextLink\",\n mapper: {\n serializedName: \"nextLink\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n"]}
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../../src/generated/src/models/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,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A4B;IAC9C,aAAa,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACpC,MAAM,EAAE;QACN,cAAc,EAAE,SAAS;QACzB,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;IACD,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAA0B;IAC7C,aAAa,EAAE,UAAU;IACzB,MAAM,EAAE;QACN,cAAc,EAAE,UAAU;QAC1B,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;IACD,YAAY,EAAE,IAAI;CACnB,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport { KeyValue as KeyValueMapper } from \"../models/mappers\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue:\n \"application/vnd.microsoft.appconfig.keyset+json, application/json, application/problem+json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const endpoint: OperationURLParameter = {\n parameterPath: \"endpoint\",\n mapper: {\n serializedName: \"endpoint\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const name: OperationQueryParameter = {\n parameterPath: [\"options\", \"name\"],\n mapper: {\n serializedName: \"name\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const syncToken: OperationParameter = {\n parameterPath: \"syncToken\",\n mapper: {\n serializedName: \"Sync-Token\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const apiVersion: OperationQueryParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n serializedName: \"api-version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const after: OperationQueryParameter = {\n parameterPath: [\"options\", \"after\"],\n mapper: {\n serializedName: \"After\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const acceptDatetime: OperationParameter = {\n parameterPath: [\"options\", \"acceptDatetime\"],\n mapper: {\n serializedName: \"Accept-Datetime\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const accept1: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue:\n \"application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const key: OperationQueryParameter = {\n parameterPath: [\"options\", \"key\"],\n mapper: {\n serializedName: \"key\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const label: OperationQueryParameter = {\n parameterPath: [\"options\", \"label\"],\n mapper: {\n serializedName: \"label\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const select: OperationQueryParameter = {\n parameterPath: [\"options\", \"select\"],\n mapper: {\n serializedName: \"$Select\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const accept2: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue:\n \"application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const key1: OperationURLParameter = {\n parameterPath: \"key\",\n mapper: {\n serializedName: \"key\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const ifMatch: OperationParameter = {\n parameterPath: [\"options\", \"ifMatch\"],\n mapper: {\n serializedName: \"If-Match\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const ifNoneMatch: OperationParameter = {\n parameterPath: [\"options\", \"ifNoneMatch\"],\n mapper: {\n serializedName: \"If-None-Match\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/vnd.microsoft.appconfig.kv+json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const entity: OperationParameter = {\n parameterPath: [\"options\", \"entity\"],\n mapper: KeyValueMapper\n};\n\nexport const accept3: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue:\n \"application/vnd.microsoft.appconfig.labelset+json, application/json, application/problem+json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const select1: OperationQueryParameter = {\n parameterPath: [\"options\", \"select\"],\n mapper: {\n serializedName: \"$Select\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const nextLink: OperationURLParameter = {\n parameterPath: \"nextLink\",\n mapper: {\n serializedName: \"nextLink\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n"]}
|
|
@@ -98,53 +98,67 @@ describe("AppConfigurationClient - FeatureFlag", () => {
|
|
|
98
98
|
assertFeatureFlagProps(getResponseAfterUpdate, Object.assign(Object.assign({}, baseSetting), { value: Object.assign(Object.assign({}, baseSetting.value), { enabled: !baseSetting.value.enabled }) }));
|
|
99
99
|
});
|
|
100
100
|
it("can add, list and update multiple FeatureFlags", async () => {
|
|
101
|
-
var e_1,
|
|
101
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
|
102
102
|
const secondSetting = Object.assign(Object.assign({}, baseSetting), { key: `${baseSetting.key}-2` });
|
|
103
103
|
await client.addConfigurationSetting(secondSetting);
|
|
104
104
|
let numberOFFeatureFlagsReceived = 0;
|
|
105
105
|
try {
|
|
106
|
-
for (var
|
|
106
|
+
for (var _g = true, _h = __asyncValues(client.listConfigurationSettings({
|
|
107
107
|
keyFilter: `${baseSetting.key}*`,
|
|
108
|
-
})),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
})), _j; _j = await _h.next(), _a = _j.done, !_a;) {
|
|
109
|
+
_c = _j.value;
|
|
110
|
+
_g = false;
|
|
111
|
+
try {
|
|
112
|
+
const setting = _c;
|
|
113
|
+
numberOFFeatureFlagsReceived++;
|
|
114
|
+
if (setting.key === baseSetting.key) {
|
|
115
|
+
assertFeatureFlagProps(setting, baseSetting);
|
|
116
|
+
await client.setConfigurationSetting(Object.assign(Object.assign({}, baseSetting), { value: Object.assign(Object.assign({}, baseSetting.value), { enabled: !baseSetting.value.enabled }) }));
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
assertFeatureFlagProps(setting, secondSetting);
|
|
120
|
+
const parsedSetting = parseFeatureFlag(setting);
|
|
121
|
+
await client.setConfigurationSetting(Object.assign(Object.assign({}, parsedSetting), { value: Object.assign(Object.assign({}, parsedSetting.value), { description: "I'm new description" }) }));
|
|
122
|
+
}
|
|
114
123
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const parsedSetting = parseFeatureFlag(setting);
|
|
118
|
-
await client.setConfigurationSetting(Object.assign(Object.assign({}, parsedSetting), { value: Object.assign(Object.assign({}, parsedSetting.value), { description: "I'm new description" }) }));
|
|
124
|
+
finally {
|
|
125
|
+
_g = true;
|
|
119
126
|
}
|
|
120
127
|
}
|
|
121
128
|
}
|
|
122
129
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
123
130
|
finally {
|
|
124
131
|
try {
|
|
125
|
-
if (
|
|
132
|
+
if (!_g && !_a && (_b = _h.return)) await _b.call(_h);
|
|
126
133
|
}
|
|
127
134
|
finally { if (e_1) throw e_1.error; }
|
|
128
135
|
}
|
|
129
136
|
assert.equal(numberOFFeatureFlagsReceived, 2, "Unexpected number of FeatureFlags seen");
|
|
130
137
|
try {
|
|
131
|
-
for (var
|
|
138
|
+
for (var _k = true, _l = __asyncValues(client.listConfigurationSettings({
|
|
132
139
|
keyFilter: `${baseSetting.key}*`,
|
|
133
|
-
})),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
})), _m; _m = await _l.next(), _d = _m.done, !_d;) {
|
|
141
|
+
_f = _m.value;
|
|
142
|
+
_k = false;
|
|
143
|
+
try {
|
|
144
|
+
const setting = _f;
|
|
145
|
+
numberOFFeatureFlagsReceived--;
|
|
146
|
+
if (setting.key === baseSetting.key) {
|
|
147
|
+
assertFeatureFlagProps(setting, Object.assign(Object.assign({}, baseSetting), { value: Object.assign(Object.assign({}, baseSetting.value), { enabled: !baseSetting.value.enabled }) }));
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
assertFeatureFlagProps(setting, Object.assign(Object.assign({}, secondSetting), { value: Object.assign(Object.assign({}, secondSetting.value), { description: "I'm new description" }) }));
|
|
151
|
+
}
|
|
138
152
|
}
|
|
139
|
-
|
|
140
|
-
|
|
153
|
+
finally {
|
|
154
|
+
_k = true;
|
|
141
155
|
}
|
|
142
156
|
}
|
|
143
157
|
}
|
|
144
158
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
145
159
|
finally {
|
|
146
160
|
try {
|
|
147
|
-
if (
|
|
161
|
+
if (!_k && !_d && (_e = _l.return)) await _e.call(_l);
|
|
148
162
|
}
|
|
149
163
|
finally { if (e_2) throw e_2.error; }
|
|
150
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featureFlag.spec.js","sourceRoot":"","sources":["../../../test/public/featureFlag.spec.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAIL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAoB,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,oCAAoC,EAAE,aAAa,EAAE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Q,CAC3C,QAAQ,EACR,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAC5C,EAAE;gBACH,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;aAC5D,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,KAAK;YACb,MAAM,MAAM,CAAC,0BAA0B,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC;YAClE,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACtC,EAAE,CAAC,oBAAoB,KAAK,wBAAwB,EAAE,KAAK,IAAI,EAAE;gBAC/D,WAAW,CAAC,KAAK,GAAG,KAAY,CAAC;gBACjC,MAAM,MAAM,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;gBAClD,MAAM,CAAC,KAAK,CACV,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EACtE,KAAK,EACL,SAAS,CACV,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AddConfigurationSettingResponse,\n AppConfigurationClient,\n ConfigurationSetting,\n featureFlagContentType,\n featureFlagPrefix,\n} from \"../../src\";\nimport { FeatureFlagValue, isFeatureFlag, parseFeatureFlag } from \"../../src/featureFlag\";\nimport { Recorder } from \"@azure-tools/test-recorder\";\nimport { createAppConfigurationClientForTests, startRecorder } from \"./utils/testHelpers\";\nimport { Context } from \"mocha\";\nimport { assert } from \"chai\";\n\ndescribe(\"AppConfigurationClient - FeatureFlag\", () => {\n describe(\"FeatureFlag configuration setting\", () => {\n let client: AppConfigurationClient;\n let recorder: Recorder;\n let baseSetting: ConfigurationSetting<FeatureFlagValue>;\n let addResponse: AddConfigurationSettingResponse;\n\n beforeEach(async function (this: Context) {\n recorder = await startRecorder(this);\n client = createAppConfigurationClientForTests(recorder.configureClientOptions({}));\n baseSetting = {\n value: {\n conditions: {\n clientFilters: [\n {\n name: \"Microsoft.TimeWindow\",\n parameters: {\n Start: \"Wed, 01 May 2019 13:59:59 GMT\",\n End: \"Mon, 01 July 2019 00:00:00 GMT\",\n },\n },\n { name: \"FilterX\" },\n {\n name: \"Microsoft.Targeting\",\n parameters: {\n Audience: {\n Groups: [\n { Name: \"group-1\", RolloutPercentage: 25 },\n { Name: \"group-2\", RolloutPercentage: 45 },\n ],\n Users: [\"userA\", \"userB\"],\n DefaultRolloutPercentage: 40,\n },\n },\n },\n { name: \"Microsoft.Percentage\", parameters: { Value: 25 } },\n ],\n },\n enabled: false,\n description: \"I'm a description\",\n displayName: \"for display\",\n },\n isReadOnly: false,\n key: `${\n featureFlagPrefix +\n recorder.variable(\"name-1\", `name-1${Math.floor(Math.random() * 1000)}`)\n }`,\n contentType: featureFlagContentType,\n label: \"label-1\",\n };\n addResponse = await client.addConfigurationSetting(baseSetting);\n });\n\n afterEach(async function (this: Context) {\n await client.deleteConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n await recorder.stop();\n });\n\n function assertFeatureFlagProps(\n actual: Omit<AddConfigurationSettingResponse, \"_response\">,\n expected: ConfigurationSetting<FeatureFlagValue>\n ): void {\n assert.equal(isFeatureFlag(actual), true, \"Expected to get the feature flag\");\n assert.isDefined(actual.value, \"Expected the value to be defined\");\n const featureFlagValue = parseFeatureFlag(actual).value;\n assert.equal(\n actual.key,\n expected.key,\n \"Key from the response from get request is not as expected\"\n );\n assert.deepEqual(\n featureFlagValue.conditions,\n expected.value.conditions,\n \"conditions from the response from get request is not as expected\"\n );\n assert.equal(featureFlagValue.description, expected.value.description);\n assert.equal(featureFlagValue.enabled, expected.value.enabled);\n assert.equal(actual.isReadOnly, expected.isReadOnly);\n assert.equal(actual.label, expected.label);\n assert.equal(actual.contentType, expected.contentType);\n }\n\n it(\"can add and get FeatureFlag\", async () => {\n assertFeatureFlagProps(addResponse, baseSetting);\n const getResponse = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertFeatureFlagProps(getResponse, baseSetting);\n });\n\n it(\"can add and update FeatureFlag\", async () => {\n const getResponse = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertFeatureFlagProps(getResponse, baseSetting);\n\n const featureFlag = parseFeatureFlag(getResponse);\n featureFlag.value.enabled = !baseSetting.value.enabled;\n\n const setResponse = await client.setConfigurationSetting(featureFlag);\n assertFeatureFlagProps(setResponse, {\n ...baseSetting,\n value: { ...baseSetting.value, enabled: !baseSetting.value.enabled },\n });\n\n const getResponseAfterUpdate = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertFeatureFlagProps(getResponseAfterUpdate, {\n ...baseSetting,\n value: { ...baseSetting.value, enabled: !baseSetting.value.enabled },\n });\n });\n\n it(\"can add, list and update multiple FeatureFlags\", async () => {\n const secondSetting = {\n ...baseSetting,\n key: `${baseSetting.key}-2`,\n };\n await client.addConfigurationSetting(secondSetting);\n\n let numberOFFeatureFlagsReceived = 0;\n for await (const setting of client.listConfigurationSettings({\n keyFilter: `${baseSetting.key}*`,\n })) {\n numberOFFeatureFlagsReceived++;\n if (setting.key === baseSetting.key) {\n assertFeatureFlagProps(setting, baseSetting);\n await client.setConfigurationSetting({\n ...baseSetting,\n value: { ...baseSetting.value, enabled: !baseSetting.value.enabled },\n });\n } else {\n assertFeatureFlagProps(setting, secondSetting);\n const parsedSetting = parseFeatureFlag(setting);\n await client.setConfigurationSetting({\n ...parsedSetting,\n value: { ...parsedSetting.value, description: \"I'm new description\" },\n });\n }\n }\n assert.equal(numberOFFeatureFlagsReceived, 2, \"Unexpected number of FeatureFlags seen\");\n\n for await (const setting of client.listConfigurationSettings({\n keyFilter: `${baseSetting.key}*`,\n })) {\n numberOFFeatureFlagsReceived--;\n if (setting.key === baseSetting.key) {\n assertFeatureFlagProps(setting, {\n ...baseSetting,\n value: { ...baseSetting.value, enabled: !baseSetting.value.enabled },\n });\n } else {\n assertFeatureFlagProps(setting, {\n ...secondSetting,\n value: { ...secondSetting.value, description: \"I'm new description\" },\n });\n }\n }\n\n assert.equal(\n numberOFFeatureFlagsReceived,\n 0,\n \"Unexpected number of FeatureFlags seen after updating\"\n );\n await client.deleteConfigurationSetting({ key: secondSetting.key });\n });\n });\n\n describe(\"serializeAsConfigurationSettingParam\", () => {\n let client: AppConfigurationClient;\n let recorder: Recorder;\n let featureFlag: ConfigurationSetting<FeatureFlagValue>;\n beforeEach(async function (this: Context) {\n recorder = await startRecorder(this);\n client = createAppConfigurationClientForTests(recorder.configureClientOptions({}));\n featureFlag = {\n contentType: featureFlagContentType,\n key: `${featureFlagPrefix}${recorder.variable(\n \"name-1\",\n `name-1${Math.floor(Math.random() * 1000)}`\n )}`,\n isReadOnly: false,\n value: { conditions: { clientFilters: [] }, enabled: true },\n };\n });\n\n afterEach(async function (this: Context) {\n await client.deleteConfigurationSetting({ key: featureFlag.key });\n await recorder.stop();\n });\n\n [`[]`, \"Hello World\"].forEach((value) => {\n it(`Unexpected value ${value} as feature flag value`, async () => {\n featureFlag.value = value as any;\n await client.addConfigurationSetting(featureFlag);\n assert.equal(\n (await client.getConfigurationSetting({ key: featureFlag.key })).value,\n value,\n \"message\"\n );\n });\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"featureFlag.spec.js","sourceRoot":"","sources":["../../../test/public/featureFlag.spec.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAA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ation.\n// Licensed under the MIT license.\n\nimport {\n AddConfigurationSettingResponse,\n AppConfigurationClient,\n ConfigurationSetting,\n featureFlagContentType,\n featureFlagPrefix,\n} from \"../../src\";\nimport { FeatureFlagValue, isFeatureFlag, parseFeatureFlag } from \"../../src/featureFlag\";\nimport { Recorder } from \"@azure-tools/test-recorder\";\nimport { createAppConfigurationClientForTests, startRecorder } from \"./utils/testHelpers\";\nimport { Context } from \"mocha\";\nimport { assert } from \"chai\";\n\ndescribe(\"AppConfigurationClient - FeatureFlag\", () => {\n describe(\"FeatureFlag configuration setting\", () => {\n let client: AppConfigurationClient;\n let recorder: Recorder;\n let baseSetting: ConfigurationSetting<FeatureFlagValue>;\n let addResponse: AddConfigurationSettingResponse;\n\n beforeEach(async function (this: Context) {\n recorder = await startRecorder(this);\n client = createAppConfigurationClientForTests(recorder.configureClientOptions({}));\n baseSetting = {\n value: {\n conditions: {\n clientFilters: [\n {\n name: \"Microsoft.TimeWindow\",\n parameters: {\n Start: \"Wed, 01 May 2019 13:59:59 GMT\",\n End: \"Mon, 01 July 2019 00:00:00 GMT\",\n },\n },\n { name: \"FilterX\" },\n {\n name: \"Microsoft.Targeting\",\n parameters: {\n Audience: {\n Groups: [\n { Name: \"group-1\", RolloutPercentage: 25 },\n { Name: \"group-2\", RolloutPercentage: 45 },\n ],\n Users: [\"userA\", \"userB\"],\n DefaultRolloutPercentage: 40,\n },\n },\n },\n { name: \"Microsoft.Percentage\", parameters: { Value: 25 } },\n ],\n },\n enabled: false,\n description: \"I'm a description\",\n displayName: \"for display\",\n },\n isReadOnly: false,\n key: `${\n featureFlagPrefix +\n recorder.variable(\"name-1\", `name-1${Math.floor(Math.random() * 1000)}`)\n }`,\n contentType: featureFlagContentType,\n label: \"label-1\",\n };\n addResponse = await client.addConfigurationSetting(baseSetting);\n });\n\n afterEach(async function (this: Context) {\n await client.deleteConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n await recorder.stop();\n });\n\n function assertFeatureFlagProps(\n actual: Omit<AddConfigurationSettingResponse, \"_response\">,\n expected: ConfigurationSetting<FeatureFlagValue>\n ): void {\n assert.equal(isFeatureFlag(actual), true, \"Expected to get the feature flag\");\n assert.isDefined(actual.value, \"Expected the value to be defined\");\n const featureFlagValue = parseFeatureFlag(actual).value;\n assert.equal(\n actual.key,\n expected.key,\n \"Key from the response from get request is not as expected\"\n );\n assert.deepEqual(\n featureFlagValue.conditions,\n expected.value.conditions,\n \"conditions from the response from get request is not as expected\"\n );\n assert.equal(featureFlagValue.description, expected.value.description);\n assert.equal(featureFlagValue.enabled, expected.value.enabled);\n assert.equal(actual.isReadOnly, expected.isReadOnly);\n assert.equal(actual.label, expected.label);\n assert.equal(actual.contentType, expected.contentType);\n }\n\n it(\"can add and get FeatureFlag\", async () => {\n assertFeatureFlagProps(addResponse, baseSetting);\n const getResponse = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertFeatureFlagProps(getResponse, baseSetting);\n });\n\n it(\"can add and update FeatureFlag\", async () => {\n const getResponse = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertFeatureFlagProps(getResponse, baseSetting);\n\n const featureFlag = parseFeatureFlag(getResponse);\n featureFlag.value.enabled = !baseSetting.value.enabled;\n\n const setResponse = await client.setConfigurationSetting(featureFlag);\n assertFeatureFlagProps(setResponse, {\n ...baseSetting,\n value: { ...baseSetting.value, enabled: !baseSetting.value.enabled },\n });\n\n const getResponseAfterUpdate = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertFeatureFlagProps(getResponseAfterUpdate, {\n ...baseSetting,\n value: { ...baseSetting.value, enabled: !baseSetting.value.enabled },\n });\n });\n\n it(\"can add, list and update multiple FeatureFlags\", async () => {\n const secondSetting = {\n ...baseSetting,\n key: `${baseSetting.key}-2`,\n };\n await client.addConfigurationSetting(secondSetting);\n\n let numberOFFeatureFlagsReceived = 0;\n for await (const setting of client.listConfigurationSettings({\n keyFilter: `${baseSetting.key}*`,\n })) {\n numberOFFeatureFlagsReceived++;\n if (setting.key === baseSetting.key) {\n assertFeatureFlagProps(setting, baseSetting);\n await client.setConfigurationSetting({\n ...baseSetting,\n value: { ...baseSetting.value, enabled: !baseSetting.value.enabled },\n });\n } else {\n assertFeatureFlagProps(setting, secondSetting);\n const parsedSetting = parseFeatureFlag(setting);\n await client.setConfigurationSetting({\n ...parsedSetting,\n value: { ...parsedSetting.value, description: \"I'm new description\" },\n });\n }\n }\n assert.equal(numberOFFeatureFlagsReceived, 2, \"Unexpected number of FeatureFlags seen\");\n\n for await (const setting of client.listConfigurationSettings({\n keyFilter: `${baseSetting.key}*`,\n })) {\n numberOFFeatureFlagsReceived--;\n if (setting.key === baseSetting.key) {\n assertFeatureFlagProps(setting, {\n ...baseSetting,\n value: { ...baseSetting.value, enabled: !baseSetting.value.enabled },\n });\n } else {\n assertFeatureFlagProps(setting, {\n ...secondSetting,\n value: { ...secondSetting.value, description: \"I'm new description\" },\n });\n }\n }\n\n assert.equal(\n numberOFFeatureFlagsReceived,\n 0,\n \"Unexpected number of FeatureFlags seen after updating\"\n );\n await client.deleteConfigurationSetting({ key: secondSetting.key });\n });\n });\n\n describe(\"serializeAsConfigurationSettingParam\", () => {\n let client: AppConfigurationClient;\n let recorder: Recorder;\n let featureFlag: ConfigurationSetting<FeatureFlagValue>;\n beforeEach(async function (this: Context) {\n recorder = await startRecorder(this);\n client = createAppConfigurationClientForTests(recorder.configureClientOptions({}));\n featureFlag = {\n contentType: featureFlagContentType,\n key: `${featureFlagPrefix}${recorder.variable(\n \"name-1\",\n `name-1${Math.floor(Math.random() * 1000)}`\n )}`,\n isReadOnly: false,\n value: { conditions: { clientFilters: [] }, enabled: true },\n };\n });\n\n afterEach(async function (this: Context) {\n await client.deleteConfigurationSetting({ key: featureFlag.key });\n await recorder.stop();\n });\n\n [`[]`, \"Hello World\"].forEach((value) => {\n it(`Unexpected value ${value} as feature flag value`, async () => {\n featureFlag.value = value as any;\n await client.addConfigurationSetting(featureFlag);\n assert.equal(\n (await client.getConfigurationSetting({ key: featureFlag.key })).value,\n value,\n \"message\"\n );\n });\n });\n });\n});\n"]}
|
|
@@ -79,53 +79,67 @@ describe("AppConfigurationClient - SecretReference", () => {
|
|
|
79
79
|
assertSecretReferenceProps(getResponseAfterUpdate, Object.assign(Object.assign({}, baseSetting), { value: { secretId: newSecretId } }));
|
|
80
80
|
});
|
|
81
81
|
it("can add, list and update multiple SecretReferences", async () => {
|
|
82
|
-
var e_1,
|
|
82
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
|
83
83
|
const secondSetting = Object.assign(Object.assign({}, baseSetting), { key: `${baseSetting.key}-2` });
|
|
84
84
|
const newSecretId = `https://vault_name.vault.azure.net/secrets/${recorder.variable("name-5", `name-5${Math.floor(Math.random() * 1000)}`)}`;
|
|
85
85
|
await client.addConfigurationSetting(secondSetting);
|
|
86
86
|
let numberOFSecretReferencesReceived = 0;
|
|
87
87
|
try {
|
|
88
|
-
for (var
|
|
88
|
+
for (var _g = true, _h = __asyncValues(client.listConfigurationSettings({
|
|
89
89
|
keyFilter: `${baseSetting.key}*`,
|
|
90
|
-
})),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
})), _j; _j = await _h.next(), _a = _j.done, !_a;) {
|
|
91
|
+
_c = _j.value;
|
|
92
|
+
_g = false;
|
|
93
|
+
try {
|
|
94
|
+
const setting = _c;
|
|
95
|
+
numberOFSecretReferencesReceived++;
|
|
96
|
+
if (setting.key === baseSetting.key) {
|
|
97
|
+
assertSecretReferenceProps(setting, baseSetting);
|
|
98
|
+
await client.setConfigurationSetting(Object.assign(Object.assign({}, baseSetting), { value: { secretId: newSecretId } }));
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
assertSecretReferenceProps(setting, secondSetting);
|
|
102
|
+
await client.setReadOnly({ key: setting.key, label: setting.label }, !secondSetting.isReadOnly);
|
|
103
|
+
}
|
|
96
104
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
await client.setReadOnly({ key: setting.key, label: setting.label }, !secondSetting.isReadOnly);
|
|
105
|
+
finally {
|
|
106
|
+
_g = true;
|
|
100
107
|
}
|
|
101
108
|
}
|
|
102
109
|
}
|
|
103
110
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
104
111
|
finally {
|
|
105
112
|
try {
|
|
106
|
-
if (
|
|
113
|
+
if (!_g && !_a && (_b = _h.return)) await _b.call(_h);
|
|
107
114
|
}
|
|
108
115
|
finally { if (e_1) throw e_1.error; }
|
|
109
116
|
}
|
|
110
117
|
assert.equal(numberOFSecretReferencesReceived, 2, "Unexpected number of FeatureFlags seen");
|
|
111
118
|
try {
|
|
112
|
-
for (var
|
|
119
|
+
for (var _k = true, _l = __asyncValues(client.listConfigurationSettings({
|
|
113
120
|
keyFilter: `${baseSetting.key}*`,
|
|
114
|
-
})),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
})), _m; _m = await _l.next(), _d = _m.done, !_d;) {
|
|
122
|
+
_f = _m.value;
|
|
123
|
+
_k = false;
|
|
124
|
+
try {
|
|
125
|
+
const setting = _f;
|
|
126
|
+
numberOFSecretReferencesReceived--;
|
|
127
|
+
if (setting.key === baseSetting.key) {
|
|
128
|
+
assertSecretReferenceProps(setting, Object.assign(Object.assign({}, baseSetting), { value: { secretId: newSecretId } }));
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
assertSecretReferenceProps(setting, Object.assign(Object.assign({}, secondSetting), { isReadOnly: !secondSetting.isReadOnly }));
|
|
132
|
+
}
|
|
119
133
|
}
|
|
120
|
-
|
|
121
|
-
|
|
134
|
+
finally {
|
|
135
|
+
_k = true;
|
|
122
136
|
}
|
|
123
137
|
}
|
|
124
138
|
}
|
|
125
139
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
126
140
|
finally {
|
|
127
141
|
try {
|
|
128
|
-
if (
|
|
142
|
+
if (!_k && !_d && (_e = _l.return)) await _e.call(_l);
|
|
129
143
|
}
|
|
130
144
|
finally { if (e_2) throw e_2.error; }
|
|
131
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secretReference.spec.js","sourceRoot":"","sources":["../../../test/public/secretReference.spec.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAKL,iBAAiB,EACjB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,oCAAoC,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACxD,IAAI,MAA8B,CAAC;IACnC,IAAI,QAAkB,CAAC;IAEvB,UAAU,CAAC,KAAK;QACd,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,GAAG,oCAAoC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK;QACb,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;QACrD,MAAM,cAAc,GAAG,GAA+C,EAAE;YACtE,OAAO;gBACL,KAAK,EAAE;oBACL,QAAQ,EAAE,8CAA8C,QAAQ,CAAC,QAAQ,CACvE,QAAQ,EACR,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAC5C,EAAE;iBACJ;gBACD,UAAU,EAAE,KAAK;gBACjB,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,KAAK,CAAC,IAA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AE,KAAK,IAAI,EAAE;gBACnE,MAAM,OAAO,GAA+C;oBAC1D,WAAW,EAAE,0BAA0B;oBACvC,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;oBAC7E,UAAU,EAAE,KAAK;oBACjB,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;iBAC1B,CAAC;gBACF,OAAO,CAAC,KAAK,GAAG,KAAY,CAAC;gBAC7B,MAAM,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;gBAC9C,MAAM,CAAC,KAAK,CACV,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAClE,KAAK,EACL,SAAS,CACV,CAAC;gBACF,MAAM,MAAM,CAAC,0BAA0B,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AddConfigurationSettingResponse,\n AppConfigurationClient,\n ConfigurationSetting,\n SecretReferenceValue,\n isSecretReference,\n parseSecretReference,\n secretReferenceContentType,\n} from \"../../src\";\nimport { Recorder } from \"@azure-tools/test-recorder\";\nimport { createAppConfigurationClientForTests, startRecorder } from \"./utils/testHelpers\";\nimport { Context } from \"mocha\";\nimport { assert } from \"chai\";\n\ndescribe(\"AppConfigurationClient - SecretReference\", () => {\n let client: AppConfigurationClient;\n let recorder: Recorder;\n\n beforeEach(async function (this: Context) {\n recorder = await startRecorder(this);\n client = createAppConfigurationClientForTests(recorder.configureClientOptions({}));\n });\n\n afterEach(async function (this: Context) {\n await recorder.stop();\n });\n\n describe(\"SecretReference configuration setting\", () => {\n const getBaseSetting = (): ConfigurationSetting<SecretReferenceValue> => {\n return {\n value: {\n secretId: `https://vault_name.vault.azure.net/secrets/${recorder.variable(\n \"name-2\",\n `name-2${Math.floor(Math.random() * 1000)}`\n )}`,\n },\n isReadOnly: false,\n key: recorder.variable(\"name-3\", `name-3${Math.floor(Math.random() * 1000)}`),\n label: \"label-s\",\n contentType: secretReferenceContentType,\n };\n };\n\n function assertSecretReferenceProps(\n actual: Omit<AddConfigurationSettingResponse, \"_response\">,\n expected: ConfigurationSetting<SecretReferenceValue>\n ): void {\n assert.equal(isSecretReference(actual), true, \"Expected to get the SecretReference\");\n const actualSecretReference = parseSecretReference(actual);\n if (isSecretReference(actual)) {\n assert.equal(\n actual.key,\n expected.key,\n \"Key from the response from get request is not as expected\"\n );\n assert.equal(actualSecretReference.value.secretId, expected.value.secretId);\n assert.equal(actual.isReadOnly, expected.isReadOnly);\n assert.equal(actual.label, expected.label);\n assert.equal(actual.contentType, expected.contentType);\n }\n }\n\n let addResponse: AddConfigurationSettingResponse;\n let baseSetting: ConfigurationSetting<SecretReferenceValue>;\n beforeEach(async () => {\n baseSetting = getBaseSetting();\n addResponse = await client.addConfigurationSetting(baseSetting);\n });\n\n afterEach(async () => {\n await client.setReadOnly(\n {\n key: baseSetting.key,\n label: baseSetting.label,\n },\n false\n );\n await client.deleteConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n });\n\n it(\"can add and get SecretReference\", async () => {\n assertSecretReferenceProps(addResponse, baseSetting);\n const getResponse = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertSecretReferenceProps(getResponse, baseSetting);\n });\n\n it(\"can add and update SecretReference\", async () => {\n const getResponse = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n const newSecretId = `https://vault_name.vault.azure.net/secrets/${recorder.variable(\n \"name-4\",\n `name-4${Math.floor(Math.random() * 1000)}`\n )}`;\n\n assertSecretReferenceProps(getResponse, baseSetting);\n const secretReference = parseSecretReference(getResponse);\n secretReference.value.secretId = newSecretId;\n\n const setResponse = await client.setConfigurationSetting(secretReference);\n assertSecretReferenceProps(setResponse, {\n ...baseSetting,\n value: { secretId: newSecretId },\n });\n\n const getResponseAfterUpdate = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertSecretReferenceProps(getResponseAfterUpdate, {\n ...baseSetting,\n value: { secretId: newSecretId },\n });\n });\n\n it(\"can add, list and update multiple SecretReferences\", async () => {\n const secondSetting = {\n ...baseSetting,\n key: `${baseSetting.key}-2`,\n };\n const newSecretId = `https://vault_name.vault.azure.net/secrets/${recorder.variable(\n \"name-5\",\n `name-5${Math.floor(Math.random() * 1000)}`\n )}`;\n await client.addConfigurationSetting(secondSetting);\n\n let numberOFSecretReferencesReceived = 0;\n for await (const setting of client.listConfigurationSettings({\n keyFilter: `${baseSetting.key}*`,\n })) {\n numberOFSecretReferencesReceived++;\n if (setting.key === baseSetting.key) {\n assertSecretReferenceProps(setting, baseSetting);\n await client.setConfigurationSetting({\n ...baseSetting,\n value: { secretId: newSecretId },\n });\n } else {\n assertSecretReferenceProps(setting, secondSetting);\n await client.setReadOnly(\n { key: setting.key, label: setting.label },\n !secondSetting.isReadOnly\n );\n }\n }\n assert.equal(numberOFSecretReferencesReceived, 2, \"Unexpected number of FeatureFlags seen\");\n for await (const setting of client.listConfigurationSettings({\n keyFilter: `${baseSetting.key}*`,\n })) {\n numberOFSecretReferencesReceived--;\n if (setting.key === baseSetting.key) {\n assertSecretReferenceProps(setting, { ...baseSetting, value: { secretId: newSecretId } });\n } else {\n assertSecretReferenceProps(setting, {\n ...secondSetting,\n isReadOnly: !secondSetting.isReadOnly,\n });\n }\n }\n\n assert.equal(\n numberOFSecretReferencesReceived,\n 0,\n \"Unexpected number of SecretReferences seen after updating\"\n );\n await client.setReadOnly({ key: secondSetting.key, label: secondSetting.label }, false);\n await client.deleteConfigurationSetting({\n key: secondSetting.key,\n label: secondSetting.label,\n });\n });\n });\n\n describe(\"serializeAsConfigurationSettingParam\", () => {\n [`[]`, \"Hello World\"].forEach((value) => {\n it(`Unexpected value ${value} as secret reference value`, async () => {\n const setting: ConfigurationSetting<SecretReferenceValue> = {\n contentType: secretReferenceContentType,\n key: recorder.variable(\"name-1\", `name-1${Math.floor(Math.random() * 1000)}`),\n isReadOnly: false,\n value: { secretId: \"id\" },\n };\n setting.value = value as any;\n await client.addConfigurationSetting(setting);\n assert.equal(\n (await client.getConfigurationSetting({ key: setting.key })).value,\n value,\n \"message\"\n );\n await client.deleteConfigurationSetting({ key: setting.key });\n });\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"secretReference.spec.js","sourceRoot":"","sources":["../../../test/public/secretReference.spec.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAKL,iBAAiB,EACjB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,oCAAoC,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACxD,IAAI,MAA8B,CAAC;IACnC,IAAI,QAAkB,CAAC;IAEvB,UAAU,CAAC,KAAK;QACd,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,GAAG,oCAAoC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK;QACb,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;QACrD,MAAM,cAAc,GAAG,GAA+C,EAAE;YACtE,OAAO;gBACL,KAAK,EAA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,CAAC,CAAC;YACxF,MAAM,MAAM,CAAC,0BAA0B,CAAC;gBACtC,GAAG,EAAE,aAAa,CAAC,GAAG;gBACtB,KAAK,EAAE,aAAa,CAAC,KAAK;aAC3B,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;QACpD,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACtC,EAAE,CAAC,oBAAoB,KAAK,4BAA4B,EAAE,KAAK,IAAI,EAAE;gBACnE,MAAM,OAAO,GAA+C;oBAC1D,WAAW,EAAE,0BAA0B;oBACvC,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;oBAC7E,UAAU,EAAE,KAAK;oBACjB,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;iBAC1B,CAAC;gBACF,OAAO,CAAC,KAAK,GAAG,KAAY,CAAC;gBAC7B,MAAM,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;gBAC9C,MAAM,CAAC,KAAK,CACV,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAClE,KAAK,EACL,SAAS,CACV,CAAC;gBACF,MAAM,MAAM,CAAC,0BAA0B,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AddConfigurationSettingResponse,\n AppConfigurationClient,\n ConfigurationSetting,\n SecretReferenceValue,\n isSecretReference,\n parseSecretReference,\n secretReferenceContentType,\n} from \"../../src\";\nimport { Recorder } from \"@azure-tools/test-recorder\";\nimport { createAppConfigurationClientForTests, startRecorder } from \"./utils/testHelpers\";\nimport { Context } from \"mocha\";\nimport { assert } from \"chai\";\n\ndescribe(\"AppConfigurationClient - SecretReference\", () => {\n let client: AppConfigurationClient;\n let recorder: Recorder;\n\n beforeEach(async function (this: Context) {\n recorder = await startRecorder(this);\n client = createAppConfigurationClientForTests(recorder.configureClientOptions({}));\n });\n\n afterEach(async function (this: Context) {\n await recorder.stop();\n });\n\n describe(\"SecretReference configuration setting\", () => {\n const getBaseSetting = (): ConfigurationSetting<SecretReferenceValue> => {\n return {\n value: {\n secretId: `https://vault_name.vault.azure.net/secrets/${recorder.variable(\n \"name-2\",\n `name-2${Math.floor(Math.random() * 1000)}`\n )}`,\n },\n isReadOnly: false,\n key: recorder.variable(\"name-3\", `name-3${Math.floor(Math.random() * 1000)}`),\n label: \"label-s\",\n contentType: secretReferenceContentType,\n };\n };\n\n function assertSecretReferenceProps(\n actual: Omit<AddConfigurationSettingResponse, \"_response\">,\n expected: ConfigurationSetting<SecretReferenceValue>\n ): void {\n assert.equal(isSecretReference(actual), true, \"Expected to get the SecretReference\");\n const actualSecretReference = parseSecretReference(actual);\n if (isSecretReference(actual)) {\n assert.equal(\n actual.key,\n expected.key,\n \"Key from the response from get request is not as expected\"\n );\n assert.equal(actualSecretReference.value.secretId, expected.value.secretId);\n assert.equal(actual.isReadOnly, expected.isReadOnly);\n assert.equal(actual.label, expected.label);\n assert.equal(actual.contentType, expected.contentType);\n }\n }\n\n let addResponse: AddConfigurationSettingResponse;\n let baseSetting: ConfigurationSetting<SecretReferenceValue>;\n beforeEach(async () => {\n baseSetting = getBaseSetting();\n addResponse = await client.addConfigurationSetting(baseSetting);\n });\n\n afterEach(async () => {\n await client.setReadOnly(\n {\n key: baseSetting.key,\n label: baseSetting.label,\n },\n false\n );\n await client.deleteConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n });\n\n it(\"can add and get SecretReference\", async () => {\n assertSecretReferenceProps(addResponse, baseSetting);\n const getResponse = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertSecretReferenceProps(getResponse, baseSetting);\n });\n\n it(\"can add and update SecretReference\", async () => {\n const getResponse = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n const newSecretId = `https://vault_name.vault.azure.net/secrets/${recorder.variable(\n \"name-4\",\n `name-4${Math.floor(Math.random() * 1000)}`\n )}`;\n\n assertSecretReferenceProps(getResponse, baseSetting);\n const secretReference = parseSecretReference(getResponse);\n secretReference.value.secretId = newSecretId;\n\n const setResponse = await client.setConfigurationSetting(secretReference);\n assertSecretReferenceProps(setResponse, {\n ...baseSetting,\n value: { secretId: newSecretId },\n });\n\n const getResponseAfterUpdate = await client.getConfigurationSetting({\n key: baseSetting.key,\n label: baseSetting.label,\n });\n assertSecretReferenceProps(getResponseAfterUpdate, {\n ...baseSetting,\n value: { secretId: newSecretId },\n });\n });\n\n it(\"can add, list and update multiple SecretReferences\", async () => {\n const secondSetting = {\n ...baseSetting,\n key: `${baseSetting.key}-2`,\n };\n const newSecretId = `https://vault_name.vault.azure.net/secrets/${recorder.variable(\n \"name-5\",\n `name-5${Math.floor(Math.random() * 1000)}`\n )}`;\n await client.addConfigurationSetting(secondSetting);\n\n let numberOFSecretReferencesReceived = 0;\n for await (const setting of client.listConfigurationSettings({\n keyFilter: `${baseSetting.key}*`,\n })) {\n numberOFSecretReferencesReceived++;\n if (setting.key === baseSetting.key) {\n assertSecretReferenceProps(setting, baseSetting);\n await client.setConfigurationSetting({\n ...baseSetting,\n value: { secretId: newSecretId },\n });\n } else {\n assertSecretReferenceProps(setting, secondSetting);\n await client.setReadOnly(\n { key: setting.key, label: setting.label },\n !secondSetting.isReadOnly\n );\n }\n }\n assert.equal(numberOFSecretReferencesReceived, 2, \"Unexpected number of FeatureFlags seen\");\n for await (const setting of client.listConfigurationSettings({\n keyFilter: `${baseSetting.key}*`,\n })) {\n numberOFSecretReferencesReceived--;\n if (setting.key === baseSetting.key) {\n assertSecretReferenceProps(setting, { ...baseSetting, value: { secretId: newSecretId } });\n } else {\n assertSecretReferenceProps(setting, {\n ...secondSetting,\n isReadOnly: !secondSetting.isReadOnly,\n });\n }\n }\n\n assert.equal(\n numberOFSecretReferencesReceived,\n 0,\n \"Unexpected number of SecretReferences seen after updating\"\n );\n await client.setReadOnly({ key: secondSetting.key, label: secondSetting.label }, false);\n await client.deleteConfigurationSetting({\n key: secondSetting.key,\n label: secondSetting.label,\n });\n });\n });\n\n describe(\"serializeAsConfigurationSettingParam\", () => {\n [`[]`, \"Hello World\"].forEach((value) => {\n it(`Unexpected value ${value} as secret reference value`, async () => {\n const setting: ConfigurationSetting<SecretReferenceValue> = {\n contentType: secretReferenceContentType,\n key: recorder.variable(\"name-1\", `name-1${Math.floor(Math.random() * 1000)}`),\n isReadOnly: false,\n value: { secretId: \"id\" },\n };\n setting.value = value as any;\n await client.addConfigurationSetting(setting);\n assert.equal(\n (await client.getConfigurationSetting({ key: setting.key })).value,\n value,\n \"message\"\n );\n await client.deleteConfigurationSetting({ key: setting.key });\n });\n });\n });\n});\n"]}
|