"use strict";
/*
 Generated by typeshare 1.13.2
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReplacerFunc = exports.ReviverFunc = exports.UPDATE_ITEM_HISTORY = exports.UPDATE_ITEMS = exports.SEND_ITEMS = exports.REVEAL_ITEM_PASSWORD = exports.RECOVER_VAULT = exports.READ_ITEMS = exports.PRINT_ITEMS = exports.NO_ACCESS = exports.MANAGE_VAULT = exports.IMPORT_ITEMS = exports.EXPORT_ITEMS = exports.DELETE_ITEMS = exports.CREATE_ITEMS = exports.ARCHIVE_ITEMS = exports.WordListType = exports.SeparatorType = exports.VaultType = exports.AllowedRecipientType = exports.AllowedType = exports.ItemShareDuration = exports.ItemState = exports.AutofillBehavior = exports.ItemFieldType = exports.ItemCategory = exports.VaultAccessorType = exports.GroupState = exports.GroupType = void 0;
var GroupType;
(function (GroupType) {
    /**
     * The owners group, which gives the following permissions:
     * - Do everything the Admin group can do
     * - See every vault other than the personal vaults
     * - Change people's names
     * - See billing
     * - Change billing
     * - Make other people owners
     * - Delete a person
     */
    GroupType["Owners"] = "owners";
    /**
     * The administrators group, which gives the following permissions:
     * - Perform recovery
     * - Create new vaults
     * - Invite new members
     * - See vault metadata, including the vault name and who has access.
     * - Make other people admins
     */
    GroupType["Administrators"] = "administrators";
    /**
     * The recovery group. It contains recovery keysets, and is added to every vault to allow for recovery.
     *
     * No one is added to this.
     */
    GroupType["Recovery"] = "recovery";
    /**
     * The external account managers group or EAM is a mandatory group for managed accounts that has
     * same permissions as the owners.
     */
    GroupType["ExternalAccountManagers"] = "externalAccountManagers";
    /** Members of a team that a user is on. */
    GroupType["TeamMembers"] = "teamMembers";
    /** A custom, user defined group. */
    GroupType["UserDefined"] = "userDefined";
    /** Support for new or renamed group types */
    GroupType["Unsupported"] = "unsupported";
})(GroupType || (exports.GroupType = GroupType = {}));
var GroupState;
(function (GroupState) {
    /** This group is active */
    GroupState["Active"] = "active";
    /** This group has been deleted */
    GroupState["Deleted"] = "deleted";
    /** This group is in an unknown state */
    GroupState["Unsupported"] = "unsupported";
})(GroupState || (exports.GroupState = GroupState = {}));
var VaultAccessorType;
(function (VaultAccessorType) {
    VaultAccessorType["User"] = "user";
    VaultAccessorType["Group"] = "group";
})(VaultAccessorType || (exports.VaultAccessorType = VaultAccessorType = {}));
var ItemCategory;
(function (ItemCategory) {
    ItemCategory["Login"] = "Login";
    ItemCategory["SecureNote"] = "SecureNote";
    ItemCategory["CreditCard"] = "CreditCard";
    ItemCategory["CryptoWallet"] = "CryptoWallet";
    ItemCategory["Identity"] = "Identity";
    ItemCategory["Password"] = "Password";
    ItemCategory["Document"] = "Document";
    ItemCategory["ApiCredentials"] = "ApiCredentials";
    ItemCategory["BankAccount"] = "BankAccount";
    ItemCategory["Database"] = "Database";
    ItemCategory["DriverLicense"] = "DriverLicense";
    ItemCategory["Email"] = "Email";
    ItemCategory["MedicalRecord"] = "MedicalRecord";
    ItemCategory["Membership"] = "Membership";
    ItemCategory["OutdoorLicense"] = "OutdoorLicense";
    ItemCategory["Passport"] = "Passport";
    ItemCategory["Rewards"] = "Rewards";
    ItemCategory["Router"] = "Router";
    ItemCategory["Server"] = "Server";
    ItemCategory["SshKey"] = "SshKey";
    ItemCategory["SocialSecurityNumber"] = "SocialSecurityNumber";
    ItemCategory["SoftwareLicense"] = "SoftwareLicense";
    ItemCategory["Person"] = "Person";
    ItemCategory["Unsupported"] = "Unsupported";
})(ItemCategory || (exports.ItemCategory = ItemCategory = {}));
var ItemFieldType;
(function (ItemFieldType) {
    ItemFieldType["Text"] = "Text";
    ItemFieldType["Concealed"] = "Concealed";
    ItemFieldType["CreditCardType"] = "CreditCardType";
    ItemFieldType["CreditCardNumber"] = "CreditCardNumber";
    ItemFieldType["Phone"] = "Phone";
    ItemFieldType["Url"] = "Url";
    ItemFieldType["Totp"] = "Totp";
    ItemFieldType["Email"] = "Email";
    ItemFieldType["Reference"] = "Reference";
    ItemFieldType["SshKey"] = "SshKey";
    ItemFieldType["Menu"] = "Menu";
    ItemFieldType["MonthYear"] = "MonthYear";
    ItemFieldType["Address"] = "Address";
    ItemFieldType["Date"] = "Date";
    ItemFieldType["Unsupported"] = "Unsupported";
})(ItemFieldType || (exports.ItemFieldType = ItemFieldType = {}));
/**
 * Controls the auto-fill behavior of a website.
 *
 *
 * For more information, visit <https://support.1password.com/autofill-behavior/>
 */
var AutofillBehavior;
(function (AutofillBehavior) {
    /** Auto-fill any page that’s part of the website, including subdomains */
    AutofillBehavior["AnywhereOnWebsite"] = "AnywhereOnWebsite";
    /** Auto-fill only if the domain (hostname and port) is an exact match. */
    AutofillBehavior["ExactDomain"] = "ExactDomain";
    /** Never auto-fill on this website */
    AutofillBehavior["Never"] = "Never";
})(AutofillBehavior || (exports.AutofillBehavior = AutofillBehavior = {}));
/** Represents the state of an item in the SDK. */
var ItemState;
(function (ItemState) {
    /** The item is active */
    ItemState["Active"] = "active";
    /** The item is archived meaning it's hidden from regular view and stored in the archive. */
    ItemState["Archived"] = "archived";
})(ItemState || (exports.ItemState = ItemState = {}));
/** The valid duration options for sharing an item */
var ItemShareDuration;
(function (ItemShareDuration) {
    /** The share will expire in one hour */
    ItemShareDuration["OneHour"] = "OneHour";
    /** The share will expire in one day */
    ItemShareDuration["OneDay"] = "OneDay";
    /** The share will expire in seven days */
    ItemShareDuration["SevenDays"] = "SevenDays";
    /** The share will expire in fourteen days */
    ItemShareDuration["FourteenDays"] = "FourteenDays";
    /** The share will expire in thirty days */
    ItemShareDuration["ThirtyDays"] = "ThirtyDays";
})(ItemShareDuration || (exports.ItemShareDuration = ItemShareDuration = {}));
/** The allowed types of item sharing, enforced by account policy */
var AllowedType;
(function (AllowedType) {
    /** Allows creating share links with specific recipients */
    AllowedType["Authenticated"] = "Authenticated";
    /** Allows creating public share links */
    AllowedType["Public"] = "Public";
})(AllowedType || (exports.AllowedType = AllowedType = {}));
/** The allowed recipient types of item sharing, enforced by account policy */
var AllowedRecipientType;
(function (AllowedRecipientType) {
    /** Recipients can be specified by email address */
    AllowedRecipientType["Email"] = "Email";
    /** Recipients can be specified by domain */
    AllowedRecipientType["Domain"] = "Domain";
})(AllowedRecipientType || (exports.AllowedRecipientType = AllowedRecipientType = {}));
/** Represents the vault type. */
var VaultType;
(function (VaultType) {
    VaultType["Personal"] = "personal";
    VaultType["Everyone"] = "everyone";
    VaultType["Transfer"] = "transfer";
    VaultType["UserCreated"] = "userCreated";
    VaultType["Unsupported"] = "unsupported";
})(VaultType || (exports.VaultType = VaultType = {}));
var SeparatorType;
(function (SeparatorType) {
    /**
     * Randomly selected digits.
     * E.g, "`correct4horse0battery1staple`"
     */
    SeparatorType["Digits"] = "digits";
    /**
     * Randomly selected digits and symbols.
     * This is useful to get word-based passwords to meet complexity requirements
     * E.g, "`correct4horse-battery1staple`"
     */
    SeparatorType["DigitsAndSymbols"] = "digitsAndSymbols";
    /**
     * Spaces, like the original Diceware.
     * Great for mobile keyboards, not so great when people can overhear you type the password.
     * E.g, "`correct horse battery staple`"
     */
    SeparatorType["Spaces"] = "spaces";
    /**
     * Hyphens "`-`".
     * E.g, "`correct-horse-battery-staple`"
     */
    SeparatorType["Hyphens"] = "hyphens";
    /**
     * "`_`".
     * E.g, "`correct_horse_battery_staple`"
     */
    SeparatorType["Underscores"] = "underscores";
    /**
     * Period (full stop) "`.`".
     * E.g, "`correct.horse.battery.staple`"
     */
    SeparatorType["Periods"] = "periods";
    /**
     * Comma "`,`".
     * E.g, "`correct,horse,battery,staple`"
     */
    SeparatorType["Commas"] = "commas";
})(SeparatorType || (exports.SeparatorType = SeparatorType = {}));
var WordListType;
(function (WordListType) {
    /** Agile wordlist */
    WordListType["FullWords"] = "fullWords";
    /** English-like syllables */
    WordListType["Syllables"] = "syllables";
    /** Three (random) letter "words" */
    WordListType["ThreeLetters"] = "threeLetters";
})(WordListType || (exports.WordListType = WordListType = {}));
exports.ARCHIVE_ITEMS = 256;
exports.CREATE_ITEMS = 128;
exports.DELETE_ITEMS = 512;
exports.EXPORT_ITEMS = 4194304;
exports.IMPORT_ITEMS = 2097152;
exports.MANAGE_VAULT = 2;
exports.NO_ACCESS = 0;
exports.PRINT_ITEMS = 8388608;
exports.READ_ITEMS = 32;
exports.RECOVER_VAULT = 1;
exports.REVEAL_ITEM_PASSWORD = 16;
exports.SEND_ITEMS = 1048576;
exports.UPDATE_ITEMS = 64;
exports.UPDATE_ITEM_HISTORY = 1024;
/**
 * Custom JSON reviver and replacer functions for dynamic data transformation
 * ReviverFunc is used during JSON parsing to detect and transform specific data structures
 * ReplacerFunc is used during JSON serialization to modify certain values before stringifying.
 * These functions allow for flexible encoding and decoding of data, ensuring that complex types are properly handled when converting between TS objects and JSON
 */
const ReviverFunc = (key, value) => {
    if (typeof value === "string" &&
        /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/.test(value) &&
        (key === "createdAt" || key === "updatedAt")) {
        return new Date(value);
    }
    if (Array.isArray(value) &&
        value.every((v) => Number.isInteger(v) && v >= 0 && v <= 255) &&
        value.length > 0) {
        return new Uint8Array(value);
    }
    return value;
};
exports.ReviverFunc = ReviverFunc;
const ReplacerFunc = (key, value) => {
    if (value instanceof Date) {
        return value.toISOString();
    }
    if (value instanceof Uint8Array) {
        return Array.from(value);
    }
    return value;
};
exports.ReplacerFunc = ReplacerFunc;
