@cobre-npm/library-portal-core 0.51.0 → 0.52.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/README.md
CHANGED
|
@@ -490,7 +490,7 @@ verified against its real DTO and entity, not against what any consumer had gues
|
|
|
490
490
|
|
|
491
491
|
```ts
|
|
492
492
|
import {
|
|
493
|
-
type ExportRequest, type ExportQueryConfig, type ExportQueryFilter, type ExportQuerySort,
|
|
493
|
+
type ExportRequest, type ExportQueryConfig, type ExportQueryFilter, type ExportFilterCondition, type ExportQuerySort,
|
|
494
494
|
type ExportResponse, type ExportStatus, type ExportCreator, type ExportStatusState,
|
|
495
495
|
EXPORT_FORMATS, type ExportFormat,
|
|
496
496
|
EXPORT_QUERY_OPERATORS, type ExportQueryOperator,
|
|
@@ -502,10 +502,13 @@ import {
|
|
|
502
502
|
`status`/`updated_at`/`export_path` in place as it processes. Both the exports list/status view in
|
|
503
503
|
`portal` and any widget that creates exports read/write this one shape; keeping two hand-typed copies
|
|
504
504
|
is what let each one drift from the real contract in its own way (see the two fixes below).
|
|
505
|
-
- `EXPORT_QUERY_OPERATORS` is the engine's **real** allow-list (`eq`, `gt`, `lt`, `lte`, `gte`) — narrower
|
|
506
|
-
than what a layout's catalog is allowed to declare (`between`, `in`, `like
|
|
505
|
+
- `EXPORT_QUERY_OPERATORS` is the engine's **real** allow-list (`eq`, `neq`, `gt`, `lt`, `lte`, `gte`) — narrower
|
|
506
|
+
than what a layout's catalog is allowed to declare (`between`, `in`, `like` are valid catalog
|
|
507
507
|
entries the engine still rejects at request time). A consumer validating a filter before sending it
|
|
508
508
|
needs the intersection of both, not just the catalog's.
|
|
509
|
+
- `ExportFilterCondition` is an `ExportQueryFilter` before its `type` is resolved
|
|
510
|
+
(`{ column: "state", operator: "neq", value: "pending_funds" }`). The type belongs to the layout's catalog,
|
|
511
|
+
so whoever reads the catalog fills it in and the column's type keeps one source of truth.
|
|
509
512
|
- `ExportQuerySort` uses `field`; `ExportQueryFilter` uses `column` — not a typo, the engine's own DTOs
|
|
510
513
|
name the two differently.
|
|
511
514
|
- `column_aggregations` is a required `boolean` (apply aggregations or don't), not a per-column map — the
|
|
@@ -9,10 +9,11 @@ export type ExportFormat = typeof EXPORT_FORMATS[keyof typeof EXPORT_FORMATS];
|
|
|
9
9
|
/**
|
|
10
10
|
* The export engine's real allow-list (verified against util-platform-exports'
|
|
11
11
|
* QueryOperator enum). A layout's catalog can declare more operators than this
|
|
12
|
-
* ("between", "in", "like"
|
|
12
|
+
* ("between", "in", "like") — those are rejected by the engine at request time.
|
|
13
13
|
*/
|
|
14
14
|
export declare const EXPORT_QUERY_OPERATORS: {
|
|
15
15
|
readonly EQ: "eq";
|
|
16
|
+
readonly NEQ: "neq";
|
|
16
17
|
readonly GT: "gt";
|
|
17
18
|
readonly LT: "lt";
|
|
18
19
|
readonly LTE: "lte";
|
|
@@ -25,10 +25,11 @@ exports.EXPORT_FORMATS = {
|
|
|
25
25
|
/**
|
|
26
26
|
* The export engine's real allow-list (verified against util-platform-exports'
|
|
27
27
|
* QueryOperator enum). A layout's catalog can declare more operators than this
|
|
28
|
-
* ("between", "in", "like"
|
|
28
|
+
* ("between", "in", "like") — those are rejected by the engine at request time.
|
|
29
29
|
*/
|
|
30
30
|
exports.EXPORT_QUERY_OPERATORS = {
|
|
31
31
|
EQ: "eq",
|
|
32
|
+
NEQ: "neq",
|
|
32
33
|
GT: "gt",
|
|
33
34
|
LT: "lt",
|
|
34
35
|
LTE: "lte",
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ExportQueryOperator } from "../index";
|
|
2
|
-
export interface
|
|
2
|
+
export interface ExportFilterCondition {
|
|
3
3
|
column: string;
|
|
4
|
-
type: string;
|
|
5
4
|
operator: ExportQueryOperator;
|
|
6
5
|
value: string;
|
|
7
6
|
}
|
|
7
|
+
export interface ExportQueryFilter extends ExportFilterCondition {
|
|
8
|
+
type: string;
|
|
9
|
+
}
|
|
8
10
|
export interface ExportQuerySort {
|
|
9
11
|
field: string;
|
|
10
12
|
order: "asc" | "desc";
|
|
@@ -8,10 +8,11 @@ export const EXPORT_FORMATS = {
|
|
|
8
8
|
/**
|
|
9
9
|
* The export engine's real allow-list (verified against util-platform-exports'
|
|
10
10
|
* QueryOperator enum). A layout's catalog can declare more operators than this
|
|
11
|
-
* ("between", "in", "like"
|
|
11
|
+
* ("between", "in", "like") — those are rejected by the engine at request time.
|
|
12
12
|
*/
|
|
13
13
|
export const EXPORT_QUERY_OPERATORS = {
|
|
14
14
|
EQ: "eq",
|
|
15
|
+
NEQ: "neq",
|
|
15
16
|
GT: "gt",
|
|
16
17
|
LT: "lt",
|
|
17
18
|
LTE: "lte",
|