Skip to main content

Nexus Core

This package contains a collection of modules that provide a common functionality without substantial external dependencies. Generally, the modules in this package are not intended to be used directly, but rather are used internally within other Nexus packages.

Core modules do not require a specific JavaScript runtime, and can be used in Node.js, browser, or Web Worker environments. For modules that require Node.js-specific functionality, see @isp.nexus/sdk.

Environment

Interface, Type alias, Variable, FunctionDescription
OptionalEnvironmentA record containing all of the optional environment variables for Open ISP.
EnvironmentKeysAll recognized environment keys.
EnvironmentNameA tuple of all of the recognized environment names.
EnvironmentRecordInputA generic environment record without any specific keys.
OptionalEnvironmentKeyOptional environment keys.
PrivateEnvironmentKeysEnvironment keys private to the application.
PublicEnvironmentKeysEnvironment keys safe to reveal to the public.
isEnvironmentRecordInputType-predicate for determining if a given object seems to be an environment record.

Identifier

Type alias, FunctionDescription
UUIDLiteralA UUID string, used for identifying entities.
createOrParseUUIDv7Attempts to parse a UUID from a string or returns a new UUID.
formatUUIDFormat a UUID as a string.
uuidV5Generate a UUID v5.
uuidV7Generate a UUID v7.

Nexus

VariableDescription
ISPNexusSchemaURLURL to the ISP Nexus schema store.

Object

Type alias, FunctionDescription
NonNullableObjectType-helper to remove nullability from an object's properties.
isIterableType-predicate for checking if a value is iterable.
isRecordLikeType-predicate for checking if a value appears to be a record, i.e. an object that is not an array.
omitNullableGiven an object, returns a new object with all nullable properties removed.

Other

Enumeration, Class, Interface, Type alias, Variable, FunctionDescription
ModelIDLength-
TemporalColumnName-
UserAgentCommon user agent strings.
APIClientA base class for API clients used in ISP Nexus.
JSONSetJSON-seralizable set.
PredicateErrorError thrown when a predicate fails.
SetTupleSet constructor that only accepts string values.
APIClientConfigConfiguration for an API client.
ExperimentalSetMethods-
IndexedIterableIterable that can be checked for the existence of a member.
IRuntimeLoggerLogger with browser methods, as well as async disposability.
RequiredEnvironmentA record containing all of the required environment variables for . Absence of any of these variables will result in a startup error.
ResponseContainerA response container, wrapping the actual response body.
TemporalPropertiesCommon temporal properties for database entities.
EnvironmentRecordA record containing all of the environment variables for ISP Nexus.
ExtractJSONJSON serialize type.
ExtractJSONPropertiesJSON serialize objects (not including arrays) and classes.
ExtractResponseBodyDataType-helper to recursively pluck the data property from a response body.
ExtractResponseDataType-helper to pluck the response body, possibly from within an Axios response.
InferTupleMemberType-helper for extracting the value type from a constant set.
ISPNexusPackageValid package names for ISP Nexus.
ISPNexusPackageFnType-signature for a package-scoped function.
ISPNexusSchemaURL-
NumericPropertiesExtracts the property keys of an object that are of type number.
PickJSONPick JSON properties from an object.
PrivateEnvironmentSubset environment kept private.
PrivateEnvironmentKeyPrivate environment keys.
PublicEnvironmentSubset environment safe to reveal to the public.
PublicEnvironmentKeyPublic environment keys.
RequiredEnvironmentKeyRequired environment keys.
ResponseLike-
SHA3Input-
SHA3Seed-
StringKeyOfType-utility for extracting the string keys of an object.
WithExperimentalSetMethods-
EnvironmentKeysISP Nexus recognized environment keys.
EnvironmentNamesStandard Node.js runtime environment values.
ISPNexusPackagesPackages used in the ISP Nexus mono-repo.
NIL_UUIDA placeholder UUID for empty values.
OptionalEnvironmentKeyA tuple of all of the optional environment keys.
RequiredEnvironmentKeysA tuple of all of the required environment keys.
TemporalColumnNamesAll temporal column names. Used for SQL select queries.
TemporalColumnOptionsTypeORM column options for temporal properties.
assertEnvironmentRecordPresentAsserts that the given input contains all of the required environment keys.
assertOptionalKeyPresentRuntime assertion that an optional key is present.
checkConnectivity-
continueIfResolves promise if condition is truthy, otherwise throws an error.
delegateAxiosErrorDelegate Axios errors to an appropriate error handler.
isIndexedIterableType-predicate for checking if an member within an iterable can be checked for existence.
isSetLikeType-predicate for checking if a value is a Set-like object.
isUniformlyCasedPredicate to determine if a given string is uniformly cased, i.e. all uppercase or all lowercase.
isUUIDBytes-
iterateInParallelConvenience function to await an async iterable.
JSONSchemaID-
normalizeSHASeeds-
pick-
pickJSON-
pluckResponseDataHelper function to recursively pluck the data property from a response body.
simpleSHA3-
smartCamelCaseConverts a name to camelCase, unless the name is already in all caps.
smartCapitalCaseCapitalizes a string, unless the string is uniformly cased, or an email address.
smartSnakeCaseConverts a name to snake_case, unless the name is already in all caps.
sumOfGiven an iterable of objects, returns the sum of the specified property.
supressErrorsSomething like an identity function, but swallows errors and returns null.
takeGiven an iterable, returns an array of arrays of the specified size.
takeInParallelGiven an iterable collection, returns an async iterable, executing the callback on each batch.
throwIfResolves promise if condition is falsy, otherwise throws an error.
tryParsingJSONGiven serialized JSON, attempt to parse it.
tupleCreates a readonly tuple-like set of values.
waitForTimeoutPromise-based sleep function.

Polyfill

InterfaceDescription
SetLikeA type representing a Set compatible object.

Temporal

Type alias, FunctionDescription
ISODateTimeStringA string type to indicate ISO 8601 formatted content.
unserializeDateUnserialize a date string into a Date object.

Type Guard

FunctionDescription
isIterableType-predicate for checking if a value is iterable.
isRecordLikeType-predicate for checking if a value appears to be a record, i.e. an object that is not an array.

UUID

FunctionDescription
isUUIDType-predicate to check if a string is a valid UUID.