From 3d702e5d8e9972992a7ac2c24368cfe19f09bc6c Mon Sep 17 00:00:00 2001 From: Alessandro Gagliardi Date: Tue, 18 Feb 2025 20:39:48 +0000 Subject: [PATCH 1/3] status --- src/data-inventory/pullAllDatapoints.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/data-inventory/pullAllDatapoints.ts b/src/data-inventory/pullAllDatapoints.ts index 7f1f1b41..98447ee8 100644 --- a/src/data-inventory/pullAllDatapoints.ts +++ b/src/data-inventory/pullAllDatapoints.ts @@ -1,7 +1,7 @@ /* eslint-disable max-lines */ import keyBy from 'lodash/keyBy'; import { - DataCategoryType, + type DataCategoryType, SubDataPointDataSubCategoryGuessStatus, } from '@transcend-io/privacy-types'; import uniq from 'lodash/uniq'; @@ -14,12 +14,12 @@ import type { GraphQLClient } from 'graphql-request'; import { DATAPOINT_EXPORT, DATA_SILO_EXPORT, - DataSiloAttributeValue, + type DataSiloAttributeValue, SUB_DATA_POINTS_COUNT, makeGraphQLRequest, } from '../graphql'; import { logger } from '../logger'; -import { DataCategoryInput, ProcessingPurposeInput } from '../codecs'; +import type { DataCategoryInput, ProcessingPurposeInput } from '../codecs'; import { mapSeries } from 'bluebird'; export interface DataSiloCsvPreview { @@ -119,6 +119,12 @@ async function pullSubDatapoints( const filterBy = { ...(parentCategories.length > 0 ? { category: parentCategories } : {}), ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}), + // if parentCategories or subCategories and not includeGuessedCategories + ...(parentCategories.length + subCategories.length > 0 && + !includeGuessedCategories + ? // then only show data points with approved data categories + { status: SubDataPointDataSubCategoryGuessStatus.Approved } + : {}), ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}), }; @@ -140,7 +146,7 @@ async function pullSubDatapoints( progressBar.start(totalCount, 0); let total = 0; let shouldContinue = false; - let cursor; + let cursor: string | undefined; let offset = 0; do { try { From 3b7481c396993fdef6b872a70ffd81a48dc68117 Mon Sep 17 00:00:00 2001 From: Alessandro Gagliardi Date: Tue, 18 Feb 2025 20:49:51 +0000 Subject: [PATCH 2/3] bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fe373c4c..eb2b5875 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Transcend Inc.", "name": "@transcend-io/cli", "description": "Small package containing useful typescript utilities.", - "version": "6.14.3", + "version": "6.14.4", "homepage": "https://github.com/transcend-io/cli", "repository": { "type": "git", From 4d1eab2f891b221b95a11c3980bfd9b2097a1831 Mon Sep 17 00:00:00 2001 From: Alessandro Gagliardi Date: Tue, 18 Feb 2025 21:07:16 +0000 Subject: [PATCH 3/3] minor --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb2b5875..f94e5a1e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Transcend Inc.", "name": "@transcend-io/cli", "description": "Small package containing useful typescript utilities.", - "version": "6.14.4", + "version": "6.15.0", "homepage": "https://github.com/transcend-io/cli", "repository": { "type": "git",