dmart 2.14.0
dmart: ^2.14.0 copied to clipboard
A pure Dart implementation of the Dmart client that depends on dio.
2.14.0 #
Compatibility: Requires csdmart ≥ 1.6.12 (getClientConfig needs it; getPermissions falls back to the profile and the rest works on older servers). Top-level shortname on sign-up and the username rule in client config need ≥ 1.7.9. Aligned with csdmart 1.7.10.
Added #
getClientConfig()andClientConfigreadGET /public/client-config: code length and resend wait, upload and query limits, and the password and username rules with their hints. No sign-in is needed.DmartErrorCode: dmart's error codes as constants, the same 19 pydmart and tsdmart carry under the same name, among themotpNeeded(115),otpInvalid(307),otpExpired(308),userIsntVerified(11),userAccountLocked(110),conflict(409),invalidTicketStatus(300),passwordResetError(102),invalidData(402),notAllowed(401),passwordHashingBusy(503) andrequestTimeout(504).LoginRequest.withPasswordAndOTPfor the second step of a sign-in that answeredOTP_NEEDED(115). Admins always sign in this way, and since dmart 1.7.2 so does a mobile account's first sign-in from a device.Dmart.deviceId(alsoinitDmart(deviceId:)) is sent asX-DeviceIdonloginwhen the request has nodeviceIDof its own. dmart ≥ 1.7.2 refuses a mobile sign-in without a device id.VerifyContactRequest.passwordandcurrentCode(current_code). Changing an address needs one of them: the password on an account that has one, otherwise a code sent to the existing address.UserType.adminandContentType.binary. Until now an admin's sign-in failed to parse.ProfileResponseRecordAttributes.mailbox,mailAliasesandservices.- Query
attributes.totalIsLowerBound(total_is_lower_bound), which is set whentotalis the server's cap rather than the exact count.
Changed #
createUsersends only fields dmart's/user/createreads: the top-levelshortnameplusdisplayname,email,msisdn,password,language,email_otpandmsisdn_otp. (dmart also acceptsdescription,tagsand apayloadon sign-up, whichCreateUserAttributesdoes not carry yet.) Thesubpathandresource_typewrapper fields are gone. On the attributes,invitation,profilePicUrl,roles,groups,firebaseToken,deviceID,isEmailVerified,isMsisdnVerifiedandforcePasswordChangeare deprecated and no longer sent, andis_activeis no longer sent either. dmart never applied any of them on self-registration.invitationis now optional.- Documented, on
login,createUser,updateProfileandverifyContact: theOTP_NEEDEDtwo-step;USER_ISNT_VERIFIED(11) for a password sign-in naming an unproven address (dmart ≥ 1.7.10); the registration codes, which dmart ≥ 1.7.10 always requires when registration is open; andold_passwordfor a password change. QueryRequest.validateSchemais deprecated, because dmart ≥ 1.5.0 ignores it. A nulllimitgets the server's default.
Fixed #
attachposted to/attach/{space}, a route dmart doesn't have. It now posts to/public/attach/{space}, and it no longer requires a token, since the route is anonymous.
Removed #
userReset. dmart dropped/user/reset, so the call always failed against csdmart.
2.13.0 #
- Add
getPermissions, which reads the caller's permission map from/user/permissions. dmart deprecates the copy in/user/profile, the heaviest part of that response, in favour of this route. A server without the route answersINVALID_ROUTE(230, HTTP 422); that answer, or a bare 404, is answered from the profile's map. getProfileno longer fails on a profile withoutpermissions;ProfileResponseRecordAttributes.permissionsis then empty. Until now a server that left the map out made everygetProfilecall throw.- Add
Permission.mapFromJson.
2.12.0 #
- Use the OTP routes of dmart >= 1.4.0, which removed
/user/otp-request-login,/user/password-reset-requestand/user/otp-confirm:otpRequestLoginandpasswordResetRequestnow call/user/otp-requestwith purposelogin/reset.confirmOTPnow calls/user/verify-contact.- All three are deprecated in favour of
otpRequestandverifyContact.
- Add
passwordResetConfirm(/user/password-reset-confirm) andPasswordResetConfirmRequest. - Add
OtpPurposeconstants. - Export
VerifyContactRequest, whichverifyContacttakes but the package did not export. otpRequestsends the token forverify-contact;verifyContactno longer sends null fields.
2.8.0 #
- Relicense under LGPL-3.0-or-later
- Upgrade dependencies to latest (dio 5.11, lints 6, test 1.31) to pick up CVE fixes
- Raise minimum Dart SDK to ^3.8.0 (required by lints 6)
1.1.0 #
- add update profile
1.0.10+2 #
- formated code
- upgrading deps
1.0.9 #
- Implementing dmart features up to dmart@1.3.5+
- Extending ResourceType: +reaction
- Extending QueryType: +update, +delete
- Extending dmart init to allow dio configuration.
- remove deprecated feature
branch.
1.0.7 #
- Implementing dmart features up to dmart@1.1.12
1.0.0 #
- Initial version.