Skip to content

Commit

Permalink
refactor: export Resolver interface (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeintner authored Jul 25, 2024
1 parent 1e1c19a commit 16e13fa
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
8 changes: 4 additions & 4 deletions node/thing-model/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/thing-model/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@thingweb/thing-model",
"version": "1.0.1",
"version": "1.0.2",
"repository": {
"type": "git",
"url": "git+https://github.com/eclipse-thingweb/td-tools.git",
Expand Down
18 changes: 18 additions & 0 deletions node/thing-model/src/resolver-interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/********************************************************************************
* Copyright (c) 2022 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the W3C Software Notice and
* Document License (2015-05-13) which is available at
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document.
*
* SPDX-License-Identifier: EPL-2.0 OR W3C-20150513
********************************************************************************/

export interface Resolver {
fetch(uri: string): Promise<unknown>;
}
5 changes: 1 addition & 4 deletions node/thing-model/src/tm-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ import { JsonPlaceholderReplacer } from "json-placeholder-replacer";
import { LinkElement } from "wot-thing-description-types";
import { DataSchema, ExposedThingInit } from "wot-typescript-definitions";
import { ThingModel } from "wot-thing-model-types";
import { Resolver } from "./resolver-interface";
import TMSchema from "wot-thing-model-types/schema/tm-json-schema-validation.json";

interface Resolver {
fetch(uri: string): Promise<unknown>;
}

// TODO: Refactor and reuse debug solution from core package
import debug from "debug";
const namespace = "node-wot:td-tools:thing-model-helpers";
Expand Down

0 comments on commit 16e13fa

Please sign in to comment.