UNPKG

mongodb-stitch

Version:

[![Join the chat at https://gitter.im/mongodb/stitch](https://badges.gitter.im/mongodb/stitch.svg)](https://gitter.im/mongodb/stitch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

45 lines 1.86 kB
import { ApiStitchUserIdentity } from "mongodb-stitch-core-sdk"; var StitchAdminUserProfileFields; (function (StitchAdminUserProfileFields) { StitchAdminUserProfileFields["UserType"] = "type"; StitchAdminUserProfileFields["Identities"] = "identities"; StitchAdminUserProfileFields["Data"] = "data"; StitchAdminUserProfileFields["Roles"] = "roles"; })(StitchAdminUserProfileFields || (StitchAdminUserProfileFields = {})); var StitchAdminUserProfileCodec = (function () { function StitchAdminUserProfileCodec() { } StitchAdminUserProfileCodec.prototype.decode = function (from) { var roleCodec = new StitchAdminRoleCodec(); return { data: from[StitchAdminUserProfileFields.Data], identities: from[StitchAdminUserProfileFields.Identities].map(function (identity) { return ApiStitchUserIdentity.fromJSON(identity); }), roles: from[StitchAdminUserProfileFields.Roles].map(function (role) { return roleCodec.decode(role); }), userType: from[StitchAdminUserProfileFields.UserType] }; }; return StitchAdminUserProfileCodec; }()); export { StitchAdminUserProfileCodec }; var StitchAdminRoleFields; (function (StitchAdminRoleFields) { StitchAdminRoleFields["Name"] = "role_name"; StitchAdminRoleFields["GroupId"] = "group_id"; })(StitchAdminRoleFields || (StitchAdminRoleFields = {})); var StitchAdminRoleCodec = (function () { function StitchAdminRoleCodec() { } StitchAdminRoleCodec.prototype.decode = function (from) { return { groupId: from[StitchAdminRoleFields.GroupId], name: from[StitchAdminRoleFields.Name] }; }; return StitchAdminRoleCodec; }()); export { StitchAdminRoleCodec }; //# sourceMappingURL=StitchAdminUserProfile.js.map