@azure/app-configuration-importer 1.0.0-preview → 1.0.1-preview
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/LICENSE +21 -0
- package/README.md +67 -0
- package/dist/index.js +77 -10
- package/dist/index.js.map +1 -1
- package/dist-esm/src/appConfigurationImporter.js +157 -0
- package/dist-esm/src/appConfigurationImporter.js.map +1 -0
- package/dist-esm/src/enums.js +28 -0
- package/dist-esm/src/enums.js.map +1 -0
- package/dist-esm/src/errors.js +35 -0
- package/dist-esm/src/errors.js.map +1 -0
- package/dist-esm/src/importOptions.js +4 -0
- package/dist-esm/src/importOptions.js.map +1 -0
- package/dist-esm/src/index.js +9 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/internal/adaptiveTaskManager.js +69 -0
- package/dist-esm/src/internal/adaptiveTaskManager.js.map +1 -0
- package/dist-esm/src/internal/constants.js +29 -0
- package/dist-esm/src/internal/constants.js.map +1 -0
- package/dist-esm/src/internal/parsers/configurationSettingsConverter.js +4 -0
- package/dist-esm/src/internal/parsers/configurationSettingsConverter.js.map +1 -0
- package/dist-esm/src/internal/parsers/defaultConfigurationSettingsConverter.js +200 -0
- package/dist-esm/src/internal/parsers/defaultConfigurationSettingsConverter.js.map +1 -0
- package/dist-esm/src/internal/parsers/kvSetConfigurationSettingsConverter.js +66 -0
- package/dist-esm/src/internal/parsers/kvSetConfigurationSettingsConverter.js.map +1 -0
- package/dist-esm/src/internal/stream.browser.js +16 -0
- package/dist-esm/src/internal/stream.browser.js.map +1 -0
- package/dist-esm/src/internal/stream.js +15 -0
- package/dist-esm/src/internal/stream.js.map +1 -0
- package/dist-esm/src/internal/utils.js +129 -0
- package/dist-esm/src/internal/utils.js.map +1 -0
- package/dist-esm/src/models.js +4 -0
- package/dist-esm/src/models.js.map +1 -0
- package/dist-esm/src/settingsImport/configurationSettingsSource.js +4 -0
- package/dist-esm/src/settingsImport/configurationSettingsSource.js.map +1 -0
- package/dist-esm/src/settingsImport/iterableConfigurationSettingsSource.js +83 -0
- package/dist-esm/src/settingsImport/iterableConfigurationSettingsSource.js.map +1 -0
- package/dist-esm/src/settingsImport/readableStreamConfigurationSettingsSource.js +49 -0
- package/dist-esm/src/settingsImport/readableStreamConfigurationSettingsSource.js.map +1 -0
- package/dist-esm/src/settingsImport/stringConfigurationSettingsSource.js +92 -0
- package/dist-esm/src/settingsImport/stringConfigurationSettingsSource.js.map +1 -0
- package/package.json +19 -5
- package/types/src/appConfigurationImporter.d.ts +37 -0
- package/types/src/appConfigurationImporter.d.ts.map +1 -0
- package/types/src/enums.d.ts +23 -0
- package/types/src/enums.d.ts.map +1 -0
- package/types/src/errors.d.ts +25 -0
- package/types/src/errors.d.ts.map +1 -0
- package/types/src/importOptions.d.ts +39 -0
- package/types/src/importOptions.d.ts.map +1 -0
- package/types/src/index.d.ts +10 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/internal/adaptiveTaskManager.d.ts +20 -0
- package/types/src/internal/adaptiveTaskManager.d.ts.map +1 -0
- package/types/src/internal/constants.d.ts +8 -0
- package/types/src/internal/constants.d.ts.map +1 -0
- package/types/src/internal/parsers/configurationSettingsConverter.d.ts +11 -0
- package/types/src/internal/parsers/configurationSettingsConverter.d.ts.map +1 -0
- package/types/src/internal/parsers/defaultConfigurationSettingsConverter.d.ts +20 -0
- package/types/src/internal/parsers/defaultConfigurationSettingsConverter.d.ts.map +1 -0
- package/types/src/internal/parsers/kvSetConfigurationSettingsConverter.d.ts +15 -0
- package/types/src/internal/parsers/kvSetConfigurationSettingsConverter.d.ts.map +1 -0
- package/types/src/internal/stream.browser.d.ts +4 -0
- package/types/src/internal/stream.browser.d.ts.map +1 -0
- package/types/src/internal/stream.d.ts +4 -0
- package/types/src/internal/stream.d.ts.map +1 -0
- package/types/src/internal/utils.d.ts +17 -0
- package/types/src/internal/utils.d.ts.map +1 -0
- package/types/src/models.d.ts +42 -0
- package/types/src/models.d.ts.map +1 -0
- package/types/src/settingsImport/configurationSettingsSource.d.ts +19 -0
- package/types/src/settingsImport/configurationSettingsSource.d.ts.map +1 -0
- package/types/src/settingsImport/iterableConfigurationSettingsSource.d.ts +14 -0
- package/types/src/settingsImport/iterableConfigurationSettingsSource.d.ts.map +1 -0
- package/types/src/settingsImport/readableStreamConfigurationSettingsSource.d.ts +11 -0
- package/types/src/settingsImport/readableStreamConfigurationSettingsSource.d.ts.map +1 -0
- package/types/src/settingsImport/stringConfigurationSettingsSource.d.ts +24 -0
- package/types/src/settingsImport/stringConfigurationSettingsSource.d.ts.map +1 -0
- package/NOTICE.txt +0 -370
- package/app-configuration-importer.test.log +0 -164
- package/dist/app-configuration-importer.api.md +0 -136
- package/examples/README.md +0 -59
- package/examples/package.json +0 -32
- package/examples/sample.env +0 -6
- package/examples/testFiles/default.json +0 -24
- package/examples/testFiles/kvset.json +0 -35
- package/types/tsdoc-metadata.json +0 -11
package/examples/README.md
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Examples for Azure App Configuration Importer
|
|
2
|
-
|
|
3
|
-
These examples show how to use the App Configuration Importer in some common scenarios
|
|
4
|
-
|
|
5
|
-
| File Name | Description |
|
|
6
|
-
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
7
|
-
| [fileSourceExample.ts](./src/fileSourceExample.ts) | Demonstrates importing configuration settings from a File source |
|
|
8
|
-
| [iterableSourceExample.ts](./src/iterableSourceExample.ts) | Demonstrates importing configuration settings from an Iterable source |
|
|
9
|
-
| [stringSourceExample.ts](./src/stringSourceExample.ts) | Demonstrates importing configuration settings from a String source |
|
|
10
|
-
| [readableStreamSourceExample](./src/readableStreamSourceExample.ts) | Demonstrates importing configuration settings from a ReadableStream source |
|
|
11
|
-
|
|
12
|
-
## Prerequisites
|
|
13
|
-
|
|
14
|
-
The example are compatible with [LTS version of Node.js](https://github.com/nodejs/release#release-schedule)
|
|
15
|
-
|
|
16
|
-
You'll need the following Azure resources to run the examples
|
|
17
|
-
|
|
18
|
-
- An [Azure subscription](https://azure.microsoft.com/free/)
|
|
19
|
-
- An [Azure App Configuration store](https://learn.microsoft.com/azure/azure-app-configuration/quickstart-azure-app-configuration-create?tabs=azure-portal)
|
|
20
|
-
|
|
21
|
-
Before running the samples in Node, they must be complied to JavaScript using the TypeScript complier. For more information on TypeScript,
|
|
22
|
-
see the [TypeScript documentation](https://www.typescriptlang.org/docs/home). Install the TypeScript compiler using:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm install -g typescript
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Setup & Run
|
|
29
|
-
|
|
30
|
-
To run the examples using the published version of the package:
|
|
31
|
-
|
|
32
|
-
1. Install the dependencies using `npm`:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npm install
|
|
36
|
-
```
|
|
37
|
-
2. There are two ways to run the examples using the correct credentials:
|
|
38
|
-
|
|
39
|
-
- Edit the file `sample.env`, adding the correct credentials to access your App Configuration. Then rename the file from `sample.env` to just `.env`. The examples will read the file automatically.
|
|
40
|
-
|
|
41
|
-
- Alternatively, you can set the environment variable to the access keys to your App Configuration store. In this case, setting up the `.env` file is not required.
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
npx cross-env APPCONFIG_CONNECTION_STRING="<appconfig connection string>"
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
3. Compile the examples
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
npm run build
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
4. Run whichever example you like
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
node dist\fileSourceExample.js
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
5. Clean up any configuration settings that may have been imported to your store if you don't plan on using them.
|
package/examples/package.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@azure-samples/app-configuration-importer-ts",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"description": "Azure App Configuration Importer client library samples for TypeScript",
|
|
6
|
-
"engines": {
|
|
7
|
-
"node": ">=18.0.0"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "npm run clean && tsc -b",
|
|
11
|
-
"clean": "rimraf dist/"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"node",
|
|
15
|
-
"azure",
|
|
16
|
-
"typescript",
|
|
17
|
-
"browser",
|
|
18
|
-
"cloud"
|
|
19
|
-
],
|
|
20
|
-
"author": "Microsoft Corporation",
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"dotenv": "latest",
|
|
24
|
-
"@azure/app-configuration-importer": "latest",
|
|
25
|
-
"@azure/app-configuration-importer-file-source": "latest"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@types/node": "^18.0.0",
|
|
29
|
-
"typescript": "~5.4.5",
|
|
30
|
-
"rimraf": "latest"
|
|
31
|
-
}
|
|
32
|
-
}
|
package/examples/sample.env
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
# This is the connection string for your app-configuration resource
|
|
2
|
-
# You can get this from the Azure portal.
|
|
3
|
-
APPCONFIG_CONNECTION_STRING=<app-configuration connection string goes here>
|
|
4
|
-
|
|
5
|
-
# This is the connection string for your source app-configuration resource, will be used in the iterableSource example, when importing configuration settings from one store to another
|
|
6
|
-
APPCONFIG_CONNECTION_STRING_SRC_STORE=<app-configuration connection string goes here>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"app":{
|
|
3
|
-
"Settings":{
|
|
4
|
-
"FontSize": "45",
|
|
5
|
-
"BackgroundColor": "yellow",
|
|
6
|
-
"FontColor":"black"
|
|
7
|
-
}
|
|
8
|
-
},
|
|
9
|
-
"FeatureManagement": {
|
|
10
|
-
"FeatureT": true,
|
|
11
|
-
"FeatureU": false,
|
|
12
|
-
"FeatureV": {
|
|
13
|
-
"EnabledFor": [
|
|
14
|
-
{
|
|
15
|
-
"Name": "TimeWindow",
|
|
16
|
-
"Parameters": {
|
|
17
|
-
"Start": "Wed, 01 May 2019 13:59:59 GMT",
|
|
18
|
-
"End": "Mon, 01 July 2019 00:00:00 GMT"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"items": [
|
|
3
|
-
{
|
|
4
|
-
"key": ".appconfig.featureflag/Beta",
|
|
5
|
-
"value": "{\"id\":\"Beta\",\"description\":\"Beta feature\",\"enabled\":true,\"conditions\":{\"client_filters\":[]}}",
|
|
6
|
-
"label": "MyLabel",
|
|
7
|
-
"content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8",
|
|
8
|
-
"tags": {}
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"key": "test:app:Database:ConnectionString",
|
|
12
|
-
"value": "{\"uri\":\"https://keyvault.vault.azure.net/secrets/db-secret\"}",
|
|
13
|
-
"label": "MyLabel",
|
|
14
|
-
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
|
|
15
|
-
"tags": {}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"key": "test:app:Env",
|
|
19
|
-
"value": "Debug",
|
|
20
|
-
"label": "MyLabel",
|
|
21
|
-
"content_type": null,
|
|
22
|
-
"tags": {
|
|
23
|
-
"tag1": "value1",
|
|
24
|
-
"tag2": "value2"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"key": "test:app:BackgroundColor",
|
|
29
|
-
"value": "yellow",
|
|
30
|
-
"label": "MyLabel",
|
|
31
|
-
"content_type": null,
|
|
32
|
-
"tags": {}
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.47.0"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|