extensions/utilities/ds_shelf_utilities_export
library
Functions
-
dsShelfApiKeyMiddleware(String expectedKey)
→ Middleware
-
Simple API key check middleware.
-
dsShelfCapitalize(String input)
→ String
-
Capitalize the first letter of a string.
-
dsShelfCustomTagMiddleware()
→ Middleware
-
Example custom middleware: tags each request with foo=bar.
-
dsShelfErrorResponse(String message, {int statusCode = 400})
→ Response
-
Wrap an error message in a JSON response.
-
Extract Bearer token from Authorization header.
-
dsShelfJoinPaths(String base, String segment)
→ String
-
Safely join two URL or file path segments.
-
dsShelfJsonResponse(Object data, {int statusCode = 200})
→ Response
-
Wrap data in a JSON response.
-
dsShelfParseJson(String jsonStr)
→ Map<String, dynamic>
-
Parse a JSON string into a Map.
-
dsShelfParseQueryParams(Request request)
→ Map<String, String>
-
Extract query parameters from a request.
-
dsShelfSaveUploadedFile(Request request, {String? targetPath, String uploadDirectory = 'upload', DSStorageManager? storageManager, String? storagePath, Map<String, dynamic>? metadata, String fieldName = 'file'})
→ Future<DSShelfUploadedFileResult>
-
-
dsShelfToJson(Object data)
→ String
-
Convert an object to its JSON string representation.