Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: export Resolver interface #43

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading