Implement namespace CRUD + various small fixes
Other fixes and improvements: - add parseISODateWithErr and parseISODatePtrWithErr handlers for incoming data - add service & repository errors - cleanup old (unbound) attachment controllers from router - fix system repository error prefix (auth => system)
This commit is contained in:
+160
-1
@@ -24,6 +24,165 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Namespaces",
|
||||
"parameters": {},
|
||||
"entrypoint": "namespace",
|
||||
"path": "/namespace",
|
||||
"authentication": [],
|
||||
"struct": [
|
||||
{
|
||||
"imports": [
|
||||
"sqlxTypes github.com/jmoiron/sqlx/types",
|
||||
"time"
|
||||
]
|
||||
}
|
||||
],
|
||||
"apis": [
|
||||
{
|
||||
"name": "list",
|
||||
"method": "GET",
|
||||
"title": "List namespaces",
|
||||
"path": "/",
|
||||
"parameters": {
|
||||
"get": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "query",
|
||||
"required": false,
|
||||
"title": "Search query"
|
||||
},
|
||||
{
|
||||
"name": "page",
|
||||
"type": "uint",
|
||||
"required": false,
|
||||
"title": "Page number (0 based)"
|
||||
},
|
||||
{
|
||||
"name": "perPage",
|
||||
"type": "uint",
|
||||
"required": false,
|
||||
"title": "Returned items per page (default 50)"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "create",
|
||||
"method": "POST",
|
||||
"title": "Create namespace",
|
||||
"path": "/",
|
||||
"parameters": {
|
||||
"post": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "name",
|
||||
"required": true,
|
||||
"title": "Name"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "slug",
|
||||
"required": true,
|
||||
"title": "Slug (url path part)"
|
||||
},
|
||||
{
|
||||
"type": "bool",
|
||||
"name": "enabled",
|
||||
"required": true,
|
||||
"title": "Enabled"
|
||||
},
|
||||
{
|
||||
"type": "sqlxTypes.JSONText",
|
||||
"name": "meta",
|
||||
"required": true,
|
||||
"title": "Meta data"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "read",
|
||||
"method": "GET",
|
||||
"title": "Read namespace",
|
||||
"path": "/{namespaceID}",
|
||||
"parameters": {
|
||||
"path": [
|
||||
{
|
||||
"type": "uint64",
|
||||
"name": "namespaceID",
|
||||
"required": true,
|
||||
"title": "ID"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "update",
|
||||
"method": "POST",
|
||||
"title": "Update namespace",
|
||||
"path": "/{namespaceID}",
|
||||
"parameters": {
|
||||
"path": [
|
||||
{
|
||||
"type": "uint64",
|
||||
"name": "namespaceID",
|
||||
"required": true,
|
||||
"title": "ID"
|
||||
}
|
||||
],
|
||||
"post": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "name",
|
||||
"required": true,
|
||||
"title": "Name"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "slug",
|
||||
"required": true,
|
||||
"title": "Slug (url path part)"
|
||||
},
|
||||
{
|
||||
"type": "bool",
|
||||
"name": "enabled",
|
||||
"required": true,
|
||||
"title": "Enabled"
|
||||
},
|
||||
{
|
||||
"type": "sqlxTypes.JSONText",
|
||||
"name": "meta",
|
||||
"required": true,
|
||||
"title": "Meta data"
|
||||
},
|
||||
{
|
||||
"type": "*time.Time",
|
||||
"name": "updatedAt",
|
||||
"required": true,
|
||||
"title": "Last update (or creation) date"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "delete",
|
||||
"method": "DELETE",
|
||||
"title": "Delete namespace",
|
||||
"path": "/{namespaceID}",
|
||||
"parameters": {
|
||||
"path": [
|
||||
{
|
||||
"type": "uint64",
|
||||
"name": "namespaceID",
|
||||
"required": true,
|
||||
"title": "ID"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Pages",
|
||||
"description": "Compose module pages",
|
||||
@@ -374,7 +533,7 @@
|
||||
},
|
||||
{
|
||||
"title": "Records",
|
||||
"description": "Compose records ",
|
||||
"description": "Compose records",
|
||||
"entrypoint": "record",
|
||||
"path": "/module/{moduleID}/record",
|
||||
"authentication": [],
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
{
|
||||
"Title": "Namespaces",
|
||||
"Interface": "Namespace",
|
||||
"Struct": [
|
||||
{
|
||||
"imports": [
|
||||
"sqlxTypes github.com/jmoiron/sqlx/types",
|
||||
"time"
|
||||
]
|
||||
}
|
||||
],
|
||||
"Parameters": {},
|
||||
"Protocol": "",
|
||||
"Authentication": [],
|
||||
"Path": "/namespace",
|
||||
"APIs": [
|
||||
{
|
||||
"Name": "list",
|
||||
"Method": "GET",
|
||||
"Title": "List namespaces",
|
||||
"Path": "/",
|
||||
"Parameters": {
|
||||
"get": [
|
||||
{
|
||||
"name": "query",
|
||||
"required": false,
|
||||
"title": "Search query",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "page",
|
||||
"required": false,
|
||||
"title": "Page number (0 based)",
|
||||
"type": "uint"
|
||||
},
|
||||
{
|
||||
"name": "perPage",
|
||||
"required": false,
|
||||
"title": "Returned items per page (default 50)",
|
||||
"type": "uint"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "create",
|
||||
"Method": "POST",
|
||||
"Title": "Create namespace",
|
||||
"Path": "/",
|
||||
"Parameters": {
|
||||
"post": [
|
||||
{
|
||||
"name": "name",
|
||||
"required": true,
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "slug",
|
||||
"required": true,
|
||||
"title": "Slug (url path part)",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "enabled",
|
||||
"required": true,
|
||||
"title": "Enabled",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "meta",
|
||||
"required": true,
|
||||
"title": "Meta data",
|
||||
"type": "sqlxTypes.JSONText"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "read",
|
||||
"Method": "GET",
|
||||
"Title": "Read namespace",
|
||||
"Path": "/{namespaceID}",
|
||||
"Parameters": {
|
||||
"path": [
|
||||
{
|
||||
"name": "namespaceID",
|
||||
"required": true,
|
||||
"title": "ID",
|
||||
"type": "uint64"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "update",
|
||||
"Method": "POST",
|
||||
"Title": "Update namespace",
|
||||
"Path": "/{namespaceID}",
|
||||
"Parameters": {
|
||||
"path": [
|
||||
{
|
||||
"name": "namespaceID",
|
||||
"required": true,
|
||||
"title": "ID",
|
||||
"type": "uint64"
|
||||
}
|
||||
],
|
||||
"post": [
|
||||
{
|
||||
"name": "name",
|
||||
"required": true,
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "slug",
|
||||
"required": true,
|
||||
"title": "Slug (url path part)",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "enabled",
|
||||
"required": true,
|
||||
"title": "Enabled",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"name": "meta",
|
||||
"required": true,
|
||||
"title": "Meta data",
|
||||
"type": "sqlxTypes.JSONText"
|
||||
},
|
||||
{
|
||||
"name": "updatedAt",
|
||||
"required": true,
|
||||
"title": "Last update (or creation) date",
|
||||
"type": "*time.Time"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "delete",
|
||||
"Method": "DELETE",
|
||||
"Title": "Delete namespace",
|
||||
"Path": "/{namespaceID}",
|
||||
"Parameters": {
|
||||
"path": [
|
||||
{
|
||||
"name": "namespaceID",
|
||||
"required": true,
|
||||
"title": "ID",
|
||||
"type": "uint64"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user