@protobase/server 0.13.3 → 0.14.0
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/files/store-file.d.ts +22 -0
- package/dist/files/store-file.js +14 -0
- package/dist/functions/records.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -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. */
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FilesOptions } from "./options.js";
|
|
2
|
+
//#region src/files/store-file.d.ts
|
|
3
|
+
export type StoreFileInput = {
|
|
4
|
+
/** The provider's name, as a stored value starts with it: `public` in `public:listings/house-1.png`. */
|
|
5
|
+
provider: string;
|
|
6
|
+
/** The path in the provider, such as `listings/house-1.png`. */
|
|
7
|
+
path: string;
|
|
8
|
+
body: Uint8Array | ReadableStream<Uint8Array>;
|
|
9
|
+
/** `files` from `protobase.config.ts`, when it configures providers; the environment's apply on top, as for the server. */
|
|
10
|
+
files?: FilesOptions;
|
|
11
|
+
/** Where `PROTOBASE_FILES_<NAME>` and the credentials are read from, usually `process.env`. */
|
|
12
|
+
env: Record<string, string | undefined>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Writes a file into one of the app's providers outside a request, such as from a seed: the folder of a `file:`
|
|
16
|
+
* provider, the bucket of an `s3:` one, resolved as the server resolves them (`PROTOBASE_FILES_<NAME>`, else the
|
|
17
|
+
* config's, else `data/files/<name>` for `private` and `public`). A relative folder is taken from the working directory.
|
|
18
|
+
*/
|
|
19
|
+
export declare const storeFile: ({ provider, path, body, files, env }: StoreFileInput) => Promise<{
|
|
20
|
+
size: number;
|
|
21
|
+
}>;
|
|
22
|
+
//#endregion
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolveProviders } from "./providers.js";
|
|
2
|
+
//#region src/files/store-file.ts
|
|
3
|
+
/**
|
|
4
|
+
* Writes a file into one of the app's providers outside a request, such as from a seed: the folder of a `file:`
|
|
5
|
+
* provider, the bucket of an `s3:` one, resolved as the server resolves them (`PROTOBASE_FILES_<NAME>`, else the
|
|
6
|
+
* config's, else `data/files/<name>` for `private` and `public`). A relative folder is taken from the working directory.
|
|
7
|
+
*/
|
|
8
|
+
const storeFile = async ({ provider, path, body, files = {}, env }) => {
|
|
9
|
+
const providers = resolveProviders(files, env, [provider]);
|
|
10
|
+
const stream = body instanceof ReadableStream ? body : new Blob([body]).stream();
|
|
11
|
+
return providers[provider].store.put(path, stream);
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { storeFile };
|
|
@@ -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/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ import { SignatureOptions, StandardWebhookOptions, verifySignature, verifyStanda
|
|
|
70
70
|
import { requireEnv } from "./functions/require-env.js";
|
|
71
71
|
import { FileLimits, limitedFileStore } from "./files/limits.js";
|
|
72
72
|
import { LocalFilesOptions, localFileStore, localFiles } from "./files/local-files.js";
|
|
73
|
+
import { StoreFileInput, storeFile } from "./files/store-file.js";
|
|
73
74
|
import { S3Bucket, S3FilesOptions, S3ListPage, S3Object, s3FileStore, s3Files } from "./files/s3-files.js";
|
|
74
75
|
import { FileCleanupInput, createFileCleanup } from "./files/file-cleanup.js";
|
|
75
76
|
import { FileObject, FileVariantObject } from "./files/present.js";
|
|
@@ -80,4 +81,4 @@ import { FatalJobError } from "./jobs/run-job.js";
|
|
|
80
81
|
import { DrainResult, JobsRuntime, StartJobsOptions, startJobs } from "./jobs/runtime.js";
|
|
81
82
|
import { jobsDrainApp } from "./jobs/drain-route.js";
|
|
82
83
|
import { checkJobsSchema, jobsSchema, jobsSchemaMigration } from "./jobs/schema.js";
|
|
83
|
-
export { type Admin, type AdminAuth, type AdminOptions, type ApiFunction, type ApprovalAnswer, type ApprovalRequest, type AssistantBackend, type AssistantOptions, type AssistantSettings, type AssistantTool, type AuditEvent, type AuditQueue, type Authenticator, type BetterAuthAuthenticatorOptions, type CapturedRow, type ChatMessage, type ChatTextPart, type CleanupEntry, type CleanupReport, type CleanupSchedule, type CoalescedChange, type Completion, type CompletionOptions, type Conversation, type ConversationRecord, type ConversationStore, type ConversationsOptions, type CorsOptions, type CorsOrigins, type CreateAdminInput, type CreateAuthOptions, type DrainResult, type EnqueueOptions, type ErrorReporter, type ErrorReportingOptions, type ErrorReportingSettings, type EventData, type EventsOptions, FatalJobError, type FileCleanupInput, type FileLimits, type FileObject, type FileProvider, type FileRef, type FileStore, type FileVariantObject, type FilesOptions, type FunctionApp, type FunctionCaller, type FunctionContext, type FunctionEnv, type FunctionHandler, type FunctionOptions, type FunctionRecords, type FunctionSource, HttpProblem, type IssueTokenOptions, type JobContext, type JobDefinition, type JobOptions, type JobsRuntime, type JwtOptions, type LinkedAccount, type ListParams, type LocalFilesOptions, type MailMessage, type Mailer, type MapOptions, type MemberInput, MissingCredentials, ModelError, type ModelSettings, type NewOrganization, type NewUser, type OperatorProvider, type OrganizationRole, type OrganizationsOptions, type PipelineHook, type PlatformSignIn, type PluginOption, type PluginRef, type ProjectConfig, type ProtectedFunctionOptions, type PublicFunctionContext, type PublicFunctionEnv, type PublicFunctionHandler, type PublicFunctionOptions, type QueryOptions, type QueryResult, type ReasoningDetail, type ReasoningEffort, type RecordKeyInput, type RecordPage, type ResourceChange, type ResourceSource, type RoleDefinition, type RolesInput, type RunContext, type RuntimeOptions, type S3Bucket, type S3FilesOptions, type S3ListPage, type S3Object, type ScanGuardMode, type ScheduledDelete, type Session, type SessionOrganization, type Sharp, type SignInPolicy, type SignInRule, type SignatureOptions, type SourceOption, type SourceRef, type StaffAccessRule, type StaffSignIn, type StandardSchema, type StandardWebhookOptions, type StartJobsOptions, type StoredMember, type StoredObject, type StoredOrganization, type StoredUser, type SubscriptionDefinition, type SubscriptionEvent, type SubscriptionOptions, type TenantValue, type ToolCall, type ToolContext, type ToolRecord, type ToolRecords, type ToolSpec, type TrustedApp, type TurnOptions, type User, type UserCreatedHook, type ViewSource, type WebhooksOptions, type WidgetOptions, type WriteEvent, type WriteOperation, addAppRoleToOwners, addMember, aspectRatio, assistantProtocolRoutes, assistantRoles, assistantSettings, assistantVariables, authSchemaMigration, badRequest, betterAuthAuthenticator, changesMigration, checkAuthSchema, checkChanges, checkJobsSchema, checkSourceNames, checkWebhooksSchema, coalesce, configExports, consoleAuditQueue, conversationKey, createAdmin, createAuth, createConversations, createFileCleanup, createOrganization, createUser, defaultSignInPolicy, defineConfig, defineFunction, defineJob, defineTool, deleteUser, errorReportingSettings, errorReportingVariable, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, formatUri, functionApp, hasUsers, imageSize, isJobDefinition, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, limitedFileStore, listOrganizations, listUsers, localFileStore, localFiles, mapStyleUrl, mapStyleVariable, maxTokenTtlSeconds, maxWidgetPropsBytes, mergeConfig, migrationCommand, newWebhookSecret, normalizeRoles, notFound, parseColumns, parseRoles, pluginOptions, pluginsFor, pluginsVariable, processor, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readWriteQueryTool, recordOf, removeMember, renderVariant, requestApproval, requireEnv, resourceChange, roleChoices, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, s3FileStore, s3Files, seesAssistant, seesRuntime, setMemberRoles, setUserBanned, setUserRole, signInPolicyMethods, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, streamChatCompletion, subscription, thumbHash, unauthorized, variantPath, verifySignature, verifyStandardWebhook, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps };
|
|
84
|
+
export { type Admin, type AdminAuth, type AdminOptions, type ApiFunction, type ApprovalAnswer, type ApprovalRequest, type AssistantBackend, type AssistantOptions, type AssistantSettings, type AssistantTool, type AuditEvent, type AuditQueue, type Authenticator, type BetterAuthAuthenticatorOptions, type CapturedRow, type ChatMessage, type ChatTextPart, type CleanupEntry, type CleanupReport, type CleanupSchedule, type CoalescedChange, type Completion, type CompletionOptions, type Conversation, type ConversationRecord, type ConversationStore, type ConversationsOptions, type CorsOptions, type CorsOrigins, type CreateAdminInput, type CreateAuthOptions, type DrainResult, type EnqueueOptions, type ErrorReporter, type ErrorReportingOptions, type ErrorReportingSettings, type EventData, type EventsOptions, FatalJobError, type FileCleanupInput, type FileLimits, type FileObject, type FileProvider, type FileRef, type FileStore, type FileVariantObject, type FilesOptions, type FunctionApp, type FunctionCaller, type FunctionContext, type FunctionEnv, type FunctionHandler, type FunctionOptions, type FunctionRecords, type FunctionSource, HttpProblem, type IssueTokenOptions, type JobContext, type JobDefinition, type JobOptions, type JobsRuntime, type JwtOptions, type LinkedAccount, type ListParams, type LocalFilesOptions, type MailMessage, type Mailer, type MapOptions, type MemberInput, MissingCredentials, ModelError, type ModelSettings, type NewOrganization, type NewUser, type OperatorProvider, type OrganizationRole, type OrganizationsOptions, type PipelineHook, type PlatformSignIn, type PluginOption, type PluginRef, type ProjectConfig, type ProtectedFunctionOptions, type PublicFunctionContext, type PublicFunctionEnv, type PublicFunctionHandler, type PublicFunctionOptions, type QueryOptions, type QueryResult, type ReasoningDetail, type ReasoningEffort, type RecordKeyInput, type RecordPage, type ResourceChange, type ResourceSource, type RoleDefinition, type RolesInput, type RunContext, type RuntimeOptions, type S3Bucket, type S3FilesOptions, type S3ListPage, type S3Object, type ScanGuardMode, type ScheduledDelete, type Session, type SessionOrganization, type Sharp, type SignInPolicy, type SignInRule, type SignatureOptions, type SourceOption, type SourceRef, type StaffAccessRule, type StaffSignIn, type StandardSchema, type StandardWebhookOptions, type StartJobsOptions, type StoreFileInput, type StoredMember, type StoredObject, type StoredOrganization, type StoredUser, type SubscriptionDefinition, type SubscriptionEvent, type SubscriptionOptions, type TenantValue, type ToolCall, type ToolContext, type ToolRecord, type ToolRecords, type ToolSpec, type TrustedApp, type TurnOptions, type User, type UserCreatedHook, type ViewSource, type WebhooksOptions, type WidgetOptions, type WriteEvent, type WriteOperation, addAppRoleToOwners, addMember, aspectRatio, assistantProtocolRoutes, assistantRoles, assistantSettings, assistantVariables, authSchemaMigration, badRequest, betterAuthAuthenticator, changesMigration, checkAuthSchema, checkChanges, checkJobsSchema, checkSourceNames, checkWebhooksSchema, coalesce, configExports, consoleAuditQueue, conversationKey, createAdmin, createAuth, createConversations, createFileCleanup, createOrganization, createUser, defaultSignInPolicy, defineConfig, defineFunction, defineJob, defineTool, deleteUser, errorReportingSettings, errorReportingVariable, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, formatUri, functionApp, hasUsers, imageSize, isJobDefinition, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, limitedFileStore, listOrganizations, listUsers, localFileStore, localFiles, mapStyleUrl, mapStyleVariable, maxTokenTtlSeconds, maxWidgetPropsBytes, mergeConfig, migrationCommand, newWebhookSecret, normalizeRoles, notFound, parseColumns, parseRoles, pluginOptions, pluginsFor, pluginsVariable, processor, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readWriteQueryTool, recordOf, removeMember, renderVariant, requestApproval, requireEnv, resourceChange, roleChoices, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, s3FileStore, s3Files, seesAssistant, seesRuntime, setMemberRoles, setUserBanned, setUserRole, signInPolicyMethods, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, storeFile, streamChatCompletion, subscription, thumbHash, unauthorized, variantPath, verifySignature, verifyStandardWebhook, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps };
|
package/dist/index.js
CHANGED
|
@@ -57,8 +57,9 @@ import { functionApp } from "./functions/function-app.js";
|
|
|
57
57
|
import { readJson } from "./functions/read-json.js";
|
|
58
58
|
import { verifySignature, verifyStandardWebhook } from "./functions/verify-signature.js";
|
|
59
59
|
import { requireEnv } from "./functions/require-env.js";
|
|
60
|
+
import { storeFile } from "./files/store-file.js";
|
|
60
61
|
import { createFileCleanup } from "./files/file-cleanup.js";
|
|
61
62
|
import { aspectRatio, fileSize, fileType, imageSize, processor } from "./files/processors.js";
|
|
62
63
|
import { startJobs } from "./jobs/runtime.js";
|
|
63
64
|
import { jobsDrainApp } from "./jobs/drain-route.js";
|
|
64
|
-
export { FatalJobError, HttpProblem, MissingCredentials, ModelError, addAppRoleToOwners, addMember, aspectRatio, assistantProtocolRoutes, assistantRoles, assistantSettings, assistantVariables, authSchemaMigration, badRequest, betterAuthAuthenticator, changesMigration, checkAuthSchema, checkChanges, checkJobsSchema, checkSourceNames, checkWebhooksSchema, coalesce, configExports, consoleAuditQueue, conversationKey, createAdmin, createAuth, createConversations, createFileCleanup, createOrganization, createUser, defaultSignInPolicy, defineConfig, defineFunction, defineJob, defineTool, deleteUser, errorReportingSettings, errorReportingVariable, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, formatUri, functionApp, hasUsers, imageSize, isJobDefinition, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, limitedFileStore, listOrganizations, listUsers, localFileStore, localFiles, mapStyleUrl, mapStyleVariable, maxTokenTtlSeconds, maxWidgetPropsBytes, mergeConfig, migrationCommand, newWebhookSecret, normalizeRoles, notFound, parseColumns, parseRoles, pluginOptions, pluginsFor, pluginsVariable, processor, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readWriteQueryTool, recordOf, removeMember, renderVariant, requestApproval, requireEnv, resourceChange, roleChoices, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, s3FileStore, s3Files, seesAssistant, seesRuntime, setMemberRoles, setUserBanned, setUserRole, signInPolicyMethods, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, streamChatCompletion, subscription, thumbHash, unauthorized, variantPath, verifySignature, verifyStandardWebhook, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps };
|
|
65
|
+
export { FatalJobError, HttpProblem, MissingCredentials, ModelError, addAppRoleToOwners, addMember, aspectRatio, assistantProtocolRoutes, assistantRoles, assistantSettings, assistantVariables, authSchemaMigration, badRequest, betterAuthAuthenticator, changesMigration, checkAuthSchema, checkChanges, checkJobsSchema, checkSourceNames, checkWebhooksSchema, coalesce, configExports, consoleAuditQueue, conversationKey, createAdmin, createAuth, createConversations, createFileCleanup, createOrganization, createUser, defaultSignInPolicy, defineConfig, defineFunction, defineJob, defineTool, deleteUser, errorReportingSettings, errorReportingVariable, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, formatUri, functionApp, hasUsers, imageSize, isJobDefinition, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, limitedFileStore, listOrganizations, listUsers, localFileStore, localFiles, mapStyleUrl, mapStyleVariable, maxTokenTtlSeconds, maxWidgetPropsBytes, mergeConfig, migrationCommand, newWebhookSecret, normalizeRoles, notFound, parseColumns, parseRoles, pluginOptions, pluginsFor, pluginsVariable, processor, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readWriteQueryTool, recordOf, removeMember, renderVariant, requestApproval, requireEnv, resourceChange, roleChoices, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, s3FileStore, s3Files, seesAssistant, seesRuntime, setMemberRoles, setUserBanned, setUserRole, signInPolicyMethods, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, storeFile, streamChatCompletion, subscription, thumbHash, unauthorized, variantPath, verifySignature, verifyStandardWebhook, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps };
|
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.0",
|
|
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.0",
|
|
34
|
+
"@protobase/query": "0.14.0",
|
|
35
|
+
"@protobase/schema": "0.14.0",
|
|
36
36
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
37
37
|
"@sentry/core": "^11.7.0",
|
|
38
38
|
"@simplewebauthn/server": "^13.3.1",
|