@protobase/server 0.12.4 → 0.12.6

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,4 +1,5 @@
1
1
  import { AuditQueue, PipelineHook, ScanGuardMode } from "./types.js";
2
+ import { ErrorReportingOptions } from "./error-reporting/error-reporting-settings.js";
2
3
  import { PluginOption } from "./plugins/plugin-settings.js";
3
4
  import { SourceOption } from "./sources/source-settings.js";
4
5
  import { CorsOrigins } from "./api-cors.js";
@@ -28,8 +29,13 @@ export type AdminOptions = {
28
29
  };
29
30
  /** Receives an event for every reveal of a sensitive field. Default: printed to the console, nothing kept. */
30
31
  audit?: AuditQueue;
31
- /** Called with every error the API turns into a 500, so the host can report it. */
32
- onUnhandledError?: (error: unknown) => void;
32
+ /** Called with every error the API turns into a 500, and the request it failed, so the host can report it. */
33
+ onUnhandledError?: (error: unknown, request?: Request) => void;
34
+ /**
35
+ * Where the app's errors go: the server's 500s and crashes, and the admin app's errors in the browser (see
36
+ * `ErrorReportingOptions`). Defaults to the DSN the platform passes in `PROTOBASE_SENTRY_DSN`; `false` turns it off.
37
+ */
38
+ errorReporting?: ErrorReportingOptions | false;
33
39
  /** The assistant in the admin app's dock: a backend elsewhere or the built-in one (see `AssistantOptions`); `false` turns it off. */
34
40
  assistant?: AssistantOptions | false;
35
41
  /**
@@ -16,6 +16,7 @@ import { webhookTable } from "./webhooks/table/webhook-table.js";
16
16
  import { subscriptionWriteCheck } from "./webhooks/table/validate-hook.js";
17
17
  import { checkBottomBars, checkShell } from "./check-shell.js";
18
18
  import { checkViews } from "./check-views.js";
19
+ import { errorReportingSettings } from "./error-reporting/error-reporting-settings.js";
19
20
  import { createFilesRuntime } from "./files/runtime.js";
20
21
  import { fileRoutes } from "./files/routes.js";
21
22
  import { functionRoutes } from "./functions/routes.js";
@@ -60,6 +61,7 @@ const createAdmin = ({ resources: appResources, views: appViews = [], pages = []
60
61
  const systemPath = basePath.slice(0, basePath.lastIndexOf("/"));
61
62
  const assistant = assistantSettings(options.assistant, globalThis.process?.env ?? {});
62
63
  const runtime = runtimeUrl(options.runtime, globalThis.process?.env ?? {});
64
+ const errorReporting = errorReportingSettings(options.errorReporting, globalThis.process?.env ?? {});
63
65
  const plugins = pluginOptions(options.plugins, globalThis.process?.env ?? {}, bundlePlugins);
64
66
  const sources = sourceOptions(options.sources, globalThis.process?.env ?? {});
65
67
  checkSourceNames(sources, {
@@ -93,6 +95,7 @@ const createAdmin = ({ resources: appResources, views: appViews = [], pages = []
93
95
  rowPermissions: (resource) => typeof options.rowPermissions === "object" ? !options.rowPermissions.except.includes(resource) : options.rowPermissions !== false,
94
96
  ...assistant && { assistant: assistant.kind === "external" ? assistant.url : `${systemPath}/assistant` },
95
97
  ...runtime && { runtime },
98
+ ...errorReporting && { errorReporting },
96
99
  plugins,
97
100
  sources,
98
101
  ...files && { files },
@@ -37,7 +37,7 @@ const problemOf = (error) => error instanceof HttpProblem ? error : error instan
37
37
  const createErrorHandler = (onUnhandledError) => (error, c) => {
38
38
  const known = problemOf(error);
39
39
  if (known) return problemResponse(known, c.req.path);
40
- onUnhandledError?.(error);
40
+ onUnhandledError?.(error, c.req.raw);
41
41
  return problemResponse(new HttpProblem(500, "internal-error", titles[500], "The server failed to handle the request"), c.req.path);
42
42
  };
43
43
  //#endregion
@@ -0,0 +1,7 @@
1
+ import { ErrorReportingSettings } from "./error-reporting-settings.js";
2
+ import { ErrorReporter } from "./sentry-reporter.js";
3
+ //#region src/error-reporting/error-reporter.d.ts
4
+ /** A reporter to the tracker of `settings`. The Sentry client loads only here, so an app without a DSN never loads it. */
5
+ export declare const startErrorReporting: (settings: ErrorReportingSettings) => Promise<ErrorReporter>;
6
+ //#endregion
7
+ export type { ErrorReporter };
@@ -0,0 +1,5 @@
1
+ //#region src/error-reporting/error-reporter.ts
2
+ /** A reporter to the tracker of `settings`. The Sentry client loads only here, so an app without a DSN never loads it. */
3
+ const startErrorReporting = async (settings) => (await import("./sentry-reporter.js")).sentryReporter(settings);
4
+ //#endregion
5
+ export { startErrorReporting };
@@ -0,0 +1,22 @@
1
+ //#region src/error-reporting/error-reporting-settings.d.ts
2
+ /**
3
+ * `dsn`: where the app's errors go, the DSN of a project in Sentry or a tracker that speaks its protocol (Bugsink,
4
+ * GlitchTip, ...). Falls back to `PROTOBASE_SENTRY_DSN`. `environment` names the deployment in the tracker; the
5
+ * tracker's own default (`production`) without it.
6
+ */
7
+ export type ErrorReportingOptions = {
8
+ dsn?: string;
9
+ environment?: string;
10
+ };
11
+ /** Error reporting that is on: the server's and the admin app's errors go to `dsn`. */
12
+ export type ErrorReportingSettings = {
13
+ dsn: string;
14
+ environment?: string;
15
+ };
16
+ export declare const errorReportingVariable = "PROTOBASE_SENTRY_DSN";
17
+ /**
18
+ * The error reporting settings, when a DSN is set and the option is not `false`; off otherwise. A DSN that is no
19
+ * http(s) URL with a public key and a project id stops the server at startup, without printing the DSN.
20
+ */
21
+ export declare const errorReportingSettings: (option: ErrorReportingOptions | false | undefined, env: Record<string, string | undefined>) => ErrorReportingSettings | undefined;
22
+ //#endregion
@@ -0,0 +1,23 @@
1
+ import { checkedUrl } from "../checked-url.js";
2
+ //#region src/error-reporting/error-reporting-settings.ts
3
+ const errorReportingVariable = "PROTOBASE_SENTRY_DSN";
4
+ /**
5
+ * The error reporting settings, when a DSN is set and the option is not `false`; off otherwise. A DSN that is no
6
+ * http(s) URL with a public key and a project id stops the server at startup, without printing the DSN.
7
+ */
8
+ const errorReportingSettings = (option, env) => {
9
+ if (option === false) return void 0;
10
+ const dsn = (option?.dsn ?? env["PROTOBASE_SENTRY_DSN"])?.trim();
11
+ if (!dsn) return void 0;
12
+ const source = option?.dsn === void 0 ? errorReportingVariable : "options.errorReporting.dsn";
13
+ const url = new URL(checkedUrl(dsn, source));
14
+ if (!url.username) throw new Error(`${source} has no public key; copy the DSN from the project's settings in the error tracker`);
15
+ if (!/\/\d+$/.test(url.pathname)) throw new Error(`${source} does not end with a project id; copy the DSN from the project's settings in the error tracker`);
16
+ const environment = option?.environment?.trim();
17
+ return {
18
+ dsn,
19
+ ...environment && { environment }
20
+ };
21
+ };
22
+ //#endregion
23
+ export { errorReportingSettings, errorReportingVariable };
@@ -0,0 +1,8 @@
1
+ //#region src/error-reporting/sentry-reporter.d.ts
2
+ /** Sends errors to the error tracker. `request`: the one being handled when the error happened, without its secrets. */
3
+ export type ErrorReporter = {
4
+ report: (error: unknown, request?: Request) => void;
5
+ /** Waits until every error reported so far is sent, or `timeoutMs` passed: false then. */
6
+ flush: (timeoutMs: number) => Promise<boolean>;
7
+ };
8
+ //#endregion
@@ -0,0 +1,66 @@
1
+ import { redactSecrets } from "@protobase/schema";
2
+ import { Scope, createStackParser, createTransport, dedupeIntegration, eventFiltersIntegration, functionToStringIntegration, linkedErrorsIntegration, requestDataIntegration, winterCGRequestToRequestData } from "@sentry/core";
3
+ import { ServerRuntimeClient, nodeStackLineParser } from "@sentry/core/server";
4
+ //#region src/error-reporting/sentry-reporter.ts
5
+ const fetchTransport = (options) => createTransport(options, async ({ body }) => {
6
+ const response = await fetch(options.url, {
7
+ method: "POST",
8
+ body,
9
+ ...options.headers && { headers: options.headers }
10
+ });
11
+ await response.body?.cancel();
12
+ return {
13
+ statusCode: response.status,
14
+ headers: {
15
+ "x-sentry-rate-limits": response.headers.get("X-Sentry-Rate-Limits"),
16
+ "retry-after": response.headers.get("Retry-After")
17
+ }
18
+ };
19
+ });
20
+ const runtime = () => {
21
+ const bun = globalThis.Bun;
22
+ return bun ? {
23
+ name: "bun",
24
+ version: bun.version
25
+ } : {
26
+ name: "node",
27
+ version: globalThis.process?.version
28
+ };
29
+ };
30
+ /**
31
+ * A reporter on Sentry's runtime-neutral client: errors only, with no performance tracing and no instrumentation of
32
+ * the process, every event without its secrets (see `redactSecrets`).
33
+ */
34
+ const sentryReporter = ({ dsn, environment }) => {
35
+ const client = new ServerRuntimeClient({
36
+ dsn,
37
+ ...environment && { environment },
38
+ platform: "node",
39
+ runtime: runtime(),
40
+ traceLifecycle: "static",
41
+ stackParser: createStackParser(nodeStackLineParser()),
42
+ integrations: [
43
+ eventFiltersIntegration(),
44
+ functionToStringIntegration(),
45
+ linkedErrorsIntegration(),
46
+ dedupeIntegration(),
47
+ requestDataIntegration()
48
+ ],
49
+ transport: fetchTransport,
50
+ beforeSend: (event) => redactSecrets(event)
51
+ });
52
+ client.init();
53
+ return {
54
+ report: (error, request) => {
55
+ const scope = new Scope();
56
+ if (request) scope.setSDKProcessingMetadata({ normalizedRequest: winterCGRequestToRequestData(request) });
57
+ client.captureException(error, { mechanism: {
58
+ type: "protobase",
59
+ handled: false
60
+ } }, scope);
61
+ },
62
+ flush: async (timeoutMs) => client.flush(timeoutMs)
63
+ };
64
+ };
65
+ //#endregion
66
+ export { sentryReporter };
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ import { WebhooksOptions } from "./webhooks/table/options.js";
14
14
  import { EventData, RunContext, SubscriptionDefinition, SubscriptionEvent, SubscriptionOptions, subscription } from "./webhooks/subscription.js";
15
15
  import { FileProvider, FileStore, StoredObject } from "./files/store.js";
16
16
  import { FilesOptions } from "./files/options.js";
17
+ import { ErrorReportingOptions, ErrorReportingSettings, errorReportingSettings, errorReportingVariable } from "./error-reporting/error-reporting-settings.js";
17
18
  import { CleanupEntry, CleanupSchedule, ScheduledDelete, storageCleanupSchedule } from "./files/cleanup-schedule.js";
18
19
  import { CleanupReport } from "./files/cleanup-runner.js";
19
20
  import { PluginOption, PluginRef, pluginOptions, pluginsFor, pluginsVariable } from "./plugins/plugin-settings.js";
@@ -59,6 +60,8 @@ import { TurnOptions, runTurn } from "./assistant/turn.js";
59
60
  import { WidgetOptions, maxWidgetPropsBytes, widget } from "./assistant/widget.js";
60
61
  import { QueryOptions, QueryResult, runReadOnlyQuery, runReadWriteQuery } from "./assistant/run-query.js";
61
62
  import { readOnlyQueryTool, readWriteQueryTool } from "./assistant/query-tools.js";
63
+ import { ErrorReporter } from "./error-reporting/sentry-reporter.js";
64
+ import { startErrorReporting } from "./error-reporting/error-reporter.js";
62
65
  import { FunctionEnv, PublicFunctionEnv, functionApp } from "./functions/function-app.js";
63
66
  import { SignatureOptions, StandardWebhookOptions, verifySignature, verifyStandardWebhook } from "./functions/verify-signature.js";
64
67
  import { requireEnv } from "./functions/require-env.js";
@@ -71,4 +74,4 @@ import { FatalJobError } from "./jobs/run-job.js";
71
74
  import { DrainResult, JobsRuntime, StartJobsOptions, startJobs } from "./jobs/runtime.js";
72
75
  import { jobsDrainApp } from "./jobs/drain-route.js";
73
76
  import { checkJobsSchema, jobsSchema, jobsSchemaMigration } from "./jobs/schema.js";
74
- 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 EventData, type EventsOptions, FatalJobError, type FileCleanupInput, type FileObject, type FileProvider, type FileStore, 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 MemberInput, 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 ScanGuardMode, type ScheduledDelete, type Session, type SessionOrganization, 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, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, functionApp, hasUsers, imageSize, isJobDefinition, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, listOrganizations, listUsers, localFileStore, localFiles, maxTokenTtlSeconds, maxWidgetPropsBytes, mergeConfig, migrationCommand, newWebhookSecret, normalizeRoles, notFound, parseColumns, parseRoles, pluginOptions, pluginsFor, pluginsVariable, processor, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readWriteQueryTool, recordOf, removeMember, requestApproval, requireEnv, resourceChange, roleChoices, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, seesAssistant, seesRuntime, setMemberRoles, setUserBanned, setUserRole, signInPolicyMethods, sourceOptions, sourcesFor, sourcesVariable, startJobs, storageCleanupSchedule, streamChatCompletion, subscription, unauthorized, verifySignature, verifyStandardWebhook, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps };
77
+ 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 FileObject, type FileProvider, type FileStore, 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 MemberInput, 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 ScanGuardMode, type ScheduledDelete, type Session, type SessionOrganization, 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, functionApp, hasUsers, imageSize, isJobDefinition, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, listOrganizations, listUsers, localFileStore, localFiles, maxTokenTtlSeconds, maxWidgetPropsBytes, mergeConfig, migrationCommand, newWebhookSecret, normalizeRoles, notFound, parseColumns, parseRoles, pluginOptions, pluginsFor, pluginsVariable, processor, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readWriteQueryTool, recordOf, removeMember, requestApproval, requireEnv, resourceChange, roleChoices, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, seesAssistant, seesRuntime, setMemberRoles, setUserBanned, setUserRole, signInPolicyMethods, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, streamChatCompletion, subscription, unauthorized, verifySignature, verifyStandardWebhook, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps };
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ import { FatalJobError } from "./jobs/run-job.js";
29
29
  import { defineFunction } from "./functions/define-function.js";
30
30
  import { newWebhookSecret } from "./webhooks/standard-webhooks.js";
31
31
  import { subscription } from "./webhooks/subscription.js";
32
+ import { errorReportingSettings, errorReportingVariable } from "./error-reporting/error-reporting-settings.js";
32
33
  import { storageCleanupSchedule } from "./files/cleanup-schedule.js";
33
34
  import { localFileStore, localFiles } from "./files/local-files.js";
34
35
  import { pluginOptions, pluginsFor, pluginsVariable } from "./plugins/plugin-settings.js";
@@ -46,6 +47,7 @@ import { changesMigration, checkChanges, migrationCommand } from "./changes/capt
46
47
  import { webhooks } from "./webhooks/table/plugin.js";
47
48
  import { checkWebhooksSchema, webhooksMigration } from "./webhooks/table/schema.js";
48
49
  import { maxWidgetPropsBytes, widget } from "./assistant/widget.js";
50
+ import { startErrorReporting } from "./error-reporting/error-reporter.js";
49
51
  import { functionApp } from "./functions/function-app.js";
50
52
  import { readJson } from "./functions/read-json.js";
51
53
  import { verifySignature, verifyStandardWebhook } from "./functions/verify-signature.js";
@@ -54,4 +56,4 @@ import { createFileCleanup } from "./files/file-cleanup.js";
54
56
  import { aspectRatio, fileSize, fileType, imageSize, processor } from "./files/processors.js";
55
57
  import { startJobs } from "./jobs/runtime.js";
56
58
  import { jobsDrainApp } from "./jobs/drain-route.js";
57
- export { FatalJobError, HttpProblem, 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, eventMatcher, fileConversationStore, fileSize, fileType, forbidden, functionApp, hasUsers, imageSize, isJobDefinition, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, listOrganizations, listUsers, localFileStore, localFiles, maxTokenTtlSeconds, maxWidgetPropsBytes, mergeConfig, migrationCommand, newWebhookSecret, normalizeRoles, notFound, parseColumns, parseRoles, pluginOptions, pluginsFor, pluginsVariable, processor, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readWriteQueryTool, recordOf, removeMember, requestApproval, requireEnv, resourceChange, roleChoices, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, seesAssistant, seesRuntime, setMemberRoles, setUserBanned, setUserRole, signInPolicyMethods, sourceOptions, sourcesFor, sourcesVariable, startJobs, storageCleanupSchedule, streamChatCompletion, subscription, unauthorized, verifySignature, verifyStandardWebhook, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps };
59
+ export { FatalJobError, HttpProblem, 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, functionApp, hasUsers, imageSize, isJobDefinition, issueToken, jobDefinitions, jobsDrainApp, jobsSchema, jobsSchemaMigration, jwtAuthenticator, listOrganizations, listUsers, localFileStore, localFiles, maxTokenTtlSeconds, maxWidgetPropsBytes, mergeConfig, migrationCommand, newWebhookSecret, normalizeRoles, notFound, parseColumns, parseRoles, pluginOptions, pluginsFor, pluginsVariable, processor, readJson, readOnlyQueryTool, readOperatorSettings, readOutbox, readPlatformSignIn, readWriteQueryTool, recordOf, removeMember, requestApproval, requireEnv, resourceChange, roleChoices, runReadOnlyQuery, runReadWriteQuery, runTurn, runtimeUrl, runtimeVariable, seesAssistant, seesRuntime, setMemberRoles, setUserBanned, setUserRole, signInPolicyMethods, sourceOptions, sourcesFor, sourcesVariable, startErrorReporting, startJobs, storageCleanupSchedule, streamChatCompletion, subscription, unauthorized, verifySignature, verifyStandardWebhook, webauthnPath, webhooks, webhooksMigration, widget, withCacheBreakpoints, withTrustedApps };
package/dist/meta.js CHANGED
@@ -61,6 +61,7 @@ const createMeta = (deps) => {
61
61
  } },
62
62
  ...deps.assistant && seesAssistant(session.user.roles) && { assistant: { url: deps.assistant } },
63
63
  ...deps.runtime && seesRuntime(session.user.roles) && { runtime: { url: deps.runtime } },
64
+ ...deps.errorReporting && { errorReporting: deps.errorReporting },
64
65
  ...plugins.length > 0 && { plugins },
65
66
  ...sources.length > 0 && { sources }
66
67
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/server",
3
- "version": "0.12.4",
3
+ "version": "0.12.6",
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,10 +30,11 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@better-auth/passkey": "^1.7.7",
33
- "@protobase/layout": "0.12.4",
34
- "@protobase/query": "0.12.4",
35
- "@protobase/schema": "0.12.4",
33
+ "@protobase/layout": "0.12.6",
34
+ "@protobase/query": "0.12.6",
35
+ "@protobase/schema": "0.12.6",
36
36
  "@scalar/hono-api-reference": "^0.12.10",
37
+ "@sentry/core": "^11.7.0",
37
38
  "@simplewebauthn/server": "^13.3.1",
38
39
  "better-auth": "^1.7.7",
39
40
  "cron-parser": "^5.10.1",