@lunora/cli 1.0.0-alpha.462 → 1.0.0-alpha.463
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +76 -55
- package/dist/index.d.ts +76 -55
- package/dist/index.mjs +1 -1
- package/dist/packem_chunks/cli.mjs +2 -2
- package/dist/packem_chunks/dispatch.mjs +1 -1
- package/dist/packem_chunks/handler.mjs +10 -10
- package/dist/packem_chunks/handler12.mjs +1 -1
- package/dist/packem_chunks/handler15.mjs +2 -2
- package/dist/packem_chunks/handler17.mjs +1 -1
- package/dist/packem_chunks/handler24.mjs +3 -3
- package/dist/packem_chunks/handler6.mjs +1 -1
- package/dist/packem_chunks/handler7.mjs +1 -1
- package/dist/packem_chunks/runInitCommand.mjs +87 -63
- package/dist/packem_shared/DEFAULT_IMPORT_BATCH_SIZE-CyOfZWMk.mjs +1 -0
- package/dist/packem_shared/export-rows-EzdNDYpa.mjs +3 -0
- package/dist/packem_shared/health-probe-BLnoq_oC.mjs +13 -0
- package/dist/packem_shared/import-C-XRRHrZ.mjs +13 -0
- package/dist/packem_shared/runDeployCommand-2tEbutD6.mjs +1 -0
- package/dist/packem_shared/runExportCommand-Dy6pSX68.mjs +5 -0
- package/dist/packem_shared/{runMigrateGenerateCommand-Bd2W9t1k.mjs → runMigrateGenerateCommand-CFy3hXXu.mjs} +3 -3
- package/dist/packem_shared/shared-CV7ESvuj.mjs +2 -0
- package/package.json +9 -8
- package/skills/lunora-deploy/SKILL.md +18 -17
- package/skills/lunora-migration-helper/SKILL.md +25 -11
- package/dist/packem_shared/DEFAULT_IMPORT_BATCH_SIZE-5xxKz-zB.mjs +0 -1
- package/dist/packem_shared/health-probe-Bw9JFfIy.mjs +0 -1
- package/dist/packem_shared/import-DoAUdyfU.mjs +0 -13
- package/dist/packem_shared/runDeployCommand-Tgy9tGRV.mjs +0 -1
- package/dist/packem_shared/runExportCommand-DiMCQ-Il.mjs +0 -5
- package/dist/packem_shared/shared-D-zCOmgY.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -201,6 +201,31 @@ interface ImportShardFailure {
|
|
|
201
201
|
shardKey: string;
|
|
202
202
|
timedOut: boolean;
|
|
203
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* How an import treats the rows a target already holds:
|
|
206
|
+
*
|
|
207
|
+
* - `append` — insert; a row whose `_id` exists is a conflict left unchanged.
|
|
208
|
+
* - `upsert` — insert; a row whose `_id` exists is overwritten.
|
|
209
|
+
* - `replace` — `upsert`, then delete every stored row of the file's tables whose
|
|
210
|
+
* `_id` the file lacks, so each table ends up holding exactly the file's rows.
|
|
211
|
+
* Tables the file does not name are never touched.
|
|
212
|
+
* - `require-empty` — refuse unless the file's tables hold no rows at all.
|
|
213
|
+
*/
|
|
214
|
+
type ImportMode = "append" | "replace" | "require-empty" | "upsert";
|
|
215
|
+
interface TablePlan {
|
|
216
|
+
/** File rows whose `_id` the target does not hold (or that carry none). */
|
|
217
|
+
add: number;
|
|
218
|
+
/** Stored rows the file lacks, which `replace` deletes. Zero for every other mode. */
|
|
219
|
+
delete: number;
|
|
220
|
+
/** File rows whose `_id` the target already holds: conflicts under `append`, overwritten under `upsert`/`replace`. */
|
|
221
|
+
existing: number;
|
|
222
|
+
/** Stored rows an `_id` of the file matches, which an overwrite changes. Repeats within the file are in `existing`, not here. */
|
|
223
|
+
matched: number;
|
|
224
|
+
source: number;
|
|
225
|
+
table: string;
|
|
226
|
+
/** Rows the target holds in this table now. */
|
|
227
|
+
target: number;
|
|
228
|
+
}
|
|
204
229
|
/**
|
|
205
230
|
* The sources `--from` accepts.
|
|
206
231
|
*
|
|
@@ -256,7 +281,11 @@ declare const DEFAULT_IMPORT_BATCH_SIZE = 500;
|
|
|
256
281
|
interface ImportCommandOptions {
|
|
257
282
|
/** Rows per HTTP request. Defaults to {@link DEFAULT_IMPORT_BATCH_SIZE}. */
|
|
258
283
|
batchSize?: number;
|
|
284
|
+
/** Ask before overwriting or deleting stored rows. Defaults to the TUI prompt on a TTY. Returns `true` on confirmation. */
|
|
285
|
+
confirm?: (prompt: string) => Promise<boolean>;
|
|
259
286
|
cwd?: string;
|
|
287
|
+
/** Check the file and print the plan against the target's rows; write nothing. */
|
|
288
|
+
dryRun?: boolean;
|
|
260
289
|
fetchImpl?: StreamingFetchLike;
|
|
261
290
|
/** Source NDJSON file. Required. */
|
|
262
291
|
file: string;
|
|
@@ -270,12 +299,9 @@ interface ImportCommandOptions {
|
|
|
270
299
|
*/
|
|
271
300
|
from?: ImportSourceName;
|
|
272
301
|
logger: Logger;
|
|
302
|
+
/** How the rows the target already holds are treated. Defaults to `append`; see {@link ImportMode}. */
|
|
303
|
+
mode?: ImportMode;
|
|
273
304
|
prod?: boolean;
|
|
274
|
-
/**
|
|
275
|
-
* Overwrite rows whose `_id` already exists in the target instead of
|
|
276
|
-
* reporting them as conflicts (`?onConflict=replace`).
|
|
277
|
-
*/
|
|
278
|
-
replace?: boolean;
|
|
279
305
|
/**
|
|
280
306
|
* Scan the export for columns holding `_storage` ids and write a candidate
|
|
281
307
|
* `lunora/import-convex.json`. Scan-only: nothing is imported.
|
|
@@ -319,12 +345,16 @@ interface ImportCommandOptions {
|
|
|
319
345
|
*/
|
|
320
346
|
interface ImportSummary {
|
|
321
347
|
conflicts: number;
|
|
348
|
+
/** Stored rows `--mode replace` deleted because the file lacks them. */
|
|
349
|
+
deleted: number;
|
|
322
350
|
errors: ImportRowError[];
|
|
323
351
|
/** Shards the endpoint could not reach (it answered 207). Their rows are MISSING, not rejected — present only when non-empty. */
|
|
324
352
|
failed?: ImportShardFailure[];
|
|
325
353
|
inserted: Record<string, number>;
|
|
354
|
+
/** What the run planned against the target's rows, per table. Present for every mode but `append` and for `--dry-run`. */
|
|
355
|
+
plan?: TablePlan[];
|
|
326
356
|
received: number;
|
|
327
|
-
/** Existing rows overwritten under `--replace`. */
|
|
357
|
+
/** Existing rows overwritten under `--mode upsert` / `--mode replace`. */
|
|
328
358
|
replaced: number;
|
|
329
359
|
storage?: {
|
|
330
360
|
/** Up to {@link UNRESOLVED_REPORT_LIMIT} distinct references — a sample, not the whole set. See `ambiguousTotal`. */
|
|
@@ -351,7 +381,7 @@ interface ImportCommandResult extends CommandResult<ImportCommandData> {
|
|
|
351
381
|
body: ImportSummary | undefined;
|
|
352
382
|
/** Total inserted rows across batches. */
|
|
353
383
|
inserted: number;
|
|
354
|
-
/** Existing rows overwritten under `--replace`; absent when the run wrote nothing. */
|
|
384
|
+
/** Existing rows overwritten under `--mode upsert` / `--mode replace`; absent when the run wrote nothing. */
|
|
355
385
|
replaced?: number;
|
|
356
386
|
}
|
|
357
387
|
declare const runImportCommand: (options: ImportCommandOptions) => Promise<ImportCommandResult>;
|
|
@@ -521,41 +551,6 @@ interface ListRemoteSecretsResult {
|
|
|
521
551
|
/** False when wrangler failed or its output could not be parsed. */
|
|
522
552
|
ok: boolean;
|
|
523
553
|
}
|
|
524
|
-
type FetchLike = (input: string, init?: {
|
|
525
|
-
body?: string;
|
|
526
|
-
headers?: Record<string, string>;
|
|
527
|
-
method?: string;
|
|
528
|
-
}) => Promise<{
|
|
529
|
-
json: () => Promise<unknown>;
|
|
530
|
-
ok: boolean;
|
|
531
|
-
status: number;
|
|
532
|
-
text: () => Promise<string>;
|
|
533
|
-
}>;
|
|
534
|
-
interface RunCommandOptions {
|
|
535
|
-
args?: string;
|
|
536
|
-
/** Forge this user id for the call (dispatches through the admin-gated `runAs` op). */
|
|
537
|
-
as?: string;
|
|
538
|
-
/** JSON-encoded extra identity claims to accompany {@link RunCommandOptions.as}. */
|
|
539
|
-
claims?: string;
|
|
540
|
-
cwd?: string;
|
|
541
|
-
fetchImpl?: FetchLike;
|
|
542
|
-
/** Output format: `pretty` (default) or `json`. */
|
|
543
|
-
format?: OutputFormat;
|
|
544
|
-
functionPath: string;
|
|
545
|
-
logger: Logger;
|
|
546
|
-
shard?: string;
|
|
547
|
-
/** Admin bearer for the `runAs` dispatch; resolved from the environment / `.dev.vars` when absent. */
|
|
548
|
-
token?: string;
|
|
549
|
-
url?: string;
|
|
550
|
-
}
|
|
551
|
-
interface RunCommandResult {
|
|
552
|
-
body: unknown;
|
|
553
|
-
code: number;
|
|
554
|
-
/** Why the call failed before (or at) the RPC, for the `--format json` envelope. */
|
|
555
|
-
error?: string;
|
|
556
|
-
requestUrl: string;
|
|
557
|
-
}
|
|
558
|
-
declare const runRpcCommand: (options: RunCommandOptions) => Promise<RunCommandResult>;
|
|
559
554
|
interface DeployCommandOptions {
|
|
560
555
|
/** Deploy even though the app enables the open-shard option (the `open_shard_access` gate). */
|
|
561
556
|
allowOpenShards?: boolean;
|
|
@@ -605,8 +600,8 @@ interface DeployCommandOptions {
|
|
|
605
600
|
*/
|
|
606
601
|
emitBindings?: string;
|
|
607
602
|
env?: string;
|
|
608
|
-
/** Fetch implementation injected in tests for `--migrate` RPC calls. */
|
|
609
|
-
fetchImpl?:
|
|
603
|
+
/** Fetch implementation injected in tests for `--migrate` RPC calls and the drift gate's stored-row read. */
|
|
604
|
+
fetchImpl?: StreamingFetchLike;
|
|
610
605
|
/** Output format: `pretty` (default) or `json`. */
|
|
611
606
|
format?: OutputFormat;
|
|
612
607
|
/**
|
|
@@ -670,12 +665,7 @@ interface DeployCommandOptions {
|
|
|
670
665
|
* `<outDir>/bundle-meta.json`. When unset, no artifact is written.
|
|
671
666
|
*/
|
|
672
667
|
outDir?: string;
|
|
673
|
-
/**
|
|
674
|
-
* Upload a preview version (`wrangler versions upload`) instead of a live
|
|
675
|
-
* `wrangler deploy`. Codegen + the drift gate + validation still run, but
|
|
676
|
-
* the post-deploy finalize (migrations, baseline re-bless, auto-link, the
|
|
677
|
-
* production summary) is skipped — a preview never shifts live traffic.
|
|
678
|
-
*/
|
|
668
|
+
/** Refused on every target (see `PREVIEW_REFUSAL` in the handler); kept as an option so the refusal can say why. */
|
|
679
669
|
preview?: boolean;
|
|
680
670
|
/** Railpack-availability probe injected in tests. Defaults to a real `railpack --version` + `BUILDKIT_HOST` check. */
|
|
681
671
|
railpackAvailable?: DockerProbe;
|
|
@@ -725,14 +715,12 @@ interface DeployCommandOptions {
|
|
|
725
715
|
* global API key), so we pass the flag straight through without guarding.
|
|
726
716
|
*/
|
|
727
717
|
temporary?: boolean;
|
|
728
|
-
/** Re-bless the committed schema baseline with the current shape (accepts breaking drift). */
|
|
729
|
-
updateSchemaBaseline?: boolean;
|
|
730
718
|
}
|
|
731
719
|
/**
|
|
732
720
|
* What this run put where — the identity of the thing that was just deployed.
|
|
733
721
|
*
|
|
734
722
|
* Present on every run that reached (and completed) the wrangler invocation,
|
|
735
|
-
* including `--dry-run
|
|
723
|
+
* including `--dry-run`, so a consumer can tell "nothing went
|
|
736
724
|
* live" from "went live" without inferring it from a missing `url`. A dry run
|
|
737
725
|
* publishes nothing and therefore never carries a `url`.
|
|
738
726
|
*
|
|
@@ -749,8 +737,6 @@ interface DeployedIdentity {
|
|
|
749
737
|
dryRun: boolean;
|
|
750
738
|
/** The Cloudflare environment this run targeted, when `--env` named one. */
|
|
751
739
|
env?: string;
|
|
752
|
-
/** True when `--preview` uploaded a version instead of shifting live traffic. */
|
|
753
|
-
preview: boolean;
|
|
754
740
|
/** The URL wrangler reported publishing to; absent on a dry run, or when the output carried no URL. */
|
|
755
741
|
url?: string;
|
|
756
742
|
/** The Worker name from the project's wrangler config. */
|
|
@@ -1542,6 +1528,41 @@ interface InitCommandResult {
|
|
|
1542
1528
|
* scaffold's exit code.
|
|
1543
1529
|
*/
|
|
1544
1530
|
declare const runInitCommand: (options: InitCommandOptions) => Promise<InitCommandResult>;
|
|
1531
|
+
type FetchLike = (input: string, init?: {
|
|
1532
|
+
body?: string;
|
|
1533
|
+
headers?: Record<string, string>;
|
|
1534
|
+
method?: string;
|
|
1535
|
+
}) => Promise<{
|
|
1536
|
+
json: () => Promise<unknown>;
|
|
1537
|
+
ok: boolean;
|
|
1538
|
+
status: number;
|
|
1539
|
+
text: () => Promise<string>;
|
|
1540
|
+
}>;
|
|
1541
|
+
interface RunCommandOptions {
|
|
1542
|
+
args?: string;
|
|
1543
|
+
/** Forge this user id for the call (dispatches through the admin-gated `runAs` op). */
|
|
1544
|
+
as?: string;
|
|
1545
|
+
/** JSON-encoded extra identity claims to accompany {@link RunCommandOptions.as}. */
|
|
1546
|
+
claims?: string;
|
|
1547
|
+
cwd?: string;
|
|
1548
|
+
fetchImpl?: FetchLike;
|
|
1549
|
+
/** Output format: `pretty` (default) or `json`. */
|
|
1550
|
+
format?: OutputFormat;
|
|
1551
|
+
functionPath: string;
|
|
1552
|
+
logger: Logger;
|
|
1553
|
+
shard?: string;
|
|
1554
|
+
/** Admin bearer for the `runAs` dispatch; resolved from the environment / `.dev.vars` when absent. */
|
|
1555
|
+
token?: string;
|
|
1556
|
+
url?: string;
|
|
1557
|
+
}
|
|
1558
|
+
interface RunCommandResult {
|
|
1559
|
+
body: unknown;
|
|
1560
|
+
code: number;
|
|
1561
|
+
/** Why the call failed before (or at) the RPC, for the `--format json` envelope. */
|
|
1562
|
+
error?: string;
|
|
1563
|
+
requestUrl: string;
|
|
1564
|
+
}
|
|
1565
|
+
declare const runRpcCommand: (options: RunCommandOptions) => Promise<RunCommandResult>;
|
|
1545
1566
|
interface MigrateGenerateCommandOptions {
|
|
1546
1567
|
cwd?: string;
|
|
1547
1568
|
logger: Logger;
|
package/dist/index.d.ts
CHANGED
|
@@ -201,6 +201,31 @@ interface ImportShardFailure {
|
|
|
201
201
|
shardKey: string;
|
|
202
202
|
timedOut: boolean;
|
|
203
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* How an import treats the rows a target already holds:
|
|
206
|
+
*
|
|
207
|
+
* - `append` — insert; a row whose `_id` exists is a conflict left unchanged.
|
|
208
|
+
* - `upsert` — insert; a row whose `_id` exists is overwritten.
|
|
209
|
+
* - `replace` — `upsert`, then delete every stored row of the file's tables whose
|
|
210
|
+
* `_id` the file lacks, so each table ends up holding exactly the file's rows.
|
|
211
|
+
* Tables the file does not name are never touched.
|
|
212
|
+
* - `require-empty` — refuse unless the file's tables hold no rows at all.
|
|
213
|
+
*/
|
|
214
|
+
type ImportMode = "append" | "replace" | "require-empty" | "upsert";
|
|
215
|
+
interface TablePlan {
|
|
216
|
+
/** File rows whose `_id` the target does not hold (or that carry none). */
|
|
217
|
+
add: number;
|
|
218
|
+
/** Stored rows the file lacks, which `replace` deletes. Zero for every other mode. */
|
|
219
|
+
delete: number;
|
|
220
|
+
/** File rows whose `_id` the target already holds: conflicts under `append`, overwritten under `upsert`/`replace`. */
|
|
221
|
+
existing: number;
|
|
222
|
+
/** Stored rows an `_id` of the file matches, which an overwrite changes. Repeats within the file are in `existing`, not here. */
|
|
223
|
+
matched: number;
|
|
224
|
+
source: number;
|
|
225
|
+
table: string;
|
|
226
|
+
/** Rows the target holds in this table now. */
|
|
227
|
+
target: number;
|
|
228
|
+
}
|
|
204
229
|
/**
|
|
205
230
|
* The sources `--from` accepts.
|
|
206
231
|
*
|
|
@@ -256,7 +281,11 @@ declare const DEFAULT_IMPORT_BATCH_SIZE = 500;
|
|
|
256
281
|
interface ImportCommandOptions {
|
|
257
282
|
/** Rows per HTTP request. Defaults to {@link DEFAULT_IMPORT_BATCH_SIZE}. */
|
|
258
283
|
batchSize?: number;
|
|
284
|
+
/** Ask before overwriting or deleting stored rows. Defaults to the TUI prompt on a TTY. Returns `true` on confirmation. */
|
|
285
|
+
confirm?: (prompt: string) => Promise<boolean>;
|
|
259
286
|
cwd?: string;
|
|
287
|
+
/** Check the file and print the plan against the target's rows; write nothing. */
|
|
288
|
+
dryRun?: boolean;
|
|
260
289
|
fetchImpl?: StreamingFetchLike;
|
|
261
290
|
/** Source NDJSON file. Required. */
|
|
262
291
|
file: string;
|
|
@@ -270,12 +299,9 @@ interface ImportCommandOptions {
|
|
|
270
299
|
*/
|
|
271
300
|
from?: ImportSourceName;
|
|
272
301
|
logger: Logger;
|
|
302
|
+
/** How the rows the target already holds are treated. Defaults to `append`; see {@link ImportMode}. */
|
|
303
|
+
mode?: ImportMode;
|
|
273
304
|
prod?: boolean;
|
|
274
|
-
/**
|
|
275
|
-
* Overwrite rows whose `_id` already exists in the target instead of
|
|
276
|
-
* reporting them as conflicts (`?onConflict=replace`).
|
|
277
|
-
*/
|
|
278
|
-
replace?: boolean;
|
|
279
305
|
/**
|
|
280
306
|
* Scan the export for columns holding `_storage` ids and write a candidate
|
|
281
307
|
* `lunora/import-convex.json`. Scan-only: nothing is imported.
|
|
@@ -319,12 +345,16 @@ interface ImportCommandOptions {
|
|
|
319
345
|
*/
|
|
320
346
|
interface ImportSummary {
|
|
321
347
|
conflicts: number;
|
|
348
|
+
/** Stored rows `--mode replace` deleted because the file lacks them. */
|
|
349
|
+
deleted: number;
|
|
322
350
|
errors: ImportRowError[];
|
|
323
351
|
/** Shards the endpoint could not reach (it answered 207). Their rows are MISSING, not rejected — present only when non-empty. */
|
|
324
352
|
failed?: ImportShardFailure[];
|
|
325
353
|
inserted: Record<string, number>;
|
|
354
|
+
/** What the run planned against the target's rows, per table. Present for every mode but `append` and for `--dry-run`. */
|
|
355
|
+
plan?: TablePlan[];
|
|
326
356
|
received: number;
|
|
327
|
-
/** Existing rows overwritten under `--replace`. */
|
|
357
|
+
/** Existing rows overwritten under `--mode upsert` / `--mode replace`. */
|
|
328
358
|
replaced: number;
|
|
329
359
|
storage?: {
|
|
330
360
|
/** Up to {@link UNRESOLVED_REPORT_LIMIT} distinct references — a sample, not the whole set. See `ambiguousTotal`. */
|
|
@@ -351,7 +381,7 @@ interface ImportCommandResult extends CommandResult<ImportCommandData> {
|
|
|
351
381
|
body: ImportSummary | undefined;
|
|
352
382
|
/** Total inserted rows across batches. */
|
|
353
383
|
inserted: number;
|
|
354
|
-
/** Existing rows overwritten under `--replace`; absent when the run wrote nothing. */
|
|
384
|
+
/** Existing rows overwritten under `--mode upsert` / `--mode replace`; absent when the run wrote nothing. */
|
|
355
385
|
replaced?: number;
|
|
356
386
|
}
|
|
357
387
|
declare const runImportCommand: (options: ImportCommandOptions) => Promise<ImportCommandResult>;
|
|
@@ -521,41 +551,6 @@ interface ListRemoteSecretsResult {
|
|
|
521
551
|
/** False when wrangler failed or its output could not be parsed. */
|
|
522
552
|
ok: boolean;
|
|
523
553
|
}
|
|
524
|
-
type FetchLike = (input: string, init?: {
|
|
525
|
-
body?: string;
|
|
526
|
-
headers?: Record<string, string>;
|
|
527
|
-
method?: string;
|
|
528
|
-
}) => Promise<{
|
|
529
|
-
json: () => Promise<unknown>;
|
|
530
|
-
ok: boolean;
|
|
531
|
-
status: number;
|
|
532
|
-
text: () => Promise<string>;
|
|
533
|
-
}>;
|
|
534
|
-
interface RunCommandOptions {
|
|
535
|
-
args?: string;
|
|
536
|
-
/** Forge this user id for the call (dispatches through the admin-gated `runAs` op). */
|
|
537
|
-
as?: string;
|
|
538
|
-
/** JSON-encoded extra identity claims to accompany {@link RunCommandOptions.as}. */
|
|
539
|
-
claims?: string;
|
|
540
|
-
cwd?: string;
|
|
541
|
-
fetchImpl?: FetchLike;
|
|
542
|
-
/** Output format: `pretty` (default) or `json`. */
|
|
543
|
-
format?: OutputFormat;
|
|
544
|
-
functionPath: string;
|
|
545
|
-
logger: Logger;
|
|
546
|
-
shard?: string;
|
|
547
|
-
/** Admin bearer for the `runAs` dispatch; resolved from the environment / `.dev.vars` when absent. */
|
|
548
|
-
token?: string;
|
|
549
|
-
url?: string;
|
|
550
|
-
}
|
|
551
|
-
interface RunCommandResult {
|
|
552
|
-
body: unknown;
|
|
553
|
-
code: number;
|
|
554
|
-
/** Why the call failed before (or at) the RPC, for the `--format json` envelope. */
|
|
555
|
-
error?: string;
|
|
556
|
-
requestUrl: string;
|
|
557
|
-
}
|
|
558
|
-
declare const runRpcCommand: (options: RunCommandOptions) => Promise<RunCommandResult>;
|
|
559
554
|
interface DeployCommandOptions {
|
|
560
555
|
/** Deploy even though the app enables the open-shard option (the `open_shard_access` gate). */
|
|
561
556
|
allowOpenShards?: boolean;
|
|
@@ -605,8 +600,8 @@ interface DeployCommandOptions {
|
|
|
605
600
|
*/
|
|
606
601
|
emitBindings?: string;
|
|
607
602
|
env?: string;
|
|
608
|
-
/** Fetch implementation injected in tests for `--migrate` RPC calls. */
|
|
609
|
-
fetchImpl?:
|
|
603
|
+
/** Fetch implementation injected in tests for `--migrate` RPC calls and the drift gate's stored-row read. */
|
|
604
|
+
fetchImpl?: StreamingFetchLike;
|
|
610
605
|
/** Output format: `pretty` (default) or `json`. */
|
|
611
606
|
format?: OutputFormat;
|
|
612
607
|
/**
|
|
@@ -670,12 +665,7 @@ interface DeployCommandOptions {
|
|
|
670
665
|
* `<outDir>/bundle-meta.json`. When unset, no artifact is written.
|
|
671
666
|
*/
|
|
672
667
|
outDir?: string;
|
|
673
|
-
/**
|
|
674
|
-
* Upload a preview version (`wrangler versions upload`) instead of a live
|
|
675
|
-
* `wrangler deploy`. Codegen + the drift gate + validation still run, but
|
|
676
|
-
* the post-deploy finalize (migrations, baseline re-bless, auto-link, the
|
|
677
|
-
* production summary) is skipped — a preview never shifts live traffic.
|
|
678
|
-
*/
|
|
668
|
+
/** Refused on every target (see `PREVIEW_REFUSAL` in the handler); kept as an option so the refusal can say why. */
|
|
679
669
|
preview?: boolean;
|
|
680
670
|
/** Railpack-availability probe injected in tests. Defaults to a real `railpack --version` + `BUILDKIT_HOST` check. */
|
|
681
671
|
railpackAvailable?: DockerProbe;
|
|
@@ -725,14 +715,12 @@ interface DeployCommandOptions {
|
|
|
725
715
|
* global API key), so we pass the flag straight through without guarding.
|
|
726
716
|
*/
|
|
727
717
|
temporary?: boolean;
|
|
728
|
-
/** Re-bless the committed schema baseline with the current shape (accepts breaking drift). */
|
|
729
|
-
updateSchemaBaseline?: boolean;
|
|
730
718
|
}
|
|
731
719
|
/**
|
|
732
720
|
* What this run put where — the identity of the thing that was just deployed.
|
|
733
721
|
*
|
|
734
722
|
* Present on every run that reached (and completed) the wrangler invocation,
|
|
735
|
-
* including `--dry-run
|
|
723
|
+
* including `--dry-run`, so a consumer can tell "nothing went
|
|
736
724
|
* live" from "went live" without inferring it from a missing `url`. A dry run
|
|
737
725
|
* publishes nothing and therefore never carries a `url`.
|
|
738
726
|
*
|
|
@@ -749,8 +737,6 @@ interface DeployedIdentity {
|
|
|
749
737
|
dryRun: boolean;
|
|
750
738
|
/** The Cloudflare environment this run targeted, when `--env` named one. */
|
|
751
739
|
env?: string;
|
|
752
|
-
/** True when `--preview` uploaded a version instead of shifting live traffic. */
|
|
753
|
-
preview: boolean;
|
|
754
740
|
/** The URL wrangler reported publishing to; absent on a dry run, or when the output carried no URL. */
|
|
755
741
|
url?: string;
|
|
756
742
|
/** The Worker name from the project's wrangler config. */
|
|
@@ -1542,6 +1528,41 @@ interface InitCommandResult {
|
|
|
1542
1528
|
* scaffold's exit code.
|
|
1543
1529
|
*/
|
|
1544
1530
|
declare const runInitCommand: (options: InitCommandOptions) => Promise<InitCommandResult>;
|
|
1531
|
+
type FetchLike = (input: string, init?: {
|
|
1532
|
+
body?: string;
|
|
1533
|
+
headers?: Record<string, string>;
|
|
1534
|
+
method?: string;
|
|
1535
|
+
}) => Promise<{
|
|
1536
|
+
json: () => Promise<unknown>;
|
|
1537
|
+
ok: boolean;
|
|
1538
|
+
status: number;
|
|
1539
|
+
text: () => Promise<string>;
|
|
1540
|
+
}>;
|
|
1541
|
+
interface RunCommandOptions {
|
|
1542
|
+
args?: string;
|
|
1543
|
+
/** Forge this user id for the call (dispatches through the admin-gated `runAs` op). */
|
|
1544
|
+
as?: string;
|
|
1545
|
+
/** JSON-encoded extra identity claims to accompany {@link RunCommandOptions.as}. */
|
|
1546
|
+
claims?: string;
|
|
1547
|
+
cwd?: string;
|
|
1548
|
+
fetchImpl?: FetchLike;
|
|
1549
|
+
/** Output format: `pretty` (default) or `json`. */
|
|
1550
|
+
format?: OutputFormat;
|
|
1551
|
+
functionPath: string;
|
|
1552
|
+
logger: Logger;
|
|
1553
|
+
shard?: string;
|
|
1554
|
+
/** Admin bearer for the `runAs` dispatch; resolved from the environment / `.dev.vars` when absent. */
|
|
1555
|
+
token?: string;
|
|
1556
|
+
url?: string;
|
|
1557
|
+
}
|
|
1558
|
+
interface RunCommandResult {
|
|
1559
|
+
body: unknown;
|
|
1560
|
+
code: number;
|
|
1561
|
+
/** Why the call failed before (or at) the RPC, for the `--format json` envelope. */
|
|
1562
|
+
error?: string;
|
|
1563
|
+
requestUrl: string;
|
|
1564
|
+
}
|
|
1565
|
+
declare const runRpcCommand: (options: RunCommandOptions) => Promise<RunCommandResult>;
|
|
1545
1566
|
interface MigrateGenerateCommandOptions {
|
|
1546
1567
|
cwd?: string;
|
|
1547
1568
|
logger: Logger;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as o,V as a,r as n}from"./packem_chunks/cli.mjs";import{runCodegenCommand as m}from"./packem_chunks/runCodegenCommand.mjs";import{r as p}from"./packem_chunks/handler.mjs";import{runDevCommand as f}from"./packem_chunks/runDevCommand.mjs";import{p as i}from"./packem_shared/plan-BH4ZfiFs.mjs";import{runInitCommand as l}from"./packem_chunks/runInitCommand.mjs";import{runMigrateGenerateCommand as I}from"./packem_shared/runMigrateGenerateCommand-
|
|
1
|
+
import{C as o,V as a,r as n}from"./packem_chunks/cli.mjs";import{runCodegenCommand as m}from"./packem_chunks/runCodegenCommand.mjs";import{r as p}from"./packem_chunks/handler.mjs";import{runDevCommand as f}from"./packem_chunks/runDevCommand.mjs";import{p as i}from"./packem_shared/plan-BH4ZfiFs.mjs";import{runInitCommand as l}from"./packem_chunks/runInitCommand.mjs";import{runMigrateGenerateCommand as I}from"./packem_shared/runMigrateGenerateCommand-CFy3hXXu.mjs";import{runResetCommand as g}from"./packem_chunks/runResetCommand.mjs";import{runRpcCommand as T}from"./packem_chunks/runRpcCommand.mjs";import{EXIT_CODE as S,exitCodeForCode as A,exitCodeForError as c,exitCodeForStatus as M}from"./packem_shared/EXIT_CODE-DVjUgIaG.mjs";import{insertSchemaExtension as v}from"./packem_shared/insertSchemaExtension-CbTH3lCQ.mjs";import{createLogger as b,pail as O}from"./packem_shared/createLogger-4TujevyB.mjs";import{diffSnapshots as y,renderAddColumn as L,renderCreateIndex as w,renderCreateTable as B,renderDropIndex as P,renderDropTable as U,renderMigrationFile as V,validatorKindToSqlType as W}from"./packem_shared/diffSnapshots-htqNZT8Q.mjs";import{default as N}from"./packem_shared/schemaIrToSnapshot-BHuNOfgs.mjs";import{createRecordingSpawner as j,defaultSpawner as q}from"./packem_shared/createRecordingSpawner-01ZngIwK.mjs";import{default as K}from"./packem_shared/parseManifest-CwPTKdtS.mjs";import{D as Y,r as Z}from"./packem_shared/import-C-XRRHrZ.mjs";import{REQUIRED_COMPATIBILITY_DATE as z,REQUIRED_FLAG as J,validateWranglerProject as $,validateWranglerConfig as rr}from"@lunora/config/cloudflare";import{b as or}from"./packem_shared/catalog-CahzmDLV.mjs";import{r as nr,a as tr,b as mr}from"./packem_shared/commands-DC3ZX1yk.mjs";import{runExportCommand as pr}from"./packem_shared/runExportCommand-Dy6pSX68.mjs";export{o as COMMANDS,Y as DEFAULT_IMPORT_BATCH_SIZE,S as EXIT_CODE,z as REQUIRED_COMPATIBILITY_DATE,J as REQUIRED_FLAG,a as VERSION,or as buildRegistryIndex,b as createLogger,j as createRecordingSpawner,q as defaultSpawner,y as diffSnapshots,A as exitCodeForCode,c as exitCodeForError,M as exitCodeForStatus,v as insertSchemaExtension,O as pail,K as parseManifest,i as planDevCommand,L as renderAddColumn,w as renderCreateIndex,B as renderCreateTable,P as renderDropIndex,U as renderDropTable,V as renderMigrationFile,nr as runAddCommand,tr as runBuildIndexCommand,n as runCli,m as runCodegenCommand,p as runDeployCommand,f as runDevCommand,pr as runExportCommand,Z as runImportCommand,l as runInitCommand,I as runMigrateGenerateCommand,mr as runRegistryViewCommand,g as runResetCommand,T as runRpcCommand,N as schemaIrToSnapshot,$ as validateWrangler,rr as validateWranglerConfig,W as validatorKindToSqlType};
|