@onyx.dev/onyx-database 2.1.0 → 2.1.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/README.md +1 -1
- package/dist/{aggregates-DREvey7b.d.cts → aggregates-BFOBBZkW.d.cts} +1 -1
- package/dist/{aggregates-DREvey7b.d.ts → aggregates-BFOBBZkW.d.ts} +1 -1
- package/dist/edge.cjs +1 -2
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.d.cts +2 -2
- package/dist/edge.d.ts +2 -2
- package/dist/edge.js +1 -2
- package/dist/edge.js.map +1 -1
- package/dist/gen/cli/generate.cjs +5 -7
- package/dist/gen/cli/generate.cjs.map +1 -1
- package/dist/index.cjs +1 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/schema/cli/schema.cjs +0 -1
- package/dist/schema/cli/schema.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -231,7 +231,6 @@ async function resolveConfig(input) {
|
|
|
231
231
|
const maxRetries = retryConfig.maxRetries ?? 3;
|
|
232
232
|
const retryInitialDelayMs = retryConfig.initialDelayMs ?? 300;
|
|
233
233
|
const missing = [];
|
|
234
|
-
if (!databaseId) missing.push("databaseId");
|
|
235
234
|
if (!apiKey) missing.push("apiKey");
|
|
236
235
|
if (!apiSecret) missing.push("apiSecret");
|
|
237
236
|
if (missing.length) {
|
|
@@ -2353,7 +2352,7 @@ function normalizeIntrospection(raw) {
|
|
|
2353
2352
|
async function fetchSchemaFromApi(config) {
|
|
2354
2353
|
const db = onyx.init({
|
|
2355
2354
|
baseUrl: config.baseUrl,
|
|
2356
|
-
databaseId: config.databaseId,
|
|
2355
|
+
...config.databaseId ? { databaseId: config.databaseId } : {},
|
|
2357
2356
|
apiKey: config.apiKey,
|
|
2358
2357
|
apiSecret: config.apiSecret,
|
|
2359
2358
|
fetch: config.fetch
|
|
@@ -2376,12 +2375,11 @@ async function generateTypes(options) {
|
|
|
2376
2375
|
if (!schemaInput) {
|
|
2377
2376
|
if (opts.source === "file") throw new Error("Failed to read schema from file");
|
|
2378
2377
|
const cfg = await resolveConfig({});
|
|
2379
|
-
if (!
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
if (!opts.quiet)
|
|
2383
|
-
process__default.default.stderr.write(`[onyx-gen] fetching schema from API for db ${cfg.databaseId}
|
|
2378
|
+
if (!opts.quiet) {
|
|
2379
|
+
const target = cfg.databaseId ? `db ${cfg.databaseId}` : "default database context";
|
|
2380
|
+
process__default.default.stderr.write(`[onyx-gen] fetching schema from API for ${target}
|
|
2384
2381
|
`);
|
|
2382
|
+
}
|
|
2385
2383
|
schemaInput = await fetchSchemaFromApi(cfg);
|
|
2386
2384
|
}
|
|
2387
2385
|
const schema = normalizeIntrospection(schemaInput);
|