"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getIntrinsicUserAttributes = exports.LocalIssuerTypes = exports.isOpenIdUser = exports.isUserWithOrg = exports.UserAsCodeInvitationStatus = exports.UserAsCodeLifecycleStatus = void 0;
var UserAsCodeLifecycleStatus;
(function (UserAsCodeLifecycleStatus) {
    UserAsCodeLifecycleStatus["READY"] = "ready";
    UserAsCodeLifecycleStatus["AWAITING_AUTHENTICATION"] = "awaiting authentication";
})(UserAsCodeLifecycleStatus || (exports.UserAsCodeLifecycleStatus = UserAsCodeLifecycleStatus = {}));
var UserAsCodeInvitationStatus;
(function (UserAsCodeInvitationStatus) {
    UserAsCodeInvitationStatus["NOT_REQUESTED"] = "not requested";
    UserAsCodeInvitationStatus["SENT"] = "sent";
    UserAsCodeInvitationStatus["SKIPPED_AUTHENTICATED"] = "skipped authenticated";
    UserAsCodeInvitationStatus["SKIPPED_DISABLED"] = "skipped disabled";
    UserAsCodeInvitationStatus["SKIPPED_VALID_INVITE"] = "skipped valid invite";
})(UserAsCodeInvitationStatus || (exports.UserAsCodeInvitationStatus = UserAsCodeInvitationStatus = {}));
const isUserWithOrg = (user) => typeof user?.organizationUuid === 'string' &&
    typeof user?.organizationName === 'string' &&
    user?.organizationCreatedAt instanceof Date &&
    typeof user?.role === 'string';
exports.isUserWithOrg = isUserWithOrg;
const isOpenIdUser = (user) => typeof user === 'object' &&
    user !== null &&
    user.userUuid === undefined &&
    user.userId === undefined &&
    typeof user.openId === 'object' &&
    user.openId !== null &&
    typeof user.openId.subject === 'string' &&
    typeof user.openId.issuer === 'string' &&
    typeof user.openId.email === 'string' &&
    typeof user.openId.issuerType === 'string';
exports.isOpenIdUser = isOpenIdUser;
var LocalIssuerTypes;
(function (LocalIssuerTypes) {
    LocalIssuerTypes["EMAIL"] = "email";
    LocalIssuerTypes["API_TOKEN"] = "apiToken";
})(LocalIssuerTypes || (exports.LocalIssuerTypes = LocalIssuerTypes = {}));
const getIntrinsicUserAttributes = (user) => ({
    email: user.email,
});
exports.getIntrinsicUserAttributes = getIntrinsicUserAttributes;
//# sourceMappingURL=user.js.map