@superdurable/connector-freshdesk 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/dex-connector.json +191 -0
- package/dist/chunk-CLK5W7ZY.js +316 -0
- package/dist/connection-BRfKrSCD.d.ts +482 -0
- package/dist/index.d.ts +333 -0
- package/dist/index.js +861 -0
- package/dist/mock.d.ts +145 -0
- package/dist/mock.js +350 -0
- package/package.json +60 -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,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Freshdesk TypeScript Connector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@superdurable/connector-freshdesk` supplies Dex Step factories for five Freshdesk API v2 operations: `searchTickets`, `getTicket`, `createTicket`, `updateTicket`, and `addNote`. The package uses the same connection, operation, and branch identities as the Go connector. It has no Triggers. See the [connector README](../README.md) for Freshdesk setup, statuses, limits, and duplicate safety.
|
|
4
|
+
|
|
5
|
+
Create a Dex Web connection named `freshdesk-helpdesk`. Set `domain` to the lowercase part before `.freshdesk.com`, and save the agent's API key in the secret `api_key` field. Keep the key out of Flow input. `newProjectConnection` loads that static connection at Worker startup and resolves the current credential for each operation.
|
|
6
|
+
|
|
7
|
+
The runnable [ticket search example](examples/search-tickets/README.md) uses `newSearchTicketsStep` inside a Flow. Its `searched` branch is wired; the optional `providerRejected`, `invalidResponse`, and `defect` branches fail the Flow if selected. The other generated factories are `newGetTicketStep`, `newCreateTicketStep`, `newUpdateTicketStep`, and `newAddNoteStep`.
|
|
8
|
+
|
|
9
|
+
`createTicket` requester email and `searchTickets` requester email must be bare addresses with no dot at the start or end of the local part. A refused provider address is retried as an unsent request. `getTicket` and `updateTicket` receipts identify the requested ticket on provider response branches, including `notFound` and `invalidResponse`.
|
|
10
|
+
|
|
11
|
+
Run package checks with `npm ci && npm run check`. The Go-recorded fixture in `../../../../conformance/connectors/freshworks/freshdesk/scenarios.json` covers all five operations, including branches, retry classifications, request shapes, and unkeyed write uncertainty. Run the example's integration test with `DEX_FLOW_SERVICE_ADDRESS` set to a local `dexcli dev` gRPC address; its stand-in provider binds a free loopback port.
|
|
12
|
+
|
|
13
|
+
Live Freshdesk authorization and provider behavior have not been verified. The local integration test uses a Freshdesk-compatible HTTP stand-in through a real Dex Worker and Client.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
{
|
|
2
|
+
"connectorId": "freshdesk",
|
|
3
|
+
"releaseTag": "connectors/freshworks/freshdesk/go/v0.23.0",
|
|
4
|
+
"package": {
|
|
5
|
+
"ecosystem": "npm",
|
|
6
|
+
"name": "@superdurable/connector-freshdesk",
|
|
7
|
+
"version": "0.1.0"
|
|
8
|
+
},
|
|
9
|
+
"factories": [
|
|
10
|
+
{
|
|
11
|
+
"name": "newSearchTicketsStep",
|
|
12
|
+
"kind": "query",
|
|
13
|
+
"operationId": "searchTickets",
|
|
14
|
+
"fields": {
|
|
15
|
+
"stepType": "stepType",
|
|
16
|
+
"annotations": "annotations",
|
|
17
|
+
"connectionName": "connectionName",
|
|
18
|
+
"resultAttribute": "resultAttribute"
|
|
19
|
+
},
|
|
20
|
+
"branches": [
|
|
21
|
+
{
|
|
22
|
+
"id": "searched",
|
|
23
|
+
"field": "searched",
|
|
24
|
+
"optional": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "providerRejected",
|
|
28
|
+
"field": "providerRejected",
|
|
29
|
+
"optional": true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "invalidResponse",
|
|
33
|
+
"field": "invalidResponse",
|
|
34
|
+
"optional": true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "defect",
|
|
38
|
+
"field": "defect",
|
|
39
|
+
"optional": true
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "newGetTicketStep",
|
|
45
|
+
"kind": "query",
|
|
46
|
+
"operationId": "getTicket",
|
|
47
|
+
"fields": {
|
|
48
|
+
"stepType": "stepType",
|
|
49
|
+
"annotations": "annotations",
|
|
50
|
+
"connectionName": "connectionName",
|
|
51
|
+
"resultAttribute": "resultAttribute"
|
|
52
|
+
},
|
|
53
|
+
"branches": [
|
|
54
|
+
{
|
|
55
|
+
"id": "found",
|
|
56
|
+
"field": "found",
|
|
57
|
+
"optional": false
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "notFound",
|
|
61
|
+
"field": "notFound",
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "providerRejected",
|
|
66
|
+
"field": "providerRejected",
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "invalidResponse",
|
|
71
|
+
"field": "invalidResponse",
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "defect",
|
|
76
|
+
"field": "defect",
|
|
77
|
+
"optional": true
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "newCreateTicketStep",
|
|
83
|
+
"kind": "mutation",
|
|
84
|
+
"operationId": "createTicket",
|
|
85
|
+
"fields": {
|
|
86
|
+
"stepType": "stepType",
|
|
87
|
+
"annotations": "annotations",
|
|
88
|
+
"connectionName": "connectionName",
|
|
89
|
+
"resultAttribute": "resultAttribute"
|
|
90
|
+
},
|
|
91
|
+
"branches": [
|
|
92
|
+
{
|
|
93
|
+
"id": "created",
|
|
94
|
+
"field": "created",
|
|
95
|
+
"optional": false
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "providerRejected",
|
|
99
|
+
"field": "providerRejected",
|
|
100
|
+
"optional": true
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "uncertain",
|
|
104
|
+
"field": "uncertain",
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "defect",
|
|
109
|
+
"field": "defect",
|
|
110
|
+
"optional": true
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "newUpdateTicketStep",
|
|
116
|
+
"kind": "mutation",
|
|
117
|
+
"operationId": "updateTicket",
|
|
118
|
+
"fields": {
|
|
119
|
+
"stepType": "stepType",
|
|
120
|
+
"annotations": "annotations",
|
|
121
|
+
"connectionName": "connectionName",
|
|
122
|
+
"resultAttribute": "resultAttribute"
|
|
123
|
+
},
|
|
124
|
+
"branches": [
|
|
125
|
+
{
|
|
126
|
+
"id": "updated",
|
|
127
|
+
"field": "updated",
|
|
128
|
+
"optional": false
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "notFound",
|
|
132
|
+
"field": "notFound",
|
|
133
|
+
"optional": true
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "providerRejected",
|
|
137
|
+
"field": "providerRejected",
|
|
138
|
+
"optional": true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "invalidResponse",
|
|
142
|
+
"field": "invalidResponse",
|
|
143
|
+
"optional": true
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "defect",
|
|
147
|
+
"field": "defect",
|
|
148
|
+
"optional": true
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "newAddNoteStep",
|
|
154
|
+
"kind": "mutation",
|
|
155
|
+
"operationId": "addNote",
|
|
156
|
+
"fields": {
|
|
157
|
+
"stepType": "stepType",
|
|
158
|
+
"annotations": "annotations",
|
|
159
|
+
"connectionName": "connectionName",
|
|
160
|
+
"resultAttribute": "resultAttribute"
|
|
161
|
+
},
|
|
162
|
+
"branches": [
|
|
163
|
+
{
|
|
164
|
+
"id": "added",
|
|
165
|
+
"field": "added",
|
|
166
|
+
"optional": false
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"id": "notFound",
|
|
170
|
+
"field": "notFound",
|
|
171
|
+
"optional": true
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"id": "providerRejected",
|
|
175
|
+
"field": "providerRejected",
|
|
176
|
+
"optional": true
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"id": "uncertain",
|
|
180
|
+
"field": "uncertain",
|
|
181
|
+
"optional": true
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "defect",
|
|
185
|
+
"field": "defect",
|
|
186
|
+
"optional": true
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
// src/generated/models.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var ConfigSchema = z.object({
|
|
4
|
+
"domain": z.string(),
|
|
5
|
+
"maxResponseBytes": z.number().int().optional()
|
|
6
|
+
});
|
|
7
|
+
var SearchTicketsInputSchema = z.strictObject({
|
|
8
|
+
"statuses": z.array(z.number().int()).optional(),
|
|
9
|
+
"priorities": z.array(z.number().int()).optional(),
|
|
10
|
+
"tags": z.array(z.string()).optional(),
|
|
11
|
+
"updatedSinceDate": z.string().optional(),
|
|
12
|
+
"requesterEmail": z.string().optional(),
|
|
13
|
+
"page": z.number().int().optional()
|
|
14
|
+
});
|
|
15
|
+
var TicketSchema = z.strictObject({
|
|
16
|
+
"id": z.number().int(),
|
|
17
|
+
"subject": z.string().optional(),
|
|
18
|
+
"description": z.string().optional(),
|
|
19
|
+
"isDescriptionTruncated": z.boolean().optional(),
|
|
20
|
+
"status": z.number().int(),
|
|
21
|
+
"priority": z.number().int(),
|
|
22
|
+
"source": z.number().int().optional(),
|
|
23
|
+
"type": z.string().optional(),
|
|
24
|
+
"requesterId": z.number().int().optional(),
|
|
25
|
+
"responderId": z.number().int().optional(),
|
|
26
|
+
"groupId": z.number().int().optional(),
|
|
27
|
+
"companyId": z.number().int().optional(),
|
|
28
|
+
"productId": z.number().int().optional(),
|
|
29
|
+
"tags": z.array(z.string()).optional(),
|
|
30
|
+
"isEscalated": z.boolean().optional(),
|
|
31
|
+
"isSpam": z.boolean().optional(),
|
|
32
|
+
"createdAt": z.iso.datetime({ offset: true }),
|
|
33
|
+
"updatedAt": z.iso.datetime({ offset: true }),
|
|
34
|
+
"dueBy": z.iso.datetime({ offset: true }).nullable().optional(),
|
|
35
|
+
"firstResponseDueBy": z.iso.datetime({ offset: true }).nullable().optional()
|
|
36
|
+
});
|
|
37
|
+
var SearchTicketsOutputSchema = z.strictObject({
|
|
38
|
+
"tickets": z.array(TicketSchema).nullable(),
|
|
39
|
+
"totalMatched": z.number().int(),
|
|
40
|
+
"nextPage": z.number().int().optional()
|
|
41
|
+
});
|
|
42
|
+
var GetTicketInputSchema = z.strictObject({
|
|
43
|
+
"ticketId": z.number().int(),
|
|
44
|
+
"conversationLimit": z.number().int().optional()
|
|
45
|
+
});
|
|
46
|
+
var TicketRequesterSchema = z.strictObject({
|
|
47
|
+
"id": z.number().int(),
|
|
48
|
+
"name": z.string().optional(),
|
|
49
|
+
"email": z.string().optional()
|
|
50
|
+
});
|
|
51
|
+
var TicketConversationSchema = z.strictObject({
|
|
52
|
+
"id": z.number().int(),
|
|
53
|
+
"ticketId": z.number().int().optional(),
|
|
54
|
+
"userId": z.number().int().optional(),
|
|
55
|
+
"source": z.number().int(),
|
|
56
|
+
"isPrivate": z.boolean(),
|
|
57
|
+
"isIncoming": z.boolean().optional(),
|
|
58
|
+
"body": z.string(),
|
|
59
|
+
"isBodyTruncated": z.boolean().optional(),
|
|
60
|
+
"createdAt": z.iso.datetime({ offset: true })
|
|
61
|
+
});
|
|
62
|
+
var TicketDetailsSchema = z.strictObject({
|
|
63
|
+
"ticket": TicketSchema,
|
|
64
|
+
"requester": TicketRequesterSchema.optional(),
|
|
65
|
+
"conversations": z.array(TicketConversationSchema).nullable(),
|
|
66
|
+
"hasMoreConversations": z.boolean().optional()
|
|
67
|
+
});
|
|
68
|
+
var TicketRequesterInputSchema = z.strictObject({
|
|
69
|
+
"email": z.string(),
|
|
70
|
+
"name": z.string().optional()
|
|
71
|
+
});
|
|
72
|
+
var CreateTicketInputSchema = z.strictObject({
|
|
73
|
+
"subject": z.string(),
|
|
74
|
+
"description": z.string(),
|
|
75
|
+
"requester": TicketRequesterInputSchema,
|
|
76
|
+
"status": z.number().int().optional(),
|
|
77
|
+
"priority": z.number().int().optional(),
|
|
78
|
+
"type": z.string().optional(),
|
|
79
|
+
"tags": z.array(z.string()).optional(),
|
|
80
|
+
"groupId": z.number().int().optional(),
|
|
81
|
+
"responderId": z.number().int().optional()
|
|
82
|
+
});
|
|
83
|
+
var CreateTicketOutputSchema = z.strictObject({
|
|
84
|
+
"ticket": TicketSchema
|
|
85
|
+
});
|
|
86
|
+
var UpdateTicketInputSchema = z.strictObject({
|
|
87
|
+
"ticketId": z.number().int(),
|
|
88
|
+
"status": z.number().int().optional(),
|
|
89
|
+
"priority": z.number().int().optional(),
|
|
90
|
+
"groupId": z.number().int().optional(),
|
|
91
|
+
"responderId": z.number().int().optional(),
|
|
92
|
+
"addTags": z.array(z.string()).optional(),
|
|
93
|
+
"removeTags": z.array(z.string()).optional()
|
|
94
|
+
});
|
|
95
|
+
var UpdateTicketOutputSchema = z.strictObject({
|
|
96
|
+
"ticket": TicketSchema,
|
|
97
|
+
"wasAlreadyApplied": z.boolean().optional()
|
|
98
|
+
});
|
|
99
|
+
var AddNoteInputSchema = z.strictObject({
|
|
100
|
+
"ticketId": z.number().int(),
|
|
101
|
+
"body": z.string(),
|
|
102
|
+
"isPublicReply": z.boolean().optional()
|
|
103
|
+
});
|
|
104
|
+
var AddNoteOutputSchema = z.strictObject({
|
|
105
|
+
"conversation": TicketConversationSchema
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// src/generated/definitions.ts
|
|
109
|
+
var ConnectorID = "freshdesk";
|
|
110
|
+
var ProviderID = "freshdesk";
|
|
111
|
+
var SearchTicketsBranch = {
|
|
112
|
+
Searched: "searched",
|
|
113
|
+
ProviderRejected: "providerRejected",
|
|
114
|
+
InvalidResponse: "invalidResponse",
|
|
115
|
+
Defect: "defect"
|
|
116
|
+
};
|
|
117
|
+
var SearchTicketsBranchSearched = SearchTicketsBranch.Searched;
|
|
118
|
+
var SearchTicketsBranchProviderRejected = SearchTicketsBranch.ProviderRejected;
|
|
119
|
+
var SearchTicketsBranchInvalidResponse = SearchTicketsBranch.InvalidResponse;
|
|
120
|
+
var SearchTicketsBranchDefect = SearchTicketsBranch.Defect;
|
|
121
|
+
var SearchTicketsDefinition = {
|
|
122
|
+
operation: { connectorId: ConnectorID, operationId: "searchTickets" },
|
|
123
|
+
branches: [
|
|
124
|
+
{ id: "searched", description: "One page of matching tickets was returned; it may be empty." },
|
|
125
|
+
{ id: "providerRejected", description: "Freshdesk conclusively rejected the search, such as invalid credentials, a missing permission, or an unknown status.", optional: true },
|
|
126
|
+
{ id: "invalidResponse", description: "Freshdesk returned an invalid or oversized contact list or search page.", optional: true },
|
|
127
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
128
|
+
],
|
|
129
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
130
|
+
};
|
|
131
|
+
var SearchTicketsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
132
|
+
var GetTicketBranch = {
|
|
133
|
+
Found: "found",
|
|
134
|
+
NotFound: "notFound",
|
|
135
|
+
ProviderRejected: "providerRejected",
|
|
136
|
+
InvalidResponse: "invalidResponse",
|
|
137
|
+
Defect: "defect"
|
|
138
|
+
};
|
|
139
|
+
var GetTicketBranchFound = GetTicketBranch.Found;
|
|
140
|
+
var GetTicketBranchNotFound = GetTicketBranch.NotFound;
|
|
141
|
+
var GetTicketBranchProviderRejected = GetTicketBranch.ProviderRejected;
|
|
142
|
+
var GetTicketBranchInvalidResponse = GetTicketBranch.InvalidResponse;
|
|
143
|
+
var GetTicketBranchDefect = GetTicketBranch.Defect;
|
|
144
|
+
var GetTicketDefinition = {
|
|
145
|
+
operation: { connectorId: ConnectorID, operationId: "getTicket" },
|
|
146
|
+
branches: [
|
|
147
|
+
{ id: "found", description: "The ticket and its first conversations were read." },
|
|
148
|
+
{ id: "notFound", description: "The ticket does not exist or is not visible to the connection's agent.", optional: true },
|
|
149
|
+
{ id: "providerRejected", description: "Freshdesk conclusively rejected the ticket read.", optional: true },
|
|
150
|
+
{ id: "invalidResponse", description: "Freshdesk returned an invalid or oversized ticket or conversation page.", optional: true },
|
|
151
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
152
|
+
],
|
|
153
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
154
|
+
};
|
|
155
|
+
var GetTicketMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
156
|
+
var CreateTicketBranch = {
|
|
157
|
+
Created: "created",
|
|
158
|
+
ProviderRejected: "providerRejected",
|
|
159
|
+
Uncertain: "uncertain",
|
|
160
|
+
Defect: "defect"
|
|
161
|
+
};
|
|
162
|
+
var CreateTicketBranchCreated = CreateTicketBranch.Created;
|
|
163
|
+
var CreateTicketBranchProviderRejected = CreateTicketBranch.ProviderRejected;
|
|
164
|
+
var CreateTicketBranchUncertain = CreateTicketBranch.Uncertain;
|
|
165
|
+
var CreateTicketBranchDefect = CreateTicketBranch.Defect;
|
|
166
|
+
var CreateTicketDefinition = {
|
|
167
|
+
operation: { connectorId: ConnectorID, operationId: "createTicket" },
|
|
168
|
+
branches: [
|
|
169
|
+
{ id: "created", description: "Freshdesk created the ticket and returned it." },
|
|
170
|
+
{ id: "providerRejected", description: "Freshdesk conclusively rejected the ticket, such as an unknown status, group, or agent; no ticket was created.", optional: true },
|
|
171
|
+
{ id: "uncertain", description: "The request was sent but its outcome cannot be confirmed, so the ticket may exist; the connector never resends it.", optional: true },
|
|
172
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
173
|
+
],
|
|
174
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 6e4, maximumAttempts: 5, totalDurationMs: 3e5 } }
|
|
175
|
+
};
|
|
176
|
+
var CreateTicketMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
177
|
+
var UpdateTicketBranch = {
|
|
178
|
+
Updated: "updated",
|
|
179
|
+
NotFound: "notFound",
|
|
180
|
+
ProviderRejected: "providerRejected",
|
|
181
|
+
InvalidResponse: "invalidResponse",
|
|
182
|
+
Defect: "defect"
|
|
183
|
+
};
|
|
184
|
+
var UpdateTicketBranchUpdated = UpdateTicketBranch.Updated;
|
|
185
|
+
var UpdateTicketBranchNotFound = UpdateTicketBranch.NotFound;
|
|
186
|
+
var UpdateTicketBranchProviderRejected = UpdateTicketBranch.ProviderRejected;
|
|
187
|
+
var UpdateTicketBranchInvalidResponse = UpdateTicketBranch.InvalidResponse;
|
|
188
|
+
var UpdateTicketBranchDefect = UpdateTicketBranch.Defect;
|
|
189
|
+
var UpdateTicketDefinition = {
|
|
190
|
+
operation: { connectorId: ConnectorID, operationId: "updateTicket" },
|
|
191
|
+
branches: [
|
|
192
|
+
{ id: "updated", description: "The ticket holds the requested values, written now or by an earlier attempt." },
|
|
193
|
+
{ id: "notFound", description: "The ticket does not exist or is not visible to the connection's agent.", optional: true },
|
|
194
|
+
{ id: "providerRejected", description: "Freshdesk conclusively rejected the change, such as an unknown status, a missing required field, or a spam or deleted ticket.", optional: true },
|
|
195
|
+
{ id: "invalidResponse", description: "Freshdesk returned an invalid or oversized ticket, so the change may have been applied.", optional: true },
|
|
196
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
197
|
+
],
|
|
198
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
199
|
+
};
|
|
200
|
+
var UpdateTicketMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
201
|
+
var AddNoteBranch = {
|
|
202
|
+
Added: "added",
|
|
203
|
+
NotFound: "notFound",
|
|
204
|
+
ProviderRejected: "providerRejected",
|
|
205
|
+
Uncertain: "uncertain",
|
|
206
|
+
Defect: "defect"
|
|
207
|
+
};
|
|
208
|
+
var AddNoteBranchAdded = AddNoteBranch.Added;
|
|
209
|
+
var AddNoteBranchNotFound = AddNoteBranch.NotFound;
|
|
210
|
+
var AddNoteBranchProviderRejected = AddNoteBranch.ProviderRejected;
|
|
211
|
+
var AddNoteBranchUncertain = AddNoteBranch.Uncertain;
|
|
212
|
+
var AddNoteBranchDefect = AddNoteBranch.Defect;
|
|
213
|
+
var AddNoteDefinition = {
|
|
214
|
+
operation: { connectorId: ConnectorID, operationId: "addNote" },
|
|
215
|
+
branches: [
|
|
216
|
+
{ id: "added", description: "Freshdesk added the note or reply and returned it." },
|
|
217
|
+
{ id: "notFound", description: "The ticket does not exist or is not visible to the connection's agent; nothing was added.", optional: true },
|
|
218
|
+
{ id: "providerRejected", description: "Freshdesk conclusively rejected the note or reply; nothing was added.", optional: true },
|
|
219
|
+
{ id: "uncertain", description: "The request was sent but its outcome cannot be confirmed, so the note or reply may exist; the connector never resends it.", optional: true },
|
|
220
|
+
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
221
|
+
],
|
|
222
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 6e4, maximumAttempts: 5, totalDurationMs: 3e5 } }
|
|
223
|
+
};
|
|
224
|
+
var AddNoteMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
225
|
+
|
|
226
|
+
// src/generated/connection.ts
|
|
227
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
228
|
+
var Connection = class {
|
|
229
|
+
/** Stable provider and connection name. */
|
|
230
|
+
reference;
|
|
231
|
+
/** Bound provider operations. */
|
|
232
|
+
operations;
|
|
233
|
+
/** Validate a reference and bind operations. */
|
|
234
|
+
constructor(reference, operations) {
|
|
235
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
236
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
237
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
238
|
+
this.operations = operations;
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
function newConnection(client, reference) {
|
|
242
|
+
if (!client) throw new TypeError("connector client is required");
|
|
243
|
+
return new Connection(reference, client);
|
|
244
|
+
}
|
|
245
|
+
function newConnectionWithOperations(operations, reference) {
|
|
246
|
+
return new Connection(reference, operations);
|
|
247
|
+
}
|
|
248
|
+
function newProjectConnection(project, connectionName, createClient) {
|
|
249
|
+
if (!project) throw new TypeError("loaded project is required");
|
|
250
|
+
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
251
|
+
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
252
|
+
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
253
|
+
return newConnection(createClient(project, connectionName), reference);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export {
|
|
257
|
+
ConfigSchema,
|
|
258
|
+
SearchTicketsInputSchema,
|
|
259
|
+
TicketSchema,
|
|
260
|
+
SearchTicketsOutputSchema,
|
|
261
|
+
GetTicketInputSchema,
|
|
262
|
+
TicketRequesterSchema,
|
|
263
|
+
TicketConversationSchema,
|
|
264
|
+
TicketDetailsSchema,
|
|
265
|
+
TicketRequesterInputSchema,
|
|
266
|
+
CreateTicketInputSchema,
|
|
267
|
+
CreateTicketOutputSchema,
|
|
268
|
+
UpdateTicketInputSchema,
|
|
269
|
+
UpdateTicketOutputSchema,
|
|
270
|
+
AddNoteInputSchema,
|
|
271
|
+
AddNoteOutputSchema,
|
|
272
|
+
ConnectorID,
|
|
273
|
+
ProviderID,
|
|
274
|
+
SearchTicketsBranch,
|
|
275
|
+
SearchTicketsBranchSearched,
|
|
276
|
+
SearchTicketsBranchProviderRejected,
|
|
277
|
+
SearchTicketsBranchInvalidResponse,
|
|
278
|
+
SearchTicketsBranchDefect,
|
|
279
|
+
SearchTicketsDefinition,
|
|
280
|
+
SearchTicketsMetadata,
|
|
281
|
+
GetTicketBranch,
|
|
282
|
+
GetTicketBranchFound,
|
|
283
|
+
GetTicketBranchNotFound,
|
|
284
|
+
GetTicketBranchProviderRejected,
|
|
285
|
+
GetTicketBranchInvalidResponse,
|
|
286
|
+
GetTicketBranchDefect,
|
|
287
|
+
GetTicketDefinition,
|
|
288
|
+
GetTicketMetadata,
|
|
289
|
+
CreateTicketBranch,
|
|
290
|
+
CreateTicketBranchCreated,
|
|
291
|
+
CreateTicketBranchProviderRejected,
|
|
292
|
+
CreateTicketBranchUncertain,
|
|
293
|
+
CreateTicketBranchDefect,
|
|
294
|
+
CreateTicketDefinition,
|
|
295
|
+
CreateTicketMetadata,
|
|
296
|
+
UpdateTicketBranch,
|
|
297
|
+
UpdateTicketBranchUpdated,
|
|
298
|
+
UpdateTicketBranchNotFound,
|
|
299
|
+
UpdateTicketBranchProviderRejected,
|
|
300
|
+
UpdateTicketBranchInvalidResponse,
|
|
301
|
+
UpdateTicketBranchDefect,
|
|
302
|
+
UpdateTicketDefinition,
|
|
303
|
+
UpdateTicketMetadata,
|
|
304
|
+
AddNoteBranch,
|
|
305
|
+
AddNoteBranchAdded,
|
|
306
|
+
AddNoteBranchNotFound,
|
|
307
|
+
AddNoteBranchProviderRejected,
|
|
308
|
+
AddNoteBranchUncertain,
|
|
309
|
+
AddNoteBranchDefect,
|
|
310
|
+
AddNoteDefinition,
|
|
311
|
+
AddNoteMetadata,
|
|
312
|
+
Connection,
|
|
313
|
+
newConnection,
|
|
314
|
+
newConnectionWithOperations,
|
|
315
|
+
newProjectConnection
|
|
316
|
+
};
|