@attlaz/client 1.95.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.
@@ -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 `/data_quality/datasets` resource.
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
  */
@@ -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 `/data_quality/datasets` resource.
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
  */
@@ -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 `/data_quality/datasets/:datasetId/entities` resource.
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 `/data_quality/datasets/:datasetId/entities` resource.
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
  */
@@ -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
- * `/data_quality/datasets/:datasetId/suppressions` resource.
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 QualitySuppression {
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): QualitySuppression;
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
- * `/data_quality/datasets/:datasetId/suppressions` resource.
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 QualitySuppression {
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 QualitySuppression(raw.id, raw.code);
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
- * `/data_quality/datasets/:datasetId/entities/:entityType/:entityId/problems` resource.
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
- * `/data_quality/datasets/:datasetId/entities/:entityType/:entityId/problems` resource.
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.
@@ -1,6 +1,6 @@
1
1
  import { ApiRecord } from '../../Model/ApiRecord.js';
2
2
  /**
3
- * The catalogue entry behind a problem code — the `/data_quality/definitions` resource.
3
+ * The catalogue entry behind a problem code — the `/data-quality/definitions` resource.
4
4
  *
5
5
  * A code is a machine key (`verlichting.ean_invalid_checkdigit`); the definition is what makes it
6
6
  * readable, so anything showing a code to a user should resolve it here. Definitions are either
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The catalogue entry behind a problem code — the `/data_quality/definitions` resource.
2
+ * The catalogue entry behind a problem code — the `/data-quality/definitions` resource.
3
3
  *
4
4
  * A code is a machine key (`verlichting.ean_invalid_checkdigit`); the definition is what makes it
5
5
  * readable, so anything showing a code to a user should resolve it here. Definitions are either
@@ -1,7 +1,7 @@
1
1
  import { ApiRecord } from '../../Model/ApiRecord.js';
2
2
  /**
3
3
  * One transition of a single problem — the
4
- * `/data_quality/datasets/:datasetId/entities/:entityType/:entityId/problems/:code/events` resource.
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
- * `/data_quality/datasets/:datasetId/entities/:entityType/:entityId/problems/:code/events` resource.
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
@@ -6,13 +6,13 @@ import { QualityProblem } from '../Model/QualityProblem.js';
6
6
  import { QualityProblemDefinition } from '../Model/QualityProblemDefinition.js';
7
7
  import { QualityProblemEvent } from '../Model/QualityProblemEvent.js';
8
8
  import { QualitySummary } from '../Model/QualitySummary.js';
9
- import { QualitySuppression } from '../Model/QualitySuppression.js';
10
- import { QualitySuppressionResult } from '../Model/QualitySuppressionResult.js';
9
+ import { QualityEntityProblemSuppression } from '../Model/QualityEntityProblemSuppression.js';
10
+ import { QualityEntityProblemSuppressionResult } from '../Model/QualityEntityProblemSuppressionResult.js';
11
11
  import { CursorPagination } from '../../Model/Pagination/CursorPagination.js';
12
12
  import { CollectionResult } from '../../Model/Result/CollectionResult.js';
13
13
  import { Endpoint } from '../../Service/Endpoint.js';
14
14
  /**
15
- * Data Quality — `/data_quality/datasets`. A dataset holds the entities being checked and the
15
+ * Data Quality — `/data-quality/datasets`. A dataset holds the entities being checked and the
16
16
  * problems open on them.
17
17
  */
18
18
  export declare class QualityEndpoint extends Endpoint {
@@ -40,18 +40,18 @@ export declare class QualityEndpoint extends Endpoint {
40
40
  * have open problems, so a fully suppressed or resolved code has no label there.
41
41
  */
42
42
  getDefinitions(projectId: string, pack?: string | null): Promise<CollectionResult<QualityProblemDefinition>>;
43
- getSuppressions(datasetId: string): Promise<CollectionResult<QualitySuppression>>;
43
+ getEntityProblemSuppressions(datasetId: string): Promise<CollectionResult<QualityEntityProblemSuppression>>;
44
44
  /**
45
45
  * Suppress a code, either on one entity or — with both entity fields omitted — across the whole
46
46
  * dataset. Also mutes the matching problems that are already open, so suppressing acts on what
47
47
  * is there rather than only on future scans.
48
48
  */
49
- createSuppression(datasetId: string, suppression: {
49
+ createEntityProblemSuppression(datasetId: string, suppression: {
50
50
  code: string;
51
51
  entityType?: string | null;
52
52
  entityId?: string | null;
53
53
  reason?: string | null;
54
- }): Promise<QualitySuppressionResult>;
54
+ }): Promise<QualityEntityProblemSuppressionResult>;
55
55
  /** Lift a suppression; returns how many muted problems were returned to the open list. */
56
- deleteSuppression(datasetId: string, suppressionId: string): Promise<number>;
56
+ deleteEntityProblemSuppression(datasetId: string, entityProblemSuppressionId: string): Promise<number>;
57
57
  }
@@ -4,21 +4,21 @@ import { QualityEntity } from '../Model/QualityEntity.js';
4
4
  import { QualityProblem } from '../Model/QualityProblem.js';
5
5
  import { QualityProblemDefinition } from '../Model/QualityProblemDefinition.js';
6
6
  import { QualityProblemEvent } from '../Model/QualityProblemEvent.js';
7
- import { QualitySuppression } from '../Model/QualitySuppression.js';
7
+ import { QualityEntityProblemSuppression } from '../Model/QualityEntityProblemSuppression.js';
8
8
  import { Endpoint } from '../../Service/Endpoint.js';
9
9
  /**
10
- * Data Quality — `/data_quality/datasets`. A dataset holds the entities being checked and the
10
+ * Data Quality — `/data-quality/datasets`. A dataset holds the entities being checked and the
11
11
  * problems open on them.
12
12
  */
13
13
  export class QualityEndpoint extends Endpoint {
14
14
  async getDatasets(projectId, pagination = null) {
15
- const queryString = new QueryString('/data_quality/datasets');
15
+ const queryString = new QueryString('/data-quality/datasets');
16
16
  queryString.set('project', projectId);
17
17
  queryString.addPagination(pagination);
18
18
  return await this.requestCollection(queryString, QualityDataset.parse);
19
19
  }
20
20
  async getDataset(datasetId) {
21
- const result = await this.requestObject('/data_quality/datasets/' + datasetId, null, QualityDataset.parse, 'GET');
21
+ const result = await this.requestObject('/data-quality/datasets/' + datasetId, null, QualityDataset.parse, 'GET');
22
22
  return result.getData();
23
23
  }
24
24
  async createDataset(projectId, name, autoCloseMode = null) {
@@ -26,19 +26,19 @@ export class QualityEndpoint extends Endpoint {
26
26
  if (autoCloseMode !== null) {
27
27
  body['auto_close_mode'] = autoCloseMode;
28
28
  }
29
- const result = await this.requestObject('/data_quality/datasets', body, QualityDataset.parse, 'POST');
29
+ const result = await this.requestObject('/data-quality/datasets', body, QualityDataset.parse, 'POST');
30
30
  return result.getData();
31
31
  }
32
32
  async updateDataset(datasetId, changes) {
33
33
  // camelCase keys are snake_cased by the base Endpoint (autoCloseMode -> auto_close_mode).
34
- const result = await this.requestObject('/data_quality/datasets/' + datasetId, changes, QualityDataset.parse, 'PATCH');
34
+ const result = await this.requestObject('/data-quality/datasets/' + datasetId, changes, QualityDataset.parse, 'PATCH');
35
35
  return result.getData();
36
36
  }
37
37
  async deleteDataset(datasetId) {
38
- await this.requestObject('/data_quality/datasets/' + datasetId, null, (raw) => raw, 'DELETE');
38
+ await this.requestObject('/data-quality/datasets/' + datasetId, null, (raw) => raw, 'DELETE');
39
39
  }
40
40
  async getEntities(datasetId, pagination = null, filters = {}) {
41
- const queryString = new QueryString('/data_quality/datasets/' + datasetId + '/entities');
41
+ const queryString = new QueryString('/data-quality/datasets/' + datasetId + '/entities');
42
42
  if (filters.entityType) {
43
43
  queryString.set('entity_type', filters.entityType);
44
44
  }
@@ -62,7 +62,7 @@ export class QualityEndpoint extends Endpoint {
62
62
  }
63
63
  /** Suppressed problems are hidden unless `includeSuppressed` is set. */
64
64
  async getEntityProblems(datasetId, entityType, entityId, includeSuppressed = false) {
65
- const queryString = new QueryString('/data_quality/datasets/' + datasetId
65
+ const queryString = new QueryString('/data-quality/datasets/' + datasetId
66
66
  + '/entities/' + encodeURIComponent(entityType)
67
67
  + '/' + encodeURIComponent(entityId) + '/problems');
68
68
  if (includeSuppressed) {
@@ -72,7 +72,7 @@ export class QualityEndpoint extends Endpoint {
72
72
  }
73
73
  /** The transition timeline for one problem, oldest first. */
74
74
  async getProblemEvents(datasetId, entityType, entityId, code) {
75
- const path = '/data_quality/datasets/' + datasetId
75
+ const path = '/data-quality/datasets/' + datasetId
76
76
  + '/entities/' + encodeURIComponent(entityType)
77
77
  + '/' + encodeURIComponent(entityId)
78
78
  + '/problems/' + encodeURIComponent(code) + '/events';
@@ -80,14 +80,14 @@ export class QualityEndpoint extends Endpoint {
80
80
  }
81
81
  /** Clear an entity's problems so the next scan starts from scratch; returns how many were removed. */
82
82
  async resetEntity(datasetId, entityType, entityId) {
83
- const path = '/data_quality/datasets/' + datasetId
83
+ const path = '/data-quality/datasets/' + datasetId
84
84
  + '/entities/' + encodeURIComponent(entityType)
85
85
  + '/' + encodeURIComponent(entityId) + '/reset';
86
86
  const result = await this.requestObject(path, {}, (raw) => ({ deleted: raw.deleted ?? 0 }), 'POST');
87
87
  return result.getData()?.deleted ?? 0;
88
88
  }
89
89
  async getFilterOptions(datasetId) {
90
- const result = await this.requestObject('/data_quality/datasets/' + datasetId + '/filter-options', null, (raw) => ({
90
+ const result = await this.requestObject('/data-quality/datasets/' + datasetId + '/filter-options', null, (raw) => ({
91
91
  entityTypes: raw.entity_types ?? [],
92
92
  properties: raw.properties ?? [],
93
93
  codes: (raw.codes ?? []).map((row) => ({
@@ -100,7 +100,7 @@ export class QualityEndpoint extends Endpoint {
100
100
  }
101
101
  /** Both groupings in one call: `counts` by (property, severity) and `codes` for the fix cards. */
102
102
  async getSummary(datasetId) {
103
- const result = await this.requestObject('/data_quality/datasets/' + datasetId + '/summary', null, (raw) => ({
103
+ const result = await this.requestObject('/data-quality/datasets/' + datasetId + '/summary', null, (raw) => ({
104
104
  counts: (raw.counts ?? []).map((row) => ({
105
105
  property: row.property,
106
106
  severity: row.severity,
@@ -125,7 +125,7 @@ export class QualityEndpoint extends Endpoint {
125
125
  * have open problems, so a fully suppressed or resolved code has no label there.
126
126
  */
127
127
  async getDefinitions(projectId, pack = null) {
128
- const queryString = new QueryString('/data_quality/definitions');
128
+ const queryString = new QueryString('/data-quality/definitions');
129
129
  queryString.set('project', projectId);
130
130
  if (pack !== null) {
131
131
  queryString.set('pack', pack);
@@ -133,15 +133,15 @@ export class QualityEndpoint extends Endpoint {
133
133
  return await this.requestCollection(queryString, QualityProblemDefinition.parse);
134
134
  }
135
135
  // ---- Suppressions ----
136
- async getSuppressions(datasetId) {
137
- return await this.requestCollection('/data_quality/datasets/' + datasetId + '/suppressions', QualitySuppression.parse);
136
+ async getEntityProblemSuppressions(datasetId) {
137
+ return await this.requestCollection('/data-quality/datasets/' + datasetId + '/entity-problem-suppressions', QualityEntityProblemSuppression.parse);
138
138
  }
139
139
  /**
140
140
  * Suppress a code, either on one entity or — with both entity fields omitted — across the whole
141
141
  * dataset. Also mutes the matching problems that are already open, so suppressing acts on what
142
142
  * is there rather than only on future scans.
143
143
  */
144
- async createSuppression(datasetId, suppression) {
144
+ async createEntityProblemSuppression(datasetId, suppression) {
145
145
  // Both entity keys are always sent, explicitly null for a dataset-wide suppression: the
146
146
  // endpoint requires them to be present so that a dropped or renamed key is an error rather
147
147
  // than a silent widening to the whole dataset.
@@ -154,15 +154,15 @@ export class QualityEndpoint extends Endpoint {
154
154
  entity: suppression.entityId ?? null,
155
155
  reason: suppression.reason ?? null,
156
156
  };
157
- const result = await this.requestObject('/data_quality/datasets/' + datasetId + '/suppressions', body, (raw) => ({
158
- suppression: raw.id ? QualitySuppression.parse(raw) : null,
157
+ const result = await this.requestObject('/data-quality/datasets/' + datasetId + '/entity-problem-suppressions', body, (raw) => ({
158
+ suppression: raw.id ? QualityEntityProblemSuppression.parse(raw) : null,
159
159
  muted: Number(raw.muted ?? 0),
160
160
  }), 'POST');
161
161
  return result.getData() ?? { suppression: null, muted: 0 };
162
162
  }
163
163
  /** Lift a suppression; returns how many muted problems were returned to the open list. */
164
- async deleteSuppression(datasetId, suppressionId) {
165
- const result = await this.requestObject('/data_quality/datasets/' + datasetId + '/suppressions/' + suppressionId, null, (raw) => ({ reopened: Number(raw.reopened ?? 0) }), 'DELETE');
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');
166
166
  return result.getData()?.reopened ?? 0;
167
167
  }
168
168
  }
package/dist/index.d.ts CHANGED
@@ -137,14 +137,14 @@ export { QualityEntity } from './DataQuality/Model/QualityEntity.js';
137
137
  export { QualityProblem } from './DataQuality/Model/QualityProblem.js';
138
138
  export { QualityProblemDefinition } from './DataQuality/Model/QualityProblemDefinition.js';
139
139
  export { QualityProblemEvent } from './DataQuality/Model/QualityProblemEvent.js';
140
- export { QualitySuppression } from './DataQuality/Model/QualitySuppression.js';
140
+ export { QualityEntityProblemSuppression } from './DataQuality/Model/QualityEntityProblemSuppression.js';
141
141
  export { QualityCodeOption } from './DataQuality/Model/QualityCodeOption.js';
142
142
  export { QualityCodeSummaryRow } from './DataQuality/Model/QualityCodeSummaryRow.js';
143
143
  export { QualityEntityFilters } from './DataQuality/Model/QualityEntityFilters.js';
144
144
  export { QualityFilterOptions } from './DataQuality/Model/QualityFilterOptions.js';
145
145
  export { QualitySummary } from './DataQuality/Model/QualitySummary.js';
146
146
  export { QualitySummaryRow } from './DataQuality/Model/QualitySummaryRow.js';
147
- export { QualitySuppressionResult } from './DataQuality/Model/QualitySuppressionResult.js';
147
+ export { QualityEntityProblemSuppressionResult } from './DataQuality/Model/QualityEntityProblemSuppressionResult.js';
148
148
  export { QualityEndpoint } from './DataQuality/Service/QualityEndpoint.js';
149
149
  export { CatalogFeed } from './FeedManagement/Model/CatalogFeed.js';
150
150
  export { CatalogFeedEndpoint } from './FeedManagement/Service/CatalogFeedEndpoint.js';
package/dist/index.js CHANGED
@@ -110,7 +110,7 @@ export { QualityEntity } from './DataQuality/Model/QualityEntity.js';
110
110
  export { QualityProblem } from './DataQuality/Model/QualityProblem.js';
111
111
  export { QualityProblemDefinition } from './DataQuality/Model/QualityProblemDefinition.js';
112
112
  export { QualityProblemEvent } from './DataQuality/Model/QualityProblemEvent.js';
113
- export { QualitySuppression } from './DataQuality/Model/QualitySuppression.js';
113
+ export { QualityEntityProblemSuppression } from './DataQuality/Model/QualityEntityProblemSuppression.js';
114
114
  export { QualityEndpoint } from './DataQuality/Service/QualityEndpoint.js';
115
115
  export { CatalogFeed } from './FeedManagement/Model/CatalogFeed.js';
116
116
  export { CatalogFeedEndpoint } from './FeedManagement/Service/CatalogFeedEndpoint.js';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.94.0";
1
+ export declare const VERSION = "1.96.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.94.0";
1
+ export const VERSION = "1.96.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attlaz/client",
3
- "version": "1.95.0",
3
+ "version": "1.96.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -1,6 +0,0 @@
1
- import { QualitySuppression } from './QualitySuppression.js';
2
- /** What a new suppression did: the record itself, plus how many open problems it muted. */
3
- export type QualitySuppressionResult = {
4
- suppression: QualitySuppression | null;
5
- muted: number;
6
- };