/** * @db4/core - Core types, interfaces, and utilities * * This package provides the foundational type definitions for the db4 ecosystem. * * @packageDocumentation */ export type { Brand, DocumentId, BatchId, CollectionName, ShardId, Timestamp, Version, Document, DocumentMeta, StoredDocument, BatchMetadata, DocumentBatch, PrimitiveType, CanonicalPrimitiveType, RuntimeType, SQLiteType, FieldModifier, FieldDefinition, FilterOperator, QueryFilter, SortDirection, SortSpec, QueryResult, QueryOptions, QueryPlan, ShardMetadata, ShardRoutingContext, ShardRoutingResult, IsolationLevel, TransactionOptions, ConflictInfo, CDCOperation, CDCLogEntry, CDCCursor, CDCBatch, CDCStreamOptions, CDCStreamResult, CDCCheckpoint, CDCFilter, CollectionStats, ShardStats, BatchSizeTier, DB4Config, StorageConfig, CDCConfig, QueryConfig, ShardingConfig, LoggingConfig, PerformanceConfig, IceTypeDOConfig, ConfigValidationResult, EventType, SyncEvent, ReadonlyDocument, ReadonlyDocumentMeta, ReadonlyStoredDocument, ReadonlyBatchMetadata, ReadonlyDocumentBatch, ReadonlyQueryFilter, ReadonlySortSpec, ReadonlyQueryOptions, ReadonlyQueryResult, ReadonlyFieldDefinition, PartialDocument, PartialDocumentMeta, DocumentInput, DocumentUpdate, DocumentInputBatch, ExtractDocument, AsStoredDocument, StripMeta, ProjectDocument, Result, } from './types.js'; export { createDocumentId, createBatchId, createCollectionName, createShardId, createTimestamp, createVersion, DEFAULT_CONFIG, PRIMITIVE_TYPES, FILTER_OPERATORS, FIELD_MODIFIERS, SORT_DIRECTIONS, normalizeType, toRuntimeType, toSQLiteType, isTypeAlias, getPrimaryType, areTypesEquivalent, ok, err, isOk, isErr, CDC_OPERATIONS, BATCH_SIZE_TIERS, createCDCCursor, encodeCDCCursor, decodeCDCCursor, createCDCBatch, mergeCDCBatches, filterCDCEntries, isCDCOperation, isCDCLogEntry, validateConfig, mergeConfig, createConfig, isValidBatchSizeTier, getConfigDefaults, normalizeConfig, } from './types.js'; export { ErrorCategory, DEFAULT_RETRY_GUIDANCE, ERROR_CODE_TO_CATEGORY, getErrorCategory, getRetryGuidance, ErrorCode, CursorErrorCode, NetworkErrorCode, AuthenticationErrorCode, DB4Error, DocumentNotFoundError, DocumentTooLargeError, MemoryLimitExceededError, ConflictError, TransactionTimeoutError, ValidationError, SchemaValidationError, InvalidQueryError, QueryTimeoutError, CursorError, ShardNotFoundError, ShardRoutingError, InvalidConfigError, NetworkError, AuthenticationError, BatchError, batchSuccess, batchFailure, aggregateBatchResults, isDB4Error, hasErrorCode, hasErrorCategory, isConflictError, isValidationError, isDocumentNotFoundError, isCursorError, isBatchError, isRetryableError, isTimeoutError, isCapacityError, isNetworkError, isAuthenticationError, wrapError, getErrorMessage, chainError, calculateRetryDelay, shouldRetry, withRetry, isIceTypeError, wrapIceTypeError, mapIceTypeCodeToErrorCode, getIceTypeRetryGuidance, ICETYPE_CODE_TO_DB4_CODE, ICETYPE_RETRY_GUIDANCE, } from './errors.js'; export type { RetryGuidance, BatchOperationResult, BatchSummary, IceTypeErrorLike, ParseErrorLike, SchemaValidationErrorLike, } from './errors.js'; export { generateId, generateUUID, generateDocumentId, generateBatchId, generateShardId, jsonSize, estimateSize, documentSize, isDocument, isDocumentMeta, isStoredDocument, isBatchMetadata, isDocumentBatch, isPrimitiveType, isFieldModifier, isFieldDefinition, isFilterOperator, isQueryFilter, isSortDirection, isSortSpec, isQueryOptions, validateNonEmptyString, validatePositiveNumber, validateNonNegativeInteger, validateTimestamp, validateDocument, validateDocumentMeta, validateStoredDocument, validateQueryOptions, deepClone, safeClone, deepMerge, getNestedValue, setNestedValue, pick, omit, now, delay, formatTimestamp, truncate, slugify, chunk, unique, groupBy, } from './utils.js'; export type { ValidationResult } from './utils.js'; export { CursorPagination, createCursorPagination, } from './cursor.js'; export type { CursorPosition, CursorValidation, PageInfo, Edge, PaginatedResult, CursorOptions, PaginateOptions, BuildQueryOptionsInput, } from './cursor.js'; export { createLogger, createSilentLogger, createConsoleLogger, DEFAULT_REDACTION_PATTERNS, } from './logging.js'; export type { LogLevel, SourceLocation, SerializedError, LogEntry, LogOutput, RedactionPattern, ValueRedactionPattern, RedactionConfig, OutputConfig, SamplingConfig, BatchConfig, LoggerConfig, LogTimer, Logger, } from './logging.js'; export { createTelemetryManager, createNoopTelemetryManager, createInMemoryCollector, InMemoryTelemetryCollector, DEFAULT_TELEMETRY_CONFIG, TELEMETRY_EVENT_TYPES, TELEMETRY_EVENT_CATEGORIES, isTelemetryEventCategory, isTelemetryEventType, isTelemetryEvent, isTelemetrySpan, isQueryTelemetryEvent, isWriteTelemetryEvent, isErrorTelemetryEvent, isPerformanceTelemetryEvent, } from './telemetry.js'; export type { TelemetryEventCategory, TelemetryEventType, SpanStatus, SpanKind, TelemetryAttributes, TelemetryEvent, QueryTelemetryEvent, WriteTelemetryEvent, ErrorTelemetryEvent, PerformanceTelemetryEvent, TelemetrySpan, ActiveSpan, TelemetrySamplingConfig, TelemetryCollector, TelemetryConfig, TelemetryManager, StartSpanOptions, } from './telemetry.js'; export { isOTelAvailable, getTracer, getMeter, SpanStatusCode, SpanKind as OTelSpanKind, getQueryCounter, getErrorCounter, getWriteCounter, getCDCEventsCounter, getActiveTransactionsGauge, getQueryDurationHistogram, getTransactionDurationHistogram, getStorageOperationDurationHistogram, getDocumentSizeHistogram, getBatchSizeHistogram, startQuerySpan, startStorageSpan, startTransactionSpan, startCDCSpan, instrument, instrumentAsync, instrumentQuery, instrumentWrite, instrumentTransaction, instrumentStorage, instrumentCDC, recordCDCEvent, resetOTel, } from './telemetry/otel.js'; export type { OTelSpan, OTelTracer, OTelMeter, OTelCounter, OTelUpDownCounter, OTelHistogram, OTelSpanOptions, OTelMetricOptions, QueryInstrumentationOptions, WriteInstrumentationOptions, TransactionInstrumentationOptions, StorageInstrumentationOptions, CDCInstrumentationOptions, } from './telemetry/otel.js'; export { PRIMITIVE_TYPE_VALUES, isPrimitiveType as isIceTypePrimitiveType, normalizePrimitiveType, FIELD_MODIFIER_KINDS, isFieldModifier as isIceTypeFieldModifier, isModifierKind, optional, required, unique as uniqueModifier, indexed, primary, references, defaultValue, immutable, computed, COMPLEX_TYPE_KINDS, isComplexType, isComplexTypeKind, array, map, struct, enumType, union, tuple, isFieldType, isTypeReference, ref, isFieldDefinition as isIceTypeFieldDefinition, field, schema, getFieldsWithModifier, getPrimaryKeyField, isOptionalField, isRequiredField, isIndexedField, getDefaultValue, getReferenceTarget, } from './types/field-types.js'; export type { PrimitiveType as IceTypePrimitiveType, PrimitiveToJS, FieldModifier as IceTypeFieldModifier, FieldModifierKind, OptionalModifier, RequiredModifier, UniqueModifier, IndexedModifier, PrimaryModifier, ReferencesModifier, DefaultModifier, ImmutableModifier, ComputedModifier, ArrayType, MapType, StructType, EnumType, UnionType, TupleType, ComplexType, ComplexTypeKind, FieldType, TypeReference, FieldDefinition as IceTypeFieldDefinition, FieldConstraints, InferFieldType, InferFieldDefinition, HasModifier, ExtractModifier, InferSchema, RequiredFields, OptionalFields, SchemaDefinition, IndexDefinition as IceTypeIndexDefinition, } from './types/field-types.js'; export type { StorageEngineConfig, WriteOptions, ReadOptions, DeleteOptions, BatchWriteOperation, BatchWriteResult, StorageEngine, QueryEngineConfig, CompiledQuery, QueryContext, QueryEngine, AggregationSpec, AggregationResult, TransactionState, TransactionMeta, Transaction, TransactionManager, TransactionStats, CDCEngineConfig, CDCSubscription, CDCEngine, CDCStats, IndexType, IndexDef, IndexStats, IndexManager, EngineContext, EngineContextConfig, EngineContextFactory, } from './engines.js'; export { TYPE_MARKERS, serialize, deserialize, serializeDocument, deserializeDocument, serializeStoredDocument, deserializeStoredDocument, encodeBinary, decodeBinary, arrayBufferToBase64, base64ToArrayBuffer, serializeWithSchema, deserializeWithSchema, } from './serialization.js'; export type { SerializationOptions, DeserializationOptions, SerializationFieldType, SerializationSchema, } from './serialization.js'; export { MAX_DOCUMENT_SIZE, MAX_BATCH_SIZE, MAX_RESULT_SIZE, MAX_QUERY_MEMORY, MAX_CDC_LOG_SIZE, MAX_INDEX_SIZE, DO_TRANSIENT_LIMIT, BATCH_SIZE_TIER, DEFAULT_BATCH_SIZE, MAX_NESTED_DEPTH, MAX_FIELD_NAME_LENGTH, MAX_STRING_VALUE_LENGTH, MAX_ARRAY_LENGTH, MAX_DOCUMENT_FIELDS, DEFAULT_QUERY_LIMIT, MAX_QUERY_LIMIT, DEFAULT_QUERY_TIMEOUT, MAX_QUERY_TIMEOUT, STREAMING_THRESHOLD, MAX_QUERY_FILTERS, MAX_SORT_FIELDS, MAX_PROJECTION_FIELDS, DEFAULT_TRANSACTION_TIMEOUT, MAX_TRANSACTION_TIMEOUT, MAX_CONCURRENT_TRANSACTIONS, MAX_TRANSACTION_READ_SET, MAX_TRANSACTION_WRITE_SET, DEFAULT_CDC_BATCH_SIZE, MAX_CDC_BATCH_SIZE, DEFAULT_CDC_FLUSH_INTERVAL, DEFAULT_CDC_RETENTION_PERIOD, MAX_CDC_LOG_ENTRIES, MAX_INDEXES_PER_COLLECTION, MAX_COMPOUND_INDEX_FIELDS, MAX_INDEX_NAME_LENGTH, MAX_SHARDS, DEFAULT_SHARD_COUNT, MAX_SHARD_KEY_LENGTH, DEFAULT_RETRY_COUNT, DEFAULT_RETRY_DELAY, MAX_RETRY_DELAY, RETRY_BACKOFF_MULTIPLIER, RETRY_JITTER_FACTOR, DEFAULT_CURSOR_TTL, MAX_CURSOR_TTL, CURSOR_VERSION, DEFAULT_TELEMETRY_BUFFER_SIZE, DEFAULT_TELEMETRY_FLUSH_INTERVAL, DEFAULT_QUERY_SAMPLING_RATE, DEFAULT_PERFORMANCE_SAMPLING_RATE, MAX_LOG_ENTRY_SIZE, DEFAULT_LOG_BATCH_SIZE, DEFAULT_LOG_BATCH_INTERVAL, RESERVED_COLLECTION_NAMES, INTERNAL_COLLECTION_PREFIX, MAX_COLLECTION_NAME_LENGTH, RESERVED_FIELD_NAMES, INTERNAL_FIELD_PREFIX, DEFAULT_FEATURE_FLAGS, DEFAULT_HTTP_TIMEOUT, MAX_HTTP_BODY_SIZE, MAX_CONCURRENT_REQUESTS, VERSION, MIN_COMPATIBLE_VERSION, SCHEMA_VERSION, isReservedCollectionName, isReservedFieldName, isInternalCollection, isInternalField, validateDocumentSize, validateCollectionName, validateFieldName, } from './constants.js'; export type { FeatureFlags } from './constants.js'; export { MAX_IDENTIFIER_LENGTH, MAX_ID_LENGTH, MAX_FIELD_PATH_LENGTH, SQL_RESERVED_KEYWORDS, SQL_INJECTION_PATTERNS, SqlInjectionError, isValidIdentifier, isValidId, isValidFieldPath, isValidSqlIdentifier, containsSqlInjection, detectSqlInjection, validateSqlIdentifier, validateSchemaName, validateMetaKey, validateIndexName, validateCollectionName as validateSqlCollectionName, validateColumnName, validateFieldName as validateSqlFieldName, validateDocumentId, validateBatchId, escapeIdentifier, escapeLikePattern, escapeSqlLikePattern, sql, sqlIn, validatedIdentifier, validatedId, validatedFieldPath, } from './sql-safety.js'; export type { SqlQueryResult, ValidatedIdentifier, ValidatedId, ValidatedFieldPath, } from './sql-safety.js'; export { calculateBloomParams, createBloomFilter, bloomAdd, bloomMightContain, bloomMerge, estimateFalsePositiveRate, BloomFilterManager, createBloomFilterManager, BLOOM_FILTERS_TABLE_SQL, BLOOM_FILTERS_INDEXES_SQL, DEFAULT_BLOOM_FILTERS_CONFIG, } from './bloom.js'; export type { BloomFilterConfig, BloomFilterMeta, BloomFilter, BloomFilterPruning, BloomFilterRow, BloomFilterSQLiteDatabase, BloomFilterSQLiteStatement, } from './bloom.js'; export { isDocument as isDocumentCached, isDocumentMeta as isDocumentMetaCached, isStoredDocument as isStoredDocumentCached, isIceTypeDocument, isIceTypeStoredDocument, isCDCEntry, isCDCOperation as isCDCOperationCached, isBatchMetadata as isBatchMetadataCached, isDocumentBatch as isDocumentBatchCached, isFilterOperator as isFilterOperatorCached, isQueryFilter as isQueryFilterCached, isSortDirection as isSortDirectionCached, isSortSpec as isSortSpecCached, isQueryOptions as isQueryOptionsCached, isFieldModifier as isFieldModifierCached, isPrimitiveType as isPrimitiveTypeCached, isFieldDefinition as isFieldDefinitionCached, isError, createErrorTypeGuard, isObject, isArray, isString, isNumber, isBoolean, isNull, isUndefined, isNullish, isDefined, isFunction, clearTypeGuardCache, _cacheKeys, } from './type-guards.js'; export type { IceTypeDocument, IceTypeStoredDocument, CDCLogEntry as IceTypeCDCLogEntry, CDCOperation as IceTypeCDCOperation, } from './type-guards.js'; export { isCompactDocument, isExpandedDocument, isCompactStoredDocument, isExpandedStoredDocument, compactToExpanded, expandedToCompact, extractData, isSystemField, ensureId, createStoredDocument, updateStoredDocument, COMPACT_SYSTEM_FIELDS, } from './document.js'; export type { CompactDocument, CompactStoredDocument, ExpandedDocument, ExpandedStoredDocument, } from './document.js'; export { isNoModifier, isModifierSymbol, isDB4FieldModifier, isIceTypeFieldModifier as isIceTypeStringModifier, isUnifiedFieldModifier, normalizeFieldModifier, toDb4FieldModifier, toIceTypeFieldModifier, parseFieldModifier, appendModifier, modifiersEqual, describeModifier, FIELD_MODIFIER_SYMBOLS, } from './field-modifier.js'; export type { DB4FieldModifier, IceTypeFieldModifier as IceTypeStringModifier, UnifiedFieldModifier, NoModifier, FieldModifierSymbol, ParsedFieldModifier, } from './field-modifier.js'; export { createPluginManager, PluginError, PluginLoadError, PluginDependencyError, PluginLifecycleError, isPluginError, isPluginLoadError, isPluginDependencyError, isPluginLifecycleError, isValidHookName, hasHook, VALID_HOOK_NAMES, } from './plugin.js'; export type { Plugin, PluginHooks, PluginDependency, PluginContext, TypedPlugin, TypedPluginHooks, HookName, PluginMiddleware, MiddlewareContext, MiddlewareHooks, StorageAdapterPlugin, StorageAdapterHooks, PluginManager, PluginManagerConfig, RegisterOptions, } from './plugin.js'; export type { SqlValue, ComparisonOp, PatternOp, SetOp, NullOp, PredicateOp, Predicate, Constraint, FilterOpType, } from './predicate.js'; export { COMPARISON_OPS, PATTERN_OPS, SET_OPS, NULL_OPS, PREDICATE_OPS, isComparisonOp, isPatternOp, isSetOp, isNullOp, isPredicateOp, isSqlValue, isPredicate, isConstraint, predicateOpToSQL, eq, ne, lt, le, gt, ge, like, inSet, nullPredicate, notNullPredicate, or, } from './predicate.js'; /** * Cache invalidation types and utilities. */ export type { InvalidationReason, InvalidationCallback, CacheInvalidator, CacheInvalidatorOptions, } from './cache-invalidation.js'; export { createCacheInvalidator, invalidationAffectsTable, schemaChangeReason, tableDropReason, manualInvalidationReason, isSchemaChangeReason, isTableDropReason, isManualInvalidationReason, } from './cache-invalidation.js'; //# sourceMappingURL=index.d.ts.map