@byline/db-postgres 2.5.1 → 2.5.2
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.
|
@@ -443,10 +443,10 @@ export declare class DocumentQueries implements IDocumentQueries {
|
|
|
443
443
|
*/
|
|
444
444
|
private buildCombinatorGroup;
|
|
445
445
|
/**
|
|
446
|
-
* Compile a `DocumentColumnFilter` against the outer scope's status
|
|
447
|
-
* path column. Plain comparison — no EXISTS — because the
|
|
448
|
-
* directly on the outer relation (
|
|
449
|
-
* EAV stores.
|
|
446
|
+
* Compile a `DocumentColumnFilter` against the outer scope's `status`,
|
|
447
|
+
* `path`, or `id` column. Plain comparison — no EXISTS — because the
|
|
448
|
+
* column lives directly on the outer relation (current-documents view),
|
|
449
|
+
* not in the EAV stores.
|
|
450
450
|
*/
|
|
451
451
|
private buildDocColumnFilter;
|
|
452
452
|
/**
|
|
@@ -296,6 +296,7 @@ export class DocumentQueries {
|
|
|
296
296
|
if (filters?.length) {
|
|
297
297
|
const outerScope = {
|
|
298
298
|
docVersionId: sql `${view.id}`,
|
|
299
|
+
documentId: sql `${view.document_id}`,
|
|
299
300
|
status: sql `${view.status}`,
|
|
300
301
|
path: this.pathProjection(sql `${view.document_id}`, locale),
|
|
301
302
|
};
|
|
@@ -363,6 +364,7 @@ export class DocumentQueries {
|
|
|
363
364
|
if (filters?.length) {
|
|
364
365
|
const outerScope = {
|
|
365
366
|
docVersionId: sql `${view.id}`,
|
|
367
|
+
documentId: sql `${view.document_id}`,
|
|
366
368
|
status: sql `${view.status}`,
|
|
367
369
|
path: this.pathProjection(sql `${view.document_id}`, locale),
|
|
368
370
|
};
|
|
@@ -496,6 +498,7 @@ export class DocumentQueries {
|
|
|
496
498
|
if (filters?.length) {
|
|
497
499
|
const outerScope = {
|
|
498
500
|
docVersionId: sql `${view.id}`,
|
|
501
|
+
documentId: sql `${view.document_id}`,
|
|
499
502
|
status: sql `${view.status}`,
|
|
500
503
|
path: this.pathProjection(sql `${view.document_id}`, filterLocale),
|
|
501
504
|
};
|
|
@@ -674,6 +677,7 @@ export class DocumentQueries {
|
|
|
674
677
|
if (filters?.length) {
|
|
675
678
|
const outerScope = {
|
|
676
679
|
docVersionId: sql `${currentDocumentsView.id}`,
|
|
680
|
+
documentId: sql `${currentDocumentsView.document_id}`,
|
|
677
681
|
status: sql `${currentDocumentsView.status}`,
|
|
678
682
|
path: this.pathProjection(sql `${currentDocumentsView.document_id}`, this.defaultContentLocale),
|
|
679
683
|
};
|
|
@@ -851,6 +855,7 @@ export class DocumentQueries {
|
|
|
851
855
|
for (const filter of filters) {
|
|
852
856
|
conditions.push(this.buildFilterExists(filter, locale, {
|
|
853
857
|
docVersionId: sql `d.id`,
|
|
858
|
+
documentId: sql `d.document_id`,
|
|
854
859
|
status: sql `d.status`,
|
|
855
860
|
path: this.pathProjection(sql `d.document_id`, locale),
|
|
856
861
|
}, readMode, 0));
|
|
@@ -980,13 +985,17 @@ export class DocumentQueries {
|
|
|
980
985
|
return sql `(${sql.join(childSql, joiner)})`;
|
|
981
986
|
}
|
|
982
987
|
/**
|
|
983
|
-
* Compile a `DocumentColumnFilter` against the outer scope's status
|
|
984
|
-
* path column. Plain comparison — no EXISTS — because the
|
|
985
|
-
* directly on the outer relation (
|
|
986
|
-
* EAV stores.
|
|
988
|
+
* Compile a `DocumentColumnFilter` against the outer scope's `status`,
|
|
989
|
+
* `path`, or `id` column. Plain comparison — no EXISTS — because the
|
|
990
|
+
* column lives directly on the outer relation (current-documents view),
|
|
991
|
+
* not in the EAV stores.
|
|
987
992
|
*/
|
|
988
993
|
buildDocColumnFilter(filter, outerScope) {
|
|
989
|
-
const column = filter.column === 'status'
|
|
994
|
+
const column = filter.column === 'status'
|
|
995
|
+
? outerScope.status
|
|
996
|
+
: filter.column === 'path'
|
|
997
|
+
? outerScope.path
|
|
998
|
+
: outerScope.documentId;
|
|
990
999
|
return this.buildFilterCondition(column, filter.operator, filter.value);
|
|
991
1000
|
}
|
|
992
1001
|
/**
|
|
@@ -1035,6 +1044,7 @@ export class DocumentQueries {
|
|
|
1035
1044
|
const tdAlias = sql.raw(`td${depth}`);
|
|
1036
1045
|
const innerScope = {
|
|
1037
1046
|
docVersionId: sql.raw(`td${depth}.id`),
|
|
1047
|
+
documentId: sql.raw(`td${depth}.document_id`),
|
|
1038
1048
|
status: sql.raw(`td${depth}.status`),
|
|
1039
1049
|
// `td${depth}.path` no longer exists on the view; resolve via the
|
|
1040
1050
|
// locale priority chain against byline_document_paths instead.
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@byline/db-postgres",
|
|
3
3
|
"private": false,
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
|
-
"version": "2.5.
|
|
5
|
+
"version": "2.5.2",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.9.0"
|
|
8
8
|
},
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"pg": "^8.21.0",
|
|
58
58
|
"uuid": "^14.0.0",
|
|
59
59
|
"zod": "^4.4.3",
|
|
60
|
-
"@byline/
|
|
61
|
-
"@byline/
|
|
62
|
-
"@byline/core": "2.5.
|
|
60
|
+
"@byline/auth": "2.5.2",
|
|
61
|
+
"@byline/admin": "2.5.2",
|
|
62
|
+
"@byline/core": "2.5.2"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@biomejs/biome": "2.4.15",
|