Skip to content

Commit 06c5601

Browse files
committed
Merge branch 'development'
2 parents 86ef89e + d84ae73 commit 06c5601

36 files changed

+1627
-5
lines changed

box.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"ColdBox CLI",
3-
"version":"8.1.0",
3+
"version":"8.2.0",
44
"location":"https://downloads.ortussolutions.com/ortussolutions/commandbox-modules/coldbox-cli/@build.version@/[email protected]@.zip",
55
"slug":"coldbox-cli",
66
"author":"Ortus Solutions, Corp",

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
### Added
13+
14+
- Missing rest resources for the `boxlang` template
15+
16+
### Fixed
17+
18+
- Cleanup for vite resources only if vite is not selected
19+
1220
## [8.1.0] - 2025-10-22
1321

1422
### Changed

commands/coldbox/create/app.cfc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ component extends="coldbox-cli.models.BaseCommand" {
175175
slug : variables.formatterUtil.slugify( arguments.name ),
176176
version : "1.0.0",
177177
location: "forgeboxStorage",
178-
ignore : "[]"
178+
ignore : "[]",
179+
description: "A ColdBox Application created with the ColdBox CLI"
179180
)
180181
.run();
181182

@@ -310,8 +311,8 @@ component extends="coldbox-cli.models.BaseCommand" {
310311
}
311312
// REST Setup
312313
if ( arguments.rest ) {
313-
if ( !arguments.skeleton.reFindNoCase( "(modern|boxlang)" ) ) {
314-
printWarn( "⚠️ REST setup is only supported for 'modern' or 'boxlang' skeletons. Skipping REST setup." )
314+
if ( !arguments.skeleton.reFindNoCase( "(boxlang)" ) ) {
315+
printWarn( "⚠️ REST setup is only supported for 'boxlang' skeletons. Skipping REST setup." )
315316
} else {
316317
printInfo( "🥊 Setting up a REST API only ColdBox application" )
317318
// Router
@@ -395,19 +396,22 @@ component extends="coldbox-cli.models.BaseCommand" {
395396
true
396397
)
397398
}
399+
398400
// Vite Cleanup
399-
if ( directoryExists( arguments.directory & "resources/assets" ) ) {
401+
if ( !arguments.vite && directoryExists( arguments.directory & "resources/assets" ) ) {
400402
directoryDelete(
401403
arguments.directory & "resources/assets",
402404
true
403405
)
404406
}
407+
405408
if ( directoryExists( arguments.directory & "resources/vite" ) ) {
406409
directoryDelete(
407410
arguments.directory & "resources/vite",
408411
true
409412
)
410413
}
414+
411415
// Docker Cleanup
412416
if ( directoryExists( arguments.directory & "resources/docker" ) ) {
413417
directoryDelete(

templates/rest/Router.bx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* This is your application router. From here you can controll all the incoming routes to your application.
3+
*
4+
* https://coldbox.ortusbooks.com/the-basics/routing
5+
*/
6+
class {
7+
8+
function configure(){
9+
/**
10+
* --------------------------------------------------------------------------
11+
* App Routes
12+
* --------------------------------------------------------------------------
13+
* Here is where you can register the routes for your web application!
14+
* Go get Funky!
15+
*/
16+
17+
// A nice healthcheck route example
18+
route( "/healthcheck", function( event, rc, prc ){
19+
return "Ok!"
20+
} )
21+
22+
// API Echo
23+
get( "/api/echo", "Echo.index" )
24+
25+
// API Authentication Routes
26+
post( "/api/login", "Auth.login" )
27+
post( "/api/logout", "Auth.logout" )
28+
post( "/api/register", "Auth.register" )
29+
30+
// API Secured Routes
31+
get( "/api/whoami", "Echo.whoami" )
32+
33+
// @app_routes@
34+
35+
// Conventions-Based Routing
36+
route( ":handler/:action?" ).end()
37+
}
38+
39+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"error": {
5+
"description": "Flag to indicate an error.",
6+
"type": "boolean"
7+
},
8+
"messages": {
9+
"description": "An array of messages related to the request.",
10+
"type": "array",
11+
"items": {
12+
"type": "string"
13+
}
14+
},
15+
"pagination" : {
16+
"description": "Pagination information.",
17+
"type": "object",
18+
"properties": {}
19+
},
20+
"data": {
21+
"description": "The data packet",
22+
"type": "object",
23+
"properties": {}
24+
}
25+
}
26+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"description": "The user that is logged in",
3+
"type": "object",
4+
"properties": {
5+
"id": {
6+
"description": "The User ID",
7+
"type": "integer"
8+
},
9+
"firstName": {
10+
"description": "The user's first name",
11+
"type": "string"
12+
},
13+
"lastName": {
14+
"description": "The user's last name",
15+
"type": "integer"
16+
},
17+
"username": {
18+
"description": "The user's username",
19+
"type": "string"
20+
},
21+
"permissions": {
22+
"description": "The collection of permissions",
23+
"type": "array",
24+
"items" : {
25+
"type" : "string"
26+
}
27+
},
28+
"roles": {
29+
"description": "The collection of roles",
30+
"type": "array",
31+
"items" : {
32+
"type" : "string"
33+
}
34+
}
35+
}
36+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"description" : "An invalid field will contain an array of information messages",
3+
"type" : "array",
4+
"items" : {
5+
"type" : "object",
6+
"properties" : {
7+
"MESSAGE" :{
8+
"type" : "string",
9+
"description" : "The human readable error message"
10+
},
11+
"VALIDATIONDATA" :{
12+
"type" : "boolean",
13+
"description" : "The validation data attached"
14+
},
15+
"ERRORMETADATA" :{
16+
"type" : "object",
17+
"description" : "Any error metdata attached"
18+
},
19+
"REJECTEDVALUE" :{
20+
"type" : "string",
21+
"description" : "The rejected value if any"
22+
},
23+
"VALIDATIONTYPE" :{
24+
"type" : "string",
25+
"description" : "The contraint type applied"
26+
},
27+
"FIELD" :{
28+
"type" : "string",
29+
"description" : "The field name that caused the validation"
30+
}
31+
}
32+
}
33+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"data": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE1ODkzMDUwMzEsInNjb3BlcyI6W10sImlzcyI6Imh0dHA6Ly8xMjcuMC4wLjE6NjUxMDAvIiwic3ViIjoxLCJleHAiOjE1ODkzMDg2MzEsImp0aSI6IkQxNkI4Qzg5NTc2OUU5MDcyNUNBQTU3M0I3M0FCNTc2In0.VDsqEDCXtHnrMXZYXqE2To2lQpmQAmHP8asXjhw_c2KsI_1mx2gZETuIrVNXckUl9zdevx2O818PlCkp6znmGw",
3+
"error": false,
4+
"pagination": {},
5+
"messages": [
6+
"Bearer token created and it expires in 60 minutes"
7+
]
8+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"data": {
3+
"lastName": [
4+
{
5+
"MESSAGE": "The 'lastName' value is required",
6+
"VALIDATIONDATA": true,
7+
"ERRORMETADATA": {},
8+
"REJECTEDVALUE": "",
9+
"VALIDATIONTYPE": "Required",
10+
"FIELD": "lastName"
11+
}
12+
],
13+
"firstName": [
14+
{
15+
"MESSAGE": "The 'firstName' value is required",
16+
"VALIDATIONDATA": true,
17+
"ERRORMETADATA": {},
18+
"REJECTEDVALUE": "",
19+
"VALIDATIONTYPE": "Required",
20+
"FIELD": "firstName"
21+
}
22+
],
23+
"PASSWORD": [
24+
{
25+
"MESSAGE": "The 'PASSWORD' value is required",
26+
"VALIDATIONDATA": true,
27+
"ERRORMETADATA": {},
28+
"REJECTEDVALUE": "",
29+
"VALIDATIONTYPE": "Required",
30+
"FIELD": "PASSWORD"
31+
}
32+
],
33+
"USERNAME": [
34+
{
35+
"MESSAGE": "The 'USERNAME' value is required",
36+
"VALIDATIONDATA": true,
37+
"ERRORMETADATA": {},
38+
"REJECTEDVALUE": "",
39+
"VALIDATIONTYPE": "Required",
40+
"FIELD": "USERNAME"
41+
}
42+
]
43+
},
44+
"error": true,
45+
"pagination": {},
46+
"messages": [
47+
"Validation exceptions occurred, please see the data"
48+
]
49+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"description": "Needed fields to login a user",
3+
"required": true,
4+
"content": {
5+
"application/json": {
6+
"schema": {
7+
"type": "object",
8+
"required": [
9+
"username",
10+
"password"
11+
],
12+
"properties": {
13+
"username": {
14+
"description": "The username to use for login in",
15+
"type": "string"
16+
},
17+
"password": {
18+
"description": "The password to use for login in",
19+
"type": "string"
20+
}
21+
},
22+
"example": {
23+
"username": "user",
24+
"password": "test"
25+
}
26+
}
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)