@hestia-earth/api 0.28.19 → 0.28.21

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.
@@ -36,6 +36,7 @@ export interface DataPlan extends BaseModel {
36
36
  releasedQuality?: QualityRank | null;
37
37
  nonVerifiedQuality?: QualityRank | null;
38
38
  unmetCriteria?: AggregationCriterion[];
39
+ verifiedAt?: Date | null;
39
40
  suitableSourcesCount?: number | null;
40
41
  sourcesToUploadCount?: number | null;
41
42
  completionPct?: number | null;
@@ -2,4 +2,5 @@ import { BaseModel } from '../../db/model.base';
2
2
  export interface DataPlanVersion extends BaseModel {
3
3
  name: string;
4
4
  enabled: boolean;
5
+ expectedDate?: Date | null;
5
6
  }
@@ -12,9 +12,10 @@ export const dataStatesTypeMapping = {
12
12
  [DataState.original]: Object.values(NodeType),
13
13
  [DataState.recalculated]: [NodeType.Cycle, NodeType.ImpactAssessment, NodeType.Site]
14
14
  };
15
- export const allowedDataStates = (type) => Object.values(DataState).filter(dataState => dataStatesTypeMapping[dataState].includes(type));
15
+ const typesForDataState = (dataState) => dataStatesTypeMapping[dataState] || [];
16
+ export const allowedDataStates = (type) => Object.values(DataState).filter(dataState => typesForDataState(dataState).includes(type));
16
17
  export const pathWithState = (type, id, dataState = DataState.original, strictDataState = false) => {
17
- const state = dataStatesTypeMapping[dataState].includes(type) ? dataState : null;
18
+ const state = typesForDataState(dataState).includes(type) ? dataState : null;
18
19
  return state !== null || !strictDataState
19
20
  ? [state === DataState.original ? null : state, jsonldPath(type, id)].filter(Boolean).join('/')
20
21
  : null;
@@ -15,10 +15,11 @@ exports.dataStatesTypeMapping = {
15
15
  [DataState.original]: Object.values(schema_1.NodeType),
16
16
  [DataState.recalculated]: [schema_1.NodeType.Cycle, schema_1.NodeType.ImpactAssessment, schema_1.NodeType.Site]
17
17
  };
18
- const allowedDataStates = (type) => Object.values(DataState).filter(dataState => exports.dataStatesTypeMapping[dataState].includes(type));
18
+ const typesForDataState = (dataState) => exports.dataStatesTypeMapping[dataState] || [];
19
+ const allowedDataStates = (type) => Object.values(DataState).filter(dataState => typesForDataState(dataState).includes(type));
19
20
  exports.allowedDataStates = allowedDataStates;
20
21
  const pathWithState = (type, id, dataState = DataState.original, strictDataState = false) => {
21
- const state = exports.dataStatesTypeMapping[dataState].includes(type) ? dataState : null;
22
+ const state = typesForDataState(dataState).includes(type) ? dataState : null;
22
23
  return state !== null || !strictDataState
23
24
  ? [state === DataState.original ? null : state, (0, schema_1.jsonldPath)(type, id)].filter(Boolean).join('/')
24
25
  : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/api",
3
- "version": "0.28.19",
3
+ "version": "0.28.21",
4
4
  "description": "Hestia API definitions",
5
5
  "main": "models.js",
6
6
  "module": "esm/models.js",
@@ -40,6 +40,7 @@ export interface SourceTracker extends BaseModel {
40
40
  rejectionReason?: RejectionReason;
41
41
  rejectedAt?: Date;
42
42
  rejectedBy?: string;
43
+ indexedAt?: Date;
43
44
  assigneeId?: string;
44
45
  projects?: string[];
45
46
  gitlabIssueIid?: number;