@livechat/developer-studio-api 3.0.52 → 3.0.54

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.js CHANGED
@@ -74,7 +74,10 @@ __export(src_exports, {
74
74
  DpsApiError: () => DpsApiError,
75
75
  LivechatApiError: () => LivechatApiError,
76
76
  MailchimpApiError: () => MailchimpApiError,
77
+ MailchimpEvents: () => MailchimpEvents,
77
78
  ShopifyApiError: () => ShopifyApiError,
79
+ ShopifyEvents: () => ShopifyEvents,
80
+ TextLivechatEvents: () => TextLivechatEvents,
78
81
  UnauthorizeApiError: () => UnauthorizeApiError,
79
82
  WorkflowDefinitionTaskType: () => WorkflowDefinitionTaskType,
80
83
  allAppTemplates: () => allAppTemplates,
@@ -133,8 +136,10 @@ __export(src_exports, {
133
136
  initShopifyClient: () => initShopifyClient,
134
137
  initTextClient: () => initTextClient,
135
138
  initVercelClient: () => initVercelClient,
139
+ integrationEventsZods: () => integrationEventsZods,
136
140
  livechatClientInstance: () => livechatClientInstance,
137
141
  mailchimpClientInstance: () => mailchimpClientInstance,
142
+ mailchimpEventsZods: () => mailchimpEventsZods,
138
143
  neonClientInstance: () => neonClientInstance,
139
144
  netlifyClientInstance: () => netlifyClientInstance,
140
145
  planetScaleClientInstance: () => planetScaleClientInstance,
@@ -143,7 +148,9 @@ __export(src_exports, {
143
148
  platformBillingClientInstance: () => platformBillingClientInstance,
144
149
  platformDpsClientInstance: () => platformDpsClientInstance,
145
150
  shopifyClientInstance: () => shopifyClientInstance,
151
+ shopifyEventsZods: () => shopifyEventsZods,
146
152
  textClientInstance: () => textClientInstance,
153
+ textLivechatEventsZods: () => textLivechatEventsZods,
147
154
  updateGithubClient: () => updateGithubClient,
148
155
  updateMailchimpClient: () => updateMailchimpClient,
149
156
  updateNeonClient: () => updateNeonClient,
@@ -211,13 +218,13 @@ githubClientInstance.interceptors.response.use(
211
218
  function getGitHubClientAuthorization(req) {
212
219
  if (req.headers instanceof Headers) {
213
220
  return {
214
- appToken: req.headers.get("github-app-token"),
215
- oauthToken: req.headers.get("github-oauth-token")
221
+ appToken: req.headers.get("x-adapter-github-app-token"),
222
+ oauthToken: req.headers.get("x-adapter-github-oauth-token")
216
223
  };
217
224
  }
218
225
  return {
219
- appToken: req.headers["github-app-token"],
220
- oauthToken: req.headers["github-oauth-token"]
226
+ appToken: req.headers["x-adapter-github-app-token"],
227
+ oauthToken: req.headers["x-adapter-github-oauth-token"]
221
228
  };
222
229
  }
223
230
  function getGithubClientConfig(options = {}) {
@@ -674,11 +681,11 @@ netlifyClientInstance.interceptors.response.use(
674
681
  function getNetlifyClientAuthorization(req) {
675
682
  if (req.headers instanceof Headers) {
676
683
  return {
677
- token: req.headers.get("netlify-token")
684
+ token: req.headers.get("x-adapter-netlify-token")
678
685
  };
679
686
  }
680
687
  return {
681
- token: req.headers["netlify-token"]
688
+ token: req.headers["x-adapter-netlify-token"]
682
689
  };
683
690
  }
684
691
  function getNetlifyClientConfig(options = {}) {
@@ -1138,11 +1145,11 @@ planetScaleClientInstance.interceptors.response.use(
1138
1145
  function getPlanetScaleClientAuthorization(req) {
1139
1146
  if (req.headers instanceof Headers) {
1140
1147
  return {
1141
- token: req.headers.get("planetscale-token")
1148
+ token: req.headers.get("x-adapter-planetscale-token")
1142
1149
  };
1143
1150
  }
1144
1151
  return {
1145
- token: req.headers["planetscale-token"]
1152
+ token: req.headers["x-adapter-planetscale-token"]
1146
1153
  };
1147
1154
  }
1148
1155
  function getPlanetScaleClientConfig(options = {}) {
@@ -1355,12 +1362,12 @@ var textClientInstance = import_axios8.default.create({
1355
1362
  function getTextClientAuthorization(req) {
1356
1363
  if (req.headers instanceof Headers) {
1357
1364
  return {
1358
- token: req.headers.get("platform-token"),
1365
+ token: req.headers.get("x-adapter-platform-token"),
1359
1366
  tokenType: "Bearer"
1360
1367
  };
1361
1368
  }
1362
1369
  return {
1363
- token: req.headers["platform-token"],
1370
+ token: req.headers["x-adapter-platform-token"],
1364
1371
  tokenType: "Bearer"
1365
1372
  };
1366
1373
  }
@@ -1874,11 +1881,11 @@ vercelClientInstance.interceptors.response.use(
1874
1881
  function getVercelClientAuthorization(req) {
1875
1882
  if (req.headers instanceof Headers) {
1876
1883
  return {
1877
- token: req.headers.get("vercel-token")
1884
+ token: req.headers.get("x-adapter-vercel-token")
1878
1885
  };
1879
1886
  }
1880
1887
  return {
1881
- token: req.headers["vercel-token"]
1888
+ token: req.headers["x-adapter-vercel-token"]
1882
1889
  };
1883
1890
  }
1884
1891
  function getVercelClientConfig(options = {}) {
@@ -2198,11 +2205,11 @@ neonClientInstance.interceptors.response.use(
2198
2205
  function getNeonClientAuthorization(req) {
2199
2206
  if (req.headers instanceof Headers) {
2200
2207
  return {
2201
- token: req.headers.get("neon-token")
2208
+ token: req.headers.get("x-adapter-neon-token")
2202
2209
  };
2203
2210
  }
2204
2211
  return {
2205
- token: req.headers["neon-token"]
2212
+ token: req.headers["x-adapter-neon-token"]
2206
2213
  };
2207
2214
  }
2208
2215
  function getNeonClientConfig(options = {}) {
@@ -2531,13 +2538,13 @@ mailchimpClientInstance.interceptors.response.use(
2531
2538
  function getMailchimpClientAuthorization(req) {
2532
2539
  if (req.headers instanceof Headers) {
2533
2540
  return {
2534
- server: req.headers.get("mailchimp-server"),
2535
- token: req.headers.get("mailchimp-token")
2541
+ server: req.headers.get("x-adapter-mailchimp-server"),
2542
+ token: req.headers.get("x-adapter-mailchimp-token")
2536
2543
  };
2537
2544
  }
2538
2545
  return {
2539
- server: req.headers["mailchimp-server"],
2540
- token: req.headers["mailchimp-token"]
2546
+ server: req.headers["x-adapter-mailchimp-server"],
2547
+ token: req.headers["x-adapter-mailchimp-token"]
2541
2548
  };
2542
2549
  }
2543
2550
  function getMailchimpClientConfig(options = {}) {
@@ -2702,16 +2709,16 @@ var getShopifyClientUrl = (store) => `https://${store}.myshopify.com/admin/api/2
2702
2709
  function getShopifyClientAuthorization(req) {
2703
2710
  if (req.headers instanceof Headers) {
2704
2711
  return {
2705
- shop: req.headers.get("shopify-shop"),
2706
- token: req.headers.get("shopify-token")
2712
+ shop: req.headers.get("x-adapter-shopify-shop"),
2713
+ token: req.headers.get("x-adapter-shopify-token")
2707
2714
  };
2708
2715
  }
2709
2716
  return {
2710
- shop: req.headers["shopify-shop"],
2711
- token: req.headers["shopify-token"]
2717
+ shop: req.headers["x-adapter-shopify-shop"],
2718
+ token: req.headers["x-adapter-shopify-token"]
2712
2719
  };
2713
2720
  }
2714
- function getShopifyClientConfig(options) {
2721
+ function getShopifyClientConfig(options = {}) {
2715
2722
  var _a, _b;
2716
2723
  const currentBaseUrl = shopifyClientInstance.defaults.baseURL;
2717
2724
  const currentHeaders = shopifyClientInstance.defaults.headers;
@@ -2872,11 +2879,11 @@ livechatClientInstance.interceptors.response.use(
2872
2879
  function getLiveChatClientAuthorization(req) {
2873
2880
  if (req.headers instanceof Headers) {
2874
2881
  return {
2875
- token: req.headers.get("platform-token")
2882
+ token: req.headers.get("x-adapter-platform-token")
2876
2883
  };
2877
2884
  }
2878
2885
  return {
2879
- token: req.headers["platform-token"]
2886
+ token: req.headers["x-adapter-platform-token"]
2880
2887
  };
2881
2888
  }
2882
2889
  function getLiveChatClientConfig(options = {}) {
@@ -3444,11 +3451,11 @@ platformAccountsClientInstance.interceptors.response.use(
3444
3451
  function getPlatformAccountsClientAuthorization(req) {
3445
3452
  if (req.headers instanceof Headers) {
3446
3453
  return {
3447
- token: req.headers.get("platform-token")
3454
+ token: req.headers.get("x-adapter-platform-token")
3448
3455
  };
3449
3456
  }
3450
3457
  return {
3451
- token: req.headers["platform-token"]
3458
+ token: req.headers["x-adapter-platform-token"]
3452
3459
  };
3453
3460
  }
3454
3461
  function getPlatformAccountsClientConfig(options = {}) {
@@ -3786,12 +3793,12 @@ platformDpsClientInstance.interceptors.response.use(
3786
3793
  function getPlatformDpsClientAuthorization(req) {
3787
3794
  if (req.headers instanceof Headers) {
3788
3795
  return {
3789
- token: req.headers.get("platform-token"),
3796
+ token: req.headers.get("x-adapter-platform-token"),
3790
3797
  tokenType: "Bearer"
3791
3798
  };
3792
3799
  }
3793
3800
  return {
3794
- token: req.headers["platform-token"],
3801
+ token: req.headers["x-adapter-platform-token"],
3795
3802
  tokenType: "Bearer"
3796
3803
  };
3797
3804
  }
@@ -5375,61 +5382,61 @@ function getPlatformAdapterClientAuthorization(req) {
5375
5382
  if (req.headers instanceof Headers) {
5376
5383
  return {
5377
5384
  platform: {
5378
- token: req.headers.get("platform-token")
5385
+ token: req.headers.get("x-adapter-platform-token")
5379
5386
  },
5380
5387
  github: {
5381
- appToken: req.headers.get("github-app-token"),
5382
- oauthToken: req.headers.get("github-oauth-token")
5388
+ appToken: req.headers.get("x-adapter-github-app-token"),
5389
+ oauthToken: req.headers.get("x-adapter-github-oauth-token")
5383
5390
  },
5384
5391
  netlify: {
5385
- token: req.headers.get("netlify-token")
5392
+ token: req.headers.get("x-adapter-netlify-token")
5386
5393
  },
5387
5394
  vercel: {
5388
- token: req.headers.get("vercel-token")
5395
+ token: req.headers.get("x-adapter-vercel-token")
5389
5396
  },
5390
5397
  planetscale: {
5391
- token: req.headers.get("planetscale-token")
5398
+ token: req.headers.get("x-adapter-planetscale-token")
5392
5399
  },
5393
5400
  neon: {
5394
- token: req.headers.get("neon-token")
5401
+ token: req.headers.get("x-adapter-neon-token")
5395
5402
  },
5396
5403
  mailchimp: {
5397
- token: req.headers.get("mailchimp-token"),
5398
- server: req.headers.get("mailchimp-server")
5404
+ token: req.headers.get("x-adapter-mailchimp-token"),
5405
+ server: req.headers.get("x-adapter-mailchimp-server")
5399
5406
  },
5400
5407
  shopify: {
5401
- token: req.headers.get("shopify-token"),
5402
- shop: req.headers.get("shopify-shop")
5408
+ token: req.headers.get("x-adapter-shopify-token"),
5409
+ shop: req.headers.get("x-adapter-shopify-shop")
5403
5410
  }
5404
5411
  };
5405
5412
  }
5406
5413
  return {
5407
5414
  platform: {
5408
- token: req.headers["platform-token"]
5415
+ token: req.headers["x-adapter-platform-token"]
5409
5416
  },
5410
5417
  github: {
5411
- appToken: req.headers["github-app-token"],
5412
- oauthToken: req.headers["github-oauth-token"]
5418
+ appToken: req.headers["x-adapter-github-app-token"],
5419
+ oauthToken: req.headers["x-adapter-github-oauth-token"]
5413
5420
  },
5414
5421
  netlify: {
5415
- token: req.headers["netlify-token"]
5422
+ token: req.headers["x-adapter-netlify-token"]
5416
5423
  },
5417
5424
  vercel: {
5418
- token: req.headers["vercel-token"]
5425
+ token: req.headers["x-adapter-vercel-token"]
5419
5426
  },
5420
5427
  planetscale: {
5421
- token: req.headers["planetscale-token"]
5428
+ token: req.headers["x-adapter-planetscale-token"]
5422
5429
  },
5423
5430
  neon: {
5424
- token: req.headers["neon-token"]
5431
+ token: req.headers["x-adapter-neon-token"]
5425
5432
  },
5426
5433
  mailchimp: {
5427
- token: req.headers["mailchimp-token"],
5428
- server: req.headers["mailchimp-server"]
5434
+ token: req.headers["x-adapter-mailchimp-token"],
5435
+ server: req.headers["x-adapter-mailchimp-server"]
5429
5436
  },
5430
5437
  shopify: {
5431
- token: req.headers["shopify-token"],
5432
- shop: req.headers["shopify-shop"]
5438
+ token: req.headers["x-adapter-shopify-token"],
5439
+ shop: req.headers["x-adapter-shopify-shop"]
5433
5440
  }
5434
5441
  };
5435
5442
  }
@@ -5438,25 +5445,25 @@ function getPlatformAdapterClientConfig(options = {}) {
5438
5445
  const currentHeaders = platformAdapterClientInstance.defaults.headers;
5439
5446
  const headers = {
5440
5447
  platform: {
5441
- token: (_b = currentHeaders["platform-token"]) != null ? _b : (_a = options.platform) == null ? void 0 : _a.token
5448
+ token: (_b = currentHeaders["x-adapter-platform-token"]) != null ? _b : (_a = options.platform) == null ? void 0 : _a.token
5442
5449
  },
5443
5450
  integrations: {
5444
5451
  github: {
5445
- app: (_d = currentHeaders["github-app-token"]) != null ? _d : (_c = options.github) == null ? void 0 : _c.appToken,
5446
- oauth: (_f = currentHeaders["github-oauth-token"]) != null ? _f : (_e = options.github) == null ? void 0 : _e.oauthToken
5452
+ app: (_d = currentHeaders["x-adapter-github-app-token"]) != null ? _d : (_c = options.github) == null ? void 0 : _c.appToken,
5453
+ oauth: (_f = currentHeaders["x-adapter-github-oauth-token"]) != null ? _f : (_e = options.github) == null ? void 0 : _e.oauthToken
5447
5454
  },
5448
- netlify: (_h = currentHeaders["netlify-token"]) != null ? _h : (_g = options.netlify) == null ? void 0 : _g.token,
5449
- vercel: (_j = currentHeaders["vercel-token"]) != null ? _j : (_i = options.vercel) == null ? void 0 : _i.token,
5450
- planetscale: (_l = currentHeaders["planetscale-token"]) != null ? _l : (_k = options.planetscale) == null ? void 0 : _k.token,
5451
- neon: (_n = currentHeaders["neon-token"]) != null ? _n : (_m = options.neon) == null ? void 0 : _m.token,
5452
- mailchimp: (_p = currentHeaders["mailchimp-token"]) != null ? _p : (_o = options.mailchimp) == null ? void 0 : _o.token,
5453
- mailchimpServer: (_r = currentHeaders["mailchimp-server"]) != null ? _r : (_q = options.mailchimp) == null ? void 0 : _q.server,
5454
- shopify: (_t = currentHeaders["shopify-token"]) != null ? _t : (_s = options.shopify) == null ? void 0 : _s.token,
5455
- shopifyShop: (_v = currentHeaders["shopify-shop"]) != null ? _v : (_u = options.shopify) == null ? void 0 : _u.shop
5455
+ netlify: (_h = currentHeaders["x-adapter-netlify-token"]) != null ? _h : (_g = options.netlify) == null ? void 0 : _g.token,
5456
+ vercel: (_j = currentHeaders["x-adapter-vercel-token"]) != null ? _j : (_i = options.vercel) == null ? void 0 : _i.token,
5457
+ planetscale: (_l = currentHeaders["x-adapter-planetscale-token"]) != null ? _l : (_k = options.planetscale) == null ? void 0 : _k.token,
5458
+ neon: (_n = currentHeaders["x-adapter-neon-token"]) != null ? _n : (_m = options.neon) == null ? void 0 : _m.token,
5459
+ mailchimp: (_p = currentHeaders["x-adapter-mailchimp-token"]) != null ? _p : (_o = options.mailchimp) == null ? void 0 : _o.token,
5460
+ mailchimpServer: (_r = currentHeaders["x-adapter-mailchimp-server"]) != null ? _r : (_q = options.mailchimp) == null ? void 0 : _q.server,
5461
+ shopify: (_t = currentHeaders["x-adapter-shopify-token"]) != null ? _t : (_s = options.shopify) == null ? void 0 : _s.token,
5462
+ shopifyShop: (_v = currentHeaders["x-adapter-shopify-shop"]) != null ? _v : (_u = options.shopify) == null ? void 0 : _u.shop
5456
5463
  }
5457
5464
  };
5458
- if (currentHeaders["platform-token"]) {
5459
- currentHeaders["X-Region"] = (_w = getRegion2(currentHeaders["platform-token"])) != null ? _w : void 0;
5465
+ if (currentHeaders["x-adapter-platform-token"]) {
5466
+ currentHeaders["X-Region"] = (_w = getRegion2(currentHeaders["x-adapter-platform-token"])) != null ? _w : void 0;
5460
5467
  }
5461
5468
  if (((_x = options.ensureAuthorizationToken) == null ? void 0 : _x.platform) && !headers.platform.token) {
5462
5469
  throw new UnauthorizeApiError("accounts");
@@ -5483,7 +5490,7 @@ function getPlatformAdapterClientConfig(options = {}) {
5483
5490
  throw new UnauthorizeApiError("shopify");
5484
5491
  }
5485
5492
  return {
5486
- headers: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, headers.platform.token ? { "platform-token": headers.platform.token } : {}), headers.integrations.github.app ? { "github-app-token": headers.integrations.github.app } : {}), headers.integrations.github.oauth ? { "github-oauth-token": headers.integrations.github.oauth } : {}), headers.integrations.netlify ? { "netlify-token": headers.integrations.netlify } : {}), headers.integrations.vercel ? { "vercel-token": headers.integrations.vercel } : {}), headers.integrations.planetscale ? { "planetscale-token": headers.integrations.planetscale } : {}), headers.integrations.neon ? { "neon-token": headers.integrations.neon } : {}), headers.integrations.mailchimp ? { "mailchimp-token": headers.integrations.mailchimp } : {}), headers.integrations.mailchimpServer ? { "mailchimp-server": headers.integrations.mailchimpServer } : {}), headers.integrations.shopify ? { "shopify-token": headers.integrations.shopify } : {}), headers.integrations.shopifyShop ? { "shopify-shop": headers.integrations.shopifyShop } : {})
5493
+ headers: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, headers.platform.token ? { "x-adapter-platform-token": headers.platform.token } : {}), headers.integrations.github.app ? { "x-adapter-github-app-token": headers.integrations.github.app } : {}), headers.integrations.github.oauth ? { "x-adapter-github-oauth-token": headers.integrations.github.oauth } : {}), headers.integrations.netlify ? { "x-adapter-netlify-token": headers.integrations.netlify } : {}), headers.integrations.vercel ? { "x-adapter-vercel-token": headers.integrations.vercel } : {}), headers.integrations.planetscale ? { "x-adapter-planetscale-token": headers.integrations.planetscale } : {}), headers.integrations.neon ? { "x-adapter-neon-token": headers.integrations.neon } : {}), headers.integrations.mailchimp ? { "x-adapter-mailchimp-token": headers.integrations.mailchimp } : {}), headers.integrations.mailchimpServer ? { "x-adapter-mailchimp-server": headers.integrations.mailchimpServer } : {}), headers.integrations.shopify ? { "x-adapter-shopify-token": headers.integrations.shopify } : {}), headers.integrations.shopifyShop ? { "x-adapter-shopify-shop": headers.integrations.shopifyShop } : {})
5487
5494
  };
5488
5495
  }
5489
5496
  var getPlatformAdapterClientDefaultConfig = (authorization) => getPlatformAdapterClientConfig(__spreadProps(__spreadValues({}, authorization), {
@@ -5509,37 +5516,37 @@ function updatePlatformAdapterClient(tokens) {
5509
5516
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
5510
5517
  const headers = platformAdapterClientInstance.defaults.headers;
5511
5518
  if ((_a = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _a.token) {
5512
- headers["platform-token"] = tokens.platform.token;
5519
+ headers["x-adapter-platform-token"] = tokens.platform.token;
5513
5520
  }
5514
5521
  if ((_b = tokens == null ? void 0 : tokens.github) == null ? void 0 : _b.appToken) {
5515
- headers["github-app-token"] = tokens.github.appToken;
5522
+ headers["x-adapter-github-app-token"] = tokens.github.appToken;
5516
5523
  }
5517
5524
  if ((_c = tokens == null ? void 0 : tokens.github) == null ? void 0 : _c.oauthToken) {
5518
- headers["github-oauth-token"] = tokens.github.oauthToken;
5525
+ headers["x-adapter-github-oauth-token"] = tokens.github.oauthToken;
5519
5526
  }
5520
5527
  if ((_d = tokens == null ? void 0 : tokens.netlify) == null ? void 0 : _d.token) {
5521
- headers["netlify-token"] = tokens.netlify.token;
5528
+ headers["x-adapter-netlify-token"] = tokens.netlify.token;
5522
5529
  }
5523
5530
  if ((_e = tokens == null ? void 0 : tokens.vercel) == null ? void 0 : _e.token) {
5524
- headers["vercel-token"] = tokens.vercel.token;
5531
+ headers["x-adapter-vercel-token"] = tokens.vercel.token;
5525
5532
  }
5526
5533
  if ((_f = tokens == null ? void 0 : tokens.planetscale) == null ? void 0 : _f.token) {
5527
- headers["planetscale-token"] = tokens.planetscale.token;
5534
+ headers["x-adapter-planetscale-token"] = tokens.planetscale.token;
5528
5535
  }
5529
5536
  if ((_g = tokens == null ? void 0 : tokens.neon) == null ? void 0 : _g.token) {
5530
- headers["neon-token"] = tokens.neon.token;
5537
+ headers["x-adapter-neon-token"] = tokens.neon.token;
5531
5538
  }
5532
5539
  if ((_h = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _h.server) {
5533
- headers["mailchimp-server"] = tokens.mailchimp.server;
5540
+ headers["x-adapter-mailchimp-server"] = tokens.mailchimp.server;
5534
5541
  }
5535
5542
  if ((_i = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _i.token) {
5536
- headers["mailchimp-token"] = tokens.mailchimp.token;
5543
+ headers["x-adapter-mailchimp-token"] = tokens.mailchimp.token;
5537
5544
  }
5538
5545
  if ((_j = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _j.shop) {
5539
- headers["shopify-shop"] = tokens.shopify.shop;
5546
+ headers["x-adapter-shopify-shop"] = tokens.shopify.shop;
5540
5547
  }
5541
5548
  if ((_k = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _k.token) {
5542
- headers["shopify-token"] = tokens.shopify.token;
5549
+ headers["x-adapter-shopify-token"] = tokens.shopify.token;
5543
5550
  }
5544
5551
  }
5545
5552
 
@@ -6036,11 +6043,11 @@ var platformBillingClientInstance = import_axios21.default.create({
6036
6043
  function getPlatformBillingClientAuthorization(req) {
6037
6044
  if (req.headers instanceof Headers) {
6038
6045
  return {
6039
- token: req.headers.get("platform-token")
6046
+ token: req.headers.get("x-adapter-platform-token")
6040
6047
  };
6041
6048
  }
6042
6049
  return {
6043
- token: req.headers["platform-token"]
6050
+ token: req.headers["x-adapter-platform-token"]
6044
6051
  };
6045
6052
  }
6046
6053
  function getPlatformBillingClientConfig(options = {}) {
@@ -6070,6 +6077,182 @@ function initPlatformBillingClient(baseUrl, token) {
6070
6077
  }
6071
6078
  }
6072
6079
 
6080
+ // src/apis/platform/adapter/integrations/_contracts/requests/events.ts
6081
+ var import_zod4 = require("zod");
6082
+
6083
+ // src/apis/platform/adapter/integrations/shopify/_contracts/dtos/events.ts
6084
+ var ShopifyEvents = /* @__PURE__ */ ((ShopifyEvents2) => {
6085
+ ShopifyEvents2["OrdersCreate"] = "orders/create";
6086
+ return ShopifyEvents2;
6087
+ })(ShopifyEvents || {});
6088
+
6089
+ // src/apis/platform/adapter/integrations/shopify/_contracts/requests/events.ts
6090
+ var import_zod = require("zod");
6091
+ var shopifyEventsZods = {
6092
+ event: import_zod.z.nativeEnum(ShopifyEvents),
6093
+ get body() {
6094
+ return import_zod.z.object({
6095
+ event: this.event
6096
+ });
6097
+ },
6098
+ get provider() {
6099
+ return import_zod.z.object({
6100
+ provider: import_zod.z.literal("shopify"),
6101
+ event: this.event
6102
+ });
6103
+ },
6104
+ get source() {
6105
+ return import_zod.z.object({
6106
+ sourceName: import_zod.z.enum(["apps", "workflows"]),
6107
+ sourceKey: import_zod.z.string()
6108
+ });
6109
+ },
6110
+ get subscribe() {
6111
+ return this.source.and(this.body).and(
6112
+ import_zod.z.object({
6113
+ callback: import_zod.z.string()
6114
+ })
6115
+ );
6116
+ },
6117
+ get unsubscribe() {
6118
+ return this.source.and(this.body);
6119
+ }
6120
+ };
6121
+
6122
+ // src/apis/platform/adapter/integrations/mailchimp/_contracts/requests/events.ts
6123
+ var import_zod2 = require("zod");
6124
+
6125
+ // src/apis/platform/adapter/integrations/mailchimp/_contracts/dtos/events.ts
6126
+ var MailchimpEvents = /* @__PURE__ */ ((MailchimpEvents2) => {
6127
+ MailchimpEvents2["Subscribe"] = "subscribe";
6128
+ MailchimpEvents2["Unsubscribe"] = "unsubscribe";
6129
+ return MailchimpEvents2;
6130
+ })(MailchimpEvents || {});
6131
+
6132
+ // src/apis/platform/adapter/integrations/mailchimp/_contracts/requests/events.ts
6133
+ var mailchimpEventsZods = {
6134
+ event: import_zod2.z.nativeEnum(MailchimpEvents),
6135
+ get body() {
6136
+ return import_zod2.z.object({
6137
+ event: this.event,
6138
+ listId: import_zod2.z.string()
6139
+ });
6140
+ },
6141
+ get provider() {
6142
+ return import_zod2.z.object({
6143
+ provider: import_zod2.z.literal("mailchimp"),
6144
+ event: this.event,
6145
+ listId: import_zod2.z.string()
6146
+ });
6147
+ },
6148
+ get source() {
6149
+ return import_zod2.z.object({
6150
+ sourceName: import_zod2.z.enum(["apps", "workflows"]),
6151
+ sourceKey: import_zod2.z.string()
6152
+ });
6153
+ },
6154
+ get subscribe() {
6155
+ return this.source.and(this.body).and(
6156
+ import_zod2.z.object({
6157
+ callback: import_zod2.z.string()
6158
+ })
6159
+ );
6160
+ },
6161
+ get unsubscribe() {
6162
+ return this.source.and(this.body);
6163
+ }
6164
+ };
6165
+
6166
+ // src/apis/platform/adapter/integrations/text/_contracts/dtos/events.ts
6167
+ var TextLivechatEvents = /* @__PURE__ */ ((TextLivechatEvents2) => {
6168
+ TextLivechatEvents2["IncomingChat"] = "incoming_chat";
6169
+ return TextLivechatEvents2;
6170
+ })(TextLivechatEvents || {});
6171
+
6172
+ // src/apis/platform/adapter/integrations/text/_contracts/requests/events.ts
6173
+ var import_zod3 = require("zod");
6174
+ var textLivechatEventsZods = {
6175
+ event: import_zod3.z.nativeEnum(TextLivechatEvents),
6176
+ get body() {
6177
+ return import_zod3.z.object({
6178
+ event: this.event
6179
+ });
6180
+ },
6181
+ get provider() {
6182
+ return import_zod3.z.object({
6183
+ provider: import_zod3.z.literal("text-livechat"),
6184
+ event: this.event
6185
+ });
6186
+ },
6187
+ get source() {
6188
+ return import_zod3.z.object({
6189
+ sourceName: import_zod3.z.enum(["apps", "workflows"]),
6190
+ sourceKey: import_zod3.z.string()
6191
+ });
6192
+ },
6193
+ get subscribe() {
6194
+ return this.source.and(this.body).and(
6195
+ import_zod3.z.object({
6196
+ callback: import_zod3.z.string()
6197
+ })
6198
+ );
6199
+ },
6200
+ get unsubscribe() {
6201
+ return this.source.and(this.body);
6202
+ }
6203
+ };
6204
+
6205
+ // src/apis/platform/adapter/integrations/_contracts/requests/events.ts
6206
+ var integrationEventsZods = {
6207
+ sourceName: import_zod4.z.enum(["apps", "workflows"]),
6208
+ providerName: import_zod4.z.enum(["text-livechat", "mailchimp", "shopify"]),
6209
+ get source() {
6210
+ return import_zod4.z.object({
6211
+ sourceName: this.sourceName,
6212
+ sourceKey: import_zod4.z.string()
6213
+ });
6214
+ },
6215
+ provider: import_zod4.z.discriminatedUnion("provider", [
6216
+ textLivechatEventsZods.provider,
6217
+ mailchimpEventsZods.provider,
6218
+ shopifyEventsZods.provider
6219
+ ]),
6220
+ get subscribe() {
6221
+ return this.source.and(this.provider).and(
6222
+ import_zod4.z.object({
6223
+ callback: import_zod4.z.string()
6224
+ })
6225
+ );
6226
+ },
6227
+ get unsubscribe() {
6228
+ return this.source.and(this.provider);
6229
+ }
6230
+ };
6231
+
6232
+ // src/apis/platform/adapter/integrations/mailchimp/api.ts
6233
+ var platformAdapterMailchimpApi = {
6234
+ events: {
6235
+ subscribe(payload, authorization) {
6236
+ return __async(this, null, function* () {
6237
+ yield platformAdapterClientInstance.post(
6238
+ `/integrations/mailchimp/events/subscribe`,
6239
+ payload,
6240
+ getMailchimpClientConfig(authorization)
6241
+ );
6242
+ });
6243
+ },
6244
+ unsubscribe(payload, authorization) {
6245
+ return __async(this, null, function* () {
6246
+ yield platformAdapterClientInstance.post(
6247
+ `/integrations/mailchimp/events/unsubscribe`,
6248
+ payload,
6249
+ getMailchimpClientConfig(authorization)
6250
+ );
6251
+ });
6252
+ }
6253
+ }
6254
+ };
6255
+
6073
6256
  // src/apis/platform/adapter/integrations/neon/api.ts
6074
6257
  var platformAdapterNeonProxyApi = {
6075
6258
  user(authorization) {
@@ -6107,15 +6290,66 @@ var platformAdapterNeonProxyApi = {
6107
6290
  }
6108
6291
  };
6109
6292
 
6293
+ // src/apis/platform/adapter/integrations/shopify/api.ts
6294
+ var platformAdapterShopifyApi = {
6295
+ events: {
6296
+ subscribe(payload, authorization) {
6297
+ return __async(this, null, function* () {
6298
+ yield platformAdapterClientInstance.post(
6299
+ `/integrations/shopify/events/subscribe`,
6300
+ payload,
6301
+ getShopifyClientConfig(authorization)
6302
+ );
6303
+ });
6304
+ },
6305
+ unsubscribe(payload, authorization) {
6306
+ return __async(this, null, function* () {
6307
+ yield platformAdapterClientInstance.post(
6308
+ `/integrations/shopify/events/unsubscribe`,
6309
+ payload,
6310
+ getShopifyClientConfig(authorization)
6311
+ );
6312
+ });
6313
+ }
6314
+ }
6315
+ };
6316
+
6317
+ // src/apis/platform/adapter/integrations/text/api.ts
6318
+ var platformAdapterTextApi = {
6319
+ events: {
6320
+ subscribe(payload, authorization) {
6321
+ return __async(this, null, function* () {
6322
+ yield platformAdapterClientInstance.post(
6323
+ `/integrations/text/events/subscribe`,
6324
+ payload,
6325
+ getTextClientConfig(authorization)
6326
+ );
6327
+ });
6328
+ },
6329
+ unsubscribe(payload, authorization) {
6330
+ return __async(this, null, function* () {
6331
+ yield platformAdapterClientInstance.post(
6332
+ `/integrations/text/events/unsubscribe`,
6333
+ payload,
6334
+ getTextClientConfig(authorization)
6335
+ );
6336
+ });
6337
+ }
6338
+ }
6339
+ };
6340
+
6110
6341
  // src/apis/platform/adapter/integrations/api.ts
6111
- var platformAdapterIntegrationsProxyApi = {
6112
- neon: platformAdapterNeonProxyApi
6342
+ var platformAdapterIntegrationsApi = {
6343
+ neon: platformAdapterNeonProxyApi,
6344
+ text: platformAdapterTextApi,
6345
+ mailchimp: platformAdapterMailchimpApi,
6346
+ shopify: platformAdapterShopifyApi
6113
6347
  };
6114
6348
 
6115
6349
  // src/apis/platform/adapter/api.ts
6116
6350
  var platformAdapterApi = {
6117
6351
  app: platformAdapterAppApi,
6118
- proxy: platformAdapterIntegrationsProxyApi,
6352
+ integrations: platformAdapterIntegrationsApi,
6119
6353
  log(payload, authorization) {
6120
6354
  return __async(this, null, function* () {
6121
6355
  return platformAdapterClientInstance.post(
@@ -6297,7 +6531,10 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
6297
6531
  DpsApiError,
6298
6532
  LivechatApiError,
6299
6533
  MailchimpApiError,
6534
+ MailchimpEvents,
6300
6535
  ShopifyApiError,
6536
+ ShopifyEvents,
6537
+ TextLivechatEvents,
6301
6538
  UnauthorizeApiError,
6302
6539
  WorkflowDefinitionTaskType,
6303
6540
  allAppTemplates,
@@ -6356,8 +6593,10 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
6356
6593
  initShopifyClient,
6357
6594
  initTextClient,
6358
6595
  initVercelClient,
6596
+ integrationEventsZods,
6359
6597
  livechatClientInstance,
6360
6598
  mailchimpClientInstance,
6599
+ mailchimpEventsZods,
6361
6600
  neonClientInstance,
6362
6601
  netlifyClientInstance,
6363
6602
  planetScaleClientInstance,
@@ -6366,7 +6605,9 @@ function getIntegrationFlowUrl(provider, flow, data, context, config) {
6366
6605
  platformBillingClientInstance,
6367
6606
  platformDpsClientInstance,
6368
6607
  shopifyClientInstance,
6608
+ shopifyEventsZods,
6369
6609
  textClientInstance,
6610
+ textLivechatEventsZods,
6370
6611
  updateGithubClient,
6371
6612
  updateMailchimpClient,
6372
6613
  updateNeonClient,