@transcend-io/cli
Advanced tools
Comparing version 4.0.0 to 4.1.0
import * as t from 'io-ts'; | ||
/** | ||
* Input to define email templates that can be used to communicate to end-users | ||
* about the status of their requests | ||
* | ||
* @see https://docs.transcend.io/docs/privacy-requests/configuring-requests/email-templates | ||
*/ | ||
export declare const TemplateInput: t.TypeC<{ | ||
/** The title of the template */ | ||
title: t.StringC; | ||
}>; | ||
/** Type override */ | ||
export declare type TemplateInput = t.TypeOf<typeof TemplateInput>; | ||
/** | ||
* Input to define API keys that may be shared across data silos | ||
@@ -540,2 +552,9 @@ * in the data map. When creating new data silos through the yaml | ||
/** | ||
* Email template definitions | ||
*/ | ||
templates: t.ArrayC<t.TypeC<{ | ||
/** The title of the template */ | ||
title: t.StringC; | ||
}>>; | ||
/** | ||
* Enricher definitions | ||
@@ -542,0 +561,0 @@ */ |
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TranscendInput = exports.DataSiloInput = exports.PromptAVendorEmailSettings = exports.DatapointInput = exports.FieldInput = exports.DataCategoryInput = exports.ProcessingPurposeInput = exports.EnricherInput = exports.ApiKeyInput = void 0; | ||
exports.TranscendInput = exports.DataSiloInput = exports.PromptAVendorEmailSettings = exports.DatapointInput = exports.FieldInput = exports.DataCategoryInput = exports.ProcessingPurposeInput = exports.EnricherInput = exports.ApiKeyInput = exports.TemplateInput = void 0; | ||
const t = __importStar(require("io-ts")); | ||
@@ -28,2 +28,12 @@ const type_utils_1 = require("@transcend-io/type-utils"); | ||
/** | ||
* Input to define email templates that can be used to communicate to end-users | ||
* about the status of their requests | ||
* | ||
* @see https://docs.transcend.io/docs/privacy-requests/configuring-requests/email-templates | ||
*/ | ||
exports.TemplateInput = t.type({ | ||
/** The title of the template */ | ||
title: t.string, | ||
}); | ||
/** | ||
* Input to define API keys that may be shared across data silos | ||
@@ -252,2 +262,6 @@ * in the data map. When creating new data silos through the yaml | ||
/** | ||
* Email template definitions | ||
*/ | ||
templates: t.array(exports.TemplateInput), | ||
/** | ||
* Enricher definitions | ||
@@ -254,0 +268,0 @@ */ |
@@ -8,2 +8,3 @@ export * from './dataPoint'; | ||
export * from './siloDiscovery'; | ||
export * from './template'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -20,2 +20,3 @@ "use strict"; | ||
__exportStar(require("./siloDiscovery"), exports); | ||
__exportStar(require("./template"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -10,2 +10,3 @@ export * from './fetchActiveSiloDiscoPlugin'; | ||
export * from './uploadSiloDiscoveryResults'; | ||
export * from './syncTemplates'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -22,2 +22,3 @@ "use strict"; | ||
__exportStar(require("./uploadSiloDiscoveryResults"), exports); | ||
__exportStar(require("./syncTemplates"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -14,2 +14,3 @@ "use strict"; | ||
const syncEnrichers_1 = require("./syncEnrichers"); | ||
const _1 = require("."); | ||
/** | ||
@@ -23,3 +24,3 @@ * Pull a yaml configuration from Transcend | ||
async function pullTranscendConfiguration(client, dataSiloIds) { | ||
const [dataSubjects, apiKeyTitleMap, dataSilos, enrichers] = await Promise.all([ | ||
const [dataSubjects, apiKeyTitleMap, dataSilos, enrichers, templates] = await Promise.all([ | ||
// Grab all data subjects in the organization | ||
@@ -33,2 +34,4 @@ (0, fetchDataSubjects_1.fetchDataSubjects)({}, client, true), | ||
(0, syncEnrichers_1.fetchAllEnrichers)(client), | ||
// Fetch email templates | ||
(0, _1.fetchAllTemplates)(client), | ||
]); | ||
@@ -46,2 +49,4 @@ const result = {}; | ||
} | ||
// save email templates | ||
result.templates = templates.map(({ title }) => ({ title })); | ||
// Save enrichers | ||
@@ -48,0 +53,0 @@ if (enrichers.length > 0 && dataSiloIds.length === 0) { |
@@ -16,2 +16,3 @@ "use strict"; | ||
const gqls_1 = require("./gqls"); | ||
const _1 = require("."); | ||
/** | ||
@@ -34,3 +35,19 @@ * Sync the yaml input back to Transcend using the GraphQL APIs | ||
]); | ||
const { enrichers, 'data-silos': dataSilos } = input; | ||
const { templates, enrichers, 'data-silos': dataSilos } = input; | ||
// Sync email templates | ||
if (templates) { | ||
logger_1.logger.info(colors_1.default.magenta(`Syncing "${templates.length}" email templates...`)); | ||
await (0, bluebird_1.mapSeries)(templates, async (template) => { | ||
logger_1.logger.info(colors_1.default.magenta(`Syncing template "${template.title}"...`)); | ||
try { | ||
await (0, _1.syncTemplate)(template, client); | ||
logger_1.logger.info(colors_1.default.green(`Successfully synced template "${template.title}"!`)); | ||
} | ||
catch (err) { | ||
encounteredError = true; | ||
logger_1.logger.info(colors_1.default.red(`Failed to sync template "${template.title}"! - ${err.message}`)); | ||
} | ||
logger_1.logger.info(colors_1.default.green(`Synced "${templates.length}" templates!`)); | ||
}); | ||
} | ||
// Sync enrichers | ||
@@ -37,0 +54,0 @@ if (enrichers) { |
@@ -5,3 +5,3 @@ { | ||
"description": "Small package containing useful typescript utilities.", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"homepage": "https://github.com/transcend-io/cli", | ||
@@ -8,0 +8,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267539
167
3333