@livechat/developer-studio-api 3.4.5 → 3.4.6

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/dist/index.mjs CHANGED
@@ -1997,7 +1997,14 @@ function initBillingClient(baseUrl, token) {
1997
1997
  }
1998
1998
  }
1999
1999
 
2000
- // src/apis/platform/adapter/integrations/_contracts/dtos/flow.ts
2000
+ // src/apis/platform/adapter/integrations/_contracts/dtos/flows.ts
2001
+ var IntegrationModes = /* @__PURE__ */ ((IntegrationModes2) => {
2002
+ IntegrationModes2["Redirect"] = "redirect";
2003
+ IntegrationModes2["Modal"] = "modal";
2004
+ return IntegrationModes2;
2005
+ })(IntegrationModes || {});
2006
+
2007
+ // src/apis/platform/adapter/integrations/_contracts/dtos/names.ts
2001
2008
  var IntegrationNames = /* @__PURE__ */ ((IntegrationNames2) => {
2002
2009
  IntegrationNames2["Accounts"] = "accounts";
2003
2010
  IntegrationNames2["GitHub"] = "github";
@@ -2009,8 +2016,10 @@ var IntegrationNames = /* @__PURE__ */ ((IntegrationNames2) => {
2009
2016
  IntegrationNames2["Shopify"] = "shopify";
2010
2017
  IntegrationNames2["HubSpot"] = "hubspot";
2011
2018
  IntegrationNames2["BigCommerce"] = "bigcommerce";
2012
- IntegrationNames2["Text"] = "text";
2013
2019
  IntegrationNames2["OpenAI"] = "openai";
2020
+ IntegrationNames2["Text"] = "text";
2021
+ IntegrationNames2["LiveChat"] = "text-livechat";
2022
+ IntegrationNames2["HelpDesk"] = "text-helpdesk";
2014
2023
  return IntegrationNames2;
2015
2024
  })(IntegrationNames || {});
2016
2025
  var IntegrationDisplayNames = /* @__PURE__ */ ((IntegrationDisplayNames2) => {
@@ -2024,29 +2033,24 @@ var IntegrationDisplayNames = /* @__PURE__ */ ((IntegrationDisplayNames2) => {
2024
2033
  IntegrationDisplayNames2["Shopify"] = "Shopify";
2025
2034
  IntegrationDisplayNames2["HubSpot"] = "Hubspot";
2026
2035
  IntegrationDisplayNames2["BigCommerce"] = "BigCommerce";
2027
- IntegrationDisplayNames2["Text"] = "Text";
2028
2036
  IntegrationDisplayNames2["OpenAI"] = "OpenAI";
2037
+ IntegrationDisplayNames2["Text"] = "Text";
2038
+ IntegrationDisplayNames2["LiveChat"] = "LiveChat";
2039
+ IntegrationDisplayNames2["HelpDesk"] = "HelpDesk";
2029
2040
  return IntegrationDisplayNames2;
2030
2041
  })(IntegrationDisplayNames || {});
2031
- var IntegrationModes = /* @__PURE__ */ ((IntegrationModes2) => {
2032
- IntegrationModes2["Redirect"] = "redirect";
2033
- IntegrationModes2["Modal"] = "modal";
2034
- return IntegrationModes2;
2035
- })(IntegrationModes || {});
2036
2042
 
2037
2043
  // src/apis/platform/adapter/integrations/_contracts/requests/events.ts
2038
- import { z as z6 } from "zod";
2044
+ import { z as z7 } from "zod";
2039
2045
 
2040
- // src/apis/platform/adapter/integrations/shopify/_contracts/dtos/events.ts
2046
+ // src/apis/platform/adapter/integrations/shopify/_contracts/requests/events.ts
2047
+ import { z } from "zod";
2041
2048
  var ShopifyEventNames = /* @__PURE__ */ ((ShopifyEventNames2) => {
2042
2049
  ShopifyEventNames2["OrderCreated"] = "order_created";
2043
2050
  return ShopifyEventNames2;
2044
2051
  })(ShopifyEventNames || {});
2045
-
2046
- // src/apis/platform/adapter/integrations/shopify/_contracts/requests/events.ts
2047
- import { z } from "zod";
2048
2052
  var shopifyEventsZods = {
2049
- provider: z.literal("shopify"),
2053
+ provider: z.literal("shopify" /* Shopify */),
2050
2054
  eventName: z.nativeEnum(ShopifyEventNames),
2051
2055
  events: {
2052
2056
  orderCreated: z.object({
@@ -2094,17 +2098,13 @@ var shopifyEventsZods = {
2094
2098
 
2095
2099
  // src/apis/platform/adapter/integrations/mailchimp/_contracts/requests/events.ts
2096
2100
  import { z as z2 } from "zod";
2097
-
2098
- // src/apis/platform/adapter/integrations/mailchimp/_contracts/dtos/events.ts
2099
2101
  var MailchimpEventNames = /* @__PURE__ */ ((MailchimpEventNames2) => {
2100
2102
  MailchimpEventNames2["Subscribed"] = "subscribed";
2101
2103
  MailchimpEventNames2["Unsubscribed"] = "unsubscribed";
2102
2104
  return MailchimpEventNames2;
2103
2105
  })(MailchimpEventNames || {});
2104
-
2105
- // src/apis/platform/adapter/integrations/mailchimp/_contracts/requests/events.ts
2106
2106
  var mailchimpEventsZods = {
2107
- provider: z2.literal("mailchimp"),
2107
+ provider: z2.literal("mailchimp" /* Mailchimp */),
2108
2108
  eventName: z2.nativeEnum(MailchimpEventNames),
2109
2109
  events: {
2110
2110
  subscribed: z2.object({
@@ -2158,7 +2158,8 @@ var mailchimpEventsZods = {
2158
2158
  }
2159
2159
  };
2160
2160
 
2161
- // src/apis/platform/adapter/integrations/text/_contracts/dtos/events.ts
2161
+ // src/apis/platform/adapter/integrations/text/_contracts/requests/events/livechat.ts
2162
+ import { z as z3 } from "zod";
2162
2163
  var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
2163
2164
  TextLivechatEventNames2["ChatStarted"] = "chat_started";
2164
2165
  TextLivechatEventNames2["ChatEnded"] = "chat_ended";
@@ -2171,11 +2172,8 @@ var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
2171
2172
  TextLivechatEventNames2["UserRemovedFromChat"] = "user_removed_from_chat";
2172
2173
  return TextLivechatEventNames2;
2173
2174
  })(TextLivechatEventNames || {});
2174
-
2175
- // src/apis/platform/adapter/integrations/text/_contracts/requests/events.ts
2176
- import { z as z3 } from "zod";
2177
2175
  var textLivechatEventsZods = {
2178
- provider: z3.literal("text-livechat"),
2176
+ provider: z3.literal("text-livechat" /* LiveChat */),
2179
2177
  eventName: z3.nativeEnum(TextLivechatEventNames),
2180
2178
  events: {
2181
2179
  chatStarted: z3.object({
@@ -2260,32 +2258,58 @@ var textLivechatEventsZods = {
2260
2258
  }
2261
2259
  };
2262
2260
 
2263
- // src/apis/platform/adapter/integrations/hubspot/_contracts/requests/events.ts
2261
+ // src/apis/platform/adapter/integrations/text/_contracts/requests/events/helpdesk.ts
2264
2262
  import { z as z4 } from "zod";
2265
-
2266
- // src/apis/platform/adapter/integrations/hubspot/_contracts/dtos/events.ts
2267
- var HubspotEventNames = /* @__PURE__ */ ((HubspotEventNames2) => {
2268
- HubspotEventNames2["ContactCreated"] = "contact_created";
2269
- HubspotEventNames2["ContactDeleted"] = "contact_deleted";
2270
- return HubspotEventNames2;
2271
- })(HubspotEventNames || {});
2272
-
2273
- // src/apis/platform/adapter/integrations/hubspot/_contracts/requests/events.ts
2274
- var hubspotEventsZods = {
2275
- provider: z4.literal("hubspot"),
2276
- eventName: z4.nativeEnum(HubspotEventNames),
2263
+ var TextHelpDeskEventNames = /* @__PURE__ */ ((TextHelpDeskEventNames2) => {
2264
+ TextHelpDeskEventNames2["TicketCreated"] = "ticket_created";
2265
+ TextHelpDeskEventNames2["TicketUpdated"] = "ticket_updated";
2266
+ TextHelpDeskEventNames2["TicketStatusChanged"] = "ticket_status_changed";
2267
+ TextHelpDeskEventNames2["TicketPriorityChanged"] = "ticket_priority_changed";
2268
+ TextHelpDeskEventNames2["TicketTagsChanged"] = "ticket_tags_added";
2269
+ TextHelpDeskEventNames2["TicketFollowersChanged"] = "ticket_followers_added";
2270
+ TextHelpDeskEventNames2["TicketAssignmentChanged"] = "ticket_assignment_added";
2271
+ TextHelpDeskEventNames2["TicketMessageAdded"] = "ticket_message_added";
2272
+ return TextHelpDeskEventNames2;
2273
+ })(TextHelpDeskEventNames || {});
2274
+ var textHelpDeskEventsZods = {
2275
+ provider: z4.literal("text-helpdesk" /* HelpDesk */),
2276
+ eventName: z4.nativeEnum(TextHelpDeskEventNames),
2277
2277
  events: {
2278
- contactCreated: z4.object({
2279
- name: z4.literal("contact_created" /* ContactCreated */)
2278
+ ticketCreated: z4.object({
2279
+ name: z4.literal("ticket_created" /* TicketCreated */)
2280
+ }),
2281
+ ticketUpdated: z4.object({
2282
+ name: z4.literal("ticket_updated" /* TicketUpdated */)
2283
+ }),
2284
+ ticketStatusChanged: z4.object({
2285
+ name: z4.literal("ticket_status_changed" /* TicketStatusChanged */)
2286
+ }),
2287
+ ticketPriorityChanged: z4.object({
2288
+ name: z4.literal("ticket_priority_changed" /* TicketPriorityChanged */)
2289
+ }),
2290
+ ticketTagsChanged: z4.object({
2291
+ name: z4.literal("ticket_tags_added" /* TicketTagsChanged */)
2292
+ }),
2293
+ ticketFollowersChanged: z4.object({
2294
+ name: z4.literal("ticket_followers_added" /* TicketFollowersChanged */)
2295
+ }),
2296
+ ticketAssignmentChanged: z4.object({
2297
+ name: z4.literal("ticket_assignment_added" /* TicketAssignmentChanged */)
2280
2298
  }),
2281
- contactDeleted: z4.object({
2282
- name: z4.literal("contact_deleted" /* ContactDeleted */)
2299
+ ticketMessageAdded: z4.object({
2300
+ name: z4.literal("ticket_message_added" /* TicketMessageAdded */)
2283
2301
  })
2284
2302
  },
2285
2303
  get event() {
2286
2304
  return z4.discriminatedUnion("name", [
2287
- this.events.contactCreated,
2288
- this.events.contactDeleted
2305
+ this.events.ticketCreated,
2306
+ this.events.ticketUpdated,
2307
+ this.events.ticketStatusChanged,
2308
+ this.events.ticketPriorityChanged,
2309
+ this.events.ticketTagsChanged,
2310
+ this.events.ticketFollowersChanged,
2311
+ this.events.ticketAssignmentChanged,
2312
+ this.events.ticketMessageAdded
2289
2313
  ]);
2290
2314
  },
2291
2315
  get source() {
@@ -2324,10 +2348,68 @@ var hubspotEventsZods = {
2324
2348
  }
2325
2349
  };
2326
2350
 
2327
- // src/apis/platform/adapter/integrations/bigcommerce/_contracts/requests/events.ts
2351
+ // src/apis/platform/adapter/integrations/hubspot/_contracts/requests/events.ts
2328
2352
  import { z as z5 } from "zod";
2353
+ var HubspotEventNames = /* @__PURE__ */ ((HubspotEventNames2) => {
2354
+ HubspotEventNames2["ContactCreated"] = "contact_created";
2355
+ HubspotEventNames2["ContactDeleted"] = "contact_deleted";
2356
+ return HubspotEventNames2;
2357
+ })(HubspotEventNames || {});
2358
+ var hubspotEventsZods = {
2359
+ provider: z5.literal("hubspot" /* HubSpot */),
2360
+ eventName: z5.nativeEnum(HubspotEventNames),
2361
+ events: {
2362
+ contactCreated: z5.object({
2363
+ name: z5.literal("contact_created" /* ContactCreated */)
2364
+ }),
2365
+ contactDeleted: z5.object({
2366
+ name: z5.literal("contact_deleted" /* ContactDeleted */)
2367
+ })
2368
+ },
2369
+ get event() {
2370
+ return z5.discriminatedUnion("name", [
2371
+ this.events.contactCreated,
2372
+ this.events.contactDeleted
2373
+ ]);
2374
+ },
2375
+ get source() {
2376
+ return z5.object({
2377
+ sourceName: z5.enum(["apps", "workflows"]),
2378
+ sourceKey: z5.string()
2379
+ });
2380
+ },
2381
+ get subscribe() {
2382
+ return this.source.and(
2383
+ z5.object({
2384
+ event: this.event,
2385
+ callback: z5.string()
2386
+ })
2387
+ );
2388
+ },
2389
+ get subscribeContent() {
2390
+ return z5.object({
2391
+ provider: this.provider,
2392
+ event: this.event,
2393
+ callback: z5.string()
2394
+ });
2395
+ },
2396
+ get unsubscribe() {
2397
+ return this.source.and(
2398
+ z5.object({
2399
+ event: this.event
2400
+ })
2401
+ );
2402
+ },
2403
+ get unsubscribeContent() {
2404
+ return z5.object({
2405
+ provider: this.provider,
2406
+ event: this.event
2407
+ });
2408
+ }
2409
+ };
2329
2410
 
2330
- // src/apis/platform/adapter/integrations/bigcommerce/_contracts/dtos/events.ts
2411
+ // src/apis/platform/adapter/integrations/bigcommerce/_contracts/requests/events.ts
2412
+ import { z as z6 } from "zod";
2331
2413
  var BigCommerceEventNames = /* @__PURE__ */ ((BigCommerceEventNames2) => {
2332
2414
  BigCommerceEventNames2["CartCreated"] = "cart_created";
2333
2415
  BigCommerceEventNames2["CartUpdated"] = "cart_updated";
@@ -2337,33 +2419,31 @@ var BigCommerceEventNames = /* @__PURE__ */ ((BigCommerceEventNames2) => {
2337
2419
  BigCommerceEventNames2["ProductUpdated"] = "product_updated";
2338
2420
  return BigCommerceEventNames2;
2339
2421
  })(BigCommerceEventNames || {});
2340
-
2341
- // src/apis/platform/adapter/integrations/bigcommerce/_contracts/requests/events.ts
2342
2422
  var bigcommerceEventsZods = {
2343
- provider: z5.literal("bigcommerce"),
2344
- eventName: z5.nativeEnum(BigCommerceEventNames),
2423
+ provider: z6.literal("bigcommerce" /* BigCommerce */),
2424
+ eventName: z6.nativeEnum(BigCommerceEventNames),
2345
2425
  events: {
2346
- cartCreated: z5.object({
2347
- name: z5.literal("cart_created" /* CartCreated */)
2426
+ cartCreated: z6.object({
2427
+ name: z6.literal("cart_created" /* CartCreated */)
2348
2428
  }),
2349
- cartUpdated: z5.object({
2350
- name: z5.literal("cart_updated" /* CartUpdated */)
2429
+ cartUpdated: z6.object({
2430
+ name: z6.literal("cart_updated" /* CartUpdated */)
2351
2431
  }),
2352
- orderCreated: z5.object({
2353
- name: z5.literal("order_created" /* OrderCreated */)
2432
+ orderCreated: z6.object({
2433
+ name: z6.literal("order_created" /* OrderCreated */)
2354
2434
  }),
2355
- orderUpdated: z5.object({
2356
- name: z5.literal("order_updated" /* OrderUpdated */)
2435
+ orderUpdated: z6.object({
2436
+ name: z6.literal("order_updated" /* OrderUpdated */)
2357
2437
  }),
2358
- productCreated: z5.object({
2359
- name: z5.literal("product_created" /* ProductCreated */)
2438
+ productCreated: z6.object({
2439
+ name: z6.literal("product_created" /* ProductCreated */)
2360
2440
  }),
2361
- productUpdated: z5.object({
2362
- name: z5.literal("product_updated" /* ProductUpdated */)
2441
+ productUpdated: z6.object({
2442
+ name: z6.literal("product_updated" /* ProductUpdated */)
2363
2443
  })
2364
2444
  },
2365
2445
  get event() {
2366
- return z5.discriminatedUnion("name", [
2446
+ return z6.discriminatedUnion("name", [
2367
2447
  this.events.cartCreated,
2368
2448
  this.events.cartUpdated,
2369
2449
  this.events.orderCreated,
@@ -2373,35 +2453,35 @@ var bigcommerceEventsZods = {
2373
2453
  ]);
2374
2454
  },
2375
2455
  get source() {
2376
- return z5.object({
2377
- sourceName: z5.enum(["apps", "workflows"]),
2378
- sourceKey: z5.string()
2456
+ return z6.object({
2457
+ sourceName: z6.enum(["apps", "workflows"]),
2458
+ sourceKey: z6.string()
2379
2459
  });
2380
2460
  },
2381
2461
  get subscribe() {
2382
2462
  return this.source.and(
2383
- z5.object({
2463
+ z6.object({
2384
2464
  event: this.event,
2385
- callback: z5.string()
2465
+ callback: z6.string()
2386
2466
  })
2387
2467
  );
2388
2468
  },
2389
2469
  get subscribeContent() {
2390
- return z5.object({
2470
+ return z6.object({
2391
2471
  provider: this.provider,
2392
2472
  event: this.event,
2393
- callback: z5.string()
2473
+ callback: z6.string()
2394
2474
  });
2395
2475
  },
2396
2476
  get unsubscribe() {
2397
2477
  return this.source.and(
2398
- z5.object({
2478
+ z6.object({
2399
2479
  event: this.event
2400
2480
  })
2401
2481
  );
2402
2482
  },
2403
2483
  get unsubscribeContent() {
2404
- return z5.object({
2484
+ return z6.object({
2405
2485
  provider: this.provider,
2406
2486
  event: this.event
2407
2487
  });
@@ -2410,27 +2490,29 @@ var bigcommerceEventsZods = {
2410
2490
 
2411
2491
  // src/apis/platform/adapter/integrations/_contracts/requests/events.ts
2412
2492
  var integrationEventsZods = {
2413
- sourceName: z6.enum(["apps", "workflows"]),
2414
- providerName: z6.enum([
2415
- "text-livechat",
2416
- "mailchimp",
2417
- "shopify",
2418
- "hubspot",
2419
- "bigcommerce"
2493
+ sourceName: z7.enum(["apps", "workflows"]),
2494
+ providerName: z7.enum([
2495
+ "text-livechat" /* LiveChat */,
2496
+ "text-helpdesk" /* HelpDesk */,
2497
+ "mailchimp" /* Mailchimp */,
2498
+ "shopify" /* Shopify */,
2499
+ "hubspot" /* HubSpot */,
2500
+ "bigcommerce" /* BigCommerce */
2420
2501
  ]),
2421
2502
  get event() {
2422
- return textLivechatEventsZods.event.or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event).or(bigcommerceEventsZods.event);
2503
+ return textLivechatEventsZods.event.or(textHelpDeskEventsZods.event).or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event).or(bigcommerceEventsZods.event);
2423
2504
  },
2424
2505
  get source() {
2425
- return z6.object({
2506
+ return z7.object({
2426
2507
  sourceName: this.sourceName,
2427
- sourceKey: z6.string()
2508
+ sourceKey: z7.string()
2428
2509
  });
2429
2510
  },
2430
2511
  get subscribe() {
2431
2512
  return this.source.and(
2432
- z6.discriminatedUnion("provider", [
2513
+ z7.discriminatedUnion("provider", [
2433
2514
  textLivechatEventsZods.subscribeContent,
2515
+ textHelpDeskEventsZods.subscribeContent,
2434
2516
  shopifyEventsZods.subscribeContent,
2435
2517
  mailchimpEventsZods.subscribeContent,
2436
2518
  hubspotEventsZods.subscribeContent,
@@ -2440,8 +2522,9 @@ var integrationEventsZods = {
2440
2522
  },
2441
2523
  get unsubscribe() {
2442
2524
  return this.source.and(
2443
- z6.discriminatedUnion("provider", [
2525
+ z7.discriminatedUnion("provider", [
2444
2526
  textLivechatEventsZods.unsubscribeContent,
2527
+ textHelpDeskEventsZods.unsubscribeContent,
2445
2528
  shopifyEventsZods.unsubscribeContent,
2446
2529
  mailchimpEventsZods.unsubscribeContent,
2447
2530
  hubspotEventsZods.unsubscribeContent,
@@ -2763,6 +2846,75 @@ function initDpsClient(baseUrl, token) {
2763
2846
  }
2764
2847
  }
2765
2848
 
2849
+ // src/apis/products/helpdesk/webhooks/_contracts/dtos/webhook.ts
2850
+ var HelpDeskWebhookEventType = /* @__PURE__ */ ((HelpDeskWebhookEventType2) => {
2851
+ HelpDeskWebhookEventType2["TicketCreated"] = "tickets.create";
2852
+ HelpDeskWebhookEventType2["TicketUpdated"] = "tickets.update";
2853
+ HelpDeskWebhookEventType2["TicketStatusChanged"] = "tickets.events.status";
2854
+ HelpDeskWebhookEventType2["TicketPriorityChanged"] = "tickets.events.priority";
2855
+ HelpDeskWebhookEventType2["TicketTagsChanged"] = "tickets.events.tags";
2856
+ HelpDeskWebhookEventType2["TicketFollowersChanged"] = "tickets.events.followers";
2857
+ HelpDeskWebhookEventType2["TicketAssignmentChanged"] = "tickets.events.assignment";
2858
+ HelpDeskWebhookEventType2["TicketMessageAdded"] = "tickets.events.message";
2859
+ return HelpDeskWebhookEventType2;
2860
+ })(HelpDeskWebhookEventType || {});
2861
+
2862
+ // src/apis/products/helpdesk/instance.ts
2863
+ import axios17 from "axios";
2864
+ var HelpDeskApiError = class extends ApiErrorBase {
2865
+ constructor() {
2866
+ super(...arguments);
2867
+ this.name = "helpdesk";
2868
+ }
2869
+ };
2870
+ var helpdeskClientInstance = axios17.create({
2871
+ baseURL: "https://api.labs.helpdesk.com/v1"
2872
+ });
2873
+ helpdeskClientInstance.interceptors.response.use(
2874
+ (response) => response,
2875
+ (error) => {
2876
+ var _a, _b, _c, _d;
2877
+ if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
2878
+ return Promise.reject(new UnauthorizeApiError("accounts"));
2879
+ }
2880
+ return Promise.reject(
2881
+ new HelpDeskApiError(
2882
+ error.message,
2883
+ (_b = error.response) == null ? void 0 : _b.data,
2884
+ (_d = (_c = error.response) == null ? void 0 : _c.status) != null ? _d : 400
2885
+ )
2886
+ );
2887
+ }
2888
+ );
2889
+ function getHelpDeskClientConfig(options = {}) {
2890
+ var _a, _b;
2891
+ const currentHeaders = helpdeskClientInstance.defaults.headers;
2892
+ const defaultAuthorization = currentHeaders.Authorization;
2893
+ const headers = {
2894
+ authorization: (_b = options.token ? `${(_a = options.tokenType) != null ? _a : "Bearer"} ${options.token}` : void 0) != null ? _b : defaultAuthorization
2895
+ };
2896
+ return {
2897
+ headers: __spreadValues({}, headers.authorization ? { Authorization: headers.authorization } : {})
2898
+ };
2899
+ }
2900
+ function initHelpDeskClient(baseUrl, token) {
2901
+ const headers = helpdeskClientInstance.defaults.headers;
2902
+ if (baseUrl) {
2903
+ helpdeskClientInstance.interceptors.request.use(
2904
+ (config) => {
2905
+ config.baseURL = baseUrl;
2906
+ return config;
2907
+ },
2908
+ (error) => Promise.reject(error)
2909
+ );
2910
+ }
2911
+ if (token) {
2912
+ headers.Authorization = `Bearer ${token}`;
2913
+ } else {
2914
+ delete headers.Authorization;
2915
+ }
2916
+ }
2917
+
2766
2918
  // src/apis/products/livechat/configuration/webhooks/_contracts/dtos/webhook.ts
2767
2919
  var LivechatWebhookActions = /* @__PURE__ */ ((LivechatWebhookActions2) => {
2768
2920
  LivechatWebhookActions2["IncomingChat"] = "incoming_chat";
@@ -2790,7 +2942,7 @@ var LivechatWebhookSystemMessages = /* @__PURE__ */ ((LivechatWebhookSystemMessa
2790
2942
  })(LivechatWebhookSystemMessages || {});
2791
2943
 
2792
2944
  // src/apis/products/livechat/instance.ts
2793
- import axios17 from "axios";
2945
+ import axios18 from "axios";
2794
2946
  var REGION2 = {
2795
2947
  FRA: "fra",
2796
2948
  DAL: "dal",
@@ -2810,7 +2962,7 @@ var LivechatApiError = class extends ApiErrorBase {
2810
2962
  this.name = "livechat";
2811
2963
  }
2812
2964
  };
2813
- var livechatClientInstance = axios17.create({
2965
+ var livechatClientInstance = axios18.create({
2814
2966
  baseURL: "https://api.labs.livechatinc.com"
2815
2967
  });
2816
2968
  livechatClientInstance.interceptors.response.use(
@@ -3450,7 +3602,7 @@ var textApi = {
3450
3602
  };
3451
3603
 
3452
3604
  // src/apis/integrations/vercel/api.ts
3453
- import axios18 from "axios";
3605
+ import axios19 from "axios";
3454
3606
 
3455
3607
  // src/apis/integrations/vercel/deploy/api.ts
3456
3608
  var vercelDeployApi = {
@@ -3710,7 +3862,7 @@ var vercelApi = {
3710
3862
  client_secret: clientSecret,
3711
3863
  redirect_uri: redirectUrl
3712
3864
  });
3713
- const response = yield axios18.post("https://api.vercel.com/v2/oauth/access_token", data, {
3865
+ const response = yield axios19.post("https://api.vercel.com/v2/oauth/access_token", data, {
3714
3866
  headers: {
3715
3867
  "Content-Type": "application/x-www-form-urlencoded"
3716
3868
  }
@@ -3726,7 +3878,7 @@ var vercelApi = {
3726
3878
  };
3727
3879
 
3728
3880
  // src/apis/integrations/neon/api.ts
3729
- import axios19 from "axios";
3881
+ import axios20 from "axios";
3730
3882
 
3731
3883
  // src/apis/integrations/neon/project/branch/api.ts
3732
3884
  var neonProjectBranchApi = {
@@ -3970,7 +4122,7 @@ var neonApi = {
3970
4122
  redirect_uri: redirectUri,
3971
4123
  grant_type: "authorization_code"
3972
4124
  });
3973
- const response = yield axios19.post(
4125
+ const response = yield axios20.post(
3974
4126
  "https://oauth2.neon.tech/oauth2/token",
3975
4127
  data,
3976
4128
  {
@@ -3995,7 +4147,7 @@ var neonApi = {
3995
4147
  client_secret: clientSecret,
3996
4148
  grant_type: "refresh_token"
3997
4149
  });
3998
- const response = yield axios19.post("https://oauth2.neon.tech/oauth2/token", data, {
4150
+ const response = yield axios20.post("https://oauth2.neon.tech/oauth2/token", data, {
3999
4151
  headers: {
4000
4152
  "Content-Type": "application/x-www-form-urlencoded"
4001
4153
  }
@@ -4010,7 +4162,7 @@ var neonApi = {
4010
4162
  };
4011
4163
 
4012
4164
  // src/apis/integrations/mailchimp/api.ts
4013
- import axios20 from "axios";
4165
+ import axios21 from "axios";
4014
4166
 
4015
4167
  // src/apis/integrations/mailchimp/lists/webhooks/api.ts
4016
4168
  var mailchimpListsWebhooksApi = {
@@ -4067,7 +4219,7 @@ var mailchimpApi = {
4067
4219
  redirect_uri: redirectUri,
4068
4220
  grant_type: "authorization_code"
4069
4221
  });
4070
- const tokenResponse = yield axios20.post(
4222
+ const tokenResponse = yield axios21.post(
4071
4223
  "https://login.mailchimp.com/oauth2/token",
4072
4224
  data,
4073
4225
  {
@@ -4088,7 +4240,7 @@ var mailchimpApi = {
4088
4240
  return __async(this, arguments, function* ({ token }) {
4089
4241
  const {
4090
4242
  data: { dc: server }
4091
- } = yield axios20.get(
4243
+ } = yield axios21.get(
4092
4244
  "https://login.mailchimp.com/oauth2/metadata",
4093
4245
  {
4094
4246
  headers: {
@@ -4105,7 +4257,7 @@ var mailchimpApi = {
4105
4257
  };
4106
4258
 
4107
4259
  // src/apis/integrations/shopify/api.ts
4108
- import axios21 from "axios";
4260
+ import axios22 from "axios";
4109
4261
 
4110
4262
  // src/apis/integrations/shopify/webhooks/api.ts
4111
4263
  var shopifyWebhooksApi = {
@@ -4160,7 +4312,7 @@ var shopifyApi = {
4160
4312
  redirect_uri: redirectUri,
4161
4313
  grant_type: "authorization_code"
4162
4314
  });
4163
- const response = yield axios21.post(
4315
+ const response = yield axios22.post(
4164
4316
  `https://${encodeURIComponent(
4165
4317
  shop
4166
4318
  )}.myshopify.com/admin/oauth/access_token`,
@@ -4338,7 +4490,7 @@ var hubspotApi = {
4338
4490
  };
4339
4491
 
4340
4492
  // src/apis/integrations/bigcommerce/api.ts
4341
- import axios22 from "axios";
4493
+ import axios23 from "axios";
4342
4494
 
4343
4495
  // src/apis/integrations/bigcommerce/webhooks/api.ts
4344
4496
  var bigCommerceWebhooksApi = {
@@ -4392,7 +4544,7 @@ var bigcommerceApi = {
4392
4544
  redirect_uri: redirectUri,
4393
4545
  grant_type: "authorization_code"
4394
4546
  });
4395
- const tokenResponse = yield axios22.post(
4547
+ const tokenResponse = yield axios23.post(
4396
4548
  "https://login.bigcommerce.com/oauth2/token",
4397
4549
  data,
4398
4550
  {
@@ -4412,11 +4564,11 @@ var bigcommerceApi = {
4412
4564
  };
4413
4565
 
4414
4566
  // src/apis/integrations/openai/api.ts
4415
- import axios23 from "axios";
4567
+ import axios24 from "axios";
4416
4568
  var openaiApi = {
4417
4569
  verifyToken(token) {
4418
4570
  return __async(this, null, function* () {
4419
- const response = yield axios23.get("https://api.openai.com/v1/models", {
4571
+ const response = yield axios24.get("https://api.openai.com/v1/models", {
4420
4572
  headers: {
4421
4573
  Authorization: `Bearer ${token}`
4422
4574
  }
@@ -5242,9 +5394,66 @@ var livechatApi = {
5242
5394
  configuration: livechatConfigurationApi
5243
5395
  };
5244
5396
 
5397
+ // src/apis/products/helpdesk/webhooks/api.ts
5398
+ var helpdeskWebhooksApi = {
5399
+ list(authorization) {
5400
+ return __async(this, null, function* () {
5401
+ const response = yield helpdeskClientInstance.get(
5402
+ `/webhooks`,
5403
+ getHelpDeskClientConfig(authorization)
5404
+ );
5405
+ return response;
5406
+ });
5407
+ },
5408
+ get(webhookId, authorization) {
5409
+ return __async(this, null, function* () {
5410
+ const response = yield helpdeskClientInstance.get(
5411
+ `/webhooks/${encodeURIComponent(webhookId)}`,
5412
+ getHelpDeskClientConfig(authorization)
5413
+ );
5414
+ return response;
5415
+ });
5416
+ },
5417
+ create(payload, authorization) {
5418
+ return __async(this, null, function* () {
5419
+ const response = yield helpdeskClientInstance.post(
5420
+ `/webhooks`,
5421
+ payload,
5422
+ getHelpDeskClientConfig(authorization)
5423
+ );
5424
+ return response;
5425
+ });
5426
+ },
5427
+ update(webhookId, payload, authorization) {
5428
+ return __async(this, null, function* () {
5429
+ const response = yield helpdeskClientInstance.patch(
5430
+ `/webhooks/${encodeURIComponent(webhookId)}`,
5431
+ payload,
5432
+ getHelpDeskClientConfig(authorization)
5433
+ );
5434
+ return response;
5435
+ });
5436
+ },
5437
+ delete(webhookId, authorization) {
5438
+ return __async(this, null, function* () {
5439
+ const response = yield helpdeskClientInstance.delete(
5440
+ `/webhooks/${encodeURIComponent(webhookId)}`,
5441
+ getHelpDeskClientConfig(authorization)
5442
+ );
5443
+ return response;
5444
+ });
5445
+ }
5446
+ };
5447
+
5448
+ // src/apis/products/helpdesk/api.ts
5449
+ var helpdeskApi = {
5450
+ webhooks: helpdeskWebhooksApi
5451
+ };
5452
+
5245
5453
  // src/apis/products/api.ts
5246
5454
  var productsApi = {
5247
- livechat: livechatApi
5455
+ livechat: livechatApi,
5456
+ helpdesk: helpdeskApi
5248
5457
  };
5249
5458
 
5250
5459
  // src/apis/platform/accounts/accounts/api.ts
@@ -7440,37 +7649,6 @@ var platformAdapterMailchimpApi = {
7440
7649
  }
7441
7650
  };
7442
7651
 
7443
- // src/apis/platform/adapter/integrations/neon/api.ts
7444
- var platformAdapterNeonProxyApi = {
7445
- user(authorization) {
7446
- return __async(this, null, function* () {
7447
- const response = yield adapterClientInstance.get(
7448
- `/integrations/neon/user`,
7449
- getNeonClientConfig(authorization)
7450
- );
7451
- return response.data;
7452
- });
7453
- },
7454
- projects(authorization) {
7455
- return __async(this, null, function* () {
7456
- const response = yield adapterClientInstance.get(
7457
- `/integrations/neon/projects`,
7458
- getNeonClientConfig(authorization)
7459
- );
7460
- return response.data;
7461
- });
7462
- },
7463
- databases(projectId, authorization) {
7464
- return __async(this, null, function* () {
7465
- const response = yield adapterClientInstance.get(
7466
- `/integrations/neon/projects/${encodeURIComponent(projectId)}/databases`,
7467
- getNeonClientConfig(authorization)
7468
- );
7469
- return response.data;
7470
- });
7471
- }
7472
- };
7473
-
7474
7652
  // src/apis/platform/adapter/integrations/shopify/api.ts
7475
7653
  var platformAdapterShopifyApi = {
7476
7654
  events: {
@@ -7521,7 +7699,6 @@ var platformAdapterTextApi = {
7521
7699
 
7522
7700
  // src/apis/platform/adapter/integrations/api.ts
7523
7701
  var platformAdapterIntegrationsApi = {
7524
- neon: platformAdapterNeonProxyApi,
7525
7702
  mailchimp: platformAdapterMailchimpApi,
7526
7703
  shopify: platformAdapterShopifyApi,
7527
7704
  hubspot: platformAdapterHubspotApi,
@@ -7799,6 +7976,8 @@ export {
7799
7976
  BigCommerceEventNames,
7800
7977
  BigCommerceWebhookScopes,
7801
7978
  DpsApiError,
7979
+ HelpDeskApiError,
7980
+ HelpDeskWebhookEventType,
7802
7981
  HubSpotWebhookEventTypes,
7803
7982
  HubspotApiError,
7804
7983
  HubspotEventNames,
@@ -7814,6 +7993,7 @@ export {
7814
7993
  ShopifyApiError,
7815
7994
  ShopifyEventNames,
7816
7995
  TextApiError,
7996
+ TextHelpDeskEventNames,
7817
7997
  TextLivechatEventNames,
7818
7998
  UnauthorizeAccountsApiError,
7819
7999
  UnauthorizeApiError,
@@ -7840,6 +8020,7 @@ export {
7840
8020
  getDpsClientConfig,
7841
8021
  getEmptyAppAutoReview,
7842
8022
  getGithubClientConfig,
8023
+ getHelpDeskClientConfig,
7843
8024
  getHubspotClientConfig,
7844
8025
  getIntegrationFlowUrl,
7845
8026
  getIntegrationFlowUrlOld,
@@ -7855,6 +8036,7 @@ export {
7855
8036
  getTextClientConfig,
7856
8037
  getVercelClientConfig,
7857
8038
  githubClientInstance,
8039
+ helpdeskClientInstance,
7858
8040
  hubspotClientInstance,
7859
8041
  hubspotEventsZods,
7860
8042
  initAdapterClient,
@@ -7863,6 +8045,7 @@ export {
7863
8045
  initBillingClient,
7864
8046
  initDpsClient,
7865
8047
  initGithubClient,
8048
+ initHelpDeskClient,
7866
8049
  initHubspotClient,
7867
8050
  initLiveChatClient,
7868
8051
  initMailchimpClient,
@@ -7885,6 +8068,7 @@ export {
7885
8068
  shopifyClientInstance,
7886
8069
  shopifyEventsZods,
7887
8070
  textClientInstance,
8071
+ textHelpDeskEventsZods,
7888
8072
  textLivechatEventsZods,
7889
8073
  updateAdapterClient,
7890
8074
  updateBigCommerceClient,