Pocketbase

Latest version: v0.12.0

Safety actively analyzes 637090 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 8

0.20.1

- Propagate the `PB_CONNECT` event to allow listening to the realtime connect/reconnect events.
js
pb.realtime.subscribe("PB_CONNECT", (e) => {
console.log(e.clientId);
})

0.20.0

- Added `expand`, `filter`, `fields`, custom query and headers parameters support for the realtime subscriptions.
js
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+:
js
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.

0.19.0

- Added `pb.filter(rawExpr, params?)` helper to construct a filter string with placeholder parameters populated from an object.

js
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()`

0.18.3

- Added optional generic support for the `RecordService` ([251](https://github.com/pocketbase/js-sdk/issues/251)).
This should allow specifying a single TypeScript definition for the client, eg. using type assertion:
ts
interface Task {
id: string;
name: string;
}

interface Post {
id: string;
title: string;
active: boolean;
}

interface TypedPocketBase extends PocketBase {
collection(idOrName: string): RecordService // default fallback for any other collection
collection(idOrName: 'tasks'): RecordService<Task>
collection(idOrName: 'posts'): RecordService<Post>
}

...

const pb = new PocketBase("http://127.0.0.1:8090") as TypedPocketBase;

// the same as pb.collection('tasks').getOne<Task>("RECORD_ID")
await pb.collection('tasks').getOne("RECORD_ID") // -> results in Task

// the same as pb.collection('posts').getOne<Post>("RECORD_ID")
await pb.collection('posts').getOne("RECORD_ID") // -> results in Post

0.18.2

- Added support for assigning a `Promise` as `AsyncAuthStore` initial value ([249](https://github.com/pocketbase/js-sdk/issues/249)).

0.18.1

- Fixed realtime subscriptions auto cancellation to use the proper `requestKey` param.

Page 2 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.