@devcycle/js-cloud-server-sdk
Version:
The DevCycle JS Cloud Bucketing Server SDK used for feature management.
66 lines • 3.1 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.DVCPopulatedUser = void 0;
const packageJson = __importStar(require("../../package.json"));
class DVCPopulatedUser {
constructor(user, platformDetails) {
this.user_id = user.user_id;
this.email = user.email;
this.name = user.name;
this.language = user.language;
this.country = user.country;
this.appVersion = user.appVersion;
this.appBuild = user.appBuild;
this.customData = user.customData;
this.privateCustomData = user.privateCustomData;
this.lastSeenDate = new Date();
/**
* Read only properties initialized once
*/
this.createdDate = new Date();
this.platform = (platformDetails === null || platformDetails === void 0 ? void 0 : platformDetails.platform) || 'NodeJS';
this.platformVersion = (platformDetails === null || platformDetails === void 0 ? void 0 : platformDetails.platformVersion) || '';
this.sdkType = (platformDetails === null || platformDetails === void 0 ? void 0 : platformDetails.sdkType) || 'server';
this.sdkVersion = (platformDetails === null || platformDetails === void 0 ? void 0 : platformDetails.sdkVersion) || packageJson.version;
this.sdkPlatform = platformDetails === null || platformDetails === void 0 ? void 0 : platformDetails.sdkPlatform;
this.hostname = platformDetails === null || platformDetails === void 0 ? void 0 : platformDetails.hostname;
}
static fromDVCUser(user, platformDetails) {
return new DVCPopulatedUser(user, platformDetails);
}
}
exports.DVCPopulatedUser = DVCPopulatedUser;
//# sourceMappingURL=populatedUser.js.map