From 6f765e19193303f0e736a4ab6a4cf4aeca9873f9 Mon Sep 17 00:00:00 2001 From: b-ma Date: Thu, 16 May 2024 14:19:35 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20collecti?= =?UTF-8?q?ve-soundworks/soundworks@4f5a9d0b08d2640a256a6d385a223361bbf3f9?= =?UTF-8?q?7b=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.Client.html | 124 +++++-- client.Context.html | 2 +- client.ContextManager.html | 2 +- client.Plugin.html | 2 +- client.PluginManager.html | 2 +- client.SharedState.html | 2 +- client.SharedStateCollection.html | 2 +- client.Socket.html | 18 +- client.StateManager.html | 2 +- client.html | 432 +---------------------- client_Client.js.html | 57 +-- client_Context.js.html | 2 +- client_ContextManager.js.html | 2 +- client_Plugin.js.html | 2 +- client_PluginManager.js.html | 2 +- client_SharedState.js.html | 2 +- client_SharedStateCollection.js.html | 2 +- client_Socket.js.html | 20 +- client_StateManager.js.html | 2 +- client_index.js.html | 8 +- common_BasePlugin.js.html | 2 +- common_BasePluginManager.js.html | 2 +- common_BaseSharedState.js.html | 2 +- common_BaseSharedStateCollection.js.html | 2 +- common_BaseStateManager.js.html | 2 +- common_ParameterBag.js.html | 2 +- common_SharedStatePrivate.js.html | 2 +- global.html | 2 +- index.html | 2 +- server.Client.html | 2 +- server.Context.html | 2 +- server.ContextManager.html | 2 +- server.Plugin.html | 2 +- server.PluginManager.html | 2 +- server.Server.html | 38 +- server.SharedState.html | 2 +- server.SharedStateCollection.html | 2 +- server.Socket.html | 2 +- server.Sockets.html | 2 +- server.StateManager.html | 2 +- server.html | 4 +- server_Client.js.html | 2 +- server_Context.js.html | 2 +- server_ContextManager.js.html | 2 +- server_Plugin.js.html | 2 +- server_PluginManager.js.html | 2 +- server_Server.js.html | 33 +- server_SharedState.js.html | 2 +- server_SharedStateCollection.js.html | 2 +- server_Socket.js.html | 2 +- server_Sockets.js.html | 2 +- server_StateManager.js.html | 2 +- server_audit-schema.js.html | 2 +- server_index.js.html | 8 +- 54 files changed, 273 insertions(+), 557 deletions(-) diff --git a/client.Client.html b/client.Client.html index 9310c2a1..ff69bf0b 100644 --- a/client.Client.html +++ b/client.Client.html @@ -99,7 +99,7 @@

new ClientSource:
@@ -177,10 +177,7 @@
Parameters:
-client.BrowserClientConfig -| - -client.NodeClientConfig +client.ClientConfig @@ -249,7 +246,7 @@

Members

-

config :client.BrowserClientConfig|client.NodeClientConfig

+

config :client.ClientConfig

@@ -264,7 +261,7 @@

configSource:
@@ -313,10 +310,7 @@
Type:
  • -client.BrowserClientConfig -| - -client.NodeClientConfig +client.ClientConfig @@ -346,7 +340,7 @@

    context
    Source:
    @@ -434,7 +428,7 @@

    idSource:
    @@ -515,7 +509,7 @@

    pluginMa
    Source:
    @@ -601,7 +595,7 @@

    roleSource:
    @@ -680,7 +674,7 @@

    socketSource:
    @@ -767,7 +761,7 @@

    stateMana
    Source:
    @@ -853,7 +847,7 @@

    statusSource:
    @@ -931,7 +925,7 @@

    targetSource:
    @@ -1010,7 +1004,7 @@

    uuidSource:
    @@ -1073,6 +1067,84 @@
    Type:
    + +

    (readonly) version :string

    + + + + + +
    + +
    Description:
    +
    • package version

    + + + +
    Source:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +

    package version

    +
    + + + +
    Type:
    +
      +
    • + +string + + + +
    • +
    + + + + + + + @@ -1104,7 +1176,7 @@

    Source:
    @@ -1247,7 +1319,7 @@

    (as
    Source:
    @@ -1342,7 +1414,7 @@

    onStatu
    Source:
    @@ -1508,7 +1580,7 @@

    (a
    Source:
    @@ -1604,7 +1676,7 @@

    (as
    Source:
    @@ -1699,7 +1771,7 @@
    Example

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client.Context.html b/client.Context.html index 1de1e6d8..51223569 100644 --- a/client.Context.html +++ b/client.Context.html @@ -998,7 +998,7 @@

    (as
    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client.ContextManager.html b/client.ContextManager.html index 6f08bbd0..5c09f8d4 100644 --- a/client.ContextManager.html +++ b/client.ContextManager.html @@ -243,7 +243,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client.Plugin.html b/client.Plugin.html index 7501d326..83960300 100644 --- a/client.Plugin.html +++ b/client.Plugin.html @@ -1628,7 +1628,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client.PluginManager.html b/client.PluginManager.html index 049f462d..6323ea1e 100644 --- a/client.PluginManager.html +++ b/client.PluginManager.html @@ -1096,7 +1096,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client.SharedState.html b/client.SharedState.html index 2441930f..02668379 100644 --- a/client.SharedState.html +++ b/client.SharedState.html @@ -2731,7 +2731,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client.SharedStateCollection.html b/client.SharedStateCollection.html index b038417b..da22d397 100644 --- a/client.SharedStateCollection.html +++ b/client.SharedStateCollection.html @@ -3099,7 +3099,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client.Socket.html b/client.Socket.html index 9ef19b38..13d73098 100644 --- a/client.Socket.html +++ b/client.Socket.html @@ -120,7 +120,7 @@

    addB
    Source:
    @@ -279,7 +279,7 @@

    addListene
    Source:
    @@ -440,7 +440,7 @@

    Source:
    @@ -583,7 +583,7 @@

    rem
    Source:
    @@ -726,7 +726,7 @@

    r
    Source:
    @@ -885,7 +885,7 @@

    removeL
    Source:
    @@ -1044,7 +1044,7 @@

    sendSource:
    @@ -1224,7 +1224,7 @@

    sendBinary<
    Source:
    @@ -1382,7 +1382,7 @@

    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client.StateManager.html b/client.StateManager.html index 9deb1cbb..7ea13cd2 100644 --- a/client.StateManager.html +++ b/client.StateManager.html @@ -1696,7 +1696,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client.html b/client.html index dfe5cb1e..c91efbe9 100644 --- a/client.html +++ b/client.html @@ -120,7 +120,7 @@

    client

    Source:
    @@ -240,7 +240,7 @@

    Type Definitions

    -

    BrowserClientConfig

    +

    ClientConfig

    @@ -255,7 +255,7 @@

    BrowserClientConfig

    Source:
    @@ -541,289 +541,13 @@
    Properties
    - websockets - - - - - -string - - - - - - - - - - <optional>
    - - - - - - - - - - {} - - - - -

    Configuration options for websockets.

    - - - - - - - subpath - - - - - -string - - - - - - - - - - <optional>
    - - - - - - - - - - '' - - - - -

    If running behind a proxy, path to the application.

    - - - - - - - - - - - - - - - - - - -
    -

    Configuration object for a client running in a browser runtime.

    -
    - - - -
    Type:
    -
      -
    • - -object - - - -
    • -
    - - - - - - - - -

    NodeClientConfig

    - - - - - -
    - -
    Description:
    -
    • Configuration object for a client running in a node runtime.

    - - - -
    Source:
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    Properties:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeAttributesDescription
    role - - -string - - - - - - - - -

    Role of the client in the application (e.g. 'player', 'controller').

    app - - -object - - - - - - - <optional>
    - - - -

    Application configration object.

    -
    Properties
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -843,25 +565,23 @@
    Properties
    - + - + - - - - - -
    NameTypeAttributesDefaultDescription
    nameuseHttps -string +boolean @@ -833,8 +557,6 @@
    Properties
    - <optional>
    -
    - '' -

    Name of the application.

    Define if the websocket should use secure connection.

    authorserverAddress -string +boolean @@ -886,134 +606,8 @@
    Properties

    Name of the author.

    - -
    env - - -object - - - - - - - - -

    Environment configration object.

    -
    Properties
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1047,7 +641,7 @@
    Properties
    - + @@ -1143,7 +737,7 @@
    Properties
    -

    Configuration object for a client running in a node runtime.

    +

    Configuration object for a client running in a browser runtime.

    @@ -1182,7 +776,7 @@
    Type:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_Client.js.html b/client_Client.js.html index 2159d363..8528f8a9 100644 --- a/client_Client.js.html +++ b/client_Client.js.html @@ -63,11 +63,12 @@

    client/Client.js

    AUDIT_STATE_NAME, } from '../common/constants.js'; import logger from '../common/logger.js'; +import version from '../common/version.js'; /** * Configuration object for a client running in a browser runtime. * - * @typedef BrowserClientConfig + * @typedef ClientConfig * @memberof client * @type {object} * @property {string} role - Role of the client in the application (e.g. 'player', 'controller'). @@ -75,24 +76,10 @@

    client/Client.js

    * @property {string} [app.name=''] - Name of the application. * @property {string} [app.author=''] - Name of the author. * @property {object} [env] - Environment configration object. - * @property {string} [env.websockets={}] - Configuration options for websockets. - * @property {string} [env.subpath=''] - If running behind a proxy, path to the application. - */ - -/** - * Configuration object for a client running in a node runtime. - * - * @typedef NodeClientConfig - * @memberof client - * @type {object} - * @property {string} role - Role of the client in the application (e.g. 'player', 'controller'). - * @property {object} [app] - Application configration object. - * @property {string} [app.name=''] - Name of the application. - * @property {string} [app.author=''] - Name of the author. - * @property {object} env - Environment configration object. - * @property {boolean} env.serverAddress - Domain name or IP of the server. - * @property {boolean} env.useHttps - Define is the server run in http or in https. - * @property {boolean} env.port - Port on which the server is listening. + * @property {boolean} env.useHttps - Define if the websocket should use secure connection. + * @property {boolean} [env.serverAddress=''] - Address the socket server. Mandatory for + * node clients. For browser clients, use `window.location.domain` as fallback if empty. + * @property {boolean} env.port - Port of the socket server. * @property {string} [env.websockets={}] - Configuration options for websockets. * @property {string} [env.subpath=''] - If running behind a proxy, path to the application. */ @@ -118,8 +105,7 @@

    client/Client.js

    */ class Client { /** - * @param {client.BrowserClientConfig|client.NodeClientConfig} config - - * Configuration of the soundworks client. + * @param {client.ClientConfig} config - Configuration of the soundworks client. * @throws Will throw if the given config object is invalid. */ constructor(config) { @@ -156,6 +142,13 @@

    client/Client.js

    } } + /** + * package version + * @type string + * @readonly + */ + this.version = version; + /** * Role of the client in the application. * @@ -166,7 +159,7 @@

    client/Client.js

    /** * Configuration object. * - * @type {client.BrowserClientConfig|client.NodeClientConfig} + * @type {client.ClientConfig} */ this.config = config; @@ -298,11 +291,26 @@

    client/Client.js

    try { await new Promise((resolve, reject) => { // wait for handshake response before starting stateManager and pluginManager - this.socket.addListener(CLIENT_HANDSHAKE_RESPONSE, async ({ id, uuid, token }) => { + this.socket.addListener(CLIENT_HANDSHAKE_RESPONSE, async ({ id, uuid, token, version }) => { this.id = id; this.uuid = uuid; this.token = token; + if (version !== this.version) { + console.warn(` +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +WARNING + +Version discrepancies between server and "${this.role}" client: ++ server: ${version} | client: ${this.version} + +This might lead to unexpected behavior, you should consider to update your +dependancies on both your server and clients. + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!`); + } + resolve(); }); @@ -328,6 +336,7 @@

    client/Client.js

    // send handshake request const payload = { role: this.role, + version: this.version, registeredPlugins: this.pluginManager.getRegisteredPlugins(), }; @@ -495,7 +504,7 @@

    client/Client.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_Context.js.html b/client_Context.js.html index e688c54b..b38d27d2 100644 --- a/client_Context.js.html +++ b/client_Context.js.html @@ -315,7 +315,7 @@

    client/Context.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_ContextManager.js.html b/client_ContextManager.js.html index 495cccfa..4d999d98 100644 --- a/client_ContextManager.js.html +++ b/client_ContextManager.js.html @@ -175,7 +175,7 @@

    client/ContextManager.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_Plugin.js.html b/client_Plugin.js.html index 0c40f8e5..3d55a3db 100644 --- a/client_Plugin.js.html +++ b/client_Plugin.js.html @@ -131,7 +131,7 @@

    client/Plugin.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_PluginManager.js.html b/client_PluginManager.js.html index dd376510..39c9fc24 100644 --- a/client_PluginManager.js.html +++ b/client_PluginManager.js.html @@ -196,7 +196,7 @@

    client/PluginManager.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_SharedState.js.html b/client_SharedState.js.html index bc5c0d06..c2a2d851 100644 --- a/client_SharedState.js.html +++ b/client_SharedState.js.html @@ -148,7 +148,7 @@

    client/SharedState.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_SharedStateCollection.js.html b/client_SharedStateCollection.js.html index 143b1f50..2a2c9020 100644 --- a/client_SharedStateCollection.js.html +++ b/client_SharedStateCollection.js.html @@ -102,7 +102,7 @@

    client/SharedStateCollection.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_Socket.js.html b/client_Socket.js.html index b3f55b7f..97abc160 100644 --- a/client_Socket.js.html +++ b/client_Socket.js.html @@ -151,25 +151,29 @@

    client/Socket.js

    path = `${config.env.subpath}/${path}`; } - let url; + const protocol = config.env.useHttps ? 'wss:' : 'ws:'; + const port = config.env.port; + let serverAddress; let webSocketOptions; if (isBrowser()) { - const protocol = window.location.protocol.replace(/^http?/, 'ws'); - const { hostname, port } = window.location; + // if a server address is given in config, use it, else fallback to URL hostname + if (config.env.serverAddress !== '') { + serverAddress = config.env.serverAddress; + } else { + serverAddress = window.location.hostname; + } - url = `${protocol}//${hostname}:${port}/${path}`; webSocketOptions = []; } else { - const protocol = config.env.useHttps ? 'wss:' : 'ws:'; - const { serverAddress, port } = config.env; + serverAddress = config.env.serverAddress; - url = `${protocol}//${serverAddress}:${port}/${path}`; webSocketOptions = { rejectUnauthorized: false, }; } + const url = `${protocol}//${serverAddress}:${port}/${path}`; let queryParams = `role=${role}&key=${key}`; if (config.token) { @@ -494,7 +498,7 @@

    client/Socket.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_StateManager.js.html b/client_StateManager.js.html index 06acf53c..8d227e0d 100644 --- a/client_StateManager.js.html +++ b/client_StateManager.js.html @@ -131,7 +131,7 @@

    client/StateManager.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/client_index.js.html b/client_index.js.html index dc9763b6..0b4ab7d6 100644 --- a/client_index.js.html +++ b/client_index.js.html @@ -51,6 +51,12 @@

    client/index.js

    /**
    + * @license
    + * Copyright (c) 2014-present IRCAM – Centre Pompidou (France, Paris)
    + * SPDX-License-Identifier: BSD-3-Clause
    + */
    +
    +/**
      * Client-side part of the `soundworks` framework.
      *
      * A `soundworks` client can run seamlessly in a browser or in a Node.js runtime.
    @@ -108,7 +114,7 @@ 

    client/index.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/common_BasePlugin.js.html b/common_BasePlugin.js.html index d3ada8ac..90020c86 100644 --- a/common_BasePlugin.js.html +++ b/common_BasePlugin.js.html @@ -237,7 +237,7 @@

    common/BasePlugin.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/common_BasePluginManager.js.html b/common_BasePluginManager.js.html index d6600e4e..afb4898a 100644 --- a/common_BasePluginManager.js.html +++ b/common_BasePluginManager.js.html @@ -315,7 +315,7 @@

    common/BasePluginManager.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/common_BaseSharedState.js.html b/common_BaseSharedState.js.html index 90b49442..22ea4d69 100644 --- a/common_BaseSharedState.js.html +++ b/common_BaseSharedState.js.html @@ -762,7 +762,7 @@

    common/BaseSharedState.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/common_BaseSharedStateCollection.js.html b/common_BaseSharedStateCollection.js.html index 0d3a6d43..c60c91c2 100644 --- a/common_BaseSharedStateCollection.js.html +++ b/common_BaseSharedStateCollection.js.html @@ -388,7 +388,7 @@

    common/BaseSharedStateCollection.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/common_BaseStateManager.js.html b/common_BaseStateManager.js.html index 0f7efd10..3413a318 100644 --- a/common_BaseStateManager.js.html +++ b/common_BaseStateManager.js.html @@ -568,7 +568,7 @@

    common/BaseStateManager.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/common_ParameterBag.js.html b/common_ParameterBag.js.html index 7d5846e6..ce56aa40 100644 --- a/common_ParameterBag.js.html +++ b/common_ParameterBag.js.html @@ -492,7 +492,7 @@

    common/ParameterBag.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/common_SharedStatePrivate.js.html b/common_SharedStatePrivate.js.html index 91c7678b..94c0e910 100644 --- a/common_SharedStatePrivate.js.html +++ b/common_SharedStatePrivate.js.html @@ -297,7 +297,7 @@

    common/SharedStatePrivate.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/global.html b/global.html index 994080b7..10b7be98 100644 --- a/global.html +++ b/global.html @@ -313,7 +313,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/index.html b/index.html index 71f80a2f..9c6203ae 100644 --- a/index.html +++ b/index.html @@ -98,7 +98,7 @@

    Other Links


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.Client.html b/server.Client.html index 8cfa269a..23a3566b 100644 --- a/server.Client.html +++ b/server.Client.html @@ -417,7 +417,7 @@
    Type:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.Context.html b/server.Context.html index 90c58a88..f5fa8bab 100644 --- a/server.Context.html +++ b/server.Context.html @@ -1261,7 +1261,7 @@

    (as
    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.ContextManager.html b/server.ContextManager.html index 03faf216..44e550ea 100644 --- a/server.ContextManager.html +++ b/server.ContextManager.html @@ -243,7 +243,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.Plugin.html b/server.Plugin.html index 73be5daf..26596cc4 100644 --- a/server.Plugin.html +++ b/server.Plugin.html @@ -1902,7 +1902,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.PluginManager.html b/server.PluginManager.html index cd99bb8d..12d85980 100644 --- a/server.PluginManager.html +++ b/server.PluginManager.html @@ -1180,7 +1180,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.Server.html b/server.Server.html index d181259a..625f333e 100644 --- a/server.Server.html +++ b/server.Server.html @@ -293,7 +293,7 @@

    configSource:
    @@ -384,7 +384,7 @@

    context
    Source:
    @@ -469,7 +469,7 @@

    httpServer<
    Source:
    @@ -546,7 +546,7 @@

    httpsInfos<
    Source:
    @@ -614,7 +614,7 @@

    (r
    Source:
    @@ -692,7 +692,7 @@

    pluginMa
    Source:
    @@ -779,7 +779,7 @@

    routerSource:
    @@ -867,7 +867,7 @@

    socketsSource:
    @@ -952,7 +952,7 @@

    stateMana
    Source:
    @@ -1037,7 +1037,7 @@

    statusSource:
    @@ -1129,7 +1129,7 @@

    Source:
    @@ -1271,7 +1271,7 @@

    (as
    Source:
    @@ -1367,7 +1367,7 @@

    isTrus
    Source:
    @@ -1522,7 +1522,7 @@

    isTrust
    Source:
    @@ -1727,7 +1727,7 @@

    Source:
    @@ -1822,7 +1822,7 @@

    (a
    Source:
    @@ -1919,7 +1919,7 @@

    (as
    Source:
    @@ -2031,7 +2031,7 @@

    Source:
    @@ -2115,7 +2115,7 @@

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.SharedState.html b/server.SharedState.html index 714c65e1..bb1f97dc 100644 --- a/server.SharedState.html +++ b/server.SharedState.html @@ -2731,7 +2731,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.SharedStateCollection.html b/server.SharedStateCollection.html index 1ba945dc..e7f719fa 100644 --- a/server.SharedStateCollection.html +++ b/server.SharedStateCollection.html @@ -3099,7 +3099,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.Socket.html b/server.Socket.html index e3322c71..90c7347b 100644 --- a/server.Socket.html +++ b/server.Socket.html @@ -1738,7 +1738,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.Sockets.html b/server.Sockets.html index 5236d69c..ece248b8 100644 --- a/server.Sockets.html +++ b/server.Sockets.html @@ -976,7 +976,7 @@
    Parameters:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.StateManager.html b/server.StateManager.html index d2e11c43..48d3df0e 100644 --- a/server.StateManager.html +++ b/server.StateManager.html @@ -5109,7 +5109,7 @@
    Returns:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server.html b/server.html index 1e9abd74..0e83db88 100644 --- a/server.html +++ b/server.html @@ -102,7 +102,7 @@

    server

    Source:
    @@ -802,7 +802,7 @@
    Type:

    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_Client.js.html b/server_Client.js.html index 258d0c3f..12bf328c 100644 --- a/server_Client.js.html +++ b/server_Client.js.html @@ -119,7 +119,7 @@

    server/Client.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_Context.js.html b/server_Context.js.html index d8ae2340..d4f69caa 100644 --- a/server_Context.js.html +++ b/server_Context.js.html @@ -307,7 +307,7 @@

    server/Context.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_ContextManager.js.html b/server_ContextManager.js.html index 94f781de..35c59b35 100644 --- a/server_ContextManager.js.html +++ b/server_ContextManager.js.html @@ -329,7 +329,7 @@

    server/ContextManager.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_Plugin.js.html b/server_Plugin.js.html index 1a473995..1ea54978 100644 --- a/server_Plugin.js.html +++ b/server_Plugin.js.html @@ -142,7 +142,7 @@

    server/Plugin.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_PluginManager.js.html b/server_PluginManager.js.html index e9fa2790..cadffbca 100644 --- a/server_PluginManager.js.html +++ b/server_PluginManager.js.html @@ -234,7 +234,7 @@

    server/PluginManager.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_Server.js.html b/server_Server.js.html index 99542763..944c52f7 100644 --- a/server_Server.js.html +++ b/server_Server.js.html @@ -84,7 +84,7 @@

    server/Server.js

    CLIENT_HANDSHAKE_ERROR, AUDIT_STATE_NAME, } from '../common/constants.js'; - +import version from '../common/version.js'; let _dbNamespaces = new Set(); @@ -214,6 +214,7 @@

    server/Server.js

    if (!isPlainObject(config)) { throw new Error(`[soundworks:Server] Invalid argument for Server constructor, config should be an object`); } + /** * @description Given config object merged with the following defaults: * @example @@ -277,6 +278,8 @@

    server/Server.js

    } } + this.version = version; + /** * Instance of the express router. * @@ -960,7 +963,8 @@

    server/Server.js

    }); socket.addListener(CLIENT_HANDSHAKE_REQUEST, async payload => { - const { role, registeredPlugins } = payload; + const { role, version, registeredPlugins } = payload; + if (!roles.includes(role)) { console.error(`[soundworks.Server] A client with invalid role ("${role}") attempted to connect`); @@ -972,6 +976,21 @@

    server/Server.js

    return; } + if (version !== this.version) { + console.warn(` +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +WARNING + +Version discrepancies between server and "${role}" client: ++ server: ${this.version} | client: ${version} + +This might lead to unexpected behavior, you should consider to update your +dependancies on both your server and clients. + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!`); + } + try { this.pluginManager.checkRegisteredPlugins(registeredPlugins); } catch (err) { @@ -1002,7 +1021,7 @@

    server/Server.js

    this._onClientConnectCallbacks.forEach(callback => callback(client)); const { id, uuid, token } = client; - socket.send(CLIENT_HANDSHAKE_RESPONSE, { id, uuid, token }); + socket.send(CLIENT_HANDSHAKE_RESPONSE, { id, uuid, token, version: this.version }); }); } @@ -1112,6 +1131,12 @@

    server/Server.js

    }, env: { type: config.env.type, + // use to configure the socket if the server is running on a different + // location than the one the client was served from (cf. #90) + useHttps: config.env.useHttps, + serverAddress: config.env.serverAddress, + port: config.env.port, + // other config, to review websockets: config.env.websockets, subpath: config.env.subpath, useMinifiedFile: useMinifiedFile[role], @@ -1249,7 +1274,7 @@

    server/Server.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_SharedState.js.html b/server_SharedState.js.html index a8f2561d..f67b439b 100644 --- a/server_SharedState.js.html +++ b/server_SharedState.js.html @@ -149,7 +149,7 @@

    server/SharedState.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_SharedStateCollection.js.html b/server_SharedStateCollection.js.html index 7c115ee8..561b4bea 100644 --- a/server_SharedStateCollection.js.html +++ b/server_SharedStateCollection.js.html @@ -103,7 +103,7 @@

    server/SharedStateCollection.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_Socket.js.html b/server_Socket.js.html index 34169fdd..2accad17 100644 --- a/server_Socket.js.html +++ b/server_Socket.js.html @@ -466,7 +466,7 @@

    server/Socket.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_Sockets.js.html b/server_Sockets.js.html index 7f012a66..21e508a1 100644 --- a/server_Sockets.js.html +++ b/server_Sockets.js.html @@ -289,7 +289,7 @@

    server/Sockets.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_StateManager.js.html b/server_StateManager.js.html index 27c60730..98875fe4 100644 --- a/server_StateManager.js.html +++ b/server_StateManager.js.html @@ -760,7 +760,7 @@

    server/StateManager.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_audit-schema.js.html b/server_audit-schema.js.html index 2f062d42..264f74c3 100644 --- a/server_audit-schema.js.html +++ b/server_audit-schema.js.html @@ -106,7 +106,7 @@

    server/audit-schema.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/server_index.js.html b/server_index.js.html index d205771b..d4706e7b 100644 --- a/server_index.js.html +++ b/server_index.js.html @@ -51,6 +51,12 @@

    server/index.js

    /**
    + * @license
    + * Copyright (c) 2014-present IRCAM – Centre Pompidou (France, Paris)
    + * SPDX-License-Identifier: BSD-3-Clause
    + */
    +
    +/**
      * Server-side part of the *soundworks* framework.
      *
      * ```
    @@ -89,7 +95,7 @@ 

    server/index.js


    - Documentation generated by JSDoc 4.0.3 on Mon May 06 2024 10:08:55 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 4.0.3 on Thu May 16 2024 14:19:34 GMT+0000 (Coordinated Universal Time) using the docdash theme.

    NameTypeAttributesDefaultDescription
    serverAddress - - -boolean - - - - - - - - - - -

    Domain name or IP of the server.

    useHttps - - -boolean - - - - - - - - - - -

    Define is the server run in http or in https.

    Address the socket server. Mandatory for +node clients. For browser clients, use window.location.domain as fallback if empty.

    Port on which the server is listening.

    Port of the socket server.