ts-prorm-orm 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.1]
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `EagerLoadError` and `UnsupportedSchemaObjectError` were not exported from the
|
|
13
|
+
package root, so callers could not catch by name the errors that `include` and
|
|
14
|
+
the schema-object methods actually throw. Both are now exported, along with the
|
|
15
|
+
schema-object SQL builders and their option types (the two whose names already
|
|
16
|
+
existed in `./types` are aliased as `CreateSequenceOptions` and
|
|
17
|
+
`CreatePolicyOptions` rather than shadowing them). A test now pins the public
|
|
18
|
+
error surface.
|
|
19
|
+
|
|
8
20
|
## [1.2.0]
|
|
9
21
|
|
|
10
22
|
### Fixed — relations
|
package/dist/index.d.ts
CHANGED
|
@@ -189,7 +189,7 @@ export * from './migrations';
|
|
|
189
189
|
export * from './schema';
|
|
190
190
|
export { Logger, LogLevel, LogLevelStrings, createLogger, createSilentLogger, getDefaultLogger, setDefaultLogger, } from './logging';
|
|
191
191
|
export type { LoggerOptions, LogEntry, LoggerEvents } from './logging';
|
|
192
|
-
export { PrormError, ConnectionError, DatabaseError, ValidationError, UniqueConstraintError, ForeignKeyConstraintError, ExclusionConstraintError, TimeoutError, ResourceLockedError, BulkRecordError, AssociationError, EmptyResultError, ErrorCodes, isPrormError, isValidationError, isConnectionError, isConstraintError, isEmptyResultError, } from './errors';
|
|
192
|
+
export { PrormError, ConnectionError, DatabaseError, ValidationError, UniqueConstraintError, ForeignKeyConstraintError, ExclusionConstraintError, TimeoutError, ResourceLockedError, BulkRecordError, AssociationError, EagerLoadError, EmptyResultError, ErrorCodes, isPrormError, isValidationError, isConnectionError, isConstraintError, isEmptyResultError, } from './errors';
|
|
193
193
|
export * from './errors/utils';
|
|
194
194
|
export * from './utils/index';
|
|
195
195
|
import * as Utils from './utils/index';
|
|
@@ -201,6 +201,8 @@ export * from './query-optimizers';
|
|
|
201
201
|
export { ForeignDataManager, KNOWN_FDWS, buildOptionsClause } from './foreign-data';
|
|
202
202
|
export type { ForeignServerOptions, AlterForeignServerOptions, UserMappingOptions, ForeignTableOptions, ForeignTableColumnDef, ImportForeignSchemaOptions, ServerInfo, } from './foreign-data';
|
|
203
203
|
export * from './external-fields';
|
|
204
|
+
export { UnsupportedSchemaObjectError, buildCreateSequenceSQL, buildDropSequenceSQL, buildCreateTriggerStatements, buildDropTriggerSQL, buildEnableRowLevelSecuritySQL, buildCreatePolicySQL, buildDropPolicySQL, buildCreateFullTextIndexSQL, } from './schema-objects';
|
|
205
|
+
export type { FullTextIndexOptions, TriggerDefinition, SequenceOptions as CreateSequenceOptions, PolicyOptions as CreatePolicyOptions, } from './schema-objects';
|
|
204
206
|
export * from './decorators';
|
|
205
207
|
export { Database } from './decorators/collate';
|
|
206
208
|
export { Database as DatabaseSecurityDecorator } from './compliance/security-decorator';
|
package/dist/index.js
CHANGED
|
@@ -43,9 +43,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
43
43
|
exports.VARBINARY = exports.BINARY = exports.BLOB = exports.JSONB = exports.JSON = exports.UUIDV4 = exports.UUID = exports.TIME = exports.NOW = exports.DATEONLY = exports.DATE = exports.BOOLEAN = exports.DECIMAL = exports.DOUBLE = exports.FLOAT = exports.BIGINT = exports.INTEGER = exports.TEXT = exports.CHAR = exports.VARCHAR = exports.STRING = exports.BelongsToMany = exports.BelongsTo = exports.HasMany = exports.HasOne = exports.clearMetadata = exports.getModelAttributes = exports.getAttributeMetadata = exports.getModelMetadata = exports.Comment = exports.Unique = exports.Default = exports.NotNull = exports.AutoIncrement = exports.PrimaryKey = exports.AllowNull = exports.Column = exports.Attribute = exports.Table = exports.Model = exports.AbstractDataType = exports.DataTypes = exports.createConnectionManager = exports.ConnectionManager = exports.StreamIterator = exports.BatchTransform = exports.FilterTransform = exports.MapTransform = exports.QueryTypes = exports.Prorm = void 0;
|
|
44
44
|
exports.BaseDialect = exports.ReplicaManager = exports.Transaction = exports.isOrderExpression = exports.random = exports.desc = exports.asc = exports.overlap = exports.contains = exports.isNotNull = exports.isNull = exports.notBetween = exports.between = exports.notIn = exports.inOp = exports.in = exports.notIRegexp = exports.iRegexp = exports.notRegexp = exports.regexp = exports.match = exports.notSubstring = exports.substring = exports.notEndsWith = exports.endsWith = exports.notStartsWith = exports.startsWith = exports.notILike = exports.iLike = exports.notLike = exports.like = exports.lte = exports.lt = exports.gte = exports.gt = exports.ne = exports.eq = exports.not = exports.or = exports.and = exports.where = exports.operatorToWhereKey = exports.getOperatorString = exports.OpAliases = exports.Operators = exports.Op = exports.GEOGRAPHY = exports.GEOMETRY = exports.ARRAY = exports.ENUM = void 0;
|
|
45
45
|
exports.lowerCase = exports.upperCase = exports.spliceStr = exports.formatDefaultValue = exports.toDefaultValue = exports.removeTicks = exports.addTicks = exports.escapeLike = exports.pad = exports.truncate = exports.coalesce = exports.isEmpty = exports.formatWhere = exports.escapeId = exports.escapeString = exports.formatValue = exports.formatValues = exports.isValidUUID = exports.generateShortUUID = exports.generateUUID = exports.omit = exports.pick = exports.merge = exports.cloneDeep = exports.singularize = exports.pluralize = exports.snakeCase = exports.camelize = exports.kebabToCamel = exports.camelToKebab = exports.snakeToCamel = exports.camelToSnake = exports.ModelManager = exports.ScopeManager = exports.createPool = exports.PooledConnection = exports.DatabaseConnectionPool = exports.ConnectionPool = exports.createMSSQLDialect = exports.MSSQLDialect = exports.createOracleDialect = exports.OracleDialect = exports.SQLiteDialect = exports.registerGraphDialects = exports.GRAPH_DIALECTS = exports.DgraphGraphDialect = exports.GremlinGraphDialect = exports.Neo4jGraphDialect = exports.BaseGraphDialect = exports.DialectRegistry = void 0;
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
46
|
+
exports.ModelDiagram = exports.removeGeneratedModel = exports.listModels = exports.setOutputDir = exports.getOutputDir = exports.configureCLI = exports.generateModels = exports.model = exports.CLI = exports.utils = exports.isEmptyResultError = exports.isConstraintError = exports.isConnectionError = exports.isValidationError = exports.isPrormError = exports.ErrorCodes = exports.EmptyResultError = exports.EagerLoadError = exports.AssociationError = exports.BulkRecordError = exports.ResourceLockedError = exports.TimeoutError = exports.ExclusionConstraintError = exports.ForeignKeyConstraintError = exports.UniqueConstraintError = exports.ValidationError = exports.DatabaseError = exports.ConnectionError = exports.PrormError = exports.setDefaultLogger = exports.getDefaultLogger = exports.createSilentLogger = exports.createLogger = exports.LogLevelStrings = exports.LogLevel = exports.Logger = exports.createQueryInterface = exports.CreateQueryInterface = exports.stringUtils = exports.regex = exports.truncateStr = exports.padEnd = exports.padStart = exports.trimEnd = exports.trimStart = exports.rtrim = exports.ltrim = exports.trim = exports.capitalizeWords = exports.capitalize = void 0;
|
|
47
|
+
exports.jsonExtract = exports.fullTextRank = exports.fullTextMatch = exports.currentTimestamp = exports.currentDate = exports.dateDiff = exports.dateSub = exports.dateAdd = exports.dateTrunc = exports.caseOf = exports.caseWhen = exports.SimpleCaseBuilder = exports.CaseBuilder = exports.arrayAgg = exports.stringAgg = exports.max = exports.min = exports.avg = exports.countDistinct = exports.count = exports.IsolationLevelEnum = exports.getConstantsForDialect = exports.SQLITE = exports.POSTGRES = exports.MARIADB = exports.MYSQL = exports.SQL = exports.createSQLiteAdvanced = exports.SQLiteAdvanced = exports.PRIVILEGE_LEVELS = exports.UserManager = exports.DatabaseSecurityDecorator = exports.Database = exports.buildCreateFullTextIndexSQL = exports.buildDropPolicySQL = exports.buildCreatePolicySQL = exports.buildEnableRowLevelSecuritySQL = exports.buildDropTriggerSQL = exports.buildCreateTriggerStatements = exports.buildDropSequenceSQL = exports.buildCreateSequenceSQL = exports.UnsupportedSchemaObjectError = exports.buildOptionsClause = exports.KNOWN_FDWS = exports.ForeignDataManager = exports.generateERDiagramFromFile = exports.generateModelDiagramFromFile = exports.generateERDiagram = exports.generateModelDiagram = exports.ERDiagram = void 0;
|
|
48
|
+
exports.sqlRepeat = exports.sqlNow = exports.sqlFormatDate = exports.sqlJsonHasKey = exports.sqlJsonContains = exports.sqlRtrim = exports.sqlLtrim = exports.sqlTrim = exports.sqlSubstring = exports.sqlTruncate = exports.sqlRandom = exports.NullsOrder = exports.windowFn = exports.maxOver = exports.minOver = exports.countOver = exports.avgOver = exports.sumOver = exports.nthValue = exports.lastValue = exports.firstValue = exports.lead = exports.lag = exports.ntile = exports.cumeDist = exports.percentRank = exports.denseRank = exports.rank = exports.rowNumber = exports.WindowFunctionBuilder = exports.split = exports.rpad = exports.lpad = exports.replace = exports.length = exports.lower = exports.upper = exports.concat = exports.least = exports.greatest = exports.mod = exports.sign = exports.abs = exports.sqrt = exports.power = exports.floor = exports.ceil = exports.round = exports.jsonTypeOf = exports.jsonKeys = void 0;
|
|
49
|
+
exports.sqlSum = exports.sqlReverse = void 0;
|
|
49
50
|
// Re-export Prorm class and query types
|
|
50
51
|
var prorm_1 = require("./prorm");
|
|
51
52
|
Object.defineProperty(exports, "Prorm", { enumerable: true, get: function () { return prorm_1.Prorm; } });
|
|
@@ -312,6 +313,7 @@ Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function
|
|
|
312
313
|
Object.defineProperty(exports, "ResourceLockedError", { enumerable: true, get: function () { return errors_1.ResourceLockedError; } });
|
|
313
314
|
Object.defineProperty(exports, "BulkRecordError", { enumerable: true, get: function () { return errors_1.BulkRecordError; } });
|
|
314
315
|
Object.defineProperty(exports, "AssociationError", { enumerable: true, get: function () { return errors_1.AssociationError; } });
|
|
316
|
+
Object.defineProperty(exports, "EagerLoadError", { enumerable: true, get: function () { return errors_1.EagerLoadError; } });
|
|
315
317
|
Object.defineProperty(exports, "EmptyResultError", { enumerable: true, get: function () { return errors_1.EmptyResultError; } });
|
|
316
318
|
Object.defineProperty(exports, "ErrorCodes", { enumerable: true, get: function () { return errors_1.ErrorCodes; } });
|
|
317
319
|
Object.defineProperty(exports, "isPrormError", { enumerable: true, get: function () { return errors_1.isPrormError; } });
|
|
@@ -352,6 +354,21 @@ Object.defineProperty(exports, "KNOWN_FDWS", { enumerable: true, get: function (
|
|
|
352
354
|
Object.defineProperty(exports, "buildOptionsClause", { enumerable: true, get: function () { return foreign_data_1.buildOptionsClause; } });
|
|
353
355
|
// Export external fields (@ExternalField + store registry)
|
|
354
356
|
__exportStar(require("./external-fields"), exports);
|
|
357
|
+
// Export schema-object builders and their options, so callers can catch
|
|
358
|
+
// UnsupportedSchemaObjectError and type the QueryInterface arguments.
|
|
359
|
+
// `SequenceOptions` and `PolicyOptions` already exist in './types' with
|
|
360
|
+
// different shapes, so the schema-object ones are aliased rather than
|
|
361
|
+
// shadowing names existing consumers may already import.
|
|
362
|
+
var schema_objects_1 = require("./schema-objects");
|
|
363
|
+
Object.defineProperty(exports, "UnsupportedSchemaObjectError", { enumerable: true, get: function () { return schema_objects_1.UnsupportedSchemaObjectError; } });
|
|
364
|
+
Object.defineProperty(exports, "buildCreateSequenceSQL", { enumerable: true, get: function () { return schema_objects_1.buildCreateSequenceSQL; } });
|
|
365
|
+
Object.defineProperty(exports, "buildDropSequenceSQL", { enumerable: true, get: function () { return schema_objects_1.buildDropSequenceSQL; } });
|
|
366
|
+
Object.defineProperty(exports, "buildCreateTriggerStatements", { enumerable: true, get: function () { return schema_objects_1.buildCreateTriggerStatements; } });
|
|
367
|
+
Object.defineProperty(exports, "buildDropTriggerSQL", { enumerable: true, get: function () { return schema_objects_1.buildDropTriggerSQL; } });
|
|
368
|
+
Object.defineProperty(exports, "buildEnableRowLevelSecuritySQL", { enumerable: true, get: function () { return schema_objects_1.buildEnableRowLevelSecuritySQL; } });
|
|
369
|
+
Object.defineProperty(exports, "buildCreatePolicySQL", { enumerable: true, get: function () { return schema_objects_1.buildCreatePolicySQL; } });
|
|
370
|
+
Object.defineProperty(exports, "buildDropPolicySQL", { enumerable: true, get: function () { return schema_objects_1.buildDropPolicySQL; } });
|
|
371
|
+
Object.defineProperty(exports, "buildCreateFullTextIndexSQL", { enumerable: true, get: function () { return schema_objects_1.buildCreateFullTextIndexSQL; } });
|
|
355
372
|
// Export decorators / annotations
|
|
356
373
|
__exportStar(require("./decorators"), exports);
|
|
357
374
|
// './decorators' (collate.ts) and './compliance' (security-decorator.ts) both export a
|