@rebasepro/server 0.28.1 → 0.29.0-canary.g0e3a0e7
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/{GCSStorageController-LXeAF6Ks.js → GCSStorageController-Ch3Ridyt.js} +4 -4
- package/dist/{GCSStorageController-LXeAF6Ks.js.map → GCSStorageController-Ch3Ridyt.js.map} +1 -1
- package/dist/{S3StorageController-CVKMUXo_.js → S3StorageController-CmNMg7Gu.js} +4 -4
- package/dist/{S3StorageController-CVKMUXo_.js.map → S3StorageController-CmNMg7Gu.js.map} +1 -1
- package/dist/{access-BDz4FO9D.js → access-BZjeLhf5.js} +7 -7
- package/dist/{access-BDz4FO9D.js.map → access-BZjeLhf5.js.map} +1 -1
- package/dist/api/rest/api-generator.d.ts +19 -0
- package/dist/{ast-schema-editor-C4bDSb61.js → ast-schema-editor-Dg7BWKE3.js} +3 -3
- package/dist/{ast-schema-editor-C4bDSb61.js.map → ast-schema-editor-Dg7BWKE3.js.map} +1 -1
- package/dist/auth/cookie-utils.d.ts +14 -6
- package/dist/auth/rate-limiter.d.ts +8 -0
- package/dist/{auth-CZGfVKcL.js → auth-CSWKaSgJ.js} +70 -18
- package/dist/auth-CSWKaSgJ.js.map +1 -0
- package/dist/{auth_adapter-B7RUMk6e.js → auth_adapter-HFv5axIT.js} +20 -2
- package/dist/auth_adapter-HFv5axIT.js.map +1 -0
- package/dist/backend/options.d.ts +3 -0
- package/dist/backend-CaG_Jyso.js.map +1 -1
- package/dist/{backup-BmzY9xdN.js → backup-woinIDjt.js} +9 -9
- package/dist/{backup-BmzY9xdN.js.map → backup-woinIDjt.js.map} +1 -1
- package/dist/boot/driver.d.ts +4 -0
- package/dist/boot/sources.d.ts +7 -0
- package/dist/{branch-routes-DpgaeTJl.js → branch-routes-F5VIJrZp.js} +3 -3
- package/dist/{branch-routes-DpgaeTJl.js.map → branch-routes-F5VIJrZp.js.map} +1 -1
- package/dist/{contract-routes-vYiBHbjI.js → contract-routes-D8Vsxjx8.js} +3 -3
- package/dist/{contract-routes-vYiBHbjI.js.map → contract-routes-D8Vsxjx8.js.map} +1 -1
- package/dist/{cron-loader-C_C-lNgG.js → cron-loader-n9Uh_E1a.js} +3 -3
- package/dist/{cron-loader-C_C-lNgG.js.map → cron-loader-n9Uh_E1a.js.map} +1 -1
- package/dist/{cron-routes-DlwOV6zl.js → cron-routes-mLexIC9F.js} +4 -4
- package/dist/{cron-routes-DlwOV6zl.js.map → cron-routes-mLexIC9F.js.map} +1 -1
- package/dist/{cron-scheduler-6ipIm5mm.js → cron-scheduler-DhxuCDuI.js} +2 -2
- package/dist/{cron-scheduler-6ipIm5mm.js.map → cron-scheduler-DhxuCDuI.js.map} +1 -1
- package/dist/{cron-store-KIOM8LCC.js → cron-store-DzKz7jXF.js} +2 -2
- package/dist/{cron-store-KIOM8LCC.js.map → cron-store-DzKz7jXF.js.map} +1 -1
- package/dist/data_driver-D0mg1Y_x.js.map +1 -1
- package/dist/dist-B4YtgTMh.js +19359 -0
- package/dist/dist-B4YtgTMh.js.map +1 -0
- package/dist/env.d.ts +7 -0
- package/dist/{errors-DIWnZIDY.js → errors-DpTMfX77.js} +58 -8
- package/dist/errors-DpTMfX77.js.map +1 -0
- package/dist/{field-access-KYk8RGOx.js → field-access-CzKjatID.js} +3 -3
- package/dist/{field-access-KYk8RGOx.js.map → field-access-CzKjatID.js.map} +1 -1
- package/dist/{filter-dialect-CE4bloug.js → filter-dialect-C5wfpopB.js} +110 -9
- package/dist/{filter-dialect-CE4bloug.js.map → filter-dialect-C5wfpopB.js.map} +1 -1
- package/dist/{function-loader-CKB9b4uP.js → function-loader-BzKo2Oiu.js} +2 -2
- package/dist/{function-loader-CKB9b4uP.js.map → function-loader-BzKo2Oiu.js.map} +1 -1
- package/dist/{function-routes-DLaXaiQA.js → function-routes-CQ0z3WDt.js} +2 -2
- package/dist/{function-routes-DLaXaiQA.js.map → function-routes-CQ0z3WDt.js.map} +1 -1
- package/dist/functions/index.d.ts +1 -0
- package/dist/functions/index.js +10 -29
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/wait-until.d.ts +29 -1
- package/dist/{history-recorder-BE4HWR-M.js → history-recorder-wkBuX7Np.js} +2 -2
- package/dist/{history-recorder-BE4HWR-M.js.map → history-recorder-wkBuX7Np.js.map} +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.es.js +2260 -1284
- package/dist/index.es.js.map +1 -1
- package/dist/init/surfaces.d.ts +19 -3
- package/dist/{jobs-CXTs9qXH.js → jobs-D61qYEGt.js} +2 -2
- package/dist/{jobs-CXTs9qXH.js.map → jobs-D61qYEGt.js.map} +1 -1
- package/dist/{jwt-5EvX3lQa.js → jwt-CBmQXYs-.js} +2 -2
- package/dist/{jwt-5EvX3lQa.js.map → jwt-CBmQXYs-.js.map} +1 -1
- package/dist/{keys-DJ1ZNcZi.js → keys-Cd_4l48g.js} +2 -2
- package/dist/{keys-DJ1ZNcZi.js.map → keys-Cd_4l48g.js.map} +1 -1
- package/dist/{logs-routes-DXLvMasE.js → logs-routes-08LiyYua.js} +2 -2
- package/dist/{logs-routes-DXLvMasE.js.map → logs-routes-08LiyYua.js.map} +1 -1
- package/dist/mcp/consent-page.d.ts +14 -1
- package/dist/mcp/mcp-apps.d.ts +51 -17
- package/dist/mcp/mcp-routes.d.ts +6 -1
- package/dist/mcp/mcp-tools.d.ts +44 -1
- package/dist/mcp/mcp-view.d.ts +107 -0
- package/dist/mcp/oauth-metadata.d.ts +7 -1
- package/dist/mcp/show-app-guide.d.ts +1 -0
- package/dist/metrics/database.d.ts +69 -0
- package/dist/metrics/db-connection-errors.d.ts +21 -0
- package/dist/{offline-BjJdcVBb-BOzzsnrh.js → offline-BjJdcVBb-B_bOcnDC.js} +4 -4
- package/dist/{offline-BjJdcVBb-BOzzsnrh.js.map → offline-BjJdcVBb-B_bOcnDC.js.map} +1 -1
- package/dist/{offline-store-Cxhh99Q--FB6fSf5A.js → offline-store-Cxhh99Q--DQ-M1M8d.js} +4 -4
- package/dist/{offline-store-Cxhh99Q--FB6fSf5A.js.map → offline-store-Cxhh99Q--DQ-M1M8d.js.map} +1 -1
- package/dist/{openapi-generator-B6aw_KuR.js → openapi-generator-B3LsKCon.js} +4 -4
- package/dist/{openapi-generator-B6aw_KuR.js.map → openapi-generator-B3LsKCon.js.map} +1 -1
- package/dist/{proxy-2nS5N63I.js → proxy-LUsudeht.js} +2 -2
- package/dist/{proxy-2nS5N63I.js.map → proxy-LUsudeht.js.map} +1 -1
- package/dist/{query-parser-DFVCjW5i.js → query-parser-C90z8csB.js} +6 -6
- package/dist/{query-parser-DFVCjW5i.js.map → query-parser-C90z8csB.js.map} +1 -1
- package/dist/{request-timeout-Cqm4JXtZ.js → request-timeout-DW2OBWfJ.js} +2 -2
- package/dist/{request-timeout-Cqm4JXtZ.js.map → request-timeout-DW2OBWfJ.js.map} +1 -1
- package/dist/{rls-simulator-routes-D5-XfjzW.js → rls-simulator-routes-igGu-giT.js} +4 -4
- package/dist/{rls-simulator-routes-D5-XfjzW.js.map → rls-simulator-routes-igGu-giT.js.map} +1 -1
- package/dist/{schema-editor-routes-DzSe6V0a.js → schema-editor-routes-kF1ZKCB2.js} +4 -4
- package/dist/{schema-editor-routes-DzSe6V0a.js.map → schema-editor-routes-kF1ZKCB2.js.map} +1 -1
- package/dist/serve-spa.d.ts +2 -10
- package/dist/{soft-delete-params-9lKBAlDw.js → soft-delete-params-DDRmxT2z.js} +2 -2
- package/dist/{soft-delete-params-9lKBAlDw.js.map → soft-delete-params-DDRmxT2z.js.map} +1 -1
- package/dist/{sql-export-routes-BxMqgAFX.js → sql-export-routes-DObpbf8x.js} +3 -3
- package/dist/{sql-export-routes-BxMqgAFX.js.map → sql-export-routes-DObpbf8x.js.map} +1 -1
- package/dist/{src-JQNz7cWv.js → src-BXDkXOtq.js} +2 -1
- package/dist/{src-JQNz7cWv.js.map → src-BXDkXOtq.js.map} +1 -1
- package/dist/{upload-validation-IYXn4xcm.js → upload-validation-B-psYLaN.js} +2 -2
- package/dist/{upload-validation-IYXn4xcm.js.map → upload-validation-B-psYLaN.js.map} +1 -1
- package/package.json +5 -5
- package/dist/auth-CZGfVKcL.js.map +0 -1
- package/dist/auth_adapter-B7RUMk6e.js.map +0 -1
- package/dist/dist-CT9HJehq.js +0 -22
- package/dist/dist-CT9HJehq.js.map +0 -1
- package/dist/errors-DIWnZIDY.js.map +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the database side of this process looks like, for `/metrics`.
|
|
3
|
+
*
|
|
4
|
+
* Three kinds of number, each answering a question the pool-wait histogram
|
|
5
|
+
* cannot:
|
|
6
|
+
*
|
|
7
|
+
* - **Pools** (`rebase_db_pool_{connections,idle,waiting}`, per source and pool) —
|
|
8
|
+
* read from the pools at each scrape. `waiting` above zero for long is a
|
|
9
|
+
* pool too small for its load; `total` across instances is what they ask of
|
|
10
|
+
* the database between them.
|
|
11
|
+
* - **Connection errors** (`rebase_db_connection_errors_total{code}`) —
|
|
12
|
+
* requests answered 503 because no connection could be had: the server out
|
|
13
|
+
* of connections (`53300`, `53400`), the pool exhausted, a connect timeout,
|
|
14
|
+
* the database unreachable. Counted where the request's error is classified.
|
|
15
|
+
* - **The server** (`rebase_db_connections{state}`, `rebase_db_max_connections`,
|
|
16
|
+
* `rebase_db_size_bytes`, `rebase_db_replica_lag_seconds`) — sampled every
|
|
17
|
+
* 30 seconds by a probe on each source's own connection, not at scrape time:
|
|
18
|
+
* a scrape every few seconds must not become a query every few seconds.
|
|
19
|
+
*
|
|
20
|
+
* The control plane scrapes this on every substrate, including where it
|
|
21
|
+
* cannot reach the database itself, so these are how it sees the database.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
import { type DatabaseAdmin, type DatabaseHealthSample } from "@rebasepro/types";
|
|
26
|
+
import type { MetricsRegistry } from "./index.js";
|
|
27
|
+
export { dbConnectionErrorCounts, noteDbConnectionError, type DbConnectionErrorCode } from "./db-connection-errors.js";
|
|
28
|
+
export declare const DB_POOL_CONNECTIONS_METRIC = "rebase_db_pool_connections";
|
|
29
|
+
export declare const DB_POOL_IDLE_METRIC = "rebase_db_pool_idle";
|
|
30
|
+
export declare const DB_POOL_WAITING_METRIC = "rebase_db_pool_waiting";
|
|
31
|
+
export declare const DB_CONNECTION_ERRORS_METRIC = "rebase_db_connection_errors_total";
|
|
32
|
+
export declare const DB_CONNECTIONS_METRIC = "rebase_db_connections";
|
|
33
|
+
export declare const DB_MAX_CONNECTIONS_METRIC = "rebase_db_max_connections";
|
|
34
|
+
export declare const DB_SIZE_METRIC = "rebase_db_size_bytes";
|
|
35
|
+
export declare const DB_REPLICA_LAG_METRIC = "rebase_db_replica_lag_seconds";
|
|
36
|
+
/** How often the server behind each source is sampled. */
|
|
37
|
+
export declare const DB_PROBE_INTERVAL_MS = 30000;
|
|
38
|
+
/** A pool's three counts, as `pg.Pool` keeps them. Any field may be missing on another driver's pool. */
|
|
39
|
+
interface CountedPool {
|
|
40
|
+
totalCount?: number;
|
|
41
|
+
idleCount?: number;
|
|
42
|
+
waitingCount?: number;
|
|
43
|
+
}
|
|
44
|
+
/** One data source as the metrics see it: its key, the pool the server opened, and how to reach its admin. */
|
|
45
|
+
export interface MeteredSource {
|
|
46
|
+
key: string;
|
|
47
|
+
pool?: CountedPool;
|
|
48
|
+
admin: () => DatabaseAdmin | undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Report each source's pools and the connection-error totals at every render.
|
|
52
|
+
* The server's own pool is read directly — any driver whose pool keeps
|
|
53
|
+
* `pg.Pool`'s counts reports it — and the driver's other pools through
|
|
54
|
+
* `SQLAdmin.poolStats`, when it has one.
|
|
55
|
+
*/
|
|
56
|
+
export declare function recordDatabasePools(registry: MetricsRegistry, sources: readonly MeteredSource[]): void;
|
|
57
|
+
/** Write one source's sample into the registry. A field the sample lacks leaves its gauge as it was. */
|
|
58
|
+
export declare function applyHealthSample(registry: MetricsRegistry, source: string, sample: DatabaseHealthSample): void;
|
|
59
|
+
/**
|
|
60
|
+
* Sample every source that can be sampled, now and every
|
|
61
|
+
* {@link DB_PROBE_INTERVAL_MS}. Returns the stop. The timer is unref'd, so it
|
|
62
|
+
* never holds the process open; a sample still running is not doubled.
|
|
63
|
+
*
|
|
64
|
+
* A source whose driver has no `SQLAdmin.sampleHealth` is skipped. A failed
|
|
65
|
+
* sample is logged at debug and leaves the last values in place — the gauges
|
|
66
|
+
* describe the database, and the database did not change because one sample
|
|
67
|
+
* failed.
|
|
68
|
+
*/
|
|
69
|
+
export declare function startDatabaseProbe(registry: MetricsRegistry, sources: readonly MeteredSource[], intervalMs?: number): () => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requests that failed for want of a database connection, counted where the
|
|
3
|
+
* error handler classifies them — see `rebase_db_connection_errors_total` in
|
|
4
|
+
* `database.ts`, which renders these.
|
|
5
|
+
*
|
|
6
|
+
* Its own module, with no imports, because the error handler is part of the
|
|
7
|
+
* portable `@rebasepro/server/functions` entry: whatever it imports has to load
|
|
8
|
+
* on a runtime without Node.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Why a request found no connection: a SQLSTATE (`53300`, `53400`) or
|
|
14
|
+
* `pool_exhausted`, `connect_timeout`, `unreachable`. A closed set — never a
|
|
15
|
+
* message — so the label stays bounded.
|
|
16
|
+
*/
|
|
17
|
+
export type DbConnectionErrorCode = "53300" | "53400" | "pool_exhausted" | "connect_timeout" | "unreachable";
|
|
18
|
+
/** Count one request that failed for want of a connection. */
|
|
19
|
+
export declare function noteDbConnectionError(code: DbConnectionErrorCode): void;
|
|
20
|
+
/** The totals so far, for rendering and for tests. */
|
|
21
|
+
export declare function dbConnectionErrorCounts(): ReadonlyMap<string, number>;
|
|
@@ -3,10 +3,10 @@ import __rebaseProcess from "process";
|
|
|
3
3
|
globalThis.process ??= __rebaseProcess;
|
|
4
4
|
__rebaseCreateRequire(import.meta.url);
|
|
5
5
|
import { a as RebaseClientError, i as RebaseApiError, o as isUnsupported } from "./data_driver-D0mg1Y_x.js";
|
|
6
|
-
import { D as Vector, E as GeoPoint, S as hasFieldOperation, T as EntityRelation, _ as normalizeOrderBy, c as collectAllPages, l as paginateFind, u as resolveFindWindow, w as EntityReference } from "./filter-dialect-
|
|
7
|
-
import { et as parseRelationAggregateSort, nt as toCanonicalOp } from "./src-
|
|
6
|
+
import { D as Vector, E as GeoPoint, S as hasFieldOperation, T as EntityRelation, _ as normalizeOrderBy, c as collectAllPages, l as paginateFind, u as resolveFindWindow, w as EntityReference } from "./filter-dialect-C5wfpopB.js";
|
|
7
|
+
import { et as parseRelationAggregateSort, nt as toCanonicalOp } from "./src-BXDkXOtq.js";
|
|
8
8
|
import { t as splitSearchTerms } from "./strings.es-B7QLnHh2.js";
|
|
9
|
-
import { a as byIdRead, f as rebaseReviver, h as unref, i as buildQueryString, m as withETag, n as MemoryOfflineStore, p as etagOf, r as SDKQueryBuilder, s as createMutationId, t as IndexedDBOfflineStore, u as invalidBulkBody } from "./offline-store-Cxhh99Q--
|
|
9
|
+
import { a as byIdRead, f as rebaseReviver, h as unref, i as buildQueryString, m as withETag, n as MemoryOfflineStore, p as etagOf, r as SDKQueryBuilder, s as createMutationId, t as IndexedDBOfflineStore, u as invalidBulkBody } from "./offline-store-Cxhh99Q--DQ-M1M8d.js";
|
|
10
10
|
//#region ../client/dist/offline-BjJdcVBb.js
|
|
11
11
|
/**
|
|
12
12
|
* Lossless round-tripping of rows through the offline store.
|
|
@@ -3417,4 +3417,4 @@ var OfflineManager = class {
|
|
|
3417
3417
|
//#endregion
|
|
3418
3418
|
export { OfflineManager };
|
|
3419
3419
|
|
|
3420
|
-
//# sourceMappingURL=offline-BjJdcVBb-
|
|
3420
|
+
//# sourceMappingURL=offline-BjJdcVBb-B_bOcnDC.js.map
|