From 7ea25cd0a533789eb4e8e053e939a968ca1ccca9 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Sun, 8 Jan 2023 17:38:01 +0100
Subject: [PATCH] chore: doc

---
 .../example/data/datasource/server/restapi.mjs   | 14 ++++++++++++++
 .../server/webconnect.mjs}                       |  6 ++----
 application/example/net/webconnect.mjs           | 16 ++++++++++++++++
 .../source/data/datasource/server/restapi.mjs    |  2 +-
 .../source/data/datasource/server/webconnect.mjs |  2 +-
 application/source/net/webconnect.mjs            |  6 +++---
 application/source/net/webconnect/message.mjs    |  6 ++++++
 application/source/net/webconnect/namespace.mjs  | 15 +++++++++++++++
 8 files changed, 58 insertions(+), 9 deletions(-)
 create mode 100644 application/example/data/datasource/server/restapi.mjs
 rename application/example/data/{storage/restapi.mjs => datasource/server/webconnect.mjs} (50%)
 create mode 100644 application/example/net/webconnect.mjs
 create mode 100644 application/source/net/webconnect/namespace.mjs

diff --git a/application/example/data/datasource/server/restapi.mjs b/application/example/data/datasource/server/restapi.mjs
new file mode 100644
index 000000000..7f4a2eb07
--- /dev/null
+++ b/application/example/data/datasource/server/restapi.mjs
@@ -0,0 +1,14 @@
+import {RestAPI} from '@schukai/monster/source/data/datasource/server/restapi.mjs';
+
+const ds = new RestAPI({
+    write: {
+        url: 'https://httpbin.org/get'    
+    },
+    read: {
+        url: 'https://httpbin.org/get'
+    }
+});
+
+ds.set({flag: true})
+ds.write().then(() => console.log('done'));
+ds.read().then(() => console.log('done'));
\ No newline at end of file
diff --git a/application/example/data/storage/restapi.mjs b/application/example/data/datasource/server/webconnect.mjs
similarity index 50%
rename from application/example/data/storage/restapi.mjs
rename to application/example/data/datasource/server/webconnect.mjs
index 983e63268..c0c020b7d 100644
--- a/application/example/data/storage/restapi.mjs
+++ b/application/example/data/datasource/server/webconnect.mjs
@@ -1,9 +1,7 @@
-import {RestAPI} from '@schukai/monster/source/data/datasource/restapi.mjs';
+import {WebConnect} from '@schukai/monster/source/data/datasource/server/webconnect.mjs';
 
-const ds = new RestAPI({
+const ds = new WebConnect({
     url: 'https://httpbin.org/get'
-}, {
-    url: 'https://httpbin.org/post'
 });
 
 ds.set({flag: true})
diff --git a/application/example/net/webconnect.mjs b/application/example/net/webconnect.mjs
new file mode 100644
index 000000000..94dd3c9f7
--- /dev/null
+++ b/application/example/net/webconnect.mjs
@@ -0,0 +1,16 @@
+import {WebConnect} from '@schukai/monster/source/net/webconnect.mjs';
+
+const connection = new WebConnect({
+    url: 'https://httpbin.org/get'
+});
+
+connection.connect().then(()=>{
+
+    connection.send({message:"Hello World!"}).then((response)=>{
+        console.log(response);
+    });
+    
+    const message = connection.poll()
+    
+    
+})
diff --git a/application/source/data/datasource/server/restapi.mjs b/application/source/data/datasource/server/restapi.mjs
index f54aabb1b..4d7065cec 100644
--- a/application/source/data/datasource/server/restapi.mjs
+++ b/application/source/data/datasource/server/restapi.mjs
@@ -17,7 +17,7 @@ export {RestAPI}
 /**
  * The RestAPI is a class that enables a REST API server.
  *
- * @externalExample ../../../example/data/storage/restapi.mjs
+ * @externalExample ../../../../example/data/datasource/server/restapi.mjs
  * @license AGPLv3
  * @since 1.22.0
  * @copyright schukai GmbH
diff --git a/application/source/data/datasource/server/webconnect.mjs b/application/source/data/datasource/server/webconnect.mjs
index cd91e8da7..07e6c4ec7 100644
--- a/application/source/data/datasource/server/webconnect.mjs
+++ b/application/source/data/datasource/server/webconnect.mjs
@@ -26,7 +26,7 @@ const webConnectSymbol = Symbol("connection");
 /**
  * The RestAPI is a class that enables a REST API server.
  *
- * @externalExample ../../../example/data/storage/restapi.mjs
+ * @externalExample ../../../../example/data/datasource/server/webconnect.mjs
  * @license AGPLv3
  * @since 3.1.0
  * @copyright schukai GmbH
diff --git a/application/source/net/webconnect.mjs b/application/source/net/webconnect.mjs
index 48535e2b1..a497ded29 100644
--- a/application/source/net/webconnect.mjs
+++ b/application/source/net/webconnect.mjs
@@ -158,18 +158,18 @@ function connectServer(resolve, reject) {
 /**
  * The RestAPI is a class that enables a REST API server.
  *
- * @externalExample ../../../example/data/storage/restapi.mjs
+ * @externalExample ../../example/net/webconnect.mjs
  * @license AGPLv3
  * @since 3.1.0
  * @copyright schukai GmbH
- * @memberOf Monster.Data.Datasource
+ * @memberOf Monster.Net
  * @summary The LocalStorage class encapsulates the access to data objects.
  */
 class WebConnect extends BaseWithOptions {
 
     /**
      *
-     * @param {Object} [options] options contains definitions for the datasource.
+     * @param {Object} [options] options contains definitions for the webconnect.
      */
     constructor(options) {
 
diff --git a/application/source/net/webconnect/message.mjs b/application/source/net/webconnect/message.mjs
index 2df1bd5e6..e198ed9d8 100644
--- a/application/source/net/webconnect/message.mjs
+++ b/application/source/net/webconnect/message.mjs
@@ -14,6 +14,12 @@ const dataSymbol = Symbol("@@data");
 
 /**
  * This class represents a WebSocket message.
+ *
+ * @license AGPLv3
+ * @since 3.4.0
+ * @copyright schukai GmbH
+ * @memberOf Monster.Net.WebSocket
+ * @summary The Message class encapsulates a WebSocket message.
  */
 class Message extends Base {
 
diff --git a/application/source/net/webconnect/namespace.mjs b/application/source/net/webconnect/namespace.mjs
new file mode 100644
index 000000000..ba98b2c10
--- /dev/null
+++ b/application/source/net/webconnect/namespace.mjs
@@ -0,0 +1,15 @@
+/**
+ * Copyright 2022 schukai GmbH
+ * SPDX-License-Identifier: AGPL-3.0
+ */
+
+
+
+/**
+ * In this namespace you will find classes and methods for handling data.
+ *
+ * @namespace Monster.Net.WebConnect
+ * @memberOf Monster.Net
+ * @author schukai GmbH
+ */
+const ns = {};
\ No newline at end of file
-- 
GitLab