@cat-factory/integrations 0.152.7 → 0.153.0

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.
Files changed (53) hide show
  1. package/dist/index.d.ts +5 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +5 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/tasks/GitHubIssuesProvider.d.ts +9 -1
  6. package/dist/modules/tasks/GitHubIssuesProvider.d.ts.map +1 -1
  7. package/dist/modules/tasks/GitHubIssuesProvider.js +18 -0
  8. package/dist/modules/tasks/GitHubIssuesProvider.js.map +1 -1
  9. package/dist/modules/tasks/GitLabIssuesProvider.d.ts +20 -1
  10. package/dist/modules/tasks/GitLabIssuesProvider.d.ts.map +1 -1
  11. package/dist/modules/tasks/GitLabIssuesProvider.js +30 -0
  12. package/dist/modules/tasks/GitLabIssuesProvider.js.map +1 -1
  13. package/dist/modules/tasks/JiraProvider.d.ts +6 -0
  14. package/dist/modules/tasks/JiraProvider.d.ts.map +1 -1
  15. package/dist/modules/tasks/JiraProvider.js +7 -0
  16. package/dist/modules/tasks/JiraProvider.js.map +1 -1
  17. package/dist/modules/tasks/LinearTaskProvider.d.ts +6 -0
  18. package/dist/modules/tasks/LinearTaskProvider.d.ts.map +1 -1
  19. package/dist/modules/tasks/LinearTaskProvider.js +7 -0
  20. package/dist/modules/tasks/LinearTaskProvider.js.map +1 -1
  21. package/dist/modules/tasks/gitlab-issues.logic.d.ts +10 -0
  22. package/dist/modules/tasks/gitlab-issues.logic.d.ts.map +1 -1
  23. package/dist/modules/tasks/gitlab-issues.logic.js +12 -0
  24. package/dist/modules/tasks/gitlab-issues.logic.js.map +1 -1
  25. package/dist/modules/tasks/intakeMatch.logic.d.ts +6 -5
  26. package/dist/modules/tasks/intakeMatch.logic.d.ts.map +1 -1
  27. package/dist/modules/tasks/intakeMatch.logic.js +33 -14
  28. package/dist/modules/tasks/intakeMatch.logic.js.map +1 -1
  29. package/dist/modules/tasks/webhook/adapters.d.ts +16 -0
  30. package/dist/modules/tasks/webhook/adapters.d.ts.map +1 -1
  31. package/dist/modules/tasks/webhook/adapters.js +117 -1
  32. package/dist/modules/tasks/webhook/adapters.js.map +1 -1
  33. package/dist/modules/tasks/webhook/hmac.d.ts +11 -0
  34. package/dist/modules/tasks/webhook/hmac.d.ts.map +1 -1
  35. package/dist/modules/tasks/webhook/hmac.js +30 -6
  36. package/dist/modules/tasks/webhook/hmac.js.map +1 -1
  37. package/dist/modules/tasks/writeback/jira.writeback.d.ts +4 -0
  38. package/dist/modules/tasks/writeback/jira.writeback.d.ts.map +1 -0
  39. package/dist/modules/tasks/writeback/jira.writeback.js +89 -0
  40. package/dist/modules/tasks/writeback/jira.writeback.js.map +1 -0
  41. package/dist/modules/tasks/writeback/linear.writeback.d.ts +4 -0
  42. package/dist/modules/tasks/writeback/linear.writeback.d.ts.map +1 -0
  43. package/dist/modules/tasks/writeback/linear.writeback.js +66 -0
  44. package/dist/modules/tasks/writeback/linear.writeback.js.map +1 -0
  45. package/dist/modules/tasks/writeback/repo-issue.writeback.d.ts +32 -0
  46. package/dist/modules/tasks/writeback/repo-issue.writeback.d.ts.map +1 -0
  47. package/dist/modules/tasks/writeback/repo-issue.writeback.js +70 -0
  48. package/dist/modules/tasks/writeback/repo-issue.writeback.js.map +1 -0
  49. package/dist/modules/writeback/IssueWritebackService.d.ts +69 -111
  50. package/dist/modules/writeback/IssueWritebackService.d.ts.map +1 -1
  51. package/dist/modules/writeback/IssueWritebackService.js +155 -222
  52. package/dist/modules/writeback/IssueWritebackService.js.map +1 -1
  53. package/package.json +4 -4
@@ -57,6 +57,16 @@ export declare function gitlabIssueUrl(id: GitLabIssueExternalId, webBaseUrl: st
57
57
  * absent/unparseable value rather than a guess, so {@link gitlabIssueUrl} withholds its link.
58
58
  */
59
59
  export declare function gitlabWebBaseFromApiBase(apiBase: string | undefined): string | undefined;
60
+ /**
61
+ * The provider's `sameBoard` rule: whether two project paths name the same GitLab project.
62
+ *
63
+ * Case-SENSITIVE, unlike the default fold the intake matcher applies to every other source's
64
+ * board id. GitLab serves `Acme/web` and `acme/web` as two DIFFERENT projects, so folding case
65
+ * would admit a pushed delivery from one to a schedule scoped to the other, and under the
66
+ * `per-ticket` dispatch mode that is a block and an agent run on a stranger's issue. Same
67
+ * asymmetry, and same reason for it living on the source, as {@link gitlabIssueInRepoScope}.
68
+ */
69
+ export declare function gitlabSameProject(a: string, b: string): boolean;
60
70
  /**
61
71
  * The provider's `TaskRepoScopeRules` matcher: whether a STORED external id belongs to the
62
72
  * scoped project.
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab-issues.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/gitlab-issues.logic.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAA+B,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAgBtF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,oBAQtC,CAAA;AAED,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,qBAAqB,GAAG,MAAM,CAEvE;AAoBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAShE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAM3F;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,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AAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACpC,KAAK,EAAE,iBAAiB,CAAA;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACpC,kBAAkB,CA6BpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,4GAA+D,CAAA;AAEnG;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,yBAAmB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,mBAAmB,GACzB,MAAM,GAAG,IAAI,CAgBf"}
@@ -115,6 +115,18 @@ export function gitlabWebBaseFromApiBase(apiBase) {
115
115
  const stripped = trimmed.replace(/\/api\/v\d+$/, '');
116
116
  return stripped || undefined;
117
117
  }
118
+ /**
119
+ * The provider's `sameBoard` rule: whether two project paths name the same GitLab project.
120
+ *
121
+ * Case-SENSITIVE, unlike the default fold the intake matcher applies to every other source's
122
+ * board id. GitLab serves `Acme/web` and `acme/web` as two DIFFERENT projects, so folding case
123
+ * would admit a pushed delivery from one to a schedule scoped to the other, and under the
124
+ * `per-ticket` dispatch mode that is a block and an agent run on a stranger's issue. Same
125
+ * asymmetry, and same reason for it living on the source, as {@link gitlabIssueInRepoScope}.
126
+ */
127
+ export function gitlabSameProject(a, b) {
128
+ return a.trim() === b.trim();
129
+ }
118
130
  /**
119
131
  * The provider's `TaskRepoScopeRules` matcher: whether a STORED external id belongs to the
120
132
  * scoped project.
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab-issues.logic.js","sourceRoot":"","sources":["../../../src/modules/tasks/gitlab-issues.logic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAK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CAAC,OAAO,CAAC;SACxB,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { IssueIntakeConfig, TrackerIssueEvent } from '@cat-factory/kernel';
1
+ import type { IssueIntakeConfig, TaskSourceProvider, TrackerIssueEvent } from '@cat-factory/kernel';
2
2
  /** The intake configuration a schedule carries (`PipelineSchedule.issueIntake`). */
3
3
  type IntakeConfig = Pick<IssueIntakeConfig, 'source' | 'board' | 'predicates'>;
4
4
  /** The predicates an event is judged against, named so a verdict can say which one it was. */
@@ -28,9 +28,10 @@ export type IntakeMatchVerdict = {
28
28
  *
29
29
  * - **source** must be the schedule's source (always evaluable; a mismatch is a `miss`).
30
30
  * - **board** must equal the configured scope for that source. The event carries it in exactly
31
- * the shape the configured field does, so no per-vendor knowledge is needed here. A `null`
32
- * board on the event is `unconfirmed`, never a match: a schedule scoped to one project must not
33
- * be assumed to cover a delivery that never named one.
31
+ * the shape the configured field does, so no per-vendor knowledge is needed here beyond the
32
+ * EQUALITY rule, which the source owns (see {@link foldedBoardEquality}) and `provider` supplies.
33
+ * A `null` board on the event is `unconfirmed`, never a match: a schedule scoped to one project
34
+ * must not be assumed to cover a delivery that never named one.
34
35
  * - **labels**: every configured label must be present, case-insensitively (the vendor queries
35
36
  * are `AND`-semantics; GitHub and Jira both match labels case-insensitively). An event carrying
36
37
  * no labels at all cannot answer a label predicate, so it is `unconfirmed`.
@@ -43,6 +44,6 @@ export type IntakeMatchVerdict = {
43
44
  * A `closed` event never qualifies: intake picks up OPEN issues, and acting on a close would spend
44
45
  * a run to discover the issue is gone.
45
46
  */
46
- export declare function judgeIssueEventForIntake(config: IntakeConfig, event: TrackerIssueEvent): IntakeMatchVerdict;
47
+ export declare function judgeIssueEventForIntake(config: IntakeConfig, event: TrackerIssueEvent, provider?: Pick<TaskSourceProvider, 'sameBoard'>): IntakeMatchVerdict;
47
48
  export {};
48
49
  //# sourceMappingURL=intakeMatch.logic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"intakeMatch.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/intakeMatch.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AA2B/E,oFAAoF;AACpF,KAAK,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC,CAAA;AAE9E,8FAA8F;AAC9F,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,eAAe,GAAG,WAAW,CAAA;AAEpF;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GACpB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAAE,GACzE;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,mBAAmB,EAAE,CAAA;CAAE,CAAA;AAEjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,iBAAiB,GACvB,kBAAkB,CA8CpB"}
1
+ {"version":3,"file":"intakeMatch.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/intakeMatch.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AA2BnG,oFAAoF;AACpF,KAAK,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC,CAAA;AAE9E,8FAA8F;AAC9F,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,eAAe,GAAG,WAAW,CAAA;AAEpF;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GACpB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAAE,GACzE;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,mBAAmB,EAAE,CAAA;CAAE,CAAA;AAEjE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,iBAAiB,EACxB,QAAQ,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,GAC/C,kBAAkB,CAgDpB"}
@@ -5,9 +5,10 @@
5
5
  *
6
6
  * - **source** must be the schedule's source (always evaluable; a mismatch is a `miss`).
7
7
  * - **board** must equal the configured scope for that source. The event carries it in exactly
8
- * the shape the configured field does, so no per-vendor knowledge is needed here. A `null`
9
- * board on the event is `unconfirmed`, never a match: a schedule scoped to one project must not
10
- * be assumed to cover a delivery that never named one.
8
+ * the shape the configured field does, so no per-vendor knowledge is needed here beyond the
9
+ * EQUALITY rule, which the source owns (see {@link foldedBoardEquality}) and `provider` supplies.
10
+ * A `null` board on the event is `unconfirmed`, never a match: a schedule scoped to one project
11
+ * must not be assumed to cover a delivery that never named one.
11
12
  * - **labels**: every configured label must be present, case-insensitively (the vendor queries
12
13
  * are `AND`-semantics; GitHub and Jira both match labels case-insensitively). An event carrying
13
14
  * no labels at all cannot answer a label predicate, so it is `unconfirmed`.
@@ -20,7 +21,7 @@
20
21
  * A `closed` event never qualifies: intake picks up OPEN issues, and acting on a close would spend
21
22
  * a run to discover the issue is gone.
22
23
  */
23
- export function judgeIssueEventForIntake(config, event) {
24
+ export function judgeIssueEventForIntake(config, event, provider) {
24
25
  if (event.source !== config.source)
25
26
  return { outcome: 'miss', predicate: 'source' };
26
27
  if (event.action === 'closed')
@@ -34,8 +35,9 @@ export function judgeIssueEventForIntake(config, event) {
34
35
  // silently suppress a schedule rather than reporting that it could not be checked.
35
36
  if (!event.board?.trim())
36
37
  unconfirmed.push('board');
37
- else if (!sameBoard(event.board, scope))
38
+ else if (!sameBoard(provider, event.board, scope)) {
38
39
  return { outcome: 'miss', predicate: 'board' };
40
+ }
39
41
  }
40
42
  const labels = config.predicates.labels ?? [];
41
43
  if (labels.length > 0) {
@@ -86,17 +88,34 @@ function configuredBoard(config) {
86
88
  undefined);
87
89
  }
88
90
  /**
89
- * Case-insensitive comparison, because the two sides are typed by different hands: a Jira project
90
- * key and a GitHub `owner/repo` are both case-insensitive at the vendor, and the operator typed
91
- * one of them into a form. A Linear team UUID is unaffected by folding case.
91
+ * Ask the source whether two board ids name the same board, falling back to {@link
92
+ * foldedBoardEquality} where it declares no rule.
93
+ *
94
+ * Called as a METHOD on the provider, never lifted off it. `sameBoard` is declared on the port as
95
+ * a method signature, so a deployment is entitled to implement it as a class method that reads
96
+ * `this` (the provider's configured instance URL, its own case rules); a detached
97
+ * `(provider?.sameBoard ?? fallback)(…)` throws a `TypeError` on the first pushed delivery for
98
+ * such a provider and takes the whole push-intake loop down with it. The built-in providers assign
99
+ * standalone functions and would never have shown it. Every sibling capability is invoked the same
100
+ * bound way (`repoScope.matches(…)`, the writeback's `commentOnIssue.call(client, …)`).
101
+ */
102
+ function sameBoard(provider, a, b) {
103
+ return provider?.sameBoard ? provider.sameBoard(a, b) : foldedBoardEquality(a, b);
104
+ }
105
+ /**
106
+ * The DEFAULT board comparison: case-insensitive, because the two sides are typed by different
107
+ * hands. A Jira project key and a GitHub `owner/repo` are both case-insensitive at the vendor, the
108
+ * operator typed one of them into a form, and folding case leaves a Linear team UUID unaffected.
92
109
  *
93
- * A GitLab project path is the one member the vendor treats as case-SENSITIVE, so this fold is
94
- * more forgiving than GitLab itself would be. It is unreachable today (GitLab has no webhook
95
- * adapter, so no delivery ever gets here) and belongs to the slice that adds one, which is where
96
- * a per-source comparison could be threaded through from the provider's own `repoScope` rules
97
- * rather than guessed at here.
110
+ * It is a default rather than the rule, because it is WRONG for GitLab, whose project paths the
111
+ * vendor treats as case-SENSITIVE: folding them would admit a delivery from `Acme/web` to a
112
+ * schedule scoped to `acme/web`, two different projects, and under `per-ticket` dispatch that is a
113
+ * real block and a real agent run on a stranger's issue. So a source that knows better declares
114
+ * `TaskSourceProvider.sameBoard` and the caller passes its provider in, the same asymmetry
115
+ * `repoScope` already states about external ids. A source that does not declare one keeps this
116
+ * fold, so no existing behaviour moves.
98
117
  */
99
- function sameBoard(a, b) {
118
+ function foldedBoardEquality(a, b) {
100
119
  return a.trim().toLowerCase() === b.trim().toLowerCase();
101
120
  }
102
121
  //# sourceMappingURL=intakeMatch.logic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"intakeMatch.logic.js","sourceRoot":"","sources":["../../../src/modules/tasks/intakeMatch.logic.ts"],"names":[],"mappings":"AA+CA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAoB,EACpB,KAAwB;IAExB,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM;QAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAA;IACnF,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAA;IAE9E,MAAM,WAAW,GAA0B,EAAE,CAAA;IAE7C,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;IACrC,IAAI,KAAK,EAAE,CAAC;QACV,4FAA4F;QAC5F,8FAA8F;QAC9F,wFAAwF;QACxF,mFAAmF;QACnF,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;YAAE,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;aAC9C,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EA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;QAC5B,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE;QAC1B,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE;QACxB,KAAK,CAAC,aAAa,EAAE,IAAI,EAAE;QAC3B,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE;QACrB,SAAS,CACV,CAAA;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,SAAS,CAChB,QAA2D,EAC3D,CAAS,EACT,CAAS;IAET,OAAO,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACnF,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,mBAAmB,CAAC,CAAS,EAAE,CAAS;IAC/C,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;AAC1D,CAAC"}
@@ -28,4 +28,20 @@ export declare const jiraWebhookAdapter: TaskSourceWebhookAdapter;
28
28
  * The raw `data.issue.id` is a UUID and would never match an imported row.
29
29
  */
30
30
  export declare const linearWebhookAdapter: TaskSourceWebhookAdapter;
31
+ /**
32
+ * GitLab.
33
+ *
34
+ * Two differences from the three above, both load-bearing:
35
+ *
36
+ * - **There is no signature.** GitLab echoes the caller-chosen secret in `X-Gitlab-Token`, so
37
+ * verification is a constant-time compare of that header (see {@link verifySharedToken}).
38
+ * - **The payload is keyed by `object_kind` in the BODY**, like Jira's `webhookEvent`, so the
39
+ * delivery's `eventName` header is ignored here.
40
+ *
41
+ * The external id is built through {@link parseGitLabIssueRef} rather than concatenated, so a
42
+ * project path the id grammar cannot express (one GitLab would serve but our parser does not
43
+ * admit) maps to `null` (an unrecognised delivery, which the receiver acks) instead of minting an id that no
44
+ * imported row can ever match.
45
+ */
46
+ export declare const gitlabIssuesWebhookAdapter: TaskSourceWebhookAdapter;
31
47
  //# sourceMappingURL=adapters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../../../src/modules/tasks/webhook/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAGzB,MAAM,qBAAqB,CAAA;AA6B5B;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,EAAE,wBAkDxC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,wBA8DhC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,wBAsDlC,CAAA"}
1
+ {"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../../../src/modules/tasks/webhook/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAGzB,MAAM,qBAAqB,CAAA;AAuC5B;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,EAAE,wBAkDxC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,wBA8DhC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,wBAsDlC,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,0BAA0B,EAAE,wBA4DxC,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import { githubIssueExternalId } from '../github-issues.logic.js';
2
+ import { parseGitLabIssueRef } from '../gitlab-issues.logic.js';
2
3
  import { adfToMarkdown } from '../jira.logic.js';
3
- import { parseJsonBody, readObject, readString, verifyHmacSignature } from './hmac.js';
4
+ import { parseJsonBody, readObject, readString, verifyHmacSignature, verifySharedToken, } from './hmac.js';
4
5
  // The per-vendor half of tracker webhook ingest: verify a delivery's signature and map its
5
6
  // payload onto the neutral `TrackerWebhookEvent`. Everything transport-shaped (raw body, fast
6
7
  // ack, hand-off to the facade's queue) lives in the shared receiver; everything vendor-shaped
@@ -21,6 +22,8 @@ const GITHUB_SCHEME = { header: 'x-hub-signature-256', prefix: 'sha256=' };
21
22
  const JIRA_SCHEME = { header: 'x-hub-signature', prefix: 'sha256=' };
22
23
  /** Linear deliveries: bare HMAC-SHA256 hex in `Linear-Signature` (no scheme prefix). */
23
24
  const LINEAR_SCHEME = { header: 'linear-signature', prefix: '' };
25
+ /** GitLab deliveries: the shared secret itself, echoed in `X-Gitlab-Token` (no signature). */
26
+ const GITLAB_TOKEN_HEADER = 'x-gitlab-token';
24
27
  /**
25
28
  * GitHub Issues.
26
29
  *
@@ -218,6 +221,119 @@ export const linearWebhookAdapter = {
218
221
  return null;
219
222
  },
220
223
  };
224
+ /**
225
+ * GitLab.
226
+ *
227
+ * Two differences from the three above, both load-bearing:
228
+ *
229
+ * - **There is no signature.** GitLab echoes the caller-chosen secret in `X-Gitlab-Token`, so
230
+ * verification is a constant-time compare of that header (see {@link verifySharedToken}).
231
+ * - **The payload is keyed by `object_kind` in the BODY**, like Jira's `webhookEvent`, so the
232
+ * delivery's `eventName` header is ignored here.
233
+ *
234
+ * The external id is built through {@link parseGitLabIssueRef} rather than concatenated, so a
235
+ * project path the id grammar cannot express (one GitLab would serve but our parser does not
236
+ * admit) maps to `null` (an unrecognised delivery, which the receiver acks) instead of minting an id that no
237
+ * imported row can ever match.
238
+ */
239
+ export const gitlabIssuesWebhookAdapter = {
240
+ verify: async (secret, delivery) => verifySharedToken(secret, delivery.headers, GITLAB_TOKEN_HEADER),
241
+ parse(delivery) {
242
+ const payload = parseJsonBody(delivery.raw);
243
+ if (!payload)
244
+ return null;
245
+ const project = readString(payload, 'project', 'path_with_namespace');
246
+ if (!project)
247
+ return null;
248
+ const kind = readString(payload, 'object_kind');
249
+ if (kind === 'note') {
250
+ // Notes cover merge requests, commits and snippets too; only an issue note drives the loop.
251
+ // (A reply command typed on an MR therefore does nothing, exactly as on GitHub, where the
252
+ // shared issue/PR number space makes the same comment simply find no linked task.)
253
+ if (readString(payload, 'object_attributes', 'noteable_type') !== 'Issue')
254
+ return null;
255
+ const externalId = gitlabExternalId(project, readString(payload, 'issue', 'iid'));
256
+ const commentId = readString(payload, 'object_attributes', 'id');
257
+ const body = readString(payload, 'object_attributes', 'note');
258
+ if (!externalId || !commentId || !body)
259
+ return null;
260
+ return {
261
+ kind: 'comment',
262
+ source: 'gitlab',
263
+ externalId,
264
+ commentId,
265
+ body,
266
+ author: gitlabAuthor(readObject(payload, 'user')),
267
+ };
268
+ }
269
+ if (kind === 'issue') {
270
+ const attrs = readObject(payload, 'object_attributes');
271
+ const externalId = gitlabExternalId(project, readString(attrs, 'iid'));
272
+ if (!externalId)
273
+ return null;
274
+ return {
275
+ kind: 'issue',
276
+ source: 'gitlab',
277
+ externalId,
278
+ action: gitlabIssueAction(readString(attrs, 'action'), readString(attrs, 'state')),
279
+ title: readString(attrs, 'title') ?? '',
280
+ // GitLab labels carry `title`, not the `name` the other three read. Both the
281
+ // top-level list and the one nested on the issue are sent depending on the instance's
282
+ // version, so read whichever is populated rather than picking one and reporting an
283
+ // unlabelled issue (which an intake label predicate would read as `unconfirmed`).
284
+ labels: readTitleList(payload, 'labels').length
285
+ ? readTitleList(payload, 'labels')
286
+ : readTitleList(attrs, 'labels'),
287
+ // GitLab's issue TYPE vocabulary (`issue`/`incident`/`test_case`/`task`) has no member
288
+ // meaning "bug", which is why `GitLabIssuesProvider` declares `issueType` among its
289
+ // `ignoredIntakePredicates` and omits it from the vendor query. Reporting the payload's
290
+ // type here would make the push path evaluate a predicate the polling path ignores, so
291
+ // the same delivery would be admitted by a schedule fire and refused by a webhook.
292
+ issueType: null,
293
+ // The full path with namespace, exactly what `IssueIntakeQuery.board.gitlabProject`
294
+ // carries and what `listBoards` hands the picker.
295
+ board: project,
296
+ url: readString(attrs, 'url'),
297
+ };
298
+ }
299
+ return null;
300
+ },
301
+ };
302
+ /**
303
+ * The canonical `group/sub/project#iid` id for a delivery's project path + issue iid, or null when
304
+ * either is missing or the pair does not parse as a reference we could have imported.
305
+ */
306
+ function gitlabExternalId(project, iid) {
307
+ if (!iid)
308
+ return null;
309
+ return parseGitLabIssueRef(`${project}#${iid}`);
310
+ }
311
+ /** GitLab's issue actions collapsed onto the neutral lifecycle triple. */
312
+ function gitlabIssueAction(action, state) {
313
+ if (action === 'open')
314
+ return 'created';
315
+ // `close` is the explicit action; the state check catches an `update` delivered for an issue
316
+ // that is already closed, which must not be re-offered to intake as live work.
317
+ if (action === 'close' || state === 'closed')
318
+ return 'closed';
319
+ return 'updated';
320
+ }
321
+ function gitlabAuthor(user) {
322
+ return {
323
+ id: readString(user, 'id'),
324
+ handle: readString(user, 'username') ?? readString(user, 'name'),
325
+ email: readString(user, 'email'),
326
+ // GitLab's webhook `user` object carries no bot flag, so an integration's own notes are
327
+ // caught by the identity allow-list rather than here, and reported honestly as `false` instead
328
+ // of guessed at from the username, exactly as on Linear.
329
+ bot: false,
330
+ };
331
+ }
332
+ /** Read a list of `{ title }` objects (GitLab labels) as plain names. */
333
+ function readTitleList(payload, ...path) {
334
+ const list = readList(payload, path);
335
+ return list.map((entry) => readString(entry, 'title')).filter((v) => v != null);
336
+ }
221
337
  /** GitHub's issue actions collapsed onto the neutral lifecycle triple. */
222
338
  function githubIssueAction(action) {
223
339
  if (action === 'opened')
@@ -1 +1 @@
1
- {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../../../src/modules/tasks/webhook/adapters.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAEtF,2FAA2F;AAC3F,8FAA8F;AAC9F,8FAA8F;AAC9F,+EAA+E;AAC/E,EAAE;AACF,0CAA0C;AAC1C,EAAE;AACF,iGAAiG;AACjG,8FAA8F;AAC9F,iGAAiG;AACjG,wEAAwE;AACxE,2FAA2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CAAC,IAAI,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC;QACnE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC;QAChC,wFAAwF;QACxF,8FAA8F;QAC9F,4BAA4B;QAC5B,GAAG,EAAE,KAAK;KACX,CAAA;AACH,CAAC;AAED,+EAA+E;AAC/E,SAAS,YAAY,CAAC,OAAgB,EAAE,GAAG,IAAc;IACvD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IACpC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAA;AAC7F,CAAC;AAED,kDAAkD;AAClD,SAAS,cAAc,CAAC,OAAgB,EAAE,GAAG,IAAc;IACzD,OAAO,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAA;AAClF,CAAC;AAED,SAAS,QAAQ,CAAC,OAAgB,EAAE,IAAc;IAChD,IAAI,MAAM,GAAY,OAAO,CAAA;IAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAA;QACpD,MAAM,GAAI,MAAkC,CAAC,GAAG,CAAC,CAAA;IACnD,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;AAC5C,CAAC"}
@@ -25,6 +25,17 @@ export interface HmacHeaderScheme {
25
25
  * anyone willing to send a few thousand deliveries.
26
26
  */
27
27
  export declare function verifyHmacSignature(secret: string, raw: ArrayBuffer, headers: Record<string, string>, scheme: HmacHeaderScheme): Promise<boolean>;
28
+ /**
29
+ * Verify a delivery whose vendor sends the shared secret itself in a header (GitLab's
30
+ * `X-Gitlab-Token`) rather than a signature over the body.
31
+ *
32
+ * The same two guards as {@link verifyHmacSignature} apply and for the same reasons: an empty
33
+ * stored secret fails closed FIRST (an unconfigured connection must not accept a delivery that
34
+ * also presents nothing), and the comparison is timing-safe. The body is not read here at all,
35
+ * because nothing in this scheme binds the token to it, which is precisely why the platform
36
+ * still reads the RAW body once, before any parse, rather than trusting a re-serialisation.
37
+ */
38
+ export declare function verifySharedToken(secret: string, headers: Record<string, string>, header: string): boolean;
28
39
  /** Decode a delivery's raw bytes as JSON, or null when it is not parseable JSON. */
29
40
  export declare function parseJsonBody(raw: ArrayBuffer): Record<string, unknown> | null;
30
41
  /** Read a nested string off an untrusted payload (`obj.a.b`), or null. */
@@ -1 +1 @@
1
- {"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../../../src/modules/tasks/webhook/hmac.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,OAAO,CAAC,CAiBlB;AAiBD,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAS9E;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAW7E;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAS9F"}
1
+ {"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../../../src/modules/tasks/webhook/hmac.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,OAAO,CAAC,CAiBlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,MAAM,EAAE,MAAM,GACb,OAAO,CAMT;AAiBD,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAS9E;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAW7E;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAS9F"}
@@ -1,10 +1,15 @@
1
- // Inbound-webhook signature verification shared by every tracker adapter.
1
+ // Inbound-webhook verification shared by every tracker adapter.
2
2
  //
3
- // All three vendors sign HMAC-SHA256 over the RAW request body and differ only in which header
4
- // carries the digest and whether it is prefixed (`sha256=<hex>` on GitHub/Jira, a bare `<hex>` on
5
- // Linear). So the crypto lives here once and each adapter supplies its header name + prefix —
6
- // rather than three near-verbatim copies, which is exactly how a fix to one silently misses the
7
- // others (the lesson `captured-command.ts` records on the harness side).
3
+ // GitHub, Jira and Linear sign HMAC-SHA256 over the RAW request body and differ only in which
4
+ // header carries the digest and whether it is prefixed (`sha256=<hex>` on GitHub/Jira, a bare
5
+ // `<hex>` on Linear). So the crypto lives here once and each adapter supplies its header name +
6
+ // prefix, rather than three near-verbatim copies, which is exactly how a fix to one silently
7
+ // misses the others (the lesson `captured-command.ts` records on the harness side).
8
+ //
9
+ // GitLab does not sign at all: it echoes a caller-chosen secret in `X-Gitlab-Token`, which
10
+ // {@link verifySharedToken} compares. That is a WEAKER scheme (the secret travels on every
11
+ // delivery, and nothing binds it to the body), and it is the vendor's only option, so it is named
12
+ // as its own function rather than dressed up as a signature check.
8
13
  //
9
14
  // This is the same Web Crypto construction `WebCryptoWebhookVerifier` (`@cat-factory/server`) uses
10
15
  // for GitHub VCS deliveries, re-expressed here because `@cat-factory/server` sits ABOVE this
@@ -40,6 +45,25 @@ export async function verifyHmacSignature(secret, raw, headers, scheme) {
40
45
  const computed = new Uint8Array(await crypto.subtle.sign('HMAC', key, raw));
41
46
  return timingSafeEqual(provided, computed);
42
47
  }
48
+ /**
49
+ * Verify a delivery whose vendor sends the shared secret itself in a header (GitLab's
50
+ * `X-Gitlab-Token`) rather than a signature over the body.
51
+ *
52
+ * The same two guards as {@link verifyHmacSignature} apply and for the same reasons: an empty
53
+ * stored secret fails closed FIRST (an unconfigured connection must not accept a delivery that
54
+ * also presents nothing), and the comparison is timing-safe. The body is not read here at all,
55
+ * because nothing in this scheme binds the token to it, which is precisely why the platform
56
+ * still reads the RAW body once, before any parse, rather than trusting a re-serialisation.
57
+ */
58
+ export function verifySharedToken(secret, headers, header) {
59
+ if (!secret)
60
+ return false;
61
+ const presented = headers[header];
62
+ if (!presented)
63
+ return false;
64
+ const encoder = new TextEncoder();
65
+ return timingSafeEqual(encoder.encode(presented), encoder.encode(secret));
66
+ }
43
67
  /** Constant-time byte comparison (length included in the constant-time property). */
44
68
  function timingSafeEqual(a, b) {
45
69
  if (a.length !== b.length)
@@ -1 +1 @@
1
- {"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../../../src/modules/tasks/webhook/hmac.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,+FAA+F;AAC/F,kGAAkG;AAClG,8FAA8F;AAC9F,gGAAgG;AAChG,yEAAyE;AACzE,EAAE;AACF,mGAAmG;AACnG,6FAA6F;AAC7F,oGAAoG;AACpG,+DAA+D;AAc/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAc,EACd,GAAgB,EAChB,OAA+B,EAC/B,MAAwB;IAExB,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAA;IACzB,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACxC,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAA;IAC5B,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAA;IACvE,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IACzE,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAA;IAE3B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,CACvC,KAAK,EACL,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAChC,EAAE,IAAI,EAAE,MAAM,EAAE,I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AAC,MAAM,CAAC,MAAM,CAAC;YAChB,CAAC,CAAC,IAAI,CAAA;AACZ,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,GAAG,IAAc;IAC5D,IAAI,MAAM,GAAY,OAAO,CAAA;IAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAA;QACtD,MAAM,GAAI,MAAkC,CAAC,GAAG,CAAC,CAAA;IACnD,CAAC;IACD,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACnE,CAAC,CAAE,MAAkC;QACrC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type TaskSourceWritebackAdapter } from '@cat-factory/kernel';
2
+ /** Jira Cloud's REST v3 writeback adapter, wired on the provider itself. */
3
+ export declare const jiraWriteback: TaskSourceWritebackAdapter;
4
+ //# sourceMappingURL=jira.writeback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira.writeback.d.ts","sourceRoot":"","sources":["../../../../src/modules/tasks/writeback/jira.writeback.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,0BAA0B,EAEhC,MAAM,qBAAqB,CAAA;AAuB5B,4EAA4E;AAC5E,eAAO,MAAM,aAAa,EAAE,0BAoB3B,CAAA"}
@@ -0,0 +1,89 @@
1
+ import { ConflictError, atlassianLogic, } from '@cat-factory/kernel';
2
+ import { buildJiraCommentPayload, pickTransitionByCategory, } from '../../tracker/jira.writeback.logic.js';
3
+ // The writeback capability of the Jira task source: comment, resolve (a transition into the
4
+ // `done` status category) and claim (a transition into `indeterminate`, Jira's In Progress).
5
+ //
6
+ // The transport is the same thin `fetch` shell `JiraProvider`'s reads use (the connection's
7
+ // stored base URL re-validated on every call, HTTP Basic over account email + API token), and the
8
+ // two pure pieces (the ADF comment payload, the category→transition pick) stay in
9
+ // `tracker/jira.writeback.logic.ts`, where the ticket-filing path already reads them.
10
+ //
11
+ // A workspace with no stored Jira credentials REFUSES rather than returning quietly. That is a
12
+ // deliberate change from the writeback this replaced, which returned normally in exactly that
13
+ // case: the parked-review echo then recorded its idempotency marker for a comment Jira never saw,
14
+ // so a linked Jira issue in a workspace whose connection had been removed silently swallowed the
15
+ // questions instead of reporting a broken link.
16
+ const USER_AGENT = 'cat-factory';
17
+ /** Jira Cloud's REST v3 writeback adapter, wired on the provider itself. */
18
+ export const jiraWriteback = {
19
+ // HTTP Basic over the connection's stored account email + API token: with no readable bag there
20
+ // is no identity to post as, so an unreadable connection is fatal to every call here.
21
+ authenticates: 'stored-connection',
22
+ async comment(ctx, externalId, body) {
23
+ await jiraRequest(ctx, `issue/${encodeURIComponent(externalId)}/comment`, {
24
+ method: 'POST',
25
+ body: buildJiraCommentPayload(body),
26
+ });
27
+ },
28
+ async resolve(ctx, externalId) {
29
+ await transition(ctx, externalId, 'done');
30
+ },
31
+ /** Jira HAS a workflow status, so the intake mark is a transition and `mark.label` is unused. */
32
+ async markInProgress(ctx, externalId) {
33
+ await transition(ctx, externalId, 'indeterminate');
34
+ },
35
+ };
36
+ /**
37
+ * Move an issue into a standard status category by listing its available transitions and firing
38
+ * the first one that lands there. A workflow with no such transition available from the issue's
39
+ * current status is a no-op rather than an error: the issue is already past it, or the project's
40
+ * workflow does not offer it to this account, and neither is a delivery failure to report.
41
+ */
42
+ async function transition(ctx, externalId, category) {
43
+ const path = `issue/${encodeURIComponent(externalId)}/transitions`;
44
+ const list = (await jiraRequest(ctx, path, { method: 'GET' }));
45
+ const chosen = pickTransitionByCategory(list?.transitions ?? [], category);
46
+ if (!chosen?.id)
47
+ return;
48
+ await jiraRequest(ctx, path, { method: 'POST', body: { transition: { id: chosen.id } } });
49
+ }
50
+ /**
51
+ * One authenticated Jira REST v3 request for the workspace's connection. Throws on a non-OK
52
+ * status so the caller's per-issue isolation reports it (and so the question echo never records a
53
+ * failed post as delivered).
54
+ */
55
+ async function jiraRequest(ctx, path, init) {
56
+ const { baseUrl, accountEmail, apiToken } = requireJiraCredentials(ctx.credentials);
57
+ const base = baseUrl.replace(/\/+$/, '');
58
+ // Re-validate the stored base before fetching with the workspace's credentials, exactly as the
59
+ // read path does: a base that became unsafe since connect time must not be reached now.
60
+ atlassianLogic.assertSafeAtlassianBaseUrl(base);
61
+ const url = `${base}/rest/api/3/${path}`;
62
+ const auth = btoa(`${accountEmail}:${apiToken}`);
63
+ const res = await fetch(url, {
64
+ method: init.method,
65
+ headers: {
66
+ authorization: `Basic ${auth}`,
67
+ accept: 'application/json',
68
+ 'content-type': 'application/json',
69
+ 'user-agent': USER_AGENT,
70
+ },
71
+ // Omit the body entirely for a bodyless (GET) request: `fetch` throws for ANY non-null body
72
+ // on a GET, including an empty string, which would surface as a transport failure.
73
+ ...(init.body === undefined ? {} : { body: JSON.stringify(init.body) }),
74
+ });
75
+ if (!res.ok) {
76
+ const text = await res.text().catch(() => '');
77
+ throw new Error(`Jira ${init.method} ${url} → ${res.status}: ${text.slice(0, 300)}`);
78
+ }
79
+ return res.json().catch(() => null);
80
+ }
81
+ /** The three fields a Jira write needs, or a refusal naming what the workspace is missing. */
82
+ function requireJiraCredentials(credentials) {
83
+ const { baseUrl, accountEmail, apiToken } = credentials;
84
+ if (!baseUrl || !accountEmail || !apiToken) {
85
+ throw new ConflictError('This workspace has no Jira connection, so its linked Jira issues cannot be written back to.');
86
+ }
87
+ return { baseUrl, accountEmail, apiToken };
88
+ }
89
+ //# sourceMappingURL=jira.writeback.js.map