@rebasepro/types 0.34.1 → 0.35.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/controllers/client.d.ts +23 -1
- package/dist/index.es.js +594 -5
- package/dist/index.es.js.map +1 -1
- package/dist/schema/column_options.d.ts +6 -0
- package/dist/schema/columns.d.ts +12 -1
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/rpc.d.ts +148 -0
- package/dist/types/backend.d.ts +118 -0
- package/dist/types/channel_bus.d.ts +5 -5
- package/dist/types/database_adapter.d.ts +7 -1
- package/dist/types/project_manifest.d.ts +198 -0
- package/dist/types/storage_authorize.d.ts +54 -0
- package/dist/users/import.d.ts +123 -0
- package/dist/users/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2408,6 +2408,19 @@ function summarizeScopes(model = EMPTY_ACCESS_MODEL) {
|
|
|
2408
2408
|
}
|
|
2409
2409
|
//#endregion
|
|
2410
2410
|
//#region src/types/project_manifest.ts
|
|
2411
|
+
/** The statuses a static app's redirect may answer with. */
|
|
2412
|
+
var STATIC_REDIRECT_STATUSES = [
|
|
2413
|
+
301,
|
|
2414
|
+
302,
|
|
2415
|
+
307,
|
|
2416
|
+
308
|
|
2417
|
+
];
|
|
2418
|
+
/** The status a redirect answers with when it names none: permanent, method kept. */
|
|
2419
|
+
var DEFAULT_STATIC_REDIRECT_STATUS = 308;
|
|
2420
|
+
/** Whether `value` is one of {@link STATIC_REDIRECT_STATUSES}. */
|
|
2421
|
+
function isStaticRedirectStatus(value) {
|
|
2422
|
+
return STATIC_REDIRECT_STATUSES.some((status) => status === value);
|
|
2423
|
+
}
|
|
2411
2424
|
/**
|
|
2412
2425
|
* Path prefixes the backend owns, which no static app may claim.
|
|
2413
2426
|
*
|
|
@@ -2592,7 +2605,7 @@ function validateStaticRoute(value, appPath) {
|
|
|
2592
2605
|
if (prefix.split("/").some((segment) => segment.startsWith("."))) return {
|
|
2593
2606
|
ok: false,
|
|
2594
2607
|
field: "path",
|
|
2595
|
-
reason: "must have no segment starting with \".\" —
|
|
2608
|
+
reason: "must have no segment starting with \".\" — an app serves no dot-file; for /.well-known, put the file in the .well-known/ folder of the build and the app at \"/\" serves it"
|
|
2596
2609
|
};
|
|
2597
2610
|
const reserved = reservedPrefixFor(prefix);
|
|
2598
2611
|
if (reserved) return {
|
|
@@ -2648,6 +2661,380 @@ function compareStaticRoutes(a, b) {
|
|
|
2648
2661
|
if (aWild !== b.path.endsWith("/*")) return aWild ? 1 : -1;
|
|
2649
2662
|
return aWild ? b.path.length - a.path.length : 0;
|
|
2650
2663
|
}
|
|
2664
|
+
/** `:name` or `:name*`, a whole segment. */
|
|
2665
|
+
var REDIRECT_PARAM_SEGMENT = /^:([A-Za-z_][A-Za-z0-9_]*)(\*)?$/;
|
|
2666
|
+
/** A parameter written in `to`: `:name` or `:name*`, with the slash before it. */
|
|
2667
|
+
var REDIRECT_PARAM_IN_TO = /(\/)?:([A-Za-z_][A-Za-z0-9_]*)(\*)?/g;
|
|
2668
|
+
/** What a literal segment may not hold. A `:` starts a parameter, which is a whole segment. */
|
|
2669
|
+
var REDIRECT_LITERAL_FORBIDDEN = /[?#\\*:\s\u0000-\u001f\u007f]/;
|
|
2670
|
+
/**
|
|
2671
|
+
* A literal segment as a browser sends it: percent-encoded where the URL
|
|
2672
|
+
* standard encodes a path, so `café` in `from` matches the request
|
|
2673
|
+
* `/caf%C3%A9`, and an escape already written is kept.
|
|
2674
|
+
*/
|
|
2675
|
+
function encodePathSegment(segment) {
|
|
2676
|
+
return new URL(`http://h/${segment}`).pathname.slice(1);
|
|
2677
|
+
}
|
|
2678
|
+
/** Split `from` into segments, or say why it cannot be. */
|
|
2679
|
+
function parseRedirectFrom(from) {
|
|
2680
|
+
if (from === "/") return {
|
|
2681
|
+
ok: true,
|
|
2682
|
+
segments: []
|
|
2683
|
+
};
|
|
2684
|
+
if (from.startsWith("//")) return {
|
|
2685
|
+
ok: false,
|
|
2686
|
+
reason: "must be a path, not a URL without its scheme — match a hostname with \"host\""
|
|
2687
|
+
};
|
|
2688
|
+
const parts = from.slice(1).split("/");
|
|
2689
|
+
if (parts.some((part) => part === "")) return {
|
|
2690
|
+
ok: false,
|
|
2691
|
+
reason: "must have no empty segment and no trailing slash — a request's trailing slash is ignored anyway"
|
|
2692
|
+
};
|
|
2693
|
+
const segments = [];
|
|
2694
|
+
const names = /* @__PURE__ */ new Set();
|
|
2695
|
+
for (const [index, part] of parts.entries()) {
|
|
2696
|
+
if (part.startsWith(":")) {
|
|
2697
|
+
const param = REDIRECT_PARAM_SEGMENT.exec(part);
|
|
2698
|
+
if (!param) return {
|
|
2699
|
+
ok: false,
|
|
2700
|
+
reason: `has "${part}", which is not a parameter: write ":name" for one segment or ":name*" for the rest of the path`
|
|
2701
|
+
};
|
|
2702
|
+
const [, name, star] = param;
|
|
2703
|
+
if (star && index !== parts.length - 1) return {
|
|
2704
|
+
ok: false,
|
|
2705
|
+
reason: `has ":${name}*" before its last segment — a parameter matching the rest of the path comes last`
|
|
2706
|
+
};
|
|
2707
|
+
if (names.has(name)) return {
|
|
2708
|
+
ok: false,
|
|
2709
|
+
reason: `names ":${name}" twice`
|
|
2710
|
+
};
|
|
2711
|
+
names.add(name);
|
|
2712
|
+
segments.push({
|
|
2713
|
+
kind: "param",
|
|
2714
|
+
name,
|
|
2715
|
+
rest: Boolean(star)
|
|
2716
|
+
});
|
|
2717
|
+
continue;
|
|
2718
|
+
}
|
|
2719
|
+
if (part.startsWith(".")) return {
|
|
2720
|
+
ok: false,
|
|
2721
|
+
reason: "must have no segment starting with \".\" — an app serves no dot-file; for /.well-known, put the file in the .well-known/ folder of the build and the app at \"/\" serves it"
|
|
2722
|
+
};
|
|
2723
|
+
if (REDIRECT_LITERAL_FORBIDDEN.test(part)) return {
|
|
2724
|
+
ok: false,
|
|
2725
|
+
reason: `has "${part}", which holds a space, "?", "#", "\\", "*" or ":" — a ":" starts a parameter, which is a whole segment, and a query is matched with "query"`
|
|
2726
|
+
};
|
|
2727
|
+
const encoded = encodePathSegment(part);
|
|
2728
|
+
if (encoded === "") return {
|
|
2729
|
+
ok: false,
|
|
2730
|
+
reason: `has "${part}", which is "." or ".." written with escapes — a request never arrives with one`
|
|
2731
|
+
};
|
|
2732
|
+
segments.push({
|
|
2733
|
+
kind: "literal",
|
|
2734
|
+
value: encoded
|
|
2735
|
+
});
|
|
2736
|
+
}
|
|
2737
|
+
return {
|
|
2738
|
+
ok: true,
|
|
2739
|
+
segments
|
|
2740
|
+
};
|
|
2741
|
+
}
|
|
2742
|
+
/** The leading literal segments of `from`, as a path: what every match is under. */
|
|
2743
|
+
function literalPrefixOf(segments) {
|
|
2744
|
+
const literals = [];
|
|
2745
|
+
for (const segment of segments) {
|
|
2746
|
+
if (segment.kind !== "literal") break;
|
|
2747
|
+
literals.push(segment.value);
|
|
2748
|
+
}
|
|
2749
|
+
return `/${literals.join("/")}`;
|
|
2750
|
+
}
|
|
2751
|
+
/**
|
|
2752
|
+
* Compile one redirect into the function that answers a request with it, or
|
|
2753
|
+
* `undefined` when it does not match. The redirect must have passed
|
|
2754
|
+
* {@link validateStaticRedirect}; one that would not throws.
|
|
2755
|
+
*/
|
|
2756
|
+
function compileStaticRedirect(redirect) {
|
|
2757
|
+
const parsed = parseRedirectFrom(redirect.from);
|
|
2758
|
+
if (!parsed.ok) throw new Error(`Redirect from ${JSON.stringify(redirect.from)} ${parsed.reason}.`);
|
|
2759
|
+
const names = [];
|
|
2760
|
+
let body = "";
|
|
2761
|
+
for (const segment of parsed.segments) if (segment.kind === "literal") body += `/${segment.value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`;
|
|
2762
|
+
else {
|
|
2763
|
+
names.push(segment.name);
|
|
2764
|
+
body += segment.rest ? "(?:/([^/]+(?:/[^/]+)*))?" : "/([^/]+)";
|
|
2765
|
+
}
|
|
2766
|
+
const pattern = new RegExp(`^${body}/?$`);
|
|
2767
|
+
const status = redirect.status ?? 308;
|
|
2768
|
+
const conditions = Object.entries(redirect.query ?? {});
|
|
2769
|
+
const absolute = /^https?:\/\//i.test(redirect.to);
|
|
2770
|
+
return (request) => {
|
|
2771
|
+
if (redirect.host !== void 0 && redirect.host !== request.host) return void 0;
|
|
2772
|
+
if (redirect.notHost !== void 0 && redirect.notHost === request.host) return void 0;
|
|
2773
|
+
const match = pattern.exec(request.path);
|
|
2774
|
+
if (!match) return void 0;
|
|
2775
|
+
if (conditions.length > 0) {
|
|
2776
|
+
const query = new URLSearchParams(request.search);
|
|
2777
|
+
if (!conditions.every(([key, value]) => query.getAll(key).includes(value))) return void 0;
|
|
2778
|
+
}
|
|
2779
|
+
const params = new Map(names.map((name, index) => [name, match[index + 1] ?? ""]));
|
|
2780
|
+
let location = redirect.to.replace(REDIRECT_PARAM_IN_TO, (_whole, slash, name) => {
|
|
2781
|
+
const value = params.get(name) ?? "";
|
|
2782
|
+
return value === "" ? "" : `${slash ?? ""}${value}`;
|
|
2783
|
+
});
|
|
2784
|
+
if (!absolute) {
|
|
2785
|
+
if (location === "" || location.startsWith("?") || location.startsWith("#")) location = `/${location}`;
|
|
2786
|
+
if (/^[/\\]{2}/.test(location)) return void 0;
|
|
2787
|
+
}
|
|
2788
|
+
const hashAt = location.indexOf("#");
|
|
2789
|
+
const beforeHash = hashAt === -1 ? location : location.slice(0, hashAt);
|
|
2790
|
+
if (!beforeHash.includes("?") && request.search.length > 1) location = `${beforeHash}${request.search}${hashAt === -1 ? "" : location.slice(hashAt)}`;
|
|
2791
|
+
return {
|
|
2792
|
+
status,
|
|
2793
|
+
location
|
|
2794
|
+
};
|
|
2795
|
+
};
|
|
2796
|
+
}
|
|
2797
|
+
/**
|
|
2798
|
+
* Compile a static app's redirects into the one function that answers a
|
|
2799
|
+
* request with the first that matches, in declaration order — `undefined`
|
|
2800
|
+
* when none does. Each must have passed {@link validateStaticRedirect}.
|
|
2801
|
+
*
|
|
2802
|
+
* Shared so every server of a static app answers the same request the same
|
|
2803
|
+
* way: `rebase dev`, `rebase start` and `rebase-server` through `serveSPA`,
|
|
2804
|
+
* and any other host that serves a built app.
|
|
2805
|
+
*/
|
|
2806
|
+
function compileStaticRedirects(redirects) {
|
|
2807
|
+
const compiled = redirects.map(compileStaticRedirect);
|
|
2808
|
+
return (request) => {
|
|
2809
|
+
for (const answer of compiled) {
|
|
2810
|
+
const match = answer(request);
|
|
2811
|
+
if (match) return match;
|
|
2812
|
+
}
|
|
2813
|
+
};
|
|
2814
|
+
}
|
|
2815
|
+
/**
|
|
2816
|
+
* Validate one of a static app's redirects against the app's address (its
|
|
2817
|
+
* hostname, when its `path` names one, and the path part).
|
|
2818
|
+
*
|
|
2819
|
+
* Shared for the reason {@link validateStaticRoute} is: the CLI checks a
|
|
2820
|
+
* redirect while `rebase.json` is edited, and the runtime checks it again
|
|
2821
|
+
* when it loads a bundle. The rules:
|
|
2822
|
+
*
|
|
2823
|
+
* - `from` is an absolute path with no empty segment, no trailing slash and
|
|
2824
|
+
* no segment starting with a dot. A segment is literal text or a parameter
|
|
2825
|
+
* — `:name`, or `:name*` as the last segment — and a literal holds no
|
|
2826
|
+
* space, `?`, `#`, `\`, `*` or `:`. Its leading literal segments are inside
|
|
2827
|
+
* the app's path and not under a prefix the backend owns, since the app is
|
|
2828
|
+
* what answers there.
|
|
2829
|
+
* - `to` is a path (`/…`, never `//…`) or an absolute `http://` or `https://`
|
|
2830
|
+
* URL, with no space or backslash. It names only parameters `from`
|
|
2831
|
+
* declares, and none in an absolute URL's scheme, host or port.
|
|
2832
|
+
* - `status` is 301, 302, 307 or 308.
|
|
2833
|
+
* - `host` is a public hostname, lowercase, and is the app's own when the
|
|
2834
|
+
* app has one — on any other the redirect could never match.
|
|
2835
|
+
* - `notHost` is a public hostname, lowercase, never with `host`, and never
|
|
2836
|
+
* the app's own hostname, on which the redirect could never match.
|
|
2837
|
+
* - `query` maps parameter names to the exact string each must hold.
|
|
2838
|
+
* - A redirect to a path on the same address that its own `from` matches
|
|
2839
|
+
* again is refused: every request it answers would be sent round forever.
|
|
2840
|
+
*/
|
|
2841
|
+
function validateStaticRedirect(value, app) {
|
|
2842
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return {
|
|
2843
|
+
ok: false,
|
|
2844
|
+
reason: "must be an object like { \"from\": \"/old\", \"to\": \"/new\" }"
|
|
2845
|
+
};
|
|
2846
|
+
const { from, to, status, host, notHost, query, source, destination } = value;
|
|
2847
|
+
if (from === void 0 && source !== void 0) return {
|
|
2848
|
+
ok: false,
|
|
2849
|
+
field: "from",
|
|
2850
|
+
reason: "is missing — Vercel's \"source\" is \"from\" here"
|
|
2851
|
+
};
|
|
2852
|
+
if (to === void 0 && destination !== void 0) return {
|
|
2853
|
+
ok: false,
|
|
2854
|
+
field: "to",
|
|
2855
|
+
reason: "is missing — Vercel's \"destination\" is \"to\" here"
|
|
2856
|
+
};
|
|
2857
|
+
if (typeof from !== "string" || !from.startsWith("/")) return {
|
|
2858
|
+
ok: false,
|
|
2859
|
+
field: "from",
|
|
2860
|
+
reason: "must be an absolute path like \"/old\" or \"/blog/:slug\""
|
|
2861
|
+
};
|
|
2862
|
+
const parsed = parseRedirectFrom(from);
|
|
2863
|
+
if (!parsed.ok) return {
|
|
2864
|
+
ok: false,
|
|
2865
|
+
field: "from",
|
|
2866
|
+
reason: parsed.reason
|
|
2867
|
+
};
|
|
2868
|
+
const prefix = literalPrefixOf(parsed.segments);
|
|
2869
|
+
const reserved = reservedPrefixFor(prefix);
|
|
2870
|
+
if (reserved) return {
|
|
2871
|
+
ok: false,
|
|
2872
|
+
field: "from",
|
|
2873
|
+
reason: `cannot be "${reserved}" or under it — the backend answers that path on every hostname`
|
|
2874
|
+
};
|
|
2875
|
+
if (!isPathUnder(prefix, app.path) && !isPathUnder(app.path, prefix)) return {
|
|
2876
|
+
ok: false,
|
|
2877
|
+
field: "from",
|
|
2878
|
+
reason: `must be inside this app's path, "${app.path}" — the app is what answers there`
|
|
2879
|
+
};
|
|
2880
|
+
if (!isPathUnder(prefix, app.path)) return {
|
|
2881
|
+
ok: false,
|
|
2882
|
+
field: "from",
|
|
2883
|
+
reason: `must start with this app's path, "${app.path}" — write "${app.path}${from === "/" ? "" : from}" if that is what you mean`
|
|
2884
|
+
};
|
|
2885
|
+
if (typeof to !== "string" || to === "") return {
|
|
2886
|
+
ok: false,
|
|
2887
|
+
field: "to",
|
|
2888
|
+
reason: "must be a path like \"/new\" or a URL like \"https://www.example.com/:path*\""
|
|
2889
|
+
};
|
|
2890
|
+
if (/[\s\\\u0000-\u001f\u007f]/.test(to)) return {
|
|
2891
|
+
ok: false,
|
|
2892
|
+
field: "to",
|
|
2893
|
+
reason: "must not contain spaces, control characters or backslashes"
|
|
2894
|
+
};
|
|
2895
|
+
const absolute = /^https?:\/\//i.test(to);
|
|
2896
|
+
if (!absolute) {
|
|
2897
|
+
if (!to.startsWith("/")) return {
|
|
2898
|
+
ok: false,
|
|
2899
|
+
field: "to",
|
|
2900
|
+
reason: "must be a path starting with \"/\" or an absolute URL starting with \"https://\""
|
|
2901
|
+
};
|
|
2902
|
+
if (to.startsWith("//")) return {
|
|
2903
|
+
ok: false,
|
|
2904
|
+
field: "to",
|
|
2905
|
+
reason: `must be a path, not a URL without its scheme — write "https:${to}"`
|
|
2906
|
+
};
|
|
2907
|
+
} else {
|
|
2908
|
+
const authority = to.slice(to.indexOf("//") + 2).split(/[/?#]/)[0];
|
|
2909
|
+
if (/:[A-Za-z_]/.test(authority)) return {
|
|
2910
|
+
ok: false,
|
|
2911
|
+
field: "to",
|
|
2912
|
+
reason: "may name parameters in its path and query only, not in its scheme, host or port"
|
|
2913
|
+
};
|
|
2914
|
+
try {
|
|
2915
|
+
const url = new URL(to.replace(REDIRECT_PARAM_IN_TO, (_whole, slash) => `${slash ?? ""}x`));
|
|
2916
|
+
if (url.username || url.password) return {
|
|
2917
|
+
ok: false,
|
|
2918
|
+
field: "to",
|
|
2919
|
+
reason: "must not contain credentials"
|
|
2920
|
+
};
|
|
2921
|
+
} catch {
|
|
2922
|
+
return {
|
|
2923
|
+
ok: false,
|
|
2924
|
+
field: "to",
|
|
2925
|
+
reason: "is not a valid URL"
|
|
2926
|
+
};
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
const declared = new Set(parsed.segments.flatMap((segment) => segment.kind === "param" ? [segment.name] : []));
|
|
2930
|
+
for (const [, , name] of to.matchAll(REDIRECT_PARAM_IN_TO)) if (!declared.has(name)) return {
|
|
2931
|
+
ok: false,
|
|
2932
|
+
field: "to",
|
|
2933
|
+
reason: `names ":${name}", which "from" does not declare` + (declared.size > 0 ? ` — it declares ${[...declared].map((n) => `":${n}"`).join(", ")}` : "")
|
|
2934
|
+
};
|
|
2935
|
+
if (status !== void 0 && !isStaticRedirectStatus(status)) return {
|
|
2936
|
+
ok: false,
|
|
2937
|
+
field: "status",
|
|
2938
|
+
reason: "must be 301, 302, 307 or 308 — 308 when left out"
|
|
2939
|
+
};
|
|
2940
|
+
if (host !== void 0) {
|
|
2941
|
+
if (typeof host !== "string" || !isValidAppHost(host)) return {
|
|
2942
|
+
ok: false,
|
|
2943
|
+
field: "host",
|
|
2944
|
+
reason: "must be a lowercase public hostname like \"example.com\" — no scheme, port or path"
|
|
2945
|
+
};
|
|
2946
|
+
if (app.host !== void 0 && host !== app.host) return {
|
|
2947
|
+
ok: false,
|
|
2948
|
+
field: "host",
|
|
2949
|
+
reason: `can never match: this app answers only on "${app.host}"`
|
|
2950
|
+
};
|
|
2951
|
+
}
|
|
2952
|
+
if (notHost !== void 0) {
|
|
2953
|
+
if (typeof notHost !== "string" || !isValidAppHost(notHost)) return {
|
|
2954
|
+
ok: false,
|
|
2955
|
+
field: "notHost",
|
|
2956
|
+
reason: "must be a lowercase public hostname like \"example.com\" — no scheme, port or path"
|
|
2957
|
+
};
|
|
2958
|
+
if (host !== void 0) return {
|
|
2959
|
+
ok: false,
|
|
2960
|
+
field: "notHost",
|
|
2961
|
+
reason: "cannot be set with \"host\", which already names the only hostname this redirect answers on"
|
|
2962
|
+
};
|
|
2963
|
+
if (app.host !== void 0 && notHost === app.host) return {
|
|
2964
|
+
ok: false,
|
|
2965
|
+
field: "notHost",
|
|
2966
|
+
reason: `can never match: this app answers only on "${app.host}"`
|
|
2967
|
+
};
|
|
2968
|
+
}
|
|
2969
|
+
let conditions;
|
|
2970
|
+
if (query !== void 0) {
|
|
2971
|
+
if (typeof query !== "object" || query === null || Array.isArray(query)) return {
|
|
2972
|
+
ok: false,
|
|
2973
|
+
field: "query",
|
|
2974
|
+
reason: "must be an object of exact values like { \"lang\": \"es\" }"
|
|
2975
|
+
};
|
|
2976
|
+
conditions = {};
|
|
2977
|
+
for (const [key, expected] of Object.entries(query)) {
|
|
2978
|
+
if (key === "" || typeof expected !== "string") return {
|
|
2979
|
+
ok: false,
|
|
2980
|
+
field: "query",
|
|
2981
|
+
reason: "must map each parameter name to the exact string it holds, like { \"lang\": \"es\" }"
|
|
2982
|
+
};
|
|
2983
|
+
conditions[key] = expected;
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
const redirect = {
|
|
2987
|
+
from,
|
|
2988
|
+
to,
|
|
2989
|
+
...isStaticRedirectStatus(status) ? { status } : {},
|
|
2990
|
+
...typeof host === "string" ? { host } : {},
|
|
2991
|
+
...typeof notHost === "string" ? { notHost } : {},
|
|
2992
|
+
...conditions ? { query: conditions } : {}
|
|
2993
|
+
};
|
|
2994
|
+
if (!absolute) {
|
|
2995
|
+
const answer = compileStaticRedirect(redirect);
|
|
2996
|
+
const samplePath = parsed.segments.length === 0 ? "/" : parsed.segments.map((segment) => `/${segment.kind === "literal" ? segment.value : "x"}`).join("");
|
|
2997
|
+
const sampleSearch = conditions && Object.keys(conditions).length > 0 ? `?${new URLSearchParams(conditions).toString()}` : "";
|
|
2998
|
+
const sampleHost = redirect.host ?? app.host ?? (redirect.notHost === "example.com" ? "example.net" : "example.com");
|
|
2999
|
+
const first = answer({
|
|
3000
|
+
host: sampleHost,
|
|
3001
|
+
path: samplePath,
|
|
3002
|
+
search: sampleSearch
|
|
3003
|
+
});
|
|
3004
|
+
if (first) {
|
|
3005
|
+
const target = new URL(first.location, `https://${sampleHost}`);
|
|
3006
|
+
if (answer({
|
|
3007
|
+
host: sampleHost,
|
|
3008
|
+
path: target.pathname,
|
|
3009
|
+
search: target.search
|
|
3010
|
+
})) return {
|
|
3011
|
+
ok: false,
|
|
3012
|
+
field: "to",
|
|
3013
|
+
reason: `sends "${samplePath}${sampleSearch}" to "${first.location}", which "from" matches again — every request it answers would be redirected forever. Narrow "from", or send it somewhere "from" does not match`
|
|
3014
|
+
};
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
return {
|
|
3018
|
+
ok: true,
|
|
3019
|
+
redirect
|
|
3020
|
+
};
|
|
3021
|
+
}
|
|
3022
|
+
/**
|
|
3023
|
+
* Where a `cleanUrls` app sends a request for an HTML file by name: `/x.html`
|
|
3024
|
+
* to `/x`, and an `index.html` to its directory, `/docs/index.html` to
|
|
3025
|
+
* `/docs/`. `undefined` for a path that names no `.html` file.
|
|
3026
|
+
*
|
|
3027
|
+
* The path is compared as it arrives, percent-encoded; the caller keeps the
|
|
3028
|
+
* query string and redirects only when the file exists.
|
|
3029
|
+
*/
|
|
3030
|
+
function cleanUrlFor(requestPath) {
|
|
3031
|
+
if (!requestPath.endsWith(".html")) return void 0;
|
|
3032
|
+
const slash = requestPath.lastIndexOf("/");
|
|
3033
|
+
const name = requestPath.slice(slash + 1);
|
|
3034
|
+
if (name === ".html") return void 0;
|
|
3035
|
+
if (name === "index.html") return requestPath.slice(0, slash + 1);
|
|
3036
|
+
return requestPath.slice(0, -5);
|
|
3037
|
+
}
|
|
2651
3038
|
/** Hosts plain `http://` is accepted for: a CMS running on the developer's own machine. */
|
|
2652
3039
|
var LOOPBACK_HOSTS = /* @__PURE__ */ new Set([
|
|
2653
3040
|
"localhost",
|
|
@@ -2914,6 +3301,32 @@ function computeSchemaVersion(tables) {
|
|
|
2914
3301
|
return `v2:${hex(h1)}${hex(h2)}`;
|
|
2915
3302
|
}
|
|
2916
3303
|
//#endregion
|
|
3304
|
+
//#region src/types/storage_authorize.ts
|
|
3305
|
+
/**
|
|
3306
|
+
* Where a project with no storage rules of its own starts — what Rebase
|
|
3307
|
+
* Cloud gives a new project and what its console offers as "recommended":
|
|
3308
|
+
* a `public/` folder anyone may read, a `users/<uid>/` folder only its user
|
|
3309
|
+
* may touch, and every key to admins. Rules are deny-by-default, so this is
|
|
3310
|
+
* also everything a caller may do.
|
|
3311
|
+
*
|
|
3312
|
+
* @group Storage
|
|
3313
|
+
*/
|
|
3314
|
+
var RECOMMENDED_STORAGE_RULES = Object.freeze([
|
|
3315
|
+
{
|
|
3316
|
+
path: "public/**",
|
|
3317
|
+
operations: ["read"],
|
|
3318
|
+
allow: "public"
|
|
3319
|
+
},
|
|
3320
|
+
{
|
|
3321
|
+
path: "users/:uid/**",
|
|
3322
|
+
allow: "owner"
|
|
3323
|
+
},
|
|
3324
|
+
{
|
|
3325
|
+
path: "**",
|
|
3326
|
+
allow: { roles: ["admin"] }
|
|
3327
|
+
}
|
|
3328
|
+
]);
|
|
3329
|
+
//#endregion
|
|
2917
3330
|
//#region src/types/mcp_app_modules.ts
|
|
2918
3331
|
/**
|
|
2919
3332
|
* The modules an app Claude writes for show_app may import, and from each the
|
|
@@ -3877,6 +4290,65 @@ function toDriverAggregateGroup(group) {
|
|
|
3877
4290
|
};
|
|
3878
4291
|
}
|
|
3879
4292
|
//#endregion
|
|
4293
|
+
//#region src/users/import.ts
|
|
4294
|
+
/**
|
|
4295
|
+
* Importing accounts from another system: `POST /admin/users/import`,
|
|
4296
|
+
* `client.admin.importUsers()` and `rebase users import`.
|
|
4297
|
+
*
|
|
4298
|
+
* An import keeps the ids the accounts had, so every row that points at a user
|
|
4299
|
+
* still points at the same one. It carries no password and sends no email: an
|
|
4300
|
+
* imported account signs in by magic link, an email code, a provider, or a
|
|
4301
|
+
* password reset.
|
|
4302
|
+
*/
|
|
4303
|
+
/**
|
|
4304
|
+
* The most accounts one `POST /admin/users/import` takes. The CLI sends a
|
|
4305
|
+
* longer file in requests of this size.
|
|
4306
|
+
*
|
|
4307
|
+
* @group Admin
|
|
4308
|
+
*/
|
|
4309
|
+
var MAX_USERS_PER_IMPORT = 100;
|
|
4310
|
+
/**
|
|
4311
|
+
* The longest id an imported account may keep.
|
|
4312
|
+
*
|
|
4313
|
+
* @group Admin
|
|
4314
|
+
*/
|
|
4315
|
+
var MAX_IMPORTED_USER_ID_LENGTH = 128;
|
|
4316
|
+
/**
|
|
4317
|
+
* Ids that already mean someone other than an account: the anonymous caller,
|
|
4318
|
+
* the service key, and the identity a custom validator's `true` stands for.
|
|
4319
|
+
*/
|
|
4320
|
+
var RESERVED_USER_IDS = /* @__PURE__ */ new Set([
|
|
4321
|
+
"anonymous",
|
|
4322
|
+
"anon",
|
|
4323
|
+
"service",
|
|
4324
|
+
"default"
|
|
4325
|
+
]);
|
|
4326
|
+
/**
|
|
4327
|
+
* Why `id` cannot be kept as an imported account's id, or `undefined` when it
|
|
4328
|
+
* can.
|
|
4329
|
+
*
|
|
4330
|
+
* A uuid is the common case (Supabase, Cognito). Other systems' ids fit too:
|
|
4331
|
+
* letters, digits and `_ - . : |`, starting with a letter or a digit, at most
|
|
4332
|
+
* {@link MAX_IMPORTED_USER_ID_LENGTH} characters (Firebase's 28-character
|
|
4333
|
+
* uids, Auth0's `auth0|5f7c…`, Clerk's `user_2abc…`). Refused: what would read
|
|
4334
|
+
* as something else on the way through a URL, a storage path or a CLI argument
|
|
4335
|
+
* (`/`, `?`, `%`, whitespace, `@`, which the CLI reads as an email), and the
|
|
4336
|
+
* ids that already name a caller who is not an account (`service`,
|
|
4337
|
+
* `anonymous`).
|
|
4338
|
+
*
|
|
4339
|
+
* The users table's id column has the last word: a uuid column refuses an id
|
|
4340
|
+
* that is not a uuid.
|
|
4341
|
+
*
|
|
4342
|
+
* @group Admin
|
|
4343
|
+
*/
|
|
4344
|
+
function importedUserIdProblem(id) {
|
|
4345
|
+
if (typeof id !== "string") return "is not a string";
|
|
4346
|
+
if (id === "") return "is empty";
|
|
4347
|
+
if (id.length > 128) return `is longer than 128 characters`;
|
|
4348
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_.:|-]*$/.test(id)) return "may hold only letters, digits and _ - . : |, starting with a letter or a digit";
|
|
4349
|
+
if (RESERVED_USER_IDS.has(id.toLowerCase())) return "is reserved: it names a caller who is not an account";
|
|
4350
|
+
}
|
|
4351
|
+
//#endregion
|
|
3880
4352
|
//#region src/schema/column_type.ts
|
|
3881
4353
|
var TEXT_KINDS = [
|
|
3882
4354
|
"text",
|
|
@@ -4298,7 +4770,7 @@ var DRIZZLE_REFUSALS = {
|
|
|
4298
4770
|
/** `.references(() => …)`: a foreign key is a `rel.belongsTo`. */
|
|
4299
4771
|
references: "A foreign key is a relation in Rebase: write `relations: { author: rel.belongsTo(() => users, { localKey: \"author_id\", onDelete: \"cascade\" }) }`. The relation's key is what `include` names.",
|
|
4300
4772
|
/** `.$defaultFn()` / `.$default()`: a run-time default function. */
|
|
4301
|
-
defaultFn: "Rebase's schema is data, not code: a default is `.default(value)` or `.default(sql`…`)`; the time is `.defaultNow()` or `.onCreateNow()`, the caller `.onCreateUser()`; anything else belongs in `hooks.beforeSave`.",
|
|
4773
|
+
defaultFn: "Rebase's schema is data, not code: a default is `.default(value)` or `.default(sql`…`)`; the time is `.defaultNow()` or `.onCreateNow()`, the caller `.onCreateUser()`; anything else belongs in `hooks.beforeSave`, with `.serverDefault()` on the column it fills.",
|
|
4302
4774
|
/** `.$onUpdate()` / `.$onUpdateFn()`: a run-time update function. */
|
|
4303
4775
|
onUpdateFn: "Rebase's schema is data, not code: write `.onUpdateNow()` for the time, `.onUpdateUser()` for the caller; anything else belongs in `hooks.beforeSave`.",
|
|
4304
4776
|
/** `.unique(name, { nulls })`: a named or NULLS NOT DISTINCT constraint. */
|
|
@@ -4487,6 +4959,19 @@ var ColumnBuilder = class ColumnBuilder {
|
|
|
4487
4959
|
return this.with({ default: { kind: "database" } });
|
|
4488
4960
|
}
|
|
4489
4961
|
/**
|
|
4962
|
+
* The table's own server code fills this column when a create leaves it
|
|
4963
|
+
* out: a `hooks.beforeSave` that derives it (a slug from the title), or
|
|
4964
|
+
* the column's `.transform()`. A hook is code and cannot be read, so this
|
|
4965
|
+
* says what it does: a create may omit the column (the SDK's insert type
|
|
4966
|
+
* makes it optional), the panel's form lets a record be created without
|
|
4967
|
+
* it, and the descriptor carries `default: { kind: "server" }`. No DDL
|
|
4968
|
+
* default is written. A `NOT NULL` column the hook does not fill still
|
|
4969
|
+
* fails on the database.
|
|
4970
|
+
*/
|
|
4971
|
+
serverDefault() {
|
|
4972
|
+
return this.with({ default: { kind: "server" } });
|
|
4973
|
+
}
|
|
4974
|
+
/**
|
|
4490
4975
|
* `GENERATED ALWAYS AS (<expression>) STORED`, as Drizzle writes it:
|
|
4491
4976
|
* `.generatedAlwaysAs(sql\`lower(email)\`)`. Nobody writes the column.
|
|
4492
4977
|
*/
|
|
@@ -5132,7 +5617,7 @@ function isRelationDef(value) {
|
|
|
5132
5617
|
var TABLE_BRAND = "rebase.table";
|
|
5133
5618
|
/** The brand of a `defineView` result. */
|
|
5134
5619
|
var VIEW_BRAND = "rebase.view";
|
|
5135
|
-
var IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
5620
|
+
var IDENTIFIER$1 = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
5136
5621
|
function assertTableShape(builder, name, config) {
|
|
5137
5622
|
if (typeof name !== "string" || name.length === 0) throw new Error(`\`${builder}(name, config)\` needs the table's name as its first argument.`);
|
|
5138
5623
|
if (typeof config !== "object" || config === null) throw new Error(`\`${builder}("${name}", config)\` needs a config object.`);
|
|
@@ -5149,7 +5634,7 @@ function assertTableShape(builder, name, config) {
|
|
|
5149
5634
|
}
|
|
5150
5635
|
for (const key of ["schema", "table"]) {
|
|
5151
5636
|
const value = key in config ? Reflect.get(config, key) : void 0;
|
|
5152
|
-
if (value !== void 0 && (typeof value !== "string" || !IDENTIFIER.test(value))) throw new Error(`\`${key}\` of table "${name}" must be a plain SQL identifier, got ${JSON.stringify(value)}.`);
|
|
5637
|
+
if (value !== void 0 && (typeof value !== "string" || !IDENTIFIER$1.test(value))) throw new Error(`\`${key}\` of table "${name}" must be a plain SQL identifier, got ${JSON.stringify(value)}.`);
|
|
5153
5638
|
}
|
|
5154
5639
|
}
|
|
5155
5640
|
function assertRlsDeclared(builder, name, config) {
|
|
@@ -5255,6 +5740,110 @@ function isViewDef(value) {
|
|
|
5255
5740
|
return typeof value === "object" && value !== null && "brand" in value && value.brand === "rebase.view";
|
|
5256
5741
|
}
|
|
5257
5742
|
//#endregion
|
|
5743
|
+
//#region src/schema/rpc.ts
|
|
5744
|
+
/** The brand of a `defineRpc` result. */
|
|
5745
|
+
var RPC_BRAND = "rebase.rpc";
|
|
5746
|
+
/**
|
|
5747
|
+
* The limit a `public` RPC is held to when it declares none: 120 calls a
|
|
5748
|
+
* minute per caller.
|
|
5749
|
+
*
|
|
5750
|
+
* @group Schema
|
|
5751
|
+
*/
|
|
5752
|
+
var DEFAULT_PUBLIC_RPC_RATE_LIMIT = {
|
|
5753
|
+
limit: 120,
|
|
5754
|
+
windowMs: 6e4
|
|
5755
|
+
};
|
|
5756
|
+
/** A SQL identifier as Rebase writes one: letters, digits, `_`, not starting with a digit. */
|
|
5757
|
+
var IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
5758
|
+
/** Schemas whose functions are the database's or the server's own, never an RPC. */
|
|
5759
|
+
var RESERVED_SCHEMAS = /* @__PURE__ */ new Set([
|
|
5760
|
+
"rebase",
|
|
5761
|
+
"pg_catalog",
|
|
5762
|
+
"information_schema",
|
|
5763
|
+
"pg_toast"
|
|
5764
|
+
]);
|
|
5765
|
+
/** A modifier on a JSON field that means something on a write and nothing on a call. */
|
|
5766
|
+
function writeOnlyModifier(shape) {
|
|
5767
|
+
if (shape.transform !== void 0) return "`.transform()`";
|
|
5768
|
+
if ((shape.kind === "string" || shape.kind === "date") && shape.stamp !== void 0) return shape.stamp === "createUser" || shape.stamp === "updateUser" ? "`.onCreateUser()` / `.onUpdateUser()`" : "`.onCreateNow()` / `.onUpdateNow()`";
|
|
5769
|
+
if (shape.kind === "object") for (const field of Object.values(shape.fields)) {
|
|
5770
|
+
const found = writeOnlyModifier(field);
|
|
5771
|
+
if (found) return found;
|
|
5772
|
+
}
|
|
5773
|
+
if (shape.kind === "array") return writeOnlyModifier(shape.of);
|
|
5774
|
+
if (shape.kind === "oneOf") for (const variant of Object.values(shape.variants)) {
|
|
5775
|
+
const found = writeOnlyModifier(variant);
|
|
5776
|
+
if (found) return found;
|
|
5777
|
+
}
|
|
5778
|
+
}
|
|
5779
|
+
function assertRateLimit(name, rateLimit) {
|
|
5780
|
+
if (rateLimit === void 0) return;
|
|
5781
|
+
if (typeof rateLimit !== "object" || rateLimit === null) throw new Error(`RPC "${name}": \`rateLimit\` is \`{ limit, windowMs }\`. A public RPC is always limited; to loosen it, raise \`limit\`.`);
|
|
5782
|
+
const limit = Reflect.get(rateLimit, "limit");
|
|
5783
|
+
const windowMs = Reflect.get(rateLimit, "windowMs");
|
|
5784
|
+
if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1) throw new Error(`RPC "${name}": \`rateLimit.limit\` must be a positive integer.`);
|
|
5785
|
+
if (typeof windowMs !== "number" || !Number.isFinite(windowMs) || windowMs <= 0) throw new Error(`RPC "${name}": \`rateLimit.windowMs\` must be a positive number of milliseconds.`);
|
|
5786
|
+
}
|
|
5787
|
+
/**
|
|
5788
|
+
* Expose a SQL function as `POST /api/rpc/<name>`, with a JSON body of named
|
|
5789
|
+
* arguments.
|
|
5790
|
+
*
|
|
5791
|
+
* Only declared functions are callable. Each call runs as the caller, like
|
|
5792
|
+
* `getSql(c)`: an anonymous caller as the anonymous identity, a signed-in one
|
|
5793
|
+
* as themselves under the tables' row-level security. A `SECURITY DEFINER`
|
|
5794
|
+
* function runs as its owner, as it does anywhere. The answer is the
|
|
5795
|
+
* function's result: an array of rows (or values) for a set-returning
|
|
5796
|
+
* function, the row or the value for any other.
|
|
5797
|
+
*
|
|
5798
|
+
* Export the result from `backend/schema/index.ts`, beside the tables.
|
|
5799
|
+
*
|
|
5800
|
+
* ```ts
|
|
5801
|
+
* // backend/schema/rpc.ts
|
|
5802
|
+
* import { defineRpc, json } from "@rebasepro/server/schema";
|
|
5803
|
+
*
|
|
5804
|
+
* export const getPublicProposal = defineRpc("get_public_proposal", {
|
|
5805
|
+
* access: "public",
|
|
5806
|
+
* args: { token: json.string().required() }
|
|
5807
|
+
* });
|
|
5808
|
+
* ```
|
|
5809
|
+
*
|
|
5810
|
+
* @group Schema
|
|
5811
|
+
*/
|
|
5812
|
+
function defineRpc(name, config) {
|
|
5813
|
+
if (typeof name !== "string" || !IDENTIFIER.test(name)) throw new Error(`defineRpc: ${JSON.stringify(name)} is not a function name an RPC can have. Use the SQL function's name as Postgres stores it: letters, digits and _, not starting with a digit (an unquoted \`CREATE FUNCTION getProposal\` is stored as \`getproposal\`).`);
|
|
5814
|
+
if (typeof config !== "object" || config === null) throw new Error(`RPC "${name}" needs a config: \`defineRpc("${name}", { access: "public" | "authenticated" })\`.`);
|
|
5815
|
+
const access = config.access;
|
|
5816
|
+
if (access !== "public" && access !== "authenticated") throw new Error(`RPC "${name}": \`access\` must be "public" or "authenticated" (received ${JSON.stringify(access)}). It is required: who may call a function is a decision, not a default.`);
|
|
5817
|
+
const schema = config.schema ?? "public";
|
|
5818
|
+
if (typeof schema !== "string" || !IDENTIFIER.test(schema)) throw new Error(`RPC "${name}": \`schema\` ${JSON.stringify(schema)} is not a schema name (letters, digits and _).`);
|
|
5819
|
+
if (RESERVED_SCHEMAS.has(schema)) throw new Error(`RPC "${name}": the "${schema}" schema holds the database's or the server's own functions, which are never exposed as RPCs.`);
|
|
5820
|
+
if (config.args !== void 0) {
|
|
5821
|
+
if (typeof config.args !== "object" || config.args === null || Array.isArray(config.args)) throw new Error(`RPC "${name}": \`args\` is an object of \`json.*\` fields, one per named argument.`);
|
|
5822
|
+
for (const [key, field] of Object.entries(config.args)) {
|
|
5823
|
+
if (!IDENTIFIER.test(key)) throw new Error(`RPC "${name}": argument ${JSON.stringify(key)} is not a SQL parameter name (letters, digits and _).`);
|
|
5824
|
+
if (!isJsonField(field)) throw new Error(`RPC "${name}": argument "${key}" must be a \`json.*\` field, such as \`json.string()\`.`);
|
|
5825
|
+
const modifier = writeOnlyModifier(field.shape);
|
|
5826
|
+
if (modifier) throw new Error(`RPC "${name}": argument "${key}" uses ${modifier}, which applies to a row being written, not to a call. Read the caller inside the function instead (\`auth.uid()\`, \`now()\`).`);
|
|
5827
|
+
}
|
|
5828
|
+
}
|
|
5829
|
+
if (config.write !== void 0 && typeof config.write !== "boolean") throw new Error(`RPC "${name}": \`write\` is true or false.`);
|
|
5830
|
+
assertRateLimit(name, config.rateLimit);
|
|
5831
|
+
return {
|
|
5832
|
+
brand: RPC_BRAND,
|
|
5833
|
+
name,
|
|
5834
|
+
config
|
|
5835
|
+
};
|
|
5836
|
+
}
|
|
5837
|
+
/**
|
|
5838
|
+
* Whether a value is the result of `defineRpc`, from this copy of the package
|
|
5839
|
+
* or another.
|
|
5840
|
+
*
|
|
5841
|
+
* @group Schema
|
|
5842
|
+
*/
|
|
5843
|
+
function isRpcDef(value) {
|
|
5844
|
+
return typeof value === "object" && value !== null && "brand" in value && value.brand === "rebase.rpc";
|
|
5845
|
+
}
|
|
5846
|
+
//#endregion
|
|
5258
5847
|
//#region src/schema/table_patch.ts
|
|
5259
5848
|
/** The keys of {@link TableOptionValues}, in the order a table prints them. */
|
|
5260
5849
|
var TABLE_OPTION_KEYS = [
|
|
@@ -5740,6 +6329,6 @@ function rulePatches(table, before, after) {
|
|
|
5740
6329
|
return out;
|
|
5741
6330
|
}
|
|
5742
6331
|
//#endregion
|
|
5743
|
-
export { ADMIN_ROLE, ADMIN_SCOPES, AGGREGATE_FUNCTIONS, AGGREGATE_GROUP_TRANSFORMS, ALL_WHERE_FILTER_OPS, ANONYMOUS_USER_ID, ANONYMOUS_USER_IDS, AUTH_FLOW_HEADER, BATCH_REF_KEY, BUILT_IN_SCOPES, BUILT_IN_SCOPE_DESCRIPTIONS, BUNDLE_FORMAT_VERSION, CANONICAL_TO_REST, COLUMN_BRAND, ColumnBuilder, DATA_PLANE_SCOPES, DEFAULT_CAPABILITIES, DEFAULT_COMMIT_PATHS, DEFAULT_DATA_SOURCE_KEY, DEFAULT_FILTERABLE_RELATION_KINDS, DEFAULT_FUZZY_THRESHOLD, DEFAULT_LIST_LIMIT, DEFAULT_RESOURCE_KEY, DEFAULT_SEARCH_COLUMN, DEFAULT_SEARCH_LANGUAGE, DEFAULT_SEARCH_MODE, DEFAULT_SEARCH_WEIGHT, DEFAULT_STORAGE_SOURCE_KEY, DEFAULT_TENANT_BYPASS_ROLES, DEFAULT_VECTOR_LIST_LIMIT, EMPTY_ACCESS_MODEL, FIELDLESS_AGGREGATES, FIELD_OPERATORS, FIREBASE_CAPABILITIES, IMPERSONATE_HEADER, INCLUDE_COUNT_KEY, JSON_FIELD_BRAND, JUNCTION_PIVOT_KEY, JsonField, KEY_MANAGEMENT_SCOPES, LEGACY_LAYOUT_REMEDY, LEGACY_RLS_JWT_SQL, LEGACY_RLS_ROLES_SQL, LEGACY_RLS_SCHEMA, LEGACY_RLS_UID_SQL, LEGACY_SCHEMA_VERSION_PREFIX, LIST_OPS, ListLimitError, MAX_INCLUDE_DEPTH, MAX_LIST_LIMIT, MCP_APP_MODULES, NULL_OPS, POLICY_EXPRESSION_KINDS, POSTGRES_CAPABILITIES, PUBLIC_STORAGE_PREFIX, REBASE_ADMIN_REQUEST_ROLE, REBASE_ADMIN_ROLE, REBASE_SCHEMA, RELATION_BRAND, RELEVANCE_SORT_FIELD, RESERVED_BACKEND_PREFIXES, RESOURCE_GRAPH_VERSION, REST_TO_CANONICAL, RLS_IS_ANONYMOUS_SQL, RLS_IS_REQUEST_ROLE_SQL, RLS_JWT_SQL, RLS_ROLES_SQL, RLS_UID_SQL, RUNTIME_CONTRACT_VERSION, RebaseApiError, RebaseClientError, SCHEMA_VERSION_HEADER, SCOPE_TARGETS, SIMULATED_CONTEXT_HEADER, SIMULATE_API_KEY_ID_HEADER, SIMULATE_ROLE_HEADER, SIMULATE_USER_ID_HEADER, STORAGE_REFERENCE_SCHEME, TABLE_BRAND, TABLE_OPTION_KEYS, TablePatchError, UI_PREFERENCE_FIELD_KEYS, UI_PREFERENCE_TABLE_KEYS, VIEW_BRAND, adminRequestRoleFor, aggregateAlias, aggregateGroupKey, amendResourceKind, bucket, buildResourceGraph, canonicalSchemaPayload, col, columnDefFromWire, columnTypeLabel, compareStaticRoutes, computeSchemaVersion, database, declareCron, declareFunction, declareResource, declaredDataSources, declaredDatabaseExtensions, declaredDatabaseRls, declaredQueueConsumers, declaredResources, declaredRlsPolicyShape, declaredStorageSources, declaredSubscriptions, defineAuthTable, defineTable, defineView, describeJsonShape, describeScope, encodeRelationAggregateSort, envBasesForResource, findEnvSuffixCollision, findStorageSuffixCollision, formatSimulatedContext, getDataSourceCapabilities, hasAdminRole, hasFieldOperation, holdsAdminRole, intersectScopes, isAdminScope, isAnonymousUid, isAuthTableDef, isBranchAdmin, isBuiltInScope, isChannelBusInstance, isColumnBuilder, isContentHashedFileName, isDataPlaneScope, isFieldOperation, isJsonColumnType, isJsonField, isNumericColumnType, isPercentileFraction, isPolicyExpressionKind, isPolicyShorthand, isPublicStorageKey, isPublicStoragePath, isRedactedSecurityRule, isRelationAggregateSort, isRelationDef, isResourceHandle, isSQLAdmin, isSchemaAdmin, isSchemaEditingAdmin, isSqlTemplate, isStorageReference, isTableDef, isTablePatchList, isTemporalColumnType, isTenantClaimSource, isTenantMembershipSource, isTextColumnType, isTimeZoneName, isUiTablePreferences, isUnsupported, isValidAppHost, isValidEngine, isViewDef, joinConditions, json, knownScopes, matchStaticRoute, mergeUiTablePreferences, normalizeColumnAccess, normalizeStorage, normalizeValidation, parseAppAddress, parseByteSize, parseCaseFoldedFieldPath, parseEnvBoolean, parseFrameAncestor, parseRelationAggregateSort, parseScope, parseSimulatedContext, parseStorageReference, parseTablePatches, pgEnum, policy, queue, registerDataSourceCapabilities, registerResourceKind, rel, reservedPrefixFor, resetDeclaredQueueConsumers, resetDeclaredResources, resetDeclaredSubscriptions, resolveClientListLimit, resolveResourceRefs, resolveStorageReferences, resourceEnvSuffix, resourceId, resourceKeyOf, resourceKind, resourceKinds, resourceToDataSource, resourceToStorageSource, rewriteLegacyRlsFunctions, roleNameProblem, rulePatches, scopeAcceptsTarget, scopeGrants, scopeGrantsAny, scopeTargets, scopesBeyond, scopesForRoles, setQueueRuntime, setTopicRuntime, simulationHeaders, soleJoinCondition, sortKeyToString, sql, storageEnvSuffix, storageObjectPath, storageReference, storageReferencesForDownloadUrls, storageTargetOfDownloadUrl, storageTargetsInText, summarizeRoles, summarizeScopes, tablePatchProblems, toCanonicalOp, toDriverAggregate, toDriverAggregateGroup, topic, uiTablePreferencesProblems, unsupportedMethod, usesLegacyRlsFunctions, validateScopes, validateStaticRoute };
|
|
6332
|
+
export { ADMIN_ROLE, ADMIN_SCOPES, AGGREGATE_FUNCTIONS, AGGREGATE_GROUP_TRANSFORMS, ALL_WHERE_FILTER_OPS, ANONYMOUS_USER_ID, ANONYMOUS_USER_IDS, AUTH_FLOW_HEADER, BATCH_REF_KEY, BUILT_IN_SCOPES, BUILT_IN_SCOPE_DESCRIPTIONS, BUNDLE_FORMAT_VERSION, CANONICAL_TO_REST, COLUMN_BRAND, ColumnBuilder, DATA_PLANE_SCOPES, DEFAULT_CAPABILITIES, DEFAULT_COMMIT_PATHS, DEFAULT_DATA_SOURCE_KEY, DEFAULT_FILTERABLE_RELATION_KINDS, DEFAULT_FUZZY_THRESHOLD, DEFAULT_LIST_LIMIT, DEFAULT_PUBLIC_RPC_RATE_LIMIT, DEFAULT_RESOURCE_KEY, DEFAULT_SEARCH_COLUMN, DEFAULT_SEARCH_LANGUAGE, DEFAULT_SEARCH_MODE, DEFAULT_SEARCH_WEIGHT, DEFAULT_STATIC_REDIRECT_STATUS, DEFAULT_STORAGE_SOURCE_KEY, DEFAULT_TENANT_BYPASS_ROLES, DEFAULT_VECTOR_LIST_LIMIT, EMPTY_ACCESS_MODEL, FIELDLESS_AGGREGATES, FIELD_OPERATORS, FIREBASE_CAPABILITIES, IMPERSONATE_HEADER, INCLUDE_COUNT_KEY, JSON_FIELD_BRAND, JUNCTION_PIVOT_KEY, JsonField, KEY_MANAGEMENT_SCOPES, LEGACY_LAYOUT_REMEDY, LEGACY_RLS_JWT_SQL, LEGACY_RLS_ROLES_SQL, LEGACY_RLS_SCHEMA, LEGACY_RLS_UID_SQL, LEGACY_SCHEMA_VERSION_PREFIX, LIST_OPS, ListLimitError, MAX_IMPORTED_USER_ID_LENGTH, MAX_INCLUDE_DEPTH, MAX_LIST_LIMIT, MAX_USERS_PER_IMPORT, MCP_APP_MODULES, NULL_OPS, POLICY_EXPRESSION_KINDS, POSTGRES_CAPABILITIES, PUBLIC_STORAGE_PREFIX, REBASE_ADMIN_REQUEST_ROLE, REBASE_ADMIN_ROLE, REBASE_SCHEMA, RECOMMENDED_STORAGE_RULES, RELATION_BRAND, RELEVANCE_SORT_FIELD, RESERVED_BACKEND_PREFIXES, RESOURCE_GRAPH_VERSION, REST_TO_CANONICAL, RLS_IS_ANONYMOUS_SQL, RLS_IS_REQUEST_ROLE_SQL, RLS_JWT_SQL, RLS_ROLES_SQL, RLS_UID_SQL, RPC_BRAND, RUNTIME_CONTRACT_VERSION, RebaseApiError, RebaseClientError, SCHEMA_VERSION_HEADER, SCOPE_TARGETS, SIMULATED_CONTEXT_HEADER, SIMULATE_API_KEY_ID_HEADER, SIMULATE_ROLE_HEADER, SIMULATE_USER_ID_HEADER, STATIC_REDIRECT_STATUSES, STORAGE_REFERENCE_SCHEME, TABLE_BRAND, TABLE_OPTION_KEYS, TablePatchError, UI_PREFERENCE_FIELD_KEYS, UI_PREFERENCE_TABLE_KEYS, VIEW_BRAND, adminRequestRoleFor, aggregateAlias, aggregateGroupKey, amendResourceKind, bucket, buildResourceGraph, canonicalSchemaPayload, cleanUrlFor, col, columnDefFromWire, columnTypeLabel, compareStaticRoutes, compileStaticRedirects, computeSchemaVersion, database, declareCron, declareFunction, declareResource, declaredDataSources, declaredDatabaseExtensions, declaredDatabaseRls, declaredQueueConsumers, declaredResources, declaredRlsPolicyShape, declaredStorageSources, declaredSubscriptions, defineAuthTable, defineRpc, defineTable, defineView, describeJsonShape, describeScope, encodeRelationAggregateSort, envBasesForResource, findEnvSuffixCollision, findStorageSuffixCollision, formatSimulatedContext, getDataSourceCapabilities, hasAdminRole, hasFieldOperation, holdsAdminRole, importedUserIdProblem, intersectScopes, isAdminScope, isAnonymousUid, isAuthTableDef, isBranchAdmin, isBuiltInScope, isChannelBusInstance, isColumnBuilder, isContentHashedFileName, isDataPlaneScope, isFieldOperation, isJsonColumnType, isJsonField, isNumericColumnType, isPercentileFraction, isPolicyExpressionKind, isPolicyShorthand, isPublicStorageKey, isPublicStoragePath, isRedactedSecurityRule, isRelationAggregateSort, isRelationDef, isResourceHandle, isRpcDef, isSQLAdmin, isSchemaAdmin, isSchemaEditingAdmin, isSqlTemplate, isStaticRedirectStatus, isStorageReference, isTableDef, isTablePatchList, isTemporalColumnType, isTenantClaimSource, isTenantMembershipSource, isTextColumnType, isTimeZoneName, isUiTablePreferences, isUnsupported, isValidAppHost, isValidEngine, isViewDef, joinConditions, json, knownScopes, matchStaticRoute, mergeUiTablePreferences, normalizeColumnAccess, normalizeStorage, normalizeValidation, parseAppAddress, parseByteSize, parseCaseFoldedFieldPath, parseEnvBoolean, parseFrameAncestor, parseRelationAggregateSort, parseScope, parseSimulatedContext, parseStorageReference, parseTablePatches, pgEnum, policy, queue, registerDataSourceCapabilities, registerResourceKind, rel, reservedPrefixFor, resetDeclaredQueueConsumers, resetDeclaredResources, resetDeclaredSubscriptions, resolveClientListLimit, resolveResourceRefs, resolveStorageReferences, resourceEnvSuffix, resourceId, resourceKeyOf, resourceKind, resourceKinds, resourceToDataSource, resourceToStorageSource, rewriteLegacyRlsFunctions, roleNameProblem, rulePatches, scopeAcceptsTarget, scopeGrants, scopeGrantsAny, scopeTargets, scopesBeyond, scopesForRoles, setQueueRuntime, setTopicRuntime, simulationHeaders, soleJoinCondition, sortKeyToString, sql, storageEnvSuffix, storageObjectPath, storageReference, storageReferencesForDownloadUrls, storageTargetOfDownloadUrl, storageTargetsInText, summarizeRoles, summarizeScopes, tablePatchProblems, toCanonicalOp, toDriverAggregate, toDriverAggregateGroup, topic, uiTablePreferencesProblems, unsupportedMethod, usesLegacyRlsFunctions, validateScopes, validateStaticRedirect, validateStaticRoute };
|
|
5744
6333
|
|
|
5745
6334
|
//# sourceMappingURL=index.es.js.map
|