adobe / bridgeService

The BridgeService is a library that allows your project to access java code to which you do not have implicite and normal access. Use cases are JS/Python/C++ accessing Java objects or java objects that are protected, and that you do not want to distribute as a library.
MIT License
5 stars 3 forks source link

Allow filter by fields #145

Open baubakg opened 4 months ago

baubakg commented 4 months ago

We should be able to fetch a specific value from the result payload. This is either the result field or a method.

Currently

Call

{
    "callContent": {
        "fetchString1": {
            "class": "com.adobe.campaign.tests.bridge.testdata.one.MimeMessageMethods",
            "method": "createMessage",
            "args": [
                "mre"
            ]
        }
    }
}

Result

We get a lot of values:

{
    "callDurations": {
        "fetchString1": 15
    },
    "returnValues": {
        "fetchString1": {
            "messageNumber": 0,
            "size": -1,
            "subject": "a subject by me mre",
            "hashCode": 370140205,
            "isExpunged": false,
            "contentType": "text/plain",
            "content": "a content by yours truely mre",
            "lineCount": -1
        }
    }
}

Expected

We should be able to extract / filter the result to a certain depth

Rationale:

Example: if we want to use the subject in a different call, and there is no getter, and it may be a bit large.