@stacksjs/actions 0.70.22 → 0.70.25
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/chunk-2gh7kgpc.js +3 -0
- package/dist/chunk-2kaj93p5.js +3 -0
- package/dist/chunk-2qchdrf9.js +3 -0
- package/dist/chunk-3086k7zk.js +184 -0
- package/dist/chunk-3beht8ja.js +130 -0
- package/dist/chunk-60qjz7zb.js +3 -0
- package/dist/chunk-67y94dzt.js +658 -0
- package/dist/chunk-6x1m5rkr.js +17 -0
- package/dist/chunk-7bpdkc40.js +714 -0
- package/dist/chunk-96b7fcmd.js +3 -0
- package/dist/chunk-aw6d8zr3.js +7 -0
- package/dist/chunk-c8qt2xst.js +3 -0
- package/dist/chunk-d4srk6ma.js +3 -0
- package/dist/chunk-e9tcbk71.js +1 -0
- package/dist/chunk-gt77jmb5.js +46 -0
- package/dist/chunk-h93n2j40.js +95 -0
- package/dist/chunk-jd1yzkq5.js +3 -0
- package/dist/chunk-kzhgexj4.js +3 -0
- package/dist/chunk-n1y0gpv6.js +3 -0
- package/dist/chunk-n2fd1d0m.js +3 -0
- package/dist/chunk-n2x7v39b.js +5 -0
- package/dist/chunk-rdajkt2s.js +88 -0
- package/dist/chunk-s735m9mg.js +1 -0
- package/dist/chunk-schcaf73.js +3 -0
- package/dist/chunk-tc935b45.js +93 -0
- package/dist/chunk-v0wnrnaa.js +7 -0
- package/dist/chunk-w418anbq.js +5 -0
- package/dist/chunk-wnrgcx3d.js +114 -0
- package/dist/chunk-wv5yb5wb.js +101 -0
- package/dist/chunk-x471rxrn.js +7 -0
- package/dist/chunk-xg9xscqz.js +1 -0
- package/dist/src/action.d.ts +60 -0
- package/dist/src/action.js +2 -0
- package/dist/src/actions.d.ts +2 -0
- package/dist/src/actions.js +2 -0
- package/dist/src/add.d.ts +6 -0
- package/dist/src/add.js +2 -0
- package/dist/src/ai/request-model-access.d.ts +1 -0
- package/dist/src/ai/request-model-access.js +2 -0
- package/dist/src/auth/client.d.ts +1 -0
- package/dist/src/auth/client.js +3 -0
- package/dist/src/auth/prune.d.ts +1 -0
- package/dist/src/auth/prune.js +2 -0
- package/dist/src/auth/setup.d.ts +1 -0
- package/dist/src/auth/setup.js +148 -0
- package/dist/src/auth/token.d.ts +1 -0
- package/dist/src/auth/token.js +2 -0
- package/dist/src/build/cli.d.ts +1 -0
- package/dist/src/build/cli.js +2 -0
- package/dist/src/build/component-libs.d.ts +1 -0
- package/dist/src/build/component-libs.js +2 -0
- package/dist/src/build/core.d.ts +1 -0
- package/dist/src/build/core.js +2 -0
- package/dist/src/build/desktop.d.ts +1 -0
- package/dist/src/build/desktop.js +2 -0
- package/dist/src/build/docs.d.ts +1 -0
- package/dist/src/build/docs.js +2 -0
- package/dist/src/build/server.d.ts +1 -0
- package/dist/src/build/server.js +2 -0
- package/dist/src/build/stacks.d.ts +1 -0
- package/dist/src/build/stacks.js +2 -0
- package/dist/src/build/views.d.ts +1 -0
- package/dist/src/build/views.js +2 -0
- package/dist/{build.d.ts → src/build.d.ts} +1 -2
- package/dist/src/build.js +2 -0
- package/dist/src/bump.d.ts +1 -0
- package/dist/src/bump.js +2 -0
- package/dist/src/cdn/invalidate-cache.d.ts +1 -0
- package/dist/src/cdn/invalidate-cache.js +1 -0
- package/dist/src/changelog.d.ts +1 -0
- package/dist/src/changelog.js +2 -0
- package/dist/src/check/ports.d.ts +1 -0
- package/dist/src/check/ports.js +2 -0
- package/dist/src/clean.d.ts +1 -0
- package/dist/src/clean.js +2 -0
- package/dist/{commit.d.ts → src/commit.d.ts} +1 -2
- package/dist/src/commit.js +2 -0
- package/dist/src/copy-types.d.ts +1 -0
- package/dist/src/copy-types.js +3 -0
- package/dist/src/database/seed.d.ts +1 -0
- package/dist/src/database/seed.js +2 -0
- package/dist/src/deploy/create-receipt-rule.d.ts +1 -0
- package/dist/src/deploy/create-receipt-rule.js +2 -0
- package/dist/src/deploy/index.d.ts +1 -0
- package/dist/src/deploy/index.js +307 -0
- package/dist/src/dev/api.d.ts +1 -0
- package/dist/src/dev/api.js +6 -0
- package/dist/src/dev/components.d.ts +1 -0
- package/dist/src/dev/components.js +2 -0
- package/dist/src/dev/dashboard-globals.d.ts +4 -0
- package/dist/src/dev/dashboard-globals.js +3 -0
- package/dist/src/dev/dashboard-utils.d.ts +126 -0
- package/dist/src/dev/dashboard-utils.js +2 -0
- package/dist/src/dev/dashboard.d.ts +12 -0
- package/dist/src/dev/dashboard.js +8 -0
- package/dist/src/dev/desktop.d.ts +1 -0
- package/dist/src/dev/desktop.js +2 -0
- package/dist/src/dev/docs.d.ts +1 -0
- package/dist/src/dev/docs.js +2 -0
- package/dist/src/dev/index.d.ts +10 -0
- package/dist/src/dev/index.js +2 -0
- package/dist/src/dev/system-tray.d.ts +1 -0
- package/dist/src/dev/system-tray.js +2 -0
- package/dist/src/dev/views.d.ts +1 -0
- package/dist/src/dev/views.js +2 -0
- package/dist/src/discover-packages.d.ts +18 -0
- package/dist/src/discover-packages.js +2 -0
- package/dist/src/domains/add.d.ts +1 -0
- package/dist/src/domains/add.js +2 -0
- package/dist/src/domains/purchase.d.ts +1 -0
- package/dist/src/domains/purchase.js +2 -0
- package/dist/src/domains/remove.d.ts +1 -0
- package/dist/src/domains/remove.js +2 -0
- package/dist/{examples.d.ts → src/examples.d.ts} +1 -2
- package/dist/src/examples.js +2 -0
- package/dist/src/find-projects.d.ts +1 -0
- package/dist/src/find-projects.js +2 -0
- package/dist/src/fresh.d.ts +1 -0
- package/dist/src/fresh.js +2 -0
- package/dist/src/generate/action-types.d.ts +1 -0
- package/dist/src/generate/action-types.js +8 -0
- package/dist/src/generate/component-meta.d.ts +1 -0
- package/dist/src/generate/component-meta.js +3 -0
- package/dist/src/generate/custom-cli-file.d.ts +1 -0
- package/dist/src/generate/custom-cli-file.js +4 -0
- package/dist/src/generate/env-files.d.ts +1 -0
- package/dist/src/generate/env-files.js +26 -0
- package/dist/src/generate/ide-helpers.d.ts +1 -0
- package/dist/src/generate/ide-helpers.js +3 -0
- package/dist/src/generate/index.d.ts +36 -0
- package/dist/src/generate/index.js +2 -0
- package/dist/src/generate/lib-entries.d.ts +1 -0
- package/dist/src/generate/lib-entries.js +3 -0
- package/dist/src/generate/pantry-file.d.ts +1 -0
- package/dist/src/generate/pantry-file.js +2 -0
- package/dist/src/generate/symlink-core.d.ts +1 -0
- package/dist/src/generate/symlink-core.js +2 -0
- package/dist/src/generate/types.d.ts +1 -0
- package/dist/src/generate/types.js +2 -0
- package/dist/src/generate/vscode-custom-data.d.ts +1 -0
- package/dist/src/generate/vscode-custom-data.js +3 -0
- package/dist/src/generate/web-types.d.ts +1 -0
- package/dist/src/generate/web-types.js +1 -0
- package/dist/src/helpers/component-meta.d.ts +26 -0
- package/dist/src/helpers/component-meta.js +2 -0
- package/dist/src/helpers/index.d.ts +4 -0
- package/dist/src/helpers/index.js +2 -0
- package/dist/{lib-entries.d.ts → src/helpers/lib-entries.d.ts} +9 -5
- package/dist/src/helpers/lib-entries.js +2 -0
- package/dist/src/helpers/package-json.d.ts +2 -0
- package/dist/src/helpers/package-json.js +43 -0
- package/dist/src/helpers/utils.d.ts +23 -0
- package/dist/src/helpers/utils.js +2 -0
- package/dist/{vscode-custom-data.d.ts → src/helpers/vscode-custom-data.d.ts} +1 -1
- package/dist/src/helpers/vscode-custom-data.js +2 -0
- package/dist/src/index.d.ts +42 -0
- package/dist/src/index.js +2 -0
- package/dist/src/key-generate.d.ts +1 -0
- package/dist/src/key-generate.js +2 -0
- package/dist/src/lint/fix.d.ts +1 -0
- package/dist/src/lint/fix.js +4 -0
- package/dist/src/lint/index.d.ts +1 -0
- package/dist/src/lint/index.js +2 -0
- package/dist/src/make-command.d.ts +10 -0
- package/dist/src/make-command.js +2 -0
- package/dist/src/make-job.d.ts +5 -0
- package/dist/src/make-job.js +2 -0
- package/dist/src/make-policy.d.ts +10 -0
- package/dist/src/make-policy.js +2 -0
- package/dist/src/make-resource.d.ts +10 -0
- package/dist/src/make-resource.js +2 -0
- package/dist/{make.d.ts → src/make.d.ts} +11 -9
- package/dist/src/make.js +2 -0
- package/dist/src/migrate/database.d.ts +1 -0
- package/dist/src/migrate/database.js +2 -0
- package/dist/src/migrate/fresh.d.ts +1 -0
- package/dist/src/migrate/fresh.js +2 -0
- package/dist/src/orm/base.d.ts +1 -0
- package/dist/src/orm/base.js +2 -0
- package/dist/src/orm/test.d.ts +1 -0
- package/dist/src/orm/test.js +1 -0
- package/dist/src/prepublish.d.ts +1 -0
- package/dist/src/prepublish.js +2 -0
- package/dist/src/queue/clear.d.ts +1 -0
- package/dist/src/queue/clear.js +2 -0
- package/dist/src/queue/failed.d.ts +1 -0
- package/dist/src/queue/failed.js +5 -0
- package/dist/src/queue/flush.d.ts +1 -0
- package/dist/src/queue/flush.js +3 -0
- package/dist/src/queue/inspect.d.ts +1 -0
- package/dist/src/queue/inspect.js +8 -0
- package/dist/src/queue/monitor.d.ts +1 -0
- package/dist/src/queue/monitor.js +7 -0
- package/dist/src/queue/retry.d.ts +1 -0
- package/dist/src/queue/retry.js +2 -0
- package/dist/src/queue/schedule-list.d.ts +1 -0
- package/dist/src/queue/schedule-list.js +5 -0
- package/dist/src/queue/schedule.d.ts +1 -0
- package/dist/src/queue/schedule.js +2 -0
- package/dist/src/queue/status.d.ts +1 -0
- package/dist/src/queue/status.js +5 -0
- package/dist/src/queue/table.d.ts +1 -0
- package/dist/src/queue/table.js +2 -0
- package/dist/src/queue/work.d.ts +1 -0
- package/dist/src/queue/work.js +2 -0
- package/dist/src/release.d.ts +1 -0
- package/dist/src/release.js +3 -0
- package/dist/src/route/list.d.ts +1 -0
- package/dist/src/route/list.js +3 -0
- package/dist/src/run-action.d.ts +2 -0
- package/dist/src/run-action.js +2 -0
- package/dist/src/saas/setup.d.ts +1 -0
- package/dist/src/saas/setup.js +2 -0
- package/dist/src/scaffold-crud.d.ts +25 -0
- package/dist/src/scaffold-crud.js +2 -0
- package/dist/src/schedule/run.d.ts +1 -0
- package/dist/src/schedule/run.js +2 -0
- package/dist/src/search/flush.d.ts +1 -0
- package/dist/src/search/flush.js +2 -0
- package/dist/src/search/import.d.ts +1 -0
- package/dist/src/search/import.js +2 -0
- package/dist/src/search/settings-list.d.ts +1 -0
- package/dist/src/search/settings-list.js +2 -0
- package/dist/src/search/settings.d.ts +1 -0
- package/dist/src/search/settings.js +2 -0
- package/dist/src/serve/api.d.ts +1 -0
- package/dist/src/serve/api.js +2 -0
- package/dist/src/setup/index.d.ts +1 -0
- package/dist/src/setup/index.js +2 -0
- package/dist/src/setup/ssl.d.ts +38 -0
- package/dist/src/setup/ssl.js +2 -0
- package/dist/src/stacks.d.ts +4 -0
- package/dist/src/stacks.js +2 -0
- package/dist/src/templates.d.ts +8 -0
- package/dist/src/templates.js +2 -0
- package/dist/src/test/feature.d.ts +1 -0
- package/dist/src/test/feature.js +2 -0
- package/dist/src/test/index.d.ts +1 -0
- package/dist/src/test/index.js +2 -0
- package/dist/src/test/ui.d.ts +1 -0
- package/dist/src/test/ui.js +2 -0
- package/dist/src/test/unit.d.ts +1 -0
- package/dist/src/test/unit.js +2 -0
- package/dist/src/typecheck.d.ts +1 -0
- package/dist/src/typecheck.js +2 -0
- package/dist/{types.d.ts → src/types.d.ts} +1 -2
- package/dist/src/types.js +2 -0
- package/dist/src/upgrade/binary.d.ts +1 -0
- package/dist/src/upgrade/binary.js +2 -0
- package/dist/src/upgrade/bun.d.ts +1 -0
- package/dist/src/upgrade/bun.js +1 -0
- package/dist/src/upgrade/dependencies.d.ts +1 -0
- package/dist/src/upgrade/dependencies.js +2 -0
- package/dist/src/upgrade/framework-utils.d.ts +102 -0
- package/dist/src/upgrade/framework-utils.js +2 -0
- package/dist/src/upgrade/framework.d.ts +1 -0
- package/dist/src/upgrade/framework.js +7 -0
- package/dist/src/upgrade/index.d.ts +1 -0
- package/dist/src/upgrade/index.js +2 -0
- package/dist/src/upgrade/shell.d.ts +1 -0
- package/dist/src/upgrade/shell.js +5 -0
- package/dist/src/upgrade.d.ts +7 -0
- package/dist/src/upgrade.js +2 -0
- package/package.json +39 -23
- package/dist/action-types.d.ts +0 -9
- package/dist/action.d.ts +0 -64
- package/dist/actions.d.ts +0 -2
- package/dist/add.d.ts +0 -5
- package/dist/add.js +0 -33
- package/dist/api.d.ts +0 -1
- package/dist/binary.d.ts +0 -2
- package/dist/build/component-libs.js +0 -9
- package/dist/build/core.js +0 -23
- package/dist/build/stacks.js +0 -8
- package/dist/build.js +0 -108
- package/dist/bump.d.ts +0 -2
- package/dist/bump.js +0 -17
- package/dist/changelog.d.ts +0 -2
- package/dist/changelog.js +0 -17
- package/dist/chunk-0m948f1p.js +0 -2177
- package/dist/chunk-23btgw5e.js +0 -1402
- package/dist/chunk-2dvnt46s.js +0 -7657
- package/dist/chunk-3y8t4qyf.js +0 -72
- package/dist/chunk-494jp8d5.js +0 -54
- package/dist/chunk-5wdfth6e.js +0 -901
- package/dist/chunk-8qsrwjam.js +0 -92
- package/dist/chunk-90y2wmyz.js +0 -2376
- package/dist/chunk-92e6scf8.js +0 -379
- package/dist/chunk-9v6qtbez.js +0 -45
- package/dist/chunk-a13x0e43.js +0 -1180
- package/dist/chunk-atahpwz7.js +0 -5762
- package/dist/chunk-bz3nmjmp.js +0 -212
- package/dist/chunk-ddw2jq8f.js +0 -179250
- package/dist/chunk-frw3va9v.js +0 -69
- package/dist/chunk-hqmjfnnn.js +0 -105
- package/dist/chunk-jq06qn43.js +0 -410
- package/dist/chunk-mbvdyeyw.js +0 -50
- package/dist/chunk-mdj7x1vs.js +0 -790
- package/dist/chunk-mdqphqep.js +0 -438
- package/dist/chunk-ny592jcd.js +0 -133
- package/dist/chunk-p0c688mg.js +0 -729
- package/dist/chunk-q9dmga3k.js +0 -11
- package/dist/chunk-qhh0v93n.js +0 -73
- package/dist/chunk-qka5w6cv.js +0 -1282
- package/dist/chunk-qkm8e752.js +0 -51
- package/dist/chunk-rbsehxzg.js +0 -65
- package/dist/chunk-rfdmx5yh.js +0 -170
- package/dist/chunk-s3xxrvrk.js +0 -311
- package/dist/chunk-w6fdq4hk.js +0 -14425
- package/dist/chunk-wkwtsvym.js +0 -477
- package/dist/chunk-y08qabyb.js +0 -3821
- package/dist/chunk-yyvh669b.js +0 -197
- package/dist/chunk-ze46550n.js +0 -0
- package/dist/chunk-zhrbz0qv.js +0 -661
- package/dist/chunk-zzerxbrm.js +0 -107
- package/dist/clean.js +0 -6
- package/dist/commit.js +0 -22
- package/dist/component-meta.d.ts +0 -15
- package/dist/components.d.ts +0 -3
- package/dist/copy-types.d.ts +0 -1
- package/dist/copy-types.js +0 -14
- package/dist/core.d.ts +0 -1
- package/dist/create-receipt-rule.d.ts +0 -4
- package/dist/database/seed.js +0 -30
- package/dist/database.d.ts +0 -2
- package/dist/deploy/index.js +0 -48
- package/dist/dev/components.js +0 -11
- package/dist/dev/docs.js +0 -7
- package/dist/dev/index.js +0 -58
- package/dist/env-files.d.ts +0 -9
- package/dist/examples.js +0 -46
- package/dist/feature.d.ts +0 -2
- package/dist/find-projects.d.ts +0 -1
- package/dist/fix.d.ts +0 -1
- package/dist/flush.d.ts +0 -2
- package/dist/fresh.d.ts +0 -1
- package/dist/fresh.js +0 -21
- package/dist/generate/component-meta.js +0 -17
- package/dist/generate/ide-helpers.js +0 -18
- package/dist/generate/index.js +0 -216
- package/dist/generate/lib-entries.js +0 -30
- package/dist/generate/vscode-custom-data.js +0 -17
- package/dist/helpers/component-meta.js +0 -204227
- package/dist/helpers/lib-entries.js +0 -122
- package/dist/helpers/package-json.js +0 -96
- package/dist/helpers/utils.js +0 -76
- package/dist/helpers/vscode-custom-data.js +0 -43
- package/dist/import.d.ts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -172
- package/dist/key-generate.js +0 -15
- package/dist/lint/fix.js +0 -18
- package/dist/lint/index.js +0 -5
- package/dist/list.d.ts +0 -1
- package/dist/make.js +0 -349
- package/dist/package-json.d.ts +0 -92
- package/dist/pkgx-file.d.ts +0 -8
- package/dist/ports.d.ts +0 -2
- package/dist/prepublish.d.ts +0 -1
- package/dist/prepublish.js +0 -17
- package/dist/purchase.d.ts +0 -6
- package/dist/release.js +0 -49
- package/dist/remove.d.ts +0 -6
- package/dist/request-model-access.d.ts +0 -1
- package/dist/run.d.ts +0 -1
- package/dist/settings-list.d.ts +0 -2
- package/dist/settings.d.ts +0 -1
- package/dist/setup.d.ts +0 -1
- package/dist/shell.d.ts +0 -2
- package/dist/table.d.ts +0 -1
- package/dist/test/feature.js +0 -14
- package/dist/test/index.js +0 -14
- package/dist/test/ui.js +0 -6
- package/dist/test/unit.js +0 -14
- package/dist/typecheck.js +0 -6
- package/dist/types.js +0 -23
- package/dist/unit.d.ts +0 -2
- package/dist/upgrade/dependencies.js +0 -8
- package/dist/upgrade/index.js +0 -22
- package/dist/upgrade.d.ts +0 -5
- package/dist/upgrade.js +0 -50
- package/dist/utils.d.ts +0 -75
- package/dist/work.d.ts +0 -3
- /package/dist/{upgrade/framework.js → chunk-cdk2r2jd.js} +0 -0
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { MakeOptions } from '@stacksjs/types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Toggle dry-run mode. The buddy CLI flips this on before invoking a
|
|
4
|
+
* scaffolder when the user passed `--dry-run`. Stays a module-level
|
|
5
|
+
* flag (rather than threading through every signature) so existing
|
|
6
|
+
* scaffolders can opt in just by switching their write call.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setDryRun(enabled: boolean): void;
|
|
9
|
+
export declare function isDryRunActive(): boolean;
|
|
3
10
|
export declare function invoke(options: MakeOptions): Promise<void>;
|
|
4
11
|
export declare function make(options: MakeOptions): Promise<void>;
|
|
5
12
|
export declare function makeAction(options: MakeOptions): Promise<void>;
|
|
@@ -9,23 +16,18 @@ export declare function createComponent(options: MakeOptions): Promise<void>;
|
|
|
9
16
|
export declare function makeDatabase(options: MakeOptions): void;
|
|
10
17
|
export declare function createDatabase(options: MakeOptions): void;
|
|
11
18
|
export declare function factory(options: MakeOptions): void;
|
|
12
|
-
export declare function createFactory(options: MakeOptions): void
|
|
19
|
+
export declare function createFactory(options: MakeOptions): Promise<void>;
|
|
13
20
|
export declare function makeNotification(options: MakeOptions): Promise<void>;
|
|
14
21
|
export declare function makePage(options: MakeOptions): Promise<void>;
|
|
15
22
|
export declare function createPage(options: MakeOptions): Promise<void>;
|
|
16
23
|
export declare function makeFunction(options: MakeOptions): Promise<void>;
|
|
17
24
|
export declare function createFunction(options: MakeOptions): Promise<void>;
|
|
18
|
-
declare function increment(): void;
|
|
19
25
|
export declare function makeLanguage(options: MakeOptions): Promise<void>;
|
|
20
26
|
export declare function createLanguage(options: MakeOptions): Promise<void>;
|
|
21
|
-
export declare function makeStack(options: MakeOptions): void
|
|
27
|
+
export declare function makeStack(options: MakeOptions): Promise<void>;
|
|
22
28
|
export declare function createNotification(options: MakeOptions): Promise<boolean>;
|
|
23
|
-
declare function content(): string;
|
|
24
|
-
declare function send(): $;
|
|
25
29
|
export declare function createMigration(options: MakeOptions): Promise<void>;
|
|
26
30
|
export declare function makeQueueTable(): Promise<void>;
|
|
27
31
|
export declare function makeCertificate(): Promise<void>;
|
|
28
32
|
export declare function createModel(options: MakeOptions): Promise<void>;
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
${name},
|
|
33
|
+
export declare function createMiddleware(options: MakeOptions): Promise<void>;
|
package/dist/src/make.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$ as z,C as a,D as b,E as c,F as d,G as e,H as f,I as g,J as h,K as i,L as j,M as k,N as l,O as m,P as n,Q as o,R as p,S as q,T as r,U as s,V as t,W as u,X as v,Y as w,Z as x,_ as y}from"../chunk-6x1m5rkr.js";import"../chunk-3086k7zk.js";import"../chunk-s735m9mg.js";import"../chunk-n1y0gpv6.js";import"../chunk-96b7fcmd.js";export{a as setDryRun,t as makeStack,w as makeQueueTable,n as makePage,m as makeNotification,r as makeLanguage,p as makeFunction,i as makeDatabase,f as makeComponent,x as makeCertificate,e as makeAction,d as make,b as isDryRunActive,c as invoke,k as factory,o as createPage,u as createNotification,y as createModel,v as createMigration,z as createMiddleware,s as createLanguage,q as createFunction,l as createFactory,j as createDatabase,h as createComponent,g as createAction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import i from"process";import{generateMigrations as t,runDatabaseMigration as a}from"@stacksjs/database";import{log as e}from"@stacksjs/logging";var r=await t();if(r?.isErr)console.error(r.error),e.error("[stacks] generateMigrations failed",r.error),i.exit(1);var o=await a();if(o.isErr)e.error("runDatabaseMigration failed"),e.error(o.error),i.exit(1);i.exit(0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import q from"process";import{generateMigrations as z,resetDatabase as A,runDatabaseMigration as B}from"@stacksjs/database";import{log as f}from"@stacksjs/logging";var v=await A();if(v?.isErr)console.error(v.error),f.error("resetDatabase failed",v.error),q.exit(1);var w=await z();if(w?.isErr)console.error(w.error),f.error("generateMigrations failed",w.error),q.exit(1);var x=await B();if(x.isErr)f.error("runDatabaseMigration failed"),f.error(x.error),q.exit(1);q.exit(0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import z from"process";import{NpmScript as A}from"@stacksjs/enums";import{log as q}from"@stacksjs/logging";import{runtimePath as B}from"@stacksjs/path";import{ExitCode as D}from"@stacksjs/types";import{runNpmScript as F}from"@stacksjs/utils";q.info("Running prepublish command...");var v=await F(A.BuildStacks,{verbose:!0,cwd:B()});if(v.isErr)q.error(Error("There was an error while prepublishing your stack"),v.error),z.exit(D.FatalError);q.success("Prepublishing completed");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import s from"process";import{log as r}from"@stacksjs/logging";import{Job as a}from"@stacksjs/orm";var n=c(),i=n.queue,f=n.force==="true";try{if(!f)r.warn("This will delete all jobs from the queue. Use --force to confirm."),s.exit(1);let e=0;if(i){r.info(`Clearing all jobs from queue "${i}"...`);let o=await a.where("queue",i).get();e=o.length;for(let t of o)await t.delete()}else{r.info("Clearing all jobs from all queues...");let o=await a.all();e=o.length;for(let t of o)await t.delete()}r.success(`Cleared ${e} job(s)`),s.exit(0)}catch(e){r.error("Failed to clear jobs",e),s.exit(1)}function c(){let e={};return s.argv.forEach((o)=>{if(o.startsWith("--")){let[t,l]=o.slice(2).split("=");if(t&&l)e[t]=l;else if(t)e[t]="true"}}),e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import z from"process";import{log as D}from"@stacksjs/logging";import{FailedJob as E}from"@stacksjs/orm";var K=M(),G=K.queue;try{D.info(`Fetching failed jobs...
|
|
3
|
+
`);let h;if(G)h=await E.where("queue",G).get();else h=await E.all();if(h.length===0)console.log("\u2713 No failed jobs found"),z.exit(0);console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 ID \u2502 Queue \u2502 Failed At \u2502 Exception \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let w of h){let B=String(w.id).padEnd(3),C=(w.queue||"default").substring(0,48).padEnd(48),H=(w.failed_at||"N/A").substring(0,21).padEnd(21),I=(w.exception||"Unknown error").substring(0,31).padEnd(31);console.log(`\u2502 ${B} \u2502 ${C} \u2502 ${H} \u2502 ${I} \u2502`)}console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(`
|
|
4
|
+
Total: ${h.length} failed job(s)`),z.exit(0)}catch(h){let w=h instanceof Error?h.message:String(h);if(/no such table:\s*(?:jobs|failed_jobs)\b/i.test(w))z.stdout.write(`Queue tables are not set up yet.
|
|
5
|
+
`),z.stdout.write("Run `buddy queue:table` to create the migrations, then `buddy migrate` to apply them.\n"),z.exit(0);D.error("Failed to fetch failed jobs",h),z.exit(1)}function M(){let h={};return z.argv.forEach((w)=>{if(w.startsWith("--")){let[B,C]=w.slice(2).split("=");if(B&&C)h[B]=C}}),h}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import s from"process";import{log as i}from"@stacksjs/logging";import{FailedJob as l}from"@stacksjs/orm";var n=f(),r=n.queue,u=n.force==="true";try{if(!u)i.warn("This will permanently delete all failed jobs. Use --force to confirm."),s.exit(1);let e=0;if(r){i.info(`Flushing all failed jobs from queue "${r}"...`);let t=await l.where("queue",r).get();e=t.length;for(let o of t)await o.delete()}else{i.info("Flushing all failed jobs from all queues...");let t=await l.all();e=t.length;for(let o of t)await o.delete()}i.success(`Flushed ${e} failed job(s)`),s.exit(0)}catch(e){let t=e instanceof Error?e.message:String(e);if(/no such table:\s*(?:jobs|failed_jobs)\b/i.test(t))s.stdout.write(`Queue tables are not set up yet.
|
|
3
|
+
`),s.stdout.write("Run `buddy queue:table` to create the migrations, then `buddy migrate` to apply them.\n"),s.exit(0);i.error("Failed to flush failed jobs",e),s.exit(1)}function f(){let e={};return s.argv.forEach((t)=>{if(t.startsWith("--")){let[o,a]=t.slice(2).split("=");if(o&&a)e[o]=a;else if(o)e[o]="true"}}),e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import N from"process";import{log as M}from"@stacksjs/logging";import{Job as S,FailedJob as U}from"@stacksjs/orm";var P=W(),O=P.id,V=P.failed==="true";try{if(!O)M.error("Please provide a job ID"),M.info("Usage: buddy queue:inspect --id=<jobId> [--failed]"),N.exit(1);let z=Number.parseInt(O,10);if(Number.isNaN(z))M.error("Invalid job ID provided"),N.exit(1);if(V){let B=await U.find(z);if(!B)M.error(`Failed job with ID ${z} not found`),N.exit(1);let h=B;console.log(`
|
|
3
|
+
\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`),console.log("\u2502 Failed Job Details \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(`\u2502 ID: ${String(h.id).padEnd(52)} \u2502`),console.log(`\u2502 Queue: ${(h.queue||"default").padEnd(52)} \u2502`),console.log(`\u2502 Connection: ${(h.connection||"database").padEnd(52)} \u2502`),console.log(`\u2502 Failed At: ${(h.failed_at||"N/A").padEnd(52)} \u2502`),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log("\u2502 Exception: \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let E=h.exception||"Unknown error",G=E.match(/.{1,62}/g)||[E];for(let q of G.slice(0,20))console.log(`\u2502 ${q.padEnd(62)} \u2502`);if(G.length>20)console.log(`\u2502 ... (${G.length-20} more lines)`.padEnd(64)+" \u2502");if(console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log("\u2502 Payload: \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),h.payload)try{let q=JSON.parse(h.payload);console.log(`\u2502 Name: ${q.name.padEnd(52)} \u2502`),console.log(`\u2502 Path: ${q.path.padEnd(52)} \u2502`),console.log(`\u2502 Max Tries: ${String(q.maxTries).padEnd(52)} \u2502`),console.log("\u2502 Parameters: \u2502");let K=JSON.stringify(q.params,null,2).split(`
|
|
4
|
+
`);for(let H of K.slice(0,15))console.log(`\u2502 ${H.substring(0,60).padEnd(60)} \u2502`);if(K.length>15)console.log(`\u2502 ... (${K.length-15} more lines)`.padEnd(64)+" \u2502")}catch{console.log(`\u2502 Raw: ${h.payload.substring(0,58).padEnd(58)} \u2502`)}else console.log("\u2502 (No payload) \u2502");console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(`
|
|
5
|
+
Actions:`),console.log(` Retry this job: buddy queue:retry --id=${z}`),console.log(` Delete this job: buddy queue:flush --id=${z}`)}else{let B=await S.find(z);if(!B)M.error(`Job with ID ${z} not found`),M.info("Tip: Use --failed flag to inspect failed jobs"),N.exit(1);let h=B,E=Math.floor(Date.now()/1000),G="Pending";if(h.reserved_at)G="Processing";else if(h.available_at&&h.available_at>E)G="Delayed";if(console.log(`
|
|
6
|
+
\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`),console.log("\u2502 Job Details \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(`\u2502 ID: ${String(h.id).padEnd(50)} \u2502`),console.log(`\u2502 Queue: ${(h.queue||"default").padEnd(50)} \u2502`),console.log(`\u2502 Status: ${G.padEnd(50)} \u2502`),console.log(`\u2502 Attempts: ${String(h.attempts||0).padEnd(50)} \u2502`),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),h.available_at){let q=new Date(h.available_at*1000);console.log(`\u2502 Available At: ${q.toISOString().padEnd(50)} \u2502`)}if(h.reserved_at){let q=new Date(h.reserved_at*1000);console.log(`\u2502 Reserved At: ${q.toISOString().padEnd(50)} \u2502`)}if(h.created_at)console.log(`\u2502 Created At: ${String(h.created_at).padEnd(50)} \u2502`);if(console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log("\u2502 Payload: \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),h.payload)try{let q=JSON.parse(h.payload);console.log(`\u2502 Name: ${q.name.padEnd(52)} \u2502`),console.log(`\u2502 Path: ${q.path.padEnd(52)} \u2502`),console.log(`\u2502 Max Tries: ${String(q.maxTries).padEnd(52)} \u2502`),console.log(`\u2502 Timeout: ${String(q.timeOut||"N/A").padEnd(52)} \u2502`),console.log("\u2502 Parameters: \u2502");let K=JSON.stringify(q.params,null,2).split(`
|
|
7
|
+
`);for(let H of K.slice(0,15))console.log(`\u2502 ${H.substring(0,60).padEnd(60)} \u2502`);if(K.length>15)console.log(`\u2502 ... (${K.length-15} more lines)`.padEnd(64)+" \u2502");if(q.classPayload)try{let H=JSON.parse(q.classPayload);if(console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log("\u2502 Job Configuration: \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(`\u2502 Tries: ${String(H.tries||3).padEnd(52)} \u2502`),console.log(`\u2502 Timeout: ${String(H.timeout||60).padEnd(52)} \u2502`),H.backoff)console.log(`\u2502 Backoff: ${String(JSON.stringify(H.backoff)).substring(0,52).padEnd(52)} \u2502`)}catch{}}catch{console.log(`\u2502 Raw: ${h.payload.substring(0,58).padEnd(58)} \u2502`)}else console.log("\u2502 (No payload) \u2502");if(console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),G==="Delayed"&&h.available_at){let q=h.available_at-E;console.log(`
|
|
8
|
+
This job will be available in ${q} second(s)`)}}N.exit(0)}catch(z){M.error("Failed to inspect job",z),N.exit(1)}function W(){let z={};return N.argv.forEach((B)=>{if(B.startsWith("--")){let[h,E]=B.slice(2).split("=");if(h&&E)z[h]=E;else if(h)z[h]="true"}}),z}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import D from"process";import{log as O}from"@stacksjs/logging";import{Job as P,FailedJob as Q}from"@stacksjs/orm";import{getActiveJobCount as V,isWorkerRunning as X}from"@stacksjs/queue";var U=_(),G=U.queue,Y=Number(U.interval)||2000,H=!0;D.on("SIGINT",()=>{H=!1,console.log(`
|
|
3
|
+
|
|
4
|
+
Monitoring stopped.`),D.exit(0)});D.on("SIGTERM",()=>{H=!1,D.exit(0)});async function Z(){let x=G?await P.where("queue",G).get():await P.all(),z=G?await Q.where("queue",G).get():await Q.all(),B=Math.floor(Date.now()/1000),E=0,L=0,M=0;for(let K of x)if(K.reserved_at)L++;else if(K.available_at&&Number(K.available_at)>B)M++;else E++;return{pending:E,processing:L,delayed:M,failed:z.length,total:x.length,workerRunning:X(),activeJobs:V()}}async function T(){let x=await Z(),z=new Date().toLocaleTimeString();if(console.clear(),console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 Queue Monitor \u2502"),console.log("\u2502 Press Ctrl+C to exit \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(`\u2502 Last Updated: ${z.padEnd(48)} \u2502`),console.log(`\u2502 Queue Filter: ${(G||"All Queues").padEnd(48)} \u2502`),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log("\u2502 \u2502"),console.log(`\u2502 Pending Jobs: ${String(x.pending).padStart(8)} \u2502`),console.log(`\u2502 Processing Jobs: ${String(x.processing).padStart(8)} \u2502`),console.log(`\u2502 Delayed Jobs: ${String(x.delayed).padStart(8)} \u2502`),console.log(`\u2502 Failed Jobs: ${String(x.failed).padStart(8)} \u2502`),console.log("\u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502"),console.log(`\u2502 Total Jobs: ${String(x.total).padStart(8)} \u2502`),console.log("\u2502 \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log("\u2502 Worker Status \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(`\u2502 Worker Running: ${(x.workerRunning?"Yes":"No").padEnd(8)} \u2502`),console.log(`\u2502 Active Jobs: ${String(x.activeJobs).padStart(8)} \u2502`),console.log("\u2502 \u2502"),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),x.failed>0)console.log(`
|
|
5
|
+
\u26A0\uFE0F Warning: ${x.failed} failed job(s) - run 'buddy queue:failed' for details`);if(!x.workerRunning&&x.pending>0)console.log(`
|
|
6
|
+
\u26A0\uFE0F Warning: Worker not running but ${x.pending} job(s) pending - run 'buddy queue:work'`)}try{O.info(`Starting queue monitor...
|
|
7
|
+
`),await T();while(H)if(await new Promise((x)=>setTimeout(x,Y)),H)await T()}catch(x){O.error("Monitor error:",x),D.exit(1)}function _(){let x={};return D.argv.forEach((z)=>{if(z.startsWith("--")){let[B,E]=z.slice(2).split("=");if(B&&E)x[B]=E;else if(B)x[B]="true"}}),x}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import i from"process";import{log as r}from"@stacksjs/logging";import{executeFailedJobs as n,retryFailedJob as d}from"@stacksjs/queue";var l=f(),a=l.id,u=l.all==="true";try{if(u)r.info("Retrying all failed jobs..."),await n(),r.success("All failed jobs have been queued for retry");else if(a){let e=Number.parseInt(a,10);if(Number.isNaN(e))r.error("Invalid job ID provided"),i.exit(1);r.info(`Retrying failed job ${e}...`),await d(e),r.success(`Failed job ${e} has been queued for retry`)}else r.warn("Please provide a job ID or use --all to retry all failed jobs"),r.info("Usage: buddy queue:retry <id> or buddy queue:retry --all"),i.exit(1);i.exit(0)}catch(e){r.error("Failed to retry job(s)",e),i.exit(1)}function f(){let e={};return i.argv.forEach((t)=>{if(t.startsWith("--")){let[o,s]=t.slice(2).split("=");if(o&&s)e[o]=s;else if(o)e[o]="true"}}),e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import n from"process";import{log as s}from"@stacksjs/logging";import{discoverJobs as d,getScheduledJobs as i}from"@stacksjs/queue";try{s.info(`Discovering scheduled jobs...
|
|
3
|
+
`),await d();let o=i();if(o.length===0)s.info("No scheduled jobs found."),s.info('Tip: Add a "rate" or "schedule" property to your job configuration.'),n.exit(0);console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 Job Name \u2502 Schedule \u2502 Queue \u2502 Tries \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let e of o){let l=e.name.substring(0,48).padEnd(48),r=(e.config.rate||e.config.schedule||"N/A").substring(0,21).padEnd(21),t=(e.config.queue||"default").substring(0,9).padEnd(9),c=String(e.config.tries||3).padStart(7);console.log(`\u2502 ${l} \u2502 ${r} \u2502 ${t} \u2502${c} \u2502`)}console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(`
|
|
4
|
+
Total: ${o.length} scheduled job(s)`),console.log(`
|
|
5
|
+
Schedule Formats:`),console.log(' \u2022 Cron: "* * * * *" (minute hour day month dayOfWeek)'),console.log(" \u2022 Presets: @hourly, @daily, @weekly, @monthly"),console.log(" \u2022 Every: Every.Minute, Every.Hour, Every.Day"),n.exit(0)}catch(o){s.error("Failed to list scheduled jobs:",o),n.exit(1)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import e from"process";import{log as r}from"@stacksjs/logging";import{startScheduler as o}from"@stacksjs/queue";r.info("Starting job scheduler...");try{await o(),r.success("Scheduler is running. Press Ctrl+C to stop."),await new Promise(()=>{})}catch(t){r.error("Failed to start scheduler:",t),e.exit(1)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import H from"process";import{log as V}from"@stacksjs/logging";import{Job as W,FailedJob as X}from"@stacksjs/orm";var h=A(),K=h.queue;try{V.info(`Fetching queue status...
|
|
3
|
+
`);let C=K?await W.where("queue",K).get():await W.all(),G=K?await X.where("queue",K).get():await X.all(),B=new Map;for(let x of C){let z=x.queue||"default";if(!B.has(z))B.set(z,{pending:0,processing:0,delayed:0});let I=B.get(z),L=Math.floor(Date.now()/1000);if(x.reserved_at)I.processing++;else if(x.available_at&&Number(x.available_at)>L)I.delayed++;else I.pending++}let E=new Map;for(let x of G){let z=x.queue||"default";E.set(z,(E.get(z)||0)+1)}console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 Queue \u2502 Pending \u2502 Processing \u2502 Delayed \u2502 Failed \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let M=new Set([...B.keys(),...E.keys()]);if(M.size===0)console.log("\u2502 No queues found \u2502");else for(let x of M){let z=B.get(x)||{pending:0,processing:0,delayed:0},I=E.get(x)||0,L=x.substring(0,48).padEnd(48),Y=String(z.pending).padStart(8),Z=String(z.processing).padStart(10),_=String(z.delayed).padStart(8),$=String(I).padStart(6);console.log(`\u2502 ${L} \u2502${Y} \u2502${Z} \u2502${_} \u2502${$} \u2502`)}console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");let O=Array.from(B.values()).reduce((x,z)=>x+z.pending,0),R=Array.from(B.values()).reduce((x,z)=>x+z.processing,0),T=Array.from(B.values()).reduce((x,z)=>x+z.delayed,0),U=Array.from(E.values()).reduce((x,z)=>x+z,0);console.log(`
|
|
4
|
+
Summary:`),console.log(` Pending: ${O}`),console.log(` Processing: ${R}`),console.log(` Delayed: ${T}`),console.log(` Failed: ${U}`),console.log(` Total: ${O+R+T+U}`),H.exit(0)}catch(C){let G=C instanceof Error?C.message:String(C);if(/no such table:\s*(?:jobs|failed_jobs)\b/i.test(G))H.stdout.write(`Queue tables are not set up yet.
|
|
5
|
+
`),H.stdout.write("Run `buddy queue:table` to create the migrations, then `buddy migrate` to apply them.\n"),H.exit(0);V.error("Failed to get queue status",C),H.exit(1)}function A(){let C={};return H.argv.forEach((G)=>{if(G.startsWith("--")){let[B,E]=G.slice(2).split("=");if(B&&E)C[B]=E}}),C}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import x from"process";import{log as m}from"@stacksjs/logging";import{startProcessor as F}from"@stacksjs/queue";x.on("unhandledRejection",(b)=>{m.error(`Unhandled Rejection in queue worker: ${b}`)});x.on("uncaughtException",(b)=>{m.error(`Uncaught Exception in queue worker: ${b.message}`)});var D=H(),G=D.queue,E=Number(D.concurrency)||1;m.info(`Starting queue worker with ${E} concurrent worker(s)...`);var C=await F(G,{concurrency:E});if(C.isErr)m.error("Failed to start queue worker:",C.error),x.exit(1);m.success("Queue worker started successfully!");await new Promise(()=>{});function H(){let b={};return x.argv.forEach((z)=>{if(z.startsWith("--")){let[w,B]=z.slice(2).split("=");if(w&&B)b[w]=B;else if(w)b[w]="true"}}),b}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
import"../chunk-e9tcbk71.js";import"../chunk-cdk2r2jd.js";import"../chunk-x471rxrn.js";import"../chunk-2qchdrf9.js";import"../chunk-rdajkt2s.js";import"../chunk-gt77jmb5.js";import"../chunk-3beht8ja.js";import"../chunk-h93n2j40.js";import"../chunk-wnrgcx3d.js";import"../chunk-6x1m5rkr.js";import"../chunk-3086k7zk.js";import"../chunk-60qjz7zb.js";import"../chunk-c8qt2xst.js";import"../chunk-2gh7kgpc.js";import"../chunk-schcaf73.js";import"../chunk-v0wnrnaa.js";import"../chunk-n2fd1d0m.js";import"../chunk-s735m9mg.js";import"../chunk-d4srk6ma.js";import{Za as C}from"../chunk-n1y0gpv6.js";import"../chunk-jd1yzkq5.js";import"../chunk-96b7fcmd.js";import{parseOptions as G}from"@stacksjs/cli";import{app as H}from"@stacksjs/config";import{Action as q}from"@stacksjs/enums";import{log as E}from"@stacksjs/logging";import{projectPath as I}from"@stacksjs/path";var J=G()??{},z={};for(let[B,F]of Object.entries(J)){if(B==="--"||B==="_")continue;z[B]=F}var K=z.dryRun===!0||z.dryRun==="true",L=K?[q.GenerateLibraryEntries,q.Bump]:[q.GenerateLibraryEntries,q.LintFix,q.Bump],x=await C(L,{cwd:I(),...z});if(x&&x.isErr)E.error(`Release failed: ${x.error?.message??String(x.error)}`),process.exit(1);E.success(`Successfully released ${H.name}`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import m from"process";import{italic as l,log as c}from"@stacksjs/cli";import{route as g}from"@stacksjs/router";var f=["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"];function p(r){if(typeof r==="string")return r;if(typeof r==="function")return r.name?`[fn ${r.name}]`:"[fn]";return"[handler]"}function o(r,t){if(r.length>=t)return r;return r+" ".repeat(t-r.length)}function i(r){m.stdout.write(`${r}
|
|
3
|
+
`)}async function w(){try{await g.importRoutes()}catch(e){return{isErr:!0,error:e}}let r=g.routes??[];if(r.length===0)return i(l("No routes registered.")),{};let t=r.map((e)=>({method:String(e.method||"GET").toUpperCase(),uri:String(e.path||e.uri||""),handler:p(e.handler??e.action??""),name:String(e.name||""),middleware:Array.isArray(e.middleware)?e.middleware.join(","):String(e.middleware||"")}));t.sort((e,h)=>{let s=f.indexOf(e.method),a=f.indexOf(h.method);if(s!==a)return(s===-1?99:s)-(a===-1?99:a);return e.uri.localeCompare(h.uri)});let n={method:Math.max(6,...t.map((e)=>e.method.length)),uri:Math.max(3,...t.map((e)=>e.uri.length)),handler:Math.max(7,...t.map((e)=>e.handler.length)),name:Math.max(4,...t.map((e)=>e.name.length))},d=[o("METHOD",n.method),o("URI",n.uri),o("HANDLER",n.handler),o("NAME",n.name),"MIDDLEWARE"].join(" ");i(""),i(d),i("-".repeat(d.length));for(let e of t)i([o(e.method,n.method),o(e.uri,n.uri),o(e.handler,n.handler),o(e.name||"-",n.name),e.middleware||"-"].join(" "));return i(""),i(l(`${t.length} route${t.length===1?"":"s"} registered.`)),{}}var u=await w();if(u?.isErr)console.error(u.error),c.error("Route lists failed",u.error),m.exit(1);m.exit(0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MakeOptions } from '@stacksjs/types';
|
|
2
|
+
export declare function parseFields(input: string | undefined): CrudField[];
|
|
3
|
+
/**
|
|
4
|
+
* Generate a complete CRUD stack for a resource:
|
|
5
|
+
* - app/Models/<Model>.ts (defineModel definition)
|
|
6
|
+
* - database/migrations/<ts>-create-<table>-table.ts
|
|
7
|
+
* - app/Actions/<Model>{Index,Show,Store,Update,Destroy}Action.ts
|
|
8
|
+
*
|
|
9
|
+
* Honors `--dry-run` via the shared `isDryRunActive()` flag, so users
|
|
10
|
+
* can preview every file before committing to disk.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* buddy scaffold:crud Post --fields=title:string,body:text,published:boolean
|
|
14
|
+
*/
|
|
15
|
+
export declare function scaffoldCrud(name: string, options: MakeOptions & { fields?: string }): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Field declaration for CRUD scaffolding. Examples:
|
|
18
|
+
*
|
|
19
|
+
* --fields=title,body
|
|
20
|
+
* --fields=title:string,body:text,published:boolean,views:number
|
|
21
|
+
*/
|
|
22
|
+
export declare interface CrudField {
|
|
23
|
+
name: string
|
|
24
|
+
type: 'string' | 'text' | 'number' | 'boolean' | 'date' | 'json'
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import r from"process";import{parseOptions as e}from"@stacksjs/cli";import{log as s}from"@stacksjs/logging";import{flushModelDocuments as i}from"@stacksjs/search-engine";var t=e(),n=t.model,o=await i(n);if(o?.isErr)console.error(o.error),s.error("Flushing search engine failed",o.error);r.exit(0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import r from"process";import{parseOptions as t}from"@stacksjs/cli";import{log as e}from"@stacksjs/logging";import{importModelDocuments as i}from"@stacksjs/search-engine";var s=t(),m=s.model,o=await i(m);if(o?.isErr)console.error(o.error),e.error("Import to search engine failed",o.error);r.exit(0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import o from"process";import{parseOptions as t}from"@stacksjs/cli";import{log as i}from"@stacksjs/logging";import{listIndexSettings as s}from"@stacksjs/search-engine";var e=t(),n=e.model,r=await s(n);if(r?.isErr)console.error(r.error),i.error("Listing index settings failed",r.error);o.exit(0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import o from"process";import{config as s}from"@stacksjs/config";import{log as r}from"@stacksjs/logging";import{cors as t,route as e}from"@stacksjs/router";var a=o.env.APP_ENV==="production"||o.env.NODE_ENV==="production",n=Number(o.env.PORT)||s.ports?.api||3008,i=o.env.HOST||(a?"0.0.0.0":"127.0.0.1");r.info("[Stacks API] Starting server...");r.info(`[Stacks API] Environment: ${o.env.APP_ENV||"development"}`);e.use(t().handle.bind(t()));await e.importRoutes();await e.serve({port:n,hostname:i});r.info(`[Stacks API] Server running at http://${i}:${n}`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ssl';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"../../chunk-cdk2r2jd.js";import{l as a,m as b,n as c,o as d,p as e,q as f,r as g,s as h}from"../../chunk-x471rxrn.js";import"../../chunk-96b7fcmd.js";export{e as trustCertificate,c as sslCertificatesExist,g as setupSSL,h as isSSLSetupComplete,a as isDomainInHosts,d as isCertificateTrusted,f as generateCertificates,b as addDomainToHosts};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CliOptions } from '@stacksjs/types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if a domain is in the hosts file
|
|
4
|
+
*/
|
|
5
|
+
export declare function isDomainInHosts(domain: string): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Add a domain to the hosts file (requires sudo on Unix)
|
|
8
|
+
*/
|
|
9
|
+
export declare function addDomainToHosts(domain: string, verbose?: boolean): Promise<boolean>;
|
|
10
|
+
/**
|
|
11
|
+
* Check if SSL certificates exist for a domain
|
|
12
|
+
*/
|
|
13
|
+
export declare function sslCertificatesExist(domain: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a certificate is trusted (macOS only for now)
|
|
16
|
+
*/
|
|
17
|
+
export declare function isCertificateTrusted(domain: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Trust a certificate on macOS
|
|
20
|
+
*/
|
|
21
|
+
export declare function trustCertificate(domain: string, verbose?: boolean): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Generate SSL certificates for a domain using rpx
|
|
24
|
+
*/
|
|
25
|
+
export declare function generateCertificates(domain: string, verbose?: boolean): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* Complete SSL setup for development
|
|
28
|
+
*/
|
|
29
|
+
export declare function setupSSL(options?: SSLSetupOptions): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Check if SSL setup is complete for a domain
|
|
32
|
+
*/
|
|
33
|
+
export declare function isSSLSetupComplete(domain: string): boolean;
|
|
34
|
+
export declare interface SSLSetupOptions extends CliOptions {
|
|
35
|
+
domain?: string
|
|
36
|
+
skipHosts?: boolean
|
|
37
|
+
skipTrust?: boolean
|
|
38
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{l as a,m as b,n as c,o as d,p as e,q as f,r as g,s as h}from"../../chunk-x471rxrn.js";import"../../chunk-96b7fcmd.js";export{e as trustCertificate,c as sslCertificatesExist,g as setupSSL,h as isSSLSetupComplete,a as isDomainInHosts,d as isCertificateTrusted,f as generateCertificates,b as addDomainToHosts};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StackInstallOptions, StackListEntry, StackManifestEntry, StackUninstallOptions } from '@stacksjs/types';
|
|
2
|
+
export declare function installStack(options: StackInstallOptions): Promise<StackManifestEntry | null>;
|
|
3
|
+
export declare function uninstallStack(options: StackUninstallOptions): Promise<boolean>;
|
|
4
|
+
export declare function listStacks(): Promise<StackListEntry[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code generation templates for the make command
|
|
3
|
+
*
|
|
4
|
+
* These templates use the {0}, {1}, etc. format for template substitution
|
|
5
|
+
* which works with the @stacksjs/strings template function
|
|
6
|
+
*/
|
|
7
|
+
export declare const CODE_TEMPLATES: () => unknown;
|
|
8
|
+
export type TemplateKey = keyof typeof CODE_TEMPLATES;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import q from"process";import{log as u}from"@stacksjs/cli";import{projectPath as w}from"@stacksjs/path";var y=Bun.spawn(["sh","-c","bun test ./tests/feature/**"],{cwd:w(),stdio:["inherit","inherit","inherit"]}),f=await y.exited;if(f!==0)u.error("Tests failed"),q.exit(f??1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import f from"process";import{log as m}from"@stacksjs/cli";import{projectPath as q}from"@stacksjs/path";var v=Bun.spawn(["sh","-c","bun test --timeout 30000 ./tests/feature/** ./tests/integration/** ./tests/unit/**"],{cwd:q(),stdio:["inherit","inherit","inherit"]}),b=await v.exited;if(b!==0)m.error("Tests failed"),f.exit(b??1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import q from"process";import{log as u}from"@stacksjs/cli";import{projectPath as w}from"@stacksjs/path";var y=Bun.spawn(["sh","-c","bun test ./tests/unit/**"],{cwd:w(),stdio:["inherit","inherit","inherit"]}),f=await y.exited;if(f!==0)u.error("Tests failed"),q.exit(f??1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"../chunk-96b7fcmd.js";import t from"process";import{NpmScript as e}from"@stacksjs/enums";import{log as s}from"@stacksjs/logging";import{ExitCode as i}from"@stacksjs/types";import{runNpmScript as p}from"@stacksjs/utils";async function m(r){let o=await p(e.TypesFix,r);if(o.isErr)s.error("There was an error fixing your types.",o.error),t.exit(i.FatalError);s.success("Types are set")}async function u(r){return await m(r)}export{u as types,m as invoke};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import A from"process";import{runCommand as J}from"@stacksjs/cli";import{log as q}from"@stacksjs/logging";import{path as z}from"@stacksjs/path";import{ExitCode as B}from"@stacksjs/types";import{fs as F,storage as K}from"@stacksjs/storage";var v=z.buddyPath("dist/stacks"),G=z.homeDir(".stacks/bin/stacks"),L=z.homeDir(".stacks/bin/");q.info("Upgrading `stacks`...");var H=await J("bun compile.ts",{cwd:z.buddyPath()});if(H.isErr)q.error("There was an error compiling the binary",H.error),A.exit(B.FatalError);if(await K.exists(v))try{q.info("Updating Binary..."),q.info(`Source: ${v}`),q.info(`Destination: ${G}`),await F.ensureDir(L),await F.move(v,G,{overwrite:!0}),q.success("Binary Latest Version Is Used")}catch(I){q.error(I),A.exit(B.FatalError)}else q.error(`Binary source not found: ${v}`),A.exit(B.FatalError);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|