Skip to content

Commit df93091

Browse files
committed
Support provider PII compliance, starting with Atlassian
1 parent 10444e1 commit df93091

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

.changeset/wild-lies-shout.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@plotday/tool-jira": minor
3+
"@plotday/twister": minor
4+
---
5+
6+
Added: Contact.source for external service PII compliance

tools/jira/src/jira.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,15 @@ export class Jira extends Tool<Jira> implements ProjectTool {
382382
email: reporter.emailAddress,
383383
name: reporter.displayName,
384384
avatar: reporter.avatarUrls?.["48x48"],
385+
...atlassianSource(reporter.accountId),
385386
};
386387
}
387388
if (assignee?.emailAddress) {
388389
assigneeContact = {
389390
email: assignee.emailAddress,
390391
name: assignee.displayName,
391392
avatar: assignee.avatarUrls?.["48x48"],
393+
...atlassianSource(assignee.accountId),
392394
};
393395
}
394396

@@ -453,6 +455,7 @@ export class Jira extends Tool<Jira> implements ProjectTool {
453455
email: author.emailAddress,
454456
name: author.displayName,
455457
avatar: author.avatarUrl,
458+
...atlassianSource(author.accountId),
456459
};
457460
}
458461

@@ -721,13 +724,15 @@ export class Jira extends Tool<Jira> implements ProjectTool {
721724
email: reporter.emailAddress,
722725
name: reporter.displayName,
723726
avatar: reporter.avatarUrls?.["48x48"],
727+
...atlassianSource(reporter.accountId),
724728
};
725729
}
726730
if (assignee?.emailAddress) {
727731
assigneeContact = {
728732
email: assignee.emailAddress,
729733
name: assignee.displayName,
730734
avatar: assignee.avatarUrls?.["48x48"],
735+
...atlassianSource(assignee.accountId),
731736
};
732737
}
733738

@@ -814,6 +819,7 @@ export class Jira extends Tool<Jira> implements ProjectTool {
814819
email: author.emailAddress,
815820
name: author.displayName,
816821
avatar: author.avatarUrls?.["48x48"],
822+
...atlassianSource(author.accountId),
817823
};
818824
}
819825

@@ -873,4 +879,15 @@ export class Jira extends Tool<Jira> implements ProjectTool {
873879
}
874880
}
875881

882+
/**
883+
* Returns a `source` property for NewContact if the Atlassian accountId is valid.
884+
* Used for Atlassian personal data reporting compliance.
885+
*/
886+
function atlassianSource(accountId: string | undefined): Pick<NewContact, "source"> | {} {
887+
if (accountId && accountId !== "_unknown_") {
888+
return { source: { provider: AuthProvider.Atlassian, accountId } };
889+
}
890+
return {};
891+
}
892+
876893
export default Jira;

twister/src/plot.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { type Tag } from "./tag";
22
import { type Callback } from "./tools/callbacks";
3+
import { type AuthProvider } from "./tools/integrations";
34
import { type JSONValue } from "./utils/types";
45
import { Uuid } from "./utils/uuid";
56

67
export { Tag } from "./tag";
78
export { Uuid } from "./utils/uuid";
89
export { type JSONValue } from "./utils/types";
10+
export { type AuthProvider } from "./tools/integrations";
911

1012
/**
1113
* @fileoverview
@@ -1243,6 +1245,12 @@ export type NewContact = {
12431245
name?: string;
12441246
/** Optional avatar image URL for the contact */
12451247
avatar?: string;
1248+
/**
1249+
* External provider account source. Used for privacy compliance
1250+
* (e.g. Atlassian personal data reporting for GDPR account closure).
1251+
* Required for contacts sourced from providers that mandate personal data reporting.
1252+
*/
1253+
source?: { provider: AuthProvider; accountId: string };
12461254
};
12471255

12481256
export type ContentType = "text" | "markdown" | "html";

0 commit comments

Comments
 (0)