@protobase/server 0.46.15 → 0.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,22 @@
1
+ import semver from "semver";
1
2
  //#region src/mobile-release/shell-update.ts
2
- const versionPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
3
- const parseVersion = (value) => {
4
- const match = versionPattern.exec(value);
5
- return match ? {
6
- major: Number(match[1]),
7
- minor: Number(match[2])
8
- } : void 0;
3
+ /** Whether `value` is an x.y.z version, as a shell's Protobase version is: a semver release, no prerelease. */
4
+ const isShellVersion = (value) => semver.valid(value) === value && semver.prerelease(value) === null;
5
+ const shellVersion = (value, whose) => {
6
+ if (!isShellVersion(value)) throw new Error(`The ${whose} Protobase version ${JSON.stringify(value)} is no x.y.z version`);
7
+ return {
8
+ major: semver.major(value),
9
+ minor: semver.minor(value)
10
+ };
9
11
  };
10
- /** Whether `value` is an x.y.z version, as a shell's Protobase version is. */
11
- const isShellVersion = (value) => parseVersion(value) !== void 0;
12
12
  /**
13
13
  * Whether a device running a shell of Protobase `shell` must update before it goes on: its shell no longer works with
14
14
  * the API of a server of Protobase `server`. It works on the same major, and below 1.0, where a minor may break, on the
15
15
  * same minor, as a bundle does on a runtime.
16
16
  */
17
17
  const shellUpdateRequired = (shell, server) => {
18
- const own = parseVersion(server);
19
- if (!own) throw new Error(`The server's own Protobase version ${JSON.stringify(server)} is no x.y.z version`);
20
- const running = parseVersion(shell);
21
- if (!running) throw new Error(`The shell's Protobase version ${JSON.stringify(shell)} is no x.y.z version`);
18
+ const own = shellVersion(server, "server's own");
19
+ const running = shellVersion(shell, "shell's");
22
20
  return running.major !== own.major || own.major === 0 && running.minor !== own.minor;
23
21
  };
24
22
  //#endregion
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.46.15";
2
+ var version = "0.47.1";
3
3
  //#endregion
4
4
  export { version };
@@ -0,0 +1,3 @@
1
+ import { vapidPrivateKeyVariable, vapidPublicKeyVariable, vapidSubjectVariable } from "./notifications/web-push/vapid-settings.js";
2
+ import { generateVapidKeys } from "./notifications/web-push/keys.js";
3
+ export { generateVapidKeys, vapidPrivateKeyVariable, vapidPublicKeyVariable, vapidSubjectVariable };
package/dist/vapid.js ADDED
@@ -0,0 +1,3 @@
1
+ import { generateVapidKeys } from "./notifications/web-push/keys.js";
2
+ import { vapidPrivateKeyVariable, vapidPublicKeyVariable, vapidSubjectVariable } from "./notifications/web-push/vapid-settings.js";
3
+ export { generateVapidKeys, vapidPrivateKeyVariable, vapidPublicKeyVariable, vapidSubjectVariable };
@@ -1,31 +1,10 @@
1
+ import { pngIcons } from "@protobase/schema/png-icons";
1
2
  //#region src/web-app/app-icons.d.ts
2
- /**
3
- * The PNG icons a project may put beside its `protobase.favicon.svg`, for platforms that take no SVG, each square at
4
- * `size` pixels and answered on the app's own origin at `/<file>`: Android's 192 and 512 pixel icons, a 512 pixel
5
- * maskable one whose mark keeps to the middle 80%, and the 180 pixel Apple touch icon an iPhone home screen shows.
6
- */
7
- export declare const pngIcons: {
8
- readonly icon192: {
9
- readonly file: "protobase.icon-192.png";
10
- readonly size: 192;
11
- };
12
- readonly icon512: {
13
- readonly file: "protobase.icon-512.png";
14
- readonly size: 512;
15
- };
16
- readonly maskable: {
17
- readonly file: "protobase.icon-maskable.png";
18
- readonly size: 512;
19
- };
20
- readonly appleTouch: {
21
- readonly file: "protobase.apple-touch-icon.png";
22
- readonly size: 180;
23
- };
24
- };
25
3
  export type PngIcon = keyof typeof pngIcons;
26
4
  /** The icons a project has of its own: `favicon` when the favicon is its own rather than Protobase's, and its PNGs. */
27
5
  export type AppIcons = {
28
6
  favicon: boolean;
29
7
  png: PngIcon[];
30
8
  };
31
- //#endregion
9
+ //#endregion
10
+ export { pngIcons };
@@ -1,26 +1,2 @@
1
- //#region src/web-app/app-icons.ts
2
- /**
3
- * The PNG icons a project may put beside its `protobase.favicon.svg`, for platforms that take no SVG, each square at
4
- * `size` pixels and answered on the app's own origin at `/<file>`: Android's 192 and 512 pixel icons, a 512 pixel
5
- * maskable one whose mark keeps to the middle 80%, and the 180 pixel Apple touch icon an iPhone home screen shows.
6
- */
7
- const pngIcons = {
8
- icon192: {
9
- file: "protobase.icon-192.png",
10
- size: 192
11
- },
12
- icon512: {
13
- file: "protobase.icon-512.png",
14
- size: 512
15
- },
16
- maskable: {
17
- file: "protobase.icon-maskable.png",
18
- size: 512
19
- },
20
- appleTouch: {
21
- file: "protobase.apple-touch-icon.png",
22
- size: 180
23
- }
24
- };
25
- //#endregion
1
+ import { pngIcons } from "@protobase/schema/png-icons";
26
2
  export { pngIcons };
@@ -1,3 +1,4 @@
1
+ import "./app-icons.js";
1
2
  import { Hono } from "hono";
2
3
  //#region src/web-app/web-manifest-route.d.ts
3
4
  /** The path under the system path (`/api`) the admin app's page links its manifest at. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/server",
3
- "version": "0.46.15",
3
+ "version": "0.47.1",
4
4
  "description": "The Protobase REST API as a Hono app, with Better Auth sign-in.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -16,7 +16,8 @@
16
16
  },
17
17
  "exports": {
18
18
  ".": "./dist/index.js",
19
- "./email": "./dist/email.js"
19
+ "./email": "./dist/email.js",
20
+ "./vapid": "./dist/vapid.js"
20
21
  },
21
22
  "types": "./dist/index.d.ts",
22
23
  "files": [
@@ -36,9 +37,9 @@
36
37
  "@better-auth/passkey": "^1.7.12",
37
38
  "@better-auth/sso": "^1.7.12",
38
39
  "@modelcontextprotocol/server": "^2.3.1",
39
- "@protobase/layout": "0.46.15",
40
- "@protobase/query": "0.46.15",
41
- "@protobase/schema": "0.46.15",
40
+ "@protobase/layout": "0.47.1",
41
+ "@protobase/query": "0.47.1",
42
+ "@protobase/schema": "0.47.1",
42
43
  "@react-email/render": "^2.1.0",
43
44
  "@scalar/hono-api-reference": "^0.12.10",
44
45
  "@sentry/core": "^11.7.0",
@@ -58,6 +59,7 @@
58
59
  "react": "^19.3.0",
59
60
  "react-dom": "^19.3.0",
60
61
  "react-email": "^6.11.1",
62
+ "semver": "^7.8.5",
61
63
  "thumbhash": "^0.1.1",
62
64
  "zod": "^4.6.5"
63
65
  },
@@ -73,6 +75,7 @@
73
75
  "@hono/node-server": "^2.1.3",
74
76
  "@supabase/ssr": "^0.12.7",
75
77
  "@supabase/supabase-js": "^2.118.0",
78
+ "@types/semver": "^7.8.0",
76
79
  "@types/ws": "^8.18.2",
77
80
  "samlify": "^2.13.1",
78
81
  "ws": "^8.22.0"