From 69426726d4dcb0f7503d1faf7c20b112b020874d Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 5 Feb 2024 13:00:20 +0100 Subject: [PATCH 1/4] feat: expand exploreDirectory algorithm --- index.html | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/index.html b/index.html index 44e5fb6..19be7aa 100644 --- a/index.html +++ b/index.html @@ -754,33 +754,40 @@

Validating an ExposedThingInit

Set |discovery|.{{ThingDiscoveryProcess/[[filter]]}} to |filter:ThingFilter|.
  • - Request the underlying platform to start the directory discovery process.

    This is a placeholder for more details in the discovery algorithm. Implementations should follow the procedures described in the [[wot-discovery]] and [wot-binding-templates] specifications. - Some normative steps are indicated below. + Some normative steps (that are currently Work in Progress) are + indicated below.

    -
      -
    1. - If |url| is not a TD Directory or if the underlying - implementation cannot support the Protocol Binding - indicated by |url|, [=reject=] |promise| - with {{NotSupportedError}} and terminate these steps. -
    2. -
    3. - If filters in general are not supported by the implementation and - |filter| is not `undefined` or `null`, [=reject=] |promise| - with {{NotSupportedError}} and stop. -
    4. -
    5. - Run the discovery process given |discovery|. -

      - From this point on, errors are recorded only on - {{ThingDiscoveryProcess/error}}, but don't affect |promise| any longer. -

      -
    6. -
    + + If the underlying implementation cannot support the + Protocol Binding indicated by |url|, [=reject=] |promise| with + {{NotSupportedError}} and stop. +
  • +
  • + Request the underlying platform to retrieve the TD available under + |discovery|.{{ThingDiscoveryProcess/[[url]]}}. + If that does not return a valid TDD Thing Description, [=reject=] + |promise| with {{TypeError}} and stop. + + Otherwise, let |directoryTd| be the retrieved TD. +
  • +
  • + Let |consumedTddThing| be the result of + creating a ConsumedThing + from |directoryTd|. + If that fails, resolve |promise| with {{SyntaxError}} and stop. +
  • +
  • + Run the discovery process given |discovery| by + either invoking one of the actions associated with the Search API + – if the {{ThingDiscoveryProcess/[[filter]]}} argument is not + `undefined` or `null` – or reading the `things` property. +
  • +
  • +
  • [=Resolve=] |promise| with |discovery|. From 109126cab09ccc2ccc89a9e72d8ea79b29762df8 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 18 Mar 2024 12:15:14 +0100 Subject: [PATCH 2/4] fixup! feat: expand exploreDirectory algorithm --- index.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 19be7aa..2e63847 100644 --- a/index.html +++ b/index.html @@ -731,6 +731,15 @@

    Validating an ExposedThingInit

    optional ThingFilter filter = {}); }; + + +
    +      dictionary ExploreDirectoryQuery {
    +        DOMString query;
    +        DOMString queryType;
    +      };
    +    
    +
    Belongs to the WoT Discovery conformance class. Starts the discovery process that given a TD Directory URL, will provide {{ThingDescription}} objects for Thing Descriptions that match an optional |filter:ThingFilter| argument of type {{ThingFilter}}. The method MUST run the following steps:
      @@ -3861,7 +3870,8 @@

      The ThingFilter dictionary

               dictionary ThingFilter {
                 object? fragment;
      -          
      +          
      +          ExploreDirectoryQuery? directoryQuery
               };
             

      From c9f6cdfeec1c5ba1f301273a41cf40ac60006b92 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 8 Jul 2024 09:58:18 +0200 Subject: [PATCH 3/4] fixup! feat: expand exploreDirectory algorithm --- index.html | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 2e63847..f837dd7 100644 --- a/index.html +++ b/index.html @@ -790,13 +790,24 @@

      Validating an ExposedThingInit

      If that fails, resolve |promise| with {{SyntaxError}} and stop.
    1. - Run the discovery process given |discovery| by - either invoking one of the actions associated with the Search API - – if the {{ThingDiscoveryProcess/[[filter]]}} argument is not - `undefined` or `null` – or reading the `things` property. -
    2. -
    3. - + Run the discovery process given |discovery| by running the + following steps: +
        + +
      1. + If the {{ThingDiscoveryProcess/[[filter]]}} argument is not + `undefined` or `null`, invoke the Action that represents the + corresponding Search API. + + If the corresponding Action is not present, throw a + {{NotSupportedError}} and stop. +
      2. +
      3. + Otherwise, read the `things` property. +
      4. +
    4. [=Resolve=] |promise| with |discovery|. From dc81bc5e7e6a5ef1f9980789031c8376e985feb0 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 8 Jul 2024 10:02:30 +0200 Subject: [PATCH 4/4] fixup! feat: expand exploreDirectory algorithm --- index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index f837dd7..452f322 100644 --- a/index.html +++ b/index.html @@ -796,8 +796,10 @@

      Validating an ExposedThingInit

    5. If the {{ThingDiscoveryProcess/[[filter]]}} argument is not - `undefined` or `null`, invoke the Action that represents the - corresponding Search API. + `undefined` or `null`, let |queryType| be invoke the Action that + represents the corresponding Search API described by + + {{ThingDiscoveryProcess/[[filter]].queryType}}.