xmpp.chapril.org-conversejs/src/headless/core.js

51 lines
1.4 KiB
JavaScript
Raw Normal View History

/**
2020-01-26 16:21:20 +01:00
* @copyright The Converse.js contributors
2019-09-19 16:54:55 +02:00
* @license Mozilla Public License (MPLv2)
*/
import './shared/constants.js';
import _converse from './shared/_converse';
import advancedFormat from 'dayjs/plugin/advancedFormat';
import connection_api from './shared/connection/api.js';
import dayjs from 'dayjs';
import i18n from './shared/i18n';
import { settings_api } from './shared/settings/api.js';
import send_api from './shared/api/send.js';
import user_api from './shared/api/user.js';
import events_api from './shared/api/events.js';
import promise_api from './shared/api/promise.js';
2018-10-23 03:41:38 +02:00
2023-02-26 16:23:42 +01:00
export { converse } from './shared/api/public.js';
export { _converse };
export { i18n };
dayjs.extend(advancedFormat);
2019-05-06 11:16:56 +02:00
2020-03-31 12:51:30 +02:00
/**
* ### The private API
*
* The private API methods are only accessible via the closured {@link _converse}
* object, which is only available to plugins.
*
* These methods are kept private (i.e. not global) because they may return
* sensitive data which should be kept off-limits to other 3rd-party scripts
* that might be running in the page.
*
* @namespace _converse.api
* @memberOf _converse
*/
export const api = _converse.api = {
2022-04-25 09:47:11 +02:00
connection: connection_api,
settings: settings_api,
...send_api,
...user_api,
...events_api,
...promise_api,
2020-03-31 12:51:30 +02:00
};
_converse.shouldClearCache = () => (
!_converse.config.get('trusted') ||
api.settings.get('clear_cache_on_logout') ||
_converse.isTestEnv()
);