Skip to content

Commit

Permalink
Merge pull request #2 from edgee-cloud/manifest-renaming
Browse files Browse the repository at this point in the history
Rename manifest fields, add example setting
  • Loading branch information
alexcasalboni authored Feb 13, 2025
2 parents 6cb4752 + b99cfe1 commit f67bd7b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions edgee-component.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
manifest_version = 1

[package]
[component]
name = "example-ts-component"
version = "1.0.0"
category = "data-collection"
Expand All @@ -10,6 +10,10 @@ documentation = "https://github.com/edgee-cloud/example-ts-component"
repository = "https://github.com/edgee-cloud/example-ts-component"
wit-world-version = "0.4.0"

[package.build]
[component.build]
command = "npm install && npm run generate && npm run build"
output_path = "./example-ts-component.wasm"

[component.settings.example]
title = "Example Config Field"
type = "string"
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const dataCollection: typeof EdgeeProtocolsDataCollection = {

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

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

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


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

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

// build payload
Expand Down
2 changes: 1 addition & 1 deletion test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('data collection component', function () {
};

const sampleSettings: Dict = [
["your_api_key", "api_value"]
["example", "api_value"]
];

describe('#page()', function () {
Expand Down

0 comments on commit f67bd7b

Please sign in to comment.