linagora / tmail-backend

GNU Affero General Public License v3.0
30 stars 17 forks source link

Implement PublicAsset/get method #1042

Closed quantranhong1999 closed 1 month ago

quantranhong1999 commented 1 month ago

Request:

{
    "using": [
        "urn:ietf:params:jmap:core",
        "com:linagora:params:public:assets"
    ],
    "methodCalls": [
        [
            "PublicAsset/get",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "ids": [
                    "297bf5a7-855d-459a-9853-02031169b704",
                    "notFound"
                ]
            },
            "c1"
        ]
    ]
}

Response:

{
    "sessionState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
    "methodResponses": [
        [
            "PublicAsset/get",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
                "list": [
                    {
                        "id": "297bf5a7-855d-459a-9853-02031169b704",
                        "publicURI": "https://apisix.upn.integration-open-paas.org/29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6/297bf5a7-855d-459a-9853-02031169b704",
                        "size": 11534336,
                        "identityIds": [
                            "858e7569-7085-46d2-82da-5ba0d723e94b",
                            "497f99e1-af19-4d7d-bdcb-660b69e219af"
                        ]
                    }
                ],
                "notFound": [
                    "notFound"
                ]
            },
            "c1"
        ]
    ]
}

Notes:

DoD: integration tests

Arsnael commented 1 month ago

Need to return contentType

hungphan227 commented 1 month ago

PR https://github.com/linagora/tmail-backend/pull/1060