@mediarithmics/plugins-nodejs-sdk
Version:
This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate
31 lines • 1.94 kB
JavaScript
;
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasIdentifyingProfileSelectedResource = exports.hasIdentifyingDeviceTechnicalIdSelectedResource = exports.hasIdentifyingEmailSelectedResource = exports.hasIdentifyingAccountSelectedResource = exports.isIdentifyingProfile = exports.isIdentifyingDeviceTechnicalId = exports.isIdentifyingEmail = exports.isIdentifyingAccount = void 0;
const isIdentifyingAccount = (resourceShape) => {
return resourceShape.type === 'USER_ACCOUNT';
};
exports.isIdentifyingAccount = isIdentifyingAccount;
const isIdentifyingEmail = (resourceShape) => {
return resourceShape.type === 'USER_EMAIL';
};
exports.isIdentifyingEmail = isIdentifyingEmail;
const isIdentifyingDeviceTechnicalId = (resourceShape) => {
return resourceShape.type === 'USER_DEVICE_TECHNICAL_ID';
};
exports.isIdentifyingDeviceTechnicalId = isIdentifyingDeviceTechnicalId;
const isIdentifyingProfile = (resourceShape) => {
return resourceShape.type === 'USER_PROFILE';
};
exports.isIdentifyingProfile = isIdentifyingProfile;
const getHasIdentifyingSelectedResource = (isIdentifyingResourceFunction) => {
return (baseInstanceContext) => {
const selectedIdentifyingResources = baseInstanceContext.feed.selected_identifying_resources;
return (selectedIdentifyingResources !== undefined &&
selectedIdentifyingResources.filter(isIdentifyingResourceFunction).length !== 0);
};
};
_a = [exports.isIdentifyingAccount, exports.isIdentifyingEmail, exports.isIdentifyingDeviceTechnicalId, exports.isIdentifyingProfile].map((fn) => {
return getHasIdentifyingSelectedResource(fn);
}), exports.hasIdentifyingAccountSelectedResource = _a[0], exports.hasIdentifyingEmailSelectedResource = _a[1], exports.hasIdentifyingDeviceTechnicalIdSelectedResource = _a[2], exports.hasIdentifyingProfileSelectedResource = _a[3];
//# sourceMappingURL=ValueInterface.js.map