import { EventTypes } from './EventTypes.js';
import { ApiStoreContextEvent, ApiStoreReadEvent } from './BaseEvents.js';
export const EndpointEvents = {
    /**
     * Reads the endpoint model from the store.
     * @param target The node on which to dispatch the event
     * @param id The domain id of the endpoint.
     */
    get: async (target, id) => {
        const e = new ApiStoreReadEvent(EventTypes.Endpoint.get, id);
        target.dispatchEvent(e);
        return e.detail.result;
    },
    /**
     * Reads the endpoint model from the store by the path value.
     * @param target The node on which to dispatch the event
     * @param path The path of the endpoint.
     */
    byPath: async (target, path) => {
        const e = new ApiStoreReadEvent(EventTypes.Endpoint.byPath, path);
        target.dispatchEvent(e);
        return e.detail.result;
    },
    /**
     * Lists all endpoints with operations included into the result.
     * @param target The node on which to dispatch the event
     */
    list: async (target) => {
        const e = new ApiStoreContextEvent(EventTypes.Endpoint.list);
        target.dispatchEvent(e);
        return e.detail.result;
    },
};
Object.freeze(EndpointEvents);
//# sourceMappingURL=EndpointEvents.js.map