@rebasepro/server-postgres 0.14.2-canary.gf913b76 → 0.15.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/{auth-users-columns-DLwxDqYb.js → auth-users-columns-JJ8ngvy5.js} +16 -6
- package/dist/{auth-users-columns-DLwxDqYb.js.map → auth-users-columns-JJ8ngvy5.js.map} +1 -1
- package/dist/{backup-service-BH0Dzo_h.js → backup-service-czK-OAuG.js} +2 -2
- package/dist/{backup-service-BH0Dzo_h.js.map → backup-service-czK-OAuG.js.map} +1 -1
- package/dist/{ensure-collection-policies-CjPPtN0e.js → ensure-collection-policies-D5PtQLyR.js} +3 -3
- package/dist/{ensure-collection-policies-CjPPtN0e.js.map → ensure-collection-policies-D5PtQLyR.js.map} +1 -1
- package/dist/{ensure-collection-tables-Dnb7scJ1.js → ensure-collection-tables-BHUjQ-z4.js} +3 -3
- package/dist/{ensure-collection-tables-Dnb7scJ1.js.map → ensure-collection-tables-BHUjQ-z4.js.map} +1 -1
- package/dist/index.es.js +448 -17
- package/dist/index.es.js.map +1 -1
- package/dist/{rls-bootstrap-sql-69hYT8nr.js → rls-bootstrap-sql-B5Sajku6.js} +2 -2
- package/dist/{rls-bootstrap-sql-69hYT8nr.js.map → rls-bootstrap-sql-B5Sajku6.js.map} +1 -1
- package/dist/{rls-enforcement-BpsYVDGM.js → rls-enforcement-BDBfuTD4.js} +3 -3
- package/dist/{rls-enforcement-BpsYVDGM.js.map → rls-enforcement-BDBfuTD4.js.map} +1 -1
- package/dist/services/FetchService.d.ts +22 -0
- package/dist/{src-DCdn3Val.js → src-BBFsDaeA.js} +60 -2
- package/dist/src-BBFsDaeA.js.map +1 -0
- package/dist/utils/drizzle-conditions.d.ts +168 -1
- package/dist/{websocket-D2jXv0Ds.js → websocket-BVgDVO-V.js} +2 -2
- package/dist/{websocket-D2jXv0Ds.js.map → websocket-BVgDVO-V.js.map} +1 -1
- package/package.json +6 -6
- package/src/services/FetchService.ts +155 -15
- package/src/utils/drizzle-conditions.ts +594 -1
- package/dist/src-DCdn3Val.js.map +0 -1
|
@@ -3,7 +3,7 @@ import "process";
|
|
|
3
3
|
__createRequire(import.meta.url);
|
|
4
4
|
import { l as __require, s as __commonJSMin } from "./connection-BuZ97wsr.js";
|
|
5
5
|
import { a as policy, i as ANONYMOUS_USER_IDS, r as ANONYMOUS_USER_ID } from "./data_driver-ULAyJEi9.js";
|
|
6
|
-
import { a as rewriteLegacyRlsFunctions, c as isPostgresCollectionConfig, d as getDataSourceCapabilities, f as ALL_WHERE_FILTER_OPS,
|
|
6
|
+
import { _ as isRelationAggregateSort, a as rewriteLegacyRlsFunctions, b as toCanonicalOp, c as isPostgresCollectionConfig, d as getDataSourceCapabilities, f as ALL_WHERE_FILTER_OPS, h as REST_TO_CANONICAL, i as RLS_UID_SQL, l as isRelationalCollectionConfig, m as NULL_OPS, p as CANONICAL_TO_REST, r as RLS_ROLES_SQL, s as getDeclaredSubcollections, y as sortKeyToString } from "./src-BBFsDaeA.js";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
//#region ../types/src/types/entities.ts
|
|
9
9
|
/**
|
|
@@ -4058,6 +4058,13 @@ var CollectionRegistry = class {
|
|
|
4058
4058
|
* the same value; the two are told apart by whether the first element is
|
|
4059
4059
|
* itself an array, which no field name ever is.
|
|
4060
4060
|
*
|
|
4061
|
+
* This is also where a {@link RelationAggregateSort} object stops being an
|
|
4062
|
+
* object. Above this function a sort key may be either spelling; below it,
|
|
4063
|
+
* every key is a string — which is what `OrderByTuple`, the REST parameter, the
|
|
4064
|
+
* driver contract and the cursor all already were. Doing it here means the one
|
|
4065
|
+
* place that already collapses the two *shapes* of a sort also collapses the
|
|
4066
|
+
* two *spellings* of a key, rather than every consumer learning about both.
|
|
4067
|
+
*
|
|
4061
4068
|
* @returns The keys in order of significance, or `undefined` for no sort. An
|
|
4062
4069
|
* empty list also returns `undefined` — "sort by nothing" is no sort, and
|
|
4063
4070
|
* letting `[]` through would have every layer below re-deciding what it meant.
|
|
@@ -4065,7 +4072,8 @@ var CollectionRegistry = class {
|
|
|
4065
4072
|
function normalizeOrderBy(orderBy) {
|
|
4066
4073
|
if (!orderBy || orderBy.length === 0) return void 0;
|
|
4067
4074
|
const list = Array.isArray(orderBy[0]) ? orderBy : [orderBy];
|
|
4068
|
-
|
|
4075
|
+
if (list.length === 0) return void 0;
|
|
4076
|
+
return list.map(([key, direction]) => [sortKeyToString(key), direction]);
|
|
4069
4077
|
}
|
|
4070
4078
|
/**
|
|
4071
4079
|
* Collapse the driver-level `{orderBy, order}` pair into the list form.
|
|
@@ -4112,14 +4120,16 @@ function parseOrderBySpecStrict(raw, order) {
|
|
|
4112
4120
|
if (raw === void 0 || raw === null || raw === "") return void 0;
|
|
4113
4121
|
if (typeof raw === "string") return normalizeDriverOrderBy(raw, order);
|
|
4114
4122
|
if (!Array.isArray(raw) || raw.length === 0) throw new OrderBySpecError(`${typeof raw} is not a field name or a list of sort keys`);
|
|
4115
|
-
if (typeof raw[0] === "string") return [toStrictTuple(raw, 0)];
|
|
4123
|
+
if (typeof raw[0] === "string" || isRelationAggregateSort(raw[0])) return [toStrictTuple(raw, 0)];
|
|
4116
4124
|
return raw.map(toStrictTuple);
|
|
4117
4125
|
}
|
|
4118
4126
|
function toStrictTuple(raw, index) {
|
|
4119
|
-
if (!Array.isArray(raw)
|
|
4127
|
+
if (!Array.isArray(raw)) throw new OrderBySpecError(`entry ${index} has no field name`);
|
|
4128
|
+
const key = isRelationAggregateSort(raw[0]) ? sortKeyToString(raw[0]) : raw[0];
|
|
4129
|
+
if (typeof key !== "string" || key.trim() === "") throw new OrderBySpecError(`entry ${index} has no field name`);
|
|
4120
4130
|
const direction = raw[1];
|
|
4121
4131
|
if (direction !== void 0 && direction !== "asc" && direction !== "desc") throw new OrderBySpecError(`entry ${index} has direction '${String(direction)}'`);
|
|
4122
|
-
return [
|
|
4132
|
+
return [key, direction ?? "asc"];
|
|
4123
4133
|
}
|
|
4124
4134
|
//#endregion
|
|
4125
4135
|
//#region ../common/src/data/query_builder.ts
|
|
@@ -5694,4 +5704,4 @@ function isAuthCollection(collection) {
|
|
|
5694
5704
|
//#endregion
|
|
5695
5705
|
export { mergeDeep as $, fieldKeyForColumn as A, parseIdValues as B, getJunctionCollectionConfig as C, policyToPostgres as D, getEffectiveSecurityRules as E, getTableVarName as F, updateDateAutoValues as G, createRelationRef as H, resolveCollectionRelations as I, legacyForeignKeyName as J, firstFreeKey as K, buildCompositeId as L, getColumnName as M, getEnumVarName as N, securityRuleToConditions as O, getTableName as P, isPrototypePollutingKey as Q, getDeclaredPrimaryKeys as R, resolveStringColumnLength as S, resolveJunctionSpecs as T, createRelationRefWithData as U, sortCollectionsBySlug as V, normalizeToEntityRelation as W, toWireKey as X, toPostgresIdentifier as Y, getPolicyNamesForRule as Z, OrderBySpecError as _, SEARCH_STAMP_PREFIX as a, isManyToMany as at, CollectionRegistry as b, assertSearchIsPostgresOnly as c, searchColumnStamps as d, camelCase as et, searchExtensionStatements as f, buildSdkData as g, visibleColumnProjection as h, isAuthCollection as i, hasForeignKeyOnTarget as it, findRelation as j, findAnonymousGrants as k, buildSearchColumnSpec as l, searchIndexStatements as m, authUsersColumnDefinition as n, DEFAULT_ONE_OF_TYPE as nt, SEARCH_TEXT_FN as o, Vector as ot, searchHelperFunctions as p, generateForeignKeyName as q, authUsersColumnSql as r, DEFAULT_ONE_OF_VALUE as rt, SEARCH_UNACCENT_FN as s, AUTH_USERS_COLUMNS as t, toSnakeCase as tt, hiddenColumnsOption as u, normalizeDriverOrderBy as v, getJunctionSecurityRules as w, relationalCollections as x, parseOrderBySpecStrict as y, isAddressableId as z };
|
|
5696
5706
|
|
|
5697
|
-
//# sourceMappingURL=auth-users-columns-
|
|
5707
|
+
//# sourceMappingURL=auth-users-columns-JJ8ngvy5.js.map
|