Skip to content

Commit f67bd7b

Browse files
Merge pull request #2 from edgee-cloud/manifest-renaming
Rename manifest fields, add example setting
2 parents 6cb4752 + b99cfe1 commit f67bd7b

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

edgee-component.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
manifest_version = 1
22

3-
[package]
3+
[component]
44
name = "example-ts-component"
55
version = "1.0.0"
66
category = "data-collection"
@@ -10,6 +10,10 @@ documentation = "https://github.com/edgee-cloud/example-ts-component"
1010
repository = "https://github.com/edgee-cloud/example-ts-component"
1111
wit-world-version = "0.4.0"
1212

13-
[package.build]
13+
[component.build]
1414
command = "npm install && npm run generate && npm run build"
1515
output_path = "./example-ts-component.wasm"
16+
17+
[component.settings.example]
18+
title = "Example Config Field"
19+
type = "string"

src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const dataCollection: typeof EdgeeProtocolsDataCollection = {
8787

8888
// convert to native object
8989
const dictSettings = convertDict(settings);
90-
const apiKey = dictSettings.get('your_api_key');
90+
const apiKey = dictSettings.get('example');
9191
if (!apiKey) throw new Error("Missing API key");
9292

9393
// build payload
@@ -104,7 +104,7 @@ export const dataCollection: typeof EdgeeProtocolsDataCollection = {
104104

105105
// convert to native object
106106
const dictSettings = convertDict(settings);
107-
const apiKey = dictSettings.get('your_api_key');
107+
const apiKey = dictSettings.get('example');
108108
if (!apiKey) throw new Error("Missing API key");
109109

110110

@@ -122,7 +122,7 @@ export const dataCollection: typeof EdgeeProtocolsDataCollection = {
122122

123123
// convert to native object
124124
const dictSettings = convertDict(settings);
125-
const apiKey = dictSettings.get('your_api_key');
125+
const apiKey = dictSettings.get('example');
126126
if (!apiKey) throw new Error("Missing API key");
127127

128128
// build payload

test/index.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('data collection component', function () {
8787
};
8888

8989
const sampleSettings: Dict = [
90-
["your_api_key", "api_value"]
90+
["example", "api_value"]
9191
];
9292

9393
describe('#page()', function () {

0 commit comments

Comments
 (0)