pocketbase 0.5.0-rc1 copy "pocketbase: ^0.5.0-rc1" to clipboard
pocketbase: ^0.5.0-rc1 copied to clipboard

Multi-platform Dart SDK for PocketBase, an open source realtime backend in 1 file.

0.5.0-rc1 #

⚠️ This is a pre-release, contains breaking changes and works only with the new PocketBase v0.8+ API!

For a full list with all API changes you could check the main repo's changelog.

Non breaking changes:

  • Added new crud method getFirstListItem(filter) to fetch a single item by a list filter.

  • Added optional named expand argument to all crud functions that returns a RecordModel (with v0.8 we now also support indirect expansion).

  • You can now pass additional account createData when authenticating with OAuth2.

  • Added AuthMethodsList.usernamePassword return field (we now support combined username/email authentication; see below authWithPassword).

Breaking changes:

  • For easier and more conventional parsing, all DateTime strings now have Z as suffix, eg. 2022-01-01 01:02:03.456Z.

  • Moved pb.records.getFileUrl() to pb.getFileUrl().

  • Moved all pb.records.* handlers under pb.collection().*:

    pb.records.getFullList('example');              => pb.collection('example').getFullList();
    pb.records.getList('example');                  => pb.collection('example').getList();
    pb.records.getOne('example', 'RECORD_ID');      => pb.collection('example').getOne('RECORD_ID');
    (no old equivalent)                             => pb.collection('example').getOneByFilter(filter);
    pb.records.create('example', ...);              => pb.collection('example').create(...);
    pb.records.update('example', 'RECORD_ID', ...); => pb.collection('example').update('RECORD_ID', ...);
    pb.records.delete('example', 'RECORD_ID');      => pb.collection('example').delete('RECORD_ID');
    
  • The pb.realtime service has now a more general callback form so that it can be used with custom realtime handlers. Dedicated records specific subscribtions could be found under pb.collection().*:

    pb.realtime.subscribe('example', callback)           => pb.collection('example').subscribe(callback);
    pb.realtime.subscribe('example/RECORD_ID', callback) => pb.collection('example').subscribeOne('RECORD_ID', callback);
    pb.realtime.unsubscribe('example')                   => pb.collection('example').unsubscribe();
    pb.realtime.unsubscribe('example/RECORD_ID')         => pb.collection('example').unsubscribe('RECORD_ID');
    
  • Moved all pb.users.* handlers under pb.collection().*:

    pb.users.listAuthMethods();                                                         => pb.collection('users').listAuthMethods();
    pb.users.authViaEmail(email, password);                                             => pb.collection('users').authWithPassword(usernameOrEmail, password);
    pb.users.authViaOAuth2(provider, code, codeVerifier, redirectUrl, createData: ...); => pb.collection('users').authWithOAuth2(provider, code, codeVerifier, redirectUrl, createData: ...);
    pb.users.refresh();                                                                 => pb.collection('users').authRefresh();
    pb.users.requestPasswordReset(email);                                               => pb.collection('users').requestPasswordReset(email);
    pb.users.confirmPasswordReset(resetToken, newPassword, newPasswordConfirm);         => pb.collection('users').confirmPasswordReset(resetToken, newPassword, newPasswordConfirm);
    pb.users.requestVerification(email);                                                => pb.collection('users').requestVerification(email);
    pb.users.confirmVerification(verificationToken);                                    => pb.collection('users').confirmVerification(verificationToken);
    pb.users.requestEmailChange(newEmail);                                              => pb.collection('users').requestEmailChange(newEmail);
    pb.users.confirmEmailChange(emailChangeToken, password);                            => pb.collection('users').confirmEmailChange(emailChangeToken, password);
    pb.users.listExternalAuths(recordId);                                               => pb.collection('users').listExternalAuths(recordId);
    pb.users.unlinkExternalAuth(recordId, provider);                                    => pb.collection('users').unlinkExternalAuth(recordId, provider);
    
  • Changes in pb.admins for consistency with the new auth handlers in pb.collection().*:

    pb.admins.authViaEmail(email, password); => pb.admins.authWithPassword(email, password);
    pb.admins.refresh();                     => pb.admins.authRefresh();
    
  • Removed UserModel because users are now regular records (aka. RecordModel). This means that if you want to access for example the email of an auth record, you can do something like: record.getStringValue('email'). The old user fields lastResetSentAt, lastVerificationSentAt and profile are no longer available (the profile fields are available under the RecordModel.data property like any other fields).

  • Since there is no longer UserModel, pb.authStore.model can now be of type RecordModel, AdminModel or null.

  • RecordModel.expand is now always Map<String, List<RecordModel>> and it is resolved recursively (previously it was plain Map<String, dynamic>). Please note that for easier and unified record(s) access, the map value is always List, even for single relations. When calling RecordModel.toJson() it will output the expand in its original format.

  • Removed lastResetSentAt from AdminModel.

  • Renamed the getter CrudService.basePath to CrudService.baseCrudPath.

  • Replaced ExternalAuthModel.userId with 2 new recordId and collectionId props.

  • Renamed SubscriptionEvent to RecordSubscriptionEvent.

0.4.1 #

  • Stop sending empty JSON map as body (thanks @rodydavis) [#7].
  • Changed the default ClientException.statusCode from 500 to 0.

0.4.0 #

  • Added UserService.listExternalAuths() to list all linked external auth providers for a single user.
  • Added UserService.unlinkExternalAuth() to delete a single user external auth provider relation.

0.3.0 #

  • Renamed LogRequestModel.ip to LogRequestModel.remoteIp.
  • Added LogRequestModel.userIp (the "real" user ip when behind a reverse proxy).
  • Added SettingsService.testS3() to test the S3 storage connection.
  • Added SettingsService.testEmail() to send a test email.

0.2.0 #

  • Added CollectionService.import().
  • Added totalPages to the ResultList<M> dto.

0.1.1 #

  • Fixed base64.decode exception when AuthStore.isValid is used (related to dart-lang/sdk #39510; thanks @irmhonde).

0.1.0+4 #

  • This release just removes the homepage directive from the pubspec.yaml.

0.1.0+3 #

  • No changes were made again. This release is just to trigger the pub.dev analyzer tool in order to test dart-lang/pub-dev #5927 but this time with ICMP enabled for the homepage domain.

0.1.0+2 #

  • No changes were made. This release is just to trigger the pub.dev analyzer tool in order to test dart-lang/pub-dev #5927.

0.1.0+1 #

  • Added RecordService to the library exports for dartdoc.

0.1.0 #

  • First public release.
185
likes
0
pub points
93%
popularity

Publisher

verified publisherpocketbase.io

Multi-platform Dart SDK for PocketBase, an open source realtime backend in 1 file.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http, json_annotation

More

Packages that depend on pocketbase