UNPKG

@fnlb-project/stanza

Version:

Modern XMPP in the browser, with a JSON API

41 lines (40 loc) 1.46 kB
"use strict"; // ==================================================================== // XEP-0335: JSON Containers // -------------------------------------------------------------------- // Source: https://xmpp.org/extensions/xep-0335.html // Version: 0.1 (2013-10-25) // // -------------------------------------------------------------------- // XEP-0432: Simple JSON Messaging // -------------------------------------------------------------------- // Source: https://xmpp.org/extensions/xep-0432.html // Version: 0.1.0 (2020-02-25) // ==================================================================== Object.defineProperty(exports, "__esModule", { value: true }); const jxt_1 = require("../jxt"); const Namespaces_1 = require("../Namespaces"); const Protocol = [ (0, jxt_1.extendMessage)({ json: (0, jxt_1.childJSON)(Namespaces_1.NS_JSON_0, 'json') }), { aliases: (0, jxt_1.pubsubItemContentAliases)(), element: 'json', fields: { json: (0, jxt_1.textJSON)() }, namespace: Namespaces_1.NS_JSON_0, type: Namespaces_1.NS_JSON_0 }, { aliases: [{ path: 'message.jsonPayloads', multiple: true }], element: 'payload', fields: { type: (0, jxt_1.attribute)('datatype'), data: (0, jxt_1.childJSON)(Namespaces_1.NS_JSON_0, 'json') }, namespace: Namespaces_1.NS_JSON_MESSAGE_0 } ]; exports.default = Protocol;