@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/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,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Asana connector for Dex TypeScript
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install `@superdurable/connector-asana@0.1.1` alongside `@superdurable/dex` and `@superdurable/connectors-sdk`. This package implements `listTasks`, `getTask`, `createTask`, `updateTask`, and `addComment`; it does not implement Triggers.
|
|
4
|
+
|
|
5
|
+
`Client` takes a `Config` and a `CredentialProvider<Credentials>`. Use `newProjectConnection` to load the named Dex Web connection, or `newConnection` to bind a client explicitly. The [approved request example](examples/approved-request-task/flow.ts) is a runnable Flow using every operation and the static `asana-approved-requests` connection name. Start its [Worker](examples/approved-request-task/main.ts) after configuring that connection in Dex Web. The [example guide](examples/approved-request-task/README.md) gives local verification commands.
|
|
6
|
+
|
|
7
|
+
The personal access token is resolved at each invocation and is sent only in the `Authorization` header. Task and comment POSTs have no Asana idempotency key: they retry a proven unsent request, 429, or 503; an ambiguous outcome selects `uncertain`. A Dex heartbeat checkpoints a returned task or story GID so a resumed attempt reads it back without sending another POST. `updateTask` uses absolute values and may retry; reads retry 408, 429, 5xx, and transport failures. An unwired optional branch fails the Flow.
|
|
8
|
+
|
|
9
|
+
Task IDs are decimal Asana GIDs. `listTasks` selects one project or section and returns one page of up to 100 tasks. `getTask` includes notes and custom fields. `createTask` accepts a project or workspace, optional section, assignee, date, and text, number, enum, or multi-enum custom fields. `updateTask` completes, reopens, assigns, unassigns, reschedules, clears a due date, sets custom fields, and moves to a section. `addComment` sends plain text to one task.
|
|
10
|
+
|
|
11
|
+
Run `npm ci` and `npm run check` from this directory. Cross-language provider parity is checked against the Go recordings in [scenarios.json](../../../conformance/connectors/asana/scenarios.json). The real Dex integration test requires `DEX_FLOW_SERVICE_ADDRESS` and uses a local stand-in for Asana. Live Asana authorization and API behavior remain unverified for this TypeScript package.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
{
|
|
2
|
+
"connectorId": "asana",
|
|
3
|
+
"releaseTag": "connectors/asana/go/v0.23.0",
|
|
4
|
+
"package": {
|
|
5
|
+
"ecosystem": "npm",
|
|
6
|
+
"name": "@superdurable/connector-asana",
|
|
7
|
+
"version": "0.1.1"
|
|
8
|
+
},
|
|
9
|
+
"factories": [
|
|
10
|
+
{
|
|
11
|
+
"name": "newListTasksStep",
|
|
12
|
+
"kind": "query",
|
|
13
|
+
"operationId": "listTasks",
|
|
14
|
+
"fields": {
|
|
15
|
+
"stepType": "stepType",
|
|
16
|
+
"annotations": "annotations",
|
|
17
|
+
"connectionName": "connectionName",
|
|
18
|
+
"resultAttribute": "resultAttribute"
|
|
19
|
+
},
|
|
20
|
+
"branches": [
|
|
21
|
+
{
|
|
22
|
+
"id": "listed",
|
|
23
|
+
"field": "listed",
|
|
24
|
+
"optional": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "notFound",
|
|
28
|
+
"field": "notFound",
|
|
29
|
+
"optional": true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "providerRejected",
|
|
33
|
+
"field": "providerRejected",
|
|
34
|
+
"optional": true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "invalidResponse",
|
|
38
|
+
"field": "invalidResponse",
|
|
39
|
+
"optional": true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "defect",
|
|
43
|
+
"field": "defect",
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "newGetTaskStep",
|
|
50
|
+
"kind": "query",
|
|
51
|
+
"operationId": "getTask",
|
|
52
|
+
"fields": {
|
|
53
|
+
"stepType": "stepType",
|
|
54
|
+
"annotations": "annotations",
|
|
55
|
+
"connectionName": "connectionName",
|
|
56
|
+
"resultAttribute": "resultAttribute"
|
|
57
|
+
},
|
|
58
|
+
"branches": [
|
|
59
|
+
{
|
|
60
|
+
"id": "found",
|
|
61
|
+
"field": "found",
|
|
62
|
+
"optional": false
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "notFound",
|
|
66
|
+
"field": "notFound",
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "providerRejected",
|
|
71
|
+
"field": "providerRejected",
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "invalidResponse",
|
|
76
|
+
"field": "invalidResponse",
|
|
77
|
+
"optional": true
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "defect",
|
|
81
|
+
"field": "defect",
|
|
82
|
+
"optional": true
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "newCreateTaskStep",
|
|
88
|
+
"kind": "mutation",
|
|
89
|
+
"operationId": "createTask",
|
|
90
|
+
"fields": {
|
|
91
|
+
"stepType": "stepType",
|
|
92
|
+
"annotations": "annotations",
|
|
93
|
+
"connectionName": "connectionName",
|
|
94
|
+
"resultAttribute": "resultAttribute"
|
|
95
|
+
},
|
|
96
|
+
"branches": [
|
|
97
|
+
{
|
|
98
|
+
"id": "created",
|
|
99
|
+
"field": "created",
|
|
100
|
+
"optional": false
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "providerRejected",
|
|
104
|
+
"field": "providerRejected",
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "uncertain",
|
|
109
|
+
"field": "uncertain",
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "defect",
|
|
114
|
+
"field": "defect",
|
|
115
|
+
"optional": true
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "newUpdateTaskStep",
|
|
121
|
+
"kind": "mutation",
|
|
122
|
+
"operationId": "updateTask",
|
|
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": "notFound",
|
|
137
|
+
"field": "notFound",
|
|
138
|
+
"optional": true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "providerRejected",
|
|
142
|
+
"field": "providerRejected",
|
|
143
|
+
"optional": true
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "invalidResponse",
|
|
147
|
+
"field": "invalidResponse",
|
|
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,376 @@
|
|
|
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
|
+
"endpoint": z.string().optional(),
|
|
29
|
+
"maxResponseBytes": z.number().int().optional()
|
|
30
|
+
});
|
|
31
|
+
function decodeCredentials(value) {
|
|
32
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
|
|
33
|
+
const fields = value;
|
|
34
|
+
const allowed = /* @__PURE__ */ new Set(["access_token"]);
|
|
35
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
|
|
36
|
+
if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new TypeError("credential access_token has an invalid type");
|
|
37
|
+
const credentials = {};
|
|
38
|
+
if (!fields["access_token"]) throw new TypeError("credential access_token is required");
|
|
39
|
+
credentials.accessToken = new SecretString(fields["access_token"] ?? "");
|
|
40
|
+
return credentials;
|
|
41
|
+
}
|
|
42
|
+
var ListTasksInputSchema = z.strictObject({
|
|
43
|
+
"projectId": z.string().optional(),
|
|
44
|
+
"sectionId": z.string().optional(),
|
|
45
|
+
"isIncompleteOnly": z.boolean().optional(),
|
|
46
|
+
"completedSince": GoTimeJSONSchema.nullable().optional(),
|
|
47
|
+
"modifiedSince": GoTimeJSONSchema.nullable().optional(),
|
|
48
|
+
"pageSize": z.number().int().optional(),
|
|
49
|
+
"offset": z.string().optional()
|
|
50
|
+
});
|
|
51
|
+
var UserReferenceSchema = z.strictObject({
|
|
52
|
+
"id": z.string(),
|
|
53
|
+
"name": z.string().optional()
|
|
54
|
+
});
|
|
55
|
+
var ProjectReferenceSchema = z.strictObject({
|
|
56
|
+
"id": z.string(),
|
|
57
|
+
"name": z.string().optional()
|
|
58
|
+
});
|
|
59
|
+
var SectionReferenceSchema = z.strictObject({
|
|
60
|
+
"id": z.string(),
|
|
61
|
+
"name": z.string().optional()
|
|
62
|
+
});
|
|
63
|
+
var TaskMembershipSchema = z.strictObject({
|
|
64
|
+
"project": ProjectReferenceSchema,
|
|
65
|
+
"section": SectionReferenceSchema.optional()
|
|
66
|
+
});
|
|
67
|
+
var TaskReferenceSchema = z.strictObject({
|
|
68
|
+
"id": z.string(),
|
|
69
|
+
"name": z.string().optional()
|
|
70
|
+
});
|
|
71
|
+
var WorkspaceReferenceSchema = z.strictObject({
|
|
72
|
+
"id": z.string(),
|
|
73
|
+
"name": z.string().optional()
|
|
74
|
+
});
|
|
75
|
+
var EnumOptionReferenceSchema = z.strictObject({
|
|
76
|
+
"id": z.string(),
|
|
77
|
+
"name": z.string().optional()
|
|
78
|
+
});
|
|
79
|
+
var CustomFieldValueSchema = z.strictObject({
|
|
80
|
+
"id": z.string(),
|
|
81
|
+
"name": z.string().optional(),
|
|
82
|
+
"type": z.string().optional(),
|
|
83
|
+
"displayValue": z.string().optional(),
|
|
84
|
+
"textValue": z.string().optional(),
|
|
85
|
+
"numberValue": z.number().optional(),
|
|
86
|
+
"enumOption": EnumOptionReferenceSchema.optional(),
|
|
87
|
+
"multiEnumOptions": z.array(EnumOptionReferenceSchema).optional()
|
|
88
|
+
});
|
|
89
|
+
var TaskSchema = z.strictObject({
|
|
90
|
+
"id": z.string(),
|
|
91
|
+
"name": z.string(),
|
|
92
|
+
"resourceSubtype": z.string().optional(),
|
|
93
|
+
"isCompleted": z.boolean(),
|
|
94
|
+
"completedAt": GoTimeJSONSchema.nullable().optional(),
|
|
95
|
+
"assignee": UserReferenceSchema.optional(),
|
|
96
|
+
"dueOn": z.string().optional(),
|
|
97
|
+
"dueAt": GoTimeJSONSchema.nullable().optional(),
|
|
98
|
+
"startOn": z.string().optional(),
|
|
99
|
+
"memberships": z.array(TaskMembershipSchema).optional(),
|
|
100
|
+
"parent": TaskReferenceSchema.optional(),
|
|
101
|
+
"workspace": WorkspaceReferenceSchema.optional(),
|
|
102
|
+
"notes": z.string().optional(),
|
|
103
|
+
"isNotesTruncated": z.boolean().optional(),
|
|
104
|
+
"customFields": z.array(CustomFieldValueSchema).optional(),
|
|
105
|
+
"permalinkUrl": z.string().optional(),
|
|
106
|
+
"createdAt": GoTimeJSONSchema,
|
|
107
|
+
"modifiedAt": GoTimeJSONSchema
|
|
108
|
+
});
|
|
109
|
+
var ListTasksOutputSchema = z.strictObject({
|
|
110
|
+
"tasks": z.array(TaskSchema).nullable(),
|
|
111
|
+
"nextOffset": z.string().optional()
|
|
112
|
+
});
|
|
113
|
+
var GetTaskInputSchema = z.strictObject({
|
|
114
|
+
"taskId": z.string()
|
|
115
|
+
});
|
|
116
|
+
var CustomFieldValueInputSchema = z.strictObject({
|
|
117
|
+
"customFieldId": z.string(),
|
|
118
|
+
"text": z.string().optional(),
|
|
119
|
+
"number": z.number().optional(),
|
|
120
|
+
"enumOptionId": z.string().optional(),
|
|
121
|
+
"multiEnumOptionIds": z.array(z.string()).optional()
|
|
122
|
+
});
|
|
123
|
+
var CreateTaskInputSchema = z.strictObject({
|
|
124
|
+
"name": z.string(),
|
|
125
|
+
"notes": z.string().optional(),
|
|
126
|
+
"projectId": z.string().optional(),
|
|
127
|
+
"sectionId": z.string().optional(),
|
|
128
|
+
"workspaceId": z.string().optional(),
|
|
129
|
+
"assigneeId": z.string().optional(),
|
|
130
|
+
"dueOn": z.string().optional(),
|
|
131
|
+
"customFields": z.array(CustomFieldValueInputSchema).optional()
|
|
132
|
+
});
|
|
133
|
+
var CreateTaskOutputSchema = z.strictObject({
|
|
134
|
+
"taskId": z.string().optional(),
|
|
135
|
+
"name": z.string(),
|
|
136
|
+
"projectId": z.string().optional(),
|
|
137
|
+
"sectionId": z.string().optional(),
|
|
138
|
+
"workspaceId": z.string().optional(),
|
|
139
|
+
"permalinkUrl": z.string().optional(),
|
|
140
|
+
"createdAt": GoTimeJSONSchema.nullable().optional()
|
|
141
|
+
});
|
|
142
|
+
var UpdateTaskInputSchema = z.strictObject({
|
|
143
|
+
"taskId": z.string(),
|
|
144
|
+
"isCompleted": z.boolean().optional(),
|
|
145
|
+
"assigneeId": z.string().optional(),
|
|
146
|
+
"dueOn": z.string().optional(),
|
|
147
|
+
"customFields": z.array(CustomFieldValueInputSchema).optional(),
|
|
148
|
+
"sectionId": z.string().optional()
|
|
149
|
+
});
|
|
150
|
+
var UpdateTaskOutputSchema = z.strictObject({
|
|
151
|
+
"taskId": z.string(),
|
|
152
|
+
"task": TaskSchema.optional(),
|
|
153
|
+
"isMovedToSection": z.boolean().optional()
|
|
154
|
+
});
|
|
155
|
+
var AddCommentInputSchema = z.strictObject({
|
|
156
|
+
"taskId": z.string(),
|
|
157
|
+
"text": z.string()
|
|
158
|
+
});
|
|
159
|
+
var AddCommentOutputSchema = z.strictObject({
|
|
160
|
+
"taskId": z.string(),
|
|
161
|
+
"commentId": z.string().optional(),
|
|
162
|
+
"author": UserReferenceSchema.optional(),
|
|
163
|
+
"createdAt": GoTimeJSONSchema.nullable().optional()
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// src/generated/definitions.ts
|
|
167
|
+
var ConnectorID = "asana";
|
|
168
|
+
var ProviderID = "asana";
|
|
169
|
+
var ListTasksBranch = {
|
|
170
|
+
Listed: "listed",
|
|
171
|
+
NotFound: "notFound",
|
|
172
|
+
ProviderRejected: "providerRejected",
|
|
173
|
+
InvalidResponse: "invalidResponse",
|
|
174
|
+
Defect: "defect"
|
|
175
|
+
};
|
|
176
|
+
var ListTasksBranchListed = ListTasksBranch.Listed;
|
|
177
|
+
var ListTasksBranchNotFound = ListTasksBranch.NotFound;
|
|
178
|
+
var ListTasksBranchProviderRejected = ListTasksBranch.ProviderRejected;
|
|
179
|
+
var ListTasksBranchInvalidResponse = ListTasksBranch.InvalidResponse;
|
|
180
|
+
var ListTasksBranchDefect = ListTasksBranch.Defect;
|
|
181
|
+
var ListTasksDefinition = {
|
|
182
|
+
operation: { connectorId: ConnectorID, operationId: "listTasks" },
|
|
183
|
+
branches: [
|
|
184
|
+
{ id: "listed", description: "One page of the project's or section's tasks was read." },
|
|
185
|
+
{ id: "notFound", description: "The project or section does not exist or the connection cannot see it.", optional: true },
|
|
186
|
+
{ id: "providerRejected", description: "Asana conclusively rejected the list, such as an expired offset token, missing permission, or a result set too large to page.", optional: true },
|
|
187
|
+
{ id: "invalidResponse", description: "Asana returned an invalid or oversized task 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 ListTasksMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
193
|
+
var GetTaskBranch = {
|
|
194
|
+
Found: "found",
|
|
195
|
+
NotFound: "notFound",
|
|
196
|
+
ProviderRejected: "providerRejected",
|
|
197
|
+
InvalidResponse: "invalidResponse",
|
|
198
|
+
Defect: "defect"
|
|
199
|
+
};
|
|
200
|
+
var GetTaskBranchFound = GetTaskBranch.Found;
|
|
201
|
+
var GetTaskBranchNotFound = GetTaskBranch.NotFound;
|
|
202
|
+
var GetTaskBranchProviderRejected = GetTaskBranch.ProviderRejected;
|
|
203
|
+
var GetTaskBranchInvalidResponse = GetTaskBranch.InvalidResponse;
|
|
204
|
+
var GetTaskBranchDefect = GetTaskBranch.Defect;
|
|
205
|
+
var GetTaskDefinition = {
|
|
206
|
+
operation: { connectorId: ConnectorID, operationId: "getTask" },
|
|
207
|
+
branches: [
|
|
208
|
+
{ id: "found", description: "The task was read." },
|
|
209
|
+
{ id: "notFound", description: "The task does not exist or the connection cannot see it.", optional: true },
|
|
210
|
+
{ id: "providerRejected", description: "Asana conclusively rejected the task read.", optional: true },
|
|
211
|
+
{ id: "invalidResponse", description: "Asana returned an invalid or oversized task.", 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 GetTaskMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
217
|
+
var CreateTaskBranch = {
|
|
218
|
+
Created: "created",
|
|
219
|
+
ProviderRejected: "providerRejected",
|
|
220
|
+
Uncertain: "uncertain",
|
|
221
|
+
Defect: "defect"
|
|
222
|
+
};
|
|
223
|
+
var CreateTaskBranchCreated = CreateTaskBranch.Created;
|
|
224
|
+
var CreateTaskBranchProviderRejected = CreateTaskBranch.ProviderRejected;
|
|
225
|
+
var CreateTaskBranchUncertain = CreateTaskBranch.Uncertain;
|
|
226
|
+
var CreateTaskBranchDefect = CreateTaskBranch.Defect;
|
|
227
|
+
var CreateTaskDefinition = {
|
|
228
|
+
operation: { connectorId: ConnectorID, operationId: "createTask" },
|
|
229
|
+
branches: [
|
|
230
|
+
{ id: "created", description: "Asana created the task and returned its ID." },
|
|
231
|
+
{ id: "providerRejected", description: "Asana conclusively rejected the task, such as an unknown project, section, assignee, or custom field value, or missing permission; nothing was created.", optional: true },
|
|
232
|
+
{ id: "uncertain", description: "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.", optional: true },
|
|
233
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
234
|
+
],
|
|
235
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 3e4, maximumAttempts: 5, totalDurationMs: 12e4 } }
|
|
236
|
+
};
|
|
237
|
+
var CreateTaskMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
238
|
+
var UpdateTaskBranch = {
|
|
239
|
+
Updated: "updated",
|
|
240
|
+
NotFound: "notFound",
|
|
241
|
+
ProviderRejected: "providerRejected",
|
|
242
|
+
InvalidResponse: "invalidResponse",
|
|
243
|
+
Defect: "defect"
|
|
244
|
+
};
|
|
245
|
+
var UpdateTaskBranchUpdated = UpdateTaskBranch.Updated;
|
|
246
|
+
var UpdateTaskBranchNotFound = UpdateTaskBranch.NotFound;
|
|
247
|
+
var UpdateTaskBranchProviderRejected = UpdateTaskBranch.ProviderRejected;
|
|
248
|
+
var UpdateTaskBranchInvalidResponse = UpdateTaskBranch.InvalidResponse;
|
|
249
|
+
var UpdateTaskBranchDefect = UpdateTaskBranch.Defect;
|
|
250
|
+
var UpdateTaskDefinition = {
|
|
251
|
+
operation: { connectorId: ConnectorID, operationId: "updateTask" },
|
|
252
|
+
branches: [
|
|
253
|
+
{ id: "updated", description: "Asana applied every requested change, including when the task already had those values, and the Value holds the task read back." },
|
|
254
|
+
{ id: "notFound", description: "The task or section does not exist or the connection cannot see it.", optional: true },
|
|
255
|
+
{ id: "providerRejected", description: "Asana conclusively rejected a change, such as an unknown assignee, a section of a project the task is not in, or missing permission.", optional: true },
|
|
256
|
+
{ id: "invalidResponse", description: "Asana returned an invalid or oversized task after the update.", optional: true },
|
|
257
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
258
|
+
],
|
|
259
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
260
|
+
};
|
|
261
|
+
var UpdateTaskMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
262
|
+
var AddCommentBranch = {
|
|
263
|
+
Added: "added",
|
|
264
|
+
NotFound: "notFound",
|
|
265
|
+
ProviderRejected: "providerRejected",
|
|
266
|
+
Uncertain: "uncertain",
|
|
267
|
+
Defect: "defect"
|
|
268
|
+
};
|
|
269
|
+
var AddCommentBranchAdded = AddCommentBranch.Added;
|
|
270
|
+
var AddCommentBranchNotFound = AddCommentBranch.NotFound;
|
|
271
|
+
var AddCommentBranchProviderRejected = AddCommentBranch.ProviderRejected;
|
|
272
|
+
var AddCommentBranchUncertain = AddCommentBranch.Uncertain;
|
|
273
|
+
var AddCommentBranchDefect = AddCommentBranch.Defect;
|
|
274
|
+
var AddCommentDefinition = {
|
|
275
|
+
operation: { connectorId: ConnectorID, operationId: "addComment" },
|
|
276
|
+
branches: [
|
|
277
|
+
{ id: "added", description: "Asana added the comment and returned its story ID." },
|
|
278
|
+
{ id: "notFound", description: "The task does not exist or the connection cannot see it; nothing was added.", optional: true },
|
|
279
|
+
{ id: "providerRejected", description: "Asana conclusively rejected the comment, such as missing permission or invalid text; nothing was added.", optional: true },
|
|
280
|
+
{ id: "uncertain", description: "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.", optional: true },
|
|
281
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
282
|
+
],
|
|
283
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 3e4, maximumAttempts: 5, totalDurationMs: 12e4 } }
|
|
284
|
+
};
|
|
285
|
+
var AddCommentMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
286
|
+
|
|
287
|
+
// src/generated/connection.ts
|
|
288
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
289
|
+
var Connection = class {
|
|
290
|
+
/** Stable provider and connection name. */
|
|
291
|
+
reference;
|
|
292
|
+
/** Bound provider operations. */
|
|
293
|
+
operations;
|
|
294
|
+
/** Validate a reference and bind operations. */
|
|
295
|
+
constructor(reference, operations) {
|
|
296
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
297
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
298
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
299
|
+
this.operations = operations;
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
function newConnection(client, reference) {
|
|
303
|
+
if (!client) throw new TypeError("connector client is required");
|
|
304
|
+
return new Connection(reference, client);
|
|
305
|
+
}
|
|
306
|
+
function newConnectionWithOperations(operations, reference) {
|
|
307
|
+
return new Connection(reference, operations);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export {
|
|
311
|
+
ConfigSchema,
|
|
312
|
+
decodeCredentials,
|
|
313
|
+
ListTasksInputSchema,
|
|
314
|
+
UserReferenceSchema,
|
|
315
|
+
ProjectReferenceSchema,
|
|
316
|
+
SectionReferenceSchema,
|
|
317
|
+
TaskMembershipSchema,
|
|
318
|
+
TaskReferenceSchema,
|
|
319
|
+
WorkspaceReferenceSchema,
|
|
320
|
+
EnumOptionReferenceSchema,
|
|
321
|
+
CustomFieldValueSchema,
|
|
322
|
+
TaskSchema,
|
|
323
|
+
ListTasksOutputSchema,
|
|
324
|
+
GetTaskInputSchema,
|
|
325
|
+
CustomFieldValueInputSchema,
|
|
326
|
+
CreateTaskInputSchema,
|
|
327
|
+
CreateTaskOutputSchema,
|
|
328
|
+
UpdateTaskInputSchema,
|
|
329
|
+
UpdateTaskOutputSchema,
|
|
330
|
+
AddCommentInputSchema,
|
|
331
|
+
AddCommentOutputSchema,
|
|
332
|
+
ConnectorID,
|
|
333
|
+
ProviderID,
|
|
334
|
+
ListTasksBranch,
|
|
335
|
+
ListTasksBranchListed,
|
|
336
|
+
ListTasksBranchNotFound,
|
|
337
|
+
ListTasksBranchProviderRejected,
|
|
338
|
+
ListTasksBranchInvalidResponse,
|
|
339
|
+
ListTasksBranchDefect,
|
|
340
|
+
ListTasksDefinition,
|
|
341
|
+
ListTasksMetadata,
|
|
342
|
+
GetTaskBranch,
|
|
343
|
+
GetTaskBranchFound,
|
|
344
|
+
GetTaskBranchNotFound,
|
|
345
|
+
GetTaskBranchProviderRejected,
|
|
346
|
+
GetTaskBranchInvalidResponse,
|
|
347
|
+
GetTaskBranchDefect,
|
|
348
|
+
GetTaskDefinition,
|
|
349
|
+
GetTaskMetadata,
|
|
350
|
+
CreateTaskBranch,
|
|
351
|
+
CreateTaskBranchCreated,
|
|
352
|
+
CreateTaskBranchProviderRejected,
|
|
353
|
+
CreateTaskBranchUncertain,
|
|
354
|
+
CreateTaskBranchDefect,
|
|
355
|
+
CreateTaskDefinition,
|
|
356
|
+
CreateTaskMetadata,
|
|
357
|
+
UpdateTaskBranch,
|
|
358
|
+
UpdateTaskBranchUpdated,
|
|
359
|
+
UpdateTaskBranchNotFound,
|
|
360
|
+
UpdateTaskBranchProviderRejected,
|
|
361
|
+
UpdateTaskBranchInvalidResponse,
|
|
362
|
+
UpdateTaskBranchDefect,
|
|
363
|
+
UpdateTaskDefinition,
|
|
364
|
+
UpdateTaskMetadata,
|
|
365
|
+
AddCommentBranch,
|
|
366
|
+
AddCommentBranchAdded,
|
|
367
|
+
AddCommentBranchNotFound,
|
|
368
|
+
AddCommentBranchProviderRejected,
|
|
369
|
+
AddCommentBranchUncertain,
|
|
370
|
+
AddCommentBranchDefect,
|
|
371
|
+
AddCommentDefinition,
|
|
372
|
+
AddCommentMetadata,
|
|
373
|
+
Connection,
|
|
374
|
+
newConnection,
|
|
375
|
+
newConnectionWithOperations
|
|
376
|
+
};
|