@osva-ai/connector-freshdesk 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.
Files changed (67) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +2 -2
  3. package/dist/config.d.ts +3 -0
  4. package/dist/config.d.ts.map +1 -0
  5. package/dist/config.js +77 -0
  6. package/dist/config.js.map +1 -0
  7. package/dist/connector.d.ts +10 -0
  8. package/dist/connector.d.ts.map +1 -0
  9. package/dist/connector.js +230 -0
  10. package/dist/connector.js.map +1 -0
  11. package/dist/constants.d.ts +43 -0
  12. package/dist/constants.d.ts.map +1 -0
  13. package/dist/constants.js +43 -0
  14. package/dist/constants.js.map +1 -0
  15. package/dist/freshdesk-auth.d.ts +3 -0
  16. package/dist/freshdesk-auth.d.ts.map +1 -0
  17. package/dist/freshdesk-auth.js +13 -0
  18. package/dist/freshdesk-auth.js.map +1 -0
  19. package/dist/freshdesk-base-url.d.ts +6 -0
  20. package/dist/freshdesk-base-url.d.ts.map +1 -0
  21. package/dist/freshdesk-base-url.js +31 -0
  22. package/dist/freshdesk-base-url.js.map +1 -0
  23. package/dist/freshdesk-client.d.ts +17 -0
  24. package/dist/freshdesk-client.d.ts.map +1 -0
  25. package/dist/freshdesk-client.js +2 -0
  26. package/dist/freshdesk-client.js.map +1 -0
  27. package/dist/freshdesk-rest-client.d.ts +15 -0
  28. package/dist/freshdesk-rest-client.d.ts.map +1 -0
  29. package/dist/freshdesk-rest-client.js +203 -0
  30. package/dist/freshdesk-rest-client.js.map +1 -0
  31. package/dist/id-allowlist.d.ts +9 -0
  32. package/dist/id-allowlist.d.ts.map +1 -0
  33. package/dist/id-allowlist.js +62 -0
  34. package/dist/id-allowlist.js.map +1 -0
  35. package/dist/index.d.ts +5 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +5 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/map-freshdesk-error.d.ts +7 -0
  40. package/dist/map-freshdesk-error.d.ts.map +1 -0
  41. package/dist/map-freshdesk-error.js +40 -0
  42. package/dist/map-freshdesk-error.js.map +1 -0
  43. package/dist/mutation-allowlist.d.ts +3 -0
  44. package/dist/mutation-allowlist.d.ts.map +1 -0
  45. package/dist/mutation-allowlist.js +35 -0
  46. package/dist/mutation-allowlist.js.map +1 -0
  47. package/dist/normalize-freshdesk.d.ts +42 -0
  48. package/dist/normalize-freshdesk.d.ts.map +1 -0
  49. package/dist/normalize-freshdesk.js +241 -0
  50. package/dist/normalize-freshdesk.js.map +1 -0
  51. package/dist/resource-id.d.ts +2 -0
  52. package/dist/resource-id.d.ts.map +1 -0
  53. package/dist/resource-id.js +10 -0
  54. package/dist/resource-id.js.map +1 -0
  55. package/dist/schemas.d.ts +16 -0
  56. package/dist/schemas.d.ts.map +1 -0
  57. package/dist/schemas.js +22 -0
  58. package/dist/schemas.js.map +1 -0
  59. package/dist/stdio.d.ts +3 -0
  60. package/dist/stdio.d.ts.map +1 -0
  61. package/dist/stdio.js +18 -0
  62. package/dist/stdio.js.map +1 -0
  63. package/dist/tool-schemas.d.ts +140 -0
  64. package/dist/tool-schemas.d.ts.map +1 -0
  65. package/dist/tool-schemas.js +97 -0
  66. package/dist/tool-schemas.js.map +1 -0
  67. package/package.json +57 -4
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
1
+ # @osva-ai/connector-zendesk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Customer support connector (7 tools). See [INSTALL-ZENDESK.md](../../docs/INSTALL-ZENDESK.md).
@@ -0,0 +1,3 @@
1
+ import { type FreshdeskConfig } from "./schemas.js";
2
+ export declare function loadFreshdeskConfig(env?: NodeJS.ProcessEnv): FreshdeskConfig;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAsC3E,wBAAgB,mBAAmB,CACjC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,eAAe,CAqEjB"}
package/dist/config.js ADDED
@@ -0,0 +1,77 @@
1
+ import { ConnectorSdkError } from "@osva-ai/connector-sdk";
2
+ import { DEFAULT_REQUEST_TIMEOUT_MS, FRESHDESK_ALLOW_TEST_API_HOST_ENV, FRESHDESK_ALLOWED_RESOURCE_IDS_ENV, FRESHDESK_ALLOWED_TARGET_STATUSES_ENV, FRESHDESK_API_BASE_URL_ENV, FRESHDESK_API_KEY_ENV, FRESHDESK_DOMAIN_ENV, FRESHDESK_HOST_WRITES_APPROVED_ENV, FRESHDESK_INCLUDE_PII_ENV, FRESHDESK_NOTES_ENABLED_ENV, FRESHDESK_STATUS_ENABLED_ENV, FRESHDESK_TIMEOUT_MS_ENV, } from "./constants.js";
3
+ import { parseNumericIdList } from "./id-allowlist.js";
4
+ import { parseFreshdeskDomain } from "./freshdesk-base-url.js";
5
+ import { freshdeskConfigSchema } from "./schemas.js";
6
+ function readBoundedInt(raw, fallback, label) {
7
+ if (raw === undefined || raw.trim().length === 0)
8
+ return fallback;
9
+ const value = Number(raw.trim());
10
+ if (!Number.isInteger(value)) {
11
+ throw new ConnectorSdkError("CONFIGURATION_ERROR", `${label} must be an integer.`);
12
+ }
13
+ return value;
14
+ }
15
+ function parseBooleanFlag(raw, fallback) {
16
+ if (raw === undefined || raw.trim().length === 0)
17
+ return fallback;
18
+ const normalized = raw.trim().toLowerCase();
19
+ if (["true", "1", "yes"].includes(normalized))
20
+ return true;
21
+ if (["false", "0", "no"].includes(normalized))
22
+ return false;
23
+ throw new ConnectorSdkError("CONFIGURATION_ERROR", "Boolean environment flag must be true or false.");
24
+ }
25
+ function parseCsvStrings(raw) {
26
+ if (raw === undefined)
27
+ return undefined;
28
+ if (raw.trim().length === 0)
29
+ return [];
30
+ return raw
31
+ .split(",")
32
+ .map((p) => p.trim())
33
+ .filter((p) => p.length > 0);
34
+ }
35
+ export function loadFreshdeskConfig(env = process.env) {
36
+ const rawDomain = env[FRESHDESK_DOMAIN_ENV];
37
+ const rawKey = env[FRESHDESK_API_KEY_ENV];
38
+ if (rawDomain === undefined || rawDomain.trim().length === 0) {
39
+ throw new ConnectorSdkError("CONFIGURATION_ERROR", "Freshdesk domain is not configured.");
40
+ }
41
+ if (rawKey === undefined || rawKey.trim().length === 0) {
42
+ throw new ConnectorSdkError("CONFIGURATION_ERROR", "Freshdesk API key is not configured.");
43
+ }
44
+ const allowTestApiHost = parseBooleanFlag(env[FRESHDESK_ALLOW_TEST_API_HOST_ENV], false);
45
+ const rawApiBase = env[FRESHDESK_API_BASE_URL_ENV]?.trim();
46
+ let apiBaseUrl;
47
+ let pinnedOrigin;
48
+ if (rawApiBase !== undefined && rawApiBase.length > 0) {
49
+ if (!allowTestApiHost) {
50
+ throw new ConnectorSdkError("CONFIGURATION_ERROR", "Custom API base URL requires OSVA_CONNECTOR_FRESHDESK_ALLOW_TEST_API_HOST=true.");
51
+ }
52
+ const parsedUrl = new URL(rawApiBase);
53
+ apiBaseUrl = parsedUrl.toString().replace(/\/$/, "");
54
+ pinnedOrigin = parsedUrl.origin;
55
+ }
56
+ else {
57
+ ({ apiBaseUrl, pinnedOrigin } = parseFreshdeskDomain(rawDomain, allowTestApiHost));
58
+ }
59
+ const parsed = freshdeskConfigSchema.safeParse({
60
+ apiBaseUrl,
61
+ pinnedOrigin,
62
+ apiKey: rawKey.trim(),
63
+ allowTestApiHost,
64
+ allowedResourceIds: parseNumericIdList(env[FRESHDESK_ALLOWED_RESOURCE_IDS_ENV]),
65
+ allowedTargetStatuses: parseCsvStrings(env[FRESHDESK_ALLOWED_TARGET_STATUSES_ENV]),
66
+ notesEnabled: parseBooleanFlag(env[FRESHDESK_NOTES_ENABLED_ENV], false),
67
+ statusEnabled: parseBooleanFlag(env[FRESHDESK_STATUS_ENABLED_ENV], false),
68
+ hostWritesApproved: parseBooleanFlag(env[FRESHDESK_HOST_WRITES_APPROVED_ENV], false),
69
+ includePii: parseBooleanFlag(env[FRESHDESK_INCLUDE_PII_ENV], false),
70
+ requestTimeoutMs: readBoundedInt(env[FRESHDESK_TIMEOUT_MS_ENV], DEFAULT_REQUEST_TIMEOUT_MS, "Request timeout"),
71
+ });
72
+ if (!parsed.success) {
73
+ throw new ConnectorSdkError("CONFIGURATION_ERROR", "Freshdesk connector configuration is invalid.");
74
+ }
75
+ return parsed.data;
76
+ }
77
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,0BAA0B,EAC1B,iCAAiC,EACjC,kCAAkC,EAClC,qCAAqC,EACrC,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,kCAAkC,EAClC,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAwB,MAAM,cAAc,CAAC;AAE3E,SAAS,cAAc,CACrB,GAAuB,EACvB,QAAgB,EAChB,KAAa;IAEb,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAClE,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KA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;QAChB,kBAAkB,EAAE,kBAAkB,CACpC,GAAG,CAAC,kCAAkC,CAAC,CACxC;QACD,qBAAqB,EAAE,eAAe,CACpC,GAAG,CAAC,qCAAqC,CAAC,CAC3C;QACD,YAAY,EAAE,gBAAgB,CAAC,GAAG,CAAC,2BAA2B,CAAC,EAAE,KAAK,CAAC;QACvE,aAAa,EAAE,gBAAgB,CAAC,GAAG,CAAC,4BAA4B,CAAC,EAAE,KAAK,CAAC;QACzE,kBAAkB,EAAE,gBAAgB,CAClC,GAAG,CAAC,kCAAkC,CAAC,EACvC,KAAK,CACN;QACD,UAAU,EAAE,gBAAgB,CAAC,GAAG,CAAC,yBAAyB,CAAC,EAAE,KAAK,CAAC;QACnE,gBAAgB,EAAE,cAAc,CAC9B,GAAG,CAAC,wBAAwB,CAAC,EAC7B,0BAA0B,EAC1B,iBAAiB,CAClB;KACF,CAAC,CAAC;IACH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,iBAAiB,CACzB,qBAAqB,EACrB,+CAA+C,CAChD,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type DefinedConnector } from "@osva-ai/connector-sdk";
2
+ import type { FreshdeskConfig } from "./schemas.js";
3
+ import type { FreshdeskClient } from "./freshdesk-client.js";
4
+ export interface CreateFreshdeskConnectorOptions {
5
+ readonly client: FreshdeskClient;
6
+ readonly config: FreshdeskConfig;
7
+ readonly apiKeyForRedaction?: string;
8
+ }
9
+ export declare function createFreshdeskConnector(options: CreateFreshdeskConnectorOptions): DefinedConnector;
10
+ //# sourceMappingURL=connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAuBhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA8B7D,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAqDD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,+BAA+B,GACvC,gBAAgB,CAyOlB"}
@@ -0,0 +1,230 @@
1
+ import { ConnectorSdkError, defineConnector, defineTool, } from "@osva-ai/connector-sdk";
2
+ import { CONNECTOR_KEY, CONNECTOR_NAME, CONNECTOR_VERSION, FRESHDESK_ALLOWED_RESOURCE_IDS_ENV, FRESHDESK_CONTACT_GET_TOOL, FRESHDESK_CONTACT_LIST_TOOL, FRESHDESK_TICKET_CONVERSATION_LIST_TOOL, FRESHDESK_TICKET_GET_TOOL, FRESHDESK_TICKET_LIST_TOOL, FRESHDESK_TICKET_NOTE_ADD_TOOL, FRESHDESK_TICKET_SEARCH_TOOL, FRESHDESK_TICKET_STATUS_SET_TOOL, LIST_DEFAULT_PAGE, LIST_DEFAULT_PER_PAGE, } from "./constants.js";
3
+ import { assertIdAllowed, assertMutationAllowlistConfigured, createNumericIdAllowlist, filterByNumericAllowlist, } from "./id-allowlist.js";
4
+ import { mapFreshdeskError } from "./map-freshdesk-error.js";
5
+ import { buildFreshdeskPrivateNoteBody, buildFreshdeskStatusBody, } from "./mutation-allowlist.js";
6
+ import { mapCommentListResponse, mapTicketGetResponse, mapTicketListResponse, } from "./normalize-freshdesk.js";
7
+ import { contactGetInputJsonSchema, contactGetInputSchema, contactListInputJsonSchema, contactListInputSchema, ticketConversationListInputJsonSchema, ticketConversationListInputSchema, ticketGetInputJsonSchema, ticketGetInputSchema, ticketListInputJsonSchema, ticketListInputSchema, ticketNoteAddInputJsonSchema, ticketNoteAddInputSchema, ticketSearchInputJsonSchema, ticketSearchInputSchema, ticketStatusSetInputJsonSchema, ticketStatusSetInputSchema, } from "./tool-schemas.js";
8
+ function invalidInputError() {
9
+ return new ConnectorSdkError("INVALID_INPUT", "Invalid tool input.");
10
+ }
11
+ function mapError(error, options, ambiguous) {
12
+ return mapFreshdeskError(error, {
13
+ apiKey: options.apiKeyForRedaction,
14
+ ...(ambiguous === true ? { ambiguousWrite: true } : {}),
15
+ });
16
+ }
17
+ function assertNotesAllowed(config) {
18
+ if (!config.notesEnabled) {
19
+ throw new ConnectorSdkError("FORBIDDEN", "Freshdesk note adds are disabled (NOTES_ENABLED).");
20
+ }
21
+ if (!config.hostWritesApproved) {
22
+ throw new ConnectorSdkError("FORBIDDEN", "Freshdesk mutations require HOST_WRITES_APPROVED.");
23
+ }
24
+ }
25
+ function assertStatusAllowed(config) {
26
+ if (!config.statusEnabled) {
27
+ throw new ConnectorSdkError("FORBIDDEN", "Freshdesk status updates are disabled (STATUS_ENABLED).");
28
+ }
29
+ if (!config.hostWritesApproved) {
30
+ throw new ConnectorSdkError("FORBIDDEN", "Freshdesk mutations require HOST_WRITES_APPROVED.");
31
+ }
32
+ }
33
+ function readTicketId(raw) {
34
+ if (typeof raw !== "object" || raw === null)
35
+ return Number.NaN;
36
+ const id = raw.id;
37
+ return typeof id === "number" ? id : Number.parseInt(String(id), 10);
38
+ }
39
+ export function createFreshdeskConnector(options) {
40
+ const { config, client } = options;
41
+ const ticketAllowlist = createNumericIdAllowlist(config.allowedResourceIds);
42
+ return defineConnector({
43
+ key: CONNECTOR_KEY,
44
+ name: CONNECTOR_NAME,
45
+ version: CONNECTOR_VERSION,
46
+ description: "Freshdesk MCP connector: bounded ticket/contact reads, private note adds, and status updates. No customer-facing replies.",
47
+ tools: [
48
+ defineTool({
49
+ name: FRESHDESK_TICKET_LIST_TOOL,
50
+ inputSchema: ticketListInputJsonSchema,
51
+ description: "Lists Freshdesk tickets with bounded pagination.",
52
+ handler: async (input, context) => {
53
+ const parsed = ticketListInputSchema.safeParse(input);
54
+ if (!parsed.success)
55
+ throw invalidInputError();
56
+ if (ticketAllowlist?.allowedIds.size === 0) {
57
+ return {
58
+ pageInfo: { page: 1, hasMore: false },
59
+ tickets: [],
60
+ untrustedContent: true,
61
+ };
62
+ }
63
+ const page = parsed.data.page ?? LIST_DEFAULT_PAGE;
64
+ const perPage = parsed.data.perPage ?? LIST_DEFAULT_PER_PAGE;
65
+ try {
66
+ const { items } = await client.listTickets({ page, perPage }, context.signal);
67
+ const raw = typeof items === "object" &&
68
+ items !== null &&
69
+ Array.isArray(items.results)
70
+ ? items.results
71
+ : Array.isArray(items)
72
+ ? items
73
+ : [];
74
+ const filtered = filterByNumericAllowlist(ticketAllowlist, raw, readTicketId);
75
+ return mapTicketListResponse({ tickets: filtered }, page, config.includePii);
76
+ }
77
+ catch (error) {
78
+ throw mapError(error, options);
79
+ }
80
+ },
81
+ }),
82
+ defineTool({
83
+ name: FRESHDESK_TICKET_GET_TOOL,
84
+ inputSchema: ticketGetInputJsonSchema,
85
+ description: "Returns one Freshdesk ticket.",
86
+ handler: async (input, context) => {
87
+ const parsed = ticketGetInputSchema.safeParse(input);
88
+ if (!parsed.success)
89
+ throw invalidInputError();
90
+ assertIdAllowed(ticketAllowlist, parsed.data.ticketId, "Ticket");
91
+ try {
92
+ return mapTicketGetResponse(await client.getTicket(parsed.data.ticketId, context.signal), config.includePii);
93
+ }
94
+ catch (error) {
95
+ throw mapError(error, options);
96
+ }
97
+ },
98
+ }),
99
+ defineTool({
100
+ name: FRESHDESK_TICKET_SEARCH_TOOL,
101
+ inputSchema: ticketSearchInputJsonSchema,
102
+ description: "Searches Freshdesk tickets with bounded query length.",
103
+ handler: async (input, context) => {
104
+ const parsed = ticketSearchInputSchema.safeParse(input);
105
+ if (!parsed.success)
106
+ throw invalidInputError();
107
+ const page = parsed.data.page ?? LIST_DEFAULT_PAGE;
108
+ try {
109
+ const raw = await client.searchTickets(parsed.data.query, page, context.signal);
110
+ const list = typeof raw === "object" &&
111
+ raw !== null &&
112
+ Array.isArray(raw.results)
113
+ ? raw.results
114
+ : [];
115
+ const filtered = filterByNumericAllowlist(ticketAllowlist, list, readTicketId);
116
+ return mapTicketListResponse({ tickets: filtered }, page, config.includePii);
117
+ }
118
+ catch (error) {
119
+ throw mapError(error, options);
120
+ }
121
+ },
122
+ }),
123
+ defineTool({
124
+ name: FRESHDESK_TICKET_CONVERSATION_LIST_TOOL,
125
+ inputSchema: ticketConversationListInputJsonSchema,
126
+ description: "Lists ticket conversations; customer-facing bodies redacted unless INCLUDE_PII.",
127
+ handler: async (input, context) => {
128
+ const parsed = ticketConversationListInputSchema.safeParse(input);
129
+ if (!parsed.success)
130
+ throw invalidInputError();
131
+ assertIdAllowed(ticketAllowlist, parsed.data.ticketId, "Ticket");
132
+ try {
133
+ const raw = await client.listTicketConversations(parsed.data.ticketId, context.signal);
134
+ return mapCommentListResponse(raw, config.includePii);
135
+ }
136
+ catch (error) {
137
+ throw mapError(error, options);
138
+ }
139
+ },
140
+ }),
141
+ defineTool({
142
+ name: FRESHDESK_CONTACT_LIST_TOOL,
143
+ inputSchema: contactListInputJsonSchema,
144
+ description: "Lists Freshdesk contacts.",
145
+ handler: async (input, context) => {
146
+ const parsed = contactListInputSchema.safeParse(input);
147
+ if (!parsed.success)
148
+ throw invalidInputError();
149
+ const page = parsed.data.page ?? LIST_DEFAULT_PAGE;
150
+ const perPage = parsed.data.perPage ?? LIST_DEFAULT_PER_PAGE;
151
+ try {
152
+ const raw = await client.listContacts({ page, perPage }, context.signal);
153
+ return {
154
+ contacts: Array.isArray(raw) ? raw : [],
155
+ untrustedContent: true,
156
+ };
157
+ }
158
+ catch (error) {
159
+ throw mapError(error, options);
160
+ }
161
+ },
162
+ }),
163
+ defineTool({
164
+ name: FRESHDESK_CONTACT_GET_TOOL,
165
+ inputSchema: contactGetInputJsonSchema,
166
+ description: "Returns one Freshdesk contact.",
167
+ handler: async (input, context) => {
168
+ const parsed = contactGetInputSchema.safeParse(input);
169
+ if (!parsed.success)
170
+ throw invalidInputError();
171
+ try {
172
+ return {
173
+ contact: await client.getContact(parsed.data.contactId, context.signal),
174
+ untrustedContent: true,
175
+ };
176
+ }
177
+ catch (error) {
178
+ throw mapError(error, options);
179
+ }
180
+ },
181
+ }),
182
+ defineTool({
183
+ name: FRESHDESK_TICKET_NOTE_ADD_TOOL,
184
+ inputSchema: ticketNoteAddInputJsonSchema,
185
+ description: "Adds a private note (not a customer reply). Requires NOTES_ENABLED and allowlist.",
186
+ handler: async (input, context) => {
187
+ assertNotesAllowed(config);
188
+ assertMutationAllowlistConfigured(ticketAllowlist, FRESHDESK_ALLOWED_RESOURCE_IDS_ENV);
189
+ const parsed = ticketNoteAddInputSchema.safeParse(input);
190
+ if (!parsed.success)
191
+ throw invalidInputError();
192
+ assertIdAllowed(ticketAllowlist, parsed.data.ticketId, "Ticket");
193
+ try {
194
+ await client.addPrivateNote(parsed.data.ticketId, buildFreshdeskPrivateNoteBody(parsed.data.body), context.signal);
195
+ return {
196
+ ticketId: parsed.data.ticketId,
197
+ created: true,
198
+ privateNote: true,
199
+ };
200
+ }
201
+ catch (error) {
202
+ throw mapError(error, options, true);
203
+ }
204
+ },
205
+ }),
206
+ defineTool({
207
+ name: FRESHDESK_TICKET_STATUS_SET_TOOL,
208
+ inputSchema: ticketStatusSetInputJsonSchema,
209
+ description: "Sets ticket status (open/pending/resolved or 2/3/4). Requires STATUS_ENABLED.",
210
+ handler: async (input, context) => {
211
+ assertStatusAllowed(config);
212
+ assertMutationAllowlistConfigured(ticketAllowlist, FRESHDESK_ALLOWED_RESOURCE_IDS_ENV);
213
+ const parsed = ticketStatusSetInputSchema.safeParse(input);
214
+ if (!parsed.success)
215
+ throw invalidInputError();
216
+ assertIdAllowed(ticketAllowlist, parsed.data.ticketId, "Ticket");
217
+ const body = buildFreshdeskStatusBody(parsed.data.status, config.allowedTargetStatuses);
218
+ try {
219
+ await client.setTicketStatus(parsed.data.ticketId, body, context.signal);
220
+ return { ticketId: parsed.data.ticketId, updated: true };
221
+ }
222
+ catch (error) {
223
+ throw mapError(error, options, true);
224
+ }
225
+ },
226
+ }),
227
+ ],
228
+ });
229
+ }
230
+ //# sourceMappingURL=connector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector.js","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,UAAU,GAEX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,kCAAkC,EAClC,0BAA0B,EAC1B,2BAA2B,EAC3B,uCAAuC,EACvC,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,4BAA4B,EAC5B,gCAAgC,EAChC,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,iCAAiC,EACjC,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,qCAAqC,EACrC,iCAAiC,EACjC,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAQ3B,SAAS,iBAAiB;IACxB,OAAO,IAAI,iBAAiB,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,QAAQ,CACf,KAAc,EACd,OAAw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AC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC;oBACpE,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,MAAM,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;oBACvC,CAAC;gBACH,CAAC;aACF,CAAC;SACH;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,43 @@
1
+ export declare const CONNECTOR_KEY = "osva-connector-freshdesk";
2
+ export declare const CONNECTOR_NAME = "OSVA Freshdesk Connector";
3
+ export declare const CONNECTOR_VERSION = "0.1.1";
4
+ export declare const FRESHDESK_TICKET_LIST_TOOL = "freshdesk.ticket.list";
5
+ export declare const FRESHDESK_TICKET_GET_TOOL = "freshdesk.ticket.get";
6
+ export declare const FRESHDESK_TICKET_SEARCH_TOOL = "freshdesk.ticket.search";
7
+ export declare const FRESHDESK_TICKET_CONVERSATION_LIST_TOOL = "freshdesk.ticket.conversation.list";
8
+ export declare const FRESHDESK_CONTACT_LIST_TOOL = "freshdesk.contact.list";
9
+ export declare const FRESHDESK_CONTACT_GET_TOOL = "freshdesk.contact.get";
10
+ export declare const FRESHDESK_TICKET_NOTE_ADD_TOOL = "freshdesk.ticket.note.add";
11
+ export declare const FRESHDESK_TICKET_STATUS_SET_TOOL = "freshdesk.ticket.status.set";
12
+ export declare const FRESHDESK_DOMAIN_ENV = "OSVA_CONNECTOR_FRESHDESK_DOMAIN";
13
+ export declare const FRESHDESK_API_KEY_ENV = "OSVA_CONNECTOR_FRESHDESK_API_KEY";
14
+ export declare const FRESHDESK_API_BASE_URL_ENV = "OSVA_CONNECTOR_FRESHDESK_API_BASE_URL";
15
+ export declare const FRESHDESK_ALLOWED_RESOURCE_IDS_ENV = "OSVA_CONNECTOR_FRESHDESK_ALLOWED_RESOURCE_IDS";
16
+ export declare const FRESHDESK_ALLOWED_TARGET_STATUSES_ENV = "OSVA_CONNECTOR_FRESHDESK_ALLOWED_TARGET_STATUSES";
17
+ export declare const FRESHDESK_NOTES_ENABLED_ENV = "OSVA_CONNECTOR_FRESHDESK_NOTES_ENABLED";
18
+ export declare const FRESHDESK_STATUS_ENABLED_ENV = "OSVA_CONNECTOR_FRESHDESK_STATUS_ENABLED";
19
+ export declare const FRESHDESK_HOST_WRITES_APPROVED_ENV = "OSVA_CONNECTOR_FRESHDESK_HOST_WRITES_APPROVED";
20
+ export declare const FRESHDESK_INCLUDE_PII_ENV = "OSVA_CONNECTOR_FRESHDESK_INCLUDE_PII";
21
+ export declare const FRESHDESK_ALLOW_TEST_API_HOST_ENV = "OSVA_CONNECTOR_FRESHDESK_ALLOW_TEST_API_HOST";
22
+ export declare const FRESHDESK_TIMEOUT_MS_ENV = "OSVA_CONNECTOR_FRESHDESK_TIMEOUT_MS";
23
+ export declare const PRODUCTION_API_HOST_SUFFIX = ".freshdesk.com";
24
+ export declare const DEFAULT_REQUEST_TIMEOUT_MS = 30000;
25
+ export declare const MIN_REQUEST_TIMEOUT_MS = 1000;
26
+ export declare const MAX_REQUEST_TIMEOUT_MS = 120000;
27
+ export declare const LIST_DEFAULT_PAGE = 1;
28
+ export declare const LIST_DEFAULT_PER_PAGE = 25;
29
+ export declare const LIST_MAX_PER_PAGE = 100;
30
+ export declare const MAX_PAGE_NUMBER = 250;
31
+ export declare const MAX_SEARCH_QUERY_LENGTH = 256;
32
+ export declare const MAX_RESOURCE_ID = 9007199254740991;
33
+ export declare const MAX_NOTE_BODY_LENGTH = 4096;
34
+ export declare const MAX_HTTP_RESPONSE_BYTES = 2097152;
35
+ export declare const MAX_HTTP_REQUEST_BODY_BYTES = 65536;
36
+ export declare const READ_ONLY_MAX_RETRIES = 1;
37
+ export declare const READ_ONLY_RETRY_DELAY_MS = 1000;
38
+ export declare const OUTPUT_MAX_SUBJECT_LENGTH = 512;
39
+ export declare const CONVERSATIONS_PREVIEW_MAX = 25;
40
+ export declare const FRESHDESK_STATUS_OPEN = 2;
41
+ export declare const FRESHDESK_STATUS_PENDING = 3;
42
+ export declare const FRESHDESK_STATUS_RESOLVED = 4;
43
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,6BAA6B,CAAC;AACxD,eAAO,MAAM,cAAc,6BAA6B,CAAC;AACzD,eAAO,MAAM,iBAAiB,UAAU,CAAC;AAEzC,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAClE,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAChE,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AACtE,eAAO,MAAM,uCAAuC,uCACd,CAAC;AACvC,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AACpE,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAClE,eAAO,MAAM,8BAA8B,8BAA8B,CAAC;AAC1E,eAAO,MAAM,gCAAgC,gCAAgC,CAAC;AAE9E,eAAO,MAAM,oBAAoB,oCAAoC,CAAC;AACtE,eAAO,MAAM,qBAAqB,qCAAqC,CAAC;AACxE,eAAO,MAAM,0BAA0B,0CACE,CAAC;AAC1C,eAAO,MAAM,kCAAkC,kDACE,CAAC;AAClD,eAAO,MAAM,qCAAqC,qDACE,CAAC;AACrD,eAAO,MAAM,2BAA2B,2CACE,CAAC;AAC3C,eAAO,MAAM,4BAA4B,4CACE,CAAC;AAC5C,eAAO,MAAM,kCAAkC,kDACE,CAAC;AAClD,eAAO,MAAM,yBAAyB,yCAAyC,CAAC;AAChF,eAAO,MAAM,iCAAiC,iDACE,CAAC;AACjD,eAAO,MAAM,wBAAwB,wCAAwC,CAAC;AAE9E,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAC3D,eAAO,MAAM,0BAA0B,QAAS,CAAC;AACjD,eAAO,MAAM,sBAAsB,OAAQ,CAAC;AAC5C,eAAO,MAAM,sBAAsB,SAAU,CAAC;AAC9C,eAAO,MAAM,iBAAiB,IAAI,C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