@stacksjs/defaults 0.74.48 → 0.74.51
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/app/Actions/Buddy/JobRetryAction.ts +1 -1
- package/app/Actions/Buddy/JobsListAction.ts +1 -1
- package/app/Actions/Buddy/ScheduleListAction.ts +1 -1
- package/app/Actions/Commerce/Shipping/courier-session.ts +1 -1
- package/app/Actions/Dashboard/Ci/failure-notifier.ts +1 -1
- package/app/Actions/Dashboard/Ci/runner-pressure-monitor.ts +1 -1
- package/app/Actions/Dashboard/Commerce/CommercePrintLogsAction.ts +1 -1
- package/app/Actions/Dashboard/Content/AuthorDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Content/AuthorIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Content/AuthorStoreAction.ts +1 -1
- package/app/Actions/Dashboard/Content/AuthorUpdateAction.ts +1 -1
- package/app/Actions/Dashboard/Content/CategoryDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Content/CategoryIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Content/CategoryStoreAction.ts +1 -1
- package/app/Actions/Dashboard/Content/CommentDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Content/CommentIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Content/CommentUpdateAction.ts +1 -1
- package/app/Actions/Dashboard/Content/ContentDashboardAction.ts +1 -1
- package/app/Actions/Dashboard/Content/PageDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Content/PageIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Content/PageStoreAction.ts +1 -1
- package/app/Actions/Dashboard/Content/PageUpdateAction.ts +1 -1
- package/app/Actions/Dashboard/Content/PostDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Content/PostIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Content/PostStoreAction.ts +1 -1
- package/app/Actions/Dashboard/Content/PostUpdateAction.ts +1 -1
- package/app/Actions/Dashboard/Content/TagDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Content/TagIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Content/TagStoreAction.ts +1 -1
- package/app/Actions/Dashboard/Content/content-input.ts +1 -1
- package/app/Actions/Dashboard/Content/file-metadata-store.ts +1 -1
- package/app/Actions/Dashboard/Content/post-input.ts +1 -1
- package/app/Actions/Dashboard/Email/InboxActivityAction.ts +1 -1
- package/app/Actions/Dashboard/Infrastructure/InsightsAction.ts +1 -1
- package/app/Actions/Dashboard/Infrastructure/log-provider.ts +1 -1
- package/app/Actions/Dashboard/Kanban/BoardDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/BoardShowAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/BoardStoreAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/BoardsIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/BoardsReorderAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/CardAssigneesSyncAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/CardDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/CardLabelsSyncAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/CardShowAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/CardStoreAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/CardsReorderAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/ColumnDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/ColumnStoreAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/ColumnsReorderAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/LabelDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Kanban/UsersListAction.ts +1 -1
- package/app/Actions/Dashboard/Library/GetAverageReleaseTime.ts +1 -1
- package/app/Actions/Dashboard/Library/GetDownloadCount.ts +1 -1
- package/app/Actions/Dashboard/Library/GetReleaseCount.ts +1 -1
- package/app/Actions/Dashboard/Marketing/AbandonedCartIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Marketing/CampaignDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Marketing/CampaignIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Marketing/ListDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Marketing/ListIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Marketing/campaign-delivery.ts +1 -1
- package/app/Actions/Dashboard/Notifications/NotificationDeliveryHistoryAction.ts +1 -1
- package/app/Actions/Dashboard/Notifications/NotificationDeliveryOverviewAction.ts +1 -1
- package/app/Actions/Dashboard/Queries/QueryDashboardAction.ts +1 -1
- package/app/Actions/Dashboard/Queries/QueryShowAction.ts +1 -1
- package/app/Actions/Dashboard/Teams/TeamInvitationDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Teams/TeamInvitationResendAction.ts +1 -1
- package/app/Actions/Dashboard/Teams/TeamInviteAction.ts +1 -1
- package/app/Actions/Dashboard/Teams/TeamMemberDestroyAction.ts +1 -1
- package/app/Actions/Dashboard/Teams/TeamMemberUpdateAction.ts +1 -1
- package/app/Actions/Dashboard/Teams/TeamPeopleIndexAction.ts +1 -1
- package/app/Actions/Dashboard/Teams/team-invitation-delivery.ts +1 -1
- package/app/Actions/Dashboard/Teams/team-member-count.ts +1 -1
- package/app/Actions/HealthAction.ts +1 -1
- package/app/Actions/Realtime/FetchWebsocketsAction.ts +1 -1
- package/app/Actions/SitemapAction.ts +1 -1
- package/app/Actions/Storefront/AddToCartAction.ts +1 -1
- package/app/Actions/Storefront/CheckoutContactAction.ts +1 -1
- package/app/Actions/Storefront/CheckoutShippingAction.ts +1 -1
- package/app/Actions/Storefront/GetCartAction.ts +1 -1
- package/app/Actions/Storefront/PlaceOrderAction.ts +1 -1
- package/app/Actions/Storefront/SubmitReviewAction.ts +1 -1
- package/app/Actions/Storefront/UpdateCartItemAction.ts +1 -1
- package/app/Actions/Teams/AcceptInvitationAction.ts +1 -1
- package/app/Actions/Teams/ShowInvitationAction.ts +1 -1
- package/app/Controllers/QueryController.ts +1 -1
- package/app/Middleware/Maintenance.ts +16 -4
- package/bootstrap.ts +0 -27
- package/ide/vscode/package.json +1 -1
- package/package.json +2 -2
|
@@ -16,7 +16,7 @@ export default new Action({
|
|
|
16
16
|
if (!id) return new Response(JSON.stringify({ error: 'missing id' }), { status: 400 })
|
|
17
17
|
|
|
18
18
|
try {
|
|
19
|
-
const { db } = await import('@stacksjs/database')
|
|
19
|
+
const { db } = await import('@stacksjs/database/runtime')
|
|
20
20
|
const dbAny = db as any
|
|
21
21
|
|
|
22
22
|
const failed = await dbAny.selectFrom('failed_jobs').selectAll().where('id', '=', id).executeTakeFirst()
|
|
@@ -25,7 +25,7 @@ export default new Action({
|
|
|
25
25
|
const perPage = Math.min(100, Math.max(1, Number(request.get('perPage', 25) ?? 25)))
|
|
26
26
|
|
|
27
27
|
try {
|
|
28
|
-
const { db } = await import('@stacksjs/database')
|
|
28
|
+
const { db } = await import('@stacksjs/database/runtime')
|
|
29
29
|
const dbAny = db as any
|
|
30
30
|
|
|
31
31
|
// Pull the live `jobs` table — this contains queued + reserved (processing) rows.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
import type { DashboardData, FailedTransition, PreviousRunState } from '@stacksjs/github'
|
|
22
22
|
import { dashboard as dashboardConfig } from '@stacksjs/config'
|
|
23
|
-
import { db } from '@stacksjs/database'
|
|
23
|
+
import { db } from '@stacksjs/database/runtime'
|
|
24
24
|
import { detectNewlyFailedRuns } from '@stacksjs/github'
|
|
25
25
|
import { notify } from '@stacksjs/notifications'
|
|
26
26
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
import type { DashboardData, PressureAction, RunnerAlertState, RunnerSample } from '@stacksjs/github'
|
|
28
28
|
import { dashboard as dashboardConfig } from '@stacksjs/config'
|
|
29
|
-
import { db } from '@stacksjs/database'
|
|
29
|
+
import { db } from '@stacksjs/database/runtime'
|
|
30
30
|
import { detectRunnerPressure } from '@stacksjs/github'
|
|
31
31
|
import { notify } from '@stacksjs/notifications'
|
|
32
32
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { formatDate, PrintDevice } from '@stacksjs/orm'
|
|
5
5
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
6
6
|
import { dashboardRequestValue } from '../dashboard-request'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { isUniqueViolation, transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { randomUUIDv7 } from 'bun'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { isUniqueViolation, transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { randomUUIDv7 } from 'bun'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
5
5
|
|
|
6
6
|
const ALLOWED_RANGES = new Set([1, 7, 30, 90, 365])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { randomUUIDv7 } from 'bun'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { randomUUIDv7 } from 'bun'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { isUniqueViolation, transaction } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { randomUUIDv7 } from 'bun'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StorageItemMetadata, StorageItemTask, StorageMetadataStore, StorageTaskKind, StorageTaskState } from './file-metadata'
|
|
2
|
-
import { db, sqlDateTime } from '@stacksjs/database'
|
|
2
|
+
import { db, sqlDateTime } from '@stacksjs/database/runtime'
|
|
3
3
|
import { isEmptyMetadata, isUnderPrefix, normalizeTags, repathUnderPrefix, STORAGE_ITEM_TYPE } from './file-metadata'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { emailSDK } from '@stacksjs/email'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { dashboardRequestValue } from '../dashboard-request'
|
|
@@ -4,7 +4,7 @@ import { resolve } from 'node:path'
|
|
|
4
4
|
import { Action } from '@stacksjs/actions'
|
|
5
5
|
import { cache } from '@stacksjs/cache'
|
|
6
6
|
import { config } from '@stacksjs/config'
|
|
7
|
-
import { db } from '@stacksjs/database'
|
|
7
|
+
import { db } from '@stacksjs/database/runtime'
|
|
8
8
|
import { checkQueueHealth } from '@stacksjs/queue'
|
|
9
9
|
import { dashboardOperationalIssue } from '../dashboard-response'
|
|
10
10
|
import {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DashboardProviderUnavailable } from '../dashboard-provider'
|
|
2
2
|
import type { DashboardLogRecord, DashboardLogSummary } from './log-dashboard'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { HQ_READ_UNAVAILABLE, readThroughProvider, resolveDashboardDriver } from '../dashboard-provider'
|
|
5
5
|
import { DASHBOARD_LOG_TYPES, normalizeDashboardLog, summarizeDashboardLogTypes } from './log-dashboard'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { modelBoolean } from './kanban-model'
|
|
5
5
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { Board } from '@stacksjs/orm'
|
|
5
5
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface ReorderInput {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface SyncInput {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface SyncInput {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { modelBoolean } from './kanban-model'
|
|
5
5
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { BoardColumn, Card } from '@stacksjs/orm'
|
|
5
5
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface ColumnReorder {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { Board, BoardColumn } from '@stacksjs/orm'
|
|
5
5
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface ReorderInput {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions'
|
|
2
2
|
import { config } from '@stacksjs/config'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
5
5
|
import { normalizeAbandonedCarts } from './abandoned-cart-records'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { Campaign } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { marketingModelError, marketingRecordId } from './marketing-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions'
|
|
2
2
|
import { config } from '@stacksjs/config'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { Campaign, EmailList } from '@stacksjs/orm'
|
|
5
5
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
6
6
|
import { normalizeCampaigns } from './campaign-records'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { EmailList } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { marketingModelError, marketingRecordId } from './marketing-response'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions'
|
|
2
|
-
import { db } from '@stacksjs/database'
|
|
2
|
+
import { db } from '@stacksjs/database/runtime'
|
|
3
3
|
import { EmailList } from '@stacksjs/orm'
|
|
4
4
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
5
5
|
import { normalizeMarketingLists } from './marketing-list-records'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { response } from '@stacksjs/router'
|
|
5
5
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
6
6
|
import { dashboardRequestValue } from '../dashboard-request'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions'
|
|
2
2
|
import { config } from '@stacksjs/config'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
5
5
|
import { dashboardQueryColumns, mapDashboardQueryLog, type QueryLogSourceRow } from './query-dashboard'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { response } from '@stacksjs/router'
|
|
5
5
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
6
6
|
import { dashboardQueryColumns, mapDashboardQueryLog, type QueryLogSourceRow } from './query-dashboard'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { response } from '@stacksjs/router'
|
|
5
5
|
import { teamOperationalError } from '../../Teams/team-response'
|
|
6
6
|
import {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { isUniqueViolation } from '@stacksjs/orm'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
6
|
import { teamOperationalError } from '../../Teams/team-response'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { randomUUID } from 'node:crypto'
|
|
3
3
|
import { Action } from '@stacksjs/actions'
|
|
4
|
-
import { db } from '@stacksjs/database'
|
|
4
|
+
import { db } from '@stacksjs/database/runtime'
|
|
5
5
|
import { isUniqueViolation } from '@stacksjs/orm'
|
|
6
6
|
import { response } from '@stacksjs/router'
|
|
7
7
|
import { TeamStateConflictError, teamOperationalError } from '../../Teams/team-response'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { response } from '@stacksjs/router'
|
|
5
5
|
import { TeamStateConflictError, teamOperationalError } from '../../Teams/team-response'
|
|
6
6
|
import { syncTeamMemberCount } from './team-member-count'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db, getDatabaseDialect, sqlHelpers } from '@stacksjs/database'
|
|
3
|
+
import { db, getDatabaseDialect, sqlHelpers } from '@stacksjs/database/runtime'
|
|
4
4
|
import { response } from '@stacksjs/router'
|
|
5
5
|
import { teamOperationalError } from '../../Teams/team-response'
|
|
6
6
|
import { syncTeamMemberCount } from './team-member-count'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { response } from '@stacksjs/router'
|
|
5
5
|
import { teamOperationalError } from '../../Teams/team-response'
|
|
6
6
|
import { invitationStatus, parsePositiveId } from './team-records'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { config } from '@stacksjs/config'
|
|
2
|
-
import { db } from '@stacksjs/database'
|
|
2
|
+
import { db } from '@stacksjs/database/runtime'
|
|
3
3
|
import { sendTeamInvitation } from '../../../Mail/TeamInvitation'
|
|
4
4
|
import { teamOperationalIssue } from '../../Teams/team-response'
|
|
5
5
|
import { changedRows, invitationUrl, sqlTimestamp } from './team-records'
|
|
@@ -33,7 +33,7 @@ async function getServiceHealth() {
|
|
|
33
33
|
// Database Health
|
|
34
34
|
const dbStart = Date.now()
|
|
35
35
|
try {
|
|
36
|
-
const { db } = await import('@stacksjs/database')
|
|
36
|
+
const { db } = await import('@stacksjs/database/runtime')
|
|
37
37
|
await db.selectFrom('users').select('id').limit(1).execute()
|
|
38
38
|
const dbLatency = Date.now() - dbStart
|
|
39
39
|
services.push({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions'
|
|
2
2
|
import { config } from '@stacksjs/config'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { response } from '@stacksjs/router'
|
|
5
5
|
import { existsSync, readdirSync, statSync } from 'node:fs'
|
|
6
6
|
import { join } from 'node:path'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions'
|
|
2
|
-
import { db } from '@stacksjs/database'
|
|
2
|
+
import { db } from '@stacksjs/database/runtime'
|
|
3
3
|
import { response } from '@stacksjs/router'
|
|
4
4
|
import { randomUUIDv7 } from 'bun'
|
|
5
5
|
import { readCartCookie, writeCartCookie } from '../../Storefront/CartCookie'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions'
|
|
2
2
|
import { config } from '@stacksjs/config'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { response } from '@stacksjs/router'
|
|
5
5
|
import { sendOrderConfirmation } from '../../Mail/OrderConfirmation'
|
|
6
6
|
import { readCartCookie } from '../../Storefront/CartCookie'
|
|
@@ -2,7 +2,7 @@ import type { RequestInstance } from '@stacksjs/types'
|
|
|
2
2
|
import { randomUUID } from 'node:crypto'
|
|
3
3
|
import { Action } from '@stacksjs/actions'
|
|
4
4
|
import { resolveAuthenticatedUser } from '@stacksjs/auth'
|
|
5
|
-
import { db } from '@stacksjs/database'
|
|
5
|
+
import { db } from '@stacksjs/database/runtime'
|
|
6
6
|
import { response } from '@stacksjs/router'
|
|
7
7
|
import {
|
|
8
8
|
changedRows,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
|
-
import { db } from '@stacksjs/database'
|
|
3
|
+
import { db } from '@stacksjs/database/runtime'
|
|
4
4
|
import { response } from '@stacksjs/router'
|
|
5
5
|
import { hashInvitationToken, invitationStatus } from '../Dashboard/Teams/team-records'
|
|
6
6
|
import { teamOperationalError } from './team-response'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { config } from '@stacksjs/config'
|
|
2
|
-
import { db, mutationCount, sql, sqlDateTime } from '@stacksjs/database'
|
|
2
|
+
import { db, mutationCount, sql, sqlDateTime } from '@stacksjs/database/runtime'
|
|
3
3
|
import { Controller } from '@stacksjs/server'
|
|
4
4
|
|
|
5
5
|
const DAY_MS = 86_400_000
|
|
@@ -28,11 +28,23 @@ export default new Middleware({
|
|
|
28
28
|
name: 'maintenance',
|
|
29
29
|
priority: 0, // Run first, before all other middleware
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
handle(request) {
|
|
32
|
+
if (!serverModule) {
|
|
33
|
+
return import('@stacksjs/server').then((module) => {
|
|
34
|
+
serverModule = module
|
|
35
|
+
return module.maintenanceGate(request)
|
|
36
|
+
}).then(throwIfGated)
|
|
37
|
+
}
|
|
33
38
|
|
|
34
|
-
const gated =
|
|
39
|
+
const gated = serverModule.maintenanceGate(request)
|
|
40
|
+
if (gated instanceof Promise)
|
|
41
|
+
return gated.then(throwIfGated)
|
|
35
42
|
if (gated)
|
|
36
|
-
|
|
43
|
+
return Promise.reject(gated)
|
|
37
44
|
},
|
|
38
45
|
})
|
|
46
|
+
|
|
47
|
+
function throwIfGated(gated: Response | null): void {
|
|
48
|
+
if (gated)
|
|
49
|
+
throw gated // short-circuit the request
|
|
50
|
+
}
|
package/bootstrap.ts
CHANGED
|
@@ -26,33 +26,6 @@ import { frameworkPath } from '@stacksjs/path'
|
|
|
26
26
|
import { route } from '@stacksjs/router'
|
|
27
27
|
import MaintenanceMiddleware from './app/Middleware/Maintenance'
|
|
28
28
|
|
|
29
|
-
// RBAC: wire the bun-query-builder-backed store so `hasRole(user, …)` and
|
|
30
|
-
// friends from `@stacksjs/auth` actually hit the database (otherwise every
|
|
31
|
-
// call throws "RBAC store not configured"). The store is a thin adapter
|
|
32
|
-
// over the `roles` / `permissions` / `user_roles` / `user_permissions` /
|
|
33
|
-
// `role_permissions` tables created by migrations 0000000101–0000000105.
|
|
34
|
-
// Registered unconditionally because the auth middleware + Role middleware
|
|
35
|
-
// both reach for the helpers at request time regardless of which feature
|
|
36
|
-
// the project opts into.
|
|
37
|
-
// DEFERRED, non-blocking wiring on purpose. This file is dynamically
|
|
38
|
-
// imported by the route loader while other entrypoints (a test file, the
|
|
39
|
-
// API server) may still be mid-way through evaluating the @stacksjs/auth
|
|
40
|
-
// async module graph. With a static `import { setRbacStore } ...`, Bun
|
|
41
|
-
// could execute this module against auth's partially-evaluated record:
|
|
42
|
-
// the exported function exists (hoisted) but rbac.ts's module-level
|
|
43
|
-
// `let store` hadn't initialized, so calling it threw
|
|
44
|
-
// `Cannot access 'store' before initialization`, the whole bootstrap
|
|
45
|
-
// import failed, and EVERY framework default route (auth, 2FA, passkeys,
|
|
46
|
-
// dashboard) silently vanished — the loader logs one line and carries
|
|
47
|
-
// on. A blocking `await import('@stacksjs/auth')` here deadlocks instead
|
|
48
|
-
// (auth's evaluation can be waiting on the same route-loading pass that
|
|
49
|
-
// is importing this file), so the wiring is fire-and-forget: routes
|
|
50
|
-
// register immediately, and the RBAC store lands the moment auth's
|
|
51
|
-
// evaluation completes — before any real request needs it.
|
|
52
|
-
import('@stacksjs/auth')
|
|
53
|
-
.then(({ createBqbRbacStore, setRbacStore }) => setRbacStore(createBqbRbacStore()))
|
|
54
|
-
.catch(err => console.error('[bootstrap] RBAC store wiring failed:', err))
|
|
55
|
-
|
|
56
29
|
// Global maintenance / coming-soon gate. Registered first so the
|
|
57
30
|
// `buddy down` / `buddy coming-soon` (and their env-var equivalents)
|
|
58
31
|
// state files intercept every request before any other middleware or
|
package/ide/vscode/package.json
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/defaults",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.51",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@iconify-json/f7": "^1.2.2",
|
|
57
57
|
"@iconify-json/hugeicons": "^1.2.27",
|
|
58
|
-
"@stacksjs/mobile": "^0.74.
|
|
58
|
+
"@stacksjs/mobile": "^0.74.51",
|
|
59
59
|
"@stacksjs/sanitizer": "^0.2.113",
|
|
60
60
|
"ts-qr-codes": "^0.1.8"
|
|
61
61
|
}
|