metal-orm 1.0.94 → 1.0.95
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/dist/index.cjs +29 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -3
- package/src/orm/column-introspection.ts +43 -0
package/dist/index.cjs
CHANGED
|
@@ -208,6 +208,8 @@ __export(index_exports, {
|
|
|
208
208
|
generateSchemaSqlFor: () => generateSchemaSqlFor,
|
|
209
209
|
getColumn: () => getColumn,
|
|
210
210
|
getColumnMap: () => getColumnMap,
|
|
211
|
+
getColumnType: () => getColumnType,
|
|
212
|
+
getDateKind: () => getDateKind,
|
|
211
213
|
getDecoratorMetadata: () => getDecoratorMetadata,
|
|
212
214
|
getDeterministicComponentName: () => getDeterministicComponentName,
|
|
213
215
|
getOpenApiVersionForDialect: () => getOpenApiVersionForDialect,
|
|
@@ -12650,6 +12652,31 @@ var Orm = class {
|
|
|
12650
12652
|
}
|
|
12651
12653
|
};
|
|
12652
12654
|
|
|
12655
|
+
// src/orm/column-introspection.ts
|
|
12656
|
+
var getColumnDefFromTarget = (target, column) => {
|
|
12657
|
+
if (typeof target === "function") {
|
|
12658
|
+
const meta = getEntityMetadata(target);
|
|
12659
|
+
if (!meta?.columns) return void 0;
|
|
12660
|
+
return meta.columns[column];
|
|
12661
|
+
}
|
|
12662
|
+
const table = target;
|
|
12663
|
+
return table.columns[column];
|
|
12664
|
+
};
|
|
12665
|
+
var getColumnType = (target, column) => {
|
|
12666
|
+
const col2 = getColumnDefFromTarget(target, column);
|
|
12667
|
+
if (!col2?.type) return void 0;
|
|
12668
|
+
return normalizeColumnType(col2.type);
|
|
12669
|
+
};
|
|
12670
|
+
var getDateKind = (target, column) => {
|
|
12671
|
+
const type = getColumnType(target, column);
|
|
12672
|
+
if (!type) return void 0;
|
|
12673
|
+
if (type === "date") return "date";
|
|
12674
|
+
if (type === "datetime" || type === "timestamp" || type === "timestamptz") {
|
|
12675
|
+
return "date-time";
|
|
12676
|
+
}
|
|
12677
|
+
return void 0;
|
|
12678
|
+
};
|
|
12679
|
+
|
|
12653
12680
|
// src/orm/jsonify.ts
|
|
12654
12681
|
var jsonify = (value) => {
|
|
12655
12682
|
const record = value;
|
|
@@ -15475,6 +15502,8 @@ function pagedResponseToOpenApiSchema(itemSchema) {
|
|
|
15475
15502
|
generateSchemaSqlFor,
|
|
15476
15503
|
getColumn,
|
|
15477
15504
|
getColumnMap,
|
|
15505
|
+
getColumnType,
|
|
15506
|
+
getDateKind,
|
|
15478
15507
|
getDecoratorMetadata,
|
|
15479
15508
|
getDeterministicComponentName,
|
|
15480
15509
|
getOpenApiVersionForDialect,
|