@dura-run/cli 0.2.1 → 0.3.0
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 +40 -0
- package/dist/dura.js +533 -279
- package/package.json +3 -3
package/dist/dura.js
CHANGED
|
@@ -2356,13 +2356,44 @@ var init_config_store = () => {};
|
|
|
2356
2356
|
var exports_login = {};
|
|
2357
2357
|
__export(exports_login, {
|
|
2358
2358
|
startCallbackServer: () => startCallbackServer,
|
|
2359
|
-
registerLoginCommand: () => registerLoginCommand
|
|
2359
|
+
registerLoginCommand: () => registerLoginCommand,
|
|
2360
|
+
isAllowedReferer: () => isAllowedReferer,
|
|
2361
|
+
CLI_CALLBACK_PORT_MIN: () => CLI_CALLBACK_PORT_MIN,
|
|
2362
|
+
CLI_CALLBACK_PORT_MAX: () => CLI_CALLBACK_PORT_MAX
|
|
2360
2363
|
});
|
|
2364
|
+
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
2361
2365
|
import {
|
|
2362
2366
|
createServer
|
|
2363
2367
|
} from "node:http";
|
|
2364
2368
|
import { URL as URL2 } from "node:url";
|
|
2365
|
-
function
|
|
2369
|
+
function safeEqual(a, b) {
|
|
2370
|
+
const aBuf = Buffer.from(a);
|
|
2371
|
+
const bBuf = Buffer.from(b);
|
|
2372
|
+
if (aBuf.length !== bBuf.length)
|
|
2373
|
+
return false;
|
|
2374
|
+
return timingSafeEqual(aBuf, bBuf);
|
|
2375
|
+
}
|
|
2376
|
+
function isAllowedReferer(referer, consoleUrl, apiUrl) {
|
|
2377
|
+
if (!referer)
|
|
2378
|
+
return true;
|
|
2379
|
+
let refOrigin;
|
|
2380
|
+
try {
|
|
2381
|
+
refOrigin = new URL2(referer).origin;
|
|
2382
|
+
} catch {
|
|
2383
|
+
return false;
|
|
2384
|
+
}
|
|
2385
|
+
const allowed = new Set;
|
|
2386
|
+
for (const u of [consoleUrl, apiUrl]) {
|
|
2387
|
+
try {
|
|
2388
|
+
allowed.add(new URL2(u).origin);
|
|
2389
|
+
} catch {}
|
|
2390
|
+
}
|
|
2391
|
+
return allowed.has(refOrigin);
|
|
2392
|
+
}
|
|
2393
|
+
function startCallbackServer(opts) {
|
|
2394
|
+
const consoleUrl = opts?.consoleUrl ?? getConsoleUrl();
|
|
2395
|
+
const apiUrl = opts?.apiUrl ?? getApiUrl();
|
|
2396
|
+
const state = randomBytes(32).toString("hex");
|
|
2366
2397
|
return new Promise((resolveSetup, rejectSetup) => {
|
|
2367
2398
|
let resolveCode;
|
|
2368
2399
|
let rejectCode;
|
|
@@ -2377,14 +2408,29 @@ function startCallbackServer() {
|
|
|
2377
2408
|
res.end("Not found");
|
|
2378
2409
|
return;
|
|
2379
2410
|
}
|
|
2411
|
+
const referer = req.headers["referer"] || req.headers["referrer"];
|
|
2412
|
+
const refererValue = Array.isArray(referer) ? referer[0] : referer;
|
|
2413
|
+
if (!isAllowedReferer(refererValue, consoleUrl, apiUrl)) {
|
|
2414
|
+
res.writeHead(400, { "Content-Type": "text/html" });
|
|
2415
|
+
res.end("<html><body><h1>Invalid callback</h1><p>Unexpected referrer.</p></body></html>");
|
|
2416
|
+
rejectCode(new Error("Invalid callback: referrer is not from the dura.run console"));
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2380
2419
|
const code = url.searchParams.get("code");
|
|
2381
2420
|
const error = url.searchParams.get("error");
|
|
2421
|
+
const callbackState = url.searchParams.get("state");
|
|
2382
2422
|
if (error) {
|
|
2383
2423
|
res.writeHead(200, { "Content-Type": "text/html" });
|
|
2384
2424
|
res.end("<html><body><h1>Login failed</h1><p>You can close this window.</p></body></html>");
|
|
2385
2425
|
rejectCode(new Error(`Login failed: ${error}`));
|
|
2386
2426
|
return;
|
|
2387
2427
|
}
|
|
2428
|
+
if (!callbackState || !safeEqual(callbackState, state)) {
|
|
2429
|
+
res.writeHead(400, { "Content-Type": "text/html" });
|
|
2430
|
+
res.end("<html><body><h1>Invalid callback</h1><p>Missing or invalid state parameter.</p></body></html>");
|
|
2431
|
+
rejectCode(new Error("Invalid callback: missing or invalid state parameter"));
|
|
2432
|
+
return;
|
|
2433
|
+
}
|
|
2388
2434
|
if (!code) {
|
|
2389
2435
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
2390
2436
|
res.end("<html><body><h1>Invalid callback</h1><p>Missing code parameter.</p></body></html>");
|
|
@@ -2395,15 +2441,24 @@ function startCallbackServer() {
|
|
|
2395
2441
|
res.end("<html><body><h1>Login successful!</h1><p>You can close this window and return to your terminal.</p></body></html>");
|
|
2396
2442
|
resolveCode(code);
|
|
2397
2443
|
});
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2444
|
+
const tryPort = (p) => {
|
|
2445
|
+
server.once("error", (err) => {
|
|
2446
|
+
if (err.code === "EADDRINUSE" && p < CLI_CALLBACK_PORT_MAX) {
|
|
2447
|
+
tryPort(p + 1);
|
|
2448
|
+
} else {
|
|
2449
|
+
rejectSetup(err);
|
|
2450
|
+
}
|
|
2451
|
+
});
|
|
2452
|
+
server.listen(p, "127.0.0.1", () => {
|
|
2453
|
+
const addr = server.address();
|
|
2454
|
+
if (!addr || typeof addr === "string") {
|
|
2455
|
+
rejectSetup(new Error("Failed to bind callback server"));
|
|
2456
|
+
return;
|
|
2457
|
+
}
|
|
2458
|
+
resolveSetup({ server, port: addr.port, state, codePromise });
|
|
2459
|
+
});
|
|
2460
|
+
};
|
|
2461
|
+
tryPort(CLI_CALLBACK_PORT_MIN);
|
|
2407
2462
|
});
|
|
2408
2463
|
}
|
|
2409
2464
|
async function openBrowser(url) {
|
|
@@ -2440,10 +2495,13 @@ function registerLoginCommand(program2) {
|
|
|
2440
2495
|
const consoleUrl = getConsoleUrl();
|
|
2441
2496
|
let server;
|
|
2442
2497
|
try {
|
|
2443
|
-
const callbackResult = await startCallbackServer(
|
|
2498
|
+
const callbackResult = await startCallbackServer({
|
|
2499
|
+
consoleUrl,
|
|
2500
|
+
apiUrl
|
|
2501
|
+
});
|
|
2444
2502
|
server = callbackResult.server;
|
|
2445
|
-
const { port } = callbackResult;
|
|
2446
|
-
const loginUrl = `${consoleUrl}/cli-auth?port=${port}`;
|
|
2503
|
+
const { port, state } = callbackResult;
|
|
2504
|
+
const loginUrl = `${consoleUrl}/cli-auth?port=${port}&state=${state}`;
|
|
2447
2505
|
output.info("Opening browser for login...");
|
|
2448
2506
|
output.info(`If the browser doesn't open, visit: ${loginUrl}`);
|
|
2449
2507
|
await openBrowser(loginUrl);
|
|
@@ -2491,6 +2549,7 @@ function registerLoginCommand(program2) {
|
|
|
2491
2549
|
}
|
|
2492
2550
|
});
|
|
2493
2551
|
}
|
|
2552
|
+
var CLI_CALLBACK_PORT_MIN = 31180, CLI_CALLBACK_PORT_MAX = 31199;
|
|
2494
2553
|
var init_login = __esm(() => {
|
|
2495
2554
|
init_src3();
|
|
2496
2555
|
init_config_store();
|
|
@@ -7187,7 +7246,7 @@ var init_marketplace = __esm(() => {
|
|
|
7187
7246
|
entrypoint: exports_external.string().min(1, "Entrypoint is required"),
|
|
7188
7247
|
configSchema: exports_external.record(exports_external.unknown()).optional(),
|
|
7189
7248
|
readme: exports_external.string().max(50000).optional()
|
|
7190
|
-
});
|
|
7249
|
+
}).strict();
|
|
7191
7250
|
installAdapterSchema = exports_external.object({
|
|
7192
7251
|
adapterId: exports_external.string().min(1, "Adapter ID is required"),
|
|
7193
7252
|
config: exports_external.record(exports_external.unknown()).optional()
|
|
@@ -7201,7 +7260,7 @@ var init_marketplace = __esm(() => {
|
|
|
7201
7260
|
});
|
|
7202
7261
|
});
|
|
7203
7262
|
|
|
7204
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
7263
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/query.js
|
|
7205
7264
|
function cachedError(xs) {
|
|
7206
7265
|
if (originCache.has(xs))
|
|
7207
7266
|
return originCache.get(xs);
|
|
@@ -7341,7 +7400,7 @@ var init_query = __esm(() => {
|
|
|
7341
7400
|
};
|
|
7342
7401
|
});
|
|
7343
7402
|
|
|
7344
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
7403
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/errors.js
|
|
7345
7404
|
function connection(x, options, socket) {
|
|
7346
7405
|
const { host, port } = socket || options;
|
|
7347
7406
|
const error = Object.assign(new Error("write " + x + " " + (options.path || host + ":" + port)), {
|
|
@@ -7387,7 +7446,7 @@ var init_errors2 = __esm(() => {
|
|
|
7387
7446
|
};
|
|
7388
7447
|
});
|
|
7389
7448
|
|
|
7390
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
7449
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/types.js
|
|
7391
7450
|
class NotTagged {
|
|
7392
7451
|
then() {
|
|
7393
7452
|
notTagged();
|
|
@@ -7658,7 +7717,7 @@ var init_types2 = __esm(() => {
|
|
|
7658
7717
|
kebab.column.to = fromKebab;
|
|
7659
7718
|
});
|
|
7660
7719
|
|
|
7661
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
7720
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/result.js
|
|
7662
7721
|
var Result;
|
|
7663
7722
|
var init_result = __esm(() => {
|
|
7664
7723
|
Result = class Result extends Array {
|
|
@@ -7678,7 +7737,7 @@ var init_result = __esm(() => {
|
|
|
7678
7737
|
};
|
|
7679
7738
|
});
|
|
7680
7739
|
|
|
7681
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
7740
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/queue.js
|
|
7682
7741
|
function Queue(initial = []) {
|
|
7683
7742
|
let xs = initial.slice();
|
|
7684
7743
|
let index = 0;
|
|
@@ -7708,7 +7767,7 @@ var init_queue = __esm(() => {
|
|
|
7708
7767
|
queue_default = Queue;
|
|
7709
7768
|
});
|
|
7710
7769
|
|
|
7711
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
7770
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/bytes.js
|
|
7712
7771
|
function fit(x) {
|
|
7713
7772
|
if (buffer.length - b.i < x) {
|
|
7714
7773
|
const prev = buffer, length = prev.length;
|
|
@@ -7783,7 +7842,7 @@ var init_bytes = __esm(() => {
|
|
|
7783
7842
|
bytes_default = b;
|
|
7784
7843
|
});
|
|
7785
7844
|
|
|
7786
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
7845
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/connection.js
|
|
7787
7846
|
import net from "net";
|
|
7788
7847
|
import tls from "tls";
|
|
7789
7848
|
import crypto from "crypto";
|
|
@@ -8518,7 +8577,7 @@ var init_connection = __esm(() => {
|
|
|
8518
8577
|
};
|
|
8519
8578
|
});
|
|
8520
8579
|
|
|
8521
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
8580
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/subscribe.js
|
|
8522
8581
|
function Subscribe(postgres2, options) {
|
|
8523
8582
|
const subscribers = new Map, slot = "postgresjs_" + Math.random().toString(36).slice(2), state = {};
|
|
8524
8583
|
let connection2, stream, ended = false;
|
|
@@ -8714,7 +8773,7 @@ function parseEvent(x) {
|
|
|
8714
8773
|
}
|
|
8715
8774
|
var noop2 = () => {};
|
|
8716
8775
|
|
|
8717
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
8776
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/large.js
|
|
8718
8777
|
import Stream2 from "stream";
|
|
8719
8778
|
function largeObject(sql, oid, mode = 131072 | 262144) {
|
|
8720
8779
|
return new Promise(async (resolve2, reject) => {
|
|
@@ -8781,7 +8840,7 @@ function largeObject(sql, oid, mode = 131072 | 262144) {
|
|
|
8781
8840
|
}
|
|
8782
8841
|
var init_large = () => {};
|
|
8783
8842
|
|
|
8784
|
-
// ../../node_modules/.bun/postgres@3.4.
|
|
8843
|
+
// ../../node_modules/.bun/postgres@3.4.9/node_modules/postgres/src/index.js
|
|
8785
8844
|
import os from "os";
|
|
8786
8845
|
import fs from "fs";
|
|
8787
8846
|
function Postgres(a, b2) {
|
|
@@ -9185,7 +9244,7 @@ var init_src = __esm(() => {
|
|
|
9185
9244
|
});
|
|
9186
9245
|
});
|
|
9187
9246
|
|
|
9188
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9247
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/entity.js
|
|
9189
9248
|
function is(value, type) {
|
|
9190
9249
|
if (!value || typeof value !== "object") {
|
|
9191
9250
|
return false;
|
|
@@ -9213,10 +9272,10 @@ var init_entity = __esm(() => {
|
|
|
9213
9272
|
hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
|
9214
9273
|
});
|
|
9215
9274
|
|
|
9216
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9275
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/logger.js
|
|
9217
9276
|
var init_logger = () => {};
|
|
9218
9277
|
|
|
9219
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9278
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/query-promise.js
|
|
9220
9279
|
var QueryPromise;
|
|
9221
9280
|
var init_query_promise = __esm(() => {
|
|
9222
9281
|
init_entity();
|
|
@@ -9241,7 +9300,7 @@ var init_query_promise = __esm(() => {
|
|
|
9241
9300
|
};
|
|
9242
9301
|
});
|
|
9243
9302
|
|
|
9244
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9303
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/column.js
|
|
9245
9304
|
var Column;
|
|
9246
9305
|
var init_column = __esm(() => {
|
|
9247
9306
|
init_entity();
|
|
@@ -9295,7 +9354,7 @@ var init_column = __esm(() => {
|
|
|
9295
9354
|
};
|
|
9296
9355
|
});
|
|
9297
9356
|
|
|
9298
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9357
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/column-builder.js
|
|
9299
9358
|
var ColumnBuilder;
|
|
9300
9359
|
var init_column_builder = __esm(() => {
|
|
9301
9360
|
init_entity();
|
|
@@ -9355,13 +9414,13 @@ var init_column_builder = __esm(() => {
|
|
|
9355
9414
|
};
|
|
9356
9415
|
});
|
|
9357
9416
|
|
|
9358
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9417
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/table.utils.js
|
|
9359
9418
|
var TableName;
|
|
9360
9419
|
var init_table_utils = __esm(() => {
|
|
9361
9420
|
TableName = Symbol.for("drizzle:Name");
|
|
9362
9421
|
});
|
|
9363
9422
|
|
|
9364
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9423
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/foreign-keys.js
|
|
9365
9424
|
var ForeignKeyBuilder, ForeignKey;
|
|
9366
9425
|
var init_foreign_keys = __esm(() => {
|
|
9367
9426
|
init_entity();
|
|
@@ -9419,13 +9478,13 @@ var init_foreign_keys = __esm(() => {
|
|
|
9419
9478
|
};
|
|
9420
9479
|
});
|
|
9421
9480
|
|
|
9422
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9481
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/tracing-utils.js
|
|
9423
9482
|
function iife(fn, ...args) {
|
|
9424
9483
|
return fn(...args);
|
|
9425
9484
|
}
|
|
9426
9485
|
var init_tracing_utils = () => {};
|
|
9427
9486
|
|
|
9428
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9487
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/unique-constraint.js
|
|
9429
9488
|
function uniqueKeyName(table, columns) {
|
|
9430
9489
|
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
9431
9490
|
}
|
|
@@ -9433,7 +9492,7 @@ var init_unique_constraint = __esm(() => {
|
|
|
9433
9492
|
init_table_utils();
|
|
9434
9493
|
});
|
|
9435
9494
|
|
|
9436
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9495
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/utils/array.js
|
|
9437
9496
|
function parsePgArrayValue(arrayString, startFrom, inQuotes) {
|
|
9438
9497
|
for (let i = startFrom;i < arrayString.length; i++) {
|
|
9439
9498
|
const char = arrayString[i];
|
|
@@ -9510,7 +9569,7 @@ function makePgArray(array) {
|
|
|
9510
9569
|
}
|
|
9511
9570
|
var init_array = () => {};
|
|
9512
9571
|
|
|
9513
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9572
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/common.js
|
|
9514
9573
|
var PgColumnBuilder, PgColumn, ExtraConfigColumn, IndexedColumn, PgArrayBuilder, PgArray;
|
|
9515
9574
|
var init_common = __esm(() => {
|
|
9516
9575
|
init_column_builder();
|
|
@@ -9663,7 +9722,7 @@ var init_common = __esm(() => {
|
|
|
9663
9722
|
};
|
|
9664
9723
|
});
|
|
9665
9724
|
|
|
9666
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9725
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/enum.js
|
|
9667
9726
|
function isPgEnum(obj) {
|
|
9668
9727
|
return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
|
|
9669
9728
|
}
|
|
@@ -9708,7 +9767,7 @@ var init_enum = __esm(() => {
|
|
|
9708
9767
|
};
|
|
9709
9768
|
});
|
|
9710
9769
|
|
|
9711
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9770
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/subquery.js
|
|
9712
9771
|
var Subquery;
|
|
9713
9772
|
var init_subquery = __esm(() => {
|
|
9714
9773
|
init_entity();
|
|
@@ -9726,11 +9785,11 @@ var init_subquery = __esm(() => {
|
|
|
9726
9785
|
};
|
|
9727
9786
|
});
|
|
9728
9787
|
|
|
9729
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9788
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/version.js
|
|
9730
9789
|
var version = "0.39.3";
|
|
9731
9790
|
var init_version = () => {};
|
|
9732
9791
|
|
|
9733
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9792
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/tracing.js
|
|
9734
9793
|
var otel, rawTracer, tracer;
|
|
9735
9794
|
var init_tracing = __esm(() => {
|
|
9736
9795
|
init_tracing_utils();
|
|
@@ -9760,13 +9819,13 @@ var init_tracing = __esm(() => {
|
|
|
9760
9819
|
};
|
|
9761
9820
|
});
|
|
9762
9821
|
|
|
9763
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9822
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/view-common.js
|
|
9764
9823
|
var ViewBaseConfig;
|
|
9765
9824
|
var init_view_common = __esm(() => {
|
|
9766
9825
|
ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
|
9767
9826
|
});
|
|
9768
9827
|
|
|
9769
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9828
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/table.js
|
|
9770
9829
|
function getTableName(table) {
|
|
9771
9830
|
return table[TableName];
|
|
9772
9831
|
}
|
|
@@ -9811,7 +9870,7 @@ var init_table = __esm(() => {
|
|
|
9811
9870
|
};
|
|
9812
9871
|
});
|
|
9813
9872
|
|
|
9814
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
9873
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/sql/sql.js
|
|
9815
9874
|
function isSQLWrapper(value) {
|
|
9816
9875
|
return value !== null && value !== undefined && typeof value.getSQL === "function";
|
|
9817
9876
|
}
|
|
@@ -10168,7 +10227,7 @@ var init_sql = __esm(() => {
|
|
|
10168
10227
|
};
|
|
10169
10228
|
});
|
|
10170
10229
|
|
|
10171
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10230
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/alias.js
|
|
10172
10231
|
var ColumnAliasProxyHandler, TableAliasProxyHandler;
|
|
10173
10232
|
var init_alias = __esm(() => {
|
|
10174
10233
|
init_column();
|
|
@@ -10230,7 +10289,7 @@ var init_alias = __esm(() => {
|
|
|
10230
10289
|
};
|
|
10231
10290
|
});
|
|
10232
10291
|
|
|
10233
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10292
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/selection-proxy.js
|
|
10234
10293
|
var SelectionProxyHandler;
|
|
10235
10294
|
var init_selection_proxy = __esm(() => {
|
|
10236
10295
|
init_alias();
|
|
@@ -10291,7 +10350,7 @@ var init_selection_proxy = __esm(() => {
|
|
|
10291
10350
|
};
|
|
10292
10351
|
});
|
|
10293
10352
|
|
|
10294
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10353
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/utils.js
|
|
10295
10354
|
function orderSelectedFields(fields, pathPrefix) {
|
|
10296
10355
|
return Object.entries(fields).reduce((result, [name, field]) => {
|
|
10297
10356
|
if (typeof name !== "string") {
|
|
@@ -10348,13 +10407,13 @@ var init_utils = __esm(() => {
|
|
|
10348
10407
|
init_view_common();
|
|
10349
10408
|
});
|
|
10350
10409
|
|
|
10351
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10410
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/query-builders/delete.js
|
|
10352
10411
|
var init_delete = () => {};
|
|
10353
10412
|
|
|
10354
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10413
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/errors.js
|
|
10355
10414
|
var init_errors3 = () => {};
|
|
10356
10415
|
|
|
10357
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10416
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/int.common.js
|
|
10358
10417
|
var PgIntColumnBaseBuilder;
|
|
10359
10418
|
var init_int_common = __esm(() => {
|
|
10360
10419
|
init_entity();
|
|
@@ -10398,7 +10457,7 @@ var init_int_common = __esm(() => {
|
|
|
10398
10457
|
};
|
|
10399
10458
|
});
|
|
10400
10459
|
|
|
10401
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10460
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/bigint.js
|
|
10402
10461
|
function bigint(a, b2) {
|
|
10403
10462
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
10404
10463
|
if (config.mode === "number") {
|
|
@@ -10453,7 +10512,7 @@ var init_bigint = __esm(() => {
|
|
|
10453
10512
|
};
|
|
10454
10513
|
});
|
|
10455
10514
|
|
|
10456
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10515
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/bigserial.js
|
|
10457
10516
|
function bigserial(a, b2) {
|
|
10458
10517
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
10459
10518
|
if (config.mode === "number") {
|
|
@@ -10510,7 +10569,7 @@ var init_bigserial = __esm(() => {
|
|
|
10510
10569
|
};
|
|
10511
10570
|
});
|
|
10512
10571
|
|
|
10513
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10572
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/boolean.js
|
|
10514
10573
|
function boolean(name) {
|
|
10515
10574
|
return new PgBooleanBuilder(name ?? "");
|
|
10516
10575
|
}
|
|
@@ -10535,7 +10594,7 @@ var init_boolean = __esm(() => {
|
|
|
10535
10594
|
};
|
|
10536
10595
|
});
|
|
10537
10596
|
|
|
10538
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10597
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/char.js
|
|
10539
10598
|
function char(a, b2 = {}) {
|
|
10540
10599
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
10541
10600
|
return new PgCharBuilder(name, config);
|
|
@@ -10566,7 +10625,7 @@ var init_char = __esm(() => {
|
|
|
10566
10625
|
};
|
|
10567
10626
|
});
|
|
10568
10627
|
|
|
10569
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10628
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/cidr.js
|
|
10570
10629
|
function cidr(name) {
|
|
10571
10630
|
return new PgCidrBuilder(name ?? "");
|
|
10572
10631
|
}
|
|
@@ -10591,7 +10650,7 @@ var init_cidr = __esm(() => {
|
|
|
10591
10650
|
};
|
|
10592
10651
|
});
|
|
10593
10652
|
|
|
10594
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10653
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/custom.js
|
|
10595
10654
|
function customType(customTypeParams) {
|
|
10596
10655
|
return (a, b2) => {
|
|
10597
10656
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
@@ -10637,7 +10696,7 @@ var init_custom = __esm(() => {
|
|
|
10637
10696
|
};
|
|
10638
10697
|
});
|
|
10639
10698
|
|
|
10640
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10699
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/date.common.js
|
|
10641
10700
|
var PgDateColumnBaseBuilder;
|
|
10642
10701
|
var init_date_common = __esm(() => {
|
|
10643
10702
|
init_entity();
|
|
@@ -10651,7 +10710,7 @@ var init_date_common = __esm(() => {
|
|
|
10651
10710
|
};
|
|
10652
10711
|
});
|
|
10653
10712
|
|
|
10654
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10713
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/date.js
|
|
10655
10714
|
function date(a, b2) {
|
|
10656
10715
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
10657
10716
|
if (config?.mode === "date") {
|
|
@@ -10703,7 +10762,7 @@ var init_date = __esm(() => {
|
|
|
10703
10762
|
};
|
|
10704
10763
|
});
|
|
10705
10764
|
|
|
10706
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10765
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/double-precision.js
|
|
10707
10766
|
function doublePrecision(name) {
|
|
10708
10767
|
return new PgDoublePrecisionBuilder(name ?? "");
|
|
10709
10768
|
}
|
|
@@ -10734,7 +10793,7 @@ var init_double_precision = __esm(() => {
|
|
|
10734
10793
|
};
|
|
10735
10794
|
});
|
|
10736
10795
|
|
|
10737
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10796
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/inet.js
|
|
10738
10797
|
function inet(name) {
|
|
10739
10798
|
return new PgInetBuilder(name ?? "");
|
|
10740
10799
|
}
|
|
@@ -10759,7 +10818,7 @@ var init_inet = __esm(() => {
|
|
|
10759
10818
|
};
|
|
10760
10819
|
});
|
|
10761
10820
|
|
|
10762
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10821
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/integer.js
|
|
10763
10822
|
function integer(name) {
|
|
10764
10823
|
return new PgIntegerBuilder(name ?? "");
|
|
10765
10824
|
}
|
|
@@ -10791,7 +10850,7 @@ var init_integer = __esm(() => {
|
|
|
10791
10850
|
};
|
|
10792
10851
|
});
|
|
10793
10852
|
|
|
10794
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10853
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/interval.js
|
|
10795
10854
|
function interval(a, b2 = {}) {
|
|
10796
10855
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
10797
10856
|
return new PgIntervalBuilder(name, config);
|
|
@@ -10823,7 +10882,7 @@ var init_interval = __esm(() => {
|
|
|
10823
10882
|
};
|
|
10824
10883
|
});
|
|
10825
10884
|
|
|
10826
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10885
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/json.js
|
|
10827
10886
|
function json(name) {
|
|
10828
10887
|
return new PgJsonBuilder(name ?? "");
|
|
10829
10888
|
}
|
|
@@ -10864,7 +10923,7 @@ var init_json = __esm(() => {
|
|
|
10864
10923
|
};
|
|
10865
10924
|
});
|
|
10866
10925
|
|
|
10867
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10926
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/jsonb.js
|
|
10868
10927
|
function jsonb(name) {
|
|
10869
10928
|
return new PgJsonbBuilder(name ?? "");
|
|
10870
10929
|
}
|
|
@@ -10905,7 +10964,7 @@ var init_jsonb = __esm(() => {
|
|
|
10905
10964
|
};
|
|
10906
10965
|
});
|
|
10907
10966
|
|
|
10908
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
10967
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/line.js
|
|
10909
10968
|
function line(a, b2) {
|
|
10910
10969
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
10911
10970
|
if (!config?.mode || config.mode === "tuple") {
|
|
@@ -10964,7 +11023,7 @@ var init_line = __esm(() => {
|
|
|
10964
11023
|
};
|
|
10965
11024
|
});
|
|
10966
11025
|
|
|
10967
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11026
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/macaddr.js
|
|
10968
11027
|
function macaddr(name) {
|
|
10969
11028
|
return new PgMacaddrBuilder(name ?? "");
|
|
10970
11029
|
}
|
|
@@ -10989,7 +11048,7 @@ var init_macaddr = __esm(() => {
|
|
|
10989
11048
|
};
|
|
10990
11049
|
});
|
|
10991
11050
|
|
|
10992
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11051
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/macaddr8.js
|
|
10993
11052
|
function macaddr8(name) {
|
|
10994
11053
|
return new PgMacaddr8Builder(name ?? "");
|
|
10995
11054
|
}
|
|
@@ -11014,7 +11073,7 @@ var init_macaddr8 = __esm(() => {
|
|
|
11014
11073
|
};
|
|
11015
11074
|
});
|
|
11016
11075
|
|
|
11017
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11076
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/numeric.js
|
|
11018
11077
|
function numeric(a, b2) {
|
|
11019
11078
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11020
11079
|
return new PgNumericBuilder(name, config?.precision, config?.scale);
|
|
@@ -11056,7 +11115,7 @@ var init_numeric = __esm(() => {
|
|
|
11056
11115
|
};
|
|
11057
11116
|
});
|
|
11058
11117
|
|
|
11059
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11118
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/point.js
|
|
11060
11119
|
function point(a, b2) {
|
|
11061
11120
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11062
11121
|
if (!config?.mode || config.mode === "tuple") {
|
|
@@ -11121,7 +11180,7 @@ var init_point = __esm(() => {
|
|
|
11121
11180
|
};
|
|
11122
11181
|
});
|
|
11123
11182
|
|
|
11124
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11183
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/postgis_extension/utils.js
|
|
11125
11184
|
function hexToBytes(hex) {
|
|
11126
11185
|
const bytes = [];
|
|
11127
11186
|
for (let c = 0;c < hex.length; c += 2) {
|
|
@@ -11161,7 +11220,7 @@ function parseEWKB(hex) {
|
|
|
11161
11220
|
}
|
|
11162
11221
|
var init_utils2 = () => {};
|
|
11163
11222
|
|
|
11164
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11223
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/postgis_extension/geometry.js
|
|
11165
11224
|
function geometry(a, b2) {
|
|
11166
11225
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11167
11226
|
if (!config?.mode || config.mode === "tuple") {
|
|
@@ -11220,7 +11279,7 @@ var init_geometry = __esm(() => {
|
|
|
11220
11279
|
};
|
|
11221
11280
|
});
|
|
11222
11281
|
|
|
11223
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11282
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/real.js
|
|
11224
11283
|
function real(name) {
|
|
11225
11284
|
return new PgRealBuilder(name ?? "");
|
|
11226
11285
|
}
|
|
@@ -11255,7 +11314,7 @@ var init_real = __esm(() => {
|
|
|
11255
11314
|
};
|
|
11256
11315
|
});
|
|
11257
11316
|
|
|
11258
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11317
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/serial.js
|
|
11259
11318
|
function serial(name) {
|
|
11260
11319
|
return new PgSerialBuilder(name ?? "");
|
|
11261
11320
|
}
|
|
@@ -11282,7 +11341,7 @@ var init_serial = __esm(() => {
|
|
|
11282
11341
|
};
|
|
11283
11342
|
});
|
|
11284
11343
|
|
|
11285
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11344
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/smallint.js
|
|
11286
11345
|
function smallint(name) {
|
|
11287
11346
|
return new PgSmallIntBuilder(name ?? "");
|
|
11288
11347
|
}
|
|
@@ -11314,7 +11373,7 @@ var init_smallint = __esm(() => {
|
|
|
11314
11373
|
};
|
|
11315
11374
|
});
|
|
11316
11375
|
|
|
11317
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11376
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/smallserial.js
|
|
11318
11377
|
function smallserial(name) {
|
|
11319
11378
|
return new PgSmallSerialBuilder(name ?? "");
|
|
11320
11379
|
}
|
|
@@ -11341,7 +11400,7 @@ var init_smallserial = __esm(() => {
|
|
|
11341
11400
|
};
|
|
11342
11401
|
});
|
|
11343
11402
|
|
|
11344
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11403
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/text.js
|
|
11345
11404
|
function text(a, b2 = {}) {
|
|
11346
11405
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11347
11406
|
return new PgTextBuilder(name, config);
|
|
@@ -11370,7 +11429,7 @@ var init_text = __esm(() => {
|
|
|
11370
11429
|
};
|
|
11371
11430
|
});
|
|
11372
11431
|
|
|
11373
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11432
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/time.js
|
|
11374
11433
|
function time(a, b2 = {}) {
|
|
11375
11434
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11376
11435
|
return new PgTimeBuilder(name, config.withTimezone ?? false, config.precision);
|
|
@@ -11410,7 +11469,7 @@ var init_time = __esm(() => {
|
|
|
11410
11469
|
};
|
|
11411
11470
|
});
|
|
11412
11471
|
|
|
11413
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11472
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/timestamp.js
|
|
11414
11473
|
function timestamp(a, b2 = {}) {
|
|
11415
11474
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11416
11475
|
if (config?.mode === "string") {
|
|
@@ -11482,7 +11541,7 @@ var init_timestamp = __esm(() => {
|
|
|
11482
11541
|
};
|
|
11483
11542
|
});
|
|
11484
11543
|
|
|
11485
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11544
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/uuid.js
|
|
11486
11545
|
function uuid(name) {
|
|
11487
11546
|
return new PgUUIDBuilder(name ?? "");
|
|
11488
11547
|
}
|
|
@@ -11511,7 +11570,7 @@ var init_uuid = __esm(() => {
|
|
|
11511
11570
|
};
|
|
11512
11571
|
});
|
|
11513
11572
|
|
|
11514
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11573
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/varchar.js
|
|
11515
11574
|
function varchar(a, b2 = {}) {
|
|
11516
11575
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11517
11576
|
return new PgVarcharBuilder(name, config);
|
|
@@ -11542,7 +11601,7 @@ var init_varchar = __esm(() => {
|
|
|
11542
11601
|
};
|
|
11543
11602
|
});
|
|
11544
11603
|
|
|
11545
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11604
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/vector_extension/bit.js
|
|
11546
11605
|
function bit(a, b2) {
|
|
11547
11606
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11548
11607
|
return new PgBinaryVectorBuilder(name, config);
|
|
@@ -11571,7 +11630,7 @@ var init_bit = __esm(() => {
|
|
|
11571
11630
|
};
|
|
11572
11631
|
});
|
|
11573
11632
|
|
|
11574
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11633
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/vector_extension/halfvec.js
|
|
11575
11634
|
function halfvec(a, b2) {
|
|
11576
11635
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11577
11636
|
return new PgHalfVectorBuilder(name, config);
|
|
@@ -11606,7 +11665,7 @@ var init_halfvec = __esm(() => {
|
|
|
11606
11665
|
};
|
|
11607
11666
|
});
|
|
11608
11667
|
|
|
11609
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11668
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/vector_extension/sparsevec.js
|
|
11610
11669
|
function sparsevec(a, b2) {
|
|
11611
11670
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11612
11671
|
return new PgSparseVectorBuilder(name, config);
|
|
@@ -11635,7 +11694,7 @@ var init_sparsevec = __esm(() => {
|
|
|
11635
11694
|
};
|
|
11636
11695
|
});
|
|
11637
11696
|
|
|
11638
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11697
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/vector_extension/vector.js
|
|
11639
11698
|
function vector(a, b2) {
|
|
11640
11699
|
const { name, config } = getColumnNameAndConfig(a, b2);
|
|
11641
11700
|
return new PgVectorBuilder(name, config);
|
|
@@ -11670,7 +11729,7 @@ var init_vector = __esm(() => {
|
|
|
11670
11729
|
};
|
|
11671
11730
|
});
|
|
11672
11731
|
|
|
11673
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11732
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/index.js
|
|
11674
11733
|
var init_columns = __esm(() => {
|
|
11675
11734
|
init_bigint();
|
|
11676
11735
|
init_bigserial();
|
|
@@ -11709,7 +11768,7 @@ var init_columns = __esm(() => {
|
|
|
11709
11768
|
init_vector();
|
|
11710
11769
|
});
|
|
11711
11770
|
|
|
11712
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11771
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/columns/all.js
|
|
11713
11772
|
function getPgColumnBuilders() {
|
|
11714
11773
|
return {
|
|
11715
11774
|
bigint,
|
|
@@ -11781,7 +11840,7 @@ var init_all = __esm(() => {
|
|
|
11781
11840
|
init_vector();
|
|
11782
11841
|
});
|
|
11783
11842
|
|
|
11784
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11843
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/table.js
|
|
11785
11844
|
function pgTableWithSchema(name, columns, extraConfig, schema, baseName = name) {
|
|
11786
11845
|
const rawTable = new PgTable(name, schema, baseName);
|
|
11787
11846
|
const parsedColumns = typeof columns === "function" ? columns(getPgColumnBuilders()) : columns;
|
|
@@ -11832,7 +11891,7 @@ var init_table2 = __esm(() => {
|
|
|
11832
11891
|
};
|
|
11833
11892
|
});
|
|
11834
11893
|
|
|
11835
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11894
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/primary-keys.js
|
|
11836
11895
|
function primaryKey(...config) {
|
|
11837
11896
|
if (config[0].columns) {
|
|
11838
11897
|
return new PrimaryKeyBuilder(config[0].columns, config[0].name);
|
|
@@ -11870,44 +11929,49 @@ var init_primary_keys = __esm(() => {
|
|
|
11870
11929
|
};
|
|
11871
11930
|
});
|
|
11872
11931
|
|
|
11873
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11932
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/sql/expressions/conditions.js
|
|
11874
11933
|
var init_conditions = () => {};
|
|
11875
11934
|
|
|
11876
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11877
|
-
|
|
11935
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/sql/expressions/select.js
|
|
11936
|
+
function desc(column) {
|
|
11937
|
+
return sql`${column} desc`;
|
|
11938
|
+
}
|
|
11939
|
+
var init_select = __esm(() => {
|
|
11940
|
+
init_sql();
|
|
11941
|
+
});
|
|
11878
11942
|
|
|
11879
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11943
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/sql/expressions/index.js
|
|
11880
11944
|
var init_expressions = __esm(() => {
|
|
11881
11945
|
init_conditions();
|
|
11882
11946
|
init_select();
|
|
11883
11947
|
});
|
|
11884
11948
|
|
|
11885
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11949
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/relations.js
|
|
11886
11950
|
var init_relations = () => {};
|
|
11887
11951
|
|
|
11888
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11952
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/sql/functions/aggregate.js
|
|
11889
11953
|
var init_aggregate = () => {};
|
|
11890
11954
|
|
|
11891
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11955
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/sql/functions/vector.js
|
|
11892
11956
|
var init_vector2 = () => {};
|
|
11893
11957
|
|
|
11894
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11958
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/sql/functions/index.js
|
|
11895
11959
|
var init_functions = __esm(() => {
|
|
11896
11960
|
init_aggregate();
|
|
11897
11961
|
init_vector2();
|
|
11898
11962
|
});
|
|
11899
11963
|
|
|
11900
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11964
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/sql/index.js
|
|
11901
11965
|
var init_sql2 = __esm(() => {
|
|
11902
11966
|
init_expressions();
|
|
11903
11967
|
init_functions();
|
|
11904
11968
|
init_sql();
|
|
11905
11969
|
});
|
|
11906
11970
|
|
|
11907
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11971
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/dialect.js
|
|
11908
11972
|
var init_dialect = () => {};
|
|
11909
11973
|
|
|
11910
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11974
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/query-builders/query-builder.js
|
|
11911
11975
|
var TypedQueryBuilder;
|
|
11912
11976
|
var init_query_builder = __esm(() => {
|
|
11913
11977
|
init_entity();
|
|
@@ -11919,7 +11983,7 @@ var init_query_builder = __esm(() => {
|
|
|
11919
11983
|
};
|
|
11920
11984
|
});
|
|
11921
11985
|
|
|
11922
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
11986
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/query-builders/select.js
|
|
11923
11987
|
function createSetOperator(type, isAll) {
|
|
11924
11988
|
return (leftSelect, rightSelect, ...restSelects) => {
|
|
11925
11989
|
const setOperators = [rightSelect, ...restSelects].map((select3) => ({
|
|
@@ -12172,16 +12236,16 @@ var init_select2 = __esm(() => {
|
|
|
12172
12236
|
exceptAll = createSetOperator("except", true);
|
|
12173
12237
|
});
|
|
12174
12238
|
|
|
12175
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12239
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/query-builders/query-builder.js
|
|
12176
12240
|
var init_query_builder2 = () => {};
|
|
12177
12241
|
|
|
12178
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12242
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/query-builders/insert.js
|
|
12179
12243
|
var init_insert = () => {};
|
|
12180
12244
|
|
|
12181
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12245
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/query-builders/refresh-materialized-view.js
|
|
12182
12246
|
var init_refresh_materialized_view = () => {};
|
|
12183
12247
|
|
|
12184
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12248
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/query-builders/update.js
|
|
12185
12249
|
var PgUpdateBase;
|
|
12186
12250
|
var init_update = __esm(() => {
|
|
12187
12251
|
init_entity();
|
|
@@ -12325,7 +12389,7 @@ var init_update = __esm(() => {
|
|
|
12325
12389
|
};
|
|
12326
12390
|
});
|
|
12327
12391
|
|
|
12328
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12392
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/query-builders/index.js
|
|
12329
12393
|
var init_query_builders = __esm(() => {
|
|
12330
12394
|
init_delete();
|
|
12331
12395
|
init_insert();
|
|
@@ -12335,13 +12399,13 @@ var init_query_builders = __esm(() => {
|
|
|
12335
12399
|
init_update();
|
|
12336
12400
|
});
|
|
12337
12401
|
|
|
12338
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12402
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/db.js
|
|
12339
12403
|
var init_db = () => {};
|
|
12340
12404
|
|
|
12341
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12405
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/alias.js
|
|
12342
12406
|
var init_alias2 = () => {};
|
|
12343
12407
|
|
|
12344
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12408
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/checks.js
|
|
12345
12409
|
function check(name, value) {
|
|
12346
12410
|
return new CheckBuilder(name, value);
|
|
12347
12411
|
}
|
|
@@ -12371,7 +12435,7 @@ var init_checks = __esm(() => {
|
|
|
12371
12435
|
};
|
|
12372
12436
|
});
|
|
12373
12437
|
|
|
12374
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12438
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/indexes.js
|
|
12375
12439
|
function index(name) {
|
|
12376
12440
|
return new IndexBuilderOn(false, name);
|
|
12377
12441
|
}
|
|
@@ -12460,42 +12524,42 @@ var init_indexes = __esm(() => {
|
|
|
12460
12524
|
};
|
|
12461
12525
|
});
|
|
12462
12526
|
|
|
12463
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12527
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/policies.js
|
|
12464
12528
|
var init_policies = () => {};
|
|
12465
12529
|
|
|
12466
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12530
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/roles.js
|
|
12467
12531
|
var init_roles = () => {};
|
|
12468
12532
|
|
|
12469
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12533
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/sequence.js
|
|
12470
12534
|
var init_sequence = () => {};
|
|
12471
12535
|
|
|
12472
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12536
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/view-common.js
|
|
12473
12537
|
var PgViewConfig;
|
|
12474
12538
|
var init_view_common2 = __esm(() => {
|
|
12475
12539
|
PgViewConfig = Symbol.for("drizzle:PgViewConfig");
|
|
12476
12540
|
});
|
|
12477
12541
|
|
|
12478
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12542
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/view.js
|
|
12479
12543
|
var PgMaterializedViewConfig;
|
|
12480
12544
|
var init_view = __esm(() => {
|
|
12481
12545
|
PgMaterializedViewConfig = Symbol.for("drizzle:PgMaterializedViewConfig");
|
|
12482
12546
|
});
|
|
12483
12547
|
|
|
12484
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12548
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/schema.js
|
|
12485
12549
|
var init_schema = () => {};
|
|
12486
12550
|
|
|
12487
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12551
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/session.js
|
|
12488
12552
|
var init_session = () => {};
|
|
12489
12553
|
|
|
12490
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12554
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/utils.js
|
|
12491
12555
|
var init_utils3 = () => {};
|
|
12492
12556
|
|
|
12493
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12557
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/utils/index.js
|
|
12494
12558
|
var init_utils4 = __esm(() => {
|
|
12495
12559
|
init_array();
|
|
12496
12560
|
});
|
|
12497
12561
|
|
|
12498
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+
|
|
12562
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/pg-core/index.js
|
|
12499
12563
|
var init_pg_core = __esm(() => {
|
|
12500
12564
|
init_alias2();
|
|
12501
12565
|
init_checks();
|
|
@@ -12531,6 +12595,7 @@ var init_users = __esm(() => {
|
|
|
12531
12595
|
emailVerified: boolean("email_verified").notNull().default(false),
|
|
12532
12596
|
image: text("image"),
|
|
12533
12597
|
twoFactorEnabled: boolean("two_factor_enabled").default(false),
|
|
12598
|
+
isSuperadmin: boolean("is_superadmin").notNull().default(false),
|
|
12534
12599
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
12535
12600
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
12536
12601
|
});
|
|
@@ -12647,9 +12712,33 @@ var init_triggers = __esm(() => {
|
|
|
12647
12712
|
}, (table2) => [index("triggers_automation_idx").on(table2.automationId)]);
|
|
12648
12713
|
});
|
|
12649
12714
|
|
|
12715
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/expressions.js
|
|
12716
|
+
var init_expressions2 = __esm(() => {
|
|
12717
|
+
init_expressions();
|
|
12718
|
+
});
|
|
12719
|
+
|
|
12720
|
+
// ../../node_modules/.bun/drizzle-orm@0.39.3+a324ea3b81409b9a/node_modules/drizzle-orm/index.js
|
|
12721
|
+
var init_drizzle_orm = __esm(() => {
|
|
12722
|
+
init_alias();
|
|
12723
|
+
init_column_builder();
|
|
12724
|
+
init_column();
|
|
12725
|
+
init_entity();
|
|
12726
|
+
init_errors3();
|
|
12727
|
+
init_expressions2();
|
|
12728
|
+
init_logger();
|
|
12729
|
+
init_query_promise();
|
|
12730
|
+
init_relations();
|
|
12731
|
+
init_sql2();
|
|
12732
|
+
init_subquery();
|
|
12733
|
+
init_table();
|
|
12734
|
+
init_utils();
|
|
12735
|
+
init_view_common();
|
|
12736
|
+
});
|
|
12737
|
+
|
|
12650
12738
|
// ../shared/src/db/schema/deployments.ts
|
|
12651
12739
|
var deploymentStatusEnum, deployments;
|
|
12652
12740
|
var init_deployments = __esm(() => {
|
|
12741
|
+
init_drizzle_orm();
|
|
12653
12742
|
init_pg_core();
|
|
12654
12743
|
init_projects();
|
|
12655
12744
|
deploymentStatusEnum = pgEnum("deployment_status", [
|
|
@@ -12672,10 +12761,11 @@ var init_deployments = __esm(() => {
|
|
|
12672
12761
|
activatedAt: timestamp("activated_at", { withTimezone: true }),
|
|
12673
12762
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
12674
12763
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
12675
|
-
}, (
|
|
12676
|
-
index("deployments_project_idx").on(
|
|
12677
|
-
index("deployments_project_status_idx").on(
|
|
12678
|
-
index("deployments_environment_idx").on(
|
|
12764
|
+
}, (table3) => [
|
|
12765
|
+
index("deployments_project_idx").on(table3.projectId),
|
|
12766
|
+
index("deployments_project_status_idx").on(table3.projectId, table3.status),
|
|
12767
|
+
index("deployments_environment_idx").on(table3.environmentId),
|
|
12768
|
+
index("deployments_project_created_idx").on(table3.projectId, desc(table3.createdAt))
|
|
12679
12769
|
]);
|
|
12680
12770
|
});
|
|
12681
12771
|
|
|
@@ -12720,14 +12810,14 @@ var init_execution_records = __esm(() => {
|
|
|
12720
12810
|
replayOverrides: jsonb("replay_overrides").$type(),
|
|
12721
12811
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
12722
12812
|
completedAt: timestamp("completed_at", { withTimezone: true })
|
|
12723
|
-
}, (
|
|
12724
|
-
index("execution_records_automation_idx").on(
|
|
12725
|
-
index("execution_records_deployment_idx").on(
|
|
12726
|
-
index("execution_records_status_idx").on(
|
|
12727
|
-
index("execution_records_trace_idx").on(
|
|
12728
|
-
index("execution_records_created_idx").on(
|
|
12729
|
-
index("execution_records_automation_created_idx").on(
|
|
12730
|
-
index("execution_records_replay_of_idx").on(
|
|
12813
|
+
}, (table3) => [
|
|
12814
|
+
index("execution_records_automation_idx").on(table3.automationId),
|
|
12815
|
+
index("execution_records_deployment_idx").on(table3.deploymentId),
|
|
12816
|
+
index("execution_records_status_idx").on(table3.status),
|
|
12817
|
+
index("execution_records_trace_idx").on(table3.traceId),
|
|
12818
|
+
index("execution_records_created_idx").on(table3.createdAt),
|
|
12819
|
+
index("execution_records_automation_created_idx").on(table3.automationId, table3.createdAt),
|
|
12820
|
+
index("execution_records_replay_of_idx").on(table3.replayOf)
|
|
12731
12821
|
]);
|
|
12732
12822
|
});
|
|
12733
12823
|
|
|
@@ -12751,10 +12841,10 @@ var init_log_entries = __esm(() => {
|
|
|
12751
12841
|
level: logLevelEnum("level").notNull(),
|
|
12752
12842
|
message: text("message").notNull(),
|
|
12753
12843
|
fields: jsonb("fields")
|
|
12754
|
-
}, (
|
|
12755
|
-
index("log_entries_execution_idx").on(
|
|
12756
|
-
index("log_entries_project_idx").on(
|
|
12757
|
-
index("log_entries_timestamp_idx").on(
|
|
12844
|
+
}, (table3) => [
|
|
12845
|
+
index("log_entries_execution_idx").on(table3.executionId),
|
|
12846
|
+
index("log_entries_project_idx").on(table3.projectId),
|
|
12847
|
+
index("log_entries_timestamp_idx").on(table3.timestamp)
|
|
12758
12848
|
]);
|
|
12759
12849
|
});
|
|
12760
12850
|
|
|
@@ -12772,11 +12862,11 @@ var init_metrics = __esm(() => {
|
|
|
12772
12862
|
name: text("name").notNull(),
|
|
12773
12863
|
value: doublePrecision("value").notNull(),
|
|
12774
12864
|
tags: jsonb("tags")
|
|
12775
|
-
}, (
|
|
12776
|
-
index("metrics_execution_idx").on(
|
|
12777
|
-
index("metrics_project_idx").on(
|
|
12778
|
-
index("metrics_name_idx").on(
|
|
12779
|
-
index("metrics_timestamp_idx").on(
|
|
12865
|
+
}, (table3) => [
|
|
12866
|
+
index("metrics_execution_idx").on(table3.executionId),
|
|
12867
|
+
index("metrics_project_idx").on(table3.projectId),
|
|
12868
|
+
index("metrics_name_idx").on(table3.name),
|
|
12869
|
+
index("metrics_timestamp_idx").on(table3.timestamp)
|
|
12780
12870
|
]);
|
|
12781
12871
|
});
|
|
12782
12872
|
|
|
@@ -12797,9 +12887,9 @@ var init_artifacts = __esm(() => {
|
|
|
12797
12887
|
storageUrl: text("storage_url").notNull(),
|
|
12798
12888
|
metadata: jsonb("metadata"),
|
|
12799
12889
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
12800
|
-
}, (
|
|
12801
|
-
index("artifacts_execution_idx").on(
|
|
12802
|
-
index("artifacts_project_idx").on(
|
|
12890
|
+
}, (table3) => [
|
|
12891
|
+
index("artifacts_execution_idx").on(table3.executionId),
|
|
12892
|
+
index("artifacts_project_idx").on(table3.projectId)
|
|
12803
12893
|
]);
|
|
12804
12894
|
});
|
|
12805
12895
|
|
|
@@ -12822,10 +12912,10 @@ var init_secrets2 = __esm(() => {
|
|
|
12822
12912
|
nonce: bytea("nonce").notNull(),
|
|
12823
12913
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
12824
12914
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
12825
|
-
}, (
|
|
12826
|
-
uniqueIndex("secrets_project_name_idx").on(
|
|
12827
|
-
index("secrets_project_idx").on(
|
|
12828
|
-
index("secrets_environment_idx").on(
|
|
12915
|
+
}, (table3) => [
|
|
12916
|
+
uniqueIndex("secrets_project_name_idx").on(table3.projectId, table3.name),
|
|
12917
|
+
index("secrets_project_idx").on(table3.projectId),
|
|
12918
|
+
index("secrets_environment_idx").on(table3.environmentId)
|
|
12829
12919
|
]);
|
|
12830
12920
|
});
|
|
12831
12921
|
|
|
@@ -12847,11 +12937,11 @@ var init_api_keys = __esm(() => {
|
|
|
12847
12937
|
lastUsedAt: timestamp("last_used_at", { withTimezone: true }),
|
|
12848
12938
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
12849
12939
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
12850
|
-
}, (
|
|
12851
|
-
index("api_keys_org_idx").on(
|
|
12852
|
-
index("api_keys_user_idx").on(
|
|
12853
|
-
index("api_keys_prefix_idx").on(
|
|
12854
|
-
uniqueIndex("api_keys_hash_idx").on(
|
|
12940
|
+
}, (table3) => [
|
|
12941
|
+
index("api_keys_org_idx").on(table3.organizationId),
|
|
12942
|
+
index("api_keys_user_idx").on(table3.userId),
|
|
12943
|
+
index("api_keys_prefix_idx").on(table3.keyPrefix),
|
|
12944
|
+
uniqueIndex("api_keys_hash_idx").on(table3.keyHash)
|
|
12855
12945
|
]);
|
|
12856
12946
|
});
|
|
12857
12947
|
|
|
@@ -12876,10 +12966,10 @@ var init_endpoint_keys = __esm(() => {
|
|
|
12876
12966
|
revokedAt: timestamp("revoked_at", { withTimezone: true }),
|
|
12877
12967
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
12878
12968
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
12879
|
-
}, (
|
|
12880
|
-
index("endpoint_keys_project_idx").on(
|
|
12881
|
-
index("endpoint_keys_prefix_idx").on(
|
|
12882
|
-
uniqueIndex("endpoint_keys_hash_idx").on(
|
|
12969
|
+
}, (table3) => [
|
|
12970
|
+
index("endpoint_keys_project_idx").on(table3.projectId),
|
|
12971
|
+
index("endpoint_keys_prefix_idx").on(table3.keyPrefix),
|
|
12972
|
+
uniqueIndex("endpoint_keys_hash_idx").on(table3.keyHash)
|
|
12883
12973
|
]);
|
|
12884
12974
|
});
|
|
12885
12975
|
|
|
@@ -12901,11 +12991,11 @@ var init_audit_log = __esm(() => {
|
|
|
12901
12991
|
metadata: jsonb("metadata"),
|
|
12902
12992
|
ipAddress: text("ip_address"),
|
|
12903
12993
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
12904
|
-
}, (
|
|
12905
|
-
index("audit_log_org_idx").on(
|
|
12906
|
-
index("audit_log_user_idx").on(
|
|
12907
|
-
index("audit_log_action_idx").on(
|
|
12908
|
-
index("audit_log_created_idx").on(
|
|
12994
|
+
}, (table3) => [
|
|
12995
|
+
index("audit_log_org_idx").on(table3.organizationId),
|
|
12996
|
+
index("audit_log_user_idx").on(table3.userId),
|
|
12997
|
+
index("audit_log_action_idx").on(table3.action),
|
|
12998
|
+
index("audit_log_created_idx").on(table3.createdAt)
|
|
12909
12999
|
]);
|
|
12910
13000
|
});
|
|
12911
13001
|
|
|
@@ -12942,40 +13032,17 @@ var init_metering_rollups = __esm(() => {
|
|
|
12942
13032
|
}).notNull().default(0),
|
|
12943
13033
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
12944
13034
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
12945
|
-
}, (
|
|
12946
|
-
uniqueIndex("metering_rollups_natural_key").on(
|
|
12947
|
-
index("metering_rollups_org_idx").on(
|
|
12948
|
-
index("metering_rollups_project_idx").on(
|
|
12949
|
-
index("metering_rollups_automation_idx").on(
|
|
12950
|
-
index("metering_rollups_granularity_idx").on(
|
|
12951
|
-
index("metering_rollups_bucket_idx").on(
|
|
12952
|
-
index("metering_rollups_project_bucket_idx").on(
|
|
13035
|
+
}, (table3) => [
|
|
13036
|
+
uniqueIndex("metering_rollups_natural_key").on(table3.automationId, table3.granularity, table3.bucketStart),
|
|
13037
|
+
index("metering_rollups_org_idx").on(table3.organizationId),
|
|
13038
|
+
index("metering_rollups_project_idx").on(table3.projectId),
|
|
13039
|
+
index("metering_rollups_automation_idx").on(table3.automationId),
|
|
13040
|
+
index("metering_rollups_granularity_idx").on(table3.granularity),
|
|
13041
|
+
index("metering_rollups_bucket_idx").on(table3.bucketStart),
|
|
13042
|
+
index("metering_rollups_project_bucket_idx").on(table3.projectId, table3.granularity, table3.bucketStart)
|
|
12953
13043
|
]);
|
|
12954
13044
|
});
|
|
12955
13045
|
|
|
12956
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+7505325c0ab11955/node_modules/drizzle-orm/expressions.js
|
|
12957
|
-
var init_expressions2 = __esm(() => {
|
|
12958
|
-
init_expressions();
|
|
12959
|
-
});
|
|
12960
|
-
|
|
12961
|
-
// ../../node_modules/.bun/drizzle-orm@0.39.3+7505325c0ab11955/node_modules/drizzle-orm/index.js
|
|
12962
|
-
var init_drizzle_orm = __esm(() => {
|
|
12963
|
-
init_alias();
|
|
12964
|
-
init_column_builder();
|
|
12965
|
-
init_column();
|
|
12966
|
-
init_entity();
|
|
12967
|
-
init_errors3();
|
|
12968
|
-
init_expressions2();
|
|
12969
|
-
init_logger();
|
|
12970
|
-
init_query_promise();
|
|
12971
|
-
init_relations();
|
|
12972
|
-
init_sql2();
|
|
12973
|
-
init_subquery();
|
|
12974
|
-
init_table();
|
|
12975
|
-
init_utils();
|
|
12976
|
-
init_view_common();
|
|
12977
|
-
});
|
|
12978
|
-
|
|
12979
13046
|
// ../shared/src/db/schema/credit-ledger.ts
|
|
12980
13047
|
var creditLedgerEntryTypeEnum, creditLedger;
|
|
12981
13048
|
var init_credit_ledger = __esm(() => {
|
|
@@ -13591,6 +13658,56 @@ var init_auth = __esm(() => {
|
|
|
13591
13658
|
});
|
|
13592
13659
|
});
|
|
13593
13660
|
|
|
13661
|
+
// ../shared/src/db/schema/admin-sessions.ts
|
|
13662
|
+
var bytea2, adminSessions;
|
|
13663
|
+
var init_admin_sessions = __esm(() => {
|
|
13664
|
+
init_pg_core();
|
|
13665
|
+
init_users();
|
|
13666
|
+
bytea2 = customType({
|
|
13667
|
+
dataType() {
|
|
13668
|
+
return "bytea";
|
|
13669
|
+
}
|
|
13670
|
+
});
|
|
13671
|
+
adminSessions = pgTable("admin_sessions", {
|
|
13672
|
+
id: uuid("id").defaultRandom().primaryKey(),
|
|
13673
|
+
sessionTokenHash: bytea2("session_token_hash").notNull(),
|
|
13674
|
+
userId: uuid("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
13675
|
+
issuedAt: timestamp("issued_at", { withTimezone: true }).notNull().defaultNow(),
|
|
13676
|
+
lastActivityAt: timestamp("last_activity_at", { withTimezone: true }).notNull().defaultNow(),
|
|
13677
|
+
stepUpVerifiedAt: timestamp("step_up_verified_at", { withTimezone: true }),
|
|
13678
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
13679
|
+
}, (table3) => [
|
|
13680
|
+
uniqueIndex("admin_sessions_token_idx").on(table3.sessionTokenHash),
|
|
13681
|
+
index("admin_sessions_user_idx").on(table3.userId)
|
|
13682
|
+
]);
|
|
13683
|
+
});
|
|
13684
|
+
|
|
13685
|
+
// ../shared/src/db/schema/admin-audit-log.ts
|
|
13686
|
+
var adminAuditLog;
|
|
13687
|
+
var init_admin_audit_log = __esm(() => {
|
|
13688
|
+
init_pg_core();
|
|
13689
|
+
init_users();
|
|
13690
|
+
adminAuditLog = pgTable("admin_audit_log", {
|
|
13691
|
+
id: uuid("id").defaultRandom().primaryKey(),
|
|
13692
|
+
userId: uuid("user_id").references(() => users.id, {
|
|
13693
|
+
onDelete: "set null"
|
|
13694
|
+
}),
|
|
13695
|
+
actorLabel: text("actor_label").notNull(),
|
|
13696
|
+
route: text("route").notNull(),
|
|
13697
|
+
method: text("method").notNull(),
|
|
13698
|
+
queryParams: jsonb("query_params").$type(),
|
|
13699
|
+
statusCode: integer("status_code").notNull(),
|
|
13700
|
+
ipAddress: text("ip_address"),
|
|
13701
|
+
userAgent: text("user_agent"),
|
|
13702
|
+
actionPayload: jsonb("action_payload").$type(),
|
|
13703
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
13704
|
+
}, (table3) => [
|
|
13705
|
+
index("admin_audit_log_user_idx").on(table3.userId),
|
|
13706
|
+
index("admin_audit_log_created_idx").on(table3.createdAt),
|
|
13707
|
+
index("admin_audit_log_route_idx").on(table3.route)
|
|
13708
|
+
]);
|
|
13709
|
+
});
|
|
13710
|
+
|
|
13594
13711
|
// ../shared/src/db/schema/index.ts
|
|
13595
13712
|
var init_schema2 = __esm(() => {
|
|
13596
13713
|
init_users();
|
|
@@ -13625,6 +13742,8 @@ var init_schema2 = __esm(() => {
|
|
|
13625
13742
|
init_healing();
|
|
13626
13743
|
init_playground();
|
|
13627
13744
|
init_auth();
|
|
13745
|
+
init_admin_sessions();
|
|
13746
|
+
init_admin_audit_log();
|
|
13628
13747
|
});
|
|
13629
13748
|
|
|
13630
13749
|
// ../shared/src/db/index.ts
|
|
@@ -13639,6 +13758,22 @@ var init_url_validator = __esm(() => {
|
|
|
13639
13758
|
BLOCKED_HOSTNAMES = new Set(["localhost", "metadata.google.internal"]);
|
|
13640
13759
|
});
|
|
13641
13760
|
|
|
13761
|
+
// ../shared/src/crypto/session-token.ts
|
|
13762
|
+
var init_session_token = () => {};
|
|
13763
|
+
|
|
13764
|
+
// ../shared/src/http/parse-body.ts
|
|
13765
|
+
function parseHttpBody(body, _headers) {
|
|
13766
|
+
if (typeof body !== "string")
|
|
13767
|
+
return body;
|
|
13768
|
+
if (body === "")
|
|
13769
|
+
return null;
|
|
13770
|
+
try {
|
|
13771
|
+
return JSON.parse(body);
|
|
13772
|
+
} catch {
|
|
13773
|
+
return body;
|
|
13774
|
+
}
|
|
13775
|
+
}
|
|
13776
|
+
|
|
13642
13777
|
// ../shared/src/index.ts
|
|
13643
13778
|
var init_src2 = __esm(() => {
|
|
13644
13779
|
init_billing();
|
|
@@ -13650,6 +13785,7 @@ var init_src2 = __esm(() => {
|
|
|
13650
13785
|
init_marketplace();
|
|
13651
13786
|
init_db2();
|
|
13652
13787
|
init_url_validator();
|
|
13788
|
+
init_session_token();
|
|
13653
13789
|
});
|
|
13654
13790
|
|
|
13655
13791
|
// src/lib/manifest.ts
|
|
@@ -14601,6 +14737,114 @@ var init_schedule = __esm(() => {
|
|
|
14601
14737
|
init_project_id();
|
|
14602
14738
|
});
|
|
14603
14739
|
|
|
14740
|
+
// src/lib/dev-trust.ts
|
|
14741
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync4, writeFileSync as writeFileSync6 } from "node:fs";
|
|
14742
|
+
import { dirname, join as join7 } from "node:path";
|
|
14743
|
+
function hasStoredCredentials() {
|
|
14744
|
+
try {
|
|
14745
|
+
const cfg = readConfig();
|
|
14746
|
+
const apiKey = typeof cfg.apiKey === "string" ? cfg.apiKey : "";
|
|
14747
|
+
const authToken = typeof cfg.authToken === "string" ? cfg.authToken : "";
|
|
14748
|
+
return apiKey.length > 0 || authToken.length > 0;
|
|
14749
|
+
} catch {
|
|
14750
|
+
return false;
|
|
14751
|
+
}
|
|
14752
|
+
}
|
|
14753
|
+
function hasProjectTrustMarker(projectDir) {
|
|
14754
|
+
return existsSync6(join7(projectDir, TRUST_MARKER_RELATIVE_PATH));
|
|
14755
|
+
}
|
|
14756
|
+
function grantProjectTrust(projectDir) {
|
|
14757
|
+
const markerPath = join7(projectDir, TRUST_MARKER_RELATIVE_PATH);
|
|
14758
|
+
const dir = dirname(markerPath);
|
|
14759
|
+
if (!existsSync6(dir)) {
|
|
14760
|
+
mkdirSync4(dir, { recursive: true });
|
|
14761
|
+
}
|
|
14762
|
+
const note = [
|
|
14763
|
+
"# dura dev trust marker",
|
|
14764
|
+
"#",
|
|
14765
|
+
"# This file records that you accepted the risk of running `dura dev`",
|
|
14766
|
+
"# in-process with access to your local credentials (see GH #118).",
|
|
14767
|
+
"# Delete this file to revoke trust for this project.",
|
|
14768
|
+
`# Granted: ${new Date().toISOString()}`,
|
|
14769
|
+
""
|
|
14770
|
+
].join(`
|
|
14771
|
+
`);
|
|
14772
|
+
writeFileSync6(markerPath, note, { mode: 384 });
|
|
14773
|
+
}
|
|
14774
|
+
function isEnvTruthy(val) {
|
|
14775
|
+
if (!val)
|
|
14776
|
+
return false;
|
|
14777
|
+
const v = val.trim().toLowerCase();
|
|
14778
|
+
return v === "1" || v === "true" || v === "yes";
|
|
14779
|
+
}
|
|
14780
|
+
function evaluateDevTrust(input) {
|
|
14781
|
+
if (!hasStoredCredentials()) {
|
|
14782
|
+
return { allow: true, warn: false, reason: "NO_CREDENTIALS" };
|
|
14783
|
+
}
|
|
14784
|
+
if (input.trustFlag) {
|
|
14785
|
+
grantProjectTrust(input.projectDir);
|
|
14786
|
+
return { allow: true, warn: true, reason: "TRUST_GRANTED_FLAG" };
|
|
14787
|
+
}
|
|
14788
|
+
if (isEnvTruthy(input.trustEnv)) {
|
|
14789
|
+
grantProjectTrust(input.projectDir);
|
|
14790
|
+
return { allow: true, warn: true, reason: "TRUST_GRANTED_ENV" };
|
|
14791
|
+
}
|
|
14792
|
+
if (hasProjectTrustMarker(input.projectDir)) {
|
|
14793
|
+
return { allow: true, warn: true, reason: "MARKER_PRESENT" };
|
|
14794
|
+
}
|
|
14795
|
+
return { allow: false, warn: true, reason: "TRUST_REQUIRED" };
|
|
14796
|
+
}
|
|
14797
|
+
function renderTrustWarning(opts) {
|
|
14798
|
+
const color = opts?.color ?? process.stderr.isTTY ?? false;
|
|
14799
|
+
const red = color ? RED : "";
|
|
14800
|
+
const yellow = color ? YELLOW : "";
|
|
14801
|
+
const bold = color ? BOLD : "";
|
|
14802
|
+
const reset2 = color ? RESET : "";
|
|
14803
|
+
const lines = [
|
|
14804
|
+
`${red}${bold}╔══════════════════════════════════════════════════════════════════════╗${reset2}`,
|
|
14805
|
+
`${red}${bold}║ SECURITY WARNING — dura dev runs automation code with your local ║${reset2}`,
|
|
14806
|
+
`${red}${bold}║ filesystem privileges. A malicious npm dependency in your handler ║${reset2}`,
|
|
14807
|
+
`${red}${bold}║ graph can read ~/.dura/config (your API key), ~/.ssh, ~/.aws, etc. ║${reset2}`,
|
|
14808
|
+
`${red}${bold}║ See https://github.com/dura-run/dura-run/issues/118 for details. ║${reset2}`,
|
|
14809
|
+
`${red}${bold}╚══════════════════════════════════════════════════════════════════════╝${reset2}`,
|
|
14810
|
+
`${yellow} Tip: audit your dependencies before trusting this project.${reset2}`,
|
|
14811
|
+
""
|
|
14812
|
+
];
|
|
14813
|
+
return lines.join(`
|
|
14814
|
+
`);
|
|
14815
|
+
}
|
|
14816
|
+
function renderTrustRefusal() {
|
|
14817
|
+
const color = process.stderr.isTTY ?? false;
|
|
14818
|
+
const yellow = color ? YELLOW : "";
|
|
14819
|
+
const bold = color ? BOLD : "";
|
|
14820
|
+
const reset2 = color ? RESET : "";
|
|
14821
|
+
return [
|
|
14822
|
+
`${bold}${yellow}dura dev refuses to start.${reset2}`,
|
|
14823
|
+
"",
|
|
14824
|
+
"Your local machine has stored dura credentials, and `dura dev` currently",
|
|
14825
|
+
"loads your handler code with full filesystem access. Until we ship an",
|
|
14826
|
+
"isolated-vm sandbox for local dev, you must explicitly accept this risk.",
|
|
14827
|
+
"",
|
|
14828
|
+
"To proceed, pick ONE of:",
|
|
14829
|
+
"",
|
|
14830
|
+
" 1. Run with --trust (one-time; remembered via .dura/dev-trust):",
|
|
14831
|
+
" dura dev --trust",
|
|
14832
|
+
"",
|
|
14833
|
+
" 2. Set the env var (same effect):",
|
|
14834
|
+
" DURA_DEV_TRUST=1 dura dev",
|
|
14835
|
+
"",
|
|
14836
|
+
" 3. Log out first (removes the credentials being protected):",
|
|
14837
|
+
" dura logout",
|
|
14838
|
+
""
|
|
14839
|
+
].join(`
|
|
14840
|
+
`);
|
|
14841
|
+
}
|
|
14842
|
+
var TRUST_MARKER_RELATIVE_PATH, RED = "\x1B[31m", YELLOW = "\x1B[33m", BOLD = "\x1B[1m", RESET = "\x1B[0m";
|
|
14843
|
+
var init_dev_trust = __esm(() => {
|
|
14844
|
+
init_config_store();
|
|
14845
|
+
TRUST_MARKER_RELATIVE_PATH = join7(".dura", "dev-trust");
|
|
14846
|
+
});
|
|
14847
|
+
|
|
14604
14848
|
// src/dev/server.ts
|
|
14605
14849
|
var exports_server = {};
|
|
14606
14850
|
__export(exports_server, {
|
|
@@ -14680,7 +14924,7 @@ function createDevServer(options) {
|
|
|
14680
14924
|
headers,
|
|
14681
14925
|
query,
|
|
14682
14926
|
params: match.params,
|
|
14683
|
-
body
|
|
14927
|
+
body: parseHttpBody(body, headers)
|
|
14684
14928
|
});
|
|
14685
14929
|
return options.onRequest(match.route, duraReq);
|
|
14686
14930
|
}
|
|
@@ -14711,12 +14955,7 @@ function createDevServer(options) {
|
|
|
14711
14955
|
resolve3(null);
|
|
14712
14956
|
return;
|
|
14713
14957
|
}
|
|
14714
|
-
|
|
14715
|
-
try {
|
|
14716
|
-
resolve3(JSON.parse(raw));
|
|
14717
|
-
} catch {
|
|
14718
|
-
resolve3(raw);
|
|
14719
|
-
}
|
|
14958
|
+
resolve3(Buffer.concat(chunks).toString("utf-8"));
|
|
14720
14959
|
});
|
|
14721
14960
|
});
|
|
14722
14961
|
}
|
|
@@ -14788,6 +15027,7 @@ function createDevServer(options) {
|
|
|
14788
15027
|
}
|
|
14789
15028
|
var CORS_HEADERS;
|
|
14790
15029
|
var init_server = __esm(() => {
|
|
15030
|
+
init_src2();
|
|
14791
15031
|
CORS_HEADERS = {
|
|
14792
15032
|
"access-control-allow-origin": "*",
|
|
14793
15033
|
"access-control-allow-methods": "GET, POST, PUT, PATCH, DELETE, OPTIONS",
|
|
@@ -15131,8 +15371,8 @@ __export(exports_file_watcher, {
|
|
|
15131
15371
|
resolveAffectedAutomation: () => resolveAffectedAutomation,
|
|
15132
15372
|
createFileWatcher: () => createFileWatcher
|
|
15133
15373
|
});
|
|
15134
|
-
import { watch, existsSync as
|
|
15135
|
-
import { join as
|
|
15374
|
+
import { watch, existsSync as existsSync7 } from "node:fs";
|
|
15375
|
+
import { join as join8 } from "node:path";
|
|
15136
15376
|
function resolveAffectedAutomation(manifest, changedPath) {
|
|
15137
15377
|
const normalized = changedPath.replace(/\\/g, "/");
|
|
15138
15378
|
const directMatch = manifest.automations.filter((a) => a.entrypoint.replace(/\\/g, "/") === normalized);
|
|
@@ -15151,7 +15391,7 @@ function createFileWatcher(options) {
|
|
|
15151
15391
|
return;
|
|
15152
15392
|
if (!/\.(ts|tsx|js|jsx|mjs|mts)$/.test(filename))
|
|
15153
15393
|
return;
|
|
15154
|
-
const relativePath =
|
|
15394
|
+
const relativePath = join8(dir, filename).replace(/\\/g, "/");
|
|
15155
15395
|
const existing = debounceTimers.get(relativePath);
|
|
15156
15396
|
if (existing) {
|
|
15157
15397
|
clearTimeout(existing);
|
|
@@ -15167,8 +15407,8 @@ function createFileWatcher(options) {
|
|
|
15167
15407
|
return;
|
|
15168
15408
|
watching = true;
|
|
15169
15409
|
for (const dir of watchDirs) {
|
|
15170
|
-
const fullDir =
|
|
15171
|
-
if (!
|
|
15410
|
+
const fullDir = join8(projectDir, dir);
|
|
15411
|
+
if (!existsSync7(fullDir))
|
|
15172
15412
|
continue;
|
|
15173
15413
|
try {
|
|
15174
15414
|
const fsWatcher = watch(fullDir, { recursive: true }, (_eventType, filename) => {
|
|
@@ -15249,9 +15489,22 @@ function extractCronTriggers(manifest) {
|
|
|
15249
15489
|
return entries;
|
|
15250
15490
|
}
|
|
15251
15491
|
function registerDevCommand(program2) {
|
|
15252
|
-
program2.command("dev").description("Start the local development server with hot-reload").option("--dir <path>", "Project directory", ".").option("--port <port>", "Dev server port", "3000").action(async (opts, cmd) => {
|
|
15492
|
+
program2.command("dev").description("Start the local development server with hot-reload").option("--dir <path>", "Project directory", ".").option("--port <port>", "Dev server port", "3000").option("--trust", "Acknowledge that `dura dev` runs user code with your local filesystem privileges (see GH #118). Required when credentials are stored locally; remembered in .dura/dev-trust.").action(async (opts, cmd) => {
|
|
15253
15493
|
const output = getOutput(cmd);
|
|
15254
15494
|
const projectDir = opts.dir ?? ".";
|
|
15495
|
+
const trustDecision = evaluateDevTrust({
|
|
15496
|
+
projectDir,
|
|
15497
|
+
trustFlag: opts.trust === true,
|
|
15498
|
+
trustEnv: process.env["DURA_DEV_TRUST"]
|
|
15499
|
+
});
|
|
15500
|
+
if (trustDecision.warn) {
|
|
15501
|
+
process.stderr.write(renderTrustWarning());
|
|
15502
|
+
}
|
|
15503
|
+
if (!trustDecision.allow) {
|
|
15504
|
+
process.stderr.write(renderTrustRefusal());
|
|
15505
|
+
output.error("DEV_TRUST_REQUIRED", "dura dev refused to start — credentials are stored locally and trust was not granted.", "Re-run with --trust or set DURA_DEV_TRUST=1 after reviewing the warning above.");
|
|
15506
|
+
return;
|
|
15507
|
+
}
|
|
15255
15508
|
const port = parseInt(opts.port ?? "3000", 10);
|
|
15256
15509
|
if (isNaN(port) || port < 1 || port > 65535) {
|
|
15257
15510
|
output.error("INVALID_PORT", `Invalid port: "${opts.port}". Must be a number between 1 and 65535.`);
|
|
@@ -15267,11 +15520,11 @@ function registerDevCommand(program2) {
|
|
|
15267
15520
|
}
|
|
15268
15521
|
throw err;
|
|
15269
15522
|
}
|
|
15270
|
-
const { existsSync:
|
|
15271
|
-
const { join:
|
|
15272
|
-
const envPath =
|
|
15523
|
+
const { existsSync: existsSync8, readFileSync: readFileSync6 } = await import("node:fs");
|
|
15524
|
+
const { join: join9 } = await import("node:path");
|
|
15525
|
+
const envPath = join9(projectDir, ".env.local");
|
|
15273
15526
|
let secrets2 = {};
|
|
15274
|
-
if (
|
|
15527
|
+
if (existsSync8(envPath)) {
|
|
15275
15528
|
const content = readFileSync6(envPath, "utf-8");
|
|
15276
15529
|
secrets2 = parseEnvFile(content);
|
|
15277
15530
|
output.info(`Loaded ${Object.keys(secrets2).length} secret(s) from .env.local`);
|
|
@@ -15375,6 +15628,7 @@ Shutting down...`);
|
|
|
15375
15628
|
var init_dev = __esm(() => {
|
|
15376
15629
|
init_src3();
|
|
15377
15630
|
init_manifest2();
|
|
15631
|
+
init_dev_trust();
|
|
15378
15632
|
});
|
|
15379
15633
|
// src/snapshot/comparator.ts
|
|
15380
15634
|
function getAtPath(obj, path) {
|
|
@@ -15622,14 +15876,14 @@ var init_comparator = __esm(() => {
|
|
|
15622
15876
|
|
|
15623
15877
|
// src/snapshot/file-manager.ts
|
|
15624
15878
|
import {
|
|
15625
|
-
existsSync as
|
|
15626
|
-
mkdirSync as
|
|
15879
|
+
existsSync as existsSync8,
|
|
15880
|
+
mkdirSync as mkdirSync5,
|
|
15627
15881
|
readFileSync as readFileSync6,
|
|
15628
|
-
writeFileSync as
|
|
15882
|
+
writeFileSync as writeFileSync7,
|
|
15629
15883
|
readdirSync as readdirSync2,
|
|
15630
15884
|
unlinkSync
|
|
15631
15885
|
} from "node:fs";
|
|
15632
|
-
import { join as
|
|
15886
|
+
import { join as join9 } from "node:path";
|
|
15633
15887
|
function automationNameToFileName(automationName) {
|
|
15634
15888
|
return automationName.replace(/\//g, "-") + ".snap.json";
|
|
15635
15889
|
}
|
|
@@ -15640,19 +15894,19 @@ function fileNameToAutomationName(fileName) {
|
|
|
15640
15894
|
class SnapshotFileManager {
|
|
15641
15895
|
snapshotsDir;
|
|
15642
15896
|
constructor(projectDir) {
|
|
15643
|
-
this.snapshotsDir =
|
|
15897
|
+
this.snapshotsDir = join9(projectDir, SNAPSHOTS_DIR);
|
|
15644
15898
|
}
|
|
15645
15899
|
filePath(automationName) {
|
|
15646
|
-
return
|
|
15900
|
+
return join9(this.snapshotsDir, automationNameToFileName(automationName));
|
|
15647
15901
|
}
|
|
15648
15902
|
ensureDir() {
|
|
15649
|
-
if (!
|
|
15650
|
-
|
|
15903
|
+
if (!existsSync8(this.snapshotsDir)) {
|
|
15904
|
+
mkdirSync5(this.snapshotsDir, { recursive: true });
|
|
15651
15905
|
}
|
|
15652
15906
|
}
|
|
15653
15907
|
read(automationName) {
|
|
15654
15908
|
const path = this.filePath(automationName);
|
|
15655
|
-
if (!
|
|
15909
|
+
if (!existsSync8(path))
|
|
15656
15910
|
return null;
|
|
15657
15911
|
try {
|
|
15658
15912
|
const raw = readFileSync6(path, "utf-8");
|
|
@@ -15664,7 +15918,7 @@ class SnapshotFileManager {
|
|
|
15664
15918
|
write(automationName, snapshotFile) {
|
|
15665
15919
|
this.ensureDir();
|
|
15666
15920
|
const path = this.filePath(automationName);
|
|
15667
|
-
|
|
15921
|
+
writeFileSync7(path, JSON.stringify(snapshotFile, null, 2) + `
|
|
15668
15922
|
`, "utf-8");
|
|
15669
15923
|
}
|
|
15670
15924
|
updateSnapshot(automationName, snapshot) {
|
|
@@ -15685,12 +15939,12 @@ class SnapshotFileManager {
|
|
|
15685
15939
|
});
|
|
15686
15940
|
}
|
|
15687
15941
|
listAutomationNames() {
|
|
15688
|
-
if (!
|
|
15942
|
+
if (!existsSync8(this.snapshotsDir))
|
|
15689
15943
|
return [];
|
|
15690
15944
|
const files = readdirSync2(this.snapshotsDir).filter((f) => f.endsWith(".snap.json"));
|
|
15691
15945
|
const names = [];
|
|
15692
15946
|
for (const file of files) {
|
|
15693
|
-
const path =
|
|
15947
|
+
const path = join9(this.snapshotsDir, file);
|
|
15694
15948
|
try {
|
|
15695
15949
|
const raw = readFileSync6(path, "utf-8");
|
|
15696
15950
|
const parsed = JSON.parse(raw);
|
|
@@ -15703,7 +15957,7 @@ class SnapshotFileManager {
|
|
|
15703
15957
|
}
|
|
15704
15958
|
delete(automationName) {
|
|
15705
15959
|
const path = this.filePath(automationName);
|
|
15706
|
-
if (
|
|
15960
|
+
if (existsSync8(path)) {
|
|
15707
15961
|
unlinkSync(path);
|
|
15708
15962
|
}
|
|
15709
15963
|
}
|
|
@@ -15712,15 +15966,15 @@ var SNAPSHOTS_DIR = "__snapshots__";
|
|
|
15712
15966
|
var init_file_manager = () => {};
|
|
15713
15967
|
|
|
15714
15968
|
// src/snapshot/config-reader.ts
|
|
15715
|
-
import { existsSync as
|
|
15716
|
-
import { join as
|
|
15969
|
+
import { existsSync as existsSync9, readFileSync as readFileSync7 } from "node:fs";
|
|
15970
|
+
import { join as join10 } from "node:path";
|
|
15717
15971
|
function readSnapshotConfig(projectDir) {
|
|
15718
|
-
const durajsonPath =
|
|
15719
|
-
const testjsonPath =
|
|
15972
|
+
const durajsonPath = join10(projectDir, "dura.json");
|
|
15973
|
+
const testjsonPath = join10(projectDir, "dura.test.json");
|
|
15720
15974
|
let fromDuraJson = {};
|
|
15721
15975
|
let fromTestJson = {};
|
|
15722
15976
|
let mocks;
|
|
15723
|
-
if (
|
|
15977
|
+
if (existsSync9(durajsonPath)) {
|
|
15724
15978
|
try {
|
|
15725
15979
|
const raw = JSON.parse(readFileSync7(durajsonPath, "utf-8"));
|
|
15726
15980
|
if (raw["snapshots"] && typeof raw["snapshots"] === "object" && !Array.isArray(raw["snapshots"])) {
|
|
@@ -15728,7 +15982,7 @@ function readSnapshotConfig(projectDir) {
|
|
|
15728
15982
|
}
|
|
15729
15983
|
} catch {}
|
|
15730
15984
|
}
|
|
15731
|
-
if (
|
|
15985
|
+
if (existsSync9(testjsonPath)) {
|
|
15732
15986
|
try {
|
|
15733
15987
|
const raw = JSON.parse(readFileSync7(testjsonPath, "utf-8"));
|
|
15734
15988
|
if (raw["snapshots"] && typeof raw["snapshots"] === "object" && !Array.isArray(raw["snapshots"])) {
|
|
@@ -16730,19 +16984,19 @@ __export(exports_export, {
|
|
|
16730
16984
|
collectExportFiles: () => collectExportFiles
|
|
16731
16985
|
});
|
|
16732
16986
|
import {
|
|
16733
|
-
existsSync as
|
|
16987
|
+
existsSync as existsSync10,
|
|
16734
16988
|
readFileSync as readFileSync8,
|
|
16735
16989
|
readdirSync as readdirSync3,
|
|
16736
16990
|
statSync,
|
|
16737
|
-
writeFileSync as
|
|
16991
|
+
writeFileSync as writeFileSync8
|
|
16738
16992
|
} from "node:fs";
|
|
16739
|
-
import { join as
|
|
16993
|
+
import { join as join11, relative, resolve as resolve4 } from "node:path";
|
|
16740
16994
|
function collectExportFiles(baseDir, currentDir) {
|
|
16741
16995
|
const dir = currentDir ?? baseDir;
|
|
16742
16996
|
const entries = [];
|
|
16743
16997
|
const items = readdirSync3(dir);
|
|
16744
16998
|
for (const item of items) {
|
|
16745
|
-
const fullPath =
|
|
16999
|
+
const fullPath = join11(dir, item);
|
|
16746
17000
|
const relPath = relative(baseDir, fullPath);
|
|
16747
17001
|
const stat = statSync(fullPath);
|
|
16748
17002
|
if (stat.isDirectory()) {
|
|
@@ -16775,8 +17029,8 @@ function registerExportCommand(program2) {
|
|
|
16775
17029
|
program2.command("export").description("Export project source + config into a portable archive").option("--dir <path>", "Project directory", ".").option("--output <path>", "Output file path").action(async (opts, cmd) => {
|
|
16776
17030
|
const output = getOutput(cmd);
|
|
16777
17031
|
const projectDir = resolve4(opts.dir ?? ".");
|
|
16778
|
-
const manifestPath =
|
|
16779
|
-
if (!
|
|
17032
|
+
const manifestPath = join11(projectDir, "dura.json");
|
|
17033
|
+
if (!existsSync10(manifestPath)) {
|
|
16780
17034
|
output.error("EXPORT_NO_MANIFEST", "No dura.json found in project directory", "Run this command from a dura project directory or use --dir");
|
|
16781
17035
|
return;
|
|
16782
17036
|
}
|
|
@@ -16796,9 +17050,9 @@ function registerExportCommand(program2) {
|
|
|
16796
17050
|
return;
|
|
16797
17051
|
}
|
|
16798
17052
|
const archive = createArchive(projectName, files);
|
|
16799
|
-
const outputPath = opts.output ??
|
|
17053
|
+
const outputPath = opts.output ?? join11(projectDir, `${projectName}-export.json`);
|
|
16800
17054
|
try {
|
|
16801
|
-
|
|
17055
|
+
writeFileSync8(outputPath, archive, "utf-8");
|
|
16802
17056
|
} catch (err) {
|
|
16803
17057
|
output.error("EXPORT_FAILED", `Failed to write archive: ${err instanceof Error ? err.message : String(err)}`);
|
|
16804
17058
|
return;
|
|
@@ -17725,27 +17979,27 @@ __export(exports_create, {
|
|
|
17725
17979
|
registerAddCommand: () => registerAddCommand
|
|
17726
17980
|
});
|
|
17727
17981
|
import {
|
|
17728
|
-
existsSync as
|
|
17729
|
-
mkdirSync as
|
|
17730
|
-
writeFileSync as
|
|
17982
|
+
existsSync as existsSync11,
|
|
17983
|
+
mkdirSync as mkdirSync6,
|
|
17984
|
+
writeFileSync as writeFileSync9,
|
|
17731
17985
|
readFileSync as readFileSync9,
|
|
17732
17986
|
readdirSync as readdirSync4
|
|
17733
17987
|
} from "node:fs";
|
|
17734
|
-
import { join as
|
|
17988
|
+
import { join as join12, resolve as resolve5, dirname as dirname2 } from "node:path";
|
|
17735
17989
|
function slugifyDescription(description) {
|
|
17736
17990
|
return description.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 30).replace(/-+$/, "");
|
|
17737
17991
|
}
|
|
17738
17992
|
function getExistingRoutes(projectDir) {
|
|
17739
|
-
const routesDir =
|
|
17740
|
-
const jobsDir =
|
|
17993
|
+
const routesDir = join12(projectDir, "routes");
|
|
17994
|
+
const jobsDir = join12(projectDir, "jobs");
|
|
17741
17995
|
const routes = [];
|
|
17742
|
-
if (
|
|
17996
|
+
if (existsSync11(routesDir)) {
|
|
17743
17997
|
try {
|
|
17744
17998
|
const files = readdirSync4(routesDir);
|
|
17745
17999
|
routes.push(...files.map((f) => `routes/${f}`));
|
|
17746
18000
|
} catch {}
|
|
17747
18001
|
}
|
|
17748
|
-
if (
|
|
18002
|
+
if (existsSync11(jobsDir)) {
|
|
17749
18003
|
try {
|
|
17750
18004
|
const files = readdirSync4(jobsDir);
|
|
17751
18005
|
routes.push(...files.map((f) => `jobs/${f}`));
|
|
@@ -17755,12 +18009,12 @@ function getExistingRoutes(projectDir) {
|
|
|
17755
18009
|
}
|
|
17756
18010
|
function writeGeneratedFiles(projectDir, files) {
|
|
17757
18011
|
for (const file of files) {
|
|
17758
|
-
const filePath =
|
|
17759
|
-
const dir =
|
|
17760
|
-
if (!
|
|
17761
|
-
|
|
18012
|
+
const filePath = join12(projectDir, file.path);
|
|
18013
|
+
const dir = dirname2(filePath);
|
|
18014
|
+
if (!existsSync11(dir)) {
|
|
18015
|
+
mkdirSync6(dir, { recursive: true });
|
|
17762
18016
|
}
|
|
17763
|
-
|
|
18017
|
+
writeFileSync9(filePath, file.content, "utf-8");
|
|
17764
18018
|
}
|
|
17765
18019
|
}
|
|
17766
18020
|
async function confirm(question) {
|
|
@@ -17789,8 +18043,8 @@ function registerCreateCommand(program2) {
|
|
|
17789
18043
|
}
|
|
17790
18044
|
const projectName = opts.name || slugifyDescription(description);
|
|
17791
18045
|
const parentDir = opts.dir ? resolve5(opts.dir) : process.cwd();
|
|
17792
|
-
const projectDir =
|
|
17793
|
-
if (
|
|
18046
|
+
const projectDir = join12(parentDir, projectName);
|
|
18047
|
+
if (existsSync11(projectDir)) {
|
|
17794
18048
|
output.error("DIRECTORY_EXISTS", `Directory "${projectName}" already exists`, "Choose a different name with --name or remove the existing directory");
|
|
17795
18049
|
return;
|
|
17796
18050
|
}
|
|
@@ -17819,8 +18073,8 @@ function registerCreateCommand(program2) {
|
|
|
17819
18073
|
return;
|
|
17820
18074
|
}
|
|
17821
18075
|
}
|
|
17822
|
-
|
|
17823
|
-
|
|
18076
|
+
mkdirSync6(join12(projectDir, "routes"), { recursive: true });
|
|
18077
|
+
mkdirSync6(join12(projectDir, "jobs"), { recursive: true });
|
|
17824
18078
|
writeGeneratedFiles(projectDir, generateResult.files);
|
|
17825
18079
|
output.info(`Files written to ${projectDir}`);
|
|
17826
18080
|
if (opts.deploy !== false) {
|
|
@@ -17851,8 +18105,8 @@ function registerAddCommand(program2) {
|
|
|
17851
18105
|
return;
|
|
17852
18106
|
}
|
|
17853
18107
|
const projectDir = opts.dir ? resolve5(opts.dir) : process.cwd();
|
|
17854
|
-
const duraJsonPath =
|
|
17855
|
-
if (!
|
|
18108
|
+
const duraJsonPath = join12(projectDir, "dura.json");
|
|
18109
|
+
if (!existsSync11(duraJsonPath)) {
|
|
17856
18110
|
output.error("NOT_A_DURA_PROJECT", "No dura.json found in the current directory", "Run this command from a dura project directory or use --dir");
|
|
17857
18111
|
return;
|
|
17858
18112
|
}
|
|
@@ -19048,31 +19302,31 @@ var init_heal = __esm(() => {
|
|
|
19048
19302
|
});
|
|
19049
19303
|
|
|
19050
19304
|
// src/lib/skill-installer.ts
|
|
19051
|
-
import { existsSync as
|
|
19052
|
-
import { join as
|
|
19305
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync7, readFileSync as readFileSync10, writeFileSync as writeFileSync10 } from "node:fs";
|
|
19306
|
+
import { join as join13, dirname as dirname3 } from "node:path";
|
|
19053
19307
|
import { homedir as homedir2 } from "node:os";
|
|
19054
19308
|
import { fileURLToPath } from "node:url";
|
|
19055
19309
|
function getSkillSourceDir() {
|
|
19056
19310
|
const __filename2 = fileURLToPath(import.meta.url);
|
|
19057
|
-
return
|
|
19311
|
+
return join13(dirname3(dirname3(__filename2)), "skills");
|
|
19058
19312
|
}
|
|
19059
19313
|
function getGlobalSkillsDir() {
|
|
19060
|
-
return
|
|
19314
|
+
return join13(homedir2(), ".claude", "skills", "dura");
|
|
19061
19315
|
}
|
|
19062
19316
|
function getLocalSkillsDir(projectDir) {
|
|
19063
|
-
return
|
|
19317
|
+
return join13(projectDir, ".claude", "skills", "dura");
|
|
19064
19318
|
}
|
|
19065
19319
|
function installSkills(targetDir) {
|
|
19066
19320
|
const sourceDir = getSkillSourceDir();
|
|
19067
|
-
if (!
|
|
19068
|
-
|
|
19321
|
+
if (!existsSync12(targetDir)) {
|
|
19322
|
+
mkdirSync7(targetDir, { recursive: true });
|
|
19069
19323
|
}
|
|
19070
19324
|
const installedFiles = [];
|
|
19071
19325
|
for (const file of SKILL_FILES) {
|
|
19072
|
-
const sourcePath =
|
|
19073
|
-
const targetPath =
|
|
19326
|
+
const sourcePath = join13(sourceDir, file);
|
|
19327
|
+
const targetPath = join13(targetDir, file);
|
|
19074
19328
|
const content = readFileSync10(sourcePath, "utf-8");
|
|
19075
|
-
|
|
19329
|
+
writeFileSync10(targetPath, content, "utf-8");
|
|
19076
19330
|
installedFiles.push(targetPath);
|
|
19077
19331
|
}
|
|
19078
19332
|
return {
|
|
@@ -19096,8 +19350,8 @@ var exports_init = {};
|
|
|
19096
19350
|
__export(exports_init, {
|
|
19097
19351
|
registerInitCommand: () => registerInitCommand
|
|
19098
19352
|
});
|
|
19099
|
-
import { existsSync as
|
|
19100
|
-
import { join as
|
|
19353
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync8, writeFileSync as writeFileSync11 } from "node:fs";
|
|
19354
|
+
import { join as join14, resolve as resolve6, basename } from "node:path";
|
|
19101
19355
|
function registerInitCommand(program2) {
|
|
19102
19356
|
program2.command("init").description("Initialize a dura project in the current directory and install AI agent skills").option("--dir <path>", "Project directory (defaults to current dir)").option("--name <name>", "Project name (defaults to directory name)").option("--global", "Install AI agent skills globally (~/.claude/skills/dura/)").option("--local", "Install AI agent skills locally (.claude/skills/dura/)").option("--skip-skills", "Skip AI agent skill installation").action(async (opts, cmd) => {
|
|
19103
19357
|
const output = getOutput(cmd);
|
|
@@ -19107,24 +19361,24 @@ function registerInitCommand(program2) {
|
|
|
19107
19361
|
output.error("INVALID_NAME", `Invalid project name "${projectName}"`, "Project name must start with a letter and contain only letters, numbers, hyphens, and underscores. Use --name to specify a valid name.");
|
|
19108
19362
|
return;
|
|
19109
19363
|
}
|
|
19110
|
-
|
|
19111
|
-
|
|
19112
|
-
const manifestPath =
|
|
19113
|
-
const alreadyInitialized =
|
|
19364
|
+
mkdirSync8(join14(projectDir, "routes"), { recursive: true });
|
|
19365
|
+
mkdirSync8(join14(projectDir, "jobs"), { recursive: true });
|
|
19366
|
+
const manifestPath = join14(projectDir, "dura.json");
|
|
19367
|
+
const alreadyInitialized = existsSync13(manifestPath);
|
|
19114
19368
|
if (!alreadyInitialized) {
|
|
19115
|
-
|
|
19369
|
+
writeFileSync11(manifestPath, duraJsonTemplate(projectName));
|
|
19116
19370
|
} else {
|
|
19117
19371
|
output.info(`dura.json already exists in ${projectDir} — leaving it in place.`);
|
|
19118
19372
|
}
|
|
19119
|
-
const helloPath =
|
|
19120
|
-
if (
|
|
19373
|
+
const helloPath = join14(projectDir, "routes", "hello.ts");
|
|
19374
|
+
if (existsSync13(helloPath)) {
|
|
19121
19375
|
output.warn("routes/hello.ts already exists — skipping");
|
|
19122
19376
|
} else {
|
|
19123
|
-
|
|
19377
|
+
writeFileSync11(helloPath, HELLO_TEMPLATE);
|
|
19124
19378
|
}
|
|
19125
|
-
const gitignorePath =
|
|
19126
|
-
if (!
|
|
19127
|
-
|
|
19379
|
+
const gitignorePath = join14(projectDir, ".gitignore");
|
|
19380
|
+
if (!existsSync13(gitignorePath)) {
|
|
19381
|
+
writeFileSync11(gitignorePath, GITIGNORE_CONTENT2);
|
|
19128
19382
|
}
|
|
19129
19383
|
if (alreadyInitialized) {
|
|
19130
19384
|
output.info(`Re-checked dura project "${projectName}" in ${projectDir}`);
|
|
@@ -19386,7 +19640,7 @@ async function registerAllCommands(program2) {
|
|
|
19386
19640
|
registerOpenApiCommand2(program2);
|
|
19387
19641
|
return program2;
|
|
19388
19642
|
}
|
|
19389
|
-
var CLI_VERSION = "0.
|
|
19643
|
+
var CLI_VERSION = "0.3.0";
|
|
19390
19644
|
var init_src3 = __esm(() => {
|
|
19391
19645
|
init_esm();
|
|
19392
19646
|
if (import.meta.url === `file://${realpathSync(process.argv[1] ?? "").replace(/\\/g, "/")}`) {
|
|
@@ -19403,4 +19657,4 @@ export {
|
|
|
19403
19657
|
CLI_VERSION
|
|
19404
19658
|
};
|
|
19405
19659
|
|
|
19406
|
-
//# debugId=
|
|
19660
|
+
//# debugId=4BAA174E1BA4BE2C64756E2164756E21
|