zonai_client 0.2.2
zonai_client: ^0.2.2 copied to clipboard
Typed Dart and Flutter client for a Zonai backend: auth, CRUD, file uploads, and live SQLite query streams over HTTP.
0.2.2 #
- The barrel now exports the query vocabulary, so a consumer can name the types the generated typed client takes and returns.
zonai gen clientemits code whose signatures areWhere,Update,OrderByTermand friends; before this, that code compiled only if the app also depended onzonai_schemadirectly and imported it by hand, which defeats the point of a generated client. Added:Where,Update,UpdateValue,ColumnUpdate,ObjectUpdate,OrderByTerm,SortDirection, the comparison and set clauses (Eq,Gt,Gte,Lt,Lte,In,NotIn,And,Or,Literal), the string clauses (Contains,NotContains,StartsWith,EndsWith), and the mutation values (Add,AddAll,Remove,RemoveAll,Increment,Decrement). Also newly exported are the data sources a typed client hangs off —Db,DbListen,AdminAuth,Emails,Photos. Purely additive; nothing was removed or renamed. NullandNotNullare deliberately not exported, and this is the one place the addition is not mechanical. A library that imports them shadowsdart:core'sNull, because Dart resolves an explicit import ahead of the implicitdart:coreone — so everyNullwritten in that library would mean the where-clause class instead. Build those clauses withWhere.isNull/Where.isNotNull(new inzonai_schema), which redirect to them. If you already importpackage:zonai_schema/payloads.dartdirectly and rely onNull, nothing changes for you.- The
zonai_schemalower bound moves to>=0.4.1(was>=0.1.0). It is load-bearing for the first time:Where.isNull/Where.isNotNullare the documented way to build the two clauses this barrel withholds, and they do not exist below 0.4.1. Against 0.4.0 this package would export a query vocabulary with no way to express IS NULL, andzonai gen clientoutput — whose runtime callsWhere.isNull— would not compile.
0.2.1 #
- Widen the
zonai_schemaconstraint to>=0.1.0 <0.5.0so consumers can move tozonai_schema0.4.0. The published 0.2.0 declares<0.4.0, which excludes it — anyone using this client alongsidezonai_schemais pinned below 0.4.0 regardless of what they ask for, and 0.4.0 is the release carrying push notifications and the tightened auth defaults that Zonai CLI v0.8.0 requires. Nothing here references what changed in 0.4.0 (push vocabulary and rate-limit defaults, both server-side), so this spans the minors rather than pinning to the newest. - OAuth reaches the client.
Authgainsproviders({table}),startUrl({...}),complete({...})andsignInWithIdToken({...}), covering both the redirect flow and the native one. Underneath,AuthDataSourcegainsstartOAuth,oauth,oauthProviders,oauthCallbackFormPostandacceptAdminInvite, and a newAdminDataSource(members,invite,revokeInvite,removeMember) is reachable asclient.admin. Additive throughout; the package's exported entrypoint surface is unchanged. - The generated client gains
MaintenanceDataSource—purgeLogs,purgeTable,cleanupPhotosandreclaimLogSpace, reachable asclient.maintenance— andDashboardDataSource.storage(), which back the dashboard's new Maintenance screen. EmailDataSource.send,RootDataSource.swaggerJsonandRootDataSource.swaggerYamlnow take an optionalauthorizationargument, because the server no longer serves those unauthenticated. Additive for callers; if you implement or mock any of these interfaces yourself, you will need to add the parameter and the new members.
0.2.0 #
- Breaking: require
revali_client^3.0.0(was^2.1.0). This is breaking for you only if you pass your own interceptor toZonaiClient(extraInterceptors: [...]), becauseHttpInterceptor.onRequestandonResponsenow returnFutureOr<HttpResponse?>instead ofvoid. The migration is mechanical: change the return type andreturn null, which means "carry on". Returning a response instead is the new capability — fromonRequestit answers the call without sending anything, and fromonResponseit substitutes what arrived, which is what makes retries, caching and circuit breaking expressible at all. Callers who pass no interceptor of their own are unaffected; this package's own X-Auth interceptor already returnednullthroughout. - Behaviour change, no API change: a throwing interceptor now fails the request instead of being swallowed. Previously an interceptor that threw let the request continue in whatever half-prepared state it was left in, so a failed auth interceptor put an unauthenticated request on the wire and surfaced as a puzzling
401from the server rather than as an error where it actually broke. If you relied on that swallowing, catch inside your interceptor. - The bundled
revali_clientalso gainsRevaliClient.timeoutand an opt-inRetryPolicy, andServerExceptionnow parses the server's error envelope (code,reason,details,isStructured) when one was sent. This client does not yet configure any of them; they are listed because they arrive in the dependency you now resolve. - No change to this package's own public API, generated client, or
zonai_schemaconstraint. The generated client is byte-identical underrevali_client_gen2.5.0.
0.1.3 #
- Widen the
zonai_schemaconstraint to>=0.1.0 <0.4.0so consumers can move tozonai_schema0.3.0. The published 0.1.2 declares<0.3.0, which excludes it — anyone using this client alongsidezonai_schemais pinned below 0.3.0 regardless of what they ask for, and 0.3.0 is the release carrying the scheduled-cron fix. Nothing here references what changed in 0.3.0 (arevali_coremajor and new cron IPC vocabulary, both server-side), so this spans the minors rather than pinning to the newest.
0.1.2 #
- Widen the
zonai_schemaconstraint to>=0.1.0 <0.3.0so consumers can move tozonai_schema0.2.0. The published 0.1.1 declares^0.1.0, which excludes it — anyone using this client alongsidezonai_schemawas pinned below 0.2.0 regardless of what they asked for. Nothing here references the API that changed in 0.2.0 (TableRateLimits.customPolicy, which is server-side), so this deliberately spans both minors rather than pinning to the new one. - Add
RootDataSource.logo(), backing the optional dashboard logo served fromimagesPath. Additive for callers; if you implement or mockRootDataSourceyourself, you will need to add the member.
0.1.1 #
- Fix:
lib/gen/(the generated Revali HTTP client) was excluded from the published package by the repo's root.gitignore, making 0.1.0 unimportable. The generated client is now tracked and shipped.
0.1.0 #
- Initial release.