diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5c4ec3..e04d8de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Use Node.js 18.x + - name: Use Node.js 20.x uses: actions/setup-node@v4 with: - node-version: '18.x' + node-version: '20.x' - name: Install pnpm run: npm install -g pnpm diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 8284eba..4c19498 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1,7 +1,6 @@ lockfileVersion: 5.4 specifiers: - '@azure/app-configuration': ^1.9.0 '@azure/core-client': ^1.9.2 '@azure/core-http': ^3.0.1 '@azure/core-paging': ^1.4.0 @@ -56,7 +55,6 @@ specifiers: uuid: ^10.0.0 dependencies: - '@azure/app-configuration': 1.9.0 '@azure/core-client': 1.9.2 '@azure/core-http': 3.0.4 '@azure/core-paging': 1.6.2 @@ -112,6 +110,20 @@ dependencies: packages: + /@azure-rest/core-client/2.7.0: + resolution: {integrity: sha512-rL0lJqh1E8HLXNgjIw8cRyGAV/v+m6p1xRu/8OhsnmN8XHhwkyYJkAoGM+zrew96v7jZYPmVfy7pv7v4Iccfsg==} + engines: {node: '>=20.0.0'} + dependencies: + '@azure/abort-controller': 2.1.2 + '@azure/core-auth': 1.10.1 + '@azure/core-rest-pipeline': 1.24.0 + '@azure/core-tracing': 1.3.1 + '@typespec/ts-http-runtime': 0.3.6 + tslib: 2.6.3 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/abort-controller/1.1.0: resolution: {integrity: sha1-eI7nhFelWvihrTQqyxgjg9IRkkk=} engines: {node: '>=12.0.0'} @@ -143,6 +155,26 @@ packages: - supports-color dev: false + /@azure/app-configuration/1.12.1: + resolution: {integrity: sha512-skUcJ8ca5X7RQU92svaGtpefp3ncI/LqFbc+IiQR0KCT//+TlwJN52nsloGsqwr8+b4fo+refWJp53iqqHEqbA==} + engines: {node: '>=20.0.0'} + dependencies: + '@azure-rest/core-client': 2.7.0 + '@azure/abort-controller': 2.1.2 + '@azure/core-auth': 1.7.2 + '@azure/core-client': 1.9.2 + '@azure/core-http-compat': 2.1.2 + '@azure/core-lro': 3.3.1 + '@azure/core-paging': 1.6.2 + '@azure/core-rest-pipeline': 1.16.0 + '@azure/core-tracing': 1.1.2 + '@azure/core-util': 1.9.0 + '@azure/logger': 1.1.2 + tslib: 2.6.3 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/app-configuration/1.5.0: resolution: {integrity: sha1-csQwuxNAacgTwGAYcQPDrwo6h7Q=} engines: {node: '>=18.0.0'} @@ -181,6 +213,17 @@ packages: - supports-color dev: false + /@azure/core-auth/1.10.1: + resolution: {integrity: sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg==} + engines: {node: '>=20.0.0'} + dependencies: + '@azure/abort-controller': 2.1.2 + '@azure/core-util': 1.13.1 + tslib: 2.6.3 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/core-auth/1.7.2: resolution: {integrity: sha1-VYt8t90SsAvuwHrl31kH103x69k=} engines: {node: '>=18.0.0'} @@ -248,6 +291,18 @@ packages: tslib: 2.6.3 dev: false + /@azure/core-lro/3.3.1: + resolution: {integrity: sha512-bulm3klLqIAhzI3iQMYQ42i+V9EnevScsHdI9amFfjaw6OJqPBK1038cq5qachoKV3yt/iQQEDittHmZW2aSuA==} + engines: {node: '>=20.0.0'} + dependencies: + '@azure/abort-controller': 2.1.2 + '@azure/core-util': 1.13.1 + '@azure/logger': 1.3.0 + tslib: 2.6.3 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/core-paging/1.6.2: resolution: {integrity: sha1-QNOGDcLffykdZjULLP2RcVJkM+c=} engines: {node: '>=18.0.0'} @@ -271,6 +326,21 @@ packages: - supports-color dev: false + /@azure/core-rest-pipeline/1.24.0: + resolution: {integrity: sha512-PpLsoDQ3AMmKZ0VU+0GrmqMxgp/sExjlVm4R+nLWngeoEGAzOIPVifaxKGU5gMv+nWELUoHfvrolWD+ZS/nFJg==} + engines: {node: '>=20.0.0'} + dependencies: + '@azure/abort-controller': 2.1.2 + '@azure/core-auth': 1.10.1 + '@azure/core-tracing': 1.3.1 + '@azure/core-util': 1.13.1 + '@azure/logger': 1.3.0 + '@typespec/ts-http-runtime': 0.3.6 + tslib: 2.6.3 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/core-tracing/1.0.0-preview.13: resolution: {integrity: sha1-VYg9QK4gQvbx4SsX3QwNNMU21kQ=} engines: {node: '>=12.0.0'} @@ -286,6 +356,24 @@ packages: tslib: 2.6.3 dev: false + /@azure/core-tracing/1.3.1: + resolution: {integrity: sha512-9MWKevR7Hz8kNzzPLfX4EAtGM2b8mr50HPDBvio96bURP/9C+HjdH3sBlLSNNrvRAr5/k/svoH457gB5IKpmwQ==} + engines: {node: '>=20.0.0'} + dependencies: + tslib: 2.6.3 + dev: false + + /@azure/core-util/1.13.1: + resolution: {integrity: sha512-XPArKLzsvl0Hf0CaGyKHUyVgF7oDnhKoP85Xv6M4StF/1AhfORhZudHtOyf2s+FcbuQ9dPRAjB8J2KvRRMUK2A==} + engines: {node: '>=20.0.0'} + dependencies: + '@azure/abort-controller': 2.1.2 + '@typespec/ts-http-runtime': 0.3.6 + tslib: 2.6.3 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/core-util/1.9.0: resolution: {integrity: sha512-AfalUQ1ZppaKuxPPMsFEUdX6GZPB3d9paR9d/TTL7Ow2De8cJaC7ibi7kWVlFAVPCYo31OcnGymc0R89DX8Oaw==} engines: {node: '>=18.0.0'} @@ -301,8 +389,18 @@ packages: tslib: 2.6.3 dev: false + /@azure/logger/1.3.0: + resolution: {integrity: sha512-fCqPIfOcLE+CGqGPd66c8bZpwAji98tZ4JI9i/mlTNTlsIWslCfpg48s/ypyLxZTump5sypjrKn2/kY7q8oAbA==} + engines: {node: '>=20.0.0'} + dependencies: + '@typespec/ts-http-runtime': 0.3.6 + tslib: 2.6.3 + transitivePeerDependencies: + - supports-color + dev: false + /@babel/code-frame/7.24.7: - resolution: {integrity: sha1-iC/Z4J6O4yTklr0EBAHG8EbvRGU=} + resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.24.7 @@ -1044,6 +1142,17 @@ packages: eslint-visitor-keys: 3.4.3 dev: false + /@typespec/ts-http-runtime/0.3.6: + resolution: {integrity: sha512-jIXhD0eWQ1JA6ln/5Dltyx22UxWNrw0hZmhy2rlv6m6KgF7kplHx3g0fzi09lNmTJQRR91OlemYp3xFnvDK9og==} + engines: {node: '>=20.0.0'} + dependencies: + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.4 + tslib: 2.6.3 + transitivePeerDependencies: + - supports-color + dev: false + /@ungap/structured-clone/1.2.0: resolution: {integrity: sha1-dWZBrbWHhRtcyz4JXa8nrlgchAY=} dev: false @@ -3163,7 +3272,7 @@ packages: dev: false file:projects/app-configuration-importer-file-source.tgz: - resolution: {integrity: sha512-lylhd1EhxgkTt/mulHlU6rCcjtL+SQwsh02wbyqVRQXiMxkOKd+9/1Pf+jmw/dq7MJGFhgzVlhtvBC562xl/cA==, tarball: file:projects/app-configuration-importer-file-source.tgz} + resolution: {integrity: sha512-WUQu9QAl7S4brAwMex+74qPVo9Z7x+8pqrwxnZlF6cEcCgz4zG9DXGAUdyanc4SwAEWEZwl9cxES4bKSMlajnQ==, tarball: file:projects/app-configuration-importer-file-source.tgz} name: '@rush-temp/app-configuration-importer-file-source' version: 0.0.0 dependencies: @@ -3213,11 +3322,11 @@ packages: dev: false file:projects/app-configuration-importer.tgz: - resolution: {integrity: sha512-2f1actadmt36eQNkuORdme5qtI/2Y9KowWl4dz3J0QrG94Hi8yii7/mBKG30F0VsZKX7TVtxrXJ5rPYs0cnOJw==, tarball: file:projects/app-configuration-importer.tgz} + resolution: {integrity: sha512-k9UYMwUT2KPiJNtj/y2LvPw38rJIfCP4UdZ1uWtU6mRxllN9fEHSWqN0PcNNuGZiUmoV1BG0sgWfPSnDdeBzEw==, tarball: file:projects/app-configuration-importer.tgz} name: '@rush-temp/app-configuration-importer' version: 0.0.0 dependencies: - '@azure/app-configuration': 1.9.0 + '@azure/app-configuration': 1.12.1 '@azure/core-client': 1.9.2 '@azure/core-http': 3.0.4 '@azure/core-paging': 1.6.2 diff --git a/libraries/azure-app-configuration-importer-file-source/package.json b/libraries/azure-app-configuration-importer-file-source/package.json index 4f53db1..484da37 100644 --- a/libraries/azure-app-configuration-importer-file-source/package.json +++ b/libraries/azure-app-configuration-importer-file-source/package.json @@ -2,7 +2,7 @@ "name": "@azure/app-configuration-importer-file-source", "author": "Microsoft Corporation", "description": "A client library for importing/exporting key-values between configuration file sources and Azure App Configuration service", - "version": "3.0.1-preview", + "version": "3.0.2-preview", "sdk-type": "client", "keywords": [ "node", @@ -33,7 +33,7 @@ }, "dependencies": { "@azure/app-configuration": "^1.9.0", - "@azure/app-configuration-importer": "3.0.1-preview" + "@azure/app-configuration-importer": "3.0.2-preview" }, "devDependencies": { "@microsoft/api-extractor": "^7.22.2", diff --git a/libraries/azure-app-configuration-importer/package.json b/libraries/azure-app-configuration-importer/package.json index 0b4bfc5..66309d1 100644 --- a/libraries/azure-app-configuration-importer/package.json +++ b/libraries/azure-app-configuration-importer/package.json @@ -2,7 +2,7 @@ "name": "@azure/app-configuration-importer", "author": "Microsoft Corporation", "description": "A client library for importing/exporting key-values between configuration sources and Azure App Configuration service", - "version": "3.0.1-preview", + "version": "3.0.2-preview", "sdk-type": "client", "keywords": [ "node", @@ -35,7 +35,7 @@ "clean": "rimraf dist dist-* types *.tgz *.log" }, "dependencies": { - "@azure/app-configuration": "^1.9.0", + "@azure/app-configuration": "^1.12.1", "@azure/core-client": "^1.9.2", "@azure/core-paging": "^1.4.0", "@azure/core-rest-pipeline": "^1.6.0", diff --git a/libraries/azure-app-configuration-importer/src/internal/parsers/kvSetConfigurationSettingsConverter.ts b/libraries/azure-app-configuration-importer/src/internal/parsers/kvSetConfigurationSettingsConverter.ts index e5519fc..9712c98 100644 --- a/libraries/azure-app-configuration-importer/src/internal/parsers/kvSetConfigurationSettingsConverter.ts +++ b/libraries/azure-app-configuration-importer/src/internal/parsers/kvSetConfigurationSettingsConverter.ts @@ -36,6 +36,7 @@ export class KvSetConfigurationSettingsConverter implements ConfigurationSetting key: element.key, value: element.value, label: element.label, + description: element.description, contentType: element.content_type, tags: element.tags }); @@ -60,6 +61,9 @@ export class KvSetConfigurationSettingsConverter implements ConfigurationSetting if (element.value && typeof element.value !== "string") { throw new ArgumentError(`The 'value' for the key '${element.key}' is not a string.`); } + if (element.description && typeof element.description !== "string") { + throw new ArgumentError(`The 'description' for the key '${element.key}' is not a string.`); + } if (element.content_type && typeof element.content_type !== "string") { throw new ArgumentError(`The 'content_type' for the key '${element.key}' is not a string.`); } diff --git a/libraries/azure-app-configuration-importer/src/internal/utils.ts b/libraries/azure-app-configuration-importer/src/internal/utils.ts index 9667276..f505971 100644 --- a/libraries/azure-app-configuration-importer/src/internal/utils.ts +++ b/libraries/azure-app-configuration-importer/src/internal/utils.ts @@ -48,7 +48,7 @@ export function isConfigSettingEqual(settingA: SetConfigurationSettingParam { assert.equal(configurationSettings[0].key, "testPrefixapp:Settings:FontSize"); assert.equal(configurationSettings[0].label, "TestLabel"); assert.equal(configurationSettings[0].contentType, "text"); + assert.equal(configurationSettings[0].description, ""); assert.equal(configurationSettings[1].key, "testPrefixapp:Settings:BackgroundColor"); assert.equal(configurationSettings[1].label, "TestLabel"); + assert.equal(configurationSettings[1].description, "This is description"); assert.equal(configurationSettings[1].contentType, "text"); }); diff --git a/libraries/azure-app-configuration-importer/tests/kvSetConfigurationSettingsConverter.spec.ts b/libraries/azure-app-configuration-importer/tests/kvSetConfigurationSettingsConverter.spec.ts index 214504b..ac7ab39 100644 --- a/libraries/azure-app-configuration-importer/tests/kvSetConfigurationSettingsConverter.spec.ts +++ b/libraries/azure-app-configuration-importer/tests/kvSetConfigurationSettingsConverter.spec.ts @@ -35,11 +35,13 @@ describe("Parse kvset format file", () => { assert.equal(configurationSettings[1].key, "Database:ConnectionString"); assert.equal(configurationSettings[1].contentType, secretReferenceContentType); assert.equal(configurationSettings[1].label, "test"); + assert.equal(configurationSettings[1].description, "DB connection string"); const secret = JSON.parse(configurationSettings[1].value as string) as JsonSecretReferenceValue; assert.equal(secret.uri, "https://keyvault.vault.azure.net/secrets/db-secret"); assert.equal(configurationSettings[2].key, "TestEnv"); assert.equal(configurationSettings[2].value, "Debug"); + assert.equal(configurationSettings[2].description, ""); assert.equal(configurationSettings[2].contentType, null); assert.equal(configurationSettings[2].label, "dev"); assert.equal(JSON.stringify(configurationSettings[2].tags), "{\"tag1\":\"value1\",\"tag2\":\"value2\"}"); diff --git a/libraries/azure-app-configuration-importer/tests/sources/kvset.json b/libraries/azure-app-configuration-importer/tests/sources/kvset.json index 235b24b..07fb4d6 100644 --- a/libraries/azure-app-configuration-importer/tests/sources/kvset.json +++ b/libraries/azure-app-configuration-importer/tests/sources/kvset.json @@ -11,6 +11,7 @@ "key": "Database:ConnectionString", "value": "{\"uri\":\"https://keyvault.vault.azure.net/secrets/db-secret\"}", "label": "test", + "description": "DB connection string", "content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8", "tags": {} }, @@ -18,6 +19,7 @@ "key": "TestEnv", "value": "Debug", "label": "dev", + "description": "", "content_type": null, "tags": { "tag1": "value1", diff --git a/libraries/azure-app-configuration-importer/tests/utlis.ts b/libraries/azure-app-configuration-importer/tests/utlis.ts index 00c270f..3a1056e 100644 --- a/libraries/azure-app-configuration-importer/tests/utlis.ts +++ b/libraries/azure-app-configuration-importer/tests/utlis.ts @@ -12,6 +12,7 @@ const items: ConfigurationSetting[] = [ key: "app:Settings:FontSize", label: "Dev", contentType: undefined, + description: "", value: "45", lastModified: undefined, etag: "", @@ -22,6 +23,7 @@ const items: ConfigurationSetting[] = [ label: "Dev", contentType: undefined, value: "yellow", + description: "This is description", lastModified: undefined, tags: {}, etag: "", @@ -32,6 +34,7 @@ const items: ConfigurationSetting[] = [ label: "Dev", contentType: undefined, value: "yellow", + description: "Font color description", lastModified: undefined, tags: { tag1: "value1", @@ -46,6 +49,7 @@ const items: ConfigurationSetting[] = [ contentType: "application/vnd.microsoft.appconfig.ff+json;charset=utf-8", value: "{\"id\":\"Test\",\"description\":\"Test feature\",\"enabled\":true,\"conditions\":{\"client_filters\":[]}}", lastModified: undefined, + description: undefined, tags: {}, etag: "", isReadOnly: false @@ -54,6 +58,7 @@ const items: ConfigurationSetting[] = [ key: "TestEnv", label: "dev", contentType: undefined, + description: "", value: "Debug", lastModified: undefined, tags: { @@ -68,6 +73,7 @@ const items: ConfigurationSetting[] = [ label: "test", contentType: "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8", value: "{\"uri\":\"https://keyvault.vault.azure.net/secrets/db-secret\"}", + description: "DB connection string", lastModified: undefined, etag: "", isReadOnly: false diff --git a/rush.json b/rush.json index f2efa68..7fda797 100644 --- a/rush.json +++ b/rush.json @@ -41,7 +41,7 @@ * LTS schedule: https://nodejs.org/en/about/releases/ * LTS versions: https://nodejs.org/en/download/releases/ */ - "nodeSupportedVersionRange": ">=14.15.0 <15.0.0 || >=16.13.0 <17.0.0 || >=18.15.0 <19.0.0", + "nodeSupportedVersionRange": ">=14.15.0 <15.0.0 || >=16.13.0 <17.0.0 || >=18.15.0 <19.0.0 || >=20.14.0", /** * If the version check above fails, Rush will display a message showing the current