@keystrokehq/zendesk 0.0.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 (68) hide show
  1. package/README.md +188 -0
  2. package/dist/_official/index.d.mts +2 -0
  3. package/dist/_official/index.mjs +3 -0
  4. package/dist/_runtime/index.d.mts +1531 -0
  5. package/dist/_runtime/index.mjs +39 -0
  6. package/dist/chunk-DQk6qfdC.mjs +18 -0
  7. package/dist/client.d.mts +41 -0
  8. package/dist/client.mjs +137 -0
  9. package/dist/custom/connection.d.mts +2 -0
  10. package/dist/custom/connection.mjs +3 -0
  11. package/dist/custom/jobs.d.mts +8 -0
  12. package/dist/custom/jobs.mjs +8 -0
  13. package/dist/custom/organizations.d.mts +8 -0
  14. package/dist/custom/organizations.mjs +17 -0
  15. package/dist/custom/search.d.mts +8 -0
  16. package/dist/custom/search.mjs +11 -0
  17. package/dist/custom/tickets.d.mts +8 -0
  18. package/dist/custom/tickets.mjs +18 -0
  19. package/dist/custom/triggers.d.mts +2 -0
  20. package/dist/custom/triggers.mjs +3 -0
  21. package/dist/custom/users.d.mts +8 -0
  22. package/dist/custom/users.mjs +18 -0
  23. package/dist/custom.d.mts +7 -0
  24. package/dist/custom.mjs +8 -0
  25. package/dist/errors-BPAyL8gM.mjs +38 -0
  26. package/dist/events.d.mts +47 -0
  27. package/dist/events.mjs +58 -0
  28. package/dist/factory-BOeuadDj.mjs +9 -0
  29. package/dist/index.d.mts +1 -0
  30. package/dist/index.mjs +1 -0
  31. package/dist/integration-BGHdDCMn.mjs +83 -0
  32. package/dist/integration-BYDT8ccc.d.mts +98 -0
  33. package/dist/jobs-9tdPkCE1.d.mts +43 -0
  34. package/dist/jobs-BjDRvbsd.mjs +36 -0
  35. package/dist/messaging.d.mts +1 -0
  36. package/dist/messaging.mjs +1 -0
  37. package/dist/organizations-BHCFYHgM.mjs +277 -0
  38. package/dist/organizations-Ct_354Ea.d.mts +355 -0
  39. package/dist/platform/connection.d.mts +2 -0
  40. package/dist/platform/connection.mjs +3 -0
  41. package/dist/platform/jobs.d.mts +8 -0
  42. package/dist/platform/jobs.mjs +8 -0
  43. package/dist/platform/organizations.d.mts +8 -0
  44. package/dist/platform/organizations.mjs +17 -0
  45. package/dist/platform/search.d.mts +8 -0
  46. package/dist/platform/search.mjs +11 -0
  47. package/dist/platform/tickets.d.mts +8 -0
  48. package/dist/platform/tickets.mjs +18 -0
  49. package/dist/platform/triggers.d.mts +2 -0
  50. package/dist/platform/triggers.mjs +3 -0
  51. package/dist/platform/users.d.mts +8 -0
  52. package/dist/platform/users.mjs +18 -0
  53. package/dist/platform.d.mts +7 -0
  54. package/dist/platform.mjs +8 -0
  55. package/dist/schemas.d.mts +287 -0
  56. package/dist/schemas.mjs +101 -0
  57. package/dist/search-BpPJ9ccR.mjs +85 -0
  58. package/dist/search-CpISWBay.d.mts +83 -0
  59. package/dist/shared-BmxcJmfq.mjs +12 -0
  60. package/dist/tickets-BnTr_JO7.mjs +387 -0
  61. package/dist/tickets-DWxLBQOd.d.mts +633 -0
  62. package/dist/triggers-BIrYDGYF.d.mts +37 -0
  63. package/dist/triggers-ELU-gyey.mjs +107 -0
  64. package/dist/users-4ecCBdGw.d.mts +423 -0
  65. package/dist/users-BDj0GBC8.mjs +323 -0
  66. package/dist/verification.d.mts +9 -0
  67. package/dist/verification.mjs +41 -0
  68. package/package.json +172 -0
@@ -0,0 +1,98 @@
1
+ import * as _keystrokehq_integration_authoring_official0 from "@keystrokehq/integration-authoring/official";
2
+ import { z } from "zod";
3
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
4
+ import { CredentialSet } from "@keystrokehq/core";
5
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
6
+ import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
7
+
8
+ //#region src/_official/provider-app.d.ts
9
+ declare const zendeskPlatformAppCredentialSet: CredentialSet<"zendesk-platform-app", z.ZodObject<{
10
+ clientId: z.ZodString;
11
+ clientSecret: z.ZodString;
12
+ webhookSigningSecret: z.ZodString;
13
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
14
+ clientId: z.ZodString;
15
+ clientSecret: z.ZodString;
16
+ webhookSigningSecret: z.ZodString;
17
+ }, z.core.$strip>>[] | undefined>;
18
+ declare const zendeskPlatformProviderSeed: {
19
+ readonly provider: "zendesk";
20
+ readonly appRef: "zendesk-platform";
21
+ readonly displayName: "Zendesk Platform";
22
+ readonly credentialSetName: "Keystroke Zendesk Platform App";
23
+ readonly envShape: {
24
+ readonly KEYSTROKE_PLATFORM_ZENDESK_CLIENT_ID: z.ZodOptional<z.ZodString>;
25
+ readonly KEYSTROKE_PLATFORM_ZENDESK_CLIENT_SECRET: z.ZodOptional<z.ZodString>;
26
+ readonly KEYSTROKE_PLATFORM_ZENDESK_WEBHOOK_SIGNING_SECRET: z.ZodOptional<z.ZodString>;
27
+ };
28
+ readonly requiredEnvKeys: readonly ["KEYSTROKE_PLATFORM_ZENDESK_CLIENT_ID", "KEYSTROKE_PLATFORM_ZENDESK_CLIENT_SECRET", "KEYSTROKE_PLATFORM_ZENDESK_WEBHOOK_SIGNING_SECRET"];
29
+ readonly externalAppIdEnvKey: "KEYSTROKE_PLATFORM_ZENDESK_CLIENT_ID";
30
+ readonly buildCredentials: (env: Record<string, string | undefined>) => {
31
+ clientId: string | undefined;
32
+ clientSecret: string | undefined;
33
+ webhookSigningSecret: string | undefined;
34
+ };
35
+ };
36
+ //#endregion
37
+ //#region src/integration.d.ts
38
+ declare const zendeskPlatformOfficialIntegration: {
39
+ id: "zendesk-platform";
40
+ publicId: string;
41
+ name: string;
42
+ description: string;
43
+ auth: z.ZodObject<{
44
+ ZENDESK_ACCESS_TOKEN: z.ZodString;
45
+ ZENDESK_SUBDOMAIN: z.ZodString;
46
+ }, z.core.$strip>;
47
+ connections: {
48
+ id: string;
49
+ kind: "oauth";
50
+ tokenType: "refreshable";
51
+ authUrl: string;
52
+ tokenUrl: string;
53
+ revokeUrl: string;
54
+ scopes: string[];
55
+ vault: {
56
+ accessToken: "ZENDESK_ACCESS_TOKEN";
57
+ };
58
+ }[];
59
+ };
60
+ declare const zendeskCustomOfficialIntegration: {
61
+ id: "zendesk-custom";
62
+ name: string;
63
+ description: string;
64
+ auth: z.ZodObject<{
65
+ ZENDESK_SUBDOMAIN: z.ZodString;
66
+ ZENDESK_EMAIL: z.ZodEmail;
67
+ ZENDESK_API_TOKEN: z.ZodString;
68
+ }, z.core.$strip>;
69
+ };
70
+ declare const zendeskPlatformBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"zendesk-platform", z.ZodObject<{
71
+ ZENDESK_ACCESS_TOKEN: z.ZodString;
72
+ ZENDESK_SUBDOMAIN: z.ZodString;
73
+ }, z.core.$strip>>;
74
+ declare const zendeskCustomBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"zendesk-custom", z.ZodObject<{
75
+ ZENDESK_SUBDOMAIN: z.ZodString;
76
+ ZENDESK_EMAIL: z.ZodEmail;
77
+ ZENDESK_API_TOKEN: z.ZodString;
78
+ }, z.core.$strip>>;
79
+ declare const zendeskPlatform: _keystrokehq_core0.CredentialSet<"zendesk-platform", z.ZodObject<{
80
+ ZENDESK_ACCESS_TOKEN: z.ZodString;
81
+ ZENDESK_SUBDOMAIN: z.ZodString;
82
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
83
+ ZENDESK_ACCESS_TOKEN: z.ZodString;
84
+ ZENDESK_SUBDOMAIN: z.ZodString;
85
+ }, z.core.$strip>>[] | undefined>;
86
+ declare const zendeskCustom: _keystrokehq_core0.CredentialSet<"zendesk-custom", z.ZodObject<{
87
+ ZENDESK_SUBDOMAIN: z.ZodString;
88
+ ZENDESK_EMAIL: z.ZodEmail;
89
+ ZENDESK_API_TOKEN: z.ZodString;
90
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
91
+ ZENDESK_SUBDOMAIN: z.ZodString;
92
+ ZENDESK_EMAIL: z.ZodEmail;
93
+ ZENDESK_API_TOKEN: z.ZodString;
94
+ }, z.core.$strip>>[] | undefined>;
95
+ type ZendeskPlatformCredentials = InferCredentialSetAuth<typeof zendeskPlatform>;
96
+ type ZendeskCustomCredentials = InferCredentialSetAuth<typeof zendeskCustom>;
97
+ //#endregion
98
+ export { zendeskCustomOfficialIntegration as a, zendeskPlatformOfficialIntegration as c, zendeskCustomBundle as i, zendeskPlatformAppCredentialSet as l, ZendeskPlatformCredentials as n, zendeskPlatform as o, zendeskCustom as r, zendeskPlatformBundle as s, ZendeskCustomCredentials as t, zendeskPlatformProviderSeed as u };
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
3
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
+
5
+ //#region src/jobs.d.ts
6
+ declare const platformGetJobStatus: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ id: z.ZodString;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ id: z.ZodCoercedString<unknown>;
10
+ status: z.ZodString;
11
+ message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
+ progress: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
13
+ total: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
14
+ url: z.ZodOptional<z.ZodString>;
15
+ results: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>>;
16
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"zendesk-platform", z.ZodObject<{
17
+ ZENDESK_ACCESS_TOKEN: z.ZodString;
18
+ ZENDESK_SUBDOMAIN: z.ZodString;
19
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
20
+ ZENDESK_ACCESS_TOKEN: z.ZodString;
21
+ ZENDESK_SUBDOMAIN: z.ZodString;
22
+ }, z.core.$strip>>[] | undefined>], undefined>;
23
+ declare const customGetJobStatus: _keystrokehq_core0.Operation<z.ZodObject<{
24
+ id: z.ZodString;
25
+ }, z.core.$strip>, z.ZodObject<{
26
+ id: z.ZodCoercedString<unknown>;
27
+ status: z.ZodString;
28
+ message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ progress: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
30
+ total: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
31
+ url: z.ZodOptional<z.ZodString>;
32
+ results: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>]>>;
33
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"zendesk-custom", z.ZodObject<{
34
+ ZENDESK_SUBDOMAIN: z.ZodString;
35
+ ZENDESK_EMAIL: z.ZodEmail;
36
+ ZENDESK_API_TOKEN: z.ZodString;
37
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
38
+ ZENDESK_SUBDOMAIN: z.ZodString;
39
+ ZENDESK_EMAIL: z.ZodEmail;
40
+ ZENDESK_API_TOKEN: z.ZodString;
41
+ }, z.core.$strip>>[] | undefined>], undefined>;
42
+ //#endregion
43
+ export { platformGetJobStatus as n, customGetJobStatus as t };
@@ -0,0 +1,36 @@
1
+ import { zendeskJobStatusEnvelopeSchema, zendeskJobStatusSchema } from "./schemas.mjs";
2
+ import { n as zendeskPlatformOperation, t as zendeskCustomOperation } from "./factory-BOeuadDj.mjs";
3
+ import { n as createPlatformZendeskClient, t as createCustomZendeskClient } from "./shared-BmxcJmfq.mjs";
4
+ import { z } from "zod";
5
+
6
+ //#region src/jobs.ts
7
+ const getJobStatusInputSchema = z.object({ id: z.string().min(1) });
8
+ const platformGetJobStatus = zendeskPlatformOperation({
9
+ id: "get_job_status",
10
+ name: "Get Zendesk Job Status",
11
+ description: "Get the status of a Zendesk asynchronous job",
12
+ input: getJobStatusInputSchema,
13
+ output: zendeskJobStatusSchema,
14
+ run: async (input, credentials) => {
15
+ return (await createPlatformZendeskClient(credentials).get({
16
+ path: `/job_statuses/${input.id}.json`,
17
+ schema: zendeskJobStatusEnvelopeSchema
18
+ })).job_status;
19
+ }
20
+ });
21
+ const customGetJobStatus = zendeskCustomOperation({
22
+ id: "get_job_status",
23
+ name: "Get Zendesk Job Status",
24
+ description: "Get the status of a Zendesk asynchronous job",
25
+ input: getJobStatusInputSchema,
26
+ output: zendeskJobStatusSchema,
27
+ run: async (input, credentials) => {
28
+ return (await createCustomZendeskClient(credentials).get({
29
+ path: `/job_statuses/${input.id}.json`,
30
+ schema: zendeskJobStatusEnvelopeSchema
31
+ })).job_status;
32
+ }
33
+ });
34
+
35
+ //#endregion
36
+ export { platformGetJobStatus as n, customGetJobStatus as t };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,277 @@
1
+ import { zendeskBulkJobResponseSchema, zendeskOrganizationCountSchema, zendeskOrganizationEnvelopeSchema, zendeskOrganizationListResponseSchema, zendeskOrganizationSchema } from "./schemas.mjs";
2
+ import { n as zendeskPlatformOperation, t as zendeskCustomOperation } from "./factory-BOeuadDj.mjs";
3
+ import { n as createPlatformZendeskClient, t as createCustomZendeskClient } from "./shared-BmxcJmfq.mjs";
4
+ import { z } from "zod";
5
+
6
+ //#region src/organizations.ts
7
+ const listOrganizationsInputSchema = z.object({
8
+ page: z.number().int().positive().optional(),
9
+ perPage: z.number().int().positive().max(100).optional()
10
+ });
11
+ const getOrganizationInputSchema = z.object({ id: z.number().int().positive() });
12
+ const autocompleteOrganizationsInputSchema = z.object({ name: z.string().min(1) });
13
+ const organizationCreateInputSchema = z.object({
14
+ name: z.string().min(1),
15
+ externalId: z.string().optional(),
16
+ details: z.string().optional(),
17
+ notes: z.string().optional(),
18
+ sharedTickets: z.boolean().optional(),
19
+ sharedComments: z.boolean().optional()
20
+ });
21
+ const organizationUpdateInputSchema = z.object({
22
+ id: z.number().int().positive(),
23
+ name: z.string().min(1).optional(),
24
+ externalId: z.string().optional(),
25
+ details: z.string().optional(),
26
+ notes: z.string().optional(),
27
+ sharedTickets: z.boolean().optional(),
28
+ sharedComments: z.boolean().optional()
29
+ });
30
+ const createManyOrganizationsInputSchema = z.object({ organizations: z.array(organizationCreateInputSchema).min(1).max(100) });
31
+ function mapOrganizationInput(input) {
32
+ return {
33
+ ...input.name ? { name: input.name } : {},
34
+ ...input.externalId ? { external_id: input.externalId } : {},
35
+ ...input.details ? { details: input.details } : {},
36
+ ...input.notes ? { notes: input.notes } : {},
37
+ ...input.sharedTickets !== void 0 ? { shared_tickets: input.sharedTickets } : {},
38
+ ...input.sharedComments !== void 0 ? { shared_comments: input.sharedComments } : {}
39
+ };
40
+ }
41
+ const platformCountOrganizations = zendeskPlatformOperation({
42
+ id: "count_organizations",
43
+ name: "Count Zendesk Organizations",
44
+ description: "Count organizations in Zendesk Support",
45
+ input: z.object({}),
46
+ output: zendeskOrganizationCountSchema,
47
+ run: async (_input, credentials) => {
48
+ return createPlatformZendeskClient(credentials).get({
49
+ path: "/organizations/count.json",
50
+ schema: zendeskOrganizationCountSchema
51
+ });
52
+ }
53
+ });
54
+ const customCountOrganizations = zendeskCustomOperation({
55
+ id: "count_organizations",
56
+ name: "Count Zendesk Organizations",
57
+ description: "Count organizations in Zendesk Support",
58
+ input: z.object({}),
59
+ output: zendeskOrganizationCountSchema,
60
+ run: async (_input, credentials) => {
61
+ return createCustomZendeskClient(credentials).get({
62
+ path: "/organizations/count.json",
63
+ schema: zendeskOrganizationCountSchema
64
+ });
65
+ }
66
+ });
67
+ const platformListOrganizations = zendeskPlatformOperation({
68
+ id: "list_organizations",
69
+ name: "List Zendesk Organizations",
70
+ description: "List organizations from Zendesk Support",
71
+ input: listOrganizationsInputSchema,
72
+ output: zendeskOrganizationListResponseSchema,
73
+ run: async (input, credentials) => {
74
+ return createPlatformZendeskClient(credentials).get({
75
+ path: "/organizations.json",
76
+ query: {
77
+ page: input.page,
78
+ per_page: input.perPage
79
+ },
80
+ schema: zendeskOrganizationListResponseSchema
81
+ });
82
+ }
83
+ });
84
+ const customListOrganizations = zendeskCustomOperation({
85
+ id: "list_organizations",
86
+ name: "List Zendesk Organizations",
87
+ description: "List organizations from Zendesk Support",
88
+ input: listOrganizationsInputSchema,
89
+ output: zendeskOrganizationListResponseSchema,
90
+ run: async (input, credentials) => {
91
+ return createCustomZendeskClient(credentials).get({
92
+ path: "/organizations.json",
93
+ query: {
94
+ page: input.page,
95
+ per_page: input.perPage
96
+ },
97
+ schema: zendeskOrganizationListResponseSchema
98
+ });
99
+ }
100
+ });
101
+ const platformGetOrganization = zendeskPlatformOperation({
102
+ id: "get_organization",
103
+ name: "Get Zendesk Organization",
104
+ description: "Get a single Zendesk organization by ID",
105
+ input: getOrganizationInputSchema,
106
+ output: zendeskOrganizationSchema,
107
+ run: async (input, credentials) => {
108
+ return (await createPlatformZendeskClient(credentials).get({
109
+ path: `/organizations/${input.id}.json`,
110
+ schema: zendeskOrganizationEnvelopeSchema
111
+ })).organization;
112
+ }
113
+ });
114
+ const customGetOrganization = zendeskCustomOperation({
115
+ id: "get_organization",
116
+ name: "Get Zendesk Organization",
117
+ description: "Get a single Zendesk organization by ID",
118
+ input: getOrganizationInputSchema,
119
+ output: zendeskOrganizationSchema,
120
+ run: async (input, credentials) => {
121
+ return (await createCustomZendeskClient(credentials).get({
122
+ path: `/organizations/${input.id}.json`,
123
+ schema: zendeskOrganizationEnvelopeSchema
124
+ })).organization;
125
+ }
126
+ });
127
+ const platformAutocompleteOrganizations = zendeskPlatformOperation({
128
+ id: "autocomplete_organizations",
129
+ name: "Autocomplete Zendesk Organizations",
130
+ description: "Find Zendesk organizations by name prefix",
131
+ input: autocompleteOrganizationsInputSchema,
132
+ output: zendeskOrganizationListResponseSchema,
133
+ run: async (input, credentials) => {
134
+ return createPlatformZendeskClient(credentials).get({
135
+ path: "/organizations/autocomplete.json",
136
+ query: { name: input.name },
137
+ schema: zendeskOrganizationListResponseSchema
138
+ });
139
+ }
140
+ });
141
+ const customAutocompleteOrganizations = zendeskCustomOperation({
142
+ id: "autocomplete_organizations",
143
+ name: "Autocomplete Zendesk Organizations",
144
+ description: "Find Zendesk organizations by name prefix",
145
+ input: autocompleteOrganizationsInputSchema,
146
+ output: zendeskOrganizationListResponseSchema,
147
+ run: async (input, credentials) => {
148
+ return createCustomZendeskClient(credentials).get({
149
+ path: "/organizations/autocomplete.json",
150
+ query: { name: input.name },
151
+ schema: zendeskOrganizationListResponseSchema
152
+ });
153
+ }
154
+ });
155
+ const platformCreateOrganization = zendeskPlatformOperation({
156
+ id: "create_organization",
157
+ name: "Create Zendesk Organization",
158
+ description: "Create a new Zendesk organization",
159
+ input: organizationCreateInputSchema,
160
+ output: zendeskOrganizationSchema,
161
+ needsApproval: true,
162
+ run: async (input, credentials) => {
163
+ return (await createPlatformZendeskClient(credentials).post({
164
+ path: "/organizations.json",
165
+ body: { organization: mapOrganizationInput(input) },
166
+ schema: zendeskOrganizationEnvelopeSchema
167
+ })).organization;
168
+ }
169
+ });
170
+ const customCreateOrganization = zendeskCustomOperation({
171
+ id: "create_organization",
172
+ name: "Create Zendesk Organization",
173
+ description: "Create a new Zendesk organization",
174
+ input: organizationCreateInputSchema,
175
+ output: zendeskOrganizationSchema,
176
+ needsApproval: true,
177
+ run: async (input, credentials) => {
178
+ return (await createCustomZendeskClient(credentials).post({
179
+ path: "/organizations.json",
180
+ body: { organization: mapOrganizationInput(input) },
181
+ schema: zendeskOrganizationEnvelopeSchema
182
+ })).organization;
183
+ }
184
+ });
185
+ const platformUpdateOrganization = zendeskPlatformOperation({
186
+ id: "update_organization",
187
+ name: "Update Zendesk Organization",
188
+ description: "Update an existing Zendesk organization",
189
+ input: organizationUpdateInputSchema,
190
+ output: zendeskOrganizationSchema,
191
+ needsApproval: true,
192
+ run: async (input, credentials) => {
193
+ return (await createPlatformZendeskClient(credentials).put({
194
+ path: `/organizations/${input.id}.json`,
195
+ body: { organization: mapOrganizationInput(input) },
196
+ schema: zendeskOrganizationEnvelopeSchema
197
+ })).organization;
198
+ }
199
+ });
200
+ const customUpdateOrganization = zendeskCustomOperation({
201
+ id: "update_organization",
202
+ name: "Update Zendesk Organization",
203
+ description: "Update an existing Zendesk organization",
204
+ input: organizationUpdateInputSchema,
205
+ output: zendeskOrganizationSchema,
206
+ needsApproval: true,
207
+ run: async (input, credentials) => {
208
+ return (await createCustomZendeskClient(credentials).put({
209
+ path: `/organizations/${input.id}.json`,
210
+ body: { organization: mapOrganizationInput(input) },
211
+ schema: zendeskOrganizationEnvelopeSchema
212
+ })).organization;
213
+ }
214
+ });
215
+ const platformDeleteOrganization = zendeskPlatformOperation({
216
+ id: "delete_organization",
217
+ name: "Delete Zendesk Organization",
218
+ description: "Delete a Zendesk organization",
219
+ input: getOrganizationInputSchema,
220
+ output: z.object({ success: z.boolean() }),
221
+ needsApproval: true,
222
+ run: async (input, credentials) => {
223
+ await createPlatformZendeskClient(credentials).delete({
224
+ path: `/organizations/${input.id}.json`,
225
+ schema: z.object({})
226
+ });
227
+ return { success: true };
228
+ }
229
+ });
230
+ const customDeleteOrganization = zendeskCustomOperation({
231
+ id: "delete_organization",
232
+ name: "Delete Zendesk Organization",
233
+ description: "Delete a Zendesk organization",
234
+ input: getOrganizationInputSchema,
235
+ output: z.object({ success: z.boolean() }),
236
+ needsApproval: true,
237
+ run: async (input, credentials) => {
238
+ await createCustomZendeskClient(credentials).delete({
239
+ path: `/organizations/${input.id}.json`,
240
+ schema: z.object({})
241
+ });
242
+ return { success: true };
243
+ }
244
+ });
245
+ const platformCreateManyOrganizations = zendeskPlatformOperation({
246
+ id: "create_many_organizations",
247
+ name: "Create Many Zendesk Organizations",
248
+ description: "Create multiple Zendesk organizations asynchronously",
249
+ input: createManyOrganizationsInputSchema,
250
+ output: zendeskBulkJobResponseSchema,
251
+ needsApproval: true,
252
+ run: async (input, credentials) => {
253
+ return createPlatformZendeskClient(credentials).post({
254
+ path: "/organizations/create_many.json",
255
+ body: { organizations: input.organizations.map(mapOrganizationInput) },
256
+ schema: zendeskBulkJobResponseSchema
257
+ });
258
+ }
259
+ });
260
+ const customCreateManyOrganizations = zendeskCustomOperation({
261
+ id: "create_many_organizations",
262
+ name: "Create Many Zendesk Organizations",
263
+ description: "Create multiple Zendesk organizations asynchronously",
264
+ input: createManyOrganizationsInputSchema,
265
+ output: zendeskBulkJobResponseSchema,
266
+ needsApproval: true,
267
+ run: async (input, credentials) => {
268
+ return createCustomZendeskClient(credentials).post({
269
+ path: "/organizations/create_many.json",
270
+ body: { organizations: input.organizations.map(mapOrganizationInput) },
271
+ schema: zendeskBulkJobResponseSchema
272
+ });
273
+ }
274
+ });
275
+
276
+ //#endregion
277
+ export { customDeleteOrganization as a, customUpdateOrganization as c, platformCreateManyOrganizations as d, platformCreateOrganization as f, platformUpdateOrganization as g, platformListOrganizations as h, customCreateOrganization as i, platformAutocompleteOrganizations as l, platformGetOrganization as m, customCountOrganizations as n, customGetOrganization as o, platformDeleteOrganization as p, customCreateManyOrganizations as r, customListOrganizations as s, customAutocompleteOrganizations as t, platformCountOrganizations as u };