@attlaz/client 1.94.0 → 1.96.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/DataQuality/Model/QualityDataset.d.ts +7 -1
- package/dist/DataQuality/Model/QualityDataset.js +9 -1
- package/dist/DataQuality/Model/QualityEntity.d.ts +1 -1
- package/dist/DataQuality/Model/QualityEntity.js +1 -1
- package/dist/DataQuality/Model/{QualitySuppression.d.ts → QualityEntityProblemSuppression.d.ts} +3 -3
- package/dist/DataQuality/Model/{QualitySuppression.js → QualityEntityProblemSuppression.js} +3 -3
- package/dist/DataQuality/Model/QualityEntityProblemSuppressionResult.d.ts +6 -0
- package/dist/DataQuality/Model/QualityProblem.d.ts +1 -1
- package/dist/DataQuality/Model/QualityProblem.js +1 -1
- package/dist/DataQuality/Model/QualityProblemDefinition.d.ts +29 -0
- package/dist/DataQuality/Model/QualityProblemDefinition.js +45 -0
- package/dist/DataQuality/Model/QualityProblemEvent.d.ts +1 -1
- package/dist/DataQuality/Model/QualityProblemEvent.js +1 -1
- package/dist/DataQuality/Service/QualityEndpoint.d.ts +14 -7
- package/dist/DataQuality/Service/QualityEndpoint.js +35 -20
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/DataQuality/Model/QualitySuppressionResult.d.ts +0 -6
- /package/dist/DataQuality/Model/{QualitySuppressionResult.js → QualityEntityProblemSuppressionResult.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
2
|
/**
|
|
3
3
|
* A data-quality dataset: the set of entities being checked, and the problems found on them —
|
|
4
|
-
* the `/
|
|
4
|
+
* the `/data-quality/datasets` resource.
|
|
5
5
|
*
|
|
6
6
|
* `autoCloseMode` decides what happens to an open problem that a later scan no longer reports.
|
|
7
7
|
*/
|
|
@@ -12,6 +12,12 @@ export declare class QualityDataset {
|
|
|
12
12
|
autoCloseMode: string;
|
|
13
13
|
config: Record<string, unknown> | null;
|
|
14
14
|
createdAt: Date | null;
|
|
15
|
+
/**
|
|
16
|
+
* Totals for the overview: how much is being watched, and how much currently needs attention.
|
|
17
|
+
* Only the list endpoint counts them — both stay null when a single dataset is fetched.
|
|
18
|
+
*/
|
|
19
|
+
entityCount: number | null;
|
|
20
|
+
openProblemCount: number | null;
|
|
15
21
|
constructor(id: string, project: string, name: string);
|
|
16
22
|
static parse(raw: ApiRecord): QualityDataset;
|
|
17
23
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A data-quality dataset: the set of entities being checked, and the problems found on them —
|
|
3
|
-
* the `/
|
|
3
|
+
* the `/data-quality/datasets` resource.
|
|
4
4
|
*
|
|
5
5
|
* `autoCloseMode` decides what happens to an open problem that a later scan no longer reports.
|
|
6
6
|
*/
|
|
@@ -11,6 +11,12 @@ export class QualityDataset {
|
|
|
11
11
|
autoCloseMode = '';
|
|
12
12
|
config = null;
|
|
13
13
|
createdAt = null;
|
|
14
|
+
/**
|
|
15
|
+
* Totals for the overview: how much is being watched, and how much currently needs attention.
|
|
16
|
+
* Only the list endpoint counts them — both stay null when a single dataset is fetched.
|
|
17
|
+
*/
|
|
18
|
+
entityCount = null;
|
|
19
|
+
openProblemCount = null;
|
|
14
20
|
constructor(id, project, name) {
|
|
15
21
|
this.id = id;
|
|
16
22
|
this.project = project;
|
|
@@ -21,6 +27,8 @@ export class QualityDataset {
|
|
|
21
27
|
dataset.autoCloseMode = raw.auto_close_mode ?? '';
|
|
22
28
|
dataset.config = raw.config ?? null;
|
|
23
29
|
dataset.createdAt = raw.created_at ? new Date(raw.created_at) : null;
|
|
30
|
+
dataset.entityCount = raw.entity_count === undefined ? null : Number(raw.entity_count);
|
|
31
|
+
dataset.openProblemCount = raw.open_problem_count === undefined ? null : Number(raw.open_problem_count);
|
|
24
32
|
return dataset;
|
|
25
33
|
}
|
|
26
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
2
|
/**
|
|
3
3
|
* One thing being checked in a dataset (a product, a category, …), with a rollup of the problems
|
|
4
|
-
* currently open on it — the `/
|
|
4
|
+
* currently open on it — the `/data-quality/datasets/:datasetId/entities` resource.
|
|
5
5
|
*
|
|
6
6
|
* `entityType` + `entityId` identify it in the source system; `id` is the dataset's own row.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One thing being checked in a dataset (a product, a category, …), with a rollup of the problems
|
|
3
|
-
* currently open on it — the `/
|
|
3
|
+
* currently open on it — the `/data-quality/datasets/:datasetId/entities` resource.
|
|
4
4
|
*
|
|
5
5
|
* `entityType` + `entityId` identify it in the source system; `id` is the dataset's own row.
|
|
6
6
|
*/
|
package/dist/DataQuality/Model/{QualitySuppression.d.ts → QualityEntityProblemSuppression.d.ts}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
2
|
/**
|
|
3
3
|
* A standing decision to ignore a problem code — the
|
|
4
|
-
* `/
|
|
4
|
+
* `/data-quality/datasets/:datasetId/entity-problem-suppressions` resource.
|
|
5
5
|
*
|
|
6
6
|
* With `entityType` and `entityId` set it covers that one entity; with both null it covers the code
|
|
7
7
|
* across the whole dataset. Suppressed problems are still ingested but parked in `muted`, so they
|
|
8
8
|
* stay out of the needs-attention list and out of every auto-close path without losing history.
|
|
9
9
|
*/
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class QualityEntityProblemSuppression {
|
|
11
11
|
id: string;
|
|
12
12
|
code: string;
|
|
13
13
|
/** Both null = the suppression applies to this code across the whole dataset. */
|
|
@@ -18,5 +18,5 @@ export declare class QualitySuppression {
|
|
|
18
18
|
createdAt: Date | null;
|
|
19
19
|
constructor(id: string, code: string);
|
|
20
20
|
get isDatasetWide(): boolean;
|
|
21
|
-
static parse(raw: ApiRecord):
|
|
21
|
+
static parse(raw: ApiRecord): QualityEntityProblemSuppression;
|
|
22
22
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A standing decision to ignore a problem code — the
|
|
3
|
-
* `/
|
|
3
|
+
* `/data-quality/datasets/:datasetId/entity-problem-suppressions` resource.
|
|
4
4
|
*
|
|
5
5
|
* With `entityType` and `entityId` set it covers that one entity; with both null it covers the code
|
|
6
6
|
* across the whole dataset. Suppressed problems are still ingested but parked in `muted`, so they
|
|
7
7
|
* stay out of the needs-attention list and out of every auto-close path without losing history.
|
|
8
8
|
*/
|
|
9
|
-
export class
|
|
9
|
+
export class QualityEntityProblemSuppression {
|
|
10
10
|
id;
|
|
11
11
|
code;
|
|
12
12
|
/** Both null = the suppression applies to this code across the whole dataset. */
|
|
@@ -23,7 +23,7 @@ export class QualitySuppression {
|
|
|
23
23
|
return this.entityId === null;
|
|
24
24
|
}
|
|
25
25
|
static parse(raw) {
|
|
26
|
-
const suppression = new
|
|
26
|
+
const suppression = new QualityEntityProblemSuppression(raw.id, raw.code);
|
|
27
27
|
suppression.entityType = raw.entity_type ?? null;
|
|
28
28
|
// The API strips the `_id` suffix, so `entity_id` arrives as `entity`.
|
|
29
29
|
suppression.entityId = raw.entity ?? null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { QualityEntityProblemSuppression } from './QualityEntityProblemSuppression.js';
|
|
2
|
+
/** What a new suppression did: the record itself, plus how many open problems it muted. */
|
|
3
|
+
export type QualityEntityProblemSuppressionResult = {
|
|
4
|
+
suppression: QualityEntityProblemSuppression | null;
|
|
5
|
+
muted: number;
|
|
6
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
2
|
/**
|
|
3
3
|
* One quality issue found on an entity — the
|
|
4
|
-
* `/
|
|
4
|
+
* `/data-quality/datasets/:datasetId/entities/:entityType/:entityId/problems` resource.
|
|
5
5
|
*
|
|
6
6
|
* `code` says what is wrong (the rule that fired) and `property` where; `channel` and `locale`
|
|
7
7
|
* narrow it to one sales channel or language when the rule is scoped that way.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One quality issue found on an entity — the
|
|
3
|
-
* `/
|
|
3
|
+
* `/data-quality/datasets/:datasetId/entities/:entityType/:entityId/problems` resource.
|
|
4
4
|
*
|
|
5
5
|
* `code` says what is wrong (the rule that fired) and `property` where; `channel` and `locale`
|
|
6
6
|
* narrow it to one sales channel or language when the rule is scoped that way.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
|
+
/**
|
|
3
|
+
* The catalogue entry behind a problem code — the `/data-quality/definitions` resource.
|
|
4
|
+
*
|
|
5
|
+
* A code is a machine key (`verlichting.ean_invalid_checkdigit`); the definition is what makes it
|
|
6
|
+
* readable, so anything showing a code to a user should resolve it here. Definitions are either
|
|
7
|
+
* platform-owned (`ownerProject` null, shipped by Attlaz) or owned by a project, and a project's
|
|
8
|
+
* own definition takes precedence over a platform one with the same code.
|
|
9
|
+
*
|
|
10
|
+
* `blocking` is orthogonal to `defaultSeverity`: severity is how bad the problem is, blocking is
|
|
11
|
+
* whether the entity can be published to a channel at all.
|
|
12
|
+
*/
|
|
13
|
+
export declare class QualityProblemDefinition {
|
|
14
|
+
id: string;
|
|
15
|
+
code: string;
|
|
16
|
+
ownerProject: string | null;
|
|
17
|
+
label: string | null;
|
|
18
|
+
description: string | null;
|
|
19
|
+
dimension: string | null;
|
|
20
|
+
defaultSeverity: string | null;
|
|
21
|
+
blocking: boolean;
|
|
22
|
+
helpUrl: string | null;
|
|
23
|
+
pack: string | null;
|
|
24
|
+
property: string | null;
|
|
25
|
+
constructor(id: string, code: string);
|
|
26
|
+
/** What to show a user for this code: the label when it has one, the raw code otherwise. */
|
|
27
|
+
get displayName(): string;
|
|
28
|
+
static parse(raw: ApiRecord): QualityProblemDefinition;
|
|
29
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The catalogue entry behind a problem code — the `/data-quality/definitions` resource.
|
|
3
|
+
*
|
|
4
|
+
* A code is a machine key (`verlichting.ean_invalid_checkdigit`); the definition is what makes it
|
|
5
|
+
* readable, so anything showing a code to a user should resolve it here. Definitions are either
|
|
6
|
+
* platform-owned (`ownerProject` null, shipped by Attlaz) or owned by a project, and a project's
|
|
7
|
+
* own definition takes precedence over a platform one with the same code.
|
|
8
|
+
*
|
|
9
|
+
* `blocking` is orthogonal to `defaultSeverity`: severity is how bad the problem is, blocking is
|
|
10
|
+
* whether the entity can be published to a channel at all.
|
|
11
|
+
*/
|
|
12
|
+
export class QualityProblemDefinition {
|
|
13
|
+
id;
|
|
14
|
+
code;
|
|
15
|
+
ownerProject = null;
|
|
16
|
+
label = null;
|
|
17
|
+
description = null;
|
|
18
|
+
dimension = null;
|
|
19
|
+
defaultSeverity = null;
|
|
20
|
+
blocking = false;
|
|
21
|
+
helpUrl = null;
|
|
22
|
+
pack = null;
|
|
23
|
+
property = null;
|
|
24
|
+
constructor(id, code) {
|
|
25
|
+
this.id = id;
|
|
26
|
+
this.code = code;
|
|
27
|
+
}
|
|
28
|
+
/** What to show a user for this code: the label when it has one, the raw code otherwise. */
|
|
29
|
+
get displayName() {
|
|
30
|
+
return this.label ?? this.code;
|
|
31
|
+
}
|
|
32
|
+
static parse(raw) {
|
|
33
|
+
const definition = new QualityProblemDefinition(raw.id, raw.code);
|
|
34
|
+
definition.ownerProject = raw.owner_project ?? null;
|
|
35
|
+
definition.label = raw.label ?? null;
|
|
36
|
+
definition.description = raw.description ?? null;
|
|
37
|
+
definition.dimension = raw.dimension ?? null;
|
|
38
|
+
definition.defaultSeverity = raw.default_severity ?? null;
|
|
39
|
+
definition.blocking = raw.blocking === true;
|
|
40
|
+
definition.helpUrl = raw.help_url ?? null;
|
|
41
|
+
definition.pack = raw.pack ?? null;
|
|
42
|
+
definition.property = raw.property ?? null;
|
|
43
|
+
return definition;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiRecord } from '../../Model/ApiRecord.js';
|
|
2
2
|
/**
|
|
3
3
|
* One transition of a single problem — the
|
|
4
|
-
* `/
|
|
4
|
+
* `/data-quality/datasets/:datasetId/entities/:entityType/:entityId/problems/:code/events` resource.
|
|
5
5
|
*
|
|
6
6
|
* A problem is reported once and then re-reported by every later scan; only the transitions are
|
|
7
7
|
* recorded, so the timeline stays short: `reported` when it first appears, `resolved` when a scan
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One transition of a single problem — the
|
|
3
|
-
* `/
|
|
3
|
+
* `/data-quality/datasets/:datasetId/entities/:entityType/:entityId/problems/:code/events` resource.
|
|
4
4
|
*
|
|
5
5
|
* A problem is reported once and then re-reported by every later scan; only the transitions are
|
|
6
6
|
* recorded, so the timeline stays short: `reported` when it first appears, `resolved` when a scan
|
|
@@ -3,15 +3,16 @@ import { QualityEntity } from '../Model/QualityEntity.js';
|
|
|
3
3
|
import { QualityEntityFilters } from '../Model/QualityEntityFilters.js';
|
|
4
4
|
import { QualityFilterOptions } from '../Model/QualityFilterOptions.js';
|
|
5
5
|
import { QualityProblem } from '../Model/QualityProblem.js';
|
|
6
|
+
import { QualityProblemDefinition } from '../Model/QualityProblemDefinition.js';
|
|
6
7
|
import { QualityProblemEvent } from '../Model/QualityProblemEvent.js';
|
|
7
8
|
import { QualitySummary } from '../Model/QualitySummary.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
9
|
+
import { QualityEntityProblemSuppression } from '../Model/QualityEntityProblemSuppression.js';
|
|
10
|
+
import { QualityEntityProblemSuppressionResult } from '../Model/QualityEntityProblemSuppressionResult.js';
|
|
10
11
|
import { CursorPagination } from '../../Model/Pagination/CursorPagination.js';
|
|
11
12
|
import { CollectionResult } from '../../Model/Result/CollectionResult.js';
|
|
12
13
|
import { Endpoint } from '../../Service/Endpoint.js';
|
|
13
14
|
/**
|
|
14
|
-
* Data Quality — `/
|
|
15
|
+
* Data Quality — `/data-quality/datasets`. A dataset holds the entities being checked and the
|
|
15
16
|
* problems open on them.
|
|
16
17
|
*/
|
|
17
18
|
export declare class QualityEndpoint extends Endpoint {
|
|
@@ -33,18 +34,24 @@ export declare class QualityEndpoint extends Endpoint {
|
|
|
33
34
|
getFilterOptions(datasetId: string): Promise<QualityFilterOptions>;
|
|
34
35
|
/** Both groupings in one call: `counts` by (property, severity) and `codes` for the fix cards. */
|
|
35
36
|
getSummary(datasetId: string): Promise<QualitySummary>;
|
|
36
|
-
|
|
37
|
+
/**
|
|
38
|
+
* The catalogue for a project: the platform's definitions plus the project's own. Use it to turn
|
|
39
|
+
* codes into something readable — `summary`/`filter-options` only carry codes that currently
|
|
40
|
+
* have open problems, so a fully suppressed or resolved code has no label there.
|
|
41
|
+
*/
|
|
42
|
+
getDefinitions(projectId: string, pack?: string | null): Promise<CollectionResult<QualityProblemDefinition>>;
|
|
43
|
+
getEntityProblemSuppressions(datasetId: string): Promise<CollectionResult<QualityEntityProblemSuppression>>;
|
|
37
44
|
/**
|
|
38
45
|
* Suppress a code, either on one entity or — with both entity fields omitted — across the whole
|
|
39
46
|
* dataset. Also mutes the matching problems that are already open, so suppressing acts on what
|
|
40
47
|
* is there rather than only on future scans.
|
|
41
48
|
*/
|
|
42
|
-
|
|
49
|
+
createEntityProblemSuppression(datasetId: string, suppression: {
|
|
43
50
|
code: string;
|
|
44
51
|
entityType?: string | null;
|
|
45
52
|
entityId?: string | null;
|
|
46
53
|
reason?: string | null;
|
|
47
|
-
}): Promise<
|
|
54
|
+
}): Promise<QualityEntityProblemSuppressionResult>;
|
|
48
55
|
/** Lift a suppression; returns how many muted problems were returned to the open list. */
|
|
49
|
-
|
|
56
|
+
deleteEntityProblemSuppression(datasetId: string, entityProblemSuppressionId: string): Promise<number>;
|
|
50
57
|
}
|
|
@@ -2,22 +2,23 @@ import { QueryString } from '../../Http/Data/QueryString.js';
|
|
|
2
2
|
import { QualityDataset } from '../Model/QualityDataset.js';
|
|
3
3
|
import { QualityEntity } from '../Model/QualityEntity.js';
|
|
4
4
|
import { QualityProblem } from '../Model/QualityProblem.js';
|
|
5
|
+
import { QualityProblemDefinition } from '../Model/QualityProblemDefinition.js';
|
|
5
6
|
import { QualityProblemEvent } from '../Model/QualityProblemEvent.js';
|
|
6
|
-
import {
|
|
7
|
+
import { QualityEntityProblemSuppression } from '../Model/QualityEntityProblemSuppression.js';
|
|
7
8
|
import { Endpoint } from '../../Service/Endpoint.js';
|
|
8
9
|
/**
|
|
9
|
-
* Data Quality — `/
|
|
10
|
+
* Data Quality — `/data-quality/datasets`. A dataset holds the entities being checked and the
|
|
10
11
|
* problems open on them.
|
|
11
12
|
*/
|
|
12
13
|
export class QualityEndpoint extends Endpoint {
|
|
13
14
|
async getDatasets(projectId, pagination = null) {
|
|
14
|
-
const queryString = new QueryString('/
|
|
15
|
+
const queryString = new QueryString('/data-quality/datasets');
|
|
15
16
|
queryString.set('project', projectId);
|
|
16
17
|
queryString.addPagination(pagination);
|
|
17
18
|
return await this.requestCollection(queryString, QualityDataset.parse);
|
|
18
19
|
}
|
|
19
20
|
async getDataset(datasetId) {
|
|
20
|
-
const result = await this.requestObject('/
|
|
21
|
+
const result = await this.requestObject('/data-quality/datasets/' + datasetId, null, QualityDataset.parse, 'GET');
|
|
21
22
|
return result.getData();
|
|
22
23
|
}
|
|
23
24
|
async createDataset(projectId, name, autoCloseMode = null) {
|
|
@@ -25,19 +26,19 @@ export class QualityEndpoint extends Endpoint {
|
|
|
25
26
|
if (autoCloseMode !== null) {
|
|
26
27
|
body['auto_close_mode'] = autoCloseMode;
|
|
27
28
|
}
|
|
28
|
-
const result = await this.requestObject('/
|
|
29
|
+
const result = await this.requestObject('/data-quality/datasets', body, QualityDataset.parse, 'POST');
|
|
29
30
|
return result.getData();
|
|
30
31
|
}
|
|
31
32
|
async updateDataset(datasetId, changes) {
|
|
32
33
|
// camelCase keys are snake_cased by the base Endpoint (autoCloseMode -> auto_close_mode).
|
|
33
|
-
const result = await this.requestObject('/
|
|
34
|
+
const result = await this.requestObject('/data-quality/datasets/' + datasetId, changes, QualityDataset.parse, 'PATCH');
|
|
34
35
|
return result.getData();
|
|
35
36
|
}
|
|
36
37
|
async deleteDataset(datasetId) {
|
|
37
|
-
await this.requestObject('/
|
|
38
|
+
await this.requestObject('/data-quality/datasets/' + datasetId, null, (raw) => raw, 'DELETE');
|
|
38
39
|
}
|
|
39
40
|
async getEntities(datasetId, pagination = null, filters = {}) {
|
|
40
|
-
const queryString = new QueryString('/
|
|
41
|
+
const queryString = new QueryString('/data-quality/datasets/' + datasetId + '/entities');
|
|
41
42
|
if (filters.entityType) {
|
|
42
43
|
queryString.set('entity_type', filters.entityType);
|
|
43
44
|
}
|
|
@@ -61,7 +62,7 @@ export class QualityEndpoint extends Endpoint {
|
|
|
61
62
|
}
|
|
62
63
|
/** Suppressed problems are hidden unless `includeSuppressed` is set. */
|
|
63
64
|
async getEntityProblems(datasetId, entityType, entityId, includeSuppressed = false) {
|
|
64
|
-
const queryString = new QueryString('/
|
|
65
|
+
const queryString = new QueryString('/data-quality/datasets/' + datasetId
|
|
65
66
|
+ '/entities/' + encodeURIComponent(entityType)
|
|
66
67
|
+ '/' + encodeURIComponent(entityId) + '/problems');
|
|
67
68
|
if (includeSuppressed) {
|
|
@@ -71,7 +72,7 @@ export class QualityEndpoint extends Endpoint {
|
|
|
71
72
|
}
|
|
72
73
|
/** The transition timeline for one problem, oldest first. */
|
|
73
74
|
async getProblemEvents(datasetId, entityType, entityId, code) {
|
|
74
|
-
const path = '/
|
|
75
|
+
const path = '/data-quality/datasets/' + datasetId
|
|
75
76
|
+ '/entities/' + encodeURIComponent(entityType)
|
|
76
77
|
+ '/' + encodeURIComponent(entityId)
|
|
77
78
|
+ '/problems/' + encodeURIComponent(code) + '/events';
|
|
@@ -79,14 +80,14 @@ export class QualityEndpoint extends Endpoint {
|
|
|
79
80
|
}
|
|
80
81
|
/** Clear an entity's problems so the next scan starts from scratch; returns how many were removed. */
|
|
81
82
|
async resetEntity(datasetId, entityType, entityId) {
|
|
82
|
-
const path = '/
|
|
83
|
+
const path = '/data-quality/datasets/' + datasetId
|
|
83
84
|
+ '/entities/' + encodeURIComponent(entityType)
|
|
84
85
|
+ '/' + encodeURIComponent(entityId) + '/reset';
|
|
85
86
|
const result = await this.requestObject(path, {}, (raw) => ({ deleted: raw.deleted ?? 0 }), 'POST');
|
|
86
87
|
return result.getData()?.deleted ?? 0;
|
|
87
88
|
}
|
|
88
89
|
async getFilterOptions(datasetId) {
|
|
89
|
-
const result = await this.requestObject('/
|
|
90
|
+
const result = await this.requestObject('/data-quality/datasets/' + datasetId + '/filter-options', null, (raw) => ({
|
|
90
91
|
entityTypes: raw.entity_types ?? [],
|
|
91
92
|
properties: raw.properties ?? [],
|
|
92
93
|
codes: (raw.codes ?? []).map((row) => ({
|
|
@@ -99,7 +100,7 @@ export class QualityEndpoint extends Endpoint {
|
|
|
99
100
|
}
|
|
100
101
|
/** Both groupings in one call: `counts` by (property, severity) and `codes` for the fix cards. */
|
|
101
102
|
async getSummary(datasetId) {
|
|
102
|
-
const result = await this.requestObject('/
|
|
103
|
+
const result = await this.requestObject('/data-quality/datasets/' + datasetId + '/summary', null, (raw) => ({
|
|
103
104
|
counts: (raw.counts ?? []).map((row) => ({
|
|
104
105
|
property: row.property,
|
|
105
106
|
severity: row.severity,
|
|
@@ -117,16 +118,30 @@ export class QualityEndpoint extends Endpoint {
|
|
|
117
118
|
}), 'GET');
|
|
118
119
|
return result.getData() ?? { counts: [], codes: [] };
|
|
119
120
|
}
|
|
121
|
+
// ---- Problem definitions ----
|
|
122
|
+
/**
|
|
123
|
+
* The catalogue for a project: the platform's definitions plus the project's own. Use it to turn
|
|
124
|
+
* codes into something readable — `summary`/`filter-options` only carry codes that currently
|
|
125
|
+
* have open problems, so a fully suppressed or resolved code has no label there.
|
|
126
|
+
*/
|
|
127
|
+
async getDefinitions(projectId, pack = null) {
|
|
128
|
+
const queryString = new QueryString('/data-quality/definitions');
|
|
129
|
+
queryString.set('project', projectId);
|
|
130
|
+
if (pack !== null) {
|
|
131
|
+
queryString.set('pack', pack);
|
|
132
|
+
}
|
|
133
|
+
return await this.requestCollection(queryString, QualityProblemDefinition.parse);
|
|
134
|
+
}
|
|
120
135
|
// ---- Suppressions ----
|
|
121
|
-
async
|
|
122
|
-
return await this.requestCollection('/
|
|
136
|
+
async getEntityProblemSuppressions(datasetId) {
|
|
137
|
+
return await this.requestCollection('/data-quality/datasets/' + datasetId + '/entity-problem-suppressions', QualityEntityProblemSuppression.parse);
|
|
123
138
|
}
|
|
124
139
|
/**
|
|
125
140
|
* Suppress a code, either on one entity or — with both entity fields omitted — across the whole
|
|
126
141
|
* dataset. Also mutes the matching problems that are already open, so suppressing acts on what
|
|
127
142
|
* is there rather than only on future scans.
|
|
128
143
|
*/
|
|
129
|
-
async
|
|
144
|
+
async createEntityProblemSuppression(datasetId, suppression) {
|
|
130
145
|
// Both entity keys are always sent, explicitly null for a dataset-wide suppression: the
|
|
131
146
|
// endpoint requires them to be present so that a dropped or renamed key is an error rather
|
|
132
147
|
// than a silent widening to the whole dataset.
|
|
@@ -139,15 +154,15 @@ export class QualityEndpoint extends Endpoint {
|
|
|
139
154
|
entity: suppression.entityId ?? null,
|
|
140
155
|
reason: suppression.reason ?? null,
|
|
141
156
|
};
|
|
142
|
-
const result = await this.requestObject('/
|
|
143
|
-
suppression: raw.id ?
|
|
157
|
+
const result = await this.requestObject('/data-quality/datasets/' + datasetId + '/entity-problem-suppressions', body, (raw) => ({
|
|
158
|
+
suppression: raw.id ? QualityEntityProblemSuppression.parse(raw) : null,
|
|
144
159
|
muted: Number(raw.muted ?? 0),
|
|
145
160
|
}), 'POST');
|
|
146
161
|
return result.getData() ?? { suppression: null, muted: 0 };
|
|
147
162
|
}
|
|
148
163
|
/** Lift a suppression; returns how many muted problems were returned to the open list. */
|
|
149
|
-
async
|
|
150
|
-
const result = await this.requestObject('/
|
|
164
|
+
async deleteEntityProblemSuppression(datasetId, entityProblemSuppressionId) {
|
|
165
|
+
const result = await this.requestObject('/data-quality/datasets/' + datasetId + '/entity-problem-suppressions/' + entityProblemSuppressionId, null, (raw) => ({ reopened: Number(raw.reopened ?? 0) }), 'DELETE');
|
|
151
166
|
return result.getData()?.reopened ?? 0;
|
|
152
167
|
}
|
|
153
168
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -135,15 +135,16 @@ export { PulseStatisticsEndpoint } from './Pulse/Service/PulseStatisticsEndpoint
|
|
|
135
135
|
export { QualityDataset } from './DataQuality/Model/QualityDataset.js';
|
|
136
136
|
export { QualityEntity } from './DataQuality/Model/QualityEntity.js';
|
|
137
137
|
export { QualityProblem } from './DataQuality/Model/QualityProblem.js';
|
|
138
|
+
export { QualityProblemDefinition } from './DataQuality/Model/QualityProblemDefinition.js';
|
|
138
139
|
export { QualityProblemEvent } from './DataQuality/Model/QualityProblemEvent.js';
|
|
139
|
-
export {
|
|
140
|
+
export { QualityEntityProblemSuppression } from './DataQuality/Model/QualityEntityProblemSuppression.js';
|
|
140
141
|
export { QualityCodeOption } from './DataQuality/Model/QualityCodeOption.js';
|
|
141
142
|
export { QualityCodeSummaryRow } from './DataQuality/Model/QualityCodeSummaryRow.js';
|
|
142
143
|
export { QualityEntityFilters } from './DataQuality/Model/QualityEntityFilters.js';
|
|
143
144
|
export { QualityFilterOptions } from './DataQuality/Model/QualityFilterOptions.js';
|
|
144
145
|
export { QualitySummary } from './DataQuality/Model/QualitySummary.js';
|
|
145
146
|
export { QualitySummaryRow } from './DataQuality/Model/QualitySummaryRow.js';
|
|
146
|
-
export {
|
|
147
|
+
export { QualityEntityProblemSuppressionResult } from './DataQuality/Model/QualityEntityProblemSuppressionResult.js';
|
|
147
148
|
export { QualityEndpoint } from './DataQuality/Service/QualityEndpoint.js';
|
|
148
149
|
export { CatalogFeed } from './FeedManagement/Model/CatalogFeed.js';
|
|
149
150
|
export { CatalogFeedEndpoint } from './FeedManagement/Service/CatalogFeedEndpoint.js';
|
package/dist/index.js
CHANGED
|
@@ -108,8 +108,9 @@ export { PulseStatisticsEndpoint } from './Pulse/Service/PulseStatisticsEndpoint
|
|
|
108
108
|
export { QualityDataset } from './DataQuality/Model/QualityDataset.js';
|
|
109
109
|
export { QualityEntity } from './DataQuality/Model/QualityEntity.js';
|
|
110
110
|
export { QualityProblem } from './DataQuality/Model/QualityProblem.js';
|
|
111
|
+
export { QualityProblemDefinition } from './DataQuality/Model/QualityProblemDefinition.js';
|
|
111
112
|
export { QualityProblemEvent } from './DataQuality/Model/QualityProblemEvent.js';
|
|
112
|
-
export {
|
|
113
|
+
export { QualityEntityProblemSuppression } from './DataQuality/Model/QualityEntityProblemSuppression.js';
|
|
113
114
|
export { QualityEndpoint } from './DataQuality/Service/QualityEndpoint.js';
|
|
114
115
|
export { CatalogFeed } from './FeedManagement/Model/CatalogFeed.js';
|
|
115
116
|
export { CatalogFeedEndpoint } from './FeedManagement/Service/CatalogFeedEndpoint.js';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.96.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.
|
|
1
|
+
export const VERSION = "1.96.0";
|
package/package.json
CHANGED
|
File without changes
|