skill3th_core library
Skill3 API client for Flutter. Everything outside lib/src that an app may
use is exported here; do not import from src.
Classes
- AuthResource
-
CRUD on one authenticated resource (
profile,organ). Every call sends the access token. - AuthService
-
User authentication of the configured scope:
site→v1/sites/users/auth,organ→v1/users/auth,core→v1/core/users/auth. - CoreSiteService
-
Resolves the site from a domain and keeps its token (
X-Client-Site). - CustomFetch
- CustomService
-
Calls any endpoint by
"<module>/<path>", e.g.fetch.get('land/areas')→GET <base>v1/land/areas. Sends the access token by default. - ErrorCodes
- MemoryStorageProvider
- Lost when the app closes. For tests.
-
ReadonlyValue<
T> - A value that can be read and watched.
- RequestOptions
- RequestTarget
-
Where the request goes:
<base><version>/<module>/<path>. - SessionStore
-
Session values in the configured storage under
<prefix><key>. - Default storage. Not encrypted (see KI-1 in docs/KNOWN-ISSUES.md).
- Skill3Client
- Everything one app needs, wired together.
- Skill3ClientErrors
-
Codes the library puts in
error.json.codewhen no HTTP response came back. - Skill3Config
- Skill3Environment
-
Where the API is. Read from wherever the app keeps its settings
(the library never reads
.envitself). - Skill3File
-
A file held in memory, for multipart requests. Works on every platform,
including web, where
dart:ioFilecannot be read. - Skill3Http
- Sends requests to the Skill3 API.
- Skill3List
-
List response of a GET without
single. - Skill3RequestDefaults
-
include/querysent by default with a request. - Skill3Response
-
Full response of
Skill3Http.request(). Header names are lower case. - Skill3State
- Session state shared by the services. One instance per client.
- StorageKeys
- Storage key names (without prefix). Same names as the web SDK.
- StorageProvider
-
Where the session is kept. Implement it to use another store.
There is no
clear(): the store may also hold keys of the app.
Enums
- Skill3ResponseType
- How the body of a 2xx response is read.
- Skill3Scope
- Which Skill3 API family the app talks to. Decides the auth endpoints and the storage key prefix.
Functions
-
authEndpoint(
Skill3Scope scope, [String? scopePrefix]) → RequestTarget - Endpoints of the user auth for a scope.
-
createSkill3(
[Skill3Config config = const Skill3Config()]) → Skill3Client - Creates a client. Create one per app and share it: token renewal is coordinated inside one client.
-
errorCode(
Object? err) → String? -
error.json.codeof a Skill3HttpError,nullfor anything else. -
errorStatus(
Object? err) → int? -
statusof a Skill3HttpError,nullfor anything else.
Exceptions / Errors
- Skill3HttpError
- Rejection of a failed request.