Warky Devs

Warky Devs

Vanderbijlpark, South Africa

modelgate (1.4.1)

Published 2026-10-14 20:10:41 +00:00 by warkanum

Installation

dart pub add modelgate:1.4.1 --hosted-url=https://git.warky.dev/api/packages/wdevs/pub/

About this package

Client for PostAPI (JSON body) and FunctionAPI endpoints.

modelgate (Dart)

Dart / Flutter client for PostAPI (JSON body) and FunctionAPI. Depends on package:http. Dart >= 3.3.

Clients

Type Constructor Methods
PostAPIClient (baseUrl, [ClientOptions]) getMetadata read create update delete close
FunctionAPIClient (baseUrl, [ClientOptions]) query queryList close

ClientOptions(token:, headers:, timeout:, httpClient:). Precedence: Content-Type < custom headers < bearer token.

PostAPI

  • id: int/String → URL, List<String> → body. Named args: id:, options:.
  • Options, FilterOption(column, operator, [value, logic]), SortOption(column, [direction]).
  • Result: Response{success, data (decoded JSON), metadata}.

FunctionAPI

  • Routes are server-defined: pass the path.
  • params: map → query string (list → repeated keys, null skipped).
  • FunctionAPIOptions → X-* headers: filters, searchFilters, customSqlWhere, customSqlOr, sort, limit, offset, distinct, skipCount, skipCache, responseFormat.
  • queryList fills metadata from Content-Range; 206 is success.
  • Helpers: buildHeaders, buildQuery, encodeHeaderValue, decodeHeaderValue.

Server quirks

  • sort is raw SQL in ORDER BY (client sends col ASC|DESC).
  • One search operator per column.
  • Values starting ZIP_ / __ are base64-decoded by the server.
  • Non-ASCII, control chars and edge spaces are auto-encoded (ZIP_).

Errors

ModelGateException{statusCode, message, error: ApiError{code, detail, sql}}.

Test

dart test

Details
Pub
2026-10-14 20:10:41 +00:00
1
9.5 KiB
Assets (1)
1.4.1.tar.gz 9.5 KiB
Versions (1) View all
1.4.1 2026-10-14