@livechat/developer-studio-api 3.3.6 → 3.3.8
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.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +17 -45
- package/dist/index.mjs +17 -45
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6527,7 +6527,6 @@ declare const api: {
|
|
|
6527
6527
|
unregisterWebhooks(clientId?: string | undefined, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
|
|
6528
6528
|
registerWebhook(webhook: LivechatWebhook, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
|
|
6529
6529
|
registerWebhooks(webhooks: LivechatWebhook[], authorization?: PlatformClientAuthorization | undefined): Promise<void>;
|
|
6530
|
-
migrateWebhooks(webhooks: LivechatWebhook[], clientId: string, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
|
|
6531
6530
|
getLicenseWebhooksList(isAgent: boolean, authorization?: PlatformClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any> | {
|
|
6532
6531
|
data: LivechatWebhookDto[];
|
|
6533
6532
|
}>;
|
|
@@ -6817,6 +6816,9 @@ declare const api: {
|
|
|
6817
6816
|
token: string;
|
|
6818
6817
|
}>;
|
|
6819
6818
|
};
|
|
6819
|
+
openai: {
|
|
6820
|
+
verifyToken(token: string): Promise<boolean>;
|
|
6821
|
+
};
|
|
6820
6822
|
text: {
|
|
6821
6823
|
app: {
|
|
6822
6824
|
monitoring: {
|
package/dist/index.d.ts
CHANGED
|
@@ -6527,7 +6527,6 @@ declare const api: {
|
|
|
6527
6527
|
unregisterWebhooks(clientId?: string | undefined, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
|
|
6528
6528
|
registerWebhook(webhook: LivechatWebhook, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
|
|
6529
6529
|
registerWebhooks(webhooks: LivechatWebhook[], authorization?: PlatformClientAuthorization | undefined): Promise<void>;
|
|
6530
|
-
migrateWebhooks(webhooks: LivechatWebhook[], clientId: string, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
|
|
6531
6530
|
getLicenseWebhooksList(isAgent: boolean, authorization?: PlatformClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any> | {
|
|
6532
6531
|
data: LivechatWebhookDto[];
|
|
6533
6532
|
}>;
|
|
@@ -6817,6 +6816,9 @@ declare const api: {
|
|
|
6817
6816
|
token: string;
|
|
6818
6817
|
}>;
|
|
6819
6818
|
};
|
|
6819
|
+
openai: {
|
|
6820
|
+
verifyToken(token: string): Promise<boolean>;
|
|
6821
|
+
};
|
|
6820
6822
|
text: {
|
|
6821
6823
|
app: {
|
|
6822
6824
|
monitoring: {
|
package/dist/index.js
CHANGED
|
@@ -4782,6 +4782,21 @@ var bigcommerceApi = {
|
|
|
4782
4782
|
}
|
|
4783
4783
|
};
|
|
4784
4784
|
|
|
4785
|
+
// src/apis/integrations/openai/api.ts
|
|
4786
|
+
var import_axios25 = __toESM(require("axios"));
|
|
4787
|
+
var openaiApi = {
|
|
4788
|
+
verifyToken(token) {
|
|
4789
|
+
return __async(this, null, function* () {
|
|
4790
|
+
const response = yield import_axios25.default.get("https://api.openai.com/v1/models", {
|
|
4791
|
+
headers: {
|
|
4792
|
+
Authorization: `Bearer ${token}`
|
|
4793
|
+
}
|
|
4794
|
+
});
|
|
4795
|
+
return Boolean(response.data);
|
|
4796
|
+
});
|
|
4797
|
+
}
|
|
4798
|
+
};
|
|
4799
|
+
|
|
4785
4800
|
// src/apis/integrations/api.ts
|
|
4786
4801
|
var integrationsApi = {
|
|
4787
4802
|
github: gitHubApi,
|
|
@@ -4793,6 +4808,7 @@ var integrationsApi = {
|
|
|
4793
4808
|
planetscale: planetscaleApi,
|
|
4794
4809
|
hubspot: hubspotApi,
|
|
4795
4810
|
bigommerce: bigcommerceApi,
|
|
4811
|
+
openai: openaiApi,
|
|
4796
4812
|
text: textApi
|
|
4797
4813
|
};
|
|
4798
4814
|
|
|
@@ -4950,7 +4966,7 @@ var appTemplates = {
|
|
|
4950
4966
|
name: "Nextjs SaaS boilerplate",
|
|
4951
4967
|
category: { name: "Agent App Widget" },
|
|
4952
4968
|
description: "CRM-like app with key-value storage and simple UI. Authorization and payments fully set up.",
|
|
4953
|
-
tags: ["UI", "Auth", "
|
|
4969
|
+
tags: ["UI", "Auth", "Payments", "Analytics"],
|
|
4954
4970
|
template: true,
|
|
4955
4971
|
manifest: {
|
|
4956
4972
|
name: "Nextjs SaaS boilerplate",
|
|
@@ -4966,11 +4982,6 @@ var appTemplates = {
|
|
|
4966
4982
|
provider: "vercel",
|
|
4967
4983
|
url: ""
|
|
4968
4984
|
},
|
|
4969
|
-
storage: {
|
|
4970
|
-
provider: "neon",
|
|
4971
|
-
databaseName: "",
|
|
4972
|
-
isSeeded: true
|
|
4973
|
-
},
|
|
4974
4985
|
authorization: {
|
|
4975
4986
|
type: "javascript_app",
|
|
4976
4987
|
redirectUri: ""
|
|
@@ -5521,45 +5532,6 @@ var livechatWebhookApi = {
|
|
|
5521
5532
|
}
|
|
5522
5533
|
});
|
|
5523
5534
|
},
|
|
5524
|
-
migrateWebhooks(webhooks, clientId, authorization) {
|
|
5525
|
-
return __async(this, null, function* () {
|
|
5526
|
-
try {
|
|
5527
|
-
const webhooksToCheck = webhooks.map((webhook) => {
|
|
5528
|
-
return {
|
|
5529
|
-
api_version: "3.2",
|
|
5530
|
-
action: webhook.action,
|
|
5531
|
-
filters: webhook.filters
|
|
5532
|
-
};
|
|
5533
|
-
});
|
|
5534
|
-
const { data: verifiedWebhooks } = yield livechatClientInstance.post(
|
|
5535
|
-
`/v3.3/configuration/action/check_webhooks_migration`,
|
|
5536
|
-
[...webhooksToCheck],
|
|
5537
|
-
getLiveChatClientConfig(authorization)
|
|
5538
|
-
);
|
|
5539
|
-
const updatedWebhooks = webhooks.map((webhook, index) => {
|
|
5540
|
-
return __spreadProps(__spreadValues({}, webhook), {
|
|
5541
|
-
action: verifiedWebhooks[index].action
|
|
5542
|
-
});
|
|
5543
|
-
});
|
|
5544
|
-
yield livechatClientInstance.post(
|
|
5545
|
-
`/v3.3/configuration/action/migrate_webhooks`,
|
|
5546
|
-
{
|
|
5547
|
-
owner_client_id: clientId,
|
|
5548
|
-
webhooks: updatedWebhooks
|
|
5549
|
-
},
|
|
5550
|
-
getLiveChatClientConfig(authorization)
|
|
5551
|
-
);
|
|
5552
|
-
} catch (error) {
|
|
5553
|
-
if (error instanceof LivechatApiError) {
|
|
5554
|
-
throw error.withCustomMessage(
|
|
5555
|
-
`Migration failed. It looks like one of the webhooks you're trying to migrate doesn't exist in the new version or exists under a different name. Migrate the webhook manually via the Configuration API.`
|
|
5556
|
-
);
|
|
5557
|
-
} else {
|
|
5558
|
-
throw error;
|
|
5559
|
-
}
|
|
5560
|
-
}
|
|
5561
|
-
});
|
|
5562
|
-
},
|
|
5563
5535
|
getLicenseWebhooksList(isAgent, authorization) {
|
|
5564
5536
|
return __async(this, null, function* () {
|
|
5565
5537
|
if (isAgent) {
|
package/dist/index.mjs
CHANGED
|
@@ -4627,6 +4627,21 @@ var bigcommerceApi = {
|
|
|
4627
4627
|
}
|
|
4628
4628
|
};
|
|
4629
4629
|
|
|
4630
|
+
// src/apis/integrations/openai/api.ts
|
|
4631
|
+
import axios23 from "axios";
|
|
4632
|
+
var openaiApi = {
|
|
4633
|
+
verifyToken(token) {
|
|
4634
|
+
return __async(this, null, function* () {
|
|
4635
|
+
const response = yield axios23.get("https://api.openai.com/v1/models", {
|
|
4636
|
+
headers: {
|
|
4637
|
+
Authorization: `Bearer ${token}`
|
|
4638
|
+
}
|
|
4639
|
+
});
|
|
4640
|
+
return Boolean(response.data);
|
|
4641
|
+
});
|
|
4642
|
+
}
|
|
4643
|
+
};
|
|
4644
|
+
|
|
4630
4645
|
// src/apis/integrations/api.ts
|
|
4631
4646
|
var integrationsApi = {
|
|
4632
4647
|
github: gitHubApi,
|
|
@@ -4638,6 +4653,7 @@ var integrationsApi = {
|
|
|
4638
4653
|
planetscale: planetscaleApi,
|
|
4639
4654
|
hubspot: hubspotApi,
|
|
4640
4655
|
bigommerce: bigcommerceApi,
|
|
4656
|
+
openai: openaiApi,
|
|
4641
4657
|
text: textApi
|
|
4642
4658
|
};
|
|
4643
4659
|
|
|
@@ -4795,7 +4811,7 @@ var appTemplates = {
|
|
|
4795
4811
|
name: "Nextjs SaaS boilerplate",
|
|
4796
4812
|
category: { name: "Agent App Widget" },
|
|
4797
4813
|
description: "CRM-like app with key-value storage and simple UI. Authorization and payments fully set up.",
|
|
4798
|
-
tags: ["UI", "Auth", "
|
|
4814
|
+
tags: ["UI", "Auth", "Payments", "Analytics"],
|
|
4799
4815
|
template: true,
|
|
4800
4816
|
manifest: {
|
|
4801
4817
|
name: "Nextjs SaaS boilerplate",
|
|
@@ -4811,11 +4827,6 @@ var appTemplates = {
|
|
|
4811
4827
|
provider: "vercel",
|
|
4812
4828
|
url: ""
|
|
4813
4829
|
},
|
|
4814
|
-
storage: {
|
|
4815
|
-
provider: "neon",
|
|
4816
|
-
databaseName: "",
|
|
4817
|
-
isSeeded: true
|
|
4818
|
-
},
|
|
4819
4830
|
authorization: {
|
|
4820
4831
|
type: "javascript_app",
|
|
4821
4832
|
redirectUri: ""
|
|
@@ -5366,45 +5377,6 @@ var livechatWebhookApi = {
|
|
|
5366
5377
|
}
|
|
5367
5378
|
});
|
|
5368
5379
|
},
|
|
5369
|
-
migrateWebhooks(webhooks, clientId, authorization) {
|
|
5370
|
-
return __async(this, null, function* () {
|
|
5371
|
-
try {
|
|
5372
|
-
const webhooksToCheck = webhooks.map((webhook) => {
|
|
5373
|
-
return {
|
|
5374
|
-
api_version: "3.2",
|
|
5375
|
-
action: webhook.action,
|
|
5376
|
-
filters: webhook.filters
|
|
5377
|
-
};
|
|
5378
|
-
});
|
|
5379
|
-
const { data: verifiedWebhooks } = yield livechatClientInstance.post(
|
|
5380
|
-
`/v3.3/configuration/action/check_webhooks_migration`,
|
|
5381
|
-
[...webhooksToCheck],
|
|
5382
|
-
getLiveChatClientConfig(authorization)
|
|
5383
|
-
);
|
|
5384
|
-
const updatedWebhooks = webhooks.map((webhook, index) => {
|
|
5385
|
-
return __spreadProps(__spreadValues({}, webhook), {
|
|
5386
|
-
action: verifiedWebhooks[index].action
|
|
5387
|
-
});
|
|
5388
|
-
});
|
|
5389
|
-
yield livechatClientInstance.post(
|
|
5390
|
-
`/v3.3/configuration/action/migrate_webhooks`,
|
|
5391
|
-
{
|
|
5392
|
-
owner_client_id: clientId,
|
|
5393
|
-
webhooks: updatedWebhooks
|
|
5394
|
-
},
|
|
5395
|
-
getLiveChatClientConfig(authorization)
|
|
5396
|
-
);
|
|
5397
|
-
} catch (error) {
|
|
5398
|
-
if (error instanceof LivechatApiError) {
|
|
5399
|
-
throw error.withCustomMessage(
|
|
5400
|
-
`Migration failed. It looks like one of the webhooks you're trying to migrate doesn't exist in the new version or exists under a different name. Migrate the webhook manually via the Configuration API.`
|
|
5401
|
-
);
|
|
5402
|
-
} else {
|
|
5403
|
-
throw error;
|
|
5404
|
-
}
|
|
5405
|
-
}
|
|
5406
|
-
});
|
|
5407
|
-
},
|
|
5408
5380
|
getLicenseWebhooksList(isAgent, authorization) {
|
|
5409
5381
|
return __async(this, null, function* () {
|
|
5410
5382
|
if (isAgent) {
|