user-environment.js

"use strict";
/***************************************************
* Licensed Materials - Property of HCL.
* (c)Copyright HCL America, Inc. 2023-2024
****************************************************/
Object.defineProperty(exports, "__esModule", { value: true });
exports.v4UserAccess = exports.v3UserName = exports.version = exports.userRoles = exports.userPrivileges = exports.userNameLanguage = exports.userName = exports.userNamesList = exports.userAccess = exports.statusBar = exports.platform = exports.password = exports.optimizeMailAddress = exports.name = exports.mailDbName = exports.domain = exports._notes_vmx = exports._notes = void 0;
const tslib_1 = require("tslib");
/**
 * @file User Environment
 * @module user-environment
 * @category User Environment
 */
const notesf_base = tslib_1.__importStar(require("../notes/user-environment"));
const notesf_vmx = tslib_1.__importStar(require("../notes/voltmx/user-environment"));
const API = tslib_1.__importStar(require("../rosetta/API"));
const notesf = () => API.isCurrentFrameworkVoltMX() ? notesf_vmx : notesf_base;
exports._notes = notesf_base;
exports._notes_vmx = notesf_vmx;
//-----------------------------
// Open Formula user-environment
//-----------------------------
// Notes @functions user-environment
/**
 * Returns the name of the current user's Domino® mail domain listed in the current
 * location document of the Personal Address Book.
 * @throws {Error} method not implemented
 * @TODO this needs to be implemented
 */
function domain() {
    return notesf().Domain();
}
exports.domain = domain;
/**
 * Returns the name of the Domino® server and the name of the current user's mail
 * database.
 * @throws {Error} no plans to implement
 */
function mailDbName() {
    return notesf().MailDbName();
}
exports.mailDbName = mailDbName;
/**
 * Allows you to manipulate hierarchical names. You can abbreviate the canonical
 * format of a name, expand an abbreviated name to its canonical format, identify
 * particular components within the name, and reverse the order of the components
 * so that you can categorize a view by hierarchical names.
 *
 * Enables you to convert a name between the Domino® and LDAP formats.
 * @action {string} action to perform on name
 * @name_arg {TextOrTextList} name to convert
 * @returns {TextOrTextList}
 */
function name(action, name_arg) {
    return notesf().Name(action, name_arg);
}
exports.name = name;
/**
 * Returns a mail address with all unnecessary domains removed.
 * @throws {Error} no plans to implement
 */
function optimizeMailAddress() {
    return notesf().OptimizeMailAddress();
}
exports.optimizeMailAddress = optimizeMailAddress;
/**
 * Encodes a string.
 * @throws {Error} method not implemented
 * @TODO this needs to be implemented
 */
function password() {
    return notesf().Password();
}
exports.password = password;
/**
 * Returns the name of the currently running platform version of Notes, Domino,
 * or Nomad.
 * @throws {Error} method not implemented
 * @TODO this needs to be implemented
 */
function platform() {
    return notesf().Platform();
}
exports.platform = platform;
/**
 * Writes a message or messages to the status bar.
 * @throws {Error} method not implemented
 * @TODO this needs to be implemented
 */
function statusBar() {
    return notesf().StatusBar();
}
exports.statusBar = statusBar;
/**
 * Given a server and file name, indicates the current user's level of access to
 * the database.
 * @throws {Error} method not implemented
 * @TODO this needs to be implemented
 */
function userAccess() {
    return notesf().UserAccess();
}
exports.userAccess = userAccess;
/**
 * For a database on a server or a local database with "Enforce a consistent Access
 * Control List across all replicas" in effect, @UserNamesList returns a text
 * list containing the following information for the current user:
 * - Common name
 * - All hierarchical names (fully distinguished) that include the user name; for
 *   example, CN=My Name/OU=My Org Unit/O=My Org, plus  	*/OU=My Org
 *   Unit/O=My Org, */O=My Org, and *
 * - Any roles associated with the user in the ACL
 * - All groups to which the user belongs (only if the database is on a server)
 * @throws {Error} method not implemented
 * @TODO this needs to be implemented
 */
function userNamesList() {
    return notesf().UserNamesList();
}
exports.userNamesList = userNamesList;
/**
 * Returns the current user name.
 *
 * If the user name is hierarchical, @UserName returns it in canonical format
 * (including the CN, OU, O, and C identifiers). To return the name in abbreviated
 * format (omitting those identifiers), use @V3UserName.
 * @param {string} [index] Number. Optional. Indicating the index of user names.
 * 0 is for primary name and 1 is for the alternate name. If this parameter is omitted, @UserName returns the primary name.
 * @returns Promise that resolves to the current user name.
 */
function userName(index) {
    return notesf().UserName(index);
}
exports.userName = userName;
/**
 * Returns language tags associated with the user ID.
 * @throws {Error} no plans to implement
 */
function userNameLanguage() {
    return notesf().UserNameLanguage();
}
exports.userNameLanguage = userNameLanguage;
/**
 * Returns a text list of the current user's privileges. This function returns only
 * the position of the privilege in the privilege list, not the name of the
 * privilege.
 * @throws {Error} method not implemented
 * @TODO this needs to be implemented
 */
function userPrivileges() {
    return notesf().UserPrivileges();
}
exports.userPrivileges = userPrivileges;
/**
 * For a database on a server or a local replicated database, returns a list of
 * roles that the current user has. Roles are defined in a database's access control
 * list.
 * @throws {Error} method not implemented
 * @TODO this needs to be implemented
 */
function userRoles() {
    return notesf().UserRoles();
}
exports.userRoles = userRoles;
/**
 * Returns the release number of the Notes/Domino software you're running.
 * @throws {Error} no plans to implement
*/
function version() {
    return notesf().Version();
}
exports.version = version;
/**
 * Returns the current user name or server name. Using @V3UserName on a local
 * database or in a private view in a server-based database returns the user's name.
 *
 * If the user name is hierarchical, @V3UserName returns the name in
 * abbreviated format (omitting the CN, OU, O, and C identifiers). To return the
 * name in canonical format, use @UserName.
 * @returns Promise that resolves to the current user name or server name.
 */
function v3UserName() {
    return notesf().V3UserName();
}
exports.v3UserName = v3UserName;
/**
 * Given a server and file name, indicates the current user's level of access to
 * the database.
 * @throws {Error} no plans to implement
 */
function v4UserAccess() {
    return notesf().V4UserAccess();
}
exports.v4UserAccess = v4UserAccess;
//# sourceMappingURL=user-environment.js.map