relq 1.0.10 → 1.0.12
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/cjs/addon/pg/index.cjs +2 -3
- package/dist/cjs/addon/pg-cursor/index.cjs +2 -3
- package/dist/cjs/cli/index.cjs +4 -0
- package/dist/cjs/cli/utils/config-loader.cjs +6 -4
- package/dist/esm/addon/pg/index.js +2 -3
- package/dist/esm/addon/pg-cursor/index.js +2 -3
- package/dist/esm/cli/index.js +4 -0
- package/dist/esm/cli/utils/config-loader.js +6 -4
- package/package.json +1 -1
|
@@ -346,10 +346,9 @@ var require_postgres_interval = __commonJS((exports2, module2) => {
|
|
|
346
346
|
|
|
347
347
|
// node_modules/postgres-bytea/index.js
|
|
348
348
|
var require_postgres_bytea = __commonJS((exports2, module2) => {
|
|
349
|
-
var bufferFrom = Buffer.from || Buffer;
|
|
350
349
|
module2.exports = function parseBytea(input) {
|
|
351
350
|
if (/^\\x/.test(input)) {
|
|
352
|
-
return
|
|
351
|
+
return new Buffer(input.substr(2), "hex");
|
|
353
352
|
}
|
|
354
353
|
var output = "";
|
|
355
354
|
var i = 0;
|
|
@@ -373,7 +372,7 @@ var require_postgres_bytea = __commonJS((exports2, module2) => {
|
|
|
373
372
|
}
|
|
374
373
|
}
|
|
375
374
|
}
|
|
376
|
-
return
|
|
375
|
+
return new Buffer(output, "binary");
|
|
377
376
|
};
|
|
378
377
|
});
|
|
379
378
|
|
|
@@ -346,10 +346,9 @@ var require_postgres_interval = __commonJS((exports2, module2) => {
|
|
|
346
346
|
|
|
347
347
|
// node_modules/postgres-bytea/index.js
|
|
348
348
|
var require_postgres_bytea = __commonJS((exports2, module2) => {
|
|
349
|
-
var bufferFrom = Buffer.from || Buffer;
|
|
350
349
|
module2.exports = function parseBytea(input) {
|
|
351
350
|
if (/^\\x/.test(input)) {
|
|
352
|
-
return
|
|
351
|
+
return new Buffer(input.substr(2), "hex");
|
|
353
352
|
}
|
|
354
353
|
var output = "";
|
|
355
354
|
var i = 0;
|
|
@@ -373,7 +372,7 @@ var require_postgres_bytea = __commonJS((exports2, module2) => {
|
|
|
373
372
|
}
|
|
374
373
|
}
|
|
375
374
|
}
|
|
376
|
-
return
|
|
375
|
+
return new Buffer(output, "binary");
|
|
377
376
|
};
|
|
378
377
|
});
|
|
379
378
|
|
package/dist/cjs/cli/index.cjs
CHANGED
|
@@ -42,6 +42,7 @@ exports.getSchemaPath = getSchemaPath;
|
|
|
42
42
|
exports.requireValidConfig = requireValidConfig;
|
|
43
43
|
exports.requireValidSchema = requireValidSchema;
|
|
44
44
|
const config_1 = require("../../config/config.cjs");
|
|
45
|
+
const cli_utils_1 = require("./cli-utils.cjs");
|
|
45
46
|
const env_loader_1 = require("./env-loader.cjs");
|
|
46
47
|
const fs = __importStar(require("fs"));
|
|
47
48
|
const path = __importStar(require("path"));
|
|
@@ -116,9 +117,10 @@ function validateConfig(config) {
|
|
|
116
117
|
}
|
|
117
118
|
return errors;
|
|
118
119
|
}
|
|
119
|
-
function getSchemaPath(config
|
|
120
|
-
if (!config)
|
|
121
|
-
return
|
|
120
|
+
function getSchemaPath(config) {
|
|
121
|
+
if (!config) {
|
|
122
|
+
return (0, cli_utils_1.fatal)('Configuration is required', 'Schema path must be defined in relq.config.ts');
|
|
123
|
+
}
|
|
122
124
|
if (typeof config.schema === 'string' && config.schema.length > 0) {
|
|
123
125
|
return config.schema;
|
|
124
126
|
}
|
|
@@ -131,7 +133,7 @@ function getSchemaPath(config, defaultPath = './db/schema.ts') {
|
|
|
131
133
|
if (config.typeGeneration?.output) {
|
|
132
134
|
return config.typeGeneration.output;
|
|
133
135
|
}
|
|
134
|
-
return
|
|
136
|
+
return (0, cli_utils_1.fatal)('Schema path not configured', "Add schema: './path/to/schema.ts' to relq.config.ts");
|
|
135
137
|
}
|
|
136
138
|
async function requireValidConfig(config, options) {
|
|
137
139
|
const errors = validateConfig(config);
|
|
@@ -333,10 +333,9 @@ var require_postgres_interval = __commonJS((exports, module) => {
|
|
|
333
333
|
|
|
334
334
|
// node_modules/postgres-bytea/index.js
|
|
335
335
|
var require_postgres_bytea = __commonJS((exports, module) => {
|
|
336
|
-
var bufferFrom = Buffer.from || Buffer;
|
|
337
336
|
module.exports = function parseBytea(input) {
|
|
338
337
|
if (/^\\x/.test(input)) {
|
|
339
|
-
return
|
|
338
|
+
return new Buffer(input.substr(2), "hex");
|
|
340
339
|
}
|
|
341
340
|
var output = "";
|
|
342
341
|
var i = 0;
|
|
@@ -360,7 +359,7 @@ var require_postgres_bytea = __commonJS((exports, module) => {
|
|
|
360
359
|
}
|
|
361
360
|
}
|
|
362
361
|
}
|
|
363
|
-
return
|
|
362
|
+
return new Buffer(output, "binary");
|
|
364
363
|
};
|
|
365
364
|
});
|
|
366
365
|
|
|
@@ -324,10 +324,9 @@ var require_postgres_interval = __commonJS((exports, module) => {
|
|
|
324
324
|
|
|
325
325
|
// node_modules/postgres-bytea/index.js
|
|
326
326
|
var require_postgres_bytea = __commonJS((exports, module) => {
|
|
327
|
-
var bufferFrom = Buffer.from || Buffer;
|
|
328
327
|
module.exports = function parseBytea(input) {
|
|
329
328
|
if (/^\\x/.test(input)) {
|
|
330
|
-
return
|
|
329
|
+
return new Buffer(input.substr(2), "hex");
|
|
331
330
|
}
|
|
332
331
|
var output = "";
|
|
333
332
|
var i = 0;
|
|
@@ -351,7 +350,7 @@ var require_postgres_bytea = __commonJS((exports, module) => {
|
|
|
351
350
|
}
|
|
352
351
|
}
|
|
353
352
|
}
|
|
354
|
-
return
|
|
353
|
+
return new Buffer(output, "binary");
|
|
355
354
|
};
|
|
356
355
|
});
|
|
357
356
|
|
package/dist/esm/cli/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { loadConfig as baseLoadConfig } from "../../config/config.js";
|
|
2
|
+
import { fatal } from "./cli-utils.js";
|
|
2
3
|
import { loadEnvConfig } from "./env-loader.js";
|
|
3
4
|
import * as fs from 'fs';
|
|
4
5
|
import * as path from 'path';
|
|
@@ -73,9 +74,10 @@ export function validateConfig(config) {
|
|
|
73
74
|
}
|
|
74
75
|
return errors;
|
|
75
76
|
}
|
|
76
|
-
export function getSchemaPath(config
|
|
77
|
-
if (!config)
|
|
78
|
-
return
|
|
77
|
+
export function getSchemaPath(config) {
|
|
78
|
+
if (!config) {
|
|
79
|
+
return fatal('Configuration is required', 'Schema path must be defined in relq.config.ts');
|
|
80
|
+
}
|
|
79
81
|
if (typeof config.schema === 'string' && config.schema.length > 0) {
|
|
80
82
|
return config.schema;
|
|
81
83
|
}
|
|
@@ -88,7 +90,7 @@ export function getSchemaPath(config, defaultPath = './db/schema.ts') {
|
|
|
88
90
|
if (config.typeGeneration?.output) {
|
|
89
91
|
return config.typeGeneration.output;
|
|
90
92
|
}
|
|
91
|
-
return
|
|
93
|
+
return fatal('Schema path not configured', "Add schema: './path/to/schema.ts' to relq.config.ts");
|
|
92
94
|
}
|
|
93
95
|
export async function requireValidConfig(config, options) {
|
|
94
96
|
const errors = validateConfig(config);
|