@xemahq/biomes-platform-atlassian 0.1.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.
- package/LICENSE +175 -0
- package/contributions/atlassian.connector-adapter.contribution.json +26 -0
- package/dist/connector-adapters/index.d.ts +8 -0
- package/dist/connector-adapters/index.d.ts.map +1 -0
- package/dist/connector-adapters/index.js +517 -0
- package/dist/connector-adapters/index.js.map +1 -0
- package/install-schema/install.json +28 -0
- package/package.json +37 -0
- package/xema-biome.json +128 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Xema Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
|
|
4
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
5
|
+
|
|
6
|
+
-----------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
|
|
10
|
+
Licensor: Neuralchowder Inc.
|
|
11
|
+
|
|
12
|
+
Licensed Work: Xema. The Licensed Work is (c) 2026 Neuralchowder Inc.
|
|
13
|
+
|
|
14
|
+
The Licensed Work includes, without limitation, Xema Core, Xema Runtime,
|
|
15
|
+
Xema Kernel, Xema control plane, Xema application runtime, Xema biome
|
|
16
|
+
runtime, Xema biome registry, Xema store services, Xema orchestration
|
|
17
|
+
services, Xema agents, Xema skills, Xema memory services, Xema APIs, Xema
|
|
18
|
+
user interfaces, Xema command-line tools, Xema deployment artifacts, Xema
|
|
19
|
+
templates, Xema specifications, Xema schemas, Xema manifests, Xema
|
|
20
|
+
documentation, Xema examples, and all source code, object code, binaries,
|
|
21
|
+
packages, modules, configuration files, manifests, schemas, examples,
|
|
22
|
+
templates, documentation, and derivative works included in or distributed
|
|
23
|
+
as part of the Xema software project.
|
|
24
|
+
|
|
25
|
+
The Licensed Work does not include any third-party software, libraries,
|
|
26
|
+
dependencies, packages, assets, or components that are distributed with the
|
|
27
|
+
Licensed Work but are governed by their own separate license terms. Such
|
|
28
|
+
third-party materials remain subject to their respective licenses.
|
|
29
|
+
|
|
30
|
+
A specific file, package, component, or directory may state that it is
|
|
31
|
+
governed by a different license. In that case, that specific file, package,
|
|
32
|
+
component, or directory is governed by the license expressly stated therein.
|
|
33
|
+
|
|
34
|
+
Additional Use Grant:
|
|
35
|
+
|
|
36
|
+
You may make production use of the Licensed Work, provided that your use
|
|
37
|
+
does not include offering, providing, making available, distributing,
|
|
38
|
+
hosting, managing, embedding, reselling, white-labeling, sublicensing,
|
|
39
|
+
commercializing, or otherwise making the Licensed Work, or any modified
|
|
40
|
+
version or derivative work of the Licensed Work, available to Third Parties
|
|
41
|
+
as part of a Competitive Offering.
|
|
42
|
+
|
|
43
|
+
The following definitions and clarifications form part of, and govern
|
|
44
|
+
the interpretation of, the Additional Use Grant set out above.
|
|
45
|
+
|
|
46
|
+
1. "Production Use" means any use of the Licensed Work other than for
|
|
47
|
+
development, testing, evaluation, demonstration, experimentation,
|
|
48
|
+
benchmarking, or other non-production purposes.
|
|
49
|
+
|
|
50
|
+
2. "Affiliate" means any entity that, directly or indirectly,
|
|
51
|
+
controls, is controlled by, or is under common control with you,
|
|
52
|
+
where "control" means ownership of more than fifty percent (50%) of
|
|
53
|
+
the voting interests of the entity, or the power to direct its
|
|
54
|
+
management.
|
|
55
|
+
|
|
56
|
+
3. "Third Party" means any natural person or legal entity other than
|
|
57
|
+
you and your Affiliates.
|
|
58
|
+
|
|
59
|
+
4. "Competitive Offering" means any product or service, made available
|
|
60
|
+
to one or more Third Parties for a fee or other consideration
|
|
61
|
+
(including without limitation on a paid, subscription,
|
|
62
|
+
advertising-supported, hosted, or managed-service basis), that is
|
|
63
|
+
offered or marketed as, or that competes with, a software platform,
|
|
64
|
+
runtime, orchestration system, agent or automation system,
|
|
65
|
+
extension or distribution marketplace, or other software system
|
|
66
|
+
that provides, in substantial part, the same or substantially
|
|
67
|
+
similar capabilities as those provided by the Licensed Work. A
|
|
68
|
+
product or service is a Competitive Offering whether the Licensed
|
|
69
|
+
Work is provided in whole or in part, alone or bundled with other
|
|
70
|
+
software, and whether modified or unmodified.
|
|
71
|
+
|
|
72
|
+
5. Providing, hosting, or managing the Licensed Work for a Third Party,
|
|
73
|
+
or otherwise making the Licensed Work available to a Third Party as
|
|
74
|
+
a hosted or managed service such that the Third Party obtains the
|
|
75
|
+
principal value or functionality of the Licensed Work, is a
|
|
76
|
+
Competitive Offering and is not permitted by the Additional Use
|
|
77
|
+
Grant.
|
|
78
|
+
|
|
79
|
+
6. Subject to the foregoing, the Additional Use Grant permits you to
|
|
80
|
+
make Production Use of the Licensed Work for your own internal
|
|
81
|
+
business purposes and to build, operate, and provide your own
|
|
82
|
+
products and services to Third Parties, provided that the Licensed
|
|
83
|
+
Work itself (whether modified or unmodified) is not the product or
|
|
84
|
+
service, and is not a Competitive Offering, made available to those
|
|
85
|
+
Third Parties.
|
|
86
|
+
|
|
87
|
+
7. You may modify the Licensed Work and create derivative works for
|
|
88
|
+
any purpose permitted by this License. Any Production Use of such
|
|
89
|
+
modified or derivative works remains subject to the same
|
|
90
|
+
restrictions as the Licensed Work, including the prohibition on
|
|
91
|
+
Competitive Offerings.
|
|
92
|
+
|
|
93
|
+
8. Use of the Licensed Work by your own employees, contractors, and
|
|
94
|
+
agents, acting on your behalf and for your benefit, is not by
|
|
95
|
+
itself making the Licensed Work available to a Third Party.
|
|
96
|
+
|
|
97
|
+
9. Embedding or distributing the Licensed Work as a component of your
|
|
98
|
+
own product or service is permitted only where the Licensed Work
|
|
99
|
+
does not constitute the principal value of that product or service
|
|
100
|
+
and the product or service is not a Competitive Offering.
|
|
101
|
+
|
|
102
|
+
10. Nothing in this Additional Use Grant grants any right to use any
|
|
103
|
+
name, trademark, service mark, or logo of the Licensor or its
|
|
104
|
+
Affiliates, except as reasonably required for customary
|
|
105
|
+
attribution.
|
|
106
|
+
|
|
107
|
+
11. The rights stated in this Additional Use Grant are the maximum
|
|
108
|
+
rights granted for Production Use prior to the Change Date. Any
|
|
109
|
+
Production Use not expressly permitted requires a separate
|
|
110
|
+
commercial license from the Licensor.
|
|
111
|
+
|
|
112
|
+
12. If any provision of this Additional Use Grant is held invalid or
|
|
113
|
+
unenforceable, that provision shall be limited or eliminated to
|
|
114
|
+
the minimum extent necessary so that the remainder of this
|
|
115
|
+
Additional Use Grant, and of this License, remains in full force
|
|
116
|
+
and effect. The Licensor reserves all rights not expressly granted
|
|
117
|
+
by this License.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
Change Date: Four years from the date the specific version of the Licensed
|
|
121
|
+
Work is first publicly released by Licensor.
|
|
122
|
+
|
|
123
|
+
Change License: Mozilla Public License, Version 2.0
|
|
124
|
+
|
|
125
|
+
For information about alternative licensing arrangements, commercial
|
|
126
|
+
licensing, enterprise licensing, OEM licensing, appliance licensing, managed
|
|
127
|
+
service licensing, cloud provider licensing, or other commercial use of the
|
|
128
|
+
Licensed Work, please contact: licensing@neuralchowder.com
|
|
129
|
+
|
|
130
|
+
-----------------------------------------------------------------------------
|
|
131
|
+
|
|
132
|
+
Notice
|
|
133
|
+
|
|
134
|
+
Business Source License 1.1
|
|
135
|
+
|
|
136
|
+
Terms
|
|
137
|
+
|
|
138
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
139
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
140
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
141
|
+
production use.
|
|
142
|
+
|
|
143
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
144
|
+
available distribution of a specific version of the Licensed Work under this
|
|
145
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
146
|
+
the terms of the Change License, and the rights granted in the paragraph above
|
|
147
|
+
terminate.
|
|
148
|
+
|
|
149
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
150
|
+
currently in effect as described in this License, you must purchase a
|
|
151
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
152
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
153
|
+
|
|
154
|
+
All copies of the original and modified Licensed Work, and derivative works of
|
|
155
|
+
the Licensed Work, are subject to this License. This License applies separately
|
|
156
|
+
for each version of the Licensed Work and the Change Date may vary for each
|
|
157
|
+
version of the Licensed Work released by Licensor.
|
|
158
|
+
|
|
159
|
+
You must conspicuously display this License on each original or modified copy
|
|
160
|
+
of the Licensed Work. If you receive the Licensed Work in original or modified
|
|
161
|
+
form from a third party, the terms and conditions set forth in this License
|
|
162
|
+
apply to your use of that work.
|
|
163
|
+
|
|
164
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
165
|
+
terminate your rights under this License for the current and all other
|
|
166
|
+
versions of the Licensed Work.
|
|
167
|
+
|
|
168
|
+
This License does not grant you any right in any trademark or logo of Licensor
|
|
169
|
+
or its affiliates, provided that you may use a trademark or logo of Licensor
|
|
170
|
+
as expressly required by this License.
|
|
171
|
+
|
|
172
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN
|
|
173
|
+
"AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS
|
|
174
|
+
OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
175
|
+
FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "connector-adapter",
|
|
3
|
+
"manifest": {
|
|
4
|
+
"provider": {
|
|
5
|
+
"providerKey": "atlassian",
|
|
6
|
+
"displayName": "Atlassian Cloud",
|
|
7
|
+
"description": "Confluence documentation and Jira tracking for project delivery work.",
|
|
8
|
+
"iconName": "BookOpen",
|
|
9
|
+
"category": "Productivity",
|
|
10
|
+
"appAuthKind": "none",
|
|
11
|
+
"allowOrgOverride": false
|
|
12
|
+
},
|
|
13
|
+
"connectors": [
|
|
14
|
+
{
|
|
15
|
+
"connectorKey": "ATLASSIAN",
|
|
16
|
+
"displayName": "Atlassian Cloud",
|
|
17
|
+
"description": "Ingest Confluence page and Jira issue events from an Atlassian Cloud site, authenticated with an account email + API token (HTTP Basic).",
|
|
18
|
+
"iconName": "BookOpen",
|
|
19
|
+
"providerKey": "atlassian",
|
|
20
|
+
"scopes": [],
|
|
21
|
+
"connectionCredentialKind": "basic",
|
|
22
|
+
"adapterKind": "documentation"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ConnectorAdapterModule } from '@xemahq/biome-sdk/adapter';
|
|
2
|
+
import { type ConnectorDescriptor, type ProviderDescriptor } from '@xemahq/kernel-contracts/connector';
|
|
3
|
+
export declare const providerDescriptor: ProviderDescriptor;
|
|
4
|
+
export declare const connectorDescriptors: readonly ConnectorDescriptor[];
|
|
5
|
+
export declare const atlassianProvider: ConnectorAdapterModule;
|
|
6
|
+
declare const connectorAdapters: readonly ConnectorAdapterModule[];
|
|
7
|
+
export default connectorAdapters;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connector-adapters/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,sBAAsB,EAI5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EASL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAExB,MAAM,oCAAoC,CAAC;AAwnB5C,eAAO,MAAM,kBAAkB,EAAE,kBAchC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,SAAS,mBAAmB,EAkB9D,CAAC;AAiEF,eAAO,MAAM,iBAAiB,EAAE,sBAgC9B,CAAC;AAEH,QAAA,MAAM,iBAAiB,EAAE,SAAS,sBAAsB,EAAwB,CAAC;AACjF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
import { createHash, createHmac, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
import { adapterError, defineConnectorAdapter, err, ok, } from '@xemahq/biome-sdk/adapter';
|
|
3
|
+
import { BuiltInAdapterKind, CredentialFieldTransform, CredentialFieldType, CredentialKind, ConnectorOnboardingKind, ProjectBindingAdapterKey, ProviderAppAuthKind, ProviderOrigin, } from '@xemahq/kernel-contracts/connector';
|
|
4
|
+
const ENTITY_KIND = {
|
|
5
|
+
SPACE: 'space',
|
|
6
|
+
PAGE: 'page',
|
|
7
|
+
ITEM: 'item',
|
|
8
|
+
COMMENT: 'comment',
|
|
9
|
+
};
|
|
10
|
+
const DOC_EVENT = {
|
|
11
|
+
PAGE_CREATED: 'doc.page.created',
|
|
12
|
+
PAGE_UPDATED: 'doc.page.updated',
|
|
13
|
+
PAGE_DELETED: 'doc.page.deleted',
|
|
14
|
+
SPACE_CREATED: 'doc.space.created',
|
|
15
|
+
SPACE_UPDATED: 'doc.space.updated',
|
|
16
|
+
};
|
|
17
|
+
const TRACKER_EVENT = {
|
|
18
|
+
ITEM_CREATED: 'tracker.item.created',
|
|
19
|
+
ITEM_UPDATED: 'tracker.item.updated',
|
|
20
|
+
ITEM_DELETED: 'tracker.item.deleted',
|
|
21
|
+
COMMENT_ADDED: 'tracker.comment.added',
|
|
22
|
+
};
|
|
23
|
+
var DocPageContentType;
|
|
24
|
+
(function (DocPageContentType) {
|
|
25
|
+
DocPageContentType["MARKDOWN"] = "markdown";
|
|
26
|
+
DocPageContentType["FOLDER"] = "folder";
|
|
27
|
+
})(DocPageContentType || (DocPageContentType = {}));
|
|
28
|
+
var TrackerItemType;
|
|
29
|
+
(function (TrackerItemType) {
|
|
30
|
+
TrackerItemType["EPIC"] = "epic";
|
|
31
|
+
TrackerItemType["STORY"] = "story";
|
|
32
|
+
TrackerItemType["TASK"] = "task";
|
|
33
|
+
TrackerItemType["BUG"] = "bug";
|
|
34
|
+
})(TrackerItemType || (TrackerItemType = {}));
|
|
35
|
+
var TrackerItemStatus;
|
|
36
|
+
(function (TrackerItemStatus) {
|
|
37
|
+
TrackerItemStatus["TODO"] = "todo";
|
|
38
|
+
TrackerItemStatus["IN_PROGRESS"] = "in_progress";
|
|
39
|
+
TrackerItemStatus["IN_REVIEW"] = "in_review";
|
|
40
|
+
TrackerItemStatus["DONE"] = "done";
|
|
41
|
+
TrackerItemStatus["BLOCKED"] = "blocked";
|
|
42
|
+
TrackerItemStatus["CANCELLED"] = "cancelled";
|
|
43
|
+
})(TrackerItemStatus || (TrackerItemStatus = {}));
|
|
44
|
+
var TrackerItemPriority;
|
|
45
|
+
(function (TrackerItemPriority) {
|
|
46
|
+
TrackerItemPriority["P0"] = "p0";
|
|
47
|
+
TrackerItemPriority["P1"] = "p1";
|
|
48
|
+
TrackerItemPriority["P2"] = "p2";
|
|
49
|
+
TrackerItemPriority["P3"] = "p3";
|
|
50
|
+
})(TrackerItemPriority || (TrackerItemPriority = {}));
|
|
51
|
+
var JiraPriority;
|
|
52
|
+
(function (JiraPriority) {
|
|
53
|
+
JiraPriority["HIGHEST"] = "highest";
|
|
54
|
+
JiraPriority["BLOCKER"] = "blocker";
|
|
55
|
+
JiraPriority["HIGH"] = "high";
|
|
56
|
+
JiraPriority["CRITICAL"] = "critical";
|
|
57
|
+
JiraPriority["MEDIUM"] = "medium";
|
|
58
|
+
JiraPriority["LOW"] = "low";
|
|
59
|
+
JiraPriority["LOWEST"] = "lowest";
|
|
60
|
+
JiraPriority["TRIVIAL"] = "trivial";
|
|
61
|
+
})(JiraPriority || (JiraPriority = {}));
|
|
62
|
+
var JiraIssueType;
|
|
63
|
+
(function (JiraIssueType) {
|
|
64
|
+
JiraIssueType["EPIC"] = "epic";
|
|
65
|
+
JiraIssueType["STORY"] = "story";
|
|
66
|
+
JiraIssueType["BUG"] = "bug";
|
|
67
|
+
JiraIssueType["TASK"] = "task";
|
|
68
|
+
JiraIssueType["SUBTASK"] = "sub-task";
|
|
69
|
+
})(JiraIssueType || (JiraIssueType = {}));
|
|
70
|
+
const atlassianVerifier = {
|
|
71
|
+
signatureHeader: 'x-hub-signature',
|
|
72
|
+
algorithm: 'hmac-sha256',
|
|
73
|
+
secretSource: 'org-connection-secret',
|
|
74
|
+
verify({ rawBody, headers, secret }) {
|
|
75
|
+
const provided = headers['x-hub-signature'];
|
|
76
|
+
if (typeof provided !== 'string' || provided.length === 0) {
|
|
77
|
+
return err(adapterError('verification-failed', 'missing x-hub-signature header'));
|
|
78
|
+
}
|
|
79
|
+
const [algo, hash] = provided.split('=');
|
|
80
|
+
if (algo !== 'sha256' || !hash) {
|
|
81
|
+
return err(adapterError('verification-failed', 'unexpected signature format'));
|
|
82
|
+
}
|
|
83
|
+
const expectedHex = createHmac('sha256', secret).update(rawBody).digest('hex');
|
|
84
|
+
if (hash.length !== expectedHex.length) {
|
|
85
|
+
return err(adapterError('verification-failed', 'signature length mismatch'));
|
|
86
|
+
}
|
|
87
|
+
let equal;
|
|
88
|
+
try {
|
|
89
|
+
equal = timingSafeEqual(Buffer.from(hash, 'hex'), Buffer.from(expectedHex, 'hex'));
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return err(adapterError('verification-failed', 'signature decode failed'));
|
|
93
|
+
}
|
|
94
|
+
if (!equal) {
|
|
95
|
+
return err(adapterError('verification-failed', 'signature mismatch'));
|
|
96
|
+
}
|
|
97
|
+
return ok(undefined);
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
const atlassianIdempotencyKeyExtractor = ({ rawBody }) => {
|
|
101
|
+
const canonical = typeof rawBody === 'string'
|
|
102
|
+
? rawBody
|
|
103
|
+
: rawBody instanceof Uint8Array
|
|
104
|
+
? Buffer.from(rawBody).toString('utf8')
|
|
105
|
+
: rawBody && typeof rawBody === 'object'
|
|
106
|
+
? canonicalJson(rawBody)
|
|
107
|
+
: '';
|
|
108
|
+
if (canonical.length === 0) {
|
|
109
|
+
throw new Error('atlassian webhook: cannot derive a deterministic idempotency key (empty body)');
|
|
110
|
+
}
|
|
111
|
+
return `atlassian:${createHash('sha256').update(canonical, 'utf8').digest('hex')}`;
|
|
112
|
+
};
|
|
113
|
+
const atlassianEventMapper = {
|
|
114
|
+
map({ rawEvent }) {
|
|
115
|
+
if (!rawEvent || typeof rawEvent !== 'object') {
|
|
116
|
+
return err(adapterError('malformed-payload', 'atlassian event body is not an object'));
|
|
117
|
+
}
|
|
118
|
+
const payload = rawEvent;
|
|
119
|
+
const eventName = asString(payload['webhookEvent']) || asString(payload['event']);
|
|
120
|
+
if (!eventName) {
|
|
121
|
+
return ok(null);
|
|
122
|
+
}
|
|
123
|
+
if (isConfluenceEvent(eventName)) {
|
|
124
|
+
return mapConfluence(eventName, payload);
|
|
125
|
+
}
|
|
126
|
+
if (isJiraEvent(eventName)) {
|
|
127
|
+
return mapJira(eventName, payload);
|
|
128
|
+
}
|
|
129
|
+
return ok(null);
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
function isConfluenceEvent(event) {
|
|
133
|
+
return event.startsWith('page_') || event.startsWith('blog_') || event.startsWith('space_');
|
|
134
|
+
}
|
|
135
|
+
function isJiraEvent(event) {
|
|
136
|
+
return (event.startsWith('jira:') ||
|
|
137
|
+
event.startsWith('comment_') ||
|
|
138
|
+
event.startsWith('sprint_') ||
|
|
139
|
+
event.startsWith('board_'));
|
|
140
|
+
}
|
|
141
|
+
function mapConfluence(event, payload) {
|
|
142
|
+
if (event.startsWith('space_')) {
|
|
143
|
+
return mapConfluenceSpace(event, payload);
|
|
144
|
+
}
|
|
145
|
+
return mapConfluencePage(event, payload);
|
|
146
|
+
}
|
|
147
|
+
function mapConfluenceSpace(event, payload) {
|
|
148
|
+
const space = payload['space'];
|
|
149
|
+
if (!space || typeof space !== 'object') {
|
|
150
|
+
return err(adapterError('malformed-payload', `confluence ${event}: missing .space`));
|
|
151
|
+
}
|
|
152
|
+
const spaceObj = space;
|
|
153
|
+
const externalId = asIdString(spaceObj['id']);
|
|
154
|
+
const spaceKey = asString(spaceObj['key']);
|
|
155
|
+
if (!externalId || !spaceKey) {
|
|
156
|
+
return err(adapterError('malformed-payload', `confluence ${event}: space.id and space.key required`));
|
|
157
|
+
}
|
|
158
|
+
const title = optString(spaceObj['name']) ?? spaceKey;
|
|
159
|
+
const description = optString(spaceObj['description']);
|
|
160
|
+
const spacePayload = {
|
|
161
|
+
slug: spaceKey,
|
|
162
|
+
title,
|
|
163
|
+
...omitUndefined({ description }),
|
|
164
|
+
};
|
|
165
|
+
const canonicalEvent = event === 'space_created' ? DOC_EVENT.SPACE_CREATED : DOC_EVENT.SPACE_UPDATED;
|
|
166
|
+
const envelope = {
|
|
167
|
+
entityKind: ENTITY_KIND.SPACE,
|
|
168
|
+
event: canonicalEvent,
|
|
169
|
+
payload: spacePayload,
|
|
170
|
+
externalId,
|
|
171
|
+
externalSpaceKey: spaceKey,
|
|
172
|
+
adapterKindOverride: BuiltInAdapterKind.Documentation,
|
|
173
|
+
};
|
|
174
|
+
return ok(envelope);
|
|
175
|
+
}
|
|
176
|
+
function mapConfluencePage(event, payload) {
|
|
177
|
+
const page = payload['page'];
|
|
178
|
+
const space = payload['space'];
|
|
179
|
+
if (!page || typeof page !== 'object' || !space || typeof space !== 'object') {
|
|
180
|
+
return err(adapterError('malformed-payload', `confluence ${event}: .page and .space are required`));
|
|
181
|
+
}
|
|
182
|
+
const pageObj = page;
|
|
183
|
+
const spaceObj = space;
|
|
184
|
+
const externalId = asIdString(pageObj['id']);
|
|
185
|
+
const spaceKey = asString(spaceObj['key']);
|
|
186
|
+
const title = asString(pageObj['title']);
|
|
187
|
+
if (!externalId || !spaceKey || !title) {
|
|
188
|
+
return err(adapterError('malformed-payload', `confluence ${event}: page.id, page.title, space.key are required`));
|
|
189
|
+
}
|
|
190
|
+
const body = pageObj['body'];
|
|
191
|
+
const storage = body && typeof body === 'object'
|
|
192
|
+
? body['storage']
|
|
193
|
+
: undefined;
|
|
194
|
+
const content = optString(storage?.['value']) ?? '';
|
|
195
|
+
const externalParentId = extractConfluenceParentId(pageObj);
|
|
196
|
+
const pagePayload = {
|
|
197
|
+
slug: externalId,
|
|
198
|
+
title,
|
|
199
|
+
content,
|
|
200
|
+
contentType: DocPageContentType.MARKDOWN,
|
|
201
|
+
...omitUndefined({ externalParentId }),
|
|
202
|
+
};
|
|
203
|
+
const envelope = {
|
|
204
|
+
entityKind: ENTITY_KIND.PAGE,
|
|
205
|
+
event: mapConfluencePageEvent(event),
|
|
206
|
+
payload: pagePayload,
|
|
207
|
+
externalId,
|
|
208
|
+
externalSpaceKey: spaceKey,
|
|
209
|
+
adapterKindOverride: BuiltInAdapterKind.Documentation,
|
|
210
|
+
};
|
|
211
|
+
return ok(envelope);
|
|
212
|
+
}
|
|
213
|
+
function mapConfluencePageEvent(event) {
|
|
214
|
+
switch (event) {
|
|
215
|
+
case 'page_created':
|
|
216
|
+
return DOC_EVENT.PAGE_CREATED;
|
|
217
|
+
case 'page_trashed':
|
|
218
|
+
case 'page_removed':
|
|
219
|
+
return DOC_EVENT.PAGE_DELETED;
|
|
220
|
+
case 'page_updated':
|
|
221
|
+
case 'page_restored':
|
|
222
|
+
return DOC_EVENT.PAGE_UPDATED;
|
|
223
|
+
default:
|
|
224
|
+
return DOC_EVENT.PAGE_UPDATED;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function extractConfluenceParentId(page) {
|
|
228
|
+
const direct = optString(page['parentId']);
|
|
229
|
+
if (direct !== undefined) {
|
|
230
|
+
return direct;
|
|
231
|
+
}
|
|
232
|
+
const ancestors = page['ancestors'];
|
|
233
|
+
if (Array.isArray(ancestors) && ancestors.length > 0) {
|
|
234
|
+
const last = ancestors.at(-1);
|
|
235
|
+
return last ? optString(last['id']) : undefined;
|
|
236
|
+
}
|
|
237
|
+
return undefined;
|
|
238
|
+
}
|
|
239
|
+
function mapJira(event, payload) {
|
|
240
|
+
if (event.includes('comment')) {
|
|
241
|
+
return mapJiraComment(event, payload);
|
|
242
|
+
}
|
|
243
|
+
return mapJiraIssue(event, payload);
|
|
244
|
+
}
|
|
245
|
+
function mapJiraIssue(event, payload) {
|
|
246
|
+
const issue = payload['issue'];
|
|
247
|
+
if (!issue || typeof issue !== 'object') {
|
|
248
|
+
return err(adapterError('malformed-payload', `jira ${event}: missing .issue`));
|
|
249
|
+
}
|
|
250
|
+
const issueObj = issue;
|
|
251
|
+
const externalId = asIdString(issueObj['id']) || asString(issueObj['key']);
|
|
252
|
+
if (!externalId) {
|
|
253
|
+
return err(adapterError('malformed-payload', `jira ${event}: issue.id or issue.key required`));
|
|
254
|
+
}
|
|
255
|
+
const built = buildJiraIssuePayload(issueObj);
|
|
256
|
+
if (!built.ok) {
|
|
257
|
+
return built;
|
|
258
|
+
}
|
|
259
|
+
const envelope = {
|
|
260
|
+
entityKind: ENTITY_KIND.ITEM,
|
|
261
|
+
event: mapJiraIssueEvent(event),
|
|
262
|
+
payload: built.value,
|
|
263
|
+
externalId,
|
|
264
|
+
adapterKindOverride: BuiltInAdapterKind.Tracker,
|
|
265
|
+
};
|
|
266
|
+
return ok(envelope);
|
|
267
|
+
}
|
|
268
|
+
function buildJiraIssuePayload(issue) {
|
|
269
|
+
const fields = issue['fields'];
|
|
270
|
+
if (!fields || typeof fields !== 'object') {
|
|
271
|
+
return err(adapterError('malformed-payload', 'jira issue: missing .fields'));
|
|
272
|
+
}
|
|
273
|
+
const f = fields;
|
|
274
|
+
const title = asString(f['summary']);
|
|
275
|
+
if (!title) {
|
|
276
|
+
return err(adapterError('malformed-payload', 'jira issue: fields.summary required'));
|
|
277
|
+
}
|
|
278
|
+
const description = optString(f['description']);
|
|
279
|
+
const issueType = f['issuetype'] ?? undefined;
|
|
280
|
+
const statusObj = f['status'] ?? undefined;
|
|
281
|
+
const priorityObj = f['priority'] ?? undefined;
|
|
282
|
+
const labelsRaw = f['labels'];
|
|
283
|
+
const tags = Array.isArray(labelsRaw)
|
|
284
|
+
? labelsRaw.filter((l) => typeof l === 'string')
|
|
285
|
+
: [];
|
|
286
|
+
return ok({
|
|
287
|
+
title,
|
|
288
|
+
type: mapJiraType(issueType ? optString(issueType['name']) : undefined),
|
|
289
|
+
status: mapJiraStatus(statusObj ? optString(statusObj['name']) : undefined),
|
|
290
|
+
priority: mapJiraPriority(priorityObj ? optString(priorityObj['name']) : undefined),
|
|
291
|
+
tags,
|
|
292
|
+
...omitUndefined({ description }),
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
function mapJiraIssueEvent(event) {
|
|
296
|
+
switch (event) {
|
|
297
|
+
case 'jira:issue_created':
|
|
298
|
+
return TRACKER_EVENT.ITEM_CREATED;
|
|
299
|
+
case 'jira:issue_deleted':
|
|
300
|
+
return TRACKER_EVENT.ITEM_DELETED;
|
|
301
|
+
case 'jira:issue_updated':
|
|
302
|
+
return TRACKER_EVENT.ITEM_UPDATED;
|
|
303
|
+
default:
|
|
304
|
+
return TRACKER_EVENT.ITEM_UPDATED;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function mapJiraType(jiraType) {
|
|
308
|
+
if (jiraType === undefined) {
|
|
309
|
+
return TrackerItemType.TASK;
|
|
310
|
+
}
|
|
311
|
+
switch (jiraType.toLowerCase()) {
|
|
312
|
+
case JiraIssueType.EPIC:
|
|
313
|
+
return TrackerItemType.EPIC;
|
|
314
|
+
case JiraIssueType.STORY:
|
|
315
|
+
return TrackerItemType.STORY;
|
|
316
|
+
case JiraIssueType.BUG:
|
|
317
|
+
return TrackerItemType.BUG;
|
|
318
|
+
case JiraIssueType.TASK:
|
|
319
|
+
case JiraIssueType.SUBTASK:
|
|
320
|
+
return TrackerItemType.TASK;
|
|
321
|
+
default:
|
|
322
|
+
return TrackerItemType.TASK;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const JIRA_STATUS_MAP = {
|
|
326
|
+
done: TrackerItemStatus.DONE,
|
|
327
|
+
closed: TrackerItemStatus.DONE,
|
|
328
|
+
resolved: TrackerItemStatus.DONE,
|
|
329
|
+
complete: TrackerItemStatus.DONE,
|
|
330
|
+
'in progress': TrackerItemStatus.IN_PROGRESS,
|
|
331
|
+
'in development': TrackerItemStatus.IN_PROGRESS,
|
|
332
|
+
active: TrackerItemStatus.IN_PROGRESS,
|
|
333
|
+
'in review': TrackerItemStatus.IN_REVIEW,
|
|
334
|
+
review: TrackerItemStatus.IN_REVIEW,
|
|
335
|
+
'in qa': TrackerItemStatus.IN_REVIEW,
|
|
336
|
+
testing: TrackerItemStatus.IN_REVIEW,
|
|
337
|
+
blocked: TrackerItemStatus.BLOCKED,
|
|
338
|
+
impediment: TrackerItemStatus.BLOCKED,
|
|
339
|
+
'on hold': TrackerItemStatus.BLOCKED,
|
|
340
|
+
cancelled: TrackerItemStatus.CANCELLED,
|
|
341
|
+
"won't do": TrackerItemStatus.CANCELLED,
|
|
342
|
+
rejected: TrackerItemStatus.CANCELLED,
|
|
343
|
+
"won't fix": TrackerItemStatus.CANCELLED,
|
|
344
|
+
};
|
|
345
|
+
function mapJiraStatus(jiraStatus) {
|
|
346
|
+
if (jiraStatus === undefined) {
|
|
347
|
+
return TrackerItemStatus.TODO;
|
|
348
|
+
}
|
|
349
|
+
return JIRA_STATUS_MAP[jiraStatus.toLowerCase()] ?? TrackerItemStatus.TODO;
|
|
350
|
+
}
|
|
351
|
+
function mapJiraPriority(jiraPriority) {
|
|
352
|
+
if (jiraPriority === undefined) {
|
|
353
|
+
return TrackerItemPriority.P2;
|
|
354
|
+
}
|
|
355
|
+
switch (jiraPriority.toLowerCase()) {
|
|
356
|
+
case JiraPriority.HIGHEST:
|
|
357
|
+
case JiraPriority.BLOCKER:
|
|
358
|
+
return TrackerItemPriority.P0;
|
|
359
|
+
case JiraPriority.HIGH:
|
|
360
|
+
case JiraPriority.CRITICAL:
|
|
361
|
+
return TrackerItemPriority.P1;
|
|
362
|
+
case JiraPriority.LOW:
|
|
363
|
+
case JiraPriority.LOWEST:
|
|
364
|
+
case JiraPriority.TRIVIAL:
|
|
365
|
+
return TrackerItemPriority.P3;
|
|
366
|
+
case JiraPriority.MEDIUM:
|
|
367
|
+
return TrackerItemPriority.P2;
|
|
368
|
+
default:
|
|
369
|
+
return TrackerItemPriority.P2;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function mapJiraComment(event, payload) {
|
|
373
|
+
const comment = payload['comment'];
|
|
374
|
+
const issue = payload['issue'];
|
|
375
|
+
if (!comment || typeof comment !== 'object' || !issue || typeof issue !== 'object') {
|
|
376
|
+
return err(adapterError('malformed-payload', `jira ${event}: .comment and .issue required`));
|
|
377
|
+
}
|
|
378
|
+
const commentObj = comment;
|
|
379
|
+
const issueObj = issue;
|
|
380
|
+
const externalId = asIdString(commentObj['id']);
|
|
381
|
+
const itemExternalId = asIdString(issueObj['id']) || asString(issueObj['key']);
|
|
382
|
+
const content = asString(commentObj['body']);
|
|
383
|
+
if (!externalId || !itemExternalId || !content) {
|
|
384
|
+
return err(adapterError('malformed-payload', `jira ${event}: comment.id, issue.id|key, comment.body required`));
|
|
385
|
+
}
|
|
386
|
+
const author = commentObj['author'] ?? undefined;
|
|
387
|
+
const authorId = author ? optString(author['accountId']) : undefined;
|
|
388
|
+
const commentPayload = {
|
|
389
|
+
itemExternalId,
|
|
390
|
+
content,
|
|
391
|
+
authorType: 'human',
|
|
392
|
+
...omitUndefined({ authorId }),
|
|
393
|
+
};
|
|
394
|
+
const envelope = {
|
|
395
|
+
entityKind: ENTITY_KIND.COMMENT,
|
|
396
|
+
event: TRACKER_EVENT.COMMENT_ADDED,
|
|
397
|
+
payload: commentPayload,
|
|
398
|
+
externalId,
|
|
399
|
+
adapterKindOverride: BuiltInAdapterKind.Tracker,
|
|
400
|
+
};
|
|
401
|
+
return ok(envelope);
|
|
402
|
+
}
|
|
403
|
+
const ATLASSIAN_PROVIDER_KEY = 'atlassian';
|
|
404
|
+
const ATLASSIAN_DISPLAY_NAME = 'Atlassian Cloud';
|
|
405
|
+
const ATLASSIAN_ICON_NAME = 'BookOpen';
|
|
406
|
+
const ATLASSIAN_DESCRIPTION = 'Confluence documentation and Jira tracking for project delivery work.';
|
|
407
|
+
const atlassianOnboarding = {
|
|
408
|
+
provider: ATLASSIAN_PROVIDER_KEY,
|
|
409
|
+
displayName: ATLASSIAN_DISPLAY_NAME,
|
|
410
|
+
description: ATLASSIAN_DESCRIPTION,
|
|
411
|
+
iconName: ATLASSIAN_ICON_NAME,
|
|
412
|
+
kind: ConnectorOnboardingKind.CREDENTIALS,
|
|
413
|
+
supportedProjectBindingAdapterKinds: [
|
|
414
|
+
ProjectBindingAdapterKey.DOCUMENTATION,
|
|
415
|
+
ProjectBindingAdapterKey.TRACKER,
|
|
416
|
+
],
|
|
417
|
+
fields: [
|
|
418
|
+
{
|
|
419
|
+
key: 'username',
|
|
420
|
+
label: 'Email',
|
|
421
|
+
type: CredentialFieldType.EMAIL,
|
|
422
|
+
required: true,
|
|
423
|
+
isSecret: false,
|
|
424
|
+
placeholder: 'your.name@company.com',
|
|
425
|
+
hint: 'The Atlassian account email — the username half of the Basic credential.',
|
|
426
|
+
transform: CredentialFieldTransform.TRIM,
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
key: 'password',
|
|
430
|
+
label: 'API Token',
|
|
431
|
+
type: CredentialFieldType.PASSWORD,
|
|
432
|
+
required: true,
|
|
433
|
+
isSecret: true,
|
|
434
|
+
placeholder: 'Paste the Atlassian API token',
|
|
435
|
+
hint: 'Create one at id.atlassian.com → Security → API tokens.',
|
|
436
|
+
transform: CredentialFieldTransform.NONE,
|
|
437
|
+
},
|
|
438
|
+
],
|
|
439
|
+
hint: 'These credentials are reused by both documentation and tracker bindings.',
|
|
440
|
+
};
|
|
441
|
+
export const providerDescriptor = {
|
|
442
|
+
providerKey: ATLASSIAN_PROVIDER_KEY,
|
|
443
|
+
displayName: ATLASSIAN_DISPLAY_NAME,
|
|
444
|
+
description: ATLASSIAN_DESCRIPTION,
|
|
445
|
+
iconName: ATLASSIAN_ICON_NAME,
|
|
446
|
+
category: 'Productivity',
|
|
447
|
+
appAuthKind: ProviderAppAuthKind.None,
|
|
448
|
+
origin: ProviderOrigin.Biome,
|
|
449
|
+
allowOrgOverride: false,
|
|
450
|
+
};
|
|
451
|
+
export const connectorDescriptors = [
|
|
452
|
+
{
|
|
453
|
+
connectorKey: 'ATLASSIAN',
|
|
454
|
+
displayName: ATLASSIAN_DISPLAY_NAME,
|
|
455
|
+
description: 'Ingest Confluence page and Jira issue events from an Atlassian Cloud site, ' +
|
|
456
|
+
'authenticated with an account email + API token (HTTP Basic).',
|
|
457
|
+
iconName: ATLASSIAN_ICON_NAME,
|
|
458
|
+
providerKey: ATLASSIAN_PROVIDER_KEY,
|
|
459
|
+
scopes: [],
|
|
460
|
+
connectionCredentialKind: CredentialKind.Basic,
|
|
461
|
+
adapterKind: BuiltInAdapterKind.Documentation,
|
|
462
|
+
},
|
|
463
|
+
];
|
|
464
|
+
function asString(value) {
|
|
465
|
+
return typeof value === 'string' && value.length > 0 ? value : '';
|
|
466
|
+
}
|
|
467
|
+
function optString(value) {
|
|
468
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
469
|
+
}
|
|
470
|
+
function asIdString(value) {
|
|
471
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
472
|
+
return value;
|
|
473
|
+
}
|
|
474
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
475
|
+
return String(value);
|
|
476
|
+
}
|
|
477
|
+
return '';
|
|
478
|
+
}
|
|
479
|
+
function omitUndefined(obj) {
|
|
480
|
+
const out = {};
|
|
481
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
482
|
+
if (v !== undefined) {
|
|
483
|
+
out[k] = v;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return out;
|
|
487
|
+
}
|
|
488
|
+
function canonicalJson(value) {
|
|
489
|
+
if (value === null || typeof value !== 'object') {
|
|
490
|
+
return JSON.stringify(value) ?? 'null';
|
|
491
|
+
}
|
|
492
|
+
if (Array.isArray(value)) {
|
|
493
|
+
return `[${value.map(canonicalJson).join(',')}]`;
|
|
494
|
+
}
|
|
495
|
+
const entries = Object.entries(value)
|
|
496
|
+
.filter(([, v]) => v !== undefined)
|
|
497
|
+
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
|
|
498
|
+
.map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson(v)}`);
|
|
499
|
+
return `{${entries.join(',')}}`;
|
|
500
|
+
}
|
|
501
|
+
export const atlassianProvider = defineConnectorAdapter({
|
|
502
|
+
adapterKind: BuiltInAdapterKind.Documentation,
|
|
503
|
+
provider: ATLASSIAN_PROVIDER_KEY,
|
|
504
|
+
displayName: 'Atlassian (Confluence + Jira)',
|
|
505
|
+
webhook: {
|
|
506
|
+
verifier: atlassianVerifier,
|
|
507
|
+
eventMapper: atlassianEventMapper,
|
|
508
|
+
idempotencyKeyExtractor: atlassianIdempotencyKeyExtractor,
|
|
509
|
+
},
|
|
510
|
+
credentialKind: CredentialKind.Basic,
|
|
511
|
+
resources: {},
|
|
512
|
+
actions: {},
|
|
513
|
+
onboarding: atlassianOnboarding,
|
|
514
|
+
});
|
|
515
|
+
const connectorAdapters = [atlassianProvider];
|
|
516
|
+
export default connectorAdapters;
|
|
517
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connector-adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,GAAG,EACH,EAAE,GAOH,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,GAIf,MAAM,oCAAoC,CAAC;AAgC5C,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,M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AAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAChD,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAClC,CAAC;AAQD,MAAM,CAAC,MAAM,iBAAiB,GAA2B,sBAAsB,CAAC;IAC9E,WAAW,EAAE,kBAAkB,CAAC,aAAa;IAC7C,QAAQ,EAAE,sBAAsB;IAChC,WAAW,EAAE,+BAA+B;IAC5C,OAAO,EAAE;QACP,QAAQ,EAAE,iBAAiB;QAC3B,WAAW,EAAE,oBAAoB;QACjC,uBAAuB,EAAE,gCAAgC;KAC1D;IAOD,cAAc,EAAE,cAAc,CAAC,KAAK;IAcpC,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,UAAU,EAAE,mBAAmB;CAChC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAsC,CAAC,iBAAiB,CAAC,CAAC;AACjF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "connector-atlassian-install",
|
|
4
|
+
"title": "Atlassian Connector Settings",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["integration"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"integration": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"title": "Atlassian integration",
|
|
11
|
+
"description": "Which connected Atlassian Cloud site (Confluence + Jira) this installation uses.",
|
|
12
|
+
"x-widget": "connection-picker",
|
|
13
|
+
"x-widget-config": { "provider": "atlassian" }
|
|
14
|
+
},
|
|
15
|
+
"confluenceSpaceKeys": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"title": "Confluence spaces",
|
|
18
|
+
"description": "Confluence space keys whose page activity should fire documentation workflows.",
|
|
19
|
+
"items": { "type": "string" }
|
|
20
|
+
},
|
|
21
|
+
"jiraProjectKeys": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"title": "Jira projects",
|
|
24
|
+
"description": "Jira project keys whose issue activity should fire tracker workflows.",
|
|
25
|
+
"items": { "type": "string" }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xemahq/biomes-platform-atlassian",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "LicenseRef-Xema-BSL-1.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"registry": "https://registry.npmjs.org/",
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/connector-adapters/index.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"install-schema",
|
|
14
|
+
"xema-biome.json",
|
|
15
|
+
"contributions"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
"./connector-adapters": {
|
|
19
|
+
"types": "./dist/connector-adapters/index.d.ts",
|
|
20
|
+
"default": "./dist/connector-adapters/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@xemahq/biome-sdk": "^3.0.0",
|
|
26
|
+
"@xemahq/kernel-contracts": "^5.1.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "25.2.3",
|
|
30
|
+
"typescript": "5.9.3"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc -p tsconfig.json",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"test": "node --test ./tests/**/*.test.mjs"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/xema-biome.json
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xemahq/biomes-platform-atlassian",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"xema": {
|
|
5
|
+
"id": "connector-atlassian",
|
|
6
|
+
"displayName": "Atlassian Connector",
|
|
7
|
+
"display": {
|
|
8
|
+
"icon": "plug",
|
|
9
|
+
"category": "connect",
|
|
10
|
+
"summary": "Atlassian connector — ingests Confluence page/space and Jira issue/comment webhooks into Xema via the connector gateway."
|
|
11
|
+
},
|
|
12
|
+
"description": "First-party connector biome that ships the Atlassian Cloud integration (single webhook URL spanning Confluence pages/spaces normalized to the canonical documentation envelopes and Jira issues/comments normalized to the canonical tracker envelopes) as a contributed ConnectorAdapterModule. Terminates at the single connector-gateway ingress edge — contributes the provider module (HMAC-SHA256 verifier, event mapper, deterministic idempotency, onboarding manifest), NOT its own webhook route.",
|
|
13
|
+
"scope": "platform",
|
|
14
|
+
"target": "server",
|
|
15
|
+
"bundleSource": {
|
|
16
|
+
"kind": "npm",
|
|
17
|
+
"name": "@xemahq/biomes-platform-atlassian",
|
|
18
|
+
"version": "0.1.0"
|
|
19
|
+
},
|
|
20
|
+
"trustTier": "first-party",
|
|
21
|
+
"connectorRequirements": [
|
|
22
|
+
{
|
|
23
|
+
"adapterKind": "documentation",
|
|
24
|
+
"purpose": "Confluence page + space activity for knowledge-base synchronization",
|
|
25
|
+
"capabilities": [
|
|
26
|
+
"read.page",
|
|
27
|
+
"read.space"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"adapterKind": "tracker",
|
|
32
|
+
"purpose": "Jira issue + comment activity for backlog synchronization",
|
|
33
|
+
"capabilities": [
|
|
34
|
+
"read.item",
|
|
35
|
+
"read.comment"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"components": [
|
|
40
|
+
{
|
|
41
|
+
"key": "connector-adapter",
|
|
42
|
+
"kind": "adapter",
|
|
43
|
+
"artifact": {
|
|
44
|
+
"kind": "host-module",
|
|
45
|
+
"path": "dist/connector-adapters/index.js"
|
|
46
|
+
},
|
|
47
|
+
"entrypoint": {
|
|
48
|
+
"kind": "module-export",
|
|
49
|
+
"module": "dist/connector-adapters/index.js",
|
|
50
|
+
"exportName": "default"
|
|
51
|
+
},
|
|
52
|
+
"protocol": {
|
|
53
|
+
"kind": "adapter",
|
|
54
|
+
"revision": "v1"
|
|
55
|
+
},
|
|
56
|
+
"hostAbi": {
|
|
57
|
+
"name": "xema-adapter-host",
|
|
58
|
+
"versionRange": "^1"
|
|
59
|
+
},
|
|
60
|
+
"executionModes": [
|
|
61
|
+
"shared-host",
|
|
62
|
+
"isolated"
|
|
63
|
+
],
|
|
64
|
+
"requirements": {
|
|
65
|
+
"tenancy": {
|
|
66
|
+
"allowed": [
|
|
67
|
+
"org",
|
|
68
|
+
"project"
|
|
69
|
+
],
|
|
70
|
+
"tenantContext": "verified"
|
|
71
|
+
},
|
|
72
|
+
"isolation": {
|
|
73
|
+
"minimum": "none"
|
|
74
|
+
},
|
|
75
|
+
"trust": {
|
|
76
|
+
"minimum": "verified"
|
|
77
|
+
},
|
|
78
|
+
"locality": {
|
|
79
|
+
"allowed": [
|
|
80
|
+
"cloud",
|
|
81
|
+
"customer-private"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"state": {
|
|
85
|
+
"kind": "stateless"
|
|
86
|
+
},
|
|
87
|
+
"resources": {
|
|
88
|
+
"minimum": {
|
|
89
|
+
"cpu": "100m",
|
|
90
|
+
"memory": "64Mi",
|
|
91
|
+
"ephemeralStorage": "64Mi"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"runtime": {
|
|
95
|
+
"kind": "node",
|
|
96
|
+
"versionRange": ">=22 <25"
|
|
97
|
+
},
|
|
98
|
+
"io": {
|
|
99
|
+
"ingress": "webhook",
|
|
100
|
+
"egress": "internet",
|
|
101
|
+
"rawBody": true,
|
|
102
|
+
"devices": []
|
|
103
|
+
},
|
|
104
|
+
"scaling": {
|
|
105
|
+
"mode": "horizontal",
|
|
106
|
+
"concurrency": {
|
|
107
|
+
"handling": "parallel",
|
|
108
|
+
"maximumPerInstance": 16
|
|
109
|
+
},
|
|
110
|
+
"readiness": {
|
|
111
|
+
"kind": "protocol",
|
|
112
|
+
"initialDelaySeconds": 0
|
|
113
|
+
},
|
|
114
|
+
"drain": {
|
|
115
|
+
"kind": "graceful",
|
|
116
|
+
"maximumSeconds": 30
|
|
117
|
+
},
|
|
118
|
+
"hints": {
|
|
119
|
+
"cpu": "latency",
|
|
120
|
+
"memory": "steady",
|
|
121
|
+
"startup": "fast"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
}
|