@superdurable/connector-asana 0.0.0-stage → 0.1.1
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 +10 -2
- package/dex-connector.json +196 -0
- package/dist/chunk-JITMOBYX.js +376 -0
- package/dist/connection-Bu8DfK5s.d.ts +600 -0
- package/dist/index.d.ts +338 -0
- package/dist/index.js +917 -0
- package/dist/mock.d.ts +153 -0
- package/dist/mock.js +361 -0
- package/package.json +58 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { A as AddCommentInput, a as AddCommentOutput, C as Connection, b as CreateTaskInput, c as CreateTaskOutput, G as GetTaskInput, T as Task, L as ListTasksInput, d as ListTasksOutput, U as UpdateTaskInput, e as UpdateTaskOutput, f as Config, g as Credentials } from './connection-Bu8DfK5s.js';
|
|
2
|
+
export { h as AddCommentInputSchema, i as AddCommentOutputSchema, j as ConfigSchema, k as CreateTaskInputSchema, l as CreateTaskOutputSchema, m as CredentialSource, n as CustomFieldValue, o as CustomFieldValueInput, p as CustomFieldValueInputSchema, q as CustomFieldValueSchema, E as EnumOptionReference, r as EnumOptionReferenceSchema, s as GetTaskInputSchema, t as ListTasksInputSchema, u as ListTasksOutputSchema, O as Operations, P as ProjectReference, v as ProjectReferenceSchema, S as SectionReference, w as SectionReferenceSchema, x as TaskMembership, y as TaskMembershipSchema, z as TaskReference, B as TaskReferenceSchema, D as TaskSchema, F as UpdateTaskInputSchema, H as UpdateTaskOutputSchema, I as UserReference, J as UserReferenceSchema, W as WorkspaceReference, K as WorkspaceReferenceSchema, M as decodeCredentials, N as newConnection, Q as newConnectionWithOperations } from './connection-Bu8DfK5s.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, CredentialProvider, ReceiptDraft, Failure } 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 'zod';
|
|
9
|
+
|
|
10
|
+
/** Stable connector identity. */
|
|
11
|
+
declare const ConnectorID = "asana";
|
|
12
|
+
/** Provider identity for named connections. */
|
|
13
|
+
declare const ProviderID = "asana";
|
|
14
|
+
/** Branch IDs for listTasks. */
|
|
15
|
+
declare const ListTasksBranch: {
|
|
16
|
+
readonly Listed: "listed";
|
|
17
|
+
readonly NotFound: "notFound";
|
|
18
|
+
readonly ProviderRejected: "providerRejected";
|
|
19
|
+
readonly InvalidResponse: "invalidResponse";
|
|
20
|
+
readonly Defect: "defect";
|
|
21
|
+
};
|
|
22
|
+
/** One page of the project's or section's tasks was read. */
|
|
23
|
+
declare const ListTasksBranchListed: "listed";
|
|
24
|
+
/** The project or section does not exist or the connection cannot see it. */
|
|
25
|
+
declare const ListTasksBranchNotFound: "notFound";
|
|
26
|
+
/** Asana conclusively rejected the list, such as an expired offset token, missing permission, or a result set too large to page. */
|
|
27
|
+
declare const ListTasksBranchProviderRejected: "providerRejected";
|
|
28
|
+
/** Asana returned an invalid or oversized task page. */
|
|
29
|
+
declare const ListTasksBranchInvalidResponse: "invalidResponse";
|
|
30
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
31
|
+
declare const ListTasksBranchDefect: "defect";
|
|
32
|
+
/** Manifest definition for listTasks. */
|
|
33
|
+
declare const ListTasksDefinition: QueryDefinition;
|
|
34
|
+
/** Manifest metadata for listTasks. */
|
|
35
|
+
declare const ListTasksMetadata: {
|
|
36
|
+
readonly kind: "query";
|
|
37
|
+
readonly idempotency: "none";
|
|
38
|
+
readonly authorization: "required";
|
|
39
|
+
};
|
|
40
|
+
/** Branch IDs for getTask. */
|
|
41
|
+
declare const GetTaskBranch: {
|
|
42
|
+
readonly Found: "found";
|
|
43
|
+
readonly NotFound: "notFound";
|
|
44
|
+
readonly ProviderRejected: "providerRejected";
|
|
45
|
+
readonly InvalidResponse: "invalidResponse";
|
|
46
|
+
readonly Defect: "defect";
|
|
47
|
+
};
|
|
48
|
+
/** The task was read. */
|
|
49
|
+
declare const GetTaskBranchFound: "found";
|
|
50
|
+
/** The task does not exist or the connection cannot see it. */
|
|
51
|
+
declare const GetTaskBranchNotFound: "notFound";
|
|
52
|
+
/** Asana conclusively rejected the task read. */
|
|
53
|
+
declare const GetTaskBranchProviderRejected: "providerRejected";
|
|
54
|
+
/** Asana returned an invalid or oversized task. */
|
|
55
|
+
declare const GetTaskBranchInvalidResponse: "invalidResponse";
|
|
56
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
57
|
+
declare const GetTaskBranchDefect: "defect";
|
|
58
|
+
/** Manifest definition for getTask. */
|
|
59
|
+
declare const GetTaskDefinition: QueryDefinition;
|
|
60
|
+
/** Manifest metadata for getTask. */
|
|
61
|
+
declare const GetTaskMetadata: {
|
|
62
|
+
readonly kind: "query";
|
|
63
|
+
readonly idempotency: "none";
|
|
64
|
+
readonly authorization: "required";
|
|
65
|
+
};
|
|
66
|
+
/** Branch IDs for createTask. */
|
|
67
|
+
declare const CreateTaskBranch: {
|
|
68
|
+
readonly Created: "created";
|
|
69
|
+
readonly ProviderRejected: "providerRejected";
|
|
70
|
+
readonly Uncertain: "uncertain";
|
|
71
|
+
readonly Defect: "defect";
|
|
72
|
+
};
|
|
73
|
+
/** Asana created the task and returned its ID. */
|
|
74
|
+
declare const CreateTaskBranchCreated: "created";
|
|
75
|
+
/** Asana conclusively rejected the task, such as an unknown project, section, assignee, or custom field value, or missing permission; nothing was created. */
|
|
76
|
+
declare const CreateTaskBranchProviderRejected: "providerRejected";
|
|
77
|
+
/** The request may have reached Asana but its outcome cannot be confirmed; Asana has no idempotency key, so the task may exist and must not be created again automatically. */
|
|
78
|
+
declare const CreateTaskBranchUncertain: "uncertain";
|
|
79
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
80
|
+
declare const CreateTaskBranchDefect: "defect";
|
|
81
|
+
/** Manifest definition for createTask. */
|
|
82
|
+
declare const CreateTaskDefinition: MutationDefinition;
|
|
83
|
+
/** Manifest metadata for createTask. */
|
|
84
|
+
declare const CreateTaskMetadata: {
|
|
85
|
+
readonly kind: "mutation";
|
|
86
|
+
readonly idempotency: "required";
|
|
87
|
+
readonly authorization: "required";
|
|
88
|
+
};
|
|
89
|
+
/** Branch IDs for updateTask. */
|
|
90
|
+
declare const UpdateTaskBranch: {
|
|
91
|
+
readonly Updated: "updated";
|
|
92
|
+
readonly NotFound: "notFound";
|
|
93
|
+
readonly ProviderRejected: "providerRejected";
|
|
94
|
+
readonly InvalidResponse: "invalidResponse";
|
|
95
|
+
readonly Defect: "defect";
|
|
96
|
+
};
|
|
97
|
+
/** Asana applied every requested change, including when the task already had those values, and the Value holds the task read back. */
|
|
98
|
+
declare const UpdateTaskBranchUpdated: "updated";
|
|
99
|
+
/** The task or section does not exist or the connection cannot see it. */
|
|
100
|
+
declare const UpdateTaskBranchNotFound: "notFound";
|
|
101
|
+
/** Asana conclusively rejected a change, such as an unknown assignee, a section of a project the task is not in, or missing permission. */
|
|
102
|
+
declare const UpdateTaskBranchProviderRejected: "providerRejected";
|
|
103
|
+
/** Asana returned an invalid or oversized task after the update. */
|
|
104
|
+
declare const UpdateTaskBranchInvalidResponse: "invalidResponse";
|
|
105
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
106
|
+
declare const UpdateTaskBranchDefect: "defect";
|
|
107
|
+
/** Manifest definition for updateTask. */
|
|
108
|
+
declare const UpdateTaskDefinition: MutationDefinition;
|
|
109
|
+
/** Manifest metadata for updateTask. */
|
|
110
|
+
declare const UpdateTaskMetadata: {
|
|
111
|
+
readonly kind: "mutation";
|
|
112
|
+
readonly idempotency: "required";
|
|
113
|
+
readonly authorization: "required";
|
|
114
|
+
};
|
|
115
|
+
/** Branch IDs for addComment. */
|
|
116
|
+
declare const AddCommentBranch: {
|
|
117
|
+
readonly Added: "added";
|
|
118
|
+
readonly NotFound: "notFound";
|
|
119
|
+
readonly ProviderRejected: "providerRejected";
|
|
120
|
+
readonly Uncertain: "uncertain";
|
|
121
|
+
readonly Defect: "defect";
|
|
122
|
+
};
|
|
123
|
+
/** Asana added the comment and returned its story ID. */
|
|
124
|
+
declare const AddCommentBranchAdded: "added";
|
|
125
|
+
/** The task does not exist or the connection cannot see it; nothing was added. */
|
|
126
|
+
declare const AddCommentBranchNotFound: "notFound";
|
|
127
|
+
/** Asana conclusively rejected the comment, such as missing permission or invalid text; nothing was added. */
|
|
128
|
+
declare const AddCommentBranchProviderRejected: "providerRejected";
|
|
129
|
+
/** The request may have reached Asana but its outcome cannot be confirmed; Asana has no idempotency key, so the comment may exist and must not be added again automatically. */
|
|
130
|
+
declare const AddCommentBranchUncertain: "uncertain";
|
|
131
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
132
|
+
declare const AddCommentBranchDefect: "defect";
|
|
133
|
+
/** Manifest definition for addComment. */
|
|
134
|
+
declare const AddCommentDefinition: MutationDefinition;
|
|
135
|
+
/** Manifest metadata for addComment. */
|
|
136
|
+
declare const AddCommentMetadata: {
|
|
137
|
+
readonly kind: "mutation";
|
|
138
|
+
readonly idempotency: "required";
|
|
139
|
+
readonly authorization: "required";
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/** Configuration for the listTasks connector Step. */
|
|
143
|
+
interface ListTasksStepConfig<StepInput, OperationInput = ListTasksInput, OperationOutput = ListTasksOutput> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
144
|
+
/** Named connection supplying this operation. */
|
|
145
|
+
connection: Connection<{
|
|
146
|
+
listTasks(): Query<OperationInput, OperationOutput>;
|
|
147
|
+
}>;
|
|
148
|
+
/** Name matching the bound connection. */
|
|
149
|
+
connectionName: string;
|
|
150
|
+
/** One page of the project's or section's tasks was read. */
|
|
151
|
+
listed: StepTarget<QueryResult<OperationOutput>>;
|
|
152
|
+
/** The project or section does not exist or the connection cannot see it. */
|
|
153
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
154
|
+
/** Asana conclusively rejected the list, such as an expired offset token, missing permission, or a result set too large to page. */
|
|
155
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
156
|
+
/** Asana returned an invalid or oversized task page. */
|
|
157
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
158
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
159
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
160
|
+
}
|
|
161
|
+
/** Build the listTasks Step from a named connection. */
|
|
162
|
+
declare function newListTasksStep<StepInput, OperationInput = ListTasksInput, OperationOutput = ListTasksOutput>(configuration: ListTasksStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
163
|
+
/** Configuration for the getTask connector Step. */
|
|
164
|
+
interface GetTaskStepConfig<StepInput, OperationInput = GetTaskInput, OperationOutput = Task> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
165
|
+
/** Named connection supplying this operation. */
|
|
166
|
+
connection: Connection<{
|
|
167
|
+
getTask(): Query<OperationInput, OperationOutput>;
|
|
168
|
+
}>;
|
|
169
|
+
/** Name matching the bound connection. */
|
|
170
|
+
connectionName: string;
|
|
171
|
+
/** The task was read. */
|
|
172
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
173
|
+
/** The task does not exist or the connection cannot see it. */
|
|
174
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
175
|
+
/** Asana conclusively rejected the task read. */
|
|
176
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
177
|
+
/** Asana returned an invalid or oversized task. */
|
|
178
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
179
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
180
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
181
|
+
}
|
|
182
|
+
/** Build the getTask Step from a named connection. */
|
|
183
|
+
declare function newGetTaskStep<StepInput, OperationInput = GetTaskInput, OperationOutput = Task>(configuration: GetTaskStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
184
|
+
/** Configuration for the createTask connector Step. */
|
|
185
|
+
interface CreateTaskStepConfig<StepInput, OperationInput = CreateTaskInput, OperationOutput = CreateTaskOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
186
|
+
/** Named connection supplying this operation. */
|
|
187
|
+
connection: Connection<{
|
|
188
|
+
createTask(): Mutation<OperationInput, OperationOutput>;
|
|
189
|
+
}>;
|
|
190
|
+
/** Name matching the bound connection. */
|
|
191
|
+
connectionName: string;
|
|
192
|
+
/** Asana created the task and returned its ID. */
|
|
193
|
+
created: StepTarget<MutationResult<OperationOutput>>;
|
|
194
|
+
/** Asana conclusively rejected the task, such as an unknown project, section, assignee, or custom field value, or missing permission; nothing was created. */
|
|
195
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
196
|
+
/** The request may have reached Asana but its outcome cannot be confirmed; Asana has no idempotency key, so the task may exist and must not be created again automatically. */
|
|
197
|
+
uncertain?: StepTarget<MutationResult<OperationOutput>>;
|
|
198
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
199
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
200
|
+
}
|
|
201
|
+
/** Build the createTask Step from a named connection. */
|
|
202
|
+
declare function newCreateTaskStep<StepInput, OperationInput = CreateTaskInput, OperationOutput = CreateTaskOutput>(configuration: CreateTaskStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
203
|
+
/** Configuration for the updateTask connector Step. */
|
|
204
|
+
interface UpdateTaskStepConfig<StepInput, OperationInput = UpdateTaskInput, OperationOutput = UpdateTaskOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
205
|
+
/** Named connection supplying this operation. */
|
|
206
|
+
connection: Connection<{
|
|
207
|
+
updateTask(): Mutation<OperationInput, OperationOutput>;
|
|
208
|
+
}>;
|
|
209
|
+
/** Name matching the bound connection. */
|
|
210
|
+
connectionName: string;
|
|
211
|
+
/** Asana applied every requested change, including when the task already had those values, and the Value holds the task read back. */
|
|
212
|
+
updated: StepTarget<MutationResult<OperationOutput>>;
|
|
213
|
+
/** The task or section does not exist or the connection cannot see it. */
|
|
214
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
215
|
+
/** Asana conclusively rejected a change, such as an unknown assignee, a section of a project the task is not in, or missing permission. */
|
|
216
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
217
|
+
/** Asana returned an invalid or oversized task after the update. */
|
|
218
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
219
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
220
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
221
|
+
}
|
|
222
|
+
/** Build the updateTask Step from a named connection. */
|
|
223
|
+
declare function newUpdateTaskStep<StepInput, OperationInput = UpdateTaskInput, OperationOutput = UpdateTaskOutput>(configuration: UpdateTaskStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
224
|
+
/** Configuration for the addComment connector Step. */
|
|
225
|
+
interface AddCommentStepConfig<StepInput, OperationInput = AddCommentInput, OperationOutput = AddCommentOutput> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
226
|
+
/** Named connection supplying this operation. */
|
|
227
|
+
connection: Connection<{
|
|
228
|
+
addComment(): Mutation<OperationInput, OperationOutput>;
|
|
229
|
+
}>;
|
|
230
|
+
/** Name matching the bound connection. */
|
|
231
|
+
connectionName: string;
|
|
232
|
+
/** Asana added the comment and returned its story ID. */
|
|
233
|
+
added: StepTarget<MutationResult<OperationOutput>>;
|
|
234
|
+
/** The task does not exist or the connection cannot see it; nothing was added. */
|
|
235
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
236
|
+
/** Asana conclusively rejected the comment, such as missing permission or invalid text; nothing was added. */
|
|
237
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
238
|
+
/** The request may have reached Asana but its outcome cannot be confirmed; Asana has no idempotency key, so the comment may exist and must not be added again automatically. */
|
|
239
|
+
uncertain?: StepTarget<MutationResult<OperationOutput>>;
|
|
240
|
+
/** Local input, connection configuration, or connector definition is invalid. */
|
|
241
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
242
|
+
}
|
|
243
|
+
/** Build the addComment Step from a named connection. */
|
|
244
|
+
declare function newAddCommentStep<StepInput, OperationInput = AddCommentInput, OperationOutput = AddCommentOutput>(configuration: AddCommentStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
245
|
+
|
|
246
|
+
/** List one bounded task page from a project or section. */
|
|
247
|
+
declare class ListTasksOperation implements Query<ListTasksInput, ListTasksOutput> {
|
|
248
|
+
private readonly client;
|
|
249
|
+
/** Bind a validated Asana client. */ constructor(client: Client);
|
|
250
|
+
/** Return the stable manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
251
|
+
/** Read one page and classify one provider attempt. */
|
|
252
|
+
invoke(call: Call, input: ListTasksInput): Promise<QueryAttempt<ListTasksOutput>>;
|
|
253
|
+
}
|
|
254
|
+
/** Read one task with notes and custom field values. */
|
|
255
|
+
declare class GetTaskOperation implements Query<GetTaskInput, Task> {
|
|
256
|
+
private readonly client;
|
|
257
|
+
/** Bind a validated Asana client. */ constructor(client: Client);
|
|
258
|
+
/** Return the stable manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
259
|
+
/** Read one task and classify one provider attempt. */
|
|
260
|
+
invoke(call: Call, input: GetTaskInput): Promise<QueryAttempt<Task>>;
|
|
261
|
+
}
|
|
262
|
+
/** Create one Asana task with a checkpointed, non-repeatable POST. */
|
|
263
|
+
declare class CreateTaskOperation implements Mutation<CreateTaskInput, CreateTaskOutput> {
|
|
264
|
+
private readonly client;
|
|
265
|
+
/** Bind a validated Asana client. */ constructor(client: Client);
|
|
266
|
+
/** Return the stable manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
267
|
+
/** Use the Call ID in Dex receipts; Asana does not accept this key. */ idempotencyKey(callId: string): string;
|
|
268
|
+
/** Create or read back one task without repeating an ambiguous write. */
|
|
269
|
+
invoke(call: Call, input: CreateTaskInput): Promise<MutationAttempt<CreateTaskOutput>>;
|
|
270
|
+
private readBack;
|
|
271
|
+
}
|
|
272
|
+
/** Apply absolute task field and section changes. */
|
|
273
|
+
declare class UpdateTaskOperation implements Mutation<UpdateTaskInput, UpdateTaskOutput> {
|
|
274
|
+
private readonly client;
|
|
275
|
+
/** Bind a validated Asana client. */ constructor(client: Client);
|
|
276
|
+
/** Return the stable manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
277
|
+
/** Use the stable Call ID in Dex receipts. */ idempotencyKey(callId: string): string;
|
|
278
|
+
/** Apply repeatable changes and read back the resulting task. */
|
|
279
|
+
invoke(call: Call, input: UpdateTaskInput): Promise<MutationAttempt<UpdateTaskOutput>>;
|
|
280
|
+
}
|
|
281
|
+
/** Add one comment with a checkpointed, non-repeatable POST. */
|
|
282
|
+
declare class AddCommentOperation implements Mutation<AddCommentInput, AddCommentOutput> {
|
|
283
|
+
private readonly client;
|
|
284
|
+
/** Bind a validated Asana client. */ constructor(client: Client);
|
|
285
|
+
/** Return the stable manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
286
|
+
/** Use the Call ID in Dex receipts; Asana does not accept this key. */ idempotencyKey(callId: string): string;
|
|
287
|
+
/** Add or read back one story without repeating an ambiguous write. */
|
|
288
|
+
invoke(call: Call, input: AddCommentInput): Promise<MutationAttempt<AddCommentOutput>>;
|
|
289
|
+
private readBack;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** Injectable transport and clock for deterministic provider tests. */
|
|
293
|
+
interface ClientOptions {
|
|
294
|
+
/** Provider request sender; the default pins DNS and refuses redirects. */ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
295
|
+
/** Receipt and Retry-After clock. */ now?: () => Date;
|
|
296
|
+
}
|
|
297
|
+
/** Bounded provider exchange, including failures before or after dispatch. */
|
|
298
|
+
type Exchange = {
|
|
299
|
+
response: ProviderResponse;
|
|
300
|
+
isTooLarge: boolean;
|
|
301
|
+
reflectsSecret: boolean;
|
|
302
|
+
} | {
|
|
303
|
+
error: 'beforeSend' | 'afterSend' | 'notBuilt' | 'interrupted';
|
|
304
|
+
};
|
|
305
|
+
/** Authenticated Asana API client shared by operation-specific Step factories. */
|
|
306
|
+
declare class Client {
|
|
307
|
+
readonly endpoint: string;
|
|
308
|
+
readonly maxResponseBytes: number;
|
|
309
|
+
private readonly credentials;
|
|
310
|
+
private readonly send;
|
|
311
|
+
private readonly now;
|
|
312
|
+
/** Validate settings and own the credential source without resolving a secret. */
|
|
313
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: ClientOptions);
|
|
314
|
+
/** Bind the task list query. */ listTasks(): ListTasksOperation;
|
|
315
|
+
/** Bind the task detail query. */ getTask(): GetTaskOperation;
|
|
316
|
+
/** Bind the task create mutation. */ createTask(): CreateTaskOperation;
|
|
317
|
+
/** Bind the absolute task update mutation. */ updateTask(): UpdateTaskOperation;
|
|
318
|
+
/** Bind the comment create mutation. */ addComment(): AddCommentOperation;
|
|
319
|
+
/** Resolve the current personal token for exactly one operation attempt. */
|
|
320
|
+
token(call: Call): Promise<string | undefined>;
|
|
321
|
+
/** Send one Asana JSON request while bounding response bytes and elapsed time. */
|
|
322
|
+
exchange(call: Call, token: string, method: 'GET' | 'POST' | 'PUT', path: string, query: URLSearchParams, payload?: unknown, signal?: AbortSignal): Promise<Exchange>;
|
|
323
|
+
/** Build a secret-free receipt, with no Asana request ID header. */
|
|
324
|
+
receipt(call: Call, providerObjectId?: string): ReceiptDraft;
|
|
325
|
+
/** Interpret Retry-After with the same bounded SDK parser as other connectors. */
|
|
326
|
+
retryAfter(exchange: Exchange): number;
|
|
327
|
+
}
|
|
328
|
+
/** Secret-free Asana failure for one manifest operation. */
|
|
329
|
+
declare function failure(operation: string, kind: Failure['kind'], message: string): Failure;
|
|
330
|
+
/** Classify a conclusive provider status without reflecting its free-text body. */
|
|
331
|
+
declare function rejection(operation: string, subject: string, status: number): Failure;
|
|
332
|
+
/** Convert a successful response envelope into one untrusted JSON object. */
|
|
333
|
+
declare function dataObject(exchange: Exchange): Record<string, unknown>;
|
|
334
|
+
|
|
335
|
+
/** Open the static Asana connection from a Dex project. */
|
|
336
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: ClientOptions): Connection;
|
|
337
|
+
|
|
338
|
+
export { AddCommentBranch, AddCommentBranchAdded, AddCommentBranchDefect, AddCommentBranchNotFound, AddCommentBranchProviderRejected, AddCommentBranchUncertain, AddCommentDefinition, AddCommentInput, AddCommentMetadata, AddCommentOperation, AddCommentOutput, type AddCommentStepConfig, Client, type ClientOptions, Config, Connection, ConnectorID, CreateTaskBranch, CreateTaskBranchCreated, CreateTaskBranchDefect, CreateTaskBranchProviderRejected, CreateTaskBranchUncertain, CreateTaskDefinition, CreateTaskInput, CreateTaskMetadata, CreateTaskOperation, CreateTaskOutput, type CreateTaskStepConfig, Credentials, type Exchange, GetTaskBranch, GetTaskBranchDefect, GetTaskBranchFound, GetTaskBranchInvalidResponse, GetTaskBranchNotFound, GetTaskBranchProviderRejected, GetTaskDefinition, GetTaskInput, GetTaskMetadata, GetTaskOperation, type GetTaskStepConfig, ListTasksBranch, ListTasksBranchDefect, ListTasksBranchInvalidResponse, ListTasksBranchListed, ListTasksBranchNotFound, ListTasksBranchProviderRejected, ListTasksDefinition, ListTasksInput, ListTasksMetadata, ListTasksOperation, ListTasksOutput, type ListTasksStepConfig, ProviderID, Task, UpdateTaskBranch, UpdateTaskBranchDefect, UpdateTaskBranchInvalidResponse, UpdateTaskBranchNotFound, UpdateTaskBranchProviderRejected, UpdateTaskBranchUpdated, UpdateTaskDefinition, UpdateTaskInput, UpdateTaskMetadata, UpdateTaskOperation, UpdateTaskOutput, type UpdateTaskStepConfig, dataObject, failure, newAddCommentStep, newCreateTaskStep, newGetTaskStep, newListTasksStep, newProjectConnection, newUpdateTaskStep, rejection };
|