"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteUser = void 0;
const utils_1 = require("./utils");
const deleteUser = async (request, { payload }) => {
    const userId = payload.userId;
    const segmentAnonymousId = payload.anonymousId;
    let query = '';
    if (userId) {
        query = `people[0][userId]=${userId}`;
    }
    else if (segmentAnonymousId) {
        query = `people[0][segmentAnonymousId]=${segmentAnonymousId}`;
    }
    else {
        return true;
    }
    return request(`${utils_1.enchargeRestAPIBase}/v1/people?${query}`, {
        method: 'DELETE'
    });
};
exports.deleteUser = deleteUser;
//# sourceMappingURL=deleteUser.js.map