Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/tame-years-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@transcend-io/cli': minor
---

Add sync support for purposes, preference options, and consent workflow triggers.

This ports the legacy CLI resource sync work into the monorepo, including new pull/push wiring, GraphQL sync helpers, and an example consent workflow trigger config.
148 changes: 76 additions & 72 deletions packages/cli/README.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions packages/cli/examples/consent-workflow-triggers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
consent-workflow-triggers:
- name: Erasure on opt-out
action-type: ERASURE
data-subject-type: Customer
is-silent: true
allow-unauthenticated: false
is-active: true
purposes:
- tracking-type: Advertising
matching-state: false
- name: Access on request
action-type: ACCESS
data-subject-type: Customer
is-silent: false
allow-unauthenticated: false
is-active: true
purposes:
- tracking-type: Analytics
matching-state: true
75 changes: 75 additions & 0 deletions packages/cli/schema/transcend-yml-schema-latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -59585,6 +59585,81 @@
}
]
}
},
"consent-workflow-triggers": {
"type": "array",
"items": {
"allOf": [
{
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string"
}
}
},
{
"type": "object",
"properties": {
"trigger-condition": {
"type": "string"
},
"action-type": {
"type": "string"
},
"data-subject-type": {
"type": "string"
},
"is-silent": {
"type": "boolean"
},
"allow-unauthenticated": {
"type": "boolean"
},
"is-active": {
"type": "boolean"
},
"data-silo-titles": {
"type": "array",
"items": {
"type": "string"
}
},
"purposes": {
"type": "array",
"items": {
"type": "object",
"required": ["tracking-type", "matching-state"],
"properties": {
"tracking-type": {
"type": "string"
},
"matching-state": {
"type": "boolean"
}
}
}
}
}
}
]
}
},
"preference-options": {
"type": "array",
"items": {
"type": "object",
"required": ["title", "slug"],
"properties": {
"title": {
"type": "string"
},
"slug": {
"type": "string"
}
}
}
}
}
}
75 changes: 75 additions & 0 deletions packages/cli/schema/transcend-yml-schema-v9.json
Original file line number Diff line number Diff line change
Expand Up @@ -59585,6 +59585,81 @@
}
]
}
},
"consent-workflow-triggers": {
"type": "array",
"items": {
"allOf": [
{
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string"
}
}
},
{
"type": "object",
"properties": {
"trigger-condition": {
"type": "string"
},
"action-type": {
"type": "string"
},
"data-subject-type": {
"type": "string"
},
"is-silent": {
"type": "boolean"
},
"allow-unauthenticated": {
"type": "boolean"
},
"is-active": {
"type": "boolean"
},
"data-silo-titles": {
"type": "array",
"items": {
"type": "string"
}
},
"purposes": {
"type": "array",
"items": {
"type": "object",
"required": ["tracking-type", "matching-state"],
"properties": {
"tracking-type": {
"type": "string"
},
"matching-state": {
"type": "boolean"
}
}
}
}
}
}
]
}
},
"preference-options": {
"type": "array",
"items": {
"type": "object",
"required": ["title", "slug"],
"properties": {
"title": {
"type": "string"
},
"slug": {
"type": "string"
}
}
}
}
}
}
54 changes: 54 additions & 0 deletions packages/cli/src/codecs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,52 @@ export const SiloDiscoveryResultInput = t.intersection([
/** Type override */
export type SiloDiscoveryResultInput = t.TypeOf<typeof SiloDiscoveryResultInput>;

/**
* Input for a purpose associated with a consent workflow trigger
*/
export const ConsentWorkflowTriggerPurposeInput = t.type({
/** The tracking type slug of the purpose */
'tracking-type': t.string,
/** The matching consent state for the purpose */
'matching-state': t.boolean,
});

/** Type override */
export type ConsentWorkflowTriggerPurposeInput = t.TypeOf<
typeof ConsentWorkflowTriggerPurposeInput
>;

/**
* Input to define a consent workflow trigger
*/
export const ConsentWorkflowTriggerInput = t.intersection([
t.type({
/** The name of the consent workflow trigger */
name: t.string,
}),
t.partial({
/** The trigger condition as a JSON string */
'trigger-condition': t.string,
/** The action type (e.g. ERASURE, ACCESS) */
'action-type': t.string,
/** The data subject type */
'data-subject-type': t.string,
/** Whether the trigger runs silently */
'is-silent': t.boolean,
/** Whether unauthenticated requests are allowed */
'allow-unauthenticated': t.boolean,
/** Whether the trigger is active */
'is-active': t.boolean,
/** Titles of data silos associated with this trigger */
'data-silo-titles': t.array(t.string),
/** Purposes and their matching consent states */
purposes: t.array(ConsentWorkflowTriggerPurposeInput),
}),
]);

/** Type override */
export type ConsentWorkflowTriggerInput = t.TypeOf<typeof ConsentWorkflowTriggerInput>;

export const TranscendInput = t.partial({
/**
* Action items
Expand Down Expand Up @@ -2061,6 +2107,14 @@ export const TranscendInput = t.partial({
* The full list of silo discovery results
*/
'system-discovery': t.array(SiloDiscoveryResultInput),
/**
* Consent workflow trigger definitions
*/
'consent-workflow-triggers': t.array(ConsentWorkflowTriggerInput),
/**
* Preference management options for multi and single selects
*/
'preference-options': t.array(ConsentPreferenceTopicOptionValue),
});

/** Type override */
Expand Down
10 changes: 10 additions & 0 deletions packages/cli/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ export const TR_PUSH_RESOURCE_SCOPE_MAP: {
ScopeName.ManageConsentManager,
ScopeName.ManagePreferenceStoreSettings,
],
[TranscendPullResource.PreferenceOptions]: [ScopeName.ManagePreferenceStoreSettings],
[TranscendPullResource.SystemDiscovery]: [ScopeName.ManageDataMap],
[TranscendPullResource.ConsentWorkflowTriggers]: [
ScopeName.ManageConsentManager,
ScopeName.ViewDataSubjectRequestSettings,
ScopeName.ViewConsentManager,
],
};

/**
Expand Down Expand Up @@ -119,7 +125,9 @@ export const TR_PULL_RESOURCE_SCOPE_MAP: {
ScopeName.ViewConsentManager,
ScopeName.ViewPreferenceStoreSettings,
],
[TranscendPullResource.PreferenceOptions]: [ScopeName.ViewPreferenceStoreSettings],
[TranscendPullResource.SystemDiscovery]: [ScopeName.ViewDataMap],
[TranscendPullResource.ConsentWorkflowTriggers]: [ScopeName.ViewConsentManager],
};

export const TR_YML_RESOURCE_TO_FIELD_NAME: Record<TranscendPullResource, keyof TranscendInput> = {
Expand Down Expand Up @@ -155,7 +163,9 @@ export const TR_YML_RESOURCE_TO_FIELD_NAME: Record<TranscendPullResource, keyof
[TranscendPullResource.Assessments]: 'assessments',
[TranscendPullResource.AssessmentTemplates]: 'assessment-templates',
[TranscendPullResource.Purposes]: 'purposes',
[TranscendPullResource.PreferenceOptions]: 'preference-options',
[TranscendPullResource.SystemDiscovery]: 'system-discovery',
[TranscendPullResource.ConsentWorkflowTriggers]: 'consent-workflow-triggers',
};

export const SCOPES_BY_TITLE = keyBy(
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export enum TranscendPullResource {
Assessments = 'assessments',
AssessmentTemplates = 'assessmentTemplates',
Purposes = 'purposes',
PreferenceOptions = 'preferenceOptions',
SystemDiscovery = 'systemDiscovery',
ConsentWorkflowTriggers = 'consentWorkflowTriggers',
}

/**
Expand Down
15 changes: 15 additions & 0 deletions packages/cli/src/lib/docgen/createPullResourceScopesTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,28 @@ const RESOURCE_DOCUMENTATION: Record<
(https://app.transcend.io/consent-manager/regional-experiences/purposes)',
],
},
[TranscendPullResource.PreferenceOptions]: {
description: 'Preference management options for multi and single select preference topics.',
markdownLinks: [
'[Preference Management -> Preference Topics -> Options]\
(https://app.transcend.io/preference-store/preference-topics/preference-options)',
],
},
[TranscendPullResource.SystemDiscovery]: {
description: 'System discovery results',
markdownLinks: [
'[System Discovery]\
(https://app.transcend.io/data-map/data-inventory/silo-discovery)',
],
},
[TranscendPullResource.ConsentWorkflowTriggers]: {
description:
'Consent workflow trigger definitions that automate privacy request workflows based on consent state changes.',
markdownLinks: [
'[Consent Management -> Consent Workflows]\
(https://app.transcend.io/consent-manager/consent-workflows)',
],
},
};

/**
Expand Down
Loading
Loading