/*- * Copyright (c) 2018, 2026 Oracle and/or its affiliates. All rights reserved. * * Licensed under the Universal Permissive License v 1.0 as shown at * https://oss.oracle.com/licenses/upl/ */ /** * Defines enumeration types and constants used by the driver. */ import type { Config } from "./config"; import type { AuthConfig } from "./auth/config"; import type { IAMAuthorizationProvider } from "./auth/iam/auth_provider"; import type { KVStoreAuthorizationProvider } from "./auth/kvstore/auth_provider"; /** * Service type is specified in the initial configuration used to create * {@link NoSQLClient} instance and indicates what kind of service the * driver will be using. Currently supported values are * {@link ServiceType.CLOUDSIM}, {@link ServiceType.CLOUD} and * {@link ServiceType.KVSTORE}. In addition to {@link ServiceType} * enumeration, these values may be specified as strings "CLOUDSIM", "CLOUD" * or "KVSTORE", case-insensitive. This is useful if using JSON configuration * file. If {@link ServiceType} is not present in the initial configuration, * the driver will try to deduce service type from the * information provided in authorization property {@link Config#auth} (see * {@link AuthConfig}) in the following way: *
* {@link Consistency.ABSOLUTE} consistency may be specified to guarantee that * current values are read. {@link Consistency.EVENTUAL} consistency means * that the values read may be very slightly out of date. * {@link Consistency.ABSOLUTE} consistency results in higher cost, consuming * twice the number of read units for the same data relative to * {@link Consistency.EVENTUAL} consistency, and should only be used when * required. *
** It is possible to set a default Consistency for a {@link NoSQLClient} * instance by providing it in the initial configuration as * {@link Config#consistency}. In JSON configuration file, you may use string * values such as "EVENTUAL" or "ABSOLUTE". If no consistency is specified * for an operation and there is no default value, * {@link Consistency.EVENTUAL} is used. *
** Consistency can be specified in the options(opt) argument for all * read operations. *
*/ export enum Consistency { /** * Absolute consistency * @type {Consistency} */ ABSOLUTE = "ABSOLUTE", /** * Eventual consistency * @type {Consistency} */ EVENTUAL = "EVENTUAL" } /** * Cloud service only. ** CapacityMode specifies the type of capacity that will be set on a table. It * is used in table creation and table capacity updates. See * {@link TableLimits}. *
* Table capacity is only used in the NoSQL Cloud Service. *
** {@link CapacityMode.PROVISIONED} is the default mode. In this mode, the * application defines the specified maximum read and write throughput for * a table. * {@link CapacityMode.ON_DEMAND} mode allows for flexible throughput usage. * In this mode, only the maximum storage size is specified. *
* @since 5.3.0 */ export enum CapacityMode { /** * Provisioned mode. This is the default. * @type {CapacityMode} * @since 5.3.0 */ PROVISIONED = "PROVISIONED", /** * On Demand mode. * @type {CapacityMode} * @since 5.3.0 */ ON_DEMAND = "ON_DEMAND" } /** * Describes the current state of the table. See {@link NoSQLClient#tableDDL}. */ export enum TableState { /** * The table is ready to be used. This is the steady state after creation * or modification. */ ACTIVE = "ACTIVE", /** * The table is being created and cannot yet be used. */ CREATING = "CREATING", /** * The table has been dropped or does not exist. */ DROPPED = "DROPPED", /** * The table is being dropped and cannot be used. */ DROPPING = "DROPPING", /** * The table is being updated. It is available for normal use, but * additional table modification operations are not permitted while the * table is in this state. */ UPDATING = "UPDATING" } /** * On premise only. ** Describes the current state of the operation performed by * {@link NoSQLClient#adminDDL}. */ export enum AdminState { /** * Operation is complete and successful. */ COMPLETE = "COMPLETE", /** * Operation is in progress. */ IN_PROGRESS = "IN_PROGRESS" }