From 5967ea7a068655e8a08718b863cad29f7f651d9d Mon Sep 17 00:00:00 2001 From: Chinmay Pendharkar Date: Tue, 15 Oct 2024 14:49:37 +0800 Subject: [PATCH] fix(fjagejs): cleaning up fjage-js types and adding type exporting --- docs/jsdoc/index.html | 394 +++++++++++++++++++++----------- gateways/js/dist/esm/fjage.js | 287 ++++++++++++++--------- gateways/js/dist/fjage.js | 286 ++++++++++++++--------- gateways/js/eslint.config.js | 2 +- gateways/js/package-lock.json | 39 +++- gateways/js/package.json | 10 +- gateways/js/src/TCPConnector.js | 18 +- gateways/js/src/WSConnector.js | 21 +- gateways/js/src/fjage.js | 120 ++++++++-- gateways/js/tsconfig.json | 12 +- 10 files changed, 789 insertions(+), 400 deletions(-) diff --git a/docs/jsdoc/index.html b/docs/jsdoc/index.html index ad364bcd..17f6c5f0 100644 --- a/docs/jsdoc/index.html +++ b/docs/jsdoc/index.html @@ -2,7 +2,7 @@ - fjage 1.12.0 | Documentation + fjage 1.13.0 | Documentation @@ -15,7 +15,7 @@

fjage

-
1.12.0
+
1.13.0
fjage + +
  • + ParameterReq.Entry + + + +
  • + + +
  • + ParameterReq + + + +
  • +
    @@ -429,7 +449,7 @@

    - + gateways/js/src/fjage.js @@ -485,7 +505,7 @@

    - + gateways/js/src/fjage.js @@ -542,7 +562,7 @@

    - + gateways/js/src/fjage.js @@ -599,7 +619,7 @@

    - + gateways/js/src/fjage.js @@ -656,7 +676,7 @@

    - + gateways/js/src/fjage.js @@ -713,7 +733,7 @@

    - + gateways/js/src/fjage.js @@ -770,7 +790,7 @@

    - + gateways/js/src/fjage.js @@ -827,7 +847,7 @@

    - + gateways/js/src/fjage.js @@ -884,7 +904,7 @@

    - + gateways/js/src/fjage.js @@ -941,7 +961,7 @@

    - + gateways/js/src/fjage.js @@ -998,7 +1018,7 @@

    - + gateways/js/src/fjage.js @@ -1055,7 +1075,7 @@

    - + gateways/js/src/fjage.js @@ -1112,7 +1132,7 @@

    - + gateways/js/src/fjage.js @@ -1179,7 +1199,7 @@

    - + gateways/js/src/fjage.js @@ -1188,7 +1208,7 @@

    An identifier for an agent or a topic.

    -
    new AgentID(name: string, topic: boolean, owner: Gateway)
    +
    new AgentID(name: string, topic: boolean, owner: Gateway?)
    @@ -1214,7 +1234,8 @@

    - topic (boolean) + topic (boolean + = false) name of topic
    @@ -1223,7 +1244,7 @@

    - owner (Gateway) + owner (Gateway?) Gateway owner for this AgentID
    @@ -1263,7 +1284,7 @@

    - + gateways/js/src/fjage.js @@ -1329,7 +1350,7 @@

    - + gateways/js/src/fjage.js @@ -1395,7 +1416,7 @@

    - + gateways/js/src/fjage.js @@ -1404,7 +1425,7 @@

    Sends a message to the agent represented by this id.

    -
    send(msg: string): void
    +
    send(msg: Message): void
    @@ -1421,7 +1442,7 @@

    - msg (string) + msg (Message) message to send
    @@ -1474,7 +1495,7 @@

    - + gateways/js/src/fjage.js @@ -1564,7 +1585,7 @@

    - + gateways/js/src/fjage.js @@ -1630,7 +1651,7 @@

    - + gateways/js/src/fjage.js @@ -1696,7 +1717,7 @@

    - + gateways/js/src/fjage.js @@ -1805,7 +1826,7 @@

    - + gateways/js/src/fjage.js @@ -1904,7 +1925,7 @@

    - + gateways/js/src/fjage.js @@ -1913,7 +1934,7 @@

    Base class for messages transmitted by one agent to another. Creates an empty message.

    -
    new Message(inReplyTo: Message, perf: any, null-null: Performative)
    +
    new Message(inReplyTo: Message?, perf: Performative)
    @@ -1930,7 +1951,7 @@

    - inReplyTo (Message + inReplyTo (Message? = {msgID:null,sender:null}) message to which this response corresponds to @@ -1940,16 +1961,8 @@

    - perf (any - = '') - -
    - -
    - -
    -
    - null-null (Performative) + perf (Performative + = Performative.INFORM) performative
    @@ -1989,7 +2002,7 @@

    - + gateways/js/src/fjage.js @@ -2063,7 +2076,7 @@

    - + gateways/js/src/fjage.js @@ -2124,7 +2137,7 @@

    - + gateways/js/src/fjage.js @@ -2134,7 +2147,7 @@

    A gateway for connecting to a fjage master container. The new version of the constructor uses an options object instead of individual parameters. The old version with

    -
    new Gateway(opts: Object, port: number?, pathname: string, timeout: number, hostname: string)
    +
    new Gateway(opts: Object)
    @@ -2251,45 +2264,6 @@

    -
    -
    - port (number?) - Deprecated : port number of the master container to connect to - -
    - -
    - -
    -
    - pathname (string - = ="/ws/") - Deprecated : path of the master container to connect to (for WebSockets) - -
    - -
    - -
    -
    - timeout (number - = 1000) - Deprecated : timeout for fjage level messages in ms - -
    - -
    - -
    -
    - hostname (string - = "localhost") - Deprecated : hostname/ip address of the master container to connect to - -
    - -
    -

    @@ -2323,7 +2297,7 @@

    - + gateways/js/src/fjage.js @@ -2411,7 +2385,7 @@

    - + gateways/js/src/fjage.js @@ -2499,7 +2473,7 @@

    - + gateways/js/src/fjage.js @@ -2578,7 +2552,7 @@

    - + gateways/js/src/fjage.js @@ -2657,7 +2631,7 @@

    - + gateways/js/src/fjage.js @@ -2736,7 +2710,7 @@

    - + gateways/js/src/fjage.js @@ -2815,7 +2789,7 @@

    - + gateways/js/src/fjage.js @@ -2824,7 +2798,7 @@

    Gets the agent ID associated with the gateway.

    -
    getAgentID(): string
    +
    getAgentID(): AgentID
    @@ -2842,7 +2816,7 @@

    Returns
    - string: + AgentID: agent ID @@ -2881,7 +2855,7 @@

    - + gateways/js/src/fjage.js @@ -2961,7 +2935,7 @@

    - + gateways/js/src/fjage.js @@ -3050,7 +3024,7 @@

    - + gateways/js/src/fjage.js @@ -3130,7 +3104,7 @@

    - + gateways/js/src/fjage.js @@ -3209,7 +3183,7 @@

    - + gateways/js/src/fjage.js @@ -3275,7 +3249,7 @@

    - + gateways/js/src/fjage.js @@ -3355,7 +3329,7 @@

    - + gateways/js/src/fjage.js @@ -3436,7 +3410,7 @@

    - + gateways/js/src/fjage.js @@ -3508,7 +3482,7 @@

    - + gateways/js/src/fjage.js @@ -3589,7 +3563,7 @@

    - + gateways/js/src/fjage.js @@ -3654,7 +3628,7 @@

    - + gateways/js/src/fjage.js @@ -3664,7 +3638,7 @@

    Sends a request and waits for a response. This method returns a {Promise} which resolves when a response is received or if no response is received after the timeout.

    -
    request(msg: string, timeout: number): Promise<Message?>
    +
    request(msg: Message, timeout: number): Promise<(Message | void)>
    @@ -3681,7 +3655,7 @@

    - msg (string) + msg (Message) message to send
    @@ -3706,7 +3680,7 @@

    Returns
    - Promise<Message?>: + Promise<(Message | void)>: a promise which resolves with the received response message, null on timeout @@ -3735,7 +3709,7 @@

    - receive(filter?, timeout) + receive(filter, timeout)