Skip to content

Releases: pocketbase/js-sdk

v0.21.3 Release

31 May 16:33
Compare
Choose a tag to compare

v0.21.2 Release

21 Apr 20:21
Compare
Choose a tag to compare
  • Exported HealthService types (#289).

v0.21.1 Release

03 Feb 14:53
Compare
Choose a tag to compare
  • Manually update the verified state of the current matching AuthStore model on successful "confirm-verification" call.

  • Manually clear the current matching AuthStore on "confirm-email-change" call because previous tokens are always invalidated.

  • Fixed the fetch mock tests to check also the sent body param values.

  • Formatted the source code with prettier.

v0.21.0 Release

24 Jan 10:00
Compare
Choose a tag to compare

⚠️ This release works only with PocketBase v0.21.0+ due to changes of how the multipart/form-data body is handled.

  • Properly sent json body with multipart/form-data requests.
    This should fix the edge cases mentioned in the v0.20.3 release.

  • Gracefully handle OAuth2 redirect error with the authWithOAuth2() call.

v0.20.3 Release

14 Jan 11:55
Compare
Choose a tag to compare
  • Partial and temporary workaround for the auto application/json -> multipart/form-data request serialization of a json field when a Blob/File is found in the request body (#274).

    The "fix" is partial because there are still 2 edge cases that are not handled - when a json field value is empty array (eg. []) or array of strings (eg. ["a","b"]).
    The reason for this is because the SDK doesn't have information about the field types and doesn't know which field is a json or an arrayable select, file or relation, so it can't serialize it properly on its own as FormData string value.

    If you are having troubles with persisting json values as part of a multipart/form-data request the easiest fix for now is to manually stringify the json field value:

    await pb.collection("example").create({
      // having a Blob/File as object value will convert the request to multipart/form-data
      "someFileField": new Blob([123]),
      "someJsonField": JSON.stringify(["a","b","c"]),
    })

    A proper fix for this will be implemented with PocketBase v0.21.0 where we'll have support for a special @jsonPayload multipart body key, which will allow us to submit mixed multipart/form-data content (kindof similar to the multipart/mixed MIME).

v0.20.2 Release

11 Jan 10:20
Compare
Choose a tag to compare
  • Throw 404 error for getOne("") when invoked with empty id (#271).

  • Added @throw {ClientResponseError} jsdoc annotation to the regular request methods (#262).

v0.20.1 Release

11 Dec 15:21
Compare
Choose a tag to compare
  • Propagate the PB_CONNECT EventSource message to allow listening to the realtime connect/reconnect events.
    pb.realtime.subscribe("PB_CONNECT", (e) => {
      console.log(e.clientId);
    })

v0.20.0 Release

10 Dec 13:13
Compare
Choose a tag to compare
  • Added expand, filter, fields, custom query and headers parameters support for the realtime subscriptions.

    pb.collection("example").subscribe("*", (e) => {
      ...
    }, { filter: "someField > 10" });

    This works only with PocketBase v0.20.0+.

  • Changes to the logs service methods in relation to the logs generalization in PocketBase v0.20.0+:

    pb.logs.getRequestsList(...)  -> pb.logs.getList(...)
    pb.logs.getRequest(...)       -> pb.logs.getOne(...)
    pb.logs.getRequestsStats(...) -> pb.logs.getStats(...)
  • Added missing SchemaField.presentable field.

  • Added new AuthProviderInfo.displayName string field.

  • Added new AuthMethodsList.onlyVerified bool field.

v0.20.0-rc Prerelease

24 Oct 12:37
Compare
Choose a tag to compare
v0.20.0-rc Prerelease Pre-release
Pre-release
  • Added experimental expand, filter, fields, custom query and headers parameters support for the realtime subscriptions.
    pb.collection("example").subscribe("*", (e) => {
      ...
    }, { filter: "someField > 10" });
    This works only with PocketBase v0.20.0-rc.

v0.19.0 Release

18 Oct 13:57
Compare
Choose a tag to compare
  • Added pb.filter(rawExpr, params?) helper to construct a filter string with placeholder parameters populated from an object.

    const record = await pb.collection("example").getList(1, 20, {
      // the same as: "title ~ 'te\\'st' && (totalA = 123 || totalB = 123)"
      filter: pb.filter("title ~ {:title} && (totalA = {:num} || totalB = {:num})", { title: "te'st", num: 123 })
    })

    The supported placeholder parameter values are:

    • string (single quotes will be autoescaped)
    • number
    • boolean
    • Date object (will be stringified into the format expected by PocketBase)
    • null
    • anything else is converted to a string using JSON.stringify()