@stacksjs/defaults 0.70.355 → 0.70.356
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-email/SKILL.md +38 -1
- package/app/Actions/ContactAction.ts +2 -2
- package/app/Actions/Dashboard/Analytics/EventAnalyticsAction.ts +2 -3
- package/app/Actions/Dashboard/Analytics/MarketingAnalyticsAction.ts +2 -3
- package/app/Actions/Dashboard/Analytics/SalesAnalyticsAction.ts +2 -3
- package/app/Actions/Dashboard/Analytics/WebAnalyticsAction.ts +9 -3
- package/app/Actions/Dashboard/Auth/MeAction.ts +4 -7
- package/app/Actions/Dashboard/Buddy/BuddyChatAction.ts +2 -3
- package/app/Actions/Dashboard/Cloud/CloudIndexAction.ts +8 -1
- package/app/Actions/Dashboard/Cloud/ServerlessIndexAction.ts +15 -8
- package/app/Actions/Dashboard/Commerce/CommerceCategoriesAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommerceCouponsAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommerceCustomersAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommerceDashboardAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommerceDeliveryAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommerceGiftCardsAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommerceOrdersAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommercePaymentsAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommercePosAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommercePosCheckoutAction.ts +75 -61
- package/app/Actions/Dashboard/Commerce/CommercePrintDevicesAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommercePrintLogsAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommerceProductDetailAction.ts +3 -4
- package/app/Actions/Dashboard/Commerce/CommerceProductsAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/CommerceTaxesAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/DeliveryRouteIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/DigitalDeliveryIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/DriverIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/LicenseKeyIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/LicenseKeyOptionsAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/ManufacturerIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/ProductUnitIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/ProductVariantIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/ProductWaitlistIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/RestaurantWaitlistIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/ReviewIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/ShippingMethodIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/ShippingRateIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Commerce/ShippingZoneIndexAction.ts +2 -4
- package/app/Actions/Dashboard/DashboardActivityAction.ts +2 -5
- package/app/Actions/Dashboard/Data/ActivityIndexAction.ts +2 -5
- package/app/Actions/Dashboard/Data/SubscriberIndexAction.ts +2 -5
- package/app/Actions/Dashboard/Data/TeamIndexAction.ts +2 -5
- package/app/Actions/Dashboard/Data/UserIndexAction.ts +2 -5
- package/app/Actions/Dashboard/Deployments/CreateDeployment.ts +23 -19
- package/app/Actions/Dashboard/Deployments/GetAverageDeploymentTime.ts +8 -2
- package/app/Actions/Dashboard/Deployments/GetDeployScript.ts +3 -6
- package/app/Actions/Dashboard/Deployments/GetDeployment.ts +4 -5
- package/app/Actions/Dashboard/Deployments/GetDeploymentCount.ts +7 -1
- package/app/Actions/Dashboard/Deployments/GetDeploymentLiveTerminalOutput.ts +10 -9
- package/app/Actions/Dashboard/Deployments/GetDeployments.ts +2 -4
- package/app/Actions/Dashboard/Deployments/GetRecentDeployments.ts +8 -2
- package/app/Actions/Dashboard/Deployments/UpdateDeployScript.ts +18 -5
- package/app/Actions/Dashboard/Email/CapturedMailIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Email/CapturedMailShowAction.ts +3 -4
- package/app/Actions/Dashboard/Infrastructure/InsightsAction.ts +15 -14
- package/app/Actions/Dashboard/Infrastructure/LogIndexAction.ts +2 -8
- package/app/Actions/Dashboard/Jobs/JobIndexAction.ts +2 -4
- package/app/Actions/Dashboard/Jobs/JobShowAction.ts +13 -8
- package/app/Actions/Dashboard/Jobs/JobStatsAction.ts +2 -4
- package/app/Actions/Dashboard/Kanban/BoardDestroyAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/BoardShowAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/BoardStoreAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/BoardUpdateAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/BoardsIndexAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/BoardsReorderAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardAssigneesSyncAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardCommentDestroyAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardCommentStoreAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardCommentUpdateAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardDestroyAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardLabelsSyncAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardShowAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardStoreAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardUpdateAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/CardsReorderAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/ColumnDestroyAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/ColumnStoreAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/ColumnUpdateAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/ColumnsReorderAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/LabelDestroyAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/LabelStoreAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/LabelUpdateAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/UsersListAction.ts +2 -3
- package/app/Actions/Dashboard/Kanban/kanban-response.ts +5 -0
- package/app/Actions/Dashboard/Library/CreateComponent.ts +15 -6
- package/app/Actions/Dashboard/Library/CreateFunction.ts +15 -6
- package/app/Actions/Dashboard/Library/DependencyIndexAction.ts +88 -77
- package/app/Actions/Dashboard/Library/GetAverageReleaseTime.ts +21 -15
- package/app/Actions/Dashboard/Library/GetComponents.ts +14 -7
- package/app/Actions/Dashboard/Library/GetDownloadCount.ts +14 -5
- package/app/Actions/Dashboard/Library/GetFunctions.ts +12 -5
- package/app/Actions/Dashboard/Library/GetReleaseCount.ts +14 -5
- package/app/Actions/Dashboard/Library/GetReleases.ts +17 -10
- package/app/Actions/Dashboard/Library/PackageIndexAction.ts +14 -7
- package/app/Actions/Dashboard/Models/ModelDestroyAction.ts +7 -5
- package/app/Actions/Dashboard/Models/ModelShowAction.ts +82 -174
- package/app/Actions/Dashboard/Models/ModelStoreAction.ts +6 -4
- package/app/Actions/Dashboard/Models/ModelUpdateAction.ts +9 -7
- package/app/Actions/Dashboard/Models/ModelsIndexAction.ts +47 -17
- package/app/Actions/Dashboard/Models/model-write.ts +20 -5
- package/app/Actions/Dashboard/Notifications/NotificationDeliveryHistoryAction.ts +46 -36
- package/app/Actions/Dashboard/Notifications/NotificationDeliveryIndexAction.ts +14 -6
- package/app/Actions/Dashboard/Notifications/NotificationDeliveryOverviewAction.ts +96 -84
- package/app/Actions/Dashboard/Notifications/NotificationDeliveryRetryAction.ts +34 -21
- package/app/Actions/Dashboard/Queries/QueryDashboardAction.ts +2 -4
- package/app/Actions/Dashboard/Queries/QueryShowAction.ts +2 -3
- package/app/Actions/Dashboard/Queue/QueueStatsAction.ts +2 -4
- package/app/Actions/Dashboard/Queue/QueueWorkersAction.ts +2 -4
- package/app/Actions/Dashboard/Rbac/PermissionDestroyAction.ts +2 -2
- package/app/Actions/Dashboard/Rbac/PermissionStoreAction.ts +2 -2
- package/app/Actions/Dashboard/Rbac/PermissionsIndexAction.ts +2 -3
- package/app/Actions/Dashboard/Rbac/RoleDestroyAction.ts +2 -2
- package/app/Actions/Dashboard/Rbac/RolePermissionsShowAction.ts +2 -2
- package/app/Actions/Dashboard/Rbac/RolePermissionsSyncAction.ts +2 -6
- package/app/Actions/Dashboard/Rbac/RoleStoreAction.ts +2 -2
- package/app/Actions/Dashboard/Rbac/RolesIndexAction.ts +4 -6
- package/app/Actions/Dashboard/Rbac/UserRolesShowAction.ts +2 -2
- package/app/Actions/Dashboard/Rbac/UserRolesSyncAction.ts +2 -9
- package/app/Actions/Dashboard/Rbac/UsersListAction.ts +2 -3
- package/app/Actions/Dashboard/Rbac/rbac-response.ts +10 -0
- package/app/Actions/Dashboard/Realtime/RealtimeStatsAction.ts +2 -4
- package/app/Actions/Dashboard/Search/GlobalSearchAction.ts +68 -55
- package/app/Actions/Dashboard/Teams/TeamInvitationDestroyAction.ts +34 -16
- package/app/Actions/Dashboard/Teams/TeamInvitationResendAction.ts +52 -29
- package/app/Actions/Dashboard/Teams/TeamInviteAction.ts +102 -71
- package/app/Actions/Dashboard/Teams/TeamMemberDestroyAction.ts +36 -17
- package/app/Actions/Dashboard/Teams/TeamMemberUpdateAction.ts +39 -26
- package/app/Actions/Dashboard/Teams/TeamPeopleIndexAction.ts +71 -58
- package/app/Actions/Dashboard/Teams/team-invitation-delivery.ts +29 -7
- package/app/Actions/Dashboard/Teams/team-member-count.ts +4 -2
- package/app/Actions/Dashboard/Teams/team-records.test.ts +2 -0
- package/app/Actions/Dashboard/Teams/team-records.ts +2 -0
- package/app/Actions/Dashboard/dashboard-response.ts +16 -0
- package/app/Actions/SendWelcomeEmail.ts +1 -1
- package/app/Actions/Teams/AcceptInvitationAction.ts +74 -51
- package/app/Actions/Teams/ShowInvitationAction.ts +21 -14
- package/app/Actions/Teams/team-response.ts +23 -0
- package/app/Mail/OrderConfirmation.ts +1 -1
- package/app/Mail/SubscriptionConfirmation.ts +1 -1
- package/app/Mail/TeamInvitation.ts +1 -1
- package/app/Models/EmailIdempotency.ts +64 -0
- package/app/Models/EmailSuppression.ts +52 -0
- package/app/Models/EmailWebhookEvent.ts +51 -0
- package/app/Models/TeamInvitation.ts +13 -0
- package/functions/data.ts +0 -1
- package/functions/jobs.ts +0 -1
- package/ide/vscode/package.json +1 -1
- package/package.json +1 -1
- package/resources/components/Dashboard/Data/DataRecords.stx +0 -4
- package/resources/components/Dashboard/Jobs/JobDetail.stx +3 -2
- package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +7 -13
- package/resources/components/Dashboard/Models/ModelsOverview.stx +1 -1
- package/views/dashboard/.discovered-models.json +30 -0
- package/views/dashboard/stores/auth.ts +15 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions'
|
|
2
2
|
import { db } from '@stacksjs/database'
|
|
3
3
|
import { modelBoolean } from './kanban-model'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface BoardRow {
|
|
7
7
|
id: number
|
|
@@ -70,8 +70,7 @@ export default new Action({
|
|
|
70
70
|
return { boards }
|
|
71
71
|
}
|
|
72
72
|
catch (err) {
|
|
73
|
-
|
|
74
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
73
|
+
return kanbanActionError(err, 'BoardsIndexAction')
|
|
75
74
|
}
|
|
76
75
|
},
|
|
77
76
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface ReorderInput {
|
|
7
7
|
/**
|
|
@@ -67,8 +67,7 @@ export default new Action({
|
|
|
67
67
|
return { reordered: ids.length }
|
|
68
68
|
}
|
|
69
69
|
catch (err) {
|
|
70
|
-
|
|
71
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
70
|
+
return kanbanActionError(err, 'BoardsReorderAction')
|
|
72
71
|
}
|
|
73
72
|
},
|
|
74
73
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface SyncInput {
|
|
7
7
|
userIds?: unknown
|
|
@@ -94,8 +94,7 @@ export default new Action({
|
|
|
94
94
|
return { cardId, assignees }
|
|
95
95
|
}
|
|
96
96
|
catch (err) {
|
|
97
|
-
|
|
98
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
97
|
+
return kanbanActionError(err, 'CardAssigneesSyncAction')
|
|
99
98
|
}
|
|
100
99
|
},
|
|
101
100
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { CardComment } from '@stacksjs/orm'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* `DELETE /api/dashboard/kanban/comments/:id`.
|
|
@@ -25,8 +25,7 @@ export default new Action({
|
|
|
25
25
|
return { deleted: true, id }
|
|
26
26
|
}
|
|
27
27
|
catch (err) {
|
|
28
|
-
|
|
29
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
28
|
+
return kanbanActionError(err, 'CardCommentDestroyAction')
|
|
30
29
|
}
|
|
31
30
|
},
|
|
32
31
|
})
|
|
@@ -3,7 +3,7 @@ import { Action } from '@stacksjs/actions'
|
|
|
3
3
|
import { Card, CardComment } from '@stacksjs/orm'
|
|
4
4
|
import { cardCommentResponse } from './kanban-comment'
|
|
5
5
|
import { refreshModel } from './kanban-model'
|
|
6
|
-
import { kanbanError } from './kanban-response'
|
|
6
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
7
7
|
|
|
8
8
|
interface CommentInput {
|
|
9
9
|
body?: unknown
|
|
@@ -52,8 +52,7 @@ export default new Action({
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
catch (err) {
|
|
55
|
-
|
|
56
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
55
|
+
return kanbanActionError(err, 'CardCommentStoreAction')
|
|
57
56
|
}
|
|
58
57
|
},
|
|
59
58
|
})
|
|
@@ -3,7 +3,7 @@ import { Action } from '@stacksjs/actions'
|
|
|
3
3
|
import { CardComment, User } from '@stacksjs/orm'
|
|
4
4
|
import { cardCommentResponse } from './kanban-comment'
|
|
5
5
|
import { modelNullableNumber, refreshModel } from './kanban-model'
|
|
6
|
-
import { kanbanError } from './kanban-response'
|
|
6
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
7
7
|
|
|
8
8
|
interface CommentInput {
|
|
9
9
|
body?: unknown
|
|
@@ -37,8 +37,7 @@ export default new Action({
|
|
|
37
37
|
return { comment: cardCommentResponse(updated, author) }
|
|
38
38
|
}
|
|
39
39
|
catch (error) {
|
|
40
|
-
|
|
41
|
-
return kanbanError(error instanceof Error ? error.message : 'unknown error', 500)
|
|
40
|
+
return kanbanActionError(error, 'CardCommentUpdateAction')
|
|
42
41
|
}
|
|
43
42
|
},
|
|
44
43
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* `DELETE /api/dashboard/kanban/cards/:id`.
|
|
@@ -37,8 +37,7 @@ export default new Action({
|
|
|
37
37
|
return { deleted: true, id }
|
|
38
38
|
}
|
|
39
39
|
catch (err) {
|
|
40
|
-
|
|
41
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
40
|
+
return kanbanActionError(err, 'CardDestroyAction')
|
|
42
41
|
}
|
|
43
42
|
},
|
|
44
43
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface SyncInput {
|
|
7
7
|
labelIds?: unknown
|
|
@@ -92,8 +92,7 @@ export default new Action({
|
|
|
92
92
|
return { cardId, labels }
|
|
93
93
|
}
|
|
94
94
|
catch (err) {
|
|
95
|
-
|
|
96
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
95
|
+
return kanbanActionError(err, 'CardLabelsSyncAction')
|
|
97
96
|
}
|
|
98
97
|
},
|
|
99
98
|
})
|
|
@@ -2,7 +2,7 @@ import type { RequestInstance } from '@stacksjs/types'
|
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
4
|
import { modelBoolean } from './kanban-model'
|
|
5
|
-
import { kanbanError } from './kanban-response'
|
|
5
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
7
7
|
interface CardRow {
|
|
8
8
|
id: number
|
|
@@ -118,8 +118,7 @@ export default new Action({
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
catch (err) {
|
|
121
|
-
|
|
122
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
121
|
+
return kanbanActionError(err, 'CardShowAction')
|
|
123
122
|
}
|
|
124
123
|
},
|
|
125
124
|
})
|
|
@@ -2,7 +2,7 @@ import type { RequestInstance } from '@stacksjs/types'
|
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
4
|
import { BoardColumn, Card } from '@stacksjs/orm'
|
|
5
|
-
import { kanbanError } from './kanban-response'
|
|
5
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
7
7
|
interface CardInput {
|
|
8
8
|
columnId?: unknown
|
|
@@ -90,8 +90,7 @@ export default new Action({
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
catch (err) {
|
|
93
|
-
|
|
94
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
93
|
+
return kanbanActionError(err, 'CardStoreAction')
|
|
95
94
|
}
|
|
96
95
|
},
|
|
97
96
|
})
|
|
@@ -2,7 +2,7 @@ import type { RequestInstance } from '@stacksjs/types'
|
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { Card } from '@stacksjs/orm'
|
|
4
4
|
import { modelBoolean, modelNullableString, modelNumber, modelString, modelValue, refreshModel } from './kanban-model'
|
|
5
|
-
import { kanbanError } from './kanban-response'
|
|
5
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
7
7
|
interface CardInput {
|
|
8
8
|
title?: unknown
|
|
@@ -81,8 +81,7 @@ export default new Action({
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
catch (err) {
|
|
84
|
-
|
|
85
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
84
|
+
return kanbanActionError(err, 'CardUpdateAction')
|
|
86
85
|
}
|
|
87
86
|
},
|
|
88
87
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface ColumnReorder {
|
|
7
7
|
columnId: number
|
|
@@ -135,8 +135,7 @@ export default new Action({
|
|
|
135
135
|
return { moved: allCardIds.size, boardId }
|
|
136
136
|
}
|
|
137
137
|
catch (err) {
|
|
138
|
-
|
|
139
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
138
|
+
return kanbanActionError(err, 'CardsReorderAction')
|
|
140
139
|
}
|
|
141
140
|
},
|
|
142
141
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* `DELETE /api/dashboard/kanban/columns/:id`.
|
|
@@ -48,8 +48,7 @@ export default new Action({
|
|
|
48
48
|
return { deleted: true, id }
|
|
49
49
|
}
|
|
50
50
|
catch (err) {
|
|
51
|
-
|
|
52
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
51
|
+
return kanbanActionError(err, 'ColumnDestroyAction')
|
|
53
52
|
}
|
|
54
53
|
},
|
|
55
54
|
})
|
|
@@ -2,7 +2,7 @@ import type { RequestInstance } from '@stacksjs/types'
|
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
4
|
import { Board, BoardColumn } from '@stacksjs/orm'
|
|
5
|
-
import { kanbanError } from './kanban-response'
|
|
5
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
7
7
|
interface ColumnInput {
|
|
8
8
|
boardId?: unknown
|
|
@@ -75,8 +75,7 @@ export default new Action({
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
catch (err) {
|
|
78
|
-
|
|
79
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
78
|
+
return kanbanActionError(err, 'ColumnStoreAction')
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
})
|
|
@@ -2,7 +2,7 @@ import type { RequestInstance } from '@stacksjs/types'
|
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { BoardColumn } from '@stacksjs/orm'
|
|
4
4
|
import { modelNullableString, modelNumber, modelString, modelValue, refreshModel } from './kanban-model'
|
|
5
|
-
import { kanbanError } from './kanban-response'
|
|
5
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
7
7
|
interface ColumnInput {
|
|
8
8
|
name?: unknown
|
|
@@ -80,8 +80,7 @@ export default new Action({
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
catch (err) {
|
|
83
|
-
|
|
84
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
83
|
+
return kanbanActionError(err, 'ColumnUpdateAction')
|
|
85
84
|
}
|
|
86
85
|
},
|
|
87
86
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface ReorderInput {
|
|
7
7
|
boardId?: unknown
|
|
@@ -75,8 +75,7 @@ export default new Action({
|
|
|
75
75
|
return { reordered: ids.length }
|
|
76
76
|
}
|
|
77
77
|
catch (err) {
|
|
78
|
-
|
|
79
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
78
|
+
return kanbanActionError(err, 'ColumnsReorderAction')
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { db } from '@stacksjs/database'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* `DELETE /api/dashboard/kanban/labels/:id`.
|
|
@@ -30,8 +30,7 @@ export default new Action({
|
|
|
30
30
|
return { deleted: true, id }
|
|
31
31
|
}
|
|
32
32
|
catch (err) {
|
|
33
|
-
|
|
34
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
33
|
+
return kanbanActionError(err, 'LabelDestroyAction')
|
|
35
34
|
}
|
|
36
35
|
},
|
|
37
36
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestInstance } from '@stacksjs/types'
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { Board, Label } from '@stacksjs/orm'
|
|
4
|
-
import { kanbanError } from './kanban-response'
|
|
4
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
5
5
|
|
|
6
6
|
interface LabelInput {
|
|
7
7
|
boardId?: unknown
|
|
@@ -51,8 +51,7 @@ export default new Action({
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
catch (err) {
|
|
54
|
-
|
|
55
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
54
|
+
return kanbanActionError(err, 'LabelStoreAction')
|
|
56
55
|
}
|
|
57
56
|
},
|
|
58
57
|
})
|
|
@@ -2,7 +2,7 @@ import type { RequestInstance } from '@stacksjs/types'
|
|
|
2
2
|
import { Action } from '@stacksjs/actions'
|
|
3
3
|
import { Label } from '@stacksjs/orm'
|
|
4
4
|
import { modelNumber, modelString, refreshModel } from './kanban-model'
|
|
5
|
-
import { kanbanError } from './kanban-response'
|
|
5
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
6
6
|
|
|
7
7
|
interface LabelInput {
|
|
8
8
|
name?: unknown
|
|
@@ -74,8 +74,7 @@ export default new Action({
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
catch (err) {
|
|
77
|
-
|
|
78
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
77
|
+
return kanbanActionError(err, 'LabelUpdateAction')
|
|
79
78
|
}
|
|
80
79
|
},
|
|
81
80
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '@stacksjs/actions'
|
|
2
2
|
import { db } from '@stacksjs/database'
|
|
3
|
-
import { kanbanError } from './kanban-response'
|
|
3
|
+
import { kanbanActionError, kanbanError } from './kanban-response'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* `GET /api/dashboard/kanban/users`.
|
|
@@ -30,8 +30,7 @@ export default new Action({
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
catch (err) {
|
|
33
|
-
|
|
34
|
-
return kanbanError(err instanceof Error ? err.message : 'unknown error', 500)
|
|
33
|
+
return kanbanActionError(err, 'UsersListAction')
|
|
35
34
|
}
|
|
36
35
|
},
|
|
37
36
|
})
|
|
@@ -3,3 +3,8 @@ import { response } from '@stacksjs/router'
|
|
|
3
3
|
export function kanbanError(error: string, status: number): Response {
|
|
4
4
|
return response.json({ error }, status)
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
export function kanbanActionError(error: unknown, action: string): Response {
|
|
8
|
+
console.error(`[dashboard/kanban] ${action} failed:`, error)
|
|
9
|
+
return kanbanError('The Kanban request could not be completed.', 500)
|
|
10
|
+
}
|
|
@@ -3,12 +3,14 @@ import { existsSync } from 'node:fs'
|
|
|
3
3
|
import { Action, createComponent as scaffoldComponent } from '@stacksjs/actions'
|
|
4
4
|
import { userComponentsPath } from '@stacksjs/path'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
|
+
import { dashboardOperationalError } from '../dashboard-response'
|
|
6
7
|
import { componentSourceRows } from './library-source'
|
|
7
8
|
|
|
8
9
|
export default new Action({
|
|
9
10
|
name: 'CreateComponent',
|
|
10
11
|
description: 'Creates a new STX component.',
|
|
11
12
|
method: 'POST',
|
|
13
|
+
apiResponse: true,
|
|
12
14
|
|
|
13
15
|
async handle(request: RequestInstance) {
|
|
14
16
|
const name = String(request.get('name') || '').trim()
|
|
@@ -16,13 +18,20 @@ export default new Action({
|
|
|
16
18
|
if (!/^[A-Z][A-Za-z0-9]*$/.test(name))
|
|
17
19
|
return response.json({ message: 'Use a PascalCase component name.' }, 422)
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
try {
|
|
22
|
+
const destination = userComponentsPath(`${name}.stx`)
|
|
23
|
+
if (existsSync(destination))
|
|
24
|
+
return response.json({ message: 'A component with that name already exists.' }, 409)
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
await scaffoldComponent({ name })
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
const created = componentSourceRows().find(component => component.name === name)
|
|
29
|
+
if (!created)
|
|
30
|
+
throw new Error(`Scaffolded component ${name} could not be found in resources/components.`)
|
|
31
|
+
return response.json({ component: created }, 201)
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return dashboardOperationalError(error, 'The component could not be created.', 'CreateComponent', 500)
|
|
35
|
+
}
|
|
27
36
|
},
|
|
28
37
|
})
|
|
@@ -3,12 +3,14 @@ import { existsSync } from 'node:fs'
|
|
|
3
3
|
import { Action, createFunction as scaffoldFunction } from '@stacksjs/actions'
|
|
4
4
|
import { userFunctionsPath } from '@stacksjs/path'
|
|
5
5
|
import { response } from '@stacksjs/router'
|
|
6
|
+
import { dashboardOperationalError } from '../dashboard-response'
|
|
6
7
|
import { functionSourceRows } from './library-source'
|
|
7
8
|
|
|
8
9
|
export default new Action({
|
|
9
10
|
name: 'CreateFunction',
|
|
10
11
|
description: 'Creates a new function.',
|
|
11
12
|
method: 'POST',
|
|
13
|
+
apiResponse: true,
|
|
12
14
|
|
|
13
15
|
async handle(request: RequestInstance) {
|
|
14
16
|
const name = String(request.get('name') || '').trim().toLowerCase()
|
|
@@ -16,13 +18,20 @@ export default new Action({
|
|
|
16
18
|
if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(name))
|
|
17
19
|
return response.json({ message: 'Use a lowercase kebab-case function name.' }, 422)
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
try {
|
|
22
|
+
const destination = userFunctionsPath(`${name}.ts`)
|
|
23
|
+
if (existsSync(destination))
|
|
24
|
+
return response.json({ message: 'A function with that name already exists.' }, 409)
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
await scaffoldFunction({ name })
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
const created = functionSourceRows().find(fn => fn.name === name)
|
|
29
|
+
if (!created)
|
|
30
|
+
throw new Error(`Scaffolded function ${name} could not be found in resources/functions.`)
|
|
31
|
+
return response.json({ function: created }, 201)
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return dashboardOperationalError(error, 'The function could not be created.', 'CreateFunction', 500)
|
|
35
|
+
}
|
|
27
36
|
},
|
|
28
37
|
})
|