@superdurable/connector-atlassian-confluence 0.0.0-stage → 0.2.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 +21 -0
- package/README.md +66 -2
- package/dex-connector.json +427 -0
- package/dist/chunk-K4XYPHG4.js +394 -0
- package/dist/connection-BpChC7aN.d.ts +400 -0
- package/dist/index.d.ts +508 -0
- package/dist/index.js +2882 -0
- package/dist/mock.d.ts +145 -0
- package/dist/mock.js +354 -0
- package/package.json +64 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import { A as AddCommentInput, a as AddCommentOutput, C as Connection, b as CreatePageInput, c as CreatePageOutput, G as GetPageInput, P as Page, S as SearchPagesInput, d as SearchPagesOutput, U as UpdatePageInput, e as UpdatePageOutput, f as CredentialSource, g as Config, O as Operations } from './connection-BpChC7aN.js';
|
|
2
|
+
export { h as AddCommentInputSchema, i as AddCommentOutputSchema, j as ConfigSchema, k as CreatePageInputSchema, l as CreatePageOutputSchema, m as Credentials, n as GetPageInputSchema, o as PageSchema, p as PageSearchFilter, q as PageSearchFilterSchema, r as PageSummary, s as PageSummarySchema, t as PageVersion, u as PageVersionSchema, v as SearchPagesInputSchema, w as SearchPagesOutputSchema, x as UpdatePageInputSchema, y as UpdatePageOutputSchema, z as decodeCredentials, B as decodeSharedCredentials, D as newConnection, E as newConnectionWithOperations } from './connection-BpChC7aN.js';
|
|
3
|
+
import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
|
|
4
|
+
import { MutationDefinition, QueryDefinition, MutationStepConfig, Mutation, MutationResult, QueryStepConfig, Query, QueryResult, MutationStep, QueryStep, Call, QueryAttempt, MutationAttempt, TriggerLogger, Failure, ReceiptDraft, ConnectorConfigurationUI, TriggerDefinition, TriggerBindingDefinition, TriggerTarget, TriggerContext, TriggerRunner } from '@superdurable/connectors-sdk';
|
|
5
|
+
import { StepTarget } from '@superdurable/dex';
|
|
6
|
+
import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
|
|
7
|
+
import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { CursorStore, Runner } from '@superdurable/connectors-sdk/pollingtrigger';
|
|
10
|
+
|
|
11
|
+
/** Stable connector identity. */
|
|
12
|
+
declare const ConnectorID = "confluence";
|
|
13
|
+
/** Provider identity for named connections. */
|
|
14
|
+
declare const ProviderID = "atlassian";
|
|
15
|
+
/** Branch IDs for searchPages. */
|
|
16
|
+
declare const SearchPagesBranch: {
|
|
17
|
+
readonly Searched: "searched";
|
|
18
|
+
readonly ProviderRejected: "providerRejected";
|
|
19
|
+
readonly InvalidResponse: "invalidResponse";
|
|
20
|
+
readonly Defect: "defect";
|
|
21
|
+
};
|
|
22
|
+
/** One page of matching pages was read; Confluence search is eventually consistent, so a page created or changed seconds ago can be missing. */
|
|
23
|
+
declare const SearchPagesBranchSearched: "searched";
|
|
24
|
+
/** Confluence conclusively rejected the search, such as unparsable CQL, an expired cursor, or missing permission. */
|
|
25
|
+
declare const SearchPagesBranchProviderRejected: "providerRejected";
|
|
26
|
+
/** Confluence returned an invalid or oversized search page. */
|
|
27
|
+
declare const SearchPagesBranchInvalidResponse: "invalidResponse";
|
|
28
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
29
|
+
declare const SearchPagesBranchDefect: "defect";
|
|
30
|
+
/** Manifest definition for searchPages. */
|
|
31
|
+
declare const SearchPagesDefinition: QueryDefinition;
|
|
32
|
+
/** Manifest metadata for searchPages. */
|
|
33
|
+
declare const SearchPagesMetadata: {
|
|
34
|
+
readonly kind: "query";
|
|
35
|
+
readonly idempotency: "none";
|
|
36
|
+
readonly authorization: "required";
|
|
37
|
+
};
|
|
38
|
+
/** Branch IDs for getPage. */
|
|
39
|
+
declare const GetPageBranch: {
|
|
40
|
+
readonly Found: "found";
|
|
41
|
+
readonly NotFound: "notFound";
|
|
42
|
+
readonly ProviderRejected: "providerRejected";
|
|
43
|
+
readonly InvalidResponse: "invalidResponse";
|
|
44
|
+
readonly Defect: "defect";
|
|
45
|
+
};
|
|
46
|
+
/** The page was read. */
|
|
47
|
+
declare const GetPageBranchFound: "found";
|
|
48
|
+
/** The page does not exist or the connection cannot view it. */
|
|
49
|
+
declare const GetPageBranchNotFound: "notFound";
|
|
50
|
+
/** Confluence conclusively rejected the page read. */
|
|
51
|
+
declare const GetPageBranchProviderRejected: "providerRejected";
|
|
52
|
+
/** Confluence returned an invalid or oversized page. */
|
|
53
|
+
declare const GetPageBranchInvalidResponse: "invalidResponse";
|
|
54
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
55
|
+
declare const GetPageBranchDefect: "defect";
|
|
56
|
+
/** Manifest definition for getPage. */
|
|
57
|
+
declare const GetPageDefinition: QueryDefinition;
|
|
58
|
+
/** Manifest metadata for getPage. */
|
|
59
|
+
declare const GetPageMetadata: {
|
|
60
|
+
readonly kind: "query";
|
|
61
|
+
readonly idempotency: "none";
|
|
62
|
+
readonly authorization: "required";
|
|
63
|
+
};
|
|
64
|
+
/** Branch IDs for createPage. */
|
|
65
|
+
declare const CreatePageBranch: {
|
|
66
|
+
readonly Created: "created";
|
|
67
|
+
readonly TitleConflict: "titleConflict";
|
|
68
|
+
readonly NotFound: "notFound";
|
|
69
|
+
readonly ProviderRejected: "providerRejected";
|
|
70
|
+
readonly Defect: "defect";
|
|
71
|
+
};
|
|
72
|
+
/** The page exists with the requested title, created by this Step execution, including a create an earlier attempt sent. */
|
|
73
|
+
declare const CreatePageBranchCreated: "created";
|
|
74
|
+
/** Another page in the space already has this title, so nothing was created; the Value names that page and its current version. */
|
|
75
|
+
declare const CreatePageBranchTitleConflict: "titleConflict";
|
|
76
|
+
/** The space or parent page does not exist or the connection cannot view it; nothing was created. */
|
|
77
|
+
declare const CreatePageBranchNotFound: "notFound";
|
|
78
|
+
/** Confluence conclusively rejected the page, such as an invalid body or missing Add page permission; nothing was created. */
|
|
79
|
+
declare const CreatePageBranchProviderRejected: "providerRejected";
|
|
80
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
81
|
+
declare const CreatePageBranchDefect: "defect";
|
|
82
|
+
/** Manifest definition for createPage. */
|
|
83
|
+
declare const CreatePageDefinition: MutationDefinition;
|
|
84
|
+
/** Manifest metadata for createPage. */
|
|
85
|
+
declare const CreatePageMetadata: {
|
|
86
|
+
readonly kind: "mutation";
|
|
87
|
+
readonly idempotency: "required";
|
|
88
|
+
readonly authorization: "required";
|
|
89
|
+
};
|
|
90
|
+
/** Branch IDs for updatePage. */
|
|
91
|
+
declare const UpdatePageBranch: {
|
|
92
|
+
readonly Updated: "updated";
|
|
93
|
+
readonly VersionConflict: "versionConflict";
|
|
94
|
+
readonly NotFound: "notFound";
|
|
95
|
+
readonly ProviderRejected: "providerRejected";
|
|
96
|
+
readonly Defect: "defect";
|
|
97
|
+
};
|
|
98
|
+
/** The page is at the requested version with this Step execution's change, including one an earlier attempt sent. */
|
|
99
|
+
declare const UpdatePageBranchUpdated: "updated";
|
|
100
|
+
/** 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. */
|
|
101
|
+
declare const UpdatePageBranchVersionConflict: "versionConflict";
|
|
102
|
+
/** The page does not exist or the connection cannot view it; nothing was changed. */
|
|
103
|
+
declare const UpdatePageBranchNotFound: "notFound";
|
|
104
|
+
/** Confluence conclusively rejected the update, such as an invalid body, missing Edit permission, or a space that requires approval before publishing; nothing was changed. */
|
|
105
|
+
declare const UpdatePageBranchProviderRejected: "providerRejected";
|
|
106
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
107
|
+
declare const UpdatePageBranchDefect: "defect";
|
|
108
|
+
/** Manifest definition for updatePage. */
|
|
109
|
+
declare const UpdatePageDefinition: MutationDefinition;
|
|
110
|
+
/** Manifest metadata for updatePage. */
|
|
111
|
+
declare const UpdatePageMetadata: {
|
|
112
|
+
readonly kind: "mutation";
|
|
113
|
+
readonly idempotency: "required";
|
|
114
|
+
readonly authorization: "required";
|
|
115
|
+
};
|
|
116
|
+
/** Branch IDs for addComment. */
|
|
117
|
+
declare const AddCommentBranch: {
|
|
118
|
+
readonly Added: "added";
|
|
119
|
+
readonly NotFound: "notFound";
|
|
120
|
+
readonly ProviderRejected: "providerRejected";
|
|
121
|
+
readonly Uncertain: "uncertain";
|
|
122
|
+
readonly Defect: "defect";
|
|
123
|
+
};
|
|
124
|
+
/** The comment is on the page, including one an earlier attempt of this Step execution sent. */
|
|
125
|
+
declare const AddCommentBranchAdded: "added";
|
|
126
|
+
/** The page does not exist or the connection cannot view it; nothing was added. */
|
|
127
|
+
declare const AddCommentBranchNotFound: "notFound";
|
|
128
|
+
/** Confluence conclusively rejected the comment, such as an invalid body or missing Add comments permission; nothing was added. */
|
|
129
|
+
declare const AddCommentBranchProviderRejected: "providerRejected";
|
|
130
|
+
/** 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. */
|
|
131
|
+
declare const AddCommentBranchUncertain: "uncertain";
|
|
132
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
133
|
+
declare const AddCommentBranchDefect: "defect";
|
|
134
|
+
/** Manifest definition for addComment. */
|
|
135
|
+
declare const AddCommentDefinition: MutationDefinition;
|
|
136
|
+
/** Manifest metadata for addComment. */
|
|
137
|
+
declare const AddCommentMetadata: {
|
|
138
|
+
readonly kind: "mutation";
|
|
139
|
+
readonly idempotency: "required";
|
|
140
|
+
readonly authorization: "required";
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/** Configuration for the searchPages connector Step. */
|
|
144
|
+
interface SearchPagesStepConfig<StepInput, OperationInput = SearchPagesInput, OperationOutput = SearchPagesOutput> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
145
|
+
/** Named connection supplying this operation. */
|
|
146
|
+
connection: Connection<{
|
|
147
|
+
searchPages(): Query<OperationInput, OperationOutput>;
|
|
148
|
+
}>;
|
|
149
|
+
/** Name matching the bound connection. */
|
|
150
|
+
connectionName: string;
|
|
151
|
+
/** One page of matching pages was read; Confluence search is eventually consistent, so a page created or changed seconds ago can be missing. */
|
|
152
|
+
searched: StepTarget<QueryResult<OperationOutput>>;
|
|
153
|
+
/** Confluence conclusively rejected the search, such as unparsable CQL, an expired cursor, or missing permission. */
|
|
154
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
155
|
+
/** Confluence returned an invalid or oversized search page. */
|
|
156
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
157
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
158
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
159
|
+
}
|
|
160
|
+
/** Build the searchPages Step from a named connection. */
|
|
161
|
+
declare function newSearchPagesStep<StepInput, OperationInput = SearchPagesInput, OperationOutput = SearchPagesOutput>(configuration: SearchPagesStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
162
|
+
/** Configuration for the getPage connector Step. */
|
|
163
|
+
interface GetPageStepConfig<StepInput, OperationInput = GetPageInput, OperationOutput = Page> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
164
|
+
/** Named connection supplying this operation. */
|
|
165
|
+
connection: Connection<{
|
|
166
|
+
getPage(): Query<OperationInput, OperationOutput>;
|
|
167
|
+
}>;
|
|
168
|
+
/** Name matching the bound connection. */
|
|
169
|
+
connectionName: string;
|
|
170
|
+
/** The page was read. */
|
|
171
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
172
|
+
/** The page does not exist or the connection cannot view it. */
|
|
173
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
174
|
+
/** Confluence conclusively rejected the page read. */
|
|
175
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
176
|
+
/** Confluence returned an invalid or oversized page. */
|
|
177
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
178
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
179
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
180
|
+
}
|
|
181
|
+
/** Build the getPage Step from a named connection. */
|
|
182
|
+
declare function newGetPageStep<StepInput, OperationInput = GetPageInput, OperationOutput = Page>(configuration: GetPageStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
183
|
+
/** Configuration for the createPage connector Step. */
|
|
184
|
+
interface CreatePageStepConfig<StepInput, OperationInput = CreatePageInput, OperationOutput = CreatePageOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
185
|
+
/** Named connection supplying this operation. */
|
|
186
|
+
connection: Connection<{
|
|
187
|
+
createPage(): Mutation<OperationInput, OperationOutput>;
|
|
188
|
+
}>;
|
|
189
|
+
/** Name matching the bound connection. */
|
|
190
|
+
connectionName: string;
|
|
191
|
+
/** The page exists with the requested title, created by this Step execution, including a create an earlier attempt sent. */
|
|
192
|
+
created: StepTarget<MutationResult<OperationOutput>>;
|
|
193
|
+
/** Another page in the space already has this title, so nothing was created; the Value names that page and its current version. */
|
|
194
|
+
titleConflict?: StepTarget<MutationResult<OperationOutput>>;
|
|
195
|
+
/** The space or parent page does not exist or the connection cannot view it; nothing was created. */
|
|
196
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
197
|
+
/** Confluence conclusively rejected the page, such as an invalid body or missing Add page permission; nothing was created. */
|
|
198
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
199
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
200
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
201
|
+
}
|
|
202
|
+
/** Build the createPage Step from a named connection. */
|
|
203
|
+
declare function newCreatePageStep<StepInput, OperationInput = CreatePageInput, OperationOutput = CreatePageOutput>(configuration: CreatePageStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
204
|
+
/** Configuration for the updatePage connector Step. */
|
|
205
|
+
interface UpdatePageStepConfig<StepInput, OperationInput = UpdatePageInput, OperationOutput = UpdatePageOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
206
|
+
/** Named connection supplying this operation. */
|
|
207
|
+
connection: Connection<{
|
|
208
|
+
updatePage(): Mutation<OperationInput, OperationOutput>;
|
|
209
|
+
}>;
|
|
210
|
+
/** Name matching the bound connection. */
|
|
211
|
+
connectionName: string;
|
|
212
|
+
/** The page is at the requested version with this Step execution's change, including one an earlier attempt sent. */
|
|
213
|
+
updated: StepTarget<MutationResult<OperationOutput>>;
|
|
214
|
+
/** 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. */
|
|
215
|
+
versionConflict?: StepTarget<MutationResult<OperationOutput>>;
|
|
216
|
+
/** The page does not exist or the connection cannot view it; nothing was changed. */
|
|
217
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
218
|
+
/** Confluence conclusively rejected the update, such as an invalid body, missing Edit permission, or a space that requires approval before publishing; nothing was changed. */
|
|
219
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
220
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
221
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
222
|
+
}
|
|
223
|
+
/** Build the updatePage Step from a named connection. */
|
|
224
|
+
declare function newUpdatePageStep<StepInput, OperationInput = UpdatePageInput, OperationOutput = UpdatePageOutput>(configuration: UpdatePageStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
225
|
+
/** Configuration for the addComment connector Step. */
|
|
226
|
+
interface AddCommentStepConfig<StepInput, OperationInput = AddCommentInput, OperationOutput = AddCommentOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
227
|
+
/** Named connection supplying this operation. */
|
|
228
|
+
connection: Connection<{
|
|
229
|
+
addComment(): Mutation<OperationInput, OperationOutput>;
|
|
230
|
+
}>;
|
|
231
|
+
/** Name matching the bound connection. */
|
|
232
|
+
connectionName: string;
|
|
233
|
+
/** The comment is on the page, including one an earlier attempt of this Step execution sent. */
|
|
234
|
+
added: StepTarget<MutationResult<OperationOutput>>;
|
|
235
|
+
/** The page does not exist or the connection cannot view it; nothing was added. */
|
|
236
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
237
|
+
/** Confluence conclusively rejected the comment, such as an invalid body or missing Add comments permission; nothing was added. */
|
|
238
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
239
|
+
/** 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. */
|
|
240
|
+
uncertain?: StepTarget<MutationResult<OperationOutput>>;
|
|
241
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
242
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
243
|
+
}
|
|
244
|
+
/** Build the addComment Step from a named connection. */
|
|
245
|
+
declare function newAddCommentStep<StepInput, OperationInput = AddCommentInput, OperationOutput = AddCommentOutput>(configuration: AddCommentStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
246
|
+
|
|
247
|
+
/** Search a bounded CQL result page. */
|
|
248
|
+
declare class SearchPagesOperation implements Query<SearchPagesInput, SearchPagesOutput> {
|
|
249
|
+
private readonly client;
|
|
250
|
+
/** Bind the client. */ constructor(client: ConfluenceClient);
|
|
251
|
+
/** Return the stable definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
252
|
+
/** Execute one authenticated search. */
|
|
253
|
+
invoke(call: Call, input: SearchPagesInput): Promise<QueryAttempt<SearchPagesOutput>>;
|
|
254
|
+
}
|
|
255
|
+
/** Read a page body and its current version. */
|
|
256
|
+
declare class GetPageOperation implements Query<GetPageInput, Page> {
|
|
257
|
+
private readonly client;
|
|
258
|
+
/** Bind the client. */ constructor(client: ConfluenceClient);
|
|
259
|
+
/** Return the stable definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
260
|
+
/** Execute one page read. */
|
|
261
|
+
invoke(call: Call, input: GetPageInput): Promise<QueryAttempt<Page>>;
|
|
262
|
+
}
|
|
263
|
+
/** Create one page, reconciling a previous send by title. */
|
|
264
|
+
declare class CreatePageOperation implements Mutation<CreatePageInput, CreatePageOutput> {
|
|
265
|
+
private readonly client;
|
|
266
|
+
/** Bind the client. */ constructor(client: ConfluenceClient);
|
|
267
|
+
/** Return the stable definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
268
|
+
/** Derive the stable Dex idempotency key. */ idempotencyKey(callId: string): string;
|
|
269
|
+
/** Execute one create with read-back reconciliation. */
|
|
270
|
+
invoke(call: Call, input: CreatePageInput): Promise<MutationAttempt<CreatePageOutput>>;
|
|
271
|
+
private reconcileByTitle;
|
|
272
|
+
}
|
|
273
|
+
/** Replace one page at a named version, reconciling its marker on read-back. */
|
|
274
|
+
declare class UpdatePageOperation implements Mutation<UpdatePageInput, UpdatePageOutput> {
|
|
275
|
+
private readonly client;
|
|
276
|
+
/** Bind the client. */ constructor(client: ConfluenceClient);
|
|
277
|
+
/** Return the stable definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
278
|
+
/** Derive the stable Dex idempotency key. */ idempotencyKey(callId: string): string;
|
|
279
|
+
/** Execute one update with version reconciliation. */
|
|
280
|
+
invoke(call: Call, input: UpdatePageInput): Promise<MutationAttempt<UpdatePageOutput>>;
|
|
281
|
+
private reportReadBack;
|
|
282
|
+
}
|
|
283
|
+
/** Add one footer comment at most once per Step execution. */
|
|
284
|
+
declare class AddCommentOperation implements Mutation<AddCommentInput, AddCommentOutput> {
|
|
285
|
+
private readonly client;
|
|
286
|
+
/** Bind the client. */ constructor(client: ConfluenceClient);
|
|
287
|
+
/** Return the stable definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
|
|
288
|
+
/** Derive the stable Dex idempotency key. */ idempotencyKey(callId: string): string;
|
|
289
|
+
/** Execute one comment send or read-back. */
|
|
290
|
+
invoke(call: Call, input: AddCommentInput): Promise<MutationAttempt<AddCommentOutput>>;
|
|
291
|
+
private reconcileEarlierDispatch;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** Injectable provider transport and clock for deterministic connector tests, and the Trigger's log destination. */
|
|
295
|
+
interface ConfluenceClientOptions {
|
|
296
|
+
/** Sends one provider request; omitted uses the SDK's bounded provider HTTP client. */ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
297
|
+
/** Current time for receipts, Retry-After, and pageChanged scan windows; omitted uses the system clock. */ now?: () => Date;
|
|
298
|
+
/** Receives the pageChanged runner's seed, reseed, failed-poll, and rate-limit records and its durable inbox records; never payloads or credentials. Omitted uses the SDK default logger. */ triggerLogger?: TriggerLogger;
|
|
299
|
+
}
|
|
300
|
+
/** One Confluence or gateway exchange with secret-safe transport evidence. */
|
|
301
|
+
interface ConfluenceExchange {
|
|
302
|
+
status: number;
|
|
303
|
+
headers: ProviderResponse['headers'];
|
|
304
|
+
body: Uint8Array;
|
|
305
|
+
isTooLarge: boolean;
|
|
306
|
+
reflectsSecret?: boolean;
|
|
307
|
+
isDispatched: boolean;
|
|
308
|
+
error?: 'transport' | 'request';
|
|
309
|
+
}
|
|
310
|
+
/** One authenticated invocation's site and access token. */
|
|
311
|
+
interface ConfluenceSession {
|
|
312
|
+
call: Call;
|
|
313
|
+
cloudId: string;
|
|
314
|
+
token: string;
|
|
315
|
+
}
|
|
316
|
+
/** Secret-safe session failure. */
|
|
317
|
+
interface ConfluenceSessionFailure {
|
|
318
|
+
failure: Failure;
|
|
319
|
+
isRetryable: boolean;
|
|
320
|
+
retryAfterMs: number;
|
|
321
|
+
}
|
|
322
|
+
/** Result of resolving the OAuth credential and Confluence site. */
|
|
323
|
+
type ConfluenceSessionResult = {
|
|
324
|
+
session: ConfluenceSession;
|
|
325
|
+
} | {
|
|
326
|
+
error: ConfluenceSessionFailure;
|
|
327
|
+
};
|
|
328
|
+
/** Transport and status classification shared by the five operations. */
|
|
329
|
+
interface ConfluenceClassification {
|
|
330
|
+
outcome: 'accepted' | 'notApplied' | 'notFound' | 'rejected' | 'ambiguous' | 'invalid' | 'defect' | 'retry';
|
|
331
|
+
failure?: Failure;
|
|
332
|
+
retryAfterMs: number;
|
|
333
|
+
}
|
|
334
|
+
/** Atlassian Cloud REST client with host-managed rotating OAuth credentials. */
|
|
335
|
+
declare class ConfluenceClient {
|
|
336
|
+
readonly credentials: CredentialSource;
|
|
337
|
+
readonly endpoint: string;
|
|
338
|
+
readonly configuredCloudId: string;
|
|
339
|
+
readonly maxResponseBytes: number;
|
|
340
|
+
/** Delay between pageChanged polls, in milliseconds. */ readonly pollIntervalMs: number;
|
|
341
|
+
/** Receives pageChanged Trigger records; undefined uses the SDK default logger. */ readonly triggerLogger: TriggerLogger | undefined;
|
|
342
|
+
readonly now: () => Date;
|
|
343
|
+
private readonly send;
|
|
344
|
+
private readonly refreshDriver;
|
|
345
|
+
private resolvedCloudId;
|
|
346
|
+
/** Validate connection settings and bind the host credential source. */
|
|
347
|
+
constructor(config: Config, credentials: CredentialSource, options?: ConfluenceClientOptions);
|
|
348
|
+
/** Bind the page search Query. */
|
|
349
|
+
searchPages(): SearchPagesOperation;
|
|
350
|
+
/** Bind the page read Query. */
|
|
351
|
+
getPage(): GetPageOperation;
|
|
352
|
+
/** Bind the page create Mutation. */
|
|
353
|
+
createPage(): CreatePageOperation;
|
|
354
|
+
/** Bind the page update Mutation. */
|
|
355
|
+
updatePage(): UpdatePageOperation;
|
|
356
|
+
/** Bind the footer comment Mutation. */
|
|
357
|
+
addComment(): AddCommentOperation;
|
|
358
|
+
/** Report that the next session sends the accessible-resources request. */
|
|
359
|
+
needsSiteLookup(): boolean;
|
|
360
|
+
/** Resolve the OAuth token and the single selected Confluence Cloud site. */
|
|
361
|
+
startSession(call: Call, operation: string): Promise<ConfluenceSessionResult>;
|
|
362
|
+
/** Exchange one request and refresh a rejected credential once. */
|
|
363
|
+
exchange(session: ConfluenceSession, method: string, api: 'content' | 'search' | 'gateway', path: string, query?: Record<string, string>, payload?: unknown): Promise<ConfluenceExchange>;
|
|
364
|
+
/** Classify a read without inspecting an error response body. */
|
|
365
|
+
classifyRead(operation: string, subject: string, response: ConfluenceExchange): ConfluenceClassification;
|
|
366
|
+
/** Classify a write before any read-back or business reconciliation. */
|
|
367
|
+
classifyWrite(operation: string, subject: string, response: ConfluenceExchange): ConfluenceClassification;
|
|
368
|
+
/** Produce a safe request receipt with the exact provider object identifier. */
|
|
369
|
+
receipt(session: ConfluenceSession, response: ConfluenceExchange, objectId?: string): ReceiptDraft;
|
|
370
|
+
/** Parse Retry-After against the injected clock. */
|
|
371
|
+
retryAfter(response: ConfluenceExchange): number;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/** Open a named Confluence connection with generated private and shared OAuth credential decoding. */
|
|
375
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: ConfluenceClientOptions): Connection<Operations>;
|
|
376
|
+
|
|
377
|
+
/** A page whose delivered version is 1, its first published version. */
|
|
378
|
+
declare const PageChangeCreated = "created";
|
|
379
|
+
/** A page whose delivered version is 2 or later, including a page created and edited again before the next poll read it. */
|
|
380
|
+
declare const PageChangeUpdated = "updated";
|
|
381
|
+
/** The derived kind of one pageChanged delivery. */
|
|
382
|
+
type PageChangeKind = typeof PageChangeCreated | typeof PageChangeUpdated;
|
|
383
|
+
/** Confluence space picker UI unit, which stores the space ID, key, and name. */ declare const UIUnitSpacePicker = "spacePicker";
|
|
384
|
+
/** Space picker output port: the numeric space ID. */ declare const UISpacePickerPortSpaceID = "spaceId";
|
|
385
|
+
/** Space picker output port: the space key. */ declare const UISpacePickerPortSpaceKey = "spaceKey";
|
|
386
|
+
/** Space picker output port: the space display name. */ declare const UISpacePickerPortSpaceName = "spaceName";
|
|
387
|
+
/**
|
|
388
|
+
* The pageChanged binding configuration that the space picker saves in Dex Web; field names match the Go
|
|
389
|
+
* connector. A blank spaceKey watches every space the connection can view. Changing the space of a binding
|
|
390
|
+
* that already polled makes its next poll record a new baseline.
|
|
391
|
+
*/
|
|
392
|
+
declare const PageChangedTriggerConfigurationSchema: z.ZodObject<{
|
|
393
|
+
spaceId: z.ZodOptional<z.ZodString>;
|
|
394
|
+
spaceKey: z.ZodOptional<z.ZodString>;
|
|
395
|
+
spaceName: z.ZodOptional<z.ZodString>;
|
|
396
|
+
}, z.core.$strict>;
|
|
397
|
+
/** The watched space of one pageChanged binding. */
|
|
398
|
+
type PageChangedTriggerConfiguration = z.infer<typeof PageChangedTriggerConfigurationSchema>;
|
|
399
|
+
/**
|
|
400
|
+
* One page created or updated since the previous poll; field names match the Go connector, so a Go and a
|
|
401
|
+
* TypeScript replica share an inbox. A page edited several times between two polls arrives once, at the
|
|
402
|
+
* version current when the poll read it.
|
|
403
|
+
*/
|
|
404
|
+
declare const PageChangedEventSchema: z.ZodObject<{
|
|
405
|
+
cloudId: z.ZodString;
|
|
406
|
+
changeKind: z.ZodEnum<{
|
|
407
|
+
created: "created";
|
|
408
|
+
updated: "updated";
|
|
409
|
+
}>;
|
|
410
|
+
page: z.ZodObject<{
|
|
411
|
+
id: z.ZodString;
|
|
412
|
+
title: z.ZodString;
|
|
413
|
+
status: z.ZodOptional<z.ZodString>;
|
|
414
|
+
spaceId: z.ZodOptional<z.ZodString>;
|
|
415
|
+
spaceKey: z.ZodOptional<z.ZodString>;
|
|
416
|
+
versionNumber: z.ZodOptional<z.ZodNumber>;
|
|
417
|
+
lastModifiedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
418
|
+
webUrl: z.ZodOptional<z.ZodString>;
|
|
419
|
+
}, z.core.$strict>;
|
|
420
|
+
}, z.core.$strict>;
|
|
421
|
+
/** One page created or updated since the previous poll. */
|
|
422
|
+
type PageChangedEvent = z.infer<typeof PageChangedEventSchema>;
|
|
423
|
+
/** Manifest definition of pageChanged. */
|
|
424
|
+
declare const PageChangedTriggerDefinition: TriggerDefinition;
|
|
425
|
+
/** One static application binding of pageChanged. */
|
|
426
|
+
interface PageChangedTriggerBindingConfig {
|
|
427
|
+
/** Static connection name. */ connectionName: string;
|
|
428
|
+
/** Static binding name. */ bindingName: string;
|
|
429
|
+
/** Connector Studio configuration units for the binding, such as the spacePicker unit. */ configurationUI: ConnectorConfigurationUI;
|
|
430
|
+
}
|
|
431
|
+
/** Declare a static pageChanged binding for Flow Definition tooling and Dex Web. */
|
|
432
|
+
declare function definePageChangedTriggerBinding(config: PageChangedTriggerBindingConfig): TriggerBindingDefinition;
|
|
433
|
+
|
|
434
|
+
/** Return the pageChanged Trigger event ID: a hash of site, page ID, and version, as the Go connector computes it. */
|
|
435
|
+
declare function pageChangeEventId(cloudId: string, pageId: string, versionNumber: number): string;
|
|
436
|
+
|
|
437
|
+
/** Binds one pageChanged configuration to its application target and cursor. */
|
|
438
|
+
interface PageChangedTriggerRoute {
|
|
439
|
+
/** Stable application binding name, unique within the runner. */ bindingName: string;
|
|
440
|
+
/** Selects the watched space; blank watches every space the connection can view. */ configuration: PageChangedTriggerConfiguration;
|
|
441
|
+
/**
|
|
442
|
+
* Routes each change into the application. A target from newDurableTriggerTarget records each change before
|
|
443
|
+
* the cursor commits past it; any other target consumes it first.
|
|
444
|
+
*/
|
|
445
|
+
target: TriggerTarget<PageChangedEvent>;
|
|
446
|
+
/**
|
|
447
|
+
* Stores the binding's position, such as LoadedProject.pollCursorStore. Omitted keeps it in memory, so every
|
|
448
|
+
* process start records a new baseline and changes made while stopped are lost.
|
|
449
|
+
*/
|
|
450
|
+
cursor?: CursorStore | undefined;
|
|
451
|
+
}
|
|
452
|
+
/** Configures every Confluence Trigger binding polled through one connection. */
|
|
453
|
+
interface PageTriggerRunnerConfig {
|
|
454
|
+
/** A connection from newProjectConnection or newConnection with a ConfluenceClient. */ connection: Connection;
|
|
455
|
+
/** The pageChanged bindings; at least one is required. */ pageChangedRoutes: readonly PageChangedTriggerRoute[];
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Create one poll runner for the configured pageChanged bindings. run replays each durable target, records a
|
|
459
|
+
* baseline for a binding without a cursor, then polls every binding each pollInterval with jitter. Each poll
|
|
460
|
+
* reads CQL search, newest modification first, back to ten minutes before the previous scan began, and delivers
|
|
461
|
+
* each page version not delivered before. A 429, or a 503 with Retry-After, pauses every binding of the
|
|
462
|
+
* connection for Retry-After, or backs off exponentially without it; other failures back off per binding up to
|
|
463
|
+
* 15 minutes, and none of them moves the cursor. A cursor for another site or space records a new baseline and
|
|
464
|
+
* logs a WARN record. Delivery is at least once, and each page version keeps one Trigger event ID across
|
|
465
|
+
* refetches. Records go to the client's triggerLogger. Throws for empty routes, a blank binding name
|
|
466
|
+
* or missing target, an invalid configuration, or a connection without a ConfluenceClient.
|
|
467
|
+
*/
|
|
468
|
+
declare function newPageTriggerRunner(config: PageTriggerRunnerConfig): Runner;
|
|
469
|
+
/** Configuration of one pageChanged Trigger without project storage. */
|
|
470
|
+
interface PageChangedTriggerConfig {
|
|
471
|
+
/** Confluence connection from newProjectConnection or newConnection with a ConfluenceClient. */ connection: Connection;
|
|
472
|
+
/** Static binding name. */ bindingName: string;
|
|
473
|
+
/** The watched space. */ configuration: PageChangedTriggerConfiguration;
|
|
474
|
+
/** Routes changes into the application. */ target: TriggerTarget<PageChangedEvent>;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Create one pageChanged binding as a TriggerRunner polling on its own schedule. It has no project storage,
|
|
478
|
+
* so it keeps the cursor in memory and records a new baseline on every start; use
|
|
479
|
+
* newProjectPageTriggerRunner for a durable cursor.
|
|
480
|
+
*/
|
|
481
|
+
declare function newPageChangedTrigger(config: PageChangedTriggerConfig): TriggerRunner;
|
|
482
|
+
/** Selects one pageChanged binding saved in the project configuration. */
|
|
483
|
+
interface ProjectPageChangedTriggerRoute {
|
|
484
|
+
/** The saved binding name. */ bindingName: string;
|
|
485
|
+
/** Routes each change into the application, usually newDexFlowTriggerTarget. */ target: TriggerTarget<PageChangedEvent>;
|
|
486
|
+
}
|
|
487
|
+
/** Polls the project's pageChanged bindings. Run it for the life of the Worker process. */
|
|
488
|
+
declare class PageTriggerRunner {
|
|
489
|
+
private readonly runner;
|
|
490
|
+
/** @internal Use newProjectPageTriggerRunner. */
|
|
491
|
+
constructor(runner: Runner);
|
|
492
|
+
/** Replay each binding's inbox, then poll until context.signal aborts; rejects with TriggerDeliveryAbortedError then. */
|
|
493
|
+
run(context: TriggerContext): Promise<void>;
|
|
494
|
+
/** Make the named binding poll now, without shortening a rate-limit pause. */
|
|
495
|
+
wakePoller(bindingName: string): void;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Open connectionName from the loaded project, load each route's saved space (an unsaved binding watches
|
|
499
|
+
* every space the connection can view), and create a durable runner: each route records changes in its
|
|
500
|
+
* binding's project Trigger inbox before its position commits in the binding's project poll cursor, so a
|
|
501
|
+
* restarted or replaced replica neither misses nor repeats a change. The options' triggerLogger also applies
|
|
502
|
+
* to the inboxes. Throws for empty routes, a blank or repeated binding name, or an invalid saved configuration.
|
|
503
|
+
*/
|
|
504
|
+
declare function newProjectPageTriggerRunner(project: LoadedProject, connectionName: string, routes: readonly ProjectPageChangedTriggerRoute[], options?: ConfluenceClientOptions): PageTriggerRunner;
|
|
505
|
+
/** Decode a replayed inbox payload written by this package or by the Go connector; throws for anything else. */
|
|
506
|
+
declare function decodePageChangedEventPayload(_payloadJSON: string, payloadBytes: Uint8Array): PageChangedEvent;
|
|
507
|
+
|
|
508
|
+
export { AddCommentBranch, AddCommentBranchAdded, AddCommentBranchDefect, AddCommentBranchNotFound, AddCommentBranchProviderRejected, AddCommentBranchUncertain, AddCommentDefinition, AddCommentInput, AddCommentMetadata, AddCommentOperation, AddCommentOutput, type AddCommentStepConfig, Config, ConfluenceClient, type ConfluenceClientOptions, Connection, ConnectorID, CreatePageBranch, CreatePageBranchCreated, CreatePageBranchDefect, CreatePageBranchNotFound, CreatePageBranchProviderRejected, CreatePageBranchTitleConflict, CreatePageDefinition, CreatePageInput, CreatePageMetadata, CreatePageOperation, CreatePageOutput, type CreatePageStepConfig, CredentialSource, GetPageBranch, GetPageBranchDefect, GetPageBranchFound, GetPageBranchInvalidResponse, GetPageBranchNotFound, GetPageBranchProviderRejected, GetPageDefinition, GetPageInput, GetPageMetadata, GetPageOperation, type GetPageStepConfig, Page, PageChangeCreated, type PageChangeKind, PageChangeUpdated, type PageChangedEvent, PageChangedEventSchema, type PageChangedTriggerBindingConfig, type PageChangedTriggerConfig, type PageChangedTriggerConfiguration, PageChangedTriggerConfigurationSchema, PageChangedTriggerDefinition, type PageChangedTriggerRoute, PageTriggerRunner, type PageTriggerRunnerConfig, type ProjectPageChangedTriggerRoute, ProviderID, SearchPagesBranch, SearchPagesBranchDefect, SearchPagesBranchInvalidResponse, SearchPagesBranchProviderRejected, SearchPagesBranchSearched, SearchPagesDefinition, SearchPagesInput, SearchPagesMetadata, SearchPagesOperation, SearchPagesOutput, type SearchPagesStepConfig, UISpacePickerPortSpaceID, UISpacePickerPortSpaceKey, UISpacePickerPortSpaceName, UIUnitSpacePicker, UpdatePageBranch, UpdatePageBranchDefect, UpdatePageBranchNotFound, UpdatePageBranchProviderRejected, UpdatePageBranchUpdated, UpdatePageBranchVersionConflict, UpdatePageDefinition, UpdatePageInput, UpdatePageMetadata, UpdatePageOperation, UpdatePageOutput, type UpdatePageStepConfig, decodePageChangedEventPayload, definePageChangedTriggerBinding, newAddCommentStep, newCreatePageStep, newGetPageStep, newPageChangedTrigger, newPageTriggerRunner, newProjectConnection, newProjectPageTriggerRunner, newSearchPagesStep, newUpdatePageStep, pageChangeEventId };
|