Compare commits

..

8 Commits

Author SHA1 Message Date
d9ec1405d7 csv streamlit viewer with geospatial integrations 2025-09-25 21:01:28 +01:00
be20ba8c41 geotxt 2025-09-25 21:01:15 +01:00
674fc57795 pocketbase db 2025-09-25 21:01:11 +01:00
be4a87303a json ot csv file 2025-09-25 21:01:03 +01:00
92e85f9faf extracted csv 2025-09-25 21:00:57 +01:00
d84f72b936 pocketbase 2025-09-25 21:00:46 +01:00
8ffb1735f5 node module 2025-09-25 21:00:11 +01:00
61d36c3beb node packages 2025-09-25 21:00:06 +01:00
84 changed files with 228397 additions and 0 deletions

13
node_modules/.package-lock.json generated vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"name": "personal-tracker",
"lockfileVersion": 3,
"requires": true,
"packages": {
"node_modules/pocketbase": {
"version": "0.26.2",
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.26.2.tgz",
"integrity": "sha512-WA8EOBc3QnSJh8rJ3iYoi9DmmPOMFIgVfAmIGux7wwruUEIzXgvrO4u0W2htfQjGIcyezJkdZOy5Xmh7SxAftw==",
"license": "MIT"
}
}
}

823
node_modules/pocketbase/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,823 @@
## 0.26.2
- Allow body object without constructor ([#352](https://github.com/pocketbase/js-sdk/issues/352)).
## 0.26.1
- Set the `cause` property of `ClientResponseError` to the original thrown error/data for easier debugging ([#349](https://github.com/pocketbase/js-sdk/pull/349); thanks @shish).
## 0.26.0
- Ignore `undefined` properties when submitting an object that has `Blob`/`File` fields (_which is under the hood converted to `FormData`_)
for consistency with how `JSON.stringify` works (see [pocketbase#6731](https://github.com/pocketbase/pocketbase/issues/6731#issuecomment-2812382827)).
## 0.25.2
- Removed unnecessary checks in `serializeQueryParams` and added automated tests.
## 0.25.1
- Ignore query parameters with `undefined` value ([#330](https://github.com/pocketbase/js-sdk/issues/330)).
## 0.25.0
- Added `pb.crons` service to interact with the cron Web APIs.
## 0.24.0
- Added support for assigning `FormData` as body to individual batch requests ([pocketbase#6145](https://github.com/pocketbase/pocketbase/discussions/6145)).
## 0.23.0
- Added optional `pb.realtime.onDisconnect` hook function.
_Note that the realtime client autoreconnect on its own and this hook is useful only for the cases where you want to apply a special behavior on server error or after closing the realtime connection._
## 0.22.1
- Fixed old `pb.authStore.isAdmin`/`pb.authStore.isAuthRecord` and marked them as deprecated in favour of `pb.authStore.isSuperuser` ([#323](https://github.com/pocketbase/js-sdk/issues/323)).
_Note that with PocketBase v0.23.0 superusers are converted to a system auth collection so you can always simply check the value of `pb.authStore.record?.collectionName`._
## 0.22.0
**⚠️ This release introduces some breaking changes and works only with PocketBase v0.23.0+.**
- Added support for sending batch/transactional create/updated/delete/**upsert** requests with the new batch Web APIs.
```js
const batch = pb.createBatch();
batch.collection("example1").create({ ... });
batch.collection("example2").update("RECORD_ID", { ... });
batch.collection("example3").delete("RECORD_ID");
batch.collection("example4").upsert({ ... });
const result = await batch.send();
```
- Added support for authenticating with OTP (email code):
```js
const result = await pb.collection("users").requestOTP("test@example.com");
// ... show a modal for users to check their email and to enter the received code ...
await pb.collection("users").authWithOTP(result.otpId, "EMAIL_CODE");
```
Note that PocketBase v0.23.0 comes also with Multi-factor authentication (MFA) support.
When enabled from the dashboard, the first auth attempt will result in 401 response and a `mfaId` response,
that will have to be submitted with the second auth request. For example:
```js
try {
await pb.collection("users").authWithPassword("test@example.com", "1234567890");
} catch (err) {
const mfaId = err.response?.mfaId;
if (!mfaId) {
throw err; // not mfa -> rethrow
}
// the user needs to authenticate again with another auth method, for example OTP
const result = await pb.collection("users").requestOTP("test@example.com");
// ... show a modal for users to check their email and to enter the received code ...
await pb.collection("users").authWithOTP(result.otpId, "EMAIL_CODE", { "mfaId": mfaId });
}
```
- Added new `pb.collection("users").impersonate("RECORD_ID")` method for superusers.
It authenticates with the specified record id and returns a new client with the impersonated auth state loaded in a memory store.
```js
// authenticate as superusers (with v0.23.0 admins is converted to a special system auth collection "_superusers"):
await pb.collection("_superusers").authWithPassword("test@example.com", "1234567890");
// impersonate
const impersonateClient = pb.collection("users").impersonate("USER_RECORD_ID", 3600 /* optional token duration in seconds */)
// log the impersonate token and user data
console.log(impersonateClient.authStore.token);
console.log(impersonateClient.authStore.record);
// send requests as the impersonated user
impersonateClient.collection("example").getFullList();
```
- Added new `pb.collections.getScaffolds()` method to retrieve a type indexed map with the collection models (base, auth, view) loaded with their defaults.
- Added new `pb.collections.truncate(idOrName)` to delete all records associated with the specified collection.
- Added the submitted fetch options as 3rd last argument in the `pb.afterSend` hook.
- Instead of replacing the entire `pb.authStore.record`, on auth record update we now only replace the available returned response record data ([pocketbase#5638](https://github.com/pocketbase/pocketbase/issues/5638)).
- ⚠️ Admins are converted to `_superusers` auth collection and there is no longer `AdminService` and `AdminModel` types.
`pb.admins` is soft-deprecated and aliased to `pb.collection("_superusers")`.
```js
// before -> after
pb.admins.* -> pb.collection("_superusers").*
```
- ⚠️ `pb.authStore.model` is soft-deprecated and superseded by `pb.authStore.record`.
- ⚠️ Soft-deprecated the OAuth2 success auth `meta.avatarUrl` response field in favour of `meta.avatarURL` for consistency with the Go conventions.
- ⚠️ Changed `AuthMethodsList` inerface fields to accomodate the new auth methods and `listAuthMethods()` response.
```
{
"mfa": {
"duration": 100,
"enabled": true
},
"otp": {
"duration": 0,
"enabled": false
},
"password": {
"enabled": true,
"identityFields": ["email", "username"]
},
"oauth2": {
"enabled": true,
"providers": [{"name": "gitlab", ...}, {"name": "google", ...}]
}
}
```
- ⚠️ Require specifying collection id or name when sending test email because the email templates can be changed per collection.
```js
// old
pb.settings.testEmail(email, "verification")
// new
pb.settings.testEmail("users", email, "verification")
```
- ⚠️ Soft-deprecated and aliased `*Url()` -> `*URL()` methods for consistency with other similar native JS APIs and the accepted Go conventions.
_The old methods still works but you may get a console warning to replace them because they will be removed in the future._
```js
pb.baseUrl -> pb.baseURL
pb.buildUrl() -> pb.buildURL()
pb.files.getUrl() -> pb.files.getURL()
pb.backups.getDownloadUrl() -> pb.backups.getDownloadURL()
```
- ⚠️ Renamed `CollectionModel.schema` to `CollectionModel.fields`.
- ⚠️ Renamed type `SchemaField` to `CollectionField`.
## 0.21.5
- Shallow copy the realtime subscribe `options` argument for consistency with the other methods ([#308](https://github.com/pocketbase/js-sdk/issues/308)).
## 0.21.4
- Fixed the `requestKey` handling in `authWithOAuth2({...})` to allow manually cancelling the entire OAuth2 pending request flow using `pb.cancelRequest(requestKey)`.
_Due to the [`window.close` caveats](https://developer.mozilla.org/en-US/docs/Web/API/Window/close) note that the OAuth2 popup window may still remain open depending on which stage of the OAuth2 flow the cancellation has been invoked._
## 0.21.3
- Enforce temporary the `atob` polyfill for ReactNative until [Expo 51+ and React Native v0.74+ `atob` fix get released](https://github.com/reactwg/react-native-releases/issues/287).
## 0.21.2
- Exported `HealthService` types ([#289](https://github.com/pocketbase/js-sdk/issues/289)).
## 0.21.1
- 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.
- Updated the `fetch` mock tests to check also the sent body params.
- Formatted the source and tests with prettier.
## 0.21.0
**⚠️ 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.
## 0.20.3
- 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](https://github.com/pocketbase/js-sdk/issues/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:
```js
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_).
## 0.20.2
- Throw 404 error for `getOne("")` when invoked with empty id ([#271](https://github.com/pocketbase/js-sdk/issues/271)).
- Added `@throw {ClientResponseError}` jsdoc annotation to the regular request methods ([#262](https://github.com/pocketbase/js-sdk/issues/262)).
## 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.
## 0.18.0
- Added `pb.backups.upload(data)` action (_available with PocketBase v0.18.0_).
- Added _experimental_ `autoRefreshThreshold` option to auto refresh (or reauthenticate) the AuthStore when authenticated as admin.
_This could be used as an alternative to fixed Admin API keys._
```js
await pb.admins.authWithPassword("test@example.com", "1234567890", {
// This will trigger auto refresh or auto reauthentication in case
// the token has expired or is going to expire in the next 30 minutes.
autoRefreshThreshold: 30 * 60
})
```
## 0.17.3
- Loosen the type check when calling `pb.files.getUrl(user, filename)` to allow passing the `pb.authStore.model` without type assertion.
## 0.17.2
- Fixed mulitple File/Blob array values not transformed properly to their FormData equivalent when an object syntax is used.
## 0.17.1
- Fixed typo in the deprecation console.warn messages ([#235](https://github.com/pocketbase/js-sdk/pull/235); thanks @heloineto).
## 0.17.0
- To simplify file uploads, we now allow sending the `multipart/form-data` request body also as plain object if at least one of the object props has `File` or `Blob` value.
```js
// the standard way to create multipart/form-data body
const data = new FormData();
data.set("title", "lorem ipsum...")
data.set("document", new File(...))
// this is the same as above
// (it will be converted behind the scenes to FormData)
const data = {
"title": "lorem ipsum...",
"document": new File(...),
};
await pb.collection("example").create(data);
```
- Added new `pb.authStore.isAdmin` and `pb.authStore.isAuthRecord` helpers to check the type of the current auth state.
- The default `LocalAuthStore` now listen to the browser [storage event](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event),
so that we can sync automatically the `pb.authStore` state between multiple tabs.
- Added new helper `AsyncAuthStore` class that can be used to integrate with any 3rd party async storage implementation (_usually this is needed when working with React Native_):
```js
import AsyncStorage from "@react-native-async-storage/async-storage";
import PocketBase, { AsyncAuthStore } from "pocketbase";
const store = new AsyncAuthStore({
save: async (serialized) => AsyncStorage.setItem("pb_auth", serialized),
initial: AsyncStorage.getItem("pb_auth"),
});
const pb = new PocketBase("https://example.com", store)
```
- `pb.files.getUrl()` now returns empty string in case an empty filename is passed.
- ⚠️ All API actions now return plain object (POJO) as response, aka. the custom class wrapping was removed and you no longer need to manually call `structuredClone(response)` when using with SSR frameworks.
This could be a breaking change if you use the below classes (_and respectively their helper methods like `$isNew`, `$load()`, etc._) since they were replaced with plain TS interfaces:
```ts
class BaseModel -> interface BaseModel
class Admin -> interface AdminModel
class Record -> interface RecordModel
class LogRequest -> interface LogRequestModel
class ExternalAuth -> interface ExternalAuthModel
class Collection -> interface CollectionModel
class SchemaField -> interface SchemaField
class ListResult -> interface ListResult
```
_Side-note:_ If you use somewhere in your code the `Record` and `Admin` classes to determine the type of your `pb.authStore.model`,
you can safely replace it with the new `pb.authStore.isAdmin` and `pb.authStore.isAuthRecord` getters.
- ⚠️ Added support for per-request `fetch` options, including also specifying completely custom `fetch` implementation.
In addition to the default [`fetch` options](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options), the following configurable fields are supported:
```ts
interface SendOptions extends RequestInit {
// any other custom key will be merged with the query parameters
// for backward compatibility and to minimize the verbosity
[key: string]: any;
// optional custom fetch function to use for sending the request
fetch?: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response>;
// custom headers to send with the requests
headers?: { [key: string]: string };
// the body of the request (serialized automatically for json requests)
body?: any;
// query params that will be appended to the request url
query?: { [key: string]: any };
// the request identifier that can be used to cancel pending requests
requestKey?: string|null;
// @deprecated use `requestKey:string` instead
$cancelKey?: string;
// @deprecated use `requestKey:null` instead
$autoCancel?: boolean;
}
```
For most users the above will not be a breaking change since there are available function overloads (_when possible_) to preserve the old behavior, but you can get a warning message in the console to update to the new format.
For example:
```js
// OLD (should still work but with a warning in the console)
await pb.collection("example").authRefresh({}, {
"expand": "someRelField",
})
// NEW
await pb.collection("example").authRefresh({
"expand": "someRelField",
// send some additional header
"headers": {
"X-Custom-Header": "123",
},
"cache": "no-store" // also usually used by frameworks like Next.js
})
```
- Eagerly open the default OAuth2 signin popup in case no custom `urlCallback` is provided as a workaround for Safari.
- Internal refactoring (updated dev dependencies, refactored the tests to use Vitest instead of Mocha, etc.).
## 0.16.0
- Added `skipTotal=1` query parameter by default for the `getFirstListItem()` and `getFullList()` requests.
_Note that this have performance boost only with PocketBase v0.17+._
- Added optional `download=1` query parameter to force file urls with `Content-Disposition: attachment` (_supported with PocketBase v0.17+_).
## 0.15.3
- Automatically resolve pending realtime connect `Promise`s in case `unsubscribe` is called before
`subscribe` is being able to complete ([pocketbase#2897](https://github.com/pocketbase/pocketbase/discussions/2897#discussioncomment-6423818)).
## 0.15.2
- Replaced `new URL(...)` with manual url parsing as it is not fully supported in React Native ([pocketbase#2484](https://github.com/pocketbase/pocketbase/discussions/2484#discussioncomment-6114540)).
- Fixed nested `ClientResponseError.originalError` wrapping and added `ClientResponseError` constructor tests.
## 0.15.1
- Cancel any pending subscriptions submit requests on realtime disconnect ([#204](https://github.com/pocketbase/js-sdk/issues/204)).
## 0.15.0
- Added `fields` to the optional query parameters for limiting the returned API fields (_available with PocketBase v0.16.0_).
- Added `pb.backups` service for the new PocketBase backup and restore APIs (_available with PocketBase v0.16.0_).
- Updated `pb.settings.testS3(filesystem)` to allow specifying a filesystem to test - `storage` or `backups` (_available with PocketBase v0.16.0_).
## 0.14.4
- Removed the legacy aliased `BaseModel.isNew` getter since it conflicts with similarly named record fields ([pocketbase#2385](https://github.com/pocketbase/pocketbase/discussions/2385)).
_This helper is mainly used in the Admin UI, but if you are also using it in your code you can replace it with the `$` prefixed version, aka. `BaseModel.$isNew`._
## 0.14.3
- Added `OAuth2AuthConfig.query` prop to send optional query parameters with the `authWithOAuth2(config)` call.
## 0.14.2
- Use `location.origin + location.pathname` instead of full `location.href` when constructing the browser absolute url to ignore any extra hash or query parameter passed to the base url.
_This is a small addition to the earlier change from v0.14.1._
## 0.14.1
- Use an absolute url when the SDK is initialized with a relative base path in a browser env to ensure that the generated OAuth2 redirect and file urls are absolute.
## 0.14.0
- Added simplified `authWithOAuth2()` version without having to implement custom redirect, deeplink or even page reload:
```js
const authData = await pb.collection('users').authWithOAuth2({
provider: 'google'
})
```
Works with PocketBase v0.15.0+.
This method initializes a one-off realtime subscription and will
open a popup window with the OAuth2 vendor page to authenticate.
Once the external OAuth2 sign-in/sign-up flow is completed, the popup
window will be automatically closed and the OAuth2 data sent back
to the user through the previously established realtime connection.
_Site-note_: when creating the OAuth2 app in the provider dashboard
you have to configure `https://yourdomain.com/api/oauth2-redirect`
as redirect URL.
_The "manual" code exchange flow is still supported as `authWithOAuth2Code(provider, code, codeVerifier, redirectUrl)`._
_For backward compatibility it is also available as soft-deprecated function overload of `authWithOAuth2(provider, code, codeVerifier, redirectUrl)`._
- Added new `pb.files` service:
```js
// Builds and returns an absolute record file url for the provided filename.
🔓 pb.files.getUrl(record, filename, queryParams = {});
// Requests a new private file access token for the current auth model (admin or record).
🔐 pb.files.getToken(queryParams = {});
```
_`pb.getFileUrl()` is soft-deprecated and acts as alias calling `pb.files.getUrl()` under the hood._
Works with PocketBase v0.15.0+.
## 0.13.1
- Added option to specify a generic `send()` return type and defined `SendOptions` type ([#171](https://github.com/pocketbase/js-sdk/pull/171); thanks @iamelevich).
- Deprecated `SchemaField.unique` prop since its function is replaced by `Collection.indexes` in the upcoming PocketBase v0.14.0 release.
## 0.13.0
- Aliased all `BaseModel` helpers with `$` equivalent to avoid conflicts with the dynamic record props ([#169](https://github.com/pocketbase/js-sdk/issues/169)).
```js
isNew -> $isNew
load(data) -> $load(data)
clone() -> $clone()
export() -> $export()
// ...
```
_For backward compatibility, the old helpers will still continue to work if the record doesn't have a conflicting field name._
- Updated `pb.beforeSend` and `pb.afterSend` signatures to allow returning and awaiting an optional `Promise` ([#166](https://github.com/pocketbase/js-sdk/pull/166); thanks @Bobby-McBobface).
- Added `Collection.indexes` field for the new collection indexes support in the upcoming PocketBase v0.14.0.
- Added `pb.settings.generateAppleClientSecret()` for sending a request to generate Apple OAuth2 client secret in the upcoming PocketBase v0.14.0.
## 0.12.1
- Fixed request `multipart/form-data` body check to allow the React Native Android and iOS custom `FormData` implementation as valid `fetch` body ([#2002](https://github.com/pocketbase/pocketbase/discussions/2002)).
## 0.12.0
- Changed the return type of `pb.beforeSend` hook to allow modifying the request url ([#1930](https://github.com/pocketbase/pocketbase/discussions/1930)).
```js
// old
pb.beforeSend = function (url, options) {
...
return options;
}
// new
pb.beforeSend = function (url, options) {
...
return { url, options };
}
```
The old return format is soft-deprecated and will still work, but you'll get a `console.warn` message to replace it.
## 0.11.1
- Exported the services class definitions to allow being used as argument types ([#153](https://github.com/pocketbase/js-sdk/issues/153)).
```js
CrudService
AdminService
CollectionService
LogService
RealtimeService
RecordService
SettingsService
```
## 0.11.0
- Aliased/soft-deprecated `ClientResponseError.data` in favor of `ClientResponseError.response` to avoid the stuttering when accessing the inner error response `data` key (aka. `err.data.data` now is `err.response.data`).
The `ClientResponseError.data` will still work but it is recommend for new code to use the `response` key.
- Added `getFullList(queryParams = {})` overload since the default batch size in most cases doesn't need to change (it can be defined as query parameter).
The old form `getFullList(batch = 200, queryParams = {})` will still work, but it is recommend for new code to use the shorter form.
## 0.10.2
- Updated `getFileUrl()` to accept custom types as record argument.
## 0.10.1
- Added check for the collection name before auto updating the `pb.authStore` state on auth record update/delete.
## 0.10.0
- Added more helpful message for the `ECONNREFUSED ::1` localhost error (related to [#21](https://github.com/pocketbase/js-sdk/issues/21)).
- Preserved the "original" function and class names in the minified output for those who rely on `*.prototype.name`.
- Allowed sending the existing valid auth token with the `authWithPassword()` calls.
- Updated the Nuxt3 SSR examples to use the built-in `useCookie()` helper.
## 0.9.1
- Normalized nested `expand` items to `Record|Array<Record>` instances.
## 0.9.0
- Added `pb.health.check()` that checks the health status of the API service (_available in PocketBase v0.10.0_)
## 0.8.4
- Added type declarations for the action query parameters ([#102](https://github.com/pocketbase/js-sdk/pull/102); thanks @sewera).
```js
BaseQueryParams
ListQueryParams
RecordQueryParams
RecordListQueryParams
LogStatsQueryParams
FileQueryParams
```
## 0.8.3
- Renamed the declaration file extension from `.d.ts` to `.d.mts` to prevent type resolution issues ([#92](https://github.com/pocketbase/js-sdk/issues/92)).
## 0.8.2
- Allowed catching the initial realtime connect error as part of the `subscribe()` Promise resolution.
- Reimplemented the default `EventSource` retry mechanism for better control and more consistent behavior across different browsers.
## 0.8.1
This release contains only documentation fixes:
- Fixed code comment typos.
- Added note about loadFromCookie that you may need to call authRefresh to validate the loaded cookie state server-side.
- Updated the SSR examples to show the authRefresh call. _For the examples the authRefresh call is not required but it is there to remind users that it needs to be called if you want to do permission checks in a node env (eg. SSR) and rely on the `pb.authStore.isValid`._
## 0.8.0
> ⚠️ Please note that this release works only with the new PocketBase v0.8+ API!
>
> See the breaking changes below for what has changed since v0.7.x.
#### Non breaking changes
- Added support for optional custom `Record` types using TypeScript generics, eg.
`pb.collection('example').getList<Tasks>()`.
- Added new `pb.autoCancellation(bool)` method to globally enable or disable auto cancellation (`true` by default).
- Added new crud method `getFirstListItem(filter)` to fetch a single item by a list filter.
- You can now set additional account `createData` when authenticating with OAuth2.
- Added `AuthMethodsList.usernamePassword` return field (we now support combined username/email authentication; see below `authWithPassword`).
#### Breaking changes
- Changed the contstructor from `PocketBase(url, lang?, store?)` to `PocketBase(url, store?, lang?)` (aka. the `lang` option is now last).
- For easier and more conventional parsing, all DateTime strings now have `Z` as suffix, so that you can do directly `new Date('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').getFirstListItem(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').subscribe('RECORD_ID', callback)
pb.realtime.unsubscribe('example') => pb.collection('example').unsubscribe("*")
pb.realtime.unsubscribe('example/RECORD_ID') => pb.collection('example').unsubscribe('RECORD_ID')
(no old equivalent) => pb.collection('example').unsubscribe()
```
Additionally, `subscribe()` now return `UnsubscribeFunc` that could be used to unsubscribe only from a single subscription listener.
- 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) => 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();
```
- To prevent confusion with the auth method responses, the following methods now returns 204 with empty body (previously 200 with token and auth model):
```js
pb.admins.confirmPasswordReset(...): Promise<bool>
pb.collection("users").confirmPasswordReset(...): Promise<bool>
pb.collection("users").confirmVerification(...): Promise<bool>
pb.collection("users").confirmEmailChange(...): Promise<bool>
```
- Removed the `User` model because users are now regular records (aka. `Record`).
**The old user fields `lastResetSentAt`, `lastVerificationSentAt` and `profile` are no longer available**
(the `profile` fields are available under the `Record.*` property like any other fields).
- Renamed the special `Record` props:
```
@collectionId => collectionId
@collectionName => collectionName
@expand => expand
```
- Since there is no longer `User` model, `pb.authStore.model` can now be of type `Record`, `Admin` or `null`.
- Removed `lastResetSentAt` from the `Admin` model.
- Replaced `ExternalAuth.userId` with 2 new `recordId` and `collectionId` props.
- Removed the deprecated uppercase service aliases:
```
client.Users => client.collection(*)
client.Records => client.collection(*)
client.AuthStore => client.authStore
client.Realtime => client.realtime
client.Admins => client.admins
client.Collections => client.collections
client.Logs => client.logs
client.Settings => client.settings
```

17
node_modules/pocketbase/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,17 @@
The MIT License (MIT)
Copyright (c) 2022 - present, Gani Georgiev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

2053
node_modules/pocketbase/README.html generated vendored Normal file

File diff suppressed because one or more lines are too long

1091
node_modules/pocketbase/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

1465
node_modules/pocketbase/dist/pocketbase.cjs.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

2
node_modules/pocketbase/dist/pocketbase.cjs.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/pocketbase/dist/pocketbase.cjs.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1580
node_modules/pocketbase/dist/pocketbase.es.d.mts generated vendored Normal file

File diff suppressed because it is too large Load Diff

1580
node_modules/pocketbase/dist/pocketbase.es.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

2
node_modules/pocketbase/dist/pocketbase.es.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/pocketbase/dist/pocketbase.es.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/pocketbase/dist/pocketbase.es.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/pocketbase/dist/pocketbase.es.mjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1465
node_modules/pocketbase/dist/pocketbase.iife.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

2
node_modules/pocketbase/dist/pocketbase.iife.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/pocketbase/dist/pocketbase.iife.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1465
node_modules/pocketbase/dist/pocketbase.umd.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

2
node_modules/pocketbase/dist/pocketbase.umd.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/pocketbase/dist/pocketbase.umd.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

47
node_modules/pocketbase/package.json generated vendored Normal file
View File

@@ -0,0 +1,47 @@
{
"version": "0.26.2",
"name": "pocketbase",
"description": "PocketBase JavaScript SDK",
"author": "Gani Georgiev",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/pocketbase/js-sdk.git"
},
"exports": {
".": "./dist/pocketbase.es.mjs",
"./cjs": "./dist/pocketbase.cjs.js",
"./umd": "./dist/pocketbase.umd.js"
},
"main": "./dist/pocketbase.es.mjs",
"module": "./dist/pocketbase.es.mjs",
"react-native": "./dist/pocketbase.es.js",
"types": "./dist/pocketbase.es.d.mts",
"keywords": [
"pocketbase",
"pocketbase-js",
"js-sdk",
"javascript-sdk",
"pocketbase-sdk"
],
"prettier": {
"tabWidth": 4,
"printWidth": 90,
"bracketSameLine": true
},
"scripts": {
"format": "npx prettier ./src ./tests --write",
"build": "rm -rf dist && rollup -c",
"dev": "rollup -c -w",
"test": "vitest",
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@rollup/plugin-terser": "^0.4.3",
"prettier": "3.2.4",
"rollup": "^4.0.0",
"rollup-plugin-ts": "^3.0.0",
"typescript": "^5.1.6",
"vitest": "^2.0.0"
}
}

18
package-lock.json generated Normal file
View File

@@ -0,0 +1,18 @@
{
"name": "personal-tracker",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"pocketbase": "^0.26.2"
}
},
"node_modules/pocketbase": {
"version": "0.26.2",
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.26.2.tgz",
"integrity": "sha512-WA8EOBc3QnSJh8rJ3iYoi9DmmPOMFIgVfAmIGux7wwruUEIzXgvrO4u0W2htfQjGIcyezJkdZOy5Xmh7SxAftw==",
"license": "MIT"
}
}
}

8
package.json Normal file
View File

@@ -0,0 +1,8 @@
{
"name": "personal-tracker",
"version": "1.0.0",
"type": "module",
"dependencies": {
"pocketbase": "^0.26.2"
}
}

BIN
pocketbase/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,659 @@
## v0.30.0
- Eagerly escape the S3 request path following the same rules as in the S3 signing header ([#7153](https://github.com/pocketbase/pocketbase/issues/7153)).
- Added Lark OAuth2 provider ([#7130](https://github.com/pocketbase/pocketbase/pull/7130); thanks @mashizora).
- Increased test tokens `exp` claim to minimize eventual issues with reproducible builds ([#7123](https://github.com/pocketbase/pocketbase/issues/7123)).
- Added `os.Root` bindings to the JSVM ([`$os.openRoot`](https://pocketbase.io/jsvm/functions/_os.openRoot.html), [`$os.openInRoot`](https://pocketbase.io/jsvm/functions/_os.openInRoot.html)).
- Added `osutils.IsProbablyGoRun()` helper to loosely check if the program was started using `go run`.
- Various minor UI improvements (updated collections indexes UI, enabled seconds in the datepicker, updated helper texts, etc.).
- ⚠️ Updated the minimum package Go version to 1.24.0 and bumped Go dependencies.
## v0.29.3
- Try to forward Apple OAuth2 POST redirect user's name so that it can be returned (and eventually assigned) with the success response of the all-in-one auth call ([#7090](https://github.com/pocketbase/pocketbase/issues/7090)).
- Fixed `RateLimitRule.Audience` code comment ([#7098](https://github.com/pocketbase/pocketbase/pull/7098); thanks @iustin05).
- Mocked `syscall.Exec` when building for WASM ([#7116](https://github.com/pocketbase/pocketbase/pull/7116); thanks @joas8211).
_Note that WASM is not officially supported PocketBase build target and many things may not work as expected._
- Registered missing `$filesystem`, `$mails`, `$template` and `__hooks` bindings in the JSVM migrations ([#7125](https://github.com/pocketbase/pocketbase/issues/7125)).
- Regenerated JSVM types to include methods from structs with single generic parameter.
- Updated Go dependencies.
## v0.29.2
- Bumped min Go GitHub action version to 1.23.12 since it comes with some [minor fixes for the runtime and `database/sql` package](https://github.com/golang/go/issues?q=milestone%3AGo1.23.12+label%3ACherryPickApproved).
## v0.29.1
- Updated the X/Twitter provider to return the `confirmed_email` field and to use the `x.com` domain ([#7035](https://github.com/pocketbase/pocketbase/issues/7035)).
- Added Box.com OAuth2 provider ([#7056](https://github.com/pocketbase/pocketbase/pull/7056); thanks @blakepatteson).
- Updated `modernc.org/sqlite` to 1.38.2 (SQLite 3.50.3).
- Fixed example List API response ([#7049](https://github.com/pocketbase/pocketbase/pull/7049); thanks @williamtguerra).
## v0.29.0
- Enabled calling the `/auth-refresh` endpoint with nonrenewable tokens.
_When used with nonrenewable tokens (e.g. impersonate) the endpoint will simply return the same token with the up-to-date user data associated with it._
- Added the triggered rate rimit rule in the error log `details`.
- Added optional `ServeEvent.Listener` field to initialize a custom network listener (e.g. `unix`) instead of the default `tcp` ([#3233](https://github.com/pocketbase/pocketbase/discussions/3233)).
- Fixed request data unmarshalization for the `DynamicModel` array/object fields ([#7022](https://github.com/pocketbase/pocketbase/discussions/7022)).
- Fixed Dashboard page title `-` escaping ([#6982](https://github.com/pocketbase/pocketbase/issues/6982)).
- Other minor improvements (updated first superuser console text when running with `go run`, clarified trusted IP proxy header label, wrapped the backup restore in a transaction as an extra precaution, updated deps, etc.).
## v0.28.4
- Added global JSVM `toBytes()` helper to return the bytes slice representation of a value such as io.Reader or string, _other types are first serialized to Go string_ ([#6935](https://github.com/pocketbase/pocketbase/issues/6935)).
- Fixed `security.RandomStringByRegex` random distribution ([#6947](https://github.com/pocketbase/pocketbase/pull/6947); thanks @yerTools).
- Minor docs and typos fixes.
## v0.28.3
- Skip sending empty `Range` header when fetching blobs from S3 ([#6914](https://github.com/pocketbase/pocketbase/pull/6914)).
- Updated Go deps and particularly `modernc.org/sqlite` to 1.38.0 (SQLite 3.50.1).
- Bumped GitHub action min Go version to 1.23.10 as it comes with some [minor security `net/http` fixes](https://github.com/golang/go/issues?q=milestone%3AGo1.23.10+label%3ACherryPickApproved).
## v0.28.2
- Loaded latin-ext charset for the default text fonts ([#6869](https://github.com/pocketbase/pocketbase/issues/6869)).
- Updated view query CAST regex to properly recognize multiline expressions ([#6860](https://github.com/pocketbase/pocketbase/pull/6860); thanks @azat-ismagilov).
- Updated Go and npm dependencies.
## v0.28.1
- Fixed `json_each`/`json_array_length` normalizations to properly check for array values ([#6835](https://github.com/pocketbase/pocketbase/issues/6835)).
## v0.28.0
- Write the default response body of `*Request` hooks that are wrapped in a transaction after the related transaction completes to allow propagating the transaction error ([#6462](https://github.com/pocketbase/pocketbase/discussions/6462#discussioncomment-12207818)).
- Updated `app.DB()` to automatically routes raw write SQL statements to the nonconcurrent db pool ([#6689](https://github.com/pocketbase/pocketbase/discussions/6689)).
_For the rare cases when it is needed users still have the option to explicitly target the specific pool they want using `app.ConcurrentDB()`/`app.NonconcurrentDB()`._
- ⚠️ Changed the default `json` field max size to 1MB.
_Users still have the option to adjust the default limit from the collection field options but keep in mind that storing large strings/blobs in the database is known to cause performance issues and should be avoided when possible._
- ⚠️ Soft-deprecated and replaced `filesystem.System.GetFile(fileKey)` with `filesystem.System.GetReader(fileKey)` to avoid the confusion with `filesystem.File`.
_The old method will still continue to work for at least until v0.29.0 but you'll get a console warning to replace it with `GetReader`._
- Added new `filesystem.System.GetReuploadableFile(fileKey, preserveName)` method to return an existing blob as a `*filesystem.File` value ([#6792](https://github.com/pocketbase/pocketbase/discussions/6792)).
_This method could be useful in case you want to clone an existing Record file and assign it to a new Record (e.g. in a Record duplicate action)._
- Other minor improvements (updated the GitHub release min Go version to 1.23.9, updated npm and Go deps, etc.)
## v0.27.2
- Added workers pool when cascade deleting record files to minimize _"thread exhaustion"_ errors ([#6780](https://github.com/pocketbase/pocketbase/discussions/6780)).
- Updated the `:excerpt` fields modifier to properly account for multibyte characters ([#6778](https://github.com/pocketbase/pocketbase/issues/6778)).
- Use `rowid` as count column for non-view collections to minimize the need of having the id field in a covering index ([#6739](https://github.com/pocketbase/pocketbase/discussions/6739))
## v0.27.1
- Updated example `geoPoint` API preview body data.
- Added JSVM `new GeoPointField({ ... })` constructor.
- Added _partial_ WebP thumbs generation (_the thumbs will be stored as PNG_; [#6744](https://github.com/pocketbase/pocketbase/pull/6744)).
- Updated npm dev dependencies.
## v0.27.0
- ⚠️ Moved the Create and Manage API rule checks out of the `OnRecordCreateRequest` hook finalizer, **aka. now all CRUD API rules are checked BEFORE triggering their corresponding `*Request` hook**.
This was done to minimize the confusion regarding the firing order of the request operations, making it more predictable and consistent with the other record List/View/Update/Delete request actions.
It could be a minor breaking change if you are relying on the old behavior and have a Go `tests.ApiScenario` that is testing a Create API rule failure and expect `OnRecordCreateRequest` to be fired. In that case for example you may have to update your test scenario like:
```go
tests.ApiScenario{
Name: "Example test that checks a Create API rule failure"
Method: http.MethodPost,
URL: "/api/collections/example/records",
...
// old:
ExpectedEvents: map[string]int{
"*": 0,
"OnRecordCreateRequest": 1,
},
// new:
ExpectedEvents: map[string]int{"*": 0},
}
```
If you are having difficulties adjusting your code, feel free to open a [Q&A discussion](https://github.com/pocketbase/pocketbase/discussions) with the failing/problematic code sample.
- Added [new `geoPoint` field](https://pocketbase.io/docs/collections/#geopoint) for storing `{"lon":x,"lat":y}` geographic coordinates.
In addition, a new [`geoDistance(lonA, lotA, lonB, lotB)` function](htts://pocketbase.io/docs/api-rules-and-filters/#geodistancelona-lata-lonb-latb) was also implemented that could be used to apply an API rule or filter constraint based on the distance (in km) between 2 geo points.
- Updated the `select` field UI to accommodate better larger lists and RTL languages ([#4674](https://github.com/pocketbase/pocketbase/issues/4674)).
- Updated the mail attachments auto MIME type detection to use `gabriel-vasile/mimetype` for consistency and broader sniffing signatures support.
- Forced `text/javascript` Content-Type when serving `.js`/`.mjs` collection uploaded files with the `/api/files/...` endpoint ([#6597](https://github.com/pocketbase/pocketbase/issues/6597)).
- Added second optional JSVM `DateTime` constructor argument for specifying a default timezone as TZ identifier when parsing the date string as alternative to a fixed offset in order to better handle daylight saving time nuances ([#6688](https://github.com/pocketbase/pocketbase/discussions/6688)):
```js
// the same as with CET offset: new DateTime("2025-10-26 03:00:00 +01:00")
new DateTime("2025-10-26 03:00:00", "Europe/Amsterdam") // 2025-10-26 02:00:00.000Z
// the same as with CEST offset: new DateTime("2025-10-26 01:00:00 +02:00")
new DateTime("2025-10-26 01:00:00", "Europe/Amsterdam") // 2025-10-25 23:00:00.000Z
```
- Soft-deprecated the `$http.send`'s `result.raw` field in favor of `result.body` that contains the response body as plain bytes slice to avoid the discrepancies between Go and the JSVM when casting binary data to string.
- Updated `modernc.org/sqlite` to 1.37.0.
- Other minor improvements (_removed the superuser fields from the auth record create/update body examples, allowed programmatically updating the auth record password from the create/update hooks, fixed collections import error response, etc._).
## v0.26.6
- Allow OIDC `email_verified` to be int or boolean string since some OIDC providers like AWS Cognito has non-standard userinfo response ([#6657](https://github.com/pocketbase/pocketbase/pull/6657)).
- Updated `modernc.org/sqlite` to 1.36.3.
## v0.26.5
- Fixed canonical URI parts escaping when generating the S3 request signature ([#6654](https://github.com/pocketbase/pocketbase/issues/6654)).
## v0.26.4
- Fixed `RecordErrorEvent.Error` and `CollectionErrorEvent.Error` sync with `ModelErrorEvent.Error` ([#6639](https://github.com/pocketbase/pocketbase/issues/6639)).
- Fixed logs details copy to clipboard action.
- Updated `modernc.org/sqlite` to 1.36.2.
## v0.26.3
- Fixed and normalized logs error serialization across common types for more consistent logs error output ([#6631](https://github.com/pocketbase/pocketbase/issues/6631)).
## v0.26.2
- Updated `golang-jwt/jwt` dependency because it comes with a [minor security fix](https://github.com/golang-jwt/jwt/security/advisories/GHSA-mh63-6h87-95cp).
## v0.26.1
- Removed the wrapping of `io.EOF` error when reading files since currently `io.ReadAll` doesn't check for wrapped errors ([#6600](https://github.com/pocketbase/pocketbase/issues/6600)).
## v0.26.0
- ⚠️ Replaced `aws-sdk-go-v2` and `gocloud.dev/blob` with custom lighter implementation ([#6562](https://github.com/pocketbase/pocketbase/discussions/6562)).
As a side-effect of the dependency removal, the binary size has been reduced with ~10MB and builds ~30% faster.
_Although the change is expected to be backward-compatible, I'd recommend to test first locally the new version with your S3 provider (if you use S3 for files storage and backups)._
- ⚠️ Prioritized the user submitted non-empty `createData.email` (_it will be unverified_) when creating the PocketBase user during the first OAuth2 auth.
- Load the request info context during password/OAuth2/OTP authentication ([#6402](https://github.com/pocketbase/pocketbase/issues/6402)).
This could be useful in case you want to target the auth method as part of the MFA and Auth API rules.
For example, to disable MFA for the OAuth2 auth could be expressed as `@request.context != "oauth2"` MFA rule.
- Added `store.Store.SetFunc(key, func(old T) new T)` to set/update a store value with the return result of the callback in a concurrent safe manner.
- Added `subscription.Message.WriteSSE(w, id)` for writing an SSE formatted message into the provided writer interface (_used mostly to assist with the unit testing_).
- Added `$os.stat(file)` JSVM helper ([#6407](https://github.com/pocketbase/pocketbase/discussions/6407)).
- Added log warning for `async` marked JSVM handlers and resolve when possible the returned `Promise` as fallback ([#6476](https://github.com/pocketbase/pocketbase/issues/6476)).
- Allowed calling `cronAdd`, `cronRemove` from inside other JSVM handlers ([#6481](https://github.com/pocketbase/pocketbase/discussions/6481)).
- Bumped the default request read and write timeouts to 5mins (_old 3mins_) to accommodate slower internet connections and larger file uploads/downloads.
_If you want to change them you can modify the `OnServe` hook's `ServeEvent.ReadTimeout/WriteTimeout` fields as shown in [#6550](https://github.com/pocketbase/pocketbase/discussions/6550#discussioncomment-12364515)._
- Normalized the `@request.auth.*` and `@request.body.*` back relations resolver to always return `null` when the relation field is pointing to a different collection ([#6590](https://github.com/pocketbase/pocketbase/discussions/6590#discussioncomment-12496581)).
- Other minor improvements (_fixed query dev log nested parameters output, reintroduced `DynamicModel` object/array props reflect types caching, updated Go and npm deps, etc._)
## v0.25.9
- Fixed `DynamicModel` object/array props reflect type caching ([#6563](https://github.com/pocketbase/pocketbase/discussions/6563)).
## v0.25.8
- Added a default leeway of 5 minutes for the Apple/OIDC `id_token` timestamp claims check to account for clock-skew ([#6529](https://github.com/pocketbase/pocketbase/issues/6529)).
It can be further customized if needed with the `PB_ID_TOKEN_LEEWAY` env variable (_the value must be in seconds, e.g. "PB_ID_TOKEN_LEEWAY=60" for 1 minute_).
## v0.25.7
- Fixed `@request.body.jsonObjOrArr.*` values extraction ([#6493](https://github.com/pocketbase/pocketbase/discussions/6493)).
## v0.25.6
- Restore the missing `meta.isNew` field of the OAuth2 success response ([#6490](https://github.com/pocketbase/pocketbase/issues/6490)).
- Updated npm dependencies.
## v0.25.5
- Set the current working directory as a default goja script path when executing inline JS strings to allow `require(m)` traversing parent `node_modules` directories.
- Updated `modernc.org/sqlite` and `modernc.org/libc` dependencies.
## v0.25.4
- Downgraded `aws-sdk-go-v2` to the version before the default data integrity checks because there have been reports for non-AWS S3 providers in addition to Backblaze (IDrive, R2) that no longer or partially work with the latest AWS SDK changes.
While we try to enforce `when_required` by default, it is not enough to disable the new AWS SDK integrity checks entirely and some providers will require additional manual adjustments to make them compatible with the latest AWS SDK (e.g. removing the `x-aws-checksum-*` headers, unsetting the checksums calculation or reinstantiating the old MD5 checksums for some of the required operations, etc.) which as a result leads to a configuration mess that I'm not sure it would be a good idea to introduce.
This unfornuatelly is not a PocketBase or Go specific issue and the official AWS SDKs for other languages are in the same situation (even the latest aws-cli).
For those of you that extend PocketBase with Go: if your S3 vendor doesn't support the [AWS Data integrity checks](https://docs.aws.amazon.com/sdkref/latest/guide/feature-dataintegrity.html) and you are updating with `go get -u`, then make sure that the `aws-sdk-go-v2` dependencies in your `go.mod` are the same as in the repo:
```
// go.mod
github.com/aws/aws-sdk-go-v2 v1.36.1
github.com/aws/aws-sdk-go-v2/config v1.28.10
github.com/aws/aws-sdk-go-v2/credentials v1.17.51
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.48
github.com/aws/aws-sdk-go-v2/service/s3 v1.72.2
// after that run
go clean -modcache && go mod tidy
```
_The versions pinning is temporary until the non-AWS S3 vendors patch their implementation or until I manage to find time to remove/replace the `aws-sdk-go-v2` dependency (I'll consider prioritizing it for the v0.26 or v0.27 release)._
## v0.25.3
- Added a temporary exception for Backblaze S3 endpoints to exclude the new `aws-sdk-go-v2` checksum headers ([#6440](https://github.com/pocketbase/pocketbase/discussions/6440)).
## v0.25.2
- Fixed realtime delete event not being fired for `RecordProxy`-ies and added basic realtime record resolve automated tests ([#6433](https://github.com/pocketbase/pocketbase/issues/6433)).
## v0.25.1
- Fixed the batch API Preview success sample response.
- Bumped GitHub action min Go version to 1.23.6 as it comes with a [minor security fix](https://github.com/golang/go/issues?q=milestone%3AGo1.23.6+label%3ACherryPickApproved) for the ppc64le build.
## v0.25.0
- ⚠️ Upgraded Google OAuth2 auth, token and userinfo endpoints to their latest versions.
_For users that don't do anything custom with the Google OAuth2 data or the OAuth2 auth URL, this should be a non-breaking change. The exceptions that I could find are:_
- `/v3/userinfo` auth response changes:
```
meta.rawUser.id => meta.rawUser.sub
meta.rawUser.verified_email => meta.rawUser.email_verified
```
- `/v2/auth` query parameters changes:
If you are specifying custom `approval_prompt=force` query parameter for the OAuth2 auth URL, you'll have to replace it with **`prompt=consent`**.
- Added Trakt OAuth2 provider ([#6338](https://github.com/pocketbase/pocketbase/pull/6338); thanks @aidan-)
- Added support for case-insensitive password auth based on the related UNIQUE index field collation ([#6337](https://github.com/pocketbase/pocketbase/discussions/6337)).
- Enforced `when_required` for the new AWS SDK request and response checksum validations to allow other non-AWS vendors to catch up with new AWS SDK changes (see [#6313](https://github.com/pocketbase/pocketbase/discussions/6313) and [aws/aws-sdk-go-v2#2960](https://github.com/aws/aws-sdk-go-v2/discussions/2960)).
_You can set the environment variables `AWS_REQUEST_CHECKSUM_CALCULATION` and `AWS_RESPONSE_CHECKSUM_VALIDATION` to `when_supported` if your S3 vendor supports the [new default integrity protections](https://docs.aws.amazon.com/sdkref/latest/guide/feature-dataintegrity.html)._
- Soft-deprecated `Record.GetUploadedFiles` in favor of `Record.GetUnsavedFiles` to minimize the ambiguities what the method do ([#6269](https://github.com/pocketbase/pocketbase/discussions/6269)).
- Replaced archived `github.com/AlecAivazis/survey` dependency with a simpler `osutils.YesNoPrompt(message, fallback)` helper.
- Upgraded to `golang-jwt/jwt/v5`.
- Added JSVM `new Timezone(name)` binding for constructing `time.Location` value ([#6219](https://github.com/pocketbase/pocketbase/discussions/6219)).
- Added `inflector.Camelize(str)` and `inflector.Singularize(str)` helper methods.
- Use the non-transactional app instance during the realtime records delete access checks to ensure that cascade deleted records with API rules relying on the parent will be resolved.
- Other minor improvements (_replaced all `bool` exists db scans with `int` for broader drivers compatibility, updated API Preview sample error responses, updated UI dependencies, etc._)
## v0.24.4
- Fixed fields extraction for view query with nested comments ([#6309](https://github.com/pocketbase/pocketbase/discussions/6309)).
- Bumped GitHub action min Go version to 1.23.5 as it comes with some [minor security fixes](https://github.com/golang/go/issues?q=milestone%3AGo1.23.5).
## v0.24.3
- Fixed incorrectly reported unique validator error for fields starting with name of another field ([#6281](https://github.com/pocketbase/pocketbase/pull/6281); thanks @svobol13).
- Reload the created/edited records data in the RecordsPicker UI.
- Updated Go dependencies.
## v0.24.2
- Fixed display fields extraction when there are multiple "Presentable" `relation` fields in a single related collection ([#6229](https://github.com/pocketbase/pocketbase/issues/6229)).
## v0.24.1
- Added missing time macros in the UI autocomplete.
- Fixed JSVM types for structs and functions with multiple generic parameters.
## v0.24.0
- ⚠️ Removed the "dry submit" when executing the collections Create API rule
(you can find more details why this change was introduced and how it could affect your app in https://github.com/pocketbase/pocketbase/discussions/6073).
For most users it should be non-breaking change, BUT if you have Create API rules that uses self-references or view counters you may have to adjust them manually.
With this change the "multi-match" operators are also normalized in case the targeted collection doesn't have any records
(_or in other words, `@collection.example.someField != "test"` will result to `true` if `example` collection has no records because it satisfies the condition that all available "example" records mustn't have `someField` equal to "test"_).
As a side-effect of all of the above minor changes, the record create API performance has been also improved ~4x times in high concurrent scenarios (500 concurrent clients inserting total of 50k records - [old (58.409064001s)](https://github.com/pocketbase/benchmarks/blob/54140be5fb0102f90034e1370c7f168fbcf0ddf0/results/hetzner_cax41_cgo.md#creating-50000-posts100k-reqs50000-conc500-rulerequestauthid----requestdatapublicisset--true) vs [new (13.580098262s)](https://github.com/pocketbase/benchmarks/blob/7df0466ac9bd62fe0a1056270d20ef82012f0234/results/hetzner_cax41_cgo.md#creating-50000-posts100k-reqs50000-conc500-rulerequestauthid----requestbodypublicisset--true)).
- ⚠️ Changed the type definition of `store.Store[T any]` to `store.Store[K comparable, T any]` to allow support for custom store key types.
For most users it should be non-breaking change, BUT if you are calling `store.New[any](nil)` instances you'll have to specify the store key type, aka. `store.New[string, any](nil)`.
- Added `@yesterday` and `@tomorrow` datetime filter macros.
- Added `:lower` filter modifier (e.g. `title:lower = "lorem"`).
- Added `mailer.Message.InlineAttachments` field for attaching inline files to an email (_aka. `cid` links_).
- Added cache for the JSVM `arrayOf(m)`, `DynamicModel`, etc. dynamic `reflect` created types.
- Added auth collection select for the settings "Send test email" popup ([#6166](https://github.com/pocketbase/pocketbase/issues/6166)).
- Added `record.SetRandomPassword()` to simplify random password generation usually used in the OAuth2 or OTP record creation flows.
_The generated ~30 chars random password is assigned directly as bcrypt hash and ignores the `password` field plain value validators like min/max length or regex pattern._
- Added option to list and trigger the registered app level cron jobs via the Web API and UI.
- Added extra validators for the collection field `int64` options (e.g. `FileField.MaxSize`) restricting them to the max safe JSON number (2^53-1).
- Added option to unset/overwrite the default PocketBase superuser installer using `ServeEvent.InstallerFunc`.
- Added `app.FindCachedCollectionReferences(collection, excludeIds)` to speedup records cascade delete almost twice for projects with many collections.
- Added `tests.NewTestAppWithConfig(config)` helper if you need more control over the test configurations like `IsDev`, the number of allowed connections, etc.
- Invalidate all record tokens when the auth record email is changed programmatically or by a superuser ([#5964](https://github.com/pocketbase/pocketbase/issues/5964)).
- Eagerly interrupt waiting for the email alert send in case it takes longer than 15s.
- Normalized the hidden fields filter checks and allow targetting hidden fields in the List API rule.
- Fixed "Unique identify fields" input not refreshing on unique indexes change ([#6184](https://github.com/pocketbase/pocketbase/issues/6184)).
## v0.23.12
- Added warning logs in case of mismatched `modernc.org/sqlite` and `modernc.org/libc` versions ([#6136](https://github.com/pocketbase/pocketbase/issues/6136#issuecomment-2556336962)).
- Skipped the default body size limit middleware for the backup upload endpoint ([#6152](https://github.com/pocketbase/pocketbase/issues/6152)).
## v0.23.11
- Upgraded `golang.org/x/net` to 0.33.0 to fix [CVE-2024-45338](https://www.cve.org/CVERecord?id=CVE-2024-45338).
_PocketBase uses the vulnerable functions primarily for the auto html->text mail generation, but most applications shouldn't be affected unless you are manually embedding unrestricted user provided value in your mail templates._
## v0.23.10
- Renew the superuser file token cache when clicking on the thumb preview or download link ([#6137](https://github.com/pocketbase/pocketbase/discussions/6137)).
- Upgraded `modernc.org/sqlite` to 1.34.3 to fix "disk io" error on arm64 systems.
_If you are extending PocketBase with Go and upgrading with `go get -u` make sure to manually set in your go.mod the `modernc.org/libc` indirect dependency to v1.55.3, aka. the exact same version the driver is using._
## v0.23.9
- Replaced `strconv.Itoa` with `strconv.FormatInt` to avoid the int64->int conversion overflow on 32-bit platforms ([#6132](https://github.com/pocketbase/pocketbase/discussions/6132)).
## v0.23.8
- Fixed Model->Record and Model->Collection hook events sync for nested and/or inner-hook transactions ([#6122](https://github.com/pocketbase/pocketbase/discussions/6122)).
- Other minor improvements (updated Go and npm deps, added extra escaping for the default mail record params in case the emails are stored as html files, fixed code comment typos, etc.).
## v0.23.7
- Fixed JSVM exception -> Go error unwrapping when throwing errors from non-request hooks ([#6102](https://github.com/pocketbase/pocketbase/discussions/6102)).
## v0.23.6
- Fixed `$filesystem.fileFromURL` documentation and generated type ([#6058](https://github.com/pocketbase/pocketbase/issues/6058)).
- Fixed `X-Forwarded-For` header typo in the suggested UI "Common trusted proxy" headers ([#6063](https://github.com/pocketbase/pocketbase/pull/6063)).
- Updated the `text` field max length validator error message to make it more clear ([#6066](https://github.com/pocketbase/pocketbase/issues/6066)).
- Other minor fixes (updated Go deps, skipped unnecessary validator check when the default primary key pattern is used, updated JSVM types, etc.).
## v0.23.5
- Fixed UI logs search not properly accounting for the "Include requests by superusers" toggle when multiple search expressions are used.
- Fixed `text` field max validation error message ([#6053](https://github.com/pocketbase/pocketbase/issues/6053)).
- Other minor fixes (comment typos, JSVM types update).
- Updated Go deps and the min Go release GitHub action version to 1.23.4.
## v0.23.4
- Fixed `autodate` fields not refreshing when calling `Save` multiple times on the same `Record` instance ([#6000](https://github.com/pocketbase/pocketbase/issues/6000)).
- Added more descriptive test OTP id and failure log message ([#5982](https://github.com/pocketbase/pocketbase/discussions/5982)).
- Moved the default UI CSP from meta tag to response header ([#5995](https://github.com/pocketbase/pocketbase/discussions/5995)).
- Updated Go and npm dependencies.
## v0.23.3
- Fixed Gzip middleware not applying when serving static files.
- Fixed `Record.Fresh()`/`Record.Clone()` methods not properly cloning `autodate` fields ([#5973](https://github.com/pocketbase/pocketbase/discussions/5973)).
## v0.23.2
- Fixed `RecordQuery()` custom struct scanning ([#5958](https://github.com/pocketbase/pocketbase/discussions/5958)).
- Fixed `--dev` log query print formatting.
- Added support for passing more than one id in the `Hook.Unbind` method for consistency with the router.
- Added collection rules change list in the confirmation popup
(_to avoid getting anoying during development, the rules confirmation currently is enabled only when using https_).
## v0.23.1
- Added `RequestEvent.Blob(status, contentType, bytes)` response write helper ([#5940](https://github.com/pocketbase/pocketbase/discussions/5940)).
- Added more descriptive error messages.
## v0.23.0
> [!NOTE]
> You don't have to upgrade to PocketBase v0.23.0 if you are not planning further developing
> your existing app and/or are satisfied with the v0.22.x features set. There are no identified critical issues
> with PocketBase v0.22.x yet and in the case of critical bugs and security vulnerabilities, the fixes
> will be backported for at least until Q1 of 2025 (_if not longer_).
>
> **If you don't plan upgrading make sure to pin the SDKs version to their latest PocketBase v0.22.x compatible:**
> - JS SDK: `<0.22.0`
> - Dart SDK: `<0.19.0`
> [!CAUTION]
> This release introduces many Go/JSVM and Web APIs breaking changes!
>
> Existing `pb_data` will be automatically upgraded with the start of the new executable,
> but custom Go or JSVM (`pb_hooks`, `pb_migrations`) and JS/Dart SDK code will have to be migrated manually.
> Please refer to the below upgrade guides:
> - Go: https://pocketbase.io/v023upgrade/go/.
> - JSVM: https://pocketbase.io/v023upgrade/jsvm/.
>
> If you had already switched to some of the earlier `<v0.23.0-rc14` versions and have generated a full collections snapshot migration (aka. `./pocketbase migrate collections`), then you may have to regenerate the migration file to ensure that it includes the latest changes.
PocketBase v0.23.0 is a major refactor of the internals with the overall goal of making PocketBase an easier to use Go framework.
There are a lot of changes but to highlight some of the most notable ones:
- New and more [detailed documentation](https://pocketbase.io/docs/).
_The old documentation could be accessed at [pocketbase.io/old](https://pocketbase.io/old/)._
- Replaced `echo` with a new router built on top of the Go 1.22 `net/http` mux enhancements.
- Merged `daos` packages in `core.App` to simplify the DB operations (_the `models` package structs are also migrated in `core`_).
- Option to specify custom `DBConnect` function as part of the app configuration to allow different `database/sql` SQLite drivers (_turso/libsql, sqlcipher, etc._) and custom builds.
_Note that we no longer loads the `mattn/go-sqlite3` driver by default when building with `CGO_ENABLED=1` to avoid `multiple definition` linker errors in case different CGO SQLite drivers or builds are used. You can find an example how to enable it back if you want to in the [new documentation](https://pocketbase.io/docs/go-overview/#github-commattngo-sqlite3)._
- New hooks allowing better control over the execution chain and error handling (_including wrapping an entire hook chain in a single DB transaction_).
- Various `Record` model improvements (_support for get/set modifiers, simplfied file upload by treating the file(s) as regular field value like `record.Set("document", file)`, etc._).
- Dedicated fields structs with safer defaults to make it easier creating/updating collections programmatically.
- Option to mark field as "Hidden", disallowing regular users to read or modify it (_there is also a dedicated Record hook to hide/unhide Record fields programmatically from a single place_).
- Option to customize the default system collection fields (`id`, `email`, `password`, etc.).
- Admins are now system `_superusers` auth records.
- Builtin rate limiter (_supports tags, wildcards and exact routes matching_).
- Batch/transactional Web API endpoint.
- Impersonate Web API endpoint (_it could be also used for generating fixed/nonrenewable superuser tokens, aka. "API keys"_).
- Support for custom user request activity log attributes.
- One-Time Password (OTP) auth method (_via email code_).
- Multi-Factor Authentication (MFA) support (_currently requires any 2 different auth methods to be used_).
- Support for Record "proxy/projection" in preparation for the planned autogeneration of typed Go record models.
- Linear OAuth2 provider ([#5909](https://github.com/pocketbase/pocketbase/pull/5909); thanks @chnfyi).
- WakaTime OAuth2 provider ([#5829](https://github.com/pocketbase/pocketbase/pull/5829); thanks @tigawanna).
- Notion OAuth2 provider ([#4999](https://github.com/pocketbase/pocketbase/pull/4999); thanks @s-li1).
- monday.com OAuth2 provider ([#5346](https://github.com/pocketbase/pocketbase/pull/5346); thanks @Jaytpa01).
- New Instagram provider compatible with the new Instagram Login APIs ([#5588](https://github.com/pocketbase/pocketbase/pull/5588); thanks @pnmcosta).
_The provider key is `instagram2` to prevent conflicts with existing linked users._
- Option to retrieve the OIDC OAuth2 user info from the `id_token` payload for the cases when the provider doesn't have a dedicated user info endpoint.
- Various minor UI improvements (_recursive `Presentable` view, slightly different collection options organization, zoom/pan for the logs chart, etc._)
- and many more...
#### Go/JSVM APIs changes
> - Go: https://pocketbase.io/v023upgrade/go/.
> - JSVM: https://pocketbase.io/v023upgrade/jsvm/.
#### SDKs changes
- [JS SDK v0.22.0](https://github.com/pocketbase/js-sdk/blob/master/CHANGELOG.md)
- [Dart SDK v0.19.0](https://github.com/pocketbase/dart-sdk/blob/master/CHANGELOG.md)
#### Web APIs changes
- New `POST /api/batch` endpoint.
- New `GET /api/collections/meta/scaffolds` endpoint.
- New `DELETE /api/collections/{collection}/truncate` endpoint.
- New `POST /api/collections/{collection}/request-otp` endpoint.
- New `POST /api/collections/{collection}/auth-with-otp` endpoint.
- New `POST /api/collections/{collection}/impersonate/{id}` endpoint.
- ⚠️ If you are constructing requests to `/api/*` routes manually remove the trailing slash (_there is no longer trailing slash removal middleware registered by default_).
- ⚠️ Removed `/api/admins/*` endpoints because admins are converted to `_superusers` auth collection records.
- ⚠️ Previously when uploading new files to a multiple `file` field, new files were automatically appended to the existing field values.
This behaviour has changed with v0.23+ and for consistency with the other multi-valued fields when uploading new files they will replace the old ones. If you want to prepend or append new files to an existing multiple `file` field value you can use the `+` prefix or suffix:
```js
"documents": [file1, file2] // => [file1_name, file2_name]
"+documents": [file1, file2] // => [file1_name, file2_name, old1_name, old2_name]
"documents+": [file1, file2] // => [old1_name, old2_name, file1_name, file2_name]
```
- ⚠️ Removed `GET /records/{id}/external-auths` and `DELETE /records/{id}/external-auths/{provider}` endpoints because this is now handled by sending list and delete requests to the `_externalAuths` collection.
- ⚠️ Changes to the app settings model fields and response (+new options such as `trustedProxy`, `rateLimits`, `batch`, etc.). The app settings Web APIs are mostly used by the Dashboard UI and rarely by the end users, but if you want to check all settings changes please refer to the [Settings Go struct](https://github.com/pocketbase/pocketbase/blob/develop/core/settings_model.go#L121).
- ⚠️ New flatten Collection model and fields structure. The Collection model Web APIs are mostly used by the Dashboard UI and rarely by the end users, but if you want to check all changes please refer to the [Collection Go struct](https://github.com/pocketbase/pocketbase/blob/develop/core/collection_model.go#L308).
- ⚠️ The top level error response `code` key was renamed to `status` for consistency with the Go APIs.
The error field key remains `code`:
```js
{
"status": 400, // <-- old: "code"
"message": "Failed to create record.",
"data": {
"title": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
```
- ⚠️ New fields in the `GET /api/collections/{collection}/auth-methods` response.
_The old `authProviders`, `usernamePassword`, `emailPassword` fields are still returned in the response but are considered deprecated and will be removed in the future._
```js
{
"mfa": {
"duration": 100,
"enabled": true
},
"otp": {
"duration": 0,
"enabled": false
},
"password": {
"enabled": true,
"identityFields": ["email", "username"]
},
"oauth2": {
"enabled": true,
"providers": [{"name": "gitlab", ...}, {"name": "google", ...}]
},
// old fields...
}
```
- ⚠️ Soft-deprecated the OAuth2 auth success `meta.avatarUrl` field in favour of `meta.avatarURL`.

View File

@@ -0,0 +1,17 @@
The MIT License (MIT)
Copyright (c) 2022 - present, Gani Georgiev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2749400118",
"indexes": [],
"listRule": null,
"name": "semantic_segments",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2749400118");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_3768126507",
"indexes": [],
"listRule": null,
"name": "frequent_places",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3768126507");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1343767521",
"indexes": [],
"listRule": null,
"name": "raw_signals",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_1343767521");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_952801224",
"indexes": [],
"listRule": null,
"name": "timeline_path_points",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_952801224");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1935361188",
"indexes": [],
"listRule": null,
"name": "visits",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_1935361188");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1493499684",
"indexes": [],
"listRule": null,
"name": "frequent_trip_mode_distribution",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_1493499684");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2743264166",
"indexes": [],
"listRule": null,
"name": "frequent_trip_waypoints",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2743264166");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2648794696",
"indexes": [],
"listRule": null,
"name": "frequent_trips",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2648794696");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2007833242",
"indexes": [],
"listRule": null,
"name": "travel_mode_affinities",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2007833242");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3768126507");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_3768126507",
"indexes": [],
"listRule": null,
"name": "frequent_places",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_1493499684");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1493499684",
"indexes": [],
"listRule": null,
"name": "frequent_trip_mode_distribution",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2743264166");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2743264166",
"indexes": [],
"listRule": null,
"name": "frequent_trip_waypoints",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2648794696");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2648794696",
"indexes": [],
"listRule": null,
"name": "frequent_trips",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_1343767521");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1343767521",
"indexes": [],
"listRule": null,
"name": "raw_signals",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2749400118");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2749400118",
"indexes": [],
"listRule": null,
"name": "semantic_segments",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_952801224");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_952801224",
"indexes": [],
"listRule": null,
"name": "timeline_path_points",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2007833242");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2007833242",
"indexes": [],
"listRule": null,
"name": "travel_mode_affinities",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_1935361188");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1935361188",
"indexes": [],
"listRule": null,
"name": "visits",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2749400118",
"indexes": [],
"listRule": null,
"name": "semantic_segments",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2749400118");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_3768126507",
"indexes": [],
"listRule": null,
"name": "frequent_places",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_3768126507");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1343767521",
"indexes": [],
"listRule": null,
"name": "raw_signals",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_1343767521");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_952801224",
"indexes": [],
"listRule": null,
"name": "timeline_path_points",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_952801224");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1935361188",
"indexes": [],
"listRule": null,
"name": "visits",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_1935361188");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1493499684",
"indexes": [],
"listRule": null,
"name": "frequent_trip_mode_distribution",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_1493499684");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2743264166",
"indexes": [],
"listRule": null,
"name": "frequent_trip_waypoints",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2743264166");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2648794696",
"indexes": [],
"listRule": null,
"name": "frequent_trips",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2648794696");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2007833242",
"indexes": [],
"listRule": null,
"name": "travel_mode_affinities",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2007833242");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3768126507");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_3768126507",
"indexes": [],
"listRule": null,
"name": "frequent_places",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_1493499684");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1493499684",
"indexes": [],
"listRule": null,
"name": "frequent_trip_mode_distribution",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2743264166");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2743264166",
"indexes": [],
"listRule": null,
"name": "frequent_trip_waypoints",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2648794696");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2648794696",
"indexes": [],
"listRule": null,
"name": "frequent_trips",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_1343767521");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1343767521",
"indexes": [],
"listRule": null,
"name": "raw_signals",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2749400118");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2749400118",
"indexes": [],
"listRule": null,
"name": "semantic_segments",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_952801224");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_952801224",
"indexes": [],
"listRule": null,
"name": "timeline_path_points",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2007833242");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2007833242",
"indexes": [],
"listRule": null,
"name": "travel_mode_affinities",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_1935361188");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1935361188",
"indexes": [],
"listRule": null,
"name": "visits",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1886393167",
"indexes": [],
"listRule": null,
"name": "visits_test",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_1886393167");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_1886393167");
return app.delete(collection);
}, (app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1886393167",
"indexes": [],
"listRule": null,
"name": "visits_test",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_1665123660",
"indexes": [],
"listRule": null,
"name": "visits_test_v2",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_1665123660");
return app.delete(collection);
})

View File

@@ -0,0 +1,37 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": null,
"deleteRule": null,
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
}
],
"id": "pbc_2790463832",
"indexes": [],
"listRule": null,
"name": "test_simple",
"system": false,
"type": "base",
"updateRule": null,
"viewRule": null
});
return app.save(collection);
}, (app) => {
const collection = app.findCollectionByNameOrId("pbc_2790463832");
return app.delete(collection);
})

Binary file not shown.

View File

@@ -0,0 +1,262 @@
#!/usr/bin/env python3
"""
Export Timeline.json data into multiple normalized CSV files.
Generated CSVs (default names):
semantic_segments.csv
visits.csv
timeline_path_points.csv
raw_signals.csv
frequent_places.csv
frequent_trips.csv
frequent_trip_waypoints.csv
frequent_trip_mode_distribution.csv
travel_mode_affinities.csv
Usage:
python export_timeline_to_csv.py \
--timeline ../data/Timeline.json \
--outdir ./timeline_csv \
--prefix timeline_
If --timeline not supplied, the script searches upward from script dir for Timeline.json.
"""
import os
import json
import csv
import argparse
from typing import Tuple, Any, Dict, List
from datetime import datetime
# ---------------------------- Helpers ---------------------------------
def find_timeline_json(start_path: str) -> str:
for root, dirs, files in os.walk(start_path):
if 'Timeline.json' in files:
return os.path.join(root, 'Timeline.json')
return ''
def parse_coordinates(point_str: str) -> Tuple[Any, Any]:
if not isinstance(point_str, str):
return None, None
try:
s = point_str.replace('°', '').strip()
if not s:
return None, None
parts = [p.strip() for p in s.split(',')]
if len(parts) != 2:
return None, None
return float(parts[0]), float(parts[1])
except Exception:
return None, None
def ensure_dir(path: str):
os.makedirs(path, exist_ok=True)
# ---------------------------- Export Functions -------------------------
def export_semantic_segments(data: Dict, writer):
segments = data.get('semanticSegments', [])
for idx, seg in enumerate(segments):
start = seg.get('startTime')
end = seg.get('endTime')
has_visit = 'visit' in seg
has_path = 'timelinePath' in seg
writer.writerow({
'segment_index': idx,
'startTime': start,
'endTime': end,
'has_visit': int(has_visit),
'has_timeline_path': int(has_path)
})
def export_visits(data: Dict, writer):
for idx, seg in enumerate(data.get('semanticSegments', [])):
if 'visit' not in seg:
continue
visit = seg.get('visit', {})
top = visit.get('topCandidate', {})
lat, lon = parse_coordinates(top.get('placeLocation', {}).get('latLng'))
writer.writerow({
'segment_index': idx,
'hierarchyLevel': visit.get('hierarchyLevel'),
'visit_probability': visit.get('probability'),
'top_place_id': top.get('placeId'),
'top_semantic_type': top.get('semanticType'),
'top_probability': top.get('probability'),
'top_lat': lat,
'top_lon': lon,
'startTime': seg.get('startTime'),
'endTime': seg.get('endTime')
})
def export_timeline_path_points(data: Dict, writer):
for idx, seg in enumerate(data.get('semanticSegments', [])):
path = seg.get('timelinePath')
if not isinstance(path, list):
continue
for p_idx, point_obj in enumerate(path):
point_str = point_obj.get('point')
lat, lon = parse_coordinates(point_str)
writer.writerow({
'segment_index': idx,
'point_index': p_idx,
'time': point_obj.get('time'),
'raw_point': point_str,
'lat': lat,
'lon': lon,
})
def export_raw_signals(data: Dict, writer):
for idx, signal in enumerate(data.get('rawSignals', [])):
pos = signal.get('position', {})
# Raw signals coordinate key observed as 'LatLng'
lat, lon = parse_coordinates(pos.get('LatLng') or pos.get('latLng'))
writer.writerow({
'raw_index': idx,
'timestamp': pos.get('timestamp'),
'lat': lat,
'lon': lon,
'accuracyMeters': pos.get('accuracyMeters'),
'altitudeMeters': pos.get('altitudeMeters'),
'speedMetersPerSecond': pos.get('speedMetersPerSecond'),
'source': pos.get('source')
})
def export_frequent_places(data: Dict, writer):
profile = data.get('userLocationProfile', {})
for place in profile.get('frequentPlaces', []) or []:
lat, lon = parse_coordinates(place.get('placeLocation'))
writer.writerow({
'placeId': place.get('placeId'),
'label': place.get('label'),
'lat': lat,
'lon': lon
})
def export_frequent_trips(data: Dict, trips_writer, waypoints_writer, mode_dist_writer):
profile = data.get('userLocationProfile', {})
for idx, trip in enumerate(profile.get('frequentTrips', []) or []):
waypoint_ids = trip.get('waypointIds') or []
mode_distribution = trip.get('modeDistribution') or []
trips_writer.writerow({
'trip_index': idx,
'startTimeMinutes': trip.get('startTimeMinutes'),
'endTimeMinutes': trip.get('endTimeMinutes'),
'durationMinutes': trip.get('durationMinutes'),
'confidence': trip.get('confidence'),
'commuteDirection': trip.get('commuteDirection'),
'waypoint_count': len(waypoint_ids),
'mode_dist_count': len(mode_distribution)
})
for w_idx, wid in enumerate(waypoint_ids):
waypoints_writer.writerow({
'trip_index': idx,
'waypoint_order': w_idx,
'waypoint_id': wid
})
for m_idx, m in enumerate(mode_distribution):
# Unknown exact structure, store JSON
mode_dist_writer.writerow({
'trip_index': idx,
'entry_index': m_idx,
'raw_json': json.dumps(m, ensure_ascii=False)
})
def export_travel_mode_affinities(data: Dict, writer):
profile = data.get('userLocationProfile', {})
persona = profile.get('persona', {})
for aff in persona.get('travelModeAffinities', []) or []:
writer.writerow({
'mode': aff.get('mode'),
'affinity': aff.get('affinity')
})
# ---------------------------- Main ------------------------------------
def export_all(data: Dict, outdir: str, prefix: str):
ensure_dir(outdir)
def open_csv(name: str, fieldnames: List[str]):
fpath = os.path.join(outdir, f"{prefix}{name}.csv")
f = open(fpath, 'w', encoding='utf-8', newline='')
writer = csv.DictWriter(f, fieldnames=fieldnames)
writer.writeheader()
return f, writer
files = []
try:
# semantic segments
f_seg, w_seg = open_csv('semantic_segments', ['segment_index','startTime','endTime','has_visit','has_timeline_path'])
files.append(f_seg)
export_semantic_segments(data, w_seg)
# visits
f_vis, w_vis = open_csv('visits', ['segment_index','hierarchyLevel','visit_probability','top_place_id','top_semantic_type','top_probability','top_lat','top_lon','startTime','endTime'])
files.append(f_vis)
export_visits(data, w_vis)
# timeline path points
f_path, w_path = open_csv('timeline_path_points', ['segment_index','point_index','time','raw_point','lat','lon'])
files.append(f_path)
export_timeline_path_points(data, w_path)
# raw signals
f_raw, w_raw = open_csv('raw_signals', ['raw_index','timestamp','lat','lon','accuracyMeters','altitudeMeters','speedMetersPerSecond','source'])
files.append(f_raw)
export_raw_signals(data, w_raw)
# frequent places
f_fp, w_fp = open_csv('frequent_places', ['placeId','label','lat','lon'])
files.append(f_fp)
export_frequent_places(data, w_fp)
# frequent trips core
f_trips, w_trips = open_csv('frequent_trips', ['trip_index','startTimeMinutes','endTimeMinutes','durationMinutes','confidence','commuteDirection','waypoint_count','mode_dist_count'])
files.append(f_trips)
# waypoints
f_way, w_way = open_csv('frequent_trip_waypoints', ['trip_index','waypoint_order','waypoint_id'])
files.append(f_way)
# mode distribution
f_md, w_md = open_csv('frequent_trip_mode_distribution', ['trip_index','entry_index','raw_json'])
files.append(f_md)
export_frequent_trips(data, w_trips, w_way, w_md)
# travel mode affinities
f_aff, w_aff = open_csv('travel_mode_affinities', ['mode','affinity'])
files.append(f_aff)
export_travel_mode_affinities(data, w_aff)
finally:
for f in files:
f.close()
def main():
parser = argparse.ArgumentParser(description='Export Timeline.json to multiple CSV files.')
parser.add_argument('--timeline', type=str, help='Path to Timeline.json (auto-detect if omitted)')
parser.add_argument('--outdir', type=str, default='timeline_csv', help='Output directory for CSV files')
parser.add_argument('--prefix', type=str, default='', help='Filename prefix for CSV files')
args = parser.parse_args()
if args.timeline:
timeline_path = args.timeline
else:
timeline_path = find_timeline_json(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
if not timeline_path or not os.path.isfile(timeline_path):
raise SystemExit('Timeline.json not found. Provide --timeline or place file in repository.')
print(f'Loading {timeline_path} ...')
with open(timeline_path, 'r', encoding='utf-8') as f:
data = json.load(f)
ts = datetime.now().strftime('%Y%m%d_%H%M%S')
outdir = os.path.join(args.outdir, ts)
print(f'Exporting CSV files to: {outdir}')
export_all(data, outdir, args.prefix)
print('Done.')
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,185 @@
GEOSPATIAL DATA RELATIONSHIPS IN PERSONAL TRACKER
==================================================
This document explains how the geospatial datasets in the timeline_csv folder are interconnected
and structured to provide a complete picture of location-based personal tracking data.
OVERVIEW
--------
The location tracking system uses a hierarchical approach with semantic segments as the master
index that coordinates different types of location data. The data is organized into movement
periods (travel) and stationary periods (visits), creating a complete chronological timeline.
CORE DATASETS AND THEIR RELATIONSHIPS
=====================================
1. SEMANTIC_SEGMENTS.CSV - The Master Index
--------------------------------------------
Purpose: Acts as the central orchestrator that defines time-based segments
Key Fields:
- segment_index: Unique identifier linking all other datasets
- startTime/endTime: Time boundaries for each segment
- has_visit: Boolean indicating if segment contains visit data
- has_timeline_path: Boolean indicating if segment contains movement data
This dataset defines the temporal structure and determines which other datasets contain
data for each time period.
2. TIMELINE_PATH_POINTS.CSV - Movement Data
--------------------------------------------
Purpose: GPS tracking data during travel/movement periods
Key Fields:
- segment_index: Links to semantic_segments
- point_index: Order of GPS points within a segment
- time: Precise timestamp for each GPS reading
- lat/lon: Geographic coordinates
- raw_point: Original coordinate string
Relationship: Contains data ONLY for segments where has_timeline_path=1 in semantic_segments.
These represent periods when the person was moving between locations.
3. VISITS.CSV - Stationary Location Data
-----------------------------------------
Purpose: Information about places where the person stayed for extended periods
Key Fields:
- segment_index: Links to semantic_segments
- top_place_id: Google Places API identifier
- top_semantic_type: Category (HOME, WORK, UNKNOWN, etc.)
- top_lat/top_lon: Geographic coordinates of the visit location
- startTime/endTime: Duration of the visit
- visit_probability: Confidence that this was actually a visit
Relationship: Contains data ONLY for segments where has_visit=1 in semantic_segments.
These represent periods when the person was stationary at a specific location.
4. FREQUENT_PLACES.CSV - Location Reference Data
------------------------------------------------
Purpose: Registry of commonly visited locations with semantic labels
Key Fields:
- placeId: Google Places API identifier (links to visits.top_place_id)
- label: Semantic meaning (HOME, WORK, or empty for unlabeled)
- lat/lon: Geographic coordinates
Relationship: Acts as a lookup table for visits.csv. The placeId field provides
cross-references to identify and categorize frequently visited locations.
5. RAW_SIGNALS.CSV - Raw GPS Data
---------------------------------
Purpose: Unprocessed GPS signals from the device
Key Fields:
- raw_index: Sequential identifier
- timestamp: When the GPS signal was recorded
- lat/lon: Geographic coordinates
- accuracyMeters: GPS accuracy measurement
- altitudeMeters: Elevation data
- speedMetersPerSecond: Movement speed
- source: Data source type
Relationship: This is the foundation data that gets processed into timeline_path_points
and visits. It represents the raw GPS signals before semantic interpretation.
SUPPORTING DATASETS
===================
6. FREQUENT_TRIPS.CSV - Trip Pattern Analysis
----------------------------------------------
Purpose: Analysis of regular travel patterns (like commutes)
Key Fields:
- trip_index: Unique identifier for trip patterns
- startTimeMinutes/endTimeMinutes: Time of day patterns
- durationMinutes: Typical trip duration
- commuteDirection: HOME_TO_WORK or WORK_TO_HOME
- waypoint_count: Number of stops in the trip
7. FREQUENT_TRIP_WAYPOINTS.CSV - Trip Waypoint Details
------------------------------------------------------
Purpose: Specific locations that are part of frequent trips
Key Fields:
- trip_index: Links to frequent_trips.csv
- waypoint_order: Sequence of stops in the trip
- waypoint_id: Links to frequent_places.placeId
8. FREQUENT_TRIP_MODE_DISTRIBUTION.CSV - Transportation Analysis
---------------------------------------------------------------
Purpose: Analysis of transportation methods used
Key Fields:
- trip_index: Links to frequent_trips.csv
- mode: Transportation type (WALKING, DRIVING, etc.)
- percentage: How often this mode was used for this trip
9. TRAVEL_MODE_AFFINITIES.CSV - User Preferences
------------------------------------------------
Purpose: User's preferred transportation methods
Key Fields:
- mode: Transportation type
- affinity: Preference score
DATA FLOW AND RELATIONSHIPS
============================
1. RAW COLLECTION:
raw_signals.csv contains all GPS pings from the device
2. TEMPORAL SEGMENTATION:
semantic_segments.csv divides time into logical periods based on movement patterns
3. MOVEMENT vs. STATIONARY CLASSIFICATION:
- Movement periods → timeline_path_points.csv (detailed GPS tracking)
- Stationary periods → visits.csv (location identification and categorization)
4. LOCATION IDENTIFICATION:
frequent_places.csv provides semantic meaning to visited locations
5. PATTERN ANALYSIS:
frequent_trips.csv, frequent_trip_waypoints.csv, and frequent_trip_mode_distribution.csv
analyze regular patterns and transportation preferences
EXAMPLE DATA FLOW
==================
Segment 0 (Movement): 2013-12-31 22:00 - 2014-01-01 00:00
- semantic_segments: has_timeline_path=1, has_visit=0
- timeline_path_points: Contains GPS coordinates during this travel period
- visits: No data for this segment
Segment 1 (Visit): 2013-12-31 22:29 - 2014-01-01 17:10
- semantic_segments: has_timeline_path=0, has_visit=1
- timeline_path_points: No data for this segment
- visits: Shows visit to place ChIJyaJWtZVqdkgRZHVIi0HKLto (HOME)
- frequent_places: Confirms this placeId is labeled as "HOME"
QUERYING STRATEGIES
===================
To get complete journey information:
1. Query semantic_segments for time range
2. For movement segments: Join with timeline_path_points on segment_index
3. For visit segments: Join with visits on segment_index
4. Enhance visit data by joining visits.top_place_id with frequent_places.placeId
To analyze location patterns:
1. Use frequent_places for location categories
2. Use frequent_trips for commute patterns
3. Use travel_mode_affinities for transportation preferences
COORDINATE SYSTEMS
==================
All latitude/longitude data uses WGS84 decimal degrees:
- Latitude: Positive = North, Negative = South
- Longitude: Positive = East, Negative = West
- Precision: Typically 6-7 decimal places (meter-level accuracy)
TIME ZONES
==========
All timestamps include timezone information (typically +00:00 or +01:00 for UK data).
Time ranges in semantic_segments define the boundaries for linking other datasets.
DATA COMPLETENESS
=================
- Not all segments have both movement and visit data
- Some segments may have neither (gaps in tracking)
- Visit probability scores indicate confidence levels
- Missing coordinates in raw_signals are represented as empty fields
This hierarchical structure allows for both detailed movement tracking and high-level
pattern analysis while maintaining semantic meaning about the places visited.

167
streamlit_app/app.py Normal file
View File

@@ -0,0 +1,167 @@
import streamlit as st
import pandas as pd
import os
from pathlib import Path
import folium
from streamlit_folium import folium_static
import numpy as np
st.set_page_config(page_title="Timeline CSV Viewer", layout="wide")
st.title("Timeline CSV Viewer")
# Path to the timeline_csv folder
timeline_csv_path = Path("../timeline_csv")
# Get all CSV files from all subdirectories
csv_files = []
if timeline_csv_path.exists():
for subdir in timeline_csv_path.iterdir():
if subdir.is_dir():
for csv_file in subdir.glob("*.csv"):
csv_files.append(csv_file)
if not csv_files:
st.error("No CSV files found in the timeline_csv folder.")
st.stop()
# Define geospatial datasets and their coordinate columns
GEOSPATIAL_FILES = {
'timeline_path_points.csv': {'lat': 'lat', 'lon': 'lon', 'time': 'time'},
'visits.csv': {'lat': 'top_lat', 'lon': 'top_lon', 'time': 'startTime'},
'raw_signals.csv': {'lat': 'lat', 'lon': 'lon', 'time': 'timestamp'},
'frequent_places.csv': {'lat': 'lat', 'lon': 'lon', 'time': None},
'semantic_segments.csv': {'lat': None, 'lon': None, 'time': 'startTime'}
}
# Create enhanced file names with geospatial indicators
enhanced_file_names = []
for f in csv_files:
if f.name in GEOSPATIAL_FILES:
enhanced_file_names.append(f"🗺️ {f.name} (Geospatial)")
else:
enhanced_file_names.append(f.name)
selected_enhanced_name = st.selectbox("Select a CSV file to view:", enhanced_file_names)
# Extract the actual filename from the enhanced name
selected_file_name = selected_enhanced_name.replace('🗺️ ', '').replace(' (Geospatial)', '')
# Find the full path for the selected file
selected_file_path = None
for file_path in csv_files:
if file_path.name == selected_file_name:
selected_file_path = file_path
break
if selected_file_path:
st.write(f"**File:** {selected_file_path}")
try:
# Read the CSV file
df = pd.read_csv(selected_file_path)
# Display basic info
is_geospatial = selected_file_name in GEOSPATIAL_FILES
if is_geospatial:
st.success(f"🗺️ **Geospatial Dataset Detected** - {df.shape[0]} rows × {df.shape[1]} columns")
else:
st.write(f"**Shape:** {df.shape[0]} rows × {df.shape[1]} columns")
# Show geospatial visualization if applicable
if is_geospatial and selected_file_name in GEOSPATIAL_FILES:
geo_config = GEOSPATIAL_FILES[selected_file_name]
lat_col = geo_config['lat']
lon_col = geo_config['lon']
time_col = geo_config['time']
if lat_col and lon_col and lat_col in df.columns and lon_col in df.columns:
st.subheader("🗺️ Map Visualization")
# Filter out null coordinates
geo_df = df.dropna(subset=[lat_col, lon_col])
if len(geo_df) > 0:
# Sample data if too large for performance
if len(geo_df) > 1000:
geo_df = geo_df.sample(n=1000)
st.info(f"Showing 1000 randomly sampled points out of {len(df)} total points for performance")
# Create map centered on mean coordinates
center_lat = geo_df[lat_col].mean()
center_lon = geo_df[lon_col].mean()
m = folium.Map(location=[center_lat, center_lon], zoom_start=10)
# Add points to map
for idx, row in geo_df.iterrows():
popup_text = f"Index: {idx}"
if time_col and time_col in df.columns:
popup_text += f"<br>Time: {row[time_col]}"
# Color code based on dataset type
if selected_file_name == 'timeline_path_points.csv':
color = 'blue'
elif selected_file_name == 'visits.csv':
color = 'red'
elif selected_file_name == 'raw_signals.csv':
color = 'green'
else:
color = 'orange'
folium.CircleMarker(
location=[row[lat_col], row[lon_col]],
radius=3,
popup=popup_text,
color=color,
fillColor=color,
fillOpacity=0.7
).add_to(m)
folium_static(m)
# Show coordinate statistics
st.subheader("📍 Coordinate Statistics")
coord_stats = pd.DataFrame({
'Statistic': ['Count', 'Min Lat', 'Max Lat', 'Min Lon', 'Max Lon', 'Center Lat', 'Center Lon'],
'Value': [
len(geo_df),
f"{geo_df[lat_col].min():.6f}",
f"{geo_df[lat_col].max():.6f}",
f"{geo_df[lon_col].min():.6f}",
f"{geo_df[lon_col].max():.6f}",
f"{center_lat:.6f}",
f"{center_lon:.6f}"
]
})
st.dataframe(coord_stats)
else:
st.warning("No valid coordinates found in this dataset")
else:
if selected_file_name == 'semantic_segments.csv':
st.info("📅 This dataset contains temporal data that links to spatial information in other datasets")
else:
st.warning(f"Expected coordinate columns ({lat_col}, {lon_col}) not found in this dataset")
# Show first few rows
st.subheader("Data Preview")
st.dataframe(df.head(100))
# Show column info
st.subheader("Column Information")
col_info = pd.DataFrame({
'Column': df.columns,
'Data Type': df.dtypes,
'Non-Null Count': df.count(),
'Null Count': df.isnull().sum()
})
st.dataframe(col_info)
# Show basic statistics for numeric columns
numeric_cols = df.select_dtypes(include=['number']).columns
if len(numeric_cols) > 0:
st.subheader("Numeric Column Statistics")
st.dataframe(df[numeric_cols].describe())
except Exception as e:
st.error(f"Error reading the CSV file: {str(e)}")

View File

@@ -0,0 +1,11 @@
placeId,label,lat,lon
ChIJAAAAAAAAAAARjhi7lioZa2Y,HOME,51.6658192,-0.4056977
ChIJAAAAAAAAAAARqv1PBlyKQqU,,51.5280408,-0.1333271
ChIJAAAAAAAAAAAR4xVxQ-iFuSc,WORK,51.5157699,-0.1316355
ChIJAAAAAAAAAAAREvwoXLLyhU0,,51.6636753,-0.3960678
ChIJAAAAAAAAAAAR-aFGg1la334,,51.6541167,-0.3928591
ChIJAAAAAAAAAAARVbhj9-fMCgA,,51.512069,-0.1321399
ChIJAAAAAAAAAAARrsPaSQqNays,,48.1381556,11.5602535
ChIJAAAAAAAAAAARwsyEMxqdhzg,,48.13921,11.57766
ChIJAAAAAAAAAAARCPYgxYn5PKk,,51.6698017,-0.4085657
ChIJAAAAAAAAAAAR5gk8mcL7EqQ,,51.5347377,-0.1382573
1 placeId label lat lon
2 ChIJAAAAAAAAAAARjhi7lioZa2Y HOME 51.6658192 -0.4056977
3 ChIJAAAAAAAAAAARqv1PBlyKQqU 51.5280408 -0.1333271
4 ChIJAAAAAAAAAAAR4xVxQ-iFuSc WORK 51.5157699 -0.1316355
5 ChIJAAAAAAAAAAAREvwoXLLyhU0 51.6636753 -0.3960678
6 ChIJAAAAAAAAAAAR-aFGg1la334 51.6541167 -0.3928591
7 ChIJAAAAAAAAAAARVbhj9-fMCgA 51.512069 -0.1321399
8 ChIJAAAAAAAAAAARrsPaSQqNays 48.1381556 11.5602535
9 ChIJAAAAAAAAAAARwsyEMxqdhzg 48.13921 11.57766
10 ChIJAAAAAAAAAAARCPYgxYn5PKk 51.6698017 -0.4085657
11 ChIJAAAAAAAAAAAR5gk8mcL7EqQ 51.5347377 -0.1382573

View File

@@ -0,0 +1,34 @@
trip_index,entry_index,raw_json
0,0,"{""mode"": ""WALKING"", ""rate"": 0.46875}"
0,1,"{""mode"": ""IN_TRAIN"", ""rate"": 0.3125}"
0,2,"{""mode"": ""IN_SUBWAY"", ""rate"": 0.15625}"
0,3,"{""mode"": ""CYCLING"", ""rate"": 0.0625}"
1,0,"{""mode"": ""WALKING"", ""rate"": 0.4333333373069763}"
1,1,"{""mode"": ""IN_TRAIN"", ""rate"": 0.3333333432674408}"
1,2,"{""mode"": ""IN_SUBWAY"", ""rate"": 0.13333334028720856}"
1,3,"{""mode"": ""CYCLING"", ""rate"": 0.10000000149011612}"
2,0,"{""mode"": ""WALKING"", ""rate"": 0.3888888955116272}"
2,1,"{""mode"": ""IN_TRAIN"", ""rate"": 0.3055555522441864}"
2,2,"{""mode"": ""IN_SUBWAY"", ""rate"": 0.25}"
2,3,"{""mode"": ""CYCLING"", ""rate"": 0.0555555559694767}"
3,0,"{""mode"": ""WALKING"", ""rate"": 0.42105263471603394}"
3,1,"{""mode"": ""IN_TRAIN"", ""rate"": 0.31578946113586426}"
3,2,"{""mode"": ""IN_SUBWAY"", ""rate"": 0.21052631735801697}"
3,3,"{""mode"": ""CYCLING"", ""rate"": 0.05263157933950424}"
4,0,"{""mode"": ""WALKING"", ""rate"": 0.5}"
4,1,"{""mode"": ""IN_TRAIN"", ""rate"": 0.3499999940395355}"
4,2,"{""mode"": ""IN_SUBWAY"", ""rate"": 0.10000000149011612}"
4,3,"{""mode"": ""CYCLING"", ""rate"": 0.05000000074505806}"
5,0,"{""mode"": ""WALKING"", ""rate"": 0.6111111044883728}"
5,1,"{""mode"": ""IN_TRAIN"", ""rate"": 0.2777777910232544}"
5,2,"{""mode"": ""IN_SUBWAY"", ""rate"": 0.1111111119389534}"
6,0,"{""mode"": ""WALKING"", ""rate"": 0.5769230723381042}"
6,1,"{""mode"": ""IN_TRAIN"", ""rate"": 0.3076923191547394}"
6,2,"{""mode"": ""IN_SUBWAY"", ""rate"": 0.11538461595773697}"
7,0,"{""mode"": ""WALKING"", ""rate"": 0.5263158082962036}"
7,1,"{""mode"": ""IN_TRAIN"", ""rate"": 0.2631579041481018}"
7,2,"{""mode"": ""IN_SUBWAY"", ""rate"": 0.15789473056793213}"
7,3,"{""mode"": ""IN_PASSENGER_VEHICLE"", ""rate"": 0.05263157933950424}"
8,0,"{""mode"": ""WALKING"", ""rate"": 0.5454545617103577}"
8,1,"{""mode"": ""IN_TRAIN"", ""rate"": 0.27272728085517883}"
8,2,"{""mode"": ""IN_SUBWAY"", ""rate"": 0.09090909361839294}"
1 trip_index entry_index raw_json
2 0 0 {"mode": "WALKING", "rate": 0.46875}
3 0 1 {"mode": "IN_TRAIN", "rate": 0.3125}
4 0 2 {"mode": "IN_SUBWAY", "rate": 0.15625}
5 0 3 {"mode": "CYCLING", "rate": 0.0625}
6 1 0 {"mode": "WALKING", "rate": 0.4333333373069763}
7 1 1 {"mode": "IN_TRAIN", "rate": 0.3333333432674408}
8 1 2 {"mode": "IN_SUBWAY", "rate": 0.13333334028720856}
9 1 3 {"mode": "CYCLING", "rate": 0.10000000149011612}
10 2 0 {"mode": "WALKING", "rate": 0.3888888955116272}
11 2 1 {"mode": "IN_TRAIN", "rate": 0.3055555522441864}
12 2 2 {"mode": "IN_SUBWAY", "rate": 0.25}
13 2 3 {"mode": "CYCLING", "rate": 0.0555555559694767}
14 3 0 {"mode": "WALKING", "rate": 0.42105263471603394}
15 3 1 {"mode": "IN_TRAIN", "rate": 0.31578946113586426}
16 3 2 {"mode": "IN_SUBWAY", "rate": 0.21052631735801697}
17 3 3 {"mode": "CYCLING", "rate": 0.05263157933950424}
18 4 0 {"mode": "WALKING", "rate": 0.5}
19 4 1 {"mode": "IN_TRAIN", "rate": 0.3499999940395355}
20 4 2 {"mode": "IN_SUBWAY", "rate": 0.10000000149011612}
21 4 3 {"mode": "CYCLING", "rate": 0.05000000074505806}
22 5 0 {"mode": "WALKING", "rate": 0.6111111044883728}
23 5 1 {"mode": "IN_TRAIN", "rate": 0.2777777910232544}
24 5 2 {"mode": "IN_SUBWAY", "rate": 0.1111111119389534}
25 6 0 {"mode": "WALKING", "rate": 0.5769230723381042}
26 6 1 {"mode": "IN_TRAIN", "rate": 0.3076923191547394}
27 6 2 {"mode": "IN_SUBWAY", "rate": 0.11538461595773697}
28 7 0 {"mode": "WALKING", "rate": 0.5263158082962036}
29 7 1 {"mode": "IN_TRAIN", "rate": 0.2631579041481018}
30 7 2 {"mode": "IN_SUBWAY", "rate": 0.15789473056793213}
31 7 3 {"mode": "IN_PASSENGER_VEHICLE", "rate": 0.05263157933950424}
32 8 0 {"mode": "WALKING", "rate": 0.5454545617103577}
33 8 1 {"mode": "IN_TRAIN", "rate": 0.27272728085517883}
34 8 2 {"mode": "IN_SUBWAY", "rate": 0.09090909361839294}

View File

@@ -0,0 +1,45 @@
trip_index,waypoint_order,waypoint_id
0,0,ChIJAAAAAAAAAAARjhi7lioZa2Y
0,1,ChIJAAAAAAAAAAARqv1PBlyKQqU
0,2,ChIJAAAAAAAAAAAREvwoXLLyhU0
0,3,ChIJAAAAAAAAAAAR4xVxQ-iFuSc
1,0,ChIJAAAAAAAAAAARjhi7lioZa2Y
1,1,ChIJAAAAAAAAAAARqv1PBlyKQqU
1,2,ChIJAAAAAAAAAAAREvwoXLLyhU0
1,3,ChIJAAAAAAAAAAAR4xVxQ-iFuSc
2,0,ChIJAAAAAAAAAAARjhi7lioZa2Y
2,1,ChIJAAAAAAAAAAARqv1PBlyKQqU
2,2,ChIJAAAAAAAAAAAREvwoXLLyhU0
2,3,ChIJAAAAAAAAAAAR4xVxQ-iFuSc
3,0,ChIJAAAAAAAAAAARjhi7lioZa2Y
3,1,ChIJAAAAAAAAAAAREvwoXLLyhU0
3,2,ChIJAAAAAAAAAAARqv1PBlyKQqU
3,3,ChIJAAAAAAAAAAAR4xVxQ-iFuSc
4,0,ChIJAAAAAAAAAAARjhi7lioZa2Y
4,1,ChIJAAAAAAAAAAARCO-FF_-eZUc
4,2,ChIJAAAAAAAAAAAREvwoXLLyhU0
4,3,ChIJAAAAAAAAAAARqv1PBlyKQqU
4,4,ChIJAAAAAAAAAAAR4xVxQ-iFuSc
5,0,ChIJAAAAAAAAAAAR4xVxQ-iFuSc
5,1,ChIJAAAAAAAAAAARqv1PBlyKQqU
5,2,ChIJAAAAAAAAAAAREvwoXLLyhU0
5,3,ChIJAAAAAAAAAAARjhi7lioZa2Y
6,0,ChIJAAAAAAAAAAAR4xVxQ-iFuSc
6,1,ChIJAAAAAAAAAAARDpW2KdCKr_0
6,2,ChIJAAAAAAAAAAARlCV8K3CctEM
6,3,ChIJAAAAAAAAAAARFS254-AYGeQ
6,4,ChIJAAAAAAAAAAARYgJcSNWXRnI
6,5,ChIJAAAAAAAAAAARqv1PBlyKQqU
6,6,ChIJAAAAAAAAAAAREvwoXLLyhU0
6,7,ChIJAAAAAAAAAAARjhi7lioZa2Y
7,0,ChIJAAAAAAAAAAAR4xVxQ-iFuSc
7,1,ChIJAAAAAAAAAAARqv1PBlyKQqU
7,2,ChIJAAAAAAAAAAARyKARfrOcmkE
7,3,ChIJAAAAAAAAAAAREvwoXLLyhU0
7,4,ChIJAAAAAAAAAAARjhi7lioZa2Y
8,0,ChIJAAAAAAAAAAAR4xVxQ-iFuSc
8,1,ChIJAAAAAAAAAAARqv1PBlyKQqU
8,2,ChIJAAAAAAAAAAARlCV8K3CctEM
8,3,ChIJAAAAAAAAAAARDpW2KdCKr_0
8,4,ChIJAAAAAAAAAAAREvwoXLLyhU0
8,5,ChIJAAAAAAAAAAARjhi7lioZa2Y
1 trip_index waypoint_order waypoint_id
2 0 0 ChIJAAAAAAAAAAARjhi7lioZa2Y
3 0 1 ChIJAAAAAAAAAAARqv1PBlyKQqU
4 0 2 ChIJAAAAAAAAAAAREvwoXLLyhU0
5 0 3 ChIJAAAAAAAAAAAR4xVxQ-iFuSc
6 1 0 ChIJAAAAAAAAAAARjhi7lioZa2Y
7 1 1 ChIJAAAAAAAAAAARqv1PBlyKQqU
8 1 2 ChIJAAAAAAAAAAAREvwoXLLyhU0
9 1 3 ChIJAAAAAAAAAAAR4xVxQ-iFuSc
10 2 0 ChIJAAAAAAAAAAARjhi7lioZa2Y
11 2 1 ChIJAAAAAAAAAAARqv1PBlyKQqU
12 2 2 ChIJAAAAAAAAAAAREvwoXLLyhU0
13 2 3 ChIJAAAAAAAAAAAR4xVxQ-iFuSc
14 3 0 ChIJAAAAAAAAAAARjhi7lioZa2Y
15 3 1 ChIJAAAAAAAAAAAREvwoXLLyhU0
16 3 2 ChIJAAAAAAAAAAARqv1PBlyKQqU
17 3 3 ChIJAAAAAAAAAAAR4xVxQ-iFuSc
18 4 0 ChIJAAAAAAAAAAARjhi7lioZa2Y
19 4 1 ChIJAAAAAAAAAAARCO-FF_-eZUc
20 4 2 ChIJAAAAAAAAAAAREvwoXLLyhU0
21 4 3 ChIJAAAAAAAAAAARqv1PBlyKQqU
22 4 4 ChIJAAAAAAAAAAAR4xVxQ-iFuSc
23 5 0 ChIJAAAAAAAAAAAR4xVxQ-iFuSc
24 5 1 ChIJAAAAAAAAAAARqv1PBlyKQqU
25 5 2 ChIJAAAAAAAAAAAREvwoXLLyhU0
26 5 3 ChIJAAAAAAAAAAARjhi7lioZa2Y
27 6 0 ChIJAAAAAAAAAAAR4xVxQ-iFuSc
28 6 1 ChIJAAAAAAAAAAARDpW2KdCKr_0
29 6 2 ChIJAAAAAAAAAAARlCV8K3CctEM
30 6 3 ChIJAAAAAAAAAAARFS254-AYGeQ
31 6 4 ChIJAAAAAAAAAAARYgJcSNWXRnI
32 6 5 ChIJAAAAAAAAAAARqv1PBlyKQqU
33 6 6 ChIJAAAAAAAAAAAREvwoXLLyhU0
34 6 7 ChIJAAAAAAAAAAARjhi7lioZa2Y
35 7 0 ChIJAAAAAAAAAAAR4xVxQ-iFuSc
36 7 1 ChIJAAAAAAAAAAARqv1PBlyKQqU
37 7 2 ChIJAAAAAAAAAAARyKARfrOcmkE
38 7 3 ChIJAAAAAAAAAAAREvwoXLLyhU0
39 7 4 ChIJAAAAAAAAAAARjhi7lioZa2Y
40 8 0 ChIJAAAAAAAAAAAR4xVxQ-iFuSc
41 8 1 ChIJAAAAAAAAAAARqv1PBlyKQqU
42 8 2 ChIJAAAAAAAAAAARlCV8K3CctEM
43 8 3 ChIJAAAAAAAAAAARDpW2KdCKr_0
44 8 4 ChIJAAAAAAAAAAAREvwoXLLyhU0
45 8 5 ChIJAAAAAAAAAAARjhi7lioZa2Y

View File

@@ -0,0 +1,10 @@
trip_index,startTimeMinutes,endTimeMinutes,durationMinutes,confidence,commuteDirection,waypoint_count,mode_dist_count
0,504,551,47,0.0,COMMUTE_DIRECTION_HOME_TO_WORK,4,4
1,1947,1992,45,0.0,COMMUTE_DIRECTION_HOME_TO_WORK,4,4
2,3383,3429,46,0.0,COMMUTE_DIRECTION_HOME_TO_WORK,4,4
3,4828,4875,46,0.0,COMMUTE_DIRECTION_HOME_TO_WORK,4,4
4,6276,6325,48,0.0,COMMUTE_DIRECTION_HOME_TO_WORK,5,4
5,1158,1198,40,0.0,COMMUTE_DIRECTION_WORK_TO_HOME,4,3
6,2592,2658,66,0.0,COMMUTE_DIRECTION_WORK_TO_HOME,8,3
7,4002,4063,61,0.0,COMMUTE_DIRECTION_WORK_TO_HOME,5,4
8,5514,5586,71,0.0,COMMUTE_DIRECTION_WORK_TO_HOME,6,3
1 trip_index startTimeMinutes endTimeMinutes durationMinutes confidence commuteDirection waypoint_count mode_dist_count
2 0 504 551 47 0.0 COMMUTE_DIRECTION_HOME_TO_WORK 4 4
3 1 1947 1992 45 0.0 COMMUTE_DIRECTION_HOME_TO_WORK 4 4
4 2 3383 3429 46 0.0 COMMUTE_DIRECTION_HOME_TO_WORK 4 4
5 3 4828 4875 46 0.0 COMMUTE_DIRECTION_HOME_TO_WORK 4 4
6 4 6276 6325 48 0.0 COMMUTE_DIRECTION_HOME_TO_WORK 5 4
7 5 1158 1198 40 0.0 COMMUTE_DIRECTION_WORK_TO_HOME 4 3
8 6 2592 2658 66 0.0 COMMUTE_DIRECTION_WORK_TO_HOME 8 3
9 7 4002 4063 61 0.0 COMMUTE_DIRECTION_WORK_TO_HOME 5 4
10 8 5514 5586 71 0.0 COMMUTE_DIRECTION_WORK_TO_HOME 6 3

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
mode,affinity
WALKING,0.4837758243083954
IN_TRAIN,0.2743362784385681
IN_PASSENGER_VEHICLE,0.2418879121541977
IN_SUBWAY,0.12389380484819412
CYCLING,0.06489675492048264
IN_BUS,0.014749262481927872
FLYING,0.0029498524963855743
1 mode affinity
2 WALKING 0.4837758243083954
3 IN_TRAIN 0.2743362784385681
4 IN_PASSENGER_VEHICLE 0.2418879121541977
5 IN_SUBWAY 0.12389380484819412
6 CYCLING 0.06489675492048264
7 IN_BUS 0.014749262481927872
8 FLYING 0.0029498524963855743

File diff suppressed because it is too large Load Diff