@rebasepro/server-postgres 0.11.1-canary.gfadf355 → 0.12.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/{ensure-collection-tables-BdqIpI0G.js → ensure-collection-tables-CNTcZGvn.js} +3 -3
- package/dist/{ensure-collection-tables-BdqIpI0G.js.map → ensure-collection-tables-CNTcZGvn.js.map} +1 -1
- package/dist/history/HistoryService.d.ts +9 -29
- package/dist/index.es.js +5 -4
- package/dist/index.es.js.map +1 -1
- package/dist/{src-Cn0_95uv.js → src-BbFOPJ1S.js} +7 -7
- package/dist/src-BbFOPJ1S.js.map +1 -0
- package/dist/{src-C5hyt1Um.js → src-Zqwaw3P5.js} +136 -109
- package/dist/src-Zqwaw3P5.js.map +1 -0
- package/package.json +6 -6
- package/src/PostgresBootstrapper.ts +4 -2
- package/src/history/HistoryService.ts +13 -31
- package/dist/src-C5hyt1Um.js.map +0 -1
- package/dist/src-Cn0_95uv.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from "module";
|
|
|
2
2
|
import "process";
|
|
3
3
|
__createRequire(import.meta.url);
|
|
4
4
|
import { r as __require, t as __commonJSMin } from "./chunk-DSJWtz9O.js";
|
|
5
|
-
import {
|
|
5
|
+
import { a as policy, c as getDeclaredSubcollections, f as getDataSourceCapabilities, g as EntityRelation, h as toCanonicalOp, i as ANONYMOUS_USER_ID, l as isPostgresCollectionConfig, m as REST_TO_CANONICAL, p as NULL_OPS, s as isManyToMany, u as isRelationalCollectionConfig } from "./src-Zqwaw3P5.js";
|
|
6
6
|
//#region ../common/src/util/common.ts
|
|
7
7
|
var DEFAULT_ONE_OF_TYPE = "type";
|
|
8
8
|
var DEFAULT_ONE_OF_VALUE = "value";
|
|
@@ -1527,7 +1527,7 @@ var _resolvedRelationsCache = /* @__PURE__ */ new WeakMap();
|
|
|
1527
1527
|
function resolveCollectionRelations(collection) {
|
|
1528
1528
|
const cached = _resolvedRelationsCache.get(collection);
|
|
1529
1529
|
if (cached) return cached;
|
|
1530
|
-
if (!
|
|
1530
|
+
if (!isRelationalCollectionConfig(collection)) return {};
|
|
1531
1531
|
const relations = {};
|
|
1532
1532
|
for (const relation of collection.relations ?? []) {
|
|
1533
1533
|
const resolved = resolveRelation(relation, collection);
|
|
@@ -1543,7 +1543,7 @@ function resolveCollectionRelations(collection) {
|
|
|
1543
1543
|
return relations;
|
|
1544
1544
|
}
|
|
1545
1545
|
function getTableName(collection) {
|
|
1546
|
-
if (
|
|
1546
|
+
if (isRelationalCollectionConfig(collection)) return collection.table ?? toSnakeCase(collection.slug) ?? toSnakeCase(collection.name);
|
|
1547
1547
|
return toSnakeCase(collection.slug) ?? toSnakeCase(collection.name);
|
|
1548
1548
|
}
|
|
1549
1549
|
function getTableVarName(tableName) {
|
|
@@ -2152,8 +2152,8 @@ function getIdPropertyName$1(collection) {
|
|
|
2152
2152
|
* Collections that opt out via `disableDefaultPolicies` are returned unchanged.
|
|
2153
2153
|
*/
|
|
2154
2154
|
function getEffectiveSecurityRules(collection) {
|
|
2155
|
-
const explicit = [...
|
|
2156
|
-
if (collection.disableDefaultPolicies) return explicit;
|
|
2155
|
+
const explicit = [...collection.securityRules ?? []];
|
|
2156
|
+
if (isPostgresCollectionConfig(collection) && collection.disableDefaultPolicies) return explicit;
|
|
2157
2157
|
const tableName = getTableName(collection);
|
|
2158
2158
|
const injected = [];
|
|
2159
2159
|
injected.push({
|
|
@@ -2324,7 +2324,7 @@ function coversUpdate(rule) {
|
|
|
2324
2324
|
* stays locked (RLS is still enabled) until they write policies for it.
|
|
2325
2325
|
*/
|
|
2326
2326
|
function getJunctionSecurityRules(spec) {
|
|
2327
|
-
if (spec.declaringSides.every((side) => side.collection.disableDefaultPolicies)) return [];
|
|
2327
|
+
if (spec.declaringSides.every((side) => isPostgresCollectionConfig(side.collection) && side.collection.disableDefaultPolicies)) return [];
|
|
2328
2328
|
const rules = [];
|
|
2329
2329
|
rules.push({
|
|
2330
2330
|
name: `${spec.table}_default_admin_read`,
|
|
@@ -4170,4 +4170,4 @@ async function detectJunctionTables(executeSql) {
|
|
|
4170
4170
|
//#endregion
|
|
4171
4171
|
export { toSnakeCase as A, createRelationRefWithData as C, getPolicyNamesForRule as D, generateForeignKeyName as E, DEFAULT_ONE_OF_VALUE as M, mergeDeep as O, createRelationRef as S, updateDateAutoValues as T, getTableVarName as _, getJunctionCollectionConfig as a, getDeclaredPrimaryKeys as b, getEffectiveSecurityRules as c, securityRuleToConditions as d, findAnonymousGrants as f, getTableName as g, getEnumVarName as h, CollectionRegistry as i, DEFAULT_ONE_OF_TYPE as j, camelCase as k, buildPropertyCallbacks as l, getColumnName as m, detectJunctionTables as n, getJunctionSecurityRules as o, findRelation as p, buildSdkData as r, resolveJunctionSpecs as s, classifyTable as t, policyToPostgres as u, resolveCollectionRelations as v, normalizeToEntityRelation as w, parseIdValues as x, buildCompositeId as y };
|
|
4172
4172
|
|
|
4173
|
-
//# sourceMappingURL=src-
|
|
4173
|
+
//# sourceMappingURL=src-BbFOPJ1S.js.map
|