@stacksjs/defaults 0.75.489 → 0.75.490
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/ai/skills/stacks-actions/SKILL.md +1 -1
- package/ai/skills/stacks-dashboard/SKILL.md +20 -2
- package/ai/skills/stacks-native/CATALOG.md +9 -9
- package/ai/skills/stacks-search-engine/SKILL.md +14 -0
- package/app/Actions/Dashboard/Commerce/CommerceCategoriesAction.ts +7 -13
- package/app/Actions/Dashboard/Commerce/CommerceCustomerChoicesAction.ts +34 -0
- package/app/Actions/Dashboard/Commerce/CommerceDeliveryAction.ts +7 -16
- package/app/Actions/Dashboard/Commerce/CommerceGiftCardsAction.ts +21 -15
- package/app/Actions/Dashboard/Commerce/CommerceGiftCardsExportAction.ts +41 -0
- package/app/Actions/Dashboard/Commerce/CommerceOrderCustomersAction.ts +37 -0
- package/app/Actions/Dashboard/Commerce/CommerceOrdersAction.ts +26 -41
- package/app/Actions/Dashboard/Commerce/CommerceOrdersExportAction.ts +43 -0
- package/app/Actions/Dashboard/Commerce/CommercePaymentsAction.ts +24 -21
- package/app/Actions/Dashboard/Commerce/CommercePaymentsExportAction.ts +41 -0
- package/app/Actions/Dashboard/Commerce/CommercePosAction.ts +18 -48
- package/app/Actions/Dashboard/Commerce/CommercePosProductsAction.ts +39 -0
- package/app/Actions/Dashboard/Commerce/CommercePrintLogsAction.ts +14 -104
- package/app/Actions/Dashboard/Commerce/CommercePrintLogsExportAction.ts +41 -0
- package/app/Actions/Dashboard/Commerce/CommerceProductChoicesAction.ts +32 -0
- package/app/Actions/Dashboard/Commerce/CommerceProductsAction.ts +24 -43
- package/app/Actions/Dashboard/Commerce/CommerceProductsExportAction.ts +44 -0
- package/app/Actions/Dashboard/Commerce/CourierIndexAction.ts +3 -1
- package/app/Actions/Dashboard/Commerce/DeliveryRouteIndexAction.ts +23 -12
- package/app/Actions/Dashboard/Commerce/DigitalDeliveryIndexAction.ts +3 -1
- package/app/Actions/Dashboard/Commerce/LicenseKeyIndexAction.ts +24 -23
- package/app/Actions/Dashboard/Commerce/LicenseKeyOptionsAction.ts +35 -16
- package/app/Actions/Dashboard/Commerce/ProductWaitlistIndexAction.ts +22 -22
- package/app/Actions/Dashboard/Commerce/RestaurantWaitlistIndexAction.ts +22 -17
- package/app/Actions/Dashboard/Commerce/ReviewIndexAction.ts +22 -31
- package/app/Actions/Dashboard/Commerce/ShippingMethodIndexAction.ts +3 -1
- package/app/Actions/Dashboard/Commerce/ShippingRateIndexAction.ts +3 -1
- package/app/Actions/Dashboard/Commerce/ShippingZoneIndexAction.ts +3 -1
- package/app/Actions/Dashboard/Commerce/commerce-category-list.test.ts +100 -0
- package/app/Actions/Dashboard/Commerce/commerce-category-list.ts +26 -0
- package/app/Actions/Dashboard/Commerce/commerce-choice-records.ts +56 -0
- package/app/Actions/Dashboard/Commerce/commerce-choices.test.ts +88 -0
- package/app/Actions/Dashboard/Commerce/commerce-choices.ts +70 -0
- package/app/Actions/Dashboard/Commerce/commerce-delivery-overview.test.ts +151 -0
- package/app/Actions/Dashboard/Commerce/commerce-delivery-overview.ts +85 -0
- package/app/Actions/Dashboard/Commerce/commerce-delivery-route-list.test.ts +153 -0
- package/app/Actions/Dashboard/Commerce/commerce-delivery-route-list.ts +180 -0
- package/app/Actions/Dashboard/Commerce/commerce-delivery.ts +24 -9
- package/app/Actions/Dashboard/Commerce/commerce-gift-card-list.test.ts +221 -0
- package/app/Actions/Dashboard/Commerce/commerce-gift-card-list.ts +259 -0
- package/app/Actions/Dashboard/Commerce/commerce-license-key-list.test.ts +184 -0
- package/app/Actions/Dashboard/Commerce/commerce-license-key-list.ts +217 -0
- package/app/Actions/Dashboard/Commerce/commerce-order-list.test.ts +183 -0
- package/app/Actions/Dashboard/Commerce/commerce-order-list.ts +278 -0
- package/app/Actions/Dashboard/Commerce/commerce-order-records.test.ts +29 -0
- package/app/Actions/Dashboard/Commerce/commerce-payment-list.test.ts +180 -0
- package/app/Actions/Dashboard/Commerce/commerce-payment-list.ts +272 -0
- package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.test.ts +171 -0
- package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.ts +152 -0
- package/app/Actions/Dashboard/Commerce/commerce-pos.test.ts +1 -12
- package/app/Actions/Dashboard/Commerce/commerce-pos.ts +0 -26
- package/app/Actions/Dashboard/Commerce/commerce-print-log-list.test.ts +202 -0
- package/app/Actions/Dashboard/Commerce/commerce-print-log-list.ts +286 -0
- package/app/Actions/Dashboard/Commerce/commerce-product-list.test.ts +174 -0
- package/app/Actions/Dashboard/Commerce/commerce-product-list.ts +276 -0
- package/app/Actions/Dashboard/Commerce/commerce-product-waitlist-list.test.ts +183 -0
- package/app/Actions/Dashboard/Commerce/commerce-product-waitlist-list.ts +170 -0
- package/app/Actions/Dashboard/Commerce/commerce-record.ts +21 -0
- package/app/Actions/Dashboard/Commerce/commerce-restaurant-waitlist-list.test.ts +189 -0
- package/app/Actions/Dashboard/Commerce/commerce-restaurant-waitlist-list.ts +177 -0
- package/app/Actions/Dashboard/Commerce/commerce-review-list.test.ts +193 -0
- package/app/Actions/Dashboard/Commerce/commerce-review-list.ts +220 -0
- package/app/Actions/Dashboard/Commerce/commerce-sql.ts +57 -0
- package/app/Actions/Dashboard/Commerce/payment-records.test.ts +16 -0
- package/app/Actions/Dashboard/Commerce/product-waitlist-records.test.ts +6 -5
- package/app/Actions/Dashboard/Commerce/product-waitlist-records.ts +16 -45
- package/app/Actions/Dashboard/Commerce/restaurant-waitlist-records.ts +4 -24
- package/app/Actions/Dashboard/Content/content-list.ts +10 -0
- package/app/Actions/Dashboard/Content/file-listing-metadata.test.ts +46 -0
- package/app/Actions/Dashboard/Content/file-manager.ts +51 -10
- package/app/Actions/Dashboard/DashboardHomeAction.test.ts +13 -9
- package/app/Actions/Dashboard/DashboardHomeAction.ts +42 -21
- package/app/Actions/Dashboard/Jobs/JobStatsAction.ts +5 -2
- package/app/Actions/Dashboard/Kanban/UsersListAction.ts +13 -9
- package/app/Actions/Dashboard/Kanban/kanban-response.test.ts +40 -0
- package/app/Actions/Dashboard/Kanban/kanban-response.ts +53 -1
- package/app/Actions/Dashboard/Kanban/kanban-users.test.ts +114 -0
- package/app/Actions/Dashboard/Kanban/kanban-users.ts +32 -0
- package/app/Actions/Dashboard/Models/ModelShowAction.ts +8 -0
- package/app/Actions/Dashboard/Models/ModelsIndexAction.ts +16 -2
- package/app/Actions/Dashboard/Models/model-migration.test.ts +27 -0
- package/app/Actions/Dashboard/Models/model-migration.ts +23 -0
- package/app/Actions/Dashboard/Queue/QueueStatsAction.ts +5 -3
- package/app/Actions/Dashboard/Queue/QueueWorkersAction.ts +3 -2
- package/app/Actions/Dashboard/Queue/worker-snapshots.test.ts +31 -0
- package/app/Actions/Dashboard/Queue/worker-snapshots.ts +33 -0
- package/app/Actions/Dashboard/named-search.test.ts +36 -0
- package/app/Actions/Dashboard/named-search.ts +80 -0
- package/app/Models/Request.ts +4 -2
- package/functions/commerce/shippings/dashboard-resource.ts +12 -1
- package/functions/commerce/shippings/delivery-routes.ts +1 -0
- package/functions/commerce/shippings/license-keys.ts +1 -0
- package/functions/dashboard-list.test.ts +132 -1
- package/functions/dashboard-list.ts +198 -1
- package/functions/queue.ts +2 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +2 -2
- package/resources/components/Dashboard/Commerce/CommerceGiftCardBreakdown.stx +38 -12
- package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +122 -68
- package/resources/components/Dashboard/Commerce/CommerceGiftCardsTable.stx +29 -6
- package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +59 -2
- package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +126 -80
- package/resources/components/Dashboard/Commerce/CommerceOrdersTable.stx +28 -3
- package/resources/components/Dashboard/Commerce/CommercePaymentsBreakdown.stx +12 -29
- package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +139 -60
- package/resources/components/Dashboard/Commerce/CommercePaymentsTable.stx +27 -2
- package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +17 -1
- package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +47 -3
- package/resources/components/Dashboard/Commerce/CommercePosDashboard.stx +59 -49
- package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +116 -82
- package/resources/components/Dashboard/Commerce/CommerceProductsTable.stx +28 -4
- package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +120 -69
- package/resources/components/Dashboard/Commerce/CommerceReviewsTable.stx +29 -6
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +79 -52
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +31 -8
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +71 -13
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +69 -81
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +31 -8
- package/resources/components/Dashboard/Commerce/PrintLogBreakdown.stx +21 -17
- package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +23 -22
- package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +116 -20
- package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +100 -12
- package/resources/components/Dashboard/Commerce/ProductWaitlistTable.stx +34 -16
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +107 -19
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +65 -6
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistTable.stx +29 -3
- package/resources/components/Dashboard/Kanban/KanbanBoardsDashboard.stx +10 -1
- package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +21 -1
- package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +24 -4
- package/resources/components/Dashboard/Models/ModelsOverview.stx +13 -2
- package/resources/components/Dashboard/Queue/QueueDashboard.stx +7 -1
- package/routes/dashboard-api.ts +11 -0
- package/views/dashboard/stores/kanban.ts +38 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions/runtime'
|
|
2
|
-
import { readWorkerSnapshots } from '@stacksjs/queue'
|
|
3
2
|
import { dashboardOperationalError } from '../dashboard-response'
|
|
3
|
+
import { readDashboardWorkerSnapshots } from './worker-snapshots'
|
|
4
4
|
|
|
5
5
|
export default new Action({
|
|
6
6
|
name: 'QueueWorkersAction',
|
|
@@ -8,7 +8,7 @@ export default new Action({
|
|
|
8
8
|
method: 'GET',
|
|
9
9
|
async handle() {
|
|
10
10
|
try {
|
|
11
|
-
const snapshots = await
|
|
11
|
+
const { snapshots, migrated } = await readDashboardWorkerSnapshots()
|
|
12
12
|
const tracked = snapshots.map(snapshot => snapshot.worker)
|
|
13
13
|
|
|
14
14
|
// Translate the tracker's internal status into the dashboard's vocabulary
|
|
@@ -38,6 +38,7 @@ export default new Action({
|
|
|
38
38
|
data,
|
|
39
39
|
worker_running: tracked.some(worker => worker.status !== 'stopped'),
|
|
40
40
|
active_jobs: snapshots.reduce((sum, snapshot) => sum + snapshot.activeJobs, 0),
|
|
41
|
+
workers_migrated: migrated,
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
catch (error) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test'
|
|
2
|
+
import type { WorkerSnapshot } from '@stacksjs/queue'
|
|
3
|
+
import { readDashboardWorkerSnapshots } from './worker-snapshots'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Worker heartbeats are telemetry beside the jobs. A missing `queue_workers`
|
|
7
|
+
* table must leave the Queue and Jobs pages their counts; any other failure
|
|
8
|
+
* must still fail them.
|
|
9
|
+
*/
|
|
10
|
+
describe('readDashboardWorkerSnapshots', () => {
|
|
11
|
+
test('reads the heartbeats when the table exists, without asking the catalog', async () => {
|
|
12
|
+
const snapshot = { worker: { id: 'w1' } } as unknown as WorkerSnapshot
|
|
13
|
+
const read = await readDashboardWorkerSnapshots(async () => [snapshot], async () => { throw new Error('the catalog must not be asked') })
|
|
14
|
+
expect(read).toEqual({ snapshots: [snapshot], migrated: true })
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
test('a missing queue_workers table answers no workers and migrated: false', async () => {
|
|
18
|
+
const asked: string[] = []
|
|
19
|
+
const read = await readDashboardWorkerSnapshots(
|
|
20
|
+
async () => { throw new Error('relation "queue_workers" does not exist') },
|
|
21
|
+
async (table) => { asked.push(table); return true },
|
|
22
|
+
)
|
|
23
|
+
expect(read).toEqual({ snapshots: [], migrated: false })
|
|
24
|
+
expect(asked).toEqual(['queue_workers'])
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
test('any other failure is rethrown', async () => {
|
|
28
|
+
const outage = new Error('connection refused')
|
|
29
|
+
await expect(readDashboardWorkerSnapshots(async () => { throw outage }, async () => false)).rejects.toBe(outage)
|
|
30
|
+
})
|
|
31
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { WorkerSnapshot } from '@stacksjs/queue'
|
|
2
|
+
import { readWorkerSnapshots } from '@stacksjs/queue'
|
|
3
|
+
import { isUnmigratedTable } from '../Models/model-migration'
|
|
4
|
+
|
|
5
|
+
/** Where workers publish their heartbeats (`app/Models/QueueWorker.ts`). */
|
|
6
|
+
export const WORKER_TABLE = 'queue_workers'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The worker heartbeats, for the Queue and Jobs pages.
|
|
10
|
+
*
|
|
11
|
+
* Heartbeats are telemetry beside the jobs, not the jobs: the queue counts and
|
|
12
|
+
* job totals come from `jobs` and `failed_jobs`, and a worker already runs
|
|
13
|
+
* without its telemetry table ("Queue worker telemetry unavailable"). So an app
|
|
14
|
+
* that has not migrated `queue_workers` gets its counts with no workers and
|
|
15
|
+
* `migrated: false`, where all three endpoints used to answer 503 and take the
|
|
16
|
+
* page's counts down with them.
|
|
17
|
+
*
|
|
18
|
+
* Only a missing table, as the catalog reports it, is treated that way. Any
|
|
19
|
+
* other failure is rethrown.
|
|
20
|
+
*/
|
|
21
|
+
export async function readDashboardWorkerSnapshots(
|
|
22
|
+
read: () => Promise<WorkerSnapshot[]> = readWorkerSnapshots,
|
|
23
|
+
isMissing: (table: string) => Promise<boolean> = isUnmigratedTable,
|
|
24
|
+
): Promise<{ snapshots: WorkerSnapshot[], migrated: boolean }> {
|
|
25
|
+
try {
|
|
26
|
+
return { snapshots: await read(), migrated: true }
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (await isMissing(WORKER_TABLE))
|
|
30
|
+
return { snapshots: [], migrated: false }
|
|
31
|
+
throw error
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Database } from 'bun:sqlite'
|
|
2
|
+
import { describe, expect, test } from 'bun:test'
|
|
3
|
+
import type { NamedSearchRunner, NamedSearchTable } from './named-search'
|
|
4
|
+
import { searchNamedRows } from './named-search'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shared picker search. kanban-users.test.ts runs it against users on
|
|
8
|
+
* SQLite, PostgreSQL and MySQL; this pins what that does not: the table name
|
|
9
|
+
* is SQL, so only the fixed list is accepted, and customers search the same way.
|
|
10
|
+
*/
|
|
11
|
+
function sqlite(): { database: Database, run: NamedSearchRunner } {
|
|
12
|
+
const database = new Database(':memory:')
|
|
13
|
+
return { database, run: { unsafe: (sql, values = []) => ({ execute: async () => database.query(sql).all(...(values as string[])) }) } }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
describe('searchNamedRows', () => {
|
|
17
|
+
test('searches customers by name or email, bounded, with the full count', async () => {
|
|
18
|
+
const { database, run } = sqlite()
|
|
19
|
+
database.run('CREATE TABLE customers (id INTEGER PRIMARY KEY, name TEXT, email TEXT)')
|
|
20
|
+
for (let index = 1; index <= 40; index++)
|
|
21
|
+
database.query('INSERT INTO customers (name, email) VALUES (?, ?)').run(`Customer ${String(index).padStart(2, '0')}`, `c${index}@example.com`)
|
|
22
|
+
database.query('INSERT INTO customers (name, email) VALUES (?, ?)').run('Zed Ortiz', 'ZED@shop.test')
|
|
23
|
+
|
|
24
|
+
const page = await searchNamedRows('customers', { search: 'customer', limit: 25 }, run, 'sqlite')
|
|
25
|
+
expect(page.rows).toHaveLength(25)
|
|
26
|
+
expect(page.total).toBe(40)
|
|
27
|
+
expect((await searchNamedRows('customers', { search: 'zed@SHOP', limit: 25 }, run, 'sqlite')).rows.map(row => row.name)).toEqual(['Zed Ortiz'])
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
test('refuses a table that is not on the list, before running anything', async () => {
|
|
31
|
+
let ran = false
|
|
32
|
+
const run: NamedSearchRunner = { unsafe: () => ({ execute: async () => { ran = true; return [] } }) }
|
|
33
|
+
await expect(searchNamedRows('users; DROP TABLE users' as NamedSearchTable, { search: '', limit: 5 }, run, 'sqlite')).rejects.toThrow('is not a searchable table')
|
|
34
|
+
expect(ran).toBeFalse()
|
|
35
|
+
})
|
|
36
|
+
})
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { QueryBuilderDialect } from '@stacksjs/database/runtime'
|
|
2
|
+
import { db, getDatabaseDialect, sqlHelpers } from '@stacksjs/database/runtime'
|
|
3
|
+
import type { QueryReader } from './Content/content-list'
|
|
4
|
+
import { containsPattern, countOf, queryText } from './Content/content-list'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A search over a table's `name` and `email`, for the dashboard's pickers: the
|
|
8
|
+
* Kanban assignee picker (users, stacksjs/stacks#3216) and the order dialog's
|
|
9
|
+
* customer (customers, stacksjs/stacks#3218). Each used to load the first 500
|
|
10
|
+
* rows once, so nobody past the 500th could be chosen.
|
|
11
|
+
*
|
|
12
|
+
* Case is ignored on both columns, `%` and `_` are characters to find, the
|
|
13
|
+
* answer is bounded, and `total` says how many matched.
|
|
14
|
+
*/
|
|
15
|
+
export const NAMED_SEARCH_TABLES = ['users', 'customers'] as const
|
|
16
|
+
export type NamedSearchTable = typeof NAMED_SEARCH_TABLES[number]
|
|
17
|
+
|
|
18
|
+
export const NAMED_SEARCH_LIMIT = 25
|
|
19
|
+
export const NAMED_SEARCH_MAX_LIMIT = 100
|
|
20
|
+
|
|
21
|
+
export interface NamedSearchQuery {
|
|
22
|
+
search: string
|
|
23
|
+
limit: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface NamedRow {
|
|
27
|
+
id: number
|
|
28
|
+
name: string | null
|
|
29
|
+
email: string | null
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** What runs the two queries: the configured `db`, or a test's own connection. */
|
|
33
|
+
export interface NamedSearchRunner {
|
|
34
|
+
unsafe: (sql: string, values?: unknown[]) => { execute: () => Promise<unknown> }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function parseNamedSearchQuery(read: QueryReader): NamedSearchQuery | { error: string } {
|
|
38
|
+
const search = queryText(read, 'q')
|
|
39
|
+
if (search.length > 200)
|
|
40
|
+
return { error: 'q must be 200 characters or fewer.' }
|
|
41
|
+
|
|
42
|
+
const limitText = queryText(read, 'limit')
|
|
43
|
+
const limit = limitText === '' ? NAMED_SEARCH_LIMIT : Number(limitText)
|
|
44
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > NAMED_SEARCH_MAX_LIMIT)
|
|
45
|
+
return { error: `limit must be a whole number from 1 to ${NAMED_SEARCH_MAX_LIMIT}.` }
|
|
46
|
+
|
|
47
|
+
return { search, limit }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export async function searchNamedRows(
|
|
51
|
+
table: NamedSearchTable,
|
|
52
|
+
query: NamedSearchQuery,
|
|
53
|
+
runner: NamedSearchRunner = db,
|
|
54
|
+
dialect: QueryBuilderDialect = getDatabaseDialect(),
|
|
55
|
+
): Promise<{ rows: NamedRow[], total: number }> {
|
|
56
|
+
// The table name is SQL, not a value, so only the fixed list is accepted.
|
|
57
|
+
if (!(NAMED_SEARCH_TABLES as readonly string[]).includes(table))
|
|
58
|
+
throw new TypeError(`${table} is not a searchable table.`)
|
|
59
|
+
|
|
60
|
+
const sql = sqlHelpers(dialect)
|
|
61
|
+
const values: unknown[] = []
|
|
62
|
+
let where = ''
|
|
63
|
+
if (query.search) {
|
|
64
|
+
const pattern = containsPattern(query.search)
|
|
65
|
+
values.push(pattern, pattern)
|
|
66
|
+
where = ` WHERE LOWER(COALESCE(name, '')) LIKE ${sql.param(1)} ESCAPE '!' OR LOWER(COALESCE(email, '')) LIKE ${sql.param(2)} ESCAPE '!'`
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const counted = await runner.unsafe(`SELECT COUNT(*) AS total_count FROM ${table}${where}`, values).execute() as Array<{ total_count: unknown }>
|
|
70
|
+
const found = await runner.unsafe(
|
|
71
|
+
// LOWER, so the order is the same on every dialect: each collates case its own way.
|
|
72
|
+
`SELECT id, name, email FROM ${table}${where} ORDER BY LOWER(COALESCE(name, '')) ASC, id ASC LIMIT ${query.limit}`,
|
|
73
|
+
values,
|
|
74
|
+
).execute() as Array<{ id: unknown, name: string | null, email: string | null }>
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
rows: (Array.isArray(found) ? found : []).map(row => ({ id: Number(row.id), name: row.name ?? null, email: row.email ?? null })),
|
|
78
|
+
total: countOf(Array.isArray(counted) ? counted[0]?.total_count : 0),
|
|
79
|
+
}
|
|
80
|
+
}
|
package/app/Models/Request.ts
CHANGED
|
@@ -48,9 +48,11 @@ export default defineModel({
|
|
|
48
48
|
method: {
|
|
49
49
|
fillable: true,
|
|
50
50
|
validation: {
|
|
51
|
-
|
|
51
|
+
// Observations include rejected methods (for example PROPFIND -> 405).
|
|
52
|
+
// An enum of application verbs silently lost those requests at insert.
|
|
53
|
+
rule: schema.string().max(255),
|
|
52
54
|
message: {
|
|
53
|
-
|
|
55
|
+
string: 'method must be an HTTP method token',
|
|
54
56
|
required: 'method is required',
|
|
55
57
|
},
|
|
56
58
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { dashboardApi } from '../../dashboard-api'
|
|
2
|
+
import { readEveryPage } from '../../dashboard-list'
|
|
2
3
|
import { pushToast } from '../../toasts'
|
|
3
4
|
import { useStorage } from '@stacksjs/browser/composables/useStorage'
|
|
4
5
|
|
|
@@ -11,6 +12,13 @@ interface DashboardResourceOptions {
|
|
|
11
12
|
storageKey: string
|
|
12
13
|
singular: string
|
|
13
14
|
plural: string
|
|
15
|
+
/**
|
|
16
|
+
* The endpoint answers one page at a time (`{ records, total }`, with
|
|
17
|
+
* `page` and `per_page`) instead of a bare array, as the dashboard's
|
|
18
|
+
* delivery routes do (stacksjs/stacks#3218). `fetchAll` then reads every
|
|
19
|
+
* page, so it still returns every record.
|
|
20
|
+
*/
|
|
21
|
+
paged?: boolean
|
|
14
22
|
}
|
|
15
23
|
|
|
16
24
|
export function createDashboardResource<
|
|
@@ -19,9 +27,12 @@ export function createDashboardResource<
|
|
|
19
27
|
>(options: DashboardResourceOptions) {
|
|
20
28
|
const items = useStorage<TRecord[]>(options.storageKey, [])
|
|
21
29
|
|
|
30
|
+
const fetchPages = (): Promise<TRecord[]> => readEveryPage((page, perPage) =>
|
|
31
|
+
dashboardApi<{ records?: TRecord[], total?: number }>(`${options.path}?page=${page}&per_page=${perPage}`))
|
|
32
|
+
|
|
22
33
|
async function fetchAll(): Promise<TRecord[]> {
|
|
23
34
|
try {
|
|
24
|
-
const data = await dashboardApi<TRecord[]>(options.path)
|
|
35
|
+
const data = options.paged ? await fetchPages() : await dashboardApi<TRecord[]>(options.path)
|
|
25
36
|
if (!Array.isArray(data))
|
|
26
37
|
throw new TypeError('Server returned a non-array response')
|
|
27
38
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import {
|
|
2
|
+
import { state } from '@stacksjs/stx'
|
|
3
|
+
import { LARGEST_PAGE, pageControls, readEveryPage, useRecordsDashboard, useServerList } from './dashboard-list'
|
|
3
4
|
|
|
4
5
|
/** The smallest thing with the two members `pageControls` reads. */
|
|
5
6
|
function pageSignal(initial: number) {
|
|
@@ -226,3 +227,133 @@ describe('useRecordsDashboard goToPage', () => {
|
|
|
226
227
|
expect(d.page()).toBe(1)
|
|
227
228
|
})
|
|
228
229
|
})
|
|
230
|
+
|
|
231
|
+
describe('useServerList', () => {
|
|
232
|
+
/** A fetch that records what it was asked and answers when told to. */
|
|
233
|
+
function server() {
|
|
234
|
+
const asked: URLSearchParams[] = []
|
|
235
|
+
const pending: Array<(answer: { records: string[], total: number, page: number }) => void> = []
|
|
236
|
+
const fetch = (params: URLSearchParams) => {
|
|
237
|
+
asked.push(params)
|
|
238
|
+
return new Promise<{ records: string[], total: number, page: number }>(resolve => pending.push(resolve))
|
|
239
|
+
}
|
|
240
|
+
return { asked, pending, fetch }
|
|
241
|
+
}
|
|
242
|
+
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))
|
|
243
|
+
|
|
244
|
+
it('asks for the default order and lands the answer', async () => {
|
|
245
|
+
const api = server()
|
|
246
|
+
const list = useServerList<string>({ fetch: api.fetch, defaultSort: { sort: 'created', direction: 'desc' } })
|
|
247
|
+
const loading = list.load()
|
|
248
|
+
expect(api.asked[0]!.toString()).toBe('sort=created&direction=desc&page=1&per_page=25')
|
|
249
|
+
api.pending[0]!({ records: ['a', 'b'], total: 30, page: 1 })
|
|
250
|
+
await loading
|
|
251
|
+
expect(list.records()).toEqual(['a', 'b'])
|
|
252
|
+
expect(list.total()).toBe(30)
|
|
253
|
+
expect(list.loading()).toBe(false)
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
it('keeps only the newest answer when two overlap', async () => {
|
|
257
|
+
const api = server()
|
|
258
|
+
const list = useServerList<string>({ fetch: api.fetch, defaultSort: { sort: 'created', direction: 'desc' } })
|
|
259
|
+
const first = list.load()
|
|
260
|
+
const second = list.load()
|
|
261
|
+
api.pending[1]!({ records: ['new'], total: 1, page: 1 })
|
|
262
|
+
api.pending[0]!({ records: ['old'], total: 9, page: 1 })
|
|
263
|
+
await Promise.all([first, second])
|
|
264
|
+
expect(list.records()).toEqual(['new'])
|
|
265
|
+
expect(list.total()).toBe(1)
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
it('asks for page 1 when a filter changes, and leaves out "all"', async () => {
|
|
269
|
+
const api = server()
|
|
270
|
+
const status = state('all')
|
|
271
|
+
const list = useServerList<string>({ fetch: api.fetch, defaultSort: { sort: 'id', direction: 'asc' }, filters: () => ({ status: status() }) })
|
|
272
|
+
list.page.set(3)
|
|
273
|
+
status.set('active')
|
|
274
|
+
expect(api.asked.length).toBe(1)
|
|
275
|
+
expect(api.asked[0]!.get('status')).toBe('active')
|
|
276
|
+
expect(api.asked[0]!.get('page')).toBe('1')
|
|
277
|
+
status.set('all')
|
|
278
|
+
expect(api.asked[1]!.has('status')).toBe(false)
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
it('sends the search once typing pauses', async () => {
|
|
282
|
+
const api = server()
|
|
283
|
+
const list = useServerList<string>({ fetch: api.fetch, defaultSort: { sort: 'id', direction: 'asc' }, searchDelay: 20 })
|
|
284
|
+
list.search.set('a')
|
|
285
|
+
list.search.set('ab')
|
|
286
|
+
list.search.set('abc ')
|
|
287
|
+
expect(api.asked.length).toBe(0)
|
|
288
|
+
await sleep(40)
|
|
289
|
+
expect(api.asked.length).toBe(1)
|
|
290
|
+
expect(api.asked[0]!.get('q')).toBe('abc')
|
|
291
|
+
expect(list.params().get('q')).toBe('abc')
|
|
292
|
+
})
|
|
293
|
+
|
|
294
|
+
it('maps a column header to the server sort, and an unknown one back to the default', () => {
|
|
295
|
+
const api = server()
|
|
296
|
+
const list = useServerList<string>({ fetch: api.fetch, defaultSort: { sort: 'created', direction: 'desc' }, columnSorts: { stopsLabel: 'stops' } })
|
|
297
|
+
list.changeSort({ key: 'stopsLabel', direction: 'asc' })
|
|
298
|
+
expect(api.asked[0]!.get('sort')).toBe('stops')
|
|
299
|
+
expect(api.asked[0]!.get('direction')).toBe('asc')
|
|
300
|
+
list.changeSort({ key: 'notes', direction: 'asc' })
|
|
301
|
+
expect(api.asked[1]!.get('sort')).toBe('created')
|
|
302
|
+
expect(api.asked[1]!.get('direction')).toBe('desc')
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
it('reports a failed load, and ignores one that a newer load replaced', async () => {
|
|
306
|
+
const errors: unknown[] = []
|
|
307
|
+
let calls = 0
|
|
308
|
+
const list = useServerList<string>({
|
|
309
|
+
fetch: async () => {
|
|
310
|
+
calls++
|
|
311
|
+
if (calls === 1)
|
|
312
|
+
throw new Error('boom')
|
|
313
|
+
return { records: ['ok'], total: 1, page: 1 }
|
|
314
|
+
},
|
|
315
|
+
defaultSort: { sort: 'id', direction: 'asc' },
|
|
316
|
+
onError: error => errors.push(error),
|
|
317
|
+
})
|
|
318
|
+
await list.load()
|
|
319
|
+
expect(list.loadError()).toBe('boom')
|
|
320
|
+
expect(errors.length).toBe(1)
|
|
321
|
+
await list.load()
|
|
322
|
+
expect(list.loadError()).toBe('')
|
|
323
|
+
expect(list.records()).toEqual(['ok'])
|
|
324
|
+
})
|
|
325
|
+
})
|
|
326
|
+
|
|
327
|
+
describe('readEveryPage', () => {
|
|
328
|
+
/** A paged endpoint over `count` numbered rows. */
|
|
329
|
+
function endpoint(count: number) {
|
|
330
|
+
const asked: number[] = []
|
|
331
|
+
const get = async (page: number, perPage: number) => {
|
|
332
|
+
asked.push(page)
|
|
333
|
+
const records = Array.from({ length: count }, (_, i) => i + 1).slice((page - 1) * perPage, page * perPage)
|
|
334
|
+
return { records, total: count }
|
|
335
|
+
}
|
|
336
|
+
return { asked, get }
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
it('reads every page, past the 500 a single read used to stop at', async () => {
|
|
340
|
+
const api = endpoint(523)
|
|
341
|
+
const rows = await readEveryPage(api.get)
|
|
342
|
+
expect(rows.length).toBe(523)
|
|
343
|
+
expect(rows.at(-1)).toBe(523)
|
|
344
|
+
expect(api.asked).toEqual([1, 2, 3, 4, 5, 6])
|
|
345
|
+
})
|
|
346
|
+
|
|
347
|
+
it('stops at an exact multiple of the page size, and on an empty list', async () => {
|
|
348
|
+
const exact = endpoint(LARGEST_PAGE * 2)
|
|
349
|
+
expect((await readEveryPage(exact.get)).length).toBe(LARGEST_PAGE * 2)
|
|
350
|
+
expect(exact.asked).toEqual([1, 2])
|
|
351
|
+
const empty = endpoint(0)
|
|
352
|
+
expect(await readEveryPage(empty.get)).toEqual([])
|
|
353
|
+
expect(empty.asked).toEqual([1])
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
it('refuses an answer that is not a page', async () => {
|
|
357
|
+
await expect(readEveryPage(async () => ({ total: 3 }) as never)).rejects.toThrow('without records')
|
|
358
|
+
})
|
|
359
|
+
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Signal } from '@stacksjs/stx'
|
|
2
|
-
import { state } from '@stacksjs/stx'
|
|
2
|
+
import { effect, state } from '@stacksjs/stx'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Shared pieces of the dashboard's list screens.
|
|
@@ -255,3 +255,200 @@ export function useRecordsDashboard<T>(options: RecordsDashboardOptions<T>): Rec
|
|
|
255
255
|
clampPage,
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
+
|
|
259
|
+
/** One page as a server-paged list endpoint answers it. */
|
|
260
|
+
export interface ServerListPage<T> {
|
|
261
|
+
records?: T[]
|
|
262
|
+
total?: number
|
|
263
|
+
page?: number
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface ServerListOptions<T> {
|
|
267
|
+
/**
|
|
268
|
+
* Ask for one page. `params` carries `sort`, `direction`, `q`, the filters,
|
|
269
|
+
* `page` and `per_page`, as the commerce list endpoints read them.
|
|
270
|
+
*/
|
|
271
|
+
fetch: (params: URLSearchParams) => Promise<ServerListPage<T>>
|
|
272
|
+
/** The order before any column header is clicked. */
|
|
273
|
+
defaultSort: { sort: string, direction: 'asc' | 'desc' }
|
|
274
|
+
/** The table's sortable column keys, as the server's sort names. A column not listed returns to `defaultSort`. */
|
|
275
|
+
columnSorts?: Record<string, string>
|
|
276
|
+
/** The filter values, read reactively: a change asks for page 1. `''` or `'all'` leaves a filter out. */
|
|
277
|
+
filters?: () => Record<string, string>
|
|
278
|
+
/** Rows per page. Default 25, the list endpoints' own default. */
|
|
279
|
+
perPage?: number
|
|
280
|
+
/** How long typing pauses before the search is sent. Default 250ms. */
|
|
281
|
+
searchDelay?: number
|
|
282
|
+
/** Called with whatever a load threw, after `loadError` is set. */
|
|
283
|
+
onError?: (error: unknown) => void
|
|
284
|
+
/** Called with each answer that lands, for anything else it carries (a summary, choices). */
|
|
285
|
+
onLoad?: (result: ServerListPage<T>) => void
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface ServerList<T> {
|
|
289
|
+
records: Signal<T[]>
|
|
290
|
+
/** How many rows match, across every page. */
|
|
291
|
+
total: Signal<number>
|
|
292
|
+
page: Signal<number>
|
|
293
|
+
perPage: Signal<number>
|
|
294
|
+
/** What the search box holds; it is sent once typing pauses. */
|
|
295
|
+
search: Signal<string>
|
|
296
|
+
loading: Signal<boolean>
|
|
297
|
+
loadError: Signal<string>
|
|
298
|
+
/** The search, filters and order as query parameters, without the page: what an export link needs. */
|
|
299
|
+
params: () => URLSearchParams
|
|
300
|
+
/** Ask for the current page again, after a save or a delete. */
|
|
301
|
+
load: () => Promise<void>
|
|
302
|
+
changePage: (value: number | CustomEvent<number>) => void
|
|
303
|
+
changePageSize: (value: number | CustomEvent<number>) => void
|
|
304
|
+
changeSort: (value: { key: string, direction: string } | CustomEvent<{ key: string, direction: string }>) => void
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function eventValue<V>(value: V | CustomEvent<V>): V {
|
|
308
|
+
return typeof CustomEvent !== 'undefined' && value instanceof CustomEvent ? value.detail : value as V
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* A list the server searches, filters, sorts and pages (stacksjs/stacks#3218).
|
|
313
|
+
*
|
|
314
|
+
* The Orders, Payments, Products, Gift Cards, Reviews and waitlist pages each
|
|
315
|
+
* wrote the same request counter, page, page size, header sort and search
|
|
316
|
+
* debounce. This is that, once: only the newest answer lands, a filter or
|
|
317
|
+
* search change asks for page 1, and a column header the server cannot sort
|
|
318
|
+
* by returns to the default order.
|
|
319
|
+
*
|
|
320
|
+
* The caller still owns when to load first (call `load()` in `onMount`), its
|
|
321
|
+
* toasts, and what its endpoint returns beyond the page (`onLoad`).
|
|
322
|
+
*/
|
|
323
|
+
export function useServerList<T>(options: ServerListOptions<T>): ServerList<T> {
|
|
324
|
+
const records = state<T[]>([])
|
|
325
|
+
const total = state(0)
|
|
326
|
+
const page = state(1)
|
|
327
|
+
const perPage = state(options.perPage ?? 25)
|
|
328
|
+
const search = state('')
|
|
329
|
+
const loading = state(true)
|
|
330
|
+
const loadError = state('')
|
|
331
|
+
const appliedSearch = state('')
|
|
332
|
+
const headerSort = state<{ sort: string, direction: string } | null>(null)
|
|
333
|
+
let request = 0
|
|
334
|
+
let timer: ReturnType<typeof setTimeout> | null = null
|
|
335
|
+
|
|
336
|
+
const params = (): URLSearchParams => {
|
|
337
|
+
const query = new URLSearchParams()
|
|
338
|
+
const order = headerSort() ?? options.defaultSort
|
|
339
|
+
query.set('sort', order.sort)
|
|
340
|
+
query.set('direction', order.direction)
|
|
341
|
+
if (appliedSearch())
|
|
342
|
+
query.set('q', appliedSearch())
|
|
343
|
+
for (const [name, value] of Object.entries(options.filters?.() ?? {})) {
|
|
344
|
+
if (value !== '' && value !== 'all')
|
|
345
|
+
query.set(name, value)
|
|
346
|
+
}
|
|
347
|
+
return query
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const load = async (): Promise<void> => {
|
|
351
|
+
const current = ++request
|
|
352
|
+
loading.set(true)
|
|
353
|
+
loadError.set('')
|
|
354
|
+
try {
|
|
355
|
+
const query = params()
|
|
356
|
+
query.set('page', String(page()))
|
|
357
|
+
query.set('per_page', String(perPage()))
|
|
358
|
+
const result = await options.fetch(query)
|
|
359
|
+
if (current !== request)
|
|
360
|
+
return
|
|
361
|
+
records.set(Array.isArray(result.records) ? result.records : [])
|
|
362
|
+
total.set(Number(result.total) || 0)
|
|
363
|
+
page.set(Number(result.page) || 1)
|
|
364
|
+
options.onLoad?.(result)
|
|
365
|
+
}
|
|
366
|
+
catch (error) {
|
|
367
|
+
if (current !== request)
|
|
368
|
+
return
|
|
369
|
+
loadError.set(error instanceof Error ? error.message : String(error))
|
|
370
|
+
options.onError?.(error)
|
|
371
|
+
}
|
|
372
|
+
finally {
|
|
373
|
+
if (current === request)
|
|
374
|
+
loading.set(false)
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (options.filters) {
|
|
379
|
+
let shown = JSON.stringify(options.filters())
|
|
380
|
+
effect(() => {
|
|
381
|
+
const filters = JSON.stringify(options.filters!())
|
|
382
|
+
if (filters === shown)
|
|
383
|
+
return
|
|
384
|
+
shown = filters
|
|
385
|
+
page.set(1)
|
|
386
|
+
void load()
|
|
387
|
+
})
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
let shownSearch = search().trim()
|
|
391
|
+
effect(() => {
|
|
392
|
+
const term = search().trim()
|
|
393
|
+
if (term === shownSearch)
|
|
394
|
+
return
|
|
395
|
+
shownSearch = term
|
|
396
|
+
if (timer)
|
|
397
|
+
clearTimeout(timer)
|
|
398
|
+
timer = setTimeout(() => {
|
|
399
|
+
appliedSearch.set(term)
|
|
400
|
+
page.set(1)
|
|
401
|
+
void load()
|
|
402
|
+
}, options.searchDelay ?? 250)
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
return {
|
|
406
|
+
records,
|
|
407
|
+
total,
|
|
408
|
+
page,
|
|
409
|
+
perPage,
|
|
410
|
+
search,
|
|
411
|
+
loading,
|
|
412
|
+
loadError,
|
|
413
|
+
params,
|
|
414
|
+
load,
|
|
415
|
+
changePage(value) {
|
|
416
|
+
page.set(Number(eventValue(value)) || 1)
|
|
417
|
+
void load()
|
|
418
|
+
},
|
|
419
|
+
changePageSize(value) {
|
|
420
|
+
perPage.set(Number(eventValue(value)) || (options.perPage ?? 25))
|
|
421
|
+
page.set(1)
|
|
422
|
+
void load()
|
|
423
|
+
},
|
|
424
|
+
changeSort(value) {
|
|
425
|
+
const column = eventValue(value)
|
|
426
|
+
const sort = options.columnSorts?.[column.key]
|
|
427
|
+
headerSort.set(sort ? { sort, direction: column.direction === 'asc' ? 'asc' : 'desc' } : null)
|
|
428
|
+
page.set(1)
|
|
429
|
+
void load()
|
|
430
|
+
},
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/** The largest page the list endpoints serve. */
|
|
435
|
+
export const LARGEST_PAGE = 100
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Every record a paged list endpoint holds, a page at a time: for a caller
|
|
439
|
+
* that does want all of them, such as a resource's `fetchAll`. Stops at the
|
|
440
|
+
* first short page, so a count that moved while it read cannot loop it.
|
|
441
|
+
*/
|
|
442
|
+
export async function readEveryPage<T>(
|
|
443
|
+
get: (page: number, perPage: number) => Promise<{ records?: T[], total?: number }>,
|
|
444
|
+
): Promise<T[]> {
|
|
445
|
+
const all: T[] = []
|
|
446
|
+
for (let page = 1; ; page++) {
|
|
447
|
+
const data = await get(page, LARGEST_PAGE)
|
|
448
|
+
if (!Array.isArray(data?.records))
|
|
449
|
+
throw new TypeError('Server returned a page without records')
|
|
450
|
+
all.push(...data.records)
|
|
451
|
+
if (data.records.length < LARGEST_PAGE || all.length >= Number(data.total))
|
|
452
|
+
return all
|
|
453
|
+
}
|
|
454
|
+
}
|
package/functions/queue.ts
CHANGED
|
@@ -51,6 +51,8 @@ export interface QueueWorkersResponse {
|
|
|
51
51
|
data: QueueWorker[]
|
|
52
52
|
worker_running: boolean
|
|
53
53
|
active_jobs: number
|
|
54
|
+
/** False when `queue_workers` has not been migrated: there is no worker telemetry to read yet. */
|
|
55
|
+
workers_migrated?: boolean
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
export async function fetchQueueStats(): Promise<QueueStatsResponse> {
|
package/ide/vscode/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"publisher": "Stacks",
|
|
3
3
|
"name": "vscode-stacks",
|
|
4
4
|
"displayName": "Stacks",
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.490",
|
|
6
6
|
"description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/defaults",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.490",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@iconify-json/f7": "^1.2.2",
|
|
47
47
|
"@iconify-json/hugeicons": "^1.2.35",
|
|
48
|
-
"@stacksjs/mobile": "0.75.
|
|
48
|
+
"@stacksjs/mobile": "0.75.490",
|
|
49
49
|
"@stacksjs/sanitizer": "0.2.807",
|
|
50
50
|
"@stacksjs/stx": "0.2.807",
|
|
51
51
|
"@xterm/addon-fit": "^0.11.0",
|