@superdurable/connector-atlassian-confluence 0.0.0-stage → 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Super Durable
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,22 @@
1
- # Temporary Holding Version
1
+ # Atlassian Confluence TypeScript connector
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@superdurable/connector-atlassian-confluence` provides Dex Query and Mutation
4
+ operations for Confluence Cloud pages and footer comments. Its five operations
5
+ are `searchPages`, `getPage`, `createPage`, `updatePage`, and `addComment`.
6
+ The public models, branch definitions, Step factories, connection helpers, and
7
+ mock cases are generated from `../connector.yaml`; OAuth credential refresh
8
+ uses the generated manifest declaration. The provider client and operation
9
+ behavior follow the Go connector, including page title and version read-back
10
+ for writes and an at-most-once checkpoint for footer comments.
11
+
12
+ A consuming application is checked in at
13
+ [examples/read-page](examples/read-page/README.md). It loads the private Dex
14
+ project connection `confluence-policy`, reads one page inside a Dex Step, and
15
+ returns only its ID, title, and version number. Run its real Dex integration
16
+ test with `DEX_FLOW_SERVICE_ADDRESS` set to the local `dexcli dev` gRPC address.
17
+
18
+ Run `npm ci && npm run check` to build and test the package. The conformance
19
+ suite replays the recorded Go provider scenarios under
20
+ `../../../../conformance/connectors/atlassian/confluence/scenarios.json`.
21
+ Live Atlassian authorization, site selection, writes, and comment delivery
22
+ remain unverified.
@@ -0,0 +1,196 @@
1
+ {
2
+ "connectorId": "confluence",
3
+ "releaseTag": "connectors/atlassian/confluence/go/v0.24.0",
4
+ "package": {
5
+ "ecosystem": "npm",
6
+ "name": "@superdurable/connector-atlassian-confluence",
7
+ "version": "0.1.0"
8
+ },
9
+ "factories": [
10
+ {
11
+ "name": "newSearchPagesStep",
12
+ "kind": "query",
13
+ "operationId": "searchPages",
14
+ "fields": {
15
+ "stepType": "stepType",
16
+ "annotations": "annotations",
17
+ "connectionName": "connectionName",
18
+ "resultAttribute": "resultAttribute"
19
+ },
20
+ "branches": [
21
+ {
22
+ "id": "searched",
23
+ "field": "searched",
24
+ "optional": false
25
+ },
26
+ {
27
+ "id": "providerRejected",
28
+ "field": "providerRejected",
29
+ "optional": true
30
+ },
31
+ {
32
+ "id": "invalidResponse",
33
+ "field": "invalidResponse",
34
+ "optional": true
35
+ },
36
+ {
37
+ "id": "defect",
38
+ "field": "defect",
39
+ "optional": true
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "name": "newGetPageStep",
45
+ "kind": "query",
46
+ "operationId": "getPage",
47
+ "fields": {
48
+ "stepType": "stepType",
49
+ "annotations": "annotations",
50
+ "connectionName": "connectionName",
51
+ "resultAttribute": "resultAttribute"
52
+ },
53
+ "branches": [
54
+ {
55
+ "id": "found",
56
+ "field": "found",
57
+ "optional": false
58
+ },
59
+ {
60
+ "id": "notFound",
61
+ "field": "notFound",
62
+ "optional": true
63
+ },
64
+ {
65
+ "id": "providerRejected",
66
+ "field": "providerRejected",
67
+ "optional": true
68
+ },
69
+ {
70
+ "id": "invalidResponse",
71
+ "field": "invalidResponse",
72
+ "optional": true
73
+ },
74
+ {
75
+ "id": "defect",
76
+ "field": "defect",
77
+ "optional": true
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "name": "newCreatePageStep",
83
+ "kind": "mutation",
84
+ "operationId": "createPage",
85
+ "fields": {
86
+ "stepType": "stepType",
87
+ "annotations": "annotations",
88
+ "connectionName": "connectionName",
89
+ "resultAttribute": "resultAttribute"
90
+ },
91
+ "branches": [
92
+ {
93
+ "id": "created",
94
+ "field": "created",
95
+ "optional": false
96
+ },
97
+ {
98
+ "id": "titleConflict",
99
+ "field": "titleConflict",
100
+ "optional": true
101
+ },
102
+ {
103
+ "id": "notFound",
104
+ "field": "notFound",
105
+ "optional": true
106
+ },
107
+ {
108
+ "id": "providerRejected",
109
+ "field": "providerRejected",
110
+ "optional": true
111
+ },
112
+ {
113
+ "id": "defect",
114
+ "field": "defect",
115
+ "optional": true
116
+ }
117
+ ]
118
+ },
119
+ {
120
+ "name": "newUpdatePageStep",
121
+ "kind": "mutation",
122
+ "operationId": "updatePage",
123
+ "fields": {
124
+ "stepType": "stepType",
125
+ "annotations": "annotations",
126
+ "connectionName": "connectionName",
127
+ "resultAttribute": "resultAttribute"
128
+ },
129
+ "branches": [
130
+ {
131
+ "id": "updated",
132
+ "field": "updated",
133
+ "optional": false
134
+ },
135
+ {
136
+ "id": "versionConflict",
137
+ "field": "versionConflict",
138
+ "optional": true
139
+ },
140
+ {
141
+ "id": "notFound",
142
+ "field": "notFound",
143
+ "optional": true
144
+ },
145
+ {
146
+ "id": "providerRejected",
147
+ "field": "providerRejected",
148
+ "optional": true
149
+ },
150
+ {
151
+ "id": "defect",
152
+ "field": "defect",
153
+ "optional": true
154
+ }
155
+ ]
156
+ },
157
+ {
158
+ "name": "newAddCommentStep",
159
+ "kind": "mutation",
160
+ "operationId": "addComment",
161
+ "fields": {
162
+ "stepType": "stepType",
163
+ "annotations": "annotations",
164
+ "connectionName": "connectionName",
165
+ "resultAttribute": "resultAttribute"
166
+ },
167
+ "branches": [
168
+ {
169
+ "id": "added",
170
+ "field": "added",
171
+ "optional": false
172
+ },
173
+ {
174
+ "id": "notFound",
175
+ "field": "notFound",
176
+ "optional": true
177
+ },
178
+ {
179
+ "id": "providerRejected",
180
+ "field": "providerRejected",
181
+ "optional": true
182
+ },
183
+ {
184
+ "id": "uncertain",
185
+ "field": "uncertain",
186
+ "optional": true
187
+ },
188
+ {
189
+ "id": "defect",
190
+ "field": "defect",
191
+ "optional": true
192
+ }
193
+ ]
194
+ }
195
+ ]
196
+ }
@@ -0,0 +1,387 @@
1
+ // src/generated/models.ts
2
+ import { z } from "zod";
3
+ import { SecretString } from "@superdurable/connectors-sdk";
4
+ var goTimeJSONPattern = /^(\d{4})-(\d{2})-(\d{2})T(\d{1,2}):(\d{2}):(\d{2})(?:[.,](\d+))?(Z|([+-])(\d{2}):(\d{2}))$/;
5
+ function isGoTimeJSON(value) {
6
+ const match = goTimeJSONPattern.exec(value);
7
+ if (!match) return false;
8
+ const [, yearText, monthText, dayText, hourText, minuteText, secondText, , zone, , zoneHourText, zoneMinuteText] = match;
9
+ const year = Number(yearText);
10
+ const month = Number(monthText);
11
+ const day = Number(dayText);
12
+ const isLeap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
13
+ const monthDays = [31, isLeap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
14
+ return month >= 1 && month <= 12 && day >= 1 && day <= monthDays[month - 1] && Number(hourText) <= 23 && Number(minuteText) <= 59 && Number(secondText) <= 59 && (zone === "Z" || Number(zoneHourText) <= 24 && Number(zoneMinuteText) <= 60);
15
+ }
16
+ function canonicalGoTimeJSON(value) {
17
+ const match = goTimeJSONPattern.exec(value);
18
+ const [, year, month, day, hour, minute, second, fraction, zone, sign, zoneHour, zoneMinute] = match;
19
+ const clock = year + "-" + month + "-" + day + "T" + hour.padStart(2, "0") + ":" + minute + ":" + second;
20
+ const digits = (fraction ?? "").slice(0, 9).replace(/0+$/, "");
21
+ const offsetMinutes = zone === "Z" ? 0 : (Number(zoneHour) * 60 + Number(zoneMinute)) * (sign === "+" ? 1 : -1);
22
+ if (Math.abs(offsetMinutes) >= 1440) return value;
23
+ const offset = offsetMinutes === 0 ? "Z" : (offsetMinutes > 0 ? "+" : "-") + String(Math.floor(Math.abs(offsetMinutes) / 60)).padStart(2, "0") + ":" + String(Math.abs(offsetMinutes) % 60).padStart(2, "0");
24
+ return clock + (digits ? "." + digits : "") + offset;
25
+ }
26
+ var GoTimeJSONSchema = z.string().refine(isGoTimeJSON, "invalid Go time.Time JSON timestamp").transform(canonicalGoTimeJSON);
27
+ var ConfigSchema = z.object({
28
+ "cloudId": z.string().optional(),
29
+ "endpoint": z.string().optional(),
30
+ "maxResponseBytes": z.number().int().optional()
31
+ });
32
+ function decodeCredentials(value) {
33
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
34
+ const fields = value;
35
+ const allowed = /* @__PURE__ */ new Set(["access_token", "oauth_client_id", "oauth_client_secret", "refresh_token"]);
36
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
37
+ if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new TypeError("credential access_token has an invalid type");
38
+ if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new TypeError("credential oauth_client_id has an invalid type");
39
+ if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new TypeError("credential oauth_client_secret has an invalid type");
40
+ if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new TypeError("credential refresh_token has an invalid type");
41
+ const credentials = {};
42
+ if (!fields["oauth_client_id"]) throw new TypeError("credential oauth_client_id is required");
43
+ credentials.oauthClientId = fields["oauth_client_id"] ?? "";
44
+ if (!fields["oauth_client_secret"]) throw new TypeError("credential oauth_client_secret is required");
45
+ credentials.oauthClientSecret = new SecretString(fields["oauth_client_secret"] ?? "");
46
+ if (!fields["access_token"]) throw new TypeError("credential access_token is required");
47
+ credentials.accessToken = new SecretString(fields["access_token"] ?? "");
48
+ if (!fields["refresh_token"]) throw new TypeError("credential refresh_token is required");
49
+ credentials.refreshToken = new SecretString(fields["refresh_token"] ?? "");
50
+ return credentials;
51
+ }
52
+ function decodeSharedCredentials(value) {
53
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
54
+ const fields = value;
55
+ const allowed = /* @__PURE__ */ new Set(["access_token", "oauth_client_id", "oauth_client_secret", "refresh_token"]);
56
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
57
+ if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new TypeError("credential access_token has an invalid type");
58
+ if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new TypeError("credential oauth_client_id has an invalid type");
59
+ if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new TypeError("credential oauth_client_secret has an invalid type");
60
+ if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new TypeError("credential refresh_token has an invalid type");
61
+ const credentials = {};
62
+ if (!fields["oauth_client_id"]) throw new TypeError("credential oauth_client_id is required");
63
+ credentials.oauthClientId = fields["oauth_client_id"] ?? "";
64
+ credentials.oauthClientSecret = new SecretString(fields["oauth_client_secret"] ?? "");
65
+ if (!fields["access_token"]) throw new TypeError("credential access_token is required");
66
+ credentials.accessToken = new SecretString(fields["access_token"] ?? "");
67
+ credentials.refreshToken = new SecretString(fields["refresh_token"] ?? "");
68
+ return credentials;
69
+ }
70
+ var PageSearchFilterSchema = z.strictObject({
71
+ "spaceKeys": z.array(z.string()).optional(),
72
+ "titlePhrase": z.string().optional(),
73
+ "labels": z.array(z.string()).optional(),
74
+ "modifiedSince": GoTimeJSONSchema.nullable().optional(),
75
+ "additionalCql": z.string().optional(),
76
+ "order": z.string().optional()
77
+ });
78
+ var SearchPagesInputSchema = z.strictObject({
79
+ "filter": PageSearchFilterSchema,
80
+ "pageSize": z.number().int().optional(),
81
+ "cursor": z.string().optional()
82
+ });
83
+ var PageSummarySchema = z.strictObject({
84
+ "id": z.string(),
85
+ "title": z.string(),
86
+ "status": z.string().optional(),
87
+ "spaceId": z.string().optional(),
88
+ "spaceKey": z.string().optional(),
89
+ "versionNumber": z.number().int().optional(),
90
+ "lastModifiedAt": GoTimeJSONSchema,
91
+ "webUrl": z.string().optional()
92
+ });
93
+ var SearchPagesOutputSchema = z.strictObject({
94
+ "cql": z.string(),
95
+ "pages": z.array(PageSummarySchema).nullable(),
96
+ "nextCursor": z.string().optional()
97
+ });
98
+ var GetPageInputSchema = z.strictObject({
99
+ "pageId": z.string(),
100
+ "bodyRepresentation": z.string().optional(),
101
+ "bodyFormat": z.string().optional(),
102
+ "maxBodyCharacters": z.number().int().optional()
103
+ });
104
+ var PageVersionSchema = z.strictObject({
105
+ "number": z.number().int(),
106
+ "createdAt": GoTimeJSONSchema,
107
+ "authorAccountId": z.string().optional(),
108
+ "isMinorEdit": z.boolean().optional()
109
+ });
110
+ var PageSchema = z.strictObject({
111
+ "id": z.string(),
112
+ "title": z.string(),
113
+ "status": z.string(),
114
+ "spaceId": z.string(),
115
+ "parentPageId": z.string().optional(),
116
+ "authorAccountId": z.string().optional(),
117
+ "createdAt": GoTimeJSONSchema,
118
+ "version": PageVersionSchema,
119
+ "body": z.string(),
120
+ "bodyFormat": z.string(),
121
+ "isBodyTruncated": z.boolean().optional(),
122
+ "webUrl": z.string().optional()
123
+ });
124
+ var CreatePageInputSchema = z.strictObject({
125
+ "spaceId": z.string().optional(),
126
+ "spaceKey": z.string().optional(),
127
+ "parentPageId": z.string().optional(),
128
+ "title": z.string(),
129
+ "body": z.string(),
130
+ "bodyFormat": z.string().optional()
131
+ });
132
+ var CreatePageOutputSchema = z.strictObject({
133
+ "pageId": z.string().optional(),
134
+ "title": z.string(),
135
+ "spaceId": z.string().optional(),
136
+ "spaceKey": z.string().optional(),
137
+ "parentPageId": z.string().optional(),
138
+ "versionNumber": z.number().int().optional(),
139
+ "webUrl": z.string().optional(),
140
+ "isConfirmedByTitleLookup": z.boolean().optional()
141
+ });
142
+ var UpdatePageInputSchema = z.strictObject({
143
+ "pageId": z.string(),
144
+ "title": z.string(),
145
+ "body": z.string(),
146
+ "bodyFormat": z.string().optional(),
147
+ "nextVersionNumber": z.number().int(),
148
+ "versionMessage": z.string().optional()
149
+ });
150
+ var UpdatePageOutputSchema = z.strictObject({
151
+ "pageId": z.string(),
152
+ "title": z.string(),
153
+ "versionNumber": z.number().int().optional(),
154
+ "webUrl": z.string().optional(),
155
+ "isConfirmedByReadBack": z.boolean().optional()
156
+ });
157
+ var AddCommentInputSchema = z.strictObject({
158
+ "pageId": z.string(),
159
+ "body": z.string(),
160
+ "bodyFormat": z.string().optional()
161
+ });
162
+ var AddCommentOutputSchema = z.strictObject({
163
+ "pageId": z.string(),
164
+ "commentId": z.string().optional(),
165
+ "createdAt": GoTimeJSONSchema,
166
+ "isConfirmedByReadBack": z.boolean().optional()
167
+ });
168
+
169
+ // src/generated/definitions.ts
170
+ var ConnectorID = "confluence";
171
+ var ProviderID = "atlassian";
172
+ var SearchPagesBranch = {
173
+ Searched: "searched",
174
+ ProviderRejected: "providerRejected",
175
+ InvalidResponse: "invalidResponse",
176
+ Defect: "defect"
177
+ };
178
+ var SearchPagesBranchSearched = SearchPagesBranch.Searched;
179
+ var SearchPagesBranchProviderRejected = SearchPagesBranch.ProviderRejected;
180
+ var SearchPagesBranchInvalidResponse = SearchPagesBranch.InvalidResponse;
181
+ var SearchPagesBranchDefect = SearchPagesBranch.Defect;
182
+ var SearchPagesDefinition = {
183
+ operation: { connectorId: ConnectorID, operationId: "searchPages" },
184
+ branches: [
185
+ { id: "searched", description: "One page of matching pages was read; Confluence search is eventually consistent, so a page created or changed seconds ago can be missing." },
186
+ { id: "providerRejected", description: "Confluence conclusively rejected the search, such as unparsable CQL, an expired cursor, or missing permission.", optional: true },
187
+ { id: "invalidResponse", description: "Confluence returned an invalid or oversized search page.", optional: true },
188
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
189
+ ],
190
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
191
+ };
192
+ var SearchPagesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
193
+ var GetPageBranch = {
194
+ Found: "found",
195
+ NotFound: "notFound",
196
+ ProviderRejected: "providerRejected",
197
+ InvalidResponse: "invalidResponse",
198
+ Defect: "defect"
199
+ };
200
+ var GetPageBranchFound = GetPageBranch.Found;
201
+ var GetPageBranchNotFound = GetPageBranch.NotFound;
202
+ var GetPageBranchProviderRejected = GetPageBranch.ProviderRejected;
203
+ var GetPageBranchInvalidResponse = GetPageBranch.InvalidResponse;
204
+ var GetPageBranchDefect = GetPageBranch.Defect;
205
+ var GetPageDefinition = {
206
+ operation: { connectorId: ConnectorID, operationId: "getPage" },
207
+ branches: [
208
+ { id: "found", description: "The page was read." },
209
+ { id: "notFound", description: "The page does not exist or the connection cannot view it.", optional: true },
210
+ { id: "providerRejected", description: "Confluence conclusively rejected the page read.", optional: true },
211
+ { id: "invalidResponse", description: "Confluence returned an invalid or oversized page.", optional: true },
212
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
213
+ ],
214
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
215
+ };
216
+ var GetPageMetadata = { kind: "query", idempotency: "none", authorization: "required" };
217
+ var CreatePageBranch = {
218
+ Created: "created",
219
+ TitleConflict: "titleConflict",
220
+ NotFound: "notFound",
221
+ ProviderRejected: "providerRejected",
222
+ Defect: "defect"
223
+ };
224
+ var CreatePageBranchCreated = CreatePageBranch.Created;
225
+ var CreatePageBranchTitleConflict = CreatePageBranch.TitleConflict;
226
+ var CreatePageBranchNotFound = CreatePageBranch.NotFound;
227
+ var CreatePageBranchProviderRejected = CreatePageBranch.ProviderRejected;
228
+ var CreatePageBranchDefect = CreatePageBranch.Defect;
229
+ var CreatePageDefinition = {
230
+ operation: { connectorId: ConnectorID, operationId: "createPage" },
231
+ branches: [
232
+ { id: "created", description: "The page exists with the requested title, created by this Step execution, including a create an earlier attempt sent." },
233
+ { id: "titleConflict", description: "Another page in the space already has this title, so nothing was created; the Value names that page and its current version.", optional: true },
234
+ { id: "notFound", description: "The space or parent page does not exist or the connection cannot view it; nothing was created.", optional: true },
235
+ { id: "providerRejected", description: "Confluence conclusively rejected the page, such as an invalid body or missing Add page permission; nothing was created.", optional: true },
236
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
237
+ ],
238
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" }
239
+ };
240
+ var CreatePageMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
241
+ var UpdatePageBranch = {
242
+ Updated: "updated",
243
+ VersionConflict: "versionConflict",
244
+ NotFound: "notFound",
245
+ ProviderRejected: "providerRejected",
246
+ Defect: "defect"
247
+ };
248
+ var UpdatePageBranchUpdated = UpdatePageBranch.Updated;
249
+ var UpdatePageBranchVersionConflict = UpdatePageBranch.VersionConflict;
250
+ var UpdatePageBranchNotFound = UpdatePageBranch.NotFound;
251
+ var UpdatePageBranchProviderRejected = UpdatePageBranch.ProviderRejected;
252
+ var UpdatePageBranchDefect = UpdatePageBranch.Defect;
253
+ var UpdatePageDefinition = {
254
+ operation: { connectorId: ConnectorID, operationId: "updatePage" },
255
+ branches: [
256
+ { id: "updated", description: "The page is at the requested version with this Step execution's change, including one an earlier attempt sent." },
257
+ { id: "versionConflict", description: "The page is no longer at the version before the requested one, because another edit was saved first; nothing was changed and the Value names the current version.", optional: true },
258
+ { id: "notFound", description: "The page does not exist or the connection cannot view it; nothing was changed.", optional: true },
259
+ { id: "providerRejected", description: "Confluence conclusively rejected the update, such as an invalid body, missing Edit permission, or a space that requires approval before publishing; nothing was changed.", optional: true },
260
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
261
+ ],
262
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
263
+ };
264
+ var UpdatePageMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
265
+ var AddCommentBranch = {
266
+ Added: "added",
267
+ NotFound: "notFound",
268
+ ProviderRejected: "providerRejected",
269
+ Uncertain: "uncertain",
270
+ Defect: "defect"
271
+ };
272
+ var AddCommentBranchAdded = AddCommentBranch.Added;
273
+ var AddCommentBranchNotFound = AddCommentBranch.NotFound;
274
+ var AddCommentBranchProviderRejected = AddCommentBranch.ProviderRejected;
275
+ var AddCommentBranchUncertain = AddCommentBranch.Uncertain;
276
+ var AddCommentBranchDefect = AddCommentBranch.Defect;
277
+ var AddCommentDefinition = {
278
+ operation: { connectorId: ConnectorID, operationId: "addComment" },
279
+ branches: [
280
+ { id: "added", description: "The comment is on the page, including one an earlier attempt of this Step execution sent." },
281
+ { id: "notFound", description: "The page does not exist or the connection cannot view it; nothing was added.", optional: true },
282
+ { id: "providerRejected", description: "Confluence conclusively rejected the comment, such as an invalid body or missing Add comments permission; nothing was added.", optional: true },
283
+ { id: "uncertain", description: "An earlier attempt sent the comment and the page's comments do not confirm it; Confluence has no idempotency key, so it is never sent again automatically.", optional: true },
284
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
285
+ ],
286
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 3e4, maximumAttempts: 5, totalDurationMs: 12e4 } }
287
+ };
288
+ var AddCommentMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
289
+
290
+ // src/generated/connection.ts
291
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
292
+ import { newRefreshingCredentialProvider } from "@superdurable/connectors-sdk/projectconfig";
293
+ var Connection = class {
294
+ /** Stable provider and connection name. */
295
+ reference;
296
+ /** Bound provider operations. */
297
+ operations;
298
+ /** Validate a reference and bind operations. */
299
+ constructor(reference, operations) {
300
+ this.reference = ConnectionRefSchema.parse(reference);
301
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
302
+ if (!operations) throw new TypeError("connector operations are required");
303
+ this.operations = operations;
304
+ }
305
+ };
306
+ function newConnection(client, reference) {
307
+ if (!client) throw new TypeError("connector client is required");
308
+ return new Connection(reference, client);
309
+ }
310
+ function newConnectionWithOperations(operations, reference) {
311
+ return new Connection(reference, operations);
312
+ }
313
+ function newProjectConnection(project, connectionName, createClient) {
314
+ if (!project) throw new TypeError("loaded project is required");
315
+ const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
316
+ const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
317
+ if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
318
+ return newConnection(createClient(project, connectionName), reference);
319
+ }
320
+ function newProjectCredentialProvider(project, connectionName, decode, encode, decodeShared) {
321
+ return newRefreshingCredentialProvider(project.connections, { connectorId: ConnectorID, connectionName }, decode, encode, decodeShared);
322
+ }
323
+
324
+ export {
325
+ ConfigSchema,
326
+ decodeCredentials,
327
+ decodeSharedCredentials,
328
+ PageSearchFilterSchema,
329
+ SearchPagesInputSchema,
330
+ PageSummarySchema,
331
+ SearchPagesOutputSchema,
332
+ GetPageInputSchema,
333
+ PageVersionSchema,
334
+ PageSchema,
335
+ CreatePageInputSchema,
336
+ CreatePageOutputSchema,
337
+ UpdatePageInputSchema,
338
+ UpdatePageOutputSchema,
339
+ AddCommentInputSchema,
340
+ AddCommentOutputSchema,
341
+ ConnectorID,
342
+ ProviderID,
343
+ SearchPagesBranch,
344
+ SearchPagesBranchSearched,
345
+ SearchPagesBranchProviderRejected,
346
+ SearchPagesBranchInvalidResponse,
347
+ SearchPagesBranchDefect,
348
+ SearchPagesDefinition,
349
+ SearchPagesMetadata,
350
+ GetPageBranch,
351
+ GetPageBranchFound,
352
+ GetPageBranchNotFound,
353
+ GetPageBranchProviderRejected,
354
+ GetPageBranchInvalidResponse,
355
+ GetPageBranchDefect,
356
+ GetPageDefinition,
357
+ GetPageMetadata,
358
+ CreatePageBranch,
359
+ CreatePageBranchCreated,
360
+ CreatePageBranchTitleConflict,
361
+ CreatePageBranchNotFound,
362
+ CreatePageBranchProviderRejected,
363
+ CreatePageBranchDefect,
364
+ CreatePageDefinition,
365
+ CreatePageMetadata,
366
+ UpdatePageBranch,
367
+ UpdatePageBranchUpdated,
368
+ UpdatePageBranchVersionConflict,
369
+ UpdatePageBranchNotFound,
370
+ UpdatePageBranchProviderRejected,
371
+ UpdatePageBranchDefect,
372
+ UpdatePageDefinition,
373
+ UpdatePageMetadata,
374
+ AddCommentBranch,
375
+ AddCommentBranchAdded,
376
+ AddCommentBranchNotFound,
377
+ AddCommentBranchProviderRejected,
378
+ AddCommentBranchUncertain,
379
+ AddCommentBranchDefect,
380
+ AddCommentDefinition,
381
+ AddCommentMetadata,
382
+ Connection,
383
+ newConnection,
384
+ newConnectionWithOperations,
385
+ newProjectConnection,
386
+ newProjectCredentialProvider
387
+ };