@protobase/server 0.13.4 → 0.14.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.
- package/dist/assistant/chat-completions.js +1 -1
- package/dist/assistant/conversations.js +1 -1
- package/dist/assistant/records.js +1 -1
- package/dist/batch/refs.js +1 -1
- package/dist/batch/reorder.js +1 -1
- package/dist/changes/match-events.js +2 -1
- package/dist/changes/resource-change.js +1 -1
- package/dist/check-shell.js +2 -1
- package/dist/check-views.js +1 -1
- package/dist/error-reporting/sentry-reporter.js +1 -1
- package/dist/files/limits.js +1 -1
- package/dist/files/present.js +1 -1
- package/dist/files/providers.js +1 -1
- package/dist/functions/records.js +1 -1
- package/dist/key.js +1 -1
- package/dist/meta.js +2 -1
- package/dist/reveal-service.js +1 -1
- package/dist/routes/collection.js +1 -1
- package/dist/view-access.js +1 -1
- package/dist/webhooks/route-events.js +2 -1
- package/dist/webhooks/table/plugin.js +1 -1
- package/dist/webhooks/test-event.js +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readEventStream } from "@protobase/schema";
|
|
1
|
+
import { readEventStream } from "@protobase/schema/internal";
|
|
2
2
|
//#region src/assistant/chat-completions.ts
|
|
3
3
|
/** A failed call to the model endpoint, with a message an admin can act on. */
|
|
4
4
|
var ModelError = class extends Error {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { applyAssistantEvent, emptyAssistantState } from "@protobase/schema";
|
|
1
|
+
import { applyAssistantEvent, emptyAssistantState } from "@protobase/schema/internal";
|
|
2
2
|
//#region src/assistant/conversations.ts
|
|
3
3
|
const remembered = (transcript, message, keep) => {
|
|
4
4
|
const next = [...transcript, message];
|
|
@@ -2,7 +2,7 @@ import { notFound } from "../problem.js";
|
|
|
2
2
|
import { decodeKeyText } from "../key.js";
|
|
3
3
|
import { readRecord } from "../read-service.js";
|
|
4
4
|
import { runWrite } from "../write-pipeline.js";
|
|
5
|
-
import { encodeKey } from "@protobase/schema";
|
|
5
|
+
import { encodeKey } from "@protobase/schema/internal";
|
|
6
6
|
//#region src/assistant/records.ts
|
|
7
7
|
/** `ToolRecords` over the admin's resources for `session`. */
|
|
8
8
|
const assistantRecords = (deps, session) => {
|
package/dist/batch/refs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { badRequest } from "../problem.js";
|
|
2
2
|
import { decodeKeyText } from "../key.js";
|
|
3
|
-
import { encodeKey } from "@protobase/schema";
|
|
3
|
+
import { encodeKey } from "@protobase/schema/internal";
|
|
4
4
|
//#region src/batch/refs.ts
|
|
5
5
|
const isRef = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && "$ref" in value;
|
|
6
6
|
const valueOf = (created, ref) => {
|
package/dist/batch/reorder.js
CHANGED
|
@@ -6,7 +6,7 @@ import { requireOperation, targetFilter, writableFields } from "../request-acces
|
|
|
6
6
|
import { validateBody } from "../validate-body.js";
|
|
7
7
|
import { missing, shown } from "../write-shared.js";
|
|
8
8
|
import { applyUpdate, planUpdate } from "../write-update.js";
|
|
9
|
-
import { encodeKey } from "@protobase/schema";
|
|
9
|
+
import { encodeKey } from "@protobase/schema/internal";
|
|
10
10
|
import { sql } from "kysely";
|
|
11
11
|
//#region src/batch/reorder.ts
|
|
12
12
|
const checkViolation = "23514";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { evaluateFilter } from "@protobase/schema";
|
|
2
|
+
import { checkEventFilter } from "@protobase/schema/internal";
|
|
2
3
|
//#region src/changes/match-events.ts
|
|
3
4
|
const filterOf = (model, source) => {
|
|
4
5
|
const { filter, problem } = checkEventFilter(model, source);
|
package/dist/check-shell.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { bottomBarErrors
|
|
1
|
+
import { bottomBarErrors } from "@protobase/schema";
|
|
2
|
+
import { navRecentErrors } from "@protobase/schema/internal";
|
|
2
3
|
//#region src/check-shell.ts
|
|
3
4
|
/** Fails at startup when a sidebar group or a user menu entry does not fit the resources, instead of on the first page load. */
|
|
4
5
|
const checkShell = (registry, views, userMenu, pages = []) => {
|
package/dist/check-views.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { relatedErrors } from "./view-related.js";
|
|
2
2
|
import { cardPhotosErrors } from "./view-card-photos.js";
|
|
3
3
|
import { mapDisplayErrors, mapErrors } from "./view-map.js";
|
|
4
|
-
import { addressErrors, addressPlaceholders, appHrefError, displayFields, fieldRefsIn, hrefPlaceholders } from "@protobase/schema";
|
|
4
|
+
import { addressErrors, addressPlaceholders, appHrefError, displayFields, fieldRefsIn, hrefPlaceholders } from "@protobase/schema/internal";
|
|
5
5
|
//#region src/check-views.ts
|
|
6
6
|
const linkFields = (run) => run?.kind !== "link" ? [] : "to" in run ? addressPlaceholders(run.to) : hrefPlaceholders(run.href);
|
|
7
7
|
const sensitiveErrors = (view, model) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { redactSecrets } from "@protobase/schema";
|
|
1
|
+
import { redactSecrets } from "@protobase/schema/internal";
|
|
2
2
|
import { Scope, createStackParser, createTransport, dedupeIntegration, eventFiltersIntegration, functionToStringIntegration, linkedErrorsIntegration, requestDataIntegration, winterCGRequestToRequestData } from "@sentry/core";
|
|
3
3
|
import { ServerRuntimeClient, nodeStackLineParser } from "@sentry/core/server";
|
|
4
4
|
//#region src/error-reporting/sentry-reporter.ts
|
package/dist/files/limits.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpProblem } from "../problem.js";
|
|
2
2
|
import { isFilePath } from "./uri.js";
|
|
3
|
-
import { parseSize } from "@protobase/schema";
|
|
3
|
+
import { parseSize } from "@protobase/schema/internal";
|
|
4
4
|
//#region src/files/limits.ts
|
|
5
5
|
/** How long a count of what a store holds is trusted before it is taken again. */
|
|
6
6
|
const recountMs = 3e5;
|
package/dist/files/present.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { downloadExpiry, signedDownloadUrl } from "./download-url.js";
|
|
2
2
|
import { servedType } from "./media-types.js";
|
|
3
3
|
import { parseUri, variantPaths } from "./uri.js";
|
|
4
|
-
import { encodeKey } from "@protobase/schema";
|
|
4
|
+
import { encodeKey } from "@protobase/schema/internal";
|
|
5
5
|
//#region src/files/present.ts
|
|
6
6
|
const linker = async (files, access, row, field, ref, expires) => {
|
|
7
7
|
const provider = files.providers[ref.provider];
|
package/dist/files/providers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseDuration } from "./duration.js";
|
|
2
2
|
import { localFiles } from "./local-files.js";
|
|
3
3
|
import { s3Files } from "./s3-files.js";
|
|
4
|
-
import { checkedProvider } from "@protobase/schema";
|
|
4
|
+
import { checkedProvider } from "@protobase/schema/internal";
|
|
5
5
|
//#region src/files/providers.ts
|
|
6
6
|
const prefix = "PROTOBASE_FILES_";
|
|
7
7
|
/** `PROTOBASE_FILES_<NAME>` configures a provider, except for these settings. */
|
|
@@ -3,7 +3,7 @@ import { decodeKeyText } from "../key.js";
|
|
|
3
3
|
import { runWrite } from "../write-pipeline.js";
|
|
4
4
|
import { assistantRecords } from "../assistant/records.js";
|
|
5
5
|
import { listRecords } from "../list-service.js";
|
|
6
|
-
import { encodeKey } from "@protobase/schema";
|
|
6
|
+
import { encodeKey } from "@protobase/schema/internal";
|
|
7
7
|
//#region src/functions/records.ts
|
|
8
8
|
const filterLength = 2e5;
|
|
9
9
|
/** `FunctionRecords` over the admin's resources for `session`. */
|
package/dist/key.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { badRequest } from "./problem.js";
|
|
2
|
-
import { decodeKey } from "@protobase/schema";
|
|
2
|
+
import { decodeKey } from "@protobase/schema/internal";
|
|
3
3
|
//#region src/key.ts
|
|
4
4
|
/** Decodes key text (`a,b` for composite keys, parts percent-encoded). decodeKey is a pure parser: every error it throws is a malformed key. */
|
|
5
5
|
const decodeKeyText = (entry, raw) => {
|
package/dist/meta.js
CHANGED
|
@@ -7,7 +7,8 @@ import { seesRuntime } from "./runtime/runtime-settings.js";
|
|
|
7
7
|
import { sourcesFor } from "./sources/source-settings.js";
|
|
8
8
|
import { pruneView } from "./view-access.js";
|
|
9
9
|
import { prunePage } from "@protobase/layout";
|
|
10
|
-
import {
|
|
10
|
+
import { pickView } from "@protobase/schema";
|
|
11
|
+
import { bottomBarFor } from "@protobase/schema/internal";
|
|
11
12
|
//#region src/meta.ts
|
|
12
13
|
const modelsHash = (deps) => sha256Hex(stableJson(deps.registry.entries.map((entry) => entry.model))).then((hash) => hash.slice(0, 32));
|
|
13
14
|
/**
|
package/dist/reveal-service.js
CHANGED
|
@@ -3,7 +3,7 @@ import { tenantScope } from "./tenant.js";
|
|
|
3
3
|
import { requestAccess, requireOperation } from "./request-access.js";
|
|
4
4
|
import { readTransaction } from "./transactions.js";
|
|
5
5
|
import { fetchReadable } from "./read-service.js";
|
|
6
|
-
import { encodeKey } from "@protobase/schema";
|
|
6
|
+
import { encodeKey } from "@protobase/schema/internal";
|
|
7
7
|
//#region src/reveal-service.ts
|
|
8
8
|
/**
|
|
9
9
|
* The value of one sensitive field of one record, for a caller who may read the record and the field: the same tenant,
|
|
@@ -6,7 +6,7 @@ import { uploadFile } from "../files/upload.js";
|
|
|
6
6
|
import { returnPreference } from "./preferences.js";
|
|
7
7
|
import { resolveTarget, unknownAction } from "./target.js";
|
|
8
8
|
import { Hono } from "hono";
|
|
9
|
-
import { encodeKey } from "@protobase/schema";
|
|
9
|
+
import { encodeKey } from "@protobase/schema/internal";
|
|
10
10
|
//#region src/routes/collection.ts
|
|
11
11
|
/** Filters in a JSON body may be much longer than in a URL. */
|
|
12
12
|
const searchFilterLength = 2e5;
|
package/dist/view-access.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { relatedErrors } from "./view-related.js";
|
|
2
2
|
import { cardPhotosErrors } from "./view-card-photos.js";
|
|
3
3
|
import { resolveFieldPath } from "@protobase/layout";
|
|
4
|
-
import { addressErrors, hrefPlaceholders, navRecentErrors, pruneByShape, shapes, tableDisplay } from "@protobase/schema";
|
|
4
|
+
import { addressErrors, hrefPlaceholders, navRecentErrors, pruneByShape, shapes, tableDisplay } from "@protobase/schema/internal";
|
|
5
5
|
//#region src/view-access.ts
|
|
6
6
|
const pruneRelated = (item, resource, models) => {
|
|
7
7
|
const { columns, ...rest } = item;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { eventPatternMatches } from "./subscription.js";
|
|
2
|
-
import {
|
|
2
|
+
import { evaluateFilter } from "@protobase/schema";
|
|
3
|
+
import { checkEventFilter } from "@protobase/schema/internal";
|
|
3
4
|
//#region src/webhooks/route-events.ts
|
|
4
5
|
const declaredEvents = (models) => models.flatMap((model) => (model.events ?? []).map((event) => ({
|
|
5
6
|
model,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { webhooksSchema } from "./options.js";
|
|
2
|
-
import { webhookResources } from "@protobase/schema";
|
|
2
|
+
import { webhookResources } from "@protobase/schema/internal";
|
|
3
3
|
//#region src/webhooks/table/plugin.ts
|
|
4
4
|
/**
|
|
5
5
|
* Webhook subscriptions made in the admin app: `extends: [webhooks()]` in `protobase.config.ts`. It adds the Webhook
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpProblem } from "../problem.js";
|
|
2
2
|
import { subscriberSession } from "./subscriber-view.js";
|
|
3
3
|
import { eventPatternMatches } from "./subscription.js";
|
|
4
|
-
import { encodeKey } from "@protobase/schema";
|
|
4
|
+
import { encodeKey } from "@protobase/schema/internal";
|
|
5
5
|
//#region src/webhooks/test-event.ts
|
|
6
6
|
/**
|
|
7
7
|
* What Send test event sends: the first declared event the subscription takes, made up from the newest record of its
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@better-auth/passkey": "^1.7.7",
|
|
33
|
-
"@protobase/layout": "0.
|
|
34
|
-
"@protobase/query": "0.
|
|
35
|
-
"@protobase/schema": "0.
|
|
33
|
+
"@protobase/layout": "0.14.1",
|
|
34
|
+
"@protobase/query": "0.14.1",
|
|
35
|
+
"@protobase/schema": "0.14.1",
|
|
36
36
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
37
37
|
"@sentry/core": "^11.7.0",
|
|
38
38
|
"@simplewebauthn/server": "^13.3.1",
|